makecc 0.2.16 → 0.2.18
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-Dlx6ST3a.css → index-1V3GQ_8q.css} +1 -1
- package/dist/client/assets/index-j_MJWOjN.js +67 -0
- package/dist/client/index.html +2 -2
- package/dist/server/index.js +11 -6
- package/dist/server/services/claudeCliService.js +1 -1
- package/dist/server/services/claudeService.js +1 -1
- package/dist/server/services/configLoaderService.js +10 -46
- package/dist/server/services/nodeSyncService.js +18 -41
- package/dist/server/services/terminalService.js +1 -1
- package/dist/server/services/workflowAIService.js +169 -25
- package/dist/server/services/workflowExecutionService.js +2 -2
- package/package.json +1 -1
- package/server/index.ts +13 -6
- package/server/services/claudeCliService.ts +1 -1
- package/server/services/claudeService.ts +1 -1
- package/server/services/configLoaderService.ts +13 -62
- package/server/services/nodeSyncService.ts +20 -50
- package/server/services/terminalService.ts +1 -1
- package/server/services/workflowAIService.ts +213 -27
- package/server/services/workflowExecutionService.ts +2 -2
- package/server/types.ts +1 -1
- package/dist/client/assets/index-Bir6nP2a.js +0 -150
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&l(c)}).observe(document,{childList:!0,subtree:!0});function i(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function l(o){if(o.ep)return;o.ep=!0;const s=i(o);fetch(o.href,s)}})();function Fu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jd={exports:{}},Ya={};var _y;function pk(){if(_y)return Ya;_y=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(l,o,s){var c=null;if(s!==void 0&&(c=""+s),o.key!==void 0&&(c=""+o.key),"key"in o){s={};for(var f in o)f!=="key"&&(s[f]=o[f])}else s=o;return o=s.ref,{$$typeof:e,type:l,key:c,ref:o!==void 0?o:null,props:s}}return Ya.Fragment=n,Ya.jsx=i,Ya.jsxs=i,Ya}var Cy;function mk(){return Cy||(Cy=1,jd.exports=pk()),jd.exports}var b=mk(),Dd={exports:{}},_e={};var Ty;function gk(){if(Ty)return _e;Ty=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),x=Symbol.iterator;function v(O){return O===null||typeof O!="object"?null:(O=x&&O[x]||O["@@iterator"],typeof O=="function"?O:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,C={};function N(O,$,z){this.props=O,this.context=$,this.refs=C,this.updater=z||S}N.prototype.isReactComponent={},N.prototype.setState=function(O,$){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,$,"setState")},N.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function _(){}_.prototype=N.prototype;function k(O,$,z){this.props=O,this.context=$,this.refs=C,this.updater=z||S}var A=k.prototype=new _;A.constructor=k,E(A,N.prototype),A.isPureReactComponent=!0;var B=Array.isArray;function T(){}var L={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function Z(O,$,z){var ne=z.ref;return{$$typeof:e,type:O,key:$,ref:ne!==void 0?ne:null,props:z}}function H(O,$){return Z(O.type,$,O.props)}function U(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function Y(O){var $={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(z){return $[z]})}var ee=/\/+/g;function R(O,$){return typeof O=="object"&&O!==null&&O.key!=null?Y(""+O.key):$.toString(36)}function I(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(T,T):(O.status="pending",O.then(function($){O.status==="pending"&&(O.status="fulfilled",O.value=$)},function($){O.status==="pending"&&(O.status="rejected",O.reason=$)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function D(O,$,z,ne,ue){var ce=typeof O;(ce==="undefined"||ce==="boolean")&&(O=null);var de=!1;if(O===null)de=!0;else switch(ce){case"bigint":case"string":case"number":de=!0;break;case"object":switch(O.$$typeof){case e:case n:de=!0;break;case g:return de=O._init,D(de(O._payload),$,z,ne,ue)}}if(de)return ue=ue(O),de=ne===""?"."+R(O,0):ne,B(ue)?(z="",de!=null&&(z=de.replace(ee,"$&/")+"/"),D(ue,$,z,"",function(ke){return ke})):ue!=null&&(U(ue)&&(ue=H(ue,z+(ue.key==null||O&&O.key===ue.key?"":(""+ue.key).replace(ee,"$&/")+"/")+de)),$.push(ue)),1;de=0;var se=ne===""?".":ne+":";if(B(O))for(var pe=0;pe<O.length;pe++)ne=O[pe],ce=se+R(ne,pe),de+=D(ne,$,z,ce,ue);else if(pe=v(O),typeof pe=="function")for(O=pe.call(O),pe=0;!(ne=O.next()).done;)ne=ne.value,ce=se+R(ne,pe++),de+=D(ne,$,z,ce,ue);else if(ce==="object"){if(typeof O.then=="function")return D(I(O),$,z,ne,ue);throw $=String(O),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return de}function q(O,$,z){if(O==null)return O;var ne=[],ue=0;return D(O,ne,"","",function(ce){return $.call(z,ce,ue++)}),ne}function X(O){if(O._status===-1){var $=O._result;$=$(),$.then(function(z){(O._status===0||O._status===-1)&&(O._status=1,O._result=z)},function(z){(O._status===0||O._status===-1)&&(O._status=2,O._result=z)}),O._status===-1&&(O._status=0,O._result=$)}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 $=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($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},j={map:q,forEach:function(O,$,z){q(O,function(){$.apply(this,arguments)},z)},count:function(O){var $=0;return q(O,function(){$++}),$},toArray:function(O){return q(O,function($){return $})||[]},only:function(O){if(!U(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return _e.Activity=m,_e.Children=j,_e.Component=N,_e.Fragment=i,_e.Profiler=o,_e.PureComponent=k,_e.StrictMode=l,_e.Suspense=h,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,_e.__COMPILER_RUNTIME={__proto__:null,c:function(O){return L.H.useMemoCache(O)}},_e.cache=function(O){return function(){return O.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(O,$,z){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ne=E({},O.props),ue=O.key;if($!=null)for(ce in $.key!==void 0&&(ue=""+$.key),$)!P.call($,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&$.ref===void 0||(ne[ce]=$[ce]);var ce=arguments.length-2;if(ce===1)ne.children=z;else if(1<ce){for(var de=Array(ce),se=0;se<ce;se++)de[se]=arguments[se+2];ne.children=de}return Z(O.type,ue,ne)},_e.createContext=function(O){return O={$$typeof:c,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:s,_context:O},O},_e.createElement=function(O,$,z){var ne,ue={},ce=null;if($!=null)for(ne in $.key!==void 0&&(ce=""+$.key),$)P.call($,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(ue[ne]=$[ne]);var de=arguments.length-2;if(de===1)ue.children=z;else if(1<de){for(var se=Array(de),pe=0;pe<de;pe++)se[pe]=arguments[pe+2];ue.children=se}if(O&&O.defaultProps)for(ne in de=O.defaultProps,de)ue[ne]===void 0&&(ue[ne]=de[ne]);return Z(O,ce,ue)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(O){return{$$typeof:f,render:O}},_e.isValidElement=U,_e.lazy=function(O){return{$$typeof:g,_payload:{_status:-1,_result:O},_init:X}},_e.memo=function(O,$){return{$$typeof:d,type:O,compare:$===void 0?null:$}},_e.startTransition=function(O){var $=L.T,z={};L.T=z;try{var ne=O(),ue=L.S;ue!==null&&ue(z,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(T,K)}catch(ce){K(ce)}finally{$!==null&&z.types!==null&&($.types=z.types),L.T=$}},_e.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},_e.use=function(O){return L.H.use(O)},_e.useActionState=function(O,$,z){return L.H.useActionState(O,$,z)},_e.useCallback=function(O,$){return L.H.useCallback(O,$)},_e.useContext=function(O){return L.H.useContext(O)},_e.useDebugValue=function(){},_e.useDeferredValue=function(O,$){return L.H.useDeferredValue(O,$)},_e.useEffect=function(O,$){return L.H.useEffect(O,$)},_e.useEffectEvent=function(O){return L.H.useEffectEvent(O)},_e.useId=function(){return L.H.useId()},_e.useImperativeHandle=function(O,$,z){return L.H.useImperativeHandle(O,$,z)},_e.useInsertionEffect=function(O,$){return L.H.useInsertionEffect(O,$)},_e.useLayoutEffect=function(O,$){return L.H.useLayoutEffect(O,$)},_e.useMemo=function(O,$){return L.H.useMemo(O,$)},_e.useOptimistic=function(O,$){return L.H.useOptimistic(O,$)},_e.useReducer=function(O,$,z){return L.H.useReducer(O,$,z)},_e.useRef=function(O){return L.H.useRef(O)},_e.useState=function(O){return L.H.useState(O)},_e.useSyncExternalStore=function(O,$,z){return L.H.useSyncExternalStore(O,$,z)},_e.useTransition=function(){return L.H.useTransition()},_e.version="19.2.3",_e}var Ay;function ko(){return Ay||(Ay=1,Dd.exports=gk()),Dd.exports}var G=ko();const Ja=Fu(G);var Od={exports:{}},$a={},Rd={exports:{}},Ld={};var My;function yk(){return My||(My=1,(function(e){function n(D,q){var X=D.length;D.push(q);e:for(;0<X;){var K=X-1>>>1,j=D[K];if(0<o(j,q))D[K]=q,D[X]=j,X=K;else break e}}function i(D){return D.length===0?null:D[0]}function l(D){if(D.length===0)return null;var q=D[0],X=D.pop();if(X!==q){D[0]=X;e:for(var K=0,j=D.length,O=j>>>1;K<O;){var $=2*(K+1)-1,z=D[$],ne=$+1,ue=D[ne];if(0>o(z,X))ne<j&&0>o(ue,z)?(D[K]=ue,D[ne]=X,K=ne):(D[K]=z,D[$]=X,K=$);else if(ne<j&&0>o(ue,X))D[K]=ue,D[ne]=X,K=ne;else break e}}return q}function o(D,q){var X=D.sortIndex-q.sortIndex;return X!==0?X:D.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var h=[],d=[],g=1,m=null,x=3,v=!1,S=!1,E=!1,C=!1,N=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function A(D){for(var q=i(d);q!==null;){if(q.callback===null)l(d);else if(q.startTime<=D)l(d),q.sortIndex=q.expirationTime,n(h,q);else break;q=i(d)}}function B(D){if(E=!1,A(D),!S)if(i(h)!==null)S=!0,T||(T=!0,Y());else{var q=i(d);q!==null&&I(B,q.startTime-D)}}var T=!1,L=-1,P=5,Z=-1;function H(){return C?!0:!(e.unstable_now()-Z<P)}function U(){if(C=!1,T){var D=e.unstable_now();Z=D;var q=!0;try{e:{S=!1,E&&(E=!1,_(L),L=-1),v=!0;var X=x;try{t:{for(A(D),m=i(h);m!==null&&!(m.expirationTime>D&&H());){var K=m.callback;if(typeof K=="function"){m.callback=null,x=m.priorityLevel;var j=K(m.expirationTime<=D);if(D=e.unstable_now(),typeof j=="function"){m.callback=j,A(D),q=!0;break t}m===i(h)&&l(h),A(D)}else l(h);m=i(h)}if(m!==null)q=!0;else{var O=i(d);O!==null&&I(B,O.startTime-D),q=!1}}break e}finally{m=null,x=X,v=!1}q=void 0}}finally{q?Y():T=!1}}}var Y;if(typeof k=="function")Y=function(){k(U)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,R=ee.port2;ee.port1.onmessage=U,Y=function(){R.postMessage(null)}}else Y=function(){N(U,0)};function I(D,q){L=N(function(){D(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(D){switch(x){case 1:case 2:case 3:var q=3;break;default:q=x}var X=x;x=q;try{return D()}finally{x=X}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(D,q){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var X=x;x=D;try{return q()}finally{x=X}},e.unstable_scheduleCallback=function(D,q,X){var K=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?K+X:K):X=K,D){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=X+j,D={id:g++,callback:q,priorityLevel:D,startTime:X,expirationTime:j,sortIndex:-1},X>K?(D.sortIndex=X,n(d,D),i(h)===null&&D===i(d)&&(E?(_(L),L=-1):E=!0,I(B,X-K))):(D.sortIndex=j,n(h,D),S||v||(S=!0,T||(T=!0,Y()))),D},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(D){var q=x;return function(){var X=x;x=q;try{return D.apply(this,arguments)}finally{x=X}}}})(Ld)),Ld}var zy;function xk(){return zy||(zy=1,Rd.exports=yk()),Rd.exports}var Bd={exports:{}},Rt={};var jy;function bk(){if(jy)return Rt;jy=1;var e=ko();function n(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var l={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal");function s(h,d,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:m==null?null:""+m,children:h,containerInfo:d,implementation:g}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Rt.createPortal=function(h,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(n(299));return s(h,d,null,g)},Rt.flushSync=function(h){var d=c.T,g=l.p;try{if(c.T=null,l.p=2,h)return h()}finally{c.T=d,l.p=g,l.d.f()}},Rt.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,l.d.C(h,d))},Rt.prefetchDNS=function(h){typeof h=="string"&&l.d.D(h)},Rt.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var g=d.as,m=f(g,d.crossOrigin),x=typeof d.integrity=="string"?d.integrity:void 0,v=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?l.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:x,fetchPriority:v}):g==="script"&&l.d.X(h,{crossOrigin:m,integrity:x,fetchPriority:v,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Rt.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=f(d.as,d.crossOrigin);l.d.M(h,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&l.d.M(h)},Rt.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,m=f(g,d.crossOrigin);l.d.L(h,g,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Rt.preloadModule=function(h,d){if(typeof h=="string")if(d){var g=f(d.as,d.crossOrigin);l.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else l.d.m(h)},Rt.requestFormReset=function(h){l.d.r(h)},Rt.unstable_batchedUpdates=function(h,d){return h(d)},Rt.useFormState=function(h,d,g){return c.H.useFormState(h,d,g)},Rt.useFormStatus=function(){return c.H.useHostTransitionStatus()},Rt.version="19.2.3",Rt}var Dy;function $1(){if(Dy)return Bd.exports;Dy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Bd.exports=bk(),Bd.exports}var Oy;function vk(){if(Oy)return $a;Oy=1;var e=xk(),n=ko(),i=$1();function l(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function s(t){var r=t,a=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(a=r.return),t=r.return;while(t)}return r.tag===3?a:null}function c(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function f(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function h(t){if(s(t)!==t)throw Error(l(188))}function d(t){var r=t.alternate;if(!r){if(r=s(t),r===null)throw Error(l(188));return r!==t?null:t}for(var a=t,u=r;;){var p=a.return;if(p===null)break;var y=p.alternate;if(y===null){if(u=p.return,u!==null){a=u;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===a)return h(p),t;if(y===u)return h(p),r;y=y.sibling}throw Error(l(188))}if(a.return!==u.return)a=p,u=y;else{for(var w=!1,M=p.child;M;){if(M===a){w=!0,a=p,u=y;break}if(M===u){w=!0,u=p,a=y;break}M=M.sibling}if(!w){for(M=y.child;M;){if(M===a){w=!0,a=y,u=p;break}if(M===u){w=!0,u=y,a=p;break}M=M.sibling}if(!w)throw Error(l(189))}}if(a.alternate!==u)throw Error(l(190))}if(a.tag!==3)throw Error(l(188));return a.stateNode.current===a?t:r}function g(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=g(t),r!==null)return r;t=t.sibling}return null}var m=Object.assign,x=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),k=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function Y(t){return t===null||typeof t!="object"?null:(t=U&&t[U]||t["@@iterator"],typeof t=="function"?t:null)}var ee=Symbol.for("react.client.reference");function R(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===ee?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case E:return"Fragment";case N:return"Profiler";case C:return"StrictMode";case B:return"Suspense";case T:return"SuspenseList";case Z:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case S:return"Portal";case k:return t.displayName||"Context";case _:return(t._context.displayName||"Context")+".Consumer";case A:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case L:return r=t.displayName||null,r!==null?r:R(t.type)||"Memo";case P:r=t._payload,t=t._init;try{return R(t(r))}catch{}}return null}var I=Array.isArray,D=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},K=[],j=-1;function O(t){return{current:t}}function $(t){0>j||(t.current=K[j],K[j]=null,j--)}function z(t,r){j++,K[j]=t.current,t.current=r}var ne=O(null),ue=O(null),ce=O(null),de=O(null);function se(t,r){switch(z(ce,r),z(ue,t),z(ne,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?Z0(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=Z0(r),t=Q0(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}$(ne),z(ne,t)}function pe(){$(ne),$(ue),$(ce)}function ke(t){t.memoizedState!==null&&z(de,t);var r=ne.current,a=Q0(r,t.type);r!==a&&(z(ue,t),z(ne,a))}function Ne(t){ue.current===t&&($(ne),$(ue)),de.current===t&&($(de),Ua._currentValue=X)}var be,Ee;function je(t){if(be===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);be=r&&r[1]||"",Ee=-1<a.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+be+t+Ee}var Fe=!1;function Ye(t,r){if(!t||Fe)return"";Fe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(r){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(ie){var te=ie}Reflect.construct(t,[],oe)}else{try{oe.call()}catch(ie){te=ie}t.call(oe.prototype)}}else{try{throw Error()}catch(ie){te=ie}(oe=t())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(ie){if(ie&&te&&typeof ie.stack=="string")return[ie.stack,te.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=u.DetermineComponentFrameRoot(),w=y[0],M=y[1];if(w&&M){var V=w.split(`
|
|
4
|
+
`),W=M.split(`
|
|
5
|
+
`);for(p=u=0;u<V.length&&!V[u].includes("DetermineComponentFrameRoot");)u++;for(;p<W.length&&!W[p].includes("DetermineComponentFrameRoot");)p++;if(u===V.length||p===W.length)for(u=V.length-1,p=W.length-1;1<=u&&0<=p&&V[u]!==W[p];)p--;for(;1<=u&&0<=p;u--,p--)if(V[u]!==W[p]){if(u!==1||p!==1)do if(u--,p--,0>p||V[u]!==W[p]){var le=`
|
|
6
|
+
`+V[u].replace(" at new "," at ");return t.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",t.displayName)),le}while(1<=u&&0<=p);break}}}finally{Fe=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?je(a):""}function ct(t,r){switch(t.tag){case 26:case 27:case 5:return je(t.type);case 16:return je("Lazy");case 13:return t.child!==r&&r!==null?je("Suspense Fallback"):je("Suspense");case 19:return je("SuspenseList");case 0:case 15:return Ye(t.type,!1);case 11:return Ye(t.type.render,!1);case 1:return Ye(t.type,!0);case 31:return je("Activity");default:return""}}function en(t){try{var r="",a=null;do r+=ct(t,a),a=t,t=t.return;while(t);return r}catch(u){return`
|
|
7
|
+
Error generating stack: `+u.message+`
|
|
8
|
+
`+u.stack}}var jt=Object.prototype.hasOwnProperty,Vt=e.unstable_scheduleCallback,En=e.unstable_cancelCallback,Jn=e.unstable_shouldYield,Wn=e.unstable_requestPaint,St=e.unstable_now,Ci=e.unstable_getCurrentPriorityLevel,re=e.unstable_ImmediatePriority,he=e.unstable_UserBlockingPriority,we=e.unstable_NormalPriority,ze=e.unstable_LowPriority,Ie=e.unstable_IdlePriority,Ht=e.log,Nn=e.unstable_setDisableYieldValue,Ct=null,ft=null;function Dt(t){if(typeof Ht=="function"&&Nn(t),ft&&typeof ft.setStrictMode=="function")try{ft.setStrictMode(Ct,t)}catch{}}var Pe=Math.clz32?Math.clz32:bc,Bn=Math.log,tn=Math.LN2;function bc(t){return t>>>=0,t===0?32:31-(Bn(t)/tn|0)|0}var Ir=256,qr=262144,Vr=4194304;function ei(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Yr(t,r,a){var u=t.pendingLanes;if(u===0)return 0;var p=0,y=t.suspendedLanes,w=t.pingedLanes;t=t.warmLanes;var M=u&134217727;return M!==0?(u=M&~y,u!==0?p=ei(u):(w&=M,w!==0?p=ei(w):a||(a=M&~t,a!==0&&(p=ei(a))))):(M=u&~y,M!==0?p=ei(M):w!==0?p=ei(w):a||(a=u&~t,a!==0&&(p=ei(a)))),p===0?0:r!==0&&r!==p&&(r&y)===0&&(y=p&-p,a=r&-r,y>=a||y===32&&(a&4194048)!==0)?r:p}function sr(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function vc(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ro(){var t=Vr;return Vr<<=1,(Vr&62914560)===0&&(Vr=4194304),t}function Ql(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function ur(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function wc(t,r,a,u,p,y){var w=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var M=t.entanglements,V=t.expirationTimes,W=t.hiddenUpdates;for(a=w&~a;0<a;){var le=31-Pe(a),oe=1<<le;M[le]=0,V[le]=-1;var te=W[le];if(te!==null)for(W[le]=null,le=0;le<te.length;le++){var ie=te[le];ie!==null&&(ie.lane&=-536870913)}a&=~oe}u!==0&&Lo(t,u,0),y!==0&&p===0&&t.tag!==0&&(t.suspendedLanes|=y&~(w&~r))}function Lo(t,r,a){t.pendingLanes|=r,t.suspendedLanes&=~r;var u=31-Pe(r);t.entangledLanes|=r,t.entanglements[u]=t.entanglements[u]|1073741824|a&261930}function Bo(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var u=31-Pe(a),p=1<<u;p&r|t[u]&r&&(t[u]|=r),a&=~p}}function Ho(t,r){var a=r&-r;return a=(a&42)!==0?1:Kl(a),(a&(t.suspendedLanes|r))!==0?0:a}function Kl(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Jl(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Uo(){var t=q.p;return t!==0?t:(t=window.event,t===void 0?32:by(t.type))}function Io(t,r){var a=q.p;try{return q.p=t,r()}finally{q.p=a}}var Hn=Math.random().toString(36).slice(2),kt="__reactFiber$"+Hn,Ot="__reactProps$"+Hn,ti="__reactContainer$"+Hn,$r="__reactEvents$"+Hn,qo="__reactListeners$"+Hn,Sc="__reactHandles$"+Hn,Vo="__reactResources$"+Hn,cr="__reactMarker$"+Hn;function Wl(t){delete t[kt],delete t[Ot],delete t[$r],delete t[qo],delete t[Sc]}function Ti(t){var r=t[kt];if(r)return r;for(var a=t.parentNode;a;){if(r=a[ti]||a[kt]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=iy(t);t!==null;){if(a=t[kt])return a;t=iy(t)}return r}t=a,a=t.parentNode}return null}function Ai(t){if(t=t[kt]||t[ti]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function Mi(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(l(33))}function zi(t){var r=t[Vo];return r||(r=t[Vo]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function pt(t){t[cr]=!0}var Yo=new Set,$o={};function ni(t,r){ji(t,r),ji(t+"Capture",r)}function ji(t,r){for($o[t]=r,t=0;t<r.length;t++)Yo.add(r[t])}var kc=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]*$"),ea={},Xo={};function Ec(t){return jt.call(Xo,t)?!0:jt.call(ea,t)?!1:kc.test(t)?Xo[t]=!0:(ea[t]=!0,!1)}function Xr(t,r,a){if(Ec(r))if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var u=r.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+a)}}function Fr(t,r,a){if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+a)}}function _n(t,r,a,u){if(u===null)t.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(r,a,""+u)}}function Yt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Fo(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Nc(t,r,a){var u=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,y=u.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return p.call(this)},set:function(w){a=""+w,y.call(this,w)}}),Object.defineProperty(t,r,{enumerable:u.enumerable}),{getValue:function(){return a},setValue:function(w){a=""+w},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Gr(t){if(!t._valueTracker){var r=Fo(t)?"checked":"value";t._valueTracker=Nc(t,r,""+t[r])}}function Go(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var a=r.getValue(),u="";return t&&(u=Fo(t)?t.checked?"true":"false":t.value),t=u,t!==a?(r.setValue(t),!0):!1}function fr(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var _c=/[\n"\\]/g;function $t(t){return t.replace(_c,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function dr(t,r,a,u,p,y,w,M){t.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?t.type=w:t.removeAttribute("type"),r!=null?w==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Yt(r)):t.value!==""+Yt(r)&&(t.value=""+Yt(r)):w!=="submit"&&w!=="reset"||t.removeAttribute("value"),r!=null?ta(t,w,Yt(r)):a!=null?ta(t,w,Yt(a)):u!=null&&t.removeAttribute("value"),p==null&&y!=null&&(t.defaultChecked=!!y),p!=null&&(t.checked=p&&typeof p!="function"&&typeof p!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?t.name=""+Yt(M):t.removeAttribute("name")}function Po(t,r,a,u,p,y,w,M){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.type=y),r!=null||a!=null){if(!(y!=="submit"&&y!=="reset"||r!=null)){Gr(t);return}a=a!=null?""+Yt(a):"",r=r!=null?""+Yt(r):a,M||r===t.value||(t.value=r),t.defaultValue=r}u=u??p,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=M?t.checked:!!u,t.defaultChecked=!!u,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.name=w),Gr(t)}function ta(t,r,a){r==="number"&&fr(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function ii(t,r,a,u){if(t=t.options,r){r={};for(var p=0;p<a.length;p++)r["$"+a[p]]=!0;for(a=0;a<t.length;a++)p=r.hasOwnProperty("$"+t[a].value),t[a].selected!==p&&(t[a].selected=p),p&&u&&(t[a].defaultSelected=!0)}else{for(a=""+Yt(a),r=null,p=0;p<t.length;p++){if(t[p].value===a){t[p].selected=!0,u&&(t[p].defaultSelected=!0);return}r!==null||t[p].disabled||(r=t[p])}r!==null&&(r.selected=!0)}}function $p(t,r,a){if(r!=null&&(r=""+Yt(r),r!==t.value&&(t.value=r),a==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=a!=null?""+Yt(a):""}function Xp(t,r,a,u){if(r==null){if(u!=null){if(a!=null)throw Error(l(92));if(I(u)){if(1<u.length)throw Error(l(93));u=u[0]}a=u}a==null&&(a=""),r=a}a=Yt(r),t.defaultValue=a,u=t.textContent,u===a&&u!==""&&u!==null&&(t.value=u),Gr(t)}function Pr(t,r){if(r){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=r;return}}t.textContent=r}var uS=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 Fp(t,r,a){var u=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?u?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":u?t.setProperty(r,a):typeof a!="number"||a===0||uS.has(r)?r==="float"?t.cssFloat=a:t[r]=(""+a).trim():t[r]=a+"px"}function Gp(t,r,a){if(r!=null&&typeof r!="object")throw Error(l(62));if(t=t.style,a!=null){for(var u in a)!a.hasOwnProperty(u)||r!=null&&r.hasOwnProperty(u)||(u.indexOf("--")===0?t.setProperty(u,""):u==="float"?t.cssFloat="":t[u]="");for(var p in r)u=r[p],r.hasOwnProperty(p)&&a[p]!==u&&Fp(t,p,u)}else for(var y in r)r.hasOwnProperty(y)&&Fp(t,y,r[y])}function Cc(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var cS=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"]]),fS=/^[\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 Zo(t){return fS.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function ri(){}var Tc=null;function Ac(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Zr=null,Qr=null;function Pp(t){var r=Ai(t);if(r&&(t=r.stateNode)){var a=t[Ot]||null;e:switch(t=r.stateNode,r.type){case"input":if(dr(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+$t(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var u=a[r];if(u!==t&&u.form===t.form){var p=u[Ot]||null;if(!p)throw Error(l(90));dr(u,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<a.length;r++)u=a[r],u.form===t.form&&Go(u)}break e;case"textarea":$p(t,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&ii(t,!!a.multiple,r,!1)}}}var Mc=!1;function Zp(t,r,a){if(Mc)return t(r,a);Mc=!0;try{var u=t(r);return u}finally{if(Mc=!1,(Zr!==null||Qr!==null)&&(Ls(),Zr&&(r=Zr,t=Qr,Qr=Zr=null,Pp(r),t)))for(r=0;r<t.length;r++)Pp(t[r])}}function na(t,r){var a=t.stateNode;if(a===null)return null;var u=a[Ot]||null;if(u===null)return null;a=u[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(t=t.type,u=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!u;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(l(231,r,typeof a));return a}var li=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zc=!1;if(li)try{var ia={};Object.defineProperty(ia,"passive",{get:function(){zc=!0}}),window.addEventListener("test",ia,ia),window.removeEventListener("test",ia,ia)}catch{zc=!1}var Di=null,jc=null,Qo=null;function Qp(){if(Qo)return Qo;var t,r=jc,a=r.length,u,p="value"in Di?Di.value:Di.textContent,y=p.length;for(t=0;t<a&&r[t]===p[t];t++);var w=a-t;for(u=1;u<=w&&r[a-u]===p[y-u];u++);return Qo=p.slice(t,1<u?1-u:void 0)}function Ko(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function Jo(){return!0}function Kp(){return!1}function Xt(t){function r(a,u,p,y,w){this._reactName=a,this._targetInst=p,this.type=u,this.nativeEvent=y,this.target=w,this.currentTarget=null;for(var M in t)t.hasOwnProperty(M)&&(a=t[M],this[M]=a?a(y):y[M]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Jo:Kp,this.isPropagationStopped=Kp,this}return m(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Jo)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Jo)},persist:function(){},isPersistent:Jo}),r}var hr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wo=Xt(hr),ra=m({},hr,{view:0,detail:0}),dS=Xt(ra),Dc,Oc,la,es=m({},ra,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Lc,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==la&&(la&&t.type==="mousemove"?(Dc=t.screenX-la.screenX,Oc=t.screenY-la.screenY):Oc=Dc=0,la=t),Dc)},movementY:function(t){return"movementY"in t?t.movementY:Oc}}),Jp=Xt(es),hS=m({},es,{dataTransfer:0}),pS=Xt(hS),mS=m({},ra,{relatedTarget:0}),Rc=Xt(mS),gS=m({},hr,{animationName:0,elapsedTime:0,pseudoElement:0}),yS=Xt(gS),xS=m({},hr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),bS=Xt(xS),vS=m({},hr,{data:0}),Wp=Xt(vS),wS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},SS={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"},kS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ES(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=kS[t])?!!r[t]:!1}function Lc(){return ES}var NS=m({},ra,{key:function(t){if(t.key){var r=wS[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Ko(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?SS[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Lc,charCode:function(t){return t.type==="keypress"?Ko(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ko(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),_S=Xt(NS),CS=m({},es,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),em=Xt(CS),TS=m({},ra,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Lc}),AS=Xt(TS),MS=m({},hr,{propertyName:0,elapsedTime:0,pseudoElement:0}),zS=Xt(MS),jS=m({},es,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),DS=Xt(jS),OS=m({},hr,{newState:0,oldState:0}),RS=Xt(OS),LS=[9,13,27,32],Bc=li&&"CompositionEvent"in window,aa=null;li&&"documentMode"in document&&(aa=document.documentMode);var BS=li&&"TextEvent"in window&&!aa,tm=li&&(!Bc||aa&&8<aa&&11>=aa),nm=" ",im=!1;function rm(t,r){switch(t){case"keyup":return LS.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Kr=!1;function HS(t,r){switch(t){case"compositionend":return lm(r);case"keypress":return r.which!==32?null:(im=!0,nm);case"textInput":return t=r.data,t===nm&&im?null:t;default:return null}}function US(t,r){if(Kr)return t==="compositionend"||!Bc&&rm(t,r)?(t=Qp(),Qo=jc=Di=null,Kr=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return tm&&r.locale!=="ko"?null:r.data;default:return null}}var IS={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 am(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!IS[t.type]:r==="textarea"}function om(t,r,a,u){Zr?Qr?Qr.push(u):Qr=[u]:Zr=u,r=Ys(r,"onChange"),0<r.length&&(a=new Wo("onChange","change",null,a,u),t.push({event:a,listeners:r}))}var oa=null,sa=null;function qS(t){Y0(t,0)}function ts(t){var r=Mi(t);if(Go(r))return t}function sm(t,r){if(t==="change")return r}var um=!1;if(li){var Hc;if(li){var Uc="oninput"in document;if(!Uc){var cm=document.createElement("div");cm.setAttribute("oninput","return;"),Uc=typeof cm.oninput=="function"}Hc=Uc}else Hc=!1;um=Hc&&(!document.documentMode||9<document.documentMode)}function fm(){oa&&(oa.detachEvent("onpropertychange",dm),sa=oa=null)}function dm(t){if(t.propertyName==="value"&&ts(sa)){var r=[];om(r,sa,t,Ac(t)),Zp(qS,r)}}function VS(t,r,a){t==="focusin"?(fm(),oa=r,sa=a,oa.attachEvent("onpropertychange",dm)):t==="focusout"&&fm()}function YS(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return ts(sa)}function $S(t,r){if(t==="click")return ts(r)}function XS(t,r){if(t==="input"||t==="change")return ts(r)}function FS(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var nn=typeof Object.is=="function"?Object.is:FS;function ua(t,r){if(nn(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var a=Object.keys(t),u=Object.keys(r);if(a.length!==u.length)return!1;for(u=0;u<a.length;u++){var p=a[u];if(!jt.call(r,p)||!nn(t[p],r[p]))return!1}return!0}function hm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function pm(t,r){var a=hm(t);t=0;for(var u;a;){if(a.nodeType===3){if(u=t+a.textContent.length,t<=r&&u>=r)return{node:a,offset:r-t};t=u}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=hm(a)}}function mm(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?mm(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function gm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=fr(t.document);r instanceof t.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)t=r.contentWindow;else break;r=fr(t.document)}return r}function Ic(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var GS=li&&"documentMode"in document&&11>=document.documentMode,Jr=null,qc=null,ca=null,Vc=!1;function ym(t,r,a){var u=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Vc||Jr==null||Jr!==fr(u)||(u=Jr,"selectionStart"in u&&Ic(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),ca&&ua(ca,u)||(ca=u,u=Ys(qc,"onSelect"),0<u.length&&(r=new Wo("onSelect","select",null,r,a),t.push({event:r,listeners:u}),r.target=Jr)))}function pr(t,r){var a={};return a[t.toLowerCase()]=r.toLowerCase(),a["Webkit"+t]="webkit"+r,a["Moz"+t]="moz"+r,a}var Wr={animationend:pr("Animation","AnimationEnd"),animationiteration:pr("Animation","AnimationIteration"),animationstart:pr("Animation","AnimationStart"),transitionrun:pr("Transition","TransitionRun"),transitionstart:pr("Transition","TransitionStart"),transitioncancel:pr("Transition","TransitionCancel"),transitionend:pr("Transition","TransitionEnd")},Yc={},xm={};li&&(xm=document.createElement("div").style,"AnimationEvent"in window||(delete Wr.animationend.animation,delete Wr.animationiteration.animation,delete Wr.animationstart.animation),"TransitionEvent"in window||delete Wr.transitionend.transition);function mr(t){if(Yc[t])return Yc[t];if(!Wr[t])return t;var r=Wr[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in xm)return Yc[t]=r[a];return t}var bm=mr("animationend"),vm=mr("animationiteration"),wm=mr("animationstart"),PS=mr("transitionrun"),ZS=mr("transitionstart"),QS=mr("transitioncancel"),Sm=mr("transitionend"),km=new Map,$c="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(" ");$c.push("scrollEnd");function Cn(t,r){km.set(t,r),ni(r,[t])}var ns=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},pn=[],el=0,Xc=0;function is(){for(var t=el,r=Xc=el=0;r<t;){var a=pn[r];pn[r++]=null;var u=pn[r];pn[r++]=null;var p=pn[r];pn[r++]=null;var y=pn[r];if(pn[r++]=null,u!==null&&p!==null){var w=u.pending;w===null?p.next=p:(p.next=w.next,w.next=p),u.pending=p}y!==0&&Em(a,p,y)}}function rs(t,r,a,u){pn[el++]=t,pn[el++]=r,pn[el++]=a,pn[el++]=u,Xc|=u,t.lanes|=u,t=t.alternate,t!==null&&(t.lanes|=u)}function Fc(t,r,a,u){return rs(t,r,a,u),ls(t)}function gr(t,r){return rs(t,null,null,r),ls(t)}function Em(t,r,a){t.lanes|=a;var u=t.alternate;u!==null&&(u.lanes|=a);for(var p=!1,y=t.return;y!==null;)y.childLanes|=a,u=y.alternate,u!==null&&(u.childLanes|=a),y.tag===22&&(t=y.stateNode,t===null||t._visibility&1||(p=!0)),t=y,y=y.return;return t.tag===3?(y=t.stateNode,p&&r!==null&&(p=31-Pe(a),t=y.hiddenUpdates,u=t[p],u===null?t[p]=[r]:u.push(r),r.lane=a|536870912),y):null}function ls(t){if(50<ja)throw ja=0,nd=null,Error(l(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var tl={};function KS(t,r,a,u){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rn(t,r,a,u){return new KS(t,r,a,u)}function Gc(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ai(t,r){var a=t.alternate;return a===null?(a=rn(t.tag,r,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=r,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,r=t.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function Nm(t,r){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,r=a.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function as(t,r,a,u,p,y){var w=0;if(u=t,typeof t=="function")Gc(t)&&(w=1);else if(typeof t=="string")w=nk(t,a,ne.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Z:return t=rn(31,a,r,p),t.elementType=Z,t.lanes=y,t;case E:return yr(a.children,p,y,r);case C:w=8,p|=24;break;case N:return t=rn(12,a,r,p|2),t.elementType=N,t.lanes=y,t;case B:return t=rn(13,a,r,p),t.elementType=B,t.lanes=y,t;case T:return t=rn(19,a,r,p),t.elementType=T,t.lanes=y,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case k:w=10;break e;case _:w=9;break e;case A:w=11;break e;case L:w=14;break e;case P:w=16,u=null;break e}w=29,a=Error(l(130,t===null?"null":typeof t,"")),u=null}return r=rn(w,a,r,p),r.elementType=t,r.type=u,r.lanes=y,r}function yr(t,r,a,u){return t=rn(7,t,u,r),t.lanes=a,t}function Pc(t,r,a){return t=rn(6,t,null,r),t.lanes=a,t}function _m(t){var r=rn(18,null,null,0);return r.stateNode=t,r}function Zc(t,r,a){return r=rn(4,t.children!==null?t.children:[],t.key,r),r.lanes=a,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var Cm=new WeakMap;function mn(t,r){if(typeof t=="object"&&t!==null){var a=Cm.get(t);return a!==void 0?a:(r={value:t,source:r,stack:en(r)},Cm.set(t,r),r)}return{value:t,source:r,stack:en(r)}}var nl=[],il=0,os=null,fa=0,gn=[],yn=0,Oi=null,Un=1,In="";function oi(t,r){nl[il++]=fa,nl[il++]=os,os=t,fa=r}function Tm(t,r,a){gn[yn++]=Un,gn[yn++]=In,gn[yn++]=Oi,Oi=t;var u=Un;t=In;var p=32-Pe(u)-1;u&=~(1<<p),a+=1;var y=32-Pe(r)+p;if(30<y){var w=p-p%5;y=(u&(1<<w)-1).toString(32),u>>=w,p-=w,Un=1<<32-Pe(r)+p|a<<p|u,In=y+t}else Un=1<<y|a<<p|u,In=t}function Qc(t){t.return!==null&&(oi(t,1),Tm(t,1,0))}function Kc(t){for(;t===os;)os=nl[--il],nl[il]=null,fa=nl[--il],nl[il]=null;for(;t===Oi;)Oi=gn[--yn],gn[yn]=null,In=gn[--yn],gn[yn]=null,Un=gn[--yn],gn[yn]=null}function Am(t,r){gn[yn++]=Un,gn[yn++]=In,gn[yn++]=Oi,Un=r.id,In=r.overflow,Oi=t}var Tt=null,it=null,He=!1,Ri=null,xn=!1,Jc=Error(l(519));function Li(t){var r=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw da(mn(r,t)),Jc}function Mm(t){var r=t.stateNode,a=t.type,u=t.memoizedProps;switch(r[kt]=t,r[Ot]=u,a){case"dialog":Oe("cancel",r),Oe("close",r);break;case"iframe":case"object":case"embed":Oe("load",r);break;case"video":case"audio":for(a=0;a<Oa.length;a++)Oe(Oa[a],r);break;case"source":Oe("error",r);break;case"img":case"image":case"link":Oe("error",r),Oe("load",r);break;case"details":Oe("toggle",r);break;case"input":Oe("invalid",r),Po(r,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Oe("invalid",r);break;case"textarea":Oe("invalid",r),Xp(r,u.value,u.defaultValue,u.children)}a=u.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||u.suppressHydrationWarning===!0||G0(r.textContent,a)?(u.popover!=null&&(Oe("beforetoggle",r),Oe("toggle",r)),u.onScroll!=null&&Oe("scroll",r),u.onScrollEnd!=null&&Oe("scrollend",r),u.onClick!=null&&(r.onclick=ri),r=!0):r=!1,r||Li(t,!0)}function zm(t){for(Tt=t.return;Tt;)switch(Tt.tag){case 5:case 31:case 13:xn=!1;return;case 27:case 3:xn=!0;return;default:Tt=Tt.return}}function rl(t){if(t!==Tt)return!1;if(!He)return zm(t),He=!0,!1;var r=t.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||yd(t.type,t.memoizedProps)),a=!a),a&&it&&Li(t),zm(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));it=ny(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));it=ny(t)}else r===27?(r=it,Qi(t.type)?(t=Sd,Sd=null,it=t):it=r):it=Tt?vn(t.stateNode.nextSibling):null;return!0}function xr(){it=Tt=null,He=!1}function Wc(){var t=Ri;return t!==null&&(Zt===null?Zt=t:Zt.push.apply(Zt,t),Ri=null),t}function da(t){Ri===null?Ri=[t]:Ri.push(t)}var ef=O(null),br=null,si=null;function Bi(t,r,a){z(ef,r._currentValue),r._currentValue=a}function ui(t){t._currentValue=ef.current,$(ef)}function tf(t,r,a){for(;t!==null;){var u=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,u!==null&&(u.childLanes|=r)):u!==null&&(u.childLanes&r)!==r&&(u.childLanes|=r),t===a)break;t=t.return}}function nf(t,r,a,u){var p=t.child;for(p!==null&&(p.return=t);p!==null;){var y=p.dependencies;if(y!==null){var w=p.child;y=y.firstContext;e:for(;y!==null;){var M=y;y=p;for(var V=0;V<r.length;V++)if(M.context===r[V]){y.lanes|=a,M=y.alternate,M!==null&&(M.lanes|=a),tf(y.return,a,t),u||(w=null);break e}y=M.next}}else if(p.tag===18){if(w=p.return,w===null)throw Error(l(341));w.lanes|=a,y=w.alternate,y!==null&&(y.lanes|=a),tf(w,a,t),w=null}else w=p.child;if(w!==null)w.return=p;else for(w=p;w!==null;){if(w===t){w=null;break}if(p=w.sibling,p!==null){p.return=w.return,w=p;break}w=w.return}p=w}}function ll(t,r,a,u){t=null;for(var p=r,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var w=p.alternate;if(w===null)throw Error(l(387));if(w=w.memoizedProps,w!==null){var M=p.type;nn(p.pendingProps.value,w.value)||(t!==null?t.push(M):t=[M])}}else if(p===de.current){if(w=p.alternate,w===null)throw Error(l(387));w.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(t!==null?t.push(Ua):t=[Ua])}p=p.return}t!==null&&nf(r,t,a,u),r.flags|=262144}function ss(t){for(t=t.firstContext;t!==null;){if(!nn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function vr(t){br=t,si=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function At(t){return jm(br,t)}function us(t,r){return br===null&&vr(t),jm(t,r)}function jm(t,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},si===null){if(t===null)throw Error(l(308));si=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else si=si.next=r;return a}var JS=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(a,u){t.push(u)}};this.abort=function(){r.aborted=!0,t.forEach(function(a){return a()})}},WS=e.unstable_scheduleCallback,e2=e.unstable_NormalPriority,mt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function rf(){return{controller:new JS,data:new Map,refCount:0}}function ha(t){t.refCount--,t.refCount===0&&WS(e2,function(){t.controller.abort()})}var pa=null,lf=0,al=0,ol=null;function t2(t,r){if(pa===null){var a=pa=[];lf=0,al=sd(),ol={status:"pending",value:void 0,then:function(u){a.push(u)}}}return lf++,r.then(Dm,Dm),r}function Dm(){if(--lf===0&&pa!==null){ol!==null&&(ol.status="fulfilled");var t=pa;pa=null,al=0,ol=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function n2(t,r){var a=[],u={status:"pending",value:null,reason:null,then:function(p){a.push(p)}};return t.then(function(){u.status="fulfilled",u.value=r;for(var p=0;p<a.length;p++)(0,a[p])(r)},function(p){for(u.status="rejected",u.reason=p,p=0;p<a.length;p++)(0,a[p])(void 0)}),u}var Om=D.S;D.S=function(t,r){y0=St(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&t2(t,r),Om!==null&&Om(t,r)};var wr=O(null);function af(){var t=wr.current;return t!==null?t:et.pooledCache}function cs(t,r){r===null?z(wr,wr.current):z(wr,r.pool)}function Rm(){var t=af();return t===null?null:{parent:mt._currentValue,pool:t}}var sl=Error(l(460)),of=Error(l(474)),fs=Error(l(542)),ds={then:function(){}};function Lm(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Bm(t,r,a){switch(a=t[a],a===void 0?t.push(r):a!==r&&(r.then(ri,ri),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Um(t),t;default:if(typeof r.status=="string")r.then(ri,ri);else{if(t=et,t!==null&&100<t.shellSuspendCounter)throw Error(l(482));t=r,t.status="pending",t.then(function(u){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=u}},function(u){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=u}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Um(t),t}throw kr=r,sl}}function Sr(t){try{var r=t._init;return r(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(kr=a,sl):a}}var kr=null;function Hm(){if(kr===null)throw Error(l(459));var t=kr;return kr=null,t}function Um(t){if(t===sl||t===fs)throw Error(l(483))}var ul=null,ma=0;function hs(t){var r=ma;return ma+=1,ul===null&&(ul=[]),Bm(ul,t,r)}function ga(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function ps(t,r){throw r.$$typeof===x?Error(l(525)):(t=Object.prototype.toString.call(r),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function Im(t){function r(Q,F){if(t){var J=Q.deletions;J===null?(Q.deletions=[F],Q.flags|=16):J.push(F)}}function a(Q,F){if(!t)return null;for(;F!==null;)r(Q,F),F=F.sibling;return null}function u(Q){for(var F=new Map;Q!==null;)Q.key!==null?F.set(Q.key,Q):F.set(Q.index,Q),Q=Q.sibling;return F}function p(Q,F){return Q=ai(Q,F),Q.index=0,Q.sibling=null,Q}function y(Q,F,J){return Q.index=J,t?(J=Q.alternate,J!==null?(J=J.index,J<F?(Q.flags|=67108866,F):J):(Q.flags|=67108866,F)):(Q.flags|=1048576,F)}function w(Q){return t&&Q.alternate===null&&(Q.flags|=67108866),Q}function M(Q,F,J,ae){return F===null||F.tag!==6?(F=Pc(J,Q.mode,ae),F.return=Q,F):(F=p(F,J),F.return=Q,F)}function V(Q,F,J,ae){var xe=J.type;return xe===E?le(Q,F,J.props.children,ae,J.key):F!==null&&(F.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===P&&Sr(xe)===F.type)?(F=p(F,J.props),ga(F,J),F.return=Q,F):(F=as(J.type,J.key,J.props,null,Q.mode,ae),ga(F,J),F.return=Q,F)}function W(Q,F,J,ae){return F===null||F.tag!==4||F.stateNode.containerInfo!==J.containerInfo||F.stateNode.implementation!==J.implementation?(F=Zc(J,Q.mode,ae),F.return=Q,F):(F=p(F,J.children||[]),F.return=Q,F)}function le(Q,F,J,ae,xe){return F===null||F.tag!==7?(F=yr(J,Q.mode,ae,xe),F.return=Q,F):(F=p(F,J),F.return=Q,F)}function oe(Q,F,J){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=Pc(""+F,Q.mode,J),F.return=Q,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case v:return J=as(F.type,F.key,F.props,null,Q.mode,J),ga(J,F),J.return=Q,J;case S:return F=Zc(F,Q.mode,J),F.return=Q,F;case P:return F=Sr(F),oe(Q,F,J)}if(I(F)||Y(F))return F=yr(F,Q.mode,J,null),F.return=Q,F;if(typeof F.then=="function")return oe(Q,hs(F),J);if(F.$$typeof===k)return oe(Q,us(Q,F),J);ps(Q,F)}return null}function te(Q,F,J,ae){var xe=F!==null?F.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return xe!==null?null:M(Q,F,""+J,ae);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case v:return J.key===xe?V(Q,F,J,ae):null;case S:return J.key===xe?W(Q,F,J,ae):null;case P:return J=Sr(J),te(Q,F,J,ae)}if(I(J)||Y(J))return xe!==null?null:le(Q,F,J,ae,null);if(typeof J.then=="function")return te(Q,F,hs(J),ae);if(J.$$typeof===k)return te(Q,F,us(Q,J),ae);ps(Q,J)}return null}function ie(Q,F,J,ae,xe){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return Q=Q.get(J)||null,M(F,Q,""+ae,xe);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case v:return Q=Q.get(ae.key===null?J:ae.key)||null,V(F,Q,ae,xe);case S:return Q=Q.get(ae.key===null?J:ae.key)||null,W(F,Q,ae,xe);case P:return ae=Sr(ae),ie(Q,F,J,ae,xe)}if(I(ae)||Y(ae))return Q=Q.get(J)||null,le(F,Q,ae,xe,null);if(typeof ae.then=="function")return ie(Q,F,J,hs(ae),xe);if(ae.$$typeof===k)return ie(Q,F,J,us(F,ae),xe);ps(F,ae)}return null}function me(Q,F,J,ae){for(var xe=null,$e=null,ge=F,Te=F=0,Be=null;ge!==null&&Te<J.length;Te++){ge.index>Te?(Be=ge,ge=null):Be=ge.sibling;var Xe=te(Q,ge,J[Te],ae);if(Xe===null){ge===null&&(ge=Be);break}t&&ge&&Xe.alternate===null&&r(Q,ge),F=y(Xe,F,Te),$e===null?xe=Xe:$e.sibling=Xe,$e=Xe,ge=Be}if(Te===J.length)return a(Q,ge),He&&oi(Q,Te),xe;if(ge===null){for(;Te<J.length;Te++)ge=oe(Q,J[Te],ae),ge!==null&&(F=y(ge,F,Te),$e===null?xe=ge:$e.sibling=ge,$e=ge);return He&&oi(Q,Te),xe}for(ge=u(ge);Te<J.length;Te++)Be=ie(ge,Q,Te,J[Te],ae),Be!==null&&(t&&Be.alternate!==null&&ge.delete(Be.key===null?Te:Be.key),F=y(Be,F,Te),$e===null?xe=Be:$e.sibling=Be,$e=Be);return t&&ge.forEach(function(tr){return r(Q,tr)}),He&&oi(Q,Te),xe}function Se(Q,F,J,ae){if(J==null)throw Error(l(151));for(var xe=null,$e=null,ge=F,Te=F=0,Be=null,Xe=J.next();ge!==null&&!Xe.done;Te++,Xe=J.next()){ge.index>Te?(Be=ge,ge=null):Be=ge.sibling;var tr=te(Q,ge,Xe.value,ae);if(tr===null){ge===null&&(ge=Be);break}t&&ge&&tr.alternate===null&&r(Q,ge),F=y(tr,F,Te),$e===null?xe=tr:$e.sibling=tr,$e=tr,ge=Be}if(Xe.done)return a(Q,ge),He&&oi(Q,Te),xe;if(ge===null){for(;!Xe.done;Te++,Xe=J.next())Xe=oe(Q,Xe.value,ae),Xe!==null&&(F=y(Xe,F,Te),$e===null?xe=Xe:$e.sibling=Xe,$e=Xe);return He&&oi(Q,Te),xe}for(ge=u(ge);!Xe.done;Te++,Xe=J.next())Xe=ie(ge,Q,Te,Xe.value,ae),Xe!==null&&(t&&Xe.alternate!==null&&ge.delete(Xe.key===null?Te:Xe.key),F=y(Xe,F,Te),$e===null?xe=Xe:$e.sibling=Xe,$e=Xe);return t&&ge.forEach(function(hk){return r(Q,hk)}),He&&oi(Q,Te),xe}function We(Q,F,J,ae){if(typeof J=="object"&&J!==null&&J.type===E&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case v:e:{for(var xe=J.key;F!==null;){if(F.key===xe){if(xe=J.type,xe===E){if(F.tag===7){a(Q,F.sibling),ae=p(F,J.props.children),ae.return=Q,Q=ae;break e}}else if(F.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===P&&Sr(xe)===F.type){a(Q,F.sibling),ae=p(F,J.props),ga(ae,J),ae.return=Q,Q=ae;break e}a(Q,F);break}else r(Q,F);F=F.sibling}J.type===E?(ae=yr(J.props.children,Q.mode,ae,J.key),ae.return=Q,Q=ae):(ae=as(J.type,J.key,J.props,null,Q.mode,ae),ga(ae,J),ae.return=Q,Q=ae)}return w(Q);case S:e:{for(xe=J.key;F!==null;){if(F.key===xe)if(F.tag===4&&F.stateNode.containerInfo===J.containerInfo&&F.stateNode.implementation===J.implementation){a(Q,F.sibling),ae=p(F,J.children||[]),ae.return=Q,Q=ae;break e}else{a(Q,F);break}else r(Q,F);F=F.sibling}ae=Zc(J,Q.mode,ae),ae.return=Q,Q=ae}return w(Q);case P:return J=Sr(J),We(Q,F,J,ae)}if(I(J))return me(Q,F,J,ae);if(Y(J)){if(xe=Y(J),typeof xe!="function")throw Error(l(150));return J=xe.call(J),Se(Q,F,J,ae)}if(typeof J.then=="function")return We(Q,F,hs(J),ae);if(J.$$typeof===k)return We(Q,F,us(Q,J),ae);ps(Q,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,F!==null&&F.tag===6?(a(Q,F.sibling),ae=p(F,J),ae.return=Q,Q=ae):(a(Q,F),ae=Pc(J,Q.mode,ae),ae.return=Q,Q=ae),w(Q)):a(Q,F)}return function(Q,F,J,ae){try{ma=0;var xe=We(Q,F,J,ae);return ul=null,xe}catch(ge){if(ge===sl||ge===fs)throw ge;var $e=rn(29,ge,null,Q.mode);return $e.lanes=ae,$e.return=Q,$e}}}var Er=Im(!0),qm=Im(!1),Hi=!1;function sf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uf(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ui(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ii(t,r,a){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(Ge&2)!==0){var p=u.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),u.pending=r,r=ls(t),Em(t,null,a),r}return rs(t,u,r,a),ls(t)}function ya(t,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194048)!==0)){var u=r.lanes;u&=t.pendingLanes,a|=u,r.lanes=a,Bo(t,a)}}function cf(t,r){var a=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,a===u)){var p=null,y=null;if(a=a.firstBaseUpdate,a!==null){do{var w={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};y===null?p=y=w:y=y.next=w,a=a.next}while(a!==null);y===null?p=y=r:y=y.next=r}else p=y=r;a={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:u.shared,callbacks:u.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=r:t.next=r,a.lastBaseUpdate=r}var ff=!1;function xa(){if(ff){var t=ol;if(t!==null)throw t}}function ba(t,r,a,u){ff=!1;var p=t.updateQueue;Hi=!1;var y=p.firstBaseUpdate,w=p.lastBaseUpdate,M=p.shared.pending;if(M!==null){p.shared.pending=null;var V=M,W=V.next;V.next=null,w===null?y=W:w.next=W,w=V;var le=t.alternate;le!==null&&(le=le.updateQueue,M=le.lastBaseUpdate,M!==w&&(M===null?le.firstBaseUpdate=W:M.next=W,le.lastBaseUpdate=V))}if(y!==null){var oe=p.baseState;w=0,le=W=V=null,M=y;do{var te=M.lane&-536870913,ie=te!==M.lane;if(ie?(Le&te)===te:(u&te)===te){te!==0&&te===al&&(ff=!0),le!==null&&(le=le.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var me=t,Se=M;te=r;var We=a;switch(Se.tag){case 1:if(me=Se.payload,typeof me=="function"){oe=me.call(We,oe,te);break e}oe=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=Se.payload,te=typeof me=="function"?me.call(We,oe,te):me,te==null)break e;oe=m({},oe,te);break e;case 2:Hi=!0}}te=M.callback,te!==null&&(t.flags|=64,ie&&(t.flags|=8192),ie=p.callbacks,ie===null?p.callbacks=[te]:ie.push(te))}else ie={lane:te,tag:M.tag,payload:M.payload,callback:M.callback,next:null},le===null?(W=le=ie,V=oe):le=le.next=ie,w|=te;if(M=M.next,M===null){if(M=p.shared.pending,M===null)break;ie=M,M=ie.next,ie.next=null,p.lastBaseUpdate=ie,p.shared.pending=null}}while(!0);le===null&&(V=oe),p.baseState=V,p.firstBaseUpdate=W,p.lastBaseUpdate=le,y===null&&(p.shared.lanes=0),Xi|=w,t.lanes=w,t.memoizedState=oe}}function Vm(t,r){if(typeof t!="function")throw Error(l(191,t));t.call(r)}function Ym(t,r){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)Vm(a[t],r)}var cl=O(null),ms=O(0);function $m(t,r){t=xi,z(ms,t),z(cl,r),xi=t|r.baseLanes}function df(){z(ms,xi),z(cl,cl.current)}function hf(){xi=ms.current,$(cl),$(ms)}var ln=O(null),bn=null;function qi(t){var r=t.alternate;z(dt,dt.current&1),z(ln,t),bn===null&&(r===null||cl.current!==null||r.memoizedState!==null)&&(bn=t)}function pf(t){z(dt,dt.current),z(ln,t),bn===null&&(bn=t)}function Xm(t){t.tag===22?(z(dt,dt.current),z(ln,t),bn===null&&(bn=t)):Vi()}function Vi(){z(dt,dt.current),z(ln,ln.current)}function an(t){$(ln),bn===t&&(bn=null),$(dt)}var dt=O(0);function gs(t){for(var r=t;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||vd(a)||wd(a)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var ci=0,Ce=null,Ke=null,gt=null,ys=!1,fl=!1,Nr=!1,xs=0,va=0,dl=null,i2=0;function st(){throw Error(l(321))}function mf(t,r){if(r===null)return!1;for(var a=0;a<r.length&&a<t.length;a++)if(!nn(t[a],r[a]))return!1;return!0}function gf(t,r,a,u,p,y){return ci=y,Ce=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,D.H=t===null||t.memoizedState===null?Tg:zf,Nr=!1,y=a(u,p),Nr=!1,fl&&(y=Gm(r,a,u,p)),Fm(t),y}function Fm(t){D.H=ka;var r=Ke!==null&&Ke.next!==null;if(ci=0,gt=Ke=Ce=null,ys=!1,va=0,dl=null,r)throw Error(l(300));t===null||yt||(t=t.dependencies,t!==null&&ss(t)&&(yt=!0))}function Gm(t,r,a,u){Ce=t;var p=0;do{if(fl&&(dl=null),va=0,fl=!1,25<=p)throw Error(l(301));if(p+=1,gt=Ke=null,t.updateQueue!=null){var y=t.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}D.H=Ag,y=r(a,u)}while(fl);return y}function r2(){var t=D.H,r=t.useState()[0];return r=typeof r.then=="function"?wa(r):r,t=t.useState()[0],(Ke!==null?Ke.memoizedState:null)!==t&&(Ce.flags|=1024),r}function yf(){var t=xs!==0;return xs=0,t}function xf(t,r,a){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~a}function bf(t){if(ys){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}ys=!1}ci=0,gt=Ke=Ce=null,fl=!1,va=xs=0,dl=null}function Ut(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gt===null?Ce.memoizedState=gt=t:gt=gt.next=t,gt}function ht(){if(Ke===null){var t=Ce.alternate;t=t!==null?t.memoizedState:null}else t=Ke.next;var r=gt===null?Ce.memoizedState:gt.next;if(r!==null)gt=r,Ke=t;else{if(t===null)throw Ce.alternate===null?Error(l(467)):Error(l(310));Ke=t,t={memoizedState:Ke.memoizedState,baseState:Ke.baseState,baseQueue:Ke.baseQueue,queue:Ke.queue,next:null},gt===null?Ce.memoizedState=gt=t:gt=gt.next=t}return gt}function bs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wa(t){var r=va;return va+=1,dl===null&&(dl=[]),t=Bm(dl,t,r),r=Ce,(gt===null?r.memoizedState:gt.next)===null&&(r=r.alternate,D.H=r===null||r.memoizedState===null?Tg:zf),t}function vs(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return wa(t);if(t.$$typeof===k)return At(t)}throw Error(l(438,String(t)))}function vf(t){var r=null,a=Ce.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var u=Ce.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(r={data:u.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),a===null&&(a=bs(),Ce.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(t),u=0;u<t;u++)a[u]=H;return r.index++,a}function fi(t,r){return typeof r=="function"?r(t):r}function ws(t){var r=ht();return wf(r,Ke,t)}function wf(t,r,a){var u=t.queue;if(u===null)throw Error(l(311));u.lastRenderedReducer=a;var p=t.baseQueue,y=u.pending;if(y!==null){if(p!==null){var w=p.next;p.next=y.next,y.next=w}r.baseQueue=p=y,u.pending=null}if(y=t.baseState,p===null)t.memoizedState=y;else{r=p.next;var M=w=null,V=null,W=r,le=!1;do{var oe=W.lane&-536870913;if(oe!==W.lane?(Le&oe)===oe:(ci&oe)===oe){var te=W.revertLane;if(te===0)V!==null&&(V=V.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),oe===al&&(le=!0);else if((ci&te)===te){W=W.next,te===al&&(le=!0);continue}else oe={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},V===null?(M=V=oe,w=y):V=V.next=oe,Ce.lanes|=te,Xi|=te;oe=W.action,Nr&&a(y,oe),y=W.hasEagerState?W.eagerState:a(y,oe)}else te={lane:oe,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},V===null?(M=V=te,w=y):V=V.next=te,Ce.lanes|=oe,Xi|=oe;W=W.next}while(W!==null&&W!==r);if(V===null?w=y:V.next=M,!nn(y,t.memoizedState)&&(yt=!0,le&&(a=ol,a!==null)))throw a;t.memoizedState=y,t.baseState=w,t.baseQueue=V,u.lastRenderedState=y}return p===null&&(u.lanes=0),[t.memoizedState,u.dispatch]}function Sf(t){var r=ht(),a=r.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=t;var u=a.dispatch,p=a.pending,y=r.memoizedState;if(p!==null){a.pending=null;var w=p=p.next;do y=t(y,w.action),w=w.next;while(w!==p);nn(y,r.memoizedState)||(yt=!0),r.memoizedState=y,r.baseQueue===null&&(r.baseState=y),a.lastRenderedState=y}return[y,u]}function Pm(t,r,a){var u=Ce,p=ht(),y=He;if(y){if(a===void 0)throw Error(l(407));a=a()}else a=r();var w=!nn((Ke||p).memoizedState,a);if(w&&(p.memoizedState=a,yt=!0),p=p.queue,Nf(Km.bind(null,u,p,t),[t]),p.getSnapshot!==r||w||gt!==null&>.memoizedState.tag&1){if(u.flags|=2048,hl(9,{destroy:void 0},Qm.bind(null,u,p,a,r),null),et===null)throw Error(l(349));y||(ci&127)!==0||Zm(u,r,a)}return a}function Zm(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=Ce.updateQueue,r===null?(r=bs(),Ce.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function Qm(t,r,a,u){r.value=a,r.getSnapshot=u,Jm(r)&&Wm(t)}function Km(t,r,a){return a(function(){Jm(r)&&Wm(t)})}function Jm(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!nn(t,a)}catch{return!0}}function Wm(t){var r=gr(t,2);r!==null&&Qt(r,t,2)}function kf(t){var r=Ut();if(typeof t=="function"){var a=t;if(t=a(),Nr){Dt(!0);try{a()}finally{Dt(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fi,lastRenderedState:t},r}function eg(t,r,a,u){return t.baseState=a,wf(t,Ke,typeof u=="function"?u:fi)}function l2(t,r,a,u,p){if(Es(t))throw Error(l(485));if(t=r.action,t!==null){var y={payload:p,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){y.listeners.push(w)}};D.T!==null?a(!0):y.isTransition=!1,u(y),a=r.pending,a===null?(y.next=r.pending=y,tg(r,y)):(y.next=a.next,r.pending=a.next=y)}}function tg(t,r){var a=r.action,u=r.payload,p=t.state;if(r.isTransition){var y=D.T,w={};D.T=w;try{var M=a(p,u),V=D.S;V!==null&&V(w,M),ng(t,r,M)}catch(W){Ef(t,r,W)}finally{y!==null&&w.types!==null&&(y.types=w.types),D.T=y}}else try{y=a(p,u),ng(t,r,y)}catch(W){Ef(t,r,W)}}function ng(t,r,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(u){ig(t,r,u)},function(u){return Ef(t,r,u)}):ig(t,r,a)}function ig(t,r,a){r.status="fulfilled",r.value=a,rg(r),t.state=a,r=t.pending,r!==null&&(a=r.next,a===r?t.pending=null:(a=a.next,r.next=a,tg(t,a)))}function Ef(t,r,a){var u=t.pending;if(t.pending=null,u!==null){u=u.next;do r.status="rejected",r.reason=a,rg(r),r=r.next;while(r!==u)}t.action=null}function rg(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function lg(t,r){return r}function ag(t,r){if(He){var a=et.formState;if(a!==null){e:{var u=Ce;if(He){if(it){t:{for(var p=it,y=xn;p.nodeType!==8;){if(!y){p=null;break t}if(p=vn(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){it=vn(p.nextSibling),u=p.data==="F!";break e}}Li(u)}u=!1}u&&(r=a[0])}}return a=Ut(),a.memoizedState=a.baseState=r,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lg,lastRenderedState:r},a.queue=u,a=Ng.bind(null,Ce,u),u.dispatch=a,u=kf(!1),y=Mf.bind(null,Ce,!1,u.queue),u=Ut(),p={state:r,dispatch:null,action:t,pending:null},u.queue=p,a=l2.bind(null,Ce,p,y,a),p.dispatch=a,u.memoizedState=t,[r,a,!1]}function og(t){var r=ht();return sg(r,Ke,t)}function sg(t,r,a){if(r=wf(t,r,lg)[0],t=ws(fi)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var u=wa(r)}catch(w){throw w===sl?fs:w}else u=r;r=ht();var p=r.queue,y=p.dispatch;return a!==r.memoizedState&&(Ce.flags|=2048,hl(9,{destroy:void 0},a2.bind(null,p,a),null)),[u,y,t]}function a2(t,r){t.action=r}function ug(t){var r=ht(),a=Ke;if(a!==null)return sg(r,a,t);ht(),r=r.memoizedState,a=ht();var u=a.queue.dispatch;return a.memoizedState=t,[r,u,!1]}function hl(t,r,a,u){return t={tag:t,create:a,deps:u,inst:r,next:null},r=Ce.updateQueue,r===null&&(r=bs(),Ce.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=t.next=t:(u=a.next,a.next=t,t.next=u,r.lastEffect=t),t}function cg(){return ht().memoizedState}function Ss(t,r,a,u){var p=Ut();Ce.flags|=t,p.memoizedState=hl(1|r,{destroy:void 0},a,u===void 0?null:u)}function ks(t,r,a,u){var p=ht();u=u===void 0?null:u;var y=p.memoizedState.inst;Ke!==null&&u!==null&&mf(u,Ke.memoizedState.deps)?p.memoizedState=hl(r,y,a,u):(Ce.flags|=t,p.memoizedState=hl(1|r,y,a,u))}function fg(t,r){Ss(8390656,8,t,r)}function Nf(t,r){ks(2048,8,t,r)}function o2(t){Ce.flags|=4;var r=Ce.updateQueue;if(r===null)r=bs(),Ce.updateQueue=r,r.events=[t];else{var a=r.events;a===null?r.events=[t]:a.push(t)}}function dg(t){var r=ht().memoizedState;return o2({ref:r,nextImpl:t}),function(){if((Ge&2)!==0)throw Error(l(440));return r.impl.apply(void 0,arguments)}}function hg(t,r){return ks(4,2,t,r)}function pg(t,r){return ks(4,4,t,r)}function mg(t,r){if(typeof r=="function"){t=t();var a=r(t);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function gg(t,r,a){a=a!=null?a.concat([t]):null,ks(4,4,mg.bind(null,r,t),a)}function _f(){}function yg(t,r){var a=ht();r=r===void 0?null:r;var u=a.memoizedState;return r!==null&&mf(r,u[1])?u[0]:(a.memoizedState=[t,r],t)}function xg(t,r){var a=ht();r=r===void 0?null:r;var u=a.memoizedState;if(r!==null&&mf(r,u[1]))return u[0];if(u=t(),Nr){Dt(!0);try{t()}finally{Dt(!1)}}return a.memoizedState=[u,r],u}function Cf(t,r,a){return a===void 0||(ci&1073741824)!==0&&(Le&261930)===0?t.memoizedState=r:(t.memoizedState=a,t=b0(),Ce.lanes|=t,Xi|=t,a)}function bg(t,r,a,u){return nn(a,r)?a:cl.current!==null?(t=Cf(t,a,u),nn(t,r)||(yt=!0),t):(ci&42)===0||(ci&1073741824)!==0&&(Le&261930)===0?(yt=!0,t.memoizedState=a):(t=b0(),Ce.lanes|=t,Xi|=t,r)}function vg(t,r,a,u,p){var y=q.p;q.p=y!==0&&8>y?y:8;var w=D.T,M={};D.T=M,Mf(t,!1,r,a);try{var V=p(),W=D.S;if(W!==null&&W(M,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var le=n2(V,u);Sa(t,r,le,un(t))}else Sa(t,r,u,un(t))}catch(oe){Sa(t,r,{then:function(){},status:"rejected",reason:oe},un())}finally{q.p=y,w!==null&&M.types!==null&&(w.types=M.types),D.T=w}}function s2(){}function Tf(t,r,a,u){if(t.tag!==5)throw Error(l(476));var p=wg(t).queue;vg(t,p,r,X,a===null?s2:function(){return Sg(t),a(u)})}function wg(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fi,lastRenderedState:X},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fi,lastRenderedState:a},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function Sg(t){var r=wg(t);r.next===null&&(r=t.alternate.memoizedState),Sa(t,r.next.queue,{},un())}function Af(){return At(Ua)}function kg(){return ht().memoizedState}function Eg(){return ht().memoizedState}function u2(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var a=un();t=Ui(a);var u=Ii(r,t,a);u!==null&&(Qt(u,r,a),ya(u,r,a)),r={cache:rf()},t.payload=r;return}r=r.return}}function c2(t,r,a){var u=un();a={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Es(t)?_g(r,a):(a=Fc(t,r,a,u),a!==null&&(Qt(a,t,u),Cg(a,r,u)))}function Ng(t,r,a){var u=un();Sa(t,r,a,u)}function Sa(t,r,a,u){var p={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Es(t))_g(r,p);else{var y=t.alternate;if(t.lanes===0&&(y===null||y.lanes===0)&&(y=r.lastRenderedReducer,y!==null))try{var w=r.lastRenderedState,M=y(w,a);if(p.hasEagerState=!0,p.eagerState=M,nn(M,w))return rs(t,r,p,0),et===null&&is(),!1}catch{}if(a=Fc(t,r,p,u),a!==null)return Qt(a,t,u),Cg(a,r,u),!0}return!1}function Mf(t,r,a,u){if(u={lane:2,revertLane:sd(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Es(t)){if(r)throw Error(l(479))}else r=Fc(t,a,u,2),r!==null&&Qt(r,t,2)}function Es(t){var r=t.alternate;return t===Ce||r!==null&&r===Ce}function _g(t,r){fl=ys=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function Cg(t,r,a){if((a&4194048)!==0){var u=r.lanes;u&=t.pendingLanes,a|=u,r.lanes=a,Bo(t,a)}}var ka={readContext:At,use:vs,useCallback:st,useContext:st,useEffect:st,useImperativeHandle:st,useLayoutEffect:st,useInsertionEffect:st,useMemo:st,useReducer:st,useRef:st,useState:st,useDebugValue:st,useDeferredValue:st,useTransition:st,useSyncExternalStore:st,useId:st,useHostTransitionStatus:st,useFormState:st,useActionState:st,useOptimistic:st,useMemoCache:st,useCacheRefresh:st};ka.useEffectEvent=st;var Tg={readContext:At,use:vs,useCallback:function(t,r){return Ut().memoizedState=[t,r===void 0?null:r],t},useContext:At,useEffect:fg,useImperativeHandle:function(t,r,a){a=a!=null?a.concat([t]):null,Ss(4194308,4,mg.bind(null,r,t),a)},useLayoutEffect:function(t,r){return Ss(4194308,4,t,r)},useInsertionEffect:function(t,r){Ss(4,2,t,r)},useMemo:function(t,r){var a=Ut();r=r===void 0?null:r;var u=t();if(Nr){Dt(!0);try{t()}finally{Dt(!1)}}return a.memoizedState=[u,r],u},useReducer:function(t,r,a){var u=Ut();if(a!==void 0){var p=a(r);if(Nr){Dt(!0);try{a(r)}finally{Dt(!1)}}}else p=r;return u.memoizedState=u.baseState=p,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:p},u.queue=t,t=t.dispatch=c2.bind(null,Ce,t),[u.memoizedState,t]},useRef:function(t){var r=Ut();return t={current:t},r.memoizedState=t},useState:function(t){t=kf(t);var r=t.queue,a=Ng.bind(null,Ce,r);return r.dispatch=a,[t.memoizedState,a]},useDebugValue:_f,useDeferredValue:function(t,r){var a=Ut();return Cf(a,t,r)},useTransition:function(){var t=kf(!1);return t=vg.bind(null,Ce,t.queue,!0,!1),Ut().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,a){var u=Ce,p=Ut();if(He){if(a===void 0)throw Error(l(407));a=a()}else{if(a=r(),et===null)throw Error(l(349));(Le&127)!==0||Zm(u,r,a)}p.memoizedState=a;var y={value:a,getSnapshot:r};return p.queue=y,fg(Km.bind(null,u,y,t),[t]),u.flags|=2048,hl(9,{destroy:void 0},Qm.bind(null,u,y,a,r),null),a},useId:function(){var t=Ut(),r=et.identifierPrefix;if(He){var a=In,u=Un;a=(u&~(1<<32-Pe(u)-1)).toString(32)+a,r="_"+r+"R_"+a,a=xs++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=i2++,r="_"+r+"r_"+a.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:Af,useFormState:ag,useActionState:ag,useOptimistic:function(t){var r=Ut();r.memoizedState=r.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=Mf.bind(null,Ce,!0,a),a.dispatch=r,[t,r]},useMemoCache:vf,useCacheRefresh:function(){return Ut().memoizedState=u2.bind(null,Ce)},useEffectEvent:function(t){var r=Ut(),a={impl:t};return r.memoizedState=a,function(){if((Ge&2)!==0)throw Error(l(440));return a.impl.apply(void 0,arguments)}}},zf={readContext:At,use:vs,useCallback:yg,useContext:At,useEffect:Nf,useImperativeHandle:gg,useInsertionEffect:hg,useLayoutEffect:pg,useMemo:xg,useReducer:ws,useRef:cg,useState:function(){return ws(fi)},useDebugValue:_f,useDeferredValue:function(t,r){var a=ht();return bg(a,Ke.memoizedState,t,r)},useTransition:function(){var t=ws(fi)[0],r=ht().memoizedState;return[typeof t=="boolean"?t:wa(t),r]},useSyncExternalStore:Pm,useId:kg,useHostTransitionStatus:Af,useFormState:og,useActionState:og,useOptimistic:function(t,r){var a=ht();return eg(a,Ke,t,r)},useMemoCache:vf,useCacheRefresh:Eg};zf.useEffectEvent=dg;var Ag={readContext:At,use:vs,useCallback:yg,useContext:At,useEffect:Nf,useImperativeHandle:gg,useInsertionEffect:hg,useLayoutEffect:pg,useMemo:xg,useReducer:Sf,useRef:cg,useState:function(){return Sf(fi)},useDebugValue:_f,useDeferredValue:function(t,r){var a=ht();return Ke===null?Cf(a,t,r):bg(a,Ke.memoizedState,t,r)},useTransition:function(){var t=Sf(fi)[0],r=ht().memoizedState;return[typeof t=="boolean"?t:wa(t),r]},useSyncExternalStore:Pm,useId:kg,useHostTransitionStatus:Af,useFormState:ug,useActionState:ug,useOptimistic:function(t,r){var a=ht();return Ke!==null?eg(a,Ke,t,r):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:vf,useCacheRefresh:Eg};Ag.useEffectEvent=dg;function jf(t,r,a,u){r=t.memoizedState,a=a(u,r),a=a==null?r:m({},r,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var Df={enqueueSetState:function(t,r,a){t=t._reactInternals;var u=un(),p=Ui(u);p.payload=r,a!=null&&(p.callback=a),r=Ii(t,p,u),r!==null&&(Qt(r,t,u),ya(r,t,u))},enqueueReplaceState:function(t,r,a){t=t._reactInternals;var u=un(),p=Ui(u);p.tag=1,p.payload=r,a!=null&&(p.callback=a),r=Ii(t,p,u),r!==null&&(Qt(r,t,u),ya(r,t,u))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var a=un(),u=Ui(a);u.tag=2,r!=null&&(u.callback=r),r=Ii(t,u,a),r!==null&&(Qt(r,t,a),ya(r,t,a))}};function Mg(t,r,a,u,p,y,w){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,y,w):r.prototype&&r.prototype.isPureReactComponent?!ua(a,u)||!ua(p,y):!0}function zg(t,r,a,u){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,u),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,u),r.state!==t&&Df.enqueueReplaceState(r,r.state,null)}function _r(t,r){var a=r;if("ref"in r){a={};for(var u in r)u!=="ref"&&(a[u]=r[u])}if(t=t.defaultProps){a===r&&(a=m({},a));for(var p in t)a[p]===void 0&&(a[p]=t[p])}return a}function jg(t){ns(t)}function Dg(t){console.error(t)}function Og(t){ns(t)}function Ns(t,r){try{var a=t.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(u){setTimeout(function(){throw u})}}function Rg(t,r,a){try{var u=t.onCaughtError;u(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Of(t,r,a){return a=Ui(a),a.tag=3,a.payload={element:null},a.callback=function(){Ns(t,r)},a}function Lg(t){return t=Ui(t),t.tag=3,t}function Bg(t,r,a,u){var p=a.type.getDerivedStateFromError;if(typeof p=="function"){var y=u.value;t.payload=function(){return p(y)},t.callback=function(){Rg(r,a,u)}}var w=a.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(t.callback=function(){Rg(r,a,u),typeof p!="function"&&(Fi===null?Fi=new Set([this]):Fi.add(this));var M=u.stack;this.componentDidCatch(u.value,{componentStack:M!==null?M:""})})}function f2(t,r,a,u,p){if(a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(r=a.alternate,r!==null&&ll(r,a,p,!0),a=ln.current,a!==null){switch(a.tag){case 31:case 13:return bn===null?Bs():a.alternate===null&&ut===0&&(ut=3),a.flags&=-257,a.flags|=65536,a.lanes=p,u===ds?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([u]):r.add(u),ld(t,u,p)),!1;case 22:return a.flags|=65536,u===ds?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([u])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([u]):a.add(u)),ld(t,u,p)),!1}throw Error(l(435,a.tag))}return ld(t,u,p),Bs(),!1}if(He)return r=ln.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,u!==Jc&&(t=Error(l(422),{cause:u}),da(mn(t,a)))):(u!==Jc&&(r=Error(l(423),{cause:u}),da(mn(r,a))),t=t.current.alternate,t.flags|=65536,p&=-p,t.lanes|=p,u=mn(u,a),p=Of(t.stateNode,u,p),cf(t,p),ut!==4&&(ut=2)),!1;var y=Error(l(520),{cause:u});if(y=mn(y,a),za===null?za=[y]:za.push(y),ut!==4&&(ut=2),r===null)return!0;u=mn(u,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,t=p&-p,a.lanes|=t,t=Of(a.stateNode,u,t),cf(a,t),!1;case 1:if(r=a.type,y=a.stateNode,(a.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Fi===null||!Fi.has(y))))return a.flags|=65536,p&=-p,a.lanes|=p,p=Lg(p),Bg(p,t,a,u),cf(a,p),!1}a=a.return}while(a!==null);return!1}var Rf=Error(l(461)),yt=!1;function Mt(t,r,a,u){r.child=t===null?qm(r,null,a,u):Er(r,t.child,a,u)}function Hg(t,r,a,u,p){a=a.render;var y=r.ref;if("ref"in u){var w={};for(var M in u)M!=="ref"&&(w[M]=u[M])}else w=u;return vr(r),u=gf(t,r,a,w,y,p),M=yf(),t!==null&&!yt?(xf(t,r,p),di(t,r,p)):(He&&M&&Qc(r),r.flags|=1,Mt(t,r,u,p),r.child)}function Ug(t,r,a,u,p){if(t===null){var y=a.type;return typeof y=="function"&&!Gc(y)&&y.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=y,Ig(t,r,y,u,p)):(t=as(a.type,null,u,r,r.mode,p),t.ref=r.ref,t.return=r,r.child=t)}if(y=t.child,!Yf(t,p)){var w=y.memoizedProps;if(a=a.compare,a=a!==null?a:ua,a(w,u)&&t.ref===r.ref)return di(t,r,p)}return r.flags|=1,t=ai(y,u),t.ref=r.ref,t.return=r,r.child=t}function Ig(t,r,a,u,p){if(t!==null){var y=t.memoizedProps;if(ua(y,u)&&t.ref===r.ref)if(yt=!1,r.pendingProps=u=y,Yf(t,p))(t.flags&131072)!==0&&(yt=!0);else return r.lanes=t.lanes,di(t,r,p)}return Lf(t,r,a,u,p)}function qg(t,r,a,u){var p=u.children,y=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((r.flags&128)!==0){if(y=y!==null?y.baseLanes|a:a,t!==null){for(u=r.child=t.child,p=0;u!==null;)p=p|u.lanes|u.childLanes,u=u.sibling;u=p&~y}else u=0,r.child=null;return Vg(t,r,y,a,u)}if((a&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&cs(r,y!==null?y.cachePool:null),y!==null?$m(r,y):df(),Xm(r);else return u=r.lanes=536870912,Vg(t,r,y!==null?y.baseLanes|a:a,a,u)}else y!==null?(cs(r,y.cachePool),$m(r,y),Vi(),r.memoizedState=null):(t!==null&&cs(r,null),df(),Vi());return Mt(t,r,p,a),r.child}function Ea(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Vg(t,r,a,u,p){var y=af();return y=y===null?null:{parent:mt._currentValue,pool:y},r.memoizedState={baseLanes:a,cachePool:y},t!==null&&cs(r,null),df(),Xm(r),t!==null&&ll(t,r,u,!0),r.childLanes=p,null}function _s(t,r){return r=Ts({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function Yg(t,r,a){return Er(r,t.child,null,a),t=_s(r,r.pendingProps),t.flags|=2,an(r),r.memoizedState=null,t}function d2(t,r,a){var u=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(He){if(u.mode==="hidden")return t=_s(r,u),r.lanes=536870912,Ea(null,t);if(pf(r),(t=it)?(t=ty(t,xn),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Oi!==null?{id:Un,overflow:In}:null,retryLane:536870912,hydrationErrors:null},a=_m(t),a.return=r,r.child=a,Tt=r,it=null)):t=null,t===null)throw Li(r);return r.lanes=536870912,null}return _s(r,u)}var y=t.memoizedState;if(y!==null){var w=y.dehydrated;if(pf(r),p)if(r.flags&256)r.flags&=-257,r=Yg(t,r,a);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(l(558));else if(yt||ll(t,r,a,!1),p=(a&t.childLanes)!==0,yt||p){if(u=et,u!==null&&(w=Ho(u,a),w!==0&&w!==y.retryLane))throw y.retryLane=w,gr(t,w),Qt(u,t,w),Rf;Bs(),r=Yg(t,r,a)}else t=y.treeContext,it=vn(w.nextSibling),Tt=r,He=!0,Ri=null,xn=!1,t!==null&&Am(r,t),r=_s(r,u),r.flags|=4096;return r}return t=ai(t.child,{mode:u.mode,children:u.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Cs(t,r){var a=r.ref;if(a===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(l(284));(t===null||t.ref!==a)&&(r.flags|=4194816)}}function Lf(t,r,a,u,p){return vr(r),a=gf(t,r,a,u,void 0,p),u=yf(),t!==null&&!yt?(xf(t,r,p),di(t,r,p)):(He&&u&&Qc(r),r.flags|=1,Mt(t,r,a,p),r.child)}function $g(t,r,a,u,p,y){return vr(r),r.updateQueue=null,a=Gm(r,u,a,p),Fm(t),u=yf(),t!==null&&!yt?(xf(t,r,y),di(t,r,y)):(He&&u&&Qc(r),r.flags|=1,Mt(t,r,a,y),r.child)}function Xg(t,r,a,u,p){if(vr(r),r.stateNode===null){var y=tl,w=a.contextType;typeof w=="object"&&w!==null&&(y=At(w)),y=new a(u,y),r.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Df,r.stateNode=y,y._reactInternals=r,y=r.stateNode,y.props=u,y.state=r.memoizedState,y.refs={},sf(r),w=a.contextType,y.context=typeof w=="object"&&w!==null?At(w):tl,y.state=r.memoizedState,w=a.getDerivedStateFromProps,typeof w=="function"&&(jf(r,a,w,u),y.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(w=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),w!==y.state&&Df.enqueueReplaceState(y,y.state,null),ba(r,u,y,p),xa(),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308),u=!0}else if(t===null){y=r.stateNode;var M=r.memoizedProps,V=_r(a,M);y.props=V;var W=y.context,le=a.contextType;w=tl,typeof le=="object"&&le!==null&&(w=At(le));var oe=a.getDerivedStateFromProps;le=typeof oe=="function"||typeof y.getSnapshotBeforeUpdate=="function",M=r.pendingProps!==M,le||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(M||W!==w)&&zg(r,y,u,w),Hi=!1;var te=r.memoizedState;y.state=te,ba(r,u,y,p),xa(),W=r.memoizedState,M||te!==W||Hi?(typeof oe=="function"&&(jf(r,a,oe,u),W=r.memoizedState),(V=Hi||Mg(r,a,V,u,te,W,w))?(le||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(r.flags|=4194308)):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=u,r.memoizedState=W),y.props=u,y.state=W,y.context=w,u=V):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),u=!1)}else{y=r.stateNode,uf(t,r),w=r.memoizedProps,le=_r(a,w),y.props=le,oe=r.pendingProps,te=y.context,W=a.contextType,V=tl,typeof W=="object"&&W!==null&&(V=At(W)),M=a.getDerivedStateFromProps,(W=typeof M=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(w!==oe||te!==V)&&zg(r,y,u,V),Hi=!1,te=r.memoizedState,y.state=te,ba(r,u,y,p),xa();var ie=r.memoizedState;w!==oe||te!==ie||Hi||t!==null&&t.dependencies!==null&&ss(t.dependencies)?(typeof M=="function"&&(jf(r,a,M,u),ie=r.memoizedState),(le=Hi||Mg(r,a,le,u,te,ie,V)||t!==null&&t.dependencies!==null&&ss(t.dependencies))?(W||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(u,ie,V),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(u,ie,V)),typeof y.componentDidUpdate=="function"&&(r.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof y.componentDidUpdate!="function"||w===t.memoizedProps&&te===t.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&te===t.memoizedState||(r.flags|=1024),r.memoizedProps=u,r.memoizedState=ie),y.props=u,y.state=ie,y.context=V,u=le):(typeof y.componentDidUpdate!="function"||w===t.memoizedProps&&te===t.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&te===t.memoizedState||(r.flags|=1024),u=!1)}return y=u,Cs(t,r),u=(r.flags&128)!==0,y||u?(y=r.stateNode,a=u&&typeof a.getDerivedStateFromError!="function"?null:y.render(),r.flags|=1,t!==null&&u?(r.child=Er(r,t.child,null,p),r.child=Er(r,null,a,p)):Mt(t,r,a,p),r.memoizedState=y.state,t=r.child):t=di(t,r,p),t}function Fg(t,r,a,u){return xr(),r.flags|=256,Mt(t,r,a,u),r.child}var Bf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hf(t){return{baseLanes:t,cachePool:Rm()}}function Uf(t,r,a){return t=t!==null?t.childLanes&~a:0,r&&(t|=sn),t}function Gg(t,r,a){var u=r.pendingProps,p=!1,y=(r.flags&128)!==0,w;if((w=y)||(w=t!==null&&t.memoizedState===null?!1:(dt.current&2)!==0),w&&(p=!0,r.flags&=-129),w=(r.flags&32)!==0,r.flags&=-33,t===null){if(He){if(p?qi(r):Vi(),(t=it)?(t=ty(t,xn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Oi!==null?{id:Un,overflow:In}:null,retryLane:536870912,hydrationErrors:null},a=_m(t),a.return=r,r.child=a,Tt=r,it=null)):t=null,t===null)throw Li(r);return wd(t)?r.lanes=32:r.lanes=536870912,null}var M=u.children;return u=u.fallback,p?(Vi(),p=r.mode,M=Ts({mode:"hidden",children:M},p),u=yr(u,p,a,null),M.return=r,u.return=r,M.sibling=u,r.child=M,u=r.child,u.memoizedState=Hf(a),u.childLanes=Uf(t,w,a),r.memoizedState=Bf,Ea(null,u)):(qi(r),If(r,M))}var V=t.memoizedState;if(V!==null&&(M=V.dehydrated,M!==null)){if(y)r.flags&256?(qi(r),r.flags&=-257,r=qf(t,r,a)):r.memoizedState!==null?(Vi(),r.child=t.child,r.flags|=128,r=null):(Vi(),M=u.fallback,p=r.mode,u=Ts({mode:"visible",children:u.children},p),M=yr(M,p,a,null),M.flags|=2,u.return=r,M.return=r,u.sibling=M,r.child=u,Er(r,t.child,null,a),u=r.child,u.memoizedState=Hf(a),u.childLanes=Uf(t,w,a),r.memoizedState=Bf,r=Ea(null,u));else if(qi(r),wd(M)){if(w=M.nextSibling&&M.nextSibling.dataset,w)var W=w.dgst;w=W,u=Error(l(419)),u.stack="",u.digest=w,da({value:u,source:null,stack:null}),r=qf(t,r,a)}else if(yt||ll(t,r,a,!1),w=(a&t.childLanes)!==0,yt||w){if(w=et,w!==null&&(u=Ho(w,a),u!==0&&u!==V.retryLane))throw V.retryLane=u,gr(t,u),Qt(w,t,u),Rf;vd(M)||Bs(),r=qf(t,r,a)}else vd(M)?(r.flags|=192,r.child=t.child,r=null):(t=V.treeContext,it=vn(M.nextSibling),Tt=r,He=!0,Ri=null,xn=!1,t!==null&&Am(r,t),r=If(r,u.children),r.flags|=4096);return r}return p?(Vi(),M=u.fallback,p=r.mode,V=t.child,W=V.sibling,u=ai(V,{mode:"hidden",children:u.children}),u.subtreeFlags=V.subtreeFlags&65011712,W!==null?M=ai(W,M):(M=yr(M,p,a,null),M.flags|=2),M.return=r,u.return=r,u.sibling=M,r.child=u,Ea(null,u),u=r.child,M=t.child.memoizedState,M===null?M=Hf(a):(p=M.cachePool,p!==null?(V=mt._currentValue,p=p.parent!==V?{parent:V,pool:V}:p):p=Rm(),M={baseLanes:M.baseLanes|a,cachePool:p}),u.memoizedState=M,u.childLanes=Uf(t,w,a),r.memoizedState=Bf,Ea(t.child,u)):(qi(r),a=t.child,t=a.sibling,a=ai(a,{mode:"visible",children:u.children}),a.return=r,a.sibling=null,t!==null&&(w=r.deletions,w===null?(r.deletions=[t],r.flags|=16):w.push(t)),r.child=a,r.memoizedState=null,a)}function If(t,r){return r=Ts({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Ts(t,r){return t=rn(22,t,null,r),t.lanes=0,t}function qf(t,r,a){return Er(r,t.child,null,a),t=If(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function Pg(t,r,a){t.lanes|=r;var u=t.alternate;u!==null&&(u.lanes|=r),tf(t.return,r,a)}function Vf(t,r,a,u,p,y){var w=t.memoizedState;w===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:u,tail:a,tailMode:p,treeForkCount:y}:(w.isBackwards=r,w.rendering=null,w.renderingStartTime=0,w.last=u,w.tail=a,w.tailMode=p,w.treeForkCount=y)}function Zg(t,r,a){var u=r.pendingProps,p=u.revealOrder,y=u.tail;u=u.children;var w=dt.current,M=(w&2)!==0;if(M?(w=w&1|2,r.flags|=128):w&=1,z(dt,w),Mt(t,r,u,a),u=He?fa:0,!M&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Pg(t,a,r);else if(t.tag===19)Pg(t,a,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(p){case"forwards":for(a=r.child,p=null;a!==null;)t=a.alternate,t!==null&&gs(t)===null&&(p=a),a=a.sibling;a=p,a===null?(p=r.child,r.child=null):(p=a.sibling,a.sibling=null),Vf(r,!1,p,a,y,u);break;case"backwards":case"unstable_legacy-backwards":for(a=null,p=r.child,r.child=null;p!==null;){if(t=p.alternate,t!==null&&gs(t)===null){r.child=p;break}t=p.sibling,p.sibling=a,a=p,p=t}Vf(r,!0,a,null,y,u);break;case"together":Vf(r,!1,null,null,void 0,u);break;default:r.memoizedState=null}return r.child}function di(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),Xi|=r.lanes,(a&r.childLanes)===0)if(t!==null){if(ll(t,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(l(153));if(r.child!==null){for(t=r.child,a=ai(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=ai(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function Yf(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&ss(t)))}function h2(t,r,a){switch(r.tag){case 3:se(r,r.stateNode.containerInfo),Bi(r,mt,t.memoizedState.cache),xr();break;case 27:case 5:ke(r);break;case 4:se(r,r.stateNode.containerInfo);break;case 10:Bi(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,pf(r),null;break;case 13:var u=r.memoizedState;if(u!==null)return u.dehydrated!==null?(qi(r),r.flags|=128,null):(a&r.child.childLanes)!==0?Gg(t,r,a):(qi(r),t=di(t,r,a),t!==null?t.sibling:null);qi(r);break;case 19:var p=(t.flags&128)!==0;if(u=(a&r.childLanes)!==0,u||(ll(t,r,a,!1),u=(a&r.childLanes)!==0),p){if(u)return Zg(t,r,a);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),z(dt,dt.current),u)break;return null;case 22:return r.lanes=0,qg(t,r,a,r.pendingProps);case 24:Bi(r,mt,t.memoizedState.cache)}return di(t,r,a)}function Qg(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps)yt=!0;else{if(!Yf(t,a)&&(r.flags&128)===0)return yt=!1,h2(t,r,a);yt=(t.flags&131072)!==0}else yt=!1,He&&(r.flags&1048576)!==0&&Tm(r,fa,r.index);switch(r.lanes=0,r.tag){case 16:e:{var u=r.pendingProps;if(t=Sr(r.elementType),r.type=t,typeof t=="function")Gc(t)?(u=_r(t,u),r.tag=1,r=Xg(null,r,t,u,a)):(r.tag=0,r=Lf(null,r,t,u,a));else{if(t!=null){var p=t.$$typeof;if(p===A){r.tag=11,r=Hg(null,r,t,u,a);break e}else if(p===L){r.tag=14,r=Ug(null,r,t,u,a);break e}}throw r=R(t)||t,Error(l(306,r,""))}}return r;case 0:return Lf(t,r,r.type,r.pendingProps,a);case 1:return u=r.type,p=_r(u,r.pendingProps),Xg(t,r,u,p,a);case 3:e:{if(se(r,r.stateNode.containerInfo),t===null)throw Error(l(387));u=r.pendingProps;var y=r.memoizedState;p=y.element,uf(t,r),ba(r,u,null,a);var w=r.memoizedState;if(u=w.cache,Bi(r,mt,u),u!==y.cache&&nf(r,[mt],a,!0),xa(),u=w.element,y.isDehydrated)if(y={element:u,isDehydrated:!1,cache:w.cache},r.updateQueue.baseState=y,r.memoizedState=y,r.flags&256){r=Fg(t,r,u,a);break e}else if(u!==p){p=mn(Error(l(424)),r),da(p),r=Fg(t,r,u,a);break e}else for(t=r.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,it=vn(t.firstChild),Tt=r,He=!0,Ri=null,xn=!0,a=qm(r,null,u,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(xr(),u===p){r=di(t,r,a);break e}Mt(t,r,u,a)}r=r.child}return r;case 26:return Cs(t,r),t===null?(a=oy(r.type,null,r.pendingProps,null))?r.memoizedState=a:He||(a=r.type,t=r.pendingProps,u=$s(ce.current).createElement(a),u[kt]=r,u[Ot]=t,zt(u,a,t),pt(u),r.stateNode=u):r.memoizedState=oy(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return ke(r),t===null&&He&&(u=r.stateNode=ry(r.type,r.pendingProps,ce.current),Tt=r,xn=!0,p=it,Qi(r.type)?(Sd=p,it=vn(u.firstChild)):it=p),Mt(t,r,r.pendingProps.children,a),Cs(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&He&&((p=u=it)&&(u=Y2(u,r.type,r.pendingProps,xn),u!==null?(r.stateNode=u,Tt=r,it=vn(u.firstChild),xn=!1,p=!0):p=!1),p||Li(r)),ke(r),p=r.type,y=r.pendingProps,w=t!==null?t.memoizedProps:null,u=y.children,yd(p,y)?u=null:w!==null&&yd(p,w)&&(r.flags|=32),r.memoizedState!==null&&(p=gf(t,r,r2,null,null,a),Ua._currentValue=p),Cs(t,r),Mt(t,r,u,a),r.child;case 6:return t===null&&He&&((t=a=it)&&(a=$2(a,r.pendingProps,xn),a!==null?(r.stateNode=a,Tt=r,it=null,t=!0):t=!1),t||Li(r)),null;case 13:return Gg(t,r,a);case 4:return se(r,r.stateNode.containerInfo),u=r.pendingProps,t===null?r.child=Er(r,null,u,a):Mt(t,r,u,a),r.child;case 11:return Hg(t,r,r.type,r.pendingProps,a);case 7:return Mt(t,r,r.pendingProps,a),r.child;case 8:return Mt(t,r,r.pendingProps.children,a),r.child;case 12:return Mt(t,r,r.pendingProps.children,a),r.child;case 10:return u=r.pendingProps,Bi(r,r.type,u.value),Mt(t,r,u.children,a),r.child;case 9:return p=r.type._context,u=r.pendingProps.children,vr(r),p=At(p),u=u(p),r.flags|=1,Mt(t,r,u,a),r.child;case 14:return Ug(t,r,r.type,r.pendingProps,a);case 15:return Ig(t,r,r.type,r.pendingProps,a);case 19:return Zg(t,r,a);case 31:return d2(t,r,a);case 22:return qg(t,r,a,r.pendingProps);case 24:return vr(r),u=At(mt),t===null?(p=af(),p===null&&(p=et,y=rf(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=a),p=y),r.memoizedState={parent:u,cache:p},sf(r),Bi(r,mt,p)):((t.lanes&a)!==0&&(uf(t,r),ba(r,null,null,a),xa()),p=t.memoizedState,y=r.memoizedState,p.parent!==u?(p={parent:u,cache:u},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),Bi(r,mt,u)):(u=y.cache,Bi(r,mt,u),u!==p.cache&&nf(r,[mt],a,!0))),Mt(t,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(l(156,r.tag))}function hi(t){t.flags|=4}function $f(t,r,a,u,p){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(p&335544128)===p)if(t.stateNode.complete)t.flags|=8192;else if(k0())t.flags|=8192;else throw kr=ds,of}else t.flags&=-16777217}function Kg(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!dy(r))if(k0())t.flags|=8192;else throw kr=ds,of}function As(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?Ro():536870912,t.lanes|=r,yl|=r)}function Na(t,r){if(!He)switch(t.tailMode){case"hidden":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:u.sibling=null}}function rt(t){var r=t.alternate!==null&&t.alternate.child===t.child,a=0,u=0;if(r)for(var p=t.child;p!==null;)a|=p.lanes|p.childLanes,u|=p.subtreeFlags&65011712,u|=p.flags&65011712,p.return=t,p=p.sibling;else for(p=t.child;p!==null;)a|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=t,p=p.sibling;return t.subtreeFlags|=u,t.childLanes=a,r}function p2(t,r,a){var u=r.pendingProps;switch(Kc(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rt(r),null;case 1:return rt(r),null;case 3:return a=r.stateNode,u=null,t!==null&&(u=t.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),ui(mt),pe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(rl(r)?hi(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Wc())),rt(r),null;case 26:var p=r.type,y=r.memoizedState;return t===null?(hi(r),y!==null?(rt(r),Kg(r,y)):(rt(r),$f(r,p,null,u,a))):y?y!==t.memoizedState?(hi(r),rt(r),Kg(r,y)):(rt(r),r.flags&=-16777217):(t=t.memoizedProps,t!==u&&hi(r),rt(r),$f(r,p,t,u,a)),null;case 27:if(Ne(r),a=ce.current,p=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==u&&hi(r);else{if(!u){if(r.stateNode===null)throw Error(l(166));return rt(r),null}t=ne.current,rl(r)?Mm(r):(t=ry(p,u,a),r.stateNode=t,hi(r))}return rt(r),null;case 5:if(Ne(r),p=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==u&&hi(r);else{if(!u){if(r.stateNode===null)throw Error(l(166));return rt(r),null}if(y=ne.current,rl(r))Mm(r);else{var w=$s(ce.current);switch(y){case 1:y=w.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:y=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":y=w.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":y=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":y=w.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof u.is=="string"?w.createElement("select",{is:u.is}):w.createElement("select"),u.multiple?y.multiple=!0:u.size&&(y.size=u.size);break;default:y=typeof u.is=="string"?w.createElement(p,{is:u.is}):w.createElement(p)}}y[kt]=r,y[Ot]=u;e:for(w=r.child;w!==null;){if(w.tag===5||w.tag===6)y.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===r)break e;for(;w.sibling===null;){if(w.return===null||w.return===r)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}r.stateNode=y;e:switch(zt(y,p,u),p){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&hi(r)}}return rt(r),$f(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,a),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==u&&hi(r);else{if(typeof u!="string"&&r.stateNode===null)throw Error(l(166));if(t=ce.current,rl(r)){if(t=r.stateNode,a=r.memoizedProps,u=null,p=Tt,p!==null)switch(p.tag){case 27:case 5:u=p.memoizedProps}t[kt]=r,t=!!(t.nodeValue===a||u!==null&&u.suppressHydrationWarning===!0||G0(t.nodeValue,a)),t||Li(r,!0)}else t=$s(t).createTextNode(u),t[kt]=r,r.stateNode=t}return rt(r),null;case 31:if(a=r.memoizedState,t===null||t.memoizedState!==null){if(u=rl(r),a!==null){if(t===null){if(!u)throw Error(l(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[kt]=r}else xr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;rt(r),t=!1}else a=Wc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return r.flags&256?(an(r),r):(an(r),null);if((r.flags&128)!==0)throw Error(l(558))}return rt(r),null;case 13:if(u=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(p=rl(r),u!==null&&u.dehydrated!==null){if(t===null){if(!p)throw Error(l(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(l(317));p[kt]=r}else xr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;rt(r),p=!1}else p=Wc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(an(r),r):(an(r),null)}return an(r),(r.flags&128)!==0?(r.lanes=a,r):(a=u!==null,t=t!==null&&t.memoizedState!==null,a&&(u=r.child,p=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(p=u.alternate.memoizedState.cachePool.pool),y=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),y!==p&&(u.flags|=2048)),a!==t&&a&&(r.child.flags|=8192),As(r,r.updateQueue),rt(r),null);case 4:return pe(),t===null&&dd(r.stateNode.containerInfo),rt(r),null;case 10:return ui(r.type),rt(r),null;case 19:if($(dt),u=r.memoizedState,u===null)return rt(r),null;if(p=(r.flags&128)!==0,y=u.rendering,y===null)if(p)Na(u,!1);else{if(ut!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(y=gs(t),y!==null){for(r.flags|=128,Na(u,!1),t=y.updateQueue,r.updateQueue=t,As(r,t),r.subtreeFlags=0,t=a,a=r.child;a!==null;)Nm(a,t),a=a.sibling;return z(dt,dt.current&1|2),He&&oi(r,u.treeForkCount),r.child}t=t.sibling}u.tail!==null&&St()>Os&&(r.flags|=128,p=!0,Na(u,!1),r.lanes=4194304)}else{if(!p)if(t=gs(y),t!==null){if(r.flags|=128,p=!0,t=t.updateQueue,r.updateQueue=t,As(r,t),Na(u,!0),u.tail===null&&u.tailMode==="hidden"&&!y.alternate&&!He)return rt(r),null}else 2*St()-u.renderingStartTime>Os&&a!==536870912&&(r.flags|=128,p=!0,Na(u,!1),r.lanes=4194304);u.isBackwards?(y.sibling=r.child,r.child=y):(t=u.last,t!==null?t.sibling=y:r.child=y,u.last=y)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=St(),t.sibling=null,a=dt.current,z(dt,p?a&1|2:a&1),He&&oi(r,u.treeForkCount),t):(rt(r),null);case 22:case 23:return an(r),hf(),u=r.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(r.flags|=8192):u&&(r.flags|=8192),u?(a&536870912)!==0&&(r.flags&128)===0&&(rt(r),r.subtreeFlags&6&&(r.flags|=8192)):rt(r),a=r.updateQueue,a!==null&&As(r,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==a&&(r.flags|=2048),t!==null&&$(wr),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),ui(mt),rt(r),null;case 25:return null;case 30:return null}throw Error(l(156,r.tag))}function m2(t,r){switch(Kc(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return ui(mt),pe(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return Ne(r),null;case 31:if(r.memoizedState!==null){if(an(r),r.alternate===null)throw Error(l(340));xr()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(an(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(l(340));xr()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return $(dt),null;case 4:return pe(),null;case 10:return ui(r.type),null;case 22:case 23:return an(r),hf(),t!==null&&$(wr),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return ui(mt),null;case 25:return null;default:return null}}function Jg(t,r){switch(Kc(r),r.tag){case 3:ui(mt),pe();break;case 26:case 27:case 5:Ne(r);break;case 4:pe();break;case 31:r.memoizedState!==null&&an(r);break;case 13:an(r);break;case 19:$(dt);break;case 10:ui(r.type);break;case 22:case 23:an(r),hf(),t!==null&&$(wr);break;case 24:ui(mt)}}function _a(t,r){try{var a=r.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var p=u.next;a=p;do{if((a.tag&t)===t){u=void 0;var y=a.create,w=a.inst;u=y(),w.destroy=u}a=a.next}while(a!==p)}}catch(M){Qe(r,r.return,M)}}function Yi(t,r,a){try{var u=r.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var y=p.next;u=y;do{if((u.tag&t)===t){var w=u.inst,M=w.destroy;if(M!==void 0){w.destroy=void 0,p=r;var V=a,W=M;try{W()}catch(le){Qe(p,V,le)}}}u=u.next}while(u!==y)}}catch(le){Qe(r,r.return,le)}}function Wg(t){var r=t.updateQueue;if(r!==null){var a=t.stateNode;try{Ym(r,a)}catch(u){Qe(t,t.return,u)}}}function e0(t,r,a){a.props=_r(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(u){Qe(t,r,u)}}function Ca(t,r){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof a=="function"?t.refCleanup=a(u):a.current=u}}catch(p){Qe(t,r,p)}}function qn(t,r){var a=t.ref,u=t.refCleanup;if(a!==null)if(typeof u=="function")try{u()}catch(p){Qe(t,r,p)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(p){Qe(t,r,p)}else a.current=null}function t0(t){var r=t.type,a=t.memoizedProps,u=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&u.focus();break e;case"img":a.src?u.src=a.src:a.srcSet&&(u.srcset=a.srcSet)}}catch(p){Qe(t,t.return,p)}}function Xf(t,r,a){try{var u=t.stateNode;B2(u,t.type,a,r),u[Ot]=r}catch(p){Qe(t,t.return,p)}}function n0(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Qi(t.type)||t.tag===4}function Ff(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||n0(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Qi(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Gf(t,r,a){var u=t.tag;if(u===5||u===6)t=t.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(t),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=ri));else if(u!==4&&(u===27&&Qi(t.type)&&(a=t.stateNode,r=null),t=t.child,t!==null))for(Gf(t,r,a),t=t.sibling;t!==null;)Gf(t,r,a),t=t.sibling}function Ms(t,r,a){var u=t.tag;if(u===5||u===6)t=t.stateNode,r?a.insertBefore(t,r):a.appendChild(t);else if(u!==4&&(u===27&&Qi(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Ms(t,r,a),t=t.sibling;t!==null;)Ms(t,r,a),t=t.sibling}function i0(t){var r=t.stateNode,a=t.memoizedProps;try{for(var u=t.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);zt(r,u,a),r[kt]=t,r[Ot]=a}catch(y){Qe(t,t.return,y)}}var pi=!1,xt=!1,Pf=!1,r0=typeof WeakSet=="function"?WeakSet:Set,_t=null;function g2(t,r){if(t=t.containerInfo,md=Ks,t=gm(t),Ic(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var u=a.getSelection&&a.getSelection();if(u&&u.rangeCount!==0){a=u.anchorNode;var p=u.anchorOffset,y=u.focusNode;u=u.focusOffset;try{a.nodeType,y.nodeType}catch{a=null;break e}var w=0,M=-1,V=-1,W=0,le=0,oe=t,te=null;t:for(;;){for(var ie;oe!==a||p!==0&&oe.nodeType!==3||(M=w+p),oe!==y||u!==0&&oe.nodeType!==3||(V=w+u),oe.nodeType===3&&(w+=oe.nodeValue.length),(ie=oe.firstChild)!==null;)te=oe,oe=ie;for(;;){if(oe===t)break t;if(te===a&&++W===p&&(M=w),te===y&&++le===u&&(V=w),(ie=oe.nextSibling)!==null)break;oe=te,te=oe.parentNode}oe=ie}a=M===-1||V===-1?null:{start:M,end:V}}else a=null}a=a||{start:0,end:0}}else a=null;for(gd={focusedElem:t,selectionRange:a},Ks=!1,_t=r;_t!==null;)if(r=_t,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,_t=t;else for(;_t!==null;){switch(r=_t,y=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)p=t[a],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&y!==null){t=void 0,a=r,p=y.memoizedProps,y=y.memoizedState,u=a.stateNode;try{var me=_r(a.type,p);t=u.getSnapshotBeforeUpdate(me,y),u.__reactInternalSnapshotBeforeUpdate=t}catch(Se){Qe(a,a.return,Se)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,a=t.nodeType,a===9)bd(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":bd(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(l(163))}if(t=r.sibling,t!==null){t.return=r.return,_t=t;break}_t=r.return}}function l0(t,r,a){var u=a.flags;switch(a.tag){case 0:case 11:case 15:gi(t,a),u&4&&_a(5,a);break;case 1:if(gi(t,a),u&4)if(t=a.stateNode,r===null)try{t.componentDidMount()}catch(w){Qe(a,a.return,w)}else{var p=_r(a.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(p,r,t.__reactInternalSnapshotBeforeUpdate)}catch(w){Qe(a,a.return,w)}}u&64&&Wg(a),u&512&&Ca(a,a.return);break;case 3:if(gi(t,a),u&64&&(t=a.updateQueue,t!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{Ym(t,r)}catch(w){Qe(a,a.return,w)}}break;case 27:r===null&&u&4&&i0(a);case 26:case 5:gi(t,a),r===null&&u&4&&t0(a),u&512&&Ca(a,a.return);break;case 12:gi(t,a);break;case 31:gi(t,a),u&4&&s0(t,a);break;case 13:gi(t,a),u&4&&u0(t,a),u&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=N2.bind(null,a),X2(t,a))));break;case 22:if(u=a.memoizedState!==null||pi,!u){r=r!==null&&r.memoizedState!==null||xt,p=pi;var y=xt;pi=u,(xt=r)&&!y?yi(t,a,(a.subtreeFlags&8772)!==0):gi(t,a),pi=p,xt=y}break;case 30:break;default:gi(t,a)}}function a0(t){var r=t.alternate;r!==null&&(t.alternate=null,a0(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&Wl(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var lt=null,Ft=!1;function mi(t,r,a){for(a=a.child;a!==null;)o0(t,r,a),a=a.sibling}function o0(t,r,a){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(Ct,a)}catch{}switch(a.tag){case 26:xt||qn(a,r),mi(t,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:xt||qn(a,r);var u=lt,p=Ft;Qi(a.type)&&(lt=a.stateNode,Ft=!1),mi(t,r,a),La(a.stateNode),lt=u,Ft=p;break;case 5:xt||qn(a,r);case 6:if(u=lt,p=Ft,lt=null,mi(t,r,a),lt=u,Ft=p,lt!==null)if(Ft)try{(lt.nodeType===9?lt.body:lt.nodeName==="HTML"?lt.ownerDocument.body:lt).removeChild(a.stateNode)}catch(y){Qe(a,r,y)}else try{lt.removeChild(a.stateNode)}catch(y){Qe(a,r,y)}break;case 18:lt!==null&&(Ft?(t=lt,W0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),Nl(t)):W0(lt,a.stateNode));break;case 4:u=lt,p=Ft,lt=a.stateNode.containerInfo,Ft=!0,mi(t,r,a),lt=u,Ft=p;break;case 0:case 11:case 14:case 15:Yi(2,a,r),xt||Yi(4,a,r),mi(t,r,a);break;case 1:xt||(qn(a,r),u=a.stateNode,typeof u.componentWillUnmount=="function"&&e0(a,r,u)),mi(t,r,a);break;case 21:mi(t,r,a);break;case 22:xt=(u=xt)||a.memoizedState!==null,mi(t,r,a),xt=u;break;default:mi(t,r,a)}}function s0(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Nl(t)}catch(a){Qe(r,r.return,a)}}}function u0(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Nl(t)}catch(a){Qe(r,r.return,a)}}function y2(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new r0),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new r0),r;default:throw Error(l(435,t.tag))}}function zs(t,r){var a=y2(t);r.forEach(function(u){if(!a.has(u)){a.add(u);var p=_2.bind(null,t,u);u.then(p,p)}})}function Gt(t,r){var a=r.deletions;if(a!==null)for(var u=0;u<a.length;u++){var p=a[u],y=t,w=r,M=w;e:for(;M!==null;){switch(M.tag){case 27:if(Qi(M.type)){lt=M.stateNode,Ft=!1;break e}break;case 5:lt=M.stateNode,Ft=!1;break e;case 3:case 4:lt=M.stateNode.containerInfo,Ft=!0;break e}M=M.return}if(lt===null)throw Error(l(160));o0(y,w,p),lt=null,Ft=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)c0(r,t),r=r.sibling}var Tn=null;function c0(t,r){var a=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Gt(r,t),Pt(t),u&4&&(Yi(3,t,t.return),_a(3,t),Yi(5,t,t.return));break;case 1:Gt(r,t),Pt(t),u&512&&(xt||a===null||qn(a,a.return)),u&64&&pi&&(t=t.updateQueue,t!==null&&(u=t.callbacks,u!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?u:a.concat(u))));break;case 26:var p=Tn;if(Gt(r,t),Pt(t),u&512&&(xt||a===null||qn(a,a.return)),u&4){var y=a!==null?a.memoizedState:null;if(u=t.memoizedState,a===null)if(u===null)if(t.stateNode===null){e:{u=t.type,a=t.memoizedProps,p=p.ownerDocument||p;t:switch(u){case"title":y=p.getElementsByTagName("title")[0],(!y||y[cr]||y[kt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(u),p.head.insertBefore(y,p.querySelector("head > title"))),zt(y,u,a),y[kt]=t,pt(y),u=y;break e;case"link":var w=cy("link","href",p).get(u+(a.href||""));if(w){for(var M=0;M<w.length;M++)if(y=w[M],y.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&y.getAttribute("rel")===(a.rel==null?null:a.rel)&&y.getAttribute("title")===(a.title==null?null:a.title)&&y.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){w.splice(M,1);break t}}y=p.createElement(u),zt(y,u,a),p.head.appendChild(y);break;case"meta":if(w=cy("meta","content",p).get(u+(a.content||""))){for(M=0;M<w.length;M++)if(y=w[M],y.getAttribute("content")===(a.content==null?null:""+a.content)&&y.getAttribute("name")===(a.name==null?null:a.name)&&y.getAttribute("property")===(a.property==null?null:a.property)&&y.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&y.getAttribute("charset")===(a.charSet==null?null:a.charSet)){w.splice(M,1);break t}}y=p.createElement(u),zt(y,u,a),p.head.appendChild(y);break;default:throw Error(l(468,u))}y[kt]=t,pt(y),u=y}t.stateNode=u}else fy(p,t.type,t.stateNode);else t.stateNode=uy(p,u,t.memoizedProps);else y!==u?(y===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):y.count--,u===null?fy(p,t.type,t.stateNode):uy(p,u,t.memoizedProps)):u===null&&t.stateNode!==null&&Xf(t,t.memoizedProps,a.memoizedProps)}break;case 27:Gt(r,t),Pt(t),u&512&&(xt||a===null||qn(a,a.return)),a!==null&&u&4&&Xf(t,t.memoizedProps,a.memoizedProps);break;case 5:if(Gt(r,t),Pt(t),u&512&&(xt||a===null||qn(a,a.return)),t.flags&32){p=t.stateNode;try{Pr(p,"")}catch(me){Qe(t,t.return,me)}}u&4&&t.stateNode!=null&&(p=t.memoizedProps,Xf(t,p,a!==null?a.memoizedProps:p)),u&1024&&(Pf=!0);break;case 6:if(Gt(r,t),Pt(t),u&4){if(t.stateNode===null)throw Error(l(162));u=t.memoizedProps,a=t.stateNode;try{a.nodeValue=u}catch(me){Qe(t,t.return,me)}}break;case 3:if(Gs=null,p=Tn,Tn=Xs(r.containerInfo),Gt(r,t),Tn=p,Pt(t),u&4&&a!==null&&a.memoizedState.isDehydrated)try{Nl(r.containerInfo)}catch(me){Qe(t,t.return,me)}Pf&&(Pf=!1,f0(t));break;case 4:u=Tn,Tn=Xs(t.stateNode.containerInfo),Gt(r,t),Pt(t),Tn=u;break;case 12:Gt(r,t),Pt(t);break;case 31:Gt(r,t),Pt(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,zs(t,u)));break;case 13:Gt(r,t),Pt(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ds=St()),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,zs(t,u)));break;case 22:p=t.memoizedState!==null;var V=a!==null&&a.memoizedState!==null,W=pi,le=xt;if(pi=W||p,xt=le||V,Gt(r,t),xt=le,pi=W,Pt(t),u&8192)e:for(r=t.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(a===null||V||pi||xt||Cr(t)),a=null,r=t;;){if(r.tag===5||r.tag===26){if(a===null){V=a=r;try{if(y=V.stateNode,p)w=y.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{M=V.stateNode;var oe=V.memoizedProps.style,te=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;M.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(me){Qe(V,V.return,me)}}}else if(r.tag===6){if(a===null){V=r;try{V.stateNode.nodeValue=p?"":V.memoizedProps}catch(me){Qe(V,V.return,me)}}}else if(r.tag===18){if(a===null){V=r;try{var ie=V.stateNode;p?ey(ie,!0):ey(V.stateNode,!1)}catch(me){Qe(V,V.return,me)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;a===r&&(a=null),r=r.return}a===r&&(a=null),r.sibling.return=r.return,r=r.sibling}u&4&&(u=t.updateQueue,u!==null&&(a=u.retryQueue,a!==null&&(u.retryQueue=null,zs(t,a))));break;case 19:Gt(r,t),Pt(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,zs(t,u)));break;case 30:break;case 21:break;default:Gt(r,t),Pt(t)}}function Pt(t){var r=t.flags;if(r&2){try{for(var a,u=t.return;u!==null;){if(n0(u)){a=u;break}u=u.return}if(a==null)throw Error(l(160));switch(a.tag){case 27:var p=a.stateNode,y=Ff(t);Ms(t,y,p);break;case 5:var w=a.stateNode;a.flags&32&&(Pr(w,""),a.flags&=-33);var M=Ff(t);Ms(t,M,w);break;case 3:case 4:var V=a.stateNode.containerInfo,W=Ff(t);Gf(t,W,V);break;default:throw Error(l(161))}}catch(le){Qe(t,t.return,le)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function f0(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;f0(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function gi(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)l0(t,r.alternate,r),r=r.sibling}function Cr(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:Yi(4,r,r.return),Cr(r);break;case 1:qn(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&e0(r,r.return,a),Cr(r);break;case 27:La(r.stateNode);case 26:case 5:qn(r,r.return),Cr(r);break;case 22:r.memoizedState===null&&Cr(r);break;case 30:Cr(r);break;default:Cr(r)}t=t.sibling}}function yi(t,r,a){for(a=a&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var u=r.alternate,p=t,y=r,w=y.flags;switch(y.tag){case 0:case 11:case 15:yi(p,y,a),_a(4,y);break;case 1:if(yi(p,y,a),u=y,p=u.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(W){Qe(u,u.return,W)}if(u=y,p=u.updateQueue,p!==null){var M=u.stateNode;try{var V=p.shared.hiddenCallbacks;if(V!==null)for(p.shared.hiddenCallbacks=null,p=0;p<V.length;p++)Vm(V[p],M)}catch(W){Qe(u,u.return,W)}}a&&w&64&&Wg(y),Ca(y,y.return);break;case 27:i0(y);case 26:case 5:yi(p,y,a),a&&u===null&&w&4&&t0(y),Ca(y,y.return);break;case 12:yi(p,y,a);break;case 31:yi(p,y,a),a&&w&4&&s0(p,y);break;case 13:yi(p,y,a),a&&w&4&&u0(p,y);break;case 22:y.memoizedState===null&&yi(p,y,a),Ca(y,y.return);break;case 30:break;default:yi(p,y,a)}r=r.sibling}}function Zf(t,r){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&ha(a))}function Qf(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&ha(t))}function An(t,r,a,u){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)d0(t,r,a,u),r=r.sibling}function d0(t,r,a,u){var p=r.flags;switch(r.tag){case 0:case 11:case 15:An(t,r,a,u),p&2048&&_a(9,r);break;case 1:An(t,r,a,u);break;case 3:An(t,r,a,u),p&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&ha(t)));break;case 12:if(p&2048){An(t,r,a,u),t=r.stateNode;try{var y=r.memoizedProps,w=y.id,M=y.onPostCommit;typeof M=="function"&&M(w,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(V){Qe(r,r.return,V)}}else An(t,r,a,u);break;case 31:An(t,r,a,u);break;case 13:An(t,r,a,u);break;case 23:break;case 22:y=r.stateNode,w=r.alternate,r.memoizedState!==null?y._visibility&2?An(t,r,a,u):Ta(t,r):y._visibility&2?An(t,r,a,u):(y._visibility|=2,pl(t,r,a,u,(r.subtreeFlags&10256)!==0||!1)),p&2048&&Zf(w,r);break;case 24:An(t,r,a,u),p&2048&&Qf(r.alternate,r);break;default:An(t,r,a,u)}}function pl(t,r,a,u,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var y=t,w=r,M=a,V=u,W=w.flags;switch(w.tag){case 0:case 11:case 15:pl(y,w,M,V,p),_a(8,w);break;case 23:break;case 22:var le=w.stateNode;w.memoizedState!==null?le._visibility&2?pl(y,w,M,V,p):Ta(y,w):(le._visibility|=2,pl(y,w,M,V,p)),p&&W&2048&&Zf(w.alternate,w);break;case 24:pl(y,w,M,V,p),p&&W&2048&&Qf(w.alternate,w);break;default:pl(y,w,M,V,p)}r=r.sibling}}function Ta(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=t,u=r,p=u.flags;switch(u.tag){case 22:Ta(a,u),p&2048&&Zf(u.alternate,u);break;case 24:Ta(a,u),p&2048&&Qf(u.alternate,u);break;default:Ta(a,u)}r=r.sibling}}var Aa=8192;function ml(t,r,a){if(t.subtreeFlags&Aa)for(t=t.child;t!==null;)h0(t,r,a),t=t.sibling}function h0(t,r,a){switch(t.tag){case 26:ml(t,r,a),t.flags&Aa&&t.memoizedState!==null&&ik(a,Tn,t.memoizedState,t.memoizedProps);break;case 5:ml(t,r,a);break;case 3:case 4:var u=Tn;Tn=Xs(t.stateNode.containerInfo),ml(t,r,a),Tn=u;break;case 22:t.memoizedState===null&&(u=t.alternate,u!==null&&u.memoizedState!==null?(u=Aa,Aa=16777216,ml(t,r,a),Aa=u):ml(t,r,a));break;default:ml(t,r,a)}}function p0(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function Ma(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var u=r[a];_t=u,g0(u,t)}p0(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)m0(t),t=t.sibling}function m0(t){switch(t.tag){case 0:case 11:case 15:Ma(t),t.flags&2048&&Yi(9,t,t.return);break;case 3:Ma(t);break;case 12:Ma(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,js(t)):Ma(t);break;default:Ma(t)}}function js(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var u=r[a];_t=u,g0(u,t)}p0(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:Yi(8,r,r.return),js(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,js(r));break;default:js(r)}t=t.sibling}}function g0(t,r){for(;_t!==null;){var a=_t;switch(a.tag){case 0:case 11:case 15:Yi(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var u=a.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:ha(a.memoizedState.cache)}if(u=a.child,u!==null)u.return=a,_t=u;else e:for(a=t;_t!==null;){u=_t;var p=u.sibling,y=u.return;if(a0(u),u===a){_t=null;break e}if(p!==null){p.return=y,_t=p;break e}_t=y}}}var x2={getCacheForType:function(t){var r=At(mt),a=r.data.get(t);return a===void 0&&(a=t(),r.data.set(t,a)),a},cacheSignal:function(){return At(mt).controller.signal}},b2=typeof WeakMap=="function"?WeakMap:Map,Ge=0,et=null,De=null,Le=0,Ze=0,on=null,$i=!1,gl=!1,Kf=!1,xi=0,ut=0,Xi=0,Tr=0,Jf=0,sn=0,yl=0,za=null,Zt=null,Wf=!1,Ds=0,y0=0,Os=1/0,Rs=null,Fi=null,Et=0,Gi=null,xl=null,bi=0,ed=0,td=null,x0=null,ja=0,nd=null;function un(){return(Ge&2)!==0&&Le!==0?Le&-Le:D.T!==null?sd():Uo()}function b0(){if(sn===0)if((Le&536870912)===0||He){var t=qr;qr<<=1,(qr&3932160)===0&&(qr=262144),sn=t}else sn=536870912;return t=ln.current,t!==null&&(t.flags|=32),sn}function Qt(t,r,a){(t===et&&(Ze===2||Ze===9)||t.cancelPendingCommit!==null)&&(bl(t,0),Pi(t,Le,sn,!1)),ur(t,a),((Ge&2)===0||t!==et)&&(t===et&&((Ge&2)===0&&(Tr|=a),ut===4&&Pi(t,Le,sn,!1)),Vn(t))}function v0(t,r,a){if((Ge&6)!==0)throw Error(l(327));var u=!a&&(r&127)===0&&(r&t.expiredLanes)===0||sr(t,r),p=u?S2(t,r):rd(t,r,!0),y=u;do{if(p===0){gl&&!u&&Pi(t,r,0,!1);break}else{if(a=t.current.alternate,y&&!v2(a)){p=rd(t,r,!1),y=!1;continue}if(p===2){if(y=r,t.errorRecoveryDisabledLanes&y)var w=0;else w=t.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){r=w;e:{var M=t;p=za;var V=M.current.memoizedState.isDehydrated;if(V&&(bl(M,w).flags|=256),w=rd(M,w,!1),w!==2){if(Kf&&!V){M.errorRecoveryDisabledLanes|=y,Tr|=y,p=4;break e}y=Zt,Zt=p,y!==null&&(Zt===null?Zt=y:Zt.push.apply(Zt,y))}p=w}if(y=!1,p!==2)continue}}if(p===1){bl(t,0),Pi(t,r,0,!0);break}e:{switch(u=t,y=p,y){case 0:case 1:throw Error(l(345));case 4:if((r&4194048)!==r)break;case 6:Pi(u,r,sn,!$i);break e;case 2:Zt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((r&62914560)===r&&(p=Ds+300-St(),10<p)){if(Pi(u,r,sn,!$i),Yr(u,0,!0)!==0)break e;bi=r,u.timeoutHandle=K0(w0.bind(null,u,a,Zt,Rs,Wf,r,sn,Tr,yl,$i,y,"Throttled",-0,0),p);break e}w0(u,a,Zt,Rs,Wf,r,sn,Tr,yl,$i,y,null,-0,0)}}break}while(!0);Vn(t)}function w0(t,r,a,u,p,y,w,M,V,W,le,oe,te,ie){if(t.timeoutHandle=-1,oe=r.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ri},h0(r,y,oe);var me=(y&62914560)===y?Ds-St():(y&4194048)===y?y0-St():0;if(me=rk(oe,me),me!==null){bi=y,t.cancelPendingCommit=me(A0.bind(null,t,r,y,a,u,p,w,M,V,le,oe,null,te,ie)),Pi(t,y,w,!W);return}}A0(t,r,y,a,u,p,w,M,V)}function v2(t){for(var r=t;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var u=0;u<a.length;u++){var p=a[u],y=p.getSnapshot;p=p.value;try{if(!nn(y(),p))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Pi(t,r,a,u){r&=~Jf,r&=~Tr,t.suspendedLanes|=r,t.pingedLanes&=~r,u&&(t.warmLanes|=r),u=t.expirationTimes;for(var p=r;0<p;){var y=31-Pe(p),w=1<<y;u[y]=-1,p&=~w}a!==0&&Lo(t,a,r)}function Ls(){return(Ge&6)===0?(Da(0),!1):!0}function id(){if(De!==null){if(Ze===0)var t=De.return;else t=De,si=br=null,bf(t),ul=null,ma=0,t=De;for(;t!==null;)Jg(t.alternate,t),t=t.return;De=null}}function bl(t,r){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,I2(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),bi=0,id(),et=t,De=a=ai(t.current,null),Le=r,Ze=0,on=null,$i=!1,gl=sr(t,r),Kf=!1,yl=sn=Jf=Tr=Xi=ut=0,Zt=za=null,Wf=!1,(r&8)!==0&&(r|=r&32);var u=t.entangledLanes;if(u!==0)for(t=t.entanglements,u&=r;0<u;){var p=31-Pe(u),y=1<<p;r|=t[p],u&=~y}return xi=r,is(),a}function S0(t,r){Ce=null,D.H=ka,r===sl||r===fs?(r=Hm(),Ze=3):r===of?(r=Hm(),Ze=4):Ze=r===Rf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,on=r,De===null&&(ut=1,Ns(t,mn(r,t.current)))}function k0(){var t=ln.current;return t===null?!0:(Le&4194048)===Le?bn===null:(Le&62914560)===Le||(Le&536870912)!==0?t===bn:!1}function E0(){var t=D.H;return D.H=ka,t===null?ka:t}function N0(){var t=D.A;return D.A=x2,t}function Bs(){ut=4,$i||(Le&4194048)!==Le&&ln.current!==null||(gl=!0),(Xi&134217727)===0&&(Tr&134217727)===0||et===null||Pi(et,Le,sn,!1)}function rd(t,r,a){var u=Ge;Ge|=2;var p=E0(),y=N0();(et!==t||Le!==r)&&(Rs=null,bl(t,r)),r=!1;var w=ut;e:do try{if(Ze!==0&&De!==null){var M=De,V=on;switch(Ze){case 8:id(),w=6;break e;case 3:case 2:case 9:case 6:ln.current===null&&(r=!0);var W=Ze;if(Ze=0,on=null,vl(t,M,V,W),a&&gl){w=0;break e}break;default:W=Ze,Ze=0,on=null,vl(t,M,V,W)}}w2(),w=ut;break}catch(le){S0(t,le)}while(!0);return r&&t.shellSuspendCounter++,si=br=null,Ge=u,D.H=p,D.A=y,De===null&&(et=null,Le=0,is()),w}function w2(){for(;De!==null;)_0(De)}function S2(t,r){var a=Ge;Ge|=2;var u=E0(),p=N0();et!==t||Le!==r?(Rs=null,Os=St()+500,bl(t,r)):gl=sr(t,r);e:do try{if(Ze!==0&&De!==null){r=De;var y=on;t:switch(Ze){case 1:Ze=0,on=null,vl(t,r,y,1);break;case 2:case 9:if(Lm(y)){Ze=0,on=null,C0(r);break}r=function(){Ze!==2&&Ze!==9||et!==t||(Ze=7),Vn(t)},y.then(r,r);break e;case 3:Ze=7;break e;case 4:Ze=5;break e;case 7:Lm(y)?(Ze=0,on=null,C0(r)):(Ze=0,on=null,vl(t,r,y,7));break;case 5:var w=null;switch(De.tag){case 26:w=De.memoizedState;case 5:case 27:var M=De;if(w?dy(w):M.stateNode.complete){Ze=0,on=null;var V=M.sibling;if(V!==null)De=V;else{var W=M.return;W!==null?(De=W,Hs(W)):De=null}break t}}Ze=0,on=null,vl(t,r,y,5);break;case 6:Ze=0,on=null,vl(t,r,y,6);break;case 8:id(),ut=6;break e;default:throw Error(l(462))}}k2();break}catch(le){S0(t,le)}while(!0);return si=br=null,D.H=u,D.A=p,Ge=a,De!==null?0:(et=null,Le=0,is(),ut)}function k2(){for(;De!==null&&!Jn();)_0(De)}function _0(t){var r=Qg(t.alternate,t,xi);t.memoizedProps=t.pendingProps,r===null?Hs(t):De=r}function C0(t){var r=t,a=r.alternate;switch(r.tag){case 15:case 0:r=$g(a,r,r.pendingProps,r.type,void 0,Le);break;case 11:r=$g(a,r,r.pendingProps,r.type.render,r.ref,Le);break;case 5:bf(r);default:Jg(a,r),r=De=Nm(r,xi),r=Qg(a,r,xi)}t.memoizedProps=t.pendingProps,r===null?Hs(t):De=r}function vl(t,r,a,u){si=br=null,bf(r),ul=null,ma=0;var p=r.return;try{if(f2(t,p,r,a,Le)){ut=1,Ns(t,mn(a,t.current)),De=null;return}}catch(y){if(p!==null)throw De=p,y;ut=1,Ns(t,mn(a,t.current)),De=null;return}r.flags&32768?(He||u===1?t=!0:gl||(Le&536870912)!==0?t=!1:($i=t=!0,(u===2||u===9||u===3||u===6)&&(u=ln.current,u!==null&&u.tag===13&&(u.flags|=16384))),T0(r,t)):Hs(r)}function Hs(t){var r=t;do{if((r.flags&32768)!==0){T0(r,$i);return}t=r.return;var a=p2(r.alternate,r,xi);if(a!==null){De=a;return}if(r=r.sibling,r!==null){De=r;return}De=r=t}while(r!==null);ut===0&&(ut=5)}function T0(t,r){do{var a=m2(t.alternate,t);if(a!==null){a.flags&=32767,De=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(t=t.sibling,t!==null)){De=t;return}De=t=a}while(t!==null);ut=6,De=null}function A0(t,r,a,u,p,y,w,M,V){t.cancelPendingCommit=null;do Us();while(Et!==0);if((Ge&6)!==0)throw Error(l(327));if(r!==null){if(r===t.current)throw Error(l(177));if(y=r.lanes|r.childLanes,y|=Xc,wc(t,a,y,w,M,V),t===et&&(De=et=null,Le=0),xl=r,Gi=t,bi=a,ed=y,td=p,x0=u,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,C2(we,function(){return O0(),null})):(t.callbackNode=null,t.callbackPriority=0),u=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||u){u=D.T,D.T=null,p=q.p,q.p=2,w=Ge,Ge|=4;try{g2(t,r,a)}finally{Ge=w,q.p=p,D.T=u}}Et=1,M0(),z0(),j0()}}function M0(){if(Et===1){Et=0;var t=Gi,r=xl,a=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||a){a=D.T,D.T=null;var u=q.p;q.p=2;var p=Ge;Ge|=4;try{c0(r,t);var y=gd,w=gm(t.containerInfo),M=y.focusedElem,V=y.selectionRange;if(w!==M&&M&&M.ownerDocument&&mm(M.ownerDocument.documentElement,M)){if(V!==null&&Ic(M)){var W=V.start,le=V.end;if(le===void 0&&(le=W),"selectionStart"in M)M.selectionStart=W,M.selectionEnd=Math.min(le,M.value.length);else{var oe=M.ownerDocument||document,te=oe&&oe.defaultView||window;if(te.getSelection){var ie=te.getSelection(),me=M.textContent.length,Se=Math.min(V.start,me),We=V.end===void 0?Se:Math.min(V.end,me);!ie.extend&&Se>We&&(w=We,We=Se,Se=w);var Q=pm(M,Se),F=pm(M,We);if(Q&&F&&(ie.rangeCount!==1||ie.anchorNode!==Q.node||ie.anchorOffset!==Q.offset||ie.focusNode!==F.node||ie.focusOffset!==F.offset)){var J=oe.createRange();J.setStart(Q.node,Q.offset),ie.removeAllRanges(),Se>We?(ie.addRange(J),ie.extend(F.node,F.offset)):(J.setEnd(F.node,F.offset),ie.addRange(J))}}}}for(oe=[],ie=M;ie=ie.parentNode;)ie.nodeType===1&&oe.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<oe.length;M++){var ae=oe[M];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}Ks=!!md,gd=md=null}finally{Ge=p,q.p=u,D.T=a}}t.current=r,Et=2}}function z0(){if(Et===2){Et=0;var t=Gi,r=xl,a=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||a){a=D.T,D.T=null;var u=q.p;q.p=2;var p=Ge;Ge|=4;try{l0(t,r.alternate,r)}finally{Ge=p,q.p=u,D.T=a}}Et=3}}function j0(){if(Et===4||Et===3){Et=0,Wn();var t=Gi,r=xl,a=bi,u=x0;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Et=5:(Et=0,xl=Gi=null,D0(t,t.pendingLanes));var p=t.pendingLanes;if(p===0&&(Fi=null),Jl(a),r=r.stateNode,ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(Ct,r,void 0,(r.current.flags&128)===128)}catch{}if(u!==null){r=D.T,p=q.p,q.p=2,D.T=null;try{for(var y=t.onRecoverableError,w=0;w<u.length;w++){var M=u[w];y(M.value,{componentStack:M.stack})}}finally{D.T=r,q.p=p}}(bi&3)!==0&&Us(),Vn(t),p=t.pendingLanes,(a&261930)!==0&&(p&42)!==0?t===nd?ja++:(ja=0,nd=t):ja=0,Da(0)}}function D0(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,ha(r)))}function Us(){return M0(),z0(),j0(),O0()}function O0(){if(Et!==5)return!1;var t=Gi,r=ed;ed=0;var a=Jl(bi),u=D.T,p=q.p;try{q.p=32>a?32:a,D.T=null,a=td,td=null;var y=Gi,w=bi;if(Et=0,xl=Gi=null,bi=0,(Ge&6)!==0)throw Error(l(331));var M=Ge;if(Ge|=4,m0(y.current),d0(y,y.current,w,a),Ge=M,Da(0,!1),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(Ct,y)}catch{}return!0}finally{q.p=p,D.T=u,D0(t,r)}}function R0(t,r,a){r=mn(a,r),r=Of(t.stateNode,r,2),t=Ii(t,r,2),t!==null&&(ur(t,2),Vn(t))}function Qe(t,r,a){if(t.tag===3)R0(t,t,a);else for(;r!==null;){if(r.tag===3){R0(r,t,a);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Fi===null||!Fi.has(u))){t=mn(a,t),a=Lg(2),u=Ii(r,a,2),u!==null&&(Bg(a,u,r,t),ur(u,2),Vn(u));break}}r=r.return}}function ld(t,r,a){var u=t.pingCache;if(u===null){u=t.pingCache=new b2;var p=new Set;u.set(r,p)}else p=u.get(r),p===void 0&&(p=new Set,u.set(r,p));p.has(a)||(Kf=!0,p.add(a),t=E2.bind(null,t,r,a),r.then(t,t))}function E2(t,r,a){var u=t.pingCache;u!==null&&u.delete(r),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,et===t&&(Le&a)===a&&(ut===4||ut===3&&(Le&62914560)===Le&&300>St()-Ds?(Ge&2)===0&&bl(t,0):Jf|=a,yl===Le&&(yl=0)),Vn(t)}function L0(t,r){r===0&&(r=Ro()),t=gr(t,r),t!==null&&(ur(t,r),Vn(t))}function N2(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),L0(t,a)}function _2(t,r){var a=0;switch(t.tag){case 31:case 13:var u=t.stateNode,p=t.memoizedState;p!==null&&(a=p.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(l(314))}u!==null&&u.delete(r),L0(t,a)}function C2(t,r){return Vt(t,r)}var Is=null,wl=null,ad=!1,qs=!1,od=!1,Zi=0;function Vn(t){t!==wl&&t.next===null&&(wl===null?Is=wl=t:wl=wl.next=t),qs=!0,ad||(ad=!0,A2())}function Da(t,r){if(!od&&qs){od=!0;do for(var a=!1,u=Is;u!==null;){if(t!==0){var p=u.pendingLanes;if(p===0)var y=0;else{var w=u.suspendedLanes,M=u.pingedLanes;y=(1<<31-Pe(42|t)+1)-1,y&=p&~(w&~M),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(a=!0,I0(u,y))}else y=Le,y=Yr(u,u===et?y:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(y&3)===0||sr(u,y)||(a=!0,I0(u,y));u=u.next}while(a);od=!1}}function T2(){B0()}function B0(){qs=ad=!1;var t=0;Zi!==0&&U2()&&(t=Zi);for(var r=St(),a=null,u=Is;u!==null;){var p=u.next,y=H0(u,r);y===0?(u.next=null,a===null?Is=p:a.next=p,p===null&&(wl=a)):(a=u,(t!==0||(y&3)!==0)&&(qs=!0)),u=p}Et!==0&&Et!==5||Da(t),Zi!==0&&(Zi=0)}function H0(t,r){for(var a=t.suspendedLanes,u=t.pingedLanes,p=t.expirationTimes,y=t.pendingLanes&-62914561;0<y;){var w=31-Pe(y),M=1<<w,V=p[w];V===-1?((M&a)===0||(M&u)!==0)&&(p[w]=vc(M,r)):V<=r&&(t.expiredLanes|=M),y&=~M}if(r=et,a=Le,a=Yr(t,t===r?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u=t.callbackNode,a===0||t===r&&(Ze===2||Ze===9)||t.cancelPendingCommit!==null)return u!==null&&u!==null&&En(u),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||sr(t,a)){if(r=a&-a,r===t.callbackPriority)return r;switch(u!==null&&En(u),Jl(a)){case 2:case 8:a=he;break;case 32:a=we;break;case 268435456:a=Ie;break;default:a=we}return u=U0.bind(null,t),a=Vt(a,u),t.callbackPriority=r,t.callbackNode=a,r}return u!==null&&u!==null&&En(u),t.callbackPriority=2,t.callbackNode=null,2}function U0(t,r){if(Et!==0&&Et!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Us()&&t.callbackNode!==a)return null;var u=Le;return u=Yr(t,t===et?u:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u===0?null:(v0(t,u,r),H0(t,St()),t.callbackNode!=null&&t.callbackNode===a?U0.bind(null,t):null)}function I0(t,r){if(Us())return null;v0(t,r,!0)}function A2(){q2(function(){(Ge&6)!==0?Vt(re,T2):B0()})}function sd(){if(Zi===0){var t=al;t===0&&(t=Ir,Ir<<=1,(Ir&261888)===0&&(Ir=256)),Zi=t}return Zi}function q0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Zo(""+t)}function V0(t,r){var a=r.ownerDocument.createElement("input");return a.name=r.name,a.value=r.value,t.id&&a.setAttribute("form",t.id),r.parentNode.insertBefore(a,r),t=new FormData(t),a.parentNode.removeChild(a),t}function M2(t,r,a,u,p){if(r==="submit"&&a&&a.stateNode===p){var y=q0((p[Ot]||null).action),w=u.submitter;w&&(r=(r=w[Ot]||null)?q0(r.formAction):w.getAttribute("formAction"),r!==null&&(y=r,w=null));var M=new Wo("action","action",null,u,p);t.push({event:M,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Zi!==0){var V=w?V0(p,w):new FormData(p);Tf(a,{pending:!0,data:V,method:p.method,action:y},null,V)}}else typeof y=="function"&&(M.preventDefault(),V=w?V0(p,w):new FormData(p),Tf(a,{pending:!0,data:V,method:p.method,action:y},y,V))},currentTarget:p}]})}}for(var ud=0;ud<$c.length;ud++){var cd=$c[ud],z2=cd.toLowerCase(),j2=cd[0].toUpperCase()+cd.slice(1);Cn(z2,"on"+j2)}Cn(bm,"onAnimationEnd"),Cn(vm,"onAnimationIteration"),Cn(wm,"onAnimationStart"),Cn("dblclick","onDoubleClick"),Cn("focusin","onFocus"),Cn("focusout","onBlur"),Cn(PS,"onTransitionRun"),Cn(ZS,"onTransitionStart"),Cn(QS,"onTransitionCancel"),Cn(Sm,"onTransitionEnd"),ji("onMouseEnter",["mouseout","mouseover"]),ji("onMouseLeave",["mouseout","mouseover"]),ji("onPointerEnter",["pointerout","pointerover"]),ji("onPointerLeave",["pointerout","pointerover"]),ni("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ni("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ni("onBeforeInput",["compositionend","keypress","textInput","paste"]),ni("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ni("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ni("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Oa="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(" "),D2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Oa));function Y0(t,r){r=(r&4)!==0;for(var a=0;a<t.length;a++){var u=t[a],p=u.event;u=u.listeners;e:{var y=void 0;if(r)for(var w=u.length-1;0<=w;w--){var M=u[w],V=M.instance,W=M.currentTarget;if(M=M.listener,V!==y&&p.isPropagationStopped())break e;y=M,p.currentTarget=W;try{y(p)}catch(le){ns(le)}p.currentTarget=null,y=V}else for(w=0;w<u.length;w++){if(M=u[w],V=M.instance,W=M.currentTarget,M=M.listener,V!==y&&p.isPropagationStopped())break e;y=M,p.currentTarget=W;try{y(p)}catch(le){ns(le)}p.currentTarget=null,y=V}}}}function Oe(t,r){var a=r[$r];a===void 0&&(a=r[$r]=new Set);var u=t+"__bubble";a.has(u)||($0(r,t,2,!1),a.add(u))}function fd(t,r,a){var u=0;r&&(u|=4),$0(a,t,u,r)}var Vs="_reactListening"+Math.random().toString(36).slice(2);function dd(t){if(!t[Vs]){t[Vs]=!0,Yo.forEach(function(a){a!=="selectionchange"&&(D2.has(a)||fd(a,!1,t),fd(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[Vs]||(r[Vs]=!0,fd("selectionchange",!1,r))}}function $0(t,r,a,u){switch(by(r)){case 2:var p=ok;break;case 8:p=sk;break;default:p=Cd}a=p.bind(null,r,a,t),p=void 0,!zc||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),u?p!==void 0?t.addEventListener(r,a,{capture:!0,passive:p}):t.addEventListener(r,a,!0):p!==void 0?t.addEventListener(r,a,{passive:p}):t.addEventListener(r,a,!1)}function hd(t,r,a,u,p){var y=u;if((r&1)===0&&(r&2)===0&&u!==null)e:for(;;){if(u===null)return;var w=u.tag;if(w===3||w===4){var M=u.stateNode.containerInfo;if(M===p)break;if(w===4)for(w=u.return;w!==null;){var V=w.tag;if((V===3||V===4)&&w.stateNode.containerInfo===p)return;w=w.return}for(;M!==null;){if(w=Ti(M),w===null)return;if(V=w.tag,V===5||V===6||V===26||V===27){u=y=w;continue e}M=M.parentNode}}u=u.return}Zp(function(){var W=y,le=Ac(a),oe=[];e:{var te=km.get(t);if(te!==void 0){var ie=Wo,me=t;switch(t){case"keypress":if(Ko(a)===0)break e;case"keydown":case"keyup":ie=_S;break;case"focusin":me="focus",ie=Rc;break;case"focusout":me="blur",ie=Rc;break;case"beforeblur":case"afterblur":ie=Rc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=Jp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=pS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=AS;break;case bm:case vm:case wm:ie=yS;break;case Sm:ie=zS;break;case"scroll":case"scrollend":ie=dS;break;case"wheel":ie=DS;break;case"copy":case"cut":case"paste":ie=bS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=em;break;case"toggle":case"beforetoggle":ie=RS}var Se=(r&4)!==0,We=!Se&&(t==="scroll"||t==="scrollend"),Q=Se?te!==null?te+"Capture":null:te;Se=[];for(var F=W,J;F!==null;){var ae=F;if(J=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||J===null||Q===null||(ae=na(F,Q),ae!=null&&Se.push(Ra(F,ae,J))),We)break;F=F.return}0<Se.length&&(te=new ie(te,me,null,a,le),oe.push({event:te,listeners:Se}))}}if((r&7)===0){e:{if(te=t==="mouseover"||t==="pointerover",ie=t==="mouseout"||t==="pointerout",te&&a!==Tc&&(me=a.relatedTarget||a.fromElement)&&(Ti(me)||me[ti]))break e;if((ie||te)&&(te=le.window===le?le:(te=le.ownerDocument)?te.defaultView||te.parentWindow:window,ie?(me=a.relatedTarget||a.toElement,ie=W,me=me?Ti(me):null,me!==null&&(We=s(me),Se=me.tag,me!==We||Se!==5&&Se!==27&&Se!==6)&&(me=null)):(ie=null,me=W),ie!==me)){if(Se=Jp,ae="onMouseLeave",Q="onMouseEnter",F="mouse",(t==="pointerout"||t==="pointerover")&&(Se=em,ae="onPointerLeave",Q="onPointerEnter",F="pointer"),We=ie==null?te:Mi(ie),J=me==null?te:Mi(me),te=new Se(ae,F+"leave",ie,a,le),te.target=We,te.relatedTarget=J,ae=null,Ti(le)===W&&(Se=new Se(Q,F+"enter",me,a,le),Se.target=J,Se.relatedTarget=We,ae=Se),We=ae,ie&&me)t:{for(Se=O2,Q=ie,F=me,J=0,ae=Q;ae;ae=Se(ae))J++;ae=0;for(var xe=F;xe;xe=Se(xe))ae++;for(;0<J-ae;)Q=Se(Q),J--;for(;0<ae-J;)F=Se(F),ae--;for(;J--;){if(Q===F||F!==null&&Q===F.alternate){Se=Q;break t}Q=Se(Q),F=Se(F)}Se=null}else Se=null;ie!==null&&X0(oe,te,ie,Se,!1),me!==null&&We!==null&&X0(oe,We,me,Se,!0)}}e:{if(te=W?Mi(W):window,ie=te.nodeName&&te.nodeName.toLowerCase(),ie==="select"||ie==="input"&&te.type==="file")var $e=sm;else if(am(te))if(um)$e=XS;else{$e=YS;var ge=VS}else ie=te.nodeName,!ie||ie.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?W&&Cc(W.elementType)&&($e=sm):$e=$S;if($e&&($e=$e(t,W))){om(oe,$e,a,le);break e}ge&&ge(t,te,W),t==="focusout"&&W&&te.type==="number"&&W.memoizedProps.value!=null&&ta(te,"number",te.value)}switch(ge=W?Mi(W):window,t){case"focusin":(am(ge)||ge.contentEditable==="true")&&(Jr=ge,qc=W,ca=null);break;case"focusout":ca=qc=Jr=null;break;case"mousedown":Vc=!0;break;case"contextmenu":case"mouseup":case"dragend":Vc=!1,ym(oe,a,le);break;case"selectionchange":if(GS)break;case"keydown":case"keyup":ym(oe,a,le)}var Te;if(Bc)e:{switch(t){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else Kr?rm(t,a)&&(Be="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(Be="onCompositionStart");Be&&(tm&&a.locale!=="ko"&&(Kr||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&Kr&&(Te=Qp()):(Di=le,jc="value"in Di?Di.value:Di.textContent,Kr=!0)),ge=Ys(W,Be),0<ge.length&&(Be=new Wp(Be,t,null,a,le),oe.push({event:Be,listeners:ge}),Te?Be.data=Te:(Te=lm(a),Te!==null&&(Be.data=Te)))),(Te=BS?HS(t,a):US(t,a))&&(Be=Ys(W,"onBeforeInput"),0<Be.length&&(ge=new Wp("onBeforeInput","beforeinput",null,a,le),oe.push({event:ge,listeners:Be}),ge.data=Te)),M2(oe,t,W,a,le)}Y0(oe,r)})}function Ra(t,r,a){return{instance:t,listener:r,currentTarget:a}}function Ys(t,r){for(var a=r+"Capture",u=[];t!==null;){var p=t,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=na(t,a),p!=null&&u.unshift(Ra(t,p,y)),p=na(t,r),p!=null&&u.push(Ra(t,p,y))),t.tag===3)return u;t=t.return}return[]}function O2(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function X0(t,r,a,u,p){for(var y=r._reactName,w=[];a!==null&&a!==u;){var M=a,V=M.alternate,W=M.stateNode;if(M=M.tag,V!==null&&V===u)break;M!==5&&M!==26&&M!==27||W===null||(V=W,p?(W=na(a,y),W!=null&&w.unshift(Ra(a,W,V))):p||(W=na(a,y),W!=null&&w.push(Ra(a,W,V)))),a=a.return}w.length!==0&&t.push({event:r,listeners:w})}var R2=/\r\n?/g,L2=/\u0000|\uFFFD/g;function F0(t){return(typeof t=="string"?t:""+t).replace(R2,`
|
|
9
|
+
`).replace(L2,"")}function G0(t,r){return r=F0(r),F0(t)===r}function Je(t,r,a,u,p,y){switch(a){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||Pr(t,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&Pr(t,""+u);break;case"className":Fr(t,"class",u);break;case"tabIndex":Fr(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Fr(t,a,u);break;case"style":Gp(t,u,y);break;case"data":if(r!=="object"){Fr(t,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||a!=="href")){t.removeAttribute(a);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(a);break}u=Zo(""+u),t.setAttribute(a,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(a,"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"&&(a==="formAction"?(r!=="input"&&Je(t,r,"name",p.name,p,null),Je(t,r,"formEncType",p.formEncType,p,null),Je(t,r,"formMethod",p.formMethod,p,null),Je(t,r,"formTarget",p.formTarget,p,null)):(Je(t,r,"encType",p.encType,p,null),Je(t,r,"method",p.method,p,null),Je(t,r,"target",p.target,p,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(a);break}u=Zo(""+u),t.setAttribute(a,u);break;case"onClick":u!=null&&(t.onclick=ri);break;case"onScroll":u!=null&&Oe("scroll",t);break;case"onScrollEnd":u!=null&&Oe("scrollend",t);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(l(61));if(a=u.__html,a!=null){if(p.children!=null)throw Error(l(60));t.innerHTML=a}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}a=Zo(""+u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(a,""+u):t.removeAttribute(a);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":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":u===!0?t.setAttribute(a,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(a,u):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(a,u):t.removeAttribute(a);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(a):t.setAttribute(a,u);break;case"popover":Oe("beforetoggle",t),Oe("toggle",t),Xr(t,"popover",u);break;case"xlinkActuate":_n(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":_n(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":_n(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":_n(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":_n(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":_n(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":_n(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":_n(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":_n(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Xr(t,"is",u);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=cS.get(a)||a,Xr(t,a,u))}}function pd(t,r,a,u,p,y){switch(a){case"style":Gp(t,u,y);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(l(61));if(a=u.__html,a!=null){if(p.children!=null)throw Error(l(60));t.innerHTML=a}}break;case"children":typeof u=="string"?Pr(t,u):(typeof u=="number"||typeof u=="bigint")&&Pr(t,""+u);break;case"onScroll":u!=null&&Oe("scroll",t);break;case"onScrollEnd":u!=null&&Oe("scrollend",t);break;case"onClick":u!=null&&(t.onclick=ri);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$o.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(p=a.endsWith("Capture"),r=a.slice(2,p?a.length-7:void 0),y=t[Ot]||null,y=y!=null?y[a]:null,typeof y=="function"&&t.removeEventListener(r,y,p),typeof u=="function")){typeof y!="function"&&y!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(r,u,p);break e}a in t?t[a]=u:u===!0?t.setAttribute(a,""):Xr(t,a,u)}}}function zt(t,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Oe("error",t),Oe("load",t);var u=!1,p=!1,y;for(y in a)if(a.hasOwnProperty(y)){var w=a[y];if(w!=null)switch(y){case"src":u=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,r));default:Je(t,r,y,w,a,null)}}p&&Je(t,r,"srcSet",a.srcSet,a,null),u&&Je(t,r,"src",a.src,a,null);return;case"input":Oe("invalid",t);var M=y=w=p=null,V=null,W=null;for(u in a)if(a.hasOwnProperty(u)){var le=a[u];if(le!=null)switch(u){case"name":p=le;break;case"type":w=le;break;case"checked":V=le;break;case"defaultChecked":W=le;break;case"value":y=le;break;case"defaultValue":M=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(l(137,r));break;default:Je(t,r,u,le,a,null)}}Po(t,y,M,V,W,w,p,!1);return;case"select":Oe("invalid",t),u=w=y=null;for(p in a)if(a.hasOwnProperty(p)&&(M=a[p],M!=null))switch(p){case"value":y=M;break;case"defaultValue":w=M;break;case"multiple":u=M;default:Je(t,r,p,M,a,null)}r=y,a=w,t.multiple=!!u,r!=null?ii(t,!!u,r,!1):a!=null&&ii(t,!!u,a,!0);return;case"textarea":Oe("invalid",t),y=p=u=null;for(w in a)if(a.hasOwnProperty(w)&&(M=a[w],M!=null))switch(w){case"value":u=M;break;case"defaultValue":p=M;break;case"children":y=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(l(91));break;default:Je(t,r,w,M,a,null)}Xp(t,u,p,y);return;case"option":for(V in a)a.hasOwnProperty(V)&&(u=a[V],u!=null)&&(V==="selected"?t.selected=u&&typeof u!="function"&&typeof u!="symbol":Je(t,r,V,u,a,null));return;case"dialog":Oe("beforetoggle",t),Oe("toggle",t),Oe("cancel",t),Oe("close",t);break;case"iframe":case"object":Oe("load",t);break;case"video":case"audio":for(u=0;u<Oa.length;u++)Oe(Oa[u],t);break;case"image":Oe("error",t),Oe("load",t);break;case"details":Oe("toggle",t);break;case"embed":case"source":case"link":Oe("error",t),Oe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in a)if(a.hasOwnProperty(W)&&(u=a[W],u!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,r));default:Je(t,r,W,u,a,null)}return;default:if(Cc(r)){for(le in a)a.hasOwnProperty(le)&&(u=a[le],u!==void 0&&pd(t,r,le,u,a,void 0));return}}for(M in a)a.hasOwnProperty(M)&&(u=a[M],u!=null&&Je(t,r,M,u,a,null))}function B2(t,r,a,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,w=null,M=null,V=null,W=null,le=null;for(ie in a){var oe=a[ie];if(a.hasOwnProperty(ie)&&oe!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":V=oe;default:u.hasOwnProperty(ie)||Je(t,r,ie,null,u,oe)}}for(var te in u){var ie=u[te];if(oe=a[te],u.hasOwnProperty(te)&&(ie!=null||oe!=null))switch(te){case"type":y=ie;break;case"name":p=ie;break;case"checked":W=ie;break;case"defaultChecked":le=ie;break;case"value":w=ie;break;case"defaultValue":M=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(l(137,r));break;default:ie!==oe&&Je(t,r,te,ie,u,oe)}}dr(t,w,M,V,W,le,y,p);return;case"select":ie=w=M=te=null;for(y in a)if(V=a[y],a.hasOwnProperty(y)&&V!=null)switch(y){case"value":break;case"multiple":ie=V;default:u.hasOwnProperty(y)||Je(t,r,y,null,u,V)}for(p in u)if(y=u[p],V=a[p],u.hasOwnProperty(p)&&(y!=null||V!=null))switch(p){case"value":te=y;break;case"defaultValue":M=y;break;case"multiple":w=y;default:y!==V&&Je(t,r,p,y,u,V)}r=M,a=w,u=ie,te!=null?ii(t,!!a,te,!1):!!u!=!!a&&(r!=null?ii(t,!!a,r,!0):ii(t,!!a,a?[]:"",!1));return;case"textarea":ie=te=null;for(M in a)if(p=a[M],a.hasOwnProperty(M)&&p!=null&&!u.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:Je(t,r,M,null,u,p)}for(w in u)if(p=u[w],y=a[w],u.hasOwnProperty(w)&&(p!=null||y!=null))switch(w){case"value":te=p;break;case"defaultValue":ie=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(l(91));break;default:p!==y&&Je(t,r,w,p,u,y)}$p(t,te,ie);return;case"option":for(var me in a)te=a[me],a.hasOwnProperty(me)&&te!=null&&!u.hasOwnProperty(me)&&(me==="selected"?t.selected=!1:Je(t,r,me,null,u,te));for(V in u)te=u[V],ie=a[V],u.hasOwnProperty(V)&&te!==ie&&(te!=null||ie!=null)&&(V==="selected"?t.selected=te&&typeof te!="function"&&typeof te!="symbol":Je(t,r,V,te,u,ie));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 Se in a)te=a[Se],a.hasOwnProperty(Se)&&te!=null&&!u.hasOwnProperty(Se)&&Je(t,r,Se,null,u,te);for(W in u)if(te=u[W],ie=a[W],u.hasOwnProperty(W)&&te!==ie&&(te!=null||ie!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(l(137,r));break;default:Je(t,r,W,te,u,ie)}return;default:if(Cc(r)){for(var We in a)te=a[We],a.hasOwnProperty(We)&&te!==void 0&&!u.hasOwnProperty(We)&&pd(t,r,We,void 0,u,te);for(le in u)te=u[le],ie=a[le],!u.hasOwnProperty(le)||te===ie||te===void 0&&ie===void 0||pd(t,r,le,te,u,ie);return}}for(var Q in a)te=a[Q],a.hasOwnProperty(Q)&&te!=null&&!u.hasOwnProperty(Q)&&Je(t,r,Q,null,u,te);for(oe in u)te=u[oe],ie=a[oe],!u.hasOwnProperty(oe)||te===ie||te==null&&ie==null||Je(t,r,oe,te,u,ie)}function P0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function H2(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,a=performance.getEntriesByType("resource"),u=0;u<a.length;u++){var p=a[u],y=p.transferSize,w=p.initiatorType,M=p.duration;if(y&&M&&P0(w)){for(w=0,M=p.responseEnd,u+=1;u<a.length;u++){var V=a[u],W=V.startTime;if(W>M)break;var le=V.transferSize,oe=V.initiatorType;le&&P0(oe)&&(V=V.responseEnd,w+=le*(V<M?1:(M-W)/(V-W)))}if(--u,r+=8*(y+w)/(p.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var md=null,gd=null;function $s(t){return t.nodeType===9?t:t.ownerDocument}function Z0(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Q0(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function yd(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var xd=null;function U2(){var t=window.event;return t&&t.type==="popstate"?t===xd?!1:(xd=t,!0):(xd=null,!1)}var K0=typeof setTimeout=="function"?setTimeout:void 0,I2=typeof clearTimeout=="function"?clearTimeout:void 0,J0=typeof Promise=="function"?Promise:void 0,q2=typeof queueMicrotask=="function"?queueMicrotask:typeof J0<"u"?function(t){return J0.resolve(null).then(t).catch(V2)}:K0;function V2(t){setTimeout(function(){throw t})}function Qi(t){return t==="head"}function W0(t,r){var a=r,u=0;do{var p=a.nextSibling;if(t.removeChild(a),p&&p.nodeType===8)if(a=p.data,a==="/$"||a==="/&"){if(u===0){t.removeChild(p),Nl(r);return}u--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")u++;else if(a==="html")La(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,La(a);for(var y=a.firstChild;y;){var w=y.nextSibling,M=y.nodeName;y[cr]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&y.rel.toLowerCase()==="stylesheet"||a.removeChild(y),y=w}}else a==="body"&&La(t.ownerDocument.body);a=p}while(a);Nl(r)}function ey(t,r){var a=t;t=0;do{var u=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),u&&u.nodeType===8)if(a=u.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=u}while(a)}function bd(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":bd(a),Wl(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function Y2(t,r,a,u){for(;t.nodeType===1;){var p=a;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!u&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(u){if(!t[cr])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(y=t.getAttribute("rel"),y==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(y!==p.rel||t.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||t.getAttribute("title")!==(p.title==null?null:p.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(y=t.getAttribute("src"),(y!==(p.src==null?null:p.src)||t.getAttribute("type")!==(p.type==null?null:p.type)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&t.getAttribute("name")===y)return t}else return t;if(t=vn(t.nextSibling),t===null)break}return null}function $2(t,r,a){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=vn(t.nextSibling),t===null))return null;return t}function ty(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=vn(t.nextSibling),t===null))return null;return t}function vd(t){return t.data==="$?"||t.data==="$~"}function wd(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function X2(t,r){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||a.readyState!=="loading")r();else{var u=function(){r(),a.removeEventListener("DOMContentLoaded",u)};a.addEventListener("DOMContentLoaded",u),t._reactRetry=u}}function vn(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var Sd=null;function ny(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(r===0)return vn(t.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}t=t.nextSibling}return null}function iy(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return t;r--}else a!=="/$"&&a!=="/&"||r++}t=t.previousSibling}return null}function ry(t,r,a){switch(r=$s(a),t){case"html":if(t=r.documentElement,!t)throw Error(l(452));return t;case"head":if(t=r.head,!t)throw Error(l(453));return t;case"body":if(t=r.body,!t)throw Error(l(454));return t;default:throw Error(l(451))}}function La(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Wl(t)}var wn=new Map,ly=new Set;function Xs(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var vi=q.d;q.d={f:F2,r:G2,D:P2,C:Z2,L:Q2,m:K2,X:W2,S:J2,M:ek};function F2(){var t=vi.f(),r=Ls();return t||r}function G2(t){var r=Ai(t);r!==null&&r.tag===5&&r.type==="form"?Sg(r):vi.r(t)}var Sl=typeof document>"u"?null:document;function ay(t,r,a){var u=Sl;if(u&&typeof r=="string"&&r){var p=$t(r);p='link[rel="'+t+'"][href="'+p+'"]',typeof a=="string"&&(p+='[crossorigin="'+a+'"]'),ly.has(p)||(ly.add(p),t={rel:t,crossOrigin:a,href:r},u.querySelector(p)===null&&(r=u.createElement("link"),zt(r,"link",t),pt(r),u.head.appendChild(r)))}}function P2(t){vi.D(t),ay("dns-prefetch",t,null)}function Z2(t,r){vi.C(t,r),ay("preconnect",t,r)}function Q2(t,r,a){vi.L(t,r,a);var u=Sl;if(u&&t&&r){var p='link[rel="preload"][as="'+$t(r)+'"]';r==="image"&&a&&a.imageSrcSet?(p+='[imagesrcset="'+$t(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(p+='[imagesizes="'+$t(a.imageSizes)+'"]')):p+='[href="'+$t(t)+'"]';var y=p;switch(r){case"style":y=kl(t);break;case"script":y=El(t)}wn.has(y)||(t=m({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:t,as:r},a),wn.set(y,t),u.querySelector(p)!==null||r==="style"&&u.querySelector(Ba(y))||r==="script"&&u.querySelector(Ha(y))||(r=u.createElement("link"),zt(r,"link",t),pt(r),u.head.appendChild(r)))}}function K2(t,r){vi.m(t,r);var a=Sl;if(a&&t){var u=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+$t(u)+'"][href="'+$t(t)+'"]',y=p;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=El(t)}if(!wn.has(y)&&(t=m({rel:"modulepreload",href:t},r),wn.set(y,t),a.querySelector(p)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ha(y)))return}u=a.createElement("link"),zt(u,"link",t),pt(u),a.head.appendChild(u)}}}function J2(t,r,a){vi.S(t,r,a);var u=Sl;if(u&&t){var p=zi(u).hoistableStyles,y=kl(t);r=r||"default";var w=p.get(y);if(!w){var M={loading:0,preload:null};if(w=u.querySelector(Ba(y)))M.loading=5;else{t=m({rel:"stylesheet",href:t,"data-precedence":r},a),(a=wn.get(y))&&kd(t,a);var V=w=u.createElement("link");pt(V),zt(V,"link",t),V._p=new Promise(function(W,le){V.onload=W,V.onerror=le}),V.addEventListener("load",function(){M.loading|=1}),V.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Fs(w,r,u)}w={type:"stylesheet",instance:w,count:1,state:M},p.set(y,w)}}}function W2(t,r){vi.X(t,r);var a=Sl;if(a&&t){var u=zi(a).hoistableScripts,p=El(t),y=u.get(p);y||(y=a.querySelector(Ha(p)),y||(t=m({src:t,async:!0},r),(r=wn.get(p))&&Ed(t,r),y=a.createElement("script"),pt(y),zt(y,"link",t),a.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},u.set(p,y))}}function ek(t,r){vi.M(t,r);var a=Sl;if(a&&t){var u=zi(a).hoistableScripts,p=El(t),y=u.get(p);y||(y=a.querySelector(Ha(p)),y||(t=m({src:t,async:!0,type:"module"},r),(r=wn.get(p))&&Ed(t,r),y=a.createElement("script"),pt(y),zt(y,"link",t),a.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},u.set(p,y))}}function oy(t,r,a,u){var p=(p=ce.current)?Xs(p):null;if(!p)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=kl(a.href),a=zi(p).hoistableStyles,u=a.get(r),u||(u={type:"style",instance:null,count:0,state:null},a.set(r,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=kl(a.href);var y=zi(p).hoistableStyles,w=y.get(t);if(w||(p=p.ownerDocument||p,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(t,w),(y=p.querySelector(Ba(t)))&&!y._p&&(w.instance=y,w.state.loading=5),wn.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},wn.set(t,a),y||tk(p,t,a,w.state))),r&&u===null)throw Error(l(528,""));return w}if(r&&u!==null)throw Error(l(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=El(a),a=zi(p).hoistableScripts,u=a.get(r),u||(u={type:"script",instance:null,count:0,state:null},a.set(r,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function kl(t){return'href="'+$t(t)+'"'}function Ba(t){return'link[rel="stylesheet"]['+t+"]"}function sy(t){return m({},t,{"data-precedence":t.precedence,precedence:null})}function tk(t,r,a,u){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?u.loading=1:(r=t.createElement("link"),u.preload=r,r.addEventListener("load",function(){return u.loading|=1}),r.addEventListener("error",function(){return u.loading|=2}),zt(r,"link",a),pt(r),t.head.appendChild(r))}function El(t){return'[src="'+$t(t)+'"]'}function Ha(t){return"script[async]"+t}function uy(t,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var u=t.querySelector('style[data-href~="'+$t(a.href)+'"]');if(u)return r.instance=u,pt(u),u;var p=m({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),pt(u),zt(u,"style",p),Fs(u,a.precedence,t),r.instance=u;case"stylesheet":p=kl(a.href);var y=t.querySelector(Ba(p));if(y)return r.state.loading|=4,r.instance=y,pt(y),y;u=sy(a),(p=wn.get(p))&&kd(u,p),y=(t.ownerDocument||t).createElement("link"),pt(y);var w=y;return w._p=new Promise(function(M,V){w.onload=M,w.onerror=V}),zt(y,"link",u),r.state.loading|=4,Fs(y,a.precedence,t),r.instance=y;case"script":return y=El(a.src),(p=t.querySelector(Ha(y)))?(r.instance=p,pt(p),p):(u=a,(p=wn.get(y))&&(u=m({},a),Ed(u,p)),t=t.ownerDocument||t,p=t.createElement("script"),pt(p),zt(p,"link",u),t.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(l(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(u=r.instance,r.state.loading|=4,Fs(u,a.precedence,t));return r.instance}function Fs(t,r,a){for(var u=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=u.length?u[u.length-1]:null,y=p,w=0;w<u.length;w++){var M=u[w];if(M.dataset.precedence===r)y=M;else if(y!==p)break}y?y.parentNode.insertBefore(t,y.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(t,r.firstChild))}function kd(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function Ed(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var Gs=null;function cy(t,r,a){if(Gs===null){var u=new Map,p=Gs=new Map;p.set(a,u)}else p=Gs,u=p.get(a),u||(u=new Map,p.set(a,u));if(u.has(t))return u;for(u.set(t,null),a=a.getElementsByTagName(t),p=0;p<a.length;p++){var y=a[p];if(!(y[cr]||y[kt]||t==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var w=y.getAttribute(r)||"";w=t+w;var M=u.get(w);M?M.push(y):u.set(w,[y])}}return u}function fy(t,r,a){t=t.ownerDocument||t,t.head.insertBefore(a,r==="title"?t.querySelector("head > title"):null)}function nk(t,r,a){if(a===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(t=r.disabled,typeof r.precedence=="string"&&t==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function dy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function ik(t,r,a,u){if(a.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var p=kl(u.href),y=r.querySelector(Ba(p));if(y){r=y._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=Ps.bind(t),r.then(t,t)),a.state.loading|=4,a.instance=y,pt(y);return}y=r.ownerDocument||r,u=sy(u),(p=wn.get(p))&&kd(u,p),y=y.createElement("link"),pt(y);var w=y;w._p=new Promise(function(M,V){w.onload=M,w.onerror=V}),zt(y,"link",u),a.instance=y}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=Ps.bind(t),r.addEventListener("load",a),r.addEventListener("error",a))}}var Nd=0;function rk(t,r){return t.stylesheets&&t.count===0&&Qs(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var u=setTimeout(function(){if(t.stylesheets&&Qs(t,t.stylesheets),t.unsuspend){var y=t.unsuspend;t.unsuspend=null,y()}},6e4+r);0<t.imgBytes&&Nd===0&&(Nd=62500*H2());var p=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Qs(t,t.stylesheets),t.unsuspend)){var y=t.unsuspend;t.unsuspend=null,y()}},(t.imgBytes>Nd?50:800)+r);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(p)}}:null}function Ps(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qs(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Zs=null;function Qs(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Zs=new Map,r.forEach(lk,t),Zs=null,Ps.call(t))}function lk(t,r){if(!(r.state.loading&4)){var a=Zs.get(t);if(a)var u=a.get(null);else{a=new Map,Zs.set(t,a);for(var p=t.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var w=p[y];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(a.set(w.dataset.precedence,w),u=w)}u&&a.set(null,u)}p=r.instance,w=p.getAttribute("data-precedence"),y=a.get(w)||u,y===u&&a.set(null,p),a.set(w,p),this.count++,u=Ps.bind(this),p.addEventListener("load",u),p.addEventListener("error",u),y?y.parentNode.insertBefore(p,y.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(p,t.firstChild)),r.state.loading|=4}}var Ua={$$typeof:k,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function ak(t,r,a,u,p,y,w,M,V){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ql(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ql(0),this.hiddenUpdates=Ql(null),this.identifierPrefix=u,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=V,this.incompleteTransitions=new Map}function hy(t,r,a,u,p,y,w,M,V,W,le,oe){return t=new ak(t,r,a,w,V,W,le,oe,M),r=1,y===!0&&(r|=24),y=rn(3,null,null,r),t.current=y,y.stateNode=t,r=rf(),r.refCount++,t.pooledCache=r,r.refCount++,y.memoizedState={element:u,isDehydrated:a,cache:r},sf(y),t}function py(t){return t?(t=tl,t):tl}function my(t,r,a,u,p,y){p=py(p),u.context===null?u.context=p:u.pendingContext=p,u=Ui(r),u.payload={element:a},y=y===void 0?null:y,y!==null&&(u.callback=y),a=Ii(t,u,r),a!==null&&(Qt(a,t,r),ya(a,t,r))}function gy(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function _d(t,r){gy(t,r),(t=t.alternate)&&gy(t,r)}function yy(t){if(t.tag===13||t.tag===31){var r=gr(t,67108864);r!==null&&Qt(r,t,67108864),_d(t,67108864)}}function xy(t){if(t.tag===13||t.tag===31){var r=un();r=Kl(r);var a=gr(t,r);a!==null&&Qt(a,t,r),_d(t,r)}}var Ks=!0;function ok(t,r,a,u){var p=D.T;D.T=null;var y=q.p;try{q.p=2,Cd(t,r,a,u)}finally{q.p=y,D.T=p}}function sk(t,r,a,u){var p=D.T;D.T=null;var y=q.p;try{q.p=8,Cd(t,r,a,u)}finally{q.p=y,D.T=p}}function Cd(t,r,a,u){if(Ks){var p=Td(u);if(p===null)hd(t,r,u,Js,a),vy(t,u);else if(ck(p,t,r,a,u))u.stopPropagation();else if(vy(t,u),r&4&&-1<uk.indexOf(t)){for(;p!==null;){var y=Ai(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var w=ei(y.pendingLanes);if(w!==0){var M=y;for(M.pendingLanes|=2,M.entangledLanes|=2;w;){var V=1<<31-Pe(w);M.entanglements[1]|=V,w&=~V}Vn(y),(Ge&6)===0&&(Os=St()+500,Da(0))}}break;case 31:case 13:M=gr(y,2),M!==null&&Qt(M,y,2),Ls(),_d(y,2)}if(y=Td(u),y===null&&hd(t,r,u,Js,a),y===p)break;p=y}p!==null&&u.stopPropagation()}else hd(t,r,u,null,a)}}function Td(t){return t=Ac(t),Ad(t)}var Js=null;function Ad(t){if(Js=null,t=Ti(t),t!==null){var r=s(t);if(r===null)t=null;else{var a=r.tag;if(a===13){if(t=c(r),t!==null)return t;t=null}else if(a===31){if(t=f(r),t!==null)return t;t=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return Js=t,null}function by(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ci()){case re:return 2;case he:return 8;case we:case ze:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var Md=!1,Ki=null,Ji=null,Wi=null,Ia=new Map,qa=new Map,er=[],uk="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 vy(t,r){switch(t){case"focusin":case"focusout":Ki=null;break;case"dragenter":case"dragleave":Ji=null;break;case"mouseover":case"mouseout":Wi=null;break;case"pointerover":case"pointerout":Ia.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":qa.delete(r.pointerId)}}function Va(t,r,a,u,p,y){return t===null||t.nativeEvent!==y?(t={blockedOn:r,domEventName:a,eventSystemFlags:u,nativeEvent:y,targetContainers:[p]},r!==null&&(r=Ai(r),r!==null&&yy(r)),t):(t.eventSystemFlags|=u,r=t.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),t)}function ck(t,r,a,u,p){switch(r){case"focusin":return Ki=Va(Ki,t,r,a,u,p),!0;case"dragenter":return Ji=Va(Ji,t,r,a,u,p),!0;case"mouseover":return Wi=Va(Wi,t,r,a,u,p),!0;case"pointerover":var y=p.pointerId;return Ia.set(y,Va(Ia.get(y)||null,t,r,a,u,p)),!0;case"gotpointercapture":return y=p.pointerId,qa.set(y,Va(qa.get(y)||null,t,r,a,u,p)),!0}return!1}function wy(t){var r=Ti(t.target);if(r!==null){var a=s(r);if(a!==null){if(r=a.tag,r===13){if(r=c(a),r!==null){t.blockedOn=r,Io(t.priority,function(){xy(a)});return}}else if(r===31){if(r=f(a),r!==null){t.blockedOn=r,Io(t.priority,function(){xy(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Ws(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=Td(t.nativeEvent);if(a===null){a=t.nativeEvent;var u=new a.constructor(a.type,a);Tc=u,a.target.dispatchEvent(u),Tc=null}else return r=Ai(a),r!==null&&yy(r),t.blockedOn=a,!1;r.shift()}return!0}function Sy(t,r,a){Ws(t)&&a.delete(r)}function fk(){Md=!1,Ki!==null&&Ws(Ki)&&(Ki=null),Ji!==null&&Ws(Ji)&&(Ji=null),Wi!==null&&Ws(Wi)&&(Wi=null),Ia.forEach(Sy),qa.forEach(Sy)}function eu(t,r){t.blockedOn===r&&(t.blockedOn=null,Md||(Md=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,fk)))}var tu=null;function ky(t){tu!==t&&(tu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){tu===t&&(tu=null);for(var r=0;r<t.length;r+=3){var a=t[r],u=t[r+1],p=t[r+2];if(typeof u!="function"){if(Ad(u||a)===null)continue;break}var y=Ai(a);y!==null&&(t.splice(r,3),r-=3,Tf(y,{pending:!0,data:p,method:a.method,action:u},u,p))}}))}function Nl(t){function r(V){return eu(V,t)}Ki!==null&&eu(Ki,t),Ji!==null&&eu(Ji,t),Wi!==null&&eu(Wi,t),Ia.forEach(r),qa.forEach(r);for(var a=0;a<er.length;a++){var u=er[a];u.blockedOn===t&&(u.blockedOn=null)}for(;0<er.length&&(a=er[0],a.blockedOn===null);)wy(a),a.blockedOn===null&&er.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(u=0;u<a.length;u+=3){var p=a[u],y=a[u+1],w=p[Ot]||null;if(typeof y=="function")w||ky(a);else if(w){var M=null;if(y&&y.hasAttribute("formAction")){if(p=y,w=y[Ot]||null)M=w.formAction;else if(Ad(p)!==null)continue}else M=w.action;typeof M=="function"?a[u+1]=M:(a.splice(u,3),u-=3),ky(a)}}}function Ey(){function t(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(w){return p=w})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),u||setTimeout(a,20)}function a(){if(!u&&!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 u=!1,p=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){u=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function zd(t){this._internalRoot=t}nu.prototype.render=zd.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(l(409));var a=r.current,u=un();my(a,u,t,r,null,null)},nu.prototype.unmount=zd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;my(t.current,2,null,t,null,null),Ls(),r[ti]=null}};function nu(t){this._internalRoot=t}nu.prototype.unstable_scheduleHydration=function(t){if(t){var r=Uo();t={blockedOn:null,target:t,priority:r};for(var a=0;a<er.length&&r!==0&&r<er[a].priority;a++);er.splice(a,0,t),a===0&&wy(t)}};var Ny=n.version;if(Ny!=="19.2.3")throw Error(l(527,Ny,"19.2.3"));q.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=d(r),t=t!==null?g(t):null,t=t===null?null:t.stateNode,t};var dk={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var iu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!iu.isDisabled&&iu.supportsFiber)try{Ct=iu.inject(dk),ft=iu}catch{}}return $a.createRoot=function(t,r){if(!o(t))throw Error(l(299));var a=!1,u="",p=jg,y=Dg,w=Og;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(y=r.onCaughtError),r.onRecoverableError!==void 0&&(w=r.onRecoverableError)),r=hy(t,1,!1,null,null,a,u,null,p,y,w,Ey),t[ti]=r.current,dd(t),new zd(r)},$a.hydrateRoot=function(t,r,a){if(!o(t))throw Error(l(299));var u=!1,p="",y=jg,w=Dg,M=Og,V=null;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(p=a.identifierPrefix),a.onUncaughtError!==void 0&&(y=a.onUncaughtError),a.onCaughtError!==void 0&&(w=a.onCaughtError),a.onRecoverableError!==void 0&&(M=a.onRecoverableError),a.formState!==void 0&&(V=a.formState)),r=hy(t,1,!0,r,a??null,u,p,V,y,w,M,Ey),r.context=py(null),a=r.current,u=un(),u=Kl(u),p=Ui(u),p.callback=null,Ii(a,p,u),a=u,r.current.lanes=a,ur(r,a),Vn(r),t[ti]=r.current,dd(t),new nu(r)},$a.version="19.2.3",$a}var Ry;function wk(){if(Ry)return Od.exports;Ry=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Od.exports=vk(),Od.exports}var Sk=wk();function wt(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let i=0,l;i<e.length;i++)(l=wt(e[i]))!==""&&(n+=(n&&" ")+l);else for(let i in e)e[i]&&(n+=(n&&" ")+i);return n}var kk={value:()=>{}};function Gu(){for(var e=0,n=arguments.length,i={},l;e<n;++e){if(!(l=arguments[e]+"")||l in i||/[\s.]/.test(l))throw new Error("illegal type: "+l);i[l]=[]}return new bu(i)}function bu(e){this._=e}function Ek(e,n){return e.trim().split(/^|\s+/).map(function(i){var l="",o=i.indexOf(".");if(o>=0&&(l=i.slice(o+1),i=i.slice(0,o)),i&&!n.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:l}})}bu.prototype=Gu.prototype={constructor:bu,on:function(e,n){var i=this._,l=Ek(e+"",i),o,s=-1,c=l.length;if(arguments.length<2){for(;++s<c;)if((o=(e=l[s]).type)&&(o=Nk(i[o],e.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++s<c;)if(o=(e=l[s]).type)i[o]=Ly(i[o],e.name,n);else if(n==null)for(o in i)i[o]=Ly(i[o],e.name,null);return this},copy:function(){var e={},n=this._;for(var i in n)e[i]=n[i].slice();return new bu(e)},call:function(e,n){if((o=arguments.length-2)>0)for(var i=new Array(o),l=0,o,s;l<o;++l)i[l]=arguments[l+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],l=0,o=s.length;l<o;++l)s[l].value.apply(n,i)},apply:function(e,n,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var l=this._[e],o=0,s=l.length;o<s;++o)l[o].value.apply(n,i)}};function Nk(e,n){for(var i=0,l=e.length,o;i<l;++i)if((o=e[i]).name===n)return o.value}function Ly(e,n,i){for(var l=0,o=e.length;l<o;++l)if(e[l].name===n){e[l]=kk,e=e.slice(0,l).concat(e.slice(l+1));break}return i!=null&&e.push({name:n,value:i}),e}var yh="http://www.w3.org/1999/xhtml";const By={svg:"http://www.w3.org/2000/svg",xhtml:yh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Pu(e){var n=e+="",i=n.indexOf(":");return i>=0&&(n=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),By.hasOwnProperty(n)?{space:By[n],local:e}:e}function _k(e){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===yh&&n.documentElement.namespaceURI===yh?n.createElement(e):n.createElementNS(i,e)}}function Ck(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function X1(e){var n=Pu(e);return(n.local?Ck:_k)(n)}function Tk(){}function Wh(e){return e==null?Tk:function(){return this.querySelector(e)}}function Ak(e){typeof e!="function"&&(e=Wh(e));for(var n=this._groups,i=n.length,l=new Array(i),o=0;o<i;++o)for(var s=n[o],c=s.length,f=l[o]=new Array(c),h,d,g=0;g<c;++g)(h=s[g])&&(d=e.call(h,h.__data__,g,s))&&("__data__"in h&&(d.__data__=h.__data__),f[g]=d);return new hn(l,this._parents)}function Mk(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function zk(){return[]}function F1(e){return e==null?zk:function(){return this.querySelectorAll(e)}}function jk(e){return function(){return Mk(e.apply(this,arguments))}}function Dk(e){typeof e=="function"?e=jk(e):e=F1(e);for(var n=this._groups,i=n.length,l=[],o=[],s=0;s<i;++s)for(var c=n[s],f=c.length,h,d=0;d<f;++d)(h=c[d])&&(l.push(e.call(h,h.__data__,d,c)),o.push(h));return new hn(l,o)}function G1(e){return function(){return this.matches(e)}}function P1(e){return function(n){return n.matches(e)}}var Ok=Array.prototype.find;function Rk(e){return function(){return Ok.call(this.children,e)}}function Lk(){return this.firstElementChild}function Bk(e){return this.select(e==null?Lk:Rk(typeof e=="function"?e:P1(e)))}var Hk=Array.prototype.filter;function Uk(){return Array.from(this.children)}function Ik(e){return function(){return Hk.call(this.children,e)}}function qk(e){return this.selectAll(e==null?Uk:Ik(typeof e=="function"?e:P1(e)))}function Vk(e){typeof e!="function"&&(e=G1(e));for(var n=this._groups,i=n.length,l=new Array(i),o=0;o<i;++o)for(var s=n[o],c=s.length,f=l[o]=[],h,d=0;d<c;++d)(h=s[d])&&e.call(h,h.__data__,d,s)&&f.push(h);return new hn(l,this._parents)}function Z1(e){return new Array(e.length)}function Yk(){return new hn(this._enter||this._groups.map(Z1),this._parents)}function Mu(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Mu.prototype={constructor:Mu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function $k(e){return function(){return e}}function Xk(e,n,i,l,o,s){for(var c=0,f,h=n.length,d=s.length;c<d;++c)(f=n[c])?(f.__data__=s[c],l[c]=f):i[c]=new Mu(e,s[c]);for(;c<h;++c)(f=n[c])&&(o[c]=f)}function Fk(e,n,i,l,o,s,c){var f,h,d=new Map,g=n.length,m=s.length,x=new Array(g),v;for(f=0;f<g;++f)(h=n[f])&&(x[f]=v=c.call(h,h.__data__,f,n)+"",d.has(v)?o[f]=h:d.set(v,h));for(f=0;f<m;++f)v=c.call(e,s[f],f,s)+"",(h=d.get(v))?(l[f]=h,h.__data__=s[f],d.delete(v)):i[f]=new Mu(e,s[f]);for(f=0;f<g;++f)(h=n[f])&&d.get(x[f])===h&&(o[f]=h)}function Gk(e){return e.__data__}function Pk(e,n){if(!arguments.length)return Array.from(this,Gk);var i=n?Fk:Xk,l=this._parents,o=this._groups;typeof e!="function"&&(e=$k(e));for(var s=o.length,c=new Array(s),f=new Array(s),h=new Array(s),d=0;d<s;++d){var g=l[d],m=o[d],x=m.length,v=Zk(e.call(g,g&&g.__data__,d,l)),S=v.length,E=f[d]=new Array(S),C=c[d]=new Array(S),N=h[d]=new Array(x);i(g,m,E,C,N,v,n);for(var _=0,k=0,A,B;_<S;++_)if(A=E[_]){for(_>=k&&(k=_+1);!(B=C[k])&&++k<S;);A._next=B||null}}return c=new hn(c,l),c._enter=f,c._exit=h,c}function Zk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Qk(){return new hn(this._exit||this._groups.map(Z1),this._parents)}function Kk(e,n,i){var l=this.enter(),o=this,s=this.exit();return typeof e=="function"?(l=e(l),l&&(l=l.selection())):l=l.append(e+""),n!=null&&(o=n(o),o&&(o=o.selection())),i==null?s.remove():i(s),l&&o?l.merge(o).order():o}function Jk(e){for(var n=e.selection?e.selection():e,i=this._groups,l=n._groups,o=i.length,s=l.length,c=Math.min(o,s),f=new Array(o),h=0;h<c;++h)for(var d=i[h],g=l[h],m=d.length,x=f[h]=new Array(m),v,S=0;S<m;++S)(v=d[S]||g[S])&&(x[S]=v);for(;h<o;++h)f[h]=i[h];return new hn(f,this._parents)}function Wk(){for(var e=this._groups,n=-1,i=e.length;++n<i;)for(var l=e[n],o=l.length-1,s=l[o],c;--o>=0;)(c=l[o])&&(s&&c.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(c,s),s=c);return this}function eE(e){e||(e=tE);function n(m,x){return m&&x?e(m.__data__,x.__data__):!m-!x}for(var i=this._groups,l=i.length,o=new Array(l),s=0;s<l;++s){for(var c=i[s],f=c.length,h=o[s]=new Array(f),d,g=0;g<f;++g)(d=c[g])&&(h[g]=d);h.sort(n)}return new hn(o,this._parents).order()}function tE(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function nE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function iE(){return Array.from(this)}function rE(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var l=e[n],o=0,s=l.length;o<s;++o){var c=l[o];if(c)return c}return null}function lE(){let e=0;for(const n of this)++e;return e}function aE(){return!this.node()}function oE(e){for(var n=this._groups,i=0,l=n.length;i<l;++i)for(var o=n[i],s=0,c=o.length,f;s<c;++s)(f=o[s])&&e.call(f,f.__data__,s,o);return this}function sE(e){return function(){this.removeAttribute(e)}}function uE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function cE(e,n){return function(){this.setAttribute(e,n)}}function fE(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function dE(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function hE(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function pE(e,n){var i=Pu(e);if(arguments.length<2){var l=this.node();return i.local?l.getAttributeNS(i.space,i.local):l.getAttribute(i)}return this.each((n==null?i.local?uE:sE:typeof n=="function"?i.local?hE:dE:i.local?fE:cE)(i,n))}function Q1(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function mE(e){return function(){this.style.removeProperty(e)}}function gE(e,n,i){return function(){this.style.setProperty(e,n,i)}}function yE(e,n,i){return function(){var l=n.apply(this,arguments);l==null?this.style.removeProperty(e):this.style.setProperty(e,l,i)}}function xE(e,n,i){return arguments.length>1?this.each((n==null?mE:typeof n=="function"?yE:gE)(e,n,i??"")):Rl(this.node(),e)}function Rl(e,n){return e.style.getPropertyValue(n)||Q1(e).getComputedStyle(e,null).getPropertyValue(n)}function bE(e){return function(){delete this[e]}}function vE(e,n){return function(){this[e]=n}}function wE(e,n){return function(){var i=n.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function SE(e,n){return arguments.length>1?this.each((n==null?bE:typeof n=="function"?wE:vE)(e,n)):this.node()[e]}function K1(e){return e.trim().split(/^|\s+/)}function ep(e){return e.classList||new J1(e)}function J1(e){this._node=e,this._names=K1(e.getAttribute("class")||"")}J1.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function W1(e,n){for(var i=ep(e),l=-1,o=n.length;++l<o;)i.add(n[l])}function eb(e,n){for(var i=ep(e),l=-1,o=n.length;++l<o;)i.remove(n[l])}function kE(e){return function(){W1(this,e)}}function EE(e){return function(){eb(this,e)}}function NE(e,n){return function(){(n.apply(this,arguments)?W1:eb)(this,e)}}function _E(e,n){var i=K1(e+"");if(arguments.length<2){for(var l=ep(this.node()),o=-1,s=i.length;++o<s;)if(!l.contains(i[o]))return!1;return!0}return this.each((typeof n=="function"?NE:n?kE:EE)(i,n))}function CE(){this.textContent=""}function TE(e){return function(){this.textContent=e}}function AE(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function ME(e){return arguments.length?this.each(e==null?CE:(typeof e=="function"?AE:TE)(e)):this.node().textContent}function zE(){this.innerHTML=""}function jE(e){return function(){this.innerHTML=e}}function DE(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function OE(e){return arguments.length?this.each(e==null?zE:(typeof e=="function"?DE:jE)(e)):this.node().innerHTML}function RE(){this.nextSibling&&this.parentNode.appendChild(this)}function LE(){return this.each(RE)}function BE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function HE(){return this.each(BE)}function UE(e){var n=typeof e=="function"?e:X1(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function IE(){return null}function qE(e,n){var i=typeof e=="function"?e:X1(e),l=n==null?IE:typeof n=="function"?n:Wh(n);return this.select(function(){return this.insertBefore(i.apply(this,arguments),l.apply(this,arguments)||null)})}function VE(){var e=this.parentNode;e&&e.removeChild(this)}function YE(){return this.each(VE)}function $E(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function XE(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function FE(e){return this.select(e?XE:$E)}function GE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function PE(e){return function(n){e.call(this,n,this.__data__)}}function ZE(e){return e.trim().split(/^|\s+/).map(function(n){var i="",l=n.indexOf(".");return l>=0&&(i=n.slice(l+1),n=n.slice(0,l)),{type:n,name:i}})}function QE(e){return function(){var n=this.__on;if(n){for(var i=0,l=-1,o=n.length,s;i<o;++i)s=n[i],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):n[++l]=s;++l?n.length=l:delete this.__on}}}function KE(e,n,i){return function(){var l=this.__on,o,s=PE(n);if(l){for(var c=0,f=l.length;c<f;++c)if((o=l[c]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=s,o.options=i),o.value=n;return}}this.addEventListener(e.type,s,i),o={type:e.type,name:e.name,value:n,listener:s,options:i},l?l.push(o):this.__on=[o]}}function JE(e,n,i){var l=ZE(e+""),o,s=l.length,c;if(arguments.length<2){var f=this.node().__on;if(f){for(var h=0,d=f.length,g;h<d;++h)for(o=0,g=f[h];o<s;++o)if((c=l[o]).type===g.type&&c.name===g.name)return g.value}return}for(f=n?KE:QE,o=0;o<s;++o)this.each(f(l[o],n,i));return this}function tb(e,n,i){var l=Q1(e),o=l.CustomEvent;typeof o=="function"?o=new o(n,i):(o=l.document.createEvent("Event"),i?(o.initEvent(n,i.bubbles,i.cancelable),o.detail=i.detail):o.initEvent(n,!1,!1)),e.dispatchEvent(o)}function WE(e,n){return function(){return tb(this,e,n)}}function eN(e,n){return function(){return tb(this,e,n.apply(this,arguments))}}function tN(e,n){return this.each((typeof n=="function"?eN:WE)(e,n))}function*nN(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var l=e[n],o=0,s=l.length,c;o<s;++o)(c=l[o])&&(yield c)}var nb=[null];function hn(e,n){this._groups=e,this._parents=n}function Eo(){return new hn([[document.documentElement]],nb)}function iN(){return this}hn.prototype=Eo.prototype={constructor:hn,select:Ak,selectAll:Dk,selectChild:Bk,selectChildren:qk,filter:Vk,data:Pk,enter:Yk,exit:Qk,join:Kk,merge:Jk,selection:iN,order:Wk,sort:eE,call:nE,nodes:iE,node:rE,size:lE,empty:aE,each:oE,attr:pE,style:xE,property:SE,classed:_E,text:ME,html:OE,raise:LE,lower:HE,append:UE,insert:qE,remove:YE,clone:FE,datum:GE,on:JE,dispatch:tN,[Symbol.iterator]:nN};function fn(e){return typeof e=="string"?new hn([[document.querySelector(e)]],[document.documentElement]):new hn([[e]],nb)}function rN(e){let n;for(;n=e.sourceEvent;)e=n;return e}function Mn(e,n){if(e=rN(e),n===void 0&&(n=e.currentTarget),n){var i=n.ownerSVGElement||n;if(i.createSVGPoint){var l=i.createSVGPoint();return l.x=e.clientX,l.y=e.clientY,l=l.matrixTransform(n.getScreenCTM().inverse()),[l.x,l.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}}return[e.pageX,e.pageY]}const lN={passive:!1},oo={capture:!0,passive:!1};function Hd(e){e.stopImmediatePropagation()}function jl(e){e.preventDefault(),e.stopImmediatePropagation()}function ib(e){var n=e.document.documentElement,i=fn(e).on("dragstart.drag",jl,oo);"onselectstart"in n?i.on("selectstart.drag",jl,oo):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function rb(e,n){var i=e.document.documentElement,l=fn(e).on("dragstart.drag",null);n&&(l.on("click.drag",jl,oo),setTimeout(function(){l.on("click.drag",null)},0)),"onselectstart"in i?l.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const ru=e=>()=>e;function xh(e,{sourceEvent:n,subject:i,target:l,identifier:o,active:s,x:c,y:f,dx:h,dy:d,dispatch:g}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:l,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:c,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:g}})}xh.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function aN(e){return!e.ctrlKey&&!e.button}function oN(){return this.parentNode}function sN(e,n){return n??{x:e.x,y:e.y}}function uN(){return navigator.maxTouchPoints||"ontouchstart"in this}function lb(){var e=aN,n=oN,i=sN,l=uN,o={},s=Gu("start","drag","end"),c=0,f,h,d,g,m=0;function x(A){A.on("mousedown.drag",v).filter(l).on("touchstart.drag",C).on("touchmove.drag",N,lN).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(A,B){if(!(g||!e.call(this,A,B))){var T=k(this,n.call(this,A,B),A,B,"mouse");T&&(fn(A.view).on("mousemove.drag",S,oo).on("mouseup.drag",E,oo),ib(A.view),Hd(A),d=!1,f=A.clientX,h=A.clientY,T("start",A))}}function S(A){if(jl(A),!d){var B=A.clientX-f,T=A.clientY-h;d=B*B+T*T>m}o.mouse("drag",A)}function E(A){fn(A.view).on("mousemove.drag mouseup.drag",null),rb(A.view,d),jl(A),o.mouse("end",A)}function C(A,B){if(e.call(this,A,B)){var T=A.changedTouches,L=n.call(this,A,B),P=T.length,Z,H;for(Z=0;Z<P;++Z)(H=k(this,L,A,B,T[Z].identifier,T[Z]))&&(Hd(A),H("start",A,T[Z]))}}function N(A){var B=A.changedTouches,T=B.length,L,P;for(L=0;L<T;++L)(P=o[B[L].identifier])&&(jl(A),P("drag",A,B[L]))}function _(A){var B=A.changedTouches,T=B.length,L,P;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),L=0;L<T;++L)(P=o[B[L].identifier])&&(Hd(A),P("end",A,B[L]))}function k(A,B,T,L,P,Z){var H=s.copy(),U=Mn(Z||T,B),Y,ee,R;if((R=i.call(A,new xh("beforestart",{sourceEvent:T,target:x,identifier:P,active:c,x:U[0],y:U[1],dx:0,dy:0,dispatch:H}),L))!=null)return Y=R.x-U[0]||0,ee=R.y-U[1]||0,function I(D,q,X){var K=U,j;switch(D){case"start":o[P]=I,j=c++;break;case"end":delete o[P],--c;case"drag":U=Mn(X||q,B),j=c;break}H.call(D,A,new xh(D,{sourceEvent:q,subject:R,target:x,identifier:P,active:j,x:U[0]+Y,y:U[1]+ee,dx:U[0]-K[0],dy:U[1]-K[1],dispatch:H}),L)}}return x.filter=function(A){return arguments.length?(e=typeof A=="function"?A:ru(!!A),x):e},x.container=function(A){return arguments.length?(n=typeof A=="function"?A:ru(A),x):n},x.subject=function(A){return arguments.length?(i=typeof A=="function"?A:ru(A),x):i},x.touchable=function(A){return arguments.length?(l=typeof A=="function"?A:ru(!!A),x):l},x.on=function(){var A=s.on.apply(s,arguments);return A===s?x:A},x.clickDistance=function(A){return arguments.length?(m=(A=+A)*A,x):Math.sqrt(m)},x}function tp(e,n,i){e.prototype=n.prototype=i,i.constructor=e}function ab(e,n){var i=Object.create(e.prototype);for(var l in n)i[l]=n[l];return i}function No(){}var so=.7,zu=1/so,Dl="\\s*([+-]?\\d+)\\s*",uo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",cN=/^#([0-9a-f]{3,8})$/,fN=new RegExp(`^rgb\\(${Dl},${Dl},${Dl}\\)$`),dN=new RegExp(`^rgb\\(${Xn},${Xn},${Xn}\\)$`),hN=new RegExp(`^rgba\\(${Dl},${Dl},${Dl},${uo}\\)$`),pN=new RegExp(`^rgba\\(${Xn},${Xn},${Xn},${uo}\\)$`),mN=new RegExp(`^hsl\\(${uo},${Xn},${Xn}\\)$`),gN=new RegExp(`^hsla\\(${uo},${Xn},${Xn},${uo}\\)$`),Hy={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};tp(No,Or,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Uy,formatHex:Uy,formatHex8:yN,formatHsl:xN,formatRgb:Iy,toString:Iy});function Uy(){return this.rgb().formatHex()}function yN(){return this.rgb().formatHex8()}function xN(){return ob(this).formatHsl()}function Iy(){return this.rgb().formatRgb()}function Or(e){var n,i;return e=(e+"").trim().toLowerCase(),(n=cN.exec(e))?(i=n[1].length,n=parseInt(n[1],16),i===6?qy(n):i===3?new Jt(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):i===8?lu(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):i===4?lu(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=fN.exec(e))?new Jt(n[1],n[2],n[3],1):(n=dN.exec(e))?new Jt(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=hN.exec(e))?lu(n[1],n[2],n[3],n[4]):(n=pN.exec(e))?lu(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=mN.exec(e))?$y(n[1],n[2]/100,n[3]/100,1):(n=gN.exec(e))?$y(n[1],n[2]/100,n[3]/100,n[4]):Hy.hasOwnProperty(e)?qy(Hy[e]):e==="transparent"?new Jt(NaN,NaN,NaN,0):null}function qy(e){return new Jt(e>>16&255,e>>8&255,e&255,1)}function lu(e,n,i,l){return l<=0&&(e=n=i=NaN),new Jt(e,n,i,l)}function bN(e){return e instanceof No||(e=Or(e)),e?(e=e.rgb(),new Jt(e.r,e.g,e.b,e.opacity)):new Jt}function bh(e,n,i,l){return arguments.length===1?bN(e):new Jt(e,n,i,l??1)}function Jt(e,n,i,l){this.r=+e,this.g=+n,this.b=+i,this.opacity=+l}tp(Jt,bh,ab(No,{brighter(e){return e=e==null?zu:Math.pow(zu,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?so:Math.pow(so,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Jt(jr(this.r),jr(this.g),jr(this.b),ju(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:Vy,formatHex:Vy,formatHex8:vN,formatRgb:Yy,toString:Yy}));function Vy(){return`#${zr(this.r)}${zr(this.g)}${zr(this.b)}`}function vN(){return`#${zr(this.r)}${zr(this.g)}${zr(this.b)}${zr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Yy(){const e=ju(this.opacity);return`${e===1?"rgb(":"rgba("}${jr(this.r)}, ${jr(this.g)}, ${jr(this.b)}${e===1?")":`, ${e})`}`}function ju(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function jr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zr(e){return e=jr(e),(e<16?"0":"")+e.toString(16)}function $y(e,n,i,l){return l<=0?e=n=i=NaN:i<=0||i>=1?e=n=NaN:n<=0&&(e=NaN),new jn(e,n,i,l)}function ob(e){if(e instanceof jn)return new jn(e.h,e.s,e.l,e.opacity);if(e instanceof No||(e=Or(e)),!e)return new jn;if(e instanceof jn)return e;e=e.rgb();var n=e.r/255,i=e.g/255,l=e.b/255,o=Math.min(n,i,l),s=Math.max(n,i,l),c=NaN,f=s-o,h=(s+o)/2;return f?(n===s?c=(i-l)/f+(i<l)*6:i===s?c=(l-n)/f+2:c=(n-i)/f+4,f/=h<.5?s+o:2-s-o,c*=60):f=h>0&&h<1?0:c,new jn(c,f,h,e.opacity)}function wN(e,n,i,l){return arguments.length===1?ob(e):new jn(e,n,i,l??1)}function jn(e,n,i,l){this.h=+e,this.s=+n,this.l=+i,this.opacity=+l}tp(jn,wN,ab(No,{brighter(e){return e=e==null?zu:Math.pow(zu,e),new jn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?so:Math.pow(so,e),new jn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,l=i+(i<.5?i:1-i)*n,o=2*i-l;return new Jt(Ud(e>=240?e-240:e+120,o,l),Ud(e,o,l),Ud(e<120?e+240:e-120,o,l),this.opacity)},clamp(){return new jn(Xy(this.h),au(this.s),au(this.l),ju(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=ju(this.opacity);return`${e===1?"hsl(":"hsla("}${Xy(this.h)}, ${au(this.s)*100}%, ${au(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Xy(e){return e=(e||0)%360,e<0?e+360:e}function au(e){return Math.max(0,Math.min(1,e||0))}function Ud(e,n,i){return(e<60?n+(i-n)*e/60:e<180?i:e<240?n+(i-n)*(240-e)/60:n)*255}const np=e=>()=>e;function SN(e,n){return function(i){return e+i*n}}function kN(e,n,i){return e=Math.pow(e,i),n=Math.pow(n,i)-e,i=1/i,function(l){return Math.pow(e+l*n,i)}}function EN(e){return(e=+e)==1?sb:function(n,i){return i-n?kN(n,i,e):np(isNaN(n)?i:n)}}function sb(e,n){var i=n-e;return i?SN(e,i):np(isNaN(e)?n:e)}const Du=(function e(n){var i=EN(n);function l(o,s){var c=i((o=bh(o)).r,(s=bh(s)).r),f=i(o.g,s.g),h=i(o.b,s.b),d=sb(o.opacity,s.opacity);return function(g){return o.r=c(g),o.g=f(g),o.b=h(g),o.opacity=d(g),o+""}}return l.gamma=e,l})(1);function NN(e,n){n||(n=[]);var i=e?Math.min(n.length,e.length):0,l=n.slice(),o;return function(s){for(o=0;o<i;++o)l[o]=e[o]*(1-s)+n[o]*s;return l}}function _N(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function CN(e,n){var i=n?n.length:0,l=e?Math.min(i,e.length):0,o=new Array(l),s=new Array(i),c;for(c=0;c<l;++c)o[c]=no(e[c],n[c]);for(;c<i;++c)s[c]=n[c];return function(f){for(c=0;c<l;++c)s[c]=o[c](f);return s}}function TN(e,n){var i=new Date;return e=+e,n=+n,function(l){return i.setTime(e*(1-l)+n*l),i}}function $n(e,n){return e=+e,n=+n,function(i){return e*(1-i)+n*i}}function AN(e,n){var i={},l={},o;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(o in n)o in e?i[o]=no(e[o],n[o]):l[o]=n[o];return function(s){for(o in i)l[o]=i[o](s);return l}}var vh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Id=new RegExp(vh.source,"g");function MN(e){return function(){return e}}function zN(e){return function(n){return e(n)+""}}function ub(e,n){var i=vh.lastIndex=Id.lastIndex=0,l,o,s,c=-1,f=[],h=[];for(e=e+"",n=n+"";(l=vh.exec(e))&&(o=Id.exec(n));)(s=o.index)>i&&(s=n.slice(i,s),f[c]?f[c]+=s:f[++c]=s),(l=l[0])===(o=o[0])?f[c]?f[c]+=o:f[++c]=o:(f[++c]=null,h.push({i:c,x:$n(l,o)})),i=Id.lastIndex;return i<n.length&&(s=n.slice(i),f[c]?f[c]+=s:f[++c]=s),f.length<2?h[0]?zN(h[0].x):MN(n):(n=h.length,function(d){for(var g=0,m;g<n;++g)f[(m=h[g]).i]=m.x(d);return f.join("")})}function no(e,n){var i=typeof n,l;return n==null||i==="boolean"?np(n):(i==="number"?$n:i==="string"?(l=Or(n))?(n=l,Du):ub:n instanceof Or?Du:n instanceof Date?TN:_N(n)?NN:Array.isArray(n)?CN:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?AN:$n)(e,n)}var Fy=180/Math.PI,wh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function cb(e,n,i,l,o,s){var c,f,h;return(c=Math.sqrt(e*e+n*n))&&(e/=c,n/=c),(h=e*i+n*l)&&(i-=e*h,l-=n*h),(f=Math.sqrt(i*i+l*l))&&(i/=f,l/=f,h/=f),e*l<n*i&&(e=-e,n=-n,h=-h,c=-c),{translateX:o,translateY:s,rotate:Math.atan2(n,e)*Fy,skewX:Math.atan(h)*Fy,scaleX:c,scaleY:f}}var ou;function jN(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?wh:cb(n.a,n.b,n.c,n.d,n.e,n.f)}function DN(e){return e==null||(ou||(ou=document.createElementNS("http://www.w3.org/2000/svg","g")),ou.setAttribute("transform",e),!(e=ou.transform.baseVal.consolidate()))?wh:(e=e.matrix,cb(e.a,e.b,e.c,e.d,e.e,e.f))}function fb(e,n,i,l){function o(d){return d.length?d.pop()+" ":""}function s(d,g,m,x,v,S){if(d!==m||g!==x){var E=v.push("translate(",null,n,null,i);S.push({i:E-4,x:$n(d,m)},{i:E-2,x:$n(g,x)})}else(m||x)&&v.push("translate("+m+n+x+i)}function c(d,g,m,x){d!==g?(d-g>180?g+=360:g-d>180&&(d+=360),x.push({i:m.push(o(m)+"rotate(",null,l)-2,x:$n(d,g)})):g&&m.push(o(m)+"rotate("+g+l)}function f(d,g,m,x){d!==g?x.push({i:m.push(o(m)+"skewX(",null,l)-2,x:$n(d,g)}):g&&m.push(o(m)+"skewX("+g+l)}function h(d,g,m,x,v,S){if(d!==m||g!==x){var E=v.push(o(v)+"scale(",null,",",null,")");S.push({i:E-4,x:$n(d,m)},{i:E-2,x:$n(g,x)})}else(m!==1||x!==1)&&v.push(o(v)+"scale("+m+","+x+")")}return function(d,g){var m=[],x=[];return d=e(d),g=e(g),s(d.translateX,d.translateY,g.translateX,g.translateY,m,x),c(d.rotate,g.rotate,m,x),f(d.skewX,g.skewX,m,x),h(d.scaleX,d.scaleY,g.scaleX,g.scaleY,m,x),d=g=null,function(v){for(var S=-1,E=x.length,C;++S<E;)m[(C=x[S]).i]=C.x(v);return m.join("")}}}var ON=fb(jN,"px, ","px)","deg)"),RN=fb(DN,", ",")",")"),LN=1e-12;function Gy(e){return((e=Math.exp(e))+1/e)/2}function BN(e){return((e=Math.exp(e))-1/e)/2}function HN(e){return((e=Math.exp(2*e))-1)/(e+1)}const vu=(function e(n,i,l){function o(s,c){var f=s[0],h=s[1],d=s[2],g=c[0],m=c[1],x=c[2],v=g-f,S=m-h,E=v*v+S*S,C,N;if(E<LN)N=Math.log(x/d)/n,C=function(L){return[f+L*v,h+L*S,d*Math.exp(n*L*N)]};else{var _=Math.sqrt(E),k=(x*x-d*d+l*E)/(2*d*i*_),A=(x*x-d*d-l*E)/(2*x*i*_),B=Math.log(Math.sqrt(k*k+1)-k),T=Math.log(Math.sqrt(A*A+1)-A);N=(T-B)/n,C=function(L){var P=L*N,Z=Gy(B),H=d/(i*_)*(Z*HN(n*P+B)-BN(B));return[f+H*v,h+H*S,d*Z/Gy(n*P+B)]}}return C.duration=N*1e3*n/Math.SQRT2,C}return o.rho=function(s){var c=Math.max(.001,+s),f=c*c,h=f*f;return e(c,f,h)},o})(Math.SQRT2,2,4);var Ll=0,Wa=0,Xa=0,db=1e3,Ou,eo,Ru=0,Rr=0,Zu=0,co=typeof performance=="object"&&performance.now?performance:Date,hb=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ip(){return Rr||(hb(UN),Rr=co.now()+Zu)}function UN(){Rr=0}function Lu(){this._call=this._time=this._next=null}Lu.prototype=pb.prototype={constructor:Lu,restart:function(e,n,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?ip():+i)+(n==null?0:+n),!this._next&&eo!==this&&(eo?eo._next=this:Ou=this,eo=this),this._call=e,this._time=i,Sh()},stop:function(){this._call&&(this._call=null,this._time=1/0,Sh())}};function pb(e,n,i){var l=new Lu;return l.restart(e,n,i),l}function IN(){ip(),++Ll;for(var e=Ou,n;e;)(n=Rr-e._time)>=0&&e._call.call(void 0,n),e=e._next;--Ll}function Py(){Rr=(Ru=co.now())+Zu,Ll=Wa=0;try{IN()}finally{Ll=0,VN(),Rr=0}}function qN(){var e=co.now(),n=e-Ru;n>db&&(Zu-=n,Ru=e)}function VN(){for(var e,n=Ou,i,l=1/0;n;)n._call?(l>n._time&&(l=n._time),e=n,n=n._next):(i=n._next,n._next=null,n=e?e._next=i:Ou=i);eo=e,Sh(l)}function Sh(e){if(!Ll){Wa&&(Wa=clearTimeout(Wa));var n=e-Rr;n>24?(e<1/0&&(Wa=setTimeout(Py,e-co.now()-Zu)),Xa&&(Xa=clearInterval(Xa))):(Xa||(Ru=co.now(),Xa=setInterval(qN,db)),Ll=1,hb(Py))}}function Zy(e,n,i){var l=new Lu;return n=n==null?0:+n,l.restart(o=>{l.stop(),e(o+n)},n,i),l}var YN=Gu("start","end","cancel","interrupt"),$N=[],mb=0,Qy=1,kh=2,wu=3,Ky=4,Eh=5,Su=6;function Qu(e,n,i,l,o,s){var c=e.__transition;if(!c)e.__transition={};else if(i in c)return;XN(e,i,{name:n,index:l,group:o,on:YN,tween:$N,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:mb})}function rp(e,n){var i=Ln(e,n);if(i.state>mb)throw new Error("too late; already scheduled");return i}function Qn(e,n){var i=Ln(e,n);if(i.state>wu)throw new Error("too late; already running");return i}function Ln(e,n){var i=e.__transition;if(!i||!(i=i[n]))throw new Error("transition not found");return i}function XN(e,n,i){var l=e.__transition,o;l[n]=i,i.timer=pb(s,0,i.time);function s(d){i.state=Qy,i.timer.restart(c,i.delay,i.time),i.delay<=d&&c(d-i.delay)}function c(d){var g,m,x,v;if(i.state!==Qy)return h();for(g in l)if(v=l[g],v.name===i.name){if(v.state===wu)return Zy(c);v.state===Ky?(v.state=Su,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete l[g]):+g<n&&(v.state=Su,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete l[g])}if(Zy(function(){i.state===wu&&(i.state=Ky,i.timer.restart(f,i.delay,i.time),f(d))}),i.state=kh,i.on.call("start",e,e.__data__,i.index,i.group),i.state===kh){for(i.state=wu,o=new Array(x=i.tween.length),g=0,m=-1;g<x;++g)(v=i.tween[g].value.call(e,e.__data__,i.index,i.group))&&(o[++m]=v);o.length=m+1}}function f(d){for(var g=d<i.duration?i.ease.call(null,d/i.duration):(i.timer.restart(h),i.state=Eh,1),m=-1,x=o.length;++m<x;)o[m].call(e,g);i.state===Eh&&(i.on.call("end",e,e.__data__,i.index,i.group),h())}function h(){i.state=Su,i.timer.stop(),delete l[n];for(var d in l)return;delete e.__transition}}function ku(e,n){var i=e.__transition,l,o,s=!0,c;if(i){n=n==null?null:n+"";for(c in i){if((l=i[c]).name!==n){s=!1;continue}o=l.state>kh&&l.state<Eh,l.state=Su,l.timer.stop(),l.on.call(o?"interrupt":"cancel",e,e.__data__,l.index,l.group),delete i[c]}s&&delete e.__transition}}function FN(e){return this.each(function(){ku(this,e)})}function GN(e,n){var i,l;return function(){var o=Qn(this,e),s=o.tween;if(s!==i){l=i=s;for(var c=0,f=l.length;c<f;++c)if(l[c].name===n){l=l.slice(),l.splice(c,1);break}}o.tween=l}}function PN(e,n,i){var l,o;if(typeof i!="function")throw new Error;return function(){var s=Qn(this,e),c=s.tween;if(c!==l){o=(l=c).slice();for(var f={name:n,value:i},h=0,d=o.length;h<d;++h)if(o[h].name===n){o[h]=f;break}h===d&&o.push(f)}s.tween=o}}function ZN(e,n){var i=this._id;if(e+="",arguments.length<2){for(var l=Ln(this.node(),i).tween,o=0,s=l.length,c;o<s;++o)if((c=l[o]).name===e)return c.value;return null}return this.each((n==null?GN:PN)(i,e,n))}function lp(e,n,i){var l=e._id;return e.each(function(){var o=Qn(this,l);(o.value||(o.value={}))[n]=i.apply(this,arguments)}),function(o){return Ln(o,l).value[n]}}function gb(e,n){var i;return(typeof n=="number"?$n:n instanceof Or?Du:(i=Or(n))?(n=i,Du):ub)(e,n)}function QN(e){return function(){this.removeAttribute(e)}}function KN(e){return function(){this.removeAttributeNS(e.space,e.local)}}function JN(e,n,i){var l,o=i+"",s;return function(){var c=this.getAttribute(e);return c===o?null:c===l?s:s=n(l=c,i)}}function WN(e,n,i){var l,o=i+"",s;return function(){var c=this.getAttributeNS(e.space,e.local);return c===o?null:c===l?s:s=n(l=c,i)}}function e_(e,n,i){var l,o,s;return function(){var c,f=i(this),h;return f==null?void this.removeAttribute(e):(c=this.getAttribute(e),h=f+"",c===h?null:c===l&&h===o?s:(o=h,s=n(l=c,f)))}}function t_(e,n,i){var l,o,s;return function(){var c,f=i(this),h;return f==null?void this.removeAttributeNS(e.space,e.local):(c=this.getAttributeNS(e.space,e.local),h=f+"",c===h?null:c===l&&h===o?s:(o=h,s=n(l=c,f)))}}function n_(e,n){var i=Pu(e),l=i==="transform"?RN:gb;return this.attrTween(e,typeof n=="function"?(i.local?t_:e_)(i,l,lp(this,"attr."+e,n)):n==null?(i.local?KN:QN)(i):(i.local?WN:JN)(i,l,n))}function i_(e,n){return function(i){this.setAttribute(e,n.call(this,i))}}function r_(e,n){return function(i){this.setAttributeNS(e.space,e.local,n.call(this,i))}}function l_(e,n){var i,l;function o(){var s=n.apply(this,arguments);return s!==l&&(i=(l=s)&&r_(e,s)),i}return o._value=n,o}function a_(e,n){var i,l;function o(){var s=n.apply(this,arguments);return s!==l&&(i=(l=s)&&i_(e,s)),i}return o._value=n,o}function o_(e,n){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;var l=Pu(e);return this.tween(i,(l.local?l_:a_)(l,n))}function s_(e,n){return function(){rp(this,e).delay=+n.apply(this,arguments)}}function u_(e,n){return n=+n,function(){rp(this,e).delay=n}}function c_(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?s_:u_)(n,e)):Ln(this.node(),n).delay}function f_(e,n){return function(){Qn(this,e).duration=+n.apply(this,arguments)}}function d_(e,n){return n=+n,function(){Qn(this,e).duration=n}}function h_(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?f_:d_)(n,e)):Ln(this.node(),n).duration}function p_(e,n){if(typeof n!="function")throw new Error;return function(){Qn(this,e).ease=n}}function m_(e){var n=this._id;return arguments.length?this.each(p_(n,e)):Ln(this.node(),n).ease}function g_(e,n){return function(){var i=n.apply(this,arguments);if(typeof i!="function")throw new Error;Qn(this,e).ease=i}}function y_(e){if(typeof e!="function")throw new Error;return this.each(g_(this._id,e))}function x_(e){typeof e!="function"&&(e=G1(e));for(var n=this._groups,i=n.length,l=new Array(i),o=0;o<i;++o)for(var s=n[o],c=s.length,f=l[o]=[],h,d=0;d<c;++d)(h=s[d])&&e.call(h,h.__data__,d,s)&&f.push(h);return new Ei(l,this._parents,this._name,this._id)}function b_(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,i=e._groups,l=n.length,o=i.length,s=Math.min(l,o),c=new Array(l),f=0;f<s;++f)for(var h=n[f],d=i[f],g=h.length,m=c[f]=new Array(g),x,v=0;v<g;++v)(x=h[v]||d[v])&&(m[v]=x);for(;f<l;++f)c[f]=n[f];return new Ei(c,this._parents,this._name,this._id)}function v_(e){return(e+"").trim().split(/^|\s+/).every(function(n){var i=n.indexOf(".");return i>=0&&(n=n.slice(0,i)),!n||n==="start"})}function w_(e,n,i){var l,o,s=v_(n)?rp:Qn;return function(){var c=s(this,e),f=c.on;f!==l&&(o=(l=f).copy()).on(n,i),c.on=o}}function S_(e,n){var i=this._id;return arguments.length<2?Ln(this.node(),i).on.on(e):this.each(w_(i,e,n))}function k_(e){return function(){var n=this.parentNode;for(var i in this.__transition)if(+i!==e)return;n&&n.removeChild(this)}}function E_(){return this.on("end.remove",k_(this._id))}function N_(e){var n=this._name,i=this._id;typeof e!="function"&&(e=Wh(e));for(var l=this._groups,o=l.length,s=new Array(o),c=0;c<o;++c)for(var f=l[c],h=f.length,d=s[c]=new Array(h),g,m,x=0;x<h;++x)(g=f[x])&&(m=e.call(g,g.__data__,x,f))&&("__data__"in g&&(m.__data__=g.__data__),d[x]=m,Qu(d[x],n,i,x,d,Ln(g,i)));return new Ei(s,this._parents,n,i)}function __(e){var n=this._name,i=this._id;typeof e!="function"&&(e=F1(e));for(var l=this._groups,o=l.length,s=[],c=[],f=0;f<o;++f)for(var h=l[f],d=h.length,g,m=0;m<d;++m)if(g=h[m]){for(var x=e.call(g,g.__data__,m,h),v,S=Ln(g,i),E=0,C=x.length;E<C;++E)(v=x[E])&&Qu(v,n,i,E,x,S);s.push(x),c.push(g)}return new Ei(s,c,n,i)}var C_=Eo.prototype.constructor;function T_(){return new C_(this._groups,this._parents)}function A_(e,n){var i,l,o;return function(){var s=Rl(this,e),c=(this.style.removeProperty(e),Rl(this,e));return s===c?null:s===i&&c===l?o:o=n(i=s,l=c)}}function yb(e){return function(){this.style.removeProperty(e)}}function M_(e,n,i){var l,o=i+"",s;return function(){var c=Rl(this,e);return c===o?null:c===l?s:s=n(l=c,i)}}function z_(e,n,i){var l,o,s;return function(){var c=Rl(this,e),f=i(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(e),Rl(this,e))),c===h?null:c===l&&h===o?s:(o=h,s=n(l=c,f))}}function j_(e,n){var i,l,o,s="style."+n,c="end."+s,f;return function(){var h=Qn(this,e),d=h.on,g=h.value[s]==null?f||(f=yb(n)):void 0;(d!==i||o!==g)&&(l=(i=d).copy()).on(c,o=g),h.on=l}}function D_(e,n,i){var l=(e+="")=="transform"?ON:gb;return n==null?this.styleTween(e,A_(e,l)).on("end.style."+e,yb(e)):typeof n=="function"?this.styleTween(e,z_(e,l,lp(this,"style."+e,n))).each(j_(this._id,e)):this.styleTween(e,M_(e,l,n),i).on("end.style."+e,null)}function O_(e,n,i){return function(l){this.style.setProperty(e,n.call(this,l),i)}}function R_(e,n,i){var l,o;function s(){var c=n.apply(this,arguments);return c!==o&&(l=(o=c)&&O_(e,c,i)),l}return s._value=n,s}function L_(e,n,i){var l="style."+(e+="");if(arguments.length<2)return(l=this.tween(l))&&l._value;if(n==null)return this.tween(l,null);if(typeof n!="function")throw new Error;return this.tween(l,R_(e,n,i??""))}function B_(e){return function(){this.textContent=e}}function H_(e){return function(){var n=e(this);this.textContent=n??""}}function U_(e){return this.tween("text",typeof e=="function"?H_(lp(this,"text",e)):B_(e==null?"":e+""))}function I_(e){return function(n){this.textContent=e.call(this,n)}}function q_(e){var n,i;function l(){var o=e.apply(this,arguments);return o!==i&&(n=(i=o)&&I_(o)),n}return l._value=e,l}function V_(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,q_(e))}function Y_(){for(var e=this._name,n=this._id,i=xb(),l=this._groups,o=l.length,s=0;s<o;++s)for(var c=l[s],f=c.length,h,d=0;d<f;++d)if(h=c[d]){var g=Ln(h,n);Qu(h,e,i,d,c,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new Ei(l,this._parents,e,i)}function $_(){var e,n,i=this,l=i._id,o=i.size();return new Promise(function(s,c){var f={value:c},h={value:function(){--o===0&&s()}};i.each(function(){var d=Qn(this,l),g=d.on;g!==e&&(n=(e=g).copy(),n._.cancel.push(f),n._.interrupt.push(f),n._.end.push(h)),d.on=n}),o===0&&s()})}var X_=0;function Ei(e,n,i,l){this._groups=e,this._parents=n,this._name=i,this._id=l}function xb(){return++X_}var wi=Eo.prototype;Ei.prototype={constructor:Ei,select:N_,selectAll:__,selectChild:wi.selectChild,selectChildren:wi.selectChildren,filter:x_,merge:b_,selection:T_,transition:Y_,call:wi.call,nodes:wi.nodes,node:wi.node,size:wi.size,empty:wi.empty,each:wi.each,on:S_,attr:n_,attrTween:o_,style:D_,styleTween:L_,text:U_,textTween:V_,remove:E_,tween:ZN,delay:c_,duration:h_,ease:m_,easeVarying:y_,end:$_,[Symbol.iterator]:wi[Symbol.iterator]};function F_(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var G_={time:null,delay:0,duration:250,ease:F_};function P_(e,n){for(var i;!(i=e.__transition)||!(i=i[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return i}function Z_(e){var n,i;e instanceof Ei?(n=e._id,e=e._name):(n=xb(),(i=G_).time=ip(),e=e==null?null:e+"");for(var l=this._groups,o=l.length,s=0;s<o;++s)for(var c=l[s],f=c.length,h,d=0;d<f;++d)(h=c[d])&&Qu(h,e,n,d,c,i||P_(h,n));return new Ei(l,this._parents,e,n)}Eo.prototype.interrupt=FN;Eo.prototype.transition=Z_;const su=e=>()=>e;function Q_(e,{sourceEvent:n,target:i,transform:l,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:l,enumerable:!0,configurable:!0},_:{value:o}})}function Si(e,n,i){this.k=e,this.x=n,this.y=i}Si.prototype={constructor:Si,scale:function(e){return e===1?this:new Si(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Si(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ku=new Si(1,0,0);bb.prototype=Si.prototype;function bb(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ku;return e.__zoom}function qd(e){e.stopImmediatePropagation()}function Fa(e){e.preventDefault(),e.stopImmediatePropagation()}function K_(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function J_(){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 Jy(){return this.__zoom||Ku}function W_(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function eC(){return navigator.maxTouchPoints||"ontouchstart"in this}function tC(e,n,i){var l=e.invertX(n[0][0])-i[0][0],o=e.invertX(n[1][0])-i[1][0],s=e.invertY(n[0][1])-i[0][1],c=e.invertY(n[1][1])-i[1][1];return e.translate(o>l?(l+o)/2:Math.min(0,l)||Math.max(0,o),c>s?(s+c)/2:Math.min(0,s)||Math.max(0,c))}function vb(){var e=K_,n=J_,i=tC,l=W_,o=eC,s=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],f=250,h=vu,d=Gu("start","zoom","end"),g,m,x,v=500,S=150,E=0,C=10;function N(R){R.property("__zoom",Jy).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",Z).on("dblclick.zoom",H).filter(o).on("touchstart.zoom",U).on("touchmove.zoom",Y).on("touchend.zoom touchcancel.zoom",ee).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}N.transform=function(R,I,D,q){var X=R.selection?R.selection():R;X.property("__zoom",Jy),R!==X?B(R,I,D,q):X.interrupt().each(function(){T(this,arguments).event(q).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},N.scaleBy=function(R,I,D,q){N.scaleTo(R,function(){var X=this.__zoom.k,K=typeof I=="function"?I.apply(this,arguments):I;return X*K},D,q)},N.scaleTo=function(R,I,D,q){N.transform(R,function(){var X=n.apply(this,arguments),K=this.__zoom,j=D==null?A(X):typeof D=="function"?D.apply(this,arguments):D,O=K.invert(j),$=typeof I=="function"?I.apply(this,arguments):I;return i(k(_(K,$),j,O),X,c)},D,q)},N.translateBy=function(R,I,D,q){N.transform(R,function(){return i(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof D=="function"?D.apply(this,arguments):D),n.apply(this,arguments),c)},null,q)},N.translateTo=function(R,I,D,q,X){N.transform(R,function(){var K=n.apply(this,arguments),j=this.__zoom,O=q==null?A(K):typeof q=="function"?q.apply(this,arguments):q;return i(Ku.translate(O[0],O[1]).scale(j.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof D=="function"?-D.apply(this,arguments):-D),K,c)},q,X)};function _(R,I){return I=Math.max(s[0],Math.min(s[1],I)),I===R.k?R:new Si(I,R.x,R.y)}function k(R,I,D){var q=I[0]-D[0]*R.k,X=I[1]-D[1]*R.k;return q===R.x&&X===R.y?R:new Si(R.k,q,X)}function A(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function B(R,I,D,q){R.on("start.zoom",function(){T(this,arguments).event(q).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(q).end()}).tween("zoom",function(){var X=this,K=arguments,j=T(X,K).event(q),O=n.apply(X,K),$=D==null?A(O):typeof D=="function"?D.apply(X,K):D,z=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),ne=X.__zoom,ue=typeof I=="function"?I.apply(X,K):I,ce=h(ne.invert($).concat(z/ne.k),ue.invert($).concat(z/ue.k));return function(de){if(de===1)de=ue;else{var se=ce(de),pe=z/se[2];de=new Si(pe,$[0]-se[0]*pe,$[1]-se[1]*pe)}j.zoom(null,de)}})}function T(R,I,D){return!D&&R.__zooming||new L(R,I)}function L(R,I){this.that=R,this.args=I,this.active=0,this.sourceEvent=null,this.extent=n.apply(R,I),this.taps=0}L.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,I){return this.mouse&&R!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var I=fn(this.that).datum();d.call(R,this.that,new Q_(R,{sourceEvent:this.sourceEvent,target:N,transform:this.that.__zoom,dispatch:d}),I)}};function P(R,...I){if(!e.apply(this,arguments))return;var D=T(this,I).event(R),q=this.__zoom,X=Math.max(s[0],Math.min(s[1],q.k*Math.pow(2,l.apply(this,arguments)))),K=Mn(R);if(D.wheel)(D.mouse[0][0]!==K[0]||D.mouse[0][1]!==K[1])&&(D.mouse[1]=q.invert(D.mouse[0]=K)),clearTimeout(D.wheel);else{if(q.k===X)return;D.mouse=[K,q.invert(K)],ku(this),D.start()}Fa(R),D.wheel=setTimeout(j,S),D.zoom("mouse",i(k(_(q,X),D.mouse[0],D.mouse[1]),D.extent,c));function j(){D.wheel=null,D.end()}}function Z(R,...I){if(x||!e.apply(this,arguments))return;var D=R.currentTarget,q=T(this,I,!0).event(R),X=fn(R.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",z,!0),K=Mn(R,D),j=R.clientX,O=R.clientY;ib(R.view),qd(R),q.mouse=[K,this.__zoom.invert(K)],ku(this),q.start();function $(ne){if(Fa(ne),!q.moved){var ue=ne.clientX-j,ce=ne.clientY-O;q.moved=ue*ue+ce*ce>E}q.event(ne).zoom("mouse",i(k(q.that.__zoom,q.mouse[0]=Mn(ne,D),q.mouse[1]),q.extent,c))}function z(ne){X.on("mousemove.zoom mouseup.zoom",null),rb(ne.view,q.moved),Fa(ne),q.event(ne).end()}}function H(R,...I){if(e.apply(this,arguments)){var D=this.__zoom,q=Mn(R.changedTouches?R.changedTouches[0]:R,this),X=D.invert(q),K=D.k*(R.shiftKey?.5:2),j=i(k(_(D,K),q,X),n.apply(this,I),c);Fa(R),f>0?fn(this).transition().duration(f).call(B,j,q,R):fn(this).call(N.transform,j,q,R)}}function U(R,...I){if(e.apply(this,arguments)){var D=R.touches,q=D.length,X=T(this,I,R.changedTouches.length===q).event(R),K,j,O,$;for(qd(R),j=0;j<q;++j)O=D[j],$=Mn(O,this),$=[$,this.__zoom.invert($),O.identifier],X.touch0?!X.touch1&&X.touch0[2]!==$[2]&&(X.touch1=$,X.taps=0):(X.touch0=$,K=!0,X.taps=1+!!g);g&&(g=clearTimeout(g)),K&&(X.taps<2&&(m=$[0],g=setTimeout(function(){g=null},v)),ku(this),X.start())}}function Y(R,...I){if(this.__zooming){var D=T(this,I).event(R),q=R.changedTouches,X=q.length,K,j,O,$;for(Fa(R),K=0;K<X;++K)j=q[K],O=Mn(j,this),D.touch0&&D.touch0[2]===j.identifier?D.touch0[0]=O:D.touch1&&D.touch1[2]===j.identifier&&(D.touch1[0]=O);if(j=D.that.__zoom,D.touch1){var z=D.touch0[0],ne=D.touch0[1],ue=D.touch1[0],ce=D.touch1[1],de=(de=ue[0]-z[0])*de+(de=ue[1]-z[1])*de,se=(se=ce[0]-ne[0])*se+(se=ce[1]-ne[1])*se;j=_(j,Math.sqrt(de/se)),O=[(z[0]+ue[0])/2,(z[1]+ue[1])/2],$=[(ne[0]+ce[0])/2,(ne[1]+ce[1])/2]}else if(D.touch0)O=D.touch0[0],$=D.touch0[1];else return;D.zoom("touch",i(k(j,O,$),D.extent,c))}}function ee(R,...I){if(this.__zooming){var D=T(this,I).event(R),q=R.changedTouches,X=q.length,K,j;for(qd(R),x&&clearTimeout(x),x=setTimeout(function(){x=null},v),K=0;K<X;++K)j=q[K],D.touch0&&D.touch0[2]===j.identifier?delete D.touch0:D.touch1&&D.touch1[2]===j.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(j=Mn(j,this),Math.hypot(m[0]-j[0],m[1]-j[1])<C)){var O=fn(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return N.wheelDelta=function(R){return arguments.length?(l=typeof R=="function"?R:su(+R),N):l},N.filter=function(R){return arguments.length?(e=typeof R=="function"?R:su(!!R),N):e},N.touchable=function(R){return arguments.length?(o=typeof R=="function"?R:su(!!R),N):o},N.extent=function(R){return arguments.length?(n=typeof R=="function"?R:su([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),N):n},N.scaleExtent=function(R){return arguments.length?(s[0]=+R[0],s[1]=+R[1],N):[s[0],s[1]]},N.translateExtent=function(R){return arguments.length?(c[0][0]=+R[0][0],c[1][0]=+R[1][0],c[0][1]=+R[0][1],c[1][1]=+R[1][1],N):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},N.constrain=function(R){return arguments.length?(i=R,N):i},N.duration=function(R){return arguments.length?(f=+R,N):f},N.interpolate=function(R){return arguments.length?(h=R,N):h},N.on=function(){var R=d.on.apply(d,arguments);return R===d?N:R},N.clickDistance=function(R){return arguments.length?(E=(R=+R)*R,N):Math.sqrt(E)},N.tapDistance=function(R){return arguments.length?(C=+R,N):C},N}const Gn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:i,targetHandle:l})=>`Couldn't create edge for ${e} handle id: "${e==="source"?i:l}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},fo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],wb=["Enter"," ","Escape"],Sb={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:n,y:i})=>`Moved selected node ${e}. New position, x: ${n}, y: ${i}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Bl;(function(e){e.Strict="strict",e.Loose="loose"})(Bl||(Bl={}));var Dr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Dr||(Dr={}));var ho;(function(e){e.Partial="partial",e.Full="full"})(ho||(ho={}));const kb={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var lr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(lr||(lr={}));var Bu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Bu||(Bu={}));var ye;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ye||(ye={}));const Wy={[ye.Left]:ye.Right,[ye.Right]:ye.Left,[ye.Top]:ye.Bottom,[ye.Bottom]:ye.Top};function Eb(e){return e===null?null:e?"valid":"invalid"}const Nb=e=>"id"in e&&"source"in e&&"target"in e,nC=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ap=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),_o=(e,n=[0,0])=>{const{width:i,height:l}=Ni(e),o=e.origin??n,s=i*o[0],c=l*o[1];return{x:e.position.x-s,y:e.position.y-c}},iC=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const i=e.reduce((l,o)=>{const s=typeof o=="string";let c=!n.nodeLookup&&!s?o:void 0;n.nodeLookup&&(c=s?n.nodeLookup.get(o):ap(o)?o:n.nodeLookup.get(o.id));const f=c?Hu(c,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ju(l,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Wu(i)},Co=(e,n={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},l=!1;return e.forEach(o=>{(n.filter===void 0||n.filter(o))&&(i=Ju(i,Hu(o)),l=!0)}),l?Wu(i):{x:0,y:0,width:0,height:0}},op=(e,n,[i,l,o]=[0,0,1],s=!1,c=!1)=>{const f={...Ao(n,[i,l,o]),width:n.width/o,height:n.height/o},h=[];for(const d of e.values()){const{measured:g,selectable:m=!0,hidden:x=!1}=d;if(c&&!m||x)continue;const v=g.width??d.width??d.initialWidth??null,S=g.height??d.height??d.initialHeight??null,E=po(f,Ul(d)),C=(v??0)*(S??0),N=s&&E>0;(!d.internals.handleBounds||N||E>=C||d.dragging)&&h.push(d)}return h},rC=(e,n)=>{const i=new Set;return e.forEach(l=>{i.add(l.id)}),n.filter(l=>i.has(l.source)||i.has(l.target))};function lC(e,n){const i=new Map,l=n?.nodes?new Set(n.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&(n?.includeHiddenNodes||!o.hidden)&&(!l||l.has(o.id))&&i.set(o.id,o)}),i}async function aC({nodes:e,width:n,height:i,panZoom:l,minZoom:o,maxZoom:s},c){if(e.size===0)return Promise.resolve(!0);const f=lC(e,c),h=Co(f),d=sp(h,n,i,c?.minZoom??o,c?.maxZoom??s,c?.padding??.1);return await l.setViewport(d,{duration:c?.duration,ease:c?.ease,interpolate:c?.interpolate}),Promise.resolve(!0)}function _b({nodeId:e,nextPosition:n,nodeLookup:i,nodeOrigin:l=[0,0],nodeExtent:o,onError:s}){const c=i.get(e),f=c.parentId?i.get(c.parentId):void 0,{x:h,y:d}=f?f.internals.positionAbsolute:{x:0,y:0},g=c.origin??l;let m=c.extent||o;if(c.extent==="parent"&&!c.expandParent)if(!f)s?.("005",Gn.error005());else{const v=f.measured.width,S=f.measured.height;v&&S&&(m=[[h,d],[h+v,d+S]])}else f&&Il(c.extent)&&(m=[[c.extent[0][0]+h,c.extent[0][1]+d],[c.extent[1][0]+h,c.extent[1][1]+d]]);const x=Il(m)?Lr(n,m,c.measured):n;return(c.measured.width===void 0||c.measured.height===void 0)&&s?.("015",Gn.error015()),{position:{x:x.x-h+(c.measured.width??0)*g[0],y:x.y-d+(c.measured.height??0)*g[1]},positionAbsolute:x}}async function oC({nodesToRemove:e=[],edgesToRemove:n=[],nodes:i,edges:l,onBeforeDelete:o}){const s=new Set(e.map(x=>x.id)),c=[];for(const x of i){if(x.deletable===!1)continue;const v=s.has(x.id),S=!v&&x.parentId&&c.find(E=>E.id===x.parentId);(v||S)&&c.push(x)}const f=new Set(n.map(x=>x.id)),h=l.filter(x=>x.deletable!==!1),g=rC(c,h);for(const x of h)f.has(x.id)&&!g.find(S=>S.id===x.id)&&g.push(x);if(!o)return{edges:g,nodes:c};const m=await o({nodes:c,edges:g});return typeof m=="boolean"?m?{edges:g,nodes:c}:{edges:[],nodes:[]}:m}const Hl=(e,n=0,i=1)=>Math.min(Math.max(e,n),i),Lr=(e={x:0,y:0},n,i)=>({x:Hl(e.x,n[0][0],n[1][0]-(i?.width??0)),y:Hl(e.y,n[0][1],n[1][1]-(i?.height??0))});function Cb(e,n,i){const{width:l,height:o}=Ni(i),{x:s,y:c}=i.internals.positionAbsolute;return Lr(e,[[s,c],[s+l,c+o]],n)}const ex=(e,n,i)=>e<n?Hl(Math.abs(e-n),1,n)/n:e>i?-Hl(Math.abs(e-i),1,n)/n:0,Tb=(e,n,i=15,l=40)=>{const o=ex(e.x,l,n.width-l)*i,s=ex(e.y,l,n.height-l)*i;return[o,s]},Ju=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),Nh=({x:e,y:n,width:i,height:l})=>({x:e,y:n,x2:e+i,y2:n+l}),Wu=({x:e,y:n,x2:i,y2:l})=>({x:e,y:n,width:i-e,height:l-n}),Ul=(e,n=[0,0])=>{const{x:i,y:l}=ap(e)?e.internals.positionAbsolute:_o(e,n);return{x:i,y:l,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Hu=(e,n=[0,0])=>{const{x:i,y:l}=ap(e)?e.internals.positionAbsolute:_o(e,n);return{x:i,y:l,x2:i+(e.measured?.width??e.width??e.initialWidth??0),y2:l+(e.measured?.height??e.height??e.initialHeight??0)}},Ab=(e,n)=>Wu(Ju(Nh(e),Nh(n))),po=(e,n)=>{const i=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),l=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(i*l)},tx=e=>Dn(e.width)&&Dn(e.height)&&Dn(e.x)&&Dn(e.y),Dn=e=>!isNaN(e)&&isFinite(e),sC=(e,n)=>{},To=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),Ao=({x:e,y:n},[i,l,o],s=!1,c=[1,1])=>{const f={x:(e-i)/o,y:(n-l)/o};return s?To(f,c):f},Uu=({x:e,y:n},[i,l,o])=>({x:e*o+i,y:n*o+l});function _l(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(i)}if(typeof e=="string"&&e.endsWith("%")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(n*i*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function uC(e,n,i){if(typeof e=="string"||typeof e=="number"){const l=_l(e,i),o=_l(e,n);return{top:l,right:o,bottom:l,left:o,x:o*2,y:l*2}}if(typeof e=="object"){const l=_l(e.top??e.y??0,i),o=_l(e.bottom??e.y??0,i),s=_l(e.left??e.x??0,n),c=_l(e.right??e.x??0,n);return{top:l,right:c,bottom:o,left:s,x:s+c,y:l+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function cC(e,n,i,l,o,s){const{x:c,y:f}=Uu(e,[n,i,l]),{x:h,y:d}=Uu({x:e.x+e.width,y:e.y+e.height},[n,i,l]),g=o-h,m=s-d;return{left:Math.floor(c),top:Math.floor(f),right:Math.floor(g),bottom:Math.floor(m)}}const sp=(e,n,i,l,o,s)=>{const c=uC(s,n,i),f=(n-c.x)/e.width,h=(i-c.y)/e.height,d=Math.min(f,h),g=Hl(d,l,o),m=e.x+e.width/2,x=e.y+e.height/2,v=n/2-m*g,S=i/2-x*g,E=cC(e,v,S,g,n,i),C={left:Math.min(E.left-c.left,0),top:Math.min(E.top-c.top,0),right:Math.min(E.right-c.right,0),bottom:Math.min(E.bottom-c.bottom,0)};return{x:v-C.left+C.right,y:S-C.top+C.bottom,zoom:g}},mo=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Il(e){return e!=null&&e!=="parent"}function Ni(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Mb(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function zb(e,n={width:0,height:0},i,l,o){const s={...e},c=l.get(i);if(c){const f=c.origin||o;s.x+=c.internals.positionAbsolute.x-(n.width??0)*f[0],s.y+=c.internals.positionAbsolute.y-(n.height??0)*f[1]}return s}function nx(e,n){if(e.size!==n.size)return!1;for(const i of e)if(!n.has(i))return!1;return!0}function fC(){let e,n;return{promise:new Promise((l,o)=>{e=l,n=o}),resolve:e,reject:n}}function dC(e){return{...Sb,...e||{}}}function io(e,{snapGrid:n=[0,0],snapToGrid:i=!1,transform:l,containerBounds:o}){const{x:s,y:c}=On(e),f=Ao({x:s-(o?.left??0),y:c-(o?.top??0)},l),{x:h,y:d}=i?To(f,n):f;return{xSnapped:h,ySnapped:d,...f}}const up=e=>({width:e.offsetWidth,height:e.offsetHeight}),jb=e=>e?.getRootNode?.()||window?.document,hC=["INPUT","SELECT","TEXTAREA"];function Db(e){const n=e.composedPath?.()?.[0]||e.target;return n?.nodeType!==1?!1:hC.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const Ob=e=>"clientX"in e,On=(e,n)=>{const i=Ob(e),l=i?e.clientX:e.touches?.[0].clientX,o=i?e.clientY:e.touches?.[0].clientY;return{x:l-(n?.left??0),y:o-(n?.top??0)}},ix=(e,n,i,l,o)=>{const s=n.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(c=>{const f=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),type:e,nodeId:o,position:c.getAttribute("data-handlepos"),x:(f.left-i.left)/l,y:(f.top-i.top)/l,...up(c)}})};function Rb({sourceX:e,sourceY:n,targetX:i,targetY:l,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:f}){const h=e*.125+o*.375+c*.375+i*.125,d=n*.125+s*.375+f*.375+l*.125,g=Math.abs(h-e),m=Math.abs(d-n);return[h,d,g,m]}function uu(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function rx({pos:e,x1:n,y1:i,x2:l,y2:o,c:s}){switch(e){case ye.Left:return[n-uu(n-l,s),i];case ye.Right:return[n+uu(l-n,s),i];case ye.Top:return[n,i-uu(i-o,s)];case ye.Bottom:return[n,i+uu(o-i,s)]}}function Lb({sourceX:e,sourceY:n,sourcePosition:i=ye.Bottom,targetX:l,targetY:o,targetPosition:s=ye.Top,curvature:c=.25}){const[f,h]=rx({pos:i,x1:e,y1:n,x2:l,y2:o,c}),[d,g]=rx({pos:s,x1:l,y1:o,x2:e,y2:n,c}),[m,x,v,S]=Rb({sourceX:e,sourceY:n,targetX:l,targetY:o,sourceControlX:f,sourceControlY:h,targetControlX:d,targetControlY:g});return[`M${e},${n} C${f},${h} ${d},${g} ${l},${o}`,m,x,v,S]}function Bb({sourceX:e,sourceY:n,targetX:i,targetY:l}){const o=Math.abs(i-e)/2,s=i<e?i+o:i-o,c=Math.abs(l-n)/2,f=l<n?l+c:l-c;return[s,f,o,c]}function pC({sourceNode:e,targetNode:n,selected:i=!1,zIndex:l=0,elevateOnSelect:o=!1,zIndexMode:s="basic"}){if(s==="manual")return l;const c=o&&i?l+1e3:l,f=Math.max(e.parentId||o&&e.selected?e.internals.z:0,n.parentId||o&&n.selected?n.internals.z:0);return c+f}function mC({sourceNode:e,targetNode:n,width:i,height:l,transform:o}){const s=Ju(Hu(e),Hu(n));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const c={x:-o[0]/o[2],y:-o[1]/o[2],width:i/o[2],height:l/o[2]};return po(c,Wu(s))>0}const gC=({source:e,sourceHandle:n,target:i,targetHandle:l})=>`xy-edge__${e}${n||""}-${i}${l||""}`,yC=(e,n)=>n.some(i=>i.source===e.source&&i.target===e.target&&(i.sourceHandle===e.sourceHandle||!i.sourceHandle&&!e.sourceHandle)&&(i.targetHandle===e.targetHandle||!i.targetHandle&&!e.targetHandle)),_h=(e,n,i={})=>{if(!e.source||!e.target)return n;const l=i.getEdgeId||gC;let o;return Nb(e)?o={...e}:o={...e,id:l(e)},yC(o,n)?n:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,n.concat(o))};function Hb({sourceX:e,sourceY:n,targetX:i,targetY:l}){const[o,s,c,f]=Bb({sourceX:e,sourceY:n,targetX:i,targetY:l});return[`M ${e},${n}L ${i},${l}`,o,s,c,f]}const lx={[ye.Left]:{x:-1,y:0},[ye.Right]:{x:1,y:0},[ye.Top]:{x:0,y:-1},[ye.Bottom]:{x:0,y:1}},xC=({source:e,sourcePosition:n=ye.Bottom,target:i})=>n===ye.Left||n===ye.Right?e.x<i.x?{x:1,y:0}:{x:-1,y:0}:e.y<i.y?{x:0,y:1}:{x:0,y:-1},ax=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function bC({source:e,sourcePosition:n=ye.Bottom,target:i,targetPosition:l=ye.Top,center:o,offset:s,stepPosition:c}){const f=lx[n],h=lx[l],d={x:e.x+f.x*s,y:e.y+f.y*s},g={x:i.x+h.x*s,y:i.y+h.y*s},m=xC({source:d,sourcePosition:n,target:g}),x=m.x!==0?"x":"y",v=m[x];let S=[],E,C;const N={x:0,y:0},_={x:0,y:0},[,,k,A]=Bb({sourceX:e.x,sourceY:e.y,targetX:i.x,targetY:i.y});if(f[x]*h[x]===-1){x==="x"?(E=o.x??d.x+(g.x-d.x)*c,C=o.y??(d.y+g.y)/2):(E=o.x??(d.x+g.x)/2,C=o.y??d.y+(g.y-d.y)*c);const T=[{x:E,y:d.y},{x:E,y:g.y}],L=[{x:d.x,y:C},{x:g.x,y:C}];f[x]===v?S=x==="x"?T:L:S=x==="x"?L:T}else{const T=[{x:d.x,y:g.y}],L=[{x:g.x,y:d.y}];if(x==="x"?S=f.x===v?L:T:S=f.y===v?T:L,n===l){const Y=Math.abs(e[x]-i[x]);if(Y<=s){const ee=Math.min(s-1,s-Y);f[x]===v?N[x]=(d[x]>e[x]?-1:1)*ee:_[x]=(g[x]>i[x]?-1:1)*ee}}if(n!==l){const Y=x==="x"?"y":"x",ee=f[x]===h[Y],R=d[Y]>g[Y],I=d[Y]<g[Y];(f[x]===1&&(!ee&&R||ee&&I)||f[x]!==1&&(!ee&&I||ee&&R))&&(S=x==="x"?T:L)}const P={x:d.x+N.x,y:d.y+N.y},Z={x:g.x+_.x,y:g.y+_.y},H=Math.max(Math.abs(P.x-S[0].x),Math.abs(Z.x-S[0].x)),U=Math.max(Math.abs(P.y-S[0].y),Math.abs(Z.y-S[0].y));H>=U?(E=(P.x+Z.x)/2,C=S[0].y):(E=S[0].x,C=(P.y+Z.y)/2)}return[[e,{x:d.x+N.x,y:d.y+N.y},...S,{x:g.x+_.x,y:g.y+_.y},i],E,C,k,A]}function vC(e,n,i,l){const o=Math.min(ax(e,n)/2,ax(n,i)/2,l),{x:s,y:c}=n;if(e.x===s&&s===i.x||e.y===c&&c===i.y)return`L${s} ${c}`;if(e.y===c){const d=e.x<i.x?-1:1,g=e.y<i.y?1:-1;return`L ${s+o*d},${c}Q ${s},${c} ${s},${c+o*g}`}const f=e.x<i.x?1:-1,h=e.y<i.y?-1:1;return`L ${s},${c+o*h}Q ${s},${c} ${s+o*f},${c}`}function Ch({sourceX:e,sourceY:n,sourcePosition:i=ye.Bottom,targetX:l,targetY:o,targetPosition:s=ye.Top,borderRadius:c=5,centerX:f,centerY:h,offset:d=20,stepPosition:g=.5}){const[m,x,v,S,E]=bC({source:{x:e,y:n},sourcePosition:i,target:{x:l,y:o},targetPosition:s,center:{x:f,y:h},offset:d,stepPosition:g});return[m.reduce((N,_,k)=>{let A="";return k>0&&k<m.length-1?A=vC(m[k-1],_,m[k+1],c):A=`${k===0?"M":"L"}${_.x} ${_.y}`,N+=A,N},""),x,v,S,E]}function ox(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function wC(e){const{sourceNode:n,targetNode:i}=e;if(!ox(n)||!ox(i))return null;const l=n.internals.handleBounds||sx(n.handles),o=i.internals.handleBounds||sx(i.handles),s=ux(l?.source??[],e.sourceHandle),c=ux(e.connectionMode===Bl.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!s||!c)return e.onError?.("008",Gn.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const f=s?.position||ye.Bottom,h=c?.position||ye.Top,d=Br(n,s,f),g=Br(i,c,h);return{sourceX:d.x,sourceY:d.y,targetX:g.x,targetY:g.y,sourcePosition:f,targetPosition:h}}function sx(e){if(!e)return null;const n=[],i=[];for(const l of e)l.width=l.width??1,l.height=l.height??1,l.type==="source"?n.push(l):l.type==="target"&&i.push(l);return{source:n,target:i}}function Br(e,n,i=ye.Left,l=!1){const o=(n?.x??0)+e.internals.positionAbsolute.x,s=(n?.y??0)+e.internals.positionAbsolute.y,{width:c,height:f}=n??Ni(e);if(l)return{x:o+c/2,y:s+f/2};switch(n?.position??i){case ye.Top:return{x:o+c/2,y:s};case ye.Right:return{x:o+c,y:s+f/2};case ye.Bottom:return{x:o+c/2,y:s+f};case ye.Left:return{x:o,y:s+f/2}}}function ux(e,n){return e&&(n?e.find(i=>i.id===n):e[0])||null}function Th(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(l=>`${l}=${e[l]}`).join("&")}`:""}function SC(e,{id:n,defaultColor:i,defaultMarkerStart:l,defaultMarkerEnd:o}){const s=new Set;return e.reduce((c,f)=>([f.markerStart||l,f.markerEnd||o].forEach(h=>{if(h&&typeof h=="object"){const d=Th(h,n);s.has(d)||(c.push({id:d,color:h.color||i,...h}),s.add(d))}}),c),[]).sort((c,f)=>c.id.localeCompare(f.id))}const Ub=1e3,kC=10,cp={nodeOrigin:[0,0],nodeExtent:fo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},EC={...cp,checkEquality:!0};function fp(e,n){const i={...e};for(const l in n)n[l]!==void 0&&(i[l]=n[l]);return i}function NC(e,n,i){const l=fp(cp,i);for(const o of e.values())if(o.parentId)hp(o,e,n,l);else{const s=_o(o,l.nodeOrigin),c=Il(o.extent)?o.extent:l.nodeExtent,f=Lr(s,c,Ni(o));o.internals.positionAbsolute=f}}function _C(e,n){if(!e.handles)return e.measured?n?.internals.handleBounds:void 0;const i=[],l=[];for(const o of e.handles){const s={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?i.push(s):o.type==="target"&&l.push(s)}return{source:i,target:l}}function dp(e){return e==="manual"}function Ah(e,n,i,l={}){const o=fp(EC,l),s={i:0},c=new Map(n),f=o?.elevateNodesOnSelect&&!dp(o.zIndexMode)?Ub:0;let h=e.length>0;n.clear(),i.clear();for(const d of e){let g=c.get(d.id);if(o.checkEquality&&d===g?.internals.userNode)n.set(d.id,g);else{const m=_o(d,o.nodeOrigin),x=Il(d.extent)?d.extent:o.nodeExtent,v=Lr(m,x,Ni(d));g={...o.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:v,handleBounds:_C(d,g),z:Ib(d,f,o.zIndexMode),userNode:d}},n.set(d.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(h=!1),d.parentId&&hp(g,n,i,l,s)}return h}function CC(e,n){if(!e.parentId)return;const i=n.get(e.parentId);i?i.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function hp(e,n,i,l,o){const{elevateNodesOnSelect:s,nodeOrigin:c,nodeExtent:f,zIndexMode:h}=fp(cp,l),d=e.parentId,g=n.get(d);if(!g){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}CC(e,i),o&&!g.parentId&&g.internals.rootParentIndex===void 0&&h==="auto"&&(g.internals.rootParentIndex=++o.i,g.internals.z=g.internals.z+o.i*kC),o&&g.internals.rootParentIndex!==void 0&&(o.i=g.internals.rootParentIndex);const m=s&&!dp(h)?Ub:0,{x,y:v,z:S}=TC(e,g,c,f,m,h),{positionAbsolute:E}=e.internals,C=x!==E.x||v!==E.y;(C||S!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:C?{x,y:v}:E,z:S}})}function Ib(e,n,i){const l=Dn(e.zIndex)?e.zIndex:0;return dp(i)?l:l+(e.selected?n:0)}function TC(e,n,i,l,o,s){const{x:c,y:f}=n.internals.positionAbsolute,h=Ni(e),d=_o(e,i),g=Il(e.extent)?Lr(d,e.extent,h):d;let m=Lr({x:c+g.x,y:f+g.y},l,h);e.extent==="parent"&&(m=Cb(m,h,n));const x=Ib(e,o,s),v=n.internals.z??0;return{x:m.x,y:m.y,z:v>=x?v+1:x}}function pp(e,n,i,l=[0,0]){const o=[],s=new Map;for(const c of e){const f=n.get(c.parentId);if(!f)continue;const h=s.get(c.parentId)?.expandedRect??Ul(f),d=Ab(h,c.rect);s.set(c.parentId,{expandedRect:d,parent:f})}return s.size>0&&s.forEach(({expandedRect:c,parent:f},h)=>{const d=f.internals.positionAbsolute,g=Ni(f),m=f.origin??l,x=c.x<d.x?Math.round(Math.abs(d.x-c.x)):0,v=c.y<d.y?Math.round(Math.abs(d.y-c.y)):0,S=Math.max(g.width,Math.round(c.width)),E=Math.max(g.height,Math.round(c.height)),C=(S-g.width)*m[0],N=(E-g.height)*m[1];(x>0||v>0||C||N)&&(o.push({id:h,type:"position",position:{x:f.position.x-x+C,y:f.position.y-v+N}}),i.get(h)?.forEach(_=>{e.some(k=>k.id===_.id)||o.push({id:_.id,type:"position",position:{x:_.position.x+x,y:_.position.y+v}})})),(g.width<c.width||g.height<c.height||x||v)&&o.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:S+(x?m[0]*x-C:0),height:E+(v?m[1]*v-N:0)}})}),o}function AC(e,n,i,l,o,s,c){const f=l?.querySelector(".xyflow__viewport");let h=!1;if(!f)return{changes:[],updatedInternals:h};const d=[],g=window.getComputedStyle(f),{m22:m}=new window.DOMMatrixReadOnly(g.transform),x=[];for(const v of e.values()){const S=n.get(v.id);if(!S)continue;if(S.hidden){n.set(S.id,{...S,internals:{...S.internals,handleBounds:void 0}}),h=!0;continue}const E=up(v.nodeElement),C=S.measured.width!==E.width||S.measured.height!==E.height;if(!!(E.width&&E.height&&(C||!S.internals.handleBounds||v.force))){const _=v.nodeElement.getBoundingClientRect(),k=Il(S.extent)?S.extent:s;let{positionAbsolute:A}=S.internals;S.parentId&&S.extent==="parent"?A=Cb(A,E,n.get(S.parentId)):k&&(A=Lr(A,k,E));const B={...S,measured:E,internals:{...S.internals,positionAbsolute:A,handleBounds:{source:ix("source",v.nodeElement,_,m,S.id),target:ix("target",v.nodeElement,_,m,S.id)}}};n.set(S.id,B),S.parentId&&hp(B,n,i,{nodeOrigin:o,zIndexMode:c}),h=!0,C&&(d.push({id:S.id,type:"dimensions",dimensions:E}),S.expandParent&&S.parentId&&x.push({id:S.id,parentId:S.parentId,rect:Ul(B,o)}))}}if(x.length>0){const v=pp(x,n,i,o);d.push(...v)}return{changes:d,updatedInternals:h}}async function MC({delta:e,panZoom:n,transform:i,translateExtent:l,width:o,height:s}){if(!n||!e.x&&!e.y)return Promise.resolve(!1);const c=await n.setViewportConstrained({x:i[0]+e.x,y:i[1]+e.y,zoom:i[2]},[[0,0],[o,s]],l),f=!!c&&(c.x!==i[0]||c.y!==i[1]||c.k!==i[2]);return Promise.resolve(f)}function cx(e,n,i,l,o,s){let c=o;const f=l.get(c)||new Map;l.set(c,f.set(i,n)),c=`${o}-${e}`;const h=l.get(c)||new Map;if(l.set(c,h.set(i,n)),s){c=`${o}-${e}-${s}`;const d=l.get(c)||new Map;l.set(c,d.set(i,n))}}function qb(e,n,i){e.clear(),n.clear();for(const l of i){const{source:o,target:s,sourceHandle:c=null,targetHandle:f=null}=l,h={edgeId:l.id,source:o,target:s,sourceHandle:c,targetHandle:f},d=`${o}-${c}--${s}-${f}`,g=`${s}-${f}--${o}-${c}`;cx("source",h,g,e,o,c),cx("target",h,d,e,s,f),n.set(l.id,l)}}function Vb(e,n){if(!e.parentId)return!1;const i=n.get(e.parentId);return i?i.selected?!0:Vb(i,n):!1}function fx(e,n,i){let l=e;do{if(l?.matches?.(n))return!0;if(l===i)return!1;l=l?.parentElement}while(l);return!1}function zC(e,n,i,l){const o=new Map;for(const[s,c]of e)if((c.selected||c.id===l)&&(!c.parentId||!Vb(c,e))&&(c.draggable||n&&typeof c.draggable>"u")){const f=e.get(s);f&&o.set(s,{id:s,position:f.position||{x:0,y:0},distance:{x:i.x-f.internals.positionAbsolute.x,y:i.y-f.internals.positionAbsolute.y},extent:f.extent,parentId:f.parentId,origin:f.origin,expandParent:f.expandParent,internals:{positionAbsolute:f.internals.positionAbsolute||{x:0,y:0}},measured:{width:f.measured.width??0,height:f.measured.height??0}})}return o}function Vd({nodeId:e,dragItems:n,nodeLookup:i,dragging:l=!0}){const o=[];for(const[c,f]of n){const h=i.get(c)?.internals.userNode;h&&o.push({...h,position:f.position,dragging:l})}if(!e)return[o[0],o];const s=i.get(e)?.internals.userNode;return[s?{...s,position:n.get(e)?.position||s.position,dragging:l}:o[0],o]}function jC({dragItems:e,snapGrid:n,x:i,y:l}){const o=e.values().next().value;if(!o)return null;const s={x:i-o.distance.x,y:l-o.distance.y},c=To(s,n);return{x:c.x-s.x,y:c.y-s.y}}function DC({onNodeMouseDown:e,getStoreItems:n,onDragStart:i,onDrag:l,onDragStop:o}){let s={x:null,y:null},c=0,f=new Map,h=!1,d={x:0,y:0},g=null,m=!1,x=null,v=!1,S=!1,E=null;function C({noDragClassName:_,handleSelector:k,domNode:A,isSelectable:B,nodeId:T,nodeClickDistance:L=0}){x=fn(A);function P({x:Y,y:ee}){const{nodeLookup:R,nodeExtent:I,snapGrid:D,snapToGrid:q,nodeOrigin:X,onNodeDrag:K,onSelectionDrag:j,onError:O,updateNodePositions:$}=n();s={x:Y,y:ee};let z=!1;const ne=f.size>1,ue=ne&&I?Nh(Co(f)):null,ce=ne&&q?jC({dragItems:f,snapGrid:D,x:Y,y:ee}):null;for(const[de,se]of f){if(!R.has(de))continue;let pe={x:Y-se.distance.x,y:ee-se.distance.y};q&&(pe=ce?{x:Math.round(pe.x+ce.x),y:Math.round(pe.y+ce.y)}:To(pe,D));let ke=null;if(ne&&I&&!se.extent&&ue){const{positionAbsolute:Ee}=se.internals,je=Ee.x-ue.x+I[0][0],Fe=Ee.x+se.measured.width-ue.x2+I[1][0],Ye=Ee.y-ue.y+I[0][1],ct=Ee.y+se.measured.height-ue.y2+I[1][1];ke=[[je,Ye],[Fe,ct]]}const{position:Ne,positionAbsolute:be}=_b({nodeId:de,nextPosition:pe,nodeLookup:R,nodeExtent:ke||I,nodeOrigin:X,onError:O});z=z||se.position.x!==Ne.x||se.position.y!==Ne.y,se.position=Ne,se.internals.positionAbsolute=be}if(S=S||z,!!z&&($(f,!0),E&&(l||K||!T&&j))){const[de,se]=Vd({nodeId:T,dragItems:f,nodeLookup:R});l?.(E,f,de,se),K?.(E,de,se),T||j?.(E,se)}}async function Z(){if(!g)return;const{transform:Y,panBy:ee,autoPanSpeed:R,autoPanOnNodeDrag:I}=n();if(!I){h=!1,cancelAnimationFrame(c);return}const[D,q]=Tb(d,g,R);(D!==0||q!==0)&&(s.x=(s.x??0)-D/Y[2],s.y=(s.y??0)-q/Y[2],await ee({x:D,y:q})&&P(s)),c=requestAnimationFrame(Z)}function H(Y){const{nodeLookup:ee,multiSelectionActive:R,nodesDraggable:I,transform:D,snapGrid:q,snapToGrid:X,selectNodesOnDrag:K,onNodeDragStart:j,onSelectionDragStart:O,unselectNodesAndEdges:$}=n();m=!0,(!K||!B)&&!R&&T&&(ee.get(T)?.selected||$()),B&&K&&T&&e?.(T);const z=io(Y.sourceEvent,{transform:D,snapGrid:q,snapToGrid:X,containerBounds:g});if(s=z,f=zC(ee,I,z,T),f.size>0&&(i||j||!T&&O)){const[ne,ue]=Vd({nodeId:T,dragItems:f,nodeLookup:ee});i?.(Y.sourceEvent,f,ne,ue),j?.(Y.sourceEvent,ne,ue),T||O?.(Y.sourceEvent,ue)}}const U=lb().clickDistance(L).on("start",Y=>{const{domNode:ee,nodeDragThreshold:R,transform:I,snapGrid:D,snapToGrid:q}=n();g=ee?.getBoundingClientRect()||null,v=!1,S=!1,E=Y.sourceEvent,R===0&&H(Y),s=io(Y.sourceEvent,{transform:I,snapGrid:D,snapToGrid:q,containerBounds:g}),d=On(Y.sourceEvent,g)}).on("drag",Y=>{const{autoPanOnNodeDrag:ee,transform:R,snapGrid:I,snapToGrid:D,nodeDragThreshold:q,nodeLookup:X}=n(),K=io(Y.sourceEvent,{transform:R,snapGrid:I,snapToGrid:D,containerBounds:g});if(E=Y.sourceEvent,(Y.sourceEvent.type==="touchmove"&&Y.sourceEvent.touches.length>1||T&&!X.has(T))&&(v=!0),!v){if(!h&&ee&&m&&(h=!0,Z()),!m){const j=On(Y.sourceEvent,g),O=j.x-d.x,$=j.y-d.y;Math.sqrt(O*O+$*$)>q&&H(Y)}(s.x!==K.xSnapped||s.y!==K.ySnapped)&&f&&m&&(d=On(Y.sourceEvent,g),P(K))}}).on("end",Y=>{if(!(!m||v)&&(h=!1,m=!1,cancelAnimationFrame(c),f.size>0)){const{nodeLookup:ee,updateNodePositions:R,onNodeDragStop:I,onSelectionDragStop:D}=n();if(S&&(R(f,!1),S=!1),o||I||!T&&D){const[q,X]=Vd({nodeId:T,dragItems:f,nodeLookup:ee,dragging:!1});o?.(Y.sourceEvent,f,q,X),I?.(Y.sourceEvent,q,X),T||D?.(Y.sourceEvent,X)}}}).filter(Y=>{const ee=Y.target;return!Y.button&&(!_||!fx(ee,`.${_}`,A))&&(!k||fx(ee,k,A))});x.call(U)}function N(){x?.on(".drag",null)}return{update:C,destroy:N}}function OC(e,n,i){const l=[],o={x:e.x-i,y:e.y-i,width:i*2,height:i*2};for(const s of n.values())po(o,Ul(s))>0&&l.push(s);return l}const RC=250;function LC(e,n,i,l){let o=[],s=1/0;const c=OC(e,i,n+RC);for(const f of c){const h=[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]];for(const d of h){if(l.nodeId===d.nodeId&&l.type===d.type&&l.id===d.id)continue;const{x:g,y:m}=Br(f,d,d.position,!0),x=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(m-e.y,2));x>n||(x<s?(o=[{...d,x:g,y:m}],s=x):x===s&&o.push({...d,x:g,y:m}))}}if(!o.length)return null;if(o.length>1){const f=l.type==="source"?"target":"source";return o.find(h=>h.type===f)??o[0]}return o[0]}function Yb(e,n,i,l,o,s=!1){const c=l.get(e);if(!c)return null;const f=o==="strict"?c.internals.handleBounds?.[n]:[...c.internals.handleBounds?.source??[],...c.internals.handleBounds?.target??[]],h=(i?f?.find(d=>d.id===i):f?.[0])??null;return h&&s?{...h,...Br(c,h,h.position,!0)}:h}function $b(e,n){return e||(n?.classList.contains("target")?"target":n?.classList.contains("source")?"source":null)}function BC(e,n){let i=null;return n?i=!0:e&&!n&&(i=!1),i}const Xb=()=>!0;function HC(e,{connectionMode:n,connectionRadius:i,handleId:l,nodeId:o,edgeUpdaterType:s,isTarget:c,domNode:f,nodeLookup:h,lib:d,autoPanOnConnect:g,flowId:m,panBy:x,cancelConnection:v,onConnectStart:S,onConnect:E,onConnectEnd:C,isValidConnection:N=Xb,onReconnectEnd:_,updateConnection:k,getTransform:A,getFromHandle:B,autoPanSpeed:T,dragThreshold:L=1,handleDomNode:P}){const Z=jb(e.target);let H=0,U;const{x:Y,y:ee}=On(e),R=$b(s,P),I=f?.getBoundingClientRect();let D=!1;if(!I||!R)return;const q=Yb(o,R,l,h,n);if(!q)return;let X=On(e,I),K=!1,j=null,O=!1,$=null;function z(){if(!g||!I)return;const[Ne,be]=Tb(X,I,T);x({x:Ne,y:be}),H=requestAnimationFrame(z)}const ne={...q,nodeId:o,type:R,position:q.position},ue=h.get(o);let de={inProgress:!0,isValid:null,from:Br(ue,ne,ye.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:ue,to:X,toHandle:null,toPosition:Wy[ne.position],toNode:null,pointer:X};function se(){D=!0,k(de),S?.(e,{nodeId:o,handleId:l,handleType:R})}L===0&&se();function pe(Ne){if(!D){const{x:ct,y:en}=On(Ne),jt=ct-Y,Vt=en-ee;if(!(jt*jt+Vt*Vt>L*L))return;se()}if(!B()||!ne){ke(Ne);return}const be=A();X=On(Ne,I),U=LC(Ao(X,be,!1,[1,1]),i,h,ne),K||(z(),K=!0);const Ee=Fb(Ne,{handle:U,connectionMode:n,fromNodeId:o,fromHandleId:l,fromType:c?"target":"source",isValidConnection:N,doc:Z,lib:d,flowId:m,nodeLookup:h});$=Ee.handleDomNode,j=Ee.connection,O=BC(!!U,Ee.isValid);const je=h.get(o),Fe=je?Br(je,ne,ye.Left,!0):de.from,Ye={...de,from:Fe,isValid:O,to:Ee.toHandle&&O?Uu({x:Ee.toHandle.x,y:Ee.toHandle.y},be):X,toHandle:Ee.toHandle,toPosition:O&&Ee.toHandle?Ee.toHandle.position:Wy[ne.position],toNode:Ee.toHandle?h.get(Ee.toHandle.nodeId):null,pointer:X};k(Ye),de=Ye}function ke(Ne){if(!("touches"in Ne&&Ne.touches.length>0)){if(D){(U||$)&&j&&O&&E?.(j);const{inProgress:be,...Ee}=de,je={...Ee,toPosition:de.toHandle?de.toPosition:null};C?.(Ne,je),s&&_?.(Ne,je)}v(),cancelAnimationFrame(H),K=!1,O=!1,j=null,$=null,Z.removeEventListener("mousemove",pe),Z.removeEventListener("mouseup",ke),Z.removeEventListener("touchmove",pe),Z.removeEventListener("touchend",ke)}}Z.addEventListener("mousemove",pe),Z.addEventListener("mouseup",ke),Z.addEventListener("touchmove",pe),Z.addEventListener("touchend",ke)}function Fb(e,{handle:n,connectionMode:i,fromNodeId:l,fromHandleId:o,fromType:s,doc:c,lib:f,flowId:h,isValidConnection:d=Xb,nodeLookup:g}){const m=s==="target",x=n?c.querySelector(`.${f}-flow__handle[data-id="${h}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x:v,y:S}=On(e),E=c.elementFromPoint(v,S),C=E?.classList.contains(`${f}-flow__handle`)?E:x,N={handleDomNode:C,isValid:!1,connection:null,toHandle:null};if(C){const _=$b(void 0,C),k=C.getAttribute("data-nodeid"),A=C.getAttribute("data-handleid"),B=C.classList.contains("connectable"),T=C.classList.contains("connectableend");if(!k||!_)return N;const L={source:m?k:l,sourceHandle:m?A:o,target:m?l:k,targetHandle:m?o:A};N.connection=L;const Z=B&&T&&(i===Bl.Strict?m&&_==="source"||!m&&_==="target":k!==l||A!==o);N.isValid=Z&&d(L),N.toHandle=Yb(k,_,A,g,i,!0)}return N}const Mh={onPointerDown:HC,isValid:Fb};function UC({domNode:e,panZoom:n,getTransform:i,getViewScale:l}){const o=fn(e);function s({translateExtent:f,width:h,height:d,zoomStep:g=1,pannable:m=!0,zoomable:x=!0,inversePan:v=!1}){const S=k=>{if(k.sourceEvent.type!=="wheel"||!n)return;const A=i(),B=k.sourceEvent.ctrlKey&&mo()?10:1,T=-k.sourceEvent.deltaY*(k.sourceEvent.deltaMode===1?.05:k.sourceEvent.deltaMode?1:.002)*g,L=A[2]*Math.pow(2,T*B);n.scaleTo(L)};let E=[0,0];const C=k=>{(k.sourceEvent.type==="mousedown"||k.sourceEvent.type==="touchstart")&&(E=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY])},N=k=>{const A=i();if(k.sourceEvent.type!=="mousemove"&&k.sourceEvent.type!=="touchmove"||!n)return;const B=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY],T=[B[0]-E[0],B[1]-E[1]];E=B;const L=l()*Math.max(A[2],Math.log(A[2]))*(v?-1:1),P={x:A[0]-T[0]*L,y:A[1]-T[1]*L},Z=[[0,0],[h,d]];n.setViewportConstrained({x:P.x,y:P.y,zoom:A[2]},Z,f)},_=vb().on("start",C).on("zoom",m?N:null).on("zoom.wheel",x?S:null);o.call(_,{})}function c(){o.on("zoom",null)}return{update:s,destroy:c,pointer:Mn}}const ec=e=>({x:e.x,y:e.y,zoom:e.k}),Yd=({x:e,y:n,zoom:i})=>Ku.translate(e,n).scale(i),Ml=(e,n)=>e.target.closest(`.${n}`),Gb=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),IC=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,$d=(e,n=0,i=IC,l=()=>{})=>{const o=typeof n=="number"&&n>0;return o||l(),o?e.transition().duration(n).ease(i).on("end",l):e},Pb=e=>{const n=e.ctrlKey&&mo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function qC({zoomPanValues:e,noWheelClassName:n,d3Selection:i,d3Zoom:l,panOnScrollMode:o,panOnScrollSpeed:s,zoomOnPinch:c,onPanZoomStart:f,onPanZoom:h,onPanZoomEnd:d}){return g=>{if(Ml(g,n))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const m=i.property("__zoom").k||1;if(g.ctrlKey&&c){const C=Mn(g),N=Pb(g),_=m*Math.pow(2,N);l.scaleTo(i,_,C,g);return}const x=g.deltaMode===1?20:1;let v=o===Dr.Vertical?0:g.deltaX*x,S=o===Dr.Horizontal?0:g.deltaY*x;!mo()&&g.shiftKey&&o!==Dr.Vertical&&(v=g.deltaY*x,S=0),l.translateBy(i,-(v/m)*s,-(S/m)*s,{internal:!0});const E=ec(i.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h?.(g,E),e.panScrollTimeout=setTimeout(()=>{d?.(g,E),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,f?.(g,E))}}function VC({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:i}){return function(l,o){const s=l.type==="wheel",c=!n&&s&&!l.ctrlKey,f=Ml(l,e);if(l.ctrlKey&&s&&f&&l.preventDefault(),c||f)return null;l.preventDefault(),i.call(this,l,o)}}function YC({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:i}){return l=>{if(l.sourceEvent?.internal)return;const o=ec(l.transform);e.mouseButton=l.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,l.sourceEvent?.type==="mousedown"&&n(!0),i&&i?.(l.sourceEvent,o)}}function $C({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:i,onTransformChange:l,onPanZoom:o}){return s=>{e.usedRightMouseButton=!!(i&&Gb(n,e.mouseButton??0)),s.sourceEvent?.sync||l([s.transform.x,s.transform.y,s.transform.k]),o&&!s.sourceEvent?.internal&&o?.(s.sourceEvent,ec(s.transform))}}function XC({zoomPanValues:e,panOnDrag:n,panOnScroll:i,onDraggingChange:l,onPanZoomEnd:o,onPaneContextMenu:s}){return c=>{if(!c.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,s&&Gb(n,e.mouseButton??0)&&!e.usedRightMouseButton&&c.sourceEvent&&s(c.sourceEvent),e.usedRightMouseButton=!1,l(!1),o)){const f=ec(c.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(c.sourceEvent,f)},i?150:0)}}}function FC({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:i,panOnDrag:l,panOnScroll:o,zoomOnDoubleClick:s,userSelectionActive:c,noWheelClassName:f,noPanClassName:h,lib:d,connectionInProgress:g}){return m=>{const x=e||n,v=i&&m.ctrlKey,S=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(Ml(m,`${d}-flow__node`)||Ml(m,`${d}-flow__edge`)))return!0;if(!l&&!x&&!o&&!s&&!i||c||g&&!S||Ml(m,f)&&S||Ml(m,h)&&(!S||o&&S&&!e)||!i&&m.ctrlKey&&S)return!1;if(!i&&m.type==="touchstart"&&m.touches?.length>1)return m.preventDefault(),!1;if(!x&&!o&&!v&&S||!l&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(l)&&!l.includes(m.button)&&m.type==="mousedown")return!1;const E=Array.isArray(l)&&l.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||S)&&E}}function GC({domNode:e,minZoom:n,maxZoom:i,translateExtent:l,viewport:o,onPanZoom:s,onPanZoomStart:c,onPanZoomEnd:f,onDraggingChange:h}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),m=vb().scaleExtent([n,i]).translateExtent(l),x=fn(e).call(m);_({x:o.x,y:o.y,zoom:Hl(o.zoom,n,i)},[[0,0],[g.width,g.height]],l);const v=x.on("wheel.zoom"),S=x.on("dblclick.zoom");m.wheelDelta(Pb);function E(U,Y){return x?new Promise(ee=>{m?.interpolate(Y?.interpolate==="linear"?no:vu).transform($d(x,Y?.duration,Y?.ease,()=>ee(!0)),U)}):Promise.resolve(!1)}function C({noWheelClassName:U,noPanClassName:Y,onPaneContextMenu:ee,userSelectionActive:R,panOnScroll:I,panOnDrag:D,panOnScrollMode:q,panOnScrollSpeed:X,preventScrolling:K,zoomOnPinch:j,zoomOnScroll:O,zoomOnDoubleClick:$,zoomActivationKeyPressed:z,lib:ne,onTransformChange:ue,connectionInProgress:ce,paneClickDistance:de,selectionOnDrag:se}){R&&!d.isZoomingOrPanning&&N();const pe=I&&!z&&!R;m.clickDistance(se?1/0:!Dn(de)||de<0?0:de);const ke=pe?qC({zoomPanValues:d,noWheelClassName:U,d3Selection:x,d3Zoom:m,panOnScrollMode:q,panOnScrollSpeed:X,zoomOnPinch:j,onPanZoomStart:c,onPanZoom:s,onPanZoomEnd:f}):VC({noWheelClassName:U,preventScrolling:K,d3ZoomHandler:v});if(x.on("wheel.zoom",ke,{passive:!1}),!R){const be=YC({zoomPanValues:d,onDraggingChange:h,onPanZoomStart:c});m.on("start",be);const Ee=$C({zoomPanValues:d,panOnDrag:D,onPaneContextMenu:!!ee,onPanZoom:s,onTransformChange:ue});m.on("zoom",Ee);const je=XC({zoomPanValues:d,panOnDrag:D,panOnScroll:I,onPaneContextMenu:ee,onPanZoomEnd:f,onDraggingChange:h});m.on("end",je)}const Ne=FC({zoomActivationKeyPressed:z,panOnDrag:D,zoomOnScroll:O,panOnScroll:I,zoomOnDoubleClick:$,zoomOnPinch:j,userSelectionActive:R,noPanClassName:Y,noWheelClassName:U,lib:ne,connectionInProgress:ce});m.filter(Ne),$?x.on("dblclick.zoom",S):x.on("dblclick.zoom",null)}function N(){m.on("zoom",null)}async function _(U,Y,ee){const R=Yd(U),I=m?.constrain()(R,Y,ee);return I&&await E(I),new Promise(D=>D(I))}async function k(U,Y){const ee=Yd(U);return await E(ee,Y),new Promise(R=>R(ee))}function A(U){if(x){const Y=Yd(U),ee=x.property("__zoom");(ee.k!==U.zoom||ee.x!==U.x||ee.y!==U.y)&&m?.transform(x,Y,null,{sync:!0})}}function B(){const U=x?bb(x.node()):{x:0,y:0,k:1};return{x:U.x,y:U.y,zoom:U.k}}function T(U,Y){return x?new Promise(ee=>{m?.interpolate(Y?.interpolate==="linear"?no:vu).scaleTo($d(x,Y?.duration,Y?.ease,()=>ee(!0)),U)}):Promise.resolve(!1)}function L(U,Y){return x?new Promise(ee=>{m?.interpolate(Y?.interpolate==="linear"?no:vu).scaleBy($d(x,Y?.duration,Y?.ease,()=>ee(!0)),U)}):Promise.resolve(!1)}function P(U){m?.scaleExtent(U)}function Z(U){m?.translateExtent(U)}function H(U){const Y=!Dn(U)||U<0?0:U;m?.clickDistance(Y)}return{update:C,destroy:N,setViewport:k,setViewportConstrained:_,getViewport:B,scaleTo:T,scaleBy:L,setScaleExtent:P,setTranslateExtent:Z,syncViewport:A,setClickDistance:H}}var ql;(function(e){e.Line="line",e.Handle="handle"})(ql||(ql={}));function PC({width:e,prevWidth:n,height:i,prevHeight:l,affectsX:o,affectsY:s}){const c=e-n,f=i-l,h=[c>0?1:c<0?-1:0,f>0?1:f<0?-1:0];return c&&o&&(h[0]=h[0]*-1),f&&s&&(h[1]=h[1]*-1),h}function dx(e){const n=e.includes("right")||e.includes("left"),i=e.includes("bottom")||e.includes("top"),l=e.includes("left"),o=e.includes("top");return{isHorizontal:n,isVertical:i,affectsX:l,affectsY:o}}function nr(e,n){return Math.max(0,n-e)}function ir(e,n){return Math.max(0,e-n)}function cu(e,n,i){return Math.max(0,n-e,e-i)}function hx(e,n){return e?!n:n}function ZC(e,n,i,l,o,s,c,f){let{affectsX:h,affectsY:d}=n;const{isHorizontal:g,isVertical:m}=n,x=g&&m,{xSnapped:v,ySnapped:S}=i,{minWidth:E,maxWidth:C,minHeight:N,maxHeight:_}=l,{x:k,y:A,width:B,height:T,aspectRatio:L}=e;let P=Math.floor(g?v-e.pointerX:0),Z=Math.floor(m?S-e.pointerY:0);const H=B+(h?-P:P),U=T+(d?-Z:Z),Y=-s[0]*B,ee=-s[1]*T;let R=cu(H,E,C),I=cu(U,N,_);if(c){let X=0,K=0;h&&P<0?X=nr(k+P+Y,c[0][0]):!h&&P>0&&(X=ir(k+H+Y,c[1][0])),d&&Z<0?K=nr(A+Z+ee,c[0][1]):!d&&Z>0&&(K=ir(A+U+ee,c[1][1])),R=Math.max(R,X),I=Math.max(I,K)}if(f){let X=0,K=0;h&&P>0?X=ir(k+P,f[0][0]):!h&&P<0&&(X=nr(k+H,f[1][0])),d&&Z>0?K=ir(A+Z,f[0][1]):!d&&Z<0&&(K=nr(A+U,f[1][1])),R=Math.max(R,X),I=Math.max(I,K)}if(o){if(g){const X=cu(H/L,N,_)*L;if(R=Math.max(R,X),c){let K=0;!h&&!d||h&&!d&&x?K=ir(A+ee+H/L,c[1][1])*L:K=nr(A+ee+(h?P:-P)/L,c[0][1])*L,R=Math.max(R,K)}if(f){let K=0;!h&&!d||h&&!d&&x?K=nr(A+H/L,f[1][1])*L:K=ir(A+(h?P:-P)/L,f[0][1])*L,R=Math.max(R,K)}}if(m){const X=cu(U*L,E,C)/L;if(I=Math.max(I,X),c){let K=0;!h&&!d||d&&!h&&x?K=ir(k+U*L+Y,c[1][0])/L:K=nr(k+(d?Z:-Z)*L+Y,c[0][0])/L,I=Math.max(I,K)}if(f){let K=0;!h&&!d||d&&!h&&x?K=nr(k+U*L,f[1][0])/L:K=ir(k+(d?Z:-Z)*L,f[0][0])/L,I=Math.max(I,K)}}}Z=Z+(Z<0?I:-I),P=P+(P<0?R:-R),o&&(x?H>U*L?Z=(hx(h,d)?-P:P)/L:P=(hx(h,d)?-Z:Z)*L:g?(Z=P/L,d=h):(P=Z*L,h=d));const D=h?k+P:k,q=d?A+Z:A;return{width:B+(h?-P:P),height:T+(d?-Z:Z),x:s[0]*P*(h?-1:1)+D,y:s[1]*Z*(d?-1:1)+q}}const Zb={width:0,height:0,x:0,y:0},QC={...Zb,pointerX:0,pointerY:0,aspectRatio:1};function KC(e){return[[0,0],[e.measured.width,e.measured.height]]}function JC(e,n,i){const l=n.position.x+e.position.x,o=n.position.y+e.position.y,s=e.measured.width??0,c=e.measured.height??0,f=i[0]*s,h=i[1]*c;return[[l-f,o-h],[l+s-f,o+c-h]]}function WC({domNode:e,nodeId:n,getStoreItems:i,onChange:l,onEnd:o}){const s=fn(e);let c={controlDirection:dx("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function f({controlPosition:d,boundaries:g,keepAspectRatio:m,resizeDirection:x,onResizeStart:v,onResize:S,onResizeEnd:E,shouldResize:C}){let N={...Zb},_={...QC};c={boundaries:g,resizeDirection:x,keepAspectRatio:m,controlDirection:dx(d)};let k,A=null,B=[],T,L,P,Z=!1;const H=lb().on("start",U=>{const{nodeLookup:Y,transform:ee,snapGrid:R,snapToGrid:I,nodeOrigin:D,paneDomNode:q}=i();if(k=Y.get(n),!k)return;A=q?.getBoundingClientRect()??null;const{xSnapped:X,ySnapped:K}=io(U.sourceEvent,{transform:ee,snapGrid:R,snapToGrid:I,containerBounds:A});N={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},_={...N,pointerX:X,pointerY:K,aspectRatio:N.width/N.height},T=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(T=Y.get(k.parentId),L=T&&k.extent==="parent"?KC(T):void 0),B=[],P=void 0;for(const[j,O]of Y)if(O.parentId===n&&(B.push({id:j,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const $=JC(O,k,O.origin??D);P?P=[[Math.min($[0][0],P[0][0]),Math.min($[0][1],P[0][1])],[Math.max($[1][0],P[1][0]),Math.max($[1][1],P[1][1])]]:P=$}v?.(U,{...N})}).on("drag",U=>{const{transform:Y,snapGrid:ee,snapToGrid:R,nodeOrigin:I}=i(),D=io(U.sourceEvent,{transform:Y,snapGrid:ee,snapToGrid:R,containerBounds:A}),q=[];if(!k)return;const{x:X,y:K,width:j,height:O}=N,$={},z=k.origin??I,{width:ne,height:ue,x:ce,y:de}=ZC(_,c.controlDirection,D,c.boundaries,c.keepAspectRatio,z,L,P),se=ne!==j,pe=ue!==O,ke=ce!==X&&se,Ne=de!==K&&pe;if(!ke&&!Ne&&!se&&!pe)return;if((ke||Ne||z[0]===1||z[1]===1)&&($.x=ke?ce:N.x,$.y=Ne?de:N.y,N.x=$.x,N.y=$.y,B.length>0)){const Fe=ce-X,Ye=de-K;for(const ct of B)ct.position={x:ct.position.x-Fe+z[0]*(ne-j),y:ct.position.y-Ye+z[1]*(ue-O)},q.push(ct)}if((se||pe)&&($.width=se&&(!c.resizeDirection||c.resizeDirection==="horizontal")?ne:N.width,$.height=pe&&(!c.resizeDirection||c.resizeDirection==="vertical")?ue:N.height,N.width=$.width,N.height=$.height),T&&k.expandParent){const Fe=z[0]*($.width??0);$.x&&$.x<Fe&&(N.x=Fe,_.x=_.x-($.x-Fe));const Ye=z[1]*($.height??0);$.y&&$.y<Ye&&(N.y=Ye,_.y=_.y-($.y-Ye))}const be=PC({width:N.width,prevWidth:j,height:N.height,prevHeight:O,affectsX:c.controlDirection.affectsX,affectsY:c.controlDirection.affectsY}),Ee={...N,direction:be};C?.(U,Ee)!==!1&&(Z=!0,S?.(U,Ee),l($,q))}).on("end",U=>{Z&&(E?.(U,{...N}),o?.({...N}),Z=!1)});s.call(H)}function h(){s.on(".drag",null)}return{update:f,destroy:h}}var Xd={exports:{}},Fd={},Gd={exports:{}},Pd={};var px;function e4(){if(px)return Pd;px=1;var e=ko();function n(m,x){return m===x&&(m!==0||1/m===1/x)||m!==m&&x!==x}var i=typeof Object.is=="function"?Object.is:n,l=e.useState,o=e.useEffect,s=e.useLayoutEffect,c=e.useDebugValue;function f(m,x){var v=x(),S=l({inst:{value:v,getSnapshot:x}}),E=S[0].inst,C=S[1];return s(function(){E.value=v,E.getSnapshot=x,h(E)&&C({inst:E})},[m,v,x]),o(function(){return h(E)&&C({inst:E}),m(function(){h(E)&&C({inst:E})})},[m]),c(v),v}function h(m){var x=m.getSnapshot;m=m.value;try{var v=x();return!i(m,v)}catch{return!0}}function d(m,x){return x()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:f;return Pd.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Pd}var mx;function t4(){return mx||(mx=1,Gd.exports=e4()),Gd.exports}var gx;function n4(){if(gx)return Fd;gx=1;var e=ko(),n=t4();function i(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}var l=typeof Object.is=="function"?Object.is:i,o=n.useSyncExternalStore,s=e.useRef,c=e.useEffect,f=e.useMemo,h=e.useDebugValue;return Fd.useSyncExternalStoreWithSelector=function(d,g,m,x,v){var S=s(null);if(S.current===null){var E={hasValue:!1,value:null};S.current=E}else E=S.current;S=f(function(){function N(T){if(!_){if(_=!0,k=T,T=x(T),v!==void 0&&E.hasValue){var L=E.value;if(v(L,T))return A=L}return A=T}if(L=A,l(k,T))return L;var P=x(T);return v!==void 0&&v(L,P)?(k=T,L):(k=T,A=P)}var _=!1,k,A,B=m===void 0?null:m;return[function(){return N(g())},B===null?void 0:function(){return N(B())}]},[g,m,x,v]);var C=o(d,S[0],S[1]);return c(function(){E.hasValue=!0,E.value=C},[C]),h(C),C},Fd}var yx;function i4(){return yx||(yx=1,Xd.exports=n4()),Xd.exports}var r4=i4();const l4=Fu(r4),a4={},xx=e=>{let n;const i=new Set,l=(g,m)=>{const x=typeof g=="function"?g(n):g;if(!Object.is(x,n)){const v=n;n=m??(typeof x!="object"||x===null)?x:Object.assign({},n,x),i.forEach(S=>S(n,v))}},o=()=>n,h={setState:l,getState:o,getInitialState:()=>d,subscribe:g=>(i.add(g),()=>i.delete(g)),destroy:()=>{(a4?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),i.clear()}},d=n=e(l,o,h);return h},o4=e=>e?xx(e):xx,{useDebugValue:s4}=Ja,{useSyncExternalStoreWithSelector:u4}=l4,c4=e=>e;function Qb(e,n=c4,i){const l=u4(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,i);return s4(l),l}const bx=(e,n)=>{const i=o4(e),l=(o,s=n)=>Qb(i,o,s);return Object.assign(l,i),l},f4=(e,n)=>e?bx(e,n):bx;function at(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[l,o]of e)if(!Object.is(o,n.get(l)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const l of e)if(!n.has(l))return!1;return!0}const i=Object.keys(e);if(i.length!==Object.keys(n).length)return!1;for(const l of i)if(!Object.prototype.hasOwnProperty.call(n,l)||!Object.is(e[l],n[l]))return!1;return!0}$1();const tc=G.createContext(null),d4=tc.Provider,Kb=Gn.error001();function Ve(e,n){const i=G.useContext(tc);if(i===null)throw new Error(Kb);return Qb(i,e,n)}function ot(){const e=G.useContext(tc);if(e===null)throw new Error(Kb);return G.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const vx={display:"none"},h4={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Jb="react-flow__node-desc",Wb="react-flow__edge-desc",p4="react-flow__aria-live",m4=e=>e.ariaLiveMessage,g4=e=>e.ariaLabelConfig;function y4({rfId:e}){const n=Ve(m4);return b.jsx("div",{id:`${p4}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:h4,children:n})}function x4({rfId:e,disableKeyboardA11y:n}){const i=Ve(g4);return b.jsxs(b.Fragment,{children:[b.jsx("div",{id:`${Jb}-${e}`,style:vx,children:n?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),b.jsx("div",{id:`${Wb}-${e}`,style:vx,children:i["edge.a11yDescription.default"]}),!n&&b.jsx(y4,{rfId:e})]})}const nc=G.forwardRef(({position:e="top-left",children:n,className:i,style:l,...o},s)=>{const c=`${e}`.split("-");return b.jsx("div",{className:wt(["react-flow__panel",i,...c]),style:l,ref:s,...o,children:n})});nc.displayName="Panel";function b4({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:b.jsx(nc,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:b.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const v4=e=>{const n=[],i=[];for(const[,l]of e.nodeLookup)l.selected&&n.push(l.internals.userNode);for(const[,l]of e.edgeLookup)l.selected&&i.push(l);return{selectedNodes:n,selectedEdges:i}},fu=e=>e.id;function w4(e,n){return at(e.selectedNodes.map(fu),n.selectedNodes.map(fu))&&at(e.selectedEdges.map(fu),n.selectedEdges.map(fu))}function S4({onSelectionChange:e}){const n=ot(),{selectedNodes:i,selectedEdges:l}=Ve(v4,w4);return G.useEffect(()=>{const o={nodes:i,edges:l};e?.(o),n.getState().onSelectionChangeHandlers.forEach(s=>s(o))},[i,l,e]),null}const k4=e=>!!e.onSelectionChangeHandlers;function E4({onSelectionChange:e}){const n=Ve(k4);return e||n?b.jsx(S4,{onSelectionChange:e}):null}const ev=[0,0],N4={x:0,y:0,zoom:1},_4=["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"],wx=[..._4,"rfId"],C4=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}),Sx={translateExtent:fo,nodeOrigin:ev,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function T4(e){const{setNodes:n,setEdges:i,setMinZoom:l,setMaxZoom:o,setTranslateExtent:s,setNodeExtent:c,reset:f,setDefaultNodesAndEdges:h}=Ve(C4,at),d=ot();G.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{g.current=Sx,f()}),[]);const g=G.useRef(Sx);return G.useEffect(()=>{for(const m of wx){const x=e[m],v=g.current[m];x!==v&&(typeof e[m]>"u"||(m==="nodes"?n(x):m==="edges"?i(x):m==="minZoom"?l(x):m==="maxZoom"?o(x):m==="translateExtent"?s(x):m==="nodeExtent"?c(x):m==="ariaLabelConfig"?d.setState({ariaLabelConfig:dC(x)}):m==="fitView"?d.setState({fitViewQueued:x}):m==="fitViewOptions"?d.setState({fitViewOptions:x}):d.setState({[m]:x})))}g.current=e},wx.map(m=>e[m])),null}function kx(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function A4(e){const[n,i]=G.useState(e==="system"?null:e);return G.useEffect(()=>{if(e!=="system"){i(e);return}const l=kx(),o=()=>i(l?.matches?"dark":"light");return o(),l?.addEventListener("change",o),()=>{l?.removeEventListener("change",o)}},[e]),n!==null?n:kx()?.matches?"dark":"light"}const Ex=typeof document<"u"?document:null;function go(e=null,n={target:Ex,actInsideInputWithModifier:!0}){const[i,l]=G.useState(!1),o=G.useRef(!1),s=G.useRef(new Set([])),[c,f]=G.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
|
|
10
|
+
`).replace(`
|
|
11
|
+
|
|
12
|
+
`,`
|
|
13
|
+
+`).split(`
|
|
14
|
+
`)),g=d.reduce((m,x)=>m.concat(...x),[]);return[d,g]}return[[],[]]},[e]);return G.useEffect(()=>{const h=n?.target??Ex,d=n?.actInsideInputWithModifier??!0;if(e!==null){const g=v=>{if(o.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!o.current||o.current&&!d)&&Db(v))return!1;const E=_x(v.code,f);if(s.current.add(v[E]),Nx(c,s.current,!1)){const C=v.composedPath?.()?.[0]||v.target,N=C?.nodeName==="BUTTON"||C?.nodeName==="A";n.preventDefault!==!1&&(o.current||!N)&&v.preventDefault(),l(!0)}},m=v=>{const S=_x(v.code,f);Nx(c,s.current,!0)?(l(!1),s.current.clear()):s.current.delete(v[S]),v.key==="Meta"&&s.current.clear(),o.current=!1},x=()=>{s.current.clear(),l(!1)};return h?.addEventListener("keydown",g),h?.addEventListener("keyup",m),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{h?.removeEventListener("keydown",g),h?.removeEventListener("keyup",m),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[e,l]),i}function Nx(e,n,i){return e.filter(l=>i||l.length===n.size).some(l=>l.every(o=>n.has(o)))}function _x(e,n){return n.includes(e)?"code":"key"}const M4=()=>{const e=ot();return G.useMemo(()=>({zoomIn:n=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomOut:n=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1/1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomTo:(n,i)=>{const{panZoom:l}=e.getState();return l?l.scaleTo(n,{duration:i?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(n,i)=>{const{transform:[l,o,s],panZoom:c}=e.getState();return c?(await c.setViewport({x:n.x??l,y:n.y??o,zoom:n.zoom??s},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[n,i,l]=e.getState().transform;return{x:n,y:i,zoom:l}},setCenter:async(n,i,l)=>e.getState().setCenter(n,i,l),fitBounds:async(n,i)=>{const{width:l,height:o,minZoom:s,maxZoom:c,panZoom:f}=e.getState(),h=sp(n,l,o,s,c,i?.padding??.1);return f?(await f.setViewport(h,{duration:i?.duration,ease:i?.ease,interpolate:i?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(n,i={})=>{const{transform:l,snapGrid:o,snapToGrid:s,domNode:c}=e.getState();if(!c)return n;const{x:f,y:h}=c.getBoundingClientRect(),d={x:n.x-f,y:n.y-h},g=i.snapGrid??o,m=i.snapToGrid??s;return Ao(d,l,m,g)},flowToScreenPosition:n=>{const{transform:i,domNode:l}=e.getState();if(!l)return n;const{x:o,y:s}=l.getBoundingClientRect(),c=Uu(n,i);return{x:c.x+o,y:c.y+s}}}),[])};function tv(e,n){const i=[],l=new Map,o=[];for(const s of e)if(s.type==="add"){o.push(s);continue}else if(s.type==="remove"||s.type==="replace")l.set(s.id,[s]);else{const c=l.get(s.id);c?c.push(s):l.set(s.id,[s])}for(const s of n){const c=l.get(s.id);if(!c){i.push(s);continue}if(c[0].type==="remove")continue;if(c[0].type==="replace"){i.push({...c[0].item});continue}const f={...s};for(const h of c)z4(h,f);i.push(f)}return o.length&&o.forEach(s=>{s.index!==void 0?i.splice(s.index,0,{...s.item}):i.push({...s.item})}),i}function z4(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function Eu(e,n){return tv(e,n)}function nv(e,n){return tv(e,n)}function Mr(e,n){return{id:e,type:"select",selected:n}}function zl(e,n=new Set,i=!1){const l=[];for(const[o,s]of e){const c=n.has(o);!(s.selected===void 0&&!c)&&s.selected!==c&&(i&&(s.selected=c),l.push(Mr(s.id,c)))}return l}function Cx({items:e=[],lookup:n}){const i=[],l=new Map(e.map(o=>[o.id,o]));for(const[o,s]of e.entries()){const c=n.get(s.id),f=c?.internals?.userNode??c;f!==void 0&&f!==s&&i.push({id:s.id,item:s,type:"replace"}),f===void 0&&i.push({item:s,type:"add",index:o})}for(const[o]of n)l.get(o)===void 0&&i.push({id:o,type:"remove"});return i}function Tx(e){return{id:e.id,type:"remove"}}const Ax=e=>nC(e),j4=e=>Nb(e);function iv(e){return G.forwardRef(e)}const D4=typeof window<"u"?G.useLayoutEffect:G.useEffect;function Mx(e){const[n,i]=G.useState(BigInt(0)),[l]=G.useState(()=>O4(()=>i(o=>o+BigInt(1))));return D4(()=>{const o=l.get();o.length&&(e(o),l.reset())},[n]),l}function O4(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:i=>{n.push(i),e()}}}const rv=G.createContext(null);function R4({children:e}){const n=ot(),i=G.useCallback(f=>{const{nodes:h=[],setNodes:d,hasDefaultNodes:g,onNodesChange:m,nodeLookup:x,fitViewQueued:v,onNodesChangeMiddlewareMap:S}=n.getState();let E=h;for(const N of f)E=typeof N=="function"?N(E):N;let C=Cx({items:E,lookup:x});for(const N of S.values())C=N(C);g&&d(E),C.length>0?m?.(C):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:N,nodes:_,setNodes:k}=n.getState();N&&k(_)})},[]),l=Mx(i),o=G.useCallback(f=>{const{edges:h=[],setEdges:d,hasDefaultEdges:g,onEdgesChange:m,edgeLookup:x}=n.getState();let v=h;for(const S of f)v=typeof S=="function"?S(v):S;g?d(v):m&&m(Cx({items:v,lookup:x}))},[]),s=Mx(o),c=G.useMemo(()=>({nodeQueue:l,edgeQueue:s}),[]);return b.jsx(rv.Provider,{value:c,children:e})}function L4(){const e=G.useContext(rv);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const B4=e=>!!e.panZoom;function mp(){const e=M4(),n=ot(),i=L4(),l=Ve(B4),o=G.useMemo(()=>{const s=m=>n.getState().nodeLookup.get(m),c=m=>{i.nodeQueue.push(m)},f=m=>{i.edgeQueue.push(m)},h=m=>{const{nodeLookup:x,nodeOrigin:v}=n.getState(),S=Ax(m)?m:x.get(m.id),E=S.parentId?zb(S.position,S.measured,S.parentId,x,v):S.position,C={...S,position:E,width:S.measured?.width??S.width,height:S.measured?.height??S.height};return Ul(C)},d=(m,x,v={replace:!1})=>{c(S=>S.map(E=>{if(E.id===m){const C=typeof x=="function"?x(E):x;return v.replace&&Ax(C)?C:{...E,...C}}return E}))},g=(m,x,v={replace:!1})=>{f(S=>S.map(E=>{if(E.id===m){const C=typeof x=="function"?x(E):x;return v.replace&&j4(C)?C:{...E,...C}}return E}))};return{getNodes:()=>n.getState().nodes.map(m=>({...m})),getNode:m=>s(m)?.internals.userNode,getInternalNode:s,getEdges:()=>{const{edges:m=[]}=n.getState();return m.map(x=>({...x}))},getEdge:m=>n.getState().edgeLookup.get(m),setNodes:c,setEdges:f,addNodes:m=>{const x=Array.isArray(m)?m:[m];i.nodeQueue.push(v=>[...v,...x])},addEdges:m=>{const x=Array.isArray(m)?m:[m];i.edgeQueue.push(v=>[...v,...x])},toObject:()=>{const{nodes:m=[],edges:x=[],transform:v}=n.getState(),[S,E,C]=v;return{nodes:m.map(N=>({...N})),edges:x.map(N=>({...N})),viewport:{x:S,y:E,zoom:C}}},deleteElements:async({nodes:m=[],edges:x=[]})=>{const{nodes:v,edges:S,onNodesDelete:E,onEdgesDelete:C,triggerNodeChanges:N,triggerEdgeChanges:_,onDelete:k,onBeforeDelete:A}=n.getState(),{nodes:B,edges:T}=await oC({nodesToRemove:m,edgesToRemove:x,nodes:v,edges:S,onBeforeDelete:A}),L=T.length>0,P=B.length>0;if(L){const Z=T.map(Tx);C?.(T),_(Z)}if(P){const Z=B.map(Tx);E?.(B),N(Z)}return(P||L)&&k?.({nodes:B,edges:T}),{deletedNodes:B,deletedEdges:T}},getIntersectingNodes:(m,x=!0,v)=>{const S=tx(m),E=S?m:h(m),C=v!==void 0;return E?(v||n.getState().nodes).filter(N=>{const _=n.getState().nodeLookup.get(N.id);if(_&&!S&&(N.id===m.id||!_.internals.positionAbsolute))return!1;const k=Ul(C?N:_),A=po(k,E);return x&&A>0||A>=k.width*k.height||A>=E.width*E.height}):[]},isNodeIntersecting:(m,x,v=!0)=>{const E=tx(m)?m:h(m);if(!E)return!1;const C=po(E,x);return v&&C>0||C>=x.width*x.height||C>=E.width*E.height},updateNode:d,updateNodeData:(m,x,v={replace:!1})=>{d(m,S=>{const E=typeof x=="function"?x(S):x;return v.replace?{...S,data:E}:{...S,data:{...S.data,...E}}},v)},updateEdge:g,updateEdgeData:(m,x,v={replace:!1})=>{g(m,S=>{const E=typeof x=="function"?x(S):x;return v.replace?{...S,data:E}:{...S,data:{...S.data,...E}}},v)},getNodesBounds:m=>{const{nodeLookup:x,nodeOrigin:v}=n.getState();return iC(m,{nodeLookup:x,nodeOrigin:v})},getHandleConnections:({type:m,id:x,nodeId:v})=>Array.from(n.getState().connectionLookup.get(`${v}-${m}${x?`-${x}`:""}`)?.values()??[]),getNodeConnections:({type:m,handleId:x,nodeId:v})=>Array.from(n.getState().connectionLookup.get(`${v}${m?x?`-${m}-${x}`:`-${m}`:""}`)?.values()??[]),fitView:async m=>{const x=n.getState().fitViewResolver??fC();return n.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:x}),i.nodeQueue.push(v=>[...v]),x.promise}}},[]);return G.useMemo(()=>({...o,...e,viewportInitialized:l}),[l])}const zx=e=>e.selected,H4=typeof window<"u"?window:void 0;function U4({deleteKeyCode:e,multiSelectionKeyCode:n}){const i=ot(),{deleteElements:l}=mp(),o=go(e,{actInsideInputWithModifier:!1}),s=go(n,{target:H4});G.useEffect(()=>{if(o){const{edges:c,nodes:f}=i.getState();l({nodes:f.filter(zx),edges:c.filter(zx)}),i.setState({nodesSelectionActive:!1})}},[o]),G.useEffect(()=>{i.setState({multiSelectionActive:s})},[s])}function I4(e){const n=ot();G.useEffect(()=>{const i=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const l=up(e.current);(l.height===0||l.width===0)&&n.getState().onError?.("004",Gn.error004()),n.setState({width:l.width||500,height:l.height||500})};if(e.current){i(),window.addEventListener("resize",i);const l=new ResizeObserver(()=>i());return l.observe(e.current),()=>{window.removeEventListener("resize",i),l&&e.current&&l.unobserve(e.current)}}},[])}const ic={position:"absolute",width:"100%",height:"100%",top:0,left:0},q4=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function V4({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:i=!0,panOnScroll:l=!1,panOnScrollSpeed:o=.5,panOnScrollMode:s=Dr.Free,zoomOnDoubleClick:c=!0,panOnDrag:f=!0,defaultViewport:h,translateExtent:d,minZoom:g,maxZoom:m,zoomActivationKeyCode:x,preventScrolling:v=!0,children:S,noWheelClassName:E,noPanClassName:C,onViewportChange:N,isControlledViewport:_,paneClickDistance:k,selectionOnDrag:A}){const B=ot(),T=G.useRef(null),{userSelectionActive:L,lib:P,connectionInProgress:Z}=Ve(q4,at),H=go(x),U=G.useRef();I4(T);const Y=G.useCallback(ee=>{N?.({x:ee[0],y:ee[1],zoom:ee[2]}),_||B.setState({transform:ee})},[N,_]);return G.useEffect(()=>{if(T.current){U.current=GC({domNode:T.current,minZoom:g,maxZoom:m,translateExtent:d,viewport:h,onDraggingChange:D=>B.setState({paneDragging:D}),onPanZoomStart:(D,q)=>{const{onViewportChangeStart:X,onMoveStart:K}=B.getState();K?.(D,q),X?.(q)},onPanZoom:(D,q)=>{const{onViewportChange:X,onMove:K}=B.getState();K?.(D,q),X?.(q)},onPanZoomEnd:(D,q)=>{const{onViewportChangeEnd:X,onMoveEnd:K}=B.getState();K?.(D,q),X?.(q)}});const{x:ee,y:R,zoom:I}=U.current.getViewport();return B.setState({panZoom:U.current,transform:[ee,R,I],domNode:T.current.closest(".react-flow")}),()=>{U.current?.destroy()}}},[]),G.useEffect(()=>{U.current?.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:i,panOnScroll:l,panOnScrollSpeed:o,panOnScrollMode:s,zoomOnDoubleClick:c,panOnDrag:f,zoomActivationKeyPressed:H,preventScrolling:v,noPanClassName:C,userSelectionActive:L,noWheelClassName:E,lib:P,onTransformChange:Y,connectionInProgress:Z,selectionOnDrag:A,paneClickDistance:k})},[e,n,i,l,o,s,c,f,H,v,C,L,E,P,Y,Z,A,k]),b.jsx("div",{className:"react-flow__renderer",ref:T,style:ic,children:S})}const Y4=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function $4(){const{userSelectionActive:e,userSelectionRect:n}=Ve(Y4,at);return e&&n?b.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Zd=(e,n)=>i=>{i.target===n.current&&e?.(i)},X4=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function F4({isSelecting:e,selectionKeyPressed:n,selectionMode:i=ho.Full,panOnDrag:l,paneClickDistance:o,selectionOnDrag:s,onSelectionStart:c,onSelectionEnd:f,onPaneClick:h,onPaneContextMenu:d,onPaneScroll:g,onPaneMouseEnter:m,onPaneMouseMove:x,onPaneMouseLeave:v,children:S}){const E=ot(),{userSelectionActive:C,elementsSelectable:N,dragging:_,connectionInProgress:k}=Ve(X4,at),A=N&&(e||C),B=G.useRef(null),T=G.useRef(),L=G.useRef(new Set),P=G.useRef(new Set),Z=G.useRef(!1),H=X=>{if(Z.current||k){Z.current=!1;return}h?.(X),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},U=X=>{if(Array.isArray(l)&&l?.includes(2)){X.preventDefault();return}d?.(X)},Y=g?X=>g(X):void 0,ee=X=>{Z.current&&(X.stopPropagation(),Z.current=!1)},R=X=>{const{domNode:K}=E.getState();if(T.current=K?.getBoundingClientRect(),!T.current)return;const j=X.target===B.current;if(!j&&!!X.target.closest(".nokey")||!e||!(s&&j||n)||X.button!==0||!X.isPrimary)return;X.target?.setPointerCapture?.(X.pointerId),Z.current=!1;const{x:z,y:ne}=On(X.nativeEvent,T.current);E.setState({userSelectionRect:{width:0,height:0,startX:z,startY:ne,x:z,y:ne}}),j||(X.stopPropagation(),X.preventDefault())},I=X=>{const{userSelectionRect:K,transform:j,nodeLookup:O,edgeLookup:$,connectionLookup:z,triggerNodeChanges:ne,triggerEdgeChanges:ue,defaultEdgeOptions:ce,resetSelectedElements:de}=E.getState();if(!T.current||!K)return;const{x:se,y:pe}=On(X.nativeEvent,T.current),{startX:ke,startY:Ne}=K;if(!Z.current){const Ye=n?0:o;if(Math.hypot(se-ke,pe-Ne)<=Ye)return;de(),c?.(X)}Z.current=!0;const be={startX:ke,startY:Ne,x:se<ke?se:ke,y:pe<Ne?pe:Ne,width:Math.abs(se-ke),height:Math.abs(pe-Ne)},Ee=L.current,je=P.current;L.current=new Set(op(O,be,j,i===ho.Partial,!0).map(Ye=>Ye.id)),P.current=new Set;const Fe=ce?.selectable??!0;for(const Ye of L.current){const ct=z.get(Ye);if(ct)for(const{edgeId:en}of ct.values()){const jt=$.get(en);jt&&(jt.selectable??Fe)&&P.current.add(en)}}if(!nx(Ee,L.current)){const Ye=zl(O,L.current,!0);ne(Ye)}if(!nx(je,P.current)){const Ye=zl($,P.current);ue(Ye)}E.setState({userSelectionRect:be,userSelectionActive:!0,nodesSelectionActive:!1})},D=X=>{X.button===0&&(X.target?.releasePointerCapture?.(X.pointerId),!C&&X.target===B.current&&E.getState().userSelectionRect&&H?.(X),E.setState({userSelectionActive:!1,userSelectionRect:null}),Z.current&&(f?.(X),E.setState({nodesSelectionActive:L.current.size>0})))},q=l===!0||Array.isArray(l)&&l.includes(0);return b.jsxs("div",{className:wt(["react-flow__pane",{draggable:q,dragging:_,selection:e}]),onClick:A?void 0:Zd(H,B),onContextMenu:Zd(U,B),onWheel:Zd(Y,B),onPointerEnter:A?void 0:m,onPointerMove:A?I:x,onPointerUp:A?D:void 0,onPointerDownCapture:A?R:void 0,onClickCapture:A?ee:void 0,onPointerLeave:v,ref:B,style:ic,children:[S,b.jsx($4,{})]})}function zh({id:e,store:n,unselect:i=!1,nodeRef:l}){const{addSelectedNodes:o,unselectNodesAndEdges:s,multiSelectionActive:c,nodeLookup:f,onError:h}=n.getState(),d=f.get(e);if(!d){h?.("012",Gn.error012(e));return}n.setState({nodesSelectionActive:!1}),d.selected?(i||d.selected&&c)&&(s({nodes:[d],edges:[]}),requestAnimationFrame(()=>l?.current?.blur())):o([e])}function lv({nodeRef:e,disabled:n=!1,noDragClassName:i,handleSelector:l,nodeId:o,isSelectable:s,nodeClickDistance:c}){const f=ot(),[h,d]=G.useState(!1),g=G.useRef();return G.useEffect(()=>{g.current=DC({getStoreItems:()=>f.getState(),onNodeMouseDown:m=>{zh({id:m,store:f,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),G.useEffect(()=>{if(n)g.current?.destroy();else if(e.current)return g.current?.update({noDragClassName:i,handleSelector:l,domNode:e.current,isSelectable:s,nodeId:o,nodeClickDistance:c}),()=>{g.current?.destroy()}},[i,l,n,s,e,o]),h}const G4=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function av(){const e=ot();return G.useCallback(i=>{const{nodeExtent:l,snapToGrid:o,snapGrid:s,nodesDraggable:c,onError:f,updateNodePositions:h,nodeLookup:d,nodeOrigin:g}=e.getState(),m=new Map,x=G4(c),v=o?s[0]:5,S=o?s[1]:5,E=i.direction.x*v*i.factor,C=i.direction.y*S*i.factor;for(const[,N]of d){if(!x(N))continue;let _={x:N.internals.positionAbsolute.x+E,y:N.internals.positionAbsolute.y+C};o&&(_=To(_,s));const{position:k,positionAbsolute:A}=_b({nodeId:N.id,nextPosition:_,nodeLookup:d,nodeExtent:l,nodeOrigin:g,onError:f});N.position=k,N.internals.positionAbsolute=A,m.set(N.id,N)}h(m)},[])}const gp=G.createContext(null),P4=gp.Provider;gp.Consumer;const ov=()=>G.useContext(gp),Z4=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Q4=(e,n,i)=>l=>{const{connectionClickStartHandle:o,connectionMode:s,connection:c}=l,{fromHandle:f,toHandle:h,isValid:d}=c,g=h?.nodeId===e&&h?.id===n&&h?.type===i;return{connectingFrom:f?.nodeId===e&&f?.id===n&&f?.type===i,connectingTo:g,clickConnecting:o?.nodeId===e&&o?.id===n&&o?.type===i,isPossibleEndHandle:s===Bl.Strict?f?.type!==i:e!==f?.nodeId||n!==f?.id,connectionInProcess:!!f,clickConnectionInProcess:!!o,valid:g&&d}};function K4({type:e="source",position:n=ye.Top,isValidConnection:i,isConnectable:l=!0,isConnectableStart:o=!0,isConnectableEnd:s=!0,id:c,onConnect:f,children:h,className:d,onMouseDown:g,onTouchStart:m,...x},v){const S=c||null,E=e==="target",C=ot(),N=ov(),{connectOnClick:_,noPanClassName:k,rfId:A}=Ve(Z4,at),{connectingFrom:B,connectingTo:T,clickConnecting:L,isPossibleEndHandle:P,connectionInProcess:Z,clickConnectionInProcess:H,valid:U}=Ve(Q4(N,S,e),at);N||C.getState().onError?.("010",Gn.error010());const Y=I=>{const{defaultEdgeOptions:D,onConnect:q,hasDefaultEdges:X}=C.getState(),K={...D,...I};if(X){const{edges:j,setEdges:O}=C.getState();O(_h(K,j))}q?.(K),f?.(K)},ee=I=>{if(!N)return;const D=Ob(I.nativeEvent);if(o&&(D&&I.button===0||!D)){const q=C.getState();Mh.onPointerDown(I.nativeEvent,{handleDomNode:I.currentTarget,autoPanOnConnect:q.autoPanOnConnect,connectionMode:q.connectionMode,connectionRadius:q.connectionRadius,domNode:q.domNode,nodeLookup:q.nodeLookup,lib:q.lib,isTarget:E,handleId:S,nodeId:N,flowId:q.rfId,panBy:q.panBy,cancelConnection:q.cancelConnection,onConnectStart:q.onConnectStart,onConnectEnd:q.onConnectEnd,updateConnection:q.updateConnection,onConnect:Y,isValidConnection:i||q.isValidConnection,getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,autoPanSpeed:q.autoPanSpeed,dragThreshold:q.connectionDragThreshold})}D?g?.(I):m?.(I)},R=I=>{const{onClickConnectStart:D,onClickConnectEnd:q,connectionClickStartHandle:X,connectionMode:K,isValidConnection:j,lib:O,rfId:$,nodeLookup:z,connection:ne}=C.getState();if(!N||!X&&!o)return;if(!X){D?.(I.nativeEvent,{nodeId:N,handleId:S,handleType:e}),C.setState({connectionClickStartHandle:{nodeId:N,type:e,id:S}});return}const ue=jb(I.target),ce=i||j,{connection:de,isValid:se}=Mh.isValid(I.nativeEvent,{handle:{nodeId:N,id:S,type:e},connectionMode:K,fromNodeId:X.nodeId,fromHandleId:X.id||null,fromType:X.type,isValidConnection:ce,flowId:$,doc:ue,lib:O,nodeLookup:z});se&&de&&Y(de);const pe=structuredClone(ne);delete pe.inProgress,pe.toPosition=pe.toHandle?pe.toHandle.position:null,q?.(I,pe),C.setState({connectionClickStartHandle:null})};return b.jsx("div",{"data-handleid":S,"data-nodeid":N,"data-handlepos":n,"data-id":`${A}-${N}-${S}-${e}`,className:wt(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",k,d,{source:!E,target:E,connectable:l,connectablestart:o,connectableend:s,clickconnecting:L,connectingfrom:B,connectingto:T,valid:U,connectionindicator:l&&(!Z||P)&&(Z||H?s:o)}]),onMouseDown:ee,onTouchStart:ee,onClick:_?R:void 0,ref:v,...x,children:h})}const Vl=G.memo(iv(K4));function J4({data:e,isConnectable:n,sourcePosition:i=ye.Bottom}){return b.jsxs(b.Fragment,{children:[e?.label,b.jsx(Vl,{type:"source",position:i,isConnectable:n})]})}function W4({data:e,isConnectable:n,targetPosition:i=ye.Top,sourcePosition:l=ye.Bottom}){return b.jsxs(b.Fragment,{children:[b.jsx(Vl,{type:"target",position:i,isConnectable:n}),e?.label,b.jsx(Vl,{type:"source",position:l,isConnectable:n})]})}function e3(){return null}function t3({data:e,isConnectable:n,targetPosition:i=ye.Top}){return b.jsxs(b.Fragment,{children:[b.jsx(Vl,{type:"target",position:i,isConnectable:n}),e?.label]})}const Iu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},jx={input:J4,default:W4,output:t3,group:e3};function n3(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 i3=e=>{const{width:n,height:i,x:l,y:o}=Co(e.nodeLookup,{filter:s=>!!s.selected});return{width:Dn(n)?n:null,height:Dn(i)?i:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${l}px,${o}px)`}};function r3({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:i}){const l=ot(),{width:o,height:s,transformString:c,userSelectionActive:f}=Ve(i3,at),h=av(),d=G.useRef(null);if(G.useEffect(()=>{i||d.current?.focus({preventScroll:!0})},[i]),lv({nodeRef:d}),f||!o||!s)return null;const g=e?x=>{const v=l.getState().nodes.filter(S=>S.selected);e(x,v)}:void 0,m=x=>{Object.prototype.hasOwnProperty.call(Iu,x.key)&&(x.preventDefault(),h({direction:Iu[x.key],factor:x.shiftKey?4:1}))};return b.jsx("div",{className:wt(["react-flow__nodesselection","react-flow__container",n]),style:{transform:c},children:b.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:i?void 0:-1,onKeyDown:i?void 0:m,style:{width:o,height:s}})})}const Dx=typeof window<"u"?window:void 0,l3=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function sv({children:e,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:l,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:c,paneClickDistance:f,deleteKeyCode:h,selectionKeyCode:d,selectionOnDrag:g,selectionMode:m,onSelectionStart:x,onSelectionEnd:v,multiSelectionKeyCode:S,panActivationKeyCode:E,zoomActivationKeyCode:C,elementsSelectable:N,zoomOnScroll:_,zoomOnPinch:k,panOnScroll:A,panOnScrollSpeed:B,panOnScrollMode:T,zoomOnDoubleClick:L,panOnDrag:P,defaultViewport:Z,translateExtent:H,minZoom:U,maxZoom:Y,preventScrolling:ee,onSelectionContextMenu:R,noWheelClassName:I,noPanClassName:D,disableKeyboardA11y:q,onViewportChange:X,isControlledViewport:K}){const{nodesSelectionActive:j,userSelectionActive:O}=Ve(l3,at),$=go(d,{target:Dx}),z=go(E,{target:Dx}),ne=z||P,ue=z||A,ce=g&&ne!==!0,de=$||O||ce;return U4({deleteKeyCode:h,multiSelectionKeyCode:S}),b.jsx(V4,{onPaneContextMenu:s,elementsSelectable:N,zoomOnScroll:_,zoomOnPinch:k,panOnScroll:ue,panOnScrollSpeed:B,panOnScrollMode:T,zoomOnDoubleClick:L,panOnDrag:!$&&ne,defaultViewport:Z,translateExtent:H,minZoom:U,maxZoom:Y,zoomActivationKeyCode:C,preventScrolling:ee,noWheelClassName:I,noPanClassName:D,onViewportChange:X,isControlledViewport:K,paneClickDistance:f,selectionOnDrag:ce,children:b.jsxs(F4,{onSelectionStart:x,onSelectionEnd:v,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:l,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:c,panOnDrag:ne,isSelecting:!!de,selectionMode:m,selectionKeyPressed:$,paneClickDistance:f,selectionOnDrag:ce,children:[e,j&&b.jsx(r3,{onSelectionContextMenu:R,noPanClassName:D,disableKeyboardA11y:q})]})})}sv.displayName="FlowRenderer";const a3=G.memo(sv),o3=e=>n=>e?op(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(i=>i.id):Array.from(n.nodeLookup.keys());function s3(e){return Ve(G.useCallback(o3(e),[e]),at)}const u3=e=>e.updateNodeInternals;function c3(){const e=Ve(u3),[n]=G.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const l=new Map;i.forEach(o=>{const s=o.target.getAttribute("data-id");l.set(s,{id:s,nodeElement:o.target,force:!0})}),e(l)}));return G.useEffect(()=>()=>{n?.disconnect()},[n]),n}function f3({node:e,nodeType:n,hasDimensions:i,resizeObserver:l}){const o=ot(),s=G.useRef(null),c=G.useRef(null),f=G.useRef(e.sourcePosition),h=G.useRef(e.targetPosition),d=G.useRef(n),g=i&&!!e.internals.handleBounds;return G.useEffect(()=>{s.current&&!e.hidden&&(!g||c.current!==s.current)&&(c.current&&l?.unobserve(c.current),l?.observe(s.current),c.current=s.current)},[g,e.hidden]),G.useEffect(()=>()=>{c.current&&(l?.unobserve(c.current),c.current=null)},[]),G.useEffect(()=>{if(s.current){const m=d.current!==n,x=f.current!==e.sourcePosition,v=h.current!==e.targetPosition;(m||x||v)&&(d.current=n,f.current=e.sourcePosition,h.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),s}function d3({id:e,onClick:n,onMouseEnter:i,onMouseMove:l,onMouseLeave:o,onContextMenu:s,onDoubleClick:c,nodesDraggable:f,elementsSelectable:h,nodesConnectable:d,nodesFocusable:g,resizeObserver:m,noDragClassName:x,noPanClassName:v,disableKeyboardA11y:S,rfId:E,nodeTypes:C,nodeClickDistance:N,onError:_}){const{node:k,internals:A,isParent:B}=Ve(se=>{const pe=se.nodeLookup.get(e),ke=se.parentLookup.has(e);return{node:pe,internals:pe.internals,isParent:ke}},at);let T=k.type||"default",L=C?.[T]||jx[T];L===void 0&&(_?.("003",Gn.error003(T)),T="default",L=C?.default||jx.default);const P=!!(k.draggable||f&&typeof k.draggable>"u"),Z=!!(k.selectable||h&&typeof k.selectable>"u"),H=!!(k.connectable||d&&typeof k.connectable>"u"),U=!!(k.focusable||g&&typeof k.focusable>"u"),Y=ot(),ee=Mb(k),R=f3({node:k,nodeType:T,hasDimensions:ee,resizeObserver:m}),I=lv({nodeRef:R,disabled:k.hidden||!P,noDragClassName:x,handleSelector:k.dragHandle,nodeId:e,isSelectable:Z,nodeClickDistance:N}),D=av();if(k.hidden)return null;const q=Ni(k),X=n3(k),K=Z||P||n||i||l||o,j=i?se=>i(se,{...A.userNode}):void 0,O=l?se=>l(se,{...A.userNode}):void 0,$=o?se=>o(se,{...A.userNode}):void 0,z=s?se=>s(se,{...A.userNode}):void 0,ne=c?se=>c(se,{...A.userNode}):void 0,ue=se=>{const{selectNodesOnDrag:pe,nodeDragThreshold:ke}=Y.getState();Z&&(!pe||!P||ke>0)&&zh({id:e,store:Y,nodeRef:R}),n&&n(se,{...A.userNode})},ce=se=>{if(!(Db(se.nativeEvent)||S)){if(wb.includes(se.key)&&Z){const pe=se.key==="Escape";zh({id:e,store:Y,unselect:pe,nodeRef:R})}else if(P&&k.selected&&Object.prototype.hasOwnProperty.call(Iu,se.key)){se.preventDefault();const{ariaLabelConfig:pe}=Y.getState();Y.setState({ariaLiveMessage:pe["node.a11yDescription.ariaLiveMessage"]({direction:se.key.replace("Arrow","").toLowerCase(),x:~~A.positionAbsolute.x,y:~~A.positionAbsolute.y})}),D({direction:Iu[se.key],factor:se.shiftKey?4:1})}}},de=()=>{if(S||!R.current?.matches(":focus-visible"))return;const{transform:se,width:pe,height:ke,autoPanOnNodeFocus:Ne,setCenter:be}=Y.getState();if(!Ne)return;op(new Map([[e,k]]),{x:0,y:0,width:pe,height:ke},se,!0).length>0||be(k.position.x+q.width/2,k.position.y+q.height/2,{zoom:se[2]})};return b.jsx("div",{className:wt(["react-flow__node",`react-flow__node-${T}`,{[v]:P},k.className,{selected:k.selected,selectable:Z,parent:B,draggable:P,dragging:I}]),ref:R,style:{zIndex:A.z,transform:`translate(${A.positionAbsolute.x}px,${A.positionAbsolute.y}px)`,pointerEvents:K?"all":"none",visibility:ee?"visible":"hidden",...k.style,...X},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:j,onMouseMove:O,onMouseLeave:$,onContextMenu:z,onClick:ue,onDoubleClick:ne,onKeyDown:U?ce:void 0,tabIndex:U?0:void 0,onFocus:U?de:void 0,role:k.ariaRole??(U?"group":void 0),"aria-roledescription":"node","aria-describedby":S?void 0:`${Jb}-${E}`,"aria-label":k.ariaLabel,...k.domAttributes,children:b.jsx(P4,{value:e,children:b.jsx(L,{id:e,data:k.data,type:T,positionAbsoluteX:A.positionAbsolute.x,positionAbsoluteY:A.positionAbsolute.y,selected:k.selected??!1,selectable:Z,draggable:P,deletable:k.deletable??!0,isConnectable:H,sourcePosition:k.sourcePosition,targetPosition:k.targetPosition,dragging:I,dragHandle:k.dragHandle,zIndex:A.z,parentId:k.parentId,...q})})})}var h3=G.memo(d3);const p3=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function uv(e){const{nodesDraggable:n,nodesConnectable:i,nodesFocusable:l,elementsSelectable:o,onError:s}=Ve(p3,at),c=s3(e.onlyRenderVisibleElements),f=c3();return b.jsx("div",{className:"react-flow__nodes",style:ic,children:c.map(h=>b.jsx(h3,{id:h,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:f,nodesDraggable:n,nodesConnectable:i,nodesFocusable:l,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:s},h))})}uv.displayName="NodeRenderer";const m3=G.memo(uv);function g3(e){return Ve(G.useCallback(i=>{if(!e)return i.edges.map(o=>o.id);const l=[];if(i.width&&i.height)for(const o of i.edges){const s=i.nodeLookup.get(o.source),c=i.nodeLookup.get(o.target);s&&c&&mC({sourceNode:s,targetNode:c,width:i.width,height:i.height,transform:i.transform})&&l.push(o.id)}return l},[e]),at)}const y3=({color:e="none",strokeWidth:n=1})=>{const i={strokeWidth:n,...e&&{stroke:e}};return b.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},x3=({color:e="none",strokeWidth:n=1})=>{const i={strokeWidth:n,...e&&{stroke:e,fill:e}};return b.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Ox={[Bu.Arrow]:y3,[Bu.ArrowClosed]:x3};function b3(e){const n=ot();return G.useMemo(()=>Object.prototype.hasOwnProperty.call(Ox,e)?Ox[e]:(n.getState().onError?.("009",Gn.error009(e)),null),[e])}const v3=({id:e,type:n,color:i,width:l=12.5,height:o=12.5,markerUnits:s="strokeWidth",strokeWidth:c,orient:f="auto-start-reverse"})=>{const h=b3(n);return h?b.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${l}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:f,refX:"0",refY:"0",children:b.jsx(h,{color:i,strokeWidth:c})}):null},cv=({defaultColor:e,rfId:n})=>{const i=Ve(s=>s.edges),l=Ve(s=>s.defaultEdgeOptions),o=G.useMemo(()=>SC(i,{id:n,defaultColor:e,defaultMarkerStart:l?.markerStart,defaultMarkerEnd:l?.markerEnd}),[i,l,n,e]);return o.length?b.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:b.jsx("defs",{children:o.map(s=>b.jsx(v3,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};cv.displayName="MarkerDefinitions";var w3=G.memo(cv);function fv({x:e,y:n,label:i,labelStyle:l,labelShowBg:o=!0,labelBgStyle:s,labelBgPadding:c=[2,4],labelBgBorderRadius:f=2,children:h,className:d,...g}){const[m,x]=G.useState({x:1,y:0,width:0,height:0}),v=wt(["react-flow__edge-textwrapper",d]),S=G.useRef(null);return G.useEffect(()=>{if(S.current){const E=S.current.getBBox();x({x:E.x,y:E.y,width:E.width,height:E.height})}},[i]),i?b.jsxs("g",{transform:`translate(${e-m.width/2} ${n-m.height/2})`,className:v,visibility:m.width?"visible":"hidden",...g,children:[o&&b.jsx("rect",{width:m.width+2*c[0],x:-c[0],y:-c[1],height:m.height+2*c[1],className:"react-flow__edge-textbg",style:s,rx:f,ry:f}),b.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:S,style:l,children:i}),h]}):null}fv.displayName="EdgeText";const S3=G.memo(fv);function rc({path:e,labelX:n,labelY:i,label:l,labelStyle:o,labelShowBg:s,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,interactionWidth:d=20,...g}){return b.jsxs(b.Fragment,{children:[b.jsx("path",{...g,d:e,fill:"none",className:wt(["react-flow__edge-path",g.className])}),d?b.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,l&&Dn(n)&&Dn(i)?b.jsx(S3,{x:n,y:i,label:l,labelStyle:o,labelShowBg:s,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h}):null]})}function Rx({pos:e,x1:n,y1:i,x2:l,y2:o}){return e===ye.Left||e===ye.Right?[.5*(n+l),i]:[n,.5*(i+o)]}function dv({sourceX:e,sourceY:n,sourcePosition:i=ye.Bottom,targetX:l,targetY:o,targetPosition:s=ye.Top}){const[c,f]=Rx({pos:i,x1:e,y1:n,x2:l,y2:o}),[h,d]=Rx({pos:s,x1:l,y1:o,x2:e,y2:n}),[g,m,x,v]=Rb({sourceX:e,sourceY:n,targetX:l,targetY:o,sourceControlX:c,sourceControlY:f,targetControlX:h,targetControlY:d});return[`M${e},${n} C${c},${f} ${h},${d} ${l},${o}`,g,m,x,v]}function hv(e){return G.memo(({id:n,sourceX:i,sourceY:l,targetX:o,targetY:s,sourcePosition:c,targetPosition:f,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:v,style:S,markerEnd:E,markerStart:C,interactionWidth:N})=>{const[_,k,A]=dv({sourceX:i,sourceY:l,sourcePosition:c,targetX:o,targetY:s,targetPosition:f}),B=e.isInternal?void 0:n;return b.jsx(rc,{id:B,path:_,labelX:k,labelY:A,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:v,style:S,markerEnd:E,markerStart:C,interactionWidth:N})})}const k3=hv({isInternal:!1}),pv=hv({isInternal:!0});k3.displayName="SimpleBezierEdge";pv.displayName="SimpleBezierEdgeInternal";function mv(e){return G.memo(({id:n,sourceX:i,sourceY:l,targetX:o,targetY:s,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,sourcePosition:v=ye.Bottom,targetPosition:S=ye.Top,markerEnd:E,markerStart:C,pathOptions:N,interactionWidth:_})=>{const[k,A,B]=Ch({sourceX:i,sourceY:l,sourcePosition:v,targetX:o,targetY:s,targetPosition:S,borderRadius:N?.borderRadius,offset:N?.offset,stepPosition:N?.stepPosition}),T=e.isInternal?void 0:n;return b.jsx(rc,{id:T,path:k,labelX:A,labelY:B,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:E,markerStart:C,interactionWidth:_})})}const gv=mv({isInternal:!1}),yv=mv({isInternal:!0});gv.displayName="SmoothStepEdge";yv.displayName="SmoothStepEdgeInternal";function xv(e){return G.memo(({id:n,...i})=>{const l=e.isInternal?void 0:n;return b.jsx(gv,{...i,id:l,pathOptions:G.useMemo(()=>({borderRadius:0,offset:i.pathOptions?.offset}),[i.pathOptions?.offset])})})}const E3=xv({isInternal:!1}),bv=xv({isInternal:!0});E3.displayName="StepEdge";bv.displayName="StepEdgeInternal";function vv(e){return G.memo(({id:n,sourceX:i,sourceY:l,targetX:o,targetY:s,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:v,markerStart:S,interactionWidth:E})=>{const[C,N,_]=Hb({sourceX:i,sourceY:l,targetX:o,targetY:s}),k=e.isInternal?void 0:n;return b.jsx(rc,{id:k,path:C,labelX:N,labelY:_,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:v,markerStart:S,interactionWidth:E})})}const N3=vv({isInternal:!1}),wv=vv({isInternal:!0});N3.displayName="StraightEdge";wv.displayName="StraightEdgeInternal";function Sv(e){return G.memo(({id:n,sourceX:i,sourceY:l,targetX:o,targetY:s,sourcePosition:c=ye.Bottom,targetPosition:f=ye.Top,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:v,style:S,markerEnd:E,markerStart:C,pathOptions:N,interactionWidth:_})=>{const[k,A,B]=Lb({sourceX:i,sourceY:l,sourcePosition:c,targetX:o,targetY:s,targetPosition:f,curvature:N?.curvature}),T=e.isInternal?void 0:n;return b.jsx(rc,{id:T,path:k,labelX:A,labelY:B,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:v,style:S,markerEnd:E,markerStart:C,interactionWidth:_})})}const _3=Sv({isInternal:!1}),kv=Sv({isInternal:!0});_3.displayName="BezierEdge";kv.displayName="BezierEdgeInternal";const Lx={default:kv,straight:wv,step:bv,smoothstep:yv,simplebezier:pv},Bx={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},C3=(e,n,i)=>i===ye.Left?e-n:i===ye.Right?e+n:e,T3=(e,n,i)=>i===ye.Top?e-n:i===ye.Bottom?e+n:e,Hx="react-flow__edgeupdater";function Ux({position:e,centerX:n,centerY:i,radius:l=10,onMouseDown:o,onMouseEnter:s,onMouseOut:c,type:f}){return b.jsx("circle",{onMouseDown:o,onMouseEnter:s,onMouseOut:c,className:wt([Hx,`${Hx}-${f}`]),cx:C3(n,l,e),cy:T3(i,l,e),r:l,stroke:"transparent",fill:"transparent"})}function A3({isReconnectable:e,reconnectRadius:n,edge:i,sourceX:l,sourceY:o,targetX:s,targetY:c,sourcePosition:f,targetPosition:h,onReconnect:d,onReconnectStart:g,onReconnectEnd:m,setReconnecting:x,setUpdateHover:v}){const S=ot(),E=(A,B)=>{if(A.button!==0)return;const{autoPanOnConnect:T,domNode:L,isValidConnection:P,connectionMode:Z,connectionRadius:H,lib:U,onConnectStart:Y,onConnectEnd:ee,cancelConnection:R,nodeLookup:I,rfId:D,panBy:q,updateConnection:X}=S.getState(),K=B.type==="target",j=(z,ne)=>{x(!1),m?.(z,i,B.type,ne)},O=z=>d?.(i,z),$=(z,ne)=>{x(!0),g?.(A,i,B.type),Y?.(z,ne)};Mh.onPointerDown(A.nativeEvent,{autoPanOnConnect:T,connectionMode:Z,connectionRadius:H,domNode:L,handleId:B.id,nodeId:B.nodeId,nodeLookup:I,isTarget:K,edgeUpdaterType:B.type,lib:U,flowId:D,cancelConnection:R,panBy:q,isValidConnection:P,onConnect:O,onConnectStart:$,onConnectEnd:ee,onReconnectEnd:j,updateConnection:X,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,dragThreshold:S.getState().connectionDragThreshold,handleDomNode:A.currentTarget})},C=A=>E(A,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),N=A=>E(A,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),_=()=>v(!0),k=()=>v(!1);return b.jsxs(b.Fragment,{children:[(e===!0||e==="source")&&b.jsx(Ux,{position:f,centerX:l,centerY:o,radius:n,onMouseDown:C,onMouseEnter:_,onMouseOut:k,type:"source"}),(e===!0||e==="target")&&b.jsx(Ux,{position:h,centerX:s,centerY:c,radius:n,onMouseDown:N,onMouseEnter:_,onMouseOut:k,type:"target"})]})}function M3({id:e,edgesFocusable:n,edgesReconnectable:i,elementsSelectable:l,onClick:o,onDoubleClick:s,onContextMenu:c,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,reconnectRadius:g,onReconnect:m,onReconnectStart:x,onReconnectEnd:v,rfId:S,edgeTypes:E,noPanClassName:C,onError:N,disableKeyboardA11y:_}){let k=Ve(be=>be.edgeLookup.get(e));const A=Ve(be=>be.defaultEdgeOptions);k=A?{...A,...k}:k;let B=k.type||"default",T=E?.[B]||Lx[B];T===void 0&&(N?.("011",Gn.error011(B)),B="default",T=E?.default||Lx.default);const L=!!(k.focusable||n&&typeof k.focusable>"u"),P=typeof m<"u"&&(k.reconnectable||i&&typeof k.reconnectable>"u"),Z=!!(k.selectable||l&&typeof k.selectable>"u"),H=G.useRef(null),[U,Y]=G.useState(!1),[ee,R]=G.useState(!1),I=ot(),{zIndex:D,sourceX:q,sourceY:X,targetX:K,targetY:j,sourcePosition:O,targetPosition:$}=Ve(G.useCallback(be=>{const Ee=be.nodeLookup.get(k.source),je=be.nodeLookup.get(k.target);if(!Ee||!je)return{zIndex:k.zIndex,...Bx};const Fe=wC({id:e,sourceNode:Ee,targetNode:je,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:be.connectionMode,onError:N});return{zIndex:pC({selected:k.selected,zIndex:k.zIndex,sourceNode:Ee,targetNode:je,elevateOnSelect:be.elevateEdgesOnSelect,zIndexMode:be.zIndexMode}),...Fe||Bx}},[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),at),z=G.useMemo(()=>k.markerStart?`url('#${Th(k.markerStart,S)}')`:void 0,[k.markerStart,S]),ne=G.useMemo(()=>k.markerEnd?`url('#${Th(k.markerEnd,S)}')`:void 0,[k.markerEnd,S]);if(k.hidden||q===null||X===null||K===null||j===null)return null;const ue=be=>{const{addSelectedEdges:Ee,unselectNodesAndEdges:je,multiSelectionActive:Fe}=I.getState();Z&&(I.setState({nodesSelectionActive:!1}),k.selected&&Fe?(je({nodes:[],edges:[k]}),H.current?.blur()):Ee([e])),o&&o(be,k)},ce=s?be=>{s(be,{...k})}:void 0,de=c?be=>{c(be,{...k})}:void 0,se=f?be=>{f(be,{...k})}:void 0,pe=h?be=>{h(be,{...k})}:void 0,ke=d?be=>{d(be,{...k})}:void 0,Ne=be=>{if(!_&&wb.includes(be.key)&&Z){const{unselectNodesAndEdges:Ee,addSelectedEdges:je}=I.getState();be.key==="Escape"?(H.current?.blur(),Ee({edges:[k]})):je([e])}};return b.jsx("svg",{style:{zIndex:D},children:b.jsxs("g",{className:wt(["react-flow__edge",`react-flow__edge-${B}`,k.className,C,{selected:k.selected,animated:k.animated,inactive:!Z&&!o,updating:U,selectable:Z}]),onClick:ue,onDoubleClick:ce,onContextMenu:de,onMouseEnter:se,onMouseMove:pe,onMouseLeave:ke,onKeyDown:L?Ne:void 0,tabIndex:L?0:void 0,role:k.ariaRole??(L?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":k.ariaLabel===null?void 0:k.ariaLabel||`Edge from ${k.source} to ${k.target}`,"aria-describedby":L?`${Wb}-${S}`:void 0,ref:H,...k.domAttributes,children:[!ee&&b.jsx(T,{id:e,source:k.source,target:k.target,type:k.type,selected:k.selected,animated:k.animated,selectable:Z,deletable:k.deletable??!0,label:k.label,labelStyle:k.labelStyle,labelShowBg:k.labelShowBg,labelBgStyle:k.labelBgStyle,labelBgPadding:k.labelBgPadding,labelBgBorderRadius:k.labelBgBorderRadius,sourceX:q,sourceY:X,targetX:K,targetY:j,sourcePosition:O,targetPosition:$,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:z,markerEnd:ne,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),P&&b.jsx(A3,{edge:k,isReconnectable:P,reconnectRadius:g,onReconnect:m,onReconnectStart:x,onReconnectEnd:v,sourceX:q,sourceY:X,targetX:K,targetY:j,sourcePosition:O,targetPosition:$,setUpdateHover:Y,setReconnecting:R})]})})}var z3=G.memo(M3);const j3=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Ev({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:i,edgeTypes:l,noPanClassName:o,onReconnect:s,onEdgeContextMenu:c,onEdgeMouseEnter:f,onEdgeMouseMove:h,onEdgeMouseLeave:d,onEdgeClick:g,reconnectRadius:m,onEdgeDoubleClick:x,onReconnectStart:v,onReconnectEnd:S,disableKeyboardA11y:E}){const{edgesFocusable:C,edgesReconnectable:N,elementsSelectable:_,onError:k}=Ve(j3,at),A=g3(n);return b.jsxs("div",{className:"react-flow__edges",children:[b.jsx(w3,{defaultColor:e,rfId:i}),A.map(B=>b.jsx(z3,{id:B,edgesFocusable:C,edgesReconnectable:N,elementsSelectable:_,noPanClassName:o,onReconnect:s,onContextMenu:c,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,onClick:g,reconnectRadius:m,onDoubleClick:x,onReconnectStart:v,onReconnectEnd:S,rfId:i,onError:k,edgeTypes:l,disableKeyboardA11y:E},B))]})}Ev.displayName="EdgeRenderer";const D3=G.memo(Ev),O3=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function R3({children:e}){const n=Ve(O3);return b.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function L3(e){const n=mp(),i=G.useRef(!1);G.useEffect(()=>{!i.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),i.current=!0)},[e,n.viewportInitialized])}const B3=e=>e.panZoom?.syncViewport;function H3(e){const n=Ve(B3),i=ot();return G.useEffect(()=>{e&&(n?.(e),i.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function U3(e){return e.connection.inProgress?{...e.connection,to:Ao(e.connection.to,e.transform)}:{...e.connection}}function I3(e){return U3}function q3(e){const n=I3();return Ve(n,at)}const V3=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Y3({containerStyle:e,style:n,type:i,component:l}){const{nodesConnectable:o,width:s,height:c,isValid:f,inProgress:h}=Ve(V3,at);return!(s&&o&&h)?null:b.jsx("svg",{style:e,width:s,height:c,className:"react-flow__connectionline react-flow__container",children:b.jsx("g",{className:wt(["react-flow__connection",Eb(f)]),children:b.jsx(Nv,{style:n,type:i,CustomComponent:l,isValid:f})})})}const Nv=({style:e,type:n=lr.Bezier,CustomComponent:i,isValid:l})=>{const{inProgress:o,from:s,fromNode:c,fromHandle:f,fromPosition:h,to:d,toNode:g,toHandle:m,toPosition:x,pointer:v}=q3();if(!o)return;if(i)return b.jsx(i,{connectionLineType:n,connectionLineStyle:e,fromNode:c,fromHandle:f,fromX:s.x,fromY:s.y,toX:d.x,toY:d.y,fromPosition:h,toPosition:x,connectionStatus:Eb(l),toNode:g,toHandle:m,pointer:v});let S="";const E={sourceX:s.x,sourceY:s.y,sourcePosition:h,targetX:d.x,targetY:d.y,targetPosition:x};switch(n){case lr.Bezier:[S]=Lb(E);break;case lr.SimpleBezier:[S]=dv(E);break;case lr.Step:[S]=Ch({...E,borderRadius:0});break;case lr.SmoothStep:[S]=Ch(E);break;default:[S]=Hb(E)}return b.jsx("path",{d:S,fill:"none",className:"react-flow__connection-path",style:e})};Nv.displayName="ConnectionLine";const $3={};function Ix(e=$3){G.useRef(e),ot(),G.useEffect(()=>{},[e])}function X3(){ot(),G.useRef(!1),G.useEffect(()=>{},[])}function _v({nodeTypes:e,edgeTypes:n,onInit:i,onNodeClick:l,onEdgeClick:o,onNodeDoubleClick:s,onEdgeDoubleClick:c,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:g,onSelectionContextMenu:m,onSelectionStart:x,onSelectionEnd:v,connectionLineType:S,connectionLineStyle:E,connectionLineComponent:C,connectionLineContainerStyle:N,selectionKeyCode:_,selectionOnDrag:k,selectionMode:A,multiSelectionKeyCode:B,panActivationKeyCode:T,zoomActivationKeyCode:L,deleteKeyCode:P,onlyRenderVisibleElements:Z,elementsSelectable:H,defaultViewport:U,translateExtent:Y,minZoom:ee,maxZoom:R,preventScrolling:I,defaultMarkerColor:D,zoomOnScroll:q,zoomOnPinch:X,panOnScroll:K,panOnScrollSpeed:j,panOnScrollMode:O,zoomOnDoubleClick:$,panOnDrag:z,onPaneClick:ne,onPaneMouseEnter:ue,onPaneMouseMove:ce,onPaneMouseLeave:de,onPaneScroll:se,onPaneContextMenu:pe,paneClickDistance:ke,nodeClickDistance:Ne,onEdgeContextMenu:be,onEdgeMouseEnter:Ee,onEdgeMouseMove:je,onEdgeMouseLeave:Fe,reconnectRadius:Ye,onReconnect:ct,onReconnectStart:en,onReconnectEnd:jt,noDragClassName:Vt,noWheelClassName:En,noPanClassName:Jn,disableKeyboardA11y:Wn,nodeExtent:St,rfId:Ci,viewport:re,onViewportChange:he}){return Ix(e),Ix(n),X3(),L3(i),H3(re),b.jsx(a3,{onPaneClick:ne,onPaneMouseEnter:ue,onPaneMouseMove:ce,onPaneMouseLeave:de,onPaneContextMenu:pe,onPaneScroll:se,paneClickDistance:ke,deleteKeyCode:P,selectionKeyCode:_,selectionOnDrag:k,selectionMode:A,onSelectionStart:x,onSelectionEnd:v,multiSelectionKeyCode:B,panActivationKeyCode:T,zoomActivationKeyCode:L,elementsSelectable:H,zoomOnScroll:q,zoomOnPinch:X,zoomOnDoubleClick:$,panOnScroll:K,panOnScrollSpeed:j,panOnScrollMode:O,panOnDrag:z,defaultViewport:U,translateExtent:Y,minZoom:ee,maxZoom:R,onSelectionContextMenu:m,preventScrolling:I,noDragClassName:Vt,noWheelClassName:En,noPanClassName:Jn,disableKeyboardA11y:Wn,onViewportChange:he,isControlledViewport:!!re,children:b.jsxs(R3,{children:[b.jsx(D3,{edgeTypes:n,onEdgeClick:o,onEdgeDoubleClick:c,onReconnect:ct,onReconnectStart:en,onReconnectEnd:jt,onlyRenderVisibleElements:Z,onEdgeContextMenu:be,onEdgeMouseEnter:Ee,onEdgeMouseMove:je,onEdgeMouseLeave:Fe,reconnectRadius:Ye,defaultMarkerColor:D,noPanClassName:Jn,disableKeyboardA11y:Wn,rfId:Ci}),b.jsx(Y3,{style:E,type:S,component:C,containerStyle:N}),b.jsx("div",{className:"react-flow__edgelabel-renderer"}),b.jsx(m3,{nodeTypes:e,onNodeClick:l,onNodeDoubleClick:s,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:g,nodeClickDistance:Ne,onlyRenderVisibleElements:Z,noPanClassName:Jn,noDragClassName:Vt,disableKeyboardA11y:Wn,nodeExtent:St,rfId:Ci}),b.jsx("div",{className:"react-flow__viewport-portal"})]})})}_v.displayName="GraphView";const F3=G.memo(_v),qx=({nodes:e,edges:n,defaultNodes:i,defaultEdges:l,width:o,height:s,fitView:c,fitViewOptions:f,minZoom:h=.5,maxZoom:d=2,nodeOrigin:g,nodeExtent:m,zIndexMode:x="basic"}={})=>{const v=new Map,S=new Map,E=new Map,C=new Map,N=l??n??[],_=i??e??[],k=g??[0,0],A=m??fo;qb(E,C,N);const B=Ah(_,v,S,{nodeOrigin:k,nodeExtent:A,zIndexMode:x});let T=[0,0,1];if(c&&o&&s){const L=Co(v,{filter:U=>!!((U.width||U.initialWidth)&&(U.height||U.initialHeight))}),{x:P,y:Z,zoom:H}=sp(L,o,s,h,d,f?.padding??.1);T=[P,Z,H]}return{rfId:"1",width:o??0,height:s??0,transform:T,nodes:_,nodesInitialized:B,nodeLookup:v,parentLookup:S,edges:N,edgeLookup:C,connectionLookup:E,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:l!==void 0,panZoom:null,minZoom:h,maxZoom:d,translateExtent:fo,nodeExtent:A,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Bl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:k,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:c??!1,fitViewOptions:f,fitViewResolver:null,connection:{...kb},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:sC,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Sb,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},G3=({nodes:e,edges:n,defaultNodes:i,defaultEdges:l,width:o,height:s,fitView:c,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:g,nodeExtent:m,zIndexMode:x})=>f4((v,S)=>{async function E(){const{nodeLookup:C,panZoom:N,fitViewOptions:_,fitViewResolver:k,width:A,height:B,minZoom:T,maxZoom:L}=S();N&&(await aC({nodes:C,width:A,height:B,panZoom:N,minZoom:T,maxZoom:L},_),k?.resolve(!0),v({fitViewResolver:null}))}return{...qx({nodes:e,edges:n,width:o,height:s,fitView:c,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:g,nodeExtent:m,defaultNodes:i,defaultEdges:l,zIndexMode:x}),setNodes:C=>{const{nodeLookup:N,parentLookup:_,nodeOrigin:k,elevateNodesOnSelect:A,fitViewQueued:B,zIndexMode:T}=S(),L=Ah(C,N,_,{nodeOrigin:k,nodeExtent:m,elevateNodesOnSelect:A,checkEquality:!0,zIndexMode:T});B&&L?(E(),v({nodes:C,nodesInitialized:L,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:C,nodesInitialized:L})},setEdges:C=>{const{connectionLookup:N,edgeLookup:_}=S();qb(N,_,C),v({edges:C})},setDefaultNodesAndEdges:(C,N)=>{if(C){const{setNodes:_}=S();_(C),v({hasDefaultNodes:!0})}if(N){const{setEdges:_}=S();_(N),v({hasDefaultEdges:!0})}},updateNodeInternals:C=>{const{triggerNodeChanges:N,nodeLookup:_,parentLookup:k,domNode:A,nodeOrigin:B,nodeExtent:T,debug:L,fitViewQueued:P,zIndexMode:Z}=S(),{changes:H,updatedInternals:U}=AC(C,_,k,A,B,T,Z);U&&(NC(_,k,{nodeOrigin:B,nodeExtent:T,zIndexMode:Z}),P?(E(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),H?.length>0&&(L&&console.log("React Flow: trigger node changes",H),N?.(H)))},updateNodePositions:(C,N=!1)=>{const _=[];let k=[];const{nodeLookup:A,triggerNodeChanges:B,connection:T,updateConnection:L,onNodesChangeMiddlewareMap:P}=S();for(const[Z,H]of C){const U=A.get(Z),Y=!!(U?.expandParent&&U?.parentId&&H?.position),ee={id:Z,type:"position",position:Y?{x:Math.max(0,H.position.x),y:Math.max(0,H.position.y)}:H.position,dragging:N};if(U&&T.inProgress&&T.fromNode.id===U.id){const R=Br(U,T.fromHandle,ye.Left,!0);L({...T,from:R})}Y&&U.parentId&&_.push({id:Z,parentId:U.parentId,rect:{...H.internals.positionAbsolute,width:H.measured.width??0,height:H.measured.height??0}}),k.push(ee)}if(_.length>0){const{parentLookup:Z,nodeOrigin:H}=S(),U=pp(_,A,Z,H);k.push(...U)}for(const Z of P.values())k=Z(k);B(k)},triggerNodeChanges:C=>{const{onNodesChange:N,setNodes:_,nodes:k,hasDefaultNodes:A,debug:B}=S();if(C?.length){if(A){const T=Eu(C,k);_(T)}B&&console.log("React Flow: trigger node changes",C),N?.(C)}},triggerEdgeChanges:C=>{const{onEdgesChange:N,setEdges:_,edges:k,hasDefaultEdges:A,debug:B}=S();if(C?.length){if(A){const T=nv(C,k);_(T)}B&&console.log("React Flow: trigger edge changes",C),N?.(C)}},addSelectedNodes:C=>{const{multiSelectionActive:N,edgeLookup:_,nodeLookup:k,triggerNodeChanges:A,triggerEdgeChanges:B}=S();if(N){const T=C.map(L=>Mr(L,!0));A(T);return}A(zl(k,new Set([...C]),!0)),B(zl(_))},addSelectedEdges:C=>{const{multiSelectionActive:N,edgeLookup:_,nodeLookup:k,triggerNodeChanges:A,triggerEdgeChanges:B}=S();if(N){const T=C.map(L=>Mr(L,!0));B(T);return}B(zl(_,new Set([...C]))),A(zl(k,new Set,!0))},unselectNodesAndEdges:({nodes:C,edges:N}={})=>{const{edges:_,nodes:k,nodeLookup:A,triggerNodeChanges:B,triggerEdgeChanges:T}=S(),L=C||k,P=N||_,Z=L.map(U=>{const Y=A.get(U.id);return Y&&(Y.selected=!1),Mr(U.id,!1)}),H=P.map(U=>Mr(U.id,!1));B(Z),T(H)},setMinZoom:C=>{const{panZoom:N,maxZoom:_}=S();N?.setScaleExtent([C,_]),v({minZoom:C})},setMaxZoom:C=>{const{panZoom:N,minZoom:_}=S();N?.setScaleExtent([_,C]),v({maxZoom:C})},setTranslateExtent:C=>{S().panZoom?.setTranslateExtent(C),v({translateExtent:C})},resetSelectedElements:()=>{const{edges:C,nodes:N,triggerNodeChanges:_,triggerEdgeChanges:k,elementsSelectable:A}=S();if(!A)return;const B=N.reduce((L,P)=>P.selected?[...L,Mr(P.id,!1)]:L,[]),T=C.reduce((L,P)=>P.selected?[...L,Mr(P.id,!1)]:L,[]);_(B),k(T)},setNodeExtent:C=>{const{nodes:N,nodeLookup:_,parentLookup:k,nodeOrigin:A,elevateNodesOnSelect:B,nodeExtent:T,zIndexMode:L}=S();C[0][0]===T[0][0]&&C[0][1]===T[0][1]&&C[1][0]===T[1][0]&&C[1][1]===T[1][1]||(Ah(N,_,k,{nodeOrigin:A,nodeExtent:C,elevateNodesOnSelect:B,checkEquality:!1,zIndexMode:L}),v({nodeExtent:C}))},panBy:C=>{const{transform:N,width:_,height:k,panZoom:A,translateExtent:B}=S();return MC({delta:C,panZoom:A,transform:N,translateExtent:B,width:_,height:k})},setCenter:async(C,N,_)=>{const{width:k,height:A,maxZoom:B,panZoom:T}=S();if(!T)return Promise.resolve(!1);const L=typeof _?.zoom<"u"?_.zoom:B;return await T.setViewport({x:k/2-C*L,y:A/2-N*L,zoom:L},{duration:_?.duration,ease:_?.ease,interpolate:_?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...kb}})},updateConnection:C=>{v({connection:C})},reset:()=>v({...qx()})}},Object.is);function Cv({initialNodes:e,initialEdges:n,defaultNodes:i,defaultEdges:l,initialWidth:o,initialHeight:s,initialMinZoom:c,initialMaxZoom:f,initialFitViewOptions:h,fitView:d,nodeOrigin:g,nodeExtent:m,zIndexMode:x,children:v}){const[S]=G.useState(()=>G3({nodes:e,edges:n,defaultNodes:i,defaultEdges:l,width:o,height:s,fitView:d,minZoom:c,maxZoom:f,fitViewOptions:h,nodeOrigin:g,nodeExtent:m,zIndexMode:x}));return b.jsx(d4,{value:S,children:b.jsx(R4,{children:v})})}function P3({children:e,nodes:n,edges:i,defaultNodes:l,defaultEdges:o,width:s,height:c,fitView:f,fitViewOptions:h,minZoom:d,maxZoom:g,nodeOrigin:m,nodeExtent:x,zIndexMode:v}){return G.useContext(tc)?b.jsx(b.Fragment,{children:e}):b.jsx(Cv,{initialNodes:n,initialEdges:i,defaultNodes:l,defaultEdges:o,initialWidth:s,initialHeight:c,fitView:f,initialFitViewOptions:h,initialMinZoom:d,initialMaxZoom:g,nodeOrigin:m,nodeExtent:x,zIndexMode:v,children:e})}const Z3={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Q3({nodes:e,edges:n,defaultNodes:i,defaultEdges:l,className:o,nodeTypes:s,edgeTypes:c,onNodeClick:f,onEdgeClick:h,onInit:d,onMove:g,onMoveStart:m,onMoveEnd:x,onConnect:v,onConnectStart:S,onConnectEnd:E,onClickConnectStart:C,onClickConnectEnd:N,onNodeMouseEnter:_,onNodeMouseMove:k,onNodeMouseLeave:A,onNodeContextMenu:B,onNodeDoubleClick:T,onNodeDragStart:L,onNodeDrag:P,onNodeDragStop:Z,onNodesDelete:H,onEdgesDelete:U,onDelete:Y,onSelectionChange:ee,onSelectionDragStart:R,onSelectionDrag:I,onSelectionDragStop:D,onSelectionContextMenu:q,onSelectionStart:X,onSelectionEnd:K,onBeforeDelete:j,connectionMode:O,connectionLineType:$=lr.Bezier,connectionLineStyle:z,connectionLineComponent:ne,connectionLineContainerStyle:ue,deleteKeyCode:ce="Backspace",selectionKeyCode:de="Shift",selectionOnDrag:se=!1,selectionMode:pe=ho.Full,panActivationKeyCode:ke="Space",multiSelectionKeyCode:Ne=mo()?"Meta":"Control",zoomActivationKeyCode:be=mo()?"Meta":"Control",snapToGrid:Ee,snapGrid:je,onlyRenderVisibleElements:Fe=!1,selectNodesOnDrag:Ye,nodesDraggable:ct,autoPanOnNodeFocus:en,nodesConnectable:jt,nodesFocusable:Vt,nodeOrigin:En=ev,edgesFocusable:Jn,edgesReconnectable:Wn,elementsSelectable:St=!0,defaultViewport:Ci=N4,minZoom:re=.5,maxZoom:he=2,translateExtent:we=fo,preventScrolling:ze=!0,nodeExtent:Ie,defaultMarkerColor:Ht="#b1b1b7",zoomOnScroll:Nn=!0,zoomOnPinch:Ct=!0,panOnScroll:ft=!1,panOnScrollSpeed:Dt=.5,panOnScrollMode:Pe=Dr.Free,zoomOnDoubleClick:Bn=!0,panOnDrag:tn=!0,onPaneClick:bc,onPaneMouseEnter:Ir,onPaneMouseMove:qr,onPaneMouseLeave:Vr,onPaneScroll:ei,onPaneContextMenu:Yr,paneClickDistance:sr=1,nodeClickDistance:vc=0,children:Ro,onReconnect:Ql,onReconnectStart:ur,onReconnectEnd:wc,onEdgeContextMenu:Lo,onEdgeDoubleClick:Bo,onEdgeMouseEnter:Ho,onEdgeMouseMove:Kl,onEdgeMouseLeave:Jl,reconnectRadius:Uo=10,onNodesChange:Io,onEdgesChange:Hn,noDragClassName:kt="nodrag",noWheelClassName:Ot="nowheel",noPanClassName:ti="nopan",fitView:$r,fitViewOptions:qo,connectOnClick:Sc,attributionPosition:Vo,proOptions:cr,defaultEdgeOptions:Wl,elevateNodesOnSelect:Ti=!0,elevateEdgesOnSelect:Ai=!1,disableKeyboardA11y:Mi=!1,autoPanOnConnect:zi,autoPanOnNodeDrag:pt,autoPanSpeed:Yo,connectionRadius:$o,isValidConnection:ni,onError:ji,style:kc,id:ea,nodeDragThreshold:Xo,connectionDragThreshold:Ec,viewport:Xr,onViewportChange:Fr,width:_n,height:Yt,colorMode:Fo="light",debug:Nc,onScroll:Gr,ariaLabelConfig:Go,zIndexMode:fr="basic",..._c},$t){const dr=ea||"1",Po=A4(Fo),ta=G.useCallback(ii=>{ii.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Gr?.(ii)},[Gr]);return b.jsx("div",{"data-testid":"rf__wrapper",..._c,onScroll:ta,style:{...kc,...Z3},ref:$t,className:wt(["react-flow",o,Po]),id:ea,role:"application",children:b.jsxs(P3,{nodes:e,edges:n,width:_n,height:Yt,fitView:$r,fitViewOptions:qo,minZoom:re,maxZoom:he,nodeOrigin:En,nodeExtent:Ie,zIndexMode:fr,children:[b.jsx(F3,{onInit:d,onNodeClick:f,onEdgeClick:h,onNodeMouseEnter:_,onNodeMouseMove:k,onNodeMouseLeave:A,onNodeContextMenu:B,onNodeDoubleClick:T,nodeTypes:s,edgeTypes:c,connectionLineType:$,connectionLineStyle:z,connectionLineComponent:ne,connectionLineContainerStyle:ue,selectionKeyCode:de,selectionOnDrag:se,selectionMode:pe,deleteKeyCode:ce,multiSelectionKeyCode:Ne,panActivationKeyCode:ke,zoomActivationKeyCode:be,onlyRenderVisibleElements:Fe,defaultViewport:Ci,translateExtent:we,minZoom:re,maxZoom:he,preventScrolling:ze,zoomOnScroll:Nn,zoomOnPinch:Ct,zoomOnDoubleClick:Bn,panOnScroll:ft,panOnScrollSpeed:Dt,panOnScrollMode:Pe,panOnDrag:tn,onPaneClick:bc,onPaneMouseEnter:Ir,onPaneMouseMove:qr,onPaneMouseLeave:Vr,onPaneScroll:ei,onPaneContextMenu:Yr,paneClickDistance:sr,nodeClickDistance:vc,onSelectionContextMenu:q,onSelectionStart:X,onSelectionEnd:K,onReconnect:Ql,onReconnectStart:ur,onReconnectEnd:wc,onEdgeContextMenu:Lo,onEdgeDoubleClick:Bo,onEdgeMouseEnter:Ho,onEdgeMouseMove:Kl,onEdgeMouseLeave:Jl,reconnectRadius:Uo,defaultMarkerColor:Ht,noDragClassName:kt,noWheelClassName:Ot,noPanClassName:ti,rfId:dr,disableKeyboardA11y:Mi,nodeExtent:Ie,viewport:Xr,onViewportChange:Fr}),b.jsx(T4,{nodes:e,edges:n,defaultNodes:i,defaultEdges:l,onConnect:v,onConnectStart:S,onConnectEnd:E,onClickConnectStart:C,onClickConnectEnd:N,nodesDraggable:ct,autoPanOnNodeFocus:en,nodesConnectable:jt,nodesFocusable:Vt,edgesFocusable:Jn,edgesReconnectable:Wn,elementsSelectable:St,elevateNodesOnSelect:Ti,elevateEdgesOnSelect:Ai,minZoom:re,maxZoom:he,nodeExtent:Ie,onNodesChange:Io,onEdgesChange:Hn,snapToGrid:Ee,snapGrid:je,connectionMode:O,translateExtent:we,connectOnClick:Sc,defaultEdgeOptions:Wl,fitView:$r,fitViewOptions:qo,onNodesDelete:H,onEdgesDelete:U,onDelete:Y,onNodeDragStart:L,onNodeDrag:P,onNodeDragStop:Z,onSelectionDrag:I,onSelectionDragStart:R,onSelectionDragStop:D,onMove:g,onMoveStart:m,onMoveEnd:x,noPanClassName:ti,nodeOrigin:En,rfId:dr,autoPanOnConnect:zi,autoPanOnNodeDrag:pt,autoPanSpeed:Yo,onError:ji,connectionRadius:$o,isValidConnection:ni,selectNodesOnDrag:Ye,nodeDragThreshold:Xo,connectionDragThreshold:Ec,onBeforeDelete:j,debug:Nc,ariaLabelConfig:Go,zIndexMode:fr}),b.jsx(E4,{onSelectionChange:ee}),Ro,b.jsx(b4,{proOptions:cr,position:Vo}),b.jsx(x4,{rfId:dr,disableKeyboardA11y:Mi})]})})}var K3=iv(Q3);function J3({dimensions:e,lineWidth:n,variant:i,className:l}){return b.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:wt(["react-flow__background-pattern",i,l])})}function W3({radius:e,className:n}){return b.jsx("circle",{cx:e,cy:e,r:e,className:wt(["react-flow__background-pattern","dots",n])})}var ki;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ki||(ki={}));const eT={[ki.Dots]:1,[ki.Lines]:1,[ki.Cross]:6},tT=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Tv({id:e,variant:n=ki.Dots,gap:i=20,size:l,lineWidth:o=1,offset:s=0,color:c,bgColor:f,style:h,className:d,patternClassName:g}){const m=G.useRef(null),{transform:x,patternId:v}=Ve(tT,at),S=l||eT[n],E=n===ki.Dots,C=n===ki.Cross,N=Array.isArray(i)?i:[i,i],_=[N[0]*x[2]||1,N[1]*x[2]||1],k=S*x[2],A=Array.isArray(s)?s:[s,s],B=C?[k,k]:_,T=[A[0]*x[2]||1+B[0]/2,A[1]*x[2]||1+B[1]/2],L=`${v}${e||""}`;return b.jsxs("svg",{className:wt(["react-flow__background",d]),style:{...h,...ic,"--xy-background-color-props":f,"--xy-background-pattern-color-props":c},ref:m,"data-testid":"rf__background",children:[b.jsx("pattern",{id:L,x:x[0]%_[0],y:x[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:E?b.jsx(W3,{radius:k/2,className:g}):b.jsx(J3,{dimensions:B,lineWidth:o,variant:n,className:g})}),b.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${L})`})]})}Tv.displayName="Background";const nT=G.memo(Tv);function iT(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:b.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function rT(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:b.jsx("path",{d:"M0 0h32v4.2H0z"})})}function lT(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:b.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 aT(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.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 oT(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.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 du({children:e,className:n,...i}){return b.jsx("button",{type:"button",className:wt(["react-flow__controls-button",n]),...i,children:e})}const sT=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Av({style:e,showZoom:n=!0,showFitView:i=!0,showInteractive:l=!0,fitViewOptions:o,onZoomIn:s,onZoomOut:c,onFitView:f,onInteractiveChange:h,className:d,children:g,position:m="bottom-left",orientation:x="vertical","aria-label":v}){const S=ot(),{isInteractive:E,minZoomReached:C,maxZoomReached:N,ariaLabelConfig:_}=Ve(sT,at),{zoomIn:k,zoomOut:A,fitView:B}=mp(),T=()=>{k(),s?.()},L=()=>{A(),c?.()},P=()=>{B(o),f?.()},Z=()=>{S.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),h?.(!E)},H=x==="horizontal"?"horizontal":"vertical";return b.jsxs(nc,{className:wt(["react-flow__controls",H,d]),position:m,style:e,"data-testid":"rf__controls","aria-label":v??_["controls.ariaLabel"],children:[n&&b.jsxs(b.Fragment,{children:[b.jsx(du,{onClick:T,className:"react-flow__controls-zoomin",title:_["controls.zoomIn.ariaLabel"],"aria-label":_["controls.zoomIn.ariaLabel"],disabled:N,children:b.jsx(iT,{})}),b.jsx(du,{onClick:L,className:"react-flow__controls-zoomout",title:_["controls.zoomOut.ariaLabel"],"aria-label":_["controls.zoomOut.ariaLabel"],disabled:C,children:b.jsx(rT,{})})]}),i&&b.jsx(du,{className:"react-flow__controls-fitview",onClick:P,title:_["controls.fitView.ariaLabel"],"aria-label":_["controls.fitView.ariaLabel"],children:b.jsx(lT,{})}),l&&b.jsx(du,{className:"react-flow__controls-interactive",onClick:Z,title:_["controls.interactive.ariaLabel"],"aria-label":_["controls.interactive.ariaLabel"],children:E?b.jsx(oT,{}):b.jsx(aT,{})}),g]})}Av.displayName="Controls";const uT=G.memo(Av);function cT({id:e,x:n,y:i,width:l,height:o,style:s,color:c,strokeColor:f,strokeWidth:h,className:d,borderRadius:g,shapeRendering:m,selected:x,onClick:v}){const{background:S,backgroundColor:E}=s||{},C=c||S||E;return b.jsx("rect",{className:wt(["react-flow__minimap-node",{selected:x},d]),x:n,y:i,rx:g,ry:g,width:l,height:o,style:{fill:C,stroke:f,strokeWidth:h},shapeRendering:m,onClick:v?N=>v(N,e):void 0})}const fT=G.memo(cT),dT=e=>e.nodes.map(n=>n.id),Qd=e=>e instanceof Function?e:()=>e;function hT({nodeStrokeColor:e,nodeColor:n,nodeClassName:i="",nodeBorderRadius:l=5,nodeStrokeWidth:o,nodeComponent:s=fT,onClick:c}){const f=Ve(dT,at),h=Qd(n),d=Qd(e),g=Qd(i),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return b.jsx(b.Fragment,{children:f.map(x=>b.jsx(mT,{id:x,nodeColorFunc:h,nodeStrokeColorFunc:d,nodeClassNameFunc:g,nodeBorderRadius:l,nodeStrokeWidth:o,NodeComponent:s,onClick:c,shapeRendering:m},x))})}function pT({id:e,nodeColorFunc:n,nodeStrokeColorFunc:i,nodeClassNameFunc:l,nodeBorderRadius:o,nodeStrokeWidth:s,shapeRendering:c,NodeComponent:f,onClick:h}){const{node:d,x:g,y:m,width:x,height:v}=Ve(S=>{const{internals:E}=S.nodeLookup.get(e),C=E.userNode,{x:N,y:_}=E.positionAbsolute,{width:k,height:A}=Ni(C);return{node:C,x:N,y:_,width:k,height:A}},at);return!d||d.hidden||!Mb(d)?null:b.jsx(f,{x:g,y:m,width:x,height:v,style:d.style,selected:!!d.selected,className:l(d),color:n(d),borderRadius:o,strokeColor:i(d),strokeWidth:s,shapeRendering:c,onClick:h,id:d.id})}const mT=G.memo(pT);var gT=G.memo(hT);const yT=200,xT=150,bT=e=>!e.hidden,vT=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?Ab(Co(e.nodeLookup,{filter:bT}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},wT="react-flow__minimap-desc";function Mv({style:e,className:n,nodeStrokeColor:i,nodeColor:l,nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:c,nodeComponent:f,bgColor:h,maskColor:d,maskStrokeColor:g,maskStrokeWidth:m,position:x="bottom-right",onClick:v,onNodeClick:S,pannable:E=!1,zoomable:C=!1,ariaLabel:N,inversePan:_,zoomStep:k=1,offsetScale:A=5}){const B=ot(),T=G.useRef(null),{boundingRect:L,viewBB:P,rfId:Z,panZoom:H,translateExtent:U,flowWidth:Y,flowHeight:ee,ariaLabelConfig:R}=Ve(vT,at),I=e?.width??yT,D=e?.height??xT,q=L.width/I,X=L.height/D,K=Math.max(q,X),j=K*I,O=K*D,$=A*K,z=L.x-(j-L.width)/2-$,ne=L.y-(O-L.height)/2-$,ue=j+$*2,ce=O+$*2,de=`${wT}-${Z}`,se=G.useRef(0),pe=G.useRef();se.current=K,G.useEffect(()=>{if(T.current&&H)return pe.current=UC({domNode:T.current,panZoom:H,getTransform:()=>B.getState().transform,getViewScale:()=>se.current}),()=>{pe.current?.destroy()}},[H]),G.useEffect(()=>{pe.current?.update({translateExtent:U,width:Y,height:ee,inversePan:_,pannable:E,zoomStep:k,zoomable:C})},[E,C,_,k,U,Y,ee]);const ke=v?Ee=>{const[je,Fe]=pe.current?.pointer(Ee)||[0,0];v(Ee,{x:je,y:Fe})}:void 0,Ne=S?G.useCallback((Ee,je)=>{const Fe=B.getState().nodeLookup.get(je).internals.userNode;S(Ee,Fe)},[]):void 0,be=N??R["minimap.ariaLabel"];return b.jsx(nc,{position:x,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*K:void 0,"--xy-minimap-node-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof c=="number"?c:void 0},className:wt(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:b.jsxs("svg",{width:I,height:D,viewBox:`${z} ${ne} ${ue} ${ce}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":de,ref:T,onClick:ke,children:[be&&b.jsx("title",{id:de,children:be}),b.jsx(gT,{onClick:Ne,nodeColor:l,nodeStrokeColor:i,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:c,nodeComponent:f}),b.jsx("path",{className:"react-flow__minimap-mask",d:`M${z-$},${ne-$}h${ue+$*2}v${ce+$*2}h${-ue-$*2}z
|
|
15
|
+
M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Mv.displayName="MiniMap";const ST=G.memo(Mv),kT=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,ET={[ql.Line]:"right",[ql.Handle]:"bottom-right"};function NT({nodeId:e,position:n,variant:i=ql.Handle,className:l,style:o=void 0,children:s,color:c,minWidth:f=10,minHeight:h=10,maxWidth:d=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:x,autoScale:v=!0,shouldResize:S,onResizeStart:E,onResize:C,onResizeEnd:N}){const _=ov(),k=typeof e=="string"?e:_,A=ot(),B=G.useRef(null),T=i===ql.Handle,L=Ve(G.useCallback(kT(T&&v),[T,v]),at),P=G.useRef(null),Z=n??ET[i];G.useEffect(()=>{if(!(!B.current||!k))return P.current||(P.current=WC({domNode:B.current,nodeId:k,getStoreItems:()=>{const{nodeLookup:U,transform:Y,snapGrid:ee,snapToGrid:R,nodeOrigin:I,domNode:D}=A.getState();return{nodeLookup:U,transform:Y,snapGrid:ee,snapToGrid:R,nodeOrigin:I,paneDomNode:D}},onChange:(U,Y)=>{const{triggerNodeChanges:ee,nodeLookup:R,parentLookup:I,nodeOrigin:D}=A.getState(),q=[],X={x:U.x,y:U.y},K=R.get(k);if(K&&K.expandParent&&K.parentId){const j=K.origin??D,O=U.width??K.measured.width??0,$=U.height??K.measured.height??0,z={id:K.id,parentId:K.parentId,rect:{width:O,height:$,...zb({x:U.x??K.position.x,y:U.y??K.position.y},{width:O,height:$},K.parentId,R,j)}},ne=pp([z],R,I,D);q.push(...ne),X.x=U.x?Math.max(j[0]*O,U.x):void 0,X.y=U.y?Math.max(j[1]*$,U.y):void 0}if(X.x!==void 0&&X.y!==void 0){const j={id:k,type:"position",position:{...X}};q.push(j)}if(U.width!==void 0&&U.height!==void 0){const O={id:k,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:U.width,height:U.height}};q.push(O)}for(const j of Y){const O={...j,type:"position"};q.push(O)}ee(q)},onEnd:({width:U,height:Y})=>{const ee={id:k,type:"dimensions",resizing:!1,dimensions:{width:U,height:Y}};A.getState().triggerNodeChanges([ee])}})),P.current.update({controlPosition:Z,boundaries:{minWidth:f,minHeight:h,maxWidth:d,maxHeight:g},keepAspectRatio:m,resizeDirection:x,onResizeStart:E,onResize:C,onResizeEnd:N,shouldResize:S}),()=>{P.current?.destroy()}},[Z,f,h,d,g,m,E,C,N,S]);const H=Z.split("-");return b.jsx("div",{className:wt(["react-flow__resize-control","nodrag",...H,i,l]),ref:B,style:{...o,scale:L,...c&&{[T?"backgroundColor":"borderColor"]:c}},children:s})}G.memo(NT);const zv=(...e)=>e.filter((n,i,l)=>!!n&&n.trim()!==""&&l.indexOf(n)===i).join(" ").trim();const _T=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const CT=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,l)=>l?l.toUpperCase():i.toLowerCase());const Vx=e=>{const n=CT(e);return n.charAt(0).toUpperCase()+n.slice(1)};var TT={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 AT=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1};const MT=G.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:l,className:o="",children:s,iconNode:c,...f},h)=>G.createElement("svg",{ref:h,...TT,width:n,height:n,stroke:e,strokeWidth:l?Number(i)*24/Number(n):i,className:zv("lucide",o),...!s&&!AT(f)&&{"aria-hidden":"true"},...f},[...c.map(([d,g])=>G.createElement(d,g)),...Array.isArray(s)?s:[s]]));const Me=(e,n)=>{const i=G.forwardRef(({className:l,...o},s)=>G.createElement(MT,{ref:s,iconNode:n,className:zv(`lucide-${_T(Vx(e))}`,`lucide-${e}`,l),...o}));return i.displayName=Vx(e),i};const zT=[["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"}]],yp=Me("anchor",zT);const jT=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],DT=Me("arrow-left",jT);const OT=[["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"}]],RT=Me("bot",OT);const LT=[["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"}]],lc=Me("chart-column",LT);const BT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],HT=Me("check",BT);const UT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],jv=Me("chevron-down",UT);const IT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],qT=Me("chevron-right",IT);const VT=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],YT=Me("chevron-up",VT);const $T=[["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"}]],jh=Me("circle-alert",$T);const XT=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ac=Me("circle-check-big",XT);const FT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],GT=Me("circle-check",FT);const PT=[["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"}]],xp=Me("circle-x",PT);const ZT=[["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"}]],Dh=Me("download",ZT);const QT=[["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"}]],KT=Me("eye-off",QT);const JT=[["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"}]],Dv=Me("eye",JT);const WT=[["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"}]],eA=Me("file-code",WT);const tA=[["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"}]],yo=Me("file-text",tA);const nA=[["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"}]],Oh=Me("folder-open",nA);const iA=[["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"}]],rA=Me("globe",iA);const lA=[["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"}]],Ov=Me("image",lA);const aA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],oA=Me("info",aA);const sA=[["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"}]],uA=Me("key",sA);const cA=[["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"}]],fA=Me("link-2",cA);const dA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],qu=Me("loader-circle",dA);const hA=[["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"}]],pA=Me("maximize-2",hA);const mA=[["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"}]],oc=Me("message-square",mA);const gA=[["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"}]],yA=Me("minimize-2",gA);const xA=[["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"}]],xo=Me("play",xA);const bA=[["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"}]],vA=Me("refresh-cw",bA);const wA=[["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"}]],SA=Me("save",wA);const kA=[["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"}]],EA=Me("send",kA);const NA=[["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"}]],_A=Me("server",NA);const CA=[["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"}]],TA=Me("settings-2",CA);const AA=[["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"}]],Rv=Me("settings",AA);const MA=[["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"}]],Mo=Me("sparkles",MA);const zA=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],sc=Me("terminal",zA);const jA=[["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"}]],bo=Me("trash-2",jA);const DA=[["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"}]],OA=Me("triangle-alert",DA);const RA=[["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"}]],LA=Me("upload",RA);const BA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],bp=Me("x",BA);const HA=[["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"}]],uc=Me("zap",HA),Yx=e=>{let n;const i=new Set,l=(d,g)=>{const m=typeof d=="function"?d(n):d;if(!Object.is(m,n)){const x=n;n=g??(typeof m!="object"||m===null)?m:Object.assign({},n,m),i.forEach(v=>v(n,x))}},o=()=>n,f={setState:l,getState:o,getInitialState:()=>h,subscribe:d=>(i.add(d),()=>i.delete(d))},h=n=e(l,o,f);return f},UA=(e=>e?Yx(e):Yx),IA=e=>e;function qA(e,n=IA){const i=Ja.useSyncExternalStore(e.subscribe,Ja.useCallback(()=>n(e.getState()),[e,n]),Ja.useCallback(()=>n(e.getInitialState()),[e,n]));return Ja.useDebugValue(i),i}const $x=e=>{const n=UA(e),i=l=>qA(n,l);return Object.assign(i,n),i},cc=(e=>e?$x(e):$x);function VA(e,n){let i;try{i=e()}catch{return}return{getItem:o=>{var s;const c=h=>h===null?null:JSON.parse(h,void 0),f=(s=i.getItem(o))!=null?s:null;return f instanceof Promise?f.then(c):c(f)},setItem:(o,s)=>i.setItem(o,JSON.stringify(s,void 0)),removeItem:o=>i.removeItem(o)}}const Rh=e=>n=>{try{const i=e(n);return i instanceof Promise?i:{then(l){return Rh(l)(i)},catch(l){return this}}}catch(i){return{then(l){return this},catch(l){return Rh(l)(i)}}}},YA=(e,n)=>(i,l,o)=>{let s={storage:VA(()=>localStorage),partialize:C=>C,version:0,merge:(C,N)=>({...N,...C}),...n},c=!1,f=0;const h=new Set,d=new Set;let g=s.storage;if(!g)return e((...C)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),i(...C)},l,o);const m=()=>{const C=s.partialize({...l()});return g.setItem(s.name,{state:C,version:s.version})},x=o.setState;o.setState=(C,N)=>(x(C,N),m());const v=e((...C)=>(i(...C),m()),l,o);o.getInitialState=()=>v;let S;const E=()=>{var C,N;if(!g)return;const _=++f;c=!1,h.forEach(A=>{var B;return A((B=l())!=null?B:v)});const k=((N=s.onRehydrateStorage)==null?void 0:N.call(s,(C=l())!=null?C:v))||void 0;return Rh(g.getItem.bind(g))(s.name).then(A=>{if(A)if(typeof A.version=="number"&&A.version!==s.version){if(s.migrate){const B=s.migrate(A.state,A.version);return B instanceof Promise?B.then(T=>[!0,T]):[!0,B]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,A.state];return[!1,void 0]}).then(A=>{var B;if(_!==f)return;const[T,L]=A;if(S=s.merge(L,(B=l())!=null?B:v),i(S,!0),T)return m()}).then(()=>{_===f&&(k?.(S,void 0),S=l(),c=!0,d.forEach(A=>A(S)))}).catch(A=>{_===f&&k?.(void 0,A)})};return o.persist={setOptions:C=>{s={...s,...C},C.storage&&(g=C.storage)},clearStorage:()=>{g?.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>E(),hasHydrated:()=>c,onHydrate:C=>(h.add(C),()=>{h.delete(C)}),onFinishHydration:C=>(d.add(C),()=>{d.delete(C)})},s.skipHydration||E(),S||v},Lv=YA,$A="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Yl=(e=21)=>{let n="",i=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)n+=$A[i[e]&63];return n};const Pn=cc()(Lv(e=>({nodes:[],edges:[],selectedNodeId:null,workflowId:Yl(),workflowName:"Untitled Workflow",isDraft:!0,addNode:n=>e(i=>({nodes:[...i.nodes,n]})),updateNode:(n,i)=>e(l=>({nodes:l.nodes.map(o=>o.id===n?{...o,data:{...o.data,...i}}:o)})),updateNodeStatus:(n,i,l)=>e(o=>({nodes:o.nodes.map(s=>s.id===n?{...s,data:{...s.data,status:i,progress:l??s.data.progress}}:s)})),removeNode:n=>e(i=>({nodes:i.nodes.filter(l=>l.id!==n),edges:i.edges.filter(l=>l.source!==n&&l.target!==n),selectedNodeId:i.selectedNodeId===n?null:i.selectedNodeId})),setSelectedNode:n=>e({selectedNodeId:n}),addEdge:n=>e(i=>({edges:[...i.edges,n]})),removeEdge:n=>e(i=>({edges:i.edges.filter(l=>l.id!==n)})),setWorkflowName:n=>e({workflowName:n}),loadWorkflow:n=>e({nodes:n.nodes,edges:n.edges,workflowName:n.name||"Imported Workflow",selectedNodeId:null}),mergeExistingConfig:n=>e(i=>{const l=new Set(n.map(d=>d.id)),o=["skill-","agent-","command-","hook-"],s=d=>o.some(g=>d.startsWith(g)),c=i.nodes.filter(d=>s(d.id)?l.has(d.id):!0),f=new Set(c.map(d=>d.id)),h=n.filter(d=>!f.has(d.id));return{nodes:[...c,...h]}}),clearWorkflow:()=>e({nodes:[],edges:[],selectedNodeId:null}),newWorkflow:()=>e({nodes:[],edges:[],selectedNodeId:null,workflowId:Yl(),workflowName:"Untitled Workflow",isDraft:!0}),setNodes:n=>e({nodes:n}),setEdges:n=>e({edges:n})}),{name:"workflow-storage",partialize:e=>({nodes:e.nodes,edges:e.edges,workflowId:e.workflowId,workflowName:e.workflowName})})),Bv=e=>e.nodes.find(n=>n.id===e.selectedNodeId),Xl=cc((e,n)=>({isRunning:!1,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:null,endTime:null,workflowResults:[],outputDir:null,logs:[],startExecution:()=>{e({isRunning:!0,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:Date.now(),endTime:null,workflowResults:[],outputDir:null}),n().addLog("info","Workflow execution started")},stopExecution:()=>{e({isRunning:!1,currentNodeId:null,endTime:Date.now()}),n().addLog("info","Workflow execution stopped")},setCurrentNode:i=>{e({currentNodeId:i}),i&&n().addLog("info","Processing node",i)},markNodeCompleted:(i,l)=>{e(o=>{const s=new Set(o.completedNodes);s.add(i);const c=new Map(o.results);return l!==void 0&&c.set(i,l),{completedNodes:s,results:c}}),n().addLog("success","Node completed",i)},markNodeFailed:(i,l)=>{e(o=>{const s=new Set(o.failedNodes);return s.add(i),{failedNodes:s}}),n().addLog("error",l||"Node failed",i)},setWorkflowResults:(i,l)=>{e({workflowResults:i,outputDir:l||null}),i.forEach(o=>{o.result&&e(s=>{const c=new Map(s.results);return c.set(o.nodeId,o.result),{results:c}})})},resetExecution:()=>{e({isRunning:!1,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:null,endTime:null,workflowResults:[],outputDir:null})},addLog:(i,l,o,s)=>{const c={id:Yl(),timestamp:Date.now(),level:i,message:l,nodeId:o,details:s};e(f=>({logs:[...f.logs,c]}))},clearLogs:()=>e({logs:[]})})),Zn=Object.create(null);Zn.open="0";Zn.close="1";Zn.ping="2";Zn.pong="3";Zn.message="4";Zn.upgrade="5";Zn.noop="6";const Nu=Object.create(null);Object.keys(Zn).forEach(e=>{Nu[Zn[e]]=e});const Lh={type:"error",data:"parser error"},Hv=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Uv=typeof ArrayBuffer=="function",Iv=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,vp=({type:e,data:n},i,l)=>Hv&&n instanceof Blob?i?l(n):Xx(n,l):Uv&&(n instanceof ArrayBuffer||Iv(n))?i?l(n):Xx(new Blob([n]),l):l(Zn[e]+(n||"")),Xx=(e,n)=>{const i=new FileReader;return i.onload=function(){const l=i.result.split(",")[1];n("b"+(l||""))},i.readAsDataURL(e)};function Fx(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Kd;function XA(e,n){if(Hv&&e.data instanceof Blob)return e.data.arrayBuffer().then(Fx).then(n);if(Uv&&(e.data instanceof ArrayBuffer||Iv(e.data)))return n(Fx(e.data));vp(e,!1,i=>{Kd||(Kd=new TextEncoder),n(Kd.encode(i))})}const Gx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",to=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Gx.length;e++)to[Gx.charCodeAt(e)]=e;const FA=e=>{let n=e.length*.75,i=e.length,l,o=0,s,c,f,h;e[e.length-1]==="="&&(n--,e[e.length-2]==="="&&n--);const d=new ArrayBuffer(n),g=new Uint8Array(d);for(l=0;l<i;l+=4)s=to[e.charCodeAt(l)],c=to[e.charCodeAt(l+1)],f=to[e.charCodeAt(l+2)],h=to[e.charCodeAt(l+3)],g[o++]=s<<2|c>>4,g[o++]=(c&15)<<4|f>>2,g[o++]=(f&3)<<6|h&63;return d},GA=typeof ArrayBuffer=="function",wp=(e,n)=>{if(typeof e!="string")return{type:"message",data:qv(e,n)};const i=e.charAt(0);return i==="b"?{type:"message",data:PA(e.substring(1),n)}:Nu[i]?e.length>1?{type:Nu[i],data:e.substring(1)}:{type:Nu[i]}:Lh},PA=(e,n)=>{if(GA){const i=FA(e);return qv(i,n)}else return{base64:!0,data:e}},qv=(e,n)=>n==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,Vv="",ZA=(e,n)=>{const i=e.length,l=new Array(i);let o=0;e.forEach((s,c)=>{vp(s,!1,f=>{l[c]=f,++o===i&&n(l.join(Vv))})})},QA=(e,n)=>{const i=e.split(Vv),l=[];for(let o=0;o<i.length;o++){const s=wp(i[o],n);if(l.push(s),s.type==="error")break}return l};function KA(){return new TransformStream({transform(e,n){XA(e,i=>{const l=i.length;let o;if(l<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,l);else if(l<65536){o=new Uint8Array(3);const s=new DataView(o.buffer);s.setUint8(0,126),s.setUint16(1,l)}else{o=new Uint8Array(9);const s=new DataView(o.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(l))}e.data&&typeof e.data!="string"&&(o[0]|=128),n.enqueue(o),n.enqueue(i)})}})}let Jd;function hu(e){return e.reduce((n,i)=>n+i.length,0)}function pu(e,n){if(e[0].length===n)return e.shift();const i=new Uint8Array(n);let l=0;for(let o=0;o<n;o++)i[o]=e[0][l++],l===e[0].length&&(e.shift(),l=0);return e.length&&l<e[0].length&&(e[0]=e[0].slice(l)),i}function JA(e,n){Jd||(Jd=new TextDecoder);const i=[];let l=0,o=-1,s=!1;return new TransformStream({transform(c,f){for(i.push(c);;){if(l===0){if(hu(i)<1)break;const h=pu(i,1);s=(h[0]&128)===128,o=h[0]&127,o<126?l=3:o===126?l=1:l=2}else if(l===1){if(hu(i)<2)break;const h=pu(i,2);o=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),l=3}else if(l===2){if(hu(i)<8)break;const h=pu(i,8),d=new DataView(h.buffer,h.byteOffset,h.length),g=d.getUint32(0);if(g>Math.pow(2,21)-1){f.enqueue(Lh);break}o=g*Math.pow(2,32)+d.getUint32(4),l=3}else{if(hu(i)<o)break;const h=pu(i,o);f.enqueue(wp(s?h:Jd.decode(h),n)),l=0}if(o===0||o>e){f.enqueue(Lh);break}}}})}const Yv=4;function vt(e){if(e)return WA(e)}function WA(e){for(var n in vt.prototype)e[n]=vt.prototype[n];return e}vt.prototype.on=vt.prototype.addEventListener=function(e,n){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(n),this};vt.prototype.once=function(e,n){function i(){this.off(e,i),n.apply(this,arguments)}return i.fn=n,this.on(e,i),this};vt.prototype.off=vt.prototype.removeListener=vt.prototype.removeAllListeners=vt.prototype.removeEventListener=function(e,n){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+e];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var l,o=0;o<i.length;o++)if(l=i[o],l===n||l.fn===n){i.splice(o,1);break}return i.length===0&&delete this._callbacks["$"+e],this};vt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var n=new Array(arguments.length-1),i=this._callbacks["$"+e],l=1;l<arguments.length;l++)n[l-1]=arguments[l];if(i){i=i.slice(0);for(var l=0,o=i.length;l<o;++l)i[l].apply(this,n)}return this};vt.prototype.emitReserved=vt.prototype.emit;vt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};vt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const fc=typeof Promise=="function"&&typeof Promise.resolve=="function"?n=>Promise.resolve().then(n):(n,i)=>i(n,0),Sn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),e5="arraybuffer";function $v(e,...n){return n.reduce((i,l)=>(e.hasOwnProperty(l)&&(i[l]=e[l]),i),{})}const t5=Sn.setTimeout,n5=Sn.clearTimeout;function dc(e,n){n.useNativeTimers?(e.setTimeoutFn=t5.bind(Sn),e.clearTimeoutFn=n5.bind(Sn)):(e.setTimeoutFn=Sn.setTimeout.bind(Sn),e.clearTimeoutFn=Sn.clearTimeout.bind(Sn))}const i5=1.33;function r5(e){return typeof e=="string"?l5(e):Math.ceil((e.byteLength||e.size)*i5)}function l5(e){let n=0,i=0;for(let l=0,o=e.length;l<o;l++)n=e.charCodeAt(l),n<128?i+=1:n<2048?i+=2:n<55296||n>=57344?i+=3:(l++,i+=4);return i}function Xv(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function a5(e){let n="";for(let i in e)e.hasOwnProperty(i)&&(n.length&&(n+="&"),n+=encodeURIComponent(i)+"="+encodeURIComponent(e[i]));return n}function o5(e){let n={},i=e.split("&");for(let l=0,o=i.length;l<o;l++){let s=i[l].split("=");n[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return n}class s5 extends Error{constructor(n,i,l){super(n),this.description=i,this.context=l,this.type="TransportError"}}class Sp extends vt{constructor(n){super(),this.writable=!1,dc(this,n),this.opts=n,this.query=n.query,this.socket=n.socket,this.supportsBinary=!n.forceBase64}onError(n,i,l){return super.emitReserved("error",new s5(n,i,l)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(n){this.readyState==="open"&&this.write(n)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(n){const i=wp(n,this.socket.binaryType);this.onPacket(i)}onPacket(n){super.emitReserved("packet",n)}onClose(n){this.readyState="closed",super.emitReserved("close",n)}pause(n){}createUri(n,i={}){return n+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){const n=this.opts.hostname;return n.indexOf(":")===-1?n:"["+n+"]"}_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(n){const i=a5(n);return i.length?"?"+i:""}}class u5 extends Sp{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(n){this.readyState="pausing";const i=()=>{this.readyState="paused",n()};if(this._polling||!this.writable){let l=0;this._polling&&(l++,this.once("pollComplete",function(){--l||i()})),this.writable||(l++,this.once("drain",function(){--l||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(n){const i=l=>{if(this.readyState==="opening"&&l.type==="open"&&this.onOpen(),l.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(l)};QA(n,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const n=()=>{this.write([{type:"close"}])};this.readyState==="open"?n():this.once("open",n)}write(n){this.writable=!1,ZA(n,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const n=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=Xv()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(n,i)}}let Fv=!1;try{Fv=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const c5=Fv;function f5(){}class d5 extends u5{constructor(n){if(super(n),typeof location<"u"){const i=location.protocol==="https:";let l=location.port;l||(l=i?"443":"80"),this.xd=typeof location<"u"&&n.hostname!==location.hostname||l!==n.port}}doWrite(n,i){const l=this.request({method:"POST",data:n});l.on("success",i),l.on("error",(o,s)=>{this.onError("xhr post error",o,s)})}doPoll(){const n=this.request();n.on("data",this.onData.bind(this)),n.on("error",(i,l)=>{this.onError("xhr poll error",i,l)}),this.pollXhr=n}}class Fn extends vt{constructor(n,i,l){super(),this.createRequest=n,dc(this,l),this._opts=l,this._method=l.method||"GET",this._uri=i,this._data=l.data!==void 0?l.data:null,this._create()}_create(){var n;const i=$v(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;const l=this._xhr=this.createRequest(i);try{l.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){l.setDisableHeaderCheck&&l.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&l.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{l.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{l.setRequestHeader("Accept","*/*")}catch{}(n=this._opts.cookieJar)===null||n===void 0||n.addCookies(l),"withCredentials"in l&&(l.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(l.timeout=this._opts.requestTimeout),l.onreadystatechange=()=>{var o;l.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(l.getResponseHeader("set-cookie"))),l.readyState===4&&(l.status===200||l.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof l.status=="number"?l.status:0)},0))},l.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=Fn.requestsCount++,Fn.requests[this._index]=this)}_onError(n){this.emitReserved("error",n,this._xhr),this._cleanup(!0)}_cleanup(n){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=f5,n)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Fn.requests[this._index],this._xhr=null}}_onLoad(){const n=this._xhr.responseText;n!==null&&(this.emitReserved("data",n),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Fn.requestsCount=0;Fn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Px);else if(typeof addEventListener=="function"){const e="onpagehide"in Sn?"pagehide":"unload";addEventListener(e,Px,!1)}}function Px(){for(let e in Fn.requests)Fn.requests.hasOwnProperty(e)&&Fn.requests[e].abort()}const h5=(function(){const e=Gv({xdomain:!1});return e&&e.responseType!==null})();class p5 extends d5{constructor(n){super(n);const i=n&&n.forceBase64;this.supportsBinary=h5&&!i}request(n={}){return Object.assign(n,{xd:this.xd},this.opts),new Fn(Gv,this.uri(),n)}}function Gv(e){const n=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!n||c5))return new XMLHttpRequest}catch{}if(!n)try{return new Sn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Pv=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class m5 extends Sp{get name(){return"websocket"}doOpen(){const n=this.uri(),i=this.opts.protocols,l=Pv?{}:$v(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(l.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(n,i,l)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=n=>this.onClose({description:"websocket connection closed",context:n}),this.ws.onmessage=n=>this.onData(n.data),this.ws.onerror=n=>this.onError("websocket error",n)}write(n){this.writable=!1;for(let i=0;i<n.length;i++){const l=n[i],o=i===n.length-1;vp(l,this.supportsBinary,s=>{try{this.doWrite(l,s)}catch{}o&&fc(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const n=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=Xv()),this.supportsBinary||(i.b64=1),this.createUri(n,i)}}const Wd=Sn.WebSocket||Sn.MozWebSocket;class g5 extends m5{createSocket(n,i,l){return Pv?new Wd(n,i,l):i?new Wd(n,i):new Wd(n)}doWrite(n,i){this.ws.send(i)}}class y5 extends Sp{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(n){return this.emitReserved("error",n)}this._transport.closed.then(()=>{this.onClose()}).catch(n=>{this.onError("webtransport error",n)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(n=>{const i=JA(Number.MAX_SAFE_INTEGER,this.socket.binaryType),l=n.readable.pipeThrough(i).getReader(),o=KA();o.readable.pipeTo(n.writable),this._writer=o.writable.getWriter();const s=()=>{l.read().then(({done:f,value:h})=>{f||(this.onPacket(h),s())}).catch(f=>{})};s();const c={type:"open"};this.query.sid&&(c.data=`{"sid":"${this.query.sid}"}`),this._writer.write(c).then(()=>this.onOpen())})})}write(n){this.writable=!1;for(let i=0;i<n.length;i++){const l=n[i],o=i===n.length-1;this._writer.write(l).then(()=>{o&&fc(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var n;(n=this._transport)===null||n===void 0||n.close()}}const x5={websocket:g5,webtransport:y5,polling:p5},b5=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,v5=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Bh(e){if(e.length>8e3)throw"URI too long";const n=e,i=e.indexOf("["),l=e.indexOf("]");i!=-1&&l!=-1&&(e=e.substring(0,i)+e.substring(i,l).replace(/:/g,";")+e.substring(l,e.length));let o=b5.exec(e||""),s={},c=14;for(;c--;)s[v5[c]]=o[c]||"";return i!=-1&&l!=-1&&(s.source=n,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=w5(s,s.path),s.queryKey=S5(s,s.query),s}function w5(e,n){const i=/\/{2,9}/g,l=n.replace(i,"/").split("/");return(n.slice(0,1)=="/"||n.length===0)&&l.splice(0,1),n.slice(-1)=="/"&&l.splice(l.length-1,1),l}function S5(e,n){const i={};return n.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(l,o,s){o&&(i[o]=s)}),i}const Hh=typeof addEventListener=="function"&&typeof removeEventListener=="function",_u=[];Hh&&addEventListener("offline",()=>{_u.forEach(e=>e())},!1);class ar extends vt{constructor(n,i){if(super(),this.binaryType=e5,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,n&&typeof n=="object"&&(i=n,n=null),n){const l=Bh(n);i.hostname=l.host,i.secure=l.protocol==="https"||l.protocol==="wss",i.port=l.port,l.query&&(i.query=l.query)}else i.host&&(i.hostname=Bh(i.host).host);dc(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(l=>{const o=l.prototype.name;this.transports.push(o),this._transportsByName[o]=l}),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},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=o5(this.opts.query)),Hh&&(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"})},_u.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(n){const i=Object.assign({},this.opts.query);i.EIO=Yv,i.transport=n,this.id&&(i.sid=this.id);const l=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[n]);return new this._transportsByName[n](l)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const n=this.opts.rememberUpgrade&&ar.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const i=this.createTransport(n);i.open(),this.setTransport(i)}setTransport(n){this.transport&&this.transport.removeAllListeners(),this.transport=n,n.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",i=>this._onClose("transport close",i))}onOpen(){this.readyState="open",ar.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",n),this.emitReserved("heartbeat"),n.type){case"open":this.onHandshake(JSON.parse(n.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const i=new Error("server error");i.code=n.data,this._onError(i);break;case"message":this.emitReserved("data",n.data),this.emitReserved("message",n.data);break}}onHandshake(n){this.emitReserved("handshake",n),this.id=n.sid,this.transport.query.sid=n.sid,this._pingInterval=n.pingInterval,this._pingTimeout=n.pingTimeout,this._maxPayload=n.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const n=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+n,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},n),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 n=this._getWritablePackets();this.transport.send(n),this._prevBufferLen=n.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let l=0;l<this.writeBuffer.length;l++){const o=this.writeBuffer[l].data;if(o&&(i+=r5(o)),l>0&&i>this._maxPayload)return this.writeBuffer.slice(0,l);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const n=Date.now()>this._pingTimeoutTime;return n&&(this._pingTimeoutTime=0,fc(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),n}write(n,i,l){return this._sendPacket("message",n,i,l),this}send(n,i,l){return this._sendPacket("message",n,i,l),this}_sendPacket(n,i,l,o){if(typeof i=="function"&&(o=i,i=void 0),typeof l=="function"&&(o=l,l=null),this.readyState==="closing"||this.readyState==="closed")return;l=l||{},l.compress=l.compress!==!1;const s={type:n,data:i,options:l};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),o&&this.once("flush",o),this.flush()}close(){const n=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),n()},l=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?l():n()}):this.upgrading?l():n()),this}_onError(n){if(ar.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",n),this._onClose("transport error",n)}_onClose(n,i){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(),Hh&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const l=_u.indexOf(this._offlineEventListener);l!==-1&&_u.splice(l,1)}this.readyState="closed",this.id=null,this.emitReserved("close",n,i),this.writeBuffer=[],this._prevBufferLen=0}}}ar.protocol=Yv;class k5 extends ar{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let n=0;n<this._upgrades.length;n++)this._probe(this._upgrades[n])}_probe(n){let i=this.createTransport(n),l=!1;ar.priorWebsocketSuccess=!1;const o=()=>{l||(i.send([{type:"ping",data:"probe"}]),i.once("packet",m=>{if(!l)if(m.type==="pong"&&m.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;ar.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{l||this.readyState!=="closed"&&(g(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const x=new Error("probe error");x.transport=i.name,this.emitReserved("upgradeError",x)}}))};function s(){l||(l=!0,g(),i.close(),i=null)}const c=m=>{const x=new Error("probe error: "+m);x.transport=i.name,s(),this.emitReserved("upgradeError",x)};function f(){c("transport closed")}function h(){c("socket closed")}function d(m){i&&m.name!==i.name&&s()}const g=()=>{i.removeListener("open",o),i.removeListener("error",c),i.removeListener("close",f),this.off("close",h),this.off("upgrading",d)};i.once("open",o),i.once("error",c),i.once("close",f),this.once("close",h),this.once("upgrading",d),this._upgrades.indexOf("webtransport")!==-1&&n!=="webtransport"?this.setTimeoutFn(()=>{l||i.open()},200):i.open()}onHandshake(n){this._upgrades=this._filterUpgrades(n.upgrades),super.onHandshake(n)}_filterUpgrades(n){const i=[];for(let l=0;l<n.length;l++)~this.transports.indexOf(n[l])&&i.push(n[l]);return i}}let E5=class extends k5{constructor(n,i={}){const l=typeof n=="object"?n:i;(!l.transports||l.transports&&typeof l.transports[0]=="string")&&(l.transports=(l.transports||["polling","websocket","webtransport"]).map(o=>x5[o]).filter(o=>!!o)),super(n,l)}};function N5(e,n="",i){let l=e;i=i||typeof location<"u"&&location,e==null&&(e=i.protocol+"//"+i.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=i.protocol+e:e=i.host+e),/^(https?|wss?):\/\//.test(e)||(typeof i<"u"?e=i.protocol+"//"+e:e="https://"+e),l=Bh(e)),l.port||(/^(http|ws)$/.test(l.protocol)?l.port="80":/^(http|ws)s$/.test(l.protocol)&&(l.port="443")),l.path=l.path||"/";const s=l.host.indexOf(":")!==-1?"["+l.host+"]":l.host;return l.id=l.protocol+"://"+s+":"+l.port+n,l.href=l.protocol+"://"+s+(i&&i.port===l.port?"":":"+l.port),l}const _5=typeof ArrayBuffer=="function",C5=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Zv=Object.prototype.toString,T5=typeof Blob=="function"||typeof Blob<"u"&&Zv.call(Blob)==="[object BlobConstructor]",A5=typeof File=="function"||typeof File<"u"&&Zv.call(File)==="[object FileConstructor]";function kp(e){return _5&&(e instanceof ArrayBuffer||C5(e))||T5&&e instanceof Blob||A5&&e instanceof File}function Cu(e,n){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let i=0,l=e.length;i<l;i++)if(Cu(e[i]))return!0;return!1}if(kp(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Cu(e.toJSON(),!0);for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&Cu(e[i]))return!0;return!1}function M5(e){const n=[],i=e.data,l=e;return l.data=Uh(i,n),l.attachments=n.length,{packet:l,buffers:n}}function Uh(e,n){if(!e)return e;if(kp(e)){const i={_placeholder:!0,num:n.length};return n.push(e),i}else if(Array.isArray(e)){const i=new Array(e.length);for(let l=0;l<e.length;l++)i[l]=Uh(e[l],n);return i}else if(typeof e=="object"&&!(e instanceof Date)){const i={};for(const l in e)Object.prototype.hasOwnProperty.call(e,l)&&(i[l]=Uh(e[l],n));return i}return e}function z5(e,n){return e.data=Ih(e.data,n),delete e.attachments,e}function Ih(e,n){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<n.length)return n[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i]=Ih(e[i],n);else if(typeof e=="object")for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(e[i]=Ih(e[i],n));return e}const j5=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Ue;(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"})(Ue||(Ue={}));class D5{constructor(n){this.replacer=n}encode(n){return(n.type===Ue.EVENT||n.type===Ue.ACK)&&Cu(n)?this.encodeAsBinary({type:n.type===Ue.EVENT?Ue.BINARY_EVENT:Ue.BINARY_ACK,nsp:n.nsp,data:n.data,id:n.id}):[this.encodeAsString(n)]}encodeAsString(n){let i=""+n.type;return(n.type===Ue.BINARY_EVENT||n.type===Ue.BINARY_ACK)&&(i+=n.attachments+"-"),n.nsp&&n.nsp!=="/"&&(i+=n.nsp+","),n.id!=null&&(i+=n.id),n.data!=null&&(i+=JSON.stringify(n.data,this.replacer)),i}encodeAsBinary(n){const i=M5(n),l=this.encodeAsString(i.packet),o=i.buffers;return o.unshift(l),o}}class Ep extends vt{constructor(n){super(),this.reviver=n}add(n){let i;if(typeof n=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(n);const l=i.type===Ue.BINARY_EVENT;l||i.type===Ue.BINARY_ACK?(i.type=l?Ue.EVENT:Ue.ACK,this.reconstructor=new O5(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(kp(n)||n.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(n),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+n)}decodeString(n){let i=0;const l={type:Number(n.charAt(0))};if(Ue[l.type]===void 0)throw new Error("unknown packet type "+l.type);if(l.type===Ue.BINARY_EVENT||l.type===Ue.BINARY_ACK){const s=i+1;for(;n.charAt(++i)!=="-"&&i!=n.length;);const c=n.substring(s,i);if(c!=Number(c)||n.charAt(i)!=="-")throw new Error("Illegal attachments");l.attachments=Number(c)}if(n.charAt(i+1)==="/"){const s=i+1;for(;++i&&!(n.charAt(i)===","||i===n.length););l.nsp=n.substring(s,i)}else l.nsp="/";const o=n.charAt(i+1);if(o!==""&&Number(o)==o){const s=i+1;for(;++i;){const c=n.charAt(i);if(c==null||Number(c)!=c){--i;break}if(i===n.length)break}l.id=Number(n.substring(s,i+1))}if(n.charAt(++i)){const s=this.tryParse(n.substr(i));if(Ep.isPayloadValid(l.type,s))l.data=s;else throw new Error("invalid payload")}return l}tryParse(n){try{return JSON.parse(n,this.reviver)}catch{return!1}}static isPayloadValid(n,i){switch(n){case Ue.CONNECT:return Zx(i);case Ue.DISCONNECT:return i===void 0;case Ue.CONNECT_ERROR:return typeof i=="string"||Zx(i);case Ue.EVENT:case Ue.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&j5.indexOf(i[0])===-1);case Ue.ACK:case Ue.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class O5{constructor(n){this.packet=n,this.buffers=[],this.reconPack=n}takeBinaryData(n){if(this.buffers.push(n),this.buffers.length===this.reconPack.attachments){const i=z5(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Zx(e){return Object.prototype.toString.call(e)==="[object Object]"}const R5=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ep,Encoder:D5,get PacketType(){return Ue}},Symbol.toStringTag,{value:"Module"}));function zn(e,n,i){return e.on(n,i),function(){e.off(n,i)}}const L5=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Qv extends vt{constructor(n,i,l){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=n,this.nsp=i,l&&l.auth&&(this.auth=l.auth),this._opts=Object.assign({},l),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const n=this.io;this.subs=[zn(n,"open",this.onopen.bind(this)),zn(n,"packet",this.onpacket.bind(this)),zn(n,"error",this.onerror.bind(this)),zn(n,"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(...n){return n.unshift("message"),this.emit.apply(this,n),this}emit(n,...i){var l,o,s;if(L5.hasOwnProperty(n))throw new Error('"'+n.toString()+'" is a reserved event name');if(i.unshift(n),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;const c={type:Ue.EVENT,data:i};if(c.options={},c.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const g=this.ids++,m=i.pop();this._registerAckCallback(g,m),c.id=g}const f=(o=(l=this.io.engine)===null||l===void 0?void 0:l.transport)===null||o===void 0?void 0:o.writable,h=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!f||(h?(this.notifyOutgoingListeners(c),this.packet(c)):this.sendBuffer.push(c)),this.flags={},this}_registerAckCallback(n,i){var l;const o=(l=this.flags.timeout)!==null&&l!==void 0?l:this._opts.ackTimeout;if(o===void 0){this.acks[n]=i;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[n];for(let f=0;f<this.sendBuffer.length;f++)this.sendBuffer[f].id===n&&this.sendBuffer.splice(f,1);i.call(this,new Error("operation has timed out"))},o),c=(...f)=>{this.io.clearTimeoutFn(s),i.apply(this,f)};c.withError=!0,this.acks[n]=c}emitWithAck(n,...i){return new Promise((l,o)=>{const s=(c,f)=>c?o(c):l(f);s.withError=!0,i.push(s),this.emit(n,...i)})}_addToQueue(n){let i;typeof n[n.length-1]=="function"&&(i=n.pop());const l={id:this._queueSeq++,tryCount:0,pending:!1,args:n,flags:Object.assign({fromQueue:!0},this.flags)};n.push((o,...s)=>(this._queue[0],o!==null?l.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(o)):(this._queue.shift(),i&&i(null,...s)),l.pending=!1,this._drainQueue())),this._queue.push(l),this._drainQueue()}_drainQueue(n=!1){if(!this.connected||this._queue.length===0)return;const i=this._queue[0];i.pending&&!n||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(n){n.nsp=this.nsp,this.io._packet(n)}onopen(){typeof this.auth=="function"?this.auth(n=>{this._sendConnectPacket(n)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(n){this.packet({type:Ue.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},n):n})}onerror(n){this.connected||this.emitReserved("connect_error",n)}onclose(n,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",n,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(n=>{if(!this.sendBuffer.some(l=>String(l.id)===n)){const l=this.acks[n];delete this.acks[n],l.withError&&l.call(this,new Error("socket has been disconnected"))}})}onpacket(n){if(n.nsp===this.nsp)switch(n.type){case Ue.CONNECT:n.data&&n.data.sid?this.onconnect(n.data.sid,n.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 Ue.EVENT:case Ue.BINARY_EVENT:this.onevent(n);break;case Ue.ACK:case Ue.BINARY_ACK:this.onack(n);break;case Ue.DISCONNECT:this.ondisconnect();break;case Ue.CONNECT_ERROR:this.destroy();const l=new Error(n.data.message);l.data=n.data.data,this.emitReserved("connect_error",l);break}}onevent(n){const i=n.data||[];n.id!=null&&i.push(this.ack(n.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(n){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const l of i)l.apply(this,n)}super.emit.apply(this,n),this._pid&&n.length&&typeof n[n.length-1]=="string"&&(this._lastOffset=n[n.length-1])}ack(n){const i=this;let l=!1;return function(...o){l||(l=!0,i.packet({type:Ue.ACK,id:n,data:o}))}}onack(n){const i=this.acks[n.id];typeof i=="function"&&(delete this.acks[n.id],i.withError&&n.data.unshift(null),i.apply(this,n.data))}onconnect(n,i){this.id=n,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(n=>this.emitEvent(n)),this.receiveBuffer=[],this.sendBuffer.forEach(n=>{this.notifyOutgoingListeners(n),this.packet(n)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(n=>n()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ue.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(n){return this.flags.compress=n,this}get volatile(){return this.flags.volatile=!0,this}timeout(n){return this.flags.timeout=n,this}onAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(n),this}prependAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(n),this}offAny(n){if(!this._anyListeners)return this;if(n){const i=this._anyListeners;for(let l=0;l<i.length;l++)if(n===i[l])return i.splice(l,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(n),this}prependAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(n),this}offAnyOutgoing(n){if(!this._anyOutgoingListeners)return this;if(n){const i=this._anyOutgoingListeners;for(let l=0;l<i.length;l++)if(n===i[l])return i.splice(l,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(n){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const i=this._anyOutgoingListeners.slice();for(const l of i)l.apply(this,n.data)}}}function Fl(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}Fl.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),i=Math.floor(n*this.jitter*e);e=(Math.floor(n*10)&1)==0?e-i:e+i}return Math.min(e,this.max)|0};Fl.prototype.reset=function(){this.attempts=0};Fl.prototype.setMin=function(e){this.ms=e};Fl.prototype.setMax=function(e){this.max=e};Fl.prototype.setJitter=function(e){this.jitter=e};class qh extends vt{constructor(n,i){var l;super(),this.nsps={},this.subs=[],n&&typeof n=="object"&&(i=n,n=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,dc(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((l=i.randomizationFactor)!==null&&l!==void 0?l:.5),this.backoff=new Fl({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=n;const o=i.parser||R5;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(n){return arguments.length?(this._reconnection=!!n,n||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(n){return n===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=n,this)}reconnectionDelay(n){var i;return n===void 0?this._reconnectionDelay:(this._reconnectionDelay=n,(i=this.backoff)===null||i===void 0||i.setMin(n),this)}randomizationFactor(n){var i;return n===void 0?this._randomizationFactor:(this._randomizationFactor=n,(i=this.backoff)===null||i===void 0||i.setJitter(n),this)}reconnectionDelayMax(n){var i;return n===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=n,(i=this.backoff)===null||i===void 0||i.setMax(n),this)}timeout(n){return arguments.length?(this._timeout=n,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(n){if(~this._readyState.indexOf("open"))return this;this.engine=new E5(this.uri,this.opts);const i=this.engine,l=this;this._readyState="opening",this.skipReconnect=!1;const o=zn(i,"open",function(){l.onopen(),n&&n()}),s=f=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",f),n?n(f):this.maybeReconnectOnOpen()},c=zn(i,"error",s);if(this._timeout!==!1){const f=this._timeout,h=this.setTimeoutFn(()=>{o(),s(new Error("timeout")),i.close()},f);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(o),this.subs.push(c),this}connect(n){return this.open(n)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const n=this.engine;this.subs.push(zn(n,"ping",this.onping.bind(this)),zn(n,"data",this.ondata.bind(this)),zn(n,"error",this.onerror.bind(this)),zn(n,"close",this.onclose.bind(this)),zn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(n){try{this.decoder.add(n)}catch(i){this.onclose("parse error",i)}}ondecoded(n){fc(()=>{this.emitReserved("packet",n)},this.setTimeoutFn)}onerror(n){this.emitReserved("error",n)}socket(n,i){let l=this.nsps[n];return l?this._autoConnect&&!l.active&&l.connect():(l=new Qv(this,n,i),this.nsps[n]=l),l}_destroy(n){const i=Object.keys(this.nsps);for(const l of i)if(this.nsps[l].active)return;this._close()}_packet(n){const i=this.encoder.encode(n);for(let l=0;l<i.length;l++)this.engine.write(i[l],n.options)}cleanup(){this.subs.forEach(n=>n()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(n,i){var l;this.cleanup(),(l=this.engine)===null||l===void 0||l.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",n,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const n=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const i=this.backoff.duration();this._reconnecting=!0;const l=this.setTimeoutFn(()=>{n.skipReconnect||(this.emitReserved("reconnect_attempt",n.backoff.attempts),!n.skipReconnect&&n.open(o=>{o?(n._reconnecting=!1,n.reconnect(),this.emitReserved("reconnect_error",o)):n.onreconnect()}))},i);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}}onreconnect(){const n=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",n)}}const Ga={};function Tu(e,n){typeof e=="object"&&(n=e,e=void 0),n=n||{};const i=N5(e,n.path||"/socket.io"),l=i.source,o=i.id,s=i.path,c=Ga[o]&&s in Ga[o].nsps,f=n.forceNew||n["force new connection"]||n.multiplex===!1||c;let h;return f?h=new qh(l,n):(Ga[o]||(Ga[o]=new qh(l,n)),h=Ga[o]),i.query&&!n.query&&(n.query=i.queryKey),h.socket(i.path,n)}Object.assign(Tu,{Manager:qh,Socket:Qv,io:Tu,connect:Tu});const Qx=window.location.origin;class B5{socket;constructor(){this.socket=Tu(Qx,{autoConnect:!0,reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3}),this.socket.on("connect",()=>{console.log("[Socket] Connected to server:",Qx)}),this.socket.on("disconnect",()=>{console.log("Disconnected from server")}),this.socket.on("connect_error",n=>{console.error("Socket connection error:",n.message)})}on(n,i){this.socket.on(n,i)}off(n,i){i?this.socket.off(n,i):this.socket.off(n)}emit(n,i){this.socket.connected||console.warn("Socket not connected, queuing emit:",n),this.socket.emit(n,i)}executeWorkflow(n){this.emit("execute:workflow",n)}cancelExecution(){this.emit("execute:cancel")}generateSkill(n){console.log("[Socket] Generating skill:",n.prompt.slice(0,50),"connected:",this.socket.connected),this.emit("generate:skill",n)}isConnected(){return this.socket.connected}disconnect(){this.socket.disconnect()}connect(){this.socket.connected||this.socket.connect()}}const Nt=new B5;function Kv(){const{nodes:e,edges:n,workflowName:i,updateNodeStatus:l}=Pn(),{isRunning:o,startExecution:s,stopExecution:c,setCurrentNode:f,markNodeCompleted:h,markNodeFailed:d,setWorkflowResults:g,addLog:m,clearLogs:x}=Xl(),[v,S]=G.useState(null),E=G.useRef(null);G.useEffect(()=>{const N=T=>{const{nodeId:L,status:P,progress:Z,result:H,error:U}=T;P==="running"?(l(L,"running",Z||0),f(L)):P==="completed"?(l(L,"completed",100),h(L,H)):P==="error"&&(l(L,"error",0),d(L,U||"Unknown error"))},_=T=>{const L=T.type==="warn"?"warning":T.type==="debug"?"info":T.type;m(L,T.message,T.nodeId)},k=T=>{T.results&&g(T.results),T.outputDir&&S(T.outputDir),c(),m("success","워크플로우 실행 완료!")},A=T=>{c(),m("error",`실행 오류: ${T.error}`)},B=()=>{c(),m("warning","워크플로우 실행이 취소되었습니다.")};return Nt.on("node:update",N),Nt.on("console:log",_),Nt.on("workflow:completed",k),Nt.on("workflow:error",A),Nt.on("workflow:cancelled",B),()=>{Nt.off("node:update",N),Nt.off("console:log",_),Nt.off("workflow:completed",k),Nt.off("workflow:error",A),Nt.off("workflow:cancelled",B)}},[m,h,d,f,g,c,l]);const C=G.useCallback(()=>{if(e.length===0){m("warning","No nodes to execute");return}x(),s(),S(null);const N=`workflow-${Date.now()}`;E.current=N,m("info",`워크플로우 "${i}" 실행 시작 (Claude CLI)...`),Nt.executeWorkflow({workflowId:N,workflowName:i,nodes:e.map(_=>({id:_.id,type:_.type||"unknown",data:_.data})),edges:n.map(_=>({id:_.id,source:_.source,target:_.target}))})},[e,n,i,m,x,s]);return{isRunning:o,execute:C,savedOutputDir:v}}function H5(e,n,i,l="local"){const o=l==="global"?"~/.claude":".claude",s=U5(n,o),c=I5(n,o),f=q5(e,n,i,o),h=V5(n);return{skills:s,commands:f,agents:c,mcpSettings:h}}function U5(e,n){return e.filter(l=>l.type==="skill").filter(l=>l.data.skillType==="custom").map(l=>{const o=l.data,s=Gl(o.skillId||o.label),c=`${n}/skills/${s}/SKILL.md`,f=Y5(o);return{name:s,path:c,content:f}})}function I5(e,n){return e.filter(l=>l.type==="agent").map(l=>{const o=l.data,s=Gl(o.label),c=`${n}/agents/${s}.md`,f=$5(o);return{name:s,path:c,content:f}})}function q5(e,n,i,l){if(n.length===0)return[];const o=Gl(e),s=`${l}/commands/${o}.md`,c=X5(e,n,i);return[{name:o,path:s,content:c}]}function V5(e){return e.filter(i=>i.type==="hook").length===0,null}function Y5(e){if(e.skillContent)return e.skillContent;const n=Gl(e.skillId||e.label),i=e.description||e.label,l=["---",`name: ${n}`,`description: ${i}`,"---","",`# ${e.label}`,""];return e.mdContent?l.push(e.mdContent):l.push(`Execute the ${e.label} skill.`),l.join(`
|
|
16
|
+
`)}function $5(e){const n=Gl(e.label),i=e.description||e.label,l=e.tools.length>0?e.tools.join(", "):"Read, Write, Edit",o=e.model||"sonnet",s=["---",`name: ${n}`,`description: ${i}`,`tools: ${l}`,`model: ${o}`,"---",""];return e.systemPrompt?s.push(e.systemPrompt):e.mdContent?s.push(e.mdContent):(s.push(`# ${e.label}`),s.push(""),s.push(`This agent performs the ${e.role} role.`)),s.join(`
|
|
17
|
+
`)}function X5(e,n,i){const l=n.filter(g=>g.type==="input"),o=n.filter(g=>g.type==="output"),s=l.map(g=>`<${Gl(g.data.label)}>`).join(" "),f=["---",`description: ${`Workflow: ${e}`}`];s&&f.push(`argument-hint: ${s}`),f.push("---"),f.push(""),f.push(`# ${e}`),f.push(""),l.length>0&&(f.push("## Inputs"),f.push(""),l.forEach(g=>{const m=g.data;f.push(`- **${m.label}**: ${m.description||m.placeholder||"User input"}`)}),f.push("")),f.push("## Workflow Steps"),f.push("");const h=F5(n,i);let d=1;return h.forEach(g=>{if(g.type!=="input"){if(f.push(`${d}. **${g.data.label}**`),g.data.description&&f.push(` ${g.data.description}`),g.type==="agent"){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==="hook"){const m=g.data;f.push(` - Hook: ${m.hookEvent} (${m.hookMatcher||"*"})`)}f.push(""),d++}}),o.length>0&&(f.push("## Outputs"),f.push(""),o.forEach(g=>{const m=g.data;f.push(`- **${m.label}**: ${m.outputType} format`)})),f.join(`
|
|
18
|
+
`)}function Gl(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function F5(e,n){const i=new Map(e.map(f=>[f.id,f])),l=new Map,o=new Map;e.forEach(f=>{l.set(f.id,0),o.set(f.id,[])}),n.forEach(f=>{o.get(f.source)?.push(f.target),l.set(f.target,(l.get(f.target)||0)+1)});const s=[];l.forEach((f,h)=>{f===0&&s.push(h)});const c=[];for(;s.length>0;){const f=s.shift(),h=i.get(f);h&&c.push(h),o.get(f)?.forEach(d=>{const g=(l.get(d)||0)-1;l.set(d,g),g===0&&s.push(d)})}return c}async function Jv(){try{const e=await fetch("/api/load/claude-config");if(!e.ok)throw new Error(`Failed to load config: ${e.statusText}`);const n=await e.json();return G5(n)}catch(e){return console.error("Failed to load Claude config:",e),[]}}function G5(e){const n=[];let i=0;const l=280,o=150;for(const s of e.skills)n.push({id:s.id,type:"skill",position:{x:100+i,y:o},data:{label:s.label,description:s.description,status:"idle",skillType:"custom",skillId:s.skillId,skillPath:s.skillPath}}),i+=l;for(const s of e.agents)n.push({id:s.id,type:"agent",position:{x:100+i,y:o},data:{label:s.label,description:s.description,role:"custom",tools:s.tools,model:s.model,skills:s.skills,systemPrompt:s.systemPrompt,status:"idle",usedInputs:[]}}),i+=l;for(const s of e.hooks)n.push({id:s.id,type:"hook",position:{x:100+i,y:o},data:{label:s.label,description:s.description,hookEvent:s.hookEvent,hookMatcher:s.hookMatcher,hookCommand:s.hookCommand,status:"idle",usedInputs:[]}}),i+=l;return n}function Wv(e){var n,i,l="";if(typeof e=="string"||typeof e=="number")l+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(i=Wv(e[n]))&&(l&&(l+=" "),l+=i)}else for(i in e)e[i]&&(l&&(l+=" "),l+=i);return l}function It(){for(var e,n,i=0,l="",o=arguments.length;i<o;i++)(e=arguments[i])&&(n=Wv(e))&&(l&&(l+=" "),l+=n);return l}const ew="http://localhost:3001/api";async function P5(e,n){const i=await fetch(`${ew}/save/workflow`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:e,options:n})});if(!i.ok){const l=await i.json().catch(()=>({}));throw new Error(l.message||"Failed to save workflow")}return i.json()}async function Z5(){const e=await fetch(`${ew}/project-path`);if(!e.ok)throw new Error("Failed to get project path");return(await e.json()).path}async function Q5(e,n){const i=[];return n.includeSkills&&e.skills.forEach(l=>{i.push({path:l.path,content:l.content,type:"skill"})}),n.includeCommands&&e.commands.forEach(l=>{i.push({path:l.path,content:l.content,type:"command"})}),n.includeAgents&&e.agents.forEach(l=>{i.push({path:l.path,content:l.content,type:"agent"})}),n.includeMcpSettings&&e.mcpSettings&&i.push({path:n.location==="global"?"~/.claude/settings.local.json":".claude/settings.local.json",content:JSON.stringify(e.mcpSettings,null,2),type:"mcp"}),{files:i}}function K5({isOpen:e,onClose:n,config:i}){const[l,o]=G.useState("local"),[s,c]=G.useState(!0),[f,h]=G.useState(!0),[d,g]=G.useState(!0),[m,x]=G.useState(!0),[v,S]=G.useState(""),[E,C]=G.useState([]),[N,_]=G.useState(null),[k,A]=G.useState(!1),[B,T]=G.useState(null),[L,P]=G.useState(null);G.useEffect(()=>{e&&Z5().then(S).catch(()=>S("."))},[e]),G.useEffect(()=>{if(!e)return;Q5(i,{location:l,includeSkills:s,includeCommands:f,includeAgents:d,includeMcpSettings:m}).then(({files:ee})=>{C(ee),ee.length>0&&!N&&_(ee[0])})},[e,i,l,s,f,d,m]);const Z=async()=>{A(!0),P(null),T(null);const Y={location:l,includeSkills:s,includeCommands:f,includeAgents:d,includeMcpSettings:m};try{const ee=await P5(i,Y);T(ee),ee.success&&setTimeout(()=>n(),2e3)}catch(ee){P(ee instanceof Error?ee.message:"Failed to save")}finally{A(!1)}},H=Y=>{switch(Y){case"skill":return b.jsx(yo,{className:"w-4 h-4 text-node-skill"});case"agent":return b.jsx(RT,{className:"w-4 h-4 text-node-generate"});case"command":return b.jsx(sc,{className:"w-4 h-4 text-accent"});case"mcp":return b.jsx(Rv,{className:"w-4 h-4 text-node-mcp"});default:return b.jsx(yo,{className:"w-4 h-4 text-gray-400"})}},U=i.skills.length>0||i.commands.length>0||i.agents.length>0||i.mcpSettings;return e?b.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:b.jsxs("div",{className:"bg-surface border border-border rounded-xl shadow-2xl w-[900px] max-h-[80vh] flex flex-col",children:[b.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx(Dh,{className:"w-5 h-5 text-accent"}),b.jsx("h2",{className:"text-lg font-semibold text-white",children:"Export to Claude Code"})]}),b.jsx("button",{onClick:n,className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:b.jsx(bp,{className:"w-5 h-5 text-gray-400"})})]}),b.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[b.jsxs("div",{className:"w-64 border-r border-border p-4 space-y-6 overflow-y-auto",children:[b.jsxs("div",{children:[b.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Save Location"}),b.jsxs("div",{className:"space-y-2",children:[b.jsxs("button",{onClick:()=>o("local"),className:It("w-full flex items-center gap-3 px-3 py-2 rounded-lg border transition-colors text-left",l==="local"?"border-accent bg-accent/10 text-white":"border-border hover:border-gray-500 text-gray-400"),children:[b.jsx(Oh,{className:"w-4 h-4"}),b.jsxs("div",{children:[b.jsx("div",{className:"text-sm font-medium",children:"Local"}),b.jsx("div",{className:"text-xs text-gray-500",children:".claude/"})]})]}),b.jsxs("button",{onClick:()=>o("global"),className:It("w-full flex items-center gap-3 px-3 py-2 rounded-lg border transition-colors text-left",l==="global"?"border-accent bg-accent/10 text-white":"border-border hover:border-gray-500 text-gray-400"),children:[b.jsx(Oh,{className:"w-4 h-4"}),b.jsxs("div",{children:[b.jsx("div",{className:"text-sm font-medium",children:"Global"}),b.jsx("div",{className:"text-xs text-gray-500",children:"~/.claude/"})]})]})]})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Include Files"}),b.jsxs("div",{className:"space-y-2",children:[b.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[b.jsx("input",{type:"checkbox",checked:s,onChange:Y=>c(Y.target.checked),disabled:i.skills.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),b.jsxs("span",{className:It("text-sm",i.skills.length===0?"text-gray-600":"text-gray-300"),children:["Skills (",i.skills.length,")"]})]}),b.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[b.jsx("input",{type:"checkbox",checked:f,onChange:Y=>h(Y.target.checked),disabled:i.commands.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),b.jsxs("span",{className:It("text-sm",i.commands.length===0?"text-gray-600":"text-gray-300"),children:["Commands (",i.commands.length,")"]})]}),b.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[b.jsx("input",{type:"checkbox",checked:d,onChange:Y=>g(Y.target.checked),disabled:i.agents.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),b.jsxs("span",{className:It("text-sm",i.agents.length===0?"text-gray-600":"text-gray-300"),children:["Agents (",i.agents.length,")"]})]}),b.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[b.jsx("input",{type:"checkbox",checked:m,onChange:Y=>x(Y.target.checked),disabled:!i.mcpSettings,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),b.jsx("span",{className:It("text-sm",i.mcpSettings?"text-gray-300":"text-gray-600"),children:"MCP Settings"})]})]})]}),b.jsxs("div",{className:"pt-4 border-t border-border",children:[b.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Project Path"}),b.jsx("div",{className:"text-xs text-gray-400 font-mono truncate",title:v,children:v||"Loading..."})]})]}),b.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[b.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border overflow-x-auto",children:[E.map((Y,ee)=>b.jsxs("button",{onClick:()=>_(Y),className:It("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm whitespace-nowrap transition-colors",N===Y?"bg-surface-hover text-white":"text-gray-400 hover:text-white hover:bg-surface-hover/50"),children:[H(Y.type),b.jsx("span",{children:Y.path.split("/").pop()})]},ee)),E.length===0&&b.jsx("span",{className:"text-sm text-gray-500",children:"No files to export"})]}),b.jsx("div",{className:"flex-1 overflow-auto p-4",children:N?b.jsxs("div",{className:"space-y-2",children:[b.jsx("div",{className:"text-xs text-gray-500 font-mono",children:N.path}),b.jsx("pre",{className:"text-sm text-gray-300 font-mono bg-canvas p-4 rounded-lg overflow-auto max-h-[400px]",children:N.content})]}):b.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Select a file to preview"})})]})]}),b.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-border",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[B&&B.success&&b.jsxs("div",{className:"flex items-center gap-2 text-status-completed text-sm",children:[b.jsx(HT,{className:"w-4 h-4"}),b.jsx("span",{children:"Saved successfully!"})]}),B&&!B.success&&b.jsxs("div",{className:"flex items-center gap-2 text-status-error text-sm",children:[b.jsx(jh,{className:"w-4 h-4"}),b.jsx("span",{children:"Some files failed to save"})]}),L&&b.jsxs("div",{className:"flex items-center gap-2 text-status-error text-sm",children:[b.jsx(jh,{className:"w-4 h-4"}),b.jsx("span",{children:L})]})]}),b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-400 hover:text-white transition-colors",children:"Cancel"}),b.jsxs("button",{onClick:Z,disabled:k||E.length===0||!U,className:It("flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors",k||E.length===0||!U?"bg-gray-600 text-gray-400 cursor-not-allowed":"bg-accent hover:bg-accent-hover text-white"),children:[b.jsx(Dh,{className:"w-4 h-4"}),k?"Saving...":"Export"]})]})]})]})}):null}const Np=cc()(Lv(e=>({apiMode:"proxy",apiKey:"",proxyUrl:"https://makecc-proxy.vercel.app",setApiMode:n=>e({apiMode:n}),setApiKey:n=>e({apiKey:n}),setProxyUrl:n=>e({proxyUrl:n})}),{name:"makecc-settings"}));function J5({isOpen:e,onClose:n}){const{apiMode:i,apiKey:l,proxyUrl:o,setApiMode:s,setApiKey:c,setProxyUrl:f}=Np(),[h,d]=G.useState(i),[g,m]=G.useState(l),[x,v]=G.useState(o),[S,E]=G.useState(!1);if(G.useEffect(()=>{e&&(d(i),m(l),v(o))},[e,i,l,o]),!e)return null;const C=async()=>{if(s(h),c(g),f(x),h==="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(N){console.error("Failed to save API key:",N)}n()};return b.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:b.jsxs("div",{className:"bg-surface border border-border rounded-xl w-full max-w-md mx-4 shadow-2xl",children:[b.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[b.jsx("h2",{className:"text-lg font-semibold text-white",children:"설정"}),b.jsx("button",{onClick:n,className:"p-1 hover:bg-surface-hover rounded-lg transition-colors",children:b.jsx(bp,{className:"w-5 h-5 text-gray-400"})})]}),b.jsxs("div",{className:"p-6 space-y-6",children:[b.jsxs("div",{className:"space-y-3",children:[b.jsx("label",{className:"text-sm font-medium text-gray-300",children:"API 모드"}),b.jsxs("div",{className:"space-y-2",children:[b.jsxs("label",{className:`
|
|
19
|
+
flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-colors
|
|
20
|
+
${h==="proxy"?"border-accent bg-accent/10":"border-border hover:border-gray-600"}
|
|
21
|
+
`,children:[b.jsx("input",{type:"radio",name:"apiMode",value:"proxy",checked:h==="proxy",onChange:()=>d("proxy"),className:"sr-only"}),b.jsx(_A,{className:`w-5 h-5 ${h==="proxy"?"text-accent":"text-gray-400"}`}),b.jsxs("div",{className:"flex-1",children:[b.jsx("div",{className:`font-medium ${h==="proxy"?"text-white":"text-gray-300"}`,children:"프록시 서버"}),b.jsx("div",{className:"text-sm text-gray-500",children:"프록시 서버의 API 키를 사용합니다"})]}),h==="proxy"&&b.jsx("div",{className:"w-2 h-2 bg-accent rounded-full"})]}),b.jsxs("label",{className:`
|
|
22
|
+
flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-colors
|
|
23
|
+
${h==="direct"?"border-accent bg-accent/10":"border-border hover:border-gray-600"}
|
|
24
|
+
`,children:[b.jsx("input",{type:"radio",name:"apiMode",value:"direct",checked:h==="direct",onChange:()=>d("direct"),className:"sr-only"}),b.jsx(uA,{className:`w-5 h-5 ${h==="direct"?"text-accent":"text-gray-400"}`}),b.jsxs("div",{className:"flex-1",children:[b.jsx("div",{className:`font-medium ${h==="direct"?"text-white":"text-gray-300"}`,children:"직접 입력"}),b.jsx("div",{className:"text-sm text-gray-500",children:"나만의 API 키를 사용합니다"})]}),h==="direct"&&b.jsx("div",{className:"w-2 h-2 bg-accent rounded-full"})]})]})]}),h==="proxy"&&b.jsxs("div",{className:"space-y-2",children:[b.jsx("label",{className:"text-sm font-medium text-gray-300",children:"프록시 서버 URL"}),b.jsx("input",{type:"text",value:x,onChange:N=>v(N.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"}),b.jsx("p",{className:"text-xs text-gray-500",children:"서버에서 API 키를 관리하는 프록시 서버 주소"})]}),h==="direct"&&b.jsxs("div",{className:"space-y-2",children:[b.jsx("label",{className:"text-sm font-medium text-gray-300",children:"Anthropic API 키"}),b.jsxs("div",{className:"relative",children:[b.jsx("input",{type:S?"text":"password",value:g,onChange:N=>m(N.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"}),b.jsx("button",{type:"button",onClick:()=>E(!S),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-300",children:S?b.jsx(KT,{className:"w-4 h-4"}):b.jsx(Dv,{className:"w-4 h-4"})})]}),b.jsx("p",{className:"text-xs text-gray-500",children:"API 키는 브라우저에 안전하게 저장됩니다"})]})]}),b.jsxs("div",{className:"flex justify-end gap-3 px-6 py-4 border-t border-border",children:[b.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-400 hover:text-white transition-colors",children:"취소"}),b.jsx("button",{onClick:C,className:"px-4 py-2 text-sm font-medium bg-accent hover:bg-accent-hover text-white rounded-lg transition-colors",children:"저장"})]})]})})}function W5(){const{workflowName:e,setWorkflowName:n,isDraft:i,nodes:l,edges:o,clearWorkflow:s,mergeExistingConfig:c}=Pn(),{isRunning:f,execute:h}=Kv(),[d,g]=G.useState(!1),[m,x]=G.useState(!1),[v,S]=G.useState(null),[E,C]=G.useState(!1),N=G.useCallback(async()=>{C(!0);try{const T=await Jv();T.length>0&&c(T)}catch(T){console.error("Failed to reload config:",T)}finally{C(!1)}},[c]),_=()=>{const T=H5(e,l,o,"local");S(T),g(!0)},k=()=>{g(!1),S(null)},A=()=>{f||h()},B=()=>{l.length!==0&&window.confirm("모든 워크플로우를 삭제하시겠습니까?")&&s()};return b.jsxs("header",{className:"flex items-center justify-between px-4 py-3 bg-surface border-b border-border",children:[b.jsxs("div",{className:"flex items-center gap-4",children:[b.jsx("button",{className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:b.jsx(DT,{className:"w-5 h-5 text-gray-400"})}),b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("input",{type:"text",value:e,onChange:T=>n(T.target.value),className:"bg-transparent border-none text-lg font-semibold text-white focus:outline-none focus:ring-2 focus:ring-accent rounded px-2 py-1"}),i&&b.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-yellow-500/20 text-yellow-400 rounded",children:"Draft"})]})]}),b.jsx("div",{className:"text-sm font-medium text-gray-400",children:"Visual Workflow Builder"}),b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("span",{className:"text-sm text-gray-500",children:"Saved"}),b.jsxs("button",{onClick:A,disabled:f,className:`
|
|
25
|
+
flex items-center gap-2 px-4 py-2 rounded-lg font-medium transition-colors
|
|
26
|
+
${f?"bg-gray-500 cursor-not-allowed text-white":"bg-accent hover:bg-accent-hover text-white"}
|
|
27
|
+
`,children:[b.jsx(xo,{className:"w-4 h-4"}),f?"Running...":"Run"]}),b.jsxs("button",{onClick:_,className:"flex items-center gap-2 px-3 py-2 bg-surface-hover hover:bg-border rounded-lg transition-colors",children:[b.jsx(Dh,{className:"w-4 h-4 text-gray-400"}),b.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Export"})]}),b.jsxs("button",{onClick:N,disabled:E,className:`
|
|
28
|
+
flex items-center gap-2 px-3 py-2 rounded-lg transition-colors
|
|
29
|
+
${E?"bg-surface-hover cursor-not-allowed opacity-50":"bg-surface-hover hover:bg-blue-500/20 hover:text-blue-400"}
|
|
30
|
+
`,title:".claude/ 폴더에서 다시 로드",children:[b.jsx(vA,{className:`w-4 h-4 text-gray-400 ${E?"animate-spin":""}`}),b.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Reload"})]}),b.jsxs("button",{onClick:B,disabled:l.length===0,className:`
|
|
31
|
+
flex items-center gap-2 px-3 py-2 rounded-lg transition-colors
|
|
32
|
+
${l.length===0?"bg-surface-hover cursor-not-allowed opacity-50":"bg-surface-hover hover:bg-red-500/20 hover:text-red-400"}
|
|
33
|
+
`,title:"모든 노드 삭제",children:[b.jsx(bo,{className:"w-4 h-4 text-gray-400"}),b.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Clear"})]}),b.jsx("button",{className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:b.jsx(SA,{className:"w-5 h-5 text-gray-400"})}),b.jsx("button",{onClick:()=>x(!0),className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",title:"설정",children:b.jsx(Rv,{className:"w-5 h-5 text-gray-400"})})]}),v&&b.jsx(K5,{isOpen:d,onClose:k,config:v}),b.jsx(J5,{isOpen:m,onClose:()=>x(!1)})]})}function vo(e){const n={id:e.id,type:e.type,label:e.data.label,description:e.data.description};switch(e.type){case"skill":return{...n,skillId:e.data.skillId,skillPath:e.data.skillPath};case"agent":return{...n,tools:e.data.tools,model:e.data.model,skills:e.data.skills,systemPrompt:e.data.systemPrompt};case"hook":return{...n,hookEvent:e.data.hookEvent,hookMatcher:e.data.hookMatcher,hookCommand:e.data.hookCommand};default:return n}}async function tw(e){if(e.type==="input"||e.type==="output")return!0;try{const n=await fetch("/api/sync/node",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node:vo(e)})});return n.ok?!0:(console.error("Failed to sync node:",await n.text()),!1)}catch(n){return console.error("Failed to sync node:",n),!1}}async function nw(e,n){if(e.type==="input"||e.type==="output")return!0;try{const i=await fetch("/api/sync/node",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({node:vo(e),nodes:n.map(vo)})});return i.ok?!0:(console.error("Failed to delete node:",await i.text()),!1)}catch(i){return console.error("Failed to delete node:",i),!1}}async function Kx(e,n){const i=n.find(o=>o.id===e.source),l=n.find(o=>o.id===e.target);if(!i||!l||(i.type==="input"||i.type==="output")&&(l.type==="input"||l.type==="output"))return!0;try{const o=await fetch("/api/sync/edge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({edge:{source:e.source,target:e.target,sourceType:i.type,targetType:l.type},nodes:n.map(vo)})});return o.ok?!0:(console.error("Failed to sync edge:",await o.text()),!1)}catch(o){return console.error("Failed to sync edge:",o),!1}}async function eM(e,n){const i=n.find(o=>o.id===e.source),l=n.find(o=>o.id===e.target);if(!i||!l)return!0;try{const o=await fetch("/api/sync/edge",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({edge:{source:e.source,target:e.target,sourceType:i.type,targetType:l.type},nodes:n.map(vo)})});return o.ok?!0:(console.error("Failed to remove edge:",await o.text()),!1)}catch(o){return console.error("Failed to remove edge:",o),!1}}const tM=[{type:"input",label:"User Input",icon:b.jsx(oc,{className:"w-4 h-4"}),color:"text-yellow-400",hoverColor:"hover:bg-yellow-500/10"},{type:"agent",label:"Agent",icon:b.jsx(Mo,{className:"w-4 h-4"}),color:"text-purple-400",hoverColor:"hover:bg-purple-500/10"},{type:"skill",label:"Skill",icon:b.jsx(uc,{className:"w-4 h-4"}),color:"text-cyan-400",hoverColor:"hover:bg-cyan-500/10"},{type:"hook",label:"Hook",icon:b.jsx(yp,{className:"w-4 h-4"}),color:"text-pink-400",hoverColor:"hover:bg-pink-500/10"},{type:"output",label:"Output",icon:b.jsx(lc,{className:"w-4 h-4"}),color:"text-emerald-400",hoverColor:"hover:bg-emerald-500/10"}];function nM(e){const n=Yl(),i={x:100+Math.random()*200,y:100+Math.random()*200};switch(e){case"input":return{id:n,type:"input",position:i,data:{label:"User Input",description:"Enter your input here...",inputType:"text",status:"idle",placeholder:"Enter your prompt..."}};case"agent":return{id:n,type:"agent",position:i,data:{label:"Agent",description:"Conduct in-depth research...",role:"researcher",tools:["WebSearch","WebFetch","Read"],status:"idle",usedInputs:[]}};case"skill":return{id:n,type:"skill",position:i,data:{label:"Skill",description:"Apply a specialized skill...",skillType:"official",status:"idle",usedInputs:[]}};case"hook":return{id:n,type:"hook",position:i,data:{label:"Hook",description:"Configure tool lifecycle hook...",hookEvent:"PreToolUse",status:"idle",usedInputs:[]}};case"output":return{id:n,type:"output",position:i,data:{label:"Output",description:"Select to edit in editor",outputType:"auto",status:"idle",usedInputs:[]}}}}function iM(){const e=Pn(i=>i.addNode),n=i=>{const l=nM(i);e(l),tw(l).catch(o=>{console.error("Failed to sync node to filesystem:",o)})};return b.jsx("div",{className:"flex items-center justify-center gap-2 py-3 bg-canvas border-b border-border",children:tM.map(i=>b.jsxs("button",{onClick:()=>n(i.type),className:`
|
|
34
|
+
flex items-center gap-2 px-4 py-2 rounded-lg
|
|
35
|
+
bg-surface border border-border
|
|
36
|
+
${i.hoverColor}
|
|
37
|
+
transition-all duration-200
|
|
38
|
+
hover:border-gray-500
|
|
39
|
+
`,children:[b.jsx("span",{className:i.color,children:i.icon}),b.jsx("span",{className:"text-sm font-medium text-gray-300",children:i.label})]},i.type))})}function rM({status:e}){switch(e){case"running":return b.jsx(qu,{className:"w-4 h-4 animate-spin text-blue-400"});case"completed":return b.jsx(GT,{className:"w-4 h-4 text-green-400"});case"error":return b.jsx(jh,{className:"w-4 h-4 text-red-400"});default:return b.jsx(xo,{className:"w-4 h-4"})}}function lM({data:e,selected:n,children:i,headerIcon:l,headerColor:o="bg-gray-700",showSourceHandle:s=!0,showTargetHandle:c=!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 b.jsxs("div",{className:It("workflow-node",n&&"ring-2 ring-accent ring-offset-2 ring-offset-canvas",f()),children:[b.jsxs("div",{className:It("node-header flex items-center justify-between",o),children:[b.jsxs("div",{className:"flex items-center gap-2",children:[l,b.jsx("span",{className:"font-semibold text-sm text-white",children:e.label})]}),b.jsx("div",{className:"flex items-center gap-1",children:b.jsx(rM,{status:e.status})})]}),b.jsxs("div",{className:"node-content",children:[e.description&&b.jsx("p",{className:"text-sm text-gray-400 mb-3",children:e.description}),i,e.usedInputs&&e.usedInputs.length>0&&b.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-700/50",children:[b.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"Used in this step"}),b.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.usedInputs.map(h=>b.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:[b.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"}),h]},h))})]})]}),c&&b.jsx(Vl,{type:"target",position:ye.Left}),s&&b.jsx(Vl,{type:"source",position:ye.Right})]})}const zo=G.memo(lM);function aM({data:e,selected:n}){return b.jsx(zo,{data:e,selected:n,headerIcon:b.jsx(oc,{className:"w-4 h-4 text-amber-100"}),headerColor:"bg-gradient-to-br from-amber-500 to-orange-600",showTargetHandle:!1,showSourceHandle:!0,children:b.jsxs("div",{className:"text-gray-300",children:[e.inputType==="text"&&b.jsx("div",{className:"text-sm text-gray-400",children:e.value||e.placeholder||"Enter your input..."}),e.inputType==="file"&&b.jsx("div",{className:"text-sm text-gray-400",children:"Drop files here or click to upload"}),e.inputType==="select"&&e.options&&b.jsx("select",{className:"w-full px-2 py-1 text-sm bg-gray-700 border border-gray-600 rounded text-gray-300",children:e.options.map(i=>b.jsx("option",{value:i,children:i},i))})]})})}const oM=G.memo(aM);function sM({data:e,selected:n}){return b.jsx(zo,{data:e,selected:n,headerIcon:b.jsx(Mo,{className:"w-4 h-4 text-violet-100"}),headerColor:"bg-gradient-to-br from-violet-500 to-purple-700",showTargetHandle:!0,showSourceHandle:!0,children:b.jsxs("div",{className:"space-y-2",children:[e.tools&&e.tools.length>0&&b.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.tools.slice(0,3).map(i=>b.jsx("span",{className:"px-2 py-0.5 text-xs bg-purple-900/50 text-purple-300 rounded",children:i},i)),e.tools.length>3&&b.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&&b.jsxs("div",{className:"text-xs text-gray-500",children:["Model: ",e.model]})]})})}const uM=G.memo(sM);function cM({data:e,selected:n}){return b.jsx(zo,{data:e,selected:n,headerIcon:b.jsx(uc,{className:"w-4 h-4 text-cyan-100"}),headerColor:"bg-gradient-to-br from-cyan-500 to-cyan-700",showTargetHandle:!0,showSourceHandle:!0,children:b.jsxs("div",{className:"space-y-2",children:[e.skillType==="official"&&e.skillId&&b.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&&b.jsxs("div",{className:"text-xs text-gray-500",children:["Category: ",e.skillCategory]})]})})}const fM=G.memo(cM);function dM({data:e,selected:n}){return b.jsx(zo,{data:e,selected:n,headerIcon:b.jsx(yp,{className:"w-4 h-4 text-pink-100"}),headerColor:"bg-gradient-to-br from-pink-500 to-rose-700",showTargetHandle:!0,showSourceHandle:!0,children:b.jsxs("div",{className:"space-y-2",children:[e.hookEvent&&b.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&&b.jsx("div",{className:"text-xs text-gray-500 truncate",children:e.hookMatcher})]})})}const hM=G.memo(dM);function pM(e){switch(e){case"markdown":case"document":return b.jsx(yo,{className:"w-4 h-4 text-emerald-100"});case"image":return b.jsx(Ov,{className:"w-4 h-4 text-emerald-100"});case"webpage":return b.jsx(rA,{className:"w-4 h-4 text-emerald-100"});case"link":return b.jsx(fA,{className:"w-4 h-4 text-emerald-100"});default:return b.jsx(lc,{className:"w-4 h-4 text-emerald-100"})}}function mM({data:e,selected:n}){return b.jsx(zo,{data:e,selected:n,headerIcon:pM(e.outputType),headerColor:"bg-gradient-to-br from-emerald-500 to-green-700",showTargetHandle:!0,showSourceHandle:!1,children:b.jsxs("div",{className:"space-y-2",children:[e.layoutType&&b.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&&b.jsxs("div",{className:"text-xs text-gray-400 truncate max-w-[200px]",children:[e.result.substring(0,50),"..."]})]})})}const gM=G.memo(mM),hc=cc(e=>({activeTab:"preview",isCollapsed:!1,width:400,setActiveTab:n=>e({activeTab:n}),toggleCollapsed:()=>e(n=>({isCollapsed:!n.isCollapsed})),setWidth:n=>e({width:Math.max(300,Math.min(600,n))}),openStepPanel:()=>e({activeTab:"step",isCollapsed:!1}),openConsolePanel:()=>e({activeTab:"console",isCollapsed:!1})}));function Jx(e,n){const{source:i,target:l}=e;if(i===l)return!1;const o=n.find(c=>c.id===i),s=n.find(c=>c.id===l);return!o||!s?!1:o.type==="output"?(console.warn("Output nodes cannot have outgoing connections"),!1):s.type==="input"?(console.warn("Input nodes cannot have incoming connections"),!1):!0}const yM={input:oM,agent:uM,skill:fM,hook:hM,output:gM};function xM(){const{nodes:e,edges:n,setNodes:i,setEdges:l,addEdge:o,setSelectedNode:s}=Pn(),c=hc(A=>A.openStepPanel),[f,h]=G.useState(!1),d=G.useRef([]);G.useEffect(()=>{const A=T=>{T.key==="Shift"&&h(!0)},B=T=>{T.key==="Shift"&&(h(!1),d.current=[])};return window.addEventListener("keydown",A),window.addEventListener("keyup",B),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",B)}},[]);const g=G.useCallback(({nodes:A})=>{if(!f){d.current=[];return}const B=A.map(T=>T.id);if(B.length===2){const[T,L]=B;if(!n.some(Z=>Z.source===T&&Z.target===L||Z.source===L&&Z.target===T)){const Z=e.find(U=>U.id===T),H=e.find(U=>U.id===L);if(Z&&H){let U=T,Y=L;(Z.position?.x??0)>(H.position?.x??0)&&(U=L,Y=T);const ee={source:U,target:Y,sourceHandle:null,targetHandle:null};if(Jx(ee,e)){const R={id:`e-${U}-${Y}`,source:U,target:Y,animated:!0};l(_h({...ee,animated:!0},n)),o(R),Kx(R,e).catch(I=>{console.error("Failed to sync edge to filesystem:",I)})}}}}d.current=B},[f,e,n,l,o]),[m,x]=G.useState(null),v=G.useCallback(A=>{const B=A.filter(L=>L.type==="remove"),T=A.filter(L=>L.type!=="remove");if(T.length>0&&i(Eu(T,e)),B.length>0){const L=B.map(P=>e.find(Z=>Z.id===P.id)).filter(P=>P!==void 0&&P.type!=="input"&&P.type!=="output");L.length>0?x({changes:B,nodesToDelete:L}):i(Eu(B,e))}},[e,i]),S=G.useCallback(()=>{if(!m)return;const{changes:A,nodesToDelete:B}=m;for(const T of B)nw(T,e).catch(L=>{console.error("Failed to delete node from filesystem:",L)});i(Eu(A,e)),x(null)},[m,e,i]),E=G.useCallback(()=>{x(null)},[]),C=G.useCallback(A=>{for(const B of A)if(B.type==="remove"){const T=n.find(L=>L.id===B.id);T&&eM(T,e).catch(L=>{console.error("Failed to remove edge from filesystem:",L)})}l(nv(A,n))},[n,e,l]),N=G.useCallback(A=>{if(!Jx(A,e))return;const B={id:`e-${A.source}-${A.target}`,source:A.source,target:A.target,animated:!0};l(_h({...A,animated:!0},n)),o(B),Kx(B,e).catch(T=>{console.error("Failed to sync edge to filesystem:",T)})},[e,n,l,o]),_=G.useCallback((A,B)=>{s(B.id),c()},[s,c]),k=G.useCallback(()=>{s(null)},[s]);return b.jsxs(b.Fragment,{children:[b.jsxs(K3,{nodes:e,edges:n,onNodesChange:v,onEdgesChange:C,onConnect:N,onSelectionChange:g,onNodeClick:_,onPaneClick:k,nodeTypes:yM,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,selectionOnDrag:!1,multiSelectionKeyCode:"Shift",children:[b.jsx(nT,{variant:ki.Dots,gap:20,size:1,color:"#333333"}),b.jsx(uT,{}),b.jsx(ST,{nodeColor:A=>{switch(A.type){case"input":return"#fef3c7";case"agent":return"#4f46e5";case"skill":return"#06b6d4";case"hook":return"#ec4899";case"output":return"#10b981";default:return"#6b7280"}},maskColor:"rgba(0, 0, 0, 0.8)"})]}),m&&b.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:b.jsxs("div",{className:"bg-zinc-800 rounded-lg p-6 max-w-md w-full mx-4 border border-zinc-700 shadow-xl",children:[b.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[b.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500/20 flex items-center justify-center",children:b.jsx("svg",{className:"w-5 h-5 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:b.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),b.jsx("h3",{className:"text-lg font-semibold text-white",children:"노드 삭제 확인"})]}),b.jsxs("p",{className:"text-zinc-300 mb-4",children:["다음 노드를 삭제하시겠습니까? 이 작업은 ",b.jsx("span",{className:"text-red-400 font-medium",children:"파일을 삭제"}),"하며 되돌릴 수 없습니다."]}),b.jsx("ul",{className:"bg-zinc-900 rounded-md p-3 mb-6 space-y-2",children:m.nodesToDelete.map(A=>b.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[b.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${A.type==="skill"?"bg-cyan-500/20 text-cyan-300":A.type==="agent"?"bg-indigo-500/20 text-indigo-300":A.type==="hook"?"bg-pink-500/20 text-pink-300":"bg-zinc-500/20 text-zinc-300"}`,children:A.type}),b.jsx("span",{className:"text-white",children:A.data.label})]},A.id))}),b.jsxs("div",{className:"flex gap-3 justify-end",children:[b.jsx("button",{onClick:E,className:"px-4 py-2 rounded-md bg-zinc-700 text-zinc-300 hover:bg-zinc-600 transition-colors",children:"취소"}),b.jsx("button",{onClick:S,className:"px-4 py-2 rounded-md bg-red-600 text-white hover:bg-red-500 transition-colors",children:"삭제"})]})]})})]})}function bM(e,n){const i={};return(e[e.length-1]===""?[...e,""]:e).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const vM=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wM=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,SM={};function Wx(e,n){return(SM.jsx?wM:vM).test(e)}const kM=/[ \t\n\f\r]/g;function EM(e){return typeof e=="object"?e.type==="text"?e1(e.value):!1:e1(e)}function e1(e){return e.replace(kM,"")===""}class jo{constructor(n,i,l){this.normal=i,this.property=n,l&&(this.space=l)}}jo.prototype.normal={};jo.prototype.property={};jo.prototype.space=void 0;function iw(e,n){const i={},l={};for(const o of e)Object.assign(i,o.property),Object.assign(l,o.normal);return new jo(i,l,n)}function Vh(e){return e.toLowerCase()}class Wt{constructor(n,i){this.attribute=i,this.property=n}}Wt.prototype.attribute="";Wt.prototype.booleanish=!1;Wt.prototype.boolean=!1;Wt.prototype.commaOrSpaceSeparated=!1;Wt.prototype.commaSeparated=!1;Wt.prototype.defined=!1;Wt.prototype.mustUseProperty=!1;Wt.prototype.number=!1;Wt.prototype.overloadedBoolean=!1;Wt.prototype.property="";Wt.prototype.spaceSeparated=!1;Wt.prototype.space=void 0;let NM=0;const Ae=Ur(),bt=Ur(),Yh=Ur(),fe=Ur(),nt=Ur(),Ol=Ur(),cn=Ur();function Ur(){return 2**++NM}const $h=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ae,booleanish:bt,commaOrSpaceSeparated:cn,commaSeparated:Ol,number:fe,overloadedBoolean:Yh,spaceSeparated:nt},Symbol.toStringTag,{value:"Module"})),eh=Object.keys($h);class _p extends Wt{constructor(n,i,l,o){let s=-1;if(super(n,i),t1(this,"space",o),typeof l=="number")for(;++s<eh.length;){const c=eh[s];t1(this,eh[s],(l&$h[c])===$h[c])}}}_p.prototype.defined=!0;function t1(e,n,i){i&&(e[n]=i)}function Pl(e){const n={},i={};for(const[l,o]of Object.entries(e.properties)){const s=new _p(l,e.transform(e.attributes||{},l),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(l)&&(s.mustUseProperty=!0),n[l]=s,i[Vh(l)]=l,i[Vh(s.attribute)]=l}return new jo(n,i,e.space)}const rw=Pl({properties:{ariaActiveDescendant:null,ariaAtomic:bt,ariaAutoComplete:null,ariaBusy:bt,ariaChecked:bt,ariaColCount:fe,ariaColIndex:fe,ariaColSpan:fe,ariaControls:nt,ariaCurrent:null,ariaDescribedBy:nt,ariaDetails:null,ariaDisabled:bt,ariaDropEffect:nt,ariaErrorMessage:null,ariaExpanded:bt,ariaFlowTo:nt,ariaGrabbed:bt,ariaHasPopup:null,ariaHidden:bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nt,ariaLevel:fe,ariaLive:null,ariaModal:bt,ariaMultiLine:bt,ariaMultiSelectable:bt,ariaOrientation:null,ariaOwns:nt,ariaPlaceholder:null,ariaPosInSet:fe,ariaPressed:bt,ariaReadOnly:bt,ariaRelevant:null,ariaRequired:bt,ariaRoleDescription:nt,ariaRowCount:fe,ariaRowIndex:fe,ariaRowSpan:fe,ariaSelected:bt,ariaSetSize:fe,ariaSort:null,ariaValueMax:fe,ariaValueMin:fe,ariaValueNow:fe,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function lw(e,n){return n in e?e[n]:n}function aw(e,n){return lw(e,n.toLowerCase())}const _M=Pl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ol,acceptCharset:nt,accessKey:nt,action:null,allow:null,allowFullScreen:Ae,allowPaymentRequest:Ae,allowUserMedia:Ae,alt:null,as:null,async:Ae,autoCapitalize:null,autoComplete:nt,autoFocus:Ae,autoPlay:Ae,blocking:nt,capture:null,charSet:null,checked:Ae,cite:null,className:nt,cols:fe,colSpan:null,content:null,contentEditable:bt,controls:Ae,controlsList:nt,coords:fe|Ol,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ae,defer:Ae,dir:null,dirName:null,disabled:Ae,download:Yh,draggable:bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ae,formTarget:null,headers:nt,height:fe,hidden:Yh,high:fe,href:null,hrefLang:null,htmlFor:nt,httpEquiv:nt,id:null,imageSizes:null,imageSrcSet:null,inert:Ae,inputMode:null,integrity:null,is:null,isMap:Ae,itemId:null,itemProp:nt,itemRef:nt,itemScope:Ae,itemType:nt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ae,low:fe,manifest:null,max:null,maxLength:fe,media:null,method:null,min:null,minLength:fe,multiple:Ae,muted:Ae,name:null,nonce:null,noModule:Ae,noValidate:Ae,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:Ae,optimum:fe,pattern:null,ping:nt,placeholder:null,playsInline:Ae,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ae,referrerPolicy:null,rel:nt,required:Ae,reversed:Ae,rows:fe,rowSpan:fe,sandbox:nt,scope:null,scoped:Ae,seamless:Ae,selected:Ae,shadowRootClonable:Ae,shadowRootDelegatesFocus:Ae,shadowRootMode:null,shape:null,size:fe,sizes:null,slot:null,span:fe,spellCheck:bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:fe,step:null,style:null,tabIndex:fe,target:null,title:null,translate:null,type:null,typeMustMatch:Ae,useMap:null,value:bt,width:fe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nt,axis:null,background:null,bgColor:null,border:fe,borderColor:null,bottomMargin:fe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ae,declare:Ae,event:null,face:null,frame:null,frameBorder:null,hSpace:fe,leftMargin:fe,link:null,longDesc:null,lowSrc:null,marginHeight:fe,marginWidth:fe,noResize:Ae,noHref:Ae,noShade:Ae,noWrap:Ae,object:null,profile:null,prompt:null,rev:null,rightMargin:fe,rules:null,scheme:null,scrolling:bt,standby:null,summary:null,text:null,topMargin:fe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:fe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ae,disableRemotePlayback:Ae,prefix:null,property:null,results:fe,security:null,unselectable:null},space:"html",transform:aw}),CM=Pl({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:cn,accentHeight:fe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:fe,amplitude:fe,arabicForm:null,ascent:fe,attributeName:null,attributeType:null,azimuth:fe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:fe,by:null,calcMode:null,capHeight:fe,className:nt,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:fe,diffuseConstant:fe,direction:null,display:null,dur:null,divisor:fe,dominantBaseline:null,download:Ae,dx:null,dy:null,edgeMode:null,editable:null,elevation:fe,enableBackground:null,end:null,event:null,exponent:fe,externalResourcesRequired:null,fill:null,fillOpacity:fe,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:Ol,g2:Ol,glyphName:Ol,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:fe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:fe,horizOriginX:fe,horizOriginY:fe,id:null,ideographic:fe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:fe,k:fe,k1:fe,k2:fe,k3:fe,k4:fe,kernelMatrix:cn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:fe,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:fe,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:fe,overlineThickness:fe,paintOrder:null,panose1:null,path:null,pathLength:fe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:fe,pointsAtY:fe,pointsAtZ:fe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:cn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:cn,rev:cn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:cn,requiredFeatures:cn,requiredFonts:cn,requiredFormats:cn,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:fe,specularExponent:fe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:fe,strikethroughThickness:fe,string:null,stroke:null,strokeDashArray:cn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:fe,strokeOpacity:fe,strokeWidth:null,style:null,surfaceScale:fe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:cn,tabIndex:fe,tableValues:null,target:null,targetX:fe,targetY:fe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:cn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:fe,underlineThickness:fe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:fe,values:null,vAlphabetic:fe,vMathematical:fe,vectorEffect:null,vHanging:fe,vIdeographic:fe,version:null,vertAdvY:fe,vertOriginX:fe,vertOriginY:fe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:fe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:lw}),ow=Pl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),sw=Pl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:aw}),uw=Pl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),TM={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"},AM=/[A-Z]/g,n1=/-[a-z]/g,MM=/^data[-\w.:]+$/i;function zM(e,n){const i=Vh(n);let l=n,o=Wt;if(i in e.normal)return e.property[e.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&MM.test(n)){if(n.charAt(4)==="-"){const s=n.slice(5).replace(n1,DM);l="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=n.slice(4);if(!n1.test(s)){let c=s.replace(AM,jM);c.charAt(0)!=="-"&&(c="-"+c),n="data"+c}}o=_p}return new o(l,n)}function jM(e){return"-"+e.toLowerCase()}function DM(e){return e.charAt(1).toUpperCase()}const OM=iw([rw,_M,ow,sw,uw],"html"),Cp=iw([rw,CM,ow,sw,uw],"svg");function RM(e){return e.join(" ").trim()}var Cl={},th,i1;function LM(){if(i1)return th;i1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,i=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
|
|
40
|
+
`,d="/",g="*",m="",x="comment",v="declaration";function S(C,N){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];N=N||{};var _=1,k=1;function A(R){var I=R.match(n);I&&(_+=I.length);var D=R.lastIndexOf(h);k=~D?R.length-D:k+R.length}function B(){var R={line:_,column:k};return function(I){return I.position=new T(R),Z(),I}}function T(R){this.start=R,this.end={line:_,column:k},this.source=N.source}T.prototype.content=C;function L(R){var I=new Error(N.source+":"+_+":"+k+": "+R);if(I.reason=R,I.filename=N.source,I.line=_,I.column=k,I.source=C,!N.silent)throw I}function P(R){var I=R.exec(C);if(I){var D=I[0];return A(D),C=C.slice(D.length),I}}function Z(){P(i)}function H(R){var I;for(R=R||[];I=U();)I!==!1&&R.push(I);return R}function U(){var R=B();if(!(d!=C.charAt(0)||g!=C.charAt(1))){for(var I=2;m!=C.charAt(I)&&(g!=C.charAt(I)||d!=C.charAt(I+1));)++I;if(I+=2,m===C.charAt(I-1))return L("End of comment missing");var D=C.slice(2,I-2);return k+=2,A(D),C=C.slice(I),k+=2,R({type:x,comment:D})}}function Y(){var R=B(),I=P(l);if(I){if(U(),!P(o))return L("property missing ':'");var D=P(s),q=R({type:v,property:E(I[0].replace(e,m)),value:D?E(D[0].replace(e,m)):m});return P(c),q}}function ee(){var R=[];H(R);for(var I;I=Y();)I!==!1&&(R.push(I),H(R));return R}return Z(),ee()}function E(C){return C?C.replace(f,m):m}return th=S,th}var r1;function BM(){if(r1)return Cl;r1=1;var e=Cl&&Cl.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Cl,"__esModule",{value:!0}),Cl.default=i;const n=e(LM());function i(l,o){let s=null;if(!l||typeof l!="string")return s;const c=(0,n.default)(l),f=typeof o=="function";return c.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:g}=h;f?o(d,g,h):g&&(s=s||{},s[d]=g)}),s}return Cl}var Pa={},l1;function HM(){if(l1)return Pa;l1=1,Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,i=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(d){return!d||i.test(d)||e.test(d)},c=function(d,g){return g.toUpperCase()},f=function(d,g){return"".concat(g,"-")},h=function(d,g){return g===void 0&&(g={}),s(d)?d:(d=d.toLowerCase(),g.reactCompat?d=d.replace(o,f):d=d.replace(l,f),d.replace(n,c))};return Pa.camelCase=h,Pa}var Za,a1;function UM(){if(a1)return Za;a1=1;var e=Za&&Za.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},n=e(BM()),i=HM();function l(o,s){var c={};return!o||typeof o!="string"||(0,n.default)(o,function(f,h){f&&h&&(c[(0,i.camelCase)(f,s)]=h)}),c}return l.default=l,Za=l,Za}var IM=UM();const qM=Fu(IM),cw=fw("end"),Tp=fw("start");function fw(e){return n;function n(i){const l=i&&i.position&&i.position[e]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function VM(e){const n=Tp(e),i=cw(e);if(n&&i)return{start:n,end:i}}function ro(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?o1(e.position):"start"in e||"end"in e?o1(e):"line"in e||"column"in e?Xh(e):""}function Xh(e){return s1(e&&e.line)+":"+s1(e&&e.column)}function o1(e){return Xh(e&&e.start)+"-"+Xh(e&&e.end)}function s1(e){return e&&typeof e=="number"?e:1}class Bt extends Error{constructor(n,i,l){super(),typeof i=="string"&&(l=i,i=void 0);let o="",s={},c=!1;if(i&&("line"in i&&"column"in i?s={place:i}:"start"in i&&"end"in i?s={place:i}:"type"in i?s={ancestors:[i],place:i.position}:s={...i}),typeof n=="string"?o=n:!s.cause&&n&&(c=!0,o=n.message,s.cause=n),!s.ruleId&&!s.source&&typeof l=="string"){const h=l.indexOf(":");h===-1?s.ruleId=l:(s.source=l.slice(0,h),s.ruleId=l.slice(h+1))}if(!s.place&&s.ancestors&&s.ancestors){const h=s.ancestors[s.ancestors.length-1];h&&(s.place=h.position)}const f=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=f?f.line:void 0,this.name=ro(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=c&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Bt.prototype.file="";Bt.prototype.name="";Bt.prototype.reason="";Bt.prototype.message="";Bt.prototype.stack="";Bt.prototype.column=void 0;Bt.prototype.line=void 0;Bt.prototype.ancestors=void 0;Bt.prototype.cause=void 0;Bt.prototype.fatal=void 0;Bt.prototype.place=void 0;Bt.prototype.ruleId=void 0;Bt.prototype.source=void 0;const Ap={}.hasOwnProperty,YM=new Map,$M=/[A-Z]/g,XM=new Set(["table","tbody","thead","tfoot","tr"]),FM=new Set(["td","th"]),dw="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function GM(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=n.filePath||void 0;let l;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=tz(i,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=ez(i,n.jsx,n.jsxs)}const o={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:l,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Cp:OM,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},s=hw(o,e,void 0);return s&&typeof s!="string"?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}function hw(e,n,i){if(n.type==="element")return PM(e,n,i);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return ZM(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return KM(e,n,i);if(n.type==="mdxjsEsm")return QM(e,n);if(n.type==="root")return JM(e,n,i);if(n.type==="text")return WM(e,n)}function PM(e,n,i){const l=e.schema;let o=l;n.tagName.toLowerCase()==="svg"&&l.space==="html"&&(o=Cp,e.schema=o),e.ancestors.push(n);const s=mw(e,n.tagName,!1),c=nz(e,n);let f=zp(e,n);return XM.has(n.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!EM(h):!0})),pw(e,c,s,n),Mp(c,f),e.ancestors.pop(),e.schema=l,e.create(n,s,c,i)}function ZM(e,n){if(n.data&&n.data.estree&&e.evaluater){const l=n.data.estree.body[0];return l.type,e.evaluater.evaluateExpression(l.expression)}wo(e,n.position)}function QM(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);wo(e,n.position)}function KM(e,n,i){const l=e.schema;let o=l;n.name==="svg"&&l.space==="html"&&(o=Cp,e.schema=o),e.ancestors.push(n);const s=n.name===null?e.Fragment:mw(e,n.name,!0),c=iz(e,n),f=zp(e,n);return pw(e,c,s,n),Mp(c,f),e.ancestors.pop(),e.schema=l,e.create(n,s,c,i)}function JM(e,n,i){const l={};return Mp(l,zp(e,n)),e.create(n,e.Fragment,l,i)}function WM(e,n){return n.value}function pw(e,n,i,l){typeof i!="string"&&i!==e.Fragment&&e.passNode&&(n.node=l)}function Mp(e,n){if(n.length>0){const i=n.length>1?n:n[0];i&&(e.children=i)}}function ez(e,n,i){return l;function l(o,s,c,f){const d=Array.isArray(c.children)?i:n;return f?d(s,c,f):d(s,c)}}function tz(e,n){return i;function i(l,o,s,c){const f=Array.isArray(s.children),h=Tp(l);return n(o,s,c,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function nz(e,n){const i={};let l,o;for(o in n.properties)if(o!=="children"&&Ap.call(n.properties,o)){const s=rz(e,o,n.properties[o]);if(s){const[c,f]=s;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&FM.has(n.tagName)?l=f:i[c]=f}}if(l){const s=i.style||(i.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return i}function iz(e,n){const i={};for(const l of n.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&e.evaluater){const s=l.data.estree.body[0];s.type;const c=s.expression;c.type;const f=c.properties[0];f.type,Object.assign(i,e.evaluater.evaluateExpression(f.argument))}else wo(e,n.position);else{const o=l.name;let s;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&e.evaluater){const f=l.value.data.estree.body[0];f.type,s=e.evaluater.evaluateExpression(f.expression)}else wo(e,n.position);else s=l.value===null?!0:l.value;i[o]=s}return i}function zp(e,n){const i=[];let l=-1;const o=e.passKeys?new Map:YM;for(;++l<n.children.length;){const s=n.children[l];let c;if(e.passKeys){const h=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(h){const d=o.get(h)||0;c=h+"-"+d,o.set(h,d+1)}}const f=hw(e,s,c);f!==void 0&&i.push(f)}return i}function rz(e,n,i){const l=zM(e.schema,n);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=l.commaSeparated?bM(i):RM(i)),l.property==="style"){let o=typeof i=="object"?i:lz(e,String(i));return e.stylePropertyNameCase==="css"&&(o=az(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&l.space?TM[l.property]||l.property:l.attribute,i]}}function lz(e,n){try{return qM(n,{reactCompat:!0})}catch(i){if(e.ignoreInvalidStyle)return{};const l=i,o=new Bt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=dw+"#cannot-parse-style-attribute",o}}function mw(e,n,i){let l;if(!i)l={type:"Literal",value:n};else if(n.includes(".")){const o=n.split(".");let s=-1,c;for(;++s<o.length;){const f=Wx(o[s])?{type:"Identifier",name:o[s]}:{type:"Literal",value:o[s]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(s&&f.type==="Literal"),optional:!1}:f}l=c}else l=Wx(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(l.type==="Literal"){const o=l.value;return Ap.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(l);wo(e)}function wo(e,n){const i=new Bt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=dw+"#cannot-handle-mdx-estrees-without-createevaluater",i}function az(e){const n={};let i;for(i in e)Ap.call(e,i)&&(n[oz(i)]=e[i]);return n}function oz(e){let n=e.replace($M,sz);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function sz(e){return"-"+e.toLowerCase()}const nh={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"]},uz={};function jp(e,n){const i=uz,l=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,o=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return gw(e,l,o)}function gw(e,n,i){if(cz(e)){if("value"in e)return e.type==="html"&&!i?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return u1(e.children,n,i)}return Array.isArray(e)?u1(e,n,i):""}function u1(e,n,i){const l=[];let o=-1;for(;++o<e.length;)l[o]=gw(e[o],n,i);return l.join("")}function cz(e){return!!(e&&typeof e=="object")}const c1=document.createElement("i");function Dp(e){const n="&"+e+";";c1.innerHTML=n;const i=c1.textContent;return i.charCodeAt(i.length-1)===59&&e!=="semi"||i===n?!1:i}function dn(e,n,i,l){const o=e.length;let s=0,c;if(n<0?n=-n>o?0:o+n:n=n>o?o:n,i=i>0?i:0,l.length<1e4)c=Array.from(l),c.unshift(n,i),e.splice(...c);else for(i&&e.splice(n,i);s<l.length;)c=l.slice(s,s+1e4),c.unshift(n,0),e.splice(...c),s+=1e4,n+=1e4}function kn(e,n){return e.length>0?(dn(e,e.length,0,n),e):n}const f1={}.hasOwnProperty;function yw(e){const n={};let i=-1;for(;++i<e.length;)fz(n,e[i]);return n}function fz(e,n){let i;for(i in n){const o=(f1.call(e,i)?e[i]:void 0)||(e[i]={}),s=n[i];let c;if(s)for(c in s){f1.call(o,c)||(o[c]=[]);const f=s[c];dz(o[c],Array.isArray(f)?f:f?[f]:[])}}}function dz(e,n){let i=-1;const l=[];for(;++i<n.length;)(n[i].add==="after"?e:l).push(n[i]);dn(e,0,0,l)}function xw(e,n){const i=Number.parseInt(e,n);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function Rn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const qt=or(/[A-Za-z]/),Lt=or(/[\dA-Za-z]/),hz=or(/[#-'*+\--9=?A-Z^-~]/);function Vu(e){return e!==null&&(e<32||e===127)}const Fh=or(/\d/),pz=or(/[\dA-Fa-f]/),mz=or(/[!-/:-@[-`{-~]/);function ve(e){return e!==null&&e<-2}function tt(e){return e!==null&&(e<0||e===32)}function Re(e){return e===-2||e===-1||e===32}const pc=or(new RegExp("\\p{P}|\\p{S}","u")),Hr=or(/\s/);function or(e){return n;function n(i){return i!==null&&i>-1&&e.test(String.fromCharCode(i))}}function Zl(e){const n=[];let i=-1,l=0,o=0;for(;++i<e.length;){const s=e.charCodeAt(i);let c="";if(s===37&&Lt(e.charCodeAt(i+1))&&Lt(e.charCodeAt(i+2)))o=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(c=String.fromCharCode(s));else if(s>55295&&s<57344){const f=e.charCodeAt(i+1);s<56320&&f>56319&&f<57344?(c=String.fromCharCode(s,f),o=1):c="�"}else c=String.fromCharCode(s);c&&(n.push(e.slice(l,i),encodeURIComponent(c)),l=i+o+1,c=""),o&&(i+=o,o=0)}return n.join("")+e.slice(l)}function qe(e,n,i,l){const o=l?l-1:Number.POSITIVE_INFINITY;let s=0;return c;function c(h){return Re(h)?(e.enter(i),f(h)):n(h)}function f(h){return Re(h)&&s++<o?(e.consume(h),f):(e.exit(i),n(h))}}const gz={tokenize:yz};function yz(e){const n=e.attempt(this.parser.constructs.contentInitial,l,o);let i;return n;function l(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),qe(e,n,"linePrefix")}function o(f){return e.enter("paragraph"),s(f)}function s(f){const h=e.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=h),i=h,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return ve(f)?(e.consume(f),e.exit("chunkText"),s):(e.consume(f),c)}}const xz={tokenize:bz},d1={tokenize:vz};function bz(e){const n=this,i=[];let l=0,o,s,c;return f;function f(k){if(l<i.length){const A=i[l];return n.containerState=A[1],e.attempt(A[0].continuation,h,d)(k)}return d(k)}function h(k){if(l++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,o&&_();const A=n.events.length;let B=A,T;for(;B--;)if(n.events[B][0]==="exit"&&n.events[B][1].type==="chunkFlow"){T=n.events[B][1].end;break}N(l);let L=A;for(;L<n.events.length;)n.events[L][1].end={...T},L++;return dn(n.events,B+1,0,n.events.slice(A)),n.events.length=L,d(k)}return f(k)}function d(k){if(l===i.length){if(!o)return x(k);if(o.currentConstruct&&o.currentConstruct.concrete)return S(k);n.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(d1,g,m)(k)}function g(k){return o&&_(),N(l),x(k)}function m(k){return n.parser.lazy[n.now().line]=l!==i.length,c=n.now().offset,S(k)}function x(k){return n.containerState={},e.attempt(d1,v,S)(k)}function v(k){return l++,i.push([n.currentConstruct,n.containerState]),x(k)}function S(k){if(k===null){o&&_(),N(0),e.consume(k);return}return o=o||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:s}),E(k)}function E(k){if(k===null){C(e.exit("chunkFlow"),!0),N(0),e.consume(k);return}return ve(k)?(e.consume(k),C(e.exit("chunkFlow")),l=0,n.interrupt=void 0,f):(e.consume(k),E)}function C(k,A){const B=n.sliceStream(k);if(A&&B.push(null),k.previous=s,s&&(s.next=k),s=k,o.defineSkip(k.start),o.write(B),n.parser.lazy[k.start.line]){let T=o.events.length;for(;T--;)if(o.events[T][1].start.offset<c&&(!o.events[T][1].end||o.events[T][1].end.offset>c))return;const L=n.events.length;let P=L,Z,H;for(;P--;)if(n.events[P][0]==="exit"&&n.events[P][1].type==="chunkFlow"){if(Z){H=n.events[P][1].end;break}Z=!0}for(N(l),T=L;T<n.events.length;)n.events[T][1].end={...H},T++;dn(n.events,P+1,0,n.events.slice(L)),n.events.length=T}}function N(k){let A=i.length;for(;A-- >k;){const B=i[A];n.containerState=B[1],B[0].exit.call(n,e)}i.length=k}function _(){o.write([null]),s=void 0,o=void 0,n.containerState._closeFlow=void 0}}function vz(e,n,i){return qe(e,e.attempt(this.parser.constructs.document,n,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function $l(e){if(e===null||tt(e)||Hr(e))return 1;if(pc(e))return 2}function mc(e,n,i){const l=[];let o=-1;for(;++o<e.length;){const s=e[o].resolveAll;s&&!l.includes(s)&&(n=s(n,i),l.push(s))}return n}const Gh={name:"attention",resolveAll:wz,tokenize:Sz};function wz(e,n){let i=-1,l,o,s,c,f,h,d,g;for(;++i<e.length;)if(e[i][0]==="enter"&&e[i][1].type==="attentionSequence"&&e[i][1]._close){for(l=i;l--;)if(e[l][0]==="exit"&&e[l][1].type==="attentionSequence"&&e[l][1]._open&&n.sliceSerialize(e[l][1]).charCodeAt(0)===n.sliceSerialize(e[i][1]).charCodeAt(0)){if((e[l][1]._close||e[i][1]._open)&&(e[i][1].end.offset-e[i][1].start.offset)%3&&!((e[l][1].end.offset-e[l][1].start.offset+e[i][1].end.offset-e[i][1].start.offset)%3))continue;h=e[l][1].end.offset-e[l][1].start.offset>1&&e[i][1].end.offset-e[i][1].start.offset>1?2:1;const m={...e[l][1].end},x={...e[i][1].start};h1(m,-h),h1(x,h),c={type:h>1?"strongSequence":"emphasisSequence",start:m,end:{...e[l][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[i][1].start},end:x},s={type:h>1?"strongText":"emphasisText",start:{...e[l][1].end},end:{...e[i][1].start}},o={type:h>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[l][1].end={...c.start},e[i][1].start={...f.end},d=[],e[l][1].end.offset-e[l][1].start.offset&&(d=kn(d,[["enter",e[l][1],n],["exit",e[l][1],n]])),d=kn(d,[["enter",o,n],["enter",c,n],["exit",c,n],["enter",s,n]]),d=kn(d,mc(n.parser.constructs.insideSpan.null,e.slice(l+1,i),n)),d=kn(d,[["exit",s,n],["enter",f,n],["exit",f,n],["exit",o,n]]),e[i][1].end.offset-e[i][1].start.offset?(g=2,d=kn(d,[["enter",e[i][1],n],["exit",e[i][1],n]])):g=0,dn(e,l-1,i-l+3,d),i=l+d.length-g-2;break}}for(i=-1;++i<e.length;)e[i][1].type==="attentionSequence"&&(e[i][1].type="data");return e}function Sz(e,n){const i=this.parser.constructs.attentionMarkers.null,l=this.previous,o=$l(l);let s;return c;function c(h){return s=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===s)return e.consume(h),f;const d=e.exit("attentionSequence"),g=$l(h),m=!g||g===2&&o||i.includes(h),x=!o||o===2&&g||i.includes(l);return d._open=!!(s===42?m:m&&(o||!x)),d._close=!!(s===42?x:x&&(g||!m)),n(h)}}function h1(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const kz={name:"autolink",tokenize:Ez};function Ez(e,n,i){let l=0;return o;function o(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(v){return qt(v)?(e.consume(v),c):v===64?i(v):d(v)}function c(v){return v===43||v===45||v===46||Lt(v)?(l=1,f(v)):d(v)}function f(v){return v===58?(e.consume(v),l=0,h):(v===43||v===45||v===46||Lt(v))&&l++<32?(e.consume(v),f):(l=0,d(v))}function h(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),n):v===null||v===32||v===60||Vu(v)?i(v):(e.consume(v),h)}function d(v){return v===64?(e.consume(v),g):hz(v)?(e.consume(v),d):i(v)}function g(v){return Lt(v)?m(v):i(v)}function m(v){return v===46?(e.consume(v),l=0,g):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),n):x(v)}function x(v){if((v===45||Lt(v))&&l++<63){const S=v===45?x:m;return e.consume(v),S}return i(v)}}const Do={partial:!0,tokenize:Nz};function Nz(e,n,i){return l;function l(s){return Re(s)?qe(e,o,"linePrefix")(s):o(s)}function o(s){return s===null||ve(s)?n(s):i(s)}}const bw={continuation:{tokenize:Cz},exit:Tz,name:"blockQuote",tokenize:_z};function _z(e,n,i){const l=this;return o;function o(c){if(c===62){const f=l.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),s}return i(c)}function s(c){return Re(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(c))}}function Cz(e,n,i){const l=this;return o;function o(c){return Re(c)?qe(e,s,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):s(c)}function s(c){return e.attempt(bw,n,i)(c)}}function Tz(e){e.exit("blockQuote")}const vw={name:"characterEscape",tokenize:Az};function Az(e,n,i){return l;function l(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),o}function o(s){return mz(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):i(s)}}const ww={name:"characterReference",tokenize:Mz};function Mz(e,n,i){const l=this;let o=0,s,c;return f;function f(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),h}function h(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),s=31,c=Lt,g(m))}function d(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,c=pz,g):(e.enter("characterReferenceValue"),s=7,c=Fh,g(m))}function g(m){if(m===59&&o){const x=e.exit("characterReferenceValue");return c===Lt&&!Dp(l.sliceSerialize(x))?i(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return c(m)&&o++<s?(e.consume(m),g):i(m)}}const p1={partial:!0,tokenize:jz},m1={concrete:!0,name:"codeFenced",tokenize:zz};function zz(e,n,i){const l=this,o={partial:!0,tokenize:B};let s=0,c=0,f;return h;function h(T){return d(T)}function d(T){const L=l.events[l.events.length-1];return s=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,f=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(T)}function g(T){return T===f?(c++,e.consume(T),g):c<3?i(T):(e.exit("codeFencedFenceSequence"),Re(T)?qe(e,m,"whitespace")(T):m(T))}function m(T){return T===null||ve(T)?(e.exit("codeFencedFence"),l.interrupt?n(T):e.check(p1,E,A)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(T))}function x(T){return T===null||ve(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(T)):Re(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),qe(e,v,"whitespace")(T)):T===96&&T===f?i(T):(e.consume(T),x)}function v(T){return T===null||ve(T)?m(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(T))}function S(T){return T===null||ve(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(T)):T===96&&T===f?i(T):(e.consume(T),S)}function E(T){return e.attempt(o,A,C)(T)}function C(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),N}function N(T){return s>0&&Re(T)?qe(e,_,"linePrefix",s+1)(T):_(T)}function _(T){return T===null||ve(T)?e.check(p1,E,A)(T):(e.enter("codeFlowValue"),k(T))}function k(T){return T===null||ve(T)?(e.exit("codeFlowValue"),_(T)):(e.consume(T),k)}function A(T){return e.exit("codeFenced"),n(T)}function B(T,L,P){let Z=0;return H;function H(I){return T.enter("lineEnding"),T.consume(I),T.exit("lineEnding"),U}function U(I){return T.enter("codeFencedFence"),Re(I)?qe(T,Y,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):Y(I)}function Y(I){return I===f?(T.enter("codeFencedFenceSequence"),ee(I)):P(I)}function ee(I){return I===f?(Z++,T.consume(I),ee):Z>=c?(T.exit("codeFencedFenceSequence"),Re(I)?qe(T,R,"whitespace")(I):R(I)):P(I)}function R(I){return I===null||ve(I)?(T.exit("codeFencedFence"),L(I)):P(I)}}}function jz(e,n,i){const l=this;return o;function o(c){return c===null?i(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s)}function s(c){return l.parser.lazy[l.now().line]?i(c):n(c)}}const ih={name:"codeIndented",tokenize:Oz},Dz={partial:!0,tokenize:Rz};function Oz(e,n,i){const l=this;return o;function o(d){return e.enter("codeIndented"),qe(e,s,"linePrefix",5)(d)}function s(d){const g=l.events[l.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?c(d):i(d)}function c(d){return d===null?h(d):ve(d)?e.attempt(Dz,c,h)(d):(e.enter("codeFlowValue"),f(d))}function f(d){return d===null||ve(d)?(e.exit("codeFlowValue"),c(d)):(e.consume(d),f)}function h(d){return e.exit("codeIndented"),n(d)}}function Rz(e,n,i){const l=this;return o;function o(c){return l.parser.lazy[l.now().line]?i(c):ve(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):qe(e,s,"linePrefix",5)(c)}function s(c){const f=l.events[l.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(c):ve(c)?o(c):i(c)}}const Lz={name:"codeText",previous:Hz,resolve:Bz,tokenize:Uz};function Bz(e){let n=e.length-4,i=3,l,o;if((e[i][1].type==="lineEnding"||e[i][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(l=i;++l<n;)if(e[l][1].type==="codeTextData"){e[i][1].type="codeTextPadding",e[n][1].type="codeTextPadding",i+=2,n-=2;break}}for(l=i-1,n++;++l<=n;)o===void 0?l!==n&&e[l][1].type!=="lineEnding"&&(o=l):(l===n||e[l][1].type==="lineEnding")&&(e[o][1].type="codeTextData",l!==o+2&&(e[o][1].end=e[l-1][1].end,e.splice(o+2,l-o-2),n-=l-o-2,l=o+2),o=void 0);return e}function Hz(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Uz(e,n,i){let l=0,o,s;return c;function c(m){return e.enter("codeText"),e.enter("codeTextSequence"),f(m)}function f(m){return m===96?(e.consume(m),l++,f):(e.exit("codeTextSequence"),h(m))}function h(m){return m===null?i(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),h):m===96?(s=e.enter("codeTextSequence"),o=0,g(m)):ve(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||ve(m)?(e.exit("codeTextData"),h(m)):(e.consume(m),d)}function g(m){return m===96?(e.consume(m),o++,g):o===l?(e.exit("codeTextSequence"),e.exit("codeText"),n(m)):(s.type="codeTextData",d(m))}}class Iz{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,i){const l=i??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(n,l):n>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(n,i,l){const o=i||0;this.setCursor(Math.trunc(n));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return l&&Qa(this.left,l),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Qa(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Qa(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const i=this.left.splice(n,Number.POSITIVE_INFINITY);Qa(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Qa(this.left,i.reverse())}}}function Qa(e,n){let i=0;if(n.length<1e4)e.push(...n);else for(;i<n.length;)e.push(...n.slice(i,i+1e4)),i+=1e4}function Sw(e){const n={};let i=-1,l,o,s,c,f,h,d;const g=new Iz(e);for(;++i<g.length;){for(;i in n;)i=n[i];if(l=g.get(i),i&&l[1].type==="chunkFlow"&&g.get(i-1)[1].type==="listItemPrefix"&&(h=l[1]._tokenizer.events,s=0,s<h.length&&h[s][1].type==="lineEndingBlank"&&(s+=2),s<h.length&&h[s][1].type==="content"))for(;++s<h.length&&h[s][1].type!=="content";)h[s][1].type==="chunkText"&&(h[s][1]._isInFirstContentOfListItem=!0,s++);if(l[0]==="enter")l[1].contentType&&(Object.assign(n,qz(g,i)),i=n[i],d=!0);else if(l[1]._container){for(s=i,o=void 0;s--;)if(c=g.get(s),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(o&&(g.get(o)[1].type="lineEndingBlank"),c[1].type="lineEnding",o=s);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;o&&(l[1].end={...g.get(o)[1].start},f=g.slice(o,i),f.unshift(l),g.splice(o,i-o+1,f))}}return dn(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!d}function qz(e,n){const i=e.get(n)[1],l=e.get(n)[2];let o=n-1;const s=[];let c=i._tokenizer;c||(c=l.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,h=[],d={};let g,m,x=-1,v=i,S=0,E=0;const C=[E];for(;v;){for(;e.get(++o)[1]!==v;);s.push(o),v._tokenizer||(g=l.sliceStream(v),v.next||g.push(null),m&&c.defineSkip(v.start),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(g),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=i;++x<f.length;)f[x][0]==="exit"&&f[x-1][0]==="enter"&&f[x][1].type===f[x-1][1].type&&f[x][1].start.line!==f[x][1].end.line&&(E=x+1,C.push(E),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(c.events=[],v?(v._tokenizer=void 0,v.previous=void 0):C.pop(),x=C.length;x--;){const N=f.slice(C[x],C[x+1]),_=s.pop();h.push([_,_+N.length-1]),e.splice(_,2,N)}for(h.reverse(),x=-1;++x<h.length;)d[S+h[x][0]]=S+h[x][1],S+=h[x][1]-h[x][0]-1;return d}const Vz={resolve:$z,tokenize:Xz},Yz={partial:!0,tokenize:Fz};function $z(e){return Sw(e),e}function Xz(e,n){let i;return l;function l(f){return e.enter("content"),i=e.enter("chunkContent",{contentType:"content"}),o(f)}function o(f){return f===null?s(f):ve(f)?e.check(Yz,c,s)(f):(e.consume(f),o)}function s(f){return e.exit("chunkContent"),e.exit("content"),n(f)}function c(f){return e.consume(f),e.exit("chunkContent"),i.next=e.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,o}}function Fz(e,n,i){const l=this;return o;function o(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),qe(e,s,"linePrefix")}function s(c){if(c===null||ve(c))return i(c);const f=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(c):e.interrupt(l.parser.constructs.flow,i,n)(c)}}function kw(e,n,i,l,o,s,c,f,h){const d=h||Number.POSITIVE_INFINITY;let g=0;return m;function m(N){return N===60?(e.enter(l),e.enter(o),e.enter(s),e.consume(N),e.exit(s),x):N===null||N===32||N===41||Vu(N)?i(N):(e.enter(l),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),E(N))}function x(N){return N===62?(e.enter(s),e.consume(N),e.exit(s),e.exit(o),e.exit(l),n):(e.enter(f),e.enter("chunkString",{contentType:"string"}),v(N))}function v(N){return N===62?(e.exit("chunkString"),e.exit(f),x(N)):N===null||N===60||ve(N)?i(N):(e.consume(N),N===92?S:v)}function S(N){return N===60||N===62||N===92?(e.consume(N),v):v(N)}function E(N){return!g&&(N===null||N===41||tt(N))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(l),n(N)):g<d&&N===40?(e.consume(N),g++,E):N===41?(e.consume(N),g--,E):N===null||N===32||N===40||Vu(N)?i(N):(e.consume(N),N===92?C:E)}function C(N){return N===40||N===41||N===92?(e.consume(N),E):E(N)}}function Ew(e,n,i,l,o,s){const c=this;let f=0,h;return d;function d(v){return e.enter(l),e.enter(o),e.consume(v),e.exit(o),e.enter(s),g}function g(v){return f>999||v===null||v===91||v===93&&!h||v===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?i(v):v===93?(e.exit(s),e.enter(o),e.consume(v),e.exit(o),e.exit(l),n):ve(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===null||v===91||v===93||ve(v)||f++>999?(e.exit("chunkString"),g(v)):(e.consume(v),h||(h=!Re(v)),v===92?x:m)}function x(v){return v===91||v===92||v===93?(e.consume(v),f++,m):m(v)}}function Nw(e,n,i,l,o,s){let c;return f;function f(x){return x===34||x===39||x===40?(e.enter(l),e.enter(o),e.consume(x),e.exit(o),c=x===40?41:x,h):i(x)}function h(x){return x===c?(e.enter(o),e.consume(x),e.exit(o),e.exit(l),n):(e.enter(s),d(x))}function d(x){return x===c?(e.exit(s),h(c)):x===null?i(x):ve(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),qe(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===c||x===null||ve(x)?(e.exit("chunkString"),d(x)):(e.consume(x),x===92?m:g)}function m(x){return x===c||x===92?(e.consume(x),g):g(x)}}function lo(e,n){let i;return l;function l(o){return ve(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i=!0,l):Re(o)?qe(e,l,i?"linePrefix":"lineSuffix")(o):n(o)}}const Gz={name:"definition",tokenize:Zz},Pz={partial:!0,tokenize:Qz};function Zz(e,n,i){const l=this;let o;return s;function s(v){return e.enter("definition"),c(v)}function c(v){return Ew.call(l,e,f,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function f(v){return o=Rn(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),h):i(v)}function h(v){return tt(v)?lo(e,d)(v):d(v)}function d(v){return kw(e,g,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function g(v){return e.attempt(Pz,m,m)(v)}function m(v){return Re(v)?qe(e,x,"whitespace")(v):x(v)}function x(v){return v===null||ve(v)?(e.exit("definition"),l.parser.defined.push(o),n(v)):i(v)}}function Qz(e,n,i){return l;function l(f){return tt(f)?lo(e,o)(f):i(f)}function o(f){return Nw(e,s,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function s(f){return Re(f)?qe(e,c,"whitespace")(f):c(f)}function c(f){return f===null||ve(f)?n(f):i(f)}}const Kz={name:"hardBreakEscape",tokenize:Jz};function Jz(e,n,i){return l;function l(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return ve(s)?(e.exit("hardBreakEscape"),n(s)):i(s)}}const Wz={name:"headingAtx",resolve:ej,tokenize:tj};function ej(e,n){let i=e.length-2,l=3,o,s;return e[l][1].type==="whitespace"&&(l+=2),i-2>l&&e[i][1].type==="whitespace"&&(i-=2),e[i][1].type==="atxHeadingSequence"&&(l===i-1||i-4>l&&e[i-2][1].type==="whitespace")&&(i-=l+1===i?2:4),i>l&&(o={type:"atxHeadingText",start:e[l][1].start,end:e[i][1].end},s={type:"chunkText",start:e[l][1].start,end:e[i][1].end,contentType:"text"},dn(e,l,i-l+1,[["enter",o,n],["enter",s,n],["exit",s,n],["exit",o,n]])),e}function tj(e,n,i){let l=0;return o;function o(g){return e.enter("atxHeading"),s(g)}function s(g){return e.enter("atxHeadingSequence"),c(g)}function c(g){return g===35&&l++<6?(e.consume(g),c):g===null||tt(g)?(e.exit("atxHeadingSequence"),f(g)):i(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||ve(g)?(e.exit("atxHeading"),n(g)):Re(g)?qe(e,f,"whitespace")(g):(e.enter("atxHeadingText"),d(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),f(g))}function d(g){return g===null||g===35||tt(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),d)}}const nj=["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"],g1=["pre","script","style","textarea"],ij={concrete:!0,name:"htmlFlow",resolveTo:aj,tokenize:oj},rj={partial:!0,tokenize:uj},lj={partial:!0,tokenize:sj};function aj(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function oj(e,n,i){const l=this;let o,s,c,f,h;return d;function d(z){return g(z)}function g(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),m}function m(z){return z===33?(e.consume(z),x):z===47?(e.consume(z),s=!0,E):z===63?(e.consume(z),o=3,l.interrupt?n:j):qt(z)?(e.consume(z),c=String.fromCharCode(z),C):i(z)}function x(z){return z===45?(e.consume(z),o=2,v):z===91?(e.consume(z),o=5,f=0,S):qt(z)?(e.consume(z),o=4,l.interrupt?n:j):i(z)}function v(z){return z===45?(e.consume(z),l.interrupt?n:j):i(z)}function S(z){const ne="CDATA[";return z===ne.charCodeAt(f++)?(e.consume(z),f===ne.length?l.interrupt?n:Y:S):i(z)}function E(z){return qt(z)?(e.consume(z),c=String.fromCharCode(z),C):i(z)}function C(z){if(z===null||z===47||z===62||tt(z)){const ne=z===47,ue=c.toLowerCase();return!ne&&!s&&g1.includes(ue)?(o=1,l.interrupt?n(z):Y(z)):nj.includes(c.toLowerCase())?(o=6,ne?(e.consume(z),N):l.interrupt?n(z):Y(z)):(o=7,l.interrupt&&!l.parser.lazy[l.now().line]?i(z):s?_(z):k(z))}return z===45||Lt(z)?(e.consume(z),c+=String.fromCharCode(z),C):i(z)}function N(z){return z===62?(e.consume(z),l.interrupt?n:Y):i(z)}function _(z){return Re(z)?(e.consume(z),_):H(z)}function k(z){return z===47?(e.consume(z),H):z===58||z===95||qt(z)?(e.consume(z),A):Re(z)?(e.consume(z),k):H(z)}function A(z){return z===45||z===46||z===58||z===95||Lt(z)?(e.consume(z),A):B(z)}function B(z){return z===61?(e.consume(z),T):Re(z)?(e.consume(z),B):k(z)}function T(z){return z===null||z===60||z===61||z===62||z===96?i(z):z===34||z===39?(e.consume(z),h=z,L):Re(z)?(e.consume(z),T):P(z)}function L(z){return z===h?(e.consume(z),h=null,Z):z===null||ve(z)?i(z):(e.consume(z),L)}function P(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||tt(z)?B(z):(e.consume(z),P)}function Z(z){return z===47||z===62||Re(z)?k(z):i(z)}function H(z){return z===62?(e.consume(z),U):i(z)}function U(z){return z===null||ve(z)?Y(z):Re(z)?(e.consume(z),U):i(z)}function Y(z){return z===45&&o===2?(e.consume(z),D):z===60&&o===1?(e.consume(z),q):z===62&&o===4?(e.consume(z),O):z===63&&o===3?(e.consume(z),j):z===93&&o===5?(e.consume(z),K):ve(z)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(rj,$,ee)(z)):z===null||ve(z)?(e.exit("htmlFlowData"),ee(z)):(e.consume(z),Y)}function ee(z){return e.check(lj,R,$)(z)}function R(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),I}function I(z){return z===null||ve(z)?ee(z):(e.enter("htmlFlowData"),Y(z))}function D(z){return z===45?(e.consume(z),j):Y(z)}function q(z){return z===47?(e.consume(z),c="",X):Y(z)}function X(z){if(z===62){const ne=c.toLowerCase();return g1.includes(ne)?(e.consume(z),O):Y(z)}return qt(z)&&c.length<8?(e.consume(z),c+=String.fromCharCode(z),X):Y(z)}function K(z){return z===93?(e.consume(z),j):Y(z)}function j(z){return z===62?(e.consume(z),O):z===45&&o===2?(e.consume(z),j):Y(z)}function O(z){return z===null||ve(z)?(e.exit("htmlFlowData"),$(z)):(e.consume(z),O)}function $(z){return e.exit("htmlFlow"),n(z)}}function sj(e,n,i){const l=this;return o;function o(c){return ve(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):i(c)}function s(c){return l.parser.lazy[l.now().line]?i(c):n(c)}}function uj(e,n,i){return l;function l(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Do,n,i)}}const cj={name:"htmlText",tokenize:fj};function fj(e,n,i){const l=this;let o,s,c;return f;function f(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),h}function h(j){return j===33?(e.consume(j),d):j===47?(e.consume(j),B):j===63?(e.consume(j),k):qt(j)?(e.consume(j),P):i(j)}function d(j){return j===45?(e.consume(j),g):j===91?(e.consume(j),s=0,S):qt(j)?(e.consume(j),_):i(j)}function g(j){return j===45?(e.consume(j),v):i(j)}function m(j){return j===null?i(j):j===45?(e.consume(j),x):ve(j)?(c=m,q(j)):(e.consume(j),m)}function x(j){return j===45?(e.consume(j),v):m(j)}function v(j){return j===62?D(j):j===45?x(j):m(j)}function S(j){const O="CDATA[";return j===O.charCodeAt(s++)?(e.consume(j),s===O.length?E:S):i(j)}function E(j){return j===null?i(j):j===93?(e.consume(j),C):ve(j)?(c=E,q(j)):(e.consume(j),E)}function C(j){return j===93?(e.consume(j),N):E(j)}function N(j){return j===62?D(j):j===93?(e.consume(j),N):E(j)}function _(j){return j===null||j===62?D(j):ve(j)?(c=_,q(j)):(e.consume(j),_)}function k(j){return j===null?i(j):j===63?(e.consume(j),A):ve(j)?(c=k,q(j)):(e.consume(j),k)}function A(j){return j===62?D(j):k(j)}function B(j){return qt(j)?(e.consume(j),T):i(j)}function T(j){return j===45||Lt(j)?(e.consume(j),T):L(j)}function L(j){return ve(j)?(c=L,q(j)):Re(j)?(e.consume(j),L):D(j)}function P(j){return j===45||Lt(j)?(e.consume(j),P):j===47||j===62||tt(j)?Z(j):i(j)}function Z(j){return j===47?(e.consume(j),D):j===58||j===95||qt(j)?(e.consume(j),H):ve(j)?(c=Z,q(j)):Re(j)?(e.consume(j),Z):D(j)}function H(j){return j===45||j===46||j===58||j===95||Lt(j)?(e.consume(j),H):U(j)}function U(j){return j===61?(e.consume(j),Y):ve(j)?(c=U,q(j)):Re(j)?(e.consume(j),U):Z(j)}function Y(j){return j===null||j===60||j===61||j===62||j===96?i(j):j===34||j===39?(e.consume(j),o=j,ee):ve(j)?(c=Y,q(j)):Re(j)?(e.consume(j),Y):(e.consume(j),R)}function ee(j){return j===o?(e.consume(j),o=void 0,I):j===null?i(j):ve(j)?(c=ee,q(j)):(e.consume(j),ee)}function R(j){return j===null||j===34||j===39||j===60||j===61||j===96?i(j):j===47||j===62||tt(j)?Z(j):(e.consume(j),R)}function I(j){return j===47||j===62||tt(j)?Z(j):i(j)}function D(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),n):i(j)}function q(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),X}function X(j){return Re(j)?qe(e,K,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):K(j)}function K(j){return e.enter("htmlTextData"),c(j)}}const Op={name:"labelEnd",resolveAll:mj,resolveTo:gj,tokenize:yj},dj={tokenize:xj},hj={tokenize:bj},pj={tokenize:vj};function mj(e){let n=-1;const i=[];for(;++n<e.length;){const l=e[n][1];if(i.push(e[n]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const o=l.type==="labelImage"?4:2;l.type="data",n+=o}}return e.length!==i.length&&dn(e,0,e.length,i),e}function gj(e,n){let i=e.length,l=0,o,s,c,f;for(;i--;)if(o=e[i][1],s){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[i][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(c){if(e[i][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(s=i,o.type!=="labelLink")){l=2;break}}else o.type==="labelEnd"&&(c=i);const h={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[s][1].start},end:{...e[c][1].end}},g={type:"labelText",start:{...e[s+l+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",h,n],["enter",d,n]],f=kn(f,e.slice(s+1,s+l+3)),f=kn(f,[["enter",g,n]]),f=kn(f,mc(n.parser.constructs.insideSpan.null,e.slice(s+l+4,c-3),n)),f=kn(f,[["exit",g,n],e[c-2],e[c-1],["exit",d,n]]),f=kn(f,e.slice(c+1)),f=kn(f,[["exit",h,n]]),dn(e,s,e.length,f),e}function yj(e,n,i){const l=this;let o=l.events.length,s,c;for(;o--;)if((l.events[o][1].type==="labelImage"||l.events[o][1].type==="labelLink")&&!l.events[o][1]._balanced){s=l.events[o][1];break}return f;function f(x){return s?s._inactive?m(x):(c=l.parser.defined.includes(Rn(l.sliceSerialize({start:s.end,end:l.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),h):i(x)}function h(x){return x===40?e.attempt(dj,g,c?g:m)(x):x===91?e.attempt(hj,g,c?d:m)(x):c?g(x):m(x)}function d(x){return e.attempt(pj,g,m)(x)}function g(x){return n(x)}function m(x){return s._balanced=!0,i(x)}}function xj(e,n,i){return l;function l(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),o}function o(m){return tt(m)?lo(e,s)(m):s(m)}function s(m){return m===41?g(m):kw(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function c(m){return tt(m)?lo(e,h)(m):g(m)}function f(m){return i(m)}function h(m){return m===34||m===39||m===40?Nw(e,d,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):g(m)}function d(m){return tt(m)?lo(e,g)(m):g(m)}function g(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),n):i(m)}}function bj(e,n,i){const l=this;return o;function o(f){return Ew.call(l,e,s,c,"reference","referenceMarker","referenceString")(f)}function s(f){return l.parser.defined.includes(Rn(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?n(f):i(f)}function c(f){return i(f)}}function vj(e,n,i){return l;function l(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),o}function o(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),n):i(s)}}const wj={name:"labelStartImage",resolveAll:Op.resolveAll,tokenize:Sj};function Sj(e,n,i){const l=this;return o;function o(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),s}function s(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):i(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in l.parser.constructs?i(f):n(f)}}const kj={name:"labelStartLink",resolveAll:Op.resolveAll,tokenize:Ej};function Ej(e,n,i){const l=this;return o;function o(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),s}function s(c){return c===94&&"_hiddenFootnoteSupport"in l.parser.constructs?i(c):n(c)}}const rh={name:"lineEnding",tokenize:Nj};function Nj(e,n){return i;function i(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),qe(e,n,"linePrefix")}}const Au={name:"thematicBreak",tokenize:_j};function _j(e,n,i){let l=0,o;return s;function s(d){return e.enter("thematicBreak"),c(d)}function c(d){return o=d,f(d)}function f(d){return d===o?(e.enter("thematicBreakSequence"),h(d)):l>=3&&(d===null||ve(d))?(e.exit("thematicBreak"),n(d)):i(d)}function h(d){return d===o?(e.consume(d),l++,h):(e.exit("thematicBreakSequence"),Re(d)?qe(e,f,"whitespace")(d):f(d))}}const Kt={continuation:{tokenize:Mj},exit:jj,name:"list",tokenize:Aj},Cj={partial:!0,tokenize:Dj},Tj={partial:!0,tokenize:zj};function Aj(e,n,i){const l=this,o=l.events[l.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,c=0;return f;function f(v){const S=l.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!l.containerState.marker||v===l.containerState.marker:Fh(v)){if(l.containerState.type||(l.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Au,i,d)(v):d(v);if(!l.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(v)}return i(v)}function h(v){return Fh(v)&&++c<10?(e.consume(v),h):(!l.interrupt||c<2)&&(l.containerState.marker?v===l.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),d(v)):i(v)}function d(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||v,e.check(Do,l.interrupt?i:g,e.attempt(Cj,x,m))}function g(v){return l.containerState.initialBlankLine=!0,s++,x(v)}function m(v){return Re(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),x):i(v)}function x(v){return l.containerState.size=s+l.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(v)}}function Mj(e,n,i){const l=this;return l.containerState._closeFlow=void 0,e.check(Do,o,s);function o(f){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,qe(e,n,"listItemIndent",l.containerState.size+1)(f)}function s(f){return l.containerState.furtherBlankLines||!Re(f)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,c(f)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,e.attempt(Tj,n,c)(f))}function c(f){return l.containerState._closeFlow=!0,l.interrupt=void 0,qe(e,e.attempt(Kt,n,i),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function zj(e,n,i){const l=this;return qe(e,o,"listItemIndent",l.containerState.size+1);function o(s){const c=l.events[l.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===l.containerState.size?n(s):i(s)}}function jj(e){e.exit(this.containerState.type)}function Dj(e,n,i){const l=this;return qe(e,o,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const c=l.events[l.events.length-1];return!Re(s)&&c&&c[1].type==="listItemPrefixWhitespace"?n(s):i(s)}}const y1={name:"setextUnderline",resolveTo:Oj,tokenize:Rj};function Oj(e,n){let i=e.length,l,o,s;for(;i--;)if(e[i][0]==="enter"){if(e[i][1].type==="content"){l=i;break}e[i][1].type==="paragraph"&&(o=i)}else e[i][1].type==="content"&&e.splice(i,1),!s&&e[i][1].type==="definition"&&(s=i);const c={type:"setextHeading",start:{...e[l][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",c,n]),e.splice(s+1,0,["exit",e[l][1],n]),e[l][1].end={...e[s][1].end}):e[l][1]=c,e.push(["exit",c,n]),e}function Rj(e,n,i){const l=this;let o;return s;function s(d){let g=l.events.length,m;for(;g--;)if(l.events[g][1].type!=="lineEnding"&&l.events[g][1].type!=="linePrefix"&&l.events[g][1].type!=="content"){m=l.events[g][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||m)?(e.enter("setextHeadingLine"),o=d,c(d)):i(d)}function c(d){return e.enter("setextHeadingLineSequence"),f(d)}function f(d){return d===o?(e.consume(d),f):(e.exit("setextHeadingLineSequence"),Re(d)?qe(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||ve(d)?(e.exit("setextHeadingLine"),n(d)):i(d)}}const Lj={tokenize:Bj};function Bj(e){const n=this,i=e.attempt(Do,l,e.attempt(this.parser.constructs.flowInitial,o,qe(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Vz,o)),"linePrefix")));return i;function l(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),n.currentConstruct=void 0,i}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n.currentConstruct=void 0,i}}const Hj={resolveAll:Cw()},Uj=_w("string"),Ij=_w("text");function _w(e){return{resolveAll:Cw(e==="text"?qj:void 0),tokenize:n};function n(i){const l=this,o=this.parser.constructs[e],s=i.attempt(o,c,f);return c;function c(g){return d(g)?s(g):f(g)}function f(g){if(g===null){i.consume(g);return}return i.enter("data"),i.consume(g),h}function h(g){return d(g)?(i.exit("data"),s(g)):(i.consume(g),h)}function d(g){if(g===null)return!0;const m=o[g];let x=-1;if(m)for(;++x<m.length;){const v=m[x];if(!v.previous||v.previous.call(l,l.previous))return!0}return!1}}}function Cw(e){return n;function n(i,l){let o=-1,s;for(;++o<=i.length;)s===void 0?i[o]&&i[o][1].type==="data"&&(s=o,o++):(!i[o]||i[o][1].type!=="data")&&(o!==s+2&&(i[s][1].end=i[o-1][1].end,i.splice(s+2,o-s-2),o=s+2),s=void 0);return e?e(i,l):i}}function qj(e,n){let i=0;for(;++i<=e.length;)if((i===e.length||e[i][1].type==="lineEnding")&&e[i-1][1].type==="data"){const l=e[i-1][1],o=n.sliceStream(l);let s=o.length,c=-1,f=0,h;for(;s--;){const d=o[s];if(typeof d=="string"){for(c=d.length;d.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(d===-2)h=!0,f++;else if(d!==-1){s++;break}}if(n._contentTypeTextTrailing&&i===e.length&&(f=0),f){const d={type:i===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?c:l.start._bufferIndex+c,_index:l.start._index+s,line:l.end.line,column:l.end.column-f,offset:l.end.offset-f},end:{...l.end}};l.end={...d.start},l.start.offset===l.end.offset?Object.assign(l,d):(e.splice(i,0,["enter",d,n],["exit",d,n]),i+=2)}i++}return e}const Vj={42:Kt,43:Kt,45:Kt,48:Kt,49:Kt,50:Kt,51:Kt,52:Kt,53:Kt,54:Kt,55:Kt,56:Kt,57:Kt,62:bw},Yj={91:Gz},$j={[-2]:ih,[-1]:ih,32:ih},Xj={35:Wz,42:Au,45:[y1,Au],60:ij,61:y1,95:Au,96:m1,126:m1},Fj={38:ww,92:vw},Gj={[-5]:rh,[-4]:rh,[-3]:rh,33:wj,38:ww,42:Gh,60:[kz,cj],91:kj,92:[Kz,vw],93:Op,95:Gh,96:Lz},Pj={null:[Gh,Hj]},Zj={null:[42,95]},Qj={null:[]},Kj=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Zj,contentInitial:Yj,disable:Qj,document:Vj,flow:Xj,flowInitial:$j,insideSpan:Pj,string:Fj,text:Gj},Symbol.toStringTag,{value:"Module"}));function Jj(e,n,i){let l={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const o={},s=[];let c=[],f=[];const h={attempt:L(B),check:L(T),consume:_,enter:k,exit:A,interrupt:L(T,{interrupt:!0})},d={code:null,containerState:{},defineSkip:E,events:[],now:S,parser:e,previous:null,sliceSerialize:x,sliceStream:v,write:m};let g=n.tokenize.call(d,h);return n.resolveAll&&s.push(n),d;function m(U){return c=kn(c,U),C(),c[c.length-1]!==null?[]:(P(n,0),d.events=mc(s,d.events,d),d.events)}function x(U,Y){return eD(v(U),Y)}function v(U){return Wj(c,U)}function S(){const{_bufferIndex:U,_index:Y,line:ee,column:R,offset:I}=l;return{_bufferIndex:U,_index:Y,line:ee,column:R,offset:I}}function E(U){o[U.line]=U.column,H()}function C(){let U;for(;l._index<c.length;){const Y=c[l._index];if(typeof Y=="string")for(U=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===U&&l._bufferIndex<Y.length;)N(Y.charCodeAt(l._bufferIndex));else N(Y)}}function N(U){g=g(U)}function _(U){ve(U)?(l.line++,l.column=1,l.offset+=U===-3?2:1,H()):U!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===c[l._index].length&&(l._bufferIndex=-1,l._index++)),d.previous=U}function k(U,Y){const ee=Y||{};return ee.type=U,ee.start=S(),d.events.push(["enter",ee,d]),f.push(ee),ee}function A(U){const Y=f.pop();return Y.end=S(),d.events.push(["exit",Y,d]),Y}function B(U,Y){P(U,Y.from)}function T(U,Y){Y.restore()}function L(U,Y){return ee;function ee(R,I,D){let q,X,K,j;return Array.isArray(R)?$(R):"tokenize"in R?$([R]):O(R);function O(ce){return de;function de(se){const pe=se!==null&&ce[se],ke=se!==null&&ce.null,Ne=[...Array.isArray(pe)?pe:pe?[pe]:[],...Array.isArray(ke)?ke:ke?[ke]:[]];return $(Ne)(se)}}function $(ce){return q=ce,X=0,ce.length===0?D:z(ce[X])}function z(ce){return de;function de(se){return j=Z(),K=ce,ce.partial||(d.currentConstruct=ce),ce.name&&d.parser.constructs.disable.null.includes(ce.name)?ue():ce.tokenize.call(Y?Object.assign(Object.create(d),Y):d,h,ne,ue)(se)}}function ne(ce){return U(K,j),I}function ue(ce){return j.restore(),++X<q.length?z(q[X]):D}}}function P(U,Y){U.resolveAll&&!s.includes(U)&&s.push(U),U.resolve&&dn(d.events,Y,d.events.length-Y,U.resolve(d.events.slice(Y),d)),U.resolveTo&&(d.events=U.resolveTo(d.events,d))}function Z(){const U=S(),Y=d.previous,ee=d.currentConstruct,R=d.events.length,I=Array.from(f);return{from:R,restore:D};function D(){l=U,d.previous=Y,d.currentConstruct=ee,d.events.length=R,f=I,H()}}function H(){l.line in o&&l.column<2&&(l.column=o[l.line],l.offset+=o[l.line]-1)}}function Wj(e,n){const i=n.start._index,l=n.start._bufferIndex,o=n.end._index,s=n.end._bufferIndex;let c;if(i===o)c=[e[i].slice(l,s)];else{if(c=e.slice(i,o),l>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(l):c.shift()}s>0&&c.push(e[o].slice(0,s))}return c}function eD(e,n){let i=-1;const l=[];let o;for(;++i<e.length;){const s=e[i];let c;if(typeof s=="string")c=s;else switch(s){case-5:{c="\r";break}case-4:{c=`
|
|
41
|
+
`;break}case-3:{c=`\r
|
|
42
|
+
`;break}case-2:{c=n?" ":" ";break}case-1:{if(!n&&o)continue;c=" ";break}default:c=String.fromCharCode(s)}o=s===-2,l.push(c)}return l.join("")}function tD(e){const l={constructs:yw([Kj,...(e||{}).extensions||[]]),content:o(gz),defined:[],document:o(xz),flow:o(Lj),lazy:{},string:o(Uj),text:o(Ij)};return l;function o(s){return c;function c(f){return Jj(l,s,f)}}}function nD(e){for(;!Sw(e););return e}const x1=/[\0\t\n\r]/g;function iD(){let e=1,n="",i=!0,l;return o;function o(s,c,f){const h=[];let d,g,m,x,v;for(s=n+(typeof s=="string"?s.toString():new TextDecoder(c||void 0).decode(s)),m=0,n="",i&&(s.charCodeAt(0)===65279&&m++,i=void 0);m<s.length;){if(x1.lastIndex=m,d=x1.exec(s),x=d&&d.index!==void 0?d.index:s.length,v=s.charCodeAt(x),!d){n=s.slice(m);break}if(v===10&&m===x&&l)h.push(-3),l=void 0;else switch(l&&(h.push(-5),l=void 0),m<x&&(h.push(s.slice(m,x)),e+=x-m),v){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:l=!0,e=1}m=x+1}return f&&(l&&h.push(-5),n&&h.push(n),h.push(null)),h}}const rD=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function lD(e){return e.replace(rD,aD)}function aD(e,n,i){if(n)return n;if(i.charCodeAt(0)===35){const o=i.charCodeAt(1),s=o===120||o===88;return xw(i.slice(s?2:1),s?16:10)}return Dp(i)||e}const Tw={}.hasOwnProperty;function oD(e,n,i){return typeof n!="string"&&(i=n,n=void 0),sD(i)(nD(tD(i).document().write(iD()(e,n,!0))))}function sD(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(jt),autolinkProtocol:Z,autolinkEmail:Z,atxHeading:s(Fe),blockQuote:s(ke),characterEscape:Z,characterReference:Z,codeFenced:s(Ne),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:s(Ne,c),codeText:s(be,c),codeTextData:Z,data:Z,codeFlowValue:Z,definition:s(Ee),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:s(je),hardBreakEscape:s(Ye),hardBreakTrailing:s(Ye),htmlFlow:s(ct,c),htmlFlowData:Z,htmlText:s(ct,c),htmlTextData:Z,image:s(en),label:c,link:s(jt),listItem:s(En),listItemValue:x,listOrdered:s(Vt,m),listUnordered:s(Vt),paragraph:s(Jn),reference:z,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:s(Fe),strong:s(Wn),thematicBreak:s(Ci)},exit:{atxHeading:h(),atxHeadingSequence:B,autolink:h(),autolinkEmail:pe,autolinkProtocol:se,blockQuote:h(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:ce,characterReference:de,codeFenced:h(C),codeFencedFence:E,codeFencedFenceInfo:v,codeFencedFenceMeta:S,codeFlowValue:H,codeIndented:h(N),codeText:h(I),codeTextData:H,data:H,definition:h(),definitionDestinationString:A,definitionLabelString:_,definitionTitleString:k,emphasis:h(),hardBreakEscape:h(Y),hardBreakTrailing:h(Y),htmlFlow:h(ee),htmlFlowData:H,htmlText:h(R),htmlTextData:H,image:h(q),label:K,labelText:X,lineEnding:U,link:h(D),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ne,resourceDestinationString:j,resourceTitleString:O,resource:$,setextHeading:h(P),setextHeadingLineSequence:L,setextHeadingText:T,strong:h(),thematicBreak:h()}};Aw(n,(e||{}).mdastExtensions||[]);const i={};return l;function l(re){let he={type:"root",children:[]};const we={stack:[he],tokenStack:[],config:n,enter:f,exit:d,buffer:c,resume:g,data:i},ze=[];let Ie=-1;for(;++Ie<re.length;)if(re[Ie][1].type==="listOrdered"||re[Ie][1].type==="listUnordered")if(re[Ie][0]==="enter")ze.push(Ie);else{const Ht=ze.pop();Ie=o(re,Ht,Ie)}for(Ie=-1;++Ie<re.length;){const Ht=n[re[Ie][0]];Tw.call(Ht,re[Ie][1].type)&&Ht[re[Ie][1].type].call(Object.assign({sliceSerialize:re[Ie][2].sliceSerialize},we),re[Ie][1])}if(we.tokenStack.length>0){const Ht=we.tokenStack[we.tokenStack.length-1];(Ht[1]||b1).call(we,void 0,Ht[0])}for(he.position={start:rr(re.length>0?re[0][1].start:{line:1,column:1,offset:0}),end:rr(re.length>0?re[re.length-2][1].end:{line:1,column:1,offset:0})},Ie=-1;++Ie<n.transforms.length;)he=n.transforms[Ie](he)||he;return he}function o(re,he,we){let ze=he-1,Ie=-1,Ht=!1,Nn,Ct,ft,Dt;for(;++ze<=we;){const Pe=re[ze];switch(Pe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Pe[0]==="enter"?Ie++:Ie--,Dt=void 0;break}case"lineEndingBlank":{Pe[0]==="enter"&&(Nn&&!Dt&&!Ie&&!ft&&(ft=ze),Dt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Dt=void 0}if(!Ie&&Pe[0]==="enter"&&Pe[1].type==="listItemPrefix"||Ie===-1&&Pe[0]==="exit"&&(Pe[1].type==="listUnordered"||Pe[1].type==="listOrdered")){if(Nn){let Bn=ze;for(Ct=void 0;Bn--;){const tn=re[Bn];if(tn[1].type==="lineEnding"||tn[1].type==="lineEndingBlank"){if(tn[0]==="exit")continue;Ct&&(re[Ct][1].type="lineEndingBlank",Ht=!0),tn[1].type="lineEnding",Ct=Bn}else if(!(tn[1].type==="linePrefix"||tn[1].type==="blockQuotePrefix"||tn[1].type==="blockQuotePrefixWhitespace"||tn[1].type==="blockQuoteMarker"||tn[1].type==="listItemIndent"))break}ft&&(!Ct||ft<Ct)&&(Nn._spread=!0),Nn.end=Object.assign({},Ct?re[Ct][1].start:Pe[1].end),re.splice(Ct||ze,0,["exit",Nn,Pe[2]]),ze++,we++}if(Pe[1].type==="listItemPrefix"){const Bn={type:"listItem",_spread:!1,start:Object.assign({},Pe[1].start),end:void 0};Nn=Bn,re.splice(ze,0,["enter",Bn,Pe[2]]),ze++,we++,ft=void 0,Dt=!0}}}return re[he][1]._spread=Ht,we}function s(re,he){return we;function we(ze){f.call(this,re(ze),ze),he&&he.call(this,ze)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(re,he,we){this.stack[this.stack.length-1].children.push(re),this.stack.push(re),this.tokenStack.push([he,we||void 0]),re.position={start:rr(he.start),end:void 0}}function h(re){return he;function he(we){re&&re.call(this,we),d.call(this,we)}}function d(re,he){const we=this.stack.pop(),ze=this.tokenStack.pop();if(ze)ze[0].type!==re.type&&(he?he.call(this,re,ze[0]):(ze[1]||b1).call(this,re,ze[0]));else throw new Error("Cannot close `"+re.type+"` ("+ro({start:re.start,end:re.end})+"): it’s not open");we.position.end=rr(re.end)}function g(){return jp(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function x(re){if(this.data.expectingFirstListItemValue){const he=this.stack[this.stack.length-2];he.start=Number.parseInt(this.sliceSerialize(re),10),this.data.expectingFirstListItemValue=void 0}}function v(){const re=this.resume(),he=this.stack[this.stack.length-1];he.lang=re}function S(){const re=this.resume(),he=this.stack[this.stack.length-1];he.meta=re}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const re=this.resume(),he=this.stack[this.stack.length-1];he.value=re.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const re=this.resume(),he=this.stack[this.stack.length-1];he.value=re.replace(/(\r?\n|\r)$/g,"")}function _(re){const he=this.resume(),we=this.stack[this.stack.length-1];we.label=he,we.identifier=Rn(this.sliceSerialize(re)).toLowerCase()}function k(){const re=this.resume(),he=this.stack[this.stack.length-1];he.title=re}function A(){const re=this.resume(),he=this.stack[this.stack.length-1];he.url=re}function B(re){const he=this.stack[this.stack.length-1];if(!he.depth){const we=this.sliceSerialize(re).length;he.depth=we}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function L(re){const he=this.stack[this.stack.length-1];he.depth=this.sliceSerialize(re).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function Z(re){const we=this.stack[this.stack.length-1].children;let ze=we[we.length-1];(!ze||ze.type!=="text")&&(ze=St(),ze.position={start:rr(re.start),end:void 0},we.push(ze)),this.stack.push(ze)}function H(re){const he=this.stack.pop();he.value+=this.sliceSerialize(re),he.position.end=rr(re.end)}function U(re){const he=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=he.children[he.children.length-1];we.position.end=rr(re.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(he.type)&&(Z.call(this,re),H.call(this,re))}function Y(){this.data.atHardBreak=!0}function ee(){const re=this.resume(),he=this.stack[this.stack.length-1];he.value=re}function R(){const re=this.resume(),he=this.stack[this.stack.length-1];he.value=re}function I(){const re=this.resume(),he=this.stack[this.stack.length-1];he.value=re}function D(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=he,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function q(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=he,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function X(re){const he=this.sliceSerialize(re),we=this.stack[this.stack.length-2];we.label=lD(he),we.identifier=Rn(he).toLowerCase()}function K(){const re=this.stack[this.stack.length-1],he=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const ze=re.children;we.children=ze}else we.alt=he}function j(){const re=this.resume(),he=this.stack[this.stack.length-1];he.url=re}function O(){const re=this.resume(),he=this.stack[this.stack.length-1];he.title=re}function $(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function ne(re){const he=this.resume(),we=this.stack[this.stack.length-1];we.label=he,we.identifier=Rn(this.sliceSerialize(re)).toLowerCase(),this.data.referenceType="full"}function ue(re){this.data.characterReferenceType=re.type}function ce(re){const he=this.sliceSerialize(re),we=this.data.characterReferenceType;let ze;we?(ze=xw(he,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ze=Dp(he);const Ie=this.stack[this.stack.length-1];Ie.value+=ze}function de(re){const he=this.stack.pop();he.position.end=rr(re.end)}function se(re){H.call(this,re);const he=this.stack[this.stack.length-1];he.url=this.sliceSerialize(re)}function pe(re){H.call(this,re);const he=this.stack[this.stack.length-1];he.url="mailto:"+this.sliceSerialize(re)}function ke(){return{type:"blockquote",children:[]}}function Ne(){return{type:"code",lang:null,meta:null,value:""}}function be(){return{type:"inlineCode",value:""}}function Ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function je(){return{type:"emphasis",children:[]}}function Fe(){return{type:"heading",depth:0,children:[]}}function Ye(){return{type:"break"}}function ct(){return{type:"html",value:""}}function en(){return{type:"image",title:null,url:"",alt:null}}function jt(){return{type:"link",title:null,url:"",children:[]}}function Vt(re){return{type:"list",ordered:re.type==="listOrdered",start:null,spread:re._spread,children:[]}}function En(re){return{type:"listItem",spread:re._spread,checked:null,children:[]}}function Jn(){return{type:"paragraph",children:[]}}function Wn(){return{type:"strong",children:[]}}function St(){return{type:"text",value:""}}function Ci(){return{type:"thematicBreak"}}}function rr(e){return{line:e.line,column:e.column,offset:e.offset}}function Aw(e,n){let i=-1;for(;++i<n.length;){const l=n[i];Array.isArray(l)?Aw(e,l):uD(e,l)}}function uD(e,n){let i;for(i in n)if(Tw.call(n,i))switch(i){case"canContainEols":{const l=n[i];l&&e[i].push(...l);break}case"transforms":{const l=n[i];l&&e[i].push(...l);break}case"enter":case"exit":{const l=n[i];l&&Object.assign(e[i],l);break}}}function b1(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+ro({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+ro({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+ro({start:n.start,end:n.end})+") is still open")}function cD(e){const n=this;n.parser=i;function i(l){return oD(l,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function fD(e,n){const i={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,i),e.applyData(n,i)}function dD(e,n){const i={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,i),[e.applyData(n,i),{type:"text",value:`
|
|
43
|
+
`}]}function hD(e,n){const i=n.value?n.value+`
|
|
44
|
+
`:"",l={},o=n.lang?n.lang.split(/\s+/):[];o.length>0&&(l.className=["language-"+o[0]]);let s={type:"element",tagName:"code",properties:l,children:[{type:"text",value:i}]};return n.meta&&(s.data={meta:n.meta}),e.patch(n,s),s=e.applyData(n,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(n,s),s}function pD(e,n){const i={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function mD(e,n){const i={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function gD(e,n){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",l=String(n.identifier).toUpperCase(),o=Zl(l.toLowerCase()),s=e.footnoteOrder.indexOf(l);let c,f=e.footnoteCounts.get(l);f===void 0?(f=0,e.footnoteOrder.push(l),c=e.footnoteOrder.length):c=s+1,f+=1,e.footnoteCounts.set(l,f);const h={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+o,id:i+"fnref-"+o+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(n,h);const d={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(n,d),e.applyData(n,d)}function yD(e,n){const i={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function xD(e,n){if(e.options.allowDangerousHtml){const i={type:"raw",value:n.value};return e.patch(n,i),e.applyData(n,i)}}function Mw(e,n){const i=n.referenceType;let l="]";if(i==="collapsed"?l+="[]":i==="full"&&(l+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+l}];const o=e.all(n),s=o[0];s&&s.type==="text"?s.value="["+s.value:o.unshift({type:"text",value:"["});const c=o[o.length-1];return c&&c.type==="text"?c.value+=l:o.push({type:"text",value:l}),o}function bD(e,n){const i=String(n.identifier).toUpperCase(),l=e.definitionById.get(i);if(!l)return Mw(e,n);const o={src:Zl(l.url||""),alt:n.alt};l.title!==null&&l.title!==void 0&&(o.title=l.title);const s={type:"element",tagName:"img",properties:o,children:[]};return e.patch(n,s),e.applyData(n,s)}function vD(e,n){const i={src:Zl(n.url)};n.alt!==null&&n.alt!==void 0&&(i.alt=n.alt),n.title!==null&&n.title!==void 0&&(i.title=n.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,l),e.applyData(n,l)}function wD(e,n){const i={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,i);const l={type:"element",tagName:"code",properties:{},children:[i]};return e.patch(n,l),e.applyData(n,l)}function SD(e,n){const i=String(n.identifier).toUpperCase(),l=e.definitionById.get(i);if(!l)return Mw(e,n);const o={href:Zl(l.url||"")};l.title!==null&&l.title!==void 0&&(o.title=l.title);const s={type:"element",tagName:"a",properties:o,children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function kD(e,n){const i={href:Zl(n.url)};n.title!==null&&n.title!==void 0&&(i.title=n.title);const l={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function ED(e,n,i){const l=e.all(n),o=i?ND(i):zw(n),s={},c=[];if(typeof n.checked=="boolean"){const g=l[0];let m;g&&g.type==="element"&&g.tagName==="p"?m=g:(m={type:"element",tagName:"p",properties:{},children:[]},l.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let f=-1;for(;++f<l.length;){const g=l[f];(o||f!==0||g.type!=="element"||g.tagName!=="p")&&c.push({type:"text",value:`
|
|
45
|
+
`}),g.type==="element"&&g.tagName==="p"&&!o?c.push(...g.children):c.push(g)}const h=l[l.length-1];h&&(o||h.type!=="element"||h.tagName!=="p")&&c.push({type:"text",value:`
|
|
46
|
+
`});const d={type:"element",tagName:"li",properties:s,children:c};return e.patch(n,d),e.applyData(n,d)}function ND(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const i=e.children;let l=-1;for(;!n&&++l<i.length;)n=zw(i[l])}return n}function zw(e){const n=e.spread;return n??e.children.length>1}function _D(e,n){const i={},l=e.all(n);let o=-1;for(typeof n.start=="number"&&n.start!==1&&(i.start=n.start);++o<l.length;){const c=l[o];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){i.className=["contains-task-list"];break}}const s={type:"element",tagName:n.ordered?"ol":"ul",properties:i,children:e.wrap(l,!0)};return e.patch(n,s),e.applyData(n,s)}function CD(e,n){const i={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function TD(e,n){const i={type:"root",children:e.wrap(e.all(n))};return e.patch(n,i),e.applyData(n,i)}function AD(e,n){const i={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function MD(e,n){const i=e.all(n),l=i.shift(),o=[];if(l){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([l],!0)};e.patch(n.children[0],c),o.push(c)}if(i.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(i,!0)},f=Tp(n.children[1]),h=cw(n.children[n.children.length-1]);f&&h&&(c.position={start:f,end:h}),o.push(c)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(n,s),e.applyData(n,s)}function zD(e,n,i){const l=i?i.children:void 0,s=(l?l.indexOf(n):1)===0?"th":"td",c=i&&i.type==="table"?i.align:void 0,f=c?c.length:n.children.length;let h=-1;const d=[];for(;++h<f;){const m=n.children[h],x={},v=c?c[h]:void 0;v&&(x.align=v);let S={type:"element",tagName:s,properties:x,children:[]};m&&(S.children=e.all(m),e.patch(m,S),S=e.applyData(m,S)),d.push(S)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(n,g),e.applyData(n,g)}function jD(e,n){const i={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}const v1=9,w1=32;function DD(e){const n=String(e),i=/\r?\n|\r/g;let l=i.exec(n),o=0;const s=[];for(;l;)s.push(S1(n.slice(o,l.index),o>0,!0),l[0]),o=l.index+l[0].length,l=i.exec(n);return s.push(S1(n.slice(o),o>0,!1)),s.join("")}function S1(e,n,i){let l=0,o=e.length;if(n){let s=e.codePointAt(l);for(;s===v1||s===w1;)l++,s=e.codePointAt(l)}if(i){let s=e.codePointAt(o-1);for(;s===v1||s===w1;)o--,s=e.codePointAt(o-1)}return o>l?e.slice(l,o):""}function OD(e,n){const i={type:"text",value:DD(String(n.value))};return e.patch(n,i),e.applyData(n,i)}function RD(e,n){const i={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,i),e.applyData(n,i)}const LD={blockquote:fD,break:dD,code:hD,delete:pD,emphasis:mD,footnoteReference:gD,heading:yD,html:xD,imageReference:bD,image:vD,inlineCode:wD,linkReference:SD,link:kD,listItem:ED,list:_D,paragraph:CD,root:TD,strong:AD,table:MD,tableCell:jD,tableRow:zD,text:OD,thematicBreak:RD,toml:mu,yaml:mu,definition:mu,footnoteDefinition:mu};function mu(){}const jw=-1,gc=0,ao=1,Yu=2,Rp=3,Lp=4,Bp=5,Hp=6,Dw=7,Ow=8,k1=typeof self=="object"?self:globalThis,BD=(e,n)=>{const i=(o,s)=>(e.set(s,o),o),l=o=>{if(e.has(o))return e.get(o);const[s,c]=n[o];switch(s){case gc:case jw:return i(c,o);case ao:{const f=i([],o);for(const h of c)f.push(l(h));return f}case Yu:{const f=i({},o);for(const[h,d]of c)f[l(h)]=l(d);return f}case Rp:return i(new Date(c),o);case Lp:{const{source:f,flags:h}=c;return i(new RegExp(f,h),o)}case Bp:{const f=i(new Map,o);for(const[h,d]of c)f.set(l(h),l(d));return f}case Hp:{const f=i(new Set,o);for(const h of c)f.add(l(h));return f}case Dw:{const{name:f,message:h}=c;return i(new k1[f](h),o)}case Ow:return i(BigInt(c),o);case"BigInt":return i(Object(BigInt(c)),o);case"ArrayBuffer":return i(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:f}=new Uint8Array(c);return i(new DataView(f),c)}}return i(new k1[s](c),o)};return l},E1=e=>BD(new Map,e)(0),Tl="",{toString:HD}={},{keys:UD}=Object,Ka=e=>{const n=typeof e;if(n!=="object"||!e)return[gc,n];const i=HD.call(e).slice(8,-1);switch(i){case"Array":return[ao,Tl];case"Object":return[Yu,Tl];case"Date":return[Rp,Tl];case"RegExp":return[Lp,Tl];case"Map":return[Bp,Tl];case"Set":return[Hp,Tl];case"DataView":return[ao,i]}return i.includes("Array")?[ao,i]:i.includes("Error")?[Dw,i]:[Yu,i]},gu=([e,n])=>e===gc&&(n==="function"||n==="symbol"),ID=(e,n,i,l)=>{const o=(c,f)=>{const h=l.push(c)-1;return i.set(f,h),h},s=c=>{if(i.has(c))return i.get(c);let[f,h]=Ka(c);switch(f){case gc:{let g=c;switch(h){case"bigint":f=Ow,g=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return o([jw],c)}return o([f,g],c)}case ao:{if(h){let x=c;return h==="DataView"?x=new Uint8Array(c.buffer):h==="ArrayBuffer"&&(x=new Uint8Array(c)),o([h,[...x]],c)}const g=[],m=o([f,g],c);for(const x of c)g.push(s(x));return m}case Yu:{if(h)switch(h){case"BigInt":return o([h,c.toString()],c);case"Boolean":case"Number":case"String":return o([h,c.valueOf()],c)}if(n&&"toJSON"in c)return s(c.toJSON());const g=[],m=o([f,g],c);for(const x of UD(c))(e||!gu(Ka(c[x])))&&g.push([s(x),s(c[x])]);return m}case Rp:return o([f,c.toISOString()],c);case Lp:{const{source:g,flags:m}=c;return o([f,{source:g,flags:m}],c)}case Bp:{const g=[],m=o([f,g],c);for(const[x,v]of c)(e||!(gu(Ka(x))||gu(Ka(v))))&&g.push([s(x),s(v)]);return m}case Hp:{const g=[],m=o([f,g],c);for(const x of c)(e||!gu(Ka(x)))&&g.push(s(x));return m}}const{message:d}=c;return o([f,{name:h,message:d}],c)};return s},N1=(e,{json:n,lossy:i}={})=>{const l=[];return ID(!(n||i),!!n,new Map,l)(e),l},$u=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?E1(N1(e,n)):structuredClone(e):(e,n)=>E1(N1(e,n));function qD(e,n){const i=[{type:"text",value:"↩"}];return n>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),i}function VD(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function YD(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=e.options.footnoteBackContent||qD,l=e.options.footnoteBackLabel||VD,o=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[h]);if(!d)continue;const g=e.all(d),m=String(d.identifier).toUpperCase(),x=Zl(m.toLowerCase());let v=0;const S=[],E=e.footnoteCounts.get(m);for(;E!==void 0&&++v<=E;){S.length>0&&S.push({type:"text",value:" "});let _=typeof i=="string"?i:i(h,v);typeof _=="string"&&(_={type:"text",value:_}),S.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+x+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(h,v),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const C=g[g.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const _=C.children[C.children.length-1];_&&_.type==="text"?_.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...S)}else g.push(...S);const N={type:"element",tagName:"li",properties:{id:n+"fn-"+x},children:e.wrap(g,!0)};e.patch(d,N),f.push(N)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...$u(c),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
47
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
48
|
+
`}]}}const yc=(function(e){if(e==null)return GD;if(typeof e=="function")return xc(e);if(typeof e=="object")return Array.isArray(e)?$D(e):XD(e);if(typeof e=="string")return FD(e);throw new Error("Expected function, string, or object as test")});function $D(e){const n=[];let i=-1;for(;++i<e.length;)n[i]=yc(e[i]);return xc(l);function l(...o){let s=-1;for(;++s<n.length;)if(n[s].apply(this,o))return!0;return!1}}function XD(e){const n=e;return xc(i);function i(l){const o=l;let s;for(s in e)if(o[s]!==n[s])return!1;return!0}}function FD(e){return xc(n);function n(i){return i&&i.type===e}}function xc(e){return n;function n(i,l,o){return!!(PD(i)&&e.call(this,i,typeof l=="number"?l:void 0,o||void 0))}}function GD(){return!0}function PD(e){return e!==null&&typeof e=="object"&&"type"in e}const Rw=[],ZD=!0,Ph=!1,QD="skip";function Lw(e,n,i,l){let o;typeof n=="function"&&typeof i!="function"?(l=i,i=n):o=n;const s=yc(o),c=l?-1:1;f(e,void 0,[])();function f(h,d,g){const m=h&&typeof h=="object"?h:{};if(typeof m.type=="string"){const v=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(h.type+(v?"<"+v+">":""))+")"})}return x;function x(){let v=Rw,S,E,C;if((!n||s(h,d,g[g.length-1]||void 0))&&(v=KD(i(h,g)),v[0]===Ph))return v;if("children"in h&&h.children){const N=h;if(N.children&&v[0]!==QD)for(E=(l?N.children.length:-1)+c,C=g.concat(N);E>-1&&E<N.children.length;){const _=N.children[E];if(S=f(_,E,C)(),S[0]===Ph)return S;E=typeof S[1]=="number"?S[1]:E+c}}return v}}}function KD(e){return Array.isArray(e)?e:typeof e=="number"?[ZD,e]:e==null?Rw:[e]}function Up(e,n,i,l){let o,s,c;typeof n=="function"&&typeof i!="function"?(s=void 0,c=n,o=i):(s=n,c=i,o=l),Lw(e,s,f,o);function f(h,d){const g=d[d.length-1],m=g?g.children.indexOf(h):void 0;return c(h,m,g)}}const Zh={}.hasOwnProperty,JD={};function WD(e,n){const i=n||JD,l=new Map,o=new Map,s=new Map,c={...LD,...i.handlers},f={all:d,applyData:tO,definitionById:l,footnoteById:o,footnoteCounts:s,footnoteOrder:[],handlers:c,one:h,options:i,patch:eO,wrap:iO};return Up(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const m=g.type==="definition"?l:o,x=String(g.identifier).toUpperCase();m.has(x)||m.set(x,g)}}),f;function h(g,m){const x=g.type,v=f.handlers[x];if(Zh.call(f.handlers,x)&&v)return v(f,g,m);if(f.options.passThrough&&f.options.passThrough.includes(x)){if("children"in g){const{children:E,...C}=g,N=$u(C);return N.children=f.all(g),N}return $u(g)}return(f.options.unknownHandler||nO)(f,g,m)}function d(g){const m=[];if("children"in g){const x=g.children;let v=-1;for(;++v<x.length;){const S=f.one(x[v],g);if(S){if(v&&x[v-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=_1(S.value)),!Array.isArray(S)&&S.type==="element")){const E=S.children[0];E&&E.type==="text"&&(E.value=_1(E.value))}Array.isArray(S)?m.push(...S):m.push(S)}}}return m}}function eO(e,n){e.position&&(n.position=VM(e))}function tO(e,n){let i=n;if(e&&e.data){const l=e.data.hName,o=e.data.hChildren,s=e.data.hProperties;if(typeof l=="string")if(i.type==="element")i.tagName=l;else{const c="children"in i?i.children:[i];i={type:"element",tagName:l,properties:{},children:c}}i.type==="element"&&s&&Object.assign(i.properties,$u(s)),"children"in i&&i.children&&o!==null&&o!==void 0&&(i.children=o)}return i}function nO(e,n){const i=n.data||{},l="value"in n&&!(Zh.call(i,"hProperties")||Zh.call(i,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function iO(e,n){const i=[];let l=-1;for(n&&i.push({type:"text",value:`
|
|
49
|
+
`});++l<e.length;)l&&i.push({type:"text",value:`
|
|
50
|
+
`}),i.push(e[l]);return n&&e.length>0&&i.push({type:"text",value:`
|
|
51
|
+
`}),i}function _1(e){let n=0,i=e.charCodeAt(n);for(;i===9||i===32;)n++,i=e.charCodeAt(n);return e.slice(n)}function C1(e,n){const i=WD(e,n),l=i.one(e,void 0),o=YD(i),s=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
|
|
52
|
+
`},o),s}function rO(e,n){return e&&"run"in e?async function(i,l){const o=C1(i,{file:l,...n});await e.run(o,l)}:function(i,l){return C1(i,{file:l,...e||n})}}function T1(e){if(e)throw e}var lh,A1;function lO(){if(A1)return lh;A1=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,l=Object.getOwnPropertyDescriptor,o=function(d){return typeof Array.isArray=="function"?Array.isArray(d):n.call(d)==="[object Array]"},s=function(d){if(!d||n.call(d)!=="[object Object]")return!1;var g=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!g&&!m)return!1;var x;for(x in d);return typeof x>"u"||e.call(d,x)},c=function(d,g){i&&g.name==="__proto__"?i(d,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):d[g.name]=g.newValue},f=function(d,g){if(g==="__proto__")if(e.call(d,g)){if(l)return l(d,g).value}else return;return d[g]};return lh=function h(){var d,g,m,x,v,S,E=arguments[0],C=1,N=arguments.length,_=!1;for(typeof E=="boolean"&&(_=E,E=arguments[1]||{},C=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});C<N;++C)if(d=arguments[C],d!=null)for(g in d)m=f(E,g),x=f(d,g),E!==x&&(_&&x&&(s(x)||(v=o(x)))?(v?(v=!1,S=m&&o(m)?m:[]):S=m&&s(m)?m:{},c(E,{name:g,newValue:h(_,S,x)})):typeof x<"u"&&c(E,{name:g,newValue:x}));return E},lh}var aO=lO();const ah=Fu(aO);function Qh(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function oO(){const e=[],n={run:i,use:l};return n;function i(...o){let s=-1;const c=o.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...o);function f(h,...d){const g=e[++s];let m=-1;if(h){c(h);return}for(;++m<o.length;)(d[m]===null||d[m]===void 0)&&(d[m]=o[m]);o=d,g?sO(g,f)(...d):c(null,...d)}}function l(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),n}}function sO(e,n){let i;return l;function l(...c){const f=e.length>c.length;let h;f&&c.push(o);try{h=e.apply(this,c)}catch(d){const g=d;if(f&&i)throw g;return o(g)}f||(h&&h.then&&typeof h.then=="function"?h.then(s,o):h instanceof Error?o(h):s(h))}function o(c,...f){i||(i=!0,n(c,...f))}function s(c){o(null,c)}}const Yn={basename:uO,dirname:cO,extname:fO,join:dO,sep:"/"};function uO(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Oo(e);let i=0,l=-1,o=e.length,s;if(n===void 0||n.length===0||n.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(s){i=o+1;break}}else l<0&&(s=!0,l=o+1);return l<0?"":e.slice(i,l)}if(n===e)return"";let c=-1,f=n.length-1;for(;o--;)if(e.codePointAt(o)===47){if(s){i=o+1;break}}else c<0&&(s=!0,c=o+1),f>-1&&(e.codePointAt(o)===n.codePointAt(f--)?f<0&&(l=o):(f=-1,l=c));return i===l?l=c:l<0&&(l=e.length),e.slice(i,l)}function cO(e){if(Oo(e),e.length===0)return".";let n=-1,i=e.length,l;for(;--i;)if(e.codePointAt(i)===47){if(l){n=i;break}}else l||(l=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function fO(e){Oo(e);let n=e.length,i=-1,l=0,o=-1,s=0,c;for(;n--;){const f=e.codePointAt(n);if(f===47){if(c){l=n+1;break}continue}i<0&&(c=!0,i=n+1),f===46?o<0?o=n:s!==1&&(s=1):o>-1&&(s=-1)}return o<0||i<0||s===0||s===1&&o===i-1&&o===l+1?"":e.slice(o,i)}function dO(...e){let n=-1,i;for(;++n<e.length;)Oo(e[n]),e[n]&&(i=i===void 0?e[n]:i+"/"+e[n]);return i===void 0?".":hO(i)}function hO(e){Oo(e);const n=e.codePointAt(0)===47;let i=pO(e,!n);return i.length===0&&!n&&(i="."),i.length>0&&e.codePointAt(e.length-1)===47&&(i+="/"),n?"/"+i:i}function pO(e,n){let i="",l=0,o=-1,s=0,c=-1,f,h;for(;++c<=e.length;){if(c<e.length)f=e.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(o===c-1||s===1))if(o!==c-1&&s===2){if(i.length<2||l!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(h=i.lastIndexOf("/"),h!==i.length-1){h<0?(i="",l=0):(i=i.slice(0,h),l=i.length-1-i.lastIndexOf("/")),o=c,s=0;continue}}else if(i.length>0){i="",l=0,o=c,s=0;continue}}n&&(i=i.length>0?i+"/..":"..",l=2)}else i.length>0?i+="/"+e.slice(o+1,c):i=e.slice(o+1,c),l=c-o-1;o=c,s=0}else f===46&&s>-1?s++:s=-1}return i}function Oo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const mO={cwd:gO};function gO(){return"/"}function Kh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function yO(e){if(typeof e=="string")e=new URL(e);else if(!Kh(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return xO(e)}function xO(e){if(e.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const n=e.pathname;let i=-1;for(;++i<n.length;)if(n.codePointAt(i)===37&&n.codePointAt(i+1)===50){const l=n.codePointAt(i+2);if(l===70||l===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(n)}const oh=["history","path","basename","stem","extname","dirname"];class Bw{constructor(n){let i;n?Kh(n)?i={path:n}:typeof n=="string"||bO(n)?i={value:n}:i=n:i={},this.cwd="cwd"in i?"":mO.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<oh.length;){const s=oh[l];s in i&&i[s]!==void 0&&i[s]!==null&&(this[s]=s==="history"?[...i[s]]:i[s])}let o;for(o in i)oh.includes(o)||(this[o]=i[o])}get basename(){return typeof this.path=="string"?Yn.basename(this.path):void 0}set basename(n){uh(n,"basename"),sh(n,"basename"),this.path=Yn.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?Yn.dirname(this.path):void 0}set dirname(n){M1(this.basename,"dirname"),this.path=Yn.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?Yn.extname(this.path):void 0}set extname(n){if(sh(n,"extname"),M1(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Yn.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Kh(n)&&(n=yO(n)),uh(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?Yn.basename(this.path,this.extname):void 0}set stem(n){uh(n,"stem"),sh(n,"stem"),this.path=Yn.join(this.dirname||"",n+(this.extname||""))}fail(n,i,l){const o=this.message(n,i,l);throw o.fatal=!0,o}info(n,i,l){const o=this.message(n,i,l);return o.fatal=void 0,o}message(n,i,l){const o=new Bt(n,i,l);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function sh(e,n){if(e&&e.includes(Yn.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+Yn.sep+"`")}function uh(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function M1(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function bO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const vO=(function(e){const l=this.constructor.prototype,o=l[e],s=function(){return o.apply(s,arguments)};return Object.setPrototypeOf(s,l),s}),wO={}.hasOwnProperty;class Ip extends vO{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=oO()}copy(){const n=new Ip;let i=-1;for(;++i<this.attachers.length;){const l=this.attachers[i];n.use(...l)}return n.data(ah(!0,{},this.namespace)),n}data(n,i){return typeof n=="string"?arguments.length===2?(dh("data",this.frozen),this.namespace[n]=i,this):wO.call(this.namespace,n)&&this.namespace[n]||void 0:n?(dh("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const o=i.call(n,...l);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const i=yu(n),l=this.parser||this.Parser;return ch("parse",l),l(String(i),i)}process(n,i){const l=this;return this.freeze(),ch("process",this.parser||this.Parser),fh("process",this.compiler||this.Compiler),i?o(void 0,i):new Promise(o);function o(s,c){const f=yu(n),h=l.parse(f);l.run(h,f,function(g,m,x){if(g||!m||!x)return d(g);const v=m,S=l.stringify(v,x);EO(S)?x.value=S:x.result=S,d(g,x)});function d(g,m){g||!m?c(g):s?s(m):i(void 0,m)}}}processSync(n){let i=!1,l;return this.freeze(),ch("processSync",this.parser||this.Parser),fh("processSync",this.compiler||this.Compiler),this.process(n,o),j1("processSync","process",i),l;function o(s,c){i=!0,T1(s),l=c}}run(n,i,l){z1(n),this.freeze();const o=this.transformers;return!l&&typeof i=="function"&&(l=i,i=void 0),l?s(void 0,l):new Promise(s);function s(c,f){const h=yu(i);o.run(n,h,d);function d(g,m,x){const v=m||n;g?f(g):c?c(v):l(void 0,v,x)}}}runSync(n,i){let l=!1,o;return this.run(n,i,s),j1("runSync","run",l),o;function s(c,f){T1(c),o=f,l=!0}}stringify(n,i){this.freeze();const l=yu(i),o=this.compiler||this.Compiler;return fh("stringify",o),z1(n),o(n,l)}use(n,...i){const l=this.attachers,o=this.namespace;if(dh("use",this.frozen),n!=null)if(typeof n=="function")h(n,i);else if(typeof n=="object")Array.isArray(n)?f(n):c(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function s(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[g,...m]=d;h(g,m)}else c(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function c(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(d.plugins),d.settings&&(o.settings=ah(!0,o.settings,d.settings))}function f(d){let g=-1;if(d!=null)if(Array.isArray(d))for(;++g<d.length;){const m=d[g];s(m)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,g){let m=-1,x=-1;for(;++m<l.length;)if(l[m][0]===d){x=m;break}if(x===-1)l.push([d,...g]);else if(g.length>0){let[v,...S]=g;const E=l[x][1];Qh(E)&&Qh(v)&&(v=ah(!0,E,v)),l[x]=[d,v,...S]}}}}const SO=new Ip().freeze();function ch(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function fh(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function dh(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function z1(e){if(!Qh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function j1(e,n,i){if(!i)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function yu(e){return kO(e)?e:new Bw(e)}function kO(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function EO(e){return typeof e=="string"||NO(e)}function NO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _O="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",D1=[],O1={allowDangerousHtml:!0},CO=/^(https?|ircs?|mailto|xmpp)$/i,TO=[{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 R1(e){const n=AO(e),i=MO(e);return zO(n.runSync(n.parse(i),i),e)}function AO(e){const n=e.rehypePlugins||D1,i=e.remarkPlugins||D1,l=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...O1}:O1;return SO().use(cD).use(i).use(rO,l).use(n)}function MO(e){const n=e.children||"",i=new Bw;return typeof n=="string"&&(i.value=n),i}function zO(e,n){const i=n.allowedElements,l=n.allowElement,o=n.components,s=n.disallowedElements,c=n.skipHtml,f=n.unwrapDisallowed,h=n.urlTransform||jO;for(const g of TO)Object.hasOwn(n,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+_O+g.id,void 0);return Up(e,d),GM(e,{Fragment:b.Fragment,components:o,ignoreInvalidStyle:!0,jsx:b.jsx,jsxs:b.jsxs,passKeys:!0,passNode:!0});function d(g,m,x){if(g.type==="raw"&&x&&typeof m=="number")return c?x.children.splice(m,1):x.children[m]={type:"text",value:g.value},m;if(g.type==="element"){let v;for(v in nh)if(Object.hasOwn(nh,v)&&Object.hasOwn(g.properties,v)){const S=g.properties[v],E=nh[v];(E===null||E.includes(g.tagName))&&(g.properties[v]=h(String(S||""),v,g))}}if(g.type==="element"){let v=i?!i.includes(g.tagName):s?s.includes(g.tagName):!1;if(!v&&l&&typeof m=="number"&&(v=!l(g,m,x)),v&&x&&typeof m=="number")return f&&g.children?x.children.splice(m,1,...g.children):x.children.splice(m,1),m}}}function jO(e){const n=e.indexOf(":"),i=e.indexOf("?"),l=e.indexOf("#"),o=e.indexOf("/");return n===-1||o!==-1&&n>o||i!==-1&&n>i||l!==-1&&n>l||CO.test(e.slice(0,n))?e:""}function L1(e,n){const i=String(e);if(typeof n!="string")throw new TypeError("Expected character");let l=0,o=i.indexOf(n);for(;o!==-1;)l++,o=i.indexOf(n,o+n.length);return l}function DO(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function OO(e,n,i){const o=yc((i||{}).ignore||[]),s=RO(n);let c=-1;for(;++c<s.length;)Lw(e,"text",f);function f(d,g){let m=-1,x;for(;++m<g.length;){const v=g[m],S=x?x.children:void 0;if(o(v,S?S.indexOf(v):void 0,x))return;x=v}if(x)return h(d,g)}function h(d,g){const m=g[g.length-1],x=s[c][0],v=s[c][1];let S=0;const C=m.children.indexOf(d);let N=!1,_=[];x.lastIndex=0;let k=x.exec(d.value);for(;k;){const A=k.index,B={index:k.index,input:k.input,stack:[...g,d]};let T=v(...k,B);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T===!1?x.lastIndex=A+1:(S!==A&&_.push({type:"text",value:d.value.slice(S,A)}),Array.isArray(T)?_.push(...T):T&&_.push(T),S=A+k[0].length,N=!0),!x.global)break;k=x.exec(d.value)}return N?(S<d.value.length&&_.push({type:"text",value:d.value.slice(S)}),m.children.splice(C,1,..._)):_=[d],C+_.length}}function RO(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const i=!e[0]||Array.isArray(e[0])?e:[e];let l=-1;for(;++l<i.length;){const o=i[l];n.push([LO(o[0]),BO(o[1])])}return n}function LO(e){return typeof e=="string"?new RegExp(DO(e),"g"):e}function BO(e){return typeof e=="function"?e:function(){return e}}const hh="phrasing",ph=["autolink","link","image","label"];function HO(){return{transforms:[XO],enter:{literalAutolink:IO,literalAutolinkEmail:mh,literalAutolinkHttp:mh,literalAutolinkWww:mh},exit:{literalAutolink:$O,literalAutolinkEmail:YO,literalAutolinkHttp:qO,literalAutolinkWww:VO}}}function UO(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:hh,notInConstruct:ph},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:hh,notInConstruct:ph},{character:":",before:"[ps]",after:"\\/",inConstruct:hh,notInConstruct:ph}]}}function IO(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function mh(e){this.config.enter.autolinkProtocol.call(this,e)}function qO(e){this.config.exit.autolinkProtocol.call(this,e)}function VO(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function YO(e){this.config.exit.autolinkEmail.call(this,e)}function $O(e){this.exit(e)}function XO(e){OO(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,FO],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),GO]],{ignore:["link","linkReference"]})}function FO(e,n,i,l,o){let s="";if(!Hw(o)||(/^w/i.test(n)&&(i=n+i,n="",s="http://"),!PO(i)))return!1;const c=ZO(i+l);if(!c[0])return!1;const f={type:"link",title:null,url:s+n+c[0],children:[{type:"text",value:n+c[0]}]};return c[1]?[f,{type:"text",value:c[1]}]:f}function GO(e,n,i,l){return!Hw(l,!0)||/[-\d_]$/.test(i)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+i,children:[{type:"text",value:n+"@"+i}]}}function PO(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function ZO(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let i=n[0],l=i.indexOf(")");const o=L1(e,"(");let s=L1(e,")");for(;l!==-1&&o>s;)e+=i.slice(0,l+1),i=i.slice(l+1),l=i.indexOf(")"),s++;return[e,i]}function Hw(e,n){const i=e.input.charCodeAt(e.index-1);return(e.index===0||Hr(i)||pc(i))&&(!n||i!==47)}Uw.peek=r6;function QO(){this.buffer()}function KO(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function JO(){this.buffer()}function WO(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function e6(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Rn(this.sliceSerialize(e)).toLowerCase(),i.label=n}function t6(e){this.exit(e)}function n6(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Rn(this.sliceSerialize(e)).toLowerCase(),i.label=n}function i6(e){this.exit(e)}function r6(){return"["}function Uw(e,n,i,l){const o=i.createTracker(l);let s=o.move("[^");const c=i.enter("footnoteReference"),f=i.enter("reference");return s+=o.move(i.safe(i.associationId(e),{after:"]",before:s})),f(),c(),s+=o.move("]"),s}function l6(){return{enter:{gfmFootnoteCallString:QO,gfmFootnoteCall:KO,gfmFootnoteDefinitionLabelString:JO,gfmFootnoteDefinition:WO},exit:{gfmFootnoteCallString:e6,gfmFootnoteCall:t6,gfmFootnoteDefinitionLabelString:n6,gfmFootnoteDefinition:i6}}}function a6(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:i,footnoteReference:Uw},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function i(l,o,s,c){const f=s.createTracker(c);let h=f.move("[^");const d=s.enter("footnoteDefinition"),g=s.enter("label");return h+=f.move(s.safe(s.associationId(l),{before:h,after:"]"})),g(),h+=f.move("]:"),l.children&&l.children.length>0&&(f.shift(4),h+=f.move((n?`
|
|
53
|
+
`:" ")+s.indentLines(s.containerFlow(l,f.current()),n?Iw:o6))),d(),h}}function o6(e,n,i){return n===0?e:Iw(e,n,i)}function Iw(e,n,i){return(i?"":" ")+e}const s6=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];qw.peek=h6;function u6(){return{canContainEols:["delete"],enter:{strikethrough:f6},exit:{strikethrough:d6}}}function c6(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:s6}],handlers:{delete:qw}}}function f6(e){this.enter({type:"delete",children:[]},e)}function d6(e){this.exit(e)}function qw(e,n,i,l){const o=i.createTracker(l),s=i.enter("strikethrough");let c=o.move("~~");return c+=i.containerPhrasing(e,{...o.current(),before:c,after:"~"}),c+=o.move("~~"),s(),c}function h6(){return"~"}function p6(e){return e.length}function m6(e,n){const i=n||{},l=(i.align||[]).concat(),o=i.stringLength||p6,s=[],c=[],f=[],h=[];let d=0,g=-1;for(;++g<e.length;){const E=[],C=[];let N=-1;for(e[g].length>d&&(d=e[g].length);++N<e[g].length;){const _=g6(e[g][N]);if(i.alignDelimiters!==!1){const k=o(_);C[N]=k,(h[N]===void 0||k>h[N])&&(h[N]=k)}E.push(_)}c[g]=E,f[g]=C}let m=-1;if(typeof l=="object"&&"length"in l)for(;++m<d;)s[m]=B1(l[m]);else{const E=B1(l);for(;++m<d;)s[m]=E}m=-1;const x=[],v=[];for(;++m<d;){const E=s[m];let C="",N="";E===99?(C=":",N=":"):E===108?C=":":E===114&&(N=":");let _=i.alignDelimiters===!1?1:Math.max(1,h[m]-C.length-N.length);const k=C+"-".repeat(_)+N;i.alignDelimiters!==!1&&(_=C.length+_+N.length,_>h[m]&&(h[m]=_),v[m]=_),x[m]=k}c.splice(1,0,x),f.splice(1,0,v),g=-1;const S=[];for(;++g<c.length;){const E=c[g],C=f[g];m=-1;const N=[];for(;++m<d;){const _=E[m]||"";let k="",A="";if(i.alignDelimiters!==!1){const B=h[m]-(C[m]||0),T=s[m];T===114?k=" ".repeat(B):T===99?B%2?(k=" ".repeat(B/2+.5),A=" ".repeat(B/2-.5)):(k=" ".repeat(B/2),A=k):A=" ".repeat(B)}i.delimiterStart!==!1&&!m&&N.push("|"),i.padding!==!1&&!(i.alignDelimiters===!1&&_==="")&&(i.delimiterStart!==!1||m)&&N.push(" "),i.alignDelimiters!==!1&&N.push(k),N.push(_),i.alignDelimiters!==!1&&N.push(A),i.padding!==!1&&N.push(" "),(i.delimiterEnd!==!1||m!==d-1)&&N.push("|")}S.push(i.delimiterEnd===!1?N.join("").replace(/ +$/,""):N.join(""))}return S.join(`
|
|
54
|
+
`)}function g6(e){return e==null?"":String(e)}function B1(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function y6(e,n,i,l){const o=i.enter("blockquote"),s=i.createTracker(l);s.move("> "),s.shift(2);const c=i.indentLines(i.containerFlow(e,s.current()),x6);return o(),c}function x6(e,n,i){return">"+(i?"":" ")+e}function b6(e,n){return H1(e,n.inConstruct,!0)&&!H1(e,n.notInConstruct,!1)}function H1(e,n,i){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return i;let l=-1;for(;++l<n.length;)if(e.includes(n[l]))return!0;return!1}function U1(e,n,i,l){let o=-1;for(;++o<i.unsafe.length;)if(i.unsafe[o].character===`
|
|
55
|
+
`&&b6(i.stack,i.unsafe[o]))return/[ \t]/.test(l.before)?"":" ";return`\\
|
|
56
|
+
`}function v6(e,n){const i=String(e);let l=i.indexOf(n),o=l,s=0,c=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===o?++s>c&&(c=s):s=1,o=l+n.length,l=i.indexOf(n,o);return c}function w6(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function S6(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function k6(e,n,i,l){const o=S6(i),s=e.value||"",c=o==="`"?"GraveAccent":"Tilde";if(w6(e,i)){const m=i.enter("codeIndented"),x=i.indentLines(s,E6);return m(),x}const f=i.createTracker(l),h=o.repeat(Math.max(v6(s,o)+1,3)),d=i.enter("codeFenced");let g=f.move(h);if(e.lang){const m=i.enter(`codeFencedLang${c}`);g+=f.move(i.safe(e.lang,{before:g,after:" ",encode:["`"],...f.current()})),m()}if(e.lang&&e.meta){const m=i.enter(`codeFencedMeta${c}`);g+=f.move(" "),g+=f.move(i.safe(e.meta,{before:g,after:`
|
|
57
|
+
`,encode:["`"],...f.current()})),m()}return g+=f.move(`
|
|
58
|
+
`),s&&(g+=f.move(s+`
|
|
59
|
+
`)),g+=f.move(h),d(),g}function E6(e,n,i){return(i?"":" ")+e}function qp(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function N6(e,n,i,l){const o=qp(i),s=o==='"'?"Quote":"Apostrophe",c=i.enter("definition");let f=i.enter("label");const h=i.createTracker(l);let d=h.move("[");return d+=h.move(i.safe(i.associationId(e),{before:d,after:"]",...h.current()})),d+=h.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=i.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(i.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(f=i.enter("destinationRaw"),d+=h.move(i.safe(e.url,{before:d,after:e.title?" ":`
|
|
60
|
+
`,...h.current()}))),f(),e.title&&(f=i.enter(`title${s}`),d+=h.move(" "+o),d+=h.move(i.safe(e.title,{before:d,after:o,...h.current()})),d+=h.move(o),f()),c(),d}function _6(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function So(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Xu(e,n,i){const l=$l(e),o=$l(n);return l===void 0?o===void 0?i==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Vw.peek=C6;function Vw(e,n,i,l){const o=_6(i),s=i.enter("emphasis"),c=i.createTracker(l),f=c.move(o);let h=c.move(i.containerPhrasing(e,{after:o,before:f,...c.current()}));const d=h.charCodeAt(0),g=Xu(l.before.charCodeAt(l.before.length-1),d,o);g.inside&&(h=So(d)+h.slice(1));const m=h.charCodeAt(h.length-1),x=Xu(l.after.charCodeAt(0),m,o);x.inside&&(h=h.slice(0,-1)+So(m));const v=c.move(o);return s(),i.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},f+h+v}function C6(e,n,i){return i.options.emphasis||"*"}function T6(e,n){let i=!1;return Up(e,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return i=!0,Ph}),!!((!e.depth||e.depth<3)&&jp(e)&&(n.options.setext||i))}function A6(e,n,i,l){const o=Math.max(Math.min(6,e.depth||1),1),s=i.createTracker(l);if(T6(e,i)){const g=i.enter("headingSetext"),m=i.enter("phrasing"),x=i.containerPhrasing(e,{...s.current(),before:`
|
|
61
|
+
`,after:`
|
|
62
|
+
`});return m(),g(),x+`
|
|
63
|
+
`+(o===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
64
|
+
`))+1))}const c="#".repeat(o),f=i.enter("headingAtx"),h=i.enter("phrasing");s.move(c+" ");let d=i.containerPhrasing(e,{before:"# ",after:`
|
|
65
|
+
`,...s.current()});return/^[\t ]/.test(d)&&(d=So(d.charCodeAt(0))+d.slice(1)),d=d?c+" "+d:c,i.options.closeAtx&&(d+=" "+c),h(),f(),d}Yw.peek=M6;function Yw(e){return e.value||""}function M6(){return"<"}$w.peek=z6;function $w(e,n,i,l){const o=qp(i),s=o==='"'?"Quote":"Apostrophe",c=i.enter("image");let f=i.enter("label");const h=i.createTracker(l);let d=h.move("![");return d+=h.move(i.safe(e.alt,{before:d,after:"]",...h.current()})),d+=h.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=i.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(i.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(f=i.enter("destinationRaw"),d+=h.move(i.safe(e.url,{before:d,after:e.title?" ":")",...h.current()}))),f(),e.title&&(f=i.enter(`title${s}`),d+=h.move(" "+o),d+=h.move(i.safe(e.title,{before:d,after:o,...h.current()})),d+=h.move(o),f()),d+=h.move(")"),c(),d}function z6(){return"!"}Xw.peek=j6;function Xw(e,n,i,l){const o=e.referenceType,s=i.enter("imageReference");let c=i.enter("label");const f=i.createTracker(l);let h=f.move("![");const d=i.safe(e.alt,{before:h,after:"]",...f.current()});h+=f.move(d+"]["),c();const g=i.stack;i.stack=[],c=i.enter("reference");const m=i.safe(i.associationId(e),{before:h,after:"]",...f.current()});return c(),i.stack=g,s(),o==="full"||!d||d!==m?h+=f.move(m+"]"):o==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function j6(){return"!"}Fw.peek=D6;function Fw(e,n,i){let l=e.value||"",o="`",s=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(l);)o+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++s<i.unsafe.length;){const c=i.unsafe[s],f=i.compilePattern(c);let h;if(c.atBreak)for(;h=f.exec(l);){let d=h.index;l.charCodeAt(d)===10&&l.charCodeAt(d-1)===13&&d--,l=l.slice(0,d)+" "+l.slice(h.index+1)}}return o+l+o}function D6(){return"`"}function Gw(e,n){const i=jp(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(i===e.url||"mailto:"+i===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Pw.peek=O6;function Pw(e,n,i,l){const o=qp(i),s=o==='"'?"Quote":"Apostrophe",c=i.createTracker(l);let f,h;if(Gw(e,i)){const g=i.stack;i.stack=[],f=i.enter("autolink");let m=c.move("<");return m+=c.move(i.containerPhrasing(e,{before:m,after:">",...c.current()})),m+=c.move(">"),f(),i.stack=g,m}f=i.enter("link"),h=i.enter("label");let d=c.move("[");return d+=c.move(i.containerPhrasing(e,{before:d,after:"](",...c.current()})),d+=c.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=i.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(i.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(h=i.enter("destinationRaw"),d+=c.move(i.safe(e.url,{before:d,after:e.title?" ":")",...c.current()}))),h(),e.title&&(h=i.enter(`title${s}`),d+=c.move(" "+o),d+=c.move(i.safe(e.title,{before:d,after:o,...c.current()})),d+=c.move(o),h()),d+=c.move(")"),f(),d}function O6(e,n,i){return Gw(e,i)?"<":"["}Zw.peek=R6;function Zw(e,n,i,l){const o=e.referenceType,s=i.enter("linkReference");let c=i.enter("label");const f=i.createTracker(l);let h=f.move("[");const d=i.containerPhrasing(e,{before:h,after:"]",...f.current()});h+=f.move(d+"]["),c();const g=i.stack;i.stack=[],c=i.enter("reference");const m=i.safe(i.associationId(e),{before:h,after:"]",...f.current()});return c(),i.stack=g,s(),o==="full"||!d||d!==m?h+=f.move(m+"]"):o==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function R6(){return"["}function Vp(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function L6(e){const n=Vp(e),i=e.options.bulletOther;if(!i)return n==="*"?"-":"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(i===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+i+"`) to be different");return i}function B6(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function Qw(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function H6(e,n,i,l){const o=i.enter("list"),s=i.bulletCurrent;let c=e.ordered?B6(i):Vp(i);const f=e.ordered?c==="."?")":".":L6(i);let h=n&&i.bulletLastUsed?c===i.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&g&&(!g.children||!g.children[0])&&i.stack[i.stack.length-1]==="list"&&i.stack[i.stack.length-2]==="listItem"&&i.stack[i.stack.length-3]==="list"&&i.stack[i.stack.length-4]==="listItem"&&i.indexStack[i.indexStack.length-1]===0&&i.indexStack[i.indexStack.length-2]===0&&i.indexStack[i.indexStack.length-3]===0&&(h=!0),Qw(i)===c&&g){let m=-1;for(;++m<e.children.length;){const x=e.children[m];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(c=f),i.bulletCurrent=c;const d=i.containerFlow(e,l);return i.bulletLastUsed=c,i.bulletCurrent=s,o(),d}function U6(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function I6(e,n,i,l){const o=U6(i);let s=i.bulletCurrent||Vp(i);n&&n.type==="list"&&n.ordered&&(s=(typeof n.start=="number"&&n.start>-1?n.start:1)+(i.options.incrementListMarker===!1?0:n.children.indexOf(e))+s);let c=s.length+1;(o==="tab"||o==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(c=Math.ceil(c/4)*4);const f=i.createTracker(l);f.move(s+" ".repeat(c-s.length)),f.shift(c);const h=i.enter("listItem"),d=i.indentLines(i.containerFlow(e,f.current()),g);return h(),d;function g(m,x,v){return x?(v?"":" ".repeat(c))+m:(v?s:s+" ".repeat(c-s.length))+m}}function q6(e,n,i,l){const o=i.enter("paragraph"),s=i.enter("phrasing"),c=i.containerPhrasing(e,l);return s(),o(),c}const V6=yc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Y6(e,n,i,l){return(e.children.some(function(c){return V6(c)})?i.containerPhrasing:i.containerFlow).call(i,e,l)}function $6(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Kw.peek=X6;function Kw(e,n,i,l){const o=$6(i),s=i.enter("strong"),c=i.createTracker(l),f=c.move(o+o);let h=c.move(i.containerPhrasing(e,{after:o,before:f,...c.current()}));const d=h.charCodeAt(0),g=Xu(l.before.charCodeAt(l.before.length-1),d,o);g.inside&&(h=So(d)+h.slice(1));const m=h.charCodeAt(h.length-1),x=Xu(l.after.charCodeAt(0),m,o);x.inside&&(h=h.slice(0,-1)+So(m));const v=c.move(o+o);return s(),i.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},f+h+v}function X6(e,n,i){return i.options.strong||"*"}function F6(e,n,i,l){return i.safe(e.value,l)}function G6(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function P6(e,n,i){const l=(Qw(i)+(i.options.ruleSpaces?" ":"")).repeat(G6(i));return i.options.ruleSpaces?l.slice(0,-1):l}const Jw={blockquote:y6,break:U1,code:k6,definition:N6,emphasis:Vw,hardBreak:U1,heading:A6,html:Yw,image:$w,imageReference:Xw,inlineCode:Fw,link:Pw,linkReference:Zw,list:H6,listItem:I6,paragraph:q6,root:Y6,strong:Kw,text:F6,thematicBreak:P6};function Z6(){return{enter:{table:Q6,tableData:I1,tableHeader:I1,tableRow:J6},exit:{codeText:W6,table:K6,tableData:gh,tableHeader:gh,tableRow:gh}}}function Q6(e){const n=e._align;this.enter({type:"table",align:n.map(function(i){return i==="none"?null:i}),children:[]},e),this.data.inTable=!0}function K6(e){this.exit(e),this.data.inTable=void 0}function J6(e){this.enter({type:"tableRow",children:[]},e)}function gh(e){this.exit(e)}function I1(e){this.enter({type:"tableCell",children:[]},e)}function W6(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,eR));const i=this.stack[this.stack.length-1];i.type,i.value=n,this.exit(e)}function eR(e,n){return n==="|"?n:e}function tR(e){const n=e||{},i=n.tableCellPadding,l=n.tablePipeAlign,o=n.stringLength,s=i?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
66
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:c,tableCell:h,tableRow:f}};function c(v,S,E,C){return d(g(v,E,C),v.align)}function f(v,S,E,C){const N=m(v,E,C),_=d([N]);return _.slice(0,_.indexOf(`
|
|
67
|
+
`))}function h(v,S,E,C){const N=E.enter("tableCell"),_=E.enter("phrasing"),k=E.containerPhrasing(v,{...C,before:s,after:s});return _(),N(),k}function d(v,S){return m6(v,{align:S,alignDelimiters:l,padding:i,stringLength:o})}function g(v,S,E){const C=v.children;let N=-1;const _=[],k=S.enter("table");for(;++N<C.length;)_[N]=m(C[N],S,E);return k(),_}function m(v,S,E){const C=v.children;let N=-1;const _=[],k=S.enter("tableRow");for(;++N<C.length;)_[N]=h(C[N],v,S,E);return k(),_}function x(v,S,E){let C=Jw.inlineCode(v,S,E);return E.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function nR(){return{exit:{taskListCheckValueChecked:q1,taskListCheckValueUnchecked:q1,paragraph:rR}}}function iR(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:lR}}}function q1(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function rR(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const i=this.stack[this.stack.length-1];i.type;const l=i.children[0];if(l&&l.type==="text"){const o=n.children;let s=-1,c;for(;++s<o.length;){const f=o[s];if(f.type==="paragraph"){c=f;break}}c===i&&(l.value=l.value.slice(1),l.value.length===0?i.children.shift():i.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,i.position.start=Object.assign({},l.position.start)))}}this.exit(e)}function lR(e,n,i,l){const o=e.children[0],s=typeof e.checked=="boolean"&&o&&o.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",f=i.createTracker(l);s&&f.move(c);let h=Jw.listItem(e,n,i,{...l,...f.current()});return s&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),h;function d(g){return g+c}}function aR(){return[HO(),l6(),u6(),Z6(),nR()]}function oR(e){return{extensions:[UO(),a6(e),c6(),tR(e),iR()]}}const sR={tokenize:pR,partial:!0},Ww={tokenize:mR,partial:!0},eS={tokenize:gR,partial:!0},tS={tokenize:yR,partial:!0},uR={tokenize:xR,partial:!0},nS={name:"wwwAutolink",tokenize:dR,previous:rS},iS={name:"protocolAutolink",tokenize:hR,previous:lS},_i={name:"emailAutolink",tokenize:fR,previous:aS},Kn={};function cR(){return{text:Kn}}let Ar=48;for(;Ar<123;)Kn[Ar]=_i,Ar++,Ar===58?Ar=65:Ar===91&&(Ar=97);Kn[43]=_i;Kn[45]=_i;Kn[46]=_i;Kn[95]=_i;Kn[72]=[_i,iS];Kn[104]=[_i,iS];Kn[87]=[_i,nS];Kn[119]=[_i,nS];function fR(e,n,i){const l=this;let o,s;return c;function c(m){return!Jh(m)||!aS.call(l,l.previous)||Yp(l.events)?i(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(m))}function f(m){return Jh(m)?(e.consume(m),f):m===64?(e.consume(m),h):i(m)}function h(m){return m===46?e.check(uR,g,d)(m):m===45||m===95||Lt(m)?(s=!0,e.consume(m),h):g(m)}function d(m){return e.consume(m),o=!0,h}function g(m){return s&&o&&qt(l.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(m)):i(m)}}function dR(e,n,i){const l=this;return o;function o(c){return c!==87&&c!==119||!rS.call(l,l.previous)||Yp(l.events)?i(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(sR,e.attempt(Ww,e.attempt(eS,s),i),i)(c))}function s(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(c)}}function hR(e,n,i){const l=this;let o="",s=!1;return c;function c(m){return(m===72||m===104)&&lS.call(l,l.previous)&&!Yp(l.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(m),e.consume(m),f):i(m)}function f(m){if(qt(m)&&o.length<5)return o+=String.fromCodePoint(m),e.consume(m),f;if(m===58){const x=o.toLowerCase();if(x==="http"||x==="https")return e.consume(m),h}return i(m)}function h(m){return m===47?(e.consume(m),s?d:(s=!0,h)):i(m)}function d(m){return m===null||Vu(m)||tt(m)||Hr(m)||pc(m)?i(m):e.attempt(Ww,e.attempt(eS,g),i)(m)}function g(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(m)}}function pR(e,n,i){let l=0;return o;function o(c){return(c===87||c===119)&&l<3?(l++,e.consume(c),o):c===46&&l===3?(e.consume(c),s):i(c)}function s(c){return c===null?i(c):n(c)}}function mR(e,n,i){let l,o,s;return c;function c(d){return d===46||d===95?e.check(tS,h,f)(d):d===null||tt(d)||Hr(d)||d!==45&&pc(d)?h(d):(s=!0,e.consume(d),c)}function f(d){return d===95?l=!0:(o=l,l=void 0),e.consume(d),c}function h(d){return o||l||!s?i(d):n(d)}}function gR(e,n){let i=0,l=0;return o;function o(c){return c===40?(i++,e.consume(c),o):c===41&&l<i?s(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(tS,n,s)(c):c===null||tt(c)||Hr(c)?n(c):(e.consume(c),o)}function s(c){return c===41&&l++,e.consume(c),o}}function yR(e,n,i){return l;function l(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),l):f===38?(e.consume(f),s):f===93?(e.consume(f),o):f===60||f===null||tt(f)||Hr(f)?n(f):i(f)}function o(f){return f===null||f===40||f===91||tt(f)||Hr(f)?n(f):l(f)}function s(f){return qt(f)?c(f):i(f)}function c(f){return f===59?(e.consume(f),l):qt(f)?(e.consume(f),c):i(f)}}function xR(e,n,i){return l;function l(s){return e.consume(s),o}function o(s){return Lt(s)?i(s):n(s)}}function rS(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||tt(e)}function lS(e){return!qt(e)}function aS(e){return!(e===47||Jh(e))}function Jh(e){return e===43||e===45||e===46||e===95||Lt(e)}function Yp(e){let n=e.length,i=!1;for(;n--;){const l=e[n][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){i=!0;break}if(l._gfmAutolinkLiteralWalkedInto){i=!1;break}}return e.length>0&&!i&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),i}const bR={tokenize:CR,partial:!0};function vR(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:ER,continuation:{tokenize:NR},exit:_R}},text:{91:{name:"gfmFootnoteCall",tokenize:kR},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:wR,resolveTo:SR}}}}function wR(e,n,i){const l=this;let o=l.events.length;const s=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let c;for(;o--;){const h=l.events[o][1];if(h.type==="labelImage"){c=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return f;function f(h){if(!c||!c._balanced)return i(h);const d=Rn(l.sliceSerialize({start:c.end,end:l.now()}));return d.codePointAt(0)!==94||!s.includes(d.slice(1))?i(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),n(h))}}function SR(e,n){let i=e.length;for(;i--;)if(e[i][1].type==="labelImage"&&e[i][0]==="enter"){e[i][1];break}e[i+1][1].type="data",e[i+3][1].type="gfmFootnoteCallLabelMarker";const l={type:"gfmFootnoteCall",start:Object.assign({},e[i+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[i+3][1].end),end:Object.assign({},e[i+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},f=[e[i+1],e[i+2],["enter",l,n],e[i+3],e[i+4],["enter",o,n],["exit",o,n],["enter",s,n],["enter",c,n],["exit",c,n],["exit",s,n],e[e.length-2],e[e.length-1],["exit",l,n]];return e.splice(i,e.length-i+1,...f),e}function kR(e,n,i){const l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let s=0,c;return f;function f(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),h}function h(m){return m!==94?i(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(s>999||m===93&&!c||m===null||m===91||tt(m))return i(m);if(m===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return o.includes(Rn(l.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):i(m)}return tt(m)||(c=!0),s++,e.consume(m),m===92?g:d}function g(m){return m===91||m===92||m===93?(e.consume(m),s++,d):d(m)}}function ER(e,n,i){const l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let s,c=0,f;return h;function h(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):i(S)}function g(S){if(c>999||S===93&&!f||S===null||S===91||tt(S))return i(S);if(S===93){e.exit("chunkString");const E=e.exit("gfmFootnoteDefinitionLabelString");return s=Rn(l.sliceSerialize(E)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return tt(S)||(f=!0),c++,e.consume(S),S===92?m:g}function m(S){return S===91||S===92||S===93?(e.consume(S),c++,g):g(S)}function x(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),o.includes(s)||o.push(s),qe(e,v,"gfmFootnoteDefinitionWhitespace")):i(S)}function v(S){return n(S)}}function NR(e,n,i){return e.check(Do,n,e.attempt(bR,n,i))}function _R(e){e.exit("gfmFootnoteDefinition")}function CR(e,n,i){const l=this;return qe(e,o,"gfmFootnoteDefinitionIndent",5);function o(s){const c=l.events[l.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?n(s):i(s)}}function TR(e){let i=(e||{}).singleTilde;const l={name:"strikethrough",tokenize:s,resolveAll:o};return i==null&&(i=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function o(c,f){let h=-1;for(;++h<c.length;)if(c[h][0]==="enter"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._close){let d=h;for(;d--;)if(c[d][0]==="exit"&&c[d][1].type==="strikethroughSequenceTemporary"&&c[d][1]._open&&c[h][1].end.offset-c[h][1].start.offset===c[d][1].end.offset-c[d][1].start.offset){c[h][1].type="strikethroughSequence",c[d][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},c[d][1].start),end:Object.assign({},c[h][1].end)},m={type:"strikethroughText",start:Object.assign({},c[d][1].end),end:Object.assign({},c[h][1].start)},x=[["enter",g,f],["enter",c[d][1],f],["exit",c[d][1],f],["enter",m,f]],v=f.parser.constructs.insideSpan.null;v&&dn(x,x.length,0,mc(v,c.slice(d+1,h),f)),dn(x,x.length,0,[["exit",m,f],["enter",c[h][1],f],["exit",c[h][1],f],["exit",g,f]]),dn(c,d-1,h-d+3,x),h=d+x.length-2;break}}for(h=-1;++h<c.length;)c[h][1].type==="strikethroughSequenceTemporary"&&(c[h][1].type="data");return c}function s(c,f,h){const d=this.previous,g=this.events;let m=0;return x;function x(S){return d===126&&g[g.length-1][1].type!=="characterEscape"?h(S):(c.enter("strikethroughSequenceTemporary"),v(S))}function v(S){const E=$l(d);if(S===126)return m>1?h(S):(c.consume(S),m++,v);if(m<2&&!i)return h(S);const C=c.exit("strikethroughSequenceTemporary"),N=$l(S);return C._open=!N||N===2&&!!E,C._close=!E||E===2&&!!N,f(S)}}}class AR{constructor(){this.map=[]}add(n,i,l){MR(this,n,i,l)}consume(n){if(this.map.sort(function(s,c){return s[0]-c[0]}),this.map.length===0)return;let i=this.map.length;const l=[];for(;i>0;)i-=1,l.push(n.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),n.length=this.map[i][0];l.push(n.slice()),n.length=0;let o=l.pop();for(;o;){for(const s of o)n.push(s);o=l.pop()}this.map.length=0}}function MR(e,n,i,l){let o=0;if(!(i===0&&l.length===0)){for(;o<e.map.length;){if(e.map[o][0]===n){e.map[o][1]+=i,e.map[o][2].push(...l);return}o+=1}e.map.push([n,i,l])}}function zR(e,n){let i=!1;const l=[];for(;n<e.length;){const o=e[n];if(i){if(o[0]==="enter")o[1].type==="tableContent"&&l.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const s=l.length-1;l[s]=l[s]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(i=!0);n+=1}return l}function jR(){return{flow:{null:{name:"table",tokenize:DR,resolveAll:OR}}}}function DR(e,n,i){const l=this;let o=0,s=0,c;return f;function f(H){let U=l.events.length-1;for(;U>-1;){const R=l.events[U][1].type;if(R==="lineEnding"||R==="linePrefix")U--;else break}const Y=U>-1?l.events[U][1].type:null,ee=Y==="tableHead"||Y==="tableRow"?T:h;return ee===T&&l.parser.lazy[l.now().line]?i(H):ee(H)}function h(H){return e.enter("tableHead"),e.enter("tableRow"),d(H)}function d(H){return H===124||(c=!0,s+=1),g(H)}function g(H){return H===null?i(H):ve(H)?s>1?(s=0,l.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),v):i(H):Re(H)?qe(e,g,"whitespace")(H):(s+=1,c&&(c=!1,o+=1),H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),c=!0,g):(e.enter("data"),m(H)))}function m(H){return H===null||H===124||tt(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 v(H){return l.interrupt=!1,l.parser.lazy[l.now().line]?i(H):(e.enter("tableDelimiterRow"),c=!1,Re(H)?qe(e,S,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):S(H))}function S(H){return H===45||H===58?C(H):H===124?(c=!0,e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),E):B(H)}function E(H){return Re(H)?qe(e,C,"whitespace")(H):C(H)}function C(H){return H===58?(s+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),N):H===45?(s+=1,N(H)):H===null||ve(H)?A(H):B(H)}function N(H){return H===45?(e.enter("tableDelimiterFiller"),_(H)):B(H)}function _(H){return H===45?(e.consume(H),_):H===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(H))}function k(H){return Re(H)?qe(e,A,"whitespace")(H):A(H)}function A(H){return H===124?S(H):H===null||ve(H)?!c||o!==s?B(H):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(H)):B(H)}function B(H){return i(H)}function T(H){return e.enter("tableRow"),L(H)}function L(H){return H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),L):H===null||ve(H)?(e.exit("tableRow"),n(H)):Re(H)?qe(e,L,"whitespace")(H):(e.enter("data"),P(H))}function P(H){return H===null||H===124||tt(H)?(e.exit("data"),L(H)):(e.consume(H),H===92?Z:P)}function Z(H){return H===92||H===124?(e.consume(H),P):P(H)}}function OR(e,n){let i=-1,l=!0,o=0,s=[0,0,0,0],c=[0,0,0,0],f=!1,h=0,d,g,m;const x=new AR;for(;++i<e.length;){const v=e[i],S=v[1];v[0]==="enter"?S.type==="tableHead"?(f=!1,h!==0&&(V1(x,n,h,d,g),g=void 0,h=0),d={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},x.add(i,0,[["enter",d,n]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(l=!0,m=void 0,s=[0,0,0,0],c=[0,i+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},x.add(i,0,[["enter",g,n]])),o=S.type==="tableDelimiterRow"?2:g?3:1):o&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(l=!1,c[2]===0&&(s[1]!==0&&(c[0]=c[1],m=xu(x,n,s,o,void 0,m),s=[0,0,0,0]),c[2]=i)):S.type==="tableCellDivider"&&(l?l=!1:(s[1]!==0&&(c[0]=c[1],m=xu(x,n,s,o,void 0,m)),s=c,c=[s[1],i,0,0])):S.type==="tableHead"?(f=!0,h=i):S.type==="tableRow"||S.type==="tableDelimiterRow"?(h=i,s[1]!==0?(c[0]=c[1],m=xu(x,n,s,o,i,m)):c[1]!==0&&(m=xu(x,n,c,o,i,m)),o=0):o&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(c[3]=i)}for(h!==0&&V1(x,n,h,d,g),x.consume(n.events),i=-1;++i<n.events.length;){const v=n.events[i];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=zR(n.events,i))}return e}function xu(e,n,i,l,o,s){const c=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",f="tableContent";i[0]!==0&&(s.end=Object.assign({},Al(n.events,i[0])),e.add(i[0],0,[["exit",s,n]]));const h=Al(n.events,i[1]);if(s={type:c,start:Object.assign({},h),end:Object.assign({},h)},e.add(i[1],0,[["enter",s,n]]),i[2]!==0){const d=Al(n.events,i[2]),g=Al(n.events,i[3]),m={type:f,start:Object.assign({},d),end:Object.assign({},g)};if(e.add(i[2],0,[["enter",m,n]]),l!==2){const x=n.events[i[2]],v=n.events[i[3]];if(x[1].end=Object.assign({},v[1].end),x[1].type="chunkText",x[1].contentType="text",i[3]>i[2]+1){const S=i[2]+1,E=i[3]-i[2]-1;e.add(S,E,[])}}e.add(i[3]+1,0,[["exit",m,n]])}return o!==void 0&&(s.end=Object.assign({},Al(n.events,o)),e.add(o,0,[["exit",s,n]]),s=void 0),s}function V1(e,n,i,l,o){const s=[],c=Al(n.events,i);o&&(o.end=Object.assign({},c),s.push(["exit",o,n])),l.end=Object.assign({},c),s.push(["exit",l,n]),e.add(i+1,0,s)}function Al(e,n){const i=e[n],l=i[0]==="enter"?"start":"end";return i[1][l]}const RR={name:"tasklistCheck",tokenize:BR};function LR(){return{text:{91:RR}}}function BR(e,n,i){const l=this;return o;function o(h){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?i(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),s)}function s(h){return tt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),c):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),c):i(h)}function c(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):i(h)}function f(h){return ve(h)?n(h):Re(h)?e.check({tokenize:HR},n,i)(h):i(h)}}function HR(e,n,i){return qe(e,l,"whitespace");function l(o){return o===null?i(o):n(o)}}function UR(e){return yw([cR(),vR(),TR(e),jR(),LR()])}const IR={};function Y1(e){const n=this,i=e||IR,l=n.data(),o=l.micromarkExtensions||(l.micromarkExtensions=[]),s=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),c=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);o.push(UR(i)),s.push(aR()),c.push(oR(i))}function qR(){const{isRunning:e,results:n,workflowResults:i,logs:l}=Xl(),{nodes:o,selectedNodeId:s,updateNode:c}=Pn(),f=Pn(Bv),{execute:h,savedOutputDir:d}=Kv(),[g,m]=G.useState("");G.useEffect(()=>{if(f?.type==="input"){const _=f.data;m(_.value||"")}},[s,f]);const x=o.filter(_=>_.type==="output"),v=x.length>0?n.get(x[0].id):null,S=f?.type==="input",E=S?f.data:null,C=_=>{m(_),s&&c(s,{value:_})},N=()=>{h()};return b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(Dv,{className:"w-5 h-5 text-gray-400"}),b.jsx("h3",{className:"text-lg font-semibold text-white",children:"Preview"})]}),e&&b.jsx("span",{className:"text-sm text-blue-400 animate-pulse",children:"Running..."})]}),e&&b.jsx("div",{className:"p-4 border-b border-border",children:b.jsx("div",{className:"space-y-3",children:o.map(_=>b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("div",{className:`w-2 h-2 rounded-full ${_.data.status==="completed"?"bg-green-500":_.data.status==="running"?"bg-blue-500 animate-pulse":_.data.status==="error"?"bg-red-500":"bg-gray-500"}`}),b.jsx("span",{className:"text-sm text-gray-300",children:_.data.label}),_.data.status==="running"&&_.data.progress!==void 0&&b.jsxs("span",{className:"text-xs text-gray-500",children:[_.data.progress,"%"]})]},_.id))})}),b.jsxs("div",{className:"p-4 border-b border-border",children:[b.jsxs("button",{onClick:N,disabled:e||o.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:[b.jsx(xo,{className:"w-4 h-4"}),e?"Running...":"Run Workflow"]}),o.length===0&&b.jsx("p",{className:"text-xs text-gray-500 text-center mt-2",children:"노드를 추가해주세요"})]}),b.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[S&&E&&b.jsxs("div",{className:"space-y-4 mb-4 p-4 bg-surface rounded-lg border border-border",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(oc,{className:"w-5 h-5 text-amber-500"}),b.jsx("h4",{className:"text-md font-medium text-white",children:E.label})]}),E.inputType==="text"&&b.jsxs("div",{className:"space-y-2",children:[b.jsx("label",{className:"text-sm text-gray-400",children:E.description||"Enter your input"}),b.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:E.placeholder||"Type your message here...",value:g||E.value||"",onChange:_=>C(_.target.value)})]}),E.inputType==="file"&&b.jsxs("div",{className:"space-y-2",children:[b.jsx("label",{className:"text-sm text-gray-400",children:E.description||"Upload a file"}),b.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:[b.jsx(LA,{className:"w-8 h-8 text-gray-500 mb-2"}),b.jsx("p",{className:"text-sm text-gray-400",children:"Drop files here or click to upload"}),E.fileTypes&&b.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Supported: ",E.fileTypes.join(", ")]})]})]}),E.inputType==="select"&&E.options&&b.jsxs("div",{className:"space-y-2",children:[b.jsx("label",{className:"text-sm text-gray-400",children:E.description||"Select an option"}),b.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:g||E.value||"",onChange:_=>C(_.target.value),children:[b.jsx("option",{value:"",children:"Select..."}),E.options.map(_=>b.jsx("option",{value:_,children:_},_))]})]})]}),d&&b.jsxs("div",{className:"mb-4 p-4 bg-green-900/20 border border-green-700 rounded-lg",children:[b.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[b.jsx(Oh,{className:"w-5 h-5 text-green-400"}),b.jsx("h4",{className:"text-sm font-medium text-green-300",children:"파일 저장 완료"})]}),b.jsx("p",{className:"text-xs text-gray-400 break-all",children:d})]}),i.length>0?b.jsx("div",{className:"space-y-4",children:i.map(_=>b.jsxs("div",{className:`p-4 rounded-lg border ${_.success?"bg-surface border-border":"bg-red-900/20 border-red-700"}`,children:[b.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[_.success?b.jsx(ac,{className:"w-5 h-5 text-green-500"}):b.jsx(xp,{className:"w-5 h-5 text-red-500"}),b.jsx("h5",{className:"text-sm font-medium text-white",children:_.label})]}),_.error&&b.jsx("p",{className:"text-sm text-red-400 mb-3",children:_.error}),_.files&&_.files.length>0&&b.jsxs("div",{className:"space-y-2 mb-3",children:[b.jsx("p",{className:"text-xs text-gray-400",children:"생성된 파일:"}),_.files.map((k,A)=>b.jsxs("div",{className:"flex items-center gap-2 p-2 bg-surface-hover rounded",children:[k.type==="image"?b.jsx(Ov,{className:"w-4 h-4 text-purple-400"}):b.jsx(yo,{className:"w-4 h-4 text-blue-400"}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("p",{className:"text-sm text-white truncate",children:k.name}),b.jsx("p",{className:"text-xs text-gray-500 truncate",children:k.path})]})]},A))]}),_.result&&b.jsxs("details",{className:"group",open:!0,children:[b.jsx("summary",{className:"text-xs text-gray-400 cursor-pointer hover:text-gray-300",children:"결과 보기"}),b.jsx("div",{className:"mt-2 p-2 bg-black/30 rounded max-h-64 overflow-y-auto",children:b.jsx("div",{className:"markdown-content text-sm",children:b.jsx(R1,{remarkPlugins:[Y1],children:_.result.length>2e3?_.result.substring(0,2e3)+"...":_.result})})})]})]},_.nodeId))}):v?b.jsx("div",{className:"markdown-content",children:b.jsx(R1,{remarkPlugins:[Y1],children:typeof v=="string"?v:JSON.stringify(v,null,2)})}):l.length>0?b.jsxs("div",{className:"space-y-2",children:[b.jsx("h4",{className:"text-sm font-medium text-white mb-3",children:"실행 로그"}),l.slice(-20).map(_=>b.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[b.jsx("span",{className:"text-gray-500 shrink-0",children:new Date(_.timestamp).toLocaleTimeString("ko-KR")}),b.jsx("span",{className:_.level==="error"?"text-red-400":_.level==="warning"?"text-yellow-400":_.level==="success"?"text-green-400":"text-gray-300",children:_.message})]},_.id))]}):b.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500",children:[b.jsx(yo,{className:"w-12 h-12 mb-4 opacity-50"}),b.jsx("p",{className:"text-sm",children:"Run the workflow to see results"}),b.jsx("p",{className:"text-xs mt-2",children:"노드를 연결하고 Run Workflow 버튼을 클릭하세요"})]})]})]})}function oS({level:e}){switch(e){case"success":return b.jsx(ac,{className:"w-4 h-4 text-green-400"});case"error":return b.jsx(xp,{className:"w-4 h-4 text-red-400"});case"warning":return b.jsx(OA,{className:"w-4 h-4 text-yellow-400"});default:return b.jsx(oA,{className:"w-4 h-4 text-blue-400"})}}function sS(e){return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function VR({isOpen:e,onClose:n}){const{logs:i,clearLogs:l,isRunning:o}=Xl(),[s,c]=G.useState(!1),[f,h]=G.useState(250),d=G.useRef(null);G.useEffect(()=>{d.current&&!s&&d.current.scrollIntoView({behavior:"smooth"})},[i,s]);const g=m=>{m.preventDefault();const x=m.clientY,v=f,S=C=>{const N=x-C.clientY,_=Math.min(Math.max(v+N,100),500);h(_)},E=()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",E)};document.addEventListener("mousemove",S),document.addEventListener("mouseup",E)};return e?b.jsxs("div",{className:"fixed bottom-0 left-0 right-0 bg-[#1a1a1a] border-t border-gray-700 z-50 shadow-2xl",style:{height:s?40:f},children:[!s&&b.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 cursor-ns-resize hover:bg-amber-500 transition-colors",onMouseDown:g}),b.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-[#252525] border-b border-gray-700",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(sc,{className:"w-4 h-4 text-amber-500"}),b.jsx("span",{className:"text-sm font-medium text-white",children:"Console"}),o&&b.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-500/20 text-blue-400 rounded",children:[b.jsx("span",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full animate-pulse"}),"Running"]}),b.jsxs("span",{className:"text-xs text-gray-500",children:["(",i.length," logs)"]})]}),b.jsxs("div",{className:"flex items-center gap-1",children:[b.jsx("button",{onClick:l,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Clear logs",children:b.jsx(bo,{className:"w-4 h-4 text-gray-400"})}),b.jsx("button",{onClick:()=>c(!s),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:s?"Expand":"Minimize",children:s?b.jsx(YT,{className:"w-4 h-4 text-gray-400"}):b.jsx(jv,{className:"w-4 h-4 text-gray-400"})}),b.jsx("button",{onClick:()=>h(f===250?400:250),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Toggle size",children:f>250?b.jsx(yA,{className:"w-4 h-4 text-gray-400"}):b.jsx(pA,{className:"w-4 h-4 text-gray-400"})}),b.jsx("button",{onClick:n,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Close",children:b.jsx(bp,{className:"w-4 h-4 text-gray-400"})})]})]}),!s&&b.jsx("div",{className:"overflow-y-auto font-mono text-sm p-3",style:{height:f-44},children:i.length===0?b.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:b.jsx("p",{children:"No logs yet. Run the workflow to see output."})}):b.jsxs("div",{className:"space-y-1",children:[i.map(m=>b.jsxs("div",{className:It("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:[b.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",sS(m.timestamp),"]"]}),b.jsx(oS,{level:m.level}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("span",{className:It("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&&b.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",m.nodeId.slice(0,8),"]"]}),m.details&&b.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)),b.jsx("div",{ref:d})]})})]}):null}function YR(){const{logs:e,clearLogs:n,isRunning:i}=Xl(),l=G.useRef(null);return G.useEffect(()=>{l.current&&l.current.scrollIntoView({behavior:"smooth"})},[e]),b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(sc,{className:"w-5 h-5 text-amber-500"}),b.jsx("h3",{className:"text-lg font-semibold text-white",children:"Console"}),i&&b.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-500/20 text-blue-400 rounded",children:[b.jsx("span",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full animate-pulse"}),"Running"]}),b.jsxs("span",{className:"text-xs text-gray-500",children:["(",e.length," logs)"]})]}),b.jsx("button",{onClick:n,className:"p-2 text-gray-400 hover:text-white hover:bg-surface-hover rounded-lg transition-colors",title:"Clear logs",children:b.jsx(bo,{className:"w-4 h-4"})})]}),b.jsx("div",{className:"flex-1 overflow-y-auto p-4 font-mono text-sm",children:e.length===0?b.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:b.jsx("p",{children:"No logs yet. Run the workflow to see output."})}):b.jsxs("div",{className:"space-y-1",children:[e.map(o=>b.jsxs("div",{className:It("flex items-start gap-2 px-2 py-1 rounded hover:bg-surface-hover",o.level==="error"&&"bg-red-500/10",o.level==="warning"&&"bg-yellow-500/10",o.level==="success"&&"bg-green-500/10"),children:[b.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",sS(o.timestamp),"]"]}),b.jsx(oS,{level:o.level}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("span",{className:It("text-xs",o.level==="error"&&"text-red-400",o.level==="warning"&&"text-yellow-400",o.level==="success"&&"text-green-400",o.level==="info"&&"text-gray-300"),children:o.message}),o.nodeId&&b.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",o.nodeId.slice(0,8),"]"]}),o.details&&b.jsx("pre",{className:"mt-1 p-2 bg-black/30 rounded text-xs text-gray-400 overflow-x-auto",children:typeof o.details=="string"?o.details:JSON.stringify(o.details,null,2)})]})]},o.id)),b.jsx("div",{ref:l})]})})]})}const $R=["Read","Write","Edit","Bash","Glob","Grep","WebSearch","WebFetch","Task","TodoWrite"],XR=[{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","커밋","푸시"]}],FR=[{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 GR(e){switch(e){case"input":return b.jsx(oc,{className:"w-5 h-5 text-yellow-400"});case"agent":return b.jsx(Mo,{className:"w-5 h-5 text-purple-400"});case"skill":return b.jsx(uc,{className:"w-5 h-5 text-cyan-400"});case"hook":return b.jsx(yp,{className:"w-5 h-5 text-pink-400"});case"output":return b.jsx(lc,{className:"w-5 h-5 text-emerald-400"});default:return null}}function PR(e){switch(e){case"input":return"User Input";case"agent":return"Agent";case"skill":return"Skill";case"hook":return"Hook";case"output":return"Output";default:return"Node"}}function ZR({node:e}){const{updateNode:n,removeNode:i,nodes:l}=Pn(),[o,s]=G.useState(!1),c=G.useRef(null),f=G.useCallback(v=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{tw(v).catch(S=>{console.error("Failed to sync node to filesystem:",S)})},500)},[]);if(G.useEffect(()=>(e&&e.type!=="input"&&e.type!=="output"&&f(e),()=>{c.current&&clearTimeout(c.current)}),[e,f]),!e)return b.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500 p-8",children:[b.jsx(TA,{className:"w-12 h-12 mb-4 opacity-50"}),b.jsx("p",{className:"text-center",children:"Select a node to configure its settings"})]});const h=()=>{e.type!=="input"&&e.type!=="output"?s(!0):i(e.id)},d=()=>{nw(e,l).catch(v=>{console.error("Failed to delete node from filesystem:",v)}),i(e.id),s(!1)},g=()=>{s(!1)},m=v=>{n(e.id,{label:v})},x=v=>{n(e.id,{description:v})};return b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border bg-surface-hover/50",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("div",{className:"p-2 rounded-lg bg-surface",children:GR(e.type)}),b.jsxs("div",{children:[b.jsx("h3",{className:"text-base font-semibold text-white",children:e.data.label}),b.jsx("p",{className:"text-xs text-gray-500",children:PR(e.type)})]})]}),b.jsx("button",{onClick:h,className:"p-2 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded-lg transition-colors",title:"Delete node",children:b.jsx(bo,{className:"w-4 h-4"})})]}),b.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-5",children:[b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Name"}),b.jsx("input",{type:"text",value:e.data.label,onChange:v=>m(v.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"})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:e.type==="agent"?"Prompt":"Description"}),b.jsx("textarea",{value:e.data.description||"",onChange:v=>x(v.target.value),rows:4,placeholder:e.type==="agent"?"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"&&b.jsx(QR,{data:e.data,onUpdate:v=>n(e.id,v)}),e.type==="agent"&&b.jsx(KR,{data:e.data,onUpdate:v=>n(e.id,v)}),e.type==="skill"&&b.jsx(JR,{data:e.data,onUpdate:v=>n(e.id,v)}),e.type==="hook"&&b.jsx(WR,{data:e.data,onUpdate:v=>n(e.id,v)}),e.type==="output"&&b.jsx(e8,{onUpdate:v=>n(e.id,v)})]}),o&&b.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:b.jsxs("div",{className:"bg-zinc-800 rounded-lg p-6 max-w-md w-full mx-4 border border-zinc-700 shadow-xl",children:[b.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[b.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500/20 flex items-center justify-center",children:b.jsx(bo,{className:"w-5 h-5 text-red-400"})}),b.jsx("h3",{className:"text-lg font-semibold text-white",children:"노드 삭제 확인"})]}),b.jsxs("p",{className:"text-zinc-300 mb-4",children:[b.jsx("span",{className:"font-medium text-white",children:e.data.label})," 노드를 삭제하시겠습니까?",b.jsx("br",{}),b.jsx("span",{className:"text-red-400 text-sm",children:"이 작업은 파일을 삭제하며 되돌릴 수 없습니다."})]}),b.jsxs("div",{className:"flex gap-3 justify-end",children:[b.jsx("button",{onClick:g,className:"px-4 py-2 rounded-md bg-zinc-700 text-zinc-300 hover:bg-zinc-600 transition-colors",children:"취소"}),b.jsx("button",{onClick:d,className:"px-4 py-2 rounded-md bg-red-600 text-white hover:bg-red-500 transition-colors",children:"삭제"})]})]})})]})}function QR({data:e,onUpdate:n}){return b.jsxs(b.Fragment,{children:[b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Input Type"}),b.jsx("div",{className:"grid grid-cols-3 gap-2",children:["text","file","select"].map(i=>b.jsx("button",{onClick:()=>n({inputType:i}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.inputType===i?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:i.charAt(0).toUpperCase()+i.slice(1)},i))})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Default Value"}),b.jsx("textarea",{value:e.value||"",onChange:i=>n({value:i.target.value}),rows:3,placeholder:"Enter default value...",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent resize-none"})]})]})}function KR({data:e,onUpdate:n}){return b.jsxs(b.Fragment,{children:[b.jsxs("div",{children:[b.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Model"}),b.jsx("div",{className:"space-y-2",children:FR.map(i=>b.jsxs("button",{onClick:()=>n({model:i.id}),className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-colors ${e.model===i.id?"bg-accent/20 border-accent":"bg-surface-hover border-border hover:border-gray-500"}`,children:[b.jsx(Mo,{className:"w-5 h-5 text-purple-400"}),b.jsxs("div",{className:"text-left",children:[b.jsx("div",{className:"font-medium text-white",children:i.name}),b.jsx("div",{className:"text-xs text-gray-500",children:i.description})]})]},i.id))})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Allowed Tools"}),b.jsx("div",{className:"grid grid-cols-2 gap-2",children:$R.map(i=>b.jsxs("label",{className:"flex items-center gap-2 p-2 bg-surface-hover rounded-lg cursor-pointer hover:bg-border transition-colors",children:[b.jsx("input",{type:"checkbox",checked:e.tools?.includes(i)??!1,onChange:l=>{const o=l.target.checked?[...e.tools||[],i]:(e.tools||[]).filter(s=>s!==i);n({tools:o})},className:"rounded border-gray-600 bg-surface text-accent focus:ring-accent"}),b.jsx("span",{className:"text-sm text-gray-300",children:i})]},i))})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"System Prompt"}),b.jsx("textarea",{value:e.systemPrompt||"",onChange:i=>n({systemPrompt:i.target.value}),rows:4,placeholder:"Enter custom instructions for this agent...",className:"w-full px-3 py-2 bg-surface-hover border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent resize-none"})]})]})}function JR({data:e,onUpdate:n}){const[i,l]=G.useState([]),[o,s]=G.useState(!1),[c,f]=G.useState(null),[h,d]=G.useState(""),[g,m]=G.useState(!1),[x,v]=G.useState(null);G.useEffect(()=>{e.skillType==="generated"&&e.skillPath&&(s(!0),fetch(`/api/skill/files?path=${encodeURIComponent(e.skillPath)}`).then(E=>E.json()).then(E=>{l(E.files||[]),E.files?.length>0&&f(E.files[0].name)}).catch(E=>{console.error("Failed to load skill files:",E)}).finally(()=>s(!1)))},[e.skillPath,e.skillType]);const S=async()=>{if(e.skillPath){m(!0),v(null);try{const E=h.trim()?h.trim().split(/\s+/):[],N=await(await fetch("/api/skill/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({skillPath:e.skillPath,args:E})})).json();v(N)}catch(E){v({success:!1,error:E instanceof Error?E.message:"Unknown error"})}finally{m(!1)}}};return e.skillType==="generated"&&e.skillPath?b.jsxs(b.Fragment,{children:[b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Skill Path"}),b.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})]}),b.jsxs("div",{children:[b.jsxs("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:[b.jsx(eA,{className:"w-4 h-4 inline mr-1"}),"Files Preview"]}),o?b.jsxs("div",{className:"flex items-center justify-center py-8 text-gray-500",children:[b.jsx(qu,{className:"w-5 h-5 animate-spin mr-2"}),"파일 로딩 중..."]}):i.length===0?b.jsx("div",{className:"text-center py-4 text-gray-500 text-sm",children:"파일을 찾을 수 없습니다"}):b.jsx("div",{className:"space-y-2",children:i.map(E=>b.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[b.jsxs("button",{onClick:()=>f(c===E.name?null:E.name),className:"w-full flex items-center justify-between px-3 py-2 bg-surface-hover hover:bg-border transition-colors",children:[b.jsx("span",{className:"text-sm text-white font-medium",children:E.name}),c===E.name?b.jsx(jv,{className:"w-4 h-4 text-gray-400"}):b.jsx(qT,{className:"w-4 h-4 text-gray-400"})]}),c===E.name&&b.jsx("pre",{className:"p-3 bg-[#0d1117] text-xs text-gray-300 overflow-x-auto max-h-64 overflow-y-auto font-mono",children:E.content})]},E.name))})]}),b.jsxs("div",{children:[b.jsxs("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:[b.jsx(xo,{className:"w-4 h-4 inline mr-1"}),"Test Skill"]}),b.jsxs("div",{className:"space-y-3",children:[b.jsx("div",{children:b.jsx("input",{type:"text",value:h,onChange:E=>d(E.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"})}),b.jsx("button",{onClick:S,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?b.jsxs(b.Fragment,{children:[b.jsx(qu,{className:"w-4 h-4 animate-spin"}),"실행 중..."]}):b.jsxs(b.Fragment,{children:[b.jsx(xo,{className:"w-4 h-4"}),"테스트 실행"]})}),x&&b.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:[b.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[x.success?b.jsx(ac,{className:"w-4 h-4 text-green-400"}):b.jsx(xp,{className:"w-4 h-4 text-red-400"}),b.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&&b.jsxs("div",{className:"mb-2",children:[b.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Output:"}),b.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&&b.jsxs("div",{children:[b.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Error:"}),b.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&&b.jsx("div",{className:"text-sm text-red-400",children:x.error})]})]})]})]}):b.jsxs(b.Fragment,{children:[b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Skill Type"}),b.jsx("div",{className:"grid grid-cols-2 gap-2 mb-4",children:["official","custom"].map(E=>b.jsx("button",{onClick:()=>n({skillType:E}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.skillType===E?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:E.charAt(0).toUpperCase()+E.slice(1)},E))})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Select Skill"}),b.jsx("div",{className:"space-y-2",children:XR.map(E=>b.jsxs("button",{onClick:()=>n({skillId:E.id,description:E.description}),className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-colors text-left ${e.skillId===E.id?"bg-accent/20 border-accent":"bg-surface border-border hover:border-gray-500"}`,children:[b.jsx(uc,{className:"w-5 h-5 text-cyan-400"}),b.jsxs("div",{children:[b.jsx("div",{className:"font-medium text-white",children:E.name}),b.jsx("div",{className:"text-xs text-gray-500",children:E.description})]})]},E.id))})]})]})}function WR({data:e,onUpdate:n}){const i=["PreToolUse","PostToolUse","Notification","Stop"];return b.jsxs(b.Fragment,{children:[b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Hook Event"}),b.jsx("div",{className:"grid grid-cols-2 gap-2",children:i.map(l=>b.jsx("button",{onClick:()=>n({hookEvent:l}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.hookEvent===l?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:l},l))})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Tool Matcher (optional)"}),b.jsx("input",{type:"text",value:e.hookMatcher||"",onChange:l=>n({hookMatcher:l.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"}),b.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Filter by tool name pattern"})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Hook Command"}),b.jsx("input",{type:"text",value:e.hookCommand||"",onChange:l=>n({hookCommand:l.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"}),b.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Shell command to execute"})]})]})}function e8({onUpdate:e}){const n=[{id:"auto",name:"Auto Format",description:"Automatically format output"},{id:"markdown",name:"Markdown",description:"Plain markdown text"},{id:"document",name:"Document",description:"Formatted document output"}];return b.jsxs("div",{children:[b.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Output Format"}),b.jsx("div",{className:"space-y-2",children:n.map(i=>b.jsxs("button",{onClick:()=>e({layoutType:i.id}),className:"w-full flex items-center gap-3 p-3 rounded-lg border bg-surface-hover border-border hover:border-gray-500 transition-colors text-left",children:[b.jsx(lc,{className:"w-5 h-5 text-emerald-400"}),b.jsxs("div",{children:[b.jsx("div",{className:"font-medium text-white",children:i.name}),b.jsx("div",{className:"text-xs text-gray-500",children:i.description})]})]},i.id))})]})}const t8=[{id:"preview",label:"Preview"},{id:"console",label:"Console"},{id:"step",label:"Step"},{id:"theme",label:"Theme"}];function n8(){const{activeTab:e,setActiveTab:n}=hc(),i=Pn(Bv);return b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsx("div",{className:"flex items-center gap-1 p-2 border-b border-border",children:t8.map(l=>b.jsx("button",{onClick:()=>n(l.id),className:It("px-4 py-2 text-sm font-medium rounded-lg transition-colors",e===l.id?"bg-surface-hover text-white":"text-gray-400 hover:text-white hover:bg-surface-hover/50"),children:l.label},l.id))}),b.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="preview"&&b.jsx(qR,{}),e==="console"&&b.jsx(YR,{}),e==="step"&&b.jsx(ZR,{node:i}),e==="theme"&&b.jsx("div",{className:"p-4 text-gray-500",children:"Theme customization coming soon..."})]})]})}async function i8(e){let n;const{apiMode:i,apiKey:l,proxyUrl:o}=Np.getState(),s={"Content-Type":"application/json","X-API-Mode":i};i==="direct"&&l?s["X-API-Key"]=l:i==="proxy"&&o&&(s["X-Proxy-URL"]=o);try{n=await fetch("/api/generate/workflow",{method:"POST",headers:s,body:JSON.stringify({prompt:e})})}catch{throw new Error("서버에 연결할 수 없습니다. 서버가 실행 중인지 확인하세요.")}if(!n.ok){let h=`서버 오류 (${n.status})`;try{h=(await n.json()).message||h}catch{}throw new Error(h)}let c;try{c=await n.json()}catch{throw new Error("서버 응답을 파싱할 수 없습니다.")}return{workflow:l8(c),workflowName:c.workflowName}}function r8(e,n){if(e.length===0)return e;const i=300,l=180,o=100,s=100,c=new Map,f=new Map;e.forEach(_=>{c.set(_.id,[]),f.set(_.id,[])}),n.forEach(_=>{const k=c.get(_.target)||[];k.push(_.source),c.set(_.target,k);const A=f.get(_.source)||[];A.push(_.target),f.set(_.source,A)});const h=e.filter(_=>(c.get(_.id)||[]).length===0),d=new Map,g=[];for(h.forEach(_=>{d.set(_.id,0),g.push({id:_.id,depth:0})}),h.length===0&&e.length>0&&(d.set(e[0].id,0),g.push({id:e[0].id,depth:0}));g.length>0;){const _=g.shift();(f.get(_.id)||[]).forEach(A=>{const B=d.get(A),T=_.depth+1;(B===void 0||T>B)&&(d.set(A,T),g.push({id:A,depth:T}))})}const m=new Map,x=new Set,v=[...e].sort((_,k)=>{const A=d.get(_.id)??0;return(d.get(k.id)??0)-A});function S(_){if(m.has(_))return m.get(_);const k=f.get(_)||[];if(k.length===0)return m.set(_,1),1;let A=0;k.forEach(T=>{A+=S(T)});const B=Math.max(1,A);return m.set(_,B),B}v.forEach(_=>{S(_.id)});const E=new Map;function C(_,k,A,B){if(x.has(_))return;x.add(_);const T=m.get(_)||1,L=B-A,P=A+L/2,Z=o+k*i;E.set(_,{x:Z,y:P});const H=f.get(_)||[];if(H.length>0){let U=A;H.forEach(Y=>{const R=(m.get(Y)||1)/T*L;C(Y,k+1,U,U+R),U+=R})}}let N=s;return h.forEach(_=>{const A=(m.get(_.id)||1)*l;x.clear(),C(_.id,0,N,N+A),N+=A}),e.forEach(_=>{E.has(_.id)||(E.set(_.id,{x:o,y:N}),N+=l)}),e.map(_=>{const k=E.get(_.id)||_.position;return{..._,position:k}})}function l8(e){const n=[],i=new Map,l={x:0,y:0};e.nodes.forEach((c,f)=>{const h=Yl();i.set(f,h);const d={label:c.label,description:c.description,status:"idle",usedInputs:[]};switch(c.type){case"input":n.push({id:h,type:"input",position:{...l},data:{...d,inputType:c.config.inputType||"text",placeholder:c.config.placeholder||c.description}});break;case"agent":n.push({id:h,type:"agent",position:{...l},data:{...d,role:c.config.role||"custom",tools:c.config.tools||["Read","Write"],model:c.config.model||"sonnet",systemPrompt:c.config.systemPrompt}});break;case"skill":n.push({id:h,type:"skill",position:{...l},data:{...d,skillType:c.config.skillType||"official",skillId:c.config.skillId,skillContent:c.config.skillContent}});break;case"hook":n.push({id:h,type:"hook",position:{...l},data:{...d,hookEvent:c.config.hookEvent||"PreToolUse",hookMatcher:c.config.hookMatcher,hookCommand:c.config.hookCommand}});break;case"output":n.push({id:h,type:"output",position:{...l},data:{...d,outputType:c.config.outputType||"auto"}});break}}),e.edges.forEach(c=>{const f=i.get(c.to),h=i.get(c.from);if(f&&h){const d=n.find(g=>g.id===f);d&&d.data.usedInputs&&d.data.usedInputs.push(h)}});const o=e.edges.map(c=>{const f=i.get(c.from),h=i.get(c.to);return!f||!h?null:{id:`e-${f}-${h}`,source:f,target:h,animated:!0}}).filter(c=>c!==null);return{nodes:r8(n,o),edges:o}}function a8(e){const n=e.toLowerCase();if(n.includes("스킬")||n.includes("skill"))return!0;const i=[/만들어\s*(줘|주세요|줘요)/,/작성해\s*(줘|주세요|줘요)/,/생성해\s*(줘|주세요|줘요)/];for(const l of i)if(l.test(e))return!0;return!1}function o8(){const[e,n]=G.useState(""),[i,l]=G.useState(!1),[o,s]=G.useState(null),[c,f]=G.useState(null),[h,d]=G.useState("workflow"),{loadWorkflow:g,addNode:m,setSelectedNode:x,nodes:v}=Pn(),{openConsolePanel:S,openStepPanel:E}=hc(),{addLog:C,clearLogs:N}=Xl(),{apiMode:_,apiKey:k,proxyUrl:A}=Np(),B=G.useCallback(H=>{console.log("[PromptBar] Skill progress:",H.step,H.message);const U=H.step==="error"?"error":H.step==="completed"?"success":"info";C(U,H.message,void 0,H.detail)},[C]),T=G.useCallback(H=>{l(!1),f(`스킬 "${H.skill.skillName}"이 ${H.savedPath}에 저장되었습니다!`),n(""),setTimeout(()=>f(null),5e3);const U=Yl(),Y=v.length,ee={id:U,type:"skill",position:{x:100+Y%3*300,y:100+Math.floor(Y/3)*200},data:{label:H.skill.skillName,description:H.skill.description,status:"idle",skillType:"generated",skillId:H.skill.skillId,skillPath:H.savedPath}};m(ee),x(U),E()},[v,m,x,E]),L=G.useCallback(H=>{l(!1),s(H.error)},[]);G.useEffect(()=>(Nt.on("skill:progress",B),Nt.on("skill:completed",T),Nt.on("skill:error",L),()=>{Nt.off("skill:progress",B),Nt.off("skill:completed",T),Nt.off("skill:error",L)}),[B,T,L]);const P=async()=>{if(!e.trim()||i)return;l(!0),s(null),f(null);const H=a8(e);d(H?"skill":"workflow");try{if(H)N(),S(),Nt.isConnected()||C("warning","⚠️ 서버 연결 대기 중...",void 0,"잠시 후 자동으로 연결됩니다"),Nt.generateSkill({prompt:e,apiMode:_,apiKey:_==="direct"?k:void 0,proxyUrl:_==="proxy"?A:void 0});else{const{workflow:U,workflowName:Y}=await i8(e);g({nodes:U.nodes,edges:U.edges,name:Y}),n(""),l(!1)}}catch(U){console.error("Generation failed:",U);const Y=U instanceof Error?U.message:"생성에 실패했습니다.";s(Y),l(!1)}},Z=H=>{H.key==="Enter"&&!H.shiftKey&&(H.preventDefault(),P())};return b.jsxs("div",{className:"bg-surface border border-border rounded-2xl px-5 py-3 shadow-2xl flex items-center gap-3",children:[b.jsx(Mo,{className:"w-5 h-5 text-accent flex-shrink-0"}),b.jsx("input",{type:"text",value:e,onChange:H=>n(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:i}),b.jsx("button",{onClick:P,disabled:!e.trim()||i,className:`p-2 rounded-full transition-all duration-200 ${e.trim()&&!i?"bg-accent text-white hover:bg-accent-hover hover:scale-105":"bg-surface-hover text-gray-500"}`,title:"Generate Workflow",children:i?b.jsx(qu,{className:"w-5 h-5 animate-spin"}):b.jsx(EA,{className:"w-5 h-5"})}),b.jsx("div",{className:"absolute -bottom-6 left-1/2 -translate-x-1/2 text-xs whitespace-nowrap",children:o?b.jsx("span",{className:"text-red-400",children:o}):c?b.jsxs("span",{className:"text-green-400 flex items-center gap-1",children:[b.jsx(ac,{className:"w-3 h-3"}),c]}):i?b.jsxs("span",{className:"text-accent",children:["AI가 ",h==="skill"?"스킬":"워크플로우","을 생성하고 있습니다..."]}):b.jsx("span",{className:"text-gray-600",children:'"스킬 만들어줘" 또는 워크플로우 설명을 입력하세요'})})]})}function s8(){const{isCollapsed:e,width:n}=hc(),{isRunning:i,logs:l}=Xl(),{mergeExistingConfig:o}=Pn(),[s,c]=G.useState(!1),f=G.useRef(!1);return G.useEffect(()=>{f.current||(f.current=!0,Jv().then(h=>{h.length>0&&(console.log(`Loaded ${h.length} nodes from .claude/`),o(h))}).catch(h=>{console.error("Failed to load initial config:",h)}))},[o]),G.useEffect(()=>{i&&c(!0)},[i]),b.jsx(Cv,{children:b.jsxs("div",{className:"flex flex-col h-screen bg-canvas",children:[b.jsx(W5,{}),b.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[b.jsxs("div",{className:"flex-1 flex flex-col",children:[b.jsx(iM,{}),b.jsxs("div",{className:"flex-1 relative",children:[b.jsx(xM,{}),b.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 w-full max-w-2xl px-4",children:b.jsx(o8,{})})]})]}),!e&&b.jsx("div",{className:"border-l border-border bg-surface",style:{width:`${n}px`},children:b.jsx(n8,{})})]}),b.jsxs("button",{onClick:()=>c(!s),className:`fixed bottom-4 left-4 z-40 flex items-center gap-2 px-3 py-2 rounded-lg shadow-lg transition-all ${s?"bg-amber-600 text-white":"bg-gray-800 text-gray-300 hover:bg-gray-700"} ${s?"opacity-0 pointer-events-none":"opacity-100"}`,children:[b.jsx(sc,{className:"w-4 h-4"}),b.jsx("span",{className:"text-sm font-medium",children:"Console"}),l.length>0&&!s&&b.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-amber-500 text-white rounded-full",children:l.length}),i&&b.jsx("span",{className:"w-2 h-2 bg-green-400 rounded-full animate-pulse"})]}),b.jsx(VR,{isOpen:s,onClose:()=>c(!1)})]})})}Sk.createRoot(document.getElementById("root")).render(b.jsx(G.StrictMode,{children:b.jsx(s8,{})}));
|