makecc 0.2.2 → 0.2.4
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-DLT8bQFx.css +1 -0
- package/dist/client/assets/{index--RFba-Yw.js → index-c7WYmobg.js} +59 -52
- package/dist/client/index.html +2 -2
- package/dist/server/index.js +62 -0
- package/dist/server/services/fileService.js +53 -0
- package/dist/server/services/skillGeneratorService.js +168 -0
- package/package.json +1 -1
- package/server/index.ts +67 -0
- package/server/services/fileService.ts +59 -0
- package/server/services/skillGeneratorService.ts +209 -0
- package/dist/client/assets/index-COYRelWD.css +0 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function i(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(s){if(s.ep)return;s.ep=!0;const o=i(s);fetch(s.href,o)}})();function Fc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rh={exports:{}},hs={};var Dx;function oE(){if(Dx)return hs;Dx=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(a,s,o){var u=null;if(o!==void 0&&(u=""+o),s.key!==void 0&&(u=""+s.key),"key"in s){o={};for(var f in s)f!=="key"&&(o[f]=s[f])}else o=s;return s=o.ref,{$$typeof:e,type:a,key:u,ref:s!==void 0?s:null,props:o}}return hs.Fragment=n,hs.jsx=i,hs.jsxs=i,hs}var Rx;function uE(){return Rx||(Rx=1,Rh.exports=oE()),Rh.exports}var v=uE(),Oh={exports:{}},Me={};var Ox;function cE(){if(Ox)return Me;Ox=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),x=Symbol.iterator;function b(R){return R===null||typeof R!="object"?null:(R=x&&R[x]||R["@@iterator"],typeof R=="function"?R:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,N={};function _(R,$,T){this.props=R,this.context=$,this.refs=N,this.updater=T||w}_.prototype.isReactComponent={},_.prototype.setState=function(R,$){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,$,"setState")},_.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function D(){}D.prototype=_.prototype;function k(R,$,T){this.props=R,this.context=$,this.refs=N,this.updater=T||w}var C=k.prototype=new D;C.constructor=k,E(C,_.prototype),C.isPureReactComponent=!0;var L=Array.isArray;function A(){}var H={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function G(R,$,T){var ie=T.ref;return{$$typeof:e,type:R,key:$,ref:ie!==void 0?ie:null,props:T}}function q(R,$){return G(R.type,$,R.props)}function V(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function P(R){var $={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(T){return $[T]})}var te=/\/+/g;function O(R,$){return typeof R=="object"&&R!==null&&R.key!=null?P(""+R.key):$.toString(36)}function B(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(A,A):(R.status="pending",R.then(function($){R.status==="pending"&&(R.status="fulfilled",R.value=$)},function($){R.status==="pending"&&(R.status="rejected",R.reason=$)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function j(R,$,T,ie,ce){var fe=typeof R;(fe==="undefined"||fe==="boolean")&&(R=null);var he=!1;if(R===null)he=!0;else switch(fe){case"bigint":case"string":case"number":he=!0;break;case"object":switch(R.$$typeof){case e:case n:he=!0;break;case g:return he=R._init,j(he(R._payload),$,T,ie,ce)}}if(he)return ce=ce(R),he=ie===""?"."+O(R,0):ie,L(ce)?(T="",he!=null&&(T=he.replace(te,"$&/")+"/"),j(ce,$,T,"",function(Ee){return Ee})):ce!=null&&(V(ce)&&(ce=q(ce,T+(ce.key==null||R&&R.key===ce.key?"":(""+ce.key).replace(te,"$&/")+"/")+he)),$.push(ce)),1;he=0;var ue=ie===""?".":ie+":";if(L(R))for(var me=0;me<R.length;me++)ie=R[me],fe=ue+O(ie,me),he+=j(ie,$,T,fe,ce);else if(me=b(R),typeof me=="function")for(R=me.call(R),me=0;!(ie=R.next()).done;)ie=ie.value,fe=ue+O(ie,me++),he+=j(ie,$,T,fe,ce);else if(fe==="object"){if(typeof R.then=="function")return j(B(R),$,T,ie,ce);throw $=String(R),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return he}function U(R,$,T){if(R==null)return R;var ie=[],ce=0;return j(R,ie,"","",function(fe){return $.call(T,fe,ce++)}),ie}function Y(R){if(R._status===-1){var $=R._result;$=$(),$.then(function(T){(R._status===0||R._status===-1)&&(R._status=1,R._result=T)},function(T){(R._status===0||R._status===-1)&&(R._status=2,R._result=T)}),R._status===-1&&(R._status=0,R._result=$)}if(R._status===1)return R._result.default;throw R._result}var K=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},z={map:U,forEach:function(R,$,T){U(R,function(){$.apply(this,arguments)},T)},count:function(R){var $=0;return U(R,function(){$++}),$},toArray:function(R){return U(R,function($){return $})||[]},only:function(R){if(!V(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Me.Activity=m,Me.Children=z,Me.Component=_,Me.Fragment=i,Me.Profiler=s,Me.PureComponent=k,Me.StrictMode=a,Me.Suspense=h,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,Me.__COMPILER_RUNTIME={__proto__:null,c:function(R){return H.H.useMemoCache(R)}},Me.cache=function(R){return function(){return R.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(R,$,T){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var ie=E({},R.props),ce=R.key;if($!=null)for(fe in $.key!==void 0&&(ce=""+$.key),$)!F.call($,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&$.ref===void 0||(ie[fe]=$[fe]);var fe=arguments.length-2;if(fe===1)ie.children=T;else if(1<fe){for(var he=Array(fe),ue=0;ue<fe;ue++)he[ue]=arguments[ue+2];ie.children=he}return G(R.type,ce,ie)},Me.createContext=function(R){return R={$$typeof:u,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:o,_context:R},R},Me.createElement=function(R,$,T){var ie,ce={},fe=null;if($!=null)for(ie in $.key!==void 0&&(fe=""+$.key),$)F.call($,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(ce[ie]=$[ie]);var he=arguments.length-2;if(he===1)ce.children=T;else if(1<he){for(var ue=Array(he),me=0;me<he;me++)ue[me]=arguments[me+2];ce.children=ue}if(R&&R.defaultProps)for(ie in he=R.defaultProps,he)ce[ie]===void 0&&(ce[ie]=he[ie]);return G(R,fe,ce)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(R){return{$$typeof:f,render:R}},Me.isValidElement=V,Me.lazy=function(R){return{$$typeof:g,_payload:{_status:-1,_result:R},_init:Y}},Me.memo=function(R,$){return{$$typeof:d,type:R,compare:$===void 0?null:$}},Me.startTransition=function(R){var $=H.T,T={};H.T=T;try{var ie=R(),ce=H.S;ce!==null&&ce(T,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(A,K)}catch(fe){K(fe)}finally{$!==null&&T.types!==null&&($.types=T.types),H.T=$}},Me.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},Me.use=function(R){return H.H.use(R)},Me.useActionState=function(R,$,T){return H.H.useActionState(R,$,T)},Me.useCallback=function(R,$){return H.H.useCallback(R,$)},Me.useContext=function(R){return H.H.useContext(R)},Me.useDebugValue=function(){},Me.useDeferredValue=function(R,$){return H.H.useDeferredValue(R,$)},Me.useEffect=function(R,$){return H.H.useEffect(R,$)},Me.useEffectEvent=function(R){return H.H.useEffectEvent(R)},Me.useId=function(){return H.H.useId()},Me.useImperativeHandle=function(R,$,T){return H.H.useImperativeHandle(R,$,T)},Me.useInsertionEffect=function(R,$){return H.H.useInsertionEffect(R,$)},Me.useLayoutEffect=function(R,$){return H.H.useLayoutEffect(R,$)},Me.useMemo=function(R,$){return H.H.useMemo(R,$)},Me.useOptimistic=function(R,$){return H.H.useOptimistic(R,$)},Me.useReducer=function(R,$,T){return H.H.useReducer(R,$,T)},Me.useRef=function(R){return H.H.useRef(R)},Me.useState=function(R){return H.H.useState(R)},Me.useSyncExternalStore=function(R,$,T){return H.H.useSyncExternalStore(R,$,T)},Me.useTransition=function(){return H.H.useTransition()},Me.version="19.2.3",Me}var Lx;function ao(){return Lx||(Lx=1,Oh.exports=cE()),Oh.exports}var Q=ao();const Ls=Fc(Q);var Lh={exports:{}},ps={},Hh={exports:{}},Bh={};var Hx;function fE(){return Hx||(Hx=1,(function(e){function n(j,U){var Y=j.length;j.push(U);e:for(;0<Y;){var K=Y-1>>>1,z=j[K];if(0<s(z,U))j[K]=U,j[Y]=z,Y=K;else break e}}function i(j){return j.length===0?null:j[0]}function a(j){if(j.length===0)return null;var U=j[0],Y=j.pop();if(Y!==U){j[0]=Y;e:for(var K=0,z=j.length,R=z>>>1;K<R;){var $=2*(K+1)-1,T=j[$],ie=$+1,ce=j[ie];if(0>s(T,Y))ie<z&&0>s(ce,T)?(j[K]=ce,j[ie]=Y,K=ie):(j[K]=T,j[$]=Y,K=$);else if(ie<z&&0>s(ce,Y))j[K]=ce,j[ie]=Y,K=ie;else break e}}return U}function s(j,U){var Y=j.sortIndex-U.sortIndex;return Y!==0?Y:j.id-U.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],d=[],g=1,m=null,x=3,b=!1,w=!1,E=!1,N=!1,_=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function C(j){for(var U=i(d);U!==null;){if(U.callback===null)a(d);else if(U.startTime<=j)a(d),U.sortIndex=U.expirationTime,n(h,U);else break;U=i(d)}}function L(j){if(E=!1,C(j),!w)if(i(h)!==null)w=!0,A||(A=!0,P());else{var U=i(d);U!==null&&B(L,U.startTime-j)}}var A=!1,H=-1,F=5,G=-1;function q(){return N?!0:!(e.unstable_now()-G<F)}function V(){if(N=!1,A){var j=e.unstable_now();G=j;var U=!0;try{e:{w=!1,E&&(E=!1,D(H),H=-1),b=!0;var Y=x;try{t:{for(C(j),m=i(h);m!==null&&!(m.expirationTime>j&&q());){var K=m.callback;if(typeof K=="function"){m.callback=null,x=m.priorityLevel;var z=K(m.expirationTime<=j);if(j=e.unstable_now(),typeof z=="function"){m.callback=z,C(j),U=!0;break t}m===i(h)&&a(h),C(j)}else a(h);m=i(h)}if(m!==null)U=!0;else{var R=i(d);R!==null&&B(L,R.startTime-j),U=!1}}break e}finally{m=null,x=Y,b=!1}U=void 0}}finally{U?P():A=!1}}}var P;if(typeof k=="function")P=function(){k(V)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,O=te.port2;te.port1.onmessage=V,P=function(){O.postMessage(null)}}else P=function(){_(V,0)};function B(j,U){H=_(function(){j(e.unstable_now())},U)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(j){switch(x){case 1:case 2:case 3:var U=3;break;default:U=x}var Y=x;x=U;try{return j()}finally{x=Y}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(j,U){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var Y=x;x=j;try{return U()}finally{x=Y}},e.unstable_scheduleCallback=function(j,U,Y){var K=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?K+Y:K):Y=K,j){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=Y+z,j={id:g++,callback:U,priorityLevel:j,startTime:Y,expirationTime:z,sortIndex:-1},Y>K?(j.sortIndex=Y,n(d,j),i(h)===null&&j===i(d)&&(E?(D(H),H=-1):E=!0,B(L,Y-K))):(j.sortIndex=z,n(h,j),w||b||(w=!0,A||(A=!0,P()))),j},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(j){var U=x;return function(){var Y=x;x=U;try{return j.apply(this,arguments)}finally{x=Y}}}})(Bh)),Bh}var Bx;function dE(){return Bx||(Bx=1,Hh.exports=fE()),Hh.exports}var Uh={exports:{}},Ut={};var Ux;function hE(){if(Ux)return Ut;Ux=1;var e=ao();function n(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},s=Symbol.for("react.portal");function o(h,d,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:h,containerInfo:d,implementation:g}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Ut.createPortal=function(h,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(n(299));return o(h,d,null,g)},Ut.flushSync=function(h){var d=u.T,g=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.T=d,a.p=g,a.d.f()}},Ut.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,a.d.C(h,d))},Ut.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},Ut.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var g=d.as,m=f(g,d.crossOrigin),x=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?a.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:x,fetchPriority:b}):g==="script"&&a.d.X(h,{crossOrigin:m,integrity:x,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Ut.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=f(d.as,d.crossOrigin);a.d.M(h,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&a.d.M(h)},Ut.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,m=f(g,d.crossOrigin);a.d.L(h,g,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Ut.preloadModule=function(h,d){if(typeof h=="string")if(d){var g=f(d.as,d.crossOrigin);a.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else a.d.m(h)},Ut.requestFormReset=function(h){a.d.r(h)},Ut.unstable_batchedUpdates=function(h,d){return h(d)},Ut.useFormState=function(h,d,g){return u.H.useFormState(h,d,g)},Ut.useFormStatus=function(){return u.H.useHostTransitionStatus()},Ut.version="19.2.3",Ut}var Ix;function pv(){if(Ix)return Uh.exports;Ix=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Uh.exports=hE(),Uh.exports}var qx;function pE(){if(qx)return ps;qx=1;var e=dE(),n=ao(),i=pv();function a(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)r+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function o(t){var r=t,l=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(l=r.return),t=r.return;while(t)}return r.tag===3?l:null}function u(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function f(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function h(t){if(o(t)!==t)throw Error(a(188))}function d(t){var r=t.alternate;if(!r){if(r=o(t),r===null)throw Error(a(188));return r!==t?null:t}for(var l=t,c=r;;){var p=l.return;if(p===null)break;var y=p.alternate;if(y===null){if(c=p.return,c!==null){l=c;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===l)return h(p),t;if(y===c)return h(p),r;y=y.sibling}throw Error(a(188))}if(l.return!==c.return)l=p,c=y;else{for(var S=!1,M=p.child;M;){if(M===l){S=!0,l=p,c=y;break}if(M===c){S=!0,c=p,l=y;break}M=M.sibling}if(!S){for(M=y.child;M;){if(M===l){S=!0,l=y,c=p;break}if(M===c){S=!0,c=y,l=p;break}M=M.sibling}if(!S)throw Error(a(189))}}if(l.alternate!==c)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?t:r}function g(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=g(t),r!==null)return r;t=t.sibling}return null}var m=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),k=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function P(t){return t===null||typeof t!="object"?null:(t=V&&t[V]||t["@@iterator"],typeof t=="function"?t:null)}var te=Symbol.for("react.client.reference");function O(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===te?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case E:return"Fragment";case _:return"Profiler";case N:return"StrictMode";case L:return"Suspense";case A:return"SuspenseList";case G:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case w:return"Portal";case k:return t.displayName||"Context";case D:return(t._context.displayName||"Context")+".Consumer";case C:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case H:return r=t.displayName||null,r!==null?r:O(t.type)||"Memo";case F:r=t._payload,t=t._init;try{return O(t(r))}catch{}}return null}var B=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},K=[],z=-1;function R(t){return{current:t}}function $(t){0>z||(t.current=K[z],K[z]=null,z--)}function T(t,r){z++,K[z]=t.current,t.current=r}var ie=R(null),ce=R(null),fe=R(null),he=R(null);function ue(t,r){switch(T(fe,r),T(ce,t),T(ie,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?nx(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=nx(r),t=ix(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}$(ie),T(ie,t)}function me(){$(ie),$(ce),$(fe)}function Ee(t){t.memoizedState!==null&&T(he,t);var r=ie.current,l=ix(r,t.type);r!==l&&(T(ce,t),T(ie,l))}function Ce(t){ce.current===t&&($(ie),$(ce)),he.current===t&&($(he),us._currentValue=Y)}var we,Ne;function Re(t){if(we===void 0)try{throw Error()}catch(l){var r=l.stack.trim().match(/\n( *(at )?)/);we=r&&r[1]||"",Ne=-1<l.stack.indexOf(`
|
|
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"]'))a(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const u of s.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).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 a(o){if(o.ep)return;o.ep=!0;const s=i(o);fetch(o.href,s)}})();function Gc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rh={exports:{}},go={};var Ox;function sE(){if(Ox)return go;Ox=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(a,o,s){var u=null;if(s!==void 0&&(u=""+s),o.key!==void 0&&(u=""+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:a,key:u,ref:o!==void 0?o:null,props:s}}return go.Fragment=n,go.jsx=i,go.jsxs=i,go}var Lx;function uE(){return Lx||(Lx=1,Rh.exports=sE()),Rh.exports}var v=uE(),Oh={exports:{}},Me={};var Hx;function cE(){if(Hx)return Me;Hx=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),x=Symbol.iterator;function b(R){return R===null||typeof R!="object"?null:(R=x&&R[x]||R["@@iterator"],typeof R=="function"?R:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,N={};function _(R,$,T){this.props=R,this.context=$,this.refs=N,this.updater=T||w}_.prototype.isReactComponent={},_.prototype.setState=function(R,$){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,$,"setState")},_.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function D(){}D.prototype=_.prototype;function k(R,$,T){this.props=R,this.context=$,this.refs=N,this.updater=T||w}var C=k.prototype=new D;C.constructor=k,E(C,_.prototype),C.isPureReactComponent=!0;var L=Array.isArray;function A(){}var H={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function G(R,$,T){var ie=T.ref;return{$$typeof:e,type:R,key:$,ref:ie!==void 0?ie:null,props:T}}function q(R,$){return G(R.type,$,R.props)}function V(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function P(R){var $={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(T){return $[T]})}var te=/\/+/g;function O(R,$){return typeof R=="object"&&R!==null&&R.key!=null?P(""+R.key):$.toString(36)}function B(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(A,A):(R.status="pending",R.then(function($){R.status==="pending"&&(R.status="fulfilled",R.value=$)},function($){R.status==="pending"&&(R.status="rejected",R.reason=$)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function j(R,$,T,ie,ce){var fe=typeof R;(fe==="undefined"||fe==="boolean")&&(R=null);var he=!1;if(R===null)he=!0;else switch(fe){case"bigint":case"string":case"number":he=!0;break;case"object":switch(R.$$typeof){case e:case n:he=!0;break;case g:return he=R._init,j(he(R._payload),$,T,ie,ce)}}if(he)return ce=ce(R),he=ie===""?"."+O(R,0):ie,L(ce)?(T="",he!=null&&(T=he.replace(te,"$&/")+"/"),j(ce,$,T,"",function(Ee){return Ee})):ce!=null&&(V(ce)&&(ce=q(ce,T+(ce.key==null||R&&R.key===ce.key?"":(""+ce.key).replace(te,"$&/")+"/")+he)),$.push(ce)),1;he=0;var ue=ie===""?".":ie+":";if(L(R))for(var me=0;me<R.length;me++)ie=R[me],fe=ue+O(ie,me),he+=j(ie,$,T,fe,ce);else if(me=b(R),typeof me=="function")for(R=me.call(R),me=0;!(ie=R.next()).done;)ie=ie.value,fe=ue+O(ie,me++),he+=j(ie,$,T,fe,ce);else if(fe==="object"){if(typeof R.then=="function")return j(B(R),$,T,ie,ce);throw $=String(R),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return he}function U(R,$,T){if(R==null)return R;var ie=[],ce=0;return j(R,ie,"","",function(fe){return $.call(T,fe,ce++)}),ie}function Y(R){if(R._status===-1){var $=R._result;$=$(),$.then(function(T){(R._status===0||R._status===-1)&&(R._status=1,R._result=T)},function(T){(R._status===0||R._status===-1)&&(R._status=2,R._result=T)}),R._status===-1&&(R._status=0,R._result=$)}if(R._status===1)return R._result.default;throw R._result}var K=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},z={map:U,forEach:function(R,$,T){U(R,function(){$.apply(this,arguments)},T)},count:function(R){var $=0;return U(R,function(){$++}),$},toArray:function(R){return U(R,function($){return $})||[]},only:function(R){if(!V(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Me.Activity=m,Me.Children=z,Me.Component=_,Me.Fragment=i,Me.Profiler=o,Me.PureComponent=k,Me.StrictMode=a,Me.Suspense=h,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,Me.__COMPILER_RUNTIME={__proto__:null,c:function(R){return H.H.useMemoCache(R)}},Me.cache=function(R){return function(){return R.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(R,$,T){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var ie=E({},R.props),ce=R.key;if($!=null)for(fe in $.key!==void 0&&(ce=""+$.key),$)!F.call($,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&$.ref===void 0||(ie[fe]=$[fe]);var fe=arguments.length-2;if(fe===1)ie.children=T;else if(1<fe){for(var he=Array(fe),ue=0;ue<fe;ue++)he[ue]=arguments[ue+2];ie.children=he}return G(R.type,ce,ie)},Me.createContext=function(R){return R={$$typeof:u,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:s,_context:R},R},Me.createElement=function(R,$,T){var ie,ce={},fe=null;if($!=null)for(ie in $.key!==void 0&&(fe=""+$.key),$)F.call($,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(ce[ie]=$[ie]);var he=arguments.length-2;if(he===1)ce.children=T;else if(1<he){for(var ue=Array(he),me=0;me<he;me++)ue[me]=arguments[me+2];ce.children=ue}if(R&&R.defaultProps)for(ie in he=R.defaultProps,he)ce[ie]===void 0&&(ce[ie]=he[ie]);return G(R,fe,ce)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(R){return{$$typeof:f,render:R}},Me.isValidElement=V,Me.lazy=function(R){return{$$typeof:g,_payload:{_status:-1,_result:R},_init:Y}},Me.memo=function(R,$){return{$$typeof:d,type:R,compare:$===void 0?null:$}},Me.startTransition=function(R){var $=H.T,T={};H.T=T;try{var ie=R(),ce=H.S;ce!==null&&ce(T,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(A,K)}catch(fe){K(fe)}finally{$!==null&&T.types!==null&&($.types=T.types),H.T=$}},Me.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},Me.use=function(R){return H.H.use(R)},Me.useActionState=function(R,$,T){return H.H.useActionState(R,$,T)},Me.useCallback=function(R,$){return H.H.useCallback(R,$)},Me.useContext=function(R){return H.H.useContext(R)},Me.useDebugValue=function(){},Me.useDeferredValue=function(R,$){return H.H.useDeferredValue(R,$)},Me.useEffect=function(R,$){return H.H.useEffect(R,$)},Me.useEffectEvent=function(R){return H.H.useEffectEvent(R)},Me.useId=function(){return H.H.useId()},Me.useImperativeHandle=function(R,$,T){return H.H.useImperativeHandle(R,$,T)},Me.useInsertionEffect=function(R,$){return H.H.useInsertionEffect(R,$)},Me.useLayoutEffect=function(R,$){return H.H.useLayoutEffect(R,$)},Me.useMemo=function(R,$){return H.H.useMemo(R,$)},Me.useOptimistic=function(R,$){return H.H.useOptimistic(R,$)},Me.useReducer=function(R,$,T){return H.H.useReducer(R,$,T)},Me.useRef=function(R){return H.H.useRef(R)},Me.useState=function(R){return H.H.useState(R)},Me.useSyncExternalStore=function(R,$,T){return H.H.useSyncExternalStore(R,$,T)},Me.useTransition=function(){return H.H.useTransition()},Me.version="19.2.3",Me}var Bx;function ss(){return Bx||(Bx=1,Oh.exports=cE()),Oh.exports}var Q=ss();const Uo=Gc(Q);var Lh={exports:{}},yo={},Hh={exports:{}},Bh={};var Ux;function fE(){return Ux||(Ux=1,(function(e){function n(j,U){var Y=j.length;j.push(U);e:for(;0<Y;){var K=Y-1>>>1,z=j[K];if(0<o(z,U))j[K]=U,j[Y]=z,Y=K;else break e}}function i(j){return j.length===0?null:j[0]}function a(j){if(j.length===0)return null;var U=j[0],Y=j.pop();if(Y!==U){j[0]=Y;e:for(var K=0,z=j.length,R=z>>>1;K<R;){var $=2*(K+1)-1,T=j[$],ie=$+1,ce=j[ie];if(0>o(T,Y))ie<z&&0>o(ce,T)?(j[K]=ce,j[ie]=Y,K=ie):(j[K]=T,j[$]=Y,K=$);else if(ie<z&&0>o(ce,Y))j[K]=ce,j[ie]=Y,K=ie;else break e}}return U}function o(j,U){var Y=j.sortIndex-U.sortIndex;return Y!==0?Y:j.id-U.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],d=[],g=1,m=null,x=3,b=!1,w=!1,E=!1,N=!1,_=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function C(j){for(var U=i(d);U!==null;){if(U.callback===null)a(d);else if(U.startTime<=j)a(d),U.sortIndex=U.expirationTime,n(h,U);else break;U=i(d)}}function L(j){if(E=!1,C(j),!w)if(i(h)!==null)w=!0,A||(A=!0,P());else{var U=i(d);U!==null&&B(L,U.startTime-j)}}var A=!1,H=-1,F=5,G=-1;function q(){return N?!0:!(e.unstable_now()-G<F)}function V(){if(N=!1,A){var j=e.unstable_now();G=j;var U=!0;try{e:{w=!1,E&&(E=!1,D(H),H=-1),b=!0;var Y=x;try{t:{for(C(j),m=i(h);m!==null&&!(m.expirationTime>j&&q());){var K=m.callback;if(typeof K=="function"){m.callback=null,x=m.priorityLevel;var z=K(m.expirationTime<=j);if(j=e.unstable_now(),typeof z=="function"){m.callback=z,C(j),U=!0;break t}m===i(h)&&a(h),C(j)}else a(h);m=i(h)}if(m!==null)U=!0;else{var R=i(d);R!==null&&B(L,R.startTime-j),U=!1}}break e}finally{m=null,x=Y,b=!1}U=void 0}}finally{U?P():A=!1}}}var P;if(typeof k=="function")P=function(){k(V)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,O=te.port2;te.port1.onmessage=V,P=function(){O.postMessage(null)}}else P=function(){_(V,0)};function B(j,U){H=_(function(){j(e.unstable_now())},U)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(j){switch(x){case 1:case 2:case 3:var U=3;break;default:U=x}var Y=x;x=U;try{return j()}finally{x=Y}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(j,U){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var Y=x;x=j;try{return U()}finally{x=Y}},e.unstable_scheduleCallback=function(j,U,Y){var K=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?K+Y:K):Y=K,j){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=Y+z,j={id:g++,callback:U,priorityLevel:j,startTime:Y,expirationTime:z,sortIndex:-1},Y>K?(j.sortIndex=Y,n(d,j),i(h)===null&&j===i(d)&&(E?(D(H),H=-1):E=!0,B(L,Y-K))):(j.sortIndex=z,n(h,j),w||b||(w=!0,A||(A=!0,P()))),j},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(j){var U=x;return function(){var Y=x;x=U;try{return j.apply(this,arguments)}finally{x=Y}}}})(Bh)),Bh}var Ix;function dE(){return Ix||(Ix=1,Hh.exports=fE()),Hh.exports}var Uh={exports:{}},Ut={};var qx;function hE(){if(qx)return Ut;qx=1;var e=ss();function n(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},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 u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Ut.createPortal=function(h,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(n(299));return s(h,d,null,g)},Ut.flushSync=function(h){var d=u.T,g=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.T=d,a.p=g,a.d.f()}},Ut.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,a.d.C(h,d))},Ut.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},Ut.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var g=d.as,m=f(g,d.crossOrigin),x=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?a.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:x,fetchPriority:b}):g==="script"&&a.d.X(h,{crossOrigin:m,integrity:x,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Ut.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=f(d.as,d.crossOrigin);a.d.M(h,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&a.d.M(h)},Ut.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,m=f(g,d.crossOrigin);a.d.L(h,g,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Ut.preloadModule=function(h,d){if(typeof h=="string")if(d){var g=f(d.as,d.crossOrigin);a.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else a.d.m(h)},Ut.requestFormReset=function(h){a.d.r(h)},Ut.unstable_batchedUpdates=function(h,d){return h(d)},Ut.useFormState=function(h,d,g){return u.H.useFormState(h,d,g)},Ut.useFormStatus=function(){return u.H.useHostTransitionStatus()},Ut.version="19.2.3",Ut}var $x;function gv(){if($x)return Uh.exports;$x=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Uh.exports=hE(),Uh.exports}var Vx;function pE(){if(Vx)return yo;Vx=1;var e=dE(),n=ss(),i=gv();function a(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)r+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function s(t){var r=t,l=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(l=r.return),t=r.return;while(t)}return r.tag===3?l:null}function u(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function f(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function h(t){if(s(t)!==t)throw Error(a(188))}function d(t){var r=t.alternate;if(!r){if(r=s(t),r===null)throw Error(a(188));return r!==t?null:t}for(var l=t,c=r;;){var p=l.return;if(p===null)break;var y=p.alternate;if(y===null){if(c=p.return,c!==null){l=c;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===l)return h(p),t;if(y===c)return h(p),r;y=y.sibling}throw Error(a(188))}if(l.return!==c.return)l=p,c=y;else{for(var S=!1,M=p.child;M;){if(M===l){S=!0,l=p,c=y;break}if(M===c){S=!0,c=p,l=y;break}M=M.sibling}if(!S){for(M=y.child;M;){if(M===l){S=!0,l=y,c=p;break}if(M===c){S=!0,c=y,l=p;break}M=M.sibling}if(!S)throw Error(a(189))}}if(l.alternate!==c)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?t:r}function g(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=g(t),r!==null)return r;t=t.sibling}return null}var m=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),k=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function P(t){return t===null||typeof t!="object"?null:(t=V&&t[V]||t["@@iterator"],typeof t=="function"?t:null)}var te=Symbol.for("react.client.reference");function O(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===te?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case E:return"Fragment";case _:return"Profiler";case N:return"StrictMode";case L:return"Suspense";case A:return"SuspenseList";case G:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case w:return"Portal";case k:return t.displayName||"Context";case D:return(t._context.displayName||"Context")+".Consumer";case C:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case H:return r=t.displayName||null,r!==null?r:O(t.type)||"Memo";case F:r=t._payload,t=t._init;try{return O(t(r))}catch{}}return null}var B=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},K=[],z=-1;function R(t){return{current:t}}function $(t){0>z||(t.current=K[z],K[z]=null,z--)}function T(t,r){z++,K[z]=t.current,t.current=r}var ie=R(null),ce=R(null),fe=R(null),he=R(null);function ue(t,r){switch(T(fe,r),T(ce,t),T(ie,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?rx(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=rx(r),t=ax(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}$(ie),T(ie,t)}function me(){$(ie),$(ce),$(fe)}function Ee(t){t.memoizedState!==null&&T(he,t);var r=ie.current,l=ax(r,t.type);r!==l&&(T(ce,t),T(ie,l))}function Ce(t){ce.current===t&&($(ie),$(ce)),he.current===t&&($(he),fo._currentValue=Y)}var we,Ne;function Re(t){if(we===void 0)try{throw Error()}catch(l){var r=l.stack.trim().match(/\n( *(at )?)/);we=r&&r[1]||"",Ne=-1<l.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+we+t+Ne}var Ze=!1;function Xe(t,r){if(!t||Ze)return"";Ze=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(r){var
|
|
3
|
+
`+we+t+Ne}var Ze=!1;function Xe(t,r){if(!t||Ze)return"";Ze=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(r){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(re){var ee=re}Reflect.construct(t,[],se)}else{try{se.call()}catch(re){ee=re}t.call(se.prototype)}}else{try{throw Error()}catch(re){ee=re}(se=t())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(re){if(re&&ee&&typeof re.stack=="string")return[re.stack,ee.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=c.DetermineComponentFrameRoot(),S=y[0],M=y[1];if(S&&M){var I=S.split(`
|
|
4
4
|
`),W=M.split(`
|
|
5
5
|
`);for(p=c=0;c<I.length&&!I[c].includes("DetermineComponentFrameRoot");)c++;for(;p<W.length&&!W[p].includes("DetermineComponentFrameRoot");)p++;if(c===I.length||p===W.length)for(c=I.length-1,p=W.length-1;1<=c&&0<=p&&I[c]!==W[p];)p--;for(;1<=c&&0<=p;c--,p--)if(I[c]!==W[p]){if(c!==1||p!==1)do if(c--,p--,0>p||I[c]!==W[p]){var le=`
|
|
6
|
-
`+I[c].replace(" at new "," at ");return t.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",t.displayName)),le}while(1<=c&&0<=p);break}}}finally{Ze=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?Re(l):""}function ht(t,r){switch(t.tag){case 26:case 27:case 5:return Re(t.type);case 16:return Re("Lazy");case 13:return t.child!==r&&r!==null?Re("Suspense Fallback"):Re("Suspense");case 19:return Re("SuspenseList");case 0:case 15:return Xe(t.type,!1);case 11:return Xe(t.type.render,!1);case 1:return Xe(t.type,!0);case 31:return Re("Activity");default:return""}}function
|
|
6
|
+
`+I[c].replace(" at new "," at ");return t.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",t.displayName)),le}while(1<=c&&0<=p);break}}}finally{Ze=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?Re(l):""}function ht(t,r){switch(t.tag){case 26:case 27:case 5:return Re(t.type);case 16:return Re("Lazy");case 13:return t.child!==r&&r!==null?Re("Suspense Fallback"):Re("Suspense");case 19:return Re("SuspenseList");case 0:case 15:return Xe(t.type,!1);case 11:return Xe(t.type.render,!1);case 1:return Xe(t.type,!0);case 31:return Re("Activity");default:return""}}function on(t){try{var r="",l=null;do r+=ht(t,l),l=t,t=t.return;while(t);return r}catch(c){return`
|
|
7
7
|
Error generating stack: `+c.message+`
|
|
8
|
-
`+c.stack}}var Lt=Object.prototype.hasOwnProperty,Gt=e.unstable_scheduleCallback,Rn=e.unstable_cancelCallback,si=e.unstable_shouldYield,oi=e.unstable_requestPaint,Et=e.unstable_now,Ii=e.unstable_getCurrentPriorityLevel,ae=e.unstable_ImmediatePriority,pe=e.unstable_UserBlockingPriority,_e=e.unstable_NormalPriority,De=e.unstable_LowPriority,$e=e.unstable_IdlePriority,Vt=e.log,On=e.unstable_setDisableYieldValue,At=null,pt=null;function Ht(t){if(typeof Vt=="function"&&On(t),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode(At,t)}catch{}}var Ke=Math.clz32?Math.clz32:Sf,Gn=Math.log,on=Math.LN2;function Sf(t){return t>>>=0,t===0?32:31-(Gn(t)/on|0)|0}var aa=256,la=262144,sa=4194304;function ui(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function oa(t,r,l){var c=t.pendingLanes;if(c===0)return 0;var p=0,y=t.suspendedLanes,S=t.pingedLanes;t=t.warmLanes;var M=c&134217727;return M!==0?(c=M&~y,c!==0?p=ui(c):(S&=M,S!==0?p=ui(S):l||(l=M&~t,l!==0&&(p=ui(l))))):(M=c&~y,M!==0?p=ui(M):S!==0?p=ui(S):l||(l=c&~t,l!==0&&(p=ui(l)))),p===0?0:r!==0&&r!==p&&(r&y)===0&&(y=p&-p,l=r&-r,y>=l||y===32&&(l&4194048)!==0)?r:p}function _r(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function _f(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function So(){var t=sa;return sa<<=1,(sa&62914560)===0&&(sa=4194304),t}function vl(t){for(var r=[],l=0;31>l;l++)r.push(t);return r}function kr(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function kf(t,r,l,c,p,y){var S=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var M=t.entanglements,I=t.expirationTimes,W=t.hiddenUpdates;for(l=S&~l;0<l;){var le=31-Ke(l),oe=1<<le;M[le]=0,I[le]=-1;var ee=W[le];if(ee!==null)for(W[le]=null,le=0;le<ee.length;le++){var re=ee[le];re!==null&&(re.lane&=-536870913)}l&=~oe}c!==0&&_o(t,c,0),y!==0&&p===0&&t.tag!==0&&(t.suspendedLanes|=y&~(S&~r))}function _o(t,r,l){t.pendingLanes|=r,t.suspendedLanes&=~r;var c=31-Ke(r);t.entangledLanes|=r,t.entanglements[c]=t.entanglements[c]|1073741824|l&261930}function ko(t,r){var l=t.entangledLanes|=r;for(t=t.entanglements;l;){var c=31-Ke(l),p=1<<c;p&r|t[c]&r&&(t[c]|=r),l&=~p}}function Eo(t,r){var l=r&-r;return l=(l&42)!==0?1:wl(l),(l&(t.suspendedLanes|r))!==0?0:l}function wl(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Sl(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function No(){var t=U.p;return t!==0?t:(t=window.event,t===void 0?32:Nx(t.type))}function Co(t,r){var l=U.p;try{return U.p=t,r()}finally{U.p=l}}var Zn=Math.random().toString(36).slice(2),Nt="__reactFiber$"+Zn,Bt="__reactProps$"+Zn,ci="__reactContainer$"+Zn,ua="__reactEvents$"+Zn,Mo="__reactListeners$"+Zn,Ef="__reactHandles$"+Zn,To="__reactResources$"+Zn,Er="__reactMarker$"+Zn;function _l(t){delete t[Nt],delete t[Bt],delete t[ua],delete t[Mo],delete t[Ef]}function qi(t){var r=t[Nt];if(r)return r;for(var l=t.parentNode;l;){if(r=l[ci]||l[Nt]){if(l=r.alternate,r.child!==null||l!==null&&l.child!==null)for(t=cx(t);t!==null;){if(l=t[Nt])return l;t=cx(t)}return r}t=l,l=t.parentNode}return null}function $i(t){if(t=t[Nt]||t[ci]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function Vi(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(a(33))}function Pi(t){var r=t[To];return r||(r=t[To]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function yt(t){t[Er]=!0}var Ao=new Set,zo={};function fi(t,r){Yi(t,r),Yi(t+"Capture",r)}function Yi(t,r){for(zo[t]=r,t=0;t<r.length;t++)Ao.add(r[t])}var Nf=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),kl={},jo={};function Cf(t){return Lt.call(jo,t)?!0:Lt.call(kl,t)?!1:Nf.test(t)?jo[t]=!0:(kl[t]=!0,!1)}function ca(t,r,l){if(Cf(r))if(l===null)t.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var c=r.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+l)}}function fa(t,r,l){if(l===null)t.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+l)}}function Ln(t,r,l,c){if(c===null)t.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(r,l,""+c)}}function Zt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Do(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Mf(t,r,l){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,y=c.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return p.call(this)},set:function(S){l=""+S,y.call(this,S)}}),Object.defineProperty(t,r,{enumerable:c.enumerable}),{getValue:function(){return l},setValue:function(S){l=""+S},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function da(t){if(!t._valueTracker){var r=Do(t)?"checked":"value";t._valueTracker=Mf(t,r,""+t[r])}}function Ro(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var l=r.getValue(),c="";return t&&(c=Do(t)?t.checked?"true":"false":t.value),t=c,t!==l?(r.setValue(t),!0):!1}function Nr(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Tf=/[\n"\\]/g;function Qt(t){return t.replace(Tf,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Cr(t,r,l,c,p,y,S,M){t.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.type=S:t.removeAttribute("type"),r!=null?S==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Zt(r)):t.value!==""+Zt(r)&&(t.value=""+Zt(r)):S!=="submit"&&S!=="reset"||t.removeAttribute("value"),r!=null?El(t,S,Zt(r)):l!=null?El(t,S,Zt(l)):c!=null&&t.removeAttribute("value"),p==null&&y!=null&&(t.defaultChecked=!!y),p!=null&&(t.checked=p&&typeof p!="function"&&typeof p!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?t.name=""+Zt(M):t.removeAttribute("name")}function Oo(t,r,l,c,p,y,S,M){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.type=y),r!=null||l!=null){if(!(y!=="submit"&&y!=="reset"||r!=null)){da(t);return}l=l!=null?""+Zt(l):"",r=r!=null?""+Zt(r):l,M||r===t.value||(t.value=r),t.defaultValue=r}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=M?t.checked:!!c,t.defaultChecked=!!c,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.name=S),da(t)}function El(t,r,l){r==="number"&&Nr(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function di(t,r,l,c){if(t=t.options,r){r={};for(var p=0;p<l.length;p++)r["$"+l[p]]=!0;for(l=0;l<t.length;l++)p=r.hasOwnProperty("$"+t[l].value),t[l].selected!==p&&(t[l].selected=p),p&&c&&(t[l].defaultSelected=!0)}else{for(l=""+Zt(l),r=null,p=0;p<t.length;p++){if(t[p].value===l){t[p].selected=!0,c&&(t[p].defaultSelected=!0);return}r!==null||t[p].disabled||(r=t[p])}r!==null&&(r.selected=!0)}}function Km(t,r,l){if(r!=null&&(r=""+Zt(r),r!==t.value&&(t.value=r),l==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=l!=null?""+Zt(l):""}function Jm(t,r,l,c){if(r==null){if(c!=null){if(l!=null)throw Error(a(92));if(B(c)){if(1<c.length)throw Error(a(93));c=c[0]}l=c}l==null&&(l=""),r=l}l=Zt(r),t.defaultValue=l,c=t.textContent,c===l&&c!==""&&c!==null&&(t.value=c),da(t)}function ha(t,r){if(r){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=r;return}}t.textContent=r}var i_=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Wm(t,r,l){var c=r.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?c?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":c?t.setProperty(r,l):typeof l!="number"||l===0||i_.has(r)?r==="float"?t.cssFloat=l:t[r]=(""+l).trim():t[r]=l+"px"}function eg(t,r,l){if(r!=null&&typeof r!="object")throw Error(a(62));if(t=t.style,l!=null){for(var c in l)!l.hasOwnProperty(c)||r!=null&&r.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var p in r)c=r[p],r.hasOwnProperty(p)&&l[p]!==c&&Wm(t,p,c)}else for(var y in r)r.hasOwnProperty(y)&&Wm(t,y,r[y])}function Af(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var r_=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),a_=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Lo(t){return a_.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function hi(){}var zf=null;function jf(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var pa=null,ma=null;function tg(t){var r=$i(t);if(r&&(t=r.stateNode)){var l=t[Bt]||null;e:switch(t=r.stateNode,r.type){case"input":if(Cr(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),r=l.name,l.type==="radio"&&r!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Qt(""+r)+'"][type="radio"]'),r=0;r<l.length;r++){var c=l[r];if(c!==t&&c.form===t.form){var p=c[Bt]||null;if(!p)throw Error(a(90));Cr(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<l.length;r++)c=l[r],c.form===t.form&&Ro(c)}break e;case"textarea":Km(t,l.value,l.defaultValue);break e;case"select":r=l.value,r!=null&&di(t,!!l.multiple,r,!1)}}}var Df=!1;function ng(t,r,l){if(Df)return t(r,l);Df=!0;try{var c=t(r);return c}finally{if(Df=!1,(pa!==null||ma!==null)&&(_u(),pa&&(r=pa,t=ma,ma=pa=null,tg(r),t)))for(r=0;r<t.length;r++)tg(t[r])}}function Nl(t,r){var l=t.stateNode;if(l===null)return null;var c=l[Bt]||null;if(c===null)return null;l=c[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(a(231,r,typeof l));return l}var pi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rf=!1;if(pi)try{var Cl={};Object.defineProperty(Cl,"passive",{get:function(){Rf=!0}}),window.addEventListener("test",Cl,Cl),window.removeEventListener("test",Cl,Cl)}catch{Rf=!1}var Xi=null,Of=null,Ho=null;function ig(){if(Ho)return Ho;var t,r=Of,l=r.length,c,p="value"in Xi?Xi.value:Xi.textContent,y=p.length;for(t=0;t<l&&r[t]===p[t];t++);var S=l-t;for(c=1;c<=S&&r[l-c]===p[y-c];c++);return Ho=p.slice(t,1<c?1-c:void 0)}function Bo(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function Uo(){return!0}function rg(){return!1}function Kt(t){function r(l,c,p,y,S){this._reactName=l,this._targetInst=p,this.type=c,this.nativeEvent=y,this.target=S,this.currentTarget=null;for(var M in t)t.hasOwnProperty(M)&&(l=t[M],this[M]=l?l(y):y[M]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Uo:rg,this.isPropagationStopped=rg,this}return m(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Uo)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Uo)},persist:function(){},isPersistent:Uo}),r}var Mr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Io=Kt(Mr),Ml=m({},Mr,{view:0,detail:0}),l_=Kt(Ml),Lf,Hf,Tl,qo=m({},Ml,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uf,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Tl&&(Tl&&t.type==="mousemove"?(Lf=t.screenX-Tl.screenX,Hf=t.screenY-Tl.screenY):Hf=Lf=0,Tl=t),Lf)},movementY:function(t){return"movementY"in t?t.movementY:Hf}}),ag=Kt(qo),s_=m({},qo,{dataTransfer:0}),o_=Kt(s_),u_=m({},Ml,{relatedTarget:0}),Bf=Kt(u_),c_=m({},Mr,{animationName:0,elapsedTime:0,pseudoElement:0}),f_=Kt(c_),d_=m({},Mr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),h_=Kt(d_),p_=m({},Mr,{data:0}),lg=Kt(p_),m_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},g_={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},y_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function x_(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=y_[t])?!!r[t]:!1}function Uf(){return x_}var b_=m({},Ml,{key:function(t){if(t.key){var r=m_[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Bo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?g_[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uf,charCode:function(t){return t.type==="keypress"?Bo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Bo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),v_=Kt(b_),w_=m({},qo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sg=Kt(w_),S_=m({},Ml,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uf}),__=Kt(S_),k_=m({},Mr,{propertyName:0,elapsedTime:0,pseudoElement:0}),E_=Kt(k_),N_=m({},qo,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),C_=Kt(N_),M_=m({},Mr,{newState:0,oldState:0}),T_=Kt(M_),A_=[9,13,27,32],If=pi&&"CompositionEvent"in window,Al=null;pi&&"documentMode"in document&&(Al=document.documentMode);var z_=pi&&"TextEvent"in window&&!Al,og=pi&&(!If||Al&&8<Al&&11>=Al),ug=" ",cg=!1;function fg(t,r){switch(t){case"keyup":return A_.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ga=!1;function j_(t,r){switch(t){case"compositionend":return dg(r);case"keypress":return r.which!==32?null:(cg=!0,ug);case"textInput":return t=r.data,t===ug&&cg?null:t;default:return null}}function D_(t,r){if(ga)return t==="compositionend"||!If&&fg(t,r)?(t=ig(),Ho=Of=Xi=null,ga=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return og&&r.locale!=="ko"?null:r.data;default:return null}}var R_={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function hg(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!R_[t.type]:r==="textarea"}function pg(t,r,l,c){pa?ma?ma.push(c):ma=[c]:pa=c,r=Au(r,"onChange"),0<r.length&&(l=new Io("onChange","change",null,l,c),t.push({event:l,listeners:r}))}var zl=null,jl=null;function O_(t){Qy(t,0)}function $o(t){var r=Vi(t);if(Ro(r))return t}function mg(t,r){if(t==="change")return r}var gg=!1;if(pi){var qf;if(pi){var $f="oninput"in document;if(!$f){var yg=document.createElement("div");yg.setAttribute("oninput","return;"),$f=typeof yg.oninput=="function"}qf=$f}else qf=!1;gg=qf&&(!document.documentMode||9<document.documentMode)}function xg(){zl&&(zl.detachEvent("onpropertychange",bg),jl=zl=null)}function bg(t){if(t.propertyName==="value"&&$o(jl)){var r=[];pg(r,jl,t,jf(t)),ng(O_,r)}}function L_(t,r,l){t==="focusin"?(xg(),zl=r,jl=l,zl.attachEvent("onpropertychange",bg)):t==="focusout"&&xg()}function H_(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return $o(jl)}function B_(t,r){if(t==="click")return $o(r)}function U_(t,r){if(t==="input"||t==="change")return $o(r)}function I_(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var un=typeof Object.is=="function"?Object.is:I_;function Dl(t,r){if(un(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var l=Object.keys(t),c=Object.keys(r);if(l.length!==c.length)return!1;for(c=0;c<l.length;c++){var p=l[c];if(!Lt.call(r,p)||!un(t[p],r[p]))return!1}return!0}function vg(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function wg(t,r){var l=vg(t);t=0;for(var c;l;){if(l.nodeType===3){if(c=t+l.textContent.length,t<=r&&c>=r)return{node:l,offset:r-t};t=c}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=vg(l)}}function Sg(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Sg(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function _g(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Nr(t.document);r instanceof t.HTMLIFrameElement;){try{var l=typeof r.contentWindow.location.href=="string"}catch{l=!1}if(l)t=r.contentWindow;else break;r=Nr(t.document)}return r}function Vf(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var q_=pi&&"documentMode"in document&&11>=document.documentMode,ya=null,Pf=null,Rl=null,Yf=!1;function kg(t,r,l){var c=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Yf||ya==null||ya!==Nr(c)||(c=ya,"selectionStart"in c&&Vf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Rl&&Dl(Rl,c)||(Rl=c,c=Au(Pf,"onSelect"),0<c.length&&(r=new Io("onSelect","select",null,r,l),t.push({event:r,listeners:c}),r.target=ya)))}function Tr(t,r){var l={};return l[t.toLowerCase()]=r.toLowerCase(),l["Webkit"+t]="webkit"+r,l["Moz"+t]="moz"+r,l}var xa={animationend:Tr("Animation","AnimationEnd"),animationiteration:Tr("Animation","AnimationIteration"),animationstart:Tr("Animation","AnimationStart"),transitionrun:Tr("Transition","TransitionRun"),transitionstart:Tr("Transition","TransitionStart"),transitioncancel:Tr("Transition","TransitionCancel"),transitionend:Tr("Transition","TransitionEnd")},Xf={},Eg={};pi&&(Eg=document.createElement("div").style,"AnimationEvent"in window||(delete xa.animationend.animation,delete xa.animationiteration.animation,delete xa.animationstart.animation),"TransitionEvent"in window||delete xa.transitionend.transition);function Ar(t){if(Xf[t])return Xf[t];if(!xa[t])return t;var r=xa[t],l;for(l in r)if(r.hasOwnProperty(l)&&l in Eg)return Xf[t]=r[l];return t}var Ng=Ar("animationend"),Cg=Ar("animationiteration"),Mg=Ar("animationstart"),$_=Ar("transitionrun"),V_=Ar("transitionstart"),P_=Ar("transitioncancel"),Tg=Ar("transitionend"),Ag=new Map,Ff="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ff.push("scrollEnd");function Hn(t,r){Ag.set(t,r),fi(r,[t])}var Vo=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},_n=[],ba=0,Gf=0;function Po(){for(var t=ba,r=Gf=ba=0;r<t;){var l=_n[r];_n[r++]=null;var c=_n[r];_n[r++]=null;var p=_n[r];_n[r++]=null;var y=_n[r];if(_n[r++]=null,c!==null&&p!==null){var S=c.pending;S===null?p.next=p:(p.next=S.next,S.next=p),c.pending=p}y!==0&&zg(l,p,y)}}function Yo(t,r,l,c){_n[ba++]=t,_n[ba++]=r,_n[ba++]=l,_n[ba++]=c,Gf|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function Zf(t,r,l,c){return Yo(t,r,l,c),Xo(t)}function zr(t,r){return Yo(t,null,null,r),Xo(t)}function zg(t,r,l){t.lanes|=l;var c=t.alternate;c!==null&&(c.lanes|=l);for(var p=!1,y=t.return;y!==null;)y.childLanes|=l,c=y.alternate,c!==null&&(c.childLanes|=l),y.tag===22&&(t=y.stateNode,t===null||t._visibility&1||(p=!0)),t=y,y=y.return;return t.tag===3?(y=t.stateNode,p&&r!==null&&(p=31-Ke(l),t=y.hiddenUpdates,c=t[p],c===null?t[p]=[r]:c.push(r),r.lane=l|536870912),y):null}function Xo(t){if(50<ns)throw ns=0,rh=null,Error(a(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var va={};function Y_(t,r,l,c){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cn(t,r,l,c){return new Y_(t,r,l,c)}function Qf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function mi(t,r){var l=t.alternate;return l===null?(l=cn(t.tag,r,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=r,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,r=t.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function jg(t,r){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,r=l.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function Fo(t,r,l,c,p,y){var S=0;if(c=t,typeof t=="function")Qf(t)&&(S=1);else if(typeof t=="string")S=Qk(t,l,ie.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case G:return t=cn(31,l,r,p),t.elementType=G,t.lanes=y,t;case E:return jr(l.children,p,y,r);case N:S=8,p|=24;break;case _:return t=cn(12,l,r,p|2),t.elementType=_,t.lanes=y,t;case L:return t=cn(13,l,r,p),t.elementType=L,t.lanes=y,t;case A:return t=cn(19,l,r,p),t.elementType=A,t.lanes=y,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case k:S=10;break e;case D:S=9;break e;case C:S=11;break e;case H:S=14;break e;case F:S=16,c=null;break e}S=29,l=Error(a(130,t===null?"null":typeof t,"")),c=null}return r=cn(S,l,r,p),r.elementType=t,r.type=c,r.lanes=y,r}function jr(t,r,l,c){return t=cn(7,t,c,r),t.lanes=l,t}function Kf(t,r,l){return t=cn(6,t,null,r),t.lanes=l,t}function Dg(t){var r=cn(18,null,null,0);return r.stateNode=t,r}function Jf(t,r,l){return r=cn(4,t.children!==null?t.children:[],t.key,r),r.lanes=l,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var Rg=new WeakMap;function kn(t,r){if(typeof t=="object"&&t!==null){var l=Rg.get(t);return l!==void 0?l:(r={value:t,source:r,stack:sn(r)},Rg.set(t,r),r)}return{value:t,source:r,stack:sn(r)}}var wa=[],Sa=0,Go=null,Ol=0,En=[],Nn=0,Fi=null,Qn=1,Kn="";function gi(t,r){wa[Sa++]=Ol,wa[Sa++]=Go,Go=t,Ol=r}function Og(t,r,l){En[Nn++]=Qn,En[Nn++]=Kn,En[Nn++]=Fi,Fi=t;var c=Qn;t=Kn;var p=32-Ke(c)-1;c&=~(1<<p),l+=1;var y=32-Ke(r)+p;if(30<y){var S=p-p%5;y=(c&(1<<S)-1).toString(32),c>>=S,p-=S,Qn=1<<32-Ke(r)+p|l<<p|c,Kn=y+t}else Qn=1<<y|l<<p|c,Kn=t}function Wf(t){t.return!==null&&(gi(t,1),Og(t,1,0))}function ed(t){for(;t===Go;)Go=wa[--Sa],wa[Sa]=null,Ol=wa[--Sa],wa[Sa]=null;for(;t===Fi;)Fi=En[--Nn],En[Nn]=null,Kn=En[--Nn],En[Nn]=null,Qn=En[--Nn],En[Nn]=null}function Lg(t,r){En[Nn++]=Qn,En[Nn++]=Kn,En[Nn++]=Fi,Qn=r.id,Kn=r.overflow,Fi=t}var zt=null,lt=null,qe=!1,Gi=null,Cn=!1,td=Error(a(519));function Zi(t){var r=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ll(kn(r,t)),td}function Hg(t){var r=t.stateNode,l=t.type,c=t.memoizedProps;switch(r[Nt]=t,r[Bt]=c,l){case"dialog":He("cancel",r),He("close",r);break;case"iframe":case"object":case"embed":He("load",r);break;case"video":case"audio":for(l=0;l<rs.length;l++)He(rs[l],r);break;case"source":He("error",r);break;case"img":case"image":case"link":He("error",r),He("load",r);break;case"details":He("toggle",r);break;case"input":He("invalid",r),Oo(r,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":He("invalid",r);break;case"textarea":He("invalid",r),Jm(r,c.value,c.defaultValue,c.children)}l=c.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||r.textContent===""+l||c.suppressHydrationWarning===!0||ex(r.textContent,l)?(c.popover!=null&&(He("beforetoggle",r),He("toggle",r)),c.onScroll!=null&&He("scroll",r),c.onScrollEnd!=null&&He("scrollend",r),c.onClick!=null&&(r.onclick=hi),r=!0):r=!1,r||Zi(t,!0)}function Bg(t){for(zt=t.return;zt;)switch(zt.tag){case 5:case 31:case 13:Cn=!1;return;case 27:case 3:Cn=!0;return;default:zt=zt.return}}function _a(t){if(t!==zt)return!1;if(!qe)return Bg(t),qe=!0,!1;var r=t.tag,l;if((l=r!==3&&r!==27)&&((l=r===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||bh(t.type,t.memoizedProps)),l=!l),l&<&&Zi(t),Bg(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));lt=ux(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));lt=ux(t)}else r===27?(r=lt,ur(t.type)?(t=kh,kh=null,lt=t):lt=r):lt=zt?Tn(t.stateNode.nextSibling):null;return!0}function Dr(){lt=zt=null,qe=!1}function nd(){var t=Gi;return t!==null&&(tn===null?tn=t:tn.push.apply(tn,t),Gi=null),t}function Ll(t){Gi===null?Gi=[t]:Gi.push(t)}var id=R(null),Rr=null,yi=null;function Qi(t,r,l){T(id,r._currentValue),r._currentValue=l}function xi(t){t._currentValue=id.current,$(id)}function rd(t,r,l){for(;t!==null;){var c=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,c!==null&&(c.childLanes|=r)):c!==null&&(c.childLanes&r)!==r&&(c.childLanes|=r),t===l)break;t=t.return}}function ad(t,r,l,c){var p=t.child;for(p!==null&&(p.return=t);p!==null;){var y=p.dependencies;if(y!==null){var S=p.child;y=y.firstContext;e:for(;y!==null;){var M=y;y=p;for(var I=0;I<r.length;I++)if(M.context===r[I]){y.lanes|=l,M=y.alternate,M!==null&&(M.lanes|=l),rd(y.return,l,t),c||(S=null);break e}y=M.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(a(341));S.lanes|=l,y=S.alternate,y!==null&&(y.lanes|=l),rd(S,l,t),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===t){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function ka(t,r,l,c){t=null;for(var p=r,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var S=p.alternate;if(S===null)throw Error(a(387));if(S=S.memoizedProps,S!==null){var M=p.type;un(p.pendingProps.value,S.value)||(t!==null?t.push(M):t=[M])}}else if(p===he.current){if(S=p.alternate,S===null)throw Error(a(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(t!==null?t.push(us):t=[us])}p=p.return}t!==null&&ad(r,t,l,c),r.flags|=262144}function Zo(t){for(t=t.firstContext;t!==null;){if(!un(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Or(t){Rr=t,yi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function jt(t){return Ug(Rr,t)}function Qo(t,r){return Rr===null&&Or(t),Ug(t,r)}function Ug(t,r){var l=r._currentValue;if(r={context:r,memoizedValue:l,next:null},yi===null){if(t===null)throw Error(a(308));yi=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else yi=yi.next=r;return l}var X_=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(l,c){t.push(c)}};this.abort=function(){r.aborted=!0,t.forEach(function(l){return l()})}},F_=e.unstable_scheduleCallback,G_=e.unstable_NormalPriority,xt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ld(){return{controller:new X_,data:new Map,refCount:0}}function Hl(t){t.refCount--,t.refCount===0&&F_(G_,function(){t.controller.abort()})}var Bl=null,sd=0,Ea=0,Na=null;function Z_(t,r){if(Bl===null){var l=Bl=[];sd=0,Ea=ch(),Na={status:"pending",value:void 0,then:function(c){l.push(c)}}}return sd++,r.then(Ig,Ig),r}function Ig(){if(--sd===0&&Bl!==null){Na!==null&&(Na.status="fulfilled");var t=Bl;Bl=null,Ea=0,Na=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function Q_(t,r){var l=[],c={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return t.then(function(){c.status="fulfilled",c.value=r;for(var p=0;p<l.length;p++)(0,l[p])(r)},function(p){for(c.status="rejected",c.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),c}var qg=j.S;j.S=function(t,r){ky=Et(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&Z_(t,r),qg!==null&&qg(t,r)};var Lr=R(null);function od(){var t=Lr.current;return t!==null?t:it.pooledCache}function Ko(t,r){r===null?T(Lr,Lr.current):T(Lr,r.pool)}function $g(){var t=od();return t===null?null:{parent:xt._currentValue,pool:t}}var Ca=Error(a(460)),ud=Error(a(474)),Jo=Error(a(542)),Wo={then:function(){}};function Vg(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Pg(t,r,l){switch(l=t[l],l===void 0?t.push(r):l!==r&&(r.then(hi,hi),r=l),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Xg(t),t;default:if(typeof r.status=="string")r.then(hi,hi);else{if(t=it,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=r,t.status="pending",t.then(function(c){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=c}},function(c){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=c}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Xg(t),t}throw Br=r,Ca}}function Hr(t){try{var r=t._init;return r(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Br=l,Ca):l}}var Br=null;function Yg(){if(Br===null)throw Error(a(459));var t=Br;return Br=null,t}function Xg(t){if(t===Ca||t===Jo)throw Error(a(483))}var Ma=null,Ul=0;function eu(t){var r=Ul;return Ul+=1,Ma===null&&(Ma=[]),Pg(Ma,t,r)}function Il(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function tu(t,r){throw r.$$typeof===x?Error(a(525)):(t=Object.prototype.toString.call(r),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function Fg(t){function r(Z,X){if(t){var J=Z.deletions;J===null?(Z.deletions=[X],Z.flags|=16):J.push(X)}}function l(Z,X){if(!t)return null;for(;X!==null;)r(Z,X),X=X.sibling;return null}function c(Z){for(var X=new Map;Z!==null;)Z.key!==null?X.set(Z.key,Z):X.set(Z.index,Z),Z=Z.sibling;return X}function p(Z,X){return Z=mi(Z,X),Z.index=0,Z.sibling=null,Z}function y(Z,X,J){return Z.index=J,t?(J=Z.alternate,J!==null?(J=J.index,J<X?(Z.flags|=67108866,X):J):(Z.flags|=67108866,X)):(Z.flags|=1048576,X)}function S(Z){return t&&Z.alternate===null&&(Z.flags|=67108866),Z}function M(Z,X,J,se){return X===null||X.tag!==6?(X=Kf(J,Z.mode,se),X.return=Z,X):(X=p(X,J),X.return=Z,X)}function I(Z,X,J,se){var ve=J.type;return ve===E?le(Z,X,J.props.children,se,J.key):X!==null&&(X.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===F&&Hr(ve)===X.type)?(X=p(X,J.props),Il(X,J),X.return=Z,X):(X=Fo(J.type,J.key,J.props,null,Z.mode,se),Il(X,J),X.return=Z,X)}function W(Z,X,J,se){return X===null||X.tag!==4||X.stateNode.containerInfo!==J.containerInfo||X.stateNode.implementation!==J.implementation?(X=Jf(J,Z.mode,se),X.return=Z,X):(X=p(X,J.children||[]),X.return=Z,X)}function le(Z,X,J,se,ve){return X===null||X.tag!==7?(X=jr(J,Z.mode,se,ve),X.return=Z,X):(X=p(X,J),X.return=Z,X)}function oe(Z,X,J){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=Kf(""+X,Z.mode,J),X.return=Z,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case b:return J=Fo(X.type,X.key,X.props,null,Z.mode,J),Il(J,X),J.return=Z,J;case w:return X=Jf(X,Z.mode,J),X.return=Z,X;case F:return X=Hr(X),oe(Z,X,J)}if(B(X)||P(X))return X=jr(X,Z.mode,J,null),X.return=Z,X;if(typeof X.then=="function")return oe(Z,eu(X),J);if(X.$$typeof===k)return oe(Z,Qo(Z,X),J);tu(Z,X)}return null}function ee(Z,X,J,se){var ve=X!==null?X.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return ve!==null?null:M(Z,X,""+J,se);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return J.key===ve?I(Z,X,J,se):null;case w:return J.key===ve?W(Z,X,J,se):null;case F:return J=Hr(J),ee(Z,X,J,se)}if(B(J)||P(J))return ve!==null?null:le(Z,X,J,se,null);if(typeof J.then=="function")return ee(Z,X,eu(J),se);if(J.$$typeof===k)return ee(Z,X,Qo(Z,J),se);tu(Z,J)}return null}function re(Z,X,J,se,ve){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Z=Z.get(J)||null,M(X,Z,""+se,ve);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case b:return Z=Z.get(se.key===null?J:se.key)||null,I(X,Z,se,ve);case w:return Z=Z.get(se.key===null?J:se.key)||null,W(X,Z,se,ve);case F:return se=Hr(se),re(Z,X,J,se,ve)}if(B(se)||P(se))return Z=Z.get(J)||null,le(X,Z,se,ve,null);if(typeof se.then=="function")return re(Z,X,J,eu(se),ve);if(se.$$typeof===k)return re(Z,X,J,Qo(X,se),ve);tu(X,se)}return null}function ye(Z,X,J,se){for(var ve=null,Fe=null,xe=X,ze=X=0,Ie=null;xe!==null&&ze<J.length;ze++){xe.index>ze?(Ie=xe,xe=null):Ie=xe.sibling;var Ge=ee(Z,xe,J[ze],se);if(Ge===null){xe===null&&(xe=Ie);break}t&&xe&&Ge.alternate===null&&r(Z,xe),X=y(Ge,X,ze),Fe===null?ve=Ge:Fe.sibling=Ge,Fe=Ge,xe=Ie}if(ze===J.length)return l(Z,xe),qe&&gi(Z,ze),ve;if(xe===null){for(;ze<J.length;ze++)xe=oe(Z,J[ze],se),xe!==null&&(X=y(xe,X,ze),Fe===null?ve=xe:Fe.sibling=xe,Fe=xe);return qe&&gi(Z,ze),ve}for(xe=c(xe);ze<J.length;ze++)Ie=re(xe,Z,ze,J[ze],se),Ie!==null&&(t&&Ie.alternate!==null&&xe.delete(Ie.key===null?ze:Ie.key),X=y(Ie,X,ze),Fe===null?ve=Ie:Fe.sibling=Ie,Fe=Ie);return t&&xe.forEach(function(pr){return r(Z,pr)}),qe&&gi(Z,ze),ve}function ke(Z,X,J,se){if(J==null)throw Error(a(151));for(var ve=null,Fe=null,xe=X,ze=X=0,Ie=null,Ge=J.next();xe!==null&&!Ge.done;ze++,Ge=J.next()){xe.index>ze?(Ie=xe,xe=null):Ie=xe.sibling;var pr=ee(Z,xe,Ge.value,se);if(pr===null){xe===null&&(xe=Ie);break}t&&xe&&pr.alternate===null&&r(Z,xe),X=y(pr,X,ze),Fe===null?ve=pr:Fe.sibling=pr,Fe=pr,xe=Ie}if(Ge.done)return l(Z,xe),qe&&gi(Z,ze),ve;if(xe===null){for(;!Ge.done;ze++,Ge=J.next())Ge=oe(Z,Ge.value,se),Ge!==null&&(X=y(Ge,X,ze),Fe===null?ve=Ge:Fe.sibling=Ge,Fe=Ge);return qe&&gi(Z,ze),ve}for(xe=c(xe);!Ge.done;ze++,Ge=J.next())Ge=re(xe,Z,ze,Ge.value,se),Ge!==null&&(t&&Ge.alternate!==null&&xe.delete(Ge.key===null?ze:Ge.key),X=y(Ge,X,ze),Fe===null?ve=Ge:Fe.sibling=Ge,Fe=Ge);return t&&xe.forEach(function(sE){return r(Z,sE)}),qe&&gi(Z,ze),ve}function nt(Z,X,J,se){if(typeof J=="object"&&J!==null&&J.type===E&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case b:e:{for(var ve=J.key;X!==null;){if(X.key===ve){if(ve=J.type,ve===E){if(X.tag===7){l(Z,X.sibling),se=p(X,J.props.children),se.return=Z,Z=se;break e}}else if(X.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===F&&Hr(ve)===X.type){l(Z,X.sibling),se=p(X,J.props),Il(se,J),se.return=Z,Z=se;break e}l(Z,X);break}else r(Z,X);X=X.sibling}J.type===E?(se=jr(J.props.children,Z.mode,se,J.key),se.return=Z,Z=se):(se=Fo(J.type,J.key,J.props,null,Z.mode,se),Il(se,J),se.return=Z,Z=se)}return S(Z);case w:e:{for(ve=J.key;X!==null;){if(X.key===ve)if(X.tag===4&&X.stateNode.containerInfo===J.containerInfo&&X.stateNode.implementation===J.implementation){l(Z,X.sibling),se=p(X,J.children||[]),se.return=Z,Z=se;break e}else{l(Z,X);break}else r(Z,X);X=X.sibling}se=Jf(J,Z.mode,se),se.return=Z,Z=se}return S(Z);case F:return J=Hr(J),nt(Z,X,J,se)}if(B(J))return ye(Z,X,J,se);if(P(J)){if(ve=P(J),typeof ve!="function")throw Error(a(150));return J=ve.call(J),ke(Z,X,J,se)}if(typeof J.then=="function")return nt(Z,X,eu(J),se);if(J.$$typeof===k)return nt(Z,X,Qo(Z,J),se);tu(Z,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,X!==null&&X.tag===6?(l(Z,X.sibling),se=p(X,J),se.return=Z,Z=se):(l(Z,X),se=Kf(J,Z.mode,se),se.return=Z,Z=se),S(Z)):l(Z,X)}return function(Z,X,J,se){try{Ul=0;var ve=nt(Z,X,J,se);return Ma=null,ve}catch(xe){if(xe===Ca||xe===Jo)throw xe;var Fe=cn(29,xe,null,Z.mode);return Fe.lanes=se,Fe.return=Z,Fe}}}var Ur=Fg(!0),Gg=Fg(!1),Ki=!1;function cd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fd(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ji(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Wi(t,r,l){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(Qe&2)!==0){var p=c.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),c.pending=r,r=Xo(t),zg(t,null,l),r}return Yo(t,c,r,l),Xo(t)}function ql(t,r,l){if(r=r.updateQueue,r!==null&&(r=r.shared,(l&4194048)!==0)){var c=r.lanes;c&=t.pendingLanes,l|=c,r.lanes=l,ko(t,l)}}function dd(t,r){var l=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,l===c)){var p=null,y=null;if(l=l.firstBaseUpdate,l!==null){do{var S={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};y===null?p=y=S:y=y.next=S,l=l.next}while(l!==null);y===null?p=y=r:y=y.next=r}else p=y=r;l={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:c.shared,callbacks:c.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=r:t.next=r,l.lastBaseUpdate=r}var hd=!1;function $l(){if(hd){var t=Na;if(t!==null)throw t}}function Vl(t,r,l,c){hd=!1;var p=t.updateQueue;Ki=!1;var y=p.firstBaseUpdate,S=p.lastBaseUpdate,M=p.shared.pending;if(M!==null){p.shared.pending=null;var I=M,W=I.next;I.next=null,S===null?y=W:S.next=W,S=I;var le=t.alternate;le!==null&&(le=le.updateQueue,M=le.lastBaseUpdate,M!==S&&(M===null?le.firstBaseUpdate=W:M.next=W,le.lastBaseUpdate=I))}if(y!==null){var oe=p.baseState;S=0,le=W=I=null,M=y;do{var ee=M.lane&-536870913,re=ee!==M.lane;if(re?(Ue&ee)===ee:(c&ee)===ee){ee!==0&&ee===Ea&&(hd=!0),le!==null&&(le=le.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var ye=t,ke=M;ee=r;var nt=l;switch(ke.tag){case 1:if(ye=ke.payload,typeof ye=="function"){oe=ye.call(nt,oe,ee);break e}oe=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=ke.payload,ee=typeof ye=="function"?ye.call(nt,oe,ee):ye,ee==null)break e;oe=m({},oe,ee);break e;case 2:Ki=!0}}ee=M.callback,ee!==null&&(t.flags|=64,re&&(t.flags|=8192),re=p.callbacks,re===null?p.callbacks=[ee]:re.push(ee))}else re={lane:ee,tag:M.tag,payload:M.payload,callback:M.callback,next:null},le===null?(W=le=re,I=oe):le=le.next=re,S|=ee;if(M=M.next,M===null){if(M=p.shared.pending,M===null)break;re=M,M=re.next,re.next=null,p.lastBaseUpdate=re,p.shared.pending=null}}while(!0);le===null&&(I=oe),p.baseState=I,p.firstBaseUpdate=W,p.lastBaseUpdate=le,y===null&&(p.shared.lanes=0),rr|=S,t.lanes=S,t.memoizedState=oe}}function Zg(t,r){if(typeof t!="function")throw Error(a(191,t));t.call(r)}function Qg(t,r){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Zg(l[t],r)}var Ta=R(null),nu=R(0);function Kg(t,r){t=Ci,T(nu,t),T(Ta,r),Ci=t|r.baseLanes}function pd(){T(nu,Ci),T(Ta,Ta.current)}function md(){Ci=nu.current,$(Ta),$(nu)}var fn=R(null),Mn=null;function er(t){var r=t.alternate;T(mt,mt.current&1),T(fn,t),Mn===null&&(r===null||Ta.current!==null||r.memoizedState!==null)&&(Mn=t)}function gd(t){T(mt,mt.current),T(fn,t),Mn===null&&(Mn=t)}function Jg(t){t.tag===22?(T(mt,mt.current),T(fn,t),Mn===null&&(Mn=t)):tr()}function tr(){T(mt,mt.current),T(fn,fn.current)}function dn(t){$(fn),Mn===t&&(Mn=null),$(mt)}var mt=R(0);function iu(t){for(var r=t;r!==null;){if(r.tag===13){var l=r.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Sh(l)||_h(l)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var bi=0,Ae=null,et=null,bt=null,ru=!1,Aa=!1,Ir=!1,au=0,Pl=0,za=null,K_=0;function ft(){throw Error(a(321))}function yd(t,r){if(r===null)return!1;for(var l=0;l<r.length&&l<t.length;l++)if(!un(t[l],r[l]))return!1;return!0}function xd(t,r,l,c,p,y){return bi=y,Ae=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,j.H=t===null||t.memoizedState===null?O0:Dd,Ir=!1,y=l(c,p),Ir=!1,Aa&&(y=e0(r,l,c,p)),Wg(t),y}function Wg(t){j.H=Fl;var r=et!==null&&et.next!==null;if(bi=0,bt=et=Ae=null,ru=!1,Pl=0,za=null,r)throw Error(a(300));t===null||vt||(t=t.dependencies,t!==null&&Zo(t)&&(vt=!0))}function e0(t,r,l,c){Ae=t;var p=0;do{if(Aa&&(za=null),Pl=0,Aa=!1,25<=p)throw Error(a(301));if(p+=1,bt=et=null,t.updateQueue!=null){var y=t.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}j.H=L0,y=r(l,c)}while(Aa);return y}function J_(){var t=j.H,r=t.useState()[0];return r=typeof r.then=="function"?Yl(r):r,t=t.useState()[0],(et!==null?et.memoizedState:null)!==t&&(Ae.flags|=1024),r}function bd(){var t=au!==0;return au=0,t}function vd(t,r,l){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~l}function wd(t){if(ru){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}ru=!1}bi=0,bt=et=Ae=null,Aa=!1,Pl=au=0,za=null}function Pt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?Ae.memoizedState=bt=t:bt=bt.next=t,bt}function gt(){if(et===null){var t=Ae.alternate;t=t!==null?t.memoizedState:null}else t=et.next;var r=bt===null?Ae.memoizedState:bt.next;if(r!==null)bt=r,et=t;else{if(t===null)throw Ae.alternate===null?Error(a(467)):Error(a(310));et=t,t={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},bt===null?Ae.memoizedState=bt=t:bt=bt.next=t}return bt}function lu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yl(t){var r=Pl;return Pl+=1,za===null&&(za=[]),t=Pg(za,t,r),r=Ae,(bt===null?r.memoizedState:bt.next)===null&&(r=r.alternate,j.H=r===null||r.memoizedState===null?O0:Dd),t}function su(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Yl(t);if(t.$$typeof===k)return jt(t)}throw Error(a(438,String(t)))}function Sd(t){var r=null,l=Ae.updateQueue;if(l!==null&&(r=l.memoCache),r==null){var c=Ae.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(r={data:c.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),l===null&&(l=lu(),Ae.updateQueue=l),l.memoCache=r,l=r.data[r.index],l===void 0)for(l=r.data[r.index]=Array(t),c=0;c<t;c++)l[c]=q;return r.index++,l}function vi(t,r){return typeof r=="function"?r(t):r}function ou(t){var r=gt();return _d(r,et,t)}function _d(t,r,l){var c=t.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=l;var p=t.baseQueue,y=c.pending;if(y!==null){if(p!==null){var S=p.next;p.next=y.next,y.next=S}r.baseQueue=p=y,c.pending=null}if(y=t.baseState,p===null)t.memoizedState=y;else{r=p.next;var M=S=null,I=null,W=r,le=!1;do{var oe=W.lane&-536870913;if(oe!==W.lane?(Ue&oe)===oe:(bi&oe)===oe){var ee=W.revertLane;if(ee===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),oe===Ea&&(le=!0);else if((bi&ee)===ee){W=W.next,ee===Ea&&(le=!0);continue}else oe={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},I===null?(M=I=oe,S=y):I=I.next=oe,Ae.lanes|=ee,rr|=ee;oe=W.action,Ir&&l(y,oe),y=W.hasEagerState?W.eagerState:l(y,oe)}else ee={lane:oe,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},I===null?(M=I=ee,S=y):I=I.next=ee,Ae.lanes|=oe,rr|=oe;W=W.next}while(W!==null&&W!==r);if(I===null?S=y:I.next=M,!un(y,t.memoizedState)&&(vt=!0,le&&(l=Na,l!==null)))throw l;t.memoizedState=y,t.baseState=S,t.baseQueue=I,c.lastRenderedState=y}return p===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function kd(t){var r=gt(),l=r.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=t;var c=l.dispatch,p=l.pending,y=r.memoizedState;if(p!==null){l.pending=null;var S=p=p.next;do y=t(y,S.action),S=S.next;while(S!==p);un(y,r.memoizedState)||(vt=!0),r.memoizedState=y,r.baseQueue===null&&(r.baseState=y),l.lastRenderedState=y}return[y,c]}function t0(t,r,l){var c=Ae,p=gt(),y=qe;if(y){if(l===void 0)throw Error(a(407));l=l()}else l=r();var S=!un((et||p).memoizedState,l);if(S&&(p.memoizedState=l,vt=!0),p=p.queue,Cd(r0.bind(null,c,p,t),[t]),p.getSnapshot!==r||S||bt!==null&&bt.memoizedState.tag&1){if(c.flags|=2048,ja(9,{destroy:void 0},i0.bind(null,c,p,l,r),null),it===null)throw Error(a(349));y||(bi&127)!==0||n0(c,r,l)}return l}function n0(t,r,l){t.flags|=16384,t={getSnapshot:r,value:l},r=Ae.updateQueue,r===null?(r=lu(),Ae.updateQueue=r,r.stores=[t]):(l=r.stores,l===null?r.stores=[t]:l.push(t))}function i0(t,r,l,c){r.value=l,r.getSnapshot=c,a0(r)&&l0(t)}function r0(t,r,l){return l(function(){a0(r)&&l0(t)})}function a0(t){var r=t.getSnapshot;t=t.value;try{var l=r();return!un(t,l)}catch{return!0}}function l0(t){var r=zr(t,2);r!==null&&nn(r,t,2)}function Ed(t){var r=Pt();if(typeof t=="function"){var l=t;if(t=l(),Ir){Ht(!0);try{l()}finally{Ht(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:t},r}function s0(t,r,l,c){return t.baseState=l,_d(t,et,typeof c=="function"?c:vi)}function W_(t,r,l,c,p){if(fu(t))throw Error(a(485));if(t=r.action,t!==null){var y={payload:p,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){y.listeners.push(S)}};j.T!==null?l(!0):y.isTransition=!1,c(y),l=r.pending,l===null?(y.next=r.pending=y,o0(r,y)):(y.next=l.next,r.pending=l.next=y)}}function o0(t,r){var l=r.action,c=r.payload,p=t.state;if(r.isTransition){var y=j.T,S={};j.T=S;try{var M=l(p,c),I=j.S;I!==null&&I(S,M),u0(t,r,M)}catch(W){Nd(t,r,W)}finally{y!==null&&S.types!==null&&(y.types=S.types),j.T=y}}else try{y=l(p,c),u0(t,r,y)}catch(W){Nd(t,r,W)}}function u0(t,r,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(c){c0(t,r,c)},function(c){return Nd(t,r,c)}):c0(t,r,l)}function c0(t,r,l){r.status="fulfilled",r.value=l,f0(r),t.state=l,r=t.pending,r!==null&&(l=r.next,l===r?t.pending=null:(l=l.next,r.next=l,o0(t,l)))}function Nd(t,r,l){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do r.status="rejected",r.reason=l,f0(r),r=r.next;while(r!==c)}t.action=null}function f0(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function d0(t,r){return r}function h0(t,r){if(qe){var l=it.formState;if(l!==null){e:{var c=Ae;if(qe){if(lt){t:{for(var p=lt,y=Cn;p.nodeType!==8;){if(!y){p=null;break t}if(p=Tn(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){lt=Tn(p.nextSibling),c=p.data==="F!";break e}}Zi(c)}c=!1}c&&(r=l[0])}}return l=Pt(),l.memoizedState=l.baseState=r,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:d0,lastRenderedState:r},l.queue=c,l=j0.bind(null,Ae,c),c.dispatch=l,c=Ed(!1),y=jd.bind(null,Ae,!1,c.queue),c=Pt(),p={state:r,dispatch:null,action:t,pending:null},c.queue=p,l=W_.bind(null,Ae,p,y,l),p.dispatch=l,c.memoizedState=t,[r,l,!1]}function p0(t){var r=gt();return m0(r,et,t)}function m0(t,r,l){if(r=_d(t,r,d0)[0],t=ou(vi)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var c=Yl(r)}catch(S){throw S===Ca?Jo:S}else c=r;r=gt();var p=r.queue,y=p.dispatch;return l!==r.memoizedState&&(Ae.flags|=2048,ja(9,{destroy:void 0},ek.bind(null,p,l),null)),[c,y,t]}function ek(t,r){t.action=r}function g0(t){var r=gt(),l=et;if(l!==null)return m0(r,l,t);gt(),r=r.memoizedState,l=gt();var c=l.queue.dispatch;return l.memoizedState=t,[r,c,!1]}function ja(t,r,l,c){return t={tag:t,create:l,deps:c,inst:r,next:null},r=Ae.updateQueue,r===null&&(r=lu(),Ae.updateQueue=r),l=r.lastEffect,l===null?r.lastEffect=t.next=t:(c=l.next,l.next=t,t.next=c,r.lastEffect=t),t}function y0(){return gt().memoizedState}function uu(t,r,l,c){var p=Pt();Ae.flags|=t,p.memoizedState=ja(1|r,{destroy:void 0},l,c===void 0?null:c)}function cu(t,r,l,c){var p=gt();c=c===void 0?null:c;var y=p.memoizedState.inst;et!==null&&c!==null&&yd(c,et.memoizedState.deps)?p.memoizedState=ja(r,y,l,c):(Ae.flags|=t,p.memoizedState=ja(1|r,y,l,c))}function x0(t,r){uu(8390656,8,t,r)}function Cd(t,r){cu(2048,8,t,r)}function tk(t){Ae.flags|=4;var r=Ae.updateQueue;if(r===null)r=lu(),Ae.updateQueue=r,r.events=[t];else{var l=r.events;l===null?r.events=[t]:l.push(t)}}function b0(t){var r=gt().memoizedState;return tk({ref:r,nextImpl:t}),function(){if((Qe&2)!==0)throw Error(a(440));return r.impl.apply(void 0,arguments)}}function v0(t,r){return cu(4,2,t,r)}function w0(t,r){return cu(4,4,t,r)}function S0(t,r){if(typeof r=="function"){t=t();var l=r(t);return function(){typeof l=="function"?l():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function _0(t,r,l){l=l!=null?l.concat([t]):null,cu(4,4,S0.bind(null,r,t),l)}function Md(){}function k0(t,r){var l=gt();r=r===void 0?null:r;var c=l.memoizedState;return r!==null&&yd(r,c[1])?c[0]:(l.memoizedState=[t,r],t)}function E0(t,r){var l=gt();r=r===void 0?null:r;var c=l.memoizedState;if(r!==null&&yd(r,c[1]))return c[0];if(c=t(),Ir){Ht(!0);try{t()}finally{Ht(!1)}}return l.memoizedState=[c,r],c}function Td(t,r,l){return l===void 0||(bi&1073741824)!==0&&(Ue&261930)===0?t.memoizedState=r:(t.memoizedState=l,t=Ny(),Ae.lanes|=t,rr|=t,l)}function N0(t,r,l,c){return un(l,r)?l:Ta.current!==null?(t=Td(t,l,c),un(t,r)||(vt=!0),t):(bi&42)===0||(bi&1073741824)!==0&&(Ue&261930)===0?(vt=!0,t.memoizedState=l):(t=Ny(),Ae.lanes|=t,rr|=t,r)}function C0(t,r,l,c,p){var y=U.p;U.p=y!==0&&8>y?y:8;var S=j.T,M={};j.T=M,jd(t,!1,r,l);try{var I=p(),W=j.S;if(W!==null&&W(M,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var le=Q_(I,c);Xl(t,r,le,mn(t))}else Xl(t,r,c,mn(t))}catch(oe){Xl(t,r,{then:function(){},status:"rejected",reason:oe},mn())}finally{U.p=y,S!==null&&M.types!==null&&(S.types=M.types),j.T=S}}function nk(){}function Ad(t,r,l,c){if(t.tag!==5)throw Error(a(476));var p=M0(t).queue;C0(t,p,r,Y,l===null?nk:function(){return T0(t),l(c)})}function M0(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:Y},next:null};var l={};return r.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:l},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function T0(t){var r=M0(t);r.next===null&&(r=t.alternate.memoizedState),Xl(t,r.next.queue,{},mn())}function zd(){return jt(us)}function A0(){return gt().memoizedState}function z0(){return gt().memoizedState}function ik(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var l=mn();t=Ji(l);var c=Wi(r,t,l);c!==null&&(nn(c,r,l),ql(c,r,l)),r={cache:ld()},t.payload=r;return}r=r.return}}function rk(t,r,l){var c=mn();l={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},fu(t)?D0(r,l):(l=Zf(t,r,l,c),l!==null&&(nn(l,t,c),R0(l,r,c)))}function j0(t,r,l){var c=mn();Xl(t,r,l,c)}function Xl(t,r,l,c){var p={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(fu(t))D0(r,p);else{var y=t.alternate;if(t.lanes===0&&(y===null||y.lanes===0)&&(y=r.lastRenderedReducer,y!==null))try{var S=r.lastRenderedState,M=y(S,l);if(p.hasEagerState=!0,p.eagerState=M,un(M,S))return Yo(t,r,p,0),it===null&&Po(),!1}catch{}if(l=Zf(t,r,p,c),l!==null)return nn(l,t,c),R0(l,r,c),!0}return!1}function jd(t,r,l,c){if(c={lane:2,revertLane:ch(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},fu(t)){if(r)throw Error(a(479))}else r=Zf(t,l,c,2),r!==null&&nn(r,t,2)}function fu(t){var r=t.alternate;return t===Ae||r!==null&&r===Ae}function D0(t,r){Aa=ru=!0;var l=t.pending;l===null?r.next=r:(r.next=l.next,l.next=r),t.pending=r}function R0(t,r,l){if((l&4194048)!==0){var c=r.lanes;c&=t.pendingLanes,l|=c,r.lanes=l,ko(t,l)}}var Fl={readContext:jt,use:su,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useLayoutEffect:ft,useInsertionEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useSyncExternalStore:ft,useId:ft,useHostTransitionStatus:ft,useFormState:ft,useActionState:ft,useOptimistic:ft,useMemoCache:ft,useCacheRefresh:ft};Fl.useEffectEvent=ft;var O0={readContext:jt,use:su,useCallback:function(t,r){return Pt().memoizedState=[t,r===void 0?null:r],t},useContext:jt,useEffect:x0,useImperativeHandle:function(t,r,l){l=l!=null?l.concat([t]):null,uu(4194308,4,S0.bind(null,r,t),l)},useLayoutEffect:function(t,r){return uu(4194308,4,t,r)},useInsertionEffect:function(t,r){uu(4,2,t,r)},useMemo:function(t,r){var l=Pt();r=r===void 0?null:r;var c=t();if(Ir){Ht(!0);try{t()}finally{Ht(!1)}}return l.memoizedState=[c,r],c},useReducer:function(t,r,l){var c=Pt();if(l!==void 0){var p=l(r);if(Ir){Ht(!0);try{l(r)}finally{Ht(!1)}}}else p=r;return c.memoizedState=c.baseState=p,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:p},c.queue=t,t=t.dispatch=rk.bind(null,Ae,t),[c.memoizedState,t]},useRef:function(t){var r=Pt();return t={current:t},r.memoizedState=t},useState:function(t){t=Ed(t);var r=t.queue,l=j0.bind(null,Ae,r);return r.dispatch=l,[t.memoizedState,l]},useDebugValue:Md,useDeferredValue:function(t,r){var l=Pt();return Td(l,t,r)},useTransition:function(){var t=Ed(!1);return t=C0.bind(null,Ae,t.queue,!0,!1),Pt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,l){var c=Ae,p=Pt();if(qe){if(l===void 0)throw Error(a(407));l=l()}else{if(l=r(),it===null)throw Error(a(349));(Ue&127)!==0||n0(c,r,l)}p.memoizedState=l;var y={value:l,getSnapshot:r};return p.queue=y,x0(r0.bind(null,c,y,t),[t]),c.flags|=2048,ja(9,{destroy:void 0},i0.bind(null,c,y,l,r),null),l},useId:function(){var t=Pt(),r=it.identifierPrefix;if(qe){var l=Kn,c=Qn;l=(c&~(1<<32-Ke(c)-1)).toString(32)+l,r="_"+r+"R_"+l,l=au++,0<l&&(r+="H"+l.toString(32)),r+="_"}else l=K_++,r="_"+r+"r_"+l.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:zd,useFormState:h0,useActionState:h0,useOptimistic:function(t){var r=Pt();r.memoizedState=r.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=l,r=jd.bind(null,Ae,!0,l),l.dispatch=r,[t,r]},useMemoCache:Sd,useCacheRefresh:function(){return Pt().memoizedState=ik.bind(null,Ae)},useEffectEvent:function(t){var r=Pt(),l={impl:t};return r.memoizedState=l,function(){if((Qe&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},Dd={readContext:jt,use:su,useCallback:k0,useContext:jt,useEffect:Cd,useImperativeHandle:_0,useInsertionEffect:v0,useLayoutEffect:w0,useMemo:E0,useReducer:ou,useRef:y0,useState:function(){return ou(vi)},useDebugValue:Md,useDeferredValue:function(t,r){var l=gt();return N0(l,et.memoizedState,t,r)},useTransition:function(){var t=ou(vi)[0],r=gt().memoizedState;return[typeof t=="boolean"?t:Yl(t),r]},useSyncExternalStore:t0,useId:A0,useHostTransitionStatus:zd,useFormState:p0,useActionState:p0,useOptimistic:function(t,r){var l=gt();return s0(l,et,t,r)},useMemoCache:Sd,useCacheRefresh:z0};Dd.useEffectEvent=b0;var L0={readContext:jt,use:su,useCallback:k0,useContext:jt,useEffect:Cd,useImperativeHandle:_0,useInsertionEffect:v0,useLayoutEffect:w0,useMemo:E0,useReducer:kd,useRef:y0,useState:function(){return kd(vi)},useDebugValue:Md,useDeferredValue:function(t,r){var l=gt();return et===null?Td(l,t,r):N0(l,et.memoizedState,t,r)},useTransition:function(){var t=kd(vi)[0],r=gt().memoizedState;return[typeof t=="boolean"?t:Yl(t),r]},useSyncExternalStore:t0,useId:A0,useHostTransitionStatus:zd,useFormState:g0,useActionState:g0,useOptimistic:function(t,r){var l=gt();return et!==null?s0(l,et,t,r):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Sd,useCacheRefresh:z0};L0.useEffectEvent=b0;function Rd(t,r,l,c){r=t.memoizedState,l=l(c,r),l=l==null?r:m({},r,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Od={enqueueSetState:function(t,r,l){t=t._reactInternals;var c=mn(),p=Ji(c);p.payload=r,l!=null&&(p.callback=l),r=Wi(t,p,c),r!==null&&(nn(r,t,c),ql(r,t,c))},enqueueReplaceState:function(t,r,l){t=t._reactInternals;var c=mn(),p=Ji(c);p.tag=1,p.payload=r,l!=null&&(p.callback=l),r=Wi(t,p,c),r!==null&&(nn(r,t,c),ql(r,t,c))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var l=mn(),c=Ji(l);c.tag=2,r!=null&&(c.callback=r),r=Wi(t,c,l),r!==null&&(nn(r,t,l),ql(r,t,l))}};function H0(t,r,l,c,p,y,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,y,S):r.prototype&&r.prototype.isPureReactComponent?!Dl(l,c)||!Dl(p,y):!0}function B0(t,r,l,c){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(l,c),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(l,c),r.state!==t&&Od.enqueueReplaceState(r,r.state,null)}function qr(t,r){var l=r;if("ref"in r){l={};for(var c in r)c!=="ref"&&(l[c]=r[c])}if(t=t.defaultProps){l===r&&(l=m({},l));for(var p in t)l[p]===void 0&&(l[p]=t[p])}return l}function U0(t){Vo(t)}function I0(t){console.error(t)}function q0(t){Vo(t)}function du(t,r){try{var l=t.onUncaughtError;l(r.value,{componentStack:r.stack})}catch(c){setTimeout(function(){throw c})}}function $0(t,r,l){try{var c=t.onCaughtError;c(l.value,{componentStack:l.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Ld(t,r,l){return l=Ji(l),l.tag=3,l.payload={element:null},l.callback=function(){du(t,r)},l}function V0(t){return t=Ji(t),t.tag=3,t}function P0(t,r,l,c){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var y=c.value;t.payload=function(){return p(y)},t.callback=function(){$0(r,l,c)}}var S=l.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){$0(r,l,c),typeof p!="function"&&(ar===null?ar=new Set([this]):ar.add(this));var M=c.stack;this.componentDidCatch(c.value,{componentStack:M!==null?M:""})})}function ak(t,r,l,c,p){if(l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(r=l.alternate,r!==null&&ka(r,l,p,!0),l=fn.current,l!==null){switch(l.tag){case 31:case 13:return Mn===null?ku():l.alternate===null&&dt===0&&(dt=3),l.flags&=-257,l.flags|=65536,l.lanes=p,c===Wo?l.flags|=16384:(r=l.updateQueue,r===null?l.updateQueue=new Set([c]):r.add(c),sh(t,c,p)),!1;case 22:return l.flags|=65536,c===Wo?l.flags|=16384:(r=l.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([c])},l.updateQueue=r):(l=r.retryQueue,l===null?r.retryQueue=new Set([c]):l.add(c)),sh(t,c,p)),!1}throw Error(a(435,l.tag))}return sh(t,c,p),ku(),!1}if(qe)return r=fn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,c!==td&&(t=Error(a(422),{cause:c}),Ll(kn(t,l)))):(c!==td&&(r=Error(a(423),{cause:c}),Ll(kn(r,l))),t=t.current.alternate,t.flags|=65536,p&=-p,t.lanes|=p,c=kn(c,l),p=Ld(t.stateNode,c,p),dd(t,p),dt!==4&&(dt=2)),!1;var y=Error(a(520),{cause:c});if(y=kn(y,l),ts===null?ts=[y]:ts.push(y),dt!==4&&(dt=2),r===null)return!0;c=kn(c,l),l=r;do{switch(l.tag){case 3:return l.flags|=65536,t=p&-p,l.lanes|=t,t=Ld(l.stateNode,c,t),dd(l,t),!1;case 1:if(r=l.type,y=l.stateNode,(l.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ar===null||!ar.has(y))))return l.flags|=65536,p&=-p,l.lanes|=p,p=V0(p),P0(p,t,l,c),dd(l,p),!1}l=l.return}while(l!==null);return!1}var Hd=Error(a(461)),vt=!1;function Dt(t,r,l,c){r.child=t===null?Gg(r,null,l,c):Ur(r,t.child,l,c)}function Y0(t,r,l,c,p){l=l.render;var y=r.ref;if("ref"in c){var S={};for(var M in c)M!=="ref"&&(S[M]=c[M])}else S=c;return Or(r),c=xd(t,r,l,S,y,p),M=bd(),t!==null&&!vt?(vd(t,r,p),wi(t,r,p)):(qe&&M&&Wf(r),r.flags|=1,Dt(t,r,c,p),r.child)}function X0(t,r,l,c,p){if(t===null){var y=l.type;return typeof y=="function"&&!Qf(y)&&y.defaultProps===void 0&&l.compare===null?(r.tag=15,r.type=y,F0(t,r,y,c,p)):(t=Fo(l.type,null,c,r,r.mode,p),t.ref=r.ref,t.return=r,r.child=t)}if(y=t.child,!Yd(t,p)){var S=y.memoizedProps;if(l=l.compare,l=l!==null?l:Dl,l(S,c)&&t.ref===r.ref)return wi(t,r,p)}return r.flags|=1,t=mi(y,c),t.ref=r.ref,t.return=r,r.child=t}function F0(t,r,l,c,p){if(t!==null){var y=t.memoizedProps;if(Dl(y,c)&&t.ref===r.ref)if(vt=!1,r.pendingProps=c=y,Yd(t,p))(t.flags&131072)!==0&&(vt=!0);else return r.lanes=t.lanes,wi(t,r,p)}return Bd(t,r,l,c,p)}function G0(t,r,l,c){var p=c.children,y=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((r.flags&128)!==0){if(y=y!==null?y.baseLanes|l:l,t!==null){for(c=r.child=t.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~y}else c=0,r.child=null;return Z0(t,r,y,l,c)}if((l&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Ko(r,y!==null?y.cachePool:null),y!==null?Kg(r,y):pd(),Jg(r);else return c=r.lanes=536870912,Z0(t,r,y!==null?y.baseLanes|l:l,l,c)}else y!==null?(Ko(r,y.cachePool),Kg(r,y),tr(),r.memoizedState=null):(t!==null&&Ko(r,null),pd(),tr());return Dt(t,r,p,l),r.child}function Gl(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Z0(t,r,l,c,p){var y=od();return y=y===null?null:{parent:xt._currentValue,pool:y},r.memoizedState={baseLanes:l,cachePool:y},t!==null&&Ko(r,null),pd(),Jg(r),t!==null&&ka(t,r,c,!0),r.childLanes=p,null}function hu(t,r){return r=mu({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function Q0(t,r,l){return Ur(r,t.child,null,l),t=hu(r,r.pendingProps),t.flags|=2,dn(r),r.memoizedState=null,t}function lk(t,r,l){var c=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(qe){if(c.mode==="hidden")return t=hu(r,c),r.lanes=536870912,Gl(null,t);if(gd(r),(t=lt)?(t=ox(t,Cn),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Fi!==null?{id:Qn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},l=Dg(t),l.return=r,r.child=l,zt=r,lt=null)):t=null,t===null)throw Zi(r);return r.lanes=536870912,null}return hu(r,c)}var y=t.memoizedState;if(y!==null){var S=y.dehydrated;if(gd(r),p)if(r.flags&256)r.flags&=-257,r=Q0(t,r,l);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(a(558));else if(vt||ka(t,r,l,!1),p=(l&t.childLanes)!==0,vt||p){if(c=it,c!==null&&(S=Eo(c,l),S!==0&&S!==y.retryLane))throw y.retryLane=S,zr(t,S),nn(c,t,S),Hd;ku(),r=Q0(t,r,l)}else t=y.treeContext,lt=Tn(S.nextSibling),zt=r,qe=!0,Gi=null,Cn=!1,t!==null&&Lg(r,t),r=hu(r,c),r.flags|=4096;return r}return t=mi(t.child,{mode:c.mode,children:c.children}),t.ref=r.ref,r.child=t,t.return=r,t}function pu(t,r){var l=r.ref;if(l===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(t===null||t.ref!==l)&&(r.flags|=4194816)}}function Bd(t,r,l,c,p){return Or(r),l=xd(t,r,l,c,void 0,p),c=bd(),t!==null&&!vt?(vd(t,r,p),wi(t,r,p)):(qe&&c&&Wf(r),r.flags|=1,Dt(t,r,l,p),r.child)}function K0(t,r,l,c,p,y){return Or(r),r.updateQueue=null,l=e0(r,c,l,p),Wg(t),c=bd(),t!==null&&!vt?(vd(t,r,y),wi(t,r,y)):(qe&&c&&Wf(r),r.flags|=1,Dt(t,r,l,y),r.child)}function J0(t,r,l,c,p){if(Or(r),r.stateNode===null){var y=va,S=l.contextType;typeof S=="object"&&S!==null&&(y=jt(S)),y=new l(c,y),r.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Od,r.stateNode=y,y._reactInternals=r,y=r.stateNode,y.props=c,y.state=r.memoizedState,y.refs={},cd(r),S=l.contextType,y.context=typeof S=="object"&&S!==null?jt(S):va,y.state=r.memoizedState,S=l.getDerivedStateFromProps,typeof S=="function"&&(Rd(r,l,S,c),y.state=r.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(S=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),S!==y.state&&Od.enqueueReplaceState(y,y.state,null),Vl(r,c,y,p),$l(),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308),c=!0}else if(t===null){y=r.stateNode;var M=r.memoizedProps,I=qr(l,M);y.props=I;var W=y.context,le=l.contextType;S=va,typeof le=="object"&&le!==null&&(S=jt(le));var oe=l.getDerivedStateFromProps;le=typeof oe=="function"||typeof y.getSnapshotBeforeUpdate=="function",M=r.pendingProps!==M,le||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(M||W!==S)&&B0(r,y,c,S),Ki=!1;var ee=r.memoizedState;y.state=ee,Vl(r,c,y,p),$l(),W=r.memoizedState,M||ee!==W||Ki?(typeof oe=="function"&&(Rd(r,l,oe,c),W=r.memoizedState),(I=Ki||H0(r,l,I,c,ee,W,S))?(le||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(r.flags|=4194308)):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=c,r.memoizedState=W),y.props=c,y.state=W,y.context=S,c=I):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),c=!1)}else{y=r.stateNode,fd(t,r),S=r.memoizedProps,le=qr(l,S),y.props=le,oe=r.pendingProps,ee=y.context,W=l.contextType,I=va,typeof W=="object"&&W!==null&&(I=jt(W)),M=l.getDerivedStateFromProps,(W=typeof M=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(S!==oe||ee!==I)&&B0(r,y,c,I),Ki=!1,ee=r.memoizedState,y.state=ee,Vl(r,c,y,p),$l();var re=r.memoizedState;S!==oe||ee!==re||Ki||t!==null&&t.dependencies!==null&&Zo(t.dependencies)?(typeof M=="function"&&(Rd(r,l,M,c),re=r.memoizedState),(le=Ki||H0(r,l,le,c,ee,re,I)||t!==null&&t.dependencies!==null&&Zo(t.dependencies))?(W||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(c,re,I),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(c,re,I)),typeof y.componentDidUpdate=="function"&&(r.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof y.componentDidUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=1024),r.memoizedProps=c,r.memoizedState=re),y.props=c,y.state=re,y.context=I,c=le):(typeof y.componentDidUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=1024),c=!1)}return y=c,pu(t,r),c=(r.flags&128)!==0,y||c?(y=r.stateNode,l=c&&typeof l.getDerivedStateFromError!="function"?null:y.render(),r.flags|=1,t!==null&&c?(r.child=Ur(r,t.child,null,p),r.child=Ur(r,null,l,p)):Dt(t,r,l,p),r.memoizedState=y.state,t=r.child):t=wi(t,r,p),t}function W0(t,r,l,c){return Dr(),r.flags|=256,Dt(t,r,l,c),r.child}var Ud={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Id(t){return{baseLanes:t,cachePool:$g()}}function qd(t,r,l){return t=t!==null?t.childLanes&~l:0,r&&(t|=pn),t}function ey(t,r,l){var c=r.pendingProps,p=!1,y=(r.flags&128)!==0,S;if((S=y)||(S=t!==null&&t.memoizedState===null?!1:(mt.current&2)!==0),S&&(p=!0,r.flags&=-129),S=(r.flags&32)!==0,r.flags&=-33,t===null){if(qe){if(p?er(r):tr(),(t=lt)?(t=ox(t,Cn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Fi!==null?{id:Qn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},l=Dg(t),l.return=r,r.child=l,zt=r,lt=null)):t=null,t===null)throw Zi(r);return _h(t)?r.lanes=32:r.lanes=536870912,null}var M=c.children;return c=c.fallback,p?(tr(),p=r.mode,M=mu({mode:"hidden",children:M},p),c=jr(c,p,l,null),M.return=r,c.return=r,M.sibling=c,r.child=M,c=r.child,c.memoizedState=Id(l),c.childLanes=qd(t,S,l),r.memoizedState=Ud,Gl(null,c)):(er(r),$d(r,M))}var I=t.memoizedState;if(I!==null&&(M=I.dehydrated,M!==null)){if(y)r.flags&256?(er(r),r.flags&=-257,r=Vd(t,r,l)):r.memoizedState!==null?(tr(),r.child=t.child,r.flags|=128,r=null):(tr(),M=c.fallback,p=r.mode,c=mu({mode:"visible",children:c.children},p),M=jr(M,p,l,null),M.flags|=2,c.return=r,M.return=r,c.sibling=M,r.child=c,Ur(r,t.child,null,l),c=r.child,c.memoizedState=Id(l),c.childLanes=qd(t,S,l),r.memoizedState=Ud,r=Gl(null,c));else if(er(r),_h(M)){if(S=M.nextSibling&&M.nextSibling.dataset,S)var W=S.dgst;S=W,c=Error(a(419)),c.stack="",c.digest=S,Ll({value:c,source:null,stack:null}),r=Vd(t,r,l)}else if(vt||ka(t,r,l,!1),S=(l&t.childLanes)!==0,vt||S){if(S=it,S!==null&&(c=Eo(S,l),c!==0&&c!==I.retryLane))throw I.retryLane=c,zr(t,c),nn(S,t,c),Hd;Sh(M)||ku(),r=Vd(t,r,l)}else Sh(M)?(r.flags|=192,r.child=t.child,r=null):(t=I.treeContext,lt=Tn(M.nextSibling),zt=r,qe=!0,Gi=null,Cn=!1,t!==null&&Lg(r,t),r=$d(r,c.children),r.flags|=4096);return r}return p?(tr(),M=c.fallback,p=r.mode,I=t.child,W=I.sibling,c=mi(I,{mode:"hidden",children:c.children}),c.subtreeFlags=I.subtreeFlags&65011712,W!==null?M=mi(W,M):(M=jr(M,p,l,null),M.flags|=2),M.return=r,c.return=r,c.sibling=M,r.child=c,Gl(null,c),c=r.child,M=t.child.memoizedState,M===null?M=Id(l):(p=M.cachePool,p!==null?(I=xt._currentValue,p=p.parent!==I?{parent:I,pool:I}:p):p=$g(),M={baseLanes:M.baseLanes|l,cachePool:p}),c.memoizedState=M,c.childLanes=qd(t,S,l),r.memoizedState=Ud,Gl(t.child,c)):(er(r),l=t.child,t=l.sibling,l=mi(l,{mode:"visible",children:c.children}),l.return=r,l.sibling=null,t!==null&&(S=r.deletions,S===null?(r.deletions=[t],r.flags|=16):S.push(t)),r.child=l,r.memoizedState=null,l)}function $d(t,r){return r=mu({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function mu(t,r){return t=cn(22,t,null,r),t.lanes=0,t}function Vd(t,r,l){return Ur(r,t.child,null,l),t=$d(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function ty(t,r,l){t.lanes|=r;var c=t.alternate;c!==null&&(c.lanes|=r),rd(t.return,r,l)}function Pd(t,r,l,c,p,y){var S=t.memoizedState;S===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:c,tail:l,tailMode:p,treeForkCount:y}:(S.isBackwards=r,S.rendering=null,S.renderingStartTime=0,S.last=c,S.tail=l,S.tailMode=p,S.treeForkCount=y)}function ny(t,r,l){var c=r.pendingProps,p=c.revealOrder,y=c.tail;c=c.children;var S=mt.current,M=(S&2)!==0;if(M?(S=S&1|2,r.flags|=128):S&=1,T(mt,S),Dt(t,r,c,l),c=qe?Ol:0,!M&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ty(t,l,r);else if(t.tag===19)ty(t,l,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(p){case"forwards":for(l=r.child,p=null;l!==null;)t=l.alternate,t!==null&&iu(t)===null&&(p=l),l=l.sibling;l=p,l===null?(p=r.child,r.child=null):(p=l.sibling,l.sibling=null),Pd(r,!1,p,l,y,c);break;case"backwards":case"unstable_legacy-backwards":for(l=null,p=r.child,r.child=null;p!==null;){if(t=p.alternate,t!==null&&iu(t)===null){r.child=p;break}t=p.sibling,p.sibling=l,l=p,p=t}Pd(r,!0,l,null,y,c);break;case"together":Pd(r,!1,null,null,void 0,c);break;default:r.memoizedState=null}return r.child}function wi(t,r,l){if(t!==null&&(r.dependencies=t.dependencies),rr|=r.lanes,(l&r.childLanes)===0)if(t!==null){if(ka(t,r,l,!1),(l&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(a(153));if(r.child!==null){for(t=r.child,l=mi(t,t.pendingProps),r.child=l,l.return=r;t.sibling!==null;)t=t.sibling,l=l.sibling=mi(t,t.pendingProps),l.return=r;l.sibling=null}return r.child}function Yd(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&Zo(t)))}function sk(t,r,l){switch(r.tag){case 3:ue(r,r.stateNode.containerInfo),Qi(r,xt,t.memoizedState.cache),Dr();break;case 27:case 5:Ee(r);break;case 4:ue(r,r.stateNode.containerInfo);break;case 10:Qi(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,gd(r),null;break;case 13:var c=r.memoizedState;if(c!==null)return c.dehydrated!==null?(er(r),r.flags|=128,null):(l&r.child.childLanes)!==0?ey(t,r,l):(er(r),t=wi(t,r,l),t!==null?t.sibling:null);er(r);break;case 19:var p=(t.flags&128)!==0;if(c=(l&r.childLanes)!==0,c||(ka(t,r,l,!1),c=(l&r.childLanes)!==0),p){if(c)return ny(t,r,l);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),T(mt,mt.current),c)break;return null;case 22:return r.lanes=0,G0(t,r,l,r.pendingProps);case 24:Qi(r,xt,t.memoizedState.cache)}return wi(t,r,l)}function iy(t,r,l){if(t!==null)if(t.memoizedProps!==r.pendingProps)vt=!0;else{if(!Yd(t,l)&&(r.flags&128)===0)return vt=!1,sk(t,r,l);vt=(t.flags&131072)!==0}else vt=!1,qe&&(r.flags&1048576)!==0&&Og(r,Ol,r.index);switch(r.lanes=0,r.tag){case 16:e:{var c=r.pendingProps;if(t=Hr(r.elementType),r.type=t,typeof t=="function")Qf(t)?(c=qr(t,c),r.tag=1,r=J0(null,r,t,c,l)):(r.tag=0,r=Bd(null,r,t,c,l));else{if(t!=null){var p=t.$$typeof;if(p===C){r.tag=11,r=Y0(null,r,t,c,l);break e}else if(p===H){r.tag=14,r=X0(null,r,t,c,l);break e}}throw r=O(t)||t,Error(a(306,r,""))}}return r;case 0:return Bd(t,r,r.type,r.pendingProps,l);case 1:return c=r.type,p=qr(c,r.pendingProps),J0(t,r,c,p,l);case 3:e:{if(ue(r,r.stateNode.containerInfo),t===null)throw Error(a(387));c=r.pendingProps;var y=r.memoizedState;p=y.element,fd(t,r),Vl(r,c,null,l);var S=r.memoizedState;if(c=S.cache,Qi(r,xt,c),c!==y.cache&&ad(r,[xt],l,!0),$l(),c=S.element,y.isDehydrated)if(y={element:c,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=y,r.memoizedState=y,r.flags&256){r=W0(t,r,c,l);break e}else if(c!==p){p=kn(Error(a(424)),r),Ll(p),r=W0(t,r,c,l);break e}else for(t=r.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,lt=Tn(t.firstChild),zt=r,qe=!0,Gi=null,Cn=!0,l=Gg(r,null,c,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Dr(),c===p){r=wi(t,r,l);break e}Dt(t,r,c,l)}r=r.child}return r;case 26:return pu(t,r),t===null?(l=px(r.type,null,r.pendingProps,null))?r.memoizedState=l:qe||(l=r.type,t=r.pendingProps,c=zu(fe.current).createElement(l),c[Nt]=r,c[Bt]=t,Rt(c,l,t),yt(c),r.stateNode=c):r.memoizedState=px(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return Ee(r),t===null&&qe&&(c=r.stateNode=fx(r.type,r.pendingProps,fe.current),zt=r,Cn=!0,p=lt,ur(r.type)?(kh=p,lt=Tn(c.firstChild)):lt=p),Dt(t,r,r.pendingProps.children,l),pu(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&qe&&((p=c=lt)&&(c=Hk(c,r.type,r.pendingProps,Cn),c!==null?(r.stateNode=c,zt=r,lt=Tn(c.firstChild),Cn=!1,p=!0):p=!1),p||Zi(r)),Ee(r),p=r.type,y=r.pendingProps,S=t!==null?t.memoizedProps:null,c=y.children,bh(p,y)?c=null:S!==null&&bh(p,S)&&(r.flags|=32),r.memoizedState!==null&&(p=xd(t,r,J_,null,null,l),us._currentValue=p),pu(t,r),Dt(t,r,c,l),r.child;case 6:return t===null&&qe&&((t=l=lt)&&(l=Bk(l,r.pendingProps,Cn),l!==null?(r.stateNode=l,zt=r,lt=null,t=!0):t=!1),t||Zi(r)),null;case 13:return ey(t,r,l);case 4:return ue(r,r.stateNode.containerInfo),c=r.pendingProps,t===null?r.child=Ur(r,null,c,l):Dt(t,r,c,l),r.child;case 11:return Y0(t,r,r.type,r.pendingProps,l);case 7:return Dt(t,r,r.pendingProps,l),r.child;case 8:return Dt(t,r,r.pendingProps.children,l),r.child;case 12:return Dt(t,r,r.pendingProps.children,l),r.child;case 10:return c=r.pendingProps,Qi(r,r.type,c.value),Dt(t,r,c.children,l),r.child;case 9:return p=r.type._context,c=r.pendingProps.children,Or(r),p=jt(p),c=c(p),r.flags|=1,Dt(t,r,c,l),r.child;case 14:return X0(t,r,r.type,r.pendingProps,l);case 15:return F0(t,r,r.type,r.pendingProps,l);case 19:return ny(t,r,l);case 31:return lk(t,r,l);case 22:return G0(t,r,l,r.pendingProps);case 24:return Or(r),c=jt(xt),t===null?(p=od(),p===null&&(p=it,y=ld(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=l),p=y),r.memoizedState={parent:c,cache:p},cd(r),Qi(r,xt,p)):((t.lanes&l)!==0&&(fd(t,r),Vl(r,null,null,l),$l()),p=t.memoizedState,y=r.memoizedState,p.parent!==c?(p={parent:c,cache:c},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),Qi(r,xt,c)):(c=y.cache,Qi(r,xt,c),c!==p.cache&&ad(r,[xt],l,!0))),Dt(t,r,r.pendingProps.children,l),r.child;case 29:throw r.pendingProps}throw Error(a(156,r.tag))}function Si(t){t.flags|=4}function Xd(t,r,l,c,p){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(p&335544128)===p)if(t.stateNode.complete)t.flags|=8192;else if(Ay())t.flags|=8192;else throw Br=Wo,ud}else t.flags&=-16777217}function ry(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!bx(r))if(Ay())t.flags|=8192;else throw Br=Wo,ud}function gu(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?So():536870912,t.lanes|=r,La|=r)}function Zl(t,r){if(!qe)switch(t.tailMode){case"hidden":r=t.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var c=null;l!==null;)l.alternate!==null&&(c=l),l=l.sibling;c===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function st(t){var r=t.alternate!==null&&t.alternate.child===t.child,l=0,c=0;if(r)for(var p=t.child;p!==null;)l|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=t,p=p.sibling;else for(p=t.child;p!==null;)l|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=t,p=p.sibling;return t.subtreeFlags|=c,t.childLanes=l,r}function ok(t,r,l){var c=r.pendingProps;switch(ed(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(r),null;case 1:return st(r),null;case 3:return l=r.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),xi(xt),me(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(_a(r)?Si(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,nd())),st(r),null;case 26:var p=r.type,y=r.memoizedState;return t===null?(Si(r),y!==null?(st(r),ry(r,y)):(st(r),Xd(r,p,null,c,l))):y?y!==t.memoizedState?(Si(r),st(r),ry(r,y)):(st(r),r.flags&=-16777217):(t=t.memoizedProps,t!==c&&Si(r),st(r),Xd(r,p,t,c,l)),null;case 27:if(Ce(r),l=fe.current,p=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==c&&Si(r);else{if(!c){if(r.stateNode===null)throw Error(a(166));return st(r),null}t=ie.current,_a(r)?Hg(r):(t=fx(p,c,l),r.stateNode=t,Si(r))}return st(r),null;case 5:if(Ce(r),p=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==c&&Si(r);else{if(!c){if(r.stateNode===null)throw Error(a(166));return st(r),null}if(y=ie.current,_a(r))Hg(r);else{var S=zu(fe.current);switch(y){case 1:y=S.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:y=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":y=S.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":y=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":y=S.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof c.is=="string"?S.createElement("select",{is:c.is}):S.createElement("select"),c.multiple?y.multiple=!0:c.size&&(y.size=c.size);break;default:y=typeof c.is=="string"?S.createElement(p,{is:c.is}):S.createElement(p)}}y[Nt]=r,y[Bt]=c;e:for(S=r.child;S!==null;){if(S.tag===5||S.tag===6)y.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===r)break e;for(;S.sibling===null;){if(S.return===null||S.return===r)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}r.stateNode=y;e:switch(Rt(y,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Si(r)}}return st(r),Xd(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,l),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==c&&Si(r);else{if(typeof c!="string"&&r.stateNode===null)throw Error(a(166));if(t=fe.current,_a(r)){if(t=r.stateNode,l=r.memoizedProps,c=null,p=zt,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}t[Nt]=r,t=!!(t.nodeValue===l||c!==null&&c.suppressHydrationWarning===!0||ex(t.nodeValue,l)),t||Zi(r,!0)}else t=zu(t).createTextNode(c),t[Nt]=r,r.stateNode=t}return st(r),null;case 31:if(l=r.memoizedState,t===null||t.memoizedState!==null){if(c=_a(r),l!==null){if(t===null){if(!c)throw Error(a(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[Nt]=r}else Dr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;st(r),t=!1}else l=nd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return r.flags&256?(dn(r),r):(dn(r),null);if((r.flags&128)!==0)throw Error(a(558))}return st(r),null;case 13:if(c=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(p=_a(r),c!==null&&c.dehydrated!==null){if(t===null){if(!p)throw Error(a(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[Nt]=r}else Dr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;st(r),p=!1}else p=nd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(dn(r),r):(dn(r),null)}return dn(r),(r.flags&128)!==0?(r.lanes=l,r):(l=c!==null,t=t!==null&&t.memoizedState!==null,l&&(c=r.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==p&&(c.flags|=2048)),l!==t&&l&&(r.child.flags|=8192),gu(r,r.updateQueue),st(r),null);case 4:return me(),t===null&&ph(r.stateNode.containerInfo),st(r),null;case 10:return xi(r.type),st(r),null;case 19:if($(mt),c=r.memoizedState,c===null)return st(r),null;if(p=(r.flags&128)!==0,y=c.rendering,y===null)if(p)Zl(c,!1);else{if(dt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(y=iu(t),y!==null){for(r.flags|=128,Zl(c,!1),t=y.updateQueue,r.updateQueue=t,gu(r,t),r.subtreeFlags=0,t=l,l=r.child;l!==null;)jg(l,t),l=l.sibling;return T(mt,mt.current&1|2),qe&&gi(r,c.treeForkCount),r.child}t=t.sibling}c.tail!==null&&Et()>wu&&(r.flags|=128,p=!0,Zl(c,!1),r.lanes=4194304)}else{if(!p)if(t=iu(y),t!==null){if(r.flags|=128,p=!0,t=t.updateQueue,r.updateQueue=t,gu(r,t),Zl(c,!0),c.tail===null&&c.tailMode==="hidden"&&!y.alternate&&!qe)return st(r),null}else 2*Et()-c.renderingStartTime>wu&&l!==536870912&&(r.flags|=128,p=!0,Zl(c,!1),r.lanes=4194304);c.isBackwards?(y.sibling=r.child,r.child=y):(t=c.last,t!==null?t.sibling=y:r.child=y,c.last=y)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Et(),t.sibling=null,l=mt.current,T(mt,p?l&1|2:l&1),qe&&gi(r,c.treeForkCount),t):(st(r),null);case 22:case 23:return dn(r),md(),c=r.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(r.flags|=8192):c&&(r.flags|=8192),c?(l&536870912)!==0&&(r.flags&128)===0&&(st(r),r.subtreeFlags&6&&(r.flags|=8192)):st(r),l=r.updateQueue,l!==null&&gu(r,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),c=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),c!==l&&(r.flags|=2048),t!==null&&$(Lr),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),xi(xt),st(r),null;case 25:return null;case 30:return null}throw Error(a(156,r.tag))}function uk(t,r){switch(ed(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return xi(xt),me(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return Ce(r),null;case 31:if(r.memoizedState!==null){if(dn(r),r.alternate===null)throw Error(a(340));Dr()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(dn(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(a(340));Dr()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return $(mt),null;case 4:return me(),null;case 10:return xi(r.type),null;case 22:case 23:return dn(r),md(),t!==null&&$(Lr),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return xi(xt),null;case 25:return null;default:return null}}function ay(t,r){switch(ed(r),r.tag){case 3:xi(xt),me();break;case 26:case 27:case 5:Ce(r);break;case 4:me();break;case 31:r.memoizedState!==null&&dn(r);break;case 13:dn(r);break;case 19:$(mt);break;case 10:xi(r.type);break;case 22:case 23:dn(r),md(),t!==null&&$(Lr);break;case 24:xi(xt)}}function Ql(t,r){try{var l=r.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var p=c.next;l=p;do{if((l.tag&t)===t){c=void 0;var y=l.create,S=l.inst;c=y(),S.destroy=c}l=l.next}while(l!==p)}}catch(M){We(r,r.return,M)}}function nr(t,r,l){try{var c=r.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var y=p.next;c=y;do{if((c.tag&t)===t){var S=c.inst,M=S.destroy;if(M!==void 0){S.destroy=void 0,p=r;var I=l,W=M;try{W()}catch(le){We(p,I,le)}}}c=c.next}while(c!==y)}}catch(le){We(r,r.return,le)}}function ly(t){var r=t.updateQueue;if(r!==null){var l=t.stateNode;try{Qg(r,l)}catch(c){We(t,t.return,c)}}}function sy(t,r,l){l.props=qr(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(c){We(t,r,c)}}function Kl(t,r){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof l=="function"?t.refCleanup=l(c):l.current=c}}catch(p){We(t,r,p)}}function Jn(t,r){var l=t.ref,c=t.refCleanup;if(l!==null)if(typeof c=="function")try{c()}catch(p){We(t,r,p)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){We(t,r,p)}else l.current=null}function oy(t){var r=t.type,l=t.memoizedProps,c=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":l.autoFocus&&c.focus();break e;case"img":l.src?c.src=l.src:l.srcSet&&(c.srcset=l.srcSet)}}catch(p){We(t,t.return,p)}}function Fd(t,r,l){try{var c=t.stateNode;zk(c,t.type,l,r),c[Bt]=r}catch(p){We(t,t.return,p)}}function uy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ur(t.type)||t.tag===4}function Gd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||uy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ur(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Zd(t,r,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,r?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,r):(r=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,r.appendChild(t),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=hi));else if(c!==4&&(c===27&&ur(t.type)&&(l=t.stateNode,r=null),t=t.child,t!==null))for(Zd(t,r,l),t=t.sibling;t!==null;)Zd(t,r,l),t=t.sibling}function yu(t,r,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,r?l.insertBefore(t,r):l.appendChild(t);else if(c!==4&&(c===27&&ur(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(yu(t,r,l),t=t.sibling;t!==null;)yu(t,r,l),t=t.sibling}function cy(t){var r=t.stateNode,l=t.memoizedProps;try{for(var c=t.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);Rt(r,c,l),r[Nt]=t,r[Bt]=l}catch(y){We(t,t.return,y)}}var _i=!1,wt=!1,Qd=!1,fy=typeof WeakSet=="function"?WeakSet:Set,Tt=null;function ck(t,r){if(t=t.containerInfo,yh=Bu,t=_g(t),Vf(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var c=l.getSelection&&l.getSelection();if(c&&c.rangeCount!==0){l=c.anchorNode;var p=c.anchorOffset,y=c.focusNode;c=c.focusOffset;try{l.nodeType,y.nodeType}catch{l=null;break e}var S=0,M=-1,I=-1,W=0,le=0,oe=t,ee=null;t:for(;;){for(var re;oe!==l||p!==0&&oe.nodeType!==3||(M=S+p),oe!==y||c!==0&&oe.nodeType!==3||(I=S+c),oe.nodeType===3&&(S+=oe.nodeValue.length),(re=oe.firstChild)!==null;)ee=oe,oe=re;for(;;){if(oe===t)break t;if(ee===l&&++W===p&&(M=S),ee===y&&++le===c&&(I=S),(re=oe.nextSibling)!==null)break;oe=ee,ee=oe.parentNode}oe=re}l=M===-1||I===-1?null:{start:M,end:I}}else l=null}l=l||{start:0,end:0}}else l=null;for(xh={focusedElem:t,selectionRange:l},Bu=!1,Tt=r;Tt!==null;)if(r=Tt,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Tt=t;else for(;Tt!==null;){switch(r=Tt,y=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)p=t[l],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&y!==null){t=void 0,l=r,p=y.memoizedProps,y=y.memoizedState,c=l.stateNode;try{var ye=qr(l.type,p);t=c.getSnapshotBeforeUpdate(ye,y),c.__reactInternalSnapshotBeforeUpdate=t}catch(ke){We(l,l.return,ke)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,l=t.nodeType,l===9)wh(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":wh(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(a(163))}if(t=r.sibling,t!==null){t.return=r.return,Tt=t;break}Tt=r.return}}function dy(t,r,l){var c=l.flags;switch(l.tag){case 0:case 11:case 15:Ei(t,l),c&4&&Ql(5,l);break;case 1:if(Ei(t,l),c&4)if(t=l.stateNode,r===null)try{t.componentDidMount()}catch(S){We(l,l.return,S)}else{var p=qr(l.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(p,r,t.__reactInternalSnapshotBeforeUpdate)}catch(S){We(l,l.return,S)}}c&64&&ly(l),c&512&&Kl(l,l.return);break;case 3:if(Ei(t,l),c&64&&(t=l.updateQueue,t!==null)){if(r=null,l.child!==null)switch(l.child.tag){case 27:case 5:r=l.child.stateNode;break;case 1:r=l.child.stateNode}try{Qg(t,r)}catch(S){We(l,l.return,S)}}break;case 27:r===null&&c&4&&cy(l);case 26:case 5:Ei(t,l),r===null&&c&4&&oy(l),c&512&&Kl(l,l.return);break;case 12:Ei(t,l);break;case 31:Ei(t,l),c&4&&my(t,l);break;case 13:Ei(t,l),c&4&&gy(t,l),c&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=bk.bind(null,l),Uk(t,l))));break;case 22:if(c=l.memoizedState!==null||_i,!c){r=r!==null&&r.memoizedState!==null||wt,p=_i;var y=wt;_i=c,(wt=r)&&!y?Ni(t,l,(l.subtreeFlags&8772)!==0):Ei(t,l),_i=p,wt=y}break;case 30:break;default:Ei(t,l)}}function hy(t){var r=t.alternate;r!==null&&(t.alternate=null,hy(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&_l(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var ot=null,Jt=!1;function ki(t,r,l){for(l=l.child;l!==null;)py(t,r,l),l=l.sibling}function py(t,r,l){if(pt&&typeof pt.onCommitFiberUnmount=="function")try{pt.onCommitFiberUnmount(At,l)}catch{}switch(l.tag){case 26:wt||Jn(l,r),ki(t,r,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:wt||Jn(l,r);var c=ot,p=Jt;ur(l.type)&&(ot=l.stateNode,Jt=!1),ki(t,r,l),ls(l.stateNode),ot=c,Jt=p;break;case 5:wt||Jn(l,r);case 6:if(c=ot,p=Jt,ot=null,ki(t,r,l),ot=c,Jt=p,ot!==null)if(Jt)try{(ot.nodeType===9?ot.body:ot.nodeName==="HTML"?ot.ownerDocument.body:ot).removeChild(l.stateNode)}catch(y){We(l,r,y)}else try{ot.removeChild(l.stateNode)}catch(y){We(l,r,y)}break;case 18:ot!==null&&(Jt?(t=ot,lx(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Pa(t)):lx(ot,l.stateNode));break;case 4:c=ot,p=Jt,ot=l.stateNode.containerInfo,Jt=!0,ki(t,r,l),ot=c,Jt=p;break;case 0:case 11:case 14:case 15:nr(2,l,r),wt||nr(4,l,r),ki(t,r,l);break;case 1:wt||(Jn(l,r),c=l.stateNode,typeof c.componentWillUnmount=="function"&&sy(l,r,c)),ki(t,r,l);break;case 21:ki(t,r,l);break;case 22:wt=(c=wt)||l.memoizedState!==null,ki(t,r,l),wt=c;break;default:ki(t,r,l)}}function my(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Pa(t)}catch(l){We(r,r.return,l)}}}function gy(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Pa(t)}catch(l){We(r,r.return,l)}}function fk(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new fy),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new fy),r;default:throw Error(a(435,t.tag))}}function xu(t,r){var l=fk(t);r.forEach(function(c){if(!l.has(c)){l.add(c);var p=vk.bind(null,t,c);c.then(p,p)}})}function Wt(t,r){var l=r.deletions;if(l!==null)for(var c=0;c<l.length;c++){var p=l[c],y=t,S=r,M=S;e:for(;M!==null;){switch(M.tag){case 27:if(ur(M.type)){ot=M.stateNode,Jt=!1;break e}break;case 5:ot=M.stateNode,Jt=!1;break e;case 3:case 4:ot=M.stateNode.containerInfo,Jt=!0;break e}M=M.return}if(ot===null)throw Error(a(160));py(y,S,p),ot=null,Jt=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)yy(r,t),r=r.sibling}var Bn=null;function yy(t,r){var l=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Wt(r,t),en(t),c&4&&(nr(3,t,t.return),Ql(3,t),nr(5,t,t.return));break;case 1:Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),c&64&&_i&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?c:l.concat(c))));break;case 26:var p=Bn;if(Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),c&4){var y=l!==null?l.memoizedState:null;if(c=t.memoizedState,l===null)if(c===null)if(t.stateNode===null){e:{c=t.type,l=t.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":y=p.getElementsByTagName("title")[0],(!y||y[Er]||y[Nt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(c),p.head.insertBefore(y,p.querySelector("head > title"))),Rt(y,c,l),y[Nt]=t,yt(y),c=y;break e;case"link":var S=yx("link","href",p).get(c+(l.href||""));if(S){for(var M=0;M<S.length;M++)if(y=S[M],y.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&y.getAttribute("rel")===(l.rel==null?null:l.rel)&&y.getAttribute("title")===(l.title==null?null:l.title)&&y.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){S.splice(M,1);break t}}y=p.createElement(c),Rt(y,c,l),p.head.appendChild(y);break;case"meta":if(S=yx("meta","content",p).get(c+(l.content||""))){for(M=0;M<S.length;M++)if(y=S[M],y.getAttribute("content")===(l.content==null?null:""+l.content)&&y.getAttribute("name")===(l.name==null?null:l.name)&&y.getAttribute("property")===(l.property==null?null:l.property)&&y.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&y.getAttribute("charset")===(l.charSet==null?null:l.charSet)){S.splice(M,1);break t}}y=p.createElement(c),Rt(y,c,l),p.head.appendChild(y);break;default:throw Error(a(468,c))}y[Nt]=t,yt(y),c=y}t.stateNode=c}else xx(p,t.type,t.stateNode);else t.stateNode=gx(p,c,t.memoizedProps);else y!==c?(y===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):y.count--,c===null?xx(p,t.type,t.stateNode):gx(p,c,t.memoizedProps)):c===null&&t.stateNode!==null&&Fd(t,t.memoizedProps,l.memoizedProps)}break;case 27:Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),l!==null&&c&4&&Fd(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),t.flags&32){p=t.stateNode;try{ha(p,"")}catch(ye){We(t,t.return,ye)}}c&4&&t.stateNode!=null&&(p=t.memoizedProps,Fd(t,p,l!==null?l.memoizedProps:p)),c&1024&&(Qd=!0);break;case 6:if(Wt(r,t),en(t),c&4){if(t.stateNode===null)throw Error(a(162));c=t.memoizedProps,l=t.stateNode;try{l.nodeValue=c}catch(ye){We(t,t.return,ye)}}break;case 3:if(Ru=null,p=Bn,Bn=ju(r.containerInfo),Wt(r,t),Bn=p,en(t),c&4&&l!==null&&l.memoizedState.isDehydrated)try{Pa(r.containerInfo)}catch(ye){We(t,t.return,ye)}Qd&&(Qd=!1,xy(t));break;case 4:c=Bn,Bn=ju(t.stateNode.containerInfo),Wt(r,t),en(t),Bn=c;break;case 12:Wt(r,t),en(t);break;case 31:Wt(r,t),en(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,xu(t,c)));break;case 13:Wt(r,t),en(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(vu=Et()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,xu(t,c)));break;case 22:p=t.memoizedState!==null;var I=l!==null&&l.memoizedState!==null,W=_i,le=wt;if(_i=W||p,wt=le||I,Wt(r,t),wt=le,_i=W,en(t),c&8192)e:for(r=t.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(l===null||I||_i||wt||$r(t)),l=null,r=t;;){if(r.tag===5||r.tag===26){if(l===null){I=l=r;try{if(y=I.stateNode,p)S=y.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{M=I.stateNode;var oe=I.memoizedProps.style,ee=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;M.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(ye){We(I,I.return,ye)}}}else if(r.tag===6){if(l===null){I=r;try{I.stateNode.nodeValue=p?"":I.memoizedProps}catch(ye){We(I,I.return,ye)}}}else if(r.tag===18){if(l===null){I=r;try{var re=I.stateNode;p?sx(re,!0):sx(I.stateNode,!1)}catch(ye){We(I,I.return,ye)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;l===r&&(l=null),r=r.return}l===r&&(l=null),r.sibling.return=r.return,r=r.sibling}c&4&&(c=t.updateQueue,c!==null&&(l=c.retryQueue,l!==null&&(c.retryQueue=null,xu(t,l))));break;case 19:Wt(r,t),en(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,xu(t,c)));break;case 30:break;case 21:break;default:Wt(r,t),en(t)}}function en(t){var r=t.flags;if(r&2){try{for(var l,c=t.return;c!==null;){if(uy(c)){l=c;break}c=c.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var p=l.stateNode,y=Gd(t);yu(t,y,p);break;case 5:var S=l.stateNode;l.flags&32&&(ha(S,""),l.flags&=-33);var M=Gd(t);yu(t,M,S);break;case 3:case 4:var I=l.stateNode.containerInfo,W=Gd(t);Zd(t,W,I);break;default:throw Error(a(161))}}catch(le){We(t,t.return,le)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function xy(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;xy(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Ei(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)dy(t,r.alternate,r),r=r.sibling}function $r(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:nr(4,r,r.return),$r(r);break;case 1:Jn(r,r.return);var l=r.stateNode;typeof l.componentWillUnmount=="function"&&sy(r,r.return,l),$r(r);break;case 27:ls(r.stateNode);case 26:case 5:Jn(r,r.return),$r(r);break;case 22:r.memoizedState===null&&$r(r);break;case 30:$r(r);break;default:$r(r)}t=t.sibling}}function Ni(t,r,l){for(l=l&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var c=r.alternate,p=t,y=r,S=y.flags;switch(y.tag){case 0:case 11:case 15:Ni(p,y,l),Ql(4,y);break;case 1:if(Ni(p,y,l),c=y,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(W){We(c,c.return,W)}if(c=y,p=c.updateQueue,p!==null){var M=c.stateNode;try{var I=p.shared.hiddenCallbacks;if(I!==null)for(p.shared.hiddenCallbacks=null,p=0;p<I.length;p++)Zg(I[p],M)}catch(W){We(c,c.return,W)}}l&&S&64&&ly(y),Kl(y,y.return);break;case 27:cy(y);case 26:case 5:Ni(p,y,l),l&&c===null&&S&4&&oy(y),Kl(y,y.return);break;case 12:Ni(p,y,l);break;case 31:Ni(p,y,l),l&&S&4&&my(p,y);break;case 13:Ni(p,y,l),l&&S&4&&gy(p,y);break;case 22:y.memoizedState===null&&Ni(p,y,l),Kl(y,y.return);break;case 30:break;default:Ni(p,y,l)}r=r.sibling}}function Kd(t,r){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&Hl(l))}function Jd(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Hl(t))}function Un(t,r,l,c){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)by(t,r,l,c),r=r.sibling}function by(t,r,l,c){var p=r.flags;switch(r.tag){case 0:case 11:case 15:Un(t,r,l,c),p&2048&&Ql(9,r);break;case 1:Un(t,r,l,c);break;case 3:Un(t,r,l,c),p&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Hl(t)));break;case 12:if(p&2048){Un(t,r,l,c),t=r.stateNode;try{var y=r.memoizedProps,S=y.id,M=y.onPostCommit;typeof M=="function"&&M(S,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(I){We(r,r.return,I)}}else Un(t,r,l,c);break;case 31:Un(t,r,l,c);break;case 13:Un(t,r,l,c);break;case 23:break;case 22:y=r.stateNode,S=r.alternate,r.memoizedState!==null?y._visibility&2?Un(t,r,l,c):Jl(t,r):y._visibility&2?Un(t,r,l,c):(y._visibility|=2,Da(t,r,l,c,(r.subtreeFlags&10256)!==0||!1)),p&2048&&Kd(S,r);break;case 24:Un(t,r,l,c),p&2048&&Jd(r.alternate,r);break;default:Un(t,r,l,c)}}function Da(t,r,l,c,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var y=t,S=r,M=l,I=c,W=S.flags;switch(S.tag){case 0:case 11:case 15:Da(y,S,M,I,p),Ql(8,S);break;case 23:break;case 22:var le=S.stateNode;S.memoizedState!==null?le._visibility&2?Da(y,S,M,I,p):Jl(y,S):(le._visibility|=2,Da(y,S,M,I,p)),p&&W&2048&&Kd(S.alternate,S);break;case 24:Da(y,S,M,I,p),p&&W&2048&&Jd(S.alternate,S);break;default:Da(y,S,M,I,p)}r=r.sibling}}function Jl(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var l=t,c=r,p=c.flags;switch(c.tag){case 22:Jl(l,c),p&2048&&Kd(c.alternate,c);break;case 24:Jl(l,c),p&2048&&Jd(c.alternate,c);break;default:Jl(l,c)}r=r.sibling}}var Wl=8192;function Ra(t,r,l){if(t.subtreeFlags&Wl)for(t=t.child;t!==null;)vy(t,r,l),t=t.sibling}function vy(t,r,l){switch(t.tag){case 26:Ra(t,r,l),t.flags&Wl&&t.memoizedState!==null&&Kk(l,Bn,t.memoizedState,t.memoizedProps);break;case 5:Ra(t,r,l);break;case 3:case 4:var c=Bn;Bn=ju(t.stateNode.containerInfo),Ra(t,r,l),Bn=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=Wl,Wl=16777216,Ra(t,r,l),Wl=c):Ra(t,r,l));break;default:Ra(t,r,l)}}function wy(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function es(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var c=r[l];Tt=c,_y(c,t)}wy(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sy(t),t=t.sibling}function Sy(t){switch(t.tag){case 0:case 11:case 15:es(t),t.flags&2048&&nr(9,t,t.return);break;case 3:es(t);break;case 12:es(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,bu(t)):es(t);break;default:es(t)}}function bu(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var c=r[l];Tt=c,_y(c,t)}wy(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:nr(8,r,r.return),bu(r);break;case 22:l=r.stateNode,l._visibility&2&&(l._visibility&=-3,bu(r));break;default:bu(r)}t=t.sibling}}function _y(t,r){for(;Tt!==null;){var l=Tt;switch(l.tag){case 0:case 11:case 15:nr(8,l,r);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var c=l.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Hl(l.memoizedState.cache)}if(c=l.child,c!==null)c.return=l,Tt=c;else e:for(l=t;Tt!==null;){c=Tt;var p=c.sibling,y=c.return;if(hy(c),c===l){Tt=null;break e}if(p!==null){p.return=y,Tt=p;break e}Tt=y}}}var dk={getCacheForType:function(t){var r=jt(xt),l=r.data.get(t);return l===void 0&&(l=t(),r.data.set(t,l)),l},cacheSignal:function(){return jt(xt).controller.signal}},hk=typeof WeakMap=="function"?WeakMap:Map,Qe=0,it=null,Le=null,Ue=0,Je=0,hn=null,ir=!1,Oa=!1,Wd=!1,Ci=0,dt=0,rr=0,Vr=0,eh=0,pn=0,La=0,ts=null,tn=null,th=!1,vu=0,ky=0,wu=1/0,Su=null,ar=null,Ct=0,lr=null,Ha=null,Mi=0,nh=0,ih=null,Ey=null,ns=0,rh=null;function mn(){return(Qe&2)!==0&&Ue!==0?Ue&-Ue:j.T!==null?ch():No()}function Ny(){if(pn===0)if((Ue&536870912)===0||qe){var t=la;la<<=1,(la&3932160)===0&&(la=262144),pn=t}else pn=536870912;return t=fn.current,t!==null&&(t.flags|=32),pn}function nn(t,r,l){(t===it&&(Je===2||Je===9)||t.cancelPendingCommit!==null)&&(Ba(t,0),sr(t,Ue,pn,!1)),kr(t,l),((Qe&2)===0||t!==it)&&(t===it&&((Qe&2)===0&&(Vr|=l),dt===4&&sr(t,Ue,pn,!1)),Wn(t))}function Cy(t,r,l){if((Qe&6)!==0)throw Error(a(327));var c=!l&&(r&127)===0&&(r&t.expiredLanes)===0||_r(t,r),p=c?gk(t,r):lh(t,r,!0),y=c;do{if(p===0){Oa&&!c&&sr(t,r,0,!1);break}else{if(l=t.current.alternate,y&&!pk(l)){p=lh(t,r,!1),y=!1;continue}if(p===2){if(y=r,t.errorRecoveryDisabledLanes&y)var S=0;else S=t.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){r=S;e:{var M=t;p=ts;var I=M.current.memoizedState.isDehydrated;if(I&&(Ba(M,S).flags|=256),S=lh(M,S,!1),S!==2){if(Wd&&!I){M.errorRecoveryDisabledLanes|=y,Vr|=y,p=4;break e}y=tn,tn=p,y!==null&&(tn===null?tn=y:tn.push.apply(tn,y))}p=S}if(y=!1,p!==2)continue}}if(p===1){Ba(t,0),sr(t,r,0,!0);break}e:{switch(c=t,y=p,y){case 0:case 1:throw Error(a(345));case 4:if((r&4194048)!==r)break;case 6:sr(c,r,pn,!ir);break e;case 2:tn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((r&62914560)===r&&(p=vu+300-Et(),10<p)){if(sr(c,r,pn,!ir),oa(c,0,!0)!==0)break e;Mi=r,c.timeoutHandle=rx(My.bind(null,c,l,tn,Su,th,r,pn,Vr,La,ir,y,"Throttled",-0,0),p);break e}My(c,l,tn,Su,th,r,pn,Vr,La,ir,y,null,-0,0)}}break}while(!0);Wn(t)}function My(t,r,l,c,p,y,S,M,I,W,le,oe,ee,re){if(t.timeoutHandle=-1,oe=r.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hi},vy(r,y,oe);var ye=(y&62914560)===y?vu-Et():(y&4194048)===y?ky-Et():0;if(ye=Jk(oe,ye),ye!==null){Mi=y,t.cancelPendingCommit=ye(Ly.bind(null,t,r,y,l,c,p,S,M,I,le,oe,null,ee,re)),sr(t,y,S,!W);return}}Ly(t,r,y,l,c,p,S,M,I)}function pk(t){for(var r=t;;){var l=r.tag;if((l===0||l===11||l===15)&&r.flags&16384&&(l=r.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var c=0;c<l.length;c++){var p=l[c],y=p.getSnapshot;p=p.value;try{if(!un(y(),p))return!1}catch{return!1}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function sr(t,r,l,c){r&=~eh,r&=~Vr,t.suspendedLanes|=r,t.pingedLanes&=~r,c&&(t.warmLanes|=r),c=t.expirationTimes;for(var p=r;0<p;){var y=31-Ke(p),S=1<<y;c[y]=-1,p&=~S}l!==0&&_o(t,l,r)}function _u(){return(Qe&6)===0?(is(0),!1):!0}function ah(){if(Le!==null){if(Je===0)var t=Le.return;else t=Le,yi=Rr=null,wd(t),Ma=null,Ul=0,t=Le;for(;t!==null;)ay(t.alternate,t),t=t.return;Le=null}}function Ba(t,r){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,Rk(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Mi=0,ah(),it=t,Le=l=mi(t.current,null),Ue=r,Je=0,hn=null,ir=!1,Oa=_r(t,r),Wd=!1,La=pn=eh=Vr=rr=dt=0,tn=ts=null,th=!1,(r&8)!==0&&(r|=r&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=r;0<c;){var p=31-Ke(c),y=1<<p;r|=t[p],c&=~y}return Ci=r,Po(),l}function Ty(t,r){Ae=null,j.H=Fl,r===Ca||r===Jo?(r=Yg(),Je=3):r===ud?(r=Yg(),Je=4):Je=r===Hd?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,hn=r,Le===null&&(dt=1,du(t,kn(r,t.current)))}function Ay(){var t=fn.current;return t===null?!0:(Ue&4194048)===Ue?Mn===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?t===Mn:!1}function zy(){var t=j.H;return j.H=Fl,t===null?Fl:t}function jy(){var t=j.A;return j.A=dk,t}function ku(){dt=4,ir||(Ue&4194048)!==Ue&&fn.current!==null||(Oa=!0),(rr&134217727)===0&&(Vr&134217727)===0||it===null||sr(it,Ue,pn,!1)}function lh(t,r,l){var c=Qe;Qe|=2;var p=zy(),y=jy();(it!==t||Ue!==r)&&(Su=null,Ba(t,r)),r=!1;var S=dt;e:do try{if(Je!==0&&Le!==null){var M=Le,I=hn;switch(Je){case 8:ah(),S=6;break e;case 3:case 2:case 9:case 6:fn.current===null&&(r=!0);var W=Je;if(Je=0,hn=null,Ua(t,M,I,W),l&&Oa){S=0;break e}break;default:W=Je,Je=0,hn=null,Ua(t,M,I,W)}}mk(),S=dt;break}catch(le){Ty(t,le)}while(!0);return r&&t.shellSuspendCounter++,yi=Rr=null,Qe=c,j.H=p,j.A=y,Le===null&&(it=null,Ue=0,Po()),S}function mk(){for(;Le!==null;)Dy(Le)}function gk(t,r){var l=Qe;Qe|=2;var c=zy(),p=jy();it!==t||Ue!==r?(Su=null,wu=Et()+500,Ba(t,r)):Oa=_r(t,r);e:do try{if(Je!==0&&Le!==null){r=Le;var y=hn;t:switch(Je){case 1:Je=0,hn=null,Ua(t,r,y,1);break;case 2:case 9:if(Vg(y)){Je=0,hn=null,Ry(r);break}r=function(){Je!==2&&Je!==9||it!==t||(Je=7),Wn(t)},y.then(r,r);break e;case 3:Je=7;break e;case 4:Je=5;break e;case 7:Vg(y)?(Je=0,hn=null,Ry(r)):(Je=0,hn=null,Ua(t,r,y,7));break;case 5:var S=null;switch(Le.tag){case 26:S=Le.memoizedState;case 5:case 27:var M=Le;if(S?bx(S):M.stateNode.complete){Je=0,hn=null;var I=M.sibling;if(I!==null)Le=I;else{var W=M.return;W!==null?(Le=W,Eu(W)):Le=null}break t}}Je=0,hn=null,Ua(t,r,y,5);break;case 6:Je=0,hn=null,Ua(t,r,y,6);break;case 8:ah(),dt=6;break e;default:throw Error(a(462))}}yk();break}catch(le){Ty(t,le)}while(!0);return yi=Rr=null,j.H=c,j.A=p,Qe=l,Le!==null?0:(it=null,Ue=0,Po(),dt)}function yk(){for(;Le!==null&&!si();)Dy(Le)}function Dy(t){var r=iy(t.alternate,t,Ci);t.memoizedProps=t.pendingProps,r===null?Eu(t):Le=r}function Ry(t){var r=t,l=r.alternate;switch(r.tag){case 15:case 0:r=K0(l,r,r.pendingProps,r.type,void 0,Ue);break;case 11:r=K0(l,r,r.pendingProps,r.type.render,r.ref,Ue);break;case 5:wd(r);default:ay(l,r),r=Le=jg(r,Ci),r=iy(l,r,Ci)}t.memoizedProps=t.pendingProps,r===null?Eu(t):Le=r}function Ua(t,r,l,c){yi=Rr=null,wd(r),Ma=null,Ul=0;var p=r.return;try{if(ak(t,p,r,l,Ue)){dt=1,du(t,kn(l,t.current)),Le=null;return}}catch(y){if(p!==null)throw Le=p,y;dt=1,du(t,kn(l,t.current)),Le=null;return}r.flags&32768?(qe||c===1?t=!0:Oa||(Ue&536870912)!==0?t=!1:(ir=t=!0,(c===2||c===9||c===3||c===6)&&(c=fn.current,c!==null&&c.tag===13&&(c.flags|=16384))),Oy(r,t)):Eu(r)}function Eu(t){var r=t;do{if((r.flags&32768)!==0){Oy(r,ir);return}t=r.return;var l=ok(r.alternate,r,Ci);if(l!==null){Le=l;return}if(r=r.sibling,r!==null){Le=r;return}Le=r=t}while(r!==null);dt===0&&(dt=5)}function Oy(t,r){do{var l=uk(t.alternate,t);if(l!==null){l.flags&=32767,Le=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!r&&(t=t.sibling,t!==null)){Le=t;return}Le=t=l}while(t!==null);dt=6,Le=null}function Ly(t,r,l,c,p,y,S,M,I){t.cancelPendingCommit=null;do Nu();while(Ct!==0);if((Qe&6)!==0)throw Error(a(327));if(r!==null){if(r===t.current)throw Error(a(177));if(y=r.lanes|r.childLanes,y|=Gf,kf(t,l,y,S,M,I),t===it&&(Le=it=null,Ue=0),Ha=r,lr=t,Mi=l,nh=y,ih=p,Ey=c,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,wk(_e,function(){return qy(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||c){c=j.T,j.T=null,p=U.p,U.p=2,S=Qe,Qe|=4;try{ck(t,r,l)}finally{Qe=S,U.p=p,j.T=c}}Ct=1,Hy(),By(),Uy()}}function Hy(){if(Ct===1){Ct=0;var t=lr,r=Ha,l=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||l){l=j.T,j.T=null;var c=U.p;U.p=2;var p=Qe;Qe|=4;try{yy(r,t);var y=xh,S=_g(t.containerInfo),M=y.focusedElem,I=y.selectionRange;if(S!==M&&M&&M.ownerDocument&&Sg(M.ownerDocument.documentElement,M)){if(I!==null&&Vf(M)){var W=I.start,le=I.end;if(le===void 0&&(le=W),"selectionStart"in M)M.selectionStart=W,M.selectionEnd=Math.min(le,M.value.length);else{var oe=M.ownerDocument||document,ee=oe&&oe.defaultView||window;if(ee.getSelection){var re=ee.getSelection(),ye=M.textContent.length,ke=Math.min(I.start,ye),nt=I.end===void 0?ke:Math.min(I.end,ye);!re.extend&&ke>nt&&(S=nt,nt=ke,ke=S);var Z=wg(M,ke),X=wg(M,nt);if(Z&&X&&(re.rangeCount!==1||re.anchorNode!==Z.node||re.anchorOffset!==Z.offset||re.focusNode!==X.node||re.focusOffset!==X.offset)){var J=oe.createRange();J.setStart(Z.node,Z.offset),re.removeAllRanges(),ke>nt?(re.addRange(J),re.extend(X.node,X.offset)):(J.setEnd(X.node,X.offset),re.addRange(J))}}}}for(oe=[],re=M;re=re.parentNode;)re.nodeType===1&&oe.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<oe.length;M++){var se=oe[M];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}Bu=!!yh,xh=yh=null}finally{Qe=p,U.p=c,j.T=l}}t.current=r,Ct=2}}function By(){if(Ct===2){Ct=0;var t=lr,r=Ha,l=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||l){l=j.T,j.T=null;var c=U.p;U.p=2;var p=Qe;Qe|=4;try{dy(t,r.alternate,r)}finally{Qe=p,U.p=c,j.T=l}}Ct=3}}function Uy(){if(Ct===4||Ct===3){Ct=0,oi();var t=lr,r=Ha,l=Mi,c=Ey;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Ct=5:(Ct=0,Ha=lr=null,Iy(t,t.pendingLanes));var p=t.pendingLanes;if(p===0&&(ar=null),Sl(l),r=r.stateNode,pt&&typeof pt.onCommitFiberRoot=="function")try{pt.onCommitFiberRoot(At,r,void 0,(r.current.flags&128)===128)}catch{}if(c!==null){r=j.T,p=U.p,U.p=2,j.T=null;try{for(var y=t.onRecoverableError,S=0;S<c.length;S++){var M=c[S];y(M.value,{componentStack:M.stack})}}finally{j.T=r,U.p=p}}(Mi&3)!==0&&Nu(),Wn(t),p=t.pendingLanes,(l&261930)!==0&&(p&42)!==0?t===rh?ns++:(ns=0,rh=t):ns=0,is(0)}}function Iy(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Hl(r)))}function Nu(){return Hy(),By(),Uy(),qy()}function qy(){if(Ct!==5)return!1;var t=lr,r=nh;nh=0;var l=Sl(Mi),c=j.T,p=U.p;try{U.p=32>l?32:l,j.T=null,l=ih,ih=null;var y=lr,S=Mi;if(Ct=0,Ha=lr=null,Mi=0,(Qe&6)!==0)throw Error(a(331));var M=Qe;if(Qe|=4,Sy(y.current),by(y,y.current,S,l),Qe=M,is(0,!1),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot(At,y)}catch{}return!0}finally{U.p=p,j.T=c,Iy(t,r)}}function $y(t,r,l){r=kn(l,r),r=Ld(t.stateNode,r,2),t=Wi(t,r,2),t!==null&&(kr(t,2),Wn(t))}function We(t,r,l){if(t.tag===3)$y(t,t,l);else for(;r!==null;){if(r.tag===3){$y(r,t,l);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(ar===null||!ar.has(c))){t=kn(l,t),l=V0(2),c=Wi(r,l,2),c!==null&&(P0(l,c,r,t),kr(c,2),Wn(c));break}}r=r.return}}function sh(t,r,l){var c=t.pingCache;if(c===null){c=t.pingCache=new hk;var p=new Set;c.set(r,p)}else p=c.get(r),p===void 0&&(p=new Set,c.set(r,p));p.has(l)||(Wd=!0,p.add(l),t=xk.bind(null,t,r,l),r.then(t,t))}function xk(t,r,l){var c=t.pingCache;c!==null&&c.delete(r),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,it===t&&(Ue&l)===l&&(dt===4||dt===3&&(Ue&62914560)===Ue&&300>Et()-vu?(Qe&2)===0&&Ba(t,0):eh|=l,La===Ue&&(La=0)),Wn(t)}function Vy(t,r){r===0&&(r=So()),t=zr(t,r),t!==null&&(kr(t,r),Wn(t))}function bk(t){var r=t.memoizedState,l=0;r!==null&&(l=r.retryLane),Vy(t,l)}function vk(t,r){var l=0;switch(t.tag){case 31:case 13:var c=t.stateNode,p=t.memoizedState;p!==null&&(l=p.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(r),Vy(t,l)}function wk(t,r){return Gt(t,r)}var Cu=null,Ia=null,oh=!1,Mu=!1,uh=!1,or=0;function Wn(t){t!==Ia&&t.next===null&&(Ia===null?Cu=Ia=t:Ia=Ia.next=t),Mu=!0,oh||(oh=!0,_k())}function is(t,r){if(!uh&&Mu){uh=!0;do for(var l=!1,c=Cu;c!==null;){if(t!==0){var p=c.pendingLanes;if(p===0)var y=0;else{var S=c.suspendedLanes,M=c.pingedLanes;y=(1<<31-Ke(42|t)+1)-1,y&=p&~(S&~M),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(l=!0,Fy(c,y))}else y=Ue,y=oa(c,c===it?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(y&3)===0||_r(c,y)||(l=!0,Fy(c,y));c=c.next}while(l);uh=!1}}function Sk(){Py()}function Py(){Mu=oh=!1;var t=0;or!==0&&Dk()&&(t=or);for(var r=Et(),l=null,c=Cu;c!==null;){var p=c.next,y=Yy(c,r);y===0?(c.next=null,l===null?Cu=p:l.next=p,p===null&&(Ia=l)):(l=c,(t!==0||(y&3)!==0)&&(Mu=!0)),c=p}Ct!==0&&Ct!==5||is(t),or!==0&&(or=0)}function Yy(t,r){for(var l=t.suspendedLanes,c=t.pingedLanes,p=t.expirationTimes,y=t.pendingLanes&-62914561;0<y;){var S=31-Ke(y),M=1<<S,I=p[S];I===-1?((M&l)===0||(M&c)!==0)&&(p[S]=_f(M,r)):I<=r&&(t.expiredLanes|=M),y&=~M}if(r=it,l=Ue,l=oa(t,t===r?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,l===0||t===r&&(Je===2||Je===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&Rn(c),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||_r(t,l)){if(r=l&-l,r===t.callbackPriority)return r;switch(c!==null&&Rn(c),Sl(l)){case 2:case 8:l=pe;break;case 32:l=_e;break;case 268435456:l=$e;break;default:l=_e}return c=Xy.bind(null,t),l=Gt(l,c),t.callbackPriority=r,t.callbackNode=l,r}return c!==null&&c!==null&&Rn(c),t.callbackPriority=2,t.callbackNode=null,2}function Xy(t,r){if(Ct!==0&&Ct!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(Nu()&&t.callbackNode!==l)return null;var c=Ue;return c=oa(t,t===it?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(Cy(t,c,r),Yy(t,Et()),t.callbackNode!=null&&t.callbackNode===l?Xy.bind(null,t):null)}function Fy(t,r){if(Nu())return null;Cy(t,r,!0)}function _k(){Ok(function(){(Qe&6)!==0?Gt(ae,Sk):Py()})}function ch(){if(or===0){var t=Ea;t===0&&(t=aa,aa<<=1,(aa&261888)===0&&(aa=256)),or=t}return or}function Gy(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Lo(""+t)}function Zy(t,r){var l=r.ownerDocument.createElement("input");return l.name=r.name,l.value=r.value,t.id&&l.setAttribute("form",t.id),r.parentNode.insertBefore(l,r),t=new FormData(t),l.parentNode.removeChild(l),t}function kk(t,r,l,c,p){if(r==="submit"&&l&&l.stateNode===p){var y=Gy((p[Bt]||null).action),S=c.submitter;S&&(r=(r=S[Bt]||null)?Gy(r.formAction):S.getAttribute("formAction"),r!==null&&(y=r,S=null));var M=new Io("action","action",null,c,p);t.push({event:M,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(or!==0){var I=S?Zy(p,S):new FormData(p);Ad(l,{pending:!0,data:I,method:p.method,action:y},null,I)}}else typeof y=="function"&&(M.preventDefault(),I=S?Zy(p,S):new FormData(p),Ad(l,{pending:!0,data:I,method:p.method,action:y},y,I))},currentTarget:p}]})}}for(var fh=0;fh<Ff.length;fh++){var dh=Ff[fh],Ek=dh.toLowerCase(),Nk=dh[0].toUpperCase()+dh.slice(1);Hn(Ek,"on"+Nk)}Hn(Ng,"onAnimationEnd"),Hn(Cg,"onAnimationIteration"),Hn(Mg,"onAnimationStart"),Hn("dblclick","onDoubleClick"),Hn("focusin","onFocus"),Hn("focusout","onBlur"),Hn($_,"onTransitionRun"),Hn(V_,"onTransitionStart"),Hn(P_,"onTransitionCancel"),Hn(Tg,"onTransitionEnd"),Yi("onMouseEnter",["mouseout","mouseover"]),Yi("onMouseLeave",["mouseout","mouseover"]),Yi("onPointerEnter",["pointerout","pointerover"]),Yi("onPointerLeave",["pointerout","pointerover"]),fi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fi("onBeforeInput",["compositionend","keypress","textInput","paste"]),fi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rs="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ck=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(rs));function Qy(t,r){r=(r&4)!==0;for(var l=0;l<t.length;l++){var c=t[l],p=c.event;c=c.listeners;e:{var y=void 0;if(r)for(var S=c.length-1;0<=S;S--){var M=c[S],I=M.instance,W=M.currentTarget;if(M=M.listener,I!==y&&p.isPropagationStopped())break e;y=M,p.currentTarget=W;try{y(p)}catch(le){Vo(le)}p.currentTarget=null,y=I}else for(S=0;S<c.length;S++){if(M=c[S],I=M.instance,W=M.currentTarget,M=M.listener,I!==y&&p.isPropagationStopped())break e;y=M,p.currentTarget=W;try{y(p)}catch(le){Vo(le)}p.currentTarget=null,y=I}}}}function He(t,r){var l=r[ua];l===void 0&&(l=r[ua]=new Set);var c=t+"__bubble";l.has(c)||(Ky(r,t,2,!1),l.add(c))}function hh(t,r,l){var c=0;r&&(c|=4),Ky(l,t,c,r)}var Tu="_reactListening"+Math.random().toString(36).slice(2);function ph(t){if(!t[Tu]){t[Tu]=!0,Ao.forEach(function(l){l!=="selectionchange"&&(Ck.has(l)||hh(l,!1,t),hh(l,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[Tu]||(r[Tu]=!0,hh("selectionchange",!1,r))}}function Ky(t,r,l,c){switch(Nx(r)){case 2:var p=tE;break;case 8:p=nE;break;default:p=Th}l=p.bind(null,r,l,t),p=void 0,!Rf||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),c?p!==void 0?t.addEventListener(r,l,{capture:!0,passive:p}):t.addEventListener(r,l,!0):p!==void 0?t.addEventListener(r,l,{passive:p}):t.addEventListener(r,l,!1)}function mh(t,r,l,c,p){var y=c;if((r&1)===0&&(r&2)===0&&c!==null)e:for(;;){if(c===null)return;var S=c.tag;if(S===3||S===4){var M=c.stateNode.containerInfo;if(M===p)break;if(S===4)for(S=c.return;S!==null;){var I=S.tag;if((I===3||I===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;M!==null;){if(S=qi(M),S===null)return;if(I=S.tag,I===5||I===6||I===26||I===27){c=y=S;continue e}M=M.parentNode}}c=c.return}ng(function(){var W=y,le=jf(l),oe=[];e:{var ee=Ag.get(t);if(ee!==void 0){var re=Io,ye=t;switch(t){case"keypress":if(Bo(l)===0)break e;case"keydown":case"keyup":re=v_;break;case"focusin":ye="focus",re=Bf;break;case"focusout":ye="blur",re=Bf;break;case"beforeblur":case"afterblur":re=Bf;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=ag;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=o_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=__;break;case Ng:case Cg:case Mg:re=f_;break;case Tg:re=E_;break;case"scroll":case"scrollend":re=l_;break;case"wheel":re=C_;break;case"copy":case"cut":case"paste":re=h_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=sg;break;case"toggle":case"beforetoggle":re=T_}var ke=(r&4)!==0,nt=!ke&&(t==="scroll"||t==="scrollend"),Z=ke?ee!==null?ee+"Capture":null:ee;ke=[];for(var X=W,J;X!==null;){var se=X;if(J=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||J===null||Z===null||(se=Nl(X,Z),se!=null&&ke.push(as(X,se,J))),nt)break;X=X.return}0<ke.length&&(ee=new re(ee,ye,null,l,le),oe.push({event:ee,listeners:ke}))}}if((r&7)===0){e:{if(ee=t==="mouseover"||t==="pointerover",re=t==="mouseout"||t==="pointerout",ee&&l!==zf&&(ye=l.relatedTarget||l.fromElement)&&(qi(ye)||ye[ci]))break e;if((re||ee)&&(ee=le.window===le?le:(ee=le.ownerDocument)?ee.defaultView||ee.parentWindow:window,re?(ye=l.relatedTarget||l.toElement,re=W,ye=ye?qi(ye):null,ye!==null&&(nt=o(ye),ke=ye.tag,ye!==nt||ke!==5&&ke!==27&&ke!==6)&&(ye=null)):(re=null,ye=W),re!==ye)){if(ke=ag,se="onMouseLeave",Z="onMouseEnter",X="mouse",(t==="pointerout"||t==="pointerover")&&(ke=sg,se="onPointerLeave",Z="onPointerEnter",X="pointer"),nt=re==null?ee:Vi(re),J=ye==null?ee:Vi(ye),ee=new ke(se,X+"leave",re,l,le),ee.target=nt,ee.relatedTarget=J,se=null,qi(le)===W&&(ke=new ke(Z,X+"enter",ye,l,le),ke.target=J,ke.relatedTarget=nt,se=ke),nt=se,re&&ye)t:{for(ke=Mk,Z=re,X=ye,J=0,se=Z;se;se=ke(se))J++;se=0;for(var ve=X;ve;ve=ke(ve))se++;for(;0<J-se;)Z=ke(Z),J--;for(;0<se-J;)X=ke(X),se--;for(;J--;){if(Z===X||X!==null&&Z===X.alternate){ke=Z;break t}Z=ke(Z),X=ke(X)}ke=null}else ke=null;re!==null&&Jy(oe,ee,re,ke,!1),ye!==null&&nt!==null&&Jy(oe,nt,ye,ke,!0)}}e:{if(ee=W?Vi(W):window,re=ee.nodeName&&ee.nodeName.toLowerCase(),re==="select"||re==="input"&&ee.type==="file")var Fe=mg;else if(hg(ee))if(gg)Fe=U_;else{Fe=H_;var xe=L_}else re=ee.nodeName,!re||re.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?W&&Af(W.elementType)&&(Fe=mg):Fe=B_;if(Fe&&(Fe=Fe(t,W))){pg(oe,Fe,l,le);break e}xe&&xe(t,ee,W),t==="focusout"&&W&&ee.type==="number"&&W.memoizedProps.value!=null&&El(ee,"number",ee.value)}switch(xe=W?Vi(W):window,t){case"focusin":(hg(xe)||xe.contentEditable==="true")&&(ya=xe,Pf=W,Rl=null);break;case"focusout":Rl=Pf=ya=null;break;case"mousedown":Yf=!0;break;case"contextmenu":case"mouseup":case"dragend":Yf=!1,kg(oe,l,le);break;case"selectionchange":if(q_)break;case"keydown":case"keyup":kg(oe,l,le)}var ze;if(If)e:{switch(t){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else ga?fg(t,l)&&(Ie="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Ie="onCompositionStart");Ie&&(og&&l.locale!=="ko"&&(ga||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&ga&&(ze=ig()):(Xi=le,Of="value"in Xi?Xi.value:Xi.textContent,ga=!0)),xe=Au(W,Ie),0<xe.length&&(Ie=new lg(Ie,t,null,l,le),oe.push({event:Ie,listeners:xe}),ze?Ie.data=ze:(ze=dg(l),ze!==null&&(Ie.data=ze)))),(ze=z_?j_(t,l):D_(t,l))&&(Ie=Au(W,"onBeforeInput"),0<Ie.length&&(xe=new lg("onBeforeInput","beforeinput",null,l,le),oe.push({event:xe,listeners:Ie}),xe.data=ze)),kk(oe,t,W,l,le)}Qy(oe,r)})}function as(t,r,l){return{instance:t,listener:r,currentTarget:l}}function Au(t,r){for(var l=r+"Capture",c=[];t!==null;){var p=t,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=Nl(t,l),p!=null&&c.unshift(as(t,p,y)),p=Nl(t,r),p!=null&&c.push(as(t,p,y))),t.tag===3)return c;t=t.return}return[]}function Mk(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Jy(t,r,l,c,p){for(var y=r._reactName,S=[];l!==null&&l!==c;){var M=l,I=M.alternate,W=M.stateNode;if(M=M.tag,I!==null&&I===c)break;M!==5&&M!==26&&M!==27||W===null||(I=W,p?(W=Nl(l,y),W!=null&&S.unshift(as(l,W,I))):p||(W=Nl(l,y),W!=null&&S.push(as(l,W,I)))),l=l.return}S.length!==0&&t.push({event:r,listeners:S})}var Tk=/\r\n?/g,Ak=/\u0000|\uFFFD/g;function Wy(t){return(typeof t=="string"?t:""+t).replace(Tk,`
|
|
9
|
-
`).replace(Ak,"")}function ex(t,r){return r=Wy(r),Wy(t)===r}function tt(t,r,l,c,p,y){switch(l){case"children":typeof c=="string"?r==="body"||r==="textarea"&&c===""||ha(t,c):(typeof c=="number"||typeof c=="bigint")&&r!=="body"&&ha(t,""+c);break;case"className":fa(t,"class",c);break;case"tabIndex":fa(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":fa(t,l,c);break;case"style":eg(t,c,y);break;case"data":if(r!=="object"){fa(t,"data",c);break}case"src":case"href":if(c===""&&(r!=="a"||l!=="href")){t.removeAttribute(l);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=Lo(""+c),t.setAttribute(l,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(l==="formAction"?(r!=="input"&&tt(t,r,"name",p.name,p,null),tt(t,r,"formEncType",p.formEncType,p,null),tt(t,r,"formMethod",p.formMethod,p,null),tt(t,r,"formTarget",p.formTarget,p,null)):(tt(t,r,"encType",p.encType,p,null),tt(t,r,"method",p.method,p,null),tt(t,r,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=Lo(""+c),t.setAttribute(l,c);break;case"onClick":c!=null&&(t.onclick=hi);break;case"onScroll":c!=null&&He("scroll",t);break;case"onScrollEnd":c!=null&&He("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(l=c.__html,l!=null){if(p.children!=null)throw Error(a(60));t.innerHTML=l}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}l=Lo(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""+c):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":c===!0?t.setAttribute(l,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,c):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(l,c):t.removeAttribute(l);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(l):t.setAttribute(l,c);break;case"popover":He("beforetoggle",t),He("toggle",t),ca(t,"popover",c);break;case"xlinkActuate":Ln(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Ln(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Ln(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Ln(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Ln(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Ln(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Ln(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Ln(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Ln(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":ca(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=r_.get(l)||l,ca(t,l,c))}}function gh(t,r,l,c,p,y){switch(l){case"style":eg(t,c,y);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(l=c.__html,l!=null){if(p.children!=null)throw Error(a(60));t.innerHTML=l}}break;case"children":typeof c=="string"?ha(t,c):(typeof c=="number"||typeof c=="bigint")&&ha(t,""+c);break;case"onScroll":c!=null&&He("scroll",t);break;case"onScrollEnd":c!=null&&He("scrollend",t);break;case"onClick":c!=null&&(t.onclick=hi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zo.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),r=l.slice(2,p?l.length-7:void 0),y=t[Bt]||null,y=y!=null?y[l]:null,typeof y=="function"&&t.removeEventListener(r,y,p),typeof c=="function")){typeof y!="function"&&y!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(r,c,p);break e}l in t?t[l]=c:c===!0?t.setAttribute(l,""):ca(t,l,c)}}}function Rt(t,r,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",t),He("load",t);var c=!1,p=!1,y;for(y in l)if(l.hasOwnProperty(y)){var S=l[y];if(S!=null)switch(y){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:tt(t,r,y,S,l,null)}}p&&tt(t,r,"srcSet",l.srcSet,l,null),c&&tt(t,r,"src",l.src,l,null);return;case"input":He("invalid",t);var M=y=S=p=null,I=null,W=null;for(c in l)if(l.hasOwnProperty(c)){var le=l[c];if(le!=null)switch(c){case"name":p=le;break;case"type":S=le;break;case"checked":I=le;break;case"defaultChecked":W=le;break;case"value":y=le;break;case"defaultValue":M=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(a(137,r));break;default:tt(t,r,c,le,l,null)}}Oo(t,y,M,I,W,S,p,!1);return;case"select":He("invalid",t),c=S=y=null;for(p in l)if(l.hasOwnProperty(p)&&(M=l[p],M!=null))switch(p){case"value":y=M;break;case"defaultValue":S=M;break;case"multiple":c=M;default:tt(t,r,p,M,l,null)}r=y,l=S,t.multiple=!!c,r!=null?di(t,!!c,r,!1):l!=null&&di(t,!!c,l,!0);return;case"textarea":He("invalid",t),y=p=c=null;for(S in l)if(l.hasOwnProperty(S)&&(M=l[S],M!=null))switch(S){case"value":c=M;break;case"defaultValue":p=M;break;case"children":y=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(a(91));break;default:tt(t,r,S,M,l,null)}Jm(t,c,p,y);return;case"option":for(I in l)l.hasOwnProperty(I)&&(c=l[I],c!=null)&&(I==="selected"?t.selected=c&&typeof c!="function"&&typeof c!="symbol":tt(t,r,I,c,l,null));return;case"dialog":He("beforetoggle",t),He("toggle",t),He("cancel",t),He("close",t);break;case"iframe":case"object":He("load",t);break;case"video":case"audio":for(c=0;c<rs.length;c++)He(rs[c],t);break;case"image":He("error",t),He("load",t);break;case"details":He("toggle",t);break;case"embed":case"source":case"link":He("error",t),He("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in l)if(l.hasOwnProperty(W)&&(c=l[W],c!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:tt(t,r,W,c,l,null)}return;default:if(Af(r)){for(le in l)l.hasOwnProperty(le)&&(c=l[le],c!==void 0&&gh(t,r,le,c,l,void 0));return}}for(M in l)l.hasOwnProperty(M)&&(c=l[M],c!=null&&tt(t,r,M,c,l,null))}function zk(t,r,l,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,S=null,M=null,I=null,W=null,le=null;for(re in l){var oe=l[re];if(l.hasOwnProperty(re)&&oe!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":I=oe;default:c.hasOwnProperty(re)||tt(t,r,re,null,c,oe)}}for(var ee in c){var re=c[ee];if(oe=l[ee],c.hasOwnProperty(ee)&&(re!=null||oe!=null))switch(ee){case"type":y=re;break;case"name":p=re;break;case"checked":W=re;break;case"defaultChecked":le=re;break;case"value":S=re;break;case"defaultValue":M=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,r));break;default:re!==oe&&tt(t,r,ee,re,c,oe)}}Cr(t,S,M,I,W,le,y,p);return;case"select":re=S=M=ee=null;for(y in l)if(I=l[y],l.hasOwnProperty(y)&&I!=null)switch(y){case"value":break;case"multiple":re=I;default:c.hasOwnProperty(y)||tt(t,r,y,null,c,I)}for(p in c)if(y=c[p],I=l[p],c.hasOwnProperty(p)&&(y!=null||I!=null))switch(p){case"value":ee=y;break;case"defaultValue":M=y;break;case"multiple":S=y;default:y!==I&&tt(t,r,p,y,c,I)}r=M,l=S,c=re,ee!=null?di(t,!!l,ee,!1):!!c!=!!l&&(r!=null?di(t,!!l,r,!0):di(t,!!l,l?[]:"",!1));return;case"textarea":re=ee=null;for(M in l)if(p=l[M],l.hasOwnProperty(M)&&p!=null&&!c.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:tt(t,r,M,null,c,p)}for(S in c)if(p=c[S],y=l[S],c.hasOwnProperty(S)&&(p!=null||y!=null))switch(S){case"value":ee=p;break;case"defaultValue":re=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==y&&tt(t,r,S,p,c,y)}Km(t,ee,re);return;case"option":for(var ye in l)ee=l[ye],l.hasOwnProperty(ye)&&ee!=null&&!c.hasOwnProperty(ye)&&(ye==="selected"?t.selected=!1:tt(t,r,ye,null,c,ee));for(I in c)ee=c[I],re=l[I],c.hasOwnProperty(I)&&ee!==re&&(ee!=null||re!=null)&&(I==="selected"?t.selected=ee&&typeof ee!="function"&&typeof ee!="symbol":tt(t,r,I,ee,c,re));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ke in l)ee=l[ke],l.hasOwnProperty(ke)&&ee!=null&&!c.hasOwnProperty(ke)&&tt(t,r,ke,null,c,ee);for(W in c)if(ee=c[W],re=l[W],c.hasOwnProperty(W)&&ee!==re&&(ee!=null||re!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(a(137,r));break;default:tt(t,r,W,ee,c,re)}return;default:if(Af(r)){for(var nt in l)ee=l[nt],l.hasOwnProperty(nt)&&ee!==void 0&&!c.hasOwnProperty(nt)&&gh(t,r,nt,void 0,c,ee);for(le in c)ee=c[le],re=l[le],!c.hasOwnProperty(le)||ee===re||ee===void 0&&re===void 0||gh(t,r,le,ee,c,re);return}}for(var Z in l)ee=l[Z],l.hasOwnProperty(Z)&&ee!=null&&!c.hasOwnProperty(Z)&&tt(t,r,Z,null,c,ee);for(oe in c)ee=c[oe],re=l[oe],!c.hasOwnProperty(oe)||ee===re||ee==null&&re==null||tt(t,r,oe,ee,c,re)}function tx(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function jk(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,l=performance.getEntriesByType("resource"),c=0;c<l.length;c++){var p=l[c],y=p.transferSize,S=p.initiatorType,M=p.duration;if(y&&M&&tx(S)){for(S=0,M=p.responseEnd,c+=1;c<l.length;c++){var I=l[c],W=I.startTime;if(W>M)break;var le=I.transferSize,oe=I.initiatorType;le&&tx(oe)&&(I=I.responseEnd,S+=le*(I<M?1:(M-W)/(I-W)))}if(--c,r+=8*(y+S)/(p.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var yh=null,xh=null;function zu(t){return t.nodeType===9?t:t.ownerDocument}function nx(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ix(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function bh(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var vh=null;function Dk(){var t=window.event;return t&&t.type==="popstate"?t===vh?!1:(vh=t,!0):(vh=null,!1)}var rx=typeof setTimeout=="function"?setTimeout:void 0,Rk=typeof clearTimeout=="function"?clearTimeout:void 0,ax=typeof Promise=="function"?Promise:void 0,Ok=typeof queueMicrotask=="function"?queueMicrotask:typeof ax<"u"?function(t){return ax.resolve(null).then(t).catch(Lk)}:rx;function Lk(t){setTimeout(function(){throw t})}function ur(t){return t==="head"}function lx(t,r){var l=r,c=0;do{var p=l.nextSibling;if(t.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"||l==="/&"){if(c===0){t.removeChild(p),Pa(r);return}c--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")c++;else if(l==="html")ls(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,ls(l);for(var y=l.firstChild;y;){var S=y.nextSibling,M=y.nodeName;y[Er]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&y.rel.toLowerCase()==="stylesheet"||l.removeChild(y),y=S}}else l==="body"&&ls(t.ownerDocument.body);l=p}while(l);Pa(r)}function sx(t,r){var l=t;t=0;do{var c=l.nextSibling;if(l.nodeType===1?r?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(r?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),c&&c.nodeType===8)if(l=c.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=c}while(l)}function wh(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var l=r;switch(r=r.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":wh(l),_l(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function Hk(t,r,l,c){for(;t.nodeType===1;){var p=l;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[Er])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(y=t.getAttribute("rel"),y==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(y!==p.rel||t.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||t.getAttribute("title")!==(p.title==null?null:p.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(y=t.getAttribute("src"),(y!==(p.src==null?null:p.src)||t.getAttribute("type")!==(p.type==null?null:p.type)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&t.getAttribute("name")===y)return t}else return t;if(t=Tn(t.nextSibling),t===null)break}return null}function Bk(t,r,l){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Tn(t.nextSibling),t===null))return null;return t}function ox(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Tn(t.nextSibling),t===null))return null;return t}function Sh(t){return t.data==="$?"||t.data==="$~"}function _h(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Uk(t,r){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||l.readyState!=="loading")r();else{var c=function(){r(),l.removeEventListener("DOMContentLoaded",c)};l.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function Tn(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var kh=null;function ux(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(r===0)return Tn(t.nextSibling);r--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||r++}t=t.nextSibling}return null}function cx(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(r===0)return t;r--}else l!=="/$"&&l!=="/&"||r++}t=t.previousSibling}return null}function fx(t,r,l){switch(r=zu(l),t){case"html":if(t=r.documentElement,!t)throw Error(a(452));return t;case"head":if(t=r.head,!t)throw Error(a(453));return t;case"body":if(t=r.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function ls(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);_l(t)}var An=new Map,dx=new Set;function ju(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ti=U.d;U.d={f:Ik,r:qk,D:$k,C:Vk,L:Pk,m:Yk,X:Fk,S:Xk,M:Gk};function Ik(){var t=Ti.f(),r=_u();return t||r}function qk(t){var r=$i(t);r!==null&&r.tag===5&&r.type==="form"?T0(r):Ti.r(t)}var qa=typeof document>"u"?null:document;function hx(t,r,l){var c=qa;if(c&&typeof r=="string"&&r){var p=Qt(r);p='link[rel="'+t+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),dx.has(p)||(dx.add(p),t={rel:t,crossOrigin:l,href:r},c.querySelector(p)===null&&(r=c.createElement("link"),Rt(r,"link",t),yt(r),c.head.appendChild(r)))}}function $k(t){Ti.D(t),hx("dns-prefetch",t,null)}function Vk(t,r){Ti.C(t,r),hx("preconnect",t,r)}function Pk(t,r,l){Ti.L(t,r,l);var c=qa;if(c&&t&&r){var p='link[rel="preload"][as="'+Qt(r)+'"]';r==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+Qt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+Qt(l.imageSizes)+'"]')):p+='[href="'+Qt(t)+'"]';var y=p;switch(r){case"style":y=$a(t);break;case"script":y=Va(t)}An.has(y)||(t=m({rel:"preload",href:r==="image"&&l&&l.imageSrcSet?void 0:t,as:r},l),An.set(y,t),c.querySelector(p)!==null||r==="style"&&c.querySelector(ss(y))||r==="script"&&c.querySelector(os(y))||(r=c.createElement("link"),Rt(r,"link",t),yt(r),c.head.appendChild(r)))}}function Yk(t,r){Ti.m(t,r);var l=qa;if(l&&t){var c=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+Qt(c)+'"][href="'+Qt(t)+'"]',y=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Va(t)}if(!An.has(y)&&(t=m({rel:"modulepreload",href:t},r),An.set(y,t),l.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(os(y)))return}c=l.createElement("link"),Rt(c,"link",t),yt(c),l.head.appendChild(c)}}}function Xk(t,r,l){Ti.S(t,r,l);var c=qa;if(c&&t){var p=Pi(c).hoistableStyles,y=$a(t);r=r||"default";var S=p.get(y);if(!S){var M={loading:0,preload:null};if(S=c.querySelector(ss(y)))M.loading=5;else{t=m({rel:"stylesheet",href:t,"data-precedence":r},l),(l=An.get(y))&&Eh(t,l);var I=S=c.createElement("link");yt(I),Rt(I,"link",t),I._p=new Promise(function(W,le){I.onload=W,I.onerror=le}),I.addEventListener("load",function(){M.loading|=1}),I.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Du(S,r,c)}S={type:"stylesheet",instance:S,count:1,state:M},p.set(y,S)}}}function Fk(t,r){Ti.X(t,r);var l=qa;if(l&&t){var c=Pi(l).hoistableScripts,p=Va(t),y=c.get(p);y||(y=l.querySelector(os(p)),y||(t=m({src:t,async:!0},r),(r=An.get(p))&&Nh(t,r),y=l.createElement("script"),yt(y),Rt(y,"link",t),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function Gk(t,r){Ti.M(t,r);var l=qa;if(l&&t){var c=Pi(l).hoistableScripts,p=Va(t),y=c.get(p);y||(y=l.querySelector(os(p)),y||(t=m({src:t,async:!0,type:"module"},r),(r=An.get(p))&&Nh(t,r),y=l.createElement("script"),yt(y),Rt(y,"link",t),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function px(t,r,l,c){var p=(p=fe.current)?ju(p):null;if(!p)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(r=$a(l.href),l=Pi(p).hoistableStyles,c=l.get(r),c||(c={type:"style",instance:null,count:0,state:null},l.set(r,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=$a(l.href);var y=Pi(p).hoistableStyles,S=y.get(t);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(t,S),(y=p.querySelector(ss(t)))&&!y._p&&(S.instance=y,S.state.loading=5),An.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},An.set(t,l),y||Zk(p,t,l,S.state))),r&&c===null)throw Error(a(528,""));return S}if(r&&c!==null)throw Error(a(529,""));return null;case"script":return r=l.async,l=l.src,typeof l=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Va(l),l=Pi(p).hoistableScripts,c=l.get(r),c||(c={type:"script",instance:null,count:0,state:null},l.set(r,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function $a(t){return'href="'+Qt(t)+'"'}function ss(t){return'link[rel="stylesheet"]['+t+"]"}function mx(t){return m({},t,{"data-precedence":t.precedence,precedence:null})}function Zk(t,r,l,c){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?c.loading=1:(r=t.createElement("link"),c.preload=r,r.addEventListener("load",function(){return c.loading|=1}),r.addEventListener("error",function(){return c.loading|=2}),Rt(r,"link",l),yt(r),t.head.appendChild(r))}function Va(t){return'[src="'+Qt(t)+'"]'}function os(t){return"script[async]"+t}function gx(t,r,l){if(r.count++,r.instance===null)switch(r.type){case"style":var c=t.querySelector('style[data-href~="'+Qt(l.href)+'"]');if(c)return r.instance=c,yt(c),c;var p=m({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),yt(c),Rt(c,"style",p),Du(c,l.precedence,t),r.instance=c;case"stylesheet":p=$a(l.href);var y=t.querySelector(ss(p));if(y)return r.state.loading|=4,r.instance=y,yt(y),y;c=mx(l),(p=An.get(p))&&Eh(c,p),y=(t.ownerDocument||t).createElement("link"),yt(y);var S=y;return S._p=new Promise(function(M,I){S.onload=M,S.onerror=I}),Rt(y,"link",c),r.state.loading|=4,Du(y,l.precedence,t),r.instance=y;case"script":return y=Va(l.src),(p=t.querySelector(os(y)))?(r.instance=p,yt(p),p):(c=l,(p=An.get(y))&&(c=m({},l),Nh(c,p)),t=t.ownerDocument||t,p=t.createElement("script"),yt(p),Rt(p,"link",c),t.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(a(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(c=r.instance,r.state.loading|=4,Du(c,l.precedence,t));return r.instance}function Du(t,r,l){for(var c=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,y=p,S=0;S<c.length;S++){var M=c[S];if(M.dataset.precedence===r)y=M;else if(y!==p)break}y?y.parentNode.insertBefore(t,y.nextSibling):(r=l.nodeType===9?l.head:l,r.insertBefore(t,r.firstChild))}function Eh(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function Nh(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var Ru=null;function yx(t,r,l){if(Ru===null){var c=new Map,p=Ru=new Map;p.set(l,c)}else p=Ru,c=p.get(l),c||(c=new Map,p.set(l,c));if(c.has(t))return c;for(c.set(t,null),l=l.getElementsByTagName(t),p=0;p<l.length;p++){var y=l[p];if(!(y[Er]||y[Nt]||t==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var S=y.getAttribute(r)||"";S=t+S;var M=c.get(S);M?M.push(y):c.set(S,[y])}}return c}function xx(t,r,l){t=t.ownerDocument||t,t.head.insertBefore(l,r==="title"?t.querySelector("head > title"):null)}function Qk(t,r,l){if(l===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(t=r.disabled,typeof r.precedence=="string"&&t==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function bx(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Kk(t,r,l,c){if(l.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var p=$a(c.href),y=r.querySelector(ss(p));if(y){r=y._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=Ou.bind(t),r.then(t,t)),l.state.loading|=4,l.instance=y,yt(y);return}y=r.ownerDocument||r,c=mx(c),(p=An.get(p))&&Eh(c,p),y=y.createElement("link"),yt(y);var S=y;S._p=new Promise(function(M,I){S.onload=M,S.onerror=I}),Rt(y,"link",c),l.instance=y}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,r),(r=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Ou.bind(t),r.addEventListener("load",l),r.addEventListener("error",l))}}var Ch=0;function Jk(t,r){return t.stylesheets&&t.count===0&&Hu(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var c=setTimeout(function(){if(t.stylesheets&&Hu(t,t.stylesheets),t.unsuspend){var y=t.unsuspend;t.unsuspend=null,y()}},6e4+r);0<t.imgBytes&&Ch===0&&(Ch=62500*jk());var p=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Hu(t,t.stylesheets),t.unsuspend)){var y=t.unsuspend;t.unsuspend=null,y()}},(t.imgBytes>Ch?50:800)+r);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Ou(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Lu=null;function Hu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Lu=new Map,r.forEach(Wk,t),Lu=null,Ou.call(t))}function Wk(t,r){if(!(r.state.loading&4)){var l=Lu.get(t);if(l)var c=l.get(null);else{l=new Map,Lu.set(t,l);for(var p=t.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var S=p[y];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(l.set(S.dataset.precedence,S),c=S)}c&&l.set(null,c)}p=r.instance,S=p.getAttribute("data-precedence"),y=l.get(S)||c,y===c&&l.set(null,p),l.set(S,p),this.count++,c=Ou.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),y?y.parentNode.insertBefore(p,y.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(p,t.firstChild)),r.state.loading|=4}}var us={$$typeof:k,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function eE(t,r,l,c,p,y,S,M,I){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=vl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vl(0),this.hiddenUpdates=vl(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function vx(t,r,l,c,p,y,S,M,I,W,le,oe){return t=new eE(t,r,l,S,I,W,le,oe,M),r=1,y===!0&&(r|=24),y=cn(3,null,null,r),t.current=y,y.stateNode=t,r=ld(),r.refCount++,t.pooledCache=r,r.refCount++,y.memoizedState={element:c,isDehydrated:l,cache:r},cd(y),t}function wx(t){return t?(t=va,t):va}function Sx(t,r,l,c,p,y){p=wx(p),c.context===null?c.context=p:c.pendingContext=p,c=Ji(r),c.payload={element:l},y=y===void 0?null:y,y!==null&&(c.callback=y),l=Wi(t,c,r),l!==null&&(nn(l,t,r),ql(l,t,r))}function _x(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<r?l:r}}function Mh(t,r){_x(t,r),(t=t.alternate)&&_x(t,r)}function kx(t){if(t.tag===13||t.tag===31){var r=zr(t,67108864);r!==null&&nn(r,t,67108864),Mh(t,67108864)}}function Ex(t){if(t.tag===13||t.tag===31){var r=mn();r=wl(r);var l=zr(t,r);l!==null&&nn(l,t,r),Mh(t,r)}}var Bu=!0;function tE(t,r,l,c){var p=j.T;j.T=null;var y=U.p;try{U.p=2,Th(t,r,l,c)}finally{U.p=y,j.T=p}}function nE(t,r,l,c){var p=j.T;j.T=null;var y=U.p;try{U.p=8,Th(t,r,l,c)}finally{U.p=y,j.T=p}}function Th(t,r,l,c){if(Bu){var p=Ah(c);if(p===null)mh(t,r,c,Uu,l),Cx(t,c);else if(rE(p,t,r,l,c))c.stopPropagation();else if(Cx(t,c),r&4&&-1<iE.indexOf(t)){for(;p!==null;){var y=$i(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var S=ui(y.pendingLanes);if(S!==0){var M=y;for(M.pendingLanes|=2,M.entangledLanes|=2;S;){var I=1<<31-Ke(S);M.entanglements[1]|=I,S&=~I}Wn(y),(Qe&6)===0&&(wu=Et()+500,is(0))}}break;case 31:case 13:M=zr(y,2),M!==null&&nn(M,y,2),_u(),Mh(y,2)}if(y=Ah(c),y===null&&mh(t,r,c,Uu,l),y===p)break;p=y}p!==null&&c.stopPropagation()}else mh(t,r,c,null,l)}}function Ah(t){return t=jf(t),zh(t)}var Uu=null;function zh(t){if(Uu=null,t=qi(t),t!==null){var r=o(t);if(r===null)t=null;else{var l=r.tag;if(l===13){if(t=u(r),t!==null)return t;t=null}else if(l===31){if(t=f(r),t!==null)return t;t=null}else if(l===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return Uu=t,null}function Nx(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ii()){case ae:return 2;case pe:return 8;case _e:case De:return 32;case $e:return 268435456;default:return 32}default:return 32}}var jh=!1,cr=null,fr=null,dr=null,cs=new Map,fs=new Map,hr=[],iE="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Cx(t,r){switch(t){case"focusin":case"focusout":cr=null;break;case"dragenter":case"dragleave":fr=null;break;case"mouseover":case"mouseout":dr=null;break;case"pointerover":case"pointerout":cs.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":fs.delete(r.pointerId)}}function ds(t,r,l,c,p,y){return t===null||t.nativeEvent!==y?(t={blockedOn:r,domEventName:l,eventSystemFlags:c,nativeEvent:y,targetContainers:[p]},r!==null&&(r=$i(r),r!==null&&kx(r)),t):(t.eventSystemFlags|=c,r=t.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),t)}function rE(t,r,l,c,p){switch(r){case"focusin":return cr=ds(cr,t,r,l,c,p),!0;case"dragenter":return fr=ds(fr,t,r,l,c,p),!0;case"mouseover":return dr=ds(dr,t,r,l,c,p),!0;case"pointerover":var y=p.pointerId;return cs.set(y,ds(cs.get(y)||null,t,r,l,c,p)),!0;case"gotpointercapture":return y=p.pointerId,fs.set(y,ds(fs.get(y)||null,t,r,l,c,p)),!0}return!1}function Mx(t){var r=qi(t.target);if(r!==null){var l=o(r);if(l!==null){if(r=l.tag,r===13){if(r=u(l),r!==null){t.blockedOn=r,Co(t.priority,function(){Ex(l)});return}}else if(r===31){if(r=f(l),r!==null){t.blockedOn=r,Co(t.priority,function(){Ex(l)});return}}else if(r===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Iu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var l=Ah(t.nativeEvent);if(l===null){l=t.nativeEvent;var c=new l.constructor(l.type,l);zf=c,l.target.dispatchEvent(c),zf=null}else return r=$i(l),r!==null&&kx(r),t.blockedOn=l,!1;r.shift()}return!0}function Tx(t,r,l){Iu(t)&&l.delete(r)}function aE(){jh=!1,cr!==null&&Iu(cr)&&(cr=null),fr!==null&&Iu(fr)&&(fr=null),dr!==null&&Iu(dr)&&(dr=null),cs.forEach(Tx),fs.forEach(Tx)}function qu(t,r){t.blockedOn===r&&(t.blockedOn=null,jh||(jh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,aE)))}var $u=null;function Ax(t){$u!==t&&($u=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){$u===t&&($u=null);for(var r=0;r<t.length;r+=3){var l=t[r],c=t[r+1],p=t[r+2];if(typeof c!="function"){if(zh(c||l)===null)continue;break}var y=$i(l);y!==null&&(t.splice(r,3),r-=3,Ad(y,{pending:!0,data:p,method:l.method,action:c},c,p))}}))}function Pa(t){function r(I){return qu(I,t)}cr!==null&&qu(cr,t),fr!==null&&qu(fr,t),dr!==null&&qu(dr,t),cs.forEach(r),fs.forEach(r);for(var l=0;l<hr.length;l++){var c=hr[l];c.blockedOn===t&&(c.blockedOn=null)}for(;0<hr.length&&(l=hr[0],l.blockedOn===null);)Mx(l),l.blockedOn===null&&hr.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(c=0;c<l.length;c+=3){var p=l[c],y=l[c+1],S=p[Bt]||null;if(typeof y=="function")S||Ax(l);else if(S){var M=null;if(y&&y.hasAttribute("formAction")){if(p=y,S=y[Bt]||null)M=S.formAction;else if(zh(p)!==null)continue}else M=S.action;typeof M=="function"?l[c+1]=M:(l.splice(c,3),c-=3),Ax(l)}}}function zx(){function t(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(S){return p=S})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),c||setTimeout(l,20)}function l(){if(!c&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(l,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function Dh(t){this._internalRoot=t}Vu.prototype.render=Dh.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(a(409));var l=r.current,c=mn();Sx(l,c,t,r,null,null)},Vu.prototype.unmount=Dh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;Sx(t.current,2,null,t,null,null),_u(),r[ci]=null}};function Vu(t){this._internalRoot=t}Vu.prototype.unstable_scheduleHydration=function(t){if(t){var r=No();t={blockedOn:null,target:t,priority:r};for(var l=0;l<hr.length&&r!==0&&r<hr[l].priority;l++);hr.splice(l,0,t),l===0&&Mx(t)}};var jx=n.version;if(jx!=="19.2.3")throw Error(a(527,jx,"19.2.3"));U.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=d(r),t=t!==null?g(t):null,t=t===null?null:t.stateNode,t};var lE={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pu.isDisabled&&Pu.supportsFiber)try{At=Pu.inject(lE),pt=Pu}catch{}}return ps.createRoot=function(t,r){if(!s(t))throw Error(a(299));var l=!1,c="",p=U0,y=I0,S=q0;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(y=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError)),r=vx(t,1,!1,null,null,l,c,null,p,y,S,zx),t[ci]=r.current,ph(t),new Dh(r)},ps.hydrateRoot=function(t,r,l){if(!s(t))throw Error(a(299));var c=!1,p="",y=U0,S=I0,M=q0,I=null;return l!=null&&(l.unstable_strictMode===!0&&(c=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(S=l.onCaughtError),l.onRecoverableError!==void 0&&(M=l.onRecoverableError),l.formState!==void 0&&(I=l.formState)),r=vx(t,1,!0,r,l??null,c,p,I,y,S,M,zx),r.context=wx(null),l=r.current,c=mn(),c=wl(c),p=Ji(c),p.callback=null,Wi(l,p,c),l=c,r.current.lanes=l,kr(r,l),Wn(r),t[ci]=r.current,ph(t),new Vu(r)},ps.version="19.2.3",ps}var $x;function mE(){if($x)return Lh.exports;$x=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Lh.exports=pE(),Lh.exports}var gE=mE();function _t(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let i=0,a;i<e.length;i++)(a=_t(e[i]))!==""&&(n+=(n&&" ")+a);else for(let i in e)e[i]&&(n+=(n&&" ")+i);return n}var yE={value:()=>{}};function Gc(){for(var e=0,n=arguments.length,i={},a;e<n;++e){if(!(a=arguments[e]+"")||a in i||/[\s.]/.test(a))throw new Error("illegal type: "+a);i[a]=[]}return new wc(i)}function wc(e){this._=e}function xE(e,n){return e.trim().split(/^|\s+/).map(function(i){var a="",s=i.indexOf(".");if(s>=0&&(a=i.slice(s+1),i=i.slice(0,s)),i&&!n.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:a}})}wc.prototype=Gc.prototype={constructor:wc,on:function(e,n){var i=this._,a=xE(e+"",i),s,o=-1,u=a.length;if(arguments.length<2){for(;++o<u;)if((s=(e=a[o]).type)&&(s=bE(i[s],e.name)))return s;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++o<u;)if(s=(e=a[o]).type)i[s]=Vx(i[s],e.name,n);else if(n==null)for(s in i)i[s]=Vx(i[s],e.name,null);return this},copy:function(){var e={},n=this._;for(var i in n)e[i]=n[i].slice();return new wc(e)},call:function(e,n){if((s=arguments.length-2)>0)for(var i=new Array(s),a=0,s,o;a<s;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],a=0,s=o.length;a<s;++a)o[a].value.apply(n,i)},apply:function(e,n,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var a=this._[e],s=0,o=a.length;s<o;++s)a[s].value.apply(n,i)}};function bE(e,n){for(var i=0,a=e.length,s;i<a;++i)if((s=e[i]).name===n)return s.value}function Vx(e,n,i){for(var a=0,s=e.length;a<s;++a)if(e[a].name===n){e[a]=yE,e=e.slice(0,a).concat(e.slice(a+1));break}return i!=null&&e.push({name:n,value:i}),e}var Ep="http://www.w3.org/1999/xhtml";const Px={svg:"http://www.w3.org/2000/svg",xhtml:Ep,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Zc(e){var n=e+="",i=n.indexOf(":");return i>=0&&(n=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),Px.hasOwnProperty(n)?{space:Px[n],local:e}:e}function vE(e){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===Ep&&n.documentElement.namespaceURI===Ep?n.createElement(e):n.createElementNS(i,e)}}function wE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mv(e){var n=Zc(e);return(n.local?wE:vE)(n)}function SE(){}function am(e){return e==null?SE:function(){return this.querySelector(e)}}function _E(e){typeof e!="function"&&(e=am(e));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s<i;++s)for(var o=n[s],u=o.length,f=a[s]=new Array(u),h,d,g=0;g<u;++g)(h=o[g])&&(d=e.call(h,h.__data__,g,o))&&("__data__"in h&&(d.__data__=h.__data__),f[g]=d);return new Sn(a,this._parents)}function kE(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function EE(){return[]}function gv(e){return e==null?EE:function(){return this.querySelectorAll(e)}}function NE(e){return function(){return kE(e.apply(this,arguments))}}function CE(e){typeof e=="function"?e=NE(e):e=gv(e);for(var n=this._groups,i=n.length,a=[],s=[],o=0;o<i;++o)for(var u=n[o],f=u.length,h,d=0;d<f;++d)(h=u[d])&&(a.push(e.call(h,h.__data__,d,u)),s.push(h));return new Sn(a,s)}function yv(e){return function(){return this.matches(e)}}function xv(e){return function(n){return n.matches(e)}}var ME=Array.prototype.find;function TE(e){return function(){return ME.call(this.children,e)}}function AE(){return this.firstElementChild}function zE(e){return this.select(e==null?AE:TE(typeof e=="function"?e:xv(e)))}var jE=Array.prototype.filter;function DE(){return Array.from(this.children)}function RE(e){return function(){return jE.call(this.children,e)}}function OE(e){return this.selectAll(e==null?DE:RE(typeof e=="function"?e:xv(e)))}function LE(e){typeof e!="function"&&(e=yv(e));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s<i;++s)for(var o=n[s],u=o.length,f=a[s]=[],h,d=0;d<u;++d)(h=o[d])&&e.call(h,h.__data__,d,o)&&f.push(h);return new Sn(a,this._parents)}function bv(e){return new Array(e.length)}function HE(){return new Sn(this._enter||this._groups.map(bv),this._parents)}function Tc(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Tc.prototype={constructor:Tc,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function BE(e){return function(){return e}}function UE(e,n,i,a,s,o){for(var u=0,f,h=n.length,d=o.length;u<d;++u)(f=n[u])?(f.__data__=o[u],a[u]=f):i[u]=new Tc(e,o[u]);for(;u<h;++u)(f=n[u])&&(s[u]=f)}function IE(e,n,i,a,s,o,u){var f,h,d=new Map,g=n.length,m=o.length,x=new Array(g),b;for(f=0;f<g;++f)(h=n[f])&&(x[f]=b=u.call(h,h.__data__,f,n)+"",d.has(b)?s[f]=h:d.set(b,h));for(f=0;f<m;++f)b=u.call(e,o[f],f,o)+"",(h=d.get(b))?(a[f]=h,h.__data__=o[f],d.delete(b)):i[f]=new Tc(e,o[f]);for(f=0;f<g;++f)(h=n[f])&&d.get(x[f])===h&&(s[f]=h)}function qE(e){return e.__data__}function $E(e,n){if(!arguments.length)return Array.from(this,qE);var i=n?IE:UE,a=this._parents,s=this._groups;typeof e!="function"&&(e=BE(e));for(var o=s.length,u=new Array(o),f=new Array(o),h=new Array(o),d=0;d<o;++d){var g=a[d],m=s[d],x=m.length,b=VE(e.call(g,g&&g.__data__,d,a)),w=b.length,E=f[d]=new Array(w),N=u[d]=new Array(w),_=h[d]=new Array(x);i(g,m,E,N,_,b,n);for(var D=0,k=0,C,L;D<w;++D)if(C=E[D]){for(D>=k&&(k=D+1);!(L=N[k])&&++k<w;);C._next=L||null}}return u=new Sn(u,a),u._enter=f,u._exit=h,u}function VE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function PE(){return new Sn(this._exit||this._groups.map(bv),this._parents)}function YE(e,n,i){var a=this.enter(),s=this,o=this.exit();return typeof e=="function"?(a=e(a),a&&(a=a.selection())):a=a.append(e+""),n!=null&&(s=n(s),s&&(s=s.selection())),i==null?o.remove():i(o),a&&s?a.merge(s).order():s}function XE(e){for(var n=e.selection?e.selection():e,i=this._groups,a=n._groups,s=i.length,o=a.length,u=Math.min(s,o),f=new Array(s),h=0;h<u;++h)for(var d=i[h],g=a[h],m=d.length,x=f[h]=new Array(m),b,w=0;w<m;++w)(b=d[w]||g[w])&&(x[w]=b);for(;h<s;++h)f[h]=i[h];return new Sn(f,this._parents)}function FE(){for(var e=this._groups,n=-1,i=e.length;++n<i;)for(var a=e[n],s=a.length-1,o=a[s],u;--s>=0;)(u=a[s])&&(o&&u.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(u,o),o=u);return this}function GE(e){e||(e=ZE);function n(m,x){return m&&x?e(m.__data__,x.__data__):!m-!x}for(var i=this._groups,a=i.length,s=new Array(a),o=0;o<a;++o){for(var u=i[o],f=u.length,h=s[o]=new Array(f),d,g=0;g<f;++g)(d=u[g])&&(h[g]=d);h.sort(n)}return new Sn(s,this._parents).order()}function ZE(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function QE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function KE(){return Array.from(this)}function JE(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var a=e[n],s=0,o=a.length;s<o;++s){var u=a[s];if(u)return u}return null}function WE(){let e=0;for(const n of this)++e;return e}function eN(){return!this.node()}function tN(e){for(var n=this._groups,i=0,a=n.length;i<a;++i)for(var s=n[i],o=0,u=s.length,f;o<u;++o)(f=s[o])&&e.call(f,f.__data__,o,s);return this}function nN(e){return function(){this.removeAttribute(e)}}function iN(e){return function(){this.removeAttributeNS(e.space,e.local)}}function rN(e,n){return function(){this.setAttribute(e,n)}}function aN(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function lN(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function sN(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function oN(e,n){var i=Zc(e);if(arguments.length<2){var a=this.node();return i.local?a.getAttributeNS(i.space,i.local):a.getAttribute(i)}return this.each((n==null?i.local?iN:nN:typeof n=="function"?i.local?sN:lN:i.local?aN:rN)(i,n))}function vv(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function uN(e){return function(){this.style.removeProperty(e)}}function cN(e,n,i){return function(){this.style.setProperty(e,n,i)}}function fN(e,n,i){return function(){var a=n.apply(this,arguments);a==null?this.style.removeProperty(e):this.style.setProperty(e,a,i)}}function dN(e,n,i){return arguments.length>1?this.each((n==null?uN:typeof n=="function"?fN:cN)(e,n,i??"")):sl(this.node(),e)}function sl(e,n){return e.style.getPropertyValue(n)||vv(e).getComputedStyle(e,null).getPropertyValue(n)}function hN(e){return function(){delete this[e]}}function pN(e,n){return function(){this[e]=n}}function mN(e,n){return function(){var i=n.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function gN(e,n){return arguments.length>1?this.each((n==null?hN:typeof n=="function"?mN:pN)(e,n)):this.node()[e]}function wv(e){return e.trim().split(/^|\s+/)}function lm(e){return e.classList||new Sv(e)}function Sv(e){this._node=e,this._names=wv(e.getAttribute("class")||"")}Sv.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function _v(e,n){for(var i=lm(e),a=-1,s=n.length;++a<s;)i.add(n[a])}function kv(e,n){for(var i=lm(e),a=-1,s=n.length;++a<s;)i.remove(n[a])}function yN(e){return function(){_v(this,e)}}function xN(e){return function(){kv(this,e)}}function bN(e,n){return function(){(n.apply(this,arguments)?_v:kv)(this,e)}}function vN(e,n){var i=wv(e+"");if(arguments.length<2){for(var a=lm(this.node()),s=-1,o=i.length;++s<o;)if(!a.contains(i[s]))return!1;return!0}return this.each((typeof n=="function"?bN:n?yN:xN)(i,n))}function wN(){this.textContent=""}function SN(e){return function(){this.textContent=e}}function _N(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function kN(e){return arguments.length?this.each(e==null?wN:(typeof e=="function"?_N:SN)(e)):this.node().textContent}function EN(){this.innerHTML=""}function NN(e){return function(){this.innerHTML=e}}function CN(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function MN(e){return arguments.length?this.each(e==null?EN:(typeof e=="function"?CN:NN)(e)):this.node().innerHTML}function TN(){this.nextSibling&&this.parentNode.appendChild(this)}function AN(){return this.each(TN)}function zN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function jN(){return this.each(zN)}function DN(e){var n=typeof e=="function"?e:mv(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function RN(){return null}function ON(e,n){var i=typeof e=="function"?e:mv(e),a=n==null?RN:typeof n=="function"?n:am(n);return this.select(function(){return this.insertBefore(i.apply(this,arguments),a.apply(this,arguments)||null)})}function LN(){var e=this.parentNode;e&&e.removeChild(this)}function HN(){return this.each(LN)}function BN(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function UN(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function IN(e){return this.select(e?UN:BN)}function qN(e){return arguments.length?this.property("__data__",e):this.node().__data__}function $N(e){return function(n){e.call(this,n,this.__data__)}}function VN(e){return e.trim().split(/^|\s+/).map(function(n){var i="",a=n.indexOf(".");return a>=0&&(i=n.slice(a+1),n=n.slice(0,a)),{type:n,name:i}})}function PN(e){return function(){var n=this.__on;if(n){for(var i=0,a=-1,s=n.length,o;i<s;++i)o=n[i],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):n[++a]=o;++a?n.length=a:delete this.__on}}}function YN(e,n,i){return function(){var a=this.__on,s,o=$N(n);if(a){for(var u=0,f=a.length;u<f;++u)if((s=a[u]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=i),s.value=n;return}}this.addEventListener(e.type,o,i),s={type:e.type,name:e.name,value:n,listener:o,options:i},a?a.push(s):this.__on=[s]}}function XN(e,n,i){var a=VN(e+""),s,o=a.length,u;if(arguments.length<2){var f=this.node().__on;if(f){for(var h=0,d=f.length,g;h<d;++h)for(s=0,g=f[h];s<o;++s)if((u=a[s]).type===g.type&&u.name===g.name)return g.value}return}for(f=n?YN:PN,s=0;s<o;++s)this.each(f(a[s],n,i));return this}function Ev(e,n,i){var a=vv(e),s=a.CustomEvent;typeof s=="function"?s=new s(n,i):(s=a.document.createEvent("Event"),i?(s.initEvent(n,i.bubbles,i.cancelable),s.detail=i.detail):s.initEvent(n,!1,!1)),e.dispatchEvent(s)}function FN(e,n){return function(){return Ev(this,e,n)}}function GN(e,n){return function(){return Ev(this,e,n.apply(this,arguments))}}function ZN(e,n){return this.each((typeof n=="function"?GN:FN)(e,n))}function*QN(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var a=e[n],s=0,o=a.length,u;s<o;++s)(u=a[s])&&(yield u)}var Nv=[null];function Sn(e,n){this._groups=e,this._parents=n}function lo(){return new Sn([[document.documentElement]],Nv)}function KN(){return this}Sn.prototype=lo.prototype={constructor:Sn,select:_E,selectAll:CE,selectChild:zE,selectChildren:OE,filter:LE,data:$E,enter:HE,exit:PE,join:YE,merge:XE,selection:KN,order:FE,sort:GE,call:QE,nodes:KE,node:JE,size:WE,empty:eN,each:tN,attr:oN,style:dN,property:gN,classed:vN,text:kN,html:MN,raise:AN,lower:jN,append:DN,insert:ON,remove:HN,clone:IN,datum:qN,on:XN,dispatch:ZN,[Symbol.iterator]:QN};function vn(e){return typeof e=="string"?new Sn([[document.querySelector(e)]],[document.documentElement]):new Sn([[e]],Nv)}function JN(e){let n;for(;n=e.sourceEvent;)e=n;return e}function In(e,n){if(e=JN(e),n===void 0&&(n=e.currentTarget),n){var i=n.ownerSVGElement||n;if(i.createSVGPoint){var a=i.createSVGPoint();return a.x=e.clientX,a.y=e.clientY,a=a.matrixTransform(n.getScreenCTM().inverse()),[a.x,a.y]}if(n.getBoundingClientRect){var s=n.getBoundingClientRect();return[e.clientX-s.left-n.clientLeft,e.clientY-s.top-n.clientTop]}}return[e.pageX,e.pageY]}const WN={passive:!1},Xs={capture:!0,passive:!1};function Ih(e){e.stopImmediatePropagation()}function tl(e){e.preventDefault(),e.stopImmediatePropagation()}function Cv(e){var n=e.document.documentElement,i=vn(e).on("dragstart.drag",tl,Xs);"onselectstart"in n?i.on("selectstart.drag",tl,Xs):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Mv(e,n){var i=e.document.documentElement,a=vn(e).on("dragstart.drag",null);n&&(a.on("click.drag",tl,Xs),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in i?a.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Yu=e=>()=>e;function Np(e,{sourceEvent:n,subject:i,target:a,identifier:s,active:o,x:u,y:f,dx:h,dy:d,dispatch:g}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:g}})}Np.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function eC(e){return!e.ctrlKey&&!e.button}function tC(){return this.parentNode}function nC(e,n){return n??{x:e.x,y:e.y}}function iC(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tv(){var e=eC,n=tC,i=nC,a=iC,s={},o=Gc("start","drag","end"),u=0,f,h,d,g,m=0;function x(C){C.on("mousedown.drag",b).filter(a).on("touchstart.drag",N).on("touchmove.drag",_,WN).on("touchend.drag touchcancel.drag",D).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(C,L){if(!(g||!e.call(this,C,L))){var A=k(this,n.call(this,C,L),C,L,"mouse");A&&(vn(C.view).on("mousemove.drag",w,Xs).on("mouseup.drag",E,Xs),Cv(C.view),Ih(C),d=!1,f=C.clientX,h=C.clientY,A("start",C))}}function w(C){if(tl(C),!d){var L=C.clientX-f,A=C.clientY-h;d=L*L+A*A>m}s.mouse("drag",C)}function E(C){vn(C.view).on("mousemove.drag mouseup.drag",null),Mv(C.view,d),tl(C),s.mouse("end",C)}function N(C,L){if(e.call(this,C,L)){var A=C.changedTouches,H=n.call(this,C,L),F=A.length,G,q;for(G=0;G<F;++G)(q=k(this,H,C,L,A[G].identifier,A[G]))&&(Ih(C),q("start",C,A[G]))}}function _(C){var L=C.changedTouches,A=L.length,H,F;for(H=0;H<A;++H)(F=s[L[H].identifier])&&(tl(C),F("drag",C,L[H]))}function D(C){var L=C.changedTouches,A=L.length,H,F;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),H=0;H<A;++H)(F=s[L[H].identifier])&&(Ih(C),F("end",C,L[H]))}function k(C,L,A,H,F,G){var q=o.copy(),V=In(G||A,L),P,te,O;if((O=i.call(C,new Np("beforestart",{sourceEvent:A,target:x,identifier:F,active:u,x:V[0],y:V[1],dx:0,dy:0,dispatch:q}),H))!=null)return P=O.x-V[0]||0,te=O.y-V[1]||0,function B(j,U,Y){var K=V,z;switch(j){case"start":s[F]=B,z=u++;break;case"end":delete s[F],--u;case"drag":V=In(Y||U,L),z=u;break}q.call(j,C,new Np(j,{sourceEvent:U,subject:O,target:x,identifier:F,active:z,x:V[0]+P,y:V[1]+te,dx:V[0]-K[0],dy:V[1]-K[1],dispatch:q}),H)}}return x.filter=function(C){return arguments.length?(e=typeof C=="function"?C:Yu(!!C),x):e},x.container=function(C){return arguments.length?(n=typeof C=="function"?C:Yu(C),x):n},x.subject=function(C){return arguments.length?(i=typeof C=="function"?C:Yu(C),x):i},x.touchable=function(C){return arguments.length?(a=typeof C=="function"?C:Yu(!!C),x):a},x.on=function(){var C=o.on.apply(o,arguments);return C===o?x:C},x.clickDistance=function(C){return arguments.length?(m=(C=+C)*C,x):Math.sqrt(m)},x}function sm(e,n,i){e.prototype=n.prototype=i,i.constructor=e}function Av(e,n){var i=Object.create(e.prototype);for(var a in n)i[a]=n[a];return i}function so(){}var Fs=.7,Ac=1/Fs,nl="\\s*([+-]?\\d+)\\s*",Gs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ii="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rC=/^#([0-9a-f]{3,8})$/,aC=new RegExp(`^rgb\\(${nl},${nl},${nl}\\)$`),lC=new RegExp(`^rgb\\(${ii},${ii},${ii}\\)$`),sC=new RegExp(`^rgba\\(${nl},${nl},${nl},${Gs}\\)$`),oC=new RegExp(`^rgba\\(${ii},${ii},${ii},${Gs}\\)$`),uC=new RegExp(`^hsl\\(${Gs},${ii},${ii}\\)$`),cC=new RegExp(`^hsla\\(${Gs},${ii},${ii},${Gs}\\)$`),Yx={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};sm(so,Wr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Xx,formatHex:Xx,formatHex8:fC,formatHsl:dC,formatRgb:Fx,toString:Fx});function Xx(){return this.rgb().formatHex()}function fC(){return this.rgb().formatHex8()}function dC(){return zv(this).formatHsl()}function Fx(){return this.rgb().formatRgb()}function Wr(e){var n,i;return e=(e+"").trim().toLowerCase(),(n=rC.exec(e))?(i=n[1].length,n=parseInt(n[1],16),i===6?Gx(n):i===3?new an(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):i===8?Xu(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):i===4?Xu(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=aC.exec(e))?new an(n[1],n[2],n[3],1):(n=lC.exec(e))?new an(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=sC.exec(e))?Xu(n[1],n[2],n[3],n[4]):(n=oC.exec(e))?Xu(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=uC.exec(e))?Kx(n[1],n[2]/100,n[3]/100,1):(n=cC.exec(e))?Kx(n[1],n[2]/100,n[3]/100,n[4]):Yx.hasOwnProperty(e)?Gx(Yx[e]):e==="transparent"?new an(NaN,NaN,NaN,0):null}function Gx(e){return new an(e>>16&255,e>>8&255,e&255,1)}function Xu(e,n,i,a){return a<=0&&(e=n=i=NaN),new an(e,n,i,a)}function hC(e){return e instanceof so||(e=Wr(e)),e?(e=e.rgb(),new an(e.r,e.g,e.b,e.opacity)):new an}function Cp(e,n,i,a){return arguments.length===1?hC(e):new an(e,n,i,a??1)}function an(e,n,i,a){this.r=+e,this.g=+n,this.b=+i,this.opacity=+a}sm(an,Cp,Av(so,{brighter(e){return e=e==null?Ac:Math.pow(Ac,e),new an(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Fs:Math.pow(Fs,e),new an(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new an(Kr(this.r),Kr(this.g),Kr(this.b),zc(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Zx,formatHex:Zx,formatHex8:pC,formatRgb:Qx,toString:Qx}));function Zx(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}`}function pC(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}${Qr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Qx(){const e=zc(this.opacity);return`${e===1?"rgb(":"rgba("}${Kr(this.r)}, ${Kr(this.g)}, ${Kr(this.b)}${e===1?")":`, ${e})`}`}function zc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Kr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qr(e){return e=Kr(e),(e<16?"0":"")+e.toString(16)}function Kx(e,n,i,a){return a<=0?e=n=i=NaN:i<=0||i>=1?e=n=NaN:n<=0&&(e=NaN),new qn(e,n,i,a)}function zv(e){if(e instanceof qn)return new qn(e.h,e.s,e.l,e.opacity);if(e instanceof so||(e=Wr(e)),!e)return new qn;if(e instanceof qn)return e;e=e.rgb();var n=e.r/255,i=e.g/255,a=e.b/255,s=Math.min(n,i,a),o=Math.max(n,i,a),u=NaN,f=o-s,h=(o+s)/2;return f?(n===o?u=(i-a)/f+(i<a)*6:i===o?u=(a-n)/f+2:u=(n-i)/f+4,f/=h<.5?o+s:2-o-s,u*=60):f=h>0&&h<1?0:u,new qn(u,f,h,e.opacity)}function mC(e,n,i,a){return arguments.length===1?zv(e):new qn(e,n,i,a??1)}function qn(e,n,i,a){this.h=+e,this.s=+n,this.l=+i,this.opacity=+a}sm(qn,mC,Av(so,{brighter(e){return e=e==null?Ac:Math.pow(Ac,e),new qn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Fs:Math.pow(Fs,e),new qn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,a=i+(i<.5?i:1-i)*n,s=2*i-a;return new an(qh(e>=240?e-240:e+120,s,a),qh(e,s,a),qh(e<120?e+240:e-120,s,a),this.opacity)},clamp(){return new qn(Jx(this.h),Fu(this.s),Fu(this.l),zc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=zc(this.opacity);return`${e===1?"hsl(":"hsla("}${Jx(this.h)}, ${Fu(this.s)*100}%, ${Fu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Jx(e){return e=(e||0)%360,e<0?e+360:e}function Fu(e){return Math.max(0,Math.min(1,e||0))}function qh(e,n,i){return(e<60?n+(i-n)*e/60:e<180?i:e<240?n+(i-n)*(240-e)/60:n)*255}const om=e=>()=>e;function gC(e,n){return function(i){return e+i*n}}function yC(e,n,i){return e=Math.pow(e,i),n=Math.pow(n,i)-e,i=1/i,function(a){return Math.pow(e+a*n,i)}}function xC(e){return(e=+e)==1?jv:function(n,i){return i-n?yC(n,i,e):om(isNaN(n)?i:n)}}function jv(e,n){var i=n-e;return i?gC(e,i):om(isNaN(e)?n:e)}const jc=(function e(n){var i=xC(n);function a(s,o){var u=i((s=Cp(s)).r,(o=Cp(o)).r),f=i(s.g,o.g),h=i(s.b,o.b),d=jv(s.opacity,o.opacity);return function(g){return s.r=u(g),s.g=f(g),s.b=h(g),s.opacity=d(g),s+""}}return a.gamma=e,a})(1);function bC(e,n){n||(n=[]);var i=e?Math.min(n.length,e.length):0,a=n.slice(),s;return function(o){for(s=0;s<i;++s)a[s]=e[s]*(1-o)+n[s]*o;return a}}function vC(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function wC(e,n){var i=n?n.length:0,a=e?Math.min(i,e.length):0,s=new Array(a),o=new Array(i),u;for(u=0;u<a;++u)s[u]=qs(e[u],n[u]);for(;u<i;++u)o[u]=n[u];return function(f){for(u=0;u<a;++u)o[u]=s[u](f);return o}}function SC(e,n){var i=new Date;return e=+e,n=+n,function(a){return i.setTime(e*(1-a)+n*a),i}}function ti(e,n){return e=+e,n=+n,function(i){return e*(1-i)+n*i}}function _C(e,n){var i={},a={},s;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(s in n)s in e?i[s]=qs(e[s],n[s]):a[s]=n[s];return function(o){for(s in i)a[s]=i[s](o);return a}}var Mp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$h=new RegExp(Mp.source,"g");function kC(e){return function(){return e}}function EC(e){return function(n){return e(n)+""}}function Dv(e,n){var i=Mp.lastIndex=$h.lastIndex=0,a,s,o,u=-1,f=[],h=[];for(e=e+"",n=n+"";(a=Mp.exec(e))&&(s=$h.exec(n));)(o=s.index)>i&&(o=n.slice(i,o),f[u]?f[u]+=o:f[++u]=o),(a=a[0])===(s=s[0])?f[u]?f[u]+=s:f[++u]=s:(f[++u]=null,h.push({i:u,x:ti(a,s)})),i=$h.lastIndex;return i<n.length&&(o=n.slice(i),f[u]?f[u]+=o:f[++u]=o),f.length<2?h[0]?EC(h[0].x):kC(n):(n=h.length,function(d){for(var g=0,m;g<n;++g)f[(m=h[g]).i]=m.x(d);return f.join("")})}function qs(e,n){var i=typeof n,a;return n==null||i==="boolean"?om(n):(i==="number"?ti:i==="string"?(a=Wr(n))?(n=a,jc):Dv:n instanceof Wr?jc:n instanceof Date?SC:vC(n)?bC:Array.isArray(n)?wC:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?_C:ti)(e,n)}var Wx=180/Math.PI,Tp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Rv(e,n,i,a,s,o){var u,f,h;return(u=Math.sqrt(e*e+n*n))&&(e/=u,n/=u),(h=e*i+n*a)&&(i-=e*h,a-=n*h),(f=Math.sqrt(i*i+a*a))&&(i/=f,a/=f,h/=f),e*a<n*i&&(e=-e,n=-n,h=-h,u=-u),{translateX:s,translateY:o,rotate:Math.atan2(n,e)*Wx,skewX:Math.atan(h)*Wx,scaleX:u,scaleY:f}}var Gu;function NC(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Tp:Rv(n.a,n.b,n.c,n.d,n.e,n.f)}function CC(e){return e==null||(Gu||(Gu=document.createElementNS("http://www.w3.org/2000/svg","g")),Gu.setAttribute("transform",e),!(e=Gu.transform.baseVal.consolidate()))?Tp:(e=e.matrix,Rv(e.a,e.b,e.c,e.d,e.e,e.f))}function Ov(e,n,i,a){function s(d){return d.length?d.pop()+" ":""}function o(d,g,m,x,b,w){if(d!==m||g!==x){var E=b.push("translate(",null,n,null,i);w.push({i:E-4,x:ti(d,m)},{i:E-2,x:ti(g,x)})}else(m||x)&&b.push("translate("+m+n+x+i)}function u(d,g,m,x){d!==g?(d-g>180?g+=360:g-d>180&&(d+=360),x.push({i:m.push(s(m)+"rotate(",null,a)-2,x:ti(d,g)})):g&&m.push(s(m)+"rotate("+g+a)}function f(d,g,m,x){d!==g?x.push({i:m.push(s(m)+"skewX(",null,a)-2,x:ti(d,g)}):g&&m.push(s(m)+"skewX("+g+a)}function h(d,g,m,x,b,w){if(d!==m||g!==x){var E=b.push(s(b)+"scale(",null,",",null,")");w.push({i:E-4,x:ti(d,m)},{i:E-2,x:ti(g,x)})}else(m!==1||x!==1)&&b.push(s(b)+"scale("+m+","+x+")")}return function(d,g){var m=[],x=[];return d=e(d),g=e(g),o(d.translateX,d.translateY,g.translateX,g.translateY,m,x),u(d.rotate,g.rotate,m,x),f(d.skewX,g.skewX,m,x),h(d.scaleX,d.scaleY,g.scaleX,g.scaleY,m,x),d=g=null,function(b){for(var w=-1,E=x.length,N;++w<E;)m[(N=x[w]).i]=N.x(b);return m.join("")}}}var MC=Ov(NC,"px, ","px)","deg)"),TC=Ov(CC,", ",")",")"),AC=1e-12;function eb(e){return((e=Math.exp(e))+1/e)/2}function zC(e){return((e=Math.exp(e))-1/e)/2}function jC(e){return((e=Math.exp(2*e))-1)/(e+1)}const Sc=(function e(n,i,a){function s(o,u){var f=o[0],h=o[1],d=o[2],g=u[0],m=u[1],x=u[2],b=g-f,w=m-h,E=b*b+w*w,N,_;if(E<AC)_=Math.log(x/d)/n,N=function(H){return[f+H*b,h+H*w,d*Math.exp(n*H*_)]};else{var D=Math.sqrt(E),k=(x*x-d*d+a*E)/(2*d*i*D),C=(x*x-d*d-a*E)/(2*x*i*D),L=Math.log(Math.sqrt(k*k+1)-k),A=Math.log(Math.sqrt(C*C+1)-C);_=(A-L)/n,N=function(H){var F=H*_,G=eb(L),q=d/(i*D)*(G*jC(n*F+L)-zC(L));return[f+q*b,h+q*w,d*G/eb(n*F+L)]}}return N.duration=_*1e3*n/Math.SQRT2,N}return s.rho=function(o){var u=Math.max(.001,+o),f=u*u,h=f*f;return e(u,f,h)},s})(Math.SQRT2,2,4);var ol=0,Hs=0,ms=0,Lv=1e3,Dc,Bs,Rc=0,ea=0,Qc=0,Zs=typeof performance=="object"&&performance.now?performance:Date,Hv=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function um(){return ea||(Hv(DC),ea=Zs.now()+Qc)}function DC(){ea=0}function Oc(){this._call=this._time=this._next=null}Oc.prototype=Bv.prototype={constructor:Oc,restart:function(e,n,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?um():+i)+(n==null?0:+n),!this._next&&Bs!==this&&(Bs?Bs._next=this:Dc=this,Bs=this),this._call=e,this._time=i,Ap()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ap())}};function Bv(e,n,i){var a=new Oc;return a.restart(e,n,i),a}function RC(){um(),++ol;for(var e=Dc,n;e;)(n=ea-e._time)>=0&&e._call.call(void 0,n),e=e._next;--ol}function tb(){ea=(Rc=Zs.now())+Qc,ol=Hs=0;try{RC()}finally{ol=0,LC(),ea=0}}function OC(){var e=Zs.now(),n=e-Rc;n>Lv&&(Qc-=n,Rc=e)}function LC(){for(var e,n=Dc,i,a=1/0;n;)n._call?(a>n._time&&(a=n._time),e=n,n=n._next):(i=n._next,n._next=null,n=e?e._next=i:Dc=i);Bs=e,Ap(a)}function Ap(e){if(!ol){Hs&&(Hs=clearTimeout(Hs));var n=e-ea;n>24?(e<1/0&&(Hs=setTimeout(tb,e-Zs.now()-Qc)),ms&&(ms=clearInterval(ms))):(ms||(Rc=Zs.now(),ms=setInterval(OC,Lv)),ol=1,Hv(tb))}}function nb(e,n,i){var a=new Oc;return n=n==null?0:+n,a.restart(s=>{a.stop(),e(s+n)},n,i),a}var HC=Gc("start","end","cancel","interrupt"),BC=[],Uv=0,ib=1,zp=2,_c=3,rb=4,jp=5,kc=6;function Kc(e,n,i,a,s,o){var u=e.__transition;if(!u)e.__transition={};else if(i in u)return;UC(e,i,{name:n,index:a,group:s,on:HC,tween:BC,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Uv})}function cm(e,n){var i=Xn(e,n);if(i.state>Uv)throw new Error("too late; already scheduled");return i}function ai(e,n){var i=Xn(e,n);if(i.state>_c)throw new Error("too late; already running");return i}function Xn(e,n){var i=e.__transition;if(!i||!(i=i[n]))throw new Error("transition not found");return i}function UC(e,n,i){var a=e.__transition,s;a[n]=i,i.timer=Bv(o,0,i.time);function o(d){i.state=ib,i.timer.restart(u,i.delay,i.time),i.delay<=d&&u(d-i.delay)}function u(d){var g,m,x,b;if(i.state!==ib)return h();for(g in a)if(b=a[g],b.name===i.name){if(b.state===_c)return nb(u);b.state===rb?(b.state=kc,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete a[g]):+g<n&&(b.state=kc,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete a[g])}if(nb(function(){i.state===_c&&(i.state=rb,i.timer.restart(f,i.delay,i.time),f(d))}),i.state=zp,i.on.call("start",e,e.__data__,i.index,i.group),i.state===zp){for(i.state=_c,s=new Array(x=i.tween.length),g=0,m=-1;g<x;++g)(b=i.tween[g].value.call(e,e.__data__,i.index,i.group))&&(s[++m]=b);s.length=m+1}}function f(d){for(var g=d<i.duration?i.ease.call(null,d/i.duration):(i.timer.restart(h),i.state=jp,1),m=-1,x=s.length;++m<x;)s[m].call(e,g);i.state===jp&&(i.on.call("end",e,e.__data__,i.index,i.group),h())}function h(){i.state=kc,i.timer.stop(),delete a[n];for(var d in a)return;delete e.__transition}}function Ec(e,n){var i=e.__transition,a,s,o=!0,u;if(i){n=n==null?null:n+"";for(u in i){if((a=i[u]).name!==n){o=!1;continue}s=a.state>zp&&a.state<jp,a.state=kc,a.timer.stop(),a.on.call(s?"interrupt":"cancel",e,e.__data__,a.index,a.group),delete i[u]}o&&delete e.__transition}}function IC(e){return this.each(function(){Ec(this,e)})}function qC(e,n){var i,a;return function(){var s=ai(this,e),o=s.tween;if(o!==i){a=i=o;for(var u=0,f=a.length;u<f;++u)if(a[u].name===n){a=a.slice(),a.splice(u,1);break}}s.tween=a}}function $C(e,n,i){var a,s;if(typeof i!="function")throw new Error;return function(){var o=ai(this,e),u=o.tween;if(u!==a){s=(a=u).slice();for(var f={name:n,value:i},h=0,d=s.length;h<d;++h)if(s[h].name===n){s[h]=f;break}h===d&&s.push(f)}o.tween=s}}function VC(e,n){var i=this._id;if(e+="",arguments.length<2){for(var a=Xn(this.node(),i).tween,s=0,o=a.length,u;s<o;++s)if((u=a[s]).name===e)return u.value;return null}return this.each((n==null?qC:$C)(i,e,n))}function fm(e,n,i){var a=e._id;return e.each(function(){var s=ai(this,a);(s.value||(s.value={}))[n]=i.apply(this,arguments)}),function(s){return Xn(s,a).value[n]}}function Iv(e,n){var i;return(typeof n=="number"?ti:n instanceof Wr?jc:(i=Wr(n))?(n=i,jc):Dv)(e,n)}function PC(e){return function(){this.removeAttribute(e)}}function YC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function XC(e,n,i){var a,s=i+"",o;return function(){var u=this.getAttribute(e);return u===s?null:u===a?o:o=n(a=u,i)}}function FC(e,n,i){var a,s=i+"",o;return function(){var u=this.getAttributeNS(e.space,e.local);return u===s?null:u===a?o:o=n(a=u,i)}}function GC(e,n,i){var a,s,o;return function(){var u,f=i(this),h;return f==null?void this.removeAttribute(e):(u=this.getAttribute(e),h=f+"",u===h?null:u===a&&h===s?o:(s=h,o=n(a=u,f)))}}function ZC(e,n,i){var a,s,o;return function(){var u,f=i(this),h;return f==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),h=f+"",u===h?null:u===a&&h===s?o:(s=h,o=n(a=u,f)))}}function QC(e,n){var i=Zc(e),a=i==="transform"?TC:Iv;return this.attrTween(e,typeof n=="function"?(i.local?ZC:GC)(i,a,fm(this,"attr."+e,n)):n==null?(i.local?YC:PC)(i):(i.local?FC:XC)(i,a,n))}function KC(e,n){return function(i){this.setAttribute(e,n.call(this,i))}}function JC(e,n){return function(i){this.setAttributeNS(e.space,e.local,n.call(this,i))}}function WC(e,n){var i,a;function s(){var o=n.apply(this,arguments);return o!==a&&(i=(a=o)&&JC(e,o)),i}return s._value=n,s}function e4(e,n){var i,a;function s(){var o=n.apply(this,arguments);return o!==a&&(i=(a=o)&&KC(e,o)),i}return s._value=n,s}function t4(e,n){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;var a=Zc(e);return this.tween(i,(a.local?WC:e4)(a,n))}function n4(e,n){return function(){cm(this,e).delay=+n.apply(this,arguments)}}function i4(e,n){return n=+n,function(){cm(this,e).delay=n}}function r4(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?n4:i4)(n,e)):Xn(this.node(),n).delay}function a4(e,n){return function(){ai(this,e).duration=+n.apply(this,arguments)}}function l4(e,n){return n=+n,function(){ai(this,e).duration=n}}function s4(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?a4:l4)(n,e)):Xn(this.node(),n).duration}function o4(e,n){if(typeof n!="function")throw new Error;return function(){ai(this,e).ease=n}}function u4(e){var n=this._id;return arguments.length?this.each(o4(n,e)):Xn(this.node(),n).ease}function c4(e,n){return function(){var i=n.apply(this,arguments);if(typeof i!="function")throw new Error;ai(this,e).ease=i}}function f4(e){if(typeof e!="function")throw new Error;return this.each(c4(this._id,e))}function d4(e){typeof e!="function"&&(e=yv(e));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s<i;++s)for(var o=n[s],u=o.length,f=a[s]=[],h,d=0;d<u;++d)(h=o[d])&&e.call(h,h.__data__,d,o)&&f.push(h);return new Li(a,this._parents,this._name,this._id)}function h4(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,i=e._groups,a=n.length,s=i.length,o=Math.min(a,s),u=new Array(a),f=0;f<o;++f)for(var h=n[f],d=i[f],g=h.length,m=u[f]=new Array(g),x,b=0;b<g;++b)(x=h[b]||d[b])&&(m[b]=x);for(;f<a;++f)u[f]=n[f];return new Li(u,this._parents,this._name,this._id)}function p4(e){return(e+"").trim().split(/^|\s+/).every(function(n){var i=n.indexOf(".");return i>=0&&(n=n.slice(0,i)),!n||n==="start"})}function m4(e,n,i){var a,s,o=p4(n)?cm:ai;return function(){var u=o(this,e),f=u.on;f!==a&&(s=(a=f).copy()).on(n,i),u.on=s}}function g4(e,n){var i=this._id;return arguments.length<2?Xn(this.node(),i).on.on(e):this.each(m4(i,e,n))}function y4(e){return function(){var n=this.parentNode;for(var i in this.__transition)if(+i!==e)return;n&&n.removeChild(this)}}function x4(){return this.on("end.remove",y4(this._id))}function b4(e){var n=this._name,i=this._id;typeof e!="function"&&(e=am(e));for(var a=this._groups,s=a.length,o=new Array(s),u=0;u<s;++u)for(var f=a[u],h=f.length,d=o[u]=new Array(h),g,m,x=0;x<h;++x)(g=f[x])&&(m=e.call(g,g.__data__,x,f))&&("__data__"in g&&(m.__data__=g.__data__),d[x]=m,Kc(d[x],n,i,x,d,Xn(g,i)));return new Li(o,this._parents,n,i)}function v4(e){var n=this._name,i=this._id;typeof e!="function"&&(e=gv(e));for(var a=this._groups,s=a.length,o=[],u=[],f=0;f<s;++f)for(var h=a[f],d=h.length,g,m=0;m<d;++m)if(g=h[m]){for(var x=e.call(g,g.__data__,m,h),b,w=Xn(g,i),E=0,N=x.length;E<N;++E)(b=x[E])&&Kc(b,n,i,E,x,w);o.push(x),u.push(g)}return new Li(o,u,n,i)}var w4=lo.prototype.constructor;function S4(){return new w4(this._groups,this._parents)}function _4(e,n){var i,a,s;return function(){var o=sl(this,e),u=(this.style.removeProperty(e),sl(this,e));return o===u?null:o===i&&u===a?s:s=n(i=o,a=u)}}function qv(e){return function(){this.style.removeProperty(e)}}function k4(e,n,i){var a,s=i+"",o;return function(){var u=sl(this,e);return u===s?null:u===a?o:o=n(a=u,i)}}function E4(e,n,i){var a,s,o;return function(){var u=sl(this,e),f=i(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(e),sl(this,e))),u===h?null:u===a&&h===s?o:(s=h,o=n(a=u,f))}}function N4(e,n){var i,a,s,o="style."+n,u="end."+o,f;return function(){var h=ai(this,e),d=h.on,g=h.value[o]==null?f||(f=qv(n)):void 0;(d!==i||s!==g)&&(a=(i=d).copy()).on(u,s=g),h.on=a}}function C4(e,n,i){var a=(e+="")=="transform"?MC:Iv;return n==null?this.styleTween(e,_4(e,a)).on("end.style."+e,qv(e)):typeof n=="function"?this.styleTween(e,E4(e,a,fm(this,"style."+e,n))).each(N4(this._id,e)):this.styleTween(e,k4(e,a,n),i).on("end.style."+e,null)}function M4(e,n,i){return function(a){this.style.setProperty(e,n.call(this,a),i)}}function T4(e,n,i){var a,s;function o(){var u=n.apply(this,arguments);return u!==s&&(a=(s=u)&&M4(e,u,i)),a}return o._value=n,o}function A4(e,n,i){var a="style."+(e+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(n==null)return this.tween(a,null);if(typeof n!="function")throw new Error;return this.tween(a,T4(e,n,i??""))}function z4(e){return function(){this.textContent=e}}function j4(e){return function(){var n=e(this);this.textContent=n??""}}function D4(e){return this.tween("text",typeof e=="function"?j4(fm(this,"text",e)):z4(e==null?"":e+""))}function R4(e){return function(n){this.textContent=e.call(this,n)}}function O4(e){var n,i;function a(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&R4(s)),n}return a._value=e,a}function L4(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,O4(e))}function H4(){for(var e=this._name,n=this._id,i=$v(),a=this._groups,s=a.length,o=0;o<s;++o)for(var u=a[o],f=u.length,h,d=0;d<f;++d)if(h=u[d]){var g=Xn(h,n);Kc(h,e,i,d,u,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new Li(a,this._parents,e,i)}function B4(){var e,n,i=this,a=i._id,s=i.size();return new Promise(function(o,u){var f={value:u},h={value:function(){--s===0&&o()}};i.each(function(){var d=ai(this,a),g=d.on;g!==e&&(n=(e=g).copy(),n._.cancel.push(f),n._.interrupt.push(f),n._.end.push(h)),d.on=n}),s===0&&o()})}var U4=0;function Li(e,n,i,a){this._groups=e,this._parents=n,this._name=i,this._id=a}function $v(){return++U4}var Ai=lo.prototype;Li.prototype={constructor:Li,select:b4,selectAll:v4,selectChild:Ai.selectChild,selectChildren:Ai.selectChildren,filter:d4,merge:h4,selection:S4,transition:H4,call:Ai.call,nodes:Ai.nodes,node:Ai.node,size:Ai.size,empty:Ai.empty,each:Ai.each,on:g4,attr:QC,attrTween:t4,style:C4,styleTween:A4,text:D4,textTween:L4,remove:x4,tween:VC,delay:r4,duration:s4,ease:u4,easeVarying:f4,end:B4,[Symbol.iterator]:Ai[Symbol.iterator]};function I4(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var q4={time:null,delay:0,duration:250,ease:I4};function $4(e,n){for(var i;!(i=e.__transition)||!(i=i[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return i}function V4(e){var n,i;e instanceof Li?(n=e._id,e=e._name):(n=$v(),(i=q4).time=um(),e=e==null?null:e+"");for(var a=this._groups,s=a.length,o=0;o<s;++o)for(var u=a[o],f=u.length,h,d=0;d<f;++d)(h=u[d])&&Kc(h,e,n,d,u,i||$4(h,n));return new Li(a,this._parents,e,n)}lo.prototype.interrupt=IC;lo.prototype.transition=V4;const Zu=e=>()=>e;function P4(e,{sourceEvent:n,target:i,transform:a,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:s}})}function Ri(e,n,i){this.k=e,this.x=n,this.y=i}Ri.prototype={constructor:Ri,scale:function(e){return e===1?this:new Ri(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Ri(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Jc=new Ri(1,0,0);Vv.prototype=Ri.prototype;function Vv(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Jc;return e.__zoom}function Vh(e){e.stopImmediatePropagation()}function gs(e){e.preventDefault(),e.stopImmediatePropagation()}function Y4(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function X4(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function ab(){return this.__zoom||Jc}function F4(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function G4(){return navigator.maxTouchPoints||"ontouchstart"in this}function Z4(e,n,i){var a=e.invertX(n[0][0])-i[0][0],s=e.invertX(n[1][0])-i[1][0],o=e.invertY(n[0][1])-i[0][1],u=e.invertY(n[1][1])-i[1][1];return e.translate(s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s),u>o?(o+u)/2:Math.min(0,o)||Math.max(0,u))}function Pv(){var e=Y4,n=X4,i=Z4,a=F4,s=G4,o=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,h=Sc,d=Gc("start","zoom","end"),g,m,x,b=500,w=150,E=0,N=10;function _(O){O.property("__zoom",ab).on("wheel.zoom",F,{passive:!1}).on("mousedown.zoom",G).on("dblclick.zoom",q).filter(s).on("touchstart.zoom",V).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",te).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(O,B,j,U){var Y=O.selection?O.selection():O;Y.property("__zoom",ab),O!==Y?L(O,B,j,U):Y.interrupt().each(function(){A(this,arguments).event(U).start().zoom(null,typeof B=="function"?B.apply(this,arguments):B).end()})},_.scaleBy=function(O,B,j,U){_.scaleTo(O,function(){var Y=this.__zoom.k,K=typeof B=="function"?B.apply(this,arguments):B;return Y*K},j,U)},_.scaleTo=function(O,B,j,U){_.transform(O,function(){var Y=n.apply(this,arguments),K=this.__zoom,z=j==null?C(Y):typeof j=="function"?j.apply(this,arguments):j,R=K.invert(z),$=typeof B=="function"?B.apply(this,arguments):B;return i(k(D(K,$),z,R),Y,u)},j,U)},_.translateBy=function(O,B,j,U){_.transform(O,function(){return i(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof j=="function"?j.apply(this,arguments):j),n.apply(this,arguments),u)},null,U)},_.translateTo=function(O,B,j,U,Y){_.transform(O,function(){var K=n.apply(this,arguments),z=this.__zoom,R=U==null?C(K):typeof U=="function"?U.apply(this,arguments):U;return i(Jc.translate(R[0],R[1]).scale(z.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof j=="function"?-j.apply(this,arguments):-j),K,u)},U,Y)};function D(O,B){return B=Math.max(o[0],Math.min(o[1],B)),B===O.k?O:new Ri(B,O.x,O.y)}function k(O,B,j){var U=B[0]-j[0]*O.k,Y=B[1]-j[1]*O.k;return U===O.x&&Y===O.y?O:new Ri(O.k,U,Y)}function C(O){return[(+O[0][0]+ +O[1][0])/2,(+O[0][1]+ +O[1][1])/2]}function L(O,B,j,U){O.on("start.zoom",function(){A(this,arguments).event(U).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(U).end()}).tween("zoom",function(){var Y=this,K=arguments,z=A(Y,K).event(U),R=n.apply(Y,K),$=j==null?C(R):typeof j=="function"?j.apply(Y,K):j,T=Math.max(R[1][0]-R[0][0],R[1][1]-R[0][1]),ie=Y.__zoom,ce=typeof B=="function"?B.apply(Y,K):B,fe=h(ie.invert($).concat(T/ie.k),ce.invert($).concat(T/ce.k));return function(he){if(he===1)he=ce;else{var ue=fe(he),me=T/ue[2];he=new Ri(me,$[0]-ue[0]*me,$[1]-ue[1]*me)}z.zoom(null,he)}})}function A(O,B,j){return!j&&O.__zooming||new H(O,B)}function H(O,B){this.that=O,this.args=B,this.active=0,this.sourceEvent=null,this.extent=n.apply(O,B),this.taps=0}H.prototype={event:function(O){return O&&(this.sourceEvent=O),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(O,B){return this.mouse&&O!=="mouse"&&(this.mouse[1]=B.invert(this.mouse[0])),this.touch0&&O!=="touch"&&(this.touch0[1]=B.invert(this.touch0[0])),this.touch1&&O!=="touch"&&(this.touch1[1]=B.invert(this.touch1[0])),this.that.__zoom=B,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(O){var B=vn(this.that).datum();d.call(O,this.that,new P4(O,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:d}),B)}};function F(O,...B){if(!e.apply(this,arguments))return;var j=A(this,B).event(O),U=this.__zoom,Y=Math.max(o[0],Math.min(o[1],U.k*Math.pow(2,a.apply(this,arguments)))),K=In(O);if(j.wheel)(j.mouse[0][0]!==K[0]||j.mouse[0][1]!==K[1])&&(j.mouse[1]=U.invert(j.mouse[0]=K)),clearTimeout(j.wheel);else{if(U.k===Y)return;j.mouse=[K,U.invert(K)],Ec(this),j.start()}gs(O),j.wheel=setTimeout(z,w),j.zoom("mouse",i(k(D(U,Y),j.mouse[0],j.mouse[1]),j.extent,u));function z(){j.wheel=null,j.end()}}function G(O,...B){if(x||!e.apply(this,arguments))return;var j=O.currentTarget,U=A(this,B,!0).event(O),Y=vn(O.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",T,!0),K=In(O,j),z=O.clientX,R=O.clientY;Cv(O.view),Vh(O),U.mouse=[K,this.__zoom.invert(K)],Ec(this),U.start();function $(ie){if(gs(ie),!U.moved){var ce=ie.clientX-z,fe=ie.clientY-R;U.moved=ce*ce+fe*fe>E}U.event(ie).zoom("mouse",i(k(U.that.__zoom,U.mouse[0]=In(ie,j),U.mouse[1]),U.extent,u))}function T(ie){Y.on("mousemove.zoom mouseup.zoom",null),Mv(ie.view,U.moved),gs(ie),U.event(ie).end()}}function q(O,...B){if(e.apply(this,arguments)){var j=this.__zoom,U=In(O.changedTouches?O.changedTouches[0]:O,this),Y=j.invert(U),K=j.k*(O.shiftKey?.5:2),z=i(k(D(j,K),U,Y),n.apply(this,B),u);gs(O),f>0?vn(this).transition().duration(f).call(L,z,U,O):vn(this).call(_.transform,z,U,O)}}function V(O,...B){if(e.apply(this,arguments)){var j=O.touches,U=j.length,Y=A(this,B,O.changedTouches.length===U).event(O),K,z,R,$;for(Vh(O),z=0;z<U;++z)R=j[z],$=In(R,this),$=[$,this.__zoom.invert($),R.identifier],Y.touch0?!Y.touch1&&Y.touch0[2]!==$[2]&&(Y.touch1=$,Y.taps=0):(Y.touch0=$,K=!0,Y.taps=1+!!g);g&&(g=clearTimeout(g)),K&&(Y.taps<2&&(m=$[0],g=setTimeout(function(){g=null},b)),Ec(this),Y.start())}}function P(O,...B){if(this.__zooming){var j=A(this,B).event(O),U=O.changedTouches,Y=U.length,K,z,R,$;for(gs(O),K=0;K<Y;++K)z=U[K],R=In(z,this),j.touch0&&j.touch0[2]===z.identifier?j.touch0[0]=R:j.touch1&&j.touch1[2]===z.identifier&&(j.touch1[0]=R);if(z=j.that.__zoom,j.touch1){var T=j.touch0[0],ie=j.touch0[1],ce=j.touch1[0],fe=j.touch1[1],he=(he=ce[0]-T[0])*he+(he=ce[1]-T[1])*he,ue=(ue=fe[0]-ie[0])*ue+(ue=fe[1]-ie[1])*ue;z=D(z,Math.sqrt(he/ue)),R=[(T[0]+ce[0])/2,(T[1]+ce[1])/2],$=[(ie[0]+fe[0])/2,(ie[1]+fe[1])/2]}else if(j.touch0)R=j.touch0[0],$=j.touch0[1];else return;j.zoom("touch",i(k(z,R,$),j.extent,u))}}function te(O,...B){if(this.__zooming){var j=A(this,B).event(O),U=O.changedTouches,Y=U.length,K,z;for(Vh(O),x&&clearTimeout(x),x=setTimeout(function(){x=null},b),K=0;K<Y;++K)z=U[K],j.touch0&&j.touch0[2]===z.identifier?delete j.touch0:j.touch1&&j.touch1[2]===z.identifier&&delete j.touch1;if(j.touch1&&!j.touch0&&(j.touch0=j.touch1,delete j.touch1),j.touch0)j.touch0[1]=this.__zoom.invert(j.touch0[0]);else if(j.end(),j.taps===2&&(z=In(z,this),Math.hypot(m[0]-z[0],m[1]-z[1])<N)){var R=vn(this).on("dblclick.zoom");R&&R.apply(this,arguments)}}}return _.wheelDelta=function(O){return arguments.length?(a=typeof O=="function"?O:Zu(+O),_):a},_.filter=function(O){return arguments.length?(e=typeof O=="function"?O:Zu(!!O),_):e},_.touchable=function(O){return arguments.length?(s=typeof O=="function"?O:Zu(!!O),_):s},_.extent=function(O){return arguments.length?(n=typeof O=="function"?O:Zu([[+O[0][0],+O[0][1]],[+O[1][0],+O[1][1]]]),_):n},_.scaleExtent=function(O){return arguments.length?(o[0]=+O[0],o[1]=+O[1],_):[o[0],o[1]]},_.translateExtent=function(O){return arguments.length?(u[0][0]=+O[0][0],u[1][0]=+O[1][0],u[0][1]=+O[0][1],u[1][1]=+O[1][1],_):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},_.constrain=function(O){return arguments.length?(i=O,_):i},_.duration=function(O){return arguments.length?(f=+O,_):f},_.interpolate=function(O){return arguments.length?(h=O,_):h},_.on=function(){var O=d.on.apply(d,arguments);return O===d?_:O},_.clickDistance=function(O){return arguments.length?(E=(O=+O)*O,_):Math.sqrt(E)},_.tapDistance=function(O){return arguments.length?(N=+O,_):N},_}const ri={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:i,targetHandle:a})=>`Couldn't create edge for ${e} handle id: "${e==="source"?i:a}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Qs=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Yv=["Enter"," ","Escape"],Xv={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:n,y:i})=>`Moved selected node ${e}. New position, x: ${n}, y: ${i}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ul;(function(e){e.Strict="strict",e.Loose="loose"})(ul||(ul={}));var Jr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Jr||(Jr={}));var Ks;(function(e){e.Partial="partial",e.Full="full"})(Ks||(Ks={}));const Fv={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var wr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(wr||(wr={}));var Lc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Lc||(Lc={}));var be;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(be||(be={}));const lb={[be.Left]:be.Right,[be.Right]:be.Left,[be.Top]:be.Bottom,[be.Bottom]:be.Top};function Gv(e){return e===null?null:e?"valid":"invalid"}const Zv=e=>"id"in e&&"source"in e&&"target"in e,Q4=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),dm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),oo=(e,n=[0,0])=>{const{width:i,height:a}=Bi(e),s=e.origin??n,o=i*s[0],u=a*s[1];return{x:e.position.x-o,y:e.position.y-u}},K4=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const i=e.reduce((a,s)=>{const o=typeof s=="string";let u=!n.nodeLookup&&!o?s:void 0;n.nodeLookup&&(u=o?n.nodeLookup.get(s):dm(s)?s:n.nodeLookup.get(s.id));const f=u?Hc(u,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Wc(a,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ef(i)},uo=(e,n={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(i=Wc(i,Hc(s)),a=!0)}),a?ef(i):{x:0,y:0,width:0,height:0}},hm=(e,n,[i,a,s]=[0,0,1],o=!1,u=!1)=>{const f={...fo(n,[i,a,s]),width:n.width/s,height:n.height/s},h=[];for(const d of e.values()){const{measured:g,selectable:m=!0,hidden:x=!1}=d;if(u&&!m||x)continue;const b=g.width??d.width??d.initialWidth??null,w=g.height??d.height??d.initialHeight??null,E=Js(f,fl(d)),N=(b??0)*(w??0),_=o&&E>0;(!d.internals.handleBounds||_||E>=N||d.dragging)&&h.push(d)}return h},J4=(e,n)=>{const i=new Set;return e.forEach(a=>{i.add(a.id)}),n.filter(a=>i.has(a.source)||i.has(a.target))};function W4(e,n){const i=new Map,a=n?.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&(n?.includeHiddenNodes||!s.hidden)&&(!a||a.has(s.id))&&i.set(s.id,s)}),i}async function eM({nodes:e,width:n,height:i,panZoom:a,minZoom:s,maxZoom:o},u){if(e.size===0)return Promise.resolve(!0);const f=W4(e,u),h=uo(f),d=pm(h,n,i,u?.minZoom??s,u?.maxZoom??o,u?.padding??.1);return await a.setViewport(d,{duration:u?.duration,ease:u?.ease,interpolate:u?.interpolate}),Promise.resolve(!0)}function Qv({nodeId:e,nextPosition:n,nodeLookup:i,nodeOrigin:a=[0,0],nodeExtent:s,onError:o}){const u=i.get(e),f=u.parentId?i.get(u.parentId):void 0,{x:h,y:d}=f?f.internals.positionAbsolute:{x:0,y:0},g=u.origin??a;let m=u.extent||s;if(u.extent==="parent"&&!u.expandParent)if(!f)o?.("005",ri.error005());else{const b=f.measured.width,w=f.measured.height;b&&w&&(m=[[h,d],[h+b,d+w]])}else f&&dl(u.extent)&&(m=[[u.extent[0][0]+h,u.extent[0][1]+d],[u.extent[1][0]+h,u.extent[1][1]+d]]);const x=dl(m)?ta(n,m,u.measured):n;return(u.measured.width===void 0||u.measured.height===void 0)&&o?.("015",ri.error015()),{position:{x:x.x-h+(u.measured.width??0)*g[0],y:x.y-d+(u.measured.height??0)*g[1]},positionAbsolute:x}}async function tM({nodesToRemove:e=[],edgesToRemove:n=[],nodes:i,edges:a,onBeforeDelete:s}){const o=new Set(e.map(x=>x.id)),u=[];for(const x of i){if(x.deletable===!1)continue;const b=o.has(x.id),w=!b&&x.parentId&&u.find(E=>E.id===x.parentId);(b||w)&&u.push(x)}const f=new Set(n.map(x=>x.id)),h=a.filter(x=>x.deletable!==!1),g=J4(u,h);for(const x of h)f.has(x.id)&&!g.find(w=>w.id===x.id)&&g.push(x);if(!s)return{edges:g,nodes:u};const m=await s({nodes:u,edges:g});return typeof m=="boolean"?m?{edges:g,nodes:u}:{edges:[],nodes:[]}:m}const cl=(e,n=0,i=1)=>Math.min(Math.max(e,n),i),ta=(e={x:0,y:0},n,i)=>({x:cl(e.x,n[0][0],n[1][0]-(i?.width??0)),y:cl(e.y,n[0][1],n[1][1]-(i?.height??0))});function Kv(e,n,i){const{width:a,height:s}=Bi(i),{x:o,y:u}=i.internals.positionAbsolute;return ta(e,[[o,u],[o+a,u+s]],n)}const sb=(e,n,i)=>e<n?cl(Math.abs(e-n),1,n)/n:e>i?-cl(Math.abs(e-i),1,n)/n:0,Jv=(e,n,i=15,a=40)=>{const s=sb(e.x,a,n.width-a)*i,o=sb(e.y,a,n.height-a)*i;return[s,o]},Wc=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),Dp=({x:e,y:n,width:i,height:a})=>({x:e,y:n,x2:e+i,y2:n+a}),ef=({x:e,y:n,x2:i,y2:a})=>({x:e,y:n,width:i-e,height:a-n}),fl=(e,n=[0,0])=>{const{x:i,y:a}=dm(e)?e.internals.positionAbsolute:oo(e,n);return{x:i,y:a,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Hc=(e,n=[0,0])=>{const{x:i,y:a}=dm(e)?e.internals.positionAbsolute:oo(e,n);return{x:i,y:a,x2:i+(e.measured?.width??e.width??e.initialWidth??0),y2:a+(e.measured?.height??e.height??e.initialHeight??0)}},Wv=(e,n)=>ef(Wc(Dp(e),Dp(n))),Js=(e,n)=>{const i=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),a=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(i*a)},ob=e=>$n(e.width)&&$n(e.height)&&$n(e.x)&&$n(e.y),$n=e=>!isNaN(e)&&isFinite(e),nM=(e,n)=>{},co=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),fo=({x:e,y:n},[i,a,s],o=!1,u=[1,1])=>{const f={x:(e-i)/s,y:(n-a)/s};return o?co(f,u):f},Bc=({x:e,y:n},[i,a,s])=>({x:e*s+i,y:n*s+a});function Ya(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(i)}if(typeof e=="string"&&e.endsWith("%")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(n*i*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function iM(e,n,i){if(typeof e=="string"||typeof e=="number"){const a=Ya(e,i),s=Ya(e,n);return{top:a,right:s,bottom:a,left:s,x:s*2,y:a*2}}if(typeof e=="object"){const a=Ya(e.top??e.y??0,i),s=Ya(e.bottom??e.y??0,i),o=Ya(e.left??e.x??0,n),u=Ya(e.right??e.x??0,n);return{top:a,right:u,bottom:s,left:o,x:o+u,y:a+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function rM(e,n,i,a,s,o){const{x:u,y:f}=Bc(e,[n,i,a]),{x:h,y:d}=Bc({x:e.x+e.width,y:e.y+e.height},[n,i,a]),g=s-h,m=o-d;return{left:Math.floor(u),top:Math.floor(f),right:Math.floor(g),bottom:Math.floor(m)}}const pm=(e,n,i,a,s,o)=>{const u=iM(o,n,i),f=(n-u.x)/e.width,h=(i-u.y)/e.height,d=Math.min(f,h),g=cl(d,a,s),m=e.x+e.width/2,x=e.y+e.height/2,b=n/2-m*g,w=i/2-x*g,E=rM(e,b,w,g,n,i),N={left:Math.min(E.left-u.left,0),top:Math.min(E.top-u.top,0),right:Math.min(E.right-u.right,0),bottom:Math.min(E.bottom-u.bottom,0)};return{x:b-N.left+N.right,y:w-N.top+N.bottom,zoom:g}},Ws=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function dl(e){return e!=null&&e!=="parent"}function Bi(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function ew(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function tw(e,n={width:0,height:0},i,a,s){const o={...e},u=a.get(i);if(u){const f=u.origin||s;o.x+=u.internals.positionAbsolute.x-(n.width??0)*f[0],o.y+=u.internals.positionAbsolute.y-(n.height??0)*f[1]}return o}function ub(e,n){if(e.size!==n.size)return!1;for(const i of e)if(!n.has(i))return!1;return!0}function aM(){let e,n;return{promise:new Promise((a,s)=>{e=a,n=s}),resolve:e,reject:n}}function lM(e){return{...Xv,...e||{}}}function $s(e,{snapGrid:n=[0,0],snapToGrid:i=!1,transform:a,containerBounds:s}){const{x:o,y:u}=Vn(e),f=fo({x:o-(s?.left??0),y:u-(s?.top??0)},a),{x:h,y:d}=i?co(f,n):f;return{xSnapped:h,ySnapped:d,...f}}const mm=e=>({width:e.offsetWidth,height:e.offsetHeight}),nw=e=>e?.getRootNode?.()||window?.document,sM=["INPUT","SELECT","TEXTAREA"];function iw(e){const n=e.composedPath?.()?.[0]||e.target;return n?.nodeType!==1?!1:sM.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const rw=e=>"clientX"in e,Vn=(e,n)=>{const i=rw(e),a=i?e.clientX:e.touches?.[0].clientX,s=i?e.clientY:e.touches?.[0].clientY;return{x:a-(n?.left??0),y:s-(n?.top??0)}},cb=(e,n,i,a,s)=>{const o=n.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(u=>{const f=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:s,position:u.getAttribute("data-handlepos"),x:(f.left-i.left)/a,y:(f.top-i.top)/a,...mm(u)}})};function aw({sourceX:e,sourceY:n,targetX:i,targetY:a,sourceControlX:s,sourceControlY:o,targetControlX:u,targetControlY:f}){const h=e*.125+s*.375+u*.375+i*.125,d=n*.125+o*.375+f*.375+a*.125,g=Math.abs(h-e),m=Math.abs(d-n);return[h,d,g,m]}function Qu(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function fb({pos:e,x1:n,y1:i,x2:a,y2:s,c:o}){switch(e){case be.Left:return[n-Qu(n-a,o),i];case be.Right:return[n+Qu(a-n,o),i];case be.Top:return[n,i-Qu(i-s,o)];case be.Bottom:return[n,i+Qu(s-i,o)]}}function lw({sourceX:e,sourceY:n,sourcePosition:i=be.Bottom,targetX:a,targetY:s,targetPosition:o=be.Top,curvature:u=.25}){const[f,h]=fb({pos:i,x1:e,y1:n,x2:a,y2:s,c:u}),[d,g]=fb({pos:o,x1:a,y1:s,x2:e,y2:n,c:u}),[m,x,b,w]=aw({sourceX:e,sourceY:n,targetX:a,targetY:s,sourceControlX:f,sourceControlY:h,targetControlX:d,targetControlY:g});return[`M${e},${n} C${f},${h} ${d},${g} ${a},${s}`,m,x,b,w]}function sw({sourceX:e,sourceY:n,targetX:i,targetY:a}){const s=Math.abs(i-e)/2,o=i<e?i+s:i-s,u=Math.abs(a-n)/2,f=a<n?a+u:a-u;return[o,f,s,u]}function oM({sourceNode:e,targetNode:n,selected:i=!1,zIndex:a=0,elevateOnSelect:s=!1,zIndexMode:o="basic"}){if(o==="manual")return a;const u=s&&i?a+1e3:a,f=Math.max(e.parentId||s&&e.selected?e.internals.z:0,n.parentId||s&&n.selected?n.internals.z:0);return u+f}function uM({sourceNode:e,targetNode:n,width:i,height:a,transform:s}){const o=Wc(Hc(e),Hc(n));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const u={x:-s[0]/s[2],y:-s[1]/s[2],width:i/s[2],height:a/s[2]};return Js(u,ef(o))>0}const cM=({source:e,sourceHandle:n,target:i,targetHandle:a})=>`xy-edge__${e}${n||""}-${i}${a||""}`,fM=(e,n)=>n.some(i=>i.source===e.source&&i.target===e.target&&(i.sourceHandle===e.sourceHandle||!i.sourceHandle&&!e.sourceHandle)&&(i.targetHandle===e.targetHandle||!i.targetHandle&&!e.targetHandle)),ow=(e,n,i={})=>{if(!e.source||!e.target)return n;const a=i.getEdgeId||cM;let s;return Zv(e)?s={...e}:s={...e,id:a(e)},fM(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function uw({sourceX:e,sourceY:n,targetX:i,targetY:a}){const[s,o,u,f]=sw({sourceX:e,sourceY:n,targetX:i,targetY:a});return[`M ${e},${n}L ${i},${a}`,s,o,u,f]}const db={[be.Left]:{x:-1,y:0},[be.Right]:{x:1,y:0},[be.Top]:{x:0,y:-1},[be.Bottom]:{x:0,y:1}},dM=({source:e,sourcePosition:n=be.Bottom,target:i})=>n===be.Left||n===be.Right?e.x<i.x?{x:1,y:0}:{x:-1,y:0}:e.y<i.y?{x:0,y:1}:{x:0,y:-1},hb=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function hM({source:e,sourcePosition:n=be.Bottom,target:i,targetPosition:a=be.Top,center:s,offset:o,stepPosition:u}){const f=db[n],h=db[a],d={x:e.x+f.x*o,y:e.y+f.y*o},g={x:i.x+h.x*o,y:i.y+h.y*o},m=dM({source:d,sourcePosition:n,target:g}),x=m.x!==0?"x":"y",b=m[x];let w=[],E,N;const _={x:0,y:0},D={x:0,y:0},[,,k,C]=sw({sourceX:e.x,sourceY:e.y,targetX:i.x,targetY:i.y});if(f[x]*h[x]===-1){x==="x"?(E=s.x??d.x+(g.x-d.x)*u,N=s.y??(d.y+g.y)/2):(E=s.x??(d.x+g.x)/2,N=s.y??d.y+(g.y-d.y)*u);const A=[{x:E,y:d.y},{x:E,y:g.y}],H=[{x:d.x,y:N},{x:g.x,y:N}];f[x]===b?w=x==="x"?A:H:w=x==="x"?H:A}else{const A=[{x:d.x,y:g.y}],H=[{x:g.x,y:d.y}];if(x==="x"?w=f.x===b?H:A:w=f.y===b?A:H,n===a){const P=Math.abs(e[x]-i[x]);if(P<=o){const te=Math.min(o-1,o-P);f[x]===b?_[x]=(d[x]>e[x]?-1:1)*te:D[x]=(g[x]>i[x]?-1:1)*te}}if(n!==a){const P=x==="x"?"y":"x",te=f[x]===h[P],O=d[P]>g[P],B=d[P]<g[P];(f[x]===1&&(!te&&O||te&&B)||f[x]!==1&&(!te&&B||te&&O))&&(w=x==="x"?A:H)}const F={x:d.x+_.x,y:d.y+_.y},G={x:g.x+D.x,y:g.y+D.y},q=Math.max(Math.abs(F.x-w[0].x),Math.abs(G.x-w[0].x)),V=Math.max(Math.abs(F.y-w[0].y),Math.abs(G.y-w[0].y));q>=V?(E=(F.x+G.x)/2,N=w[0].y):(E=w[0].x,N=(F.y+G.y)/2)}return[[e,{x:d.x+_.x,y:d.y+_.y},...w,{x:g.x+D.x,y:g.y+D.y},i],E,N,k,C]}function pM(e,n,i,a){const s=Math.min(hb(e,n)/2,hb(n,i)/2,a),{x:o,y:u}=n;if(e.x===o&&o===i.x||e.y===u&&u===i.y)return`L${o} ${u}`;if(e.y===u){const d=e.x<i.x?-1:1,g=e.y<i.y?1:-1;return`L ${o+s*d},${u}Q ${o},${u} ${o},${u+s*g}`}const f=e.x<i.x?1:-1,h=e.y<i.y?-1:1;return`L ${o},${u+s*h}Q ${o},${u} ${o+s*f},${u}`}function Rp({sourceX:e,sourceY:n,sourcePosition:i=be.Bottom,targetX:a,targetY:s,targetPosition:o=be.Top,borderRadius:u=5,centerX:f,centerY:h,offset:d=20,stepPosition:g=.5}){const[m,x,b,w,E]=hM({source:{x:e,y:n},sourcePosition:i,target:{x:a,y:s},targetPosition:o,center:{x:f,y:h},offset:d,stepPosition:g});return[m.reduce((_,D,k)=>{let C="";return k>0&&k<m.length-1?C=pM(m[k-1],D,m[k+1],u):C=`${k===0?"M":"L"}${D.x} ${D.y}`,_+=C,_},""),x,b,w,E]}function pb(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function mM(e){const{sourceNode:n,targetNode:i}=e;if(!pb(n)||!pb(i))return null;const a=n.internals.handleBounds||mb(n.handles),s=i.internals.handleBounds||mb(i.handles),o=gb(a?.source??[],e.sourceHandle),u=gb(e.connectionMode===ul.Strict?s?.target??[]:(s?.target??[]).concat(s?.source??[]),e.targetHandle);if(!o||!u)return e.onError?.("008",ri.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const f=o?.position||be.Bottom,h=u?.position||be.Top,d=na(n,o,f),g=na(i,u,h);return{sourceX:d.x,sourceY:d.y,targetX:g.x,targetY:g.y,sourcePosition:f,targetPosition:h}}function mb(e){if(!e)return null;const n=[],i=[];for(const a of e)a.width=a.width??1,a.height=a.height??1,a.type==="source"?n.push(a):a.type==="target"&&i.push(a);return{source:n,target:i}}function na(e,n,i=be.Left,a=!1){const s=(n?.x??0)+e.internals.positionAbsolute.x,o=(n?.y??0)+e.internals.positionAbsolute.y,{width:u,height:f}=n??Bi(e);if(a)return{x:s+u/2,y:o+f/2};switch(n?.position??i){case be.Top:return{x:s+u/2,y:o};case be.Right:return{x:s+u,y:o+f/2};case be.Bottom:return{x:s+u/2,y:o+f};case be.Left:return{x:s,y:o+f/2}}}function gb(e,n){return e&&(n?e.find(i=>i.id===n):e[0])||null}function Op(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(a=>`${a}=${e[a]}`).join("&")}`:""}function gM(e,{id:n,defaultColor:i,defaultMarkerStart:a,defaultMarkerEnd:s}){const o=new Set;return e.reduce((u,f)=>([f.markerStart||a,f.markerEnd||s].forEach(h=>{if(h&&typeof h=="object"){const d=Op(h,n);o.has(d)||(u.push({id:d,color:h.color||i,...h}),o.add(d))}}),u),[]).sort((u,f)=>u.id.localeCompare(f.id))}const cw=1e3,yM=10,gm={nodeOrigin:[0,0],nodeExtent:Qs,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},xM={...gm,checkEquality:!0};function ym(e,n){const i={...e};for(const a in n)n[a]!==void 0&&(i[a]=n[a]);return i}function bM(e,n,i){const a=ym(gm,i);for(const s of e.values())if(s.parentId)bm(s,e,n,a);else{const o=oo(s,a.nodeOrigin),u=dl(s.extent)?s.extent:a.nodeExtent,f=ta(o,u,Bi(s));s.internals.positionAbsolute=f}}function vM(e,n){if(!e.handles)return e.measured?n?.internals.handleBounds:void 0;const i=[],a=[];for(const s of e.handles){const o={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?i.push(o):s.type==="target"&&a.push(o)}return{source:i,target:a}}function xm(e){return e==="manual"}function Lp(e,n,i,a={}){const s=ym(xM,a),o={i:0},u=new Map(n),f=s?.elevateNodesOnSelect&&!xm(s.zIndexMode)?cw:0;let h=e.length>0;n.clear(),i.clear();for(const d of e){let g=u.get(d.id);if(s.checkEquality&&d===g?.internals.userNode)n.set(d.id,g);else{const m=oo(d,s.nodeOrigin),x=dl(d.extent)?d.extent:s.nodeExtent,b=ta(m,x,Bi(d));g={...s.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:b,handleBounds:vM(d,g),z:fw(d,f,s.zIndexMode),userNode:d}},n.set(d.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(h=!1),d.parentId&&bm(g,n,i,a,o)}return h}function wM(e,n){if(!e.parentId)return;const i=n.get(e.parentId);i?i.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function bm(e,n,i,a,s){const{elevateNodesOnSelect:o,nodeOrigin:u,nodeExtent:f,zIndexMode:h}=ym(gm,a),d=e.parentId,g=n.get(d);if(!g){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}wM(e,i),s&&!g.parentId&&g.internals.rootParentIndex===void 0&&h==="auto"&&(g.internals.rootParentIndex=++s.i,g.internals.z=g.internals.z+s.i*yM),s&&g.internals.rootParentIndex!==void 0&&(s.i=g.internals.rootParentIndex);const m=o&&!xm(h)?cw:0,{x,y:b,z:w}=SM(e,g,u,f,m,h),{positionAbsolute:E}=e.internals,N=x!==E.x||b!==E.y;(N||w!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:N?{x,y:b}:E,z:w}})}function fw(e,n,i){const a=$n(e.zIndex)?e.zIndex:0;return xm(i)?a:a+(e.selected?n:0)}function SM(e,n,i,a,s,o){const{x:u,y:f}=n.internals.positionAbsolute,h=Bi(e),d=oo(e,i),g=dl(e.extent)?ta(d,e.extent,h):d;let m=ta({x:u+g.x,y:f+g.y},a,h);e.extent==="parent"&&(m=Kv(m,h,n));const x=fw(e,s,o),b=n.internals.z??0;return{x:m.x,y:m.y,z:b>=x?b+1:x}}function vm(e,n,i,a=[0,0]){const s=[],o=new Map;for(const u of e){const f=n.get(u.parentId);if(!f)continue;const h=o.get(u.parentId)?.expandedRect??fl(f),d=Wv(h,u.rect);o.set(u.parentId,{expandedRect:d,parent:f})}return o.size>0&&o.forEach(({expandedRect:u,parent:f},h)=>{const d=f.internals.positionAbsolute,g=Bi(f),m=f.origin??a,x=u.x<d.x?Math.round(Math.abs(d.x-u.x)):0,b=u.y<d.y?Math.round(Math.abs(d.y-u.y)):0,w=Math.max(g.width,Math.round(u.width)),E=Math.max(g.height,Math.round(u.height)),N=(w-g.width)*m[0],_=(E-g.height)*m[1];(x>0||b>0||N||_)&&(s.push({id:h,type:"position",position:{x:f.position.x-x+N,y:f.position.y-b+_}}),i.get(h)?.forEach(D=>{e.some(k=>k.id===D.id)||s.push({id:D.id,type:"position",position:{x:D.position.x+x,y:D.position.y+b}})})),(g.width<u.width||g.height<u.height||x||b)&&s.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:w+(x?m[0]*x-N:0),height:E+(b?m[1]*b-_:0)}})}),s}function _M(e,n,i,a,s,o,u){const f=a?.querySelector(".xyflow__viewport");let h=!1;if(!f)return{changes:[],updatedInternals:h};const d=[],g=window.getComputedStyle(f),{m22:m}=new window.DOMMatrixReadOnly(g.transform),x=[];for(const b of e.values()){const w=n.get(b.id);if(!w)continue;if(w.hidden){n.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),h=!0;continue}const E=mm(b.nodeElement),N=w.measured.width!==E.width||w.measured.height!==E.height;if(!!(E.width&&E.height&&(N||!w.internals.handleBounds||b.force))){const D=b.nodeElement.getBoundingClientRect(),k=dl(w.extent)?w.extent:o;let{positionAbsolute:C}=w.internals;w.parentId&&w.extent==="parent"?C=Kv(C,E,n.get(w.parentId)):k&&(C=ta(C,k,E));const L={...w,measured:E,internals:{...w.internals,positionAbsolute:C,handleBounds:{source:cb("source",b.nodeElement,D,m,w.id),target:cb("target",b.nodeElement,D,m,w.id)}}};n.set(w.id,L),w.parentId&&bm(L,n,i,{nodeOrigin:s,zIndexMode:u}),h=!0,N&&(d.push({id:w.id,type:"dimensions",dimensions:E}),w.expandParent&&w.parentId&&x.push({id:w.id,parentId:w.parentId,rect:fl(L,s)}))}}if(x.length>0){const b=vm(x,n,i,s);d.push(...b)}return{changes:d,updatedInternals:h}}async function kM({delta:e,panZoom:n,transform:i,translateExtent:a,width:s,height:o}){if(!n||!e.x&&!e.y)return Promise.resolve(!1);const u=await n.setViewportConstrained({x:i[0]+e.x,y:i[1]+e.y,zoom:i[2]},[[0,0],[s,o]],a),f=!!u&&(u.x!==i[0]||u.y!==i[1]||u.k!==i[2]);return Promise.resolve(f)}function yb(e,n,i,a,s,o){let u=s;const f=a.get(u)||new Map;a.set(u,f.set(i,n)),u=`${s}-${e}`;const h=a.get(u)||new Map;if(a.set(u,h.set(i,n)),o){u=`${s}-${e}-${o}`;const d=a.get(u)||new Map;a.set(u,d.set(i,n))}}function dw(e,n,i){e.clear(),n.clear();for(const a of i){const{source:s,target:o,sourceHandle:u=null,targetHandle:f=null}=a,h={edgeId:a.id,source:s,target:o,sourceHandle:u,targetHandle:f},d=`${s}-${u}--${o}-${f}`,g=`${o}-${f}--${s}-${u}`;yb("source",h,g,e,s,u),yb("target",h,d,e,o,f),n.set(a.id,a)}}function hw(e,n){if(!e.parentId)return!1;const i=n.get(e.parentId);return i?i.selected?!0:hw(i,n):!1}function xb(e,n,i){let a=e;do{if(a?.matches?.(n))return!0;if(a===i)return!1;a=a?.parentElement}while(a);return!1}function EM(e,n,i,a){const s=new Map;for(const[o,u]of e)if((u.selected||u.id===a)&&(!u.parentId||!hw(u,e))&&(u.draggable||n&&typeof u.draggable>"u")){const f=e.get(o);f&&s.set(o,{id:o,position:f.position||{x:0,y:0},distance:{x:i.x-f.internals.positionAbsolute.x,y:i.y-f.internals.positionAbsolute.y},extent:f.extent,parentId:f.parentId,origin:f.origin,expandParent:f.expandParent,internals:{positionAbsolute:f.internals.positionAbsolute||{x:0,y:0}},measured:{width:f.measured.width??0,height:f.measured.height??0}})}return s}function Ph({nodeId:e,dragItems:n,nodeLookup:i,dragging:a=!0}){const s=[];for(const[u,f]of n){const h=i.get(u)?.internals.userNode;h&&s.push({...h,position:f.position,dragging:a})}if(!e)return[s[0],s];const o=i.get(e)?.internals.userNode;return[o?{...o,position:n.get(e)?.position||o.position,dragging:a}:s[0],s]}function NM({dragItems:e,snapGrid:n,x:i,y:a}){const s=e.values().next().value;if(!s)return null;const o={x:i-s.distance.x,y:a-s.distance.y},u=co(o,n);return{x:u.x-o.x,y:u.y-o.y}}function CM({onNodeMouseDown:e,getStoreItems:n,onDragStart:i,onDrag:a,onDragStop:s}){let o={x:null,y:null},u=0,f=new Map,h=!1,d={x:0,y:0},g=null,m=!1,x=null,b=!1,w=!1,E=null;function N({noDragClassName:D,handleSelector:k,domNode:C,isSelectable:L,nodeId:A,nodeClickDistance:H=0}){x=vn(C);function F({x:P,y:te}){const{nodeLookup:O,nodeExtent:B,snapGrid:j,snapToGrid:U,nodeOrigin:Y,onNodeDrag:K,onSelectionDrag:z,onError:R,updateNodePositions:$}=n();o={x:P,y:te};let T=!1;const ie=f.size>1,ce=ie&&B?Dp(uo(f)):null,fe=ie&&U?NM({dragItems:f,snapGrid:j,x:P,y:te}):null;for(const[he,ue]of f){if(!O.has(he))continue;let me={x:P-ue.distance.x,y:te-ue.distance.y};U&&(me=fe?{x:Math.round(me.x+fe.x),y:Math.round(me.y+fe.y)}:co(me,j));let Ee=null;if(ie&&B&&!ue.extent&&ce){const{positionAbsolute:Ne}=ue.internals,Re=Ne.x-ce.x+B[0][0],Ze=Ne.x+ue.measured.width-ce.x2+B[1][0],Xe=Ne.y-ce.y+B[0][1],ht=Ne.y+ue.measured.height-ce.y2+B[1][1];Ee=[[Re,Xe],[Ze,ht]]}const{position:Ce,positionAbsolute:we}=Qv({nodeId:he,nextPosition:me,nodeLookup:O,nodeExtent:Ee||B,nodeOrigin:Y,onError:R});T=T||ue.position.x!==Ce.x||ue.position.y!==Ce.y,ue.position=Ce,ue.internals.positionAbsolute=we}if(w=w||T,!!T&&($(f,!0),E&&(a||K||!A&&z))){const[he,ue]=Ph({nodeId:A,dragItems:f,nodeLookup:O});a?.(E,f,he,ue),K?.(E,he,ue),A||z?.(E,ue)}}async function G(){if(!g)return;const{transform:P,panBy:te,autoPanSpeed:O,autoPanOnNodeDrag:B}=n();if(!B){h=!1,cancelAnimationFrame(u);return}const[j,U]=Jv(d,g,O);(j!==0||U!==0)&&(o.x=(o.x??0)-j/P[2],o.y=(o.y??0)-U/P[2],await te({x:j,y:U})&&F(o)),u=requestAnimationFrame(G)}function q(P){const{nodeLookup:te,multiSelectionActive:O,nodesDraggable:B,transform:j,snapGrid:U,snapToGrid:Y,selectNodesOnDrag:K,onNodeDragStart:z,onSelectionDragStart:R,unselectNodesAndEdges:$}=n();m=!0,(!K||!L)&&!O&&A&&(te.get(A)?.selected||$()),L&&K&&A&&e?.(A);const T=$s(P.sourceEvent,{transform:j,snapGrid:U,snapToGrid:Y,containerBounds:g});if(o=T,f=EM(te,B,T,A),f.size>0&&(i||z||!A&&R)){const[ie,ce]=Ph({nodeId:A,dragItems:f,nodeLookup:te});i?.(P.sourceEvent,f,ie,ce),z?.(P.sourceEvent,ie,ce),A||R?.(P.sourceEvent,ce)}}const V=Tv().clickDistance(H).on("start",P=>{const{domNode:te,nodeDragThreshold:O,transform:B,snapGrid:j,snapToGrid:U}=n();g=te?.getBoundingClientRect()||null,b=!1,w=!1,E=P.sourceEvent,O===0&&q(P),o=$s(P.sourceEvent,{transform:B,snapGrid:j,snapToGrid:U,containerBounds:g}),d=Vn(P.sourceEvent,g)}).on("drag",P=>{const{autoPanOnNodeDrag:te,transform:O,snapGrid:B,snapToGrid:j,nodeDragThreshold:U,nodeLookup:Y}=n(),K=$s(P.sourceEvent,{transform:O,snapGrid:B,snapToGrid:j,containerBounds:g});if(E=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||A&&!Y.has(A))&&(b=!0),!b){if(!h&&te&&m&&(h=!0,G()),!m){const z=Vn(P.sourceEvent,g),R=z.x-d.x,$=z.y-d.y;Math.sqrt(R*R+$*$)>U&&q(P)}(o.x!==K.xSnapped||o.y!==K.ySnapped)&&f&&m&&(d=Vn(P.sourceEvent,g),F(K))}}).on("end",P=>{if(!(!m||b)&&(h=!1,m=!1,cancelAnimationFrame(u),f.size>0)){const{nodeLookup:te,updateNodePositions:O,onNodeDragStop:B,onSelectionDragStop:j}=n();if(w&&(O(f,!1),w=!1),s||B||!A&&j){const[U,Y]=Ph({nodeId:A,dragItems:f,nodeLookup:te,dragging:!1});s?.(P.sourceEvent,f,U,Y),B?.(P.sourceEvent,U,Y),A||j?.(P.sourceEvent,Y)}}}).filter(P=>{const te=P.target;return!P.button&&(!D||!xb(te,`.${D}`,C))&&(!k||xb(te,k,C))});x.call(V)}function _(){x?.on(".drag",null)}return{update:N,destroy:_}}function MM(e,n,i){const a=[],s={x:e.x-i,y:e.y-i,width:i*2,height:i*2};for(const o of n.values())Js(s,fl(o))>0&&a.push(o);return a}const TM=250;function AM(e,n,i,a){let s=[],o=1/0;const u=MM(e,i,n+TM);for(const f of u){const h=[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]];for(const d of h){if(a.nodeId===d.nodeId&&a.type===d.type&&a.id===d.id)continue;const{x:g,y:m}=na(f,d,d.position,!0),x=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(m-e.y,2));x>n||(x<o?(s=[{...d,x:g,y:m}],o=x):x===o&&s.push({...d,x:g,y:m}))}}if(!s.length)return null;if(s.length>1){const f=a.type==="source"?"target":"source";return s.find(h=>h.type===f)??s[0]}return s[0]}function pw(e,n,i,a,s,o=!1){const u=a.get(e);if(!u)return null;const f=s==="strict"?u.internals.handleBounds?.[n]:[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]],h=(i?f?.find(d=>d.id===i):f?.[0])??null;return h&&o?{...h,...na(u,h,h.position,!0)}:h}function mw(e,n){return e||(n?.classList.contains("target")?"target":n?.classList.contains("source")?"source":null)}function zM(e,n){let i=null;return n?i=!0:e&&!n&&(i=!1),i}const gw=()=>!0;function jM(e,{connectionMode:n,connectionRadius:i,handleId:a,nodeId:s,edgeUpdaterType:o,isTarget:u,domNode:f,nodeLookup:h,lib:d,autoPanOnConnect:g,flowId:m,panBy:x,cancelConnection:b,onConnectStart:w,onConnect:E,onConnectEnd:N,isValidConnection:_=gw,onReconnectEnd:D,updateConnection:k,getTransform:C,getFromHandle:L,autoPanSpeed:A,dragThreshold:H=1,handleDomNode:F}){const G=nw(e.target);let q=0,V;const{x:P,y:te}=Vn(e),O=mw(o,F),B=f?.getBoundingClientRect();let j=!1;if(!B||!O)return;const U=pw(s,O,a,h,n);if(!U)return;let Y=Vn(e,B),K=!1,z=null,R=!1,$=null;function T(){if(!g||!B)return;const[Ce,we]=Jv(Y,B,A);x({x:Ce,y:we}),q=requestAnimationFrame(T)}const ie={...U,nodeId:s,type:O,position:U.position},ce=h.get(s);let he={inProgress:!0,isValid:null,from:na(ce,ie,be.Left,!0),fromHandle:ie,fromPosition:ie.position,fromNode:ce,to:Y,toHandle:null,toPosition:lb[ie.position],toNode:null,pointer:Y};function ue(){j=!0,k(he),w?.(e,{nodeId:s,handleId:a,handleType:O})}H===0&&ue();function me(Ce){if(!j){const{x:ht,y:sn}=Vn(Ce),Lt=ht-P,Gt=sn-te;if(!(Lt*Lt+Gt*Gt>H*H))return;ue()}if(!L()||!ie){Ee(Ce);return}const we=C();Y=Vn(Ce,B),V=AM(fo(Y,we,!1,[1,1]),i,h,ie),K||(T(),K=!0);const Ne=yw(Ce,{handle:V,connectionMode:n,fromNodeId:s,fromHandleId:a,fromType:u?"target":"source",isValidConnection:_,doc:G,lib:d,flowId:m,nodeLookup:h});$=Ne.handleDomNode,z=Ne.connection,R=zM(!!V,Ne.isValid);const Re=h.get(s),Ze=Re?na(Re,ie,be.Left,!0):he.from,Xe={...he,from:Ze,isValid:R,to:Ne.toHandle&&R?Bc({x:Ne.toHandle.x,y:Ne.toHandle.y},we):Y,toHandle:Ne.toHandle,toPosition:R&&Ne.toHandle?Ne.toHandle.position:lb[ie.position],toNode:Ne.toHandle?h.get(Ne.toHandle.nodeId):null,pointer:Y};k(Xe),he=Xe}function Ee(Ce){if(!("touches"in Ce&&Ce.touches.length>0)){if(j){(V||$)&&z&&R&&E?.(z);const{inProgress:we,...Ne}=he,Re={...Ne,toPosition:he.toHandle?he.toPosition:null};N?.(Ce,Re),o&&D?.(Ce,Re)}b(),cancelAnimationFrame(q),K=!1,R=!1,z=null,$=null,G.removeEventListener("mousemove",me),G.removeEventListener("mouseup",Ee),G.removeEventListener("touchmove",me),G.removeEventListener("touchend",Ee)}}G.addEventListener("mousemove",me),G.addEventListener("mouseup",Ee),G.addEventListener("touchmove",me),G.addEventListener("touchend",Ee)}function yw(e,{handle:n,connectionMode:i,fromNodeId:a,fromHandleId:s,fromType:o,doc:u,lib:f,flowId:h,isValidConnection:d=gw,nodeLookup:g}){const m=o==="target",x=n?u.querySelector(`.${f}-flow__handle[data-id="${h}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x:b,y:w}=Vn(e),E=u.elementFromPoint(b,w),N=E?.classList.contains(`${f}-flow__handle`)?E:x,_={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const D=mw(void 0,N),k=N.getAttribute("data-nodeid"),C=N.getAttribute("data-handleid"),L=N.classList.contains("connectable"),A=N.classList.contains("connectableend");if(!k||!D)return _;const H={source:m?k:a,sourceHandle:m?C:s,target:m?a:k,targetHandle:m?s:C};_.connection=H;const G=L&&A&&(i===ul.Strict?m&&D==="source"||!m&&D==="target":k!==a||C!==s);_.isValid=G&&d(H),_.toHandle=pw(k,D,C,g,i,!0)}return _}const Hp={onPointerDown:jM,isValid:yw};function DM({domNode:e,panZoom:n,getTransform:i,getViewScale:a}){const s=vn(e);function o({translateExtent:f,width:h,height:d,zoomStep:g=1,pannable:m=!0,zoomable:x=!0,inversePan:b=!1}){const w=k=>{if(k.sourceEvent.type!=="wheel"||!n)return;const C=i(),L=k.sourceEvent.ctrlKey&&Ws()?10:1,A=-k.sourceEvent.deltaY*(k.sourceEvent.deltaMode===1?.05:k.sourceEvent.deltaMode?1:.002)*g,H=C[2]*Math.pow(2,A*L);n.scaleTo(H)};let E=[0,0];const N=k=>{(k.sourceEvent.type==="mousedown"||k.sourceEvent.type==="touchstart")&&(E=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY])},_=k=>{const C=i();if(k.sourceEvent.type!=="mousemove"&&k.sourceEvent.type!=="touchmove"||!n)return;const L=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY],A=[L[0]-E[0],L[1]-E[1]];E=L;const H=a()*Math.max(C[2],Math.log(C[2]))*(b?-1:1),F={x:C[0]-A[0]*H,y:C[1]-A[1]*H},G=[[0,0],[h,d]];n.setViewportConstrained({x:F.x,y:F.y,zoom:C[2]},G,f)},D=Pv().on("start",N).on("zoom",m?_:null).on("zoom.wheel",x?w:null);s.call(D,{})}function u(){s.on("zoom",null)}return{update:o,destroy:u,pointer:In}}const tf=e=>({x:e.x,y:e.y,zoom:e.k}),Yh=({x:e,y:n,zoom:i})=>Jc.translate(e,n).scale(i),Wa=(e,n)=>e.target.closest(`.${n}`),xw=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),RM=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Xh=(e,n=0,i=RM,a=()=>{})=>{const s=typeof n=="number"&&n>0;return s||a(),s?e.transition().duration(n).ease(i).on("end",a):e},bw=e=>{const n=e.ctrlKey&&Ws()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function OM({zoomPanValues:e,noWheelClassName:n,d3Selection:i,d3Zoom:a,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:u,onPanZoomStart:f,onPanZoom:h,onPanZoomEnd:d}){return g=>{if(Wa(g,n))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const m=i.property("__zoom").k||1;if(g.ctrlKey&&u){const N=In(g),_=bw(g),D=m*Math.pow(2,_);a.scaleTo(i,D,N,g);return}const x=g.deltaMode===1?20:1;let b=s===Jr.Vertical?0:g.deltaX*x,w=s===Jr.Horizontal?0:g.deltaY*x;!Ws()&&g.shiftKey&&s!==Jr.Vertical&&(b=g.deltaY*x,w=0),a.translateBy(i,-(b/m)*o,-(w/m)*o,{internal:!0});const E=tf(i.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h?.(g,E),e.panScrollTimeout=setTimeout(()=>{d?.(g,E),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,f?.(g,E))}}function LM({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:i}){return function(a,s){const o=a.type==="wheel",u=!n&&o&&!a.ctrlKey,f=Wa(a,e);if(a.ctrlKey&&o&&f&&a.preventDefault(),u||f)return null;a.preventDefault(),i.call(this,a,s)}}function HM({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:i}){return a=>{if(a.sourceEvent?.internal)return;const s=tf(a.transform);e.mouseButton=a.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=s,a.sourceEvent?.type==="mousedown"&&n(!0),i&&i?.(a.sourceEvent,s)}}function BM({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:i,onTransformChange:a,onPanZoom:s}){return o=>{e.usedRightMouseButton=!!(i&&xw(n,e.mouseButton??0)),o.sourceEvent?.sync||a([o.transform.x,o.transform.y,o.transform.k]),s&&!o.sourceEvent?.internal&&s?.(o.sourceEvent,tf(o.transform))}}function UM({zoomPanValues:e,panOnDrag:n,panOnScroll:i,onDraggingChange:a,onPanZoomEnd:s,onPaneContextMenu:o}){return u=>{if(!u.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,o&&xw(n,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&o(u.sourceEvent),e.usedRightMouseButton=!1,a(!1),s)){const f=tf(u.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s?.(u.sourceEvent,f)},i?150:0)}}}function IM({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:i,panOnDrag:a,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:u,noWheelClassName:f,noPanClassName:h,lib:d,connectionInProgress:g}){return m=>{const x=e||n,b=i&&m.ctrlKey,w=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(Wa(m,`${d}-flow__node`)||Wa(m,`${d}-flow__edge`)))return!0;if(!a&&!x&&!s&&!o&&!i||u||g&&!w||Wa(m,f)&&w||Wa(m,h)&&(!w||s&&w&&!e)||!i&&m.ctrlKey&&w)return!1;if(!i&&m.type==="touchstart"&&m.touches?.length>1)return m.preventDefault(),!1;if(!x&&!s&&!b&&w||!a&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(a)&&!a.includes(m.button)&&m.type==="mousedown")return!1;const E=Array.isArray(a)&&a.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||w)&&E}}function qM({domNode:e,minZoom:n,maxZoom:i,translateExtent:a,viewport:s,onPanZoom:o,onPanZoomStart:u,onPanZoomEnd:f,onDraggingChange:h}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),m=Pv().scaleExtent([n,i]).translateExtent(a),x=vn(e).call(m);D({x:s.x,y:s.y,zoom:cl(s.zoom,n,i)},[[0,0],[g.width,g.height]],a);const b=x.on("wheel.zoom"),w=x.on("dblclick.zoom");m.wheelDelta(bw);function E(V,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?qs:Sc).transform(Xh(x,P?.duration,P?.ease,()=>te(!0)),V)}):Promise.resolve(!1)}function N({noWheelClassName:V,noPanClassName:P,onPaneContextMenu:te,userSelectionActive:O,panOnScroll:B,panOnDrag:j,panOnScrollMode:U,panOnScrollSpeed:Y,preventScrolling:K,zoomOnPinch:z,zoomOnScroll:R,zoomOnDoubleClick:$,zoomActivationKeyPressed:T,lib:ie,onTransformChange:ce,connectionInProgress:fe,paneClickDistance:he,selectionOnDrag:ue}){O&&!d.isZoomingOrPanning&&_();const me=B&&!T&&!O;m.clickDistance(ue?1/0:!$n(he)||he<0?0:he);const Ee=me?OM({zoomPanValues:d,noWheelClassName:V,d3Selection:x,d3Zoom:m,panOnScrollMode:U,panOnScrollSpeed:Y,zoomOnPinch:z,onPanZoomStart:u,onPanZoom:o,onPanZoomEnd:f}):LM({noWheelClassName:V,preventScrolling:K,d3ZoomHandler:b});if(x.on("wheel.zoom",Ee,{passive:!1}),!O){const we=HM({zoomPanValues:d,onDraggingChange:h,onPanZoomStart:u});m.on("start",we);const Ne=BM({zoomPanValues:d,panOnDrag:j,onPaneContextMenu:!!te,onPanZoom:o,onTransformChange:ce});m.on("zoom",Ne);const Re=UM({zoomPanValues:d,panOnDrag:j,panOnScroll:B,onPaneContextMenu:te,onPanZoomEnd:f,onDraggingChange:h});m.on("end",Re)}const Ce=IM({zoomActivationKeyPressed:T,panOnDrag:j,zoomOnScroll:R,panOnScroll:B,zoomOnDoubleClick:$,zoomOnPinch:z,userSelectionActive:O,noPanClassName:P,noWheelClassName:V,lib:ie,connectionInProgress:fe});m.filter(Ce),$?x.on("dblclick.zoom",w):x.on("dblclick.zoom",null)}function _(){m.on("zoom",null)}async function D(V,P,te){const O=Yh(V),B=m?.constrain()(O,P,te);return B&&await E(B),new Promise(j=>j(B))}async function k(V,P){const te=Yh(V);return await E(te,P),new Promise(O=>O(te))}function C(V){if(x){const P=Yh(V),te=x.property("__zoom");(te.k!==V.zoom||te.x!==V.x||te.y!==V.y)&&m?.transform(x,P,null,{sync:!0})}}function L(){const V=x?Vv(x.node()):{x:0,y:0,k:1};return{x:V.x,y:V.y,zoom:V.k}}function A(V,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?qs:Sc).scaleTo(Xh(x,P?.duration,P?.ease,()=>te(!0)),V)}):Promise.resolve(!1)}function H(V,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?qs:Sc).scaleBy(Xh(x,P?.duration,P?.ease,()=>te(!0)),V)}):Promise.resolve(!1)}function F(V){m?.scaleExtent(V)}function G(V){m?.translateExtent(V)}function q(V){const P=!$n(V)||V<0?0:V;m?.clickDistance(P)}return{update:N,destroy:_,setViewport:k,setViewportConstrained:D,getViewport:L,scaleTo:A,scaleBy:H,setScaleExtent:F,setTranslateExtent:G,syncViewport:C,setClickDistance:q}}var hl;(function(e){e.Line="line",e.Handle="handle"})(hl||(hl={}));function $M({width:e,prevWidth:n,height:i,prevHeight:a,affectsX:s,affectsY:o}){const u=e-n,f=i-a,h=[u>0?1:u<0?-1:0,f>0?1:f<0?-1:0];return u&&s&&(h[0]=h[0]*-1),f&&o&&(h[1]=h[1]*-1),h}function bb(e){const n=e.includes("right")||e.includes("left"),i=e.includes("bottom")||e.includes("top"),a=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:i,affectsX:a,affectsY:s}}function mr(e,n){return Math.max(0,n-e)}function gr(e,n){return Math.max(0,e-n)}function Ku(e,n,i){return Math.max(0,n-e,e-i)}function vb(e,n){return e?!n:n}function VM(e,n,i,a,s,o,u,f){let{affectsX:h,affectsY:d}=n;const{isHorizontal:g,isVertical:m}=n,x=g&&m,{xSnapped:b,ySnapped:w}=i,{minWidth:E,maxWidth:N,minHeight:_,maxHeight:D}=a,{x:k,y:C,width:L,height:A,aspectRatio:H}=e;let F=Math.floor(g?b-e.pointerX:0),G=Math.floor(m?w-e.pointerY:0);const q=L+(h?-F:F),V=A+(d?-G:G),P=-o[0]*L,te=-o[1]*A;let O=Ku(q,E,N),B=Ku(V,_,D);if(u){let Y=0,K=0;h&&F<0?Y=mr(k+F+P,u[0][0]):!h&&F>0&&(Y=gr(k+q+P,u[1][0])),d&&G<0?K=mr(C+G+te,u[0][1]):!d&&G>0&&(K=gr(C+V+te,u[1][1])),O=Math.max(O,Y),B=Math.max(B,K)}if(f){let Y=0,K=0;h&&F>0?Y=gr(k+F,f[0][0]):!h&&F<0&&(Y=mr(k+q,f[1][0])),d&&G>0?K=gr(C+G,f[0][1]):!d&&G<0&&(K=mr(C+V,f[1][1])),O=Math.max(O,Y),B=Math.max(B,K)}if(s){if(g){const Y=Ku(q/H,_,D)*H;if(O=Math.max(O,Y),u){let K=0;!h&&!d||h&&!d&&x?K=gr(C+te+q/H,u[1][1])*H:K=mr(C+te+(h?F:-F)/H,u[0][1])*H,O=Math.max(O,K)}if(f){let K=0;!h&&!d||h&&!d&&x?K=mr(C+q/H,f[1][1])*H:K=gr(C+(h?F:-F)/H,f[0][1])*H,O=Math.max(O,K)}}if(m){const Y=Ku(V*H,E,N)/H;if(B=Math.max(B,Y),u){let K=0;!h&&!d||d&&!h&&x?K=gr(k+V*H+P,u[1][0])/H:K=mr(k+(d?G:-G)*H+P,u[0][0])/H,B=Math.max(B,K)}if(f){let K=0;!h&&!d||d&&!h&&x?K=mr(k+V*H,f[1][0])/H:K=gr(k+(d?G:-G)*H,f[0][0])/H,B=Math.max(B,K)}}}G=G+(G<0?B:-B),F=F+(F<0?O:-O),s&&(x?q>V*H?G=(vb(h,d)?-F:F)/H:F=(vb(h,d)?-G:G)*H:g?(G=F/H,d=h):(F=G*H,h=d));const j=h?k+F:k,U=d?C+G:C;return{width:L+(h?-F:F),height:A+(d?-G:G),x:o[0]*F*(h?-1:1)+j,y:o[1]*G*(d?-1:1)+U}}const vw={width:0,height:0,x:0,y:0},PM={...vw,pointerX:0,pointerY:0,aspectRatio:1};function YM(e){return[[0,0],[e.measured.width,e.measured.height]]}function XM(e,n,i){const a=n.position.x+e.position.x,s=n.position.y+e.position.y,o=e.measured.width??0,u=e.measured.height??0,f=i[0]*o,h=i[1]*u;return[[a-f,s-h],[a+o-f,s+u-h]]}function FM({domNode:e,nodeId:n,getStoreItems:i,onChange:a,onEnd:s}){const o=vn(e);let u={controlDirection:bb("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function f({controlPosition:d,boundaries:g,keepAspectRatio:m,resizeDirection:x,onResizeStart:b,onResize:w,onResizeEnd:E,shouldResize:N}){let _={...vw},D={...PM};u={boundaries:g,resizeDirection:x,keepAspectRatio:m,controlDirection:bb(d)};let k,C=null,L=[],A,H,F,G=!1;const q=Tv().on("start",V=>{const{nodeLookup:P,transform:te,snapGrid:O,snapToGrid:B,nodeOrigin:j,paneDomNode:U}=i();if(k=P.get(n),!k)return;C=U?.getBoundingClientRect()??null;const{xSnapped:Y,ySnapped:K}=$s(V.sourceEvent,{transform:te,snapGrid:O,snapToGrid:B,containerBounds:C});_={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},D={..._,pointerX:Y,pointerY:K,aspectRatio:_.width/_.height},A=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(A=P.get(k.parentId),H=A&&k.extent==="parent"?YM(A):void 0),L=[],F=void 0;for(const[z,R]of P)if(R.parentId===n&&(L.push({id:z,position:{...R.position},extent:R.extent}),R.extent==="parent"||R.expandParent)){const $=XM(R,k,R.origin??j);F?F=[[Math.min($[0][0],F[0][0]),Math.min($[0][1],F[0][1])],[Math.max($[1][0],F[1][0]),Math.max($[1][1],F[1][1])]]:F=$}b?.(V,{..._})}).on("drag",V=>{const{transform:P,snapGrid:te,snapToGrid:O,nodeOrigin:B}=i(),j=$s(V.sourceEvent,{transform:P,snapGrid:te,snapToGrid:O,containerBounds:C}),U=[];if(!k)return;const{x:Y,y:K,width:z,height:R}=_,$={},T=k.origin??B,{width:ie,height:ce,x:fe,y:he}=VM(D,u.controlDirection,j,u.boundaries,u.keepAspectRatio,T,H,F),ue=ie!==z,me=ce!==R,Ee=fe!==Y&&ue,Ce=he!==K&&me;if(!Ee&&!Ce&&!ue&&!me)return;if((Ee||Ce||T[0]===1||T[1]===1)&&($.x=Ee?fe:_.x,$.y=Ce?he:_.y,_.x=$.x,_.y=$.y,L.length>0)){const Ze=fe-Y,Xe=he-K;for(const ht of L)ht.position={x:ht.position.x-Ze+T[0]*(ie-z),y:ht.position.y-Xe+T[1]*(ce-R)},U.push(ht)}if((ue||me)&&($.width=ue&&(!u.resizeDirection||u.resizeDirection==="horizontal")?ie:_.width,$.height=me&&(!u.resizeDirection||u.resizeDirection==="vertical")?ce:_.height,_.width=$.width,_.height=$.height),A&&k.expandParent){const Ze=T[0]*($.width??0);$.x&&$.x<Ze&&(_.x=Ze,D.x=D.x-($.x-Ze));const Xe=T[1]*($.height??0);$.y&&$.y<Xe&&(_.y=Xe,D.y=D.y-($.y-Xe))}const we=$M({width:_.width,prevWidth:z,height:_.height,prevHeight:R,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),Ne={..._,direction:we};N?.(V,Ne)!==!1&&(G=!0,w?.(V,Ne),a($,U))}).on("end",V=>{G&&(E?.(V,{..._}),s?.({..._}),G=!1)});o.call(q)}function h(){o.on(".drag",null)}return{update:f,destroy:h}}var Fh={exports:{}},Gh={},Zh={exports:{}},Qh={};var wb;function GM(){if(wb)return Qh;wb=1;var e=ao();function n(m,x){return m===x&&(m!==0||1/m===1/x)||m!==m&&x!==x}var i=typeof Object.is=="function"?Object.is:n,a=e.useState,s=e.useEffect,o=e.useLayoutEffect,u=e.useDebugValue;function f(m,x){var b=x(),w=a({inst:{value:b,getSnapshot:x}}),E=w[0].inst,N=w[1];return o(function(){E.value=b,E.getSnapshot=x,h(E)&&N({inst:E})},[m,b,x]),s(function(){return h(E)&&N({inst:E}),m(function(){h(E)&&N({inst:E})})},[m]),u(b),b}function h(m){var x=m.getSnapshot;m=m.value;try{var b=x();return!i(m,b)}catch{return!0}}function d(m,x){return x()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:f;return Qh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Qh}var Sb;function ZM(){return Sb||(Sb=1,Zh.exports=GM()),Zh.exports}var _b;function QM(){if(_b)return Gh;_b=1;var e=ao(),n=ZM();function i(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}var a=typeof Object.is=="function"?Object.is:i,s=n.useSyncExternalStore,o=e.useRef,u=e.useEffect,f=e.useMemo,h=e.useDebugValue;return Gh.useSyncExternalStoreWithSelector=function(d,g,m,x,b){var w=o(null);if(w.current===null){var E={hasValue:!1,value:null};w.current=E}else E=w.current;w=f(function(){function _(A){if(!D){if(D=!0,k=A,A=x(A),b!==void 0&&E.hasValue){var H=E.value;if(b(H,A))return C=H}return C=A}if(H=C,a(k,A))return H;var F=x(A);return b!==void 0&&b(H,F)?(k=A,H):(k=A,C=F)}var D=!1,k,C,L=m===void 0?null:m;return[function(){return _(g())},L===null?void 0:function(){return _(L())}]},[g,m,x,b]);var N=s(d,w[0],w[1]);return u(function(){E.hasValue=!0,E.value=N},[N]),h(N),N},Gh}var kb;function KM(){return kb||(kb=1,Fh.exports=QM()),Fh.exports}var JM=KM();const WM=Fc(JM),eT={},Eb=e=>{let n;const i=new Set,a=(g,m)=>{const x=typeof g=="function"?g(n):g;if(!Object.is(x,n)){const b=n;n=m??(typeof x!="object"||x===null)?x:Object.assign({},n,x),i.forEach(w=>w(n,b))}},s=()=>n,h={setState:a,getState:s,getInitialState:()=>d,subscribe:g=>(i.add(g),()=>i.delete(g)),destroy:()=>{(eT?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),i.clear()}},d=n=e(a,s,h);return h},tT=e=>e?Eb(e):Eb,{useDebugValue:nT}=Ls,{useSyncExternalStoreWithSelector:iT}=WM,rT=e=>e;function ww(e,n=rT,i){const a=iT(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,i);return nT(a),a}const Nb=(e,n)=>{const i=tT(e),a=(s,o=n)=>ww(i,s,o);return Object.assign(a,i),a},aT=(e,n)=>e?Nb(e,n):Nb;function ut(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[a,s]of e)if(!Object.is(s,n.get(a)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const a of e)if(!n.has(a))return!1;return!0}const i=Object.keys(e);if(i.length!==Object.keys(n).length)return!1;for(const a of i)if(!Object.prototype.hasOwnProperty.call(n,a)||!Object.is(e[a],n[a]))return!1;return!0}pv();const nf=Q.createContext(null),lT=nf.Provider,Sw=ri.error001();function Ye(e,n){const i=Q.useContext(nf);if(i===null)throw new Error(Sw);return ww(i,e,n)}function ct(){const e=Q.useContext(nf);if(e===null)throw new Error(Sw);return Q.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Cb={display:"none"},sT={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},_w="react-flow__node-desc",kw="react-flow__edge-desc",oT="react-flow__aria-live",uT=e=>e.ariaLiveMessage,cT=e=>e.ariaLabelConfig;function fT({rfId:e}){const n=Ye(uT);return v.jsx("div",{id:`${oT}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:sT,children:n})}function dT({rfId:e,disableKeyboardA11y:n}){const i=Ye(cT);return v.jsxs(v.Fragment,{children:[v.jsx("div",{id:`${_w}-${e}`,style:Cb,children:n?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),v.jsx("div",{id:`${kw}-${e}`,style:Cb,children:i["edge.a11yDescription.default"]}),!n&&v.jsx(fT,{rfId:e})]})}const rf=Q.forwardRef(({position:e="top-left",children:n,className:i,style:a,...s},o)=>{const u=`${e}`.split("-");return v.jsx("div",{className:_t(["react-flow__panel",i,...u]),style:a,ref:o,...s,children:n})});rf.displayName="Panel";function hT({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:v.jsx(rf,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:v.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const pT=e=>{const n=[],i=[];for(const[,a]of e.nodeLookup)a.selected&&n.push(a.internals.userNode);for(const[,a]of e.edgeLookup)a.selected&&i.push(a);return{selectedNodes:n,selectedEdges:i}},Ju=e=>e.id;function mT(e,n){return ut(e.selectedNodes.map(Ju),n.selectedNodes.map(Ju))&&ut(e.selectedEdges.map(Ju),n.selectedEdges.map(Ju))}function gT({onSelectionChange:e}){const n=ct(),{selectedNodes:i,selectedEdges:a}=Ye(pT,mT);return Q.useEffect(()=>{const s={nodes:i,edges:a};e?.(s),n.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[i,a,e]),null}const yT=e=>!!e.onSelectionChangeHandlers;function xT({onSelectionChange:e}){const n=Ye(yT);return e||n?v.jsx(gT,{onSelectionChange:e}):null}const Ew=[0,0],bT={x:0,y:0,zoom:1},vT=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Mb=[...vT,"rfId"],wT=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Tb={translateExtent:Qs,nodeOrigin:Ew,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function ST(e){const{setNodes:n,setEdges:i,setMinZoom:a,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:u,reset:f,setDefaultNodesAndEdges:h}=Ye(wT,ut),d=ct();Q.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{g.current=Tb,f()}),[]);const g=Q.useRef(Tb);return Q.useEffect(()=>{for(const m of Mb){const x=e[m],b=g.current[m];x!==b&&(typeof e[m]>"u"||(m==="nodes"?n(x):m==="edges"?i(x):m==="minZoom"?a(x):m==="maxZoom"?s(x):m==="translateExtent"?o(x):m==="nodeExtent"?u(x):m==="ariaLabelConfig"?d.setState({ariaLabelConfig:lM(x)}):m==="fitView"?d.setState({fitViewQueued:x}):m==="fitViewOptions"?d.setState({fitViewOptions:x}):d.setState({[m]:x})))}g.current=e},Mb.map(m=>e[m])),null}function Ab(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function _T(e){const[n,i]=Q.useState(e==="system"?null:e);return Q.useEffect(()=>{if(e!=="system"){i(e);return}const a=Ab(),s=()=>i(a?.matches?"dark":"light");return s(),a?.addEventListener("change",s),()=>{a?.removeEventListener("change",s)}},[e]),n!==null?n:Ab()?.matches?"dark":"light"}const zb=typeof document<"u"?document:null;function eo(e=null,n={target:zb,actInsideInputWithModifier:!0}){const[i,a]=Q.useState(!1),s=Q.useRef(!1),o=Q.useRef(new Set([])),[u,f]=Q.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
|
|
8
|
+
`+c.stack}}var Lt=Object.prototype.hasOwnProperty,Gt=e.unstable_scheduleCallback,Rn=e.unstable_cancelCallback,oi=e.unstable_shouldYield,si=e.unstable_requestPaint,Et=e.unstable_now,Ii=e.unstable_getCurrentPriorityLevel,ae=e.unstable_ImmediatePriority,pe=e.unstable_UserBlockingPriority,_e=e.unstable_NormalPriority,De=e.unstable_LowPriority,$e=e.unstable_IdlePriority,Vt=e.log,On=e.unstable_setDisableYieldValue,At=null,pt=null;function Ht(t){if(typeof Vt=="function"&&On(t),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode(At,t)}catch{}}var Ke=Math.clz32?Math.clz32:Sf,Gn=Math.log,sn=Math.LN2;function Sf(t){return t>>>=0,t===0?32:31-(Gn(t)/sn|0)|0}var la=256,oa=262144,sa=4194304;function ui(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ua(t,r,l){var c=t.pendingLanes;if(c===0)return 0;var p=0,y=t.suspendedLanes,S=t.pingedLanes;t=t.warmLanes;var M=c&134217727;return M!==0?(c=M&~y,c!==0?p=ui(c):(S&=M,S!==0?p=ui(S):l||(l=M&~t,l!==0&&(p=ui(l))))):(M=c&~y,M!==0?p=ui(M):S!==0?p=ui(S):l||(l=c&~t,l!==0&&(p=ui(l)))),p===0?0:r!==0&&r!==p&&(r&y)===0&&(y=p&-p,l=r&-r,y>=l||y===32&&(l&4194048)!==0)?r:p}function _r(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function _f(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _s(){var t=sa;return sa<<=1,(sa&62914560)===0&&(sa=4194304),t}function Sl(t){for(var r=[],l=0;31>l;l++)r.push(t);return r}function kr(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function kf(t,r,l,c,p,y){var S=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var M=t.entanglements,I=t.expirationTimes,W=t.hiddenUpdates;for(l=S&~l;0<l;){var le=31-Ke(l),se=1<<le;M[le]=0,I[le]=-1;var ee=W[le];if(ee!==null)for(W[le]=null,le=0;le<ee.length;le++){var re=ee[le];re!==null&&(re.lane&=-536870913)}l&=~se}c!==0&&ks(t,c,0),y!==0&&p===0&&t.tag!==0&&(t.suspendedLanes|=y&~(S&~r))}function ks(t,r,l){t.pendingLanes|=r,t.suspendedLanes&=~r;var c=31-Ke(r);t.entangledLanes|=r,t.entanglements[c]=t.entanglements[c]|1073741824|l&261930}function Es(t,r){var l=t.entangledLanes|=r;for(t=t.entanglements;l;){var c=31-Ke(l),p=1<<c;p&r|t[c]&r&&(t[c]|=r),l&=~p}}function Ns(t,r){var l=r&-r;return l=(l&42)!==0?1:_l(l),(l&(t.suspendedLanes|r))!==0?0:l}function _l(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 kl(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Cs(){var t=U.p;return t!==0?t:(t=window.event,t===void 0?32:Mx(t.type))}function Ms(t,r){var l=U.p;try{return U.p=t,r()}finally{U.p=l}}var Zn=Math.random().toString(36).slice(2),Nt="__reactFiber$"+Zn,Bt="__reactProps$"+Zn,ci="__reactContainer$"+Zn,ca="__reactEvents$"+Zn,Ts="__reactListeners$"+Zn,Ef="__reactHandles$"+Zn,As="__reactResources$"+Zn,Er="__reactMarker$"+Zn;function El(t){delete t[Nt],delete t[Bt],delete t[ca],delete t[Ts],delete t[Ef]}function qi(t){var r=t[Nt];if(r)return r;for(var l=t.parentNode;l;){if(r=l[ci]||l[Nt]){if(l=r.alternate,r.child!==null||l!==null&&l.child!==null)for(t=dx(t);t!==null;){if(l=t[Nt])return l;t=dx(t)}return r}t=l,l=t.parentNode}return null}function $i(t){if(t=t[Nt]||t[ci]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function Vi(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(a(33))}function Pi(t){var r=t[As];return r||(r=t[As]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function yt(t){t[Er]=!0}var zs=new Set,js={};function fi(t,r){Yi(t,r),Yi(t+"Capture",r)}function Yi(t,r){for(js[t]=r,t=0;t<r.length;t++)zs.add(r[t])}var Nf=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Nl={},Ds={};function Cf(t){return Lt.call(Ds,t)?!0:Lt.call(Nl,t)?!1:Nf.test(t)?Ds[t]=!0:(Nl[t]=!0,!1)}function fa(t,r,l){if(Cf(r))if(l===null)t.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var c=r.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+l)}}function da(t,r,l){if(l===null)t.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+l)}}function Ln(t,r,l,c){if(c===null)t.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(r,l,""+c)}}function Zt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Rs(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Mf(t,r,l){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,y=c.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return p.call(this)},set:function(S){l=""+S,y.call(this,S)}}),Object.defineProperty(t,r,{enumerable:c.enumerable}),{getValue:function(){return l},setValue:function(S){l=""+S},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function ha(t){if(!t._valueTracker){var r=Rs(t)?"checked":"value";t._valueTracker=Mf(t,r,""+t[r])}}function Os(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var l=r.getValue(),c="";return t&&(c=Rs(t)?t.checked?"true":"false":t.value),t=c,t!==l?(r.setValue(t),!0):!1}function Nr(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Tf=/[\n"\\]/g;function Qt(t){return t.replace(Tf,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Cr(t,r,l,c,p,y,S,M){t.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.type=S:t.removeAttribute("type"),r!=null?S==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Zt(r)):t.value!==""+Zt(r)&&(t.value=""+Zt(r)):S!=="submit"&&S!=="reset"||t.removeAttribute("value"),r!=null?Cl(t,S,Zt(r)):l!=null?Cl(t,S,Zt(l)):c!=null&&t.removeAttribute("value"),p==null&&y!=null&&(t.defaultChecked=!!y),p!=null&&(t.checked=p&&typeof p!="function"&&typeof p!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?t.name=""+Zt(M):t.removeAttribute("name")}function Ls(t,r,l,c,p,y,S,M){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.type=y),r!=null||l!=null){if(!(y!=="submit"&&y!=="reset"||r!=null)){ha(t);return}l=l!=null?""+Zt(l):"",r=r!=null?""+Zt(r):l,M||r===t.value||(t.value=r),t.defaultValue=r}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=M?t.checked:!!c,t.defaultChecked=!!c,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.name=S),ha(t)}function Cl(t,r,l){r==="number"&&Nr(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function di(t,r,l,c){if(t=t.options,r){r={};for(var p=0;p<l.length;p++)r["$"+l[p]]=!0;for(l=0;l<t.length;l++)p=r.hasOwnProperty("$"+t[l].value),t[l].selected!==p&&(t[l].selected=p),p&&c&&(t[l].defaultSelected=!0)}else{for(l=""+Zt(l),r=null,p=0;p<t.length;p++){if(t[p].value===l){t[p].selected=!0,c&&(t[p].defaultSelected=!0);return}r!==null||t[p].disabled||(r=t[p])}r!==null&&(r.selected=!0)}}function Wm(t,r,l){if(r!=null&&(r=""+Zt(r),r!==t.value&&(t.value=r),l==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=l!=null?""+Zt(l):""}function eg(t,r,l,c){if(r==null){if(c!=null){if(l!=null)throw Error(a(92));if(B(c)){if(1<c.length)throw Error(a(93));c=c[0]}l=c}l==null&&(l=""),r=l}l=Zt(r),t.defaultValue=l,c=t.textContent,c===l&&c!==""&&c!==null&&(t.value=c),ha(t)}function pa(t,r){if(r){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=r;return}}t.textContent=r}var i_=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function tg(t,r,l){var c=r.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?c?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":c?t.setProperty(r,l):typeof l!="number"||l===0||i_.has(r)?r==="float"?t.cssFloat=l:t[r]=(""+l).trim():t[r]=l+"px"}function ng(t,r,l){if(r!=null&&typeof r!="object")throw Error(a(62));if(t=t.style,l!=null){for(var c in l)!l.hasOwnProperty(c)||r!=null&&r.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var p in r)c=r[p],r.hasOwnProperty(p)&&l[p]!==c&&tg(t,p,c)}else for(var y in r)r.hasOwnProperty(y)&&tg(t,y,r[y])}function Af(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var r_=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),a_=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Hs(t){return a_.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function hi(){}var zf=null;function jf(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ma=null,ga=null;function ig(t){var r=$i(t);if(r&&(t=r.stateNode)){var l=t[Bt]||null;e:switch(t=r.stateNode,r.type){case"input":if(Cr(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),r=l.name,l.type==="radio"&&r!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Qt(""+r)+'"][type="radio"]'),r=0;r<l.length;r++){var c=l[r];if(c!==t&&c.form===t.form){var p=c[Bt]||null;if(!p)throw Error(a(90));Cr(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<l.length;r++)c=l[r],c.form===t.form&&Os(c)}break e;case"textarea":Wm(t,l.value,l.defaultValue);break e;case"select":r=l.value,r!=null&&di(t,!!l.multiple,r,!1)}}}var Df=!1;function rg(t,r,l){if(Df)return t(r,l);Df=!0;try{var c=t(r);return c}finally{if(Df=!1,(ma!==null||ga!==null)&&(ku(),ma&&(r=ma,t=ga,ga=ma=null,ig(r),t)))for(r=0;r<t.length;r++)ig(t[r])}}function Ml(t,r){var l=t.stateNode;if(l===null)return null;var c=l[Bt]||null;if(c===null)return null;l=c[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(a(231,r,typeof l));return l}var pi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rf=!1;if(pi)try{var Tl={};Object.defineProperty(Tl,"passive",{get:function(){Rf=!0}}),window.addEventListener("test",Tl,Tl),window.removeEventListener("test",Tl,Tl)}catch{Rf=!1}var Xi=null,Of=null,Bs=null;function ag(){if(Bs)return Bs;var t,r=Of,l=r.length,c,p="value"in Xi?Xi.value:Xi.textContent,y=p.length;for(t=0;t<l&&r[t]===p[t];t++);var S=l-t;for(c=1;c<=S&&r[l-c]===p[y-c];c++);return Bs=p.slice(t,1<c?1-c:void 0)}function Us(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 Is(){return!0}function lg(){return!1}function Kt(t){function r(l,c,p,y,S){this._reactName=l,this._targetInst=p,this.type=c,this.nativeEvent=y,this.target=S,this.currentTarget=null;for(var M in t)t.hasOwnProperty(M)&&(l=t[M],this[M]=l?l(y):y[M]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Is:lg,this.isPropagationStopped=lg,this}return m(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Is)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Is)},persist:function(){},isPersistent:Is}),r}var Mr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qs=Kt(Mr),Al=m({},Mr,{view:0,detail:0}),l_=Kt(Al),Lf,Hf,zl,$s=m({},Al,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uf,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==zl&&(zl&&t.type==="mousemove"?(Lf=t.screenX-zl.screenX,Hf=t.screenY-zl.screenY):Hf=Lf=0,zl=t),Lf)},movementY:function(t){return"movementY"in t?t.movementY:Hf}}),og=Kt($s),o_=m({},$s,{dataTransfer:0}),s_=Kt(o_),u_=m({},Al,{relatedTarget:0}),Bf=Kt(u_),c_=m({},Mr,{animationName:0,elapsedTime:0,pseudoElement:0}),f_=Kt(c_),d_=m({},Mr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),h_=Kt(d_),p_=m({},Mr,{data:0}),sg=Kt(p_),m_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},g_={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},y_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function x_(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=y_[t])?!!r[t]:!1}function Uf(){return x_}var b_=m({},Al,{key:function(t){if(t.key){var r=m_[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Us(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?g_[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uf,charCode:function(t){return t.type==="keypress"?Us(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Us(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),v_=Kt(b_),w_=m({},$s,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ug=Kt(w_),S_=m({},Al,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uf}),__=Kt(S_),k_=m({},Mr,{propertyName:0,elapsedTime:0,pseudoElement:0}),E_=Kt(k_),N_=m({},$s,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),C_=Kt(N_),M_=m({},Mr,{newState:0,oldState:0}),T_=Kt(M_),A_=[9,13,27,32],If=pi&&"CompositionEvent"in window,jl=null;pi&&"documentMode"in document&&(jl=document.documentMode);var z_=pi&&"TextEvent"in window&&!jl,cg=pi&&(!If||jl&&8<jl&&11>=jl),fg=" ",dg=!1;function hg(t,r){switch(t){case"keyup":return A_.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ya=!1;function j_(t,r){switch(t){case"compositionend":return pg(r);case"keypress":return r.which!==32?null:(dg=!0,fg);case"textInput":return t=r.data,t===fg&&dg?null:t;default:return null}}function D_(t,r){if(ya)return t==="compositionend"||!If&&hg(t,r)?(t=ag(),Bs=Of=Xi=null,ya=!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 cg&&r.locale!=="ko"?null:r.data;default:return null}}var R_={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function mg(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!R_[t.type]:r==="textarea"}function gg(t,r,l,c){ma?ga?ga.push(c):ga=[c]:ma=c,r=zu(r,"onChange"),0<r.length&&(l=new qs("onChange","change",null,l,c),t.push({event:l,listeners:r}))}var Dl=null,Rl=null;function O_(t){Jy(t,0)}function Vs(t){var r=Vi(t);if(Os(r))return t}function yg(t,r){if(t==="change")return r}var xg=!1;if(pi){var qf;if(pi){var $f="oninput"in document;if(!$f){var bg=document.createElement("div");bg.setAttribute("oninput","return;"),$f=typeof bg.oninput=="function"}qf=$f}else qf=!1;xg=qf&&(!document.documentMode||9<document.documentMode)}function vg(){Dl&&(Dl.detachEvent("onpropertychange",wg),Rl=Dl=null)}function wg(t){if(t.propertyName==="value"&&Vs(Rl)){var r=[];gg(r,Rl,t,jf(t)),rg(O_,r)}}function L_(t,r,l){t==="focusin"?(vg(),Dl=r,Rl=l,Dl.attachEvent("onpropertychange",wg)):t==="focusout"&&vg()}function H_(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Vs(Rl)}function B_(t,r){if(t==="click")return Vs(r)}function U_(t,r){if(t==="input"||t==="change")return Vs(r)}function I_(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var un=typeof Object.is=="function"?Object.is:I_;function Ol(t,r){if(un(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var l=Object.keys(t),c=Object.keys(r);if(l.length!==c.length)return!1;for(c=0;c<l.length;c++){var p=l[c];if(!Lt.call(r,p)||!un(t[p],r[p]))return!1}return!0}function Sg(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function _g(t,r){var l=Sg(t);t=0;for(var c;l;){if(l.nodeType===3){if(c=t+l.textContent.length,t<=r&&c>=r)return{node:l,offset:r-t};t=c}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Sg(l)}}function kg(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?kg(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Eg(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Nr(t.document);r instanceof t.HTMLIFrameElement;){try{var l=typeof r.contentWindow.location.href=="string"}catch{l=!1}if(l)t=r.contentWindow;else break;r=Nr(t.document)}return r}function Vf(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var q_=pi&&"documentMode"in document&&11>=document.documentMode,xa=null,Pf=null,Ll=null,Yf=!1;function Ng(t,r,l){var c=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Yf||xa==null||xa!==Nr(c)||(c=xa,"selectionStart"in c&&Vf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Ll&&Ol(Ll,c)||(Ll=c,c=zu(Pf,"onSelect"),0<c.length&&(r=new qs("onSelect","select",null,r,l),t.push({event:r,listeners:c}),r.target=xa)))}function Tr(t,r){var l={};return l[t.toLowerCase()]=r.toLowerCase(),l["Webkit"+t]="webkit"+r,l["Moz"+t]="moz"+r,l}var ba={animationend:Tr("Animation","AnimationEnd"),animationiteration:Tr("Animation","AnimationIteration"),animationstart:Tr("Animation","AnimationStart"),transitionrun:Tr("Transition","TransitionRun"),transitionstart:Tr("Transition","TransitionStart"),transitioncancel:Tr("Transition","TransitionCancel"),transitionend:Tr("Transition","TransitionEnd")},Xf={},Cg={};pi&&(Cg=document.createElement("div").style,"AnimationEvent"in window||(delete ba.animationend.animation,delete ba.animationiteration.animation,delete ba.animationstart.animation),"TransitionEvent"in window||delete ba.transitionend.transition);function Ar(t){if(Xf[t])return Xf[t];if(!ba[t])return t;var r=ba[t],l;for(l in r)if(r.hasOwnProperty(l)&&l in Cg)return Xf[t]=r[l];return t}var Mg=Ar("animationend"),Tg=Ar("animationiteration"),Ag=Ar("animationstart"),$_=Ar("transitionrun"),V_=Ar("transitionstart"),P_=Ar("transitioncancel"),zg=Ar("transitionend"),jg=new Map,Ff="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ff.push("scrollEnd");function Hn(t,r){jg.set(t,r),fi(r,[t])}var Ps=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},_n=[],va=0,Gf=0;function Ys(){for(var t=va,r=Gf=va=0;r<t;){var l=_n[r];_n[r++]=null;var c=_n[r];_n[r++]=null;var p=_n[r];_n[r++]=null;var y=_n[r];if(_n[r++]=null,c!==null&&p!==null){var S=c.pending;S===null?p.next=p:(p.next=S.next,S.next=p),c.pending=p}y!==0&&Dg(l,p,y)}}function Xs(t,r,l,c){_n[va++]=t,_n[va++]=r,_n[va++]=l,_n[va++]=c,Gf|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function Zf(t,r,l,c){return Xs(t,r,l,c),Fs(t)}function zr(t,r){return Xs(t,null,null,r),Fs(t)}function Dg(t,r,l){t.lanes|=l;var c=t.alternate;c!==null&&(c.lanes|=l);for(var p=!1,y=t.return;y!==null;)y.childLanes|=l,c=y.alternate,c!==null&&(c.childLanes|=l),y.tag===22&&(t=y.stateNode,t===null||t._visibility&1||(p=!0)),t=y,y=y.return;return t.tag===3?(y=t.stateNode,p&&r!==null&&(p=31-Ke(l),t=y.hiddenUpdates,c=t[p],c===null?t[p]=[r]:c.push(r),r.lane=l|536870912),y):null}function Fs(t){if(50<ro)throw ro=0,rh=null,Error(a(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var wa={};function Y_(t,r,l,c){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cn(t,r,l,c){return new Y_(t,r,l,c)}function Qf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function mi(t,r){var l=t.alternate;return l===null?(l=cn(t.tag,r,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=r,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,r=t.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function Rg(t,r){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,r=l.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function Gs(t,r,l,c,p,y){var S=0;if(c=t,typeof t=="function")Qf(t)&&(S=1);else if(typeof t=="string")S=Qk(t,l,ie.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case G:return t=cn(31,l,r,p),t.elementType=G,t.lanes=y,t;case E:return jr(l.children,p,y,r);case N:S=8,p|=24;break;case _:return t=cn(12,l,r,p|2),t.elementType=_,t.lanes=y,t;case L:return t=cn(13,l,r,p),t.elementType=L,t.lanes=y,t;case A:return t=cn(19,l,r,p),t.elementType=A,t.lanes=y,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case k:S=10;break e;case D:S=9;break e;case C:S=11;break e;case H:S=14;break e;case F:S=16,c=null;break e}S=29,l=Error(a(130,t===null?"null":typeof t,"")),c=null}return r=cn(S,l,r,p),r.elementType=t,r.type=c,r.lanes=y,r}function jr(t,r,l,c){return t=cn(7,t,c,r),t.lanes=l,t}function Kf(t,r,l){return t=cn(6,t,null,r),t.lanes=l,t}function Og(t){var r=cn(18,null,null,0);return r.stateNode=t,r}function Jf(t,r,l){return r=cn(4,t.children!==null?t.children:[],t.key,r),r.lanes=l,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var Lg=new WeakMap;function kn(t,r){if(typeof t=="object"&&t!==null){var l=Lg.get(t);return l!==void 0?l:(r={value:t,source:r,stack:on(r)},Lg.set(t,r),r)}return{value:t,source:r,stack:on(r)}}var Sa=[],_a=0,Zs=null,Hl=0,En=[],Nn=0,Fi=null,Qn=1,Kn="";function gi(t,r){Sa[_a++]=Hl,Sa[_a++]=Zs,Zs=t,Hl=r}function Hg(t,r,l){En[Nn++]=Qn,En[Nn++]=Kn,En[Nn++]=Fi,Fi=t;var c=Qn;t=Kn;var p=32-Ke(c)-1;c&=~(1<<p),l+=1;var y=32-Ke(r)+p;if(30<y){var S=p-p%5;y=(c&(1<<S)-1).toString(32),c>>=S,p-=S,Qn=1<<32-Ke(r)+p|l<<p|c,Kn=y+t}else Qn=1<<y|l<<p|c,Kn=t}function Wf(t){t.return!==null&&(gi(t,1),Hg(t,1,0))}function ed(t){for(;t===Zs;)Zs=Sa[--_a],Sa[_a]=null,Hl=Sa[--_a],Sa[_a]=null;for(;t===Fi;)Fi=En[--Nn],En[Nn]=null,Kn=En[--Nn],En[Nn]=null,Qn=En[--Nn],En[Nn]=null}function Bg(t,r){En[Nn++]=Qn,En[Nn++]=Kn,En[Nn++]=Fi,Qn=r.id,Kn=r.overflow,Fi=t}var zt=null,lt=null,qe=!1,Gi=null,Cn=!1,td=Error(a(519));function Zi(t){var r=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Bl(kn(r,t)),td}function Ug(t){var r=t.stateNode,l=t.type,c=t.memoizedProps;switch(r[Nt]=t,r[Bt]=c,l){case"dialog":He("cancel",r),He("close",r);break;case"iframe":case"object":case"embed":He("load",r);break;case"video":case"audio":for(l=0;l<lo.length;l++)He(lo[l],r);break;case"source":He("error",r);break;case"img":case"image":case"link":He("error",r),He("load",r);break;case"details":He("toggle",r);break;case"input":He("invalid",r),Ls(r,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":He("invalid",r);break;case"textarea":He("invalid",r),eg(r,c.value,c.defaultValue,c.children)}l=c.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||r.textContent===""+l||c.suppressHydrationWarning===!0||nx(r.textContent,l)?(c.popover!=null&&(He("beforetoggle",r),He("toggle",r)),c.onScroll!=null&&He("scroll",r),c.onScrollEnd!=null&&He("scrollend",r),c.onClick!=null&&(r.onclick=hi),r=!0):r=!1,r||Zi(t,!0)}function Ig(t){for(zt=t.return;zt;)switch(zt.tag){case 5:case 31:case 13:Cn=!1;return;case 27:case 3:Cn=!0;return;default:zt=zt.return}}function ka(t){if(t!==zt)return!1;if(!qe)return Ig(t),qe=!0,!1;var r=t.tag,l;if((l=r!==3&&r!==27)&&((l=r===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||bh(t.type,t.memoizedProps)),l=!l),l&<&&Zi(t),Ig(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));lt=fx(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));lt=fx(t)}else r===27?(r=lt,ur(t.type)?(t=kh,kh=null,lt=t):lt=r):lt=zt?Tn(t.stateNode.nextSibling):null;return!0}function Dr(){lt=zt=null,qe=!1}function nd(){var t=Gi;return t!==null&&(tn===null?tn=t:tn.push.apply(tn,t),Gi=null),t}function Bl(t){Gi===null?Gi=[t]:Gi.push(t)}var id=R(null),Rr=null,yi=null;function Qi(t,r,l){T(id,r._currentValue),r._currentValue=l}function xi(t){t._currentValue=id.current,$(id)}function rd(t,r,l){for(;t!==null;){var c=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,c!==null&&(c.childLanes|=r)):c!==null&&(c.childLanes&r)!==r&&(c.childLanes|=r),t===l)break;t=t.return}}function ad(t,r,l,c){var p=t.child;for(p!==null&&(p.return=t);p!==null;){var y=p.dependencies;if(y!==null){var S=p.child;y=y.firstContext;e:for(;y!==null;){var M=y;y=p;for(var I=0;I<r.length;I++)if(M.context===r[I]){y.lanes|=l,M=y.alternate,M!==null&&(M.lanes|=l),rd(y.return,l,t),c||(S=null);break e}y=M.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(a(341));S.lanes|=l,y=S.alternate,y!==null&&(y.lanes|=l),rd(S,l,t),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===t){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function Ea(t,r,l,c){t=null;for(var p=r,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var S=p.alternate;if(S===null)throw Error(a(387));if(S=S.memoizedProps,S!==null){var M=p.type;un(p.pendingProps.value,S.value)||(t!==null?t.push(M):t=[M])}}else if(p===he.current){if(S=p.alternate,S===null)throw Error(a(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(t!==null?t.push(fo):t=[fo])}p=p.return}t!==null&&ad(r,t,l,c),r.flags|=262144}function Qs(t){for(t=t.firstContext;t!==null;){if(!un(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Or(t){Rr=t,yi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function jt(t){return qg(Rr,t)}function Ks(t,r){return Rr===null&&Or(t),qg(t,r)}function qg(t,r){var l=r._currentValue;if(r={context:r,memoizedValue:l,next:null},yi===null){if(t===null)throw Error(a(308));yi=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else yi=yi.next=r;return l}var X_=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(l,c){t.push(c)}};this.abort=function(){r.aborted=!0,t.forEach(function(l){return l()})}},F_=e.unstable_scheduleCallback,G_=e.unstable_NormalPriority,xt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ld(){return{controller:new X_,data:new Map,refCount:0}}function Ul(t){t.refCount--,t.refCount===0&&F_(G_,function(){t.controller.abort()})}var Il=null,od=0,Na=0,Ca=null;function Z_(t,r){if(Il===null){var l=Il=[];od=0,Na=ch(),Ca={status:"pending",value:void 0,then:function(c){l.push(c)}}}return od++,r.then($g,$g),r}function $g(){if(--od===0&&Il!==null){Ca!==null&&(Ca.status="fulfilled");var t=Il;Il=null,Na=0,Ca=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function Q_(t,r){var l=[],c={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return t.then(function(){c.status="fulfilled",c.value=r;for(var p=0;p<l.length;p++)(0,l[p])(r)},function(p){for(c.status="rejected",c.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),c}var Vg=j.S;j.S=function(t,r){Ny=Et(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&Z_(t,r),Vg!==null&&Vg(t,r)};var Lr=R(null);function sd(){var t=Lr.current;return t!==null?t:it.pooledCache}function Js(t,r){r===null?T(Lr,Lr.current):T(Lr,r.pool)}function Pg(){var t=sd();return t===null?null:{parent:xt._currentValue,pool:t}}var Ma=Error(a(460)),ud=Error(a(474)),Ws=Error(a(542)),eu={then:function(){}};function Yg(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Xg(t,r,l){switch(l=t[l],l===void 0?t.push(r):l!==r&&(r.then(hi,hi),r=l),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Gg(t),t;default:if(typeof r.status=="string")r.then(hi,hi);else{if(t=it,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=r,t.status="pending",t.then(function(c){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=c}},function(c){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=c}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Gg(t),t}throw Br=r,Ma}}function Hr(t){try{var r=t._init;return r(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Br=l,Ma):l}}var Br=null;function Fg(){if(Br===null)throw Error(a(459));var t=Br;return Br=null,t}function Gg(t){if(t===Ma||t===Ws)throw Error(a(483))}var Ta=null,ql=0;function tu(t){var r=ql;return ql+=1,Ta===null&&(Ta=[]),Xg(Ta,t,r)}function $l(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function nu(t,r){throw r.$$typeof===x?Error(a(525)):(t=Object.prototype.toString.call(r),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function Zg(t){function r(Z,X){if(t){var J=Z.deletions;J===null?(Z.deletions=[X],Z.flags|=16):J.push(X)}}function l(Z,X){if(!t)return null;for(;X!==null;)r(Z,X),X=X.sibling;return null}function c(Z){for(var X=new Map;Z!==null;)Z.key!==null?X.set(Z.key,Z):X.set(Z.index,Z),Z=Z.sibling;return X}function p(Z,X){return Z=mi(Z,X),Z.index=0,Z.sibling=null,Z}function y(Z,X,J){return Z.index=J,t?(J=Z.alternate,J!==null?(J=J.index,J<X?(Z.flags|=67108866,X):J):(Z.flags|=67108866,X)):(Z.flags|=1048576,X)}function S(Z){return t&&Z.alternate===null&&(Z.flags|=67108866),Z}function M(Z,X,J,oe){return X===null||X.tag!==6?(X=Kf(J,Z.mode,oe),X.return=Z,X):(X=p(X,J),X.return=Z,X)}function I(Z,X,J,oe){var ve=J.type;return ve===E?le(Z,X,J.props.children,oe,J.key):X!==null&&(X.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===F&&Hr(ve)===X.type)?(X=p(X,J.props),$l(X,J),X.return=Z,X):(X=Gs(J.type,J.key,J.props,null,Z.mode,oe),$l(X,J),X.return=Z,X)}function W(Z,X,J,oe){return X===null||X.tag!==4||X.stateNode.containerInfo!==J.containerInfo||X.stateNode.implementation!==J.implementation?(X=Jf(J,Z.mode,oe),X.return=Z,X):(X=p(X,J.children||[]),X.return=Z,X)}function le(Z,X,J,oe,ve){return X===null||X.tag!==7?(X=jr(J,Z.mode,oe,ve),X.return=Z,X):(X=p(X,J),X.return=Z,X)}function se(Z,X,J){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=Kf(""+X,Z.mode,J),X.return=Z,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case b:return J=Gs(X.type,X.key,X.props,null,Z.mode,J),$l(J,X),J.return=Z,J;case w:return X=Jf(X,Z.mode,J),X.return=Z,X;case F:return X=Hr(X),se(Z,X,J)}if(B(X)||P(X))return X=jr(X,Z.mode,J,null),X.return=Z,X;if(typeof X.then=="function")return se(Z,tu(X),J);if(X.$$typeof===k)return se(Z,Ks(Z,X),J);nu(Z,X)}return null}function ee(Z,X,J,oe){var ve=X!==null?X.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return ve!==null?null:M(Z,X,""+J,oe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return J.key===ve?I(Z,X,J,oe):null;case w:return J.key===ve?W(Z,X,J,oe):null;case F:return J=Hr(J),ee(Z,X,J,oe)}if(B(J)||P(J))return ve!==null?null:le(Z,X,J,oe,null);if(typeof J.then=="function")return ee(Z,X,tu(J),oe);if(J.$$typeof===k)return ee(Z,X,Ks(Z,J),oe);nu(Z,J)}return null}function re(Z,X,J,oe,ve){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Z=Z.get(J)||null,M(X,Z,""+oe,ve);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:return Z=Z.get(oe.key===null?J:oe.key)||null,I(X,Z,oe,ve);case w:return Z=Z.get(oe.key===null?J:oe.key)||null,W(X,Z,oe,ve);case F:return oe=Hr(oe),re(Z,X,J,oe,ve)}if(B(oe)||P(oe))return Z=Z.get(J)||null,le(X,Z,oe,ve,null);if(typeof oe.then=="function")return re(Z,X,J,tu(oe),ve);if(oe.$$typeof===k)return re(Z,X,J,Ks(X,oe),ve);nu(X,oe)}return null}function ye(Z,X,J,oe){for(var ve=null,Fe=null,xe=X,ze=X=0,Ie=null;xe!==null&&ze<J.length;ze++){xe.index>ze?(Ie=xe,xe=null):Ie=xe.sibling;var Ge=ee(Z,xe,J[ze],oe);if(Ge===null){xe===null&&(xe=Ie);break}t&&xe&&Ge.alternate===null&&r(Z,xe),X=y(Ge,X,ze),Fe===null?ve=Ge:Fe.sibling=Ge,Fe=Ge,xe=Ie}if(ze===J.length)return l(Z,xe),qe&&gi(Z,ze),ve;if(xe===null){for(;ze<J.length;ze++)xe=se(Z,J[ze],oe),xe!==null&&(X=y(xe,X,ze),Fe===null?ve=xe:Fe.sibling=xe,Fe=xe);return qe&&gi(Z,ze),ve}for(xe=c(xe);ze<J.length;ze++)Ie=re(xe,Z,ze,J[ze],oe),Ie!==null&&(t&&Ie.alternate!==null&&xe.delete(Ie.key===null?ze:Ie.key),X=y(Ie,X,ze),Fe===null?ve=Ie:Fe.sibling=Ie,Fe=Ie);return t&&xe.forEach(function(pr){return r(Z,pr)}),qe&&gi(Z,ze),ve}function ke(Z,X,J,oe){if(J==null)throw Error(a(151));for(var ve=null,Fe=null,xe=X,ze=X=0,Ie=null,Ge=J.next();xe!==null&&!Ge.done;ze++,Ge=J.next()){xe.index>ze?(Ie=xe,xe=null):Ie=xe.sibling;var pr=ee(Z,xe,Ge.value,oe);if(pr===null){xe===null&&(xe=Ie);break}t&&xe&&pr.alternate===null&&r(Z,xe),X=y(pr,X,ze),Fe===null?ve=pr:Fe.sibling=pr,Fe=pr,xe=Ie}if(Ge.done)return l(Z,xe),qe&&gi(Z,ze),ve;if(xe===null){for(;!Ge.done;ze++,Ge=J.next())Ge=se(Z,Ge.value,oe),Ge!==null&&(X=y(Ge,X,ze),Fe===null?ve=Ge:Fe.sibling=Ge,Fe=Ge);return qe&&gi(Z,ze),ve}for(xe=c(xe);!Ge.done;ze++,Ge=J.next())Ge=re(xe,Z,ze,Ge.value,oe),Ge!==null&&(t&&Ge.alternate!==null&&xe.delete(Ge.key===null?ze:Ge.key),X=y(Ge,X,ze),Fe===null?ve=Ge:Fe.sibling=Ge,Fe=Ge);return t&&xe.forEach(function(oE){return r(Z,oE)}),qe&&gi(Z,ze),ve}function nt(Z,X,J,oe){if(typeof J=="object"&&J!==null&&J.type===E&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case b:e:{for(var ve=J.key;X!==null;){if(X.key===ve){if(ve=J.type,ve===E){if(X.tag===7){l(Z,X.sibling),oe=p(X,J.props.children),oe.return=Z,Z=oe;break e}}else if(X.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===F&&Hr(ve)===X.type){l(Z,X.sibling),oe=p(X,J.props),$l(oe,J),oe.return=Z,Z=oe;break e}l(Z,X);break}else r(Z,X);X=X.sibling}J.type===E?(oe=jr(J.props.children,Z.mode,oe,J.key),oe.return=Z,Z=oe):(oe=Gs(J.type,J.key,J.props,null,Z.mode,oe),$l(oe,J),oe.return=Z,Z=oe)}return S(Z);case w:e:{for(ve=J.key;X!==null;){if(X.key===ve)if(X.tag===4&&X.stateNode.containerInfo===J.containerInfo&&X.stateNode.implementation===J.implementation){l(Z,X.sibling),oe=p(X,J.children||[]),oe.return=Z,Z=oe;break e}else{l(Z,X);break}else r(Z,X);X=X.sibling}oe=Jf(J,Z.mode,oe),oe.return=Z,Z=oe}return S(Z);case F:return J=Hr(J),nt(Z,X,J,oe)}if(B(J))return ye(Z,X,J,oe);if(P(J)){if(ve=P(J),typeof ve!="function")throw Error(a(150));return J=ve.call(J),ke(Z,X,J,oe)}if(typeof J.then=="function")return nt(Z,X,tu(J),oe);if(J.$$typeof===k)return nt(Z,X,Ks(Z,J),oe);nu(Z,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,X!==null&&X.tag===6?(l(Z,X.sibling),oe=p(X,J),oe.return=Z,Z=oe):(l(Z,X),oe=Kf(J,Z.mode,oe),oe.return=Z,Z=oe),S(Z)):l(Z,X)}return function(Z,X,J,oe){try{ql=0;var ve=nt(Z,X,J,oe);return Ta=null,ve}catch(xe){if(xe===Ma||xe===Ws)throw xe;var Fe=cn(29,xe,null,Z.mode);return Fe.lanes=oe,Fe.return=Z,Fe}}}var Ur=Zg(!0),Qg=Zg(!1),Ki=!1;function cd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fd(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ji(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Wi(t,r,l){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(Qe&2)!==0){var p=c.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),c.pending=r,r=Fs(t),Dg(t,null,l),r}return Xs(t,c,r,l),Fs(t)}function Vl(t,r,l){if(r=r.updateQueue,r!==null&&(r=r.shared,(l&4194048)!==0)){var c=r.lanes;c&=t.pendingLanes,l|=c,r.lanes=l,Es(t,l)}}function dd(t,r){var l=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,l===c)){var p=null,y=null;if(l=l.firstBaseUpdate,l!==null){do{var S={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};y===null?p=y=S:y=y.next=S,l=l.next}while(l!==null);y===null?p=y=r:y=y.next=r}else p=y=r;l={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:c.shared,callbacks:c.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=r:t.next=r,l.lastBaseUpdate=r}var hd=!1;function Pl(){if(hd){var t=Ca;if(t!==null)throw t}}function Yl(t,r,l,c){hd=!1;var p=t.updateQueue;Ki=!1;var y=p.firstBaseUpdate,S=p.lastBaseUpdate,M=p.shared.pending;if(M!==null){p.shared.pending=null;var I=M,W=I.next;I.next=null,S===null?y=W:S.next=W,S=I;var le=t.alternate;le!==null&&(le=le.updateQueue,M=le.lastBaseUpdate,M!==S&&(M===null?le.firstBaseUpdate=W:M.next=W,le.lastBaseUpdate=I))}if(y!==null){var se=p.baseState;S=0,le=W=I=null,M=y;do{var ee=M.lane&-536870913,re=ee!==M.lane;if(re?(Ue&ee)===ee:(c&ee)===ee){ee!==0&&ee===Na&&(hd=!0),le!==null&&(le=le.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var ye=t,ke=M;ee=r;var nt=l;switch(ke.tag){case 1:if(ye=ke.payload,typeof ye=="function"){se=ye.call(nt,se,ee);break e}se=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=ke.payload,ee=typeof ye=="function"?ye.call(nt,se,ee):ye,ee==null)break e;se=m({},se,ee);break e;case 2:Ki=!0}}ee=M.callback,ee!==null&&(t.flags|=64,re&&(t.flags|=8192),re=p.callbacks,re===null?p.callbacks=[ee]:re.push(ee))}else re={lane:ee,tag:M.tag,payload:M.payload,callback:M.callback,next:null},le===null?(W=le=re,I=se):le=le.next=re,S|=ee;if(M=M.next,M===null){if(M=p.shared.pending,M===null)break;re=M,M=re.next,re.next=null,p.lastBaseUpdate=re,p.shared.pending=null}}while(!0);le===null&&(I=se),p.baseState=I,p.firstBaseUpdate=W,p.lastBaseUpdate=le,y===null&&(p.shared.lanes=0),rr|=S,t.lanes=S,t.memoizedState=se}}function Kg(t,r){if(typeof t!="function")throw Error(a(191,t));t.call(r)}function Jg(t,r){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Kg(l[t],r)}var Aa=R(null),iu=R(0);function Wg(t,r){t=Ci,T(iu,t),T(Aa,r),Ci=t|r.baseLanes}function pd(){T(iu,Ci),T(Aa,Aa.current)}function md(){Ci=iu.current,$(Aa),$(iu)}var fn=R(null),Mn=null;function er(t){var r=t.alternate;T(mt,mt.current&1),T(fn,t),Mn===null&&(r===null||Aa.current!==null||r.memoizedState!==null)&&(Mn=t)}function gd(t){T(mt,mt.current),T(fn,t),Mn===null&&(Mn=t)}function e0(t){t.tag===22?(T(mt,mt.current),T(fn,t),Mn===null&&(Mn=t)):tr()}function tr(){T(mt,mt.current),T(fn,fn.current)}function dn(t){$(fn),Mn===t&&(Mn=null),$(mt)}var mt=R(0);function ru(t){for(var r=t;r!==null;){if(r.tag===13){var l=r.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Sh(l)||_h(l)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var bi=0,Ae=null,et=null,bt=null,au=!1,za=!1,Ir=!1,lu=0,Xl=0,ja=null,K_=0;function ft(){throw Error(a(321))}function yd(t,r){if(r===null)return!1;for(var l=0;l<r.length&&l<t.length;l++)if(!un(t[l],r[l]))return!1;return!0}function xd(t,r,l,c,p,y){return bi=y,Ae=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,j.H=t===null||t.memoizedState===null?H0:Dd,Ir=!1,y=l(c,p),Ir=!1,za&&(y=n0(r,l,c,p)),t0(t),y}function t0(t){j.H=Zl;var r=et!==null&&et.next!==null;if(bi=0,bt=et=Ae=null,au=!1,Xl=0,ja=null,r)throw Error(a(300));t===null||vt||(t=t.dependencies,t!==null&&Qs(t)&&(vt=!0))}function n0(t,r,l,c){Ae=t;var p=0;do{if(za&&(ja=null),Xl=0,za=!1,25<=p)throw Error(a(301));if(p+=1,bt=et=null,t.updateQueue!=null){var y=t.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}j.H=B0,y=r(l,c)}while(za);return y}function J_(){var t=j.H,r=t.useState()[0];return r=typeof r.then=="function"?Fl(r):r,t=t.useState()[0],(et!==null?et.memoizedState:null)!==t&&(Ae.flags|=1024),r}function bd(){var t=lu!==0;return lu=0,t}function vd(t,r,l){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~l}function wd(t){if(au){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}au=!1}bi=0,bt=et=Ae=null,za=!1,Xl=lu=0,ja=null}function Pt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?Ae.memoizedState=bt=t:bt=bt.next=t,bt}function gt(){if(et===null){var t=Ae.alternate;t=t!==null?t.memoizedState:null}else t=et.next;var r=bt===null?Ae.memoizedState:bt.next;if(r!==null)bt=r,et=t;else{if(t===null)throw Ae.alternate===null?Error(a(467)):Error(a(310));et=t,t={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},bt===null?Ae.memoizedState=bt=t:bt=bt.next=t}return bt}function ou(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fl(t){var r=Xl;return Xl+=1,ja===null&&(ja=[]),t=Xg(ja,t,r),r=Ae,(bt===null?r.memoizedState:bt.next)===null&&(r=r.alternate,j.H=r===null||r.memoizedState===null?H0:Dd),t}function su(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Fl(t);if(t.$$typeof===k)return jt(t)}throw Error(a(438,String(t)))}function Sd(t){var r=null,l=Ae.updateQueue;if(l!==null&&(r=l.memoCache),r==null){var c=Ae.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(r={data:c.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),l===null&&(l=ou(),Ae.updateQueue=l),l.memoCache=r,l=r.data[r.index],l===void 0)for(l=r.data[r.index]=Array(t),c=0;c<t;c++)l[c]=q;return r.index++,l}function vi(t,r){return typeof r=="function"?r(t):r}function uu(t){var r=gt();return _d(r,et,t)}function _d(t,r,l){var c=t.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=l;var p=t.baseQueue,y=c.pending;if(y!==null){if(p!==null){var S=p.next;p.next=y.next,y.next=S}r.baseQueue=p=y,c.pending=null}if(y=t.baseState,p===null)t.memoizedState=y;else{r=p.next;var M=S=null,I=null,W=r,le=!1;do{var se=W.lane&-536870913;if(se!==W.lane?(Ue&se)===se:(bi&se)===se){var ee=W.revertLane;if(ee===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),se===Na&&(le=!0);else if((bi&ee)===ee){W=W.next,ee===Na&&(le=!0);continue}else se={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},I===null?(M=I=se,S=y):I=I.next=se,Ae.lanes|=ee,rr|=ee;se=W.action,Ir&&l(y,se),y=W.hasEagerState?W.eagerState:l(y,se)}else ee={lane:se,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},I===null?(M=I=ee,S=y):I=I.next=ee,Ae.lanes|=se,rr|=se;W=W.next}while(W!==null&&W!==r);if(I===null?S=y:I.next=M,!un(y,t.memoizedState)&&(vt=!0,le&&(l=Ca,l!==null)))throw l;t.memoizedState=y,t.baseState=S,t.baseQueue=I,c.lastRenderedState=y}return p===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function kd(t){var r=gt(),l=r.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=t;var c=l.dispatch,p=l.pending,y=r.memoizedState;if(p!==null){l.pending=null;var S=p=p.next;do y=t(y,S.action),S=S.next;while(S!==p);un(y,r.memoizedState)||(vt=!0),r.memoizedState=y,r.baseQueue===null&&(r.baseState=y),l.lastRenderedState=y}return[y,c]}function i0(t,r,l){var c=Ae,p=gt(),y=qe;if(y){if(l===void 0)throw Error(a(407));l=l()}else l=r();var S=!un((et||p).memoizedState,l);if(S&&(p.memoizedState=l,vt=!0),p=p.queue,Cd(l0.bind(null,c,p,t),[t]),p.getSnapshot!==r||S||bt!==null&&bt.memoizedState.tag&1){if(c.flags|=2048,Da(9,{destroy:void 0},a0.bind(null,c,p,l,r),null),it===null)throw Error(a(349));y||(bi&127)!==0||r0(c,r,l)}return l}function r0(t,r,l){t.flags|=16384,t={getSnapshot:r,value:l},r=Ae.updateQueue,r===null?(r=ou(),Ae.updateQueue=r,r.stores=[t]):(l=r.stores,l===null?r.stores=[t]:l.push(t))}function a0(t,r,l,c){r.value=l,r.getSnapshot=c,o0(r)&&s0(t)}function l0(t,r,l){return l(function(){o0(r)&&s0(t)})}function o0(t){var r=t.getSnapshot;t=t.value;try{var l=r();return!un(t,l)}catch{return!0}}function s0(t){var r=zr(t,2);r!==null&&nn(r,t,2)}function Ed(t){var r=Pt();if(typeof t=="function"){var l=t;if(t=l(),Ir){Ht(!0);try{l()}finally{Ht(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:t},r}function u0(t,r,l,c){return t.baseState=l,_d(t,et,typeof c=="function"?c:vi)}function W_(t,r,l,c,p){if(du(t))throw Error(a(485));if(t=r.action,t!==null){var y={payload:p,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){y.listeners.push(S)}};j.T!==null?l(!0):y.isTransition=!1,c(y),l=r.pending,l===null?(y.next=r.pending=y,c0(r,y)):(y.next=l.next,r.pending=l.next=y)}}function c0(t,r){var l=r.action,c=r.payload,p=t.state;if(r.isTransition){var y=j.T,S={};j.T=S;try{var M=l(p,c),I=j.S;I!==null&&I(S,M),f0(t,r,M)}catch(W){Nd(t,r,W)}finally{y!==null&&S.types!==null&&(y.types=S.types),j.T=y}}else try{y=l(p,c),f0(t,r,y)}catch(W){Nd(t,r,W)}}function f0(t,r,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(c){d0(t,r,c)},function(c){return Nd(t,r,c)}):d0(t,r,l)}function d0(t,r,l){r.status="fulfilled",r.value=l,h0(r),t.state=l,r=t.pending,r!==null&&(l=r.next,l===r?t.pending=null:(l=l.next,r.next=l,c0(t,l)))}function Nd(t,r,l){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do r.status="rejected",r.reason=l,h0(r),r=r.next;while(r!==c)}t.action=null}function h0(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function p0(t,r){return r}function m0(t,r){if(qe){var l=it.formState;if(l!==null){e:{var c=Ae;if(qe){if(lt){t:{for(var p=lt,y=Cn;p.nodeType!==8;){if(!y){p=null;break t}if(p=Tn(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){lt=Tn(p.nextSibling),c=p.data==="F!";break e}}Zi(c)}c=!1}c&&(r=l[0])}}return l=Pt(),l.memoizedState=l.baseState=r,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:p0,lastRenderedState:r},l.queue=c,l=R0.bind(null,Ae,c),c.dispatch=l,c=Ed(!1),y=jd.bind(null,Ae,!1,c.queue),c=Pt(),p={state:r,dispatch:null,action:t,pending:null},c.queue=p,l=W_.bind(null,Ae,p,y,l),p.dispatch=l,c.memoizedState=t,[r,l,!1]}function g0(t){var r=gt();return y0(r,et,t)}function y0(t,r,l){if(r=_d(t,r,p0)[0],t=uu(vi)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var c=Fl(r)}catch(S){throw S===Ma?Ws:S}else c=r;r=gt();var p=r.queue,y=p.dispatch;return l!==r.memoizedState&&(Ae.flags|=2048,Da(9,{destroy:void 0},ek.bind(null,p,l),null)),[c,y,t]}function ek(t,r){t.action=r}function x0(t){var r=gt(),l=et;if(l!==null)return y0(r,l,t);gt(),r=r.memoizedState,l=gt();var c=l.queue.dispatch;return l.memoizedState=t,[r,c,!1]}function Da(t,r,l,c){return t={tag:t,create:l,deps:c,inst:r,next:null},r=Ae.updateQueue,r===null&&(r=ou(),Ae.updateQueue=r),l=r.lastEffect,l===null?r.lastEffect=t.next=t:(c=l.next,l.next=t,t.next=c,r.lastEffect=t),t}function b0(){return gt().memoizedState}function cu(t,r,l,c){var p=Pt();Ae.flags|=t,p.memoizedState=Da(1|r,{destroy:void 0},l,c===void 0?null:c)}function fu(t,r,l,c){var p=gt();c=c===void 0?null:c;var y=p.memoizedState.inst;et!==null&&c!==null&&yd(c,et.memoizedState.deps)?p.memoizedState=Da(r,y,l,c):(Ae.flags|=t,p.memoizedState=Da(1|r,y,l,c))}function v0(t,r){cu(8390656,8,t,r)}function Cd(t,r){fu(2048,8,t,r)}function tk(t){Ae.flags|=4;var r=Ae.updateQueue;if(r===null)r=ou(),Ae.updateQueue=r,r.events=[t];else{var l=r.events;l===null?r.events=[t]:l.push(t)}}function w0(t){var r=gt().memoizedState;return tk({ref:r,nextImpl:t}),function(){if((Qe&2)!==0)throw Error(a(440));return r.impl.apply(void 0,arguments)}}function S0(t,r){return fu(4,2,t,r)}function _0(t,r){return fu(4,4,t,r)}function k0(t,r){if(typeof r=="function"){t=t();var l=r(t);return function(){typeof l=="function"?l():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function E0(t,r,l){l=l!=null?l.concat([t]):null,fu(4,4,k0.bind(null,r,t),l)}function Md(){}function N0(t,r){var l=gt();r=r===void 0?null:r;var c=l.memoizedState;return r!==null&&yd(r,c[1])?c[0]:(l.memoizedState=[t,r],t)}function C0(t,r){var l=gt();r=r===void 0?null:r;var c=l.memoizedState;if(r!==null&&yd(r,c[1]))return c[0];if(c=t(),Ir){Ht(!0);try{t()}finally{Ht(!1)}}return l.memoizedState=[c,r],c}function Td(t,r,l){return l===void 0||(bi&1073741824)!==0&&(Ue&261930)===0?t.memoizedState=r:(t.memoizedState=l,t=My(),Ae.lanes|=t,rr|=t,l)}function M0(t,r,l,c){return un(l,r)?l:Aa.current!==null?(t=Td(t,l,c),un(t,r)||(vt=!0),t):(bi&42)===0||(bi&1073741824)!==0&&(Ue&261930)===0?(vt=!0,t.memoizedState=l):(t=My(),Ae.lanes|=t,rr|=t,r)}function T0(t,r,l,c,p){var y=U.p;U.p=y!==0&&8>y?y:8;var S=j.T,M={};j.T=M,jd(t,!1,r,l);try{var I=p(),W=j.S;if(W!==null&&W(M,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var le=Q_(I,c);Gl(t,r,le,mn(t))}else Gl(t,r,c,mn(t))}catch(se){Gl(t,r,{then:function(){},status:"rejected",reason:se},mn())}finally{U.p=y,S!==null&&M.types!==null&&(S.types=M.types),j.T=S}}function nk(){}function Ad(t,r,l,c){if(t.tag!==5)throw Error(a(476));var p=A0(t).queue;T0(t,p,r,Y,l===null?nk:function(){return z0(t),l(c)})}function A0(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:Y},next:null};var l={};return r.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:l},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function z0(t){var r=A0(t);r.next===null&&(r=t.alternate.memoizedState),Gl(t,r.next.queue,{},mn())}function zd(){return jt(fo)}function j0(){return gt().memoizedState}function D0(){return gt().memoizedState}function ik(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var l=mn();t=Ji(l);var c=Wi(r,t,l);c!==null&&(nn(c,r,l),Vl(c,r,l)),r={cache:ld()},t.payload=r;return}r=r.return}}function rk(t,r,l){var c=mn();l={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},du(t)?O0(r,l):(l=Zf(t,r,l,c),l!==null&&(nn(l,t,c),L0(l,r,c)))}function R0(t,r,l){var c=mn();Gl(t,r,l,c)}function Gl(t,r,l,c){var p={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(du(t))O0(r,p);else{var y=t.alternate;if(t.lanes===0&&(y===null||y.lanes===0)&&(y=r.lastRenderedReducer,y!==null))try{var S=r.lastRenderedState,M=y(S,l);if(p.hasEagerState=!0,p.eagerState=M,un(M,S))return Xs(t,r,p,0),it===null&&Ys(),!1}catch{}if(l=Zf(t,r,p,c),l!==null)return nn(l,t,c),L0(l,r,c),!0}return!1}function jd(t,r,l,c){if(c={lane:2,revertLane:ch(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},du(t)){if(r)throw Error(a(479))}else r=Zf(t,l,c,2),r!==null&&nn(r,t,2)}function du(t){var r=t.alternate;return t===Ae||r!==null&&r===Ae}function O0(t,r){za=au=!0;var l=t.pending;l===null?r.next=r:(r.next=l.next,l.next=r),t.pending=r}function L0(t,r,l){if((l&4194048)!==0){var c=r.lanes;c&=t.pendingLanes,l|=c,r.lanes=l,Es(t,l)}}var Zl={readContext:jt,use:su,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useLayoutEffect:ft,useInsertionEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useSyncExternalStore:ft,useId:ft,useHostTransitionStatus:ft,useFormState:ft,useActionState:ft,useOptimistic:ft,useMemoCache:ft,useCacheRefresh:ft};Zl.useEffectEvent=ft;var H0={readContext:jt,use:su,useCallback:function(t,r){return Pt().memoizedState=[t,r===void 0?null:r],t},useContext:jt,useEffect:v0,useImperativeHandle:function(t,r,l){l=l!=null?l.concat([t]):null,cu(4194308,4,k0.bind(null,r,t),l)},useLayoutEffect:function(t,r){return cu(4194308,4,t,r)},useInsertionEffect:function(t,r){cu(4,2,t,r)},useMemo:function(t,r){var l=Pt();r=r===void 0?null:r;var c=t();if(Ir){Ht(!0);try{t()}finally{Ht(!1)}}return l.memoizedState=[c,r],c},useReducer:function(t,r,l){var c=Pt();if(l!==void 0){var p=l(r);if(Ir){Ht(!0);try{l(r)}finally{Ht(!1)}}}else p=r;return c.memoizedState=c.baseState=p,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:p},c.queue=t,t=t.dispatch=rk.bind(null,Ae,t),[c.memoizedState,t]},useRef:function(t){var r=Pt();return t={current:t},r.memoizedState=t},useState:function(t){t=Ed(t);var r=t.queue,l=R0.bind(null,Ae,r);return r.dispatch=l,[t.memoizedState,l]},useDebugValue:Md,useDeferredValue:function(t,r){var l=Pt();return Td(l,t,r)},useTransition:function(){var t=Ed(!1);return t=T0.bind(null,Ae,t.queue,!0,!1),Pt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,l){var c=Ae,p=Pt();if(qe){if(l===void 0)throw Error(a(407));l=l()}else{if(l=r(),it===null)throw Error(a(349));(Ue&127)!==0||r0(c,r,l)}p.memoizedState=l;var y={value:l,getSnapshot:r};return p.queue=y,v0(l0.bind(null,c,y,t),[t]),c.flags|=2048,Da(9,{destroy:void 0},a0.bind(null,c,y,l,r),null),l},useId:function(){var t=Pt(),r=it.identifierPrefix;if(qe){var l=Kn,c=Qn;l=(c&~(1<<32-Ke(c)-1)).toString(32)+l,r="_"+r+"R_"+l,l=lu++,0<l&&(r+="H"+l.toString(32)),r+="_"}else l=K_++,r="_"+r+"r_"+l.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:zd,useFormState:m0,useActionState:m0,useOptimistic:function(t){var r=Pt();r.memoizedState=r.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=l,r=jd.bind(null,Ae,!0,l),l.dispatch=r,[t,r]},useMemoCache:Sd,useCacheRefresh:function(){return Pt().memoizedState=ik.bind(null,Ae)},useEffectEvent:function(t){var r=Pt(),l={impl:t};return r.memoizedState=l,function(){if((Qe&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},Dd={readContext:jt,use:su,useCallback:N0,useContext:jt,useEffect:Cd,useImperativeHandle:E0,useInsertionEffect:S0,useLayoutEffect:_0,useMemo:C0,useReducer:uu,useRef:b0,useState:function(){return uu(vi)},useDebugValue:Md,useDeferredValue:function(t,r){var l=gt();return M0(l,et.memoizedState,t,r)},useTransition:function(){var t=uu(vi)[0],r=gt().memoizedState;return[typeof t=="boolean"?t:Fl(t),r]},useSyncExternalStore:i0,useId:j0,useHostTransitionStatus:zd,useFormState:g0,useActionState:g0,useOptimistic:function(t,r){var l=gt();return u0(l,et,t,r)},useMemoCache:Sd,useCacheRefresh:D0};Dd.useEffectEvent=w0;var B0={readContext:jt,use:su,useCallback:N0,useContext:jt,useEffect:Cd,useImperativeHandle:E0,useInsertionEffect:S0,useLayoutEffect:_0,useMemo:C0,useReducer:kd,useRef:b0,useState:function(){return kd(vi)},useDebugValue:Md,useDeferredValue:function(t,r){var l=gt();return et===null?Td(l,t,r):M0(l,et.memoizedState,t,r)},useTransition:function(){var t=kd(vi)[0],r=gt().memoizedState;return[typeof t=="boolean"?t:Fl(t),r]},useSyncExternalStore:i0,useId:j0,useHostTransitionStatus:zd,useFormState:x0,useActionState:x0,useOptimistic:function(t,r){var l=gt();return et!==null?u0(l,et,t,r):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Sd,useCacheRefresh:D0};B0.useEffectEvent=w0;function Rd(t,r,l,c){r=t.memoizedState,l=l(c,r),l=l==null?r:m({},r,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Od={enqueueSetState:function(t,r,l){t=t._reactInternals;var c=mn(),p=Ji(c);p.payload=r,l!=null&&(p.callback=l),r=Wi(t,p,c),r!==null&&(nn(r,t,c),Vl(r,t,c))},enqueueReplaceState:function(t,r,l){t=t._reactInternals;var c=mn(),p=Ji(c);p.tag=1,p.payload=r,l!=null&&(p.callback=l),r=Wi(t,p,c),r!==null&&(nn(r,t,c),Vl(r,t,c))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var l=mn(),c=Ji(l);c.tag=2,r!=null&&(c.callback=r),r=Wi(t,c,l),r!==null&&(nn(r,t,l),Vl(r,t,l))}};function U0(t,r,l,c,p,y,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,y,S):r.prototype&&r.prototype.isPureReactComponent?!Ol(l,c)||!Ol(p,y):!0}function I0(t,r,l,c){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(l,c),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(l,c),r.state!==t&&Od.enqueueReplaceState(r,r.state,null)}function qr(t,r){var l=r;if("ref"in r){l={};for(var c in r)c!=="ref"&&(l[c]=r[c])}if(t=t.defaultProps){l===r&&(l=m({},l));for(var p in t)l[p]===void 0&&(l[p]=t[p])}return l}function q0(t){Ps(t)}function $0(t){console.error(t)}function V0(t){Ps(t)}function hu(t,r){try{var l=t.onUncaughtError;l(r.value,{componentStack:r.stack})}catch(c){setTimeout(function(){throw c})}}function P0(t,r,l){try{var c=t.onCaughtError;c(l.value,{componentStack:l.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Ld(t,r,l){return l=Ji(l),l.tag=3,l.payload={element:null},l.callback=function(){hu(t,r)},l}function Y0(t){return t=Ji(t),t.tag=3,t}function X0(t,r,l,c){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var y=c.value;t.payload=function(){return p(y)},t.callback=function(){P0(r,l,c)}}var S=l.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){P0(r,l,c),typeof p!="function"&&(ar===null?ar=new Set([this]):ar.add(this));var M=c.stack;this.componentDidCatch(c.value,{componentStack:M!==null?M:""})})}function ak(t,r,l,c,p){if(l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(r=l.alternate,r!==null&&Ea(r,l,p,!0),l=fn.current,l!==null){switch(l.tag){case 31:case 13:return Mn===null?Eu():l.alternate===null&&dt===0&&(dt=3),l.flags&=-257,l.flags|=65536,l.lanes=p,c===eu?l.flags|=16384:(r=l.updateQueue,r===null?l.updateQueue=new Set([c]):r.add(c),oh(t,c,p)),!1;case 22:return l.flags|=65536,c===eu?l.flags|=16384:(r=l.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([c])},l.updateQueue=r):(l=r.retryQueue,l===null?r.retryQueue=new Set([c]):l.add(c)),oh(t,c,p)),!1}throw Error(a(435,l.tag))}return oh(t,c,p),Eu(),!1}if(qe)return r=fn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,c!==td&&(t=Error(a(422),{cause:c}),Bl(kn(t,l)))):(c!==td&&(r=Error(a(423),{cause:c}),Bl(kn(r,l))),t=t.current.alternate,t.flags|=65536,p&=-p,t.lanes|=p,c=kn(c,l),p=Ld(t.stateNode,c,p),dd(t,p),dt!==4&&(dt=2)),!1;var y=Error(a(520),{cause:c});if(y=kn(y,l),io===null?io=[y]:io.push(y),dt!==4&&(dt=2),r===null)return!0;c=kn(c,l),l=r;do{switch(l.tag){case 3:return l.flags|=65536,t=p&-p,l.lanes|=t,t=Ld(l.stateNode,c,t),dd(l,t),!1;case 1:if(r=l.type,y=l.stateNode,(l.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ar===null||!ar.has(y))))return l.flags|=65536,p&=-p,l.lanes|=p,p=Y0(p),X0(p,t,l,c),dd(l,p),!1}l=l.return}while(l!==null);return!1}var Hd=Error(a(461)),vt=!1;function Dt(t,r,l,c){r.child=t===null?Qg(r,null,l,c):Ur(r,t.child,l,c)}function F0(t,r,l,c,p){l=l.render;var y=r.ref;if("ref"in c){var S={};for(var M in c)M!=="ref"&&(S[M]=c[M])}else S=c;return Or(r),c=xd(t,r,l,S,y,p),M=bd(),t!==null&&!vt?(vd(t,r,p),wi(t,r,p)):(qe&&M&&Wf(r),r.flags|=1,Dt(t,r,c,p),r.child)}function G0(t,r,l,c,p){if(t===null){var y=l.type;return typeof y=="function"&&!Qf(y)&&y.defaultProps===void 0&&l.compare===null?(r.tag=15,r.type=y,Z0(t,r,y,c,p)):(t=Gs(l.type,null,c,r,r.mode,p),t.ref=r.ref,t.return=r,r.child=t)}if(y=t.child,!Yd(t,p)){var S=y.memoizedProps;if(l=l.compare,l=l!==null?l:Ol,l(S,c)&&t.ref===r.ref)return wi(t,r,p)}return r.flags|=1,t=mi(y,c),t.ref=r.ref,t.return=r,r.child=t}function Z0(t,r,l,c,p){if(t!==null){var y=t.memoizedProps;if(Ol(y,c)&&t.ref===r.ref)if(vt=!1,r.pendingProps=c=y,Yd(t,p))(t.flags&131072)!==0&&(vt=!0);else return r.lanes=t.lanes,wi(t,r,p)}return Bd(t,r,l,c,p)}function Q0(t,r,l,c){var p=c.children,y=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((r.flags&128)!==0){if(y=y!==null?y.baseLanes|l:l,t!==null){for(c=r.child=t.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~y}else c=0,r.child=null;return K0(t,r,y,l,c)}if((l&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Js(r,y!==null?y.cachePool:null),y!==null?Wg(r,y):pd(),e0(r);else return c=r.lanes=536870912,K0(t,r,y!==null?y.baseLanes|l:l,l,c)}else y!==null?(Js(r,y.cachePool),Wg(r,y),tr(),r.memoizedState=null):(t!==null&&Js(r,null),pd(),tr());return Dt(t,r,p,l),r.child}function Ql(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function K0(t,r,l,c,p){var y=sd();return y=y===null?null:{parent:xt._currentValue,pool:y},r.memoizedState={baseLanes:l,cachePool:y},t!==null&&Js(r,null),pd(),e0(r),t!==null&&Ea(t,r,c,!0),r.childLanes=p,null}function pu(t,r){return r=gu({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function J0(t,r,l){return Ur(r,t.child,null,l),t=pu(r,r.pendingProps),t.flags|=2,dn(r),r.memoizedState=null,t}function lk(t,r,l){var c=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(qe){if(c.mode==="hidden")return t=pu(r,c),r.lanes=536870912,Ql(null,t);if(gd(r),(t=lt)?(t=cx(t,Cn),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Fi!==null?{id:Qn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},l=Og(t),l.return=r,r.child=l,zt=r,lt=null)):t=null,t===null)throw Zi(r);return r.lanes=536870912,null}return pu(r,c)}var y=t.memoizedState;if(y!==null){var S=y.dehydrated;if(gd(r),p)if(r.flags&256)r.flags&=-257,r=J0(t,r,l);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(a(558));else if(vt||Ea(t,r,l,!1),p=(l&t.childLanes)!==0,vt||p){if(c=it,c!==null&&(S=Ns(c,l),S!==0&&S!==y.retryLane))throw y.retryLane=S,zr(t,S),nn(c,t,S),Hd;Eu(),r=J0(t,r,l)}else t=y.treeContext,lt=Tn(S.nextSibling),zt=r,qe=!0,Gi=null,Cn=!1,t!==null&&Bg(r,t),r=pu(r,c),r.flags|=4096;return r}return t=mi(t.child,{mode:c.mode,children:c.children}),t.ref=r.ref,r.child=t,t.return=r,t}function mu(t,r){var l=r.ref;if(l===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(t===null||t.ref!==l)&&(r.flags|=4194816)}}function Bd(t,r,l,c,p){return Or(r),l=xd(t,r,l,c,void 0,p),c=bd(),t!==null&&!vt?(vd(t,r,p),wi(t,r,p)):(qe&&c&&Wf(r),r.flags|=1,Dt(t,r,l,p),r.child)}function W0(t,r,l,c,p,y){return Or(r),r.updateQueue=null,l=n0(r,c,l,p),t0(t),c=bd(),t!==null&&!vt?(vd(t,r,y),wi(t,r,y)):(qe&&c&&Wf(r),r.flags|=1,Dt(t,r,l,y),r.child)}function ey(t,r,l,c,p){if(Or(r),r.stateNode===null){var y=wa,S=l.contextType;typeof S=="object"&&S!==null&&(y=jt(S)),y=new l(c,y),r.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Od,r.stateNode=y,y._reactInternals=r,y=r.stateNode,y.props=c,y.state=r.memoizedState,y.refs={},cd(r),S=l.contextType,y.context=typeof S=="object"&&S!==null?jt(S):wa,y.state=r.memoizedState,S=l.getDerivedStateFromProps,typeof S=="function"&&(Rd(r,l,S,c),y.state=r.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(S=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),S!==y.state&&Od.enqueueReplaceState(y,y.state,null),Yl(r,c,y,p),Pl(),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308),c=!0}else if(t===null){y=r.stateNode;var M=r.memoizedProps,I=qr(l,M);y.props=I;var W=y.context,le=l.contextType;S=wa,typeof le=="object"&&le!==null&&(S=jt(le));var se=l.getDerivedStateFromProps;le=typeof se=="function"||typeof y.getSnapshotBeforeUpdate=="function",M=r.pendingProps!==M,le||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(M||W!==S)&&I0(r,y,c,S),Ki=!1;var ee=r.memoizedState;y.state=ee,Yl(r,c,y,p),Pl(),W=r.memoizedState,M||ee!==W||Ki?(typeof se=="function"&&(Rd(r,l,se,c),W=r.memoizedState),(I=Ki||U0(r,l,I,c,ee,W,S))?(le||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(r.flags|=4194308)):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=c,r.memoizedState=W),y.props=c,y.state=W,y.context=S,c=I):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),c=!1)}else{y=r.stateNode,fd(t,r),S=r.memoizedProps,le=qr(l,S),y.props=le,se=r.pendingProps,ee=y.context,W=l.contextType,I=wa,typeof W=="object"&&W!==null&&(I=jt(W)),M=l.getDerivedStateFromProps,(W=typeof M=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(S!==se||ee!==I)&&I0(r,y,c,I),Ki=!1,ee=r.memoizedState,y.state=ee,Yl(r,c,y,p),Pl();var re=r.memoizedState;S!==se||ee!==re||Ki||t!==null&&t.dependencies!==null&&Qs(t.dependencies)?(typeof M=="function"&&(Rd(r,l,M,c),re=r.memoizedState),(le=Ki||U0(r,l,le,c,ee,re,I)||t!==null&&t.dependencies!==null&&Qs(t.dependencies))?(W||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(c,re,I),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(c,re,I)),typeof y.componentDidUpdate=="function"&&(r.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof y.componentDidUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=1024),r.memoizedProps=c,r.memoizedState=re),y.props=c,y.state=re,y.context=I,c=le):(typeof y.componentDidUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=1024),c=!1)}return y=c,mu(t,r),c=(r.flags&128)!==0,y||c?(y=r.stateNode,l=c&&typeof l.getDerivedStateFromError!="function"?null:y.render(),r.flags|=1,t!==null&&c?(r.child=Ur(r,t.child,null,p),r.child=Ur(r,null,l,p)):Dt(t,r,l,p),r.memoizedState=y.state,t=r.child):t=wi(t,r,p),t}function ty(t,r,l,c){return Dr(),r.flags|=256,Dt(t,r,l,c),r.child}var Ud={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Id(t){return{baseLanes:t,cachePool:Pg()}}function qd(t,r,l){return t=t!==null?t.childLanes&~l:0,r&&(t|=pn),t}function ny(t,r,l){var c=r.pendingProps,p=!1,y=(r.flags&128)!==0,S;if((S=y)||(S=t!==null&&t.memoizedState===null?!1:(mt.current&2)!==0),S&&(p=!0,r.flags&=-129),S=(r.flags&32)!==0,r.flags&=-33,t===null){if(qe){if(p?er(r):tr(),(t=lt)?(t=cx(t,Cn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Fi!==null?{id:Qn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},l=Og(t),l.return=r,r.child=l,zt=r,lt=null)):t=null,t===null)throw Zi(r);return _h(t)?r.lanes=32:r.lanes=536870912,null}var M=c.children;return c=c.fallback,p?(tr(),p=r.mode,M=gu({mode:"hidden",children:M},p),c=jr(c,p,l,null),M.return=r,c.return=r,M.sibling=c,r.child=M,c=r.child,c.memoizedState=Id(l),c.childLanes=qd(t,S,l),r.memoizedState=Ud,Ql(null,c)):(er(r),$d(r,M))}var I=t.memoizedState;if(I!==null&&(M=I.dehydrated,M!==null)){if(y)r.flags&256?(er(r),r.flags&=-257,r=Vd(t,r,l)):r.memoizedState!==null?(tr(),r.child=t.child,r.flags|=128,r=null):(tr(),M=c.fallback,p=r.mode,c=gu({mode:"visible",children:c.children},p),M=jr(M,p,l,null),M.flags|=2,c.return=r,M.return=r,c.sibling=M,r.child=c,Ur(r,t.child,null,l),c=r.child,c.memoizedState=Id(l),c.childLanes=qd(t,S,l),r.memoizedState=Ud,r=Ql(null,c));else if(er(r),_h(M)){if(S=M.nextSibling&&M.nextSibling.dataset,S)var W=S.dgst;S=W,c=Error(a(419)),c.stack="",c.digest=S,Bl({value:c,source:null,stack:null}),r=Vd(t,r,l)}else if(vt||Ea(t,r,l,!1),S=(l&t.childLanes)!==0,vt||S){if(S=it,S!==null&&(c=Ns(S,l),c!==0&&c!==I.retryLane))throw I.retryLane=c,zr(t,c),nn(S,t,c),Hd;Sh(M)||Eu(),r=Vd(t,r,l)}else Sh(M)?(r.flags|=192,r.child=t.child,r=null):(t=I.treeContext,lt=Tn(M.nextSibling),zt=r,qe=!0,Gi=null,Cn=!1,t!==null&&Bg(r,t),r=$d(r,c.children),r.flags|=4096);return r}return p?(tr(),M=c.fallback,p=r.mode,I=t.child,W=I.sibling,c=mi(I,{mode:"hidden",children:c.children}),c.subtreeFlags=I.subtreeFlags&65011712,W!==null?M=mi(W,M):(M=jr(M,p,l,null),M.flags|=2),M.return=r,c.return=r,c.sibling=M,r.child=c,Ql(null,c),c=r.child,M=t.child.memoizedState,M===null?M=Id(l):(p=M.cachePool,p!==null?(I=xt._currentValue,p=p.parent!==I?{parent:I,pool:I}:p):p=Pg(),M={baseLanes:M.baseLanes|l,cachePool:p}),c.memoizedState=M,c.childLanes=qd(t,S,l),r.memoizedState=Ud,Ql(t.child,c)):(er(r),l=t.child,t=l.sibling,l=mi(l,{mode:"visible",children:c.children}),l.return=r,l.sibling=null,t!==null&&(S=r.deletions,S===null?(r.deletions=[t],r.flags|=16):S.push(t)),r.child=l,r.memoizedState=null,l)}function $d(t,r){return r=gu({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function gu(t,r){return t=cn(22,t,null,r),t.lanes=0,t}function Vd(t,r,l){return Ur(r,t.child,null,l),t=$d(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function iy(t,r,l){t.lanes|=r;var c=t.alternate;c!==null&&(c.lanes|=r),rd(t.return,r,l)}function Pd(t,r,l,c,p,y){var S=t.memoizedState;S===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:c,tail:l,tailMode:p,treeForkCount:y}:(S.isBackwards=r,S.rendering=null,S.renderingStartTime=0,S.last=c,S.tail=l,S.tailMode=p,S.treeForkCount=y)}function ry(t,r,l){var c=r.pendingProps,p=c.revealOrder,y=c.tail;c=c.children;var S=mt.current,M=(S&2)!==0;if(M?(S=S&1|2,r.flags|=128):S&=1,T(mt,S),Dt(t,r,c,l),c=qe?Hl:0,!M&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&iy(t,l,r);else if(t.tag===19)iy(t,l,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(p){case"forwards":for(l=r.child,p=null;l!==null;)t=l.alternate,t!==null&&ru(t)===null&&(p=l),l=l.sibling;l=p,l===null?(p=r.child,r.child=null):(p=l.sibling,l.sibling=null),Pd(r,!1,p,l,y,c);break;case"backwards":case"unstable_legacy-backwards":for(l=null,p=r.child,r.child=null;p!==null;){if(t=p.alternate,t!==null&&ru(t)===null){r.child=p;break}t=p.sibling,p.sibling=l,l=p,p=t}Pd(r,!0,l,null,y,c);break;case"together":Pd(r,!1,null,null,void 0,c);break;default:r.memoizedState=null}return r.child}function wi(t,r,l){if(t!==null&&(r.dependencies=t.dependencies),rr|=r.lanes,(l&r.childLanes)===0)if(t!==null){if(Ea(t,r,l,!1),(l&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(a(153));if(r.child!==null){for(t=r.child,l=mi(t,t.pendingProps),r.child=l,l.return=r;t.sibling!==null;)t=t.sibling,l=l.sibling=mi(t,t.pendingProps),l.return=r;l.sibling=null}return r.child}function Yd(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&Qs(t)))}function ok(t,r,l){switch(r.tag){case 3:ue(r,r.stateNode.containerInfo),Qi(r,xt,t.memoizedState.cache),Dr();break;case 27:case 5:Ee(r);break;case 4:ue(r,r.stateNode.containerInfo);break;case 10:Qi(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,gd(r),null;break;case 13:var c=r.memoizedState;if(c!==null)return c.dehydrated!==null?(er(r),r.flags|=128,null):(l&r.child.childLanes)!==0?ny(t,r,l):(er(r),t=wi(t,r,l),t!==null?t.sibling:null);er(r);break;case 19:var p=(t.flags&128)!==0;if(c=(l&r.childLanes)!==0,c||(Ea(t,r,l,!1),c=(l&r.childLanes)!==0),p){if(c)return ry(t,r,l);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),T(mt,mt.current),c)break;return null;case 22:return r.lanes=0,Q0(t,r,l,r.pendingProps);case 24:Qi(r,xt,t.memoizedState.cache)}return wi(t,r,l)}function ay(t,r,l){if(t!==null)if(t.memoizedProps!==r.pendingProps)vt=!0;else{if(!Yd(t,l)&&(r.flags&128)===0)return vt=!1,ok(t,r,l);vt=(t.flags&131072)!==0}else vt=!1,qe&&(r.flags&1048576)!==0&&Hg(r,Hl,r.index);switch(r.lanes=0,r.tag){case 16:e:{var c=r.pendingProps;if(t=Hr(r.elementType),r.type=t,typeof t=="function")Qf(t)?(c=qr(t,c),r.tag=1,r=ey(null,r,t,c,l)):(r.tag=0,r=Bd(null,r,t,c,l));else{if(t!=null){var p=t.$$typeof;if(p===C){r.tag=11,r=F0(null,r,t,c,l);break e}else if(p===H){r.tag=14,r=G0(null,r,t,c,l);break e}}throw r=O(t)||t,Error(a(306,r,""))}}return r;case 0:return Bd(t,r,r.type,r.pendingProps,l);case 1:return c=r.type,p=qr(c,r.pendingProps),ey(t,r,c,p,l);case 3:e:{if(ue(r,r.stateNode.containerInfo),t===null)throw Error(a(387));c=r.pendingProps;var y=r.memoizedState;p=y.element,fd(t,r),Yl(r,c,null,l);var S=r.memoizedState;if(c=S.cache,Qi(r,xt,c),c!==y.cache&&ad(r,[xt],l,!0),Pl(),c=S.element,y.isDehydrated)if(y={element:c,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=y,r.memoizedState=y,r.flags&256){r=ty(t,r,c,l);break e}else if(c!==p){p=kn(Error(a(424)),r),Bl(p),r=ty(t,r,c,l);break e}else for(t=r.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,lt=Tn(t.firstChild),zt=r,qe=!0,Gi=null,Cn=!0,l=Qg(r,null,c,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Dr(),c===p){r=wi(t,r,l);break e}Dt(t,r,c,l)}r=r.child}return r;case 26:return mu(t,r),t===null?(l=gx(r.type,null,r.pendingProps,null))?r.memoizedState=l:qe||(l=r.type,t=r.pendingProps,c=ju(fe.current).createElement(l),c[Nt]=r,c[Bt]=t,Rt(c,l,t),yt(c),r.stateNode=c):r.memoizedState=gx(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return Ee(r),t===null&&qe&&(c=r.stateNode=hx(r.type,r.pendingProps,fe.current),zt=r,Cn=!0,p=lt,ur(r.type)?(kh=p,lt=Tn(c.firstChild)):lt=p),Dt(t,r,r.pendingProps.children,l),mu(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&qe&&((p=c=lt)&&(c=Hk(c,r.type,r.pendingProps,Cn),c!==null?(r.stateNode=c,zt=r,lt=Tn(c.firstChild),Cn=!1,p=!0):p=!1),p||Zi(r)),Ee(r),p=r.type,y=r.pendingProps,S=t!==null?t.memoizedProps:null,c=y.children,bh(p,y)?c=null:S!==null&&bh(p,S)&&(r.flags|=32),r.memoizedState!==null&&(p=xd(t,r,J_,null,null,l),fo._currentValue=p),mu(t,r),Dt(t,r,c,l),r.child;case 6:return t===null&&qe&&((t=l=lt)&&(l=Bk(l,r.pendingProps,Cn),l!==null?(r.stateNode=l,zt=r,lt=null,t=!0):t=!1),t||Zi(r)),null;case 13:return ny(t,r,l);case 4:return ue(r,r.stateNode.containerInfo),c=r.pendingProps,t===null?r.child=Ur(r,null,c,l):Dt(t,r,c,l),r.child;case 11:return F0(t,r,r.type,r.pendingProps,l);case 7:return Dt(t,r,r.pendingProps,l),r.child;case 8:return Dt(t,r,r.pendingProps.children,l),r.child;case 12:return Dt(t,r,r.pendingProps.children,l),r.child;case 10:return c=r.pendingProps,Qi(r,r.type,c.value),Dt(t,r,c.children,l),r.child;case 9:return p=r.type._context,c=r.pendingProps.children,Or(r),p=jt(p),c=c(p),r.flags|=1,Dt(t,r,c,l),r.child;case 14:return G0(t,r,r.type,r.pendingProps,l);case 15:return Z0(t,r,r.type,r.pendingProps,l);case 19:return ry(t,r,l);case 31:return lk(t,r,l);case 22:return Q0(t,r,l,r.pendingProps);case 24:return Or(r),c=jt(xt),t===null?(p=sd(),p===null&&(p=it,y=ld(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=l),p=y),r.memoizedState={parent:c,cache:p},cd(r),Qi(r,xt,p)):((t.lanes&l)!==0&&(fd(t,r),Yl(r,null,null,l),Pl()),p=t.memoizedState,y=r.memoizedState,p.parent!==c?(p={parent:c,cache:c},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),Qi(r,xt,c)):(c=y.cache,Qi(r,xt,c),c!==p.cache&&ad(r,[xt],l,!0))),Dt(t,r,r.pendingProps.children,l),r.child;case 29:throw r.pendingProps}throw Error(a(156,r.tag))}function Si(t){t.flags|=4}function Xd(t,r,l,c,p){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(p&335544128)===p)if(t.stateNode.complete)t.flags|=8192;else if(jy())t.flags|=8192;else throw Br=eu,ud}else t.flags&=-16777217}function ly(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!wx(r))if(jy())t.flags|=8192;else throw Br=eu,ud}function yu(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?_s():536870912,t.lanes|=r,Ha|=r)}function Kl(t,r){if(!qe)switch(t.tailMode){case"hidden":r=t.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var c=null;l!==null;)l.alternate!==null&&(c=l),l=l.sibling;c===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function ot(t){var r=t.alternate!==null&&t.alternate.child===t.child,l=0,c=0;if(r)for(var p=t.child;p!==null;)l|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=t,p=p.sibling;else for(p=t.child;p!==null;)l|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=t,p=p.sibling;return t.subtreeFlags|=c,t.childLanes=l,r}function sk(t,r,l){var c=r.pendingProps;switch(ed(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(r),null;case 1:return ot(r),null;case 3:return l=r.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),xi(xt),me(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(ka(r)?Si(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,nd())),ot(r),null;case 26:var p=r.type,y=r.memoizedState;return t===null?(Si(r),y!==null?(ot(r),ly(r,y)):(ot(r),Xd(r,p,null,c,l))):y?y!==t.memoizedState?(Si(r),ot(r),ly(r,y)):(ot(r),r.flags&=-16777217):(t=t.memoizedProps,t!==c&&Si(r),ot(r),Xd(r,p,t,c,l)),null;case 27:if(Ce(r),l=fe.current,p=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==c&&Si(r);else{if(!c){if(r.stateNode===null)throw Error(a(166));return ot(r),null}t=ie.current,ka(r)?Ug(r):(t=hx(p,c,l),r.stateNode=t,Si(r))}return ot(r),null;case 5:if(Ce(r),p=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==c&&Si(r);else{if(!c){if(r.stateNode===null)throw Error(a(166));return ot(r),null}if(y=ie.current,ka(r))Ug(r);else{var S=ju(fe.current);switch(y){case 1:y=S.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:y=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":y=S.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":y=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":y=S.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof c.is=="string"?S.createElement("select",{is:c.is}):S.createElement("select"),c.multiple?y.multiple=!0:c.size&&(y.size=c.size);break;default:y=typeof c.is=="string"?S.createElement(p,{is:c.is}):S.createElement(p)}}y[Nt]=r,y[Bt]=c;e:for(S=r.child;S!==null;){if(S.tag===5||S.tag===6)y.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===r)break e;for(;S.sibling===null;){if(S.return===null||S.return===r)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}r.stateNode=y;e:switch(Rt(y,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Si(r)}}return ot(r),Xd(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,l),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==c&&Si(r);else{if(typeof c!="string"&&r.stateNode===null)throw Error(a(166));if(t=fe.current,ka(r)){if(t=r.stateNode,l=r.memoizedProps,c=null,p=zt,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}t[Nt]=r,t=!!(t.nodeValue===l||c!==null&&c.suppressHydrationWarning===!0||nx(t.nodeValue,l)),t||Zi(r,!0)}else t=ju(t).createTextNode(c),t[Nt]=r,r.stateNode=t}return ot(r),null;case 31:if(l=r.memoizedState,t===null||t.memoizedState!==null){if(c=ka(r),l!==null){if(t===null){if(!c)throw Error(a(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[Nt]=r}else Dr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ot(r),t=!1}else l=nd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return r.flags&256?(dn(r),r):(dn(r),null);if((r.flags&128)!==0)throw Error(a(558))}return ot(r),null;case 13:if(c=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(p=ka(r),c!==null&&c.dehydrated!==null){if(t===null){if(!p)throw Error(a(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[Nt]=r}else Dr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ot(r),p=!1}else p=nd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(dn(r),r):(dn(r),null)}return dn(r),(r.flags&128)!==0?(r.lanes=l,r):(l=c!==null,t=t!==null&&t.memoizedState!==null,l&&(c=r.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==p&&(c.flags|=2048)),l!==t&&l&&(r.child.flags|=8192),yu(r,r.updateQueue),ot(r),null);case 4:return me(),t===null&&ph(r.stateNode.containerInfo),ot(r),null;case 10:return xi(r.type),ot(r),null;case 19:if($(mt),c=r.memoizedState,c===null)return ot(r),null;if(p=(r.flags&128)!==0,y=c.rendering,y===null)if(p)Kl(c,!1);else{if(dt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(y=ru(t),y!==null){for(r.flags|=128,Kl(c,!1),t=y.updateQueue,r.updateQueue=t,yu(r,t),r.subtreeFlags=0,t=l,l=r.child;l!==null;)Rg(l,t),l=l.sibling;return T(mt,mt.current&1|2),qe&&gi(r,c.treeForkCount),r.child}t=t.sibling}c.tail!==null&&Et()>Su&&(r.flags|=128,p=!0,Kl(c,!1),r.lanes=4194304)}else{if(!p)if(t=ru(y),t!==null){if(r.flags|=128,p=!0,t=t.updateQueue,r.updateQueue=t,yu(r,t),Kl(c,!0),c.tail===null&&c.tailMode==="hidden"&&!y.alternate&&!qe)return ot(r),null}else 2*Et()-c.renderingStartTime>Su&&l!==536870912&&(r.flags|=128,p=!0,Kl(c,!1),r.lanes=4194304);c.isBackwards?(y.sibling=r.child,r.child=y):(t=c.last,t!==null?t.sibling=y:r.child=y,c.last=y)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Et(),t.sibling=null,l=mt.current,T(mt,p?l&1|2:l&1),qe&&gi(r,c.treeForkCount),t):(ot(r),null);case 22:case 23:return dn(r),md(),c=r.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(r.flags|=8192):c&&(r.flags|=8192),c?(l&536870912)!==0&&(r.flags&128)===0&&(ot(r),r.subtreeFlags&6&&(r.flags|=8192)):ot(r),l=r.updateQueue,l!==null&&yu(r,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),c=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),c!==l&&(r.flags|=2048),t!==null&&$(Lr),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),xi(xt),ot(r),null;case 25:return null;case 30:return null}throw Error(a(156,r.tag))}function uk(t,r){switch(ed(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return xi(xt),me(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return Ce(r),null;case 31:if(r.memoizedState!==null){if(dn(r),r.alternate===null)throw Error(a(340));Dr()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(dn(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(a(340));Dr()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return $(mt),null;case 4:return me(),null;case 10:return xi(r.type),null;case 22:case 23:return dn(r),md(),t!==null&&$(Lr),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return xi(xt),null;case 25:return null;default:return null}}function oy(t,r){switch(ed(r),r.tag){case 3:xi(xt),me();break;case 26:case 27:case 5:Ce(r);break;case 4:me();break;case 31:r.memoizedState!==null&&dn(r);break;case 13:dn(r);break;case 19:$(mt);break;case 10:xi(r.type);break;case 22:case 23:dn(r),md(),t!==null&&$(Lr);break;case 24:xi(xt)}}function Jl(t,r){try{var l=r.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var p=c.next;l=p;do{if((l.tag&t)===t){c=void 0;var y=l.create,S=l.inst;c=y(),S.destroy=c}l=l.next}while(l!==p)}}catch(M){We(r,r.return,M)}}function nr(t,r,l){try{var c=r.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var y=p.next;c=y;do{if((c.tag&t)===t){var S=c.inst,M=S.destroy;if(M!==void 0){S.destroy=void 0,p=r;var I=l,W=M;try{W()}catch(le){We(p,I,le)}}}c=c.next}while(c!==y)}}catch(le){We(r,r.return,le)}}function sy(t){var r=t.updateQueue;if(r!==null){var l=t.stateNode;try{Jg(r,l)}catch(c){We(t,t.return,c)}}}function uy(t,r,l){l.props=qr(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(c){We(t,r,c)}}function Wl(t,r){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof l=="function"?t.refCleanup=l(c):l.current=c}}catch(p){We(t,r,p)}}function Jn(t,r){var l=t.ref,c=t.refCleanup;if(l!==null)if(typeof c=="function")try{c()}catch(p){We(t,r,p)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){We(t,r,p)}else l.current=null}function cy(t){var r=t.type,l=t.memoizedProps,c=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":l.autoFocus&&c.focus();break e;case"img":l.src?c.src=l.src:l.srcSet&&(c.srcset=l.srcSet)}}catch(p){We(t,t.return,p)}}function Fd(t,r,l){try{var c=t.stateNode;zk(c,t.type,l,r),c[Bt]=r}catch(p){We(t,t.return,p)}}function fy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ur(t.type)||t.tag===4}function Gd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||fy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ur(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Zd(t,r,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,r?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,r):(r=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,r.appendChild(t),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=hi));else if(c!==4&&(c===27&&ur(t.type)&&(l=t.stateNode,r=null),t=t.child,t!==null))for(Zd(t,r,l),t=t.sibling;t!==null;)Zd(t,r,l),t=t.sibling}function xu(t,r,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,r?l.insertBefore(t,r):l.appendChild(t);else if(c!==4&&(c===27&&ur(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(xu(t,r,l),t=t.sibling;t!==null;)xu(t,r,l),t=t.sibling}function dy(t){var r=t.stateNode,l=t.memoizedProps;try{for(var c=t.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);Rt(r,c,l),r[Nt]=t,r[Bt]=l}catch(y){We(t,t.return,y)}}var _i=!1,wt=!1,Qd=!1,hy=typeof WeakSet=="function"?WeakSet:Set,Tt=null;function ck(t,r){if(t=t.containerInfo,yh=Uu,t=Eg(t),Vf(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var c=l.getSelection&&l.getSelection();if(c&&c.rangeCount!==0){l=c.anchorNode;var p=c.anchorOffset,y=c.focusNode;c=c.focusOffset;try{l.nodeType,y.nodeType}catch{l=null;break e}var S=0,M=-1,I=-1,W=0,le=0,se=t,ee=null;t:for(;;){for(var re;se!==l||p!==0&&se.nodeType!==3||(M=S+p),se!==y||c!==0&&se.nodeType!==3||(I=S+c),se.nodeType===3&&(S+=se.nodeValue.length),(re=se.firstChild)!==null;)ee=se,se=re;for(;;){if(se===t)break t;if(ee===l&&++W===p&&(M=S),ee===y&&++le===c&&(I=S),(re=se.nextSibling)!==null)break;se=ee,ee=se.parentNode}se=re}l=M===-1||I===-1?null:{start:M,end:I}}else l=null}l=l||{start:0,end:0}}else l=null;for(xh={focusedElem:t,selectionRange:l},Uu=!1,Tt=r;Tt!==null;)if(r=Tt,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Tt=t;else for(;Tt!==null;){switch(r=Tt,y=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)p=t[l],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&y!==null){t=void 0,l=r,p=y.memoizedProps,y=y.memoizedState,c=l.stateNode;try{var ye=qr(l.type,p);t=c.getSnapshotBeforeUpdate(ye,y),c.__reactInternalSnapshotBeforeUpdate=t}catch(ke){We(l,l.return,ke)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,l=t.nodeType,l===9)wh(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":wh(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(a(163))}if(t=r.sibling,t!==null){t.return=r.return,Tt=t;break}Tt=r.return}}function py(t,r,l){var c=l.flags;switch(l.tag){case 0:case 11:case 15:Ei(t,l),c&4&&Jl(5,l);break;case 1:if(Ei(t,l),c&4)if(t=l.stateNode,r===null)try{t.componentDidMount()}catch(S){We(l,l.return,S)}else{var p=qr(l.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(p,r,t.__reactInternalSnapshotBeforeUpdate)}catch(S){We(l,l.return,S)}}c&64&&sy(l),c&512&&Wl(l,l.return);break;case 3:if(Ei(t,l),c&64&&(t=l.updateQueue,t!==null)){if(r=null,l.child!==null)switch(l.child.tag){case 27:case 5:r=l.child.stateNode;break;case 1:r=l.child.stateNode}try{Jg(t,r)}catch(S){We(l,l.return,S)}}break;case 27:r===null&&c&4&&dy(l);case 26:case 5:Ei(t,l),r===null&&c&4&&cy(l),c&512&&Wl(l,l.return);break;case 12:Ei(t,l);break;case 31:Ei(t,l),c&4&&yy(t,l);break;case 13:Ei(t,l),c&4&&xy(t,l),c&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=bk.bind(null,l),Uk(t,l))));break;case 22:if(c=l.memoizedState!==null||_i,!c){r=r!==null&&r.memoizedState!==null||wt,p=_i;var y=wt;_i=c,(wt=r)&&!y?Ni(t,l,(l.subtreeFlags&8772)!==0):Ei(t,l),_i=p,wt=y}break;case 30:break;default:Ei(t,l)}}function my(t){var r=t.alternate;r!==null&&(t.alternate=null,my(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&El(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 st=null,Jt=!1;function ki(t,r,l){for(l=l.child;l!==null;)gy(t,r,l),l=l.sibling}function gy(t,r,l){if(pt&&typeof pt.onCommitFiberUnmount=="function")try{pt.onCommitFiberUnmount(At,l)}catch{}switch(l.tag){case 26:wt||Jn(l,r),ki(t,r,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:wt||Jn(l,r);var c=st,p=Jt;ur(l.type)&&(st=l.stateNode,Jt=!1),ki(t,r,l),so(l.stateNode),st=c,Jt=p;break;case 5:wt||Jn(l,r);case 6:if(c=st,p=Jt,st=null,ki(t,r,l),st=c,Jt=p,st!==null)if(Jt)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(l.stateNode)}catch(y){We(l,r,y)}else try{st.removeChild(l.stateNode)}catch(y){We(l,r,y)}break;case 18:st!==null&&(Jt?(t=st,sx(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Ya(t)):sx(st,l.stateNode));break;case 4:c=st,p=Jt,st=l.stateNode.containerInfo,Jt=!0,ki(t,r,l),st=c,Jt=p;break;case 0:case 11:case 14:case 15:nr(2,l,r),wt||nr(4,l,r),ki(t,r,l);break;case 1:wt||(Jn(l,r),c=l.stateNode,typeof c.componentWillUnmount=="function"&&uy(l,r,c)),ki(t,r,l);break;case 21:ki(t,r,l);break;case 22:wt=(c=wt)||l.memoizedState!==null,ki(t,r,l),wt=c;break;default:ki(t,r,l)}}function yy(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ya(t)}catch(l){We(r,r.return,l)}}}function xy(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ya(t)}catch(l){We(r,r.return,l)}}function fk(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new hy),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new hy),r;default:throw Error(a(435,t.tag))}}function bu(t,r){var l=fk(t);r.forEach(function(c){if(!l.has(c)){l.add(c);var p=vk.bind(null,t,c);c.then(p,p)}})}function Wt(t,r){var l=r.deletions;if(l!==null)for(var c=0;c<l.length;c++){var p=l[c],y=t,S=r,M=S;e:for(;M!==null;){switch(M.tag){case 27:if(ur(M.type)){st=M.stateNode,Jt=!1;break e}break;case 5:st=M.stateNode,Jt=!1;break e;case 3:case 4:st=M.stateNode.containerInfo,Jt=!0;break e}M=M.return}if(st===null)throw Error(a(160));gy(y,S,p),st=null,Jt=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)by(r,t),r=r.sibling}var Bn=null;function by(t,r){var l=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Wt(r,t),en(t),c&4&&(nr(3,t,t.return),Jl(3,t),nr(5,t,t.return));break;case 1:Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),c&64&&_i&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?c:l.concat(c))));break;case 26:var p=Bn;if(Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),c&4){var y=l!==null?l.memoizedState:null;if(c=t.memoizedState,l===null)if(c===null)if(t.stateNode===null){e:{c=t.type,l=t.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":y=p.getElementsByTagName("title")[0],(!y||y[Er]||y[Nt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(c),p.head.insertBefore(y,p.querySelector("head > title"))),Rt(y,c,l),y[Nt]=t,yt(y),c=y;break e;case"link":var S=bx("link","href",p).get(c+(l.href||""));if(S){for(var M=0;M<S.length;M++)if(y=S[M],y.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&y.getAttribute("rel")===(l.rel==null?null:l.rel)&&y.getAttribute("title")===(l.title==null?null:l.title)&&y.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){S.splice(M,1);break t}}y=p.createElement(c),Rt(y,c,l),p.head.appendChild(y);break;case"meta":if(S=bx("meta","content",p).get(c+(l.content||""))){for(M=0;M<S.length;M++)if(y=S[M],y.getAttribute("content")===(l.content==null?null:""+l.content)&&y.getAttribute("name")===(l.name==null?null:l.name)&&y.getAttribute("property")===(l.property==null?null:l.property)&&y.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&y.getAttribute("charset")===(l.charSet==null?null:l.charSet)){S.splice(M,1);break t}}y=p.createElement(c),Rt(y,c,l),p.head.appendChild(y);break;default:throw Error(a(468,c))}y[Nt]=t,yt(y),c=y}t.stateNode=c}else vx(p,t.type,t.stateNode);else t.stateNode=xx(p,c,t.memoizedProps);else y!==c?(y===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):y.count--,c===null?vx(p,t.type,t.stateNode):xx(p,c,t.memoizedProps)):c===null&&t.stateNode!==null&&Fd(t,t.memoizedProps,l.memoizedProps)}break;case 27:Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),l!==null&&c&4&&Fd(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),t.flags&32){p=t.stateNode;try{pa(p,"")}catch(ye){We(t,t.return,ye)}}c&4&&t.stateNode!=null&&(p=t.memoizedProps,Fd(t,p,l!==null?l.memoizedProps:p)),c&1024&&(Qd=!0);break;case 6:if(Wt(r,t),en(t),c&4){if(t.stateNode===null)throw Error(a(162));c=t.memoizedProps,l=t.stateNode;try{l.nodeValue=c}catch(ye){We(t,t.return,ye)}}break;case 3:if(Ou=null,p=Bn,Bn=Du(r.containerInfo),Wt(r,t),Bn=p,en(t),c&4&&l!==null&&l.memoizedState.isDehydrated)try{Ya(r.containerInfo)}catch(ye){We(t,t.return,ye)}Qd&&(Qd=!1,vy(t));break;case 4:c=Bn,Bn=Du(t.stateNode.containerInfo),Wt(r,t),en(t),Bn=c;break;case 12:Wt(r,t),en(t);break;case 31:Wt(r,t),en(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,bu(t,c)));break;case 13:Wt(r,t),en(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(wu=Et()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,bu(t,c)));break;case 22:p=t.memoizedState!==null;var I=l!==null&&l.memoizedState!==null,W=_i,le=wt;if(_i=W||p,wt=le||I,Wt(r,t),wt=le,_i=W,en(t),c&8192)e:for(r=t.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(l===null||I||_i||wt||$r(t)),l=null,r=t;;){if(r.tag===5||r.tag===26){if(l===null){I=l=r;try{if(y=I.stateNode,p)S=y.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{M=I.stateNode;var se=I.memoizedProps.style,ee=se!=null&&se.hasOwnProperty("display")?se.display:null;M.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(ye){We(I,I.return,ye)}}}else if(r.tag===6){if(l===null){I=r;try{I.stateNode.nodeValue=p?"":I.memoizedProps}catch(ye){We(I,I.return,ye)}}}else if(r.tag===18){if(l===null){I=r;try{var re=I.stateNode;p?ux(re,!0):ux(I.stateNode,!1)}catch(ye){We(I,I.return,ye)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;l===r&&(l=null),r=r.return}l===r&&(l=null),r.sibling.return=r.return,r=r.sibling}c&4&&(c=t.updateQueue,c!==null&&(l=c.retryQueue,l!==null&&(c.retryQueue=null,bu(t,l))));break;case 19:Wt(r,t),en(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,bu(t,c)));break;case 30:break;case 21:break;default:Wt(r,t),en(t)}}function en(t){var r=t.flags;if(r&2){try{for(var l,c=t.return;c!==null;){if(fy(c)){l=c;break}c=c.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var p=l.stateNode,y=Gd(t);xu(t,y,p);break;case 5:var S=l.stateNode;l.flags&32&&(pa(S,""),l.flags&=-33);var M=Gd(t);xu(t,M,S);break;case 3:case 4:var I=l.stateNode.containerInfo,W=Gd(t);Zd(t,W,I);break;default:throw Error(a(161))}}catch(le){We(t,t.return,le)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function vy(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;vy(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Ei(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)py(t,r.alternate,r),r=r.sibling}function $r(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:nr(4,r,r.return),$r(r);break;case 1:Jn(r,r.return);var l=r.stateNode;typeof l.componentWillUnmount=="function"&&uy(r,r.return,l),$r(r);break;case 27:so(r.stateNode);case 26:case 5:Jn(r,r.return),$r(r);break;case 22:r.memoizedState===null&&$r(r);break;case 30:$r(r);break;default:$r(r)}t=t.sibling}}function Ni(t,r,l){for(l=l&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var c=r.alternate,p=t,y=r,S=y.flags;switch(y.tag){case 0:case 11:case 15:Ni(p,y,l),Jl(4,y);break;case 1:if(Ni(p,y,l),c=y,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(W){We(c,c.return,W)}if(c=y,p=c.updateQueue,p!==null){var M=c.stateNode;try{var I=p.shared.hiddenCallbacks;if(I!==null)for(p.shared.hiddenCallbacks=null,p=0;p<I.length;p++)Kg(I[p],M)}catch(W){We(c,c.return,W)}}l&&S&64&&sy(y),Wl(y,y.return);break;case 27:dy(y);case 26:case 5:Ni(p,y,l),l&&c===null&&S&4&&cy(y),Wl(y,y.return);break;case 12:Ni(p,y,l);break;case 31:Ni(p,y,l),l&&S&4&&yy(p,y);break;case 13:Ni(p,y,l),l&&S&4&&xy(p,y);break;case 22:y.memoizedState===null&&Ni(p,y,l),Wl(y,y.return);break;case 30:break;default:Ni(p,y,l)}r=r.sibling}}function Kd(t,r){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&Ul(l))}function Jd(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Ul(t))}function Un(t,r,l,c){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)wy(t,r,l,c),r=r.sibling}function wy(t,r,l,c){var p=r.flags;switch(r.tag){case 0:case 11:case 15:Un(t,r,l,c),p&2048&&Jl(9,r);break;case 1:Un(t,r,l,c);break;case 3:Un(t,r,l,c),p&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Ul(t)));break;case 12:if(p&2048){Un(t,r,l,c),t=r.stateNode;try{var y=r.memoizedProps,S=y.id,M=y.onPostCommit;typeof M=="function"&&M(S,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(I){We(r,r.return,I)}}else Un(t,r,l,c);break;case 31:Un(t,r,l,c);break;case 13:Un(t,r,l,c);break;case 23:break;case 22:y=r.stateNode,S=r.alternate,r.memoizedState!==null?y._visibility&2?Un(t,r,l,c):eo(t,r):y._visibility&2?Un(t,r,l,c):(y._visibility|=2,Ra(t,r,l,c,(r.subtreeFlags&10256)!==0||!1)),p&2048&&Kd(S,r);break;case 24:Un(t,r,l,c),p&2048&&Jd(r.alternate,r);break;default:Un(t,r,l,c)}}function Ra(t,r,l,c,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var y=t,S=r,M=l,I=c,W=S.flags;switch(S.tag){case 0:case 11:case 15:Ra(y,S,M,I,p),Jl(8,S);break;case 23:break;case 22:var le=S.stateNode;S.memoizedState!==null?le._visibility&2?Ra(y,S,M,I,p):eo(y,S):(le._visibility|=2,Ra(y,S,M,I,p)),p&&W&2048&&Kd(S.alternate,S);break;case 24:Ra(y,S,M,I,p),p&&W&2048&&Jd(S.alternate,S);break;default:Ra(y,S,M,I,p)}r=r.sibling}}function eo(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var l=t,c=r,p=c.flags;switch(c.tag){case 22:eo(l,c),p&2048&&Kd(c.alternate,c);break;case 24:eo(l,c),p&2048&&Jd(c.alternate,c);break;default:eo(l,c)}r=r.sibling}}var to=8192;function Oa(t,r,l){if(t.subtreeFlags&to)for(t=t.child;t!==null;)Sy(t,r,l),t=t.sibling}function Sy(t,r,l){switch(t.tag){case 26:Oa(t,r,l),t.flags&to&&t.memoizedState!==null&&Kk(l,Bn,t.memoizedState,t.memoizedProps);break;case 5:Oa(t,r,l);break;case 3:case 4:var c=Bn;Bn=Du(t.stateNode.containerInfo),Oa(t,r,l),Bn=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=to,to=16777216,Oa(t,r,l),to=c):Oa(t,r,l));break;default:Oa(t,r,l)}}function _y(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 no(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var c=r[l];Tt=c,Ey(c,t)}_y(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ky(t),t=t.sibling}function ky(t){switch(t.tag){case 0:case 11:case 15:no(t),t.flags&2048&&nr(9,t,t.return);break;case 3:no(t);break;case 12:no(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,vu(t)):no(t);break;default:no(t)}}function vu(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var c=r[l];Tt=c,Ey(c,t)}_y(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:nr(8,r,r.return),vu(r);break;case 22:l=r.stateNode,l._visibility&2&&(l._visibility&=-3,vu(r));break;default:vu(r)}t=t.sibling}}function Ey(t,r){for(;Tt!==null;){var l=Tt;switch(l.tag){case 0:case 11:case 15:nr(8,l,r);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var c=l.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Ul(l.memoizedState.cache)}if(c=l.child,c!==null)c.return=l,Tt=c;else e:for(l=t;Tt!==null;){c=Tt;var p=c.sibling,y=c.return;if(my(c),c===l){Tt=null;break e}if(p!==null){p.return=y,Tt=p;break e}Tt=y}}}var dk={getCacheForType:function(t){var r=jt(xt),l=r.data.get(t);return l===void 0&&(l=t(),r.data.set(t,l)),l},cacheSignal:function(){return jt(xt).controller.signal}},hk=typeof WeakMap=="function"?WeakMap:Map,Qe=0,it=null,Le=null,Ue=0,Je=0,hn=null,ir=!1,La=!1,Wd=!1,Ci=0,dt=0,rr=0,Vr=0,eh=0,pn=0,Ha=0,io=null,tn=null,th=!1,wu=0,Ny=0,Su=1/0,_u=null,ar=null,Ct=0,lr=null,Ba=null,Mi=0,nh=0,ih=null,Cy=null,ro=0,rh=null;function mn(){return(Qe&2)!==0&&Ue!==0?Ue&-Ue:j.T!==null?ch():Cs()}function My(){if(pn===0)if((Ue&536870912)===0||qe){var t=oa;oa<<=1,(oa&3932160)===0&&(oa=262144),pn=t}else pn=536870912;return t=fn.current,t!==null&&(t.flags|=32),pn}function nn(t,r,l){(t===it&&(Je===2||Je===9)||t.cancelPendingCommit!==null)&&(Ua(t,0),or(t,Ue,pn,!1)),kr(t,l),((Qe&2)===0||t!==it)&&(t===it&&((Qe&2)===0&&(Vr|=l),dt===4&&or(t,Ue,pn,!1)),Wn(t))}function Ty(t,r,l){if((Qe&6)!==0)throw Error(a(327));var c=!l&&(r&127)===0&&(r&t.expiredLanes)===0||_r(t,r),p=c?gk(t,r):lh(t,r,!0),y=c;do{if(p===0){La&&!c&&or(t,r,0,!1);break}else{if(l=t.current.alternate,y&&!pk(l)){p=lh(t,r,!1),y=!1;continue}if(p===2){if(y=r,t.errorRecoveryDisabledLanes&y)var S=0;else S=t.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){r=S;e:{var M=t;p=io;var I=M.current.memoizedState.isDehydrated;if(I&&(Ua(M,S).flags|=256),S=lh(M,S,!1),S!==2){if(Wd&&!I){M.errorRecoveryDisabledLanes|=y,Vr|=y,p=4;break e}y=tn,tn=p,y!==null&&(tn===null?tn=y:tn.push.apply(tn,y))}p=S}if(y=!1,p!==2)continue}}if(p===1){Ua(t,0),or(t,r,0,!0);break}e:{switch(c=t,y=p,y){case 0:case 1:throw Error(a(345));case 4:if((r&4194048)!==r)break;case 6:or(c,r,pn,!ir);break e;case 2:tn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((r&62914560)===r&&(p=wu+300-Et(),10<p)){if(or(c,r,pn,!ir),ua(c,0,!0)!==0)break e;Mi=r,c.timeoutHandle=lx(Ay.bind(null,c,l,tn,_u,th,r,pn,Vr,Ha,ir,y,"Throttled",-0,0),p);break e}Ay(c,l,tn,_u,th,r,pn,Vr,Ha,ir,y,null,-0,0)}}break}while(!0);Wn(t)}function Ay(t,r,l,c,p,y,S,M,I,W,le,se,ee,re){if(t.timeoutHandle=-1,se=r.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hi},Sy(r,y,se);var ye=(y&62914560)===y?wu-Et():(y&4194048)===y?Ny-Et():0;if(ye=Jk(se,ye),ye!==null){Mi=y,t.cancelPendingCommit=ye(By.bind(null,t,r,y,l,c,p,S,M,I,le,se,null,ee,re)),or(t,y,S,!W);return}}By(t,r,y,l,c,p,S,M,I)}function pk(t){for(var r=t;;){var l=r.tag;if((l===0||l===11||l===15)&&r.flags&16384&&(l=r.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var c=0;c<l.length;c++){var p=l[c],y=p.getSnapshot;p=p.value;try{if(!un(y(),p))return!1}catch{return!1}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function or(t,r,l,c){r&=~eh,r&=~Vr,t.suspendedLanes|=r,t.pingedLanes&=~r,c&&(t.warmLanes|=r),c=t.expirationTimes;for(var p=r;0<p;){var y=31-Ke(p),S=1<<y;c[y]=-1,p&=~S}l!==0&&ks(t,l,r)}function ku(){return(Qe&6)===0?(ao(0),!1):!0}function ah(){if(Le!==null){if(Je===0)var t=Le.return;else t=Le,yi=Rr=null,wd(t),Ta=null,ql=0,t=Le;for(;t!==null;)oy(t.alternate,t),t=t.return;Le=null}}function Ua(t,r){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,Rk(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Mi=0,ah(),it=t,Le=l=mi(t.current,null),Ue=r,Je=0,hn=null,ir=!1,La=_r(t,r),Wd=!1,Ha=pn=eh=Vr=rr=dt=0,tn=io=null,th=!1,(r&8)!==0&&(r|=r&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=r;0<c;){var p=31-Ke(c),y=1<<p;r|=t[p],c&=~y}return Ci=r,Ys(),l}function zy(t,r){Ae=null,j.H=Zl,r===Ma||r===Ws?(r=Fg(),Je=3):r===ud?(r=Fg(),Je=4):Je=r===Hd?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,hn=r,Le===null&&(dt=1,hu(t,kn(r,t.current)))}function jy(){var t=fn.current;return t===null?!0:(Ue&4194048)===Ue?Mn===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?t===Mn:!1}function Dy(){var t=j.H;return j.H=Zl,t===null?Zl:t}function Ry(){var t=j.A;return j.A=dk,t}function Eu(){dt=4,ir||(Ue&4194048)!==Ue&&fn.current!==null||(La=!0),(rr&134217727)===0&&(Vr&134217727)===0||it===null||or(it,Ue,pn,!1)}function lh(t,r,l){var c=Qe;Qe|=2;var p=Dy(),y=Ry();(it!==t||Ue!==r)&&(_u=null,Ua(t,r)),r=!1;var S=dt;e:do try{if(Je!==0&&Le!==null){var M=Le,I=hn;switch(Je){case 8:ah(),S=6;break e;case 3:case 2:case 9:case 6:fn.current===null&&(r=!0);var W=Je;if(Je=0,hn=null,Ia(t,M,I,W),l&&La){S=0;break e}break;default:W=Je,Je=0,hn=null,Ia(t,M,I,W)}}mk(),S=dt;break}catch(le){zy(t,le)}while(!0);return r&&t.shellSuspendCounter++,yi=Rr=null,Qe=c,j.H=p,j.A=y,Le===null&&(it=null,Ue=0,Ys()),S}function mk(){for(;Le!==null;)Oy(Le)}function gk(t,r){var l=Qe;Qe|=2;var c=Dy(),p=Ry();it!==t||Ue!==r?(_u=null,Su=Et()+500,Ua(t,r)):La=_r(t,r);e:do try{if(Je!==0&&Le!==null){r=Le;var y=hn;t:switch(Je){case 1:Je=0,hn=null,Ia(t,r,y,1);break;case 2:case 9:if(Yg(y)){Je=0,hn=null,Ly(r);break}r=function(){Je!==2&&Je!==9||it!==t||(Je=7),Wn(t)},y.then(r,r);break e;case 3:Je=7;break e;case 4:Je=5;break e;case 7:Yg(y)?(Je=0,hn=null,Ly(r)):(Je=0,hn=null,Ia(t,r,y,7));break;case 5:var S=null;switch(Le.tag){case 26:S=Le.memoizedState;case 5:case 27:var M=Le;if(S?wx(S):M.stateNode.complete){Je=0,hn=null;var I=M.sibling;if(I!==null)Le=I;else{var W=M.return;W!==null?(Le=W,Nu(W)):Le=null}break t}}Je=0,hn=null,Ia(t,r,y,5);break;case 6:Je=0,hn=null,Ia(t,r,y,6);break;case 8:ah(),dt=6;break e;default:throw Error(a(462))}}yk();break}catch(le){zy(t,le)}while(!0);return yi=Rr=null,j.H=c,j.A=p,Qe=l,Le!==null?0:(it=null,Ue=0,Ys(),dt)}function yk(){for(;Le!==null&&!oi();)Oy(Le)}function Oy(t){var r=ay(t.alternate,t,Ci);t.memoizedProps=t.pendingProps,r===null?Nu(t):Le=r}function Ly(t){var r=t,l=r.alternate;switch(r.tag){case 15:case 0:r=W0(l,r,r.pendingProps,r.type,void 0,Ue);break;case 11:r=W0(l,r,r.pendingProps,r.type.render,r.ref,Ue);break;case 5:wd(r);default:oy(l,r),r=Le=Rg(r,Ci),r=ay(l,r,Ci)}t.memoizedProps=t.pendingProps,r===null?Nu(t):Le=r}function Ia(t,r,l,c){yi=Rr=null,wd(r),Ta=null,ql=0;var p=r.return;try{if(ak(t,p,r,l,Ue)){dt=1,hu(t,kn(l,t.current)),Le=null;return}}catch(y){if(p!==null)throw Le=p,y;dt=1,hu(t,kn(l,t.current)),Le=null;return}r.flags&32768?(qe||c===1?t=!0:La||(Ue&536870912)!==0?t=!1:(ir=t=!0,(c===2||c===9||c===3||c===6)&&(c=fn.current,c!==null&&c.tag===13&&(c.flags|=16384))),Hy(r,t)):Nu(r)}function Nu(t){var r=t;do{if((r.flags&32768)!==0){Hy(r,ir);return}t=r.return;var l=sk(r.alternate,r,Ci);if(l!==null){Le=l;return}if(r=r.sibling,r!==null){Le=r;return}Le=r=t}while(r!==null);dt===0&&(dt=5)}function Hy(t,r){do{var l=uk(t.alternate,t);if(l!==null){l.flags&=32767,Le=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!r&&(t=t.sibling,t!==null)){Le=t;return}Le=t=l}while(t!==null);dt=6,Le=null}function By(t,r,l,c,p,y,S,M,I){t.cancelPendingCommit=null;do Cu();while(Ct!==0);if((Qe&6)!==0)throw Error(a(327));if(r!==null){if(r===t.current)throw Error(a(177));if(y=r.lanes|r.childLanes,y|=Gf,kf(t,l,y,S,M,I),t===it&&(Le=it=null,Ue=0),Ba=r,lr=t,Mi=l,nh=y,ih=p,Cy=c,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,wk(_e,function(){return Vy(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||c){c=j.T,j.T=null,p=U.p,U.p=2,S=Qe,Qe|=4;try{ck(t,r,l)}finally{Qe=S,U.p=p,j.T=c}}Ct=1,Uy(),Iy(),qy()}}function Uy(){if(Ct===1){Ct=0;var t=lr,r=Ba,l=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||l){l=j.T,j.T=null;var c=U.p;U.p=2;var p=Qe;Qe|=4;try{by(r,t);var y=xh,S=Eg(t.containerInfo),M=y.focusedElem,I=y.selectionRange;if(S!==M&&M&&M.ownerDocument&&kg(M.ownerDocument.documentElement,M)){if(I!==null&&Vf(M)){var W=I.start,le=I.end;if(le===void 0&&(le=W),"selectionStart"in M)M.selectionStart=W,M.selectionEnd=Math.min(le,M.value.length);else{var se=M.ownerDocument||document,ee=se&&se.defaultView||window;if(ee.getSelection){var re=ee.getSelection(),ye=M.textContent.length,ke=Math.min(I.start,ye),nt=I.end===void 0?ke:Math.min(I.end,ye);!re.extend&&ke>nt&&(S=nt,nt=ke,ke=S);var Z=_g(M,ke),X=_g(M,nt);if(Z&&X&&(re.rangeCount!==1||re.anchorNode!==Z.node||re.anchorOffset!==Z.offset||re.focusNode!==X.node||re.focusOffset!==X.offset)){var J=se.createRange();J.setStart(Z.node,Z.offset),re.removeAllRanges(),ke>nt?(re.addRange(J),re.extend(X.node,X.offset)):(J.setEnd(X.node,X.offset),re.addRange(J))}}}}for(se=[],re=M;re=re.parentNode;)re.nodeType===1&&se.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<se.length;M++){var oe=se[M];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Uu=!!yh,xh=yh=null}finally{Qe=p,U.p=c,j.T=l}}t.current=r,Ct=2}}function Iy(){if(Ct===2){Ct=0;var t=lr,r=Ba,l=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||l){l=j.T,j.T=null;var c=U.p;U.p=2;var p=Qe;Qe|=4;try{py(t,r.alternate,r)}finally{Qe=p,U.p=c,j.T=l}}Ct=3}}function qy(){if(Ct===4||Ct===3){Ct=0,si();var t=lr,r=Ba,l=Mi,c=Cy;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Ct=5:(Ct=0,Ba=lr=null,$y(t,t.pendingLanes));var p=t.pendingLanes;if(p===0&&(ar=null),kl(l),r=r.stateNode,pt&&typeof pt.onCommitFiberRoot=="function")try{pt.onCommitFiberRoot(At,r,void 0,(r.current.flags&128)===128)}catch{}if(c!==null){r=j.T,p=U.p,U.p=2,j.T=null;try{for(var y=t.onRecoverableError,S=0;S<c.length;S++){var M=c[S];y(M.value,{componentStack:M.stack})}}finally{j.T=r,U.p=p}}(Mi&3)!==0&&Cu(),Wn(t),p=t.pendingLanes,(l&261930)!==0&&(p&42)!==0?t===rh?ro++:(ro=0,rh=t):ro=0,ao(0)}}function $y(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Ul(r)))}function Cu(){return Uy(),Iy(),qy(),Vy()}function Vy(){if(Ct!==5)return!1;var t=lr,r=nh;nh=0;var l=kl(Mi),c=j.T,p=U.p;try{U.p=32>l?32:l,j.T=null,l=ih,ih=null;var y=lr,S=Mi;if(Ct=0,Ba=lr=null,Mi=0,(Qe&6)!==0)throw Error(a(331));var M=Qe;if(Qe|=4,ky(y.current),wy(y,y.current,S,l),Qe=M,ao(0,!1),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot(At,y)}catch{}return!0}finally{U.p=p,j.T=c,$y(t,r)}}function Py(t,r,l){r=kn(l,r),r=Ld(t.stateNode,r,2),t=Wi(t,r,2),t!==null&&(kr(t,2),Wn(t))}function We(t,r,l){if(t.tag===3)Py(t,t,l);else for(;r!==null;){if(r.tag===3){Py(r,t,l);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(ar===null||!ar.has(c))){t=kn(l,t),l=Y0(2),c=Wi(r,l,2),c!==null&&(X0(l,c,r,t),kr(c,2),Wn(c));break}}r=r.return}}function oh(t,r,l){var c=t.pingCache;if(c===null){c=t.pingCache=new hk;var p=new Set;c.set(r,p)}else p=c.get(r),p===void 0&&(p=new Set,c.set(r,p));p.has(l)||(Wd=!0,p.add(l),t=xk.bind(null,t,r,l),r.then(t,t))}function xk(t,r,l){var c=t.pingCache;c!==null&&c.delete(r),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,it===t&&(Ue&l)===l&&(dt===4||dt===3&&(Ue&62914560)===Ue&&300>Et()-wu?(Qe&2)===0&&Ua(t,0):eh|=l,Ha===Ue&&(Ha=0)),Wn(t)}function Yy(t,r){r===0&&(r=_s()),t=zr(t,r),t!==null&&(kr(t,r),Wn(t))}function bk(t){var r=t.memoizedState,l=0;r!==null&&(l=r.retryLane),Yy(t,l)}function vk(t,r){var l=0;switch(t.tag){case 31:case 13:var c=t.stateNode,p=t.memoizedState;p!==null&&(l=p.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(r),Yy(t,l)}function wk(t,r){return Gt(t,r)}var Mu=null,qa=null,sh=!1,Tu=!1,uh=!1,sr=0;function Wn(t){t!==qa&&t.next===null&&(qa===null?Mu=qa=t:qa=qa.next=t),Tu=!0,sh||(sh=!0,_k())}function ao(t,r){if(!uh&&Tu){uh=!0;do for(var l=!1,c=Mu;c!==null;){if(t!==0){var p=c.pendingLanes;if(p===0)var y=0;else{var S=c.suspendedLanes,M=c.pingedLanes;y=(1<<31-Ke(42|t)+1)-1,y&=p&~(S&~M),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(l=!0,Zy(c,y))}else y=Ue,y=ua(c,c===it?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(y&3)===0||_r(c,y)||(l=!0,Zy(c,y));c=c.next}while(l);uh=!1}}function Sk(){Xy()}function Xy(){Tu=sh=!1;var t=0;sr!==0&&Dk()&&(t=sr);for(var r=Et(),l=null,c=Mu;c!==null;){var p=c.next,y=Fy(c,r);y===0?(c.next=null,l===null?Mu=p:l.next=p,p===null&&(qa=l)):(l=c,(t!==0||(y&3)!==0)&&(Tu=!0)),c=p}Ct!==0&&Ct!==5||ao(t),sr!==0&&(sr=0)}function Fy(t,r){for(var l=t.suspendedLanes,c=t.pingedLanes,p=t.expirationTimes,y=t.pendingLanes&-62914561;0<y;){var S=31-Ke(y),M=1<<S,I=p[S];I===-1?((M&l)===0||(M&c)!==0)&&(p[S]=_f(M,r)):I<=r&&(t.expiredLanes|=M),y&=~M}if(r=it,l=Ue,l=ua(t,t===r?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,l===0||t===r&&(Je===2||Je===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&Rn(c),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||_r(t,l)){if(r=l&-l,r===t.callbackPriority)return r;switch(c!==null&&Rn(c),kl(l)){case 2:case 8:l=pe;break;case 32:l=_e;break;case 268435456:l=$e;break;default:l=_e}return c=Gy.bind(null,t),l=Gt(l,c),t.callbackPriority=r,t.callbackNode=l,r}return c!==null&&c!==null&&Rn(c),t.callbackPriority=2,t.callbackNode=null,2}function Gy(t,r){if(Ct!==0&&Ct!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(Cu()&&t.callbackNode!==l)return null;var c=Ue;return c=ua(t,t===it?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(Ty(t,c,r),Fy(t,Et()),t.callbackNode!=null&&t.callbackNode===l?Gy.bind(null,t):null)}function Zy(t,r){if(Cu())return null;Ty(t,r,!0)}function _k(){Ok(function(){(Qe&6)!==0?Gt(ae,Sk):Xy()})}function ch(){if(sr===0){var t=Na;t===0&&(t=la,la<<=1,(la&261888)===0&&(la=256)),sr=t}return sr}function Qy(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Hs(""+t)}function Ky(t,r){var l=r.ownerDocument.createElement("input");return l.name=r.name,l.value=r.value,t.id&&l.setAttribute("form",t.id),r.parentNode.insertBefore(l,r),t=new FormData(t),l.parentNode.removeChild(l),t}function kk(t,r,l,c,p){if(r==="submit"&&l&&l.stateNode===p){var y=Qy((p[Bt]||null).action),S=c.submitter;S&&(r=(r=S[Bt]||null)?Qy(r.formAction):S.getAttribute("formAction"),r!==null&&(y=r,S=null));var M=new qs("action","action",null,c,p);t.push({event:M,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(sr!==0){var I=S?Ky(p,S):new FormData(p);Ad(l,{pending:!0,data:I,method:p.method,action:y},null,I)}}else typeof y=="function"&&(M.preventDefault(),I=S?Ky(p,S):new FormData(p),Ad(l,{pending:!0,data:I,method:p.method,action:y},y,I))},currentTarget:p}]})}}for(var fh=0;fh<Ff.length;fh++){var dh=Ff[fh],Ek=dh.toLowerCase(),Nk=dh[0].toUpperCase()+dh.slice(1);Hn(Ek,"on"+Nk)}Hn(Mg,"onAnimationEnd"),Hn(Tg,"onAnimationIteration"),Hn(Ag,"onAnimationStart"),Hn("dblclick","onDoubleClick"),Hn("focusin","onFocus"),Hn("focusout","onBlur"),Hn($_,"onTransitionRun"),Hn(V_,"onTransitionStart"),Hn(P_,"onTransitionCancel"),Hn(zg,"onTransitionEnd"),Yi("onMouseEnter",["mouseout","mouseover"]),Yi("onMouseLeave",["mouseout","mouseover"]),Yi("onPointerEnter",["pointerout","pointerover"]),Yi("onPointerLeave",["pointerout","pointerover"]),fi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fi("onBeforeInput",["compositionend","keypress","textInput","paste"]),fi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ck=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(lo));function Jy(t,r){r=(r&4)!==0;for(var l=0;l<t.length;l++){var c=t[l],p=c.event;c=c.listeners;e:{var y=void 0;if(r)for(var S=c.length-1;0<=S;S--){var M=c[S],I=M.instance,W=M.currentTarget;if(M=M.listener,I!==y&&p.isPropagationStopped())break e;y=M,p.currentTarget=W;try{y(p)}catch(le){Ps(le)}p.currentTarget=null,y=I}else for(S=0;S<c.length;S++){if(M=c[S],I=M.instance,W=M.currentTarget,M=M.listener,I!==y&&p.isPropagationStopped())break e;y=M,p.currentTarget=W;try{y(p)}catch(le){Ps(le)}p.currentTarget=null,y=I}}}}function He(t,r){var l=r[ca];l===void 0&&(l=r[ca]=new Set);var c=t+"__bubble";l.has(c)||(Wy(r,t,2,!1),l.add(c))}function hh(t,r,l){var c=0;r&&(c|=4),Wy(l,t,c,r)}var Au="_reactListening"+Math.random().toString(36).slice(2);function ph(t){if(!t[Au]){t[Au]=!0,zs.forEach(function(l){l!=="selectionchange"&&(Ck.has(l)||hh(l,!1,t),hh(l,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[Au]||(r[Au]=!0,hh("selectionchange",!1,r))}}function Wy(t,r,l,c){switch(Mx(r)){case 2:var p=tE;break;case 8:p=nE;break;default:p=Th}l=p.bind(null,r,l,t),p=void 0,!Rf||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),c?p!==void 0?t.addEventListener(r,l,{capture:!0,passive:p}):t.addEventListener(r,l,!0):p!==void 0?t.addEventListener(r,l,{passive:p}):t.addEventListener(r,l,!1)}function mh(t,r,l,c,p){var y=c;if((r&1)===0&&(r&2)===0&&c!==null)e:for(;;){if(c===null)return;var S=c.tag;if(S===3||S===4){var M=c.stateNode.containerInfo;if(M===p)break;if(S===4)for(S=c.return;S!==null;){var I=S.tag;if((I===3||I===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;M!==null;){if(S=qi(M),S===null)return;if(I=S.tag,I===5||I===6||I===26||I===27){c=y=S;continue e}M=M.parentNode}}c=c.return}rg(function(){var W=y,le=jf(l),se=[];e:{var ee=jg.get(t);if(ee!==void 0){var re=qs,ye=t;switch(t){case"keypress":if(Us(l)===0)break e;case"keydown":case"keyup":re=v_;break;case"focusin":ye="focus",re=Bf;break;case"focusout":ye="blur",re=Bf;break;case"beforeblur":case"afterblur":re=Bf;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=og;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=s_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=__;break;case Mg:case Tg:case Ag:re=f_;break;case zg:re=E_;break;case"scroll":case"scrollend":re=l_;break;case"wheel":re=C_;break;case"copy":case"cut":case"paste":re=h_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=ug;break;case"toggle":case"beforetoggle":re=T_}var ke=(r&4)!==0,nt=!ke&&(t==="scroll"||t==="scrollend"),Z=ke?ee!==null?ee+"Capture":null:ee;ke=[];for(var X=W,J;X!==null;){var oe=X;if(J=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||J===null||Z===null||(oe=Ml(X,Z),oe!=null&&ke.push(oo(X,oe,J))),nt)break;X=X.return}0<ke.length&&(ee=new re(ee,ye,null,l,le),se.push({event:ee,listeners:ke}))}}if((r&7)===0){e:{if(ee=t==="mouseover"||t==="pointerover",re=t==="mouseout"||t==="pointerout",ee&&l!==zf&&(ye=l.relatedTarget||l.fromElement)&&(qi(ye)||ye[ci]))break e;if((re||ee)&&(ee=le.window===le?le:(ee=le.ownerDocument)?ee.defaultView||ee.parentWindow:window,re?(ye=l.relatedTarget||l.toElement,re=W,ye=ye?qi(ye):null,ye!==null&&(nt=s(ye),ke=ye.tag,ye!==nt||ke!==5&&ke!==27&&ke!==6)&&(ye=null)):(re=null,ye=W),re!==ye)){if(ke=og,oe="onMouseLeave",Z="onMouseEnter",X="mouse",(t==="pointerout"||t==="pointerover")&&(ke=ug,oe="onPointerLeave",Z="onPointerEnter",X="pointer"),nt=re==null?ee:Vi(re),J=ye==null?ee:Vi(ye),ee=new ke(oe,X+"leave",re,l,le),ee.target=nt,ee.relatedTarget=J,oe=null,qi(le)===W&&(ke=new ke(Z,X+"enter",ye,l,le),ke.target=J,ke.relatedTarget=nt,oe=ke),nt=oe,re&&ye)t:{for(ke=Mk,Z=re,X=ye,J=0,oe=Z;oe;oe=ke(oe))J++;oe=0;for(var ve=X;ve;ve=ke(ve))oe++;for(;0<J-oe;)Z=ke(Z),J--;for(;0<oe-J;)X=ke(X),oe--;for(;J--;){if(Z===X||X!==null&&Z===X.alternate){ke=Z;break t}Z=ke(Z),X=ke(X)}ke=null}else ke=null;re!==null&&ex(se,ee,re,ke,!1),ye!==null&&nt!==null&&ex(se,nt,ye,ke,!0)}}e:{if(ee=W?Vi(W):window,re=ee.nodeName&&ee.nodeName.toLowerCase(),re==="select"||re==="input"&&ee.type==="file")var Fe=yg;else if(mg(ee))if(xg)Fe=U_;else{Fe=H_;var xe=L_}else re=ee.nodeName,!re||re.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?W&&Af(W.elementType)&&(Fe=yg):Fe=B_;if(Fe&&(Fe=Fe(t,W))){gg(se,Fe,l,le);break e}xe&&xe(t,ee,W),t==="focusout"&&W&&ee.type==="number"&&W.memoizedProps.value!=null&&Cl(ee,"number",ee.value)}switch(xe=W?Vi(W):window,t){case"focusin":(mg(xe)||xe.contentEditable==="true")&&(xa=xe,Pf=W,Ll=null);break;case"focusout":Ll=Pf=xa=null;break;case"mousedown":Yf=!0;break;case"contextmenu":case"mouseup":case"dragend":Yf=!1,Ng(se,l,le);break;case"selectionchange":if(q_)break;case"keydown":case"keyup":Ng(se,l,le)}var ze;if(If)e:{switch(t){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else ya?hg(t,l)&&(Ie="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Ie="onCompositionStart");Ie&&(cg&&l.locale!=="ko"&&(ya||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&ya&&(ze=ag()):(Xi=le,Of="value"in Xi?Xi.value:Xi.textContent,ya=!0)),xe=zu(W,Ie),0<xe.length&&(Ie=new sg(Ie,t,null,l,le),se.push({event:Ie,listeners:xe}),ze?Ie.data=ze:(ze=pg(l),ze!==null&&(Ie.data=ze)))),(ze=z_?j_(t,l):D_(t,l))&&(Ie=zu(W,"onBeforeInput"),0<Ie.length&&(xe=new sg("onBeforeInput","beforeinput",null,l,le),se.push({event:xe,listeners:Ie}),xe.data=ze)),kk(se,t,W,l,le)}Jy(se,r)})}function oo(t,r,l){return{instance:t,listener:r,currentTarget:l}}function zu(t,r){for(var l=r+"Capture",c=[];t!==null;){var p=t,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=Ml(t,l),p!=null&&c.unshift(oo(t,p,y)),p=Ml(t,r),p!=null&&c.push(oo(t,p,y))),t.tag===3)return c;t=t.return}return[]}function Mk(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function ex(t,r,l,c,p){for(var y=r._reactName,S=[];l!==null&&l!==c;){var M=l,I=M.alternate,W=M.stateNode;if(M=M.tag,I!==null&&I===c)break;M!==5&&M!==26&&M!==27||W===null||(I=W,p?(W=Ml(l,y),W!=null&&S.unshift(oo(l,W,I))):p||(W=Ml(l,y),W!=null&&S.push(oo(l,W,I)))),l=l.return}S.length!==0&&t.push({event:r,listeners:S})}var Tk=/\r\n?/g,Ak=/\u0000|\uFFFD/g;function tx(t){return(typeof t=="string"?t:""+t).replace(Tk,`
|
|
9
|
+
`).replace(Ak,"")}function nx(t,r){return r=tx(r),tx(t)===r}function tt(t,r,l,c,p,y){switch(l){case"children":typeof c=="string"?r==="body"||r==="textarea"&&c===""||pa(t,c):(typeof c=="number"||typeof c=="bigint")&&r!=="body"&&pa(t,""+c);break;case"className":da(t,"class",c);break;case"tabIndex":da(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":da(t,l,c);break;case"style":ng(t,c,y);break;case"data":if(r!=="object"){da(t,"data",c);break}case"src":case"href":if(c===""&&(r!=="a"||l!=="href")){t.removeAttribute(l);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=Hs(""+c),t.setAttribute(l,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(l==="formAction"?(r!=="input"&&tt(t,r,"name",p.name,p,null),tt(t,r,"formEncType",p.formEncType,p,null),tt(t,r,"formMethod",p.formMethod,p,null),tt(t,r,"formTarget",p.formTarget,p,null)):(tt(t,r,"encType",p.encType,p,null),tt(t,r,"method",p.method,p,null),tt(t,r,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=Hs(""+c),t.setAttribute(l,c);break;case"onClick":c!=null&&(t.onclick=hi);break;case"onScroll":c!=null&&He("scroll",t);break;case"onScrollEnd":c!=null&&He("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(l=c.__html,l!=null){if(p.children!=null)throw Error(a(60));t.innerHTML=l}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}l=Hs(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""+c):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":c===!0?t.setAttribute(l,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,c):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(l,c):t.removeAttribute(l);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(l):t.setAttribute(l,c);break;case"popover":He("beforetoggle",t),He("toggle",t),fa(t,"popover",c);break;case"xlinkActuate":Ln(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Ln(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Ln(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Ln(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Ln(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Ln(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Ln(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Ln(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Ln(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":fa(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=r_.get(l)||l,fa(t,l,c))}}function gh(t,r,l,c,p,y){switch(l){case"style":ng(t,c,y);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(l=c.__html,l!=null){if(p.children!=null)throw Error(a(60));t.innerHTML=l}}break;case"children":typeof c=="string"?pa(t,c):(typeof c=="number"||typeof c=="bigint")&&pa(t,""+c);break;case"onScroll":c!=null&&He("scroll",t);break;case"onScrollEnd":c!=null&&He("scrollend",t);break;case"onClick":c!=null&&(t.onclick=hi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!js.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),r=l.slice(2,p?l.length-7:void 0),y=t[Bt]||null,y=y!=null?y[l]:null,typeof y=="function"&&t.removeEventListener(r,y,p),typeof c=="function")){typeof y!="function"&&y!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(r,c,p);break e}l in t?t[l]=c:c===!0?t.setAttribute(l,""):fa(t,l,c)}}}function Rt(t,r,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",t),He("load",t);var c=!1,p=!1,y;for(y in l)if(l.hasOwnProperty(y)){var S=l[y];if(S!=null)switch(y){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:tt(t,r,y,S,l,null)}}p&&tt(t,r,"srcSet",l.srcSet,l,null),c&&tt(t,r,"src",l.src,l,null);return;case"input":He("invalid",t);var M=y=S=p=null,I=null,W=null;for(c in l)if(l.hasOwnProperty(c)){var le=l[c];if(le!=null)switch(c){case"name":p=le;break;case"type":S=le;break;case"checked":I=le;break;case"defaultChecked":W=le;break;case"value":y=le;break;case"defaultValue":M=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(a(137,r));break;default:tt(t,r,c,le,l,null)}}Ls(t,y,M,I,W,S,p,!1);return;case"select":He("invalid",t),c=S=y=null;for(p in l)if(l.hasOwnProperty(p)&&(M=l[p],M!=null))switch(p){case"value":y=M;break;case"defaultValue":S=M;break;case"multiple":c=M;default:tt(t,r,p,M,l,null)}r=y,l=S,t.multiple=!!c,r!=null?di(t,!!c,r,!1):l!=null&&di(t,!!c,l,!0);return;case"textarea":He("invalid",t),y=p=c=null;for(S in l)if(l.hasOwnProperty(S)&&(M=l[S],M!=null))switch(S){case"value":c=M;break;case"defaultValue":p=M;break;case"children":y=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(a(91));break;default:tt(t,r,S,M,l,null)}eg(t,c,p,y);return;case"option":for(I in l)l.hasOwnProperty(I)&&(c=l[I],c!=null)&&(I==="selected"?t.selected=c&&typeof c!="function"&&typeof c!="symbol":tt(t,r,I,c,l,null));return;case"dialog":He("beforetoggle",t),He("toggle",t),He("cancel",t),He("close",t);break;case"iframe":case"object":He("load",t);break;case"video":case"audio":for(c=0;c<lo.length;c++)He(lo[c],t);break;case"image":He("error",t),He("load",t);break;case"details":He("toggle",t);break;case"embed":case"source":case"link":He("error",t),He("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in l)if(l.hasOwnProperty(W)&&(c=l[W],c!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:tt(t,r,W,c,l,null)}return;default:if(Af(r)){for(le in l)l.hasOwnProperty(le)&&(c=l[le],c!==void 0&&gh(t,r,le,c,l,void 0));return}}for(M in l)l.hasOwnProperty(M)&&(c=l[M],c!=null&&tt(t,r,M,c,l,null))}function zk(t,r,l,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,S=null,M=null,I=null,W=null,le=null;for(re in l){var se=l[re];if(l.hasOwnProperty(re)&&se!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":I=se;default:c.hasOwnProperty(re)||tt(t,r,re,null,c,se)}}for(var ee in c){var re=c[ee];if(se=l[ee],c.hasOwnProperty(ee)&&(re!=null||se!=null))switch(ee){case"type":y=re;break;case"name":p=re;break;case"checked":W=re;break;case"defaultChecked":le=re;break;case"value":S=re;break;case"defaultValue":M=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,r));break;default:re!==se&&tt(t,r,ee,re,c,se)}}Cr(t,S,M,I,W,le,y,p);return;case"select":re=S=M=ee=null;for(y in l)if(I=l[y],l.hasOwnProperty(y)&&I!=null)switch(y){case"value":break;case"multiple":re=I;default:c.hasOwnProperty(y)||tt(t,r,y,null,c,I)}for(p in c)if(y=c[p],I=l[p],c.hasOwnProperty(p)&&(y!=null||I!=null))switch(p){case"value":ee=y;break;case"defaultValue":M=y;break;case"multiple":S=y;default:y!==I&&tt(t,r,p,y,c,I)}r=M,l=S,c=re,ee!=null?di(t,!!l,ee,!1):!!c!=!!l&&(r!=null?di(t,!!l,r,!0):di(t,!!l,l?[]:"",!1));return;case"textarea":re=ee=null;for(M in l)if(p=l[M],l.hasOwnProperty(M)&&p!=null&&!c.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:tt(t,r,M,null,c,p)}for(S in c)if(p=c[S],y=l[S],c.hasOwnProperty(S)&&(p!=null||y!=null))switch(S){case"value":ee=p;break;case"defaultValue":re=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==y&&tt(t,r,S,p,c,y)}Wm(t,ee,re);return;case"option":for(var ye in l)ee=l[ye],l.hasOwnProperty(ye)&&ee!=null&&!c.hasOwnProperty(ye)&&(ye==="selected"?t.selected=!1:tt(t,r,ye,null,c,ee));for(I in c)ee=c[I],re=l[I],c.hasOwnProperty(I)&&ee!==re&&(ee!=null||re!=null)&&(I==="selected"?t.selected=ee&&typeof ee!="function"&&typeof ee!="symbol":tt(t,r,I,ee,c,re));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ke in l)ee=l[ke],l.hasOwnProperty(ke)&&ee!=null&&!c.hasOwnProperty(ke)&&tt(t,r,ke,null,c,ee);for(W in c)if(ee=c[W],re=l[W],c.hasOwnProperty(W)&&ee!==re&&(ee!=null||re!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(a(137,r));break;default:tt(t,r,W,ee,c,re)}return;default:if(Af(r)){for(var nt in l)ee=l[nt],l.hasOwnProperty(nt)&&ee!==void 0&&!c.hasOwnProperty(nt)&&gh(t,r,nt,void 0,c,ee);for(le in c)ee=c[le],re=l[le],!c.hasOwnProperty(le)||ee===re||ee===void 0&&re===void 0||gh(t,r,le,ee,c,re);return}}for(var Z in l)ee=l[Z],l.hasOwnProperty(Z)&&ee!=null&&!c.hasOwnProperty(Z)&&tt(t,r,Z,null,c,ee);for(se in c)ee=c[se],re=l[se],!c.hasOwnProperty(se)||ee===re||ee==null&&re==null||tt(t,r,se,ee,c,re)}function ix(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function jk(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,l=performance.getEntriesByType("resource"),c=0;c<l.length;c++){var p=l[c],y=p.transferSize,S=p.initiatorType,M=p.duration;if(y&&M&&ix(S)){for(S=0,M=p.responseEnd,c+=1;c<l.length;c++){var I=l[c],W=I.startTime;if(W>M)break;var le=I.transferSize,se=I.initiatorType;le&&ix(se)&&(I=I.responseEnd,S+=le*(I<M?1:(M-W)/(I-W)))}if(--c,r+=8*(y+S)/(p.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var yh=null,xh=null;function ju(t){return t.nodeType===9?t:t.ownerDocument}function rx(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 ax(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function bh(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var vh=null;function Dk(){var t=window.event;return t&&t.type==="popstate"?t===vh?!1:(vh=t,!0):(vh=null,!1)}var lx=typeof setTimeout=="function"?setTimeout:void 0,Rk=typeof clearTimeout=="function"?clearTimeout:void 0,ox=typeof Promise=="function"?Promise:void 0,Ok=typeof queueMicrotask=="function"?queueMicrotask:typeof ox<"u"?function(t){return ox.resolve(null).then(t).catch(Lk)}:lx;function Lk(t){setTimeout(function(){throw t})}function ur(t){return t==="head"}function sx(t,r){var l=r,c=0;do{var p=l.nextSibling;if(t.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"||l==="/&"){if(c===0){t.removeChild(p),Ya(r);return}c--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")c++;else if(l==="html")so(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,so(l);for(var y=l.firstChild;y;){var S=y.nextSibling,M=y.nodeName;y[Er]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&y.rel.toLowerCase()==="stylesheet"||l.removeChild(y),y=S}}else l==="body"&&so(t.ownerDocument.body);l=p}while(l);Ya(r)}function ux(t,r){var l=t;t=0;do{var c=l.nextSibling;if(l.nodeType===1?r?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(r?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),c&&c.nodeType===8)if(l=c.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=c}while(l)}function wh(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var l=r;switch(r=r.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":wh(l),El(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function Hk(t,r,l,c){for(;t.nodeType===1;){var p=l;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[Er])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(y=t.getAttribute("rel"),y==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(y!==p.rel||t.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||t.getAttribute("title")!==(p.title==null?null:p.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(y=t.getAttribute("src"),(y!==(p.src==null?null:p.src)||t.getAttribute("type")!==(p.type==null?null:p.type)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&t.getAttribute("name")===y)return t}else return t;if(t=Tn(t.nextSibling),t===null)break}return null}function Bk(t,r,l){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Tn(t.nextSibling),t===null))return null;return t}function cx(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Tn(t.nextSibling),t===null))return null;return t}function Sh(t){return t.data==="$?"||t.data==="$~"}function _h(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Uk(t,r){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||l.readyState!=="loading")r();else{var c=function(){r(),l.removeEventListener("DOMContentLoaded",c)};l.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function Tn(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var kh=null;function fx(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(r===0)return Tn(t.nextSibling);r--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||r++}t=t.nextSibling}return null}function dx(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(r===0)return t;r--}else l!=="/$"&&l!=="/&"||r++}t=t.previousSibling}return null}function hx(t,r,l){switch(r=ju(l),t){case"html":if(t=r.documentElement,!t)throw Error(a(452));return t;case"head":if(t=r.head,!t)throw Error(a(453));return t;case"body":if(t=r.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function so(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);El(t)}var An=new Map,px=new Set;function Du(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ti=U.d;U.d={f:Ik,r:qk,D:$k,C:Vk,L:Pk,m:Yk,X:Fk,S:Xk,M:Gk};function Ik(){var t=Ti.f(),r=ku();return t||r}function qk(t){var r=$i(t);r!==null&&r.tag===5&&r.type==="form"?z0(r):Ti.r(t)}var $a=typeof document>"u"?null:document;function mx(t,r,l){var c=$a;if(c&&typeof r=="string"&&r){var p=Qt(r);p='link[rel="'+t+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),px.has(p)||(px.add(p),t={rel:t,crossOrigin:l,href:r},c.querySelector(p)===null&&(r=c.createElement("link"),Rt(r,"link",t),yt(r),c.head.appendChild(r)))}}function $k(t){Ti.D(t),mx("dns-prefetch",t,null)}function Vk(t,r){Ti.C(t,r),mx("preconnect",t,r)}function Pk(t,r,l){Ti.L(t,r,l);var c=$a;if(c&&t&&r){var p='link[rel="preload"][as="'+Qt(r)+'"]';r==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+Qt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+Qt(l.imageSizes)+'"]')):p+='[href="'+Qt(t)+'"]';var y=p;switch(r){case"style":y=Va(t);break;case"script":y=Pa(t)}An.has(y)||(t=m({rel:"preload",href:r==="image"&&l&&l.imageSrcSet?void 0:t,as:r},l),An.set(y,t),c.querySelector(p)!==null||r==="style"&&c.querySelector(uo(y))||r==="script"&&c.querySelector(co(y))||(r=c.createElement("link"),Rt(r,"link",t),yt(r),c.head.appendChild(r)))}}function Yk(t,r){Ti.m(t,r);var l=$a;if(l&&t){var c=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+Qt(c)+'"][href="'+Qt(t)+'"]',y=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Pa(t)}if(!An.has(y)&&(t=m({rel:"modulepreload",href:t},r),An.set(y,t),l.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(co(y)))return}c=l.createElement("link"),Rt(c,"link",t),yt(c),l.head.appendChild(c)}}}function Xk(t,r,l){Ti.S(t,r,l);var c=$a;if(c&&t){var p=Pi(c).hoistableStyles,y=Va(t);r=r||"default";var S=p.get(y);if(!S){var M={loading:0,preload:null};if(S=c.querySelector(uo(y)))M.loading=5;else{t=m({rel:"stylesheet",href:t,"data-precedence":r},l),(l=An.get(y))&&Eh(t,l);var I=S=c.createElement("link");yt(I),Rt(I,"link",t),I._p=new Promise(function(W,le){I.onload=W,I.onerror=le}),I.addEventListener("load",function(){M.loading|=1}),I.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Ru(S,r,c)}S={type:"stylesheet",instance:S,count:1,state:M},p.set(y,S)}}}function Fk(t,r){Ti.X(t,r);var l=$a;if(l&&t){var c=Pi(l).hoistableScripts,p=Pa(t),y=c.get(p);y||(y=l.querySelector(co(p)),y||(t=m({src:t,async:!0},r),(r=An.get(p))&&Nh(t,r),y=l.createElement("script"),yt(y),Rt(y,"link",t),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function Gk(t,r){Ti.M(t,r);var l=$a;if(l&&t){var c=Pi(l).hoistableScripts,p=Pa(t),y=c.get(p);y||(y=l.querySelector(co(p)),y||(t=m({src:t,async:!0,type:"module"},r),(r=An.get(p))&&Nh(t,r),y=l.createElement("script"),yt(y),Rt(y,"link",t),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function gx(t,r,l,c){var p=(p=fe.current)?Du(p):null;if(!p)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(r=Va(l.href),l=Pi(p).hoistableStyles,c=l.get(r),c||(c={type:"style",instance:null,count:0,state:null},l.set(r,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=Va(l.href);var y=Pi(p).hoistableStyles,S=y.get(t);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(t,S),(y=p.querySelector(uo(t)))&&!y._p&&(S.instance=y,S.state.loading=5),An.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},An.set(t,l),y||Zk(p,t,l,S.state))),r&&c===null)throw Error(a(528,""));return S}if(r&&c!==null)throw Error(a(529,""));return null;case"script":return r=l.async,l=l.src,typeof l=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Pa(l),l=Pi(p).hoistableScripts,c=l.get(r),c||(c={type:"script",instance:null,count:0,state:null},l.set(r,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function Va(t){return'href="'+Qt(t)+'"'}function uo(t){return'link[rel="stylesheet"]['+t+"]"}function yx(t){return m({},t,{"data-precedence":t.precedence,precedence:null})}function Zk(t,r,l,c){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?c.loading=1:(r=t.createElement("link"),c.preload=r,r.addEventListener("load",function(){return c.loading|=1}),r.addEventListener("error",function(){return c.loading|=2}),Rt(r,"link",l),yt(r),t.head.appendChild(r))}function Pa(t){return'[src="'+Qt(t)+'"]'}function co(t){return"script[async]"+t}function xx(t,r,l){if(r.count++,r.instance===null)switch(r.type){case"style":var c=t.querySelector('style[data-href~="'+Qt(l.href)+'"]');if(c)return r.instance=c,yt(c),c;var p=m({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),yt(c),Rt(c,"style",p),Ru(c,l.precedence,t),r.instance=c;case"stylesheet":p=Va(l.href);var y=t.querySelector(uo(p));if(y)return r.state.loading|=4,r.instance=y,yt(y),y;c=yx(l),(p=An.get(p))&&Eh(c,p),y=(t.ownerDocument||t).createElement("link"),yt(y);var S=y;return S._p=new Promise(function(M,I){S.onload=M,S.onerror=I}),Rt(y,"link",c),r.state.loading|=4,Ru(y,l.precedence,t),r.instance=y;case"script":return y=Pa(l.src),(p=t.querySelector(co(y)))?(r.instance=p,yt(p),p):(c=l,(p=An.get(y))&&(c=m({},l),Nh(c,p)),t=t.ownerDocument||t,p=t.createElement("script"),yt(p),Rt(p,"link",c),t.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(a(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(c=r.instance,r.state.loading|=4,Ru(c,l.precedence,t));return r.instance}function Ru(t,r,l){for(var c=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,y=p,S=0;S<c.length;S++){var M=c[S];if(M.dataset.precedence===r)y=M;else if(y!==p)break}y?y.parentNode.insertBefore(t,y.nextSibling):(r=l.nodeType===9?l.head:l,r.insertBefore(t,r.firstChild))}function Eh(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function Nh(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var Ou=null;function bx(t,r,l){if(Ou===null){var c=new Map,p=Ou=new Map;p.set(l,c)}else p=Ou,c=p.get(l),c||(c=new Map,p.set(l,c));if(c.has(t))return c;for(c.set(t,null),l=l.getElementsByTagName(t),p=0;p<l.length;p++){var y=l[p];if(!(y[Er]||y[Nt]||t==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var S=y.getAttribute(r)||"";S=t+S;var M=c.get(S);M?M.push(y):c.set(S,[y])}}return c}function vx(t,r,l){t=t.ownerDocument||t,t.head.insertBefore(l,r==="title"?t.querySelector("head > title"):null)}function Qk(t,r,l){if(l===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(t=r.disabled,typeof r.precedence=="string"&&t==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function wx(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Kk(t,r,l,c){if(l.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var p=Va(c.href),y=r.querySelector(uo(p));if(y){r=y._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=Lu.bind(t),r.then(t,t)),l.state.loading|=4,l.instance=y,yt(y);return}y=r.ownerDocument||r,c=yx(c),(p=An.get(p))&&Eh(c,p),y=y.createElement("link"),yt(y);var S=y;S._p=new Promise(function(M,I){S.onload=M,S.onerror=I}),Rt(y,"link",c),l.instance=y}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,r),(r=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Lu.bind(t),r.addEventListener("load",l),r.addEventListener("error",l))}}var Ch=0;function Jk(t,r){return t.stylesheets&&t.count===0&&Bu(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var c=setTimeout(function(){if(t.stylesheets&&Bu(t,t.stylesheets),t.unsuspend){var y=t.unsuspend;t.unsuspend=null,y()}},6e4+r);0<t.imgBytes&&Ch===0&&(Ch=62500*jk());var p=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Bu(t,t.stylesheets),t.unsuspend)){var y=t.unsuspend;t.unsuspend=null,y()}},(t.imgBytes>Ch?50:800)+r);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Lu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Hu=null;function Bu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Hu=new Map,r.forEach(Wk,t),Hu=null,Lu.call(t))}function Wk(t,r){if(!(r.state.loading&4)){var l=Hu.get(t);if(l)var c=l.get(null);else{l=new Map,Hu.set(t,l);for(var p=t.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var S=p[y];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(l.set(S.dataset.precedence,S),c=S)}c&&l.set(null,c)}p=r.instance,S=p.getAttribute("data-precedence"),y=l.get(S)||c,y===c&&l.set(null,p),l.set(S,p),this.count++,c=Lu.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),y?y.parentNode.insertBefore(p,y.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(p,t.firstChild)),r.state.loading|=4}}var fo={$$typeof:k,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function eE(t,r,l,c,p,y,S,M,I){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Sl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sl(0),this.hiddenUpdates=Sl(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function Sx(t,r,l,c,p,y,S,M,I,W,le,se){return t=new eE(t,r,l,S,I,W,le,se,M),r=1,y===!0&&(r|=24),y=cn(3,null,null,r),t.current=y,y.stateNode=t,r=ld(),r.refCount++,t.pooledCache=r,r.refCount++,y.memoizedState={element:c,isDehydrated:l,cache:r},cd(y),t}function _x(t){return t?(t=wa,t):wa}function kx(t,r,l,c,p,y){p=_x(p),c.context===null?c.context=p:c.pendingContext=p,c=Ji(r),c.payload={element:l},y=y===void 0?null:y,y!==null&&(c.callback=y),l=Wi(t,c,r),l!==null&&(nn(l,t,r),Vl(l,t,r))}function Ex(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<r?l:r}}function Mh(t,r){Ex(t,r),(t=t.alternate)&&Ex(t,r)}function Nx(t){if(t.tag===13||t.tag===31){var r=zr(t,67108864);r!==null&&nn(r,t,67108864),Mh(t,67108864)}}function Cx(t){if(t.tag===13||t.tag===31){var r=mn();r=_l(r);var l=zr(t,r);l!==null&&nn(l,t,r),Mh(t,r)}}var Uu=!0;function tE(t,r,l,c){var p=j.T;j.T=null;var y=U.p;try{U.p=2,Th(t,r,l,c)}finally{U.p=y,j.T=p}}function nE(t,r,l,c){var p=j.T;j.T=null;var y=U.p;try{U.p=8,Th(t,r,l,c)}finally{U.p=y,j.T=p}}function Th(t,r,l,c){if(Uu){var p=Ah(c);if(p===null)mh(t,r,c,Iu,l),Tx(t,c);else if(rE(p,t,r,l,c))c.stopPropagation();else if(Tx(t,c),r&4&&-1<iE.indexOf(t)){for(;p!==null;){var y=$i(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var S=ui(y.pendingLanes);if(S!==0){var M=y;for(M.pendingLanes|=2,M.entangledLanes|=2;S;){var I=1<<31-Ke(S);M.entanglements[1]|=I,S&=~I}Wn(y),(Qe&6)===0&&(Su=Et()+500,ao(0))}}break;case 31:case 13:M=zr(y,2),M!==null&&nn(M,y,2),ku(),Mh(y,2)}if(y=Ah(c),y===null&&mh(t,r,c,Iu,l),y===p)break;p=y}p!==null&&c.stopPropagation()}else mh(t,r,c,null,l)}}function Ah(t){return t=jf(t),zh(t)}var Iu=null;function zh(t){if(Iu=null,t=qi(t),t!==null){var r=s(t);if(r===null)t=null;else{var l=r.tag;if(l===13){if(t=u(r),t!==null)return t;t=null}else if(l===31){if(t=f(r),t!==null)return t;t=null}else if(l===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return Iu=t,null}function Mx(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ii()){case ae:return 2;case pe:return 8;case _e:case De:return 32;case $e:return 268435456;default:return 32}default:return 32}}var jh=!1,cr=null,fr=null,dr=null,ho=new Map,po=new Map,hr=[],iE="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Tx(t,r){switch(t){case"focusin":case"focusout":cr=null;break;case"dragenter":case"dragleave":fr=null;break;case"mouseover":case"mouseout":dr=null;break;case"pointerover":case"pointerout":ho.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":po.delete(r.pointerId)}}function mo(t,r,l,c,p,y){return t===null||t.nativeEvent!==y?(t={blockedOn:r,domEventName:l,eventSystemFlags:c,nativeEvent:y,targetContainers:[p]},r!==null&&(r=$i(r),r!==null&&Nx(r)),t):(t.eventSystemFlags|=c,r=t.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),t)}function rE(t,r,l,c,p){switch(r){case"focusin":return cr=mo(cr,t,r,l,c,p),!0;case"dragenter":return fr=mo(fr,t,r,l,c,p),!0;case"mouseover":return dr=mo(dr,t,r,l,c,p),!0;case"pointerover":var y=p.pointerId;return ho.set(y,mo(ho.get(y)||null,t,r,l,c,p)),!0;case"gotpointercapture":return y=p.pointerId,po.set(y,mo(po.get(y)||null,t,r,l,c,p)),!0}return!1}function Ax(t){var r=qi(t.target);if(r!==null){var l=s(r);if(l!==null){if(r=l.tag,r===13){if(r=u(l),r!==null){t.blockedOn=r,Ms(t.priority,function(){Cx(l)});return}}else if(r===31){if(r=f(l),r!==null){t.blockedOn=r,Ms(t.priority,function(){Cx(l)});return}}else if(r===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function qu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var l=Ah(t.nativeEvent);if(l===null){l=t.nativeEvent;var c=new l.constructor(l.type,l);zf=c,l.target.dispatchEvent(c),zf=null}else return r=$i(l),r!==null&&Nx(r),t.blockedOn=l,!1;r.shift()}return!0}function zx(t,r,l){qu(t)&&l.delete(r)}function aE(){jh=!1,cr!==null&&qu(cr)&&(cr=null),fr!==null&&qu(fr)&&(fr=null),dr!==null&&qu(dr)&&(dr=null),ho.forEach(zx),po.forEach(zx)}function $u(t,r){t.blockedOn===r&&(t.blockedOn=null,jh||(jh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,aE)))}var Vu=null;function jx(t){Vu!==t&&(Vu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Vu===t&&(Vu=null);for(var r=0;r<t.length;r+=3){var l=t[r],c=t[r+1],p=t[r+2];if(typeof c!="function"){if(zh(c||l)===null)continue;break}var y=$i(l);y!==null&&(t.splice(r,3),r-=3,Ad(y,{pending:!0,data:p,method:l.method,action:c},c,p))}}))}function Ya(t){function r(I){return $u(I,t)}cr!==null&&$u(cr,t),fr!==null&&$u(fr,t),dr!==null&&$u(dr,t),ho.forEach(r),po.forEach(r);for(var l=0;l<hr.length;l++){var c=hr[l];c.blockedOn===t&&(c.blockedOn=null)}for(;0<hr.length&&(l=hr[0],l.blockedOn===null);)Ax(l),l.blockedOn===null&&hr.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(c=0;c<l.length;c+=3){var p=l[c],y=l[c+1],S=p[Bt]||null;if(typeof y=="function")S||jx(l);else if(S){var M=null;if(y&&y.hasAttribute("formAction")){if(p=y,S=y[Bt]||null)M=S.formAction;else if(zh(p)!==null)continue}else M=S.action;typeof M=="function"?l[c+1]=M:(l.splice(c,3),c-=3),jx(l)}}}function Dx(){function t(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(S){return p=S})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),c||setTimeout(l,20)}function l(){if(!c&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(l,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function Dh(t){this._internalRoot=t}Pu.prototype.render=Dh.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(a(409));var l=r.current,c=mn();kx(l,c,t,r,null,null)},Pu.prototype.unmount=Dh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;kx(t.current,2,null,t,null,null),ku(),r[ci]=null}};function Pu(t){this._internalRoot=t}Pu.prototype.unstable_scheduleHydration=function(t){if(t){var r=Cs();t={blockedOn:null,target:t,priority:r};for(var l=0;l<hr.length&&r!==0&&r<hr[l].priority;l++);hr.splice(l,0,t),l===0&&Ax(t)}};var Rx=n.version;if(Rx!=="19.2.3")throw Error(a(527,Rx,"19.2.3"));U.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=d(r),t=t!==null?g(t):null,t=t===null?null:t.stateNode,t};var lE={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yu.isDisabled&&Yu.supportsFiber)try{At=Yu.inject(lE),pt=Yu}catch{}}return yo.createRoot=function(t,r){if(!o(t))throw Error(a(299));var l=!1,c="",p=q0,y=$0,S=V0;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(y=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError)),r=Sx(t,1,!1,null,null,l,c,null,p,y,S,Dx),t[ci]=r.current,ph(t),new Dh(r)},yo.hydrateRoot=function(t,r,l){if(!o(t))throw Error(a(299));var c=!1,p="",y=q0,S=$0,M=V0,I=null;return l!=null&&(l.unstable_strictMode===!0&&(c=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(S=l.onCaughtError),l.onRecoverableError!==void 0&&(M=l.onRecoverableError),l.formState!==void 0&&(I=l.formState)),r=Sx(t,1,!0,r,l??null,c,p,I,y,S,M,Dx),r.context=_x(null),l=r.current,c=mn(),c=_l(c),p=Ji(c),p.callback=null,Wi(l,p,c),l=c,r.current.lanes=l,kr(r,l),Wn(r),t[ci]=r.current,ph(t),new Pu(r)},yo.version="19.2.3",yo}var Px;function mE(){if(Px)return Lh.exports;Px=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Lh.exports=pE(),Lh.exports}var gE=mE();function _t(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let i=0,a;i<e.length;i++)(a=_t(e[i]))!==""&&(n+=(n&&" ")+a);else for(let i in e)e[i]&&(n+=(n&&" ")+i);return n}var yE={value:()=>{}};function Zc(){for(var e=0,n=arguments.length,i={},a;e<n;++e){if(!(a=arguments[e]+"")||a in i||/[\s.]/.test(a))throw new Error("illegal type: "+a);i[a]=[]}return new Sc(i)}function Sc(e){this._=e}function xE(e,n){return e.trim().split(/^|\s+/).map(function(i){var a="",o=i.indexOf(".");if(o>=0&&(a=i.slice(o+1),i=i.slice(0,o)),i&&!n.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:a}})}Sc.prototype=Zc.prototype={constructor:Sc,on:function(e,n){var i=this._,a=xE(e+"",i),o,s=-1,u=a.length;if(arguments.length<2){for(;++s<u;)if((o=(e=a[s]).type)&&(o=bE(i[o],e.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++s<u;)if(o=(e=a[s]).type)i[o]=Yx(i[o],e.name,n);else if(n==null)for(o in i)i[o]=Yx(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 Sc(e)},call:function(e,n){if((o=arguments.length-2)>0)for(var i=new Array(o),a=0,o,s;a<o;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],a=0,o=s.length;a<o;++a)s[a].value.apply(n,i)},apply:function(e,n,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var a=this._[e],o=0,s=a.length;o<s;++o)a[o].value.apply(n,i)}};function bE(e,n){for(var i=0,a=e.length,o;i<a;++i)if((o=e[i]).name===n)return o.value}function Yx(e,n,i){for(var a=0,o=e.length;a<o;++a)if(e[a].name===n){e[a]=yE,e=e.slice(0,a).concat(e.slice(a+1));break}return i!=null&&e.push({name:n,value:i}),e}var Ep="http://www.w3.org/1999/xhtml";const Xx={svg:"http://www.w3.org/2000/svg",xhtml:Ep,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Qc(e){var n=e+="",i=n.indexOf(":");return i>=0&&(n=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),Xx.hasOwnProperty(n)?{space:Xx[n],local:e}:e}function vE(e){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===Ep&&n.documentElement.namespaceURI===Ep?n.createElement(e):n.createElementNS(i,e)}}function wE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function yv(e){var n=Qc(e);return(n.local?wE:vE)(n)}function SE(){}function am(e){return e==null?SE:function(){return this.querySelector(e)}}function _E(e){typeof e!="function"&&(e=am(e));for(var n=this._groups,i=n.length,a=new Array(i),o=0;o<i;++o)for(var s=n[o],u=s.length,f=a[o]=new Array(u),h,d,g=0;g<u;++g)(h=s[g])&&(d=e.call(h,h.__data__,g,s))&&("__data__"in h&&(d.__data__=h.__data__),f[g]=d);return new Sn(a,this._parents)}function kE(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function EE(){return[]}function xv(e){return e==null?EE:function(){return this.querySelectorAll(e)}}function NE(e){return function(){return kE(e.apply(this,arguments))}}function CE(e){typeof e=="function"?e=NE(e):e=xv(e);for(var n=this._groups,i=n.length,a=[],o=[],s=0;s<i;++s)for(var u=n[s],f=u.length,h,d=0;d<f;++d)(h=u[d])&&(a.push(e.call(h,h.__data__,d,u)),o.push(h));return new Sn(a,o)}function bv(e){return function(){return this.matches(e)}}function vv(e){return function(n){return n.matches(e)}}var ME=Array.prototype.find;function TE(e){return function(){return ME.call(this.children,e)}}function AE(){return this.firstElementChild}function zE(e){return this.select(e==null?AE:TE(typeof e=="function"?e:vv(e)))}var jE=Array.prototype.filter;function DE(){return Array.from(this.children)}function RE(e){return function(){return jE.call(this.children,e)}}function OE(e){return this.selectAll(e==null?DE:RE(typeof e=="function"?e:vv(e)))}function LE(e){typeof e!="function"&&(e=bv(e));for(var n=this._groups,i=n.length,a=new Array(i),o=0;o<i;++o)for(var s=n[o],u=s.length,f=a[o]=[],h,d=0;d<u;++d)(h=s[d])&&e.call(h,h.__data__,d,s)&&f.push(h);return new Sn(a,this._parents)}function wv(e){return new Array(e.length)}function HE(){return new Sn(this._enter||this._groups.map(wv),this._parents)}function Ac(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Ac.prototype={constructor:Ac,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function BE(e){return function(){return e}}function UE(e,n,i,a,o,s){for(var u=0,f,h=n.length,d=s.length;u<d;++u)(f=n[u])?(f.__data__=s[u],a[u]=f):i[u]=new Ac(e,s[u]);for(;u<h;++u)(f=n[u])&&(o[u]=f)}function IE(e,n,i,a,o,s,u){var f,h,d=new Map,g=n.length,m=s.length,x=new Array(g),b;for(f=0;f<g;++f)(h=n[f])&&(x[f]=b=u.call(h,h.__data__,f,n)+"",d.has(b)?o[f]=h:d.set(b,h));for(f=0;f<m;++f)b=u.call(e,s[f],f,s)+"",(h=d.get(b))?(a[f]=h,h.__data__=s[f],d.delete(b)):i[f]=new Ac(e,s[f]);for(f=0;f<g;++f)(h=n[f])&&d.get(x[f])===h&&(o[f]=h)}function qE(e){return e.__data__}function $E(e,n){if(!arguments.length)return Array.from(this,qE);var i=n?IE:UE,a=this._parents,o=this._groups;typeof e!="function"&&(e=BE(e));for(var s=o.length,u=new Array(s),f=new Array(s),h=new Array(s),d=0;d<s;++d){var g=a[d],m=o[d],x=m.length,b=VE(e.call(g,g&&g.__data__,d,a)),w=b.length,E=f[d]=new Array(w),N=u[d]=new Array(w),_=h[d]=new Array(x);i(g,m,E,N,_,b,n);for(var D=0,k=0,C,L;D<w;++D)if(C=E[D]){for(D>=k&&(k=D+1);!(L=N[k])&&++k<w;);C._next=L||null}}return u=new Sn(u,a),u._enter=f,u._exit=h,u}function VE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function PE(){return new Sn(this._exit||this._groups.map(wv),this._parents)}function YE(e,n,i){var a=this.enter(),o=this,s=this.exit();return typeof e=="function"?(a=e(a),a&&(a=a.selection())):a=a.append(e+""),n!=null&&(o=n(o),o&&(o=o.selection())),i==null?s.remove():i(s),a&&o?a.merge(o).order():o}function XE(e){for(var n=e.selection?e.selection():e,i=this._groups,a=n._groups,o=i.length,s=a.length,u=Math.min(o,s),f=new Array(o),h=0;h<u;++h)for(var d=i[h],g=a[h],m=d.length,x=f[h]=new Array(m),b,w=0;w<m;++w)(b=d[w]||g[w])&&(x[w]=b);for(;h<o;++h)f[h]=i[h];return new Sn(f,this._parents)}function FE(){for(var e=this._groups,n=-1,i=e.length;++n<i;)for(var a=e[n],o=a.length-1,s=a[o],u;--o>=0;)(u=a[o])&&(s&&u.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(u,s),s=u);return this}function GE(e){e||(e=ZE);function n(m,x){return m&&x?e(m.__data__,x.__data__):!m-!x}for(var i=this._groups,a=i.length,o=new Array(a),s=0;s<a;++s){for(var u=i[s],f=u.length,h=o[s]=new Array(f),d,g=0;g<f;++g)(d=u[g])&&(h[g]=d);h.sort(n)}return new Sn(o,this._parents).order()}function ZE(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function QE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function KE(){return Array.from(this)}function JE(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var a=e[n],o=0,s=a.length;o<s;++o){var u=a[o];if(u)return u}return null}function WE(){let e=0;for(const n of this)++e;return e}function eN(){return!this.node()}function tN(e){for(var n=this._groups,i=0,a=n.length;i<a;++i)for(var o=n[i],s=0,u=o.length,f;s<u;++s)(f=o[s])&&e.call(f,f.__data__,s,o);return this}function nN(e){return function(){this.removeAttribute(e)}}function iN(e){return function(){this.removeAttributeNS(e.space,e.local)}}function rN(e,n){return function(){this.setAttribute(e,n)}}function aN(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function lN(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function oN(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 sN(e,n){var i=Qc(e);if(arguments.length<2){var a=this.node();return i.local?a.getAttributeNS(i.space,i.local):a.getAttribute(i)}return this.each((n==null?i.local?iN:nN:typeof n=="function"?i.local?oN:lN:i.local?aN:rN)(i,n))}function Sv(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function uN(e){return function(){this.style.removeProperty(e)}}function cN(e,n,i){return function(){this.style.setProperty(e,n,i)}}function fN(e,n,i){return function(){var a=n.apply(this,arguments);a==null?this.style.removeProperty(e):this.style.setProperty(e,a,i)}}function dN(e,n,i){return arguments.length>1?this.each((n==null?uN:typeof n=="function"?fN:cN)(e,n,i??"")):sl(this.node(),e)}function sl(e,n){return e.style.getPropertyValue(n)||Sv(e).getComputedStyle(e,null).getPropertyValue(n)}function hN(e){return function(){delete this[e]}}function pN(e,n){return function(){this[e]=n}}function mN(e,n){return function(){var i=n.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function gN(e,n){return arguments.length>1?this.each((n==null?hN:typeof n=="function"?mN:pN)(e,n)):this.node()[e]}function _v(e){return e.trim().split(/^|\s+/)}function lm(e){return e.classList||new kv(e)}function kv(e){this._node=e,this._names=_v(e.getAttribute("class")||"")}kv.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 Ev(e,n){for(var i=lm(e),a=-1,o=n.length;++a<o;)i.add(n[a])}function Nv(e,n){for(var i=lm(e),a=-1,o=n.length;++a<o;)i.remove(n[a])}function yN(e){return function(){Ev(this,e)}}function xN(e){return function(){Nv(this,e)}}function bN(e,n){return function(){(n.apply(this,arguments)?Ev:Nv)(this,e)}}function vN(e,n){var i=_v(e+"");if(arguments.length<2){for(var a=lm(this.node()),o=-1,s=i.length;++o<s;)if(!a.contains(i[o]))return!1;return!0}return this.each((typeof n=="function"?bN:n?yN:xN)(i,n))}function wN(){this.textContent=""}function SN(e){return function(){this.textContent=e}}function _N(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function kN(e){return arguments.length?this.each(e==null?wN:(typeof e=="function"?_N:SN)(e)):this.node().textContent}function EN(){this.innerHTML=""}function NN(e){return function(){this.innerHTML=e}}function CN(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function MN(e){return arguments.length?this.each(e==null?EN:(typeof e=="function"?CN:NN)(e)):this.node().innerHTML}function TN(){this.nextSibling&&this.parentNode.appendChild(this)}function AN(){return this.each(TN)}function zN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function jN(){return this.each(zN)}function DN(e){var n=typeof e=="function"?e:yv(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function RN(){return null}function ON(e,n){var i=typeof e=="function"?e:yv(e),a=n==null?RN:typeof n=="function"?n:am(n);return this.select(function(){return this.insertBefore(i.apply(this,arguments),a.apply(this,arguments)||null)})}function LN(){var e=this.parentNode;e&&e.removeChild(this)}function HN(){return this.each(LN)}function BN(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function UN(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function IN(e){return this.select(e?UN:BN)}function qN(e){return arguments.length?this.property("__data__",e):this.node().__data__}function $N(e){return function(n){e.call(this,n,this.__data__)}}function VN(e){return e.trim().split(/^|\s+/).map(function(n){var i="",a=n.indexOf(".");return a>=0&&(i=n.slice(a+1),n=n.slice(0,a)),{type:n,name:i}})}function PN(e){return function(){var n=this.__on;if(n){for(var i=0,a=-1,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[++a]=s;++a?n.length=a:delete this.__on}}}function YN(e,n,i){return function(){var a=this.__on,o,s=$N(n);if(a){for(var u=0,f=a.length;u<f;++u)if((o=a[u]).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},a?a.push(o):this.__on=[o]}}function XN(e,n,i){var a=VN(e+""),o,s=a.length,u;if(arguments.length<2){var f=this.node().__on;if(f){for(var h=0,d=f.length,g;h<d;++h)for(o=0,g=f[h];o<s;++o)if((u=a[o]).type===g.type&&u.name===g.name)return g.value}return}for(f=n?YN:PN,o=0;o<s;++o)this.each(f(a[o],n,i));return this}function Cv(e,n,i){var a=Sv(e),o=a.CustomEvent;typeof o=="function"?o=new o(n,i):(o=a.document.createEvent("Event"),i?(o.initEvent(n,i.bubbles,i.cancelable),o.detail=i.detail):o.initEvent(n,!1,!1)),e.dispatchEvent(o)}function FN(e,n){return function(){return Cv(this,e,n)}}function GN(e,n){return function(){return Cv(this,e,n.apply(this,arguments))}}function ZN(e,n){return this.each((typeof n=="function"?GN:FN)(e,n))}function*QN(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var a=e[n],o=0,s=a.length,u;o<s;++o)(u=a[o])&&(yield u)}var Mv=[null];function Sn(e,n){this._groups=e,this._parents=n}function us(){return new Sn([[document.documentElement]],Mv)}function KN(){return this}Sn.prototype=us.prototype={constructor:Sn,select:_E,selectAll:CE,selectChild:zE,selectChildren:OE,filter:LE,data:$E,enter:HE,exit:PE,join:YE,merge:XE,selection:KN,order:FE,sort:GE,call:QE,nodes:KE,node:JE,size:WE,empty:eN,each:tN,attr:sN,style:dN,property:gN,classed:vN,text:kN,html:MN,raise:AN,lower:jN,append:DN,insert:ON,remove:HN,clone:IN,datum:qN,on:XN,dispatch:ZN,[Symbol.iterator]:QN};function vn(e){return typeof e=="string"?new Sn([[document.querySelector(e)]],[document.documentElement]):new Sn([[e]],Mv)}function JN(e){let n;for(;n=e.sourceEvent;)e=n;return e}function In(e,n){if(e=JN(e),n===void 0&&(n=e.currentTarget),n){var i=n.ownerSVGElement||n;if(i.createSVGPoint){var a=i.createSVGPoint();return a.x=e.clientX,a.y=e.clientY,a=a.matrixTransform(n.getScreenCTM().inverse()),[a.x,a.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}}return[e.pageX,e.pageY]}const WN={passive:!1},Zo={capture:!0,passive:!1};function Ih(e){e.stopImmediatePropagation()}function nl(e){e.preventDefault(),e.stopImmediatePropagation()}function Tv(e){var n=e.document.documentElement,i=vn(e).on("dragstart.drag",nl,Zo);"onselectstart"in n?i.on("selectstart.drag",nl,Zo):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Av(e,n){var i=e.document.documentElement,a=vn(e).on("dragstart.drag",null);n&&(a.on("click.drag",nl,Zo),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in i?a.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Xu=e=>()=>e;function Np(e,{sourceEvent:n,subject:i,target:a,identifier:o,active:s,x:u,y:f,dx:h,dy:d,dispatch:g}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:g}})}Np.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function eC(e){return!e.ctrlKey&&!e.button}function tC(){return this.parentNode}function nC(e,n){return n??{x:e.x,y:e.y}}function iC(){return navigator.maxTouchPoints||"ontouchstart"in this}function zv(){var e=eC,n=tC,i=nC,a=iC,o={},s=Zc("start","drag","end"),u=0,f,h,d,g,m=0;function x(C){C.on("mousedown.drag",b).filter(a).on("touchstart.drag",N).on("touchmove.drag",_,WN).on("touchend.drag touchcancel.drag",D).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(C,L){if(!(g||!e.call(this,C,L))){var A=k(this,n.call(this,C,L),C,L,"mouse");A&&(vn(C.view).on("mousemove.drag",w,Zo).on("mouseup.drag",E,Zo),Tv(C.view),Ih(C),d=!1,f=C.clientX,h=C.clientY,A("start",C))}}function w(C){if(nl(C),!d){var L=C.clientX-f,A=C.clientY-h;d=L*L+A*A>m}o.mouse("drag",C)}function E(C){vn(C.view).on("mousemove.drag mouseup.drag",null),Av(C.view,d),nl(C),o.mouse("end",C)}function N(C,L){if(e.call(this,C,L)){var A=C.changedTouches,H=n.call(this,C,L),F=A.length,G,q;for(G=0;G<F;++G)(q=k(this,H,C,L,A[G].identifier,A[G]))&&(Ih(C),q("start",C,A[G]))}}function _(C){var L=C.changedTouches,A=L.length,H,F;for(H=0;H<A;++H)(F=o[L[H].identifier])&&(nl(C),F("drag",C,L[H]))}function D(C){var L=C.changedTouches,A=L.length,H,F;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),H=0;H<A;++H)(F=o[L[H].identifier])&&(Ih(C),F("end",C,L[H]))}function k(C,L,A,H,F,G){var q=s.copy(),V=In(G||A,L),P,te,O;if((O=i.call(C,new Np("beforestart",{sourceEvent:A,target:x,identifier:F,active:u,x:V[0],y:V[1],dx:0,dy:0,dispatch:q}),H))!=null)return P=O.x-V[0]||0,te=O.y-V[1]||0,function B(j,U,Y){var K=V,z;switch(j){case"start":o[F]=B,z=u++;break;case"end":delete o[F],--u;case"drag":V=In(Y||U,L),z=u;break}q.call(j,C,new Np(j,{sourceEvent:U,subject:O,target:x,identifier:F,active:z,x:V[0]+P,y:V[1]+te,dx:V[0]-K[0],dy:V[1]-K[1],dispatch:q}),H)}}return x.filter=function(C){return arguments.length?(e=typeof C=="function"?C:Xu(!!C),x):e},x.container=function(C){return arguments.length?(n=typeof C=="function"?C:Xu(C),x):n},x.subject=function(C){return arguments.length?(i=typeof C=="function"?C:Xu(C),x):i},x.touchable=function(C){return arguments.length?(a=typeof C=="function"?C:Xu(!!C),x):a},x.on=function(){var C=s.on.apply(s,arguments);return C===s?x:C},x.clickDistance=function(C){return arguments.length?(m=(C=+C)*C,x):Math.sqrt(m)},x}function om(e,n,i){e.prototype=n.prototype=i,i.constructor=e}function jv(e,n){var i=Object.create(e.prototype);for(var a in n)i[a]=n[a];return i}function cs(){}var Qo=.7,zc=1/Qo,il="\\s*([+-]?\\d+)\\s*",Ko="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ii="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rC=/^#([0-9a-f]{3,8})$/,aC=new RegExp(`^rgb\\(${il},${il},${il}\\)$`),lC=new RegExp(`^rgb\\(${ii},${ii},${ii}\\)$`),oC=new RegExp(`^rgba\\(${il},${il},${il},${Ko}\\)$`),sC=new RegExp(`^rgba\\(${ii},${ii},${ii},${Ko}\\)$`),uC=new RegExp(`^hsl\\(${Ko},${ii},${ii}\\)$`),cC=new RegExp(`^hsla\\(${Ko},${ii},${ii},${Ko}\\)$`),Fx={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};om(cs,Wr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Gx,formatHex:Gx,formatHex8:fC,formatHsl:dC,formatRgb:Zx,toString:Zx});function Gx(){return this.rgb().formatHex()}function fC(){return this.rgb().formatHex8()}function dC(){return Dv(this).formatHsl()}function Zx(){return this.rgb().formatRgb()}function Wr(e){var n,i;return e=(e+"").trim().toLowerCase(),(n=rC.exec(e))?(i=n[1].length,n=parseInt(n[1],16),i===6?Qx(n):i===3?new an(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):i===8?Fu(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):i===4?Fu(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=aC.exec(e))?new an(n[1],n[2],n[3],1):(n=lC.exec(e))?new an(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=oC.exec(e))?Fu(n[1],n[2],n[3],n[4]):(n=sC.exec(e))?Fu(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=uC.exec(e))?Wx(n[1],n[2]/100,n[3]/100,1):(n=cC.exec(e))?Wx(n[1],n[2]/100,n[3]/100,n[4]):Fx.hasOwnProperty(e)?Qx(Fx[e]):e==="transparent"?new an(NaN,NaN,NaN,0):null}function Qx(e){return new an(e>>16&255,e>>8&255,e&255,1)}function Fu(e,n,i,a){return a<=0&&(e=n=i=NaN),new an(e,n,i,a)}function hC(e){return e instanceof cs||(e=Wr(e)),e?(e=e.rgb(),new an(e.r,e.g,e.b,e.opacity)):new an}function Cp(e,n,i,a){return arguments.length===1?hC(e):new an(e,n,i,a??1)}function an(e,n,i,a){this.r=+e,this.g=+n,this.b=+i,this.opacity=+a}om(an,Cp,jv(cs,{brighter(e){return e=e==null?zc:Math.pow(zc,e),new an(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Qo:Math.pow(Qo,e),new an(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new an(Kr(this.r),Kr(this.g),Kr(this.b),jc(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:Kx,formatHex:Kx,formatHex8:pC,formatRgb:Jx,toString:Jx}));function Kx(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}`}function pC(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}${Qr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Jx(){const e=jc(this.opacity);return`${e===1?"rgb(":"rgba("}${Kr(this.r)}, ${Kr(this.g)}, ${Kr(this.b)}${e===1?")":`, ${e})`}`}function jc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Kr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qr(e){return e=Kr(e),(e<16?"0":"")+e.toString(16)}function Wx(e,n,i,a){return a<=0?e=n=i=NaN:i<=0||i>=1?e=n=NaN:n<=0&&(e=NaN),new qn(e,n,i,a)}function Dv(e){if(e instanceof qn)return new qn(e.h,e.s,e.l,e.opacity);if(e instanceof cs||(e=Wr(e)),!e)return new qn;if(e instanceof qn)return e;e=e.rgb();var n=e.r/255,i=e.g/255,a=e.b/255,o=Math.min(n,i,a),s=Math.max(n,i,a),u=NaN,f=s-o,h=(s+o)/2;return f?(n===s?u=(i-a)/f+(i<a)*6:i===s?u=(a-n)/f+2:u=(n-i)/f+4,f/=h<.5?s+o:2-s-o,u*=60):f=h>0&&h<1?0:u,new qn(u,f,h,e.opacity)}function mC(e,n,i,a){return arguments.length===1?Dv(e):new qn(e,n,i,a??1)}function qn(e,n,i,a){this.h=+e,this.s=+n,this.l=+i,this.opacity=+a}om(qn,mC,jv(cs,{brighter(e){return e=e==null?zc:Math.pow(zc,e),new qn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Qo:Math.pow(Qo,e),new qn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,a=i+(i<.5?i:1-i)*n,o=2*i-a;return new an(qh(e>=240?e-240:e+120,o,a),qh(e,o,a),qh(e<120?e+240:e-120,o,a),this.opacity)},clamp(){return new qn(eb(this.h),Gu(this.s),Gu(this.l),jc(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=jc(this.opacity);return`${e===1?"hsl(":"hsla("}${eb(this.h)}, ${Gu(this.s)*100}%, ${Gu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function eb(e){return e=(e||0)%360,e<0?e+360:e}function Gu(e){return Math.max(0,Math.min(1,e||0))}function qh(e,n,i){return(e<60?n+(i-n)*e/60:e<180?i:e<240?n+(i-n)*(240-e)/60:n)*255}const sm=e=>()=>e;function gC(e,n){return function(i){return e+i*n}}function yC(e,n,i){return e=Math.pow(e,i),n=Math.pow(n,i)-e,i=1/i,function(a){return Math.pow(e+a*n,i)}}function xC(e){return(e=+e)==1?Rv:function(n,i){return i-n?yC(n,i,e):sm(isNaN(n)?i:n)}}function Rv(e,n){var i=n-e;return i?gC(e,i):sm(isNaN(e)?n:e)}const Dc=(function e(n){var i=xC(n);function a(o,s){var u=i((o=Cp(o)).r,(s=Cp(s)).r),f=i(o.g,s.g),h=i(o.b,s.b),d=Rv(o.opacity,s.opacity);return function(g){return o.r=u(g),o.g=f(g),o.b=h(g),o.opacity=d(g),o+""}}return a.gamma=e,a})(1);function bC(e,n){n||(n=[]);var i=e?Math.min(n.length,e.length):0,a=n.slice(),o;return function(s){for(o=0;o<i;++o)a[o]=e[o]*(1-s)+n[o]*s;return a}}function vC(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function wC(e,n){var i=n?n.length:0,a=e?Math.min(i,e.length):0,o=new Array(a),s=new Array(i),u;for(u=0;u<a;++u)o[u]=Po(e[u],n[u]);for(;u<i;++u)s[u]=n[u];return function(f){for(u=0;u<a;++u)s[u]=o[u](f);return s}}function SC(e,n){var i=new Date;return e=+e,n=+n,function(a){return i.setTime(e*(1-a)+n*a),i}}function ti(e,n){return e=+e,n=+n,function(i){return e*(1-i)+n*i}}function _C(e,n){var i={},a={},o;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(o in n)o in e?i[o]=Po(e[o],n[o]):a[o]=n[o];return function(s){for(o in i)a[o]=i[o](s);return a}}var Mp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$h=new RegExp(Mp.source,"g");function kC(e){return function(){return e}}function EC(e){return function(n){return e(n)+""}}function Ov(e,n){var i=Mp.lastIndex=$h.lastIndex=0,a,o,s,u=-1,f=[],h=[];for(e=e+"",n=n+"";(a=Mp.exec(e))&&(o=$h.exec(n));)(s=o.index)>i&&(s=n.slice(i,s),f[u]?f[u]+=s:f[++u]=s),(a=a[0])===(o=o[0])?f[u]?f[u]+=o:f[++u]=o:(f[++u]=null,h.push({i:u,x:ti(a,o)})),i=$h.lastIndex;return i<n.length&&(s=n.slice(i),f[u]?f[u]+=s:f[++u]=s),f.length<2?h[0]?EC(h[0].x):kC(n):(n=h.length,function(d){for(var g=0,m;g<n;++g)f[(m=h[g]).i]=m.x(d);return f.join("")})}function Po(e,n){var i=typeof n,a;return n==null||i==="boolean"?sm(n):(i==="number"?ti:i==="string"?(a=Wr(n))?(n=a,Dc):Ov:n instanceof Wr?Dc:n instanceof Date?SC:vC(n)?bC:Array.isArray(n)?wC:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?_C:ti)(e,n)}var tb=180/Math.PI,Tp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Lv(e,n,i,a,o,s){var u,f,h;return(u=Math.sqrt(e*e+n*n))&&(e/=u,n/=u),(h=e*i+n*a)&&(i-=e*h,a-=n*h),(f=Math.sqrt(i*i+a*a))&&(i/=f,a/=f,h/=f),e*a<n*i&&(e=-e,n=-n,h=-h,u=-u),{translateX:o,translateY:s,rotate:Math.atan2(n,e)*tb,skewX:Math.atan(h)*tb,scaleX:u,scaleY:f}}var Zu;function NC(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Tp:Lv(n.a,n.b,n.c,n.d,n.e,n.f)}function CC(e){return e==null||(Zu||(Zu=document.createElementNS("http://www.w3.org/2000/svg","g")),Zu.setAttribute("transform",e),!(e=Zu.transform.baseVal.consolidate()))?Tp:(e=e.matrix,Lv(e.a,e.b,e.c,e.d,e.e,e.f))}function Hv(e,n,i,a){function o(d){return d.length?d.pop()+" ":""}function s(d,g,m,x,b,w){if(d!==m||g!==x){var E=b.push("translate(",null,n,null,i);w.push({i:E-4,x:ti(d,m)},{i:E-2,x:ti(g,x)})}else(m||x)&&b.push("translate("+m+n+x+i)}function u(d,g,m,x){d!==g?(d-g>180?g+=360:g-d>180&&(d+=360),x.push({i:m.push(o(m)+"rotate(",null,a)-2,x:ti(d,g)})):g&&m.push(o(m)+"rotate("+g+a)}function f(d,g,m,x){d!==g?x.push({i:m.push(o(m)+"skewX(",null,a)-2,x:ti(d,g)}):g&&m.push(o(m)+"skewX("+g+a)}function h(d,g,m,x,b,w){if(d!==m||g!==x){var E=b.push(o(b)+"scale(",null,",",null,")");w.push({i:E-4,x:ti(d,m)},{i:E-2,x:ti(g,x)})}else(m!==1||x!==1)&&b.push(o(b)+"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),u(d.rotate,g.rotate,m,x),f(d.skewX,g.skewX,m,x),h(d.scaleX,d.scaleY,g.scaleX,g.scaleY,m,x),d=g=null,function(b){for(var w=-1,E=x.length,N;++w<E;)m[(N=x[w]).i]=N.x(b);return m.join("")}}}var MC=Hv(NC,"px, ","px)","deg)"),TC=Hv(CC,", ",")",")"),AC=1e-12;function nb(e){return((e=Math.exp(e))+1/e)/2}function zC(e){return((e=Math.exp(e))-1/e)/2}function jC(e){return((e=Math.exp(2*e))-1)/(e+1)}const _c=(function e(n,i,a){function o(s,u){var f=s[0],h=s[1],d=s[2],g=u[0],m=u[1],x=u[2],b=g-f,w=m-h,E=b*b+w*w,N,_;if(E<AC)_=Math.log(x/d)/n,N=function(H){return[f+H*b,h+H*w,d*Math.exp(n*H*_)]};else{var D=Math.sqrt(E),k=(x*x-d*d+a*E)/(2*d*i*D),C=(x*x-d*d-a*E)/(2*x*i*D),L=Math.log(Math.sqrt(k*k+1)-k),A=Math.log(Math.sqrt(C*C+1)-C);_=(A-L)/n,N=function(H){var F=H*_,G=nb(L),q=d/(i*D)*(G*jC(n*F+L)-zC(L));return[f+q*b,h+q*w,d*G/nb(n*F+L)]}}return N.duration=_*1e3*n/Math.SQRT2,N}return o.rho=function(s){var u=Math.max(.001,+s),f=u*u,h=f*f;return e(u,f,h)},o})(Math.SQRT2,2,4);var ul=0,Io=0,xo=0,Bv=1e3,Rc,qo,Oc=0,ea=0,Kc=0,Jo=typeof performance=="object"&&performance.now?performance:Date,Uv=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function um(){return ea||(Uv(DC),ea=Jo.now()+Kc)}function DC(){ea=0}function Lc(){this._call=this._time=this._next=null}Lc.prototype=Iv.prototype={constructor:Lc,restart:function(e,n,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?um():+i)+(n==null?0:+n),!this._next&&qo!==this&&(qo?qo._next=this:Rc=this,qo=this),this._call=e,this._time=i,Ap()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ap())}};function Iv(e,n,i){var a=new Lc;return a.restart(e,n,i),a}function RC(){um(),++ul;for(var e=Rc,n;e;)(n=ea-e._time)>=0&&e._call.call(void 0,n),e=e._next;--ul}function ib(){ea=(Oc=Jo.now())+Kc,ul=Io=0;try{RC()}finally{ul=0,LC(),ea=0}}function OC(){var e=Jo.now(),n=e-Oc;n>Bv&&(Kc-=n,Oc=e)}function LC(){for(var e,n=Rc,i,a=1/0;n;)n._call?(a>n._time&&(a=n._time),e=n,n=n._next):(i=n._next,n._next=null,n=e?e._next=i:Rc=i);qo=e,Ap(a)}function Ap(e){if(!ul){Io&&(Io=clearTimeout(Io));var n=e-ea;n>24?(e<1/0&&(Io=setTimeout(ib,e-Jo.now()-Kc)),xo&&(xo=clearInterval(xo))):(xo||(Oc=Jo.now(),xo=setInterval(OC,Bv)),ul=1,Uv(ib))}}function rb(e,n,i){var a=new Lc;return n=n==null?0:+n,a.restart(o=>{a.stop(),e(o+n)},n,i),a}var HC=Zc("start","end","cancel","interrupt"),BC=[],qv=0,ab=1,zp=2,kc=3,lb=4,jp=5,Ec=6;function Jc(e,n,i,a,o,s){var u=e.__transition;if(!u)e.__transition={};else if(i in u)return;UC(e,i,{name:n,index:a,group:o,on:HC,tween:BC,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:qv})}function cm(e,n){var i=Xn(e,n);if(i.state>qv)throw new Error("too late; already scheduled");return i}function ai(e,n){var i=Xn(e,n);if(i.state>kc)throw new Error("too late; already running");return i}function Xn(e,n){var i=e.__transition;if(!i||!(i=i[n]))throw new Error("transition not found");return i}function UC(e,n,i){var a=e.__transition,o;a[n]=i,i.timer=Iv(s,0,i.time);function s(d){i.state=ab,i.timer.restart(u,i.delay,i.time),i.delay<=d&&u(d-i.delay)}function u(d){var g,m,x,b;if(i.state!==ab)return h();for(g in a)if(b=a[g],b.name===i.name){if(b.state===kc)return rb(u);b.state===lb?(b.state=Ec,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete a[g]):+g<n&&(b.state=Ec,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete a[g])}if(rb(function(){i.state===kc&&(i.state=lb,i.timer.restart(f,i.delay,i.time),f(d))}),i.state=zp,i.on.call("start",e,e.__data__,i.index,i.group),i.state===zp){for(i.state=kc,o=new Array(x=i.tween.length),g=0,m=-1;g<x;++g)(b=i.tween[g].value.call(e,e.__data__,i.index,i.group))&&(o[++m]=b);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=jp,1),m=-1,x=o.length;++m<x;)o[m].call(e,g);i.state===jp&&(i.on.call("end",e,e.__data__,i.index,i.group),h())}function h(){i.state=Ec,i.timer.stop(),delete a[n];for(var d in a)return;delete e.__transition}}function Nc(e,n){var i=e.__transition,a,o,s=!0,u;if(i){n=n==null?null:n+"";for(u in i){if((a=i[u]).name!==n){s=!1;continue}o=a.state>zp&&a.state<jp,a.state=Ec,a.timer.stop(),a.on.call(o?"interrupt":"cancel",e,e.__data__,a.index,a.group),delete i[u]}s&&delete e.__transition}}function IC(e){return this.each(function(){Nc(this,e)})}function qC(e,n){var i,a;return function(){var o=ai(this,e),s=o.tween;if(s!==i){a=i=s;for(var u=0,f=a.length;u<f;++u)if(a[u].name===n){a=a.slice(),a.splice(u,1);break}}o.tween=a}}function $C(e,n,i){var a,o;if(typeof i!="function")throw new Error;return function(){var s=ai(this,e),u=s.tween;if(u!==a){o=(a=u).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 VC(e,n){var i=this._id;if(e+="",arguments.length<2){for(var a=Xn(this.node(),i).tween,o=0,s=a.length,u;o<s;++o)if((u=a[o]).name===e)return u.value;return null}return this.each((n==null?qC:$C)(i,e,n))}function fm(e,n,i){var a=e._id;return e.each(function(){var o=ai(this,a);(o.value||(o.value={}))[n]=i.apply(this,arguments)}),function(o){return Xn(o,a).value[n]}}function $v(e,n){var i;return(typeof n=="number"?ti:n instanceof Wr?Dc:(i=Wr(n))?(n=i,Dc):Ov)(e,n)}function PC(e){return function(){this.removeAttribute(e)}}function YC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function XC(e,n,i){var a,o=i+"",s;return function(){var u=this.getAttribute(e);return u===o?null:u===a?s:s=n(a=u,i)}}function FC(e,n,i){var a,o=i+"",s;return function(){var u=this.getAttributeNS(e.space,e.local);return u===o?null:u===a?s:s=n(a=u,i)}}function GC(e,n,i){var a,o,s;return function(){var u,f=i(this),h;return f==null?void this.removeAttribute(e):(u=this.getAttribute(e),h=f+"",u===h?null:u===a&&h===o?s:(o=h,s=n(a=u,f)))}}function ZC(e,n,i){var a,o,s;return function(){var u,f=i(this),h;return f==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),h=f+"",u===h?null:u===a&&h===o?s:(o=h,s=n(a=u,f)))}}function QC(e,n){var i=Qc(e),a=i==="transform"?TC:$v;return this.attrTween(e,typeof n=="function"?(i.local?ZC:GC)(i,a,fm(this,"attr."+e,n)):n==null?(i.local?YC:PC)(i):(i.local?FC:XC)(i,a,n))}function KC(e,n){return function(i){this.setAttribute(e,n.call(this,i))}}function JC(e,n){return function(i){this.setAttributeNS(e.space,e.local,n.call(this,i))}}function WC(e,n){var i,a;function o(){var s=n.apply(this,arguments);return s!==a&&(i=(a=s)&&JC(e,s)),i}return o._value=n,o}function e4(e,n){var i,a;function o(){var s=n.apply(this,arguments);return s!==a&&(i=(a=s)&&KC(e,s)),i}return o._value=n,o}function t4(e,n){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;var a=Qc(e);return this.tween(i,(a.local?WC:e4)(a,n))}function n4(e,n){return function(){cm(this,e).delay=+n.apply(this,arguments)}}function i4(e,n){return n=+n,function(){cm(this,e).delay=n}}function r4(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?n4:i4)(n,e)):Xn(this.node(),n).delay}function a4(e,n){return function(){ai(this,e).duration=+n.apply(this,arguments)}}function l4(e,n){return n=+n,function(){ai(this,e).duration=n}}function o4(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?a4:l4)(n,e)):Xn(this.node(),n).duration}function s4(e,n){if(typeof n!="function")throw new Error;return function(){ai(this,e).ease=n}}function u4(e){var n=this._id;return arguments.length?this.each(s4(n,e)):Xn(this.node(),n).ease}function c4(e,n){return function(){var i=n.apply(this,arguments);if(typeof i!="function")throw new Error;ai(this,e).ease=i}}function f4(e){if(typeof e!="function")throw new Error;return this.each(c4(this._id,e))}function d4(e){typeof e!="function"&&(e=bv(e));for(var n=this._groups,i=n.length,a=new Array(i),o=0;o<i;++o)for(var s=n[o],u=s.length,f=a[o]=[],h,d=0;d<u;++d)(h=s[d])&&e.call(h,h.__data__,d,s)&&f.push(h);return new Li(a,this._parents,this._name,this._id)}function h4(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,i=e._groups,a=n.length,o=i.length,s=Math.min(a,o),u=new Array(a),f=0;f<s;++f)for(var h=n[f],d=i[f],g=h.length,m=u[f]=new Array(g),x,b=0;b<g;++b)(x=h[b]||d[b])&&(m[b]=x);for(;f<a;++f)u[f]=n[f];return new Li(u,this._parents,this._name,this._id)}function p4(e){return(e+"").trim().split(/^|\s+/).every(function(n){var i=n.indexOf(".");return i>=0&&(n=n.slice(0,i)),!n||n==="start"})}function m4(e,n,i){var a,o,s=p4(n)?cm:ai;return function(){var u=s(this,e),f=u.on;f!==a&&(o=(a=f).copy()).on(n,i),u.on=o}}function g4(e,n){var i=this._id;return arguments.length<2?Xn(this.node(),i).on.on(e):this.each(m4(i,e,n))}function y4(e){return function(){var n=this.parentNode;for(var i in this.__transition)if(+i!==e)return;n&&n.removeChild(this)}}function x4(){return this.on("end.remove",y4(this._id))}function b4(e){var n=this._name,i=this._id;typeof e!="function"&&(e=am(e));for(var a=this._groups,o=a.length,s=new Array(o),u=0;u<o;++u)for(var f=a[u],h=f.length,d=s[u]=new Array(h),g,m,x=0;x<h;++x)(g=f[x])&&(m=e.call(g,g.__data__,x,f))&&("__data__"in g&&(m.__data__=g.__data__),d[x]=m,Jc(d[x],n,i,x,d,Xn(g,i)));return new Li(s,this._parents,n,i)}function v4(e){var n=this._name,i=this._id;typeof e!="function"&&(e=xv(e));for(var a=this._groups,o=a.length,s=[],u=[],f=0;f<o;++f)for(var h=a[f],d=h.length,g,m=0;m<d;++m)if(g=h[m]){for(var x=e.call(g,g.__data__,m,h),b,w=Xn(g,i),E=0,N=x.length;E<N;++E)(b=x[E])&&Jc(b,n,i,E,x,w);s.push(x),u.push(g)}return new Li(s,u,n,i)}var w4=us.prototype.constructor;function S4(){return new w4(this._groups,this._parents)}function _4(e,n){var i,a,o;return function(){var s=sl(this,e),u=(this.style.removeProperty(e),sl(this,e));return s===u?null:s===i&&u===a?o:o=n(i=s,a=u)}}function Vv(e){return function(){this.style.removeProperty(e)}}function k4(e,n,i){var a,o=i+"",s;return function(){var u=sl(this,e);return u===o?null:u===a?s:s=n(a=u,i)}}function E4(e,n,i){var a,o,s;return function(){var u=sl(this,e),f=i(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(e),sl(this,e))),u===h?null:u===a&&h===o?s:(o=h,s=n(a=u,f))}}function N4(e,n){var i,a,o,s="style."+n,u="end."+s,f;return function(){var h=ai(this,e),d=h.on,g=h.value[s]==null?f||(f=Vv(n)):void 0;(d!==i||o!==g)&&(a=(i=d).copy()).on(u,o=g),h.on=a}}function C4(e,n,i){var a=(e+="")=="transform"?MC:$v;return n==null?this.styleTween(e,_4(e,a)).on("end.style."+e,Vv(e)):typeof n=="function"?this.styleTween(e,E4(e,a,fm(this,"style."+e,n))).each(N4(this._id,e)):this.styleTween(e,k4(e,a,n),i).on("end.style."+e,null)}function M4(e,n,i){return function(a){this.style.setProperty(e,n.call(this,a),i)}}function T4(e,n,i){var a,o;function s(){var u=n.apply(this,arguments);return u!==o&&(a=(o=u)&&M4(e,u,i)),a}return s._value=n,s}function A4(e,n,i){var a="style."+(e+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(n==null)return this.tween(a,null);if(typeof n!="function")throw new Error;return this.tween(a,T4(e,n,i??""))}function z4(e){return function(){this.textContent=e}}function j4(e){return function(){var n=e(this);this.textContent=n??""}}function D4(e){return this.tween("text",typeof e=="function"?j4(fm(this,"text",e)):z4(e==null?"":e+""))}function R4(e){return function(n){this.textContent=e.call(this,n)}}function O4(e){var n,i;function a(){var o=e.apply(this,arguments);return o!==i&&(n=(i=o)&&R4(o)),n}return a._value=e,a}function L4(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,O4(e))}function H4(){for(var e=this._name,n=this._id,i=Pv(),a=this._groups,o=a.length,s=0;s<o;++s)for(var u=a[s],f=u.length,h,d=0;d<f;++d)if(h=u[d]){var g=Xn(h,n);Jc(h,e,i,d,u,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new Li(a,this._parents,e,i)}function B4(){var e,n,i=this,a=i._id,o=i.size();return new Promise(function(s,u){var f={value:u},h={value:function(){--o===0&&s()}};i.each(function(){var d=ai(this,a),g=d.on;g!==e&&(n=(e=g).copy(),n._.cancel.push(f),n._.interrupt.push(f),n._.end.push(h)),d.on=n}),o===0&&s()})}var U4=0;function Li(e,n,i,a){this._groups=e,this._parents=n,this._name=i,this._id=a}function Pv(){return++U4}var Ai=us.prototype;Li.prototype={constructor:Li,select:b4,selectAll:v4,selectChild:Ai.selectChild,selectChildren:Ai.selectChildren,filter:d4,merge:h4,selection:S4,transition:H4,call:Ai.call,nodes:Ai.nodes,node:Ai.node,size:Ai.size,empty:Ai.empty,each:Ai.each,on:g4,attr:QC,attrTween:t4,style:C4,styleTween:A4,text:D4,textTween:L4,remove:x4,tween:VC,delay:r4,duration:o4,ease:u4,easeVarying:f4,end:B4,[Symbol.iterator]:Ai[Symbol.iterator]};function I4(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var q4={time:null,delay:0,duration:250,ease:I4};function $4(e,n){for(var i;!(i=e.__transition)||!(i=i[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return i}function V4(e){var n,i;e instanceof Li?(n=e._id,e=e._name):(n=Pv(),(i=q4).time=um(),e=e==null?null:e+"");for(var a=this._groups,o=a.length,s=0;s<o;++s)for(var u=a[s],f=u.length,h,d=0;d<f;++d)(h=u[d])&&Jc(h,e,n,d,u,i||$4(h,n));return new Li(a,this._parents,e,n)}us.prototype.interrupt=IC;us.prototype.transition=V4;const Qu=e=>()=>e;function P4(e,{sourceEvent:n,target:i,transform:a,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:a,enumerable:!0,configurable:!0},_:{value:o}})}function Ri(e,n,i){this.k=e,this.x=n,this.y=i}Ri.prototype={constructor:Ri,scale:function(e){return e===1?this:new Ri(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Ri(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Wc=new Ri(1,0,0);Yv.prototype=Ri.prototype;function Yv(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Wc;return e.__zoom}function Vh(e){e.stopImmediatePropagation()}function bo(e){e.preventDefault(),e.stopImmediatePropagation()}function Y4(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function X4(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function ob(){return this.__zoom||Wc}function F4(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function G4(){return navigator.maxTouchPoints||"ontouchstart"in this}function Z4(e,n,i){var a=e.invertX(n[0][0])-i[0][0],o=e.invertX(n[1][0])-i[1][0],s=e.invertY(n[0][1])-i[0][1],u=e.invertY(n[1][1])-i[1][1];return e.translate(o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o),u>s?(s+u)/2:Math.min(0,s)||Math.max(0,u))}function Xv(){var e=Y4,n=X4,i=Z4,a=F4,o=G4,s=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,h=_c,d=Zc("start","zoom","end"),g,m,x,b=500,w=150,E=0,N=10;function _(O){O.property("__zoom",ob).on("wheel.zoom",F,{passive:!1}).on("mousedown.zoom",G).on("dblclick.zoom",q).filter(o).on("touchstart.zoom",V).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",te).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(O,B,j,U){var Y=O.selection?O.selection():O;Y.property("__zoom",ob),O!==Y?L(O,B,j,U):Y.interrupt().each(function(){A(this,arguments).event(U).start().zoom(null,typeof B=="function"?B.apply(this,arguments):B).end()})},_.scaleBy=function(O,B,j,U){_.scaleTo(O,function(){var Y=this.__zoom.k,K=typeof B=="function"?B.apply(this,arguments):B;return Y*K},j,U)},_.scaleTo=function(O,B,j,U){_.transform(O,function(){var Y=n.apply(this,arguments),K=this.__zoom,z=j==null?C(Y):typeof j=="function"?j.apply(this,arguments):j,R=K.invert(z),$=typeof B=="function"?B.apply(this,arguments):B;return i(k(D(K,$),z,R),Y,u)},j,U)},_.translateBy=function(O,B,j,U){_.transform(O,function(){return i(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof j=="function"?j.apply(this,arguments):j),n.apply(this,arguments),u)},null,U)},_.translateTo=function(O,B,j,U,Y){_.transform(O,function(){var K=n.apply(this,arguments),z=this.__zoom,R=U==null?C(K):typeof U=="function"?U.apply(this,arguments):U;return i(Wc.translate(R[0],R[1]).scale(z.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof j=="function"?-j.apply(this,arguments):-j),K,u)},U,Y)};function D(O,B){return B=Math.max(s[0],Math.min(s[1],B)),B===O.k?O:new Ri(B,O.x,O.y)}function k(O,B,j){var U=B[0]-j[0]*O.k,Y=B[1]-j[1]*O.k;return U===O.x&&Y===O.y?O:new Ri(O.k,U,Y)}function C(O){return[(+O[0][0]+ +O[1][0])/2,(+O[0][1]+ +O[1][1])/2]}function L(O,B,j,U){O.on("start.zoom",function(){A(this,arguments).event(U).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(U).end()}).tween("zoom",function(){var Y=this,K=arguments,z=A(Y,K).event(U),R=n.apply(Y,K),$=j==null?C(R):typeof j=="function"?j.apply(Y,K):j,T=Math.max(R[1][0]-R[0][0],R[1][1]-R[0][1]),ie=Y.__zoom,ce=typeof B=="function"?B.apply(Y,K):B,fe=h(ie.invert($).concat(T/ie.k),ce.invert($).concat(T/ce.k));return function(he){if(he===1)he=ce;else{var ue=fe(he),me=T/ue[2];he=new Ri(me,$[0]-ue[0]*me,$[1]-ue[1]*me)}z.zoom(null,he)}})}function A(O,B,j){return!j&&O.__zooming||new H(O,B)}function H(O,B){this.that=O,this.args=B,this.active=0,this.sourceEvent=null,this.extent=n.apply(O,B),this.taps=0}H.prototype={event:function(O){return O&&(this.sourceEvent=O),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(O,B){return this.mouse&&O!=="mouse"&&(this.mouse[1]=B.invert(this.mouse[0])),this.touch0&&O!=="touch"&&(this.touch0[1]=B.invert(this.touch0[0])),this.touch1&&O!=="touch"&&(this.touch1[1]=B.invert(this.touch1[0])),this.that.__zoom=B,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(O){var B=vn(this.that).datum();d.call(O,this.that,new P4(O,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:d}),B)}};function F(O,...B){if(!e.apply(this,arguments))return;var j=A(this,B).event(O),U=this.__zoom,Y=Math.max(s[0],Math.min(s[1],U.k*Math.pow(2,a.apply(this,arguments)))),K=In(O);if(j.wheel)(j.mouse[0][0]!==K[0]||j.mouse[0][1]!==K[1])&&(j.mouse[1]=U.invert(j.mouse[0]=K)),clearTimeout(j.wheel);else{if(U.k===Y)return;j.mouse=[K,U.invert(K)],Nc(this),j.start()}bo(O),j.wheel=setTimeout(z,w),j.zoom("mouse",i(k(D(U,Y),j.mouse[0],j.mouse[1]),j.extent,u));function z(){j.wheel=null,j.end()}}function G(O,...B){if(x||!e.apply(this,arguments))return;var j=O.currentTarget,U=A(this,B,!0).event(O),Y=vn(O.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",T,!0),K=In(O,j),z=O.clientX,R=O.clientY;Tv(O.view),Vh(O),U.mouse=[K,this.__zoom.invert(K)],Nc(this),U.start();function $(ie){if(bo(ie),!U.moved){var ce=ie.clientX-z,fe=ie.clientY-R;U.moved=ce*ce+fe*fe>E}U.event(ie).zoom("mouse",i(k(U.that.__zoom,U.mouse[0]=In(ie,j),U.mouse[1]),U.extent,u))}function T(ie){Y.on("mousemove.zoom mouseup.zoom",null),Av(ie.view,U.moved),bo(ie),U.event(ie).end()}}function q(O,...B){if(e.apply(this,arguments)){var j=this.__zoom,U=In(O.changedTouches?O.changedTouches[0]:O,this),Y=j.invert(U),K=j.k*(O.shiftKey?.5:2),z=i(k(D(j,K),U,Y),n.apply(this,B),u);bo(O),f>0?vn(this).transition().duration(f).call(L,z,U,O):vn(this).call(_.transform,z,U,O)}}function V(O,...B){if(e.apply(this,arguments)){var j=O.touches,U=j.length,Y=A(this,B,O.changedTouches.length===U).event(O),K,z,R,$;for(Vh(O),z=0;z<U;++z)R=j[z],$=In(R,this),$=[$,this.__zoom.invert($),R.identifier],Y.touch0?!Y.touch1&&Y.touch0[2]!==$[2]&&(Y.touch1=$,Y.taps=0):(Y.touch0=$,K=!0,Y.taps=1+!!g);g&&(g=clearTimeout(g)),K&&(Y.taps<2&&(m=$[0],g=setTimeout(function(){g=null},b)),Nc(this),Y.start())}}function P(O,...B){if(this.__zooming){var j=A(this,B).event(O),U=O.changedTouches,Y=U.length,K,z,R,$;for(bo(O),K=0;K<Y;++K)z=U[K],R=In(z,this),j.touch0&&j.touch0[2]===z.identifier?j.touch0[0]=R:j.touch1&&j.touch1[2]===z.identifier&&(j.touch1[0]=R);if(z=j.that.__zoom,j.touch1){var T=j.touch0[0],ie=j.touch0[1],ce=j.touch1[0],fe=j.touch1[1],he=(he=ce[0]-T[0])*he+(he=ce[1]-T[1])*he,ue=(ue=fe[0]-ie[0])*ue+(ue=fe[1]-ie[1])*ue;z=D(z,Math.sqrt(he/ue)),R=[(T[0]+ce[0])/2,(T[1]+ce[1])/2],$=[(ie[0]+fe[0])/2,(ie[1]+fe[1])/2]}else if(j.touch0)R=j.touch0[0],$=j.touch0[1];else return;j.zoom("touch",i(k(z,R,$),j.extent,u))}}function te(O,...B){if(this.__zooming){var j=A(this,B).event(O),U=O.changedTouches,Y=U.length,K,z;for(Vh(O),x&&clearTimeout(x),x=setTimeout(function(){x=null},b),K=0;K<Y;++K)z=U[K],j.touch0&&j.touch0[2]===z.identifier?delete j.touch0:j.touch1&&j.touch1[2]===z.identifier&&delete j.touch1;if(j.touch1&&!j.touch0&&(j.touch0=j.touch1,delete j.touch1),j.touch0)j.touch0[1]=this.__zoom.invert(j.touch0[0]);else if(j.end(),j.taps===2&&(z=In(z,this),Math.hypot(m[0]-z[0],m[1]-z[1])<N)){var R=vn(this).on("dblclick.zoom");R&&R.apply(this,arguments)}}}return _.wheelDelta=function(O){return arguments.length?(a=typeof O=="function"?O:Qu(+O),_):a},_.filter=function(O){return arguments.length?(e=typeof O=="function"?O:Qu(!!O),_):e},_.touchable=function(O){return arguments.length?(o=typeof O=="function"?O:Qu(!!O),_):o},_.extent=function(O){return arguments.length?(n=typeof O=="function"?O:Qu([[+O[0][0],+O[0][1]],[+O[1][0],+O[1][1]]]),_):n},_.scaleExtent=function(O){return arguments.length?(s[0]=+O[0],s[1]=+O[1],_):[s[0],s[1]]},_.translateExtent=function(O){return arguments.length?(u[0][0]=+O[0][0],u[1][0]=+O[1][0],u[0][1]=+O[0][1],u[1][1]=+O[1][1],_):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},_.constrain=function(O){return arguments.length?(i=O,_):i},_.duration=function(O){return arguments.length?(f=+O,_):f},_.interpolate=function(O){return arguments.length?(h=O,_):h},_.on=function(){var O=d.on.apply(d,arguments);return O===d?_:O},_.clickDistance=function(O){return arguments.length?(E=(O=+O)*O,_):Math.sqrt(E)},_.tapDistance=function(O){return arguments.length?(N=+O,_):N},_}const ri={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:i,targetHandle:a})=>`Couldn't create edge for ${e} handle id: "${e==="source"?i:a}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Wo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Fv=["Enter"," ","Escape"],Gv={"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 cl;(function(e){e.Strict="strict",e.Loose="loose"})(cl||(cl={}));var Jr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Jr||(Jr={}));var es;(function(e){e.Partial="partial",e.Full="full"})(es||(es={}));const Zv={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var wr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(wr||(wr={}));var Hc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Hc||(Hc={}));var be;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(be||(be={}));const sb={[be.Left]:be.Right,[be.Right]:be.Left,[be.Top]:be.Bottom,[be.Bottom]:be.Top};function Qv(e){return e===null?null:e?"valid":"invalid"}const Kv=e=>"id"in e&&"source"in e&&"target"in e,Q4=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),dm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),fs=(e,n=[0,0])=>{const{width:i,height:a}=Bi(e),o=e.origin??n,s=i*o[0],u=a*o[1];return{x:e.position.x-s,y:e.position.y-u}},K4=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const i=e.reduce((a,o)=>{const s=typeof o=="string";let u=!n.nodeLookup&&!s?o:void 0;n.nodeLookup&&(u=s?n.nodeLookup.get(o):dm(o)?o:n.nodeLookup.get(o.id));const f=u?Bc(u,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ef(a,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return tf(i)},ds=(e,n={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return e.forEach(o=>{(n.filter===void 0||n.filter(o))&&(i=ef(i,Bc(o)),a=!0)}),a?tf(i):{x:0,y:0,width:0,height:0}},hm=(e,n,[i,a,o]=[0,0,1],s=!1,u=!1)=>{const f={...ps(n,[i,a,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(u&&!m||x)continue;const b=g.width??d.width??d.initialWidth??null,w=g.height??d.height??d.initialHeight??null,E=ts(f,dl(d)),N=(b??0)*(w??0),_=s&&E>0;(!d.internals.handleBounds||_||E>=N||d.dragging)&&h.push(d)}return h},J4=(e,n)=>{const i=new Set;return e.forEach(a=>{i.add(a.id)}),n.filter(a=>i.has(a.source)||i.has(a.target))};function W4(e,n){const i=new Map,a=n?.nodes?new Set(n.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&(n?.includeHiddenNodes||!o.hidden)&&(!a||a.has(o.id))&&i.set(o.id,o)}),i}async function eM({nodes:e,width:n,height:i,panZoom:a,minZoom:o,maxZoom:s},u){if(e.size===0)return Promise.resolve(!0);const f=W4(e,u),h=ds(f),d=pm(h,n,i,u?.minZoom??o,u?.maxZoom??s,u?.padding??.1);return await a.setViewport(d,{duration:u?.duration,ease:u?.ease,interpolate:u?.interpolate}),Promise.resolve(!0)}function Jv({nodeId:e,nextPosition:n,nodeLookup:i,nodeOrigin:a=[0,0],nodeExtent:o,onError:s}){const u=i.get(e),f=u.parentId?i.get(u.parentId):void 0,{x:h,y:d}=f?f.internals.positionAbsolute:{x:0,y:0},g=u.origin??a;let m=u.extent||o;if(u.extent==="parent"&&!u.expandParent)if(!f)s?.("005",ri.error005());else{const b=f.measured.width,w=f.measured.height;b&&w&&(m=[[h,d],[h+b,d+w]])}else f&&hl(u.extent)&&(m=[[u.extent[0][0]+h,u.extent[0][1]+d],[u.extent[1][0]+h,u.extent[1][1]+d]]);const x=hl(m)?ta(n,m,u.measured):n;return(u.measured.width===void 0||u.measured.height===void 0)&&s?.("015",ri.error015()),{position:{x:x.x-h+(u.measured.width??0)*g[0],y:x.y-d+(u.measured.height??0)*g[1]},positionAbsolute:x}}async function tM({nodesToRemove:e=[],edgesToRemove:n=[],nodes:i,edges:a,onBeforeDelete:o}){const s=new Set(e.map(x=>x.id)),u=[];for(const x of i){if(x.deletable===!1)continue;const b=s.has(x.id),w=!b&&x.parentId&&u.find(E=>E.id===x.parentId);(b||w)&&u.push(x)}const f=new Set(n.map(x=>x.id)),h=a.filter(x=>x.deletable!==!1),g=J4(u,h);for(const x of h)f.has(x.id)&&!g.find(w=>w.id===x.id)&&g.push(x);if(!o)return{edges:g,nodes:u};const m=await o({nodes:u,edges:g});return typeof m=="boolean"?m?{edges:g,nodes:u}:{edges:[],nodes:[]}:m}const fl=(e,n=0,i=1)=>Math.min(Math.max(e,n),i),ta=(e={x:0,y:0},n,i)=>({x:fl(e.x,n[0][0],n[1][0]-(i?.width??0)),y:fl(e.y,n[0][1],n[1][1]-(i?.height??0))});function Wv(e,n,i){const{width:a,height:o}=Bi(i),{x:s,y:u}=i.internals.positionAbsolute;return ta(e,[[s,u],[s+a,u+o]],n)}const ub=(e,n,i)=>e<n?fl(Math.abs(e-n),1,n)/n:e>i?-fl(Math.abs(e-i),1,n)/n:0,ew=(e,n,i=15,a=40)=>{const o=ub(e.x,a,n.width-a)*i,s=ub(e.y,a,n.height-a)*i;return[o,s]},ef=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),Dp=({x:e,y:n,width:i,height:a})=>({x:e,y:n,x2:e+i,y2:n+a}),tf=({x:e,y:n,x2:i,y2:a})=>({x:e,y:n,width:i-e,height:a-n}),dl=(e,n=[0,0])=>{const{x:i,y:a}=dm(e)?e.internals.positionAbsolute:fs(e,n);return{x:i,y:a,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Bc=(e,n=[0,0])=>{const{x:i,y:a}=dm(e)?e.internals.positionAbsolute:fs(e,n);return{x:i,y:a,x2:i+(e.measured?.width??e.width??e.initialWidth??0),y2:a+(e.measured?.height??e.height??e.initialHeight??0)}},tw=(e,n)=>tf(ef(Dp(e),Dp(n))),ts=(e,n)=>{const i=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),a=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(i*a)},cb=e=>$n(e.width)&&$n(e.height)&&$n(e.x)&&$n(e.y),$n=e=>!isNaN(e)&&isFinite(e),nM=(e,n)=>{},hs=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),ps=({x:e,y:n},[i,a,o],s=!1,u=[1,1])=>{const f={x:(e-i)/o,y:(n-a)/o};return s?hs(f,u):f},Uc=({x:e,y:n},[i,a,o])=>({x:e*o+i,y:n*o+a});function Xa(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(i)}if(typeof e=="string"&&e.endsWith("%")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(n*i*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function iM(e,n,i){if(typeof e=="string"||typeof e=="number"){const a=Xa(e,i),o=Xa(e,n);return{top:a,right:o,bottom:a,left:o,x:o*2,y:a*2}}if(typeof e=="object"){const a=Xa(e.top??e.y??0,i),o=Xa(e.bottom??e.y??0,i),s=Xa(e.left??e.x??0,n),u=Xa(e.right??e.x??0,n);return{top:a,right:u,bottom:o,left:s,x:s+u,y:a+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function rM(e,n,i,a,o,s){const{x:u,y:f}=Uc(e,[n,i,a]),{x:h,y:d}=Uc({x:e.x+e.width,y:e.y+e.height},[n,i,a]),g=o-h,m=s-d;return{left:Math.floor(u),top:Math.floor(f),right:Math.floor(g),bottom:Math.floor(m)}}const pm=(e,n,i,a,o,s)=>{const u=iM(s,n,i),f=(n-u.x)/e.width,h=(i-u.y)/e.height,d=Math.min(f,h),g=fl(d,a,o),m=e.x+e.width/2,x=e.y+e.height/2,b=n/2-m*g,w=i/2-x*g,E=rM(e,b,w,g,n,i),N={left:Math.min(E.left-u.left,0),top:Math.min(E.top-u.top,0),right:Math.min(E.right-u.right,0),bottom:Math.min(E.bottom-u.bottom,0)};return{x:b-N.left+N.right,y:w-N.top+N.bottom,zoom:g}},ns=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function hl(e){return e!=null&&e!=="parent"}function Bi(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function nw(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function iw(e,n={width:0,height:0},i,a,o){const s={...e},u=a.get(i);if(u){const f=u.origin||o;s.x+=u.internals.positionAbsolute.x-(n.width??0)*f[0],s.y+=u.internals.positionAbsolute.y-(n.height??0)*f[1]}return s}function fb(e,n){if(e.size!==n.size)return!1;for(const i of e)if(!n.has(i))return!1;return!0}function aM(){let e,n;return{promise:new Promise((a,o)=>{e=a,n=o}),resolve:e,reject:n}}function lM(e){return{...Gv,...e||{}}}function Yo(e,{snapGrid:n=[0,0],snapToGrid:i=!1,transform:a,containerBounds:o}){const{x:s,y:u}=Vn(e),f=ps({x:s-(o?.left??0),y:u-(o?.top??0)},a),{x:h,y:d}=i?hs(f,n):f;return{xSnapped:h,ySnapped:d,...f}}const mm=e=>({width:e.offsetWidth,height:e.offsetHeight}),rw=e=>e?.getRootNode?.()||window?.document,oM=["INPUT","SELECT","TEXTAREA"];function aw(e){const n=e.composedPath?.()?.[0]||e.target;return n?.nodeType!==1?!1:oM.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const lw=e=>"clientX"in e,Vn=(e,n)=>{const i=lw(e),a=i?e.clientX:e.touches?.[0].clientX,o=i?e.clientY:e.touches?.[0].clientY;return{x:a-(n?.left??0),y:o-(n?.top??0)}},db=(e,n,i,a,o)=>{const s=n.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(u=>{const f=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:o,position:u.getAttribute("data-handlepos"),x:(f.left-i.left)/a,y:(f.top-i.top)/a,...mm(u)}})};function ow({sourceX:e,sourceY:n,targetX:i,targetY:a,sourceControlX:o,sourceControlY:s,targetControlX:u,targetControlY:f}){const h=e*.125+o*.375+u*.375+i*.125,d=n*.125+s*.375+f*.375+a*.125,g=Math.abs(h-e),m=Math.abs(d-n);return[h,d,g,m]}function Ku(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function hb({pos:e,x1:n,y1:i,x2:a,y2:o,c:s}){switch(e){case be.Left:return[n-Ku(n-a,s),i];case be.Right:return[n+Ku(a-n,s),i];case be.Top:return[n,i-Ku(i-o,s)];case be.Bottom:return[n,i+Ku(o-i,s)]}}function sw({sourceX:e,sourceY:n,sourcePosition:i=be.Bottom,targetX:a,targetY:o,targetPosition:s=be.Top,curvature:u=.25}){const[f,h]=hb({pos:i,x1:e,y1:n,x2:a,y2:o,c:u}),[d,g]=hb({pos:s,x1:a,y1:o,x2:e,y2:n,c:u}),[m,x,b,w]=ow({sourceX:e,sourceY:n,targetX:a,targetY:o,sourceControlX:f,sourceControlY:h,targetControlX:d,targetControlY:g});return[`M${e},${n} C${f},${h} ${d},${g} ${a},${o}`,m,x,b,w]}function uw({sourceX:e,sourceY:n,targetX:i,targetY:a}){const o=Math.abs(i-e)/2,s=i<e?i+o:i-o,u=Math.abs(a-n)/2,f=a<n?a+u:a-u;return[s,f,o,u]}function sM({sourceNode:e,targetNode:n,selected:i=!1,zIndex:a=0,elevateOnSelect:o=!1,zIndexMode:s="basic"}){if(s==="manual")return a;const u=o&&i?a+1e3:a,f=Math.max(e.parentId||o&&e.selected?e.internals.z:0,n.parentId||o&&n.selected?n.internals.z:0);return u+f}function uM({sourceNode:e,targetNode:n,width:i,height:a,transform:o}){const s=ef(Bc(e),Bc(n));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const u={x:-o[0]/o[2],y:-o[1]/o[2],width:i/o[2],height:a/o[2]};return ts(u,tf(s))>0}const cM=({source:e,sourceHandle:n,target:i,targetHandle:a})=>`xy-edge__${e}${n||""}-${i}${a||""}`,fM=(e,n)=>n.some(i=>i.source===e.source&&i.target===e.target&&(i.sourceHandle===e.sourceHandle||!i.sourceHandle&&!e.sourceHandle)&&(i.targetHandle===e.targetHandle||!i.targetHandle&&!e.targetHandle)),cw=(e,n,i={})=>{if(!e.source||!e.target)return n;const a=i.getEdgeId||cM;let o;return Kv(e)?o={...e}:o={...e,id:a(e)},fM(o,n)?n:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,n.concat(o))};function fw({sourceX:e,sourceY:n,targetX:i,targetY:a}){const[o,s,u,f]=uw({sourceX:e,sourceY:n,targetX:i,targetY:a});return[`M ${e},${n}L ${i},${a}`,o,s,u,f]}const pb={[be.Left]:{x:-1,y:0},[be.Right]:{x:1,y:0},[be.Top]:{x:0,y:-1},[be.Bottom]:{x:0,y:1}},dM=({source:e,sourcePosition:n=be.Bottom,target:i})=>n===be.Left||n===be.Right?e.x<i.x?{x:1,y:0}:{x:-1,y:0}:e.y<i.y?{x:0,y:1}:{x:0,y:-1},mb=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function hM({source:e,sourcePosition:n=be.Bottom,target:i,targetPosition:a=be.Top,center:o,offset:s,stepPosition:u}){const f=pb[n],h=pb[a],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=dM({source:d,sourcePosition:n,target:g}),x=m.x!==0?"x":"y",b=m[x];let w=[],E,N;const _={x:0,y:0},D={x:0,y:0},[,,k,C]=uw({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)*u,N=o.y??(d.y+g.y)/2):(E=o.x??(d.x+g.x)/2,N=o.y??d.y+(g.y-d.y)*u);const A=[{x:E,y:d.y},{x:E,y:g.y}],H=[{x:d.x,y:N},{x:g.x,y:N}];f[x]===b?w=x==="x"?A:H:w=x==="x"?H:A}else{const A=[{x:d.x,y:g.y}],H=[{x:g.x,y:d.y}];if(x==="x"?w=f.x===b?H:A:w=f.y===b?A:H,n===a){const P=Math.abs(e[x]-i[x]);if(P<=s){const te=Math.min(s-1,s-P);f[x]===b?_[x]=(d[x]>e[x]?-1:1)*te:D[x]=(g[x]>i[x]?-1:1)*te}}if(n!==a){const P=x==="x"?"y":"x",te=f[x]===h[P],O=d[P]>g[P],B=d[P]<g[P];(f[x]===1&&(!te&&O||te&&B)||f[x]!==1&&(!te&&B||te&&O))&&(w=x==="x"?A:H)}const F={x:d.x+_.x,y:d.y+_.y},G={x:g.x+D.x,y:g.y+D.y},q=Math.max(Math.abs(F.x-w[0].x),Math.abs(G.x-w[0].x)),V=Math.max(Math.abs(F.y-w[0].y),Math.abs(G.y-w[0].y));q>=V?(E=(F.x+G.x)/2,N=w[0].y):(E=w[0].x,N=(F.y+G.y)/2)}return[[e,{x:d.x+_.x,y:d.y+_.y},...w,{x:g.x+D.x,y:g.y+D.y},i],E,N,k,C]}function pM(e,n,i,a){const o=Math.min(mb(e,n)/2,mb(n,i)/2,a),{x:s,y:u}=n;if(e.x===s&&s===i.x||e.y===u&&u===i.y)return`L${s} ${u}`;if(e.y===u){const d=e.x<i.x?-1:1,g=e.y<i.y?1:-1;return`L ${s+o*d},${u}Q ${s},${u} ${s},${u+o*g}`}const f=e.x<i.x?1:-1,h=e.y<i.y?-1:1;return`L ${s},${u+o*h}Q ${s},${u} ${s+o*f},${u}`}function Rp({sourceX:e,sourceY:n,sourcePosition:i=be.Bottom,targetX:a,targetY:o,targetPosition:s=be.Top,borderRadius:u=5,centerX:f,centerY:h,offset:d=20,stepPosition:g=.5}){const[m,x,b,w,E]=hM({source:{x:e,y:n},sourcePosition:i,target:{x:a,y:o},targetPosition:s,center:{x:f,y:h},offset:d,stepPosition:g});return[m.reduce((_,D,k)=>{let C="";return k>0&&k<m.length-1?C=pM(m[k-1],D,m[k+1],u):C=`${k===0?"M":"L"}${D.x} ${D.y}`,_+=C,_},""),x,b,w,E]}function gb(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function mM(e){const{sourceNode:n,targetNode:i}=e;if(!gb(n)||!gb(i))return null;const a=n.internals.handleBounds||yb(n.handles),o=i.internals.handleBounds||yb(i.handles),s=xb(a?.source??[],e.sourceHandle),u=xb(e.connectionMode===cl.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!s||!u)return e.onError?.("008",ri.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const f=s?.position||be.Bottom,h=u?.position||be.Top,d=na(n,s,f),g=na(i,u,h);return{sourceX:d.x,sourceY:d.y,targetX:g.x,targetY:g.y,sourcePosition:f,targetPosition:h}}function yb(e){if(!e)return null;const n=[],i=[];for(const a of e)a.width=a.width??1,a.height=a.height??1,a.type==="source"?n.push(a):a.type==="target"&&i.push(a);return{source:n,target:i}}function na(e,n,i=be.Left,a=!1){const o=(n?.x??0)+e.internals.positionAbsolute.x,s=(n?.y??0)+e.internals.positionAbsolute.y,{width:u,height:f}=n??Bi(e);if(a)return{x:o+u/2,y:s+f/2};switch(n?.position??i){case be.Top:return{x:o+u/2,y:s};case be.Right:return{x:o+u,y:s+f/2};case be.Bottom:return{x:o+u/2,y:s+f};case be.Left:return{x:o,y:s+f/2}}}function xb(e,n){return e&&(n?e.find(i=>i.id===n):e[0])||null}function Op(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(a=>`${a}=${e[a]}`).join("&")}`:""}function gM(e,{id:n,defaultColor:i,defaultMarkerStart:a,defaultMarkerEnd:o}){const s=new Set;return e.reduce((u,f)=>([f.markerStart||a,f.markerEnd||o].forEach(h=>{if(h&&typeof h=="object"){const d=Op(h,n);s.has(d)||(u.push({id:d,color:h.color||i,...h}),s.add(d))}}),u),[]).sort((u,f)=>u.id.localeCompare(f.id))}const dw=1e3,yM=10,gm={nodeOrigin:[0,0],nodeExtent:Wo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},xM={...gm,checkEquality:!0};function ym(e,n){const i={...e};for(const a in n)n[a]!==void 0&&(i[a]=n[a]);return i}function bM(e,n,i){const a=ym(gm,i);for(const o of e.values())if(o.parentId)bm(o,e,n,a);else{const s=fs(o,a.nodeOrigin),u=hl(o.extent)?o.extent:a.nodeExtent,f=ta(s,u,Bi(o));o.internals.positionAbsolute=f}}function vM(e,n){if(!e.handles)return e.measured?n?.internals.handleBounds:void 0;const i=[],a=[];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"&&a.push(s)}return{source:i,target:a}}function xm(e){return e==="manual"}function Lp(e,n,i,a={}){const o=ym(xM,a),s={i:0},u=new Map(n),f=o?.elevateNodesOnSelect&&!xm(o.zIndexMode)?dw:0;let h=e.length>0;n.clear(),i.clear();for(const d of e){let g=u.get(d.id);if(o.checkEquality&&d===g?.internals.userNode)n.set(d.id,g);else{const m=fs(d,o.nodeOrigin),x=hl(d.extent)?d.extent:o.nodeExtent,b=ta(m,x,Bi(d));g={...o.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:b,handleBounds:vM(d,g),z:hw(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&&bm(g,n,i,a,s)}return h}function wM(e,n){if(!e.parentId)return;const i=n.get(e.parentId);i?i.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function bm(e,n,i,a,o){const{elevateNodesOnSelect:s,nodeOrigin:u,nodeExtent:f,zIndexMode:h}=ym(gm,a),d=e.parentId,g=n.get(d);if(!g){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}wM(e,i),o&&!g.parentId&&g.internals.rootParentIndex===void 0&&h==="auto"&&(g.internals.rootParentIndex=++o.i,g.internals.z=g.internals.z+o.i*yM),o&&g.internals.rootParentIndex!==void 0&&(o.i=g.internals.rootParentIndex);const m=s&&!xm(h)?dw:0,{x,y:b,z:w}=SM(e,g,u,f,m,h),{positionAbsolute:E}=e.internals,N=x!==E.x||b!==E.y;(N||w!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:N?{x,y:b}:E,z:w}})}function hw(e,n,i){const a=$n(e.zIndex)?e.zIndex:0;return xm(i)?a:a+(e.selected?n:0)}function SM(e,n,i,a,o,s){const{x:u,y:f}=n.internals.positionAbsolute,h=Bi(e),d=fs(e,i),g=hl(e.extent)?ta(d,e.extent,h):d;let m=ta({x:u+g.x,y:f+g.y},a,h);e.extent==="parent"&&(m=Wv(m,h,n));const x=hw(e,o,s),b=n.internals.z??0;return{x:m.x,y:m.y,z:b>=x?b+1:x}}function vm(e,n,i,a=[0,0]){const o=[],s=new Map;for(const u of e){const f=n.get(u.parentId);if(!f)continue;const h=s.get(u.parentId)?.expandedRect??dl(f),d=tw(h,u.rect);s.set(u.parentId,{expandedRect:d,parent:f})}return s.size>0&&s.forEach(({expandedRect:u,parent:f},h)=>{const d=f.internals.positionAbsolute,g=Bi(f),m=f.origin??a,x=u.x<d.x?Math.round(Math.abs(d.x-u.x)):0,b=u.y<d.y?Math.round(Math.abs(d.y-u.y)):0,w=Math.max(g.width,Math.round(u.width)),E=Math.max(g.height,Math.round(u.height)),N=(w-g.width)*m[0],_=(E-g.height)*m[1];(x>0||b>0||N||_)&&(o.push({id:h,type:"position",position:{x:f.position.x-x+N,y:f.position.y-b+_}}),i.get(h)?.forEach(D=>{e.some(k=>k.id===D.id)||o.push({id:D.id,type:"position",position:{x:D.position.x+x,y:D.position.y+b}})})),(g.width<u.width||g.height<u.height||x||b)&&o.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:w+(x?m[0]*x-N:0),height:E+(b?m[1]*b-_:0)}})}),o}function _M(e,n,i,a,o,s,u){const f=a?.querySelector(".xyflow__viewport");let h=!1;if(!f)return{changes:[],updatedInternals:h};const d=[],g=window.getComputedStyle(f),{m22:m}=new window.DOMMatrixReadOnly(g.transform),x=[];for(const b of e.values()){const w=n.get(b.id);if(!w)continue;if(w.hidden){n.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),h=!0;continue}const E=mm(b.nodeElement),N=w.measured.width!==E.width||w.measured.height!==E.height;if(!!(E.width&&E.height&&(N||!w.internals.handleBounds||b.force))){const D=b.nodeElement.getBoundingClientRect(),k=hl(w.extent)?w.extent:s;let{positionAbsolute:C}=w.internals;w.parentId&&w.extent==="parent"?C=Wv(C,E,n.get(w.parentId)):k&&(C=ta(C,k,E));const L={...w,measured:E,internals:{...w.internals,positionAbsolute:C,handleBounds:{source:db("source",b.nodeElement,D,m,w.id),target:db("target",b.nodeElement,D,m,w.id)}}};n.set(w.id,L),w.parentId&&bm(L,n,i,{nodeOrigin:o,zIndexMode:u}),h=!0,N&&(d.push({id:w.id,type:"dimensions",dimensions:E}),w.expandParent&&w.parentId&&x.push({id:w.id,parentId:w.parentId,rect:dl(L,o)}))}}if(x.length>0){const b=vm(x,n,i,o);d.push(...b)}return{changes:d,updatedInternals:h}}async function kM({delta:e,panZoom:n,transform:i,translateExtent:a,width:o,height:s}){if(!n||!e.x&&!e.y)return Promise.resolve(!1);const u=await n.setViewportConstrained({x:i[0]+e.x,y:i[1]+e.y,zoom:i[2]},[[0,0],[o,s]],a),f=!!u&&(u.x!==i[0]||u.y!==i[1]||u.k!==i[2]);return Promise.resolve(f)}function bb(e,n,i,a,o,s){let u=o;const f=a.get(u)||new Map;a.set(u,f.set(i,n)),u=`${o}-${e}`;const h=a.get(u)||new Map;if(a.set(u,h.set(i,n)),s){u=`${o}-${e}-${s}`;const d=a.get(u)||new Map;a.set(u,d.set(i,n))}}function pw(e,n,i){e.clear(),n.clear();for(const a of i){const{source:o,target:s,sourceHandle:u=null,targetHandle:f=null}=a,h={edgeId:a.id,source:o,target:s,sourceHandle:u,targetHandle:f},d=`${o}-${u}--${s}-${f}`,g=`${s}-${f}--${o}-${u}`;bb("source",h,g,e,o,u),bb("target",h,d,e,s,f),n.set(a.id,a)}}function mw(e,n){if(!e.parentId)return!1;const i=n.get(e.parentId);return i?i.selected?!0:mw(i,n):!1}function vb(e,n,i){let a=e;do{if(a?.matches?.(n))return!0;if(a===i)return!1;a=a?.parentElement}while(a);return!1}function EM(e,n,i,a){const o=new Map;for(const[s,u]of e)if((u.selected||u.id===a)&&(!u.parentId||!mw(u,e))&&(u.draggable||n&&typeof u.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 Ph({nodeId:e,dragItems:n,nodeLookup:i,dragging:a=!0}){const o=[];for(const[u,f]of n){const h=i.get(u)?.internals.userNode;h&&o.push({...h,position:f.position,dragging:a})}if(!e)return[o[0],o];const s=i.get(e)?.internals.userNode;return[s?{...s,position:n.get(e)?.position||s.position,dragging:a}:o[0],o]}function NM({dragItems:e,snapGrid:n,x:i,y:a}){const o=e.values().next().value;if(!o)return null;const s={x:i-o.distance.x,y:a-o.distance.y},u=hs(s,n);return{x:u.x-s.x,y:u.y-s.y}}function CM({onNodeMouseDown:e,getStoreItems:n,onDragStart:i,onDrag:a,onDragStop:o}){let s={x:null,y:null},u=0,f=new Map,h=!1,d={x:0,y:0},g=null,m=!1,x=null,b=!1,w=!1,E=null;function N({noDragClassName:D,handleSelector:k,domNode:C,isSelectable:L,nodeId:A,nodeClickDistance:H=0}){x=vn(C);function F({x:P,y:te}){const{nodeLookup:O,nodeExtent:B,snapGrid:j,snapToGrid:U,nodeOrigin:Y,onNodeDrag:K,onSelectionDrag:z,onError:R,updateNodePositions:$}=n();s={x:P,y:te};let T=!1;const ie=f.size>1,ce=ie&&B?Dp(ds(f)):null,fe=ie&&U?NM({dragItems:f,snapGrid:j,x:P,y:te}):null;for(const[he,ue]of f){if(!O.has(he))continue;let me={x:P-ue.distance.x,y:te-ue.distance.y};U&&(me=fe?{x:Math.round(me.x+fe.x),y:Math.round(me.y+fe.y)}:hs(me,j));let Ee=null;if(ie&&B&&!ue.extent&&ce){const{positionAbsolute:Ne}=ue.internals,Re=Ne.x-ce.x+B[0][0],Ze=Ne.x+ue.measured.width-ce.x2+B[1][0],Xe=Ne.y-ce.y+B[0][1],ht=Ne.y+ue.measured.height-ce.y2+B[1][1];Ee=[[Re,Xe],[Ze,ht]]}const{position:Ce,positionAbsolute:we}=Jv({nodeId:he,nextPosition:me,nodeLookup:O,nodeExtent:Ee||B,nodeOrigin:Y,onError:R});T=T||ue.position.x!==Ce.x||ue.position.y!==Ce.y,ue.position=Ce,ue.internals.positionAbsolute=we}if(w=w||T,!!T&&($(f,!0),E&&(a||K||!A&&z))){const[he,ue]=Ph({nodeId:A,dragItems:f,nodeLookup:O});a?.(E,f,he,ue),K?.(E,he,ue),A||z?.(E,ue)}}async function G(){if(!g)return;const{transform:P,panBy:te,autoPanSpeed:O,autoPanOnNodeDrag:B}=n();if(!B){h=!1,cancelAnimationFrame(u);return}const[j,U]=ew(d,g,O);(j!==0||U!==0)&&(s.x=(s.x??0)-j/P[2],s.y=(s.y??0)-U/P[2],await te({x:j,y:U})&&F(s)),u=requestAnimationFrame(G)}function q(P){const{nodeLookup:te,multiSelectionActive:O,nodesDraggable:B,transform:j,snapGrid:U,snapToGrid:Y,selectNodesOnDrag:K,onNodeDragStart:z,onSelectionDragStart:R,unselectNodesAndEdges:$}=n();m=!0,(!K||!L)&&!O&&A&&(te.get(A)?.selected||$()),L&&K&&A&&e?.(A);const T=Yo(P.sourceEvent,{transform:j,snapGrid:U,snapToGrid:Y,containerBounds:g});if(s=T,f=EM(te,B,T,A),f.size>0&&(i||z||!A&&R)){const[ie,ce]=Ph({nodeId:A,dragItems:f,nodeLookup:te});i?.(P.sourceEvent,f,ie,ce),z?.(P.sourceEvent,ie,ce),A||R?.(P.sourceEvent,ce)}}const V=zv().clickDistance(H).on("start",P=>{const{domNode:te,nodeDragThreshold:O,transform:B,snapGrid:j,snapToGrid:U}=n();g=te?.getBoundingClientRect()||null,b=!1,w=!1,E=P.sourceEvent,O===0&&q(P),s=Yo(P.sourceEvent,{transform:B,snapGrid:j,snapToGrid:U,containerBounds:g}),d=Vn(P.sourceEvent,g)}).on("drag",P=>{const{autoPanOnNodeDrag:te,transform:O,snapGrid:B,snapToGrid:j,nodeDragThreshold:U,nodeLookup:Y}=n(),K=Yo(P.sourceEvent,{transform:O,snapGrid:B,snapToGrid:j,containerBounds:g});if(E=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||A&&!Y.has(A))&&(b=!0),!b){if(!h&&te&&m&&(h=!0,G()),!m){const z=Vn(P.sourceEvent,g),R=z.x-d.x,$=z.y-d.y;Math.sqrt(R*R+$*$)>U&&q(P)}(s.x!==K.xSnapped||s.y!==K.ySnapped)&&f&&m&&(d=Vn(P.sourceEvent,g),F(K))}}).on("end",P=>{if(!(!m||b)&&(h=!1,m=!1,cancelAnimationFrame(u),f.size>0)){const{nodeLookup:te,updateNodePositions:O,onNodeDragStop:B,onSelectionDragStop:j}=n();if(w&&(O(f,!1),w=!1),o||B||!A&&j){const[U,Y]=Ph({nodeId:A,dragItems:f,nodeLookup:te,dragging:!1});o?.(P.sourceEvent,f,U,Y),B?.(P.sourceEvent,U,Y),A||j?.(P.sourceEvent,Y)}}}).filter(P=>{const te=P.target;return!P.button&&(!D||!vb(te,`.${D}`,C))&&(!k||vb(te,k,C))});x.call(V)}function _(){x?.on(".drag",null)}return{update:N,destroy:_}}function MM(e,n,i){const a=[],o={x:e.x-i,y:e.y-i,width:i*2,height:i*2};for(const s of n.values())ts(o,dl(s))>0&&a.push(s);return a}const TM=250;function AM(e,n,i,a){let o=[],s=1/0;const u=MM(e,i,n+TM);for(const f of u){const h=[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]];for(const d of h){if(a.nodeId===d.nodeId&&a.type===d.type&&a.id===d.id)continue;const{x:g,y:m}=na(f,d,d.position,!0),x=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(m-e.y,2));x>n||(x<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=a.type==="source"?"target":"source";return o.find(h=>h.type===f)??o[0]}return o[0]}function gw(e,n,i,a,o,s=!1){const u=a.get(e);if(!u)return null;const f=o==="strict"?u.internals.handleBounds?.[n]:[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]],h=(i?f?.find(d=>d.id===i):f?.[0])??null;return h&&s?{...h,...na(u,h,h.position,!0)}:h}function yw(e,n){return e||(n?.classList.contains("target")?"target":n?.classList.contains("source")?"source":null)}function zM(e,n){let i=null;return n?i=!0:e&&!n&&(i=!1),i}const xw=()=>!0;function jM(e,{connectionMode:n,connectionRadius:i,handleId:a,nodeId:o,edgeUpdaterType:s,isTarget:u,domNode:f,nodeLookup:h,lib:d,autoPanOnConnect:g,flowId:m,panBy:x,cancelConnection:b,onConnectStart:w,onConnect:E,onConnectEnd:N,isValidConnection:_=xw,onReconnectEnd:D,updateConnection:k,getTransform:C,getFromHandle:L,autoPanSpeed:A,dragThreshold:H=1,handleDomNode:F}){const G=rw(e.target);let q=0,V;const{x:P,y:te}=Vn(e),O=yw(s,F),B=f?.getBoundingClientRect();let j=!1;if(!B||!O)return;const U=gw(o,O,a,h,n);if(!U)return;let Y=Vn(e,B),K=!1,z=null,R=!1,$=null;function T(){if(!g||!B)return;const[Ce,we]=ew(Y,B,A);x({x:Ce,y:we}),q=requestAnimationFrame(T)}const ie={...U,nodeId:o,type:O,position:U.position},ce=h.get(o);let he={inProgress:!0,isValid:null,from:na(ce,ie,be.Left,!0),fromHandle:ie,fromPosition:ie.position,fromNode:ce,to:Y,toHandle:null,toPosition:sb[ie.position],toNode:null,pointer:Y};function ue(){j=!0,k(he),w?.(e,{nodeId:o,handleId:a,handleType:O})}H===0&&ue();function me(Ce){if(!j){const{x:ht,y:on}=Vn(Ce),Lt=ht-P,Gt=on-te;if(!(Lt*Lt+Gt*Gt>H*H))return;ue()}if(!L()||!ie){Ee(Ce);return}const we=C();Y=Vn(Ce,B),V=AM(ps(Y,we,!1,[1,1]),i,h,ie),K||(T(),K=!0);const Ne=bw(Ce,{handle:V,connectionMode:n,fromNodeId:o,fromHandleId:a,fromType:u?"target":"source",isValidConnection:_,doc:G,lib:d,flowId:m,nodeLookup:h});$=Ne.handleDomNode,z=Ne.connection,R=zM(!!V,Ne.isValid);const Re=h.get(o),Ze=Re?na(Re,ie,be.Left,!0):he.from,Xe={...he,from:Ze,isValid:R,to:Ne.toHandle&&R?Uc({x:Ne.toHandle.x,y:Ne.toHandle.y},we):Y,toHandle:Ne.toHandle,toPosition:R&&Ne.toHandle?Ne.toHandle.position:sb[ie.position],toNode:Ne.toHandle?h.get(Ne.toHandle.nodeId):null,pointer:Y};k(Xe),he=Xe}function Ee(Ce){if(!("touches"in Ce&&Ce.touches.length>0)){if(j){(V||$)&&z&&R&&E?.(z);const{inProgress:we,...Ne}=he,Re={...Ne,toPosition:he.toHandle?he.toPosition:null};N?.(Ce,Re),s&&D?.(Ce,Re)}b(),cancelAnimationFrame(q),K=!1,R=!1,z=null,$=null,G.removeEventListener("mousemove",me),G.removeEventListener("mouseup",Ee),G.removeEventListener("touchmove",me),G.removeEventListener("touchend",Ee)}}G.addEventListener("mousemove",me),G.addEventListener("mouseup",Ee),G.addEventListener("touchmove",me),G.addEventListener("touchend",Ee)}function bw(e,{handle:n,connectionMode:i,fromNodeId:a,fromHandleId:o,fromType:s,doc:u,lib:f,flowId:h,isValidConnection:d=xw,nodeLookup:g}){const m=s==="target",x=n?u.querySelector(`.${f}-flow__handle[data-id="${h}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x:b,y:w}=Vn(e),E=u.elementFromPoint(b,w),N=E?.classList.contains(`${f}-flow__handle`)?E:x,_={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const D=yw(void 0,N),k=N.getAttribute("data-nodeid"),C=N.getAttribute("data-handleid"),L=N.classList.contains("connectable"),A=N.classList.contains("connectableend");if(!k||!D)return _;const H={source:m?k:a,sourceHandle:m?C:o,target:m?a:k,targetHandle:m?o:C};_.connection=H;const G=L&&A&&(i===cl.Strict?m&&D==="source"||!m&&D==="target":k!==a||C!==o);_.isValid=G&&d(H),_.toHandle=gw(k,D,C,g,i,!0)}return _}const Hp={onPointerDown:jM,isValid:bw};function DM({domNode:e,panZoom:n,getTransform:i,getViewScale:a}){const o=vn(e);function s({translateExtent:f,width:h,height:d,zoomStep:g=1,pannable:m=!0,zoomable:x=!0,inversePan:b=!1}){const w=k=>{if(k.sourceEvent.type!=="wheel"||!n)return;const C=i(),L=k.sourceEvent.ctrlKey&&ns()?10:1,A=-k.sourceEvent.deltaY*(k.sourceEvent.deltaMode===1?.05:k.sourceEvent.deltaMode?1:.002)*g,H=C[2]*Math.pow(2,A*L);n.scaleTo(H)};let E=[0,0];const N=k=>{(k.sourceEvent.type==="mousedown"||k.sourceEvent.type==="touchstart")&&(E=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY])},_=k=>{const C=i();if(k.sourceEvent.type!=="mousemove"&&k.sourceEvent.type!=="touchmove"||!n)return;const L=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY],A=[L[0]-E[0],L[1]-E[1]];E=L;const H=a()*Math.max(C[2],Math.log(C[2]))*(b?-1:1),F={x:C[0]-A[0]*H,y:C[1]-A[1]*H},G=[[0,0],[h,d]];n.setViewportConstrained({x:F.x,y:F.y,zoom:C[2]},G,f)},D=Xv().on("start",N).on("zoom",m?_:null).on("zoom.wheel",x?w:null);o.call(D,{})}function u(){o.on("zoom",null)}return{update:s,destroy:u,pointer:In}}const nf=e=>({x:e.x,y:e.y,zoom:e.k}),Yh=({x:e,y:n,zoom:i})=>Wc.translate(e,n).scale(i),el=(e,n)=>e.target.closest(`.${n}`),vw=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),RM=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Xh=(e,n=0,i=RM,a=()=>{})=>{const o=typeof n=="number"&&n>0;return o||a(),o?e.transition().duration(n).ease(i).on("end",a):e},ww=e=>{const n=e.ctrlKey&&ns()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function OM({zoomPanValues:e,noWheelClassName:n,d3Selection:i,d3Zoom:a,panOnScrollMode:o,panOnScrollSpeed:s,zoomOnPinch:u,onPanZoomStart:f,onPanZoom:h,onPanZoomEnd:d}){return g=>{if(el(g,n))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const m=i.property("__zoom").k||1;if(g.ctrlKey&&u){const N=In(g),_=ww(g),D=m*Math.pow(2,_);a.scaleTo(i,D,N,g);return}const x=g.deltaMode===1?20:1;let b=o===Jr.Vertical?0:g.deltaX*x,w=o===Jr.Horizontal?0:g.deltaY*x;!ns()&&g.shiftKey&&o!==Jr.Vertical&&(b=g.deltaY*x,w=0),a.translateBy(i,-(b/m)*s,-(w/m)*s,{internal:!0});const E=nf(i.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h?.(g,E),e.panScrollTimeout=setTimeout(()=>{d?.(g,E),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,f?.(g,E))}}function LM({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:i}){return function(a,o){const s=a.type==="wheel",u=!n&&s&&!a.ctrlKey,f=el(a,e);if(a.ctrlKey&&s&&f&&a.preventDefault(),u||f)return null;a.preventDefault(),i.call(this,a,o)}}function HM({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:i}){return a=>{if(a.sourceEvent?.internal)return;const o=nf(a.transform);e.mouseButton=a.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,a.sourceEvent?.type==="mousedown"&&n(!0),i&&i?.(a.sourceEvent,o)}}function BM({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:i,onTransformChange:a,onPanZoom:o}){return s=>{e.usedRightMouseButton=!!(i&&vw(n,e.mouseButton??0)),s.sourceEvent?.sync||a([s.transform.x,s.transform.y,s.transform.k]),o&&!s.sourceEvent?.internal&&o?.(s.sourceEvent,nf(s.transform))}}function UM({zoomPanValues:e,panOnDrag:n,panOnScroll:i,onDraggingChange:a,onPanZoomEnd:o,onPaneContextMenu:s}){return u=>{if(!u.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,s&&vw(n,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&s(u.sourceEvent),e.usedRightMouseButton=!1,a(!1),o)){const f=nf(u.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(u.sourceEvent,f)},i?150:0)}}}function IM({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:i,panOnDrag:a,panOnScroll:o,zoomOnDoubleClick:s,userSelectionActive:u,noWheelClassName:f,noPanClassName:h,lib:d,connectionInProgress:g}){return m=>{const x=e||n,b=i&&m.ctrlKey,w=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(el(m,`${d}-flow__node`)||el(m,`${d}-flow__edge`)))return!0;if(!a&&!x&&!o&&!s&&!i||u||g&&!w||el(m,f)&&w||el(m,h)&&(!w||o&&w&&!e)||!i&&m.ctrlKey&&w)return!1;if(!i&&m.type==="touchstart"&&m.touches?.length>1)return m.preventDefault(),!1;if(!x&&!o&&!b&&w||!a&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(a)&&!a.includes(m.button)&&m.type==="mousedown")return!1;const E=Array.isArray(a)&&a.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||w)&&E}}function qM({domNode:e,minZoom:n,maxZoom:i,translateExtent:a,viewport:o,onPanZoom:s,onPanZoomStart:u,onPanZoomEnd:f,onDraggingChange:h}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),m=Xv().scaleExtent([n,i]).translateExtent(a),x=vn(e).call(m);D({x:o.x,y:o.y,zoom:fl(o.zoom,n,i)},[[0,0],[g.width,g.height]],a);const b=x.on("wheel.zoom"),w=x.on("dblclick.zoom");m.wheelDelta(ww);function E(V,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?Po:_c).transform(Xh(x,P?.duration,P?.ease,()=>te(!0)),V)}):Promise.resolve(!1)}function N({noWheelClassName:V,noPanClassName:P,onPaneContextMenu:te,userSelectionActive:O,panOnScroll:B,panOnDrag:j,panOnScrollMode:U,panOnScrollSpeed:Y,preventScrolling:K,zoomOnPinch:z,zoomOnScroll:R,zoomOnDoubleClick:$,zoomActivationKeyPressed:T,lib:ie,onTransformChange:ce,connectionInProgress:fe,paneClickDistance:he,selectionOnDrag:ue}){O&&!d.isZoomingOrPanning&&_();const me=B&&!T&&!O;m.clickDistance(ue?1/0:!$n(he)||he<0?0:he);const Ee=me?OM({zoomPanValues:d,noWheelClassName:V,d3Selection:x,d3Zoom:m,panOnScrollMode:U,panOnScrollSpeed:Y,zoomOnPinch:z,onPanZoomStart:u,onPanZoom:s,onPanZoomEnd:f}):LM({noWheelClassName:V,preventScrolling:K,d3ZoomHandler:b});if(x.on("wheel.zoom",Ee,{passive:!1}),!O){const we=HM({zoomPanValues:d,onDraggingChange:h,onPanZoomStart:u});m.on("start",we);const Ne=BM({zoomPanValues:d,panOnDrag:j,onPaneContextMenu:!!te,onPanZoom:s,onTransformChange:ce});m.on("zoom",Ne);const Re=UM({zoomPanValues:d,panOnDrag:j,panOnScroll:B,onPaneContextMenu:te,onPanZoomEnd:f,onDraggingChange:h});m.on("end",Re)}const Ce=IM({zoomActivationKeyPressed:T,panOnDrag:j,zoomOnScroll:R,panOnScroll:B,zoomOnDoubleClick:$,zoomOnPinch:z,userSelectionActive:O,noPanClassName:P,noWheelClassName:V,lib:ie,connectionInProgress:fe});m.filter(Ce),$?x.on("dblclick.zoom",w):x.on("dblclick.zoom",null)}function _(){m.on("zoom",null)}async function D(V,P,te){const O=Yh(V),B=m?.constrain()(O,P,te);return B&&await E(B),new Promise(j=>j(B))}async function k(V,P){const te=Yh(V);return await E(te,P),new Promise(O=>O(te))}function C(V){if(x){const P=Yh(V),te=x.property("__zoom");(te.k!==V.zoom||te.x!==V.x||te.y!==V.y)&&m?.transform(x,P,null,{sync:!0})}}function L(){const V=x?Yv(x.node()):{x:0,y:0,k:1};return{x:V.x,y:V.y,zoom:V.k}}function A(V,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?Po:_c).scaleTo(Xh(x,P?.duration,P?.ease,()=>te(!0)),V)}):Promise.resolve(!1)}function H(V,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?Po:_c).scaleBy(Xh(x,P?.duration,P?.ease,()=>te(!0)),V)}):Promise.resolve(!1)}function F(V){m?.scaleExtent(V)}function G(V){m?.translateExtent(V)}function q(V){const P=!$n(V)||V<0?0:V;m?.clickDistance(P)}return{update:N,destroy:_,setViewport:k,setViewportConstrained:D,getViewport:L,scaleTo:A,scaleBy:H,setScaleExtent:F,setTranslateExtent:G,syncViewport:C,setClickDistance:q}}var pl;(function(e){e.Line="line",e.Handle="handle"})(pl||(pl={}));function $M({width:e,prevWidth:n,height:i,prevHeight:a,affectsX:o,affectsY:s}){const u=e-n,f=i-a,h=[u>0?1:u<0?-1:0,f>0?1:f<0?-1:0];return u&&o&&(h[0]=h[0]*-1),f&&s&&(h[1]=h[1]*-1),h}function wb(e){const n=e.includes("right")||e.includes("left"),i=e.includes("bottom")||e.includes("top"),a=e.includes("left"),o=e.includes("top");return{isHorizontal:n,isVertical:i,affectsX:a,affectsY:o}}function mr(e,n){return Math.max(0,n-e)}function gr(e,n){return Math.max(0,e-n)}function Ju(e,n,i){return Math.max(0,n-e,e-i)}function Sb(e,n){return e?!n:n}function VM(e,n,i,a,o,s,u,f){let{affectsX:h,affectsY:d}=n;const{isHorizontal:g,isVertical:m}=n,x=g&&m,{xSnapped:b,ySnapped:w}=i,{minWidth:E,maxWidth:N,minHeight:_,maxHeight:D}=a,{x:k,y:C,width:L,height:A,aspectRatio:H}=e;let F=Math.floor(g?b-e.pointerX:0),G=Math.floor(m?w-e.pointerY:0);const q=L+(h?-F:F),V=A+(d?-G:G),P=-s[0]*L,te=-s[1]*A;let O=Ju(q,E,N),B=Ju(V,_,D);if(u){let Y=0,K=0;h&&F<0?Y=mr(k+F+P,u[0][0]):!h&&F>0&&(Y=gr(k+q+P,u[1][0])),d&&G<0?K=mr(C+G+te,u[0][1]):!d&&G>0&&(K=gr(C+V+te,u[1][1])),O=Math.max(O,Y),B=Math.max(B,K)}if(f){let Y=0,K=0;h&&F>0?Y=gr(k+F,f[0][0]):!h&&F<0&&(Y=mr(k+q,f[1][0])),d&&G>0?K=gr(C+G,f[0][1]):!d&&G<0&&(K=mr(C+V,f[1][1])),O=Math.max(O,Y),B=Math.max(B,K)}if(o){if(g){const Y=Ju(q/H,_,D)*H;if(O=Math.max(O,Y),u){let K=0;!h&&!d||h&&!d&&x?K=gr(C+te+q/H,u[1][1])*H:K=mr(C+te+(h?F:-F)/H,u[0][1])*H,O=Math.max(O,K)}if(f){let K=0;!h&&!d||h&&!d&&x?K=mr(C+q/H,f[1][1])*H:K=gr(C+(h?F:-F)/H,f[0][1])*H,O=Math.max(O,K)}}if(m){const Y=Ju(V*H,E,N)/H;if(B=Math.max(B,Y),u){let K=0;!h&&!d||d&&!h&&x?K=gr(k+V*H+P,u[1][0])/H:K=mr(k+(d?G:-G)*H+P,u[0][0])/H,B=Math.max(B,K)}if(f){let K=0;!h&&!d||d&&!h&&x?K=mr(k+V*H,f[1][0])/H:K=gr(k+(d?G:-G)*H,f[0][0])/H,B=Math.max(B,K)}}}G=G+(G<0?B:-B),F=F+(F<0?O:-O),o&&(x?q>V*H?G=(Sb(h,d)?-F:F)/H:F=(Sb(h,d)?-G:G)*H:g?(G=F/H,d=h):(F=G*H,h=d));const j=h?k+F:k,U=d?C+G:C;return{width:L+(h?-F:F),height:A+(d?-G:G),x:s[0]*F*(h?-1:1)+j,y:s[1]*G*(d?-1:1)+U}}const Sw={width:0,height:0,x:0,y:0},PM={...Sw,pointerX:0,pointerY:0,aspectRatio:1};function YM(e){return[[0,0],[e.measured.width,e.measured.height]]}function XM(e,n,i){const a=n.position.x+e.position.x,o=n.position.y+e.position.y,s=e.measured.width??0,u=e.measured.height??0,f=i[0]*s,h=i[1]*u;return[[a-f,o-h],[a+s-f,o+u-h]]}function FM({domNode:e,nodeId:n,getStoreItems:i,onChange:a,onEnd:o}){const s=vn(e);let u={controlDirection:wb("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function f({controlPosition:d,boundaries:g,keepAspectRatio:m,resizeDirection:x,onResizeStart:b,onResize:w,onResizeEnd:E,shouldResize:N}){let _={...Sw},D={...PM};u={boundaries:g,resizeDirection:x,keepAspectRatio:m,controlDirection:wb(d)};let k,C=null,L=[],A,H,F,G=!1;const q=zv().on("start",V=>{const{nodeLookup:P,transform:te,snapGrid:O,snapToGrid:B,nodeOrigin:j,paneDomNode:U}=i();if(k=P.get(n),!k)return;C=U?.getBoundingClientRect()??null;const{xSnapped:Y,ySnapped:K}=Yo(V.sourceEvent,{transform:te,snapGrid:O,snapToGrid:B,containerBounds:C});_={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},D={..._,pointerX:Y,pointerY:K,aspectRatio:_.width/_.height},A=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(A=P.get(k.parentId),H=A&&k.extent==="parent"?YM(A):void 0),L=[],F=void 0;for(const[z,R]of P)if(R.parentId===n&&(L.push({id:z,position:{...R.position},extent:R.extent}),R.extent==="parent"||R.expandParent)){const $=XM(R,k,R.origin??j);F?F=[[Math.min($[0][0],F[0][0]),Math.min($[0][1],F[0][1])],[Math.max($[1][0],F[1][0]),Math.max($[1][1],F[1][1])]]:F=$}b?.(V,{..._})}).on("drag",V=>{const{transform:P,snapGrid:te,snapToGrid:O,nodeOrigin:B}=i(),j=Yo(V.sourceEvent,{transform:P,snapGrid:te,snapToGrid:O,containerBounds:C}),U=[];if(!k)return;const{x:Y,y:K,width:z,height:R}=_,$={},T=k.origin??B,{width:ie,height:ce,x:fe,y:he}=VM(D,u.controlDirection,j,u.boundaries,u.keepAspectRatio,T,H,F),ue=ie!==z,me=ce!==R,Ee=fe!==Y&&ue,Ce=he!==K&&me;if(!Ee&&!Ce&&!ue&&!me)return;if((Ee||Ce||T[0]===1||T[1]===1)&&($.x=Ee?fe:_.x,$.y=Ce?he:_.y,_.x=$.x,_.y=$.y,L.length>0)){const Ze=fe-Y,Xe=he-K;for(const ht of L)ht.position={x:ht.position.x-Ze+T[0]*(ie-z),y:ht.position.y-Xe+T[1]*(ce-R)},U.push(ht)}if((ue||me)&&($.width=ue&&(!u.resizeDirection||u.resizeDirection==="horizontal")?ie:_.width,$.height=me&&(!u.resizeDirection||u.resizeDirection==="vertical")?ce:_.height,_.width=$.width,_.height=$.height),A&&k.expandParent){const Ze=T[0]*($.width??0);$.x&&$.x<Ze&&(_.x=Ze,D.x=D.x-($.x-Ze));const Xe=T[1]*($.height??0);$.y&&$.y<Xe&&(_.y=Xe,D.y=D.y-($.y-Xe))}const we=$M({width:_.width,prevWidth:z,height:_.height,prevHeight:R,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),Ne={..._,direction:we};N?.(V,Ne)!==!1&&(G=!0,w?.(V,Ne),a($,U))}).on("end",V=>{G&&(E?.(V,{..._}),o?.({..._}),G=!1)});s.call(q)}function h(){s.on(".drag",null)}return{update:f,destroy:h}}var Fh={exports:{}},Gh={},Zh={exports:{}},Qh={};var _b;function GM(){if(_b)return Qh;_b=1;var e=ss();function n(m,x){return m===x&&(m!==0||1/m===1/x)||m!==m&&x!==x}var i=typeof Object.is=="function"?Object.is:n,a=e.useState,o=e.useEffect,s=e.useLayoutEffect,u=e.useDebugValue;function f(m,x){var b=x(),w=a({inst:{value:b,getSnapshot:x}}),E=w[0].inst,N=w[1];return s(function(){E.value=b,E.getSnapshot=x,h(E)&&N({inst:E})},[m,b,x]),o(function(){return h(E)&&N({inst:E}),m(function(){h(E)&&N({inst:E})})},[m]),u(b),b}function h(m){var x=m.getSnapshot;m=m.value;try{var b=x();return!i(m,b)}catch{return!0}}function d(m,x){return x()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:f;return Qh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Qh}var kb;function ZM(){return kb||(kb=1,Zh.exports=GM()),Zh.exports}var Eb;function QM(){if(Eb)return Gh;Eb=1;var e=ss(),n=ZM();function i(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}var a=typeof Object.is=="function"?Object.is:i,o=n.useSyncExternalStore,s=e.useRef,u=e.useEffect,f=e.useMemo,h=e.useDebugValue;return Gh.useSyncExternalStoreWithSelector=function(d,g,m,x,b){var w=s(null);if(w.current===null){var E={hasValue:!1,value:null};w.current=E}else E=w.current;w=f(function(){function _(A){if(!D){if(D=!0,k=A,A=x(A),b!==void 0&&E.hasValue){var H=E.value;if(b(H,A))return C=H}return C=A}if(H=C,a(k,A))return H;var F=x(A);return b!==void 0&&b(H,F)?(k=A,H):(k=A,C=F)}var D=!1,k,C,L=m===void 0?null:m;return[function(){return _(g())},L===null?void 0:function(){return _(L())}]},[g,m,x,b]);var N=o(d,w[0],w[1]);return u(function(){E.hasValue=!0,E.value=N},[N]),h(N),N},Gh}var Nb;function KM(){return Nb||(Nb=1,Fh.exports=QM()),Fh.exports}var JM=KM();const WM=Gc(JM),eT={},Cb=e=>{let n;const i=new Set,a=(g,m)=>{const x=typeof g=="function"?g(n):g;if(!Object.is(x,n)){const b=n;n=m??(typeof x!="object"||x===null)?x:Object.assign({},n,x),i.forEach(w=>w(n,b))}},o=()=>n,h={setState:a,getState:o,getInitialState:()=>d,subscribe:g=>(i.add(g),()=>i.delete(g)),destroy:()=>{(eT?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),i.clear()}},d=n=e(a,o,h);return h},tT=e=>e?Cb(e):Cb,{useDebugValue:nT}=Uo,{useSyncExternalStoreWithSelector:iT}=WM,rT=e=>e;function _w(e,n=rT,i){const a=iT(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,i);return nT(a),a}const Mb=(e,n)=>{const i=tT(e),a=(o,s=n)=>_w(i,o,s);return Object.assign(a,i),a},aT=(e,n)=>e?Mb(e,n):Mb;function ut(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[a,o]of e)if(!Object.is(o,n.get(a)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const a of e)if(!n.has(a))return!1;return!0}const i=Object.keys(e);if(i.length!==Object.keys(n).length)return!1;for(const a of i)if(!Object.prototype.hasOwnProperty.call(n,a)||!Object.is(e[a],n[a]))return!1;return!0}gv();const rf=Q.createContext(null),lT=rf.Provider,kw=ri.error001();function Ye(e,n){const i=Q.useContext(rf);if(i===null)throw new Error(kw);return _w(i,e,n)}function ct(){const e=Q.useContext(rf);if(e===null)throw new Error(kw);return Q.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Tb={display:"none"},oT={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Ew="react-flow__node-desc",Nw="react-flow__edge-desc",sT="react-flow__aria-live",uT=e=>e.ariaLiveMessage,cT=e=>e.ariaLabelConfig;function fT({rfId:e}){const n=Ye(uT);return v.jsx("div",{id:`${sT}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:oT,children:n})}function dT({rfId:e,disableKeyboardA11y:n}){const i=Ye(cT);return v.jsxs(v.Fragment,{children:[v.jsx("div",{id:`${Ew}-${e}`,style:Tb,children:n?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),v.jsx("div",{id:`${Nw}-${e}`,style:Tb,children:i["edge.a11yDescription.default"]}),!n&&v.jsx(fT,{rfId:e})]})}const af=Q.forwardRef(({position:e="top-left",children:n,className:i,style:a,...o},s)=>{const u=`${e}`.split("-");return v.jsx("div",{className:_t(["react-flow__panel",i,...u]),style:a,ref:s,...o,children:n})});af.displayName="Panel";function hT({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:v.jsx(af,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:v.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const pT=e=>{const n=[],i=[];for(const[,a]of e.nodeLookup)a.selected&&n.push(a.internals.userNode);for(const[,a]of e.edgeLookup)a.selected&&i.push(a);return{selectedNodes:n,selectedEdges:i}},Wu=e=>e.id;function mT(e,n){return ut(e.selectedNodes.map(Wu),n.selectedNodes.map(Wu))&&ut(e.selectedEdges.map(Wu),n.selectedEdges.map(Wu))}function gT({onSelectionChange:e}){const n=ct(),{selectedNodes:i,selectedEdges:a}=Ye(pT,mT);return Q.useEffect(()=>{const o={nodes:i,edges:a};e?.(o),n.getState().onSelectionChangeHandlers.forEach(s=>s(o))},[i,a,e]),null}const yT=e=>!!e.onSelectionChangeHandlers;function xT({onSelectionChange:e}){const n=Ye(yT);return e||n?v.jsx(gT,{onSelectionChange:e}):null}const Cw=[0,0],bT={x:0,y:0,zoom:1},vT=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Ab=[...vT,"rfId"],wT=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),zb={translateExtent:Wo,nodeOrigin:Cw,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function ST(e){const{setNodes:n,setEdges:i,setMinZoom:a,setMaxZoom:o,setTranslateExtent:s,setNodeExtent:u,reset:f,setDefaultNodesAndEdges:h}=Ye(wT,ut),d=ct();Q.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{g.current=zb,f()}),[]);const g=Q.useRef(zb);return Q.useEffect(()=>{for(const m of Ab){const x=e[m],b=g.current[m];x!==b&&(typeof e[m]>"u"||(m==="nodes"?n(x):m==="edges"?i(x):m==="minZoom"?a(x):m==="maxZoom"?o(x):m==="translateExtent"?s(x):m==="nodeExtent"?u(x):m==="ariaLabelConfig"?d.setState({ariaLabelConfig:lM(x)}):m==="fitView"?d.setState({fitViewQueued:x}):m==="fitViewOptions"?d.setState({fitViewOptions:x}):d.setState({[m]:x})))}g.current=e},Ab.map(m=>e[m])),null}function jb(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function _T(e){const[n,i]=Q.useState(e==="system"?null:e);return Q.useEffect(()=>{if(e!=="system"){i(e);return}const a=jb(),o=()=>i(a?.matches?"dark":"light");return o(),a?.addEventListener("change",o),()=>{a?.removeEventListener("change",o)}},[e]),n!==null?n:jb()?.matches?"dark":"light"}const Db=typeof document<"u"?document:null;function is(e=null,n={target:Db,actInsideInputWithModifier:!0}){const[i,a]=Q.useState(!1),o=Q.useRef(!1),s=Q.useRef(new Set([])),[u,f]=Q.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
|
|
10
10
|
`).replace(`
|
|
11
11
|
|
|
12
12
|
`,`
|
|
13
13
|
+`).split(`
|
|
14
|
-
`)),g=d.reduce((m,x)=>m.concat(...x),[]);return[d,g]}return[[],[]]},[e]);return Q.useEffect(()=>{const h=n?.target??zb,d=n?.actInsideInputWithModifier??!0;if(e!==null){const g=b=>{if(s.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!s.current||s.current&&!d)&&iw(b))return!1;const E=Db(b.code,f);if(o.current.add(b[E]),jb(u,o.current,!1)){const N=b.composedPath?.()?.[0]||b.target,_=N?.nodeName==="BUTTON"||N?.nodeName==="A";n.preventDefault!==!1&&(s.current||!_)&&b.preventDefault(),a(!0)}},m=b=>{const w=Db(b.code,f);jb(u,o.current,!0)?(a(!1),o.current.clear()):o.current.delete(b[w]),b.key==="Meta"&&o.current.clear(),s.current=!1},x=()=>{o.current.clear(),a(!1)};return h?.addEventListener("keydown",g),h?.addEventListener("keyup",m),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{h?.removeEventListener("keydown",g),h?.removeEventListener("keyup",m),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[e,a]),i}function jb(e,n,i){return e.filter(a=>i||a.length===n.size).some(a=>a.every(s=>n.has(s)))}function Db(e,n){return n.includes(e)?"code":"key"}const kT=()=>{const e=ct();return Q.useMemo(()=>({zoomIn:n=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomOut:n=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1/1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomTo:(n,i)=>{const{panZoom:a}=e.getState();return a?a.scaleTo(n,{duration:i?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(n,i)=>{const{transform:[a,s,o],panZoom:u}=e.getState();return u?(await u.setViewport({x:n.x??a,y:n.y??s,zoom:n.zoom??o},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[n,i,a]=e.getState().transform;return{x:n,y:i,zoom:a}},setCenter:async(n,i,a)=>e.getState().setCenter(n,i,a),fitBounds:async(n,i)=>{const{width:a,height:s,minZoom:o,maxZoom:u,panZoom:f}=e.getState(),h=pm(n,a,s,o,u,i?.padding??.1);return f?(await f.setViewport(h,{duration:i?.duration,ease:i?.ease,interpolate:i?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(n,i={})=>{const{transform:a,snapGrid:s,snapToGrid:o,domNode:u}=e.getState();if(!u)return n;const{x:f,y:h}=u.getBoundingClientRect(),d={x:n.x-f,y:n.y-h},g=i.snapGrid??s,m=i.snapToGrid??o;return fo(d,a,m,g)},flowToScreenPosition:n=>{const{transform:i,domNode:a}=e.getState();if(!a)return n;const{x:s,y:o}=a.getBoundingClientRect(),u=Bc(n,i);return{x:u.x+s,y:u.y+o}}}),[])};function Nw(e,n){const i=[],a=new Map,s=[];for(const o of e)if(o.type==="add"){s.push(o);continue}else if(o.type==="remove"||o.type==="replace")a.set(o.id,[o]);else{const u=a.get(o.id);u?u.push(o):a.set(o.id,[o])}for(const o of n){const u=a.get(o.id);if(!u){i.push(o);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){i.push({...u[0].item});continue}const f={...o};for(const h of u)ET(h,f);i.push(f)}return s.length&&s.forEach(o=>{o.index!==void 0?i.splice(o.index,0,{...o.item}):i.push({...o.item})}),i}function ET(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function Cw(e,n){return Nw(e,n)}function Mw(e,n){return Nw(e,n)}function Gr(e,n){return{id:e,type:"select",selected:n}}function el(e,n=new Set,i=!1){const a=[];for(const[s,o]of e){const u=n.has(s);!(o.selected===void 0&&!u)&&o.selected!==u&&(i&&(o.selected=u),a.push(Gr(o.id,u)))}return a}function Rb({items:e=[],lookup:n}){const i=[],a=new Map(e.map(s=>[s.id,s]));for(const[s,o]of e.entries()){const u=n.get(o.id),f=u?.internals?.userNode??u;f!==void 0&&f!==o&&i.push({id:o.id,item:o,type:"replace"}),f===void 0&&i.push({item:o,type:"add",index:s})}for(const[s]of n)a.get(s)===void 0&&i.push({id:s,type:"remove"});return i}function Ob(e){return{id:e.id,type:"remove"}}const Lb=e=>Q4(e),NT=e=>Zv(e);function Tw(e){return Q.forwardRef(e)}const CT=typeof window<"u"?Q.useLayoutEffect:Q.useEffect;function Hb(e){const[n,i]=Q.useState(BigInt(0)),[a]=Q.useState(()=>MT(()=>i(s=>s+BigInt(1))));return CT(()=>{const s=a.get();s.length&&(e(s),a.reset())},[n]),a}function MT(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:i=>{n.push(i),e()}}}const Aw=Q.createContext(null);function TT({children:e}){const n=ct(),i=Q.useCallback(f=>{const{nodes:h=[],setNodes:d,hasDefaultNodes:g,onNodesChange:m,nodeLookup:x,fitViewQueued:b,onNodesChangeMiddlewareMap:w}=n.getState();let E=h;for(const _ of f)E=typeof _=="function"?_(E):_;let N=Rb({items:E,lookup:x});for(const _ of w.values())N=_(N);g&&d(E),N.length>0?m?.(N):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:_,nodes:D,setNodes:k}=n.getState();_&&k(D)})},[]),a=Hb(i),s=Q.useCallback(f=>{const{edges:h=[],setEdges:d,hasDefaultEdges:g,onEdgesChange:m,edgeLookup:x}=n.getState();let b=h;for(const w of f)b=typeof w=="function"?w(b):w;g?d(b):m&&m(Rb({items:b,lookup:x}))},[]),o=Hb(s),u=Q.useMemo(()=>({nodeQueue:a,edgeQueue:o}),[]);return v.jsx(Aw.Provider,{value:u,children:e})}function AT(){const e=Q.useContext(Aw);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const zT=e=>!!e.panZoom;function wm(){const e=kT(),n=ct(),i=AT(),a=Ye(zT),s=Q.useMemo(()=>{const o=m=>n.getState().nodeLookup.get(m),u=m=>{i.nodeQueue.push(m)},f=m=>{i.edgeQueue.push(m)},h=m=>{const{nodeLookup:x,nodeOrigin:b}=n.getState(),w=Lb(m)?m:x.get(m.id),E=w.parentId?tw(w.position,w.measured,w.parentId,x,b):w.position,N={...w,position:E,width:w.measured?.width??w.width,height:w.measured?.height??w.height};return fl(N)},d=(m,x,b={replace:!1})=>{u(w=>w.map(E=>{if(E.id===m){const N=typeof x=="function"?x(E):x;return b.replace&&Lb(N)?N:{...E,...N}}return E}))},g=(m,x,b={replace:!1})=>{f(w=>w.map(E=>{if(E.id===m){const N=typeof x=="function"?x(E):x;return b.replace&&NT(N)?N:{...E,...N}}return E}))};return{getNodes:()=>n.getState().nodes.map(m=>({...m})),getNode:m=>o(m)?.internals.userNode,getInternalNode:o,getEdges:()=>{const{edges:m=[]}=n.getState();return m.map(x=>({...x}))},getEdge:m=>n.getState().edgeLookup.get(m),setNodes:u,setEdges:f,addNodes:m=>{const x=Array.isArray(m)?m:[m];i.nodeQueue.push(b=>[...b,...x])},addEdges:m=>{const x=Array.isArray(m)?m:[m];i.edgeQueue.push(b=>[...b,...x])},toObject:()=>{const{nodes:m=[],edges:x=[],transform:b}=n.getState(),[w,E,N]=b;return{nodes:m.map(_=>({..._})),edges:x.map(_=>({..._})),viewport:{x:w,y:E,zoom:N}}},deleteElements:async({nodes:m=[],edges:x=[]})=>{const{nodes:b,edges:w,onNodesDelete:E,onEdgesDelete:N,triggerNodeChanges:_,triggerEdgeChanges:D,onDelete:k,onBeforeDelete:C}=n.getState(),{nodes:L,edges:A}=await tM({nodesToRemove:m,edgesToRemove:x,nodes:b,edges:w,onBeforeDelete:C}),H=A.length>0,F=L.length>0;if(H){const G=A.map(Ob);N?.(A),D(G)}if(F){const G=L.map(Ob);E?.(L),_(G)}return(F||H)&&k?.({nodes:L,edges:A}),{deletedNodes:L,deletedEdges:A}},getIntersectingNodes:(m,x=!0,b)=>{const w=ob(m),E=w?m:h(m),N=b!==void 0;return E?(b||n.getState().nodes).filter(_=>{const D=n.getState().nodeLookup.get(_.id);if(D&&!w&&(_.id===m.id||!D.internals.positionAbsolute))return!1;const k=fl(N?_:D),C=Js(k,E);return x&&C>0||C>=k.width*k.height||C>=E.width*E.height}):[]},isNodeIntersecting:(m,x,b=!0)=>{const E=ob(m)?m:h(m);if(!E)return!1;const N=Js(E,x);return b&&N>0||N>=x.width*x.height||N>=E.width*E.height},updateNode:d,updateNodeData:(m,x,b={replace:!1})=>{d(m,w=>{const E=typeof x=="function"?x(w):x;return b.replace?{...w,data:E}:{...w,data:{...w.data,...E}}},b)},updateEdge:g,updateEdgeData:(m,x,b={replace:!1})=>{g(m,w=>{const E=typeof x=="function"?x(w):x;return b.replace?{...w,data:E}:{...w,data:{...w.data,...E}}},b)},getNodesBounds:m=>{const{nodeLookup:x,nodeOrigin:b}=n.getState();return K4(m,{nodeLookup:x,nodeOrigin:b})},getHandleConnections:({type:m,id:x,nodeId:b})=>Array.from(n.getState().connectionLookup.get(`${b}-${m}${x?`-${x}`:""}`)?.values()??[]),getNodeConnections:({type:m,handleId:x,nodeId:b})=>Array.from(n.getState().connectionLookup.get(`${b}${m?x?`-${m}-${x}`:`-${m}`:""}`)?.values()??[]),fitView:async m=>{const x=n.getState().fitViewResolver??aM();return n.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:x}),i.nodeQueue.push(b=>[...b]),x.promise}}},[]);return Q.useMemo(()=>({...s,...e,viewportInitialized:a}),[a])}const Bb=e=>e.selected,jT=typeof window<"u"?window:void 0;function DT({deleteKeyCode:e,multiSelectionKeyCode:n}){const i=ct(),{deleteElements:a}=wm(),s=eo(e,{actInsideInputWithModifier:!1}),o=eo(n,{target:jT});Q.useEffect(()=>{if(s){const{edges:u,nodes:f}=i.getState();a({nodes:f.filter(Bb),edges:u.filter(Bb)}),i.setState({nodesSelectionActive:!1})}},[s]),Q.useEffect(()=>{i.setState({multiSelectionActive:o})},[o])}function RT(e){const n=ct();Q.useEffect(()=>{const i=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const a=mm(e.current);(a.height===0||a.width===0)&&n.getState().onError?.("004",ri.error004()),n.setState({width:a.width||500,height:a.height||500})};if(e.current){i(),window.addEventListener("resize",i);const a=new ResizeObserver(()=>i());return a.observe(e.current),()=>{window.removeEventListener("resize",i),a&&e.current&&a.unobserve(e.current)}}},[])}const af={position:"absolute",width:"100%",height:"100%",top:0,left:0},OT=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function LT({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=Jr.Free,zoomOnDoubleClick:u=!0,panOnDrag:f=!0,defaultViewport:h,translateExtent:d,minZoom:g,maxZoom:m,zoomActivationKeyCode:x,preventScrolling:b=!0,children:w,noWheelClassName:E,noPanClassName:N,onViewportChange:_,isControlledViewport:D,paneClickDistance:k,selectionOnDrag:C}){const L=ct(),A=Q.useRef(null),{userSelectionActive:H,lib:F,connectionInProgress:G}=Ye(OT,ut),q=eo(x),V=Q.useRef();RT(A);const P=Q.useCallback(te=>{_?.({x:te[0],y:te[1],zoom:te[2]}),D||L.setState({transform:te})},[_,D]);return Q.useEffect(()=>{if(A.current){V.current=qM({domNode:A.current,minZoom:g,maxZoom:m,translateExtent:d,viewport:h,onDraggingChange:j=>L.setState({paneDragging:j}),onPanZoomStart:(j,U)=>{const{onViewportChangeStart:Y,onMoveStart:K}=L.getState();K?.(j,U),Y?.(U)},onPanZoom:(j,U)=>{const{onViewportChange:Y,onMove:K}=L.getState();K?.(j,U),Y?.(U)},onPanZoomEnd:(j,U)=>{const{onViewportChangeEnd:Y,onMoveEnd:K}=L.getState();K?.(j,U),Y?.(U)}});const{x:te,y:O,zoom:B}=V.current.getViewport();return L.setState({panZoom:V.current,transform:[te,O,B],domNode:A.current.closest(".react-flow")}),()=>{V.current?.destroy()}}},[]),Q.useEffect(()=>{V.current?.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:i,panOnScroll:a,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:u,panOnDrag:f,zoomActivationKeyPressed:q,preventScrolling:b,noPanClassName:N,userSelectionActive:H,noWheelClassName:E,lib:F,onTransformChange:P,connectionInProgress:G,selectionOnDrag:C,paneClickDistance:k})},[e,n,i,a,s,o,u,f,q,b,N,H,E,F,P,G,C,k]),v.jsx("div",{className:"react-flow__renderer",ref:A,style:af,children:w})}const HT=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function BT(){const{userSelectionActive:e,userSelectionRect:n}=Ye(HT,ut);return e&&n?v.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Kh=(e,n)=>i=>{i.target===n.current&&e?.(i)},UT=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function IT({isSelecting:e,selectionKeyPressed:n,selectionMode:i=Ks.Full,panOnDrag:a,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:u,onSelectionEnd:f,onPaneClick:h,onPaneContextMenu:d,onPaneScroll:g,onPaneMouseEnter:m,onPaneMouseMove:x,onPaneMouseLeave:b,children:w}){const E=ct(),{userSelectionActive:N,elementsSelectable:_,dragging:D,connectionInProgress:k}=Ye(UT,ut),C=_&&(e||N),L=Q.useRef(null),A=Q.useRef(),H=Q.useRef(new Set),F=Q.useRef(new Set),G=Q.useRef(!1),q=Y=>{if(G.current||k){G.current=!1;return}h?.(Y),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},V=Y=>{if(Array.isArray(a)&&a?.includes(2)){Y.preventDefault();return}d?.(Y)},P=g?Y=>g(Y):void 0,te=Y=>{G.current&&(Y.stopPropagation(),G.current=!1)},O=Y=>{const{domNode:K}=E.getState();if(A.current=K?.getBoundingClientRect(),!A.current)return;const z=Y.target===L.current;if(!z&&!!Y.target.closest(".nokey")||!e||!(o&&z||n)||Y.button!==0||!Y.isPrimary)return;Y.target?.setPointerCapture?.(Y.pointerId),G.current=!1;const{x:T,y:ie}=Vn(Y.nativeEvent,A.current);E.setState({userSelectionRect:{width:0,height:0,startX:T,startY:ie,x:T,y:ie}}),z||(Y.stopPropagation(),Y.preventDefault())},B=Y=>{const{userSelectionRect:K,transform:z,nodeLookup:R,edgeLookup:$,connectionLookup:T,triggerNodeChanges:ie,triggerEdgeChanges:ce,defaultEdgeOptions:fe,resetSelectedElements:he}=E.getState();if(!A.current||!K)return;const{x:ue,y:me}=Vn(Y.nativeEvent,A.current),{startX:Ee,startY:Ce}=K;if(!G.current){const Xe=n?0:s;if(Math.hypot(ue-Ee,me-Ce)<=Xe)return;he(),u?.(Y)}G.current=!0;const we={startX:Ee,startY:Ce,x:ue<Ee?ue:Ee,y:me<Ce?me:Ce,width:Math.abs(ue-Ee),height:Math.abs(me-Ce)},Ne=H.current,Re=F.current;H.current=new Set(hm(R,we,z,i===Ks.Partial,!0).map(Xe=>Xe.id)),F.current=new Set;const Ze=fe?.selectable??!0;for(const Xe of H.current){const ht=T.get(Xe);if(ht)for(const{edgeId:sn}of ht.values()){const Lt=$.get(sn);Lt&&(Lt.selectable??Ze)&&F.current.add(sn)}}if(!ub(Ne,H.current)){const Xe=el(R,H.current,!0);ie(Xe)}if(!ub(Re,F.current)){const Xe=el($,F.current);ce(Xe)}E.setState({userSelectionRect:we,userSelectionActive:!0,nodesSelectionActive:!1})},j=Y=>{Y.button===0&&(Y.target?.releasePointerCapture?.(Y.pointerId),!N&&Y.target===L.current&&E.getState().userSelectionRect&&q?.(Y),E.setState({userSelectionActive:!1,userSelectionRect:null}),G.current&&(f?.(Y),E.setState({nodesSelectionActive:H.current.size>0})))},U=a===!0||Array.isArray(a)&&a.includes(0);return v.jsxs("div",{className:_t(["react-flow__pane",{draggable:U,dragging:D,selection:e}]),onClick:C?void 0:Kh(q,L),onContextMenu:Kh(V,L),onWheel:Kh(P,L),onPointerEnter:C?void 0:m,onPointerMove:C?B:x,onPointerUp:C?j:void 0,onPointerDownCapture:C?O:void 0,onClickCapture:C?te:void 0,onPointerLeave:b,ref:L,style:af,children:[w,v.jsx(BT,{})]})}function Bp({id:e,store:n,unselect:i=!1,nodeRef:a}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:u,nodeLookup:f,onError:h}=n.getState(),d=f.get(e);if(!d){h?.("012",ri.error012(e));return}n.setState({nodesSelectionActive:!1}),d.selected?(i||d.selected&&u)&&(o({nodes:[d],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):s([e])}function zw({nodeRef:e,disabled:n=!1,noDragClassName:i,handleSelector:a,nodeId:s,isSelectable:o,nodeClickDistance:u}){const f=ct(),[h,d]=Q.useState(!1),g=Q.useRef();return Q.useEffect(()=>{g.current=CM({getStoreItems:()=>f.getState(),onNodeMouseDown:m=>{Bp({id:m,store:f,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),Q.useEffect(()=>{if(n)g.current?.destroy();else if(e.current)return g.current?.update({noDragClassName:i,handleSelector:a,domNode:e.current,isSelectable:o,nodeId:s,nodeClickDistance:u}),()=>{g.current?.destroy()}},[i,a,n,o,e,s]),h}const qT=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function jw(){const e=ct();return Q.useCallback(i=>{const{nodeExtent:a,snapToGrid:s,snapGrid:o,nodesDraggable:u,onError:f,updateNodePositions:h,nodeLookup:d,nodeOrigin:g}=e.getState(),m=new Map,x=qT(u),b=s?o[0]:5,w=s?o[1]:5,E=i.direction.x*b*i.factor,N=i.direction.y*w*i.factor;for(const[,_]of d){if(!x(_))continue;let D={x:_.internals.positionAbsolute.x+E,y:_.internals.positionAbsolute.y+N};s&&(D=co(D,o));const{position:k,positionAbsolute:C}=Qv({nodeId:_.id,nextPosition:D,nodeLookup:d,nodeExtent:a,nodeOrigin:g,onError:f});_.position=k,_.internals.positionAbsolute=C,m.set(_.id,_)}h(m)},[])}const Sm=Q.createContext(null),$T=Sm.Provider;Sm.Consumer;const Dw=()=>Q.useContext(Sm),VT=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),PT=(e,n,i)=>a=>{const{connectionClickStartHandle:s,connectionMode:o,connection:u}=a,{fromHandle:f,toHandle:h,isValid:d}=u,g=h?.nodeId===e&&h?.id===n&&h?.type===i;return{connectingFrom:f?.nodeId===e&&f?.id===n&&f?.type===i,connectingTo:g,clickConnecting:s?.nodeId===e&&s?.id===n&&s?.type===i,isPossibleEndHandle:o===ul.Strict?f?.type!==i:e!==f?.nodeId||n!==f?.id,connectionInProcess:!!f,clickConnectionInProcess:!!s,valid:g&&d}};function YT({type:e="source",position:n=be.Top,isValidConnection:i,isConnectable:a=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:u,onConnect:f,children:h,className:d,onMouseDown:g,onTouchStart:m,...x},b){const w=u||null,E=e==="target",N=ct(),_=Dw(),{connectOnClick:D,noPanClassName:k,rfId:C}=Ye(VT,ut),{connectingFrom:L,connectingTo:A,clickConnecting:H,isPossibleEndHandle:F,connectionInProcess:G,clickConnectionInProcess:q,valid:V}=Ye(PT(_,w,e),ut);_||N.getState().onError?.("010",ri.error010());const P=B=>{const{defaultEdgeOptions:j,onConnect:U,hasDefaultEdges:Y}=N.getState(),K={...j,...B};if(Y){const{edges:z,setEdges:R}=N.getState();R(ow(K,z))}U?.(K),f?.(K)},te=B=>{if(!_)return;const j=rw(B.nativeEvent);if(s&&(j&&B.button===0||!j)){const U=N.getState();Hp.onPointerDown(B.nativeEvent,{handleDomNode:B.currentTarget,autoPanOnConnect:U.autoPanOnConnect,connectionMode:U.connectionMode,connectionRadius:U.connectionRadius,domNode:U.domNode,nodeLookup:U.nodeLookup,lib:U.lib,isTarget:E,handleId:w,nodeId:_,flowId:U.rfId,panBy:U.panBy,cancelConnection:U.cancelConnection,onConnectStart:U.onConnectStart,onConnectEnd:U.onConnectEnd,updateConnection:U.updateConnection,onConnect:P,isValidConnection:i||U.isValidConnection,getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:U.autoPanSpeed,dragThreshold:U.connectionDragThreshold})}j?g?.(B):m?.(B)},O=B=>{const{onClickConnectStart:j,onClickConnectEnd:U,connectionClickStartHandle:Y,connectionMode:K,isValidConnection:z,lib:R,rfId:$,nodeLookup:T,connection:ie}=N.getState();if(!_||!Y&&!s)return;if(!Y){j?.(B.nativeEvent,{nodeId:_,handleId:w,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:_,type:e,id:w}});return}const ce=nw(B.target),fe=i||z,{connection:he,isValid:ue}=Hp.isValid(B.nativeEvent,{handle:{nodeId:_,id:w,type:e},connectionMode:K,fromNodeId:Y.nodeId,fromHandleId:Y.id||null,fromType:Y.type,isValidConnection:fe,flowId:$,doc:ce,lib:R,nodeLookup:T});ue&&he&&P(he);const me=structuredClone(ie);delete me.inProgress,me.toPosition=me.toHandle?me.toHandle.position:null,U?.(B,me),N.setState({connectionClickStartHandle:null})};return v.jsx("div",{"data-handleid":w,"data-nodeid":_,"data-handlepos":n,"data-id":`${C}-${_}-${w}-${e}`,className:_t(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",k,d,{source:!E,target:E,connectable:a,connectablestart:s,connectableend:o,clickconnecting:H,connectingfrom:L,connectingto:A,valid:V,connectionindicator:a&&(!G||F)&&(G||q?o:s)}]),onMouseDown:te,onTouchStart:te,onClick:D?O:void 0,ref:b,...x,children:h})}const pl=Q.memo(Tw(YT));function XT({data:e,isConnectable:n,sourcePosition:i=be.Bottom}){return v.jsxs(v.Fragment,{children:[e?.label,v.jsx(pl,{type:"source",position:i,isConnectable:n})]})}function FT({data:e,isConnectable:n,targetPosition:i=be.Top,sourcePosition:a=be.Bottom}){return v.jsxs(v.Fragment,{children:[v.jsx(pl,{type:"target",position:i,isConnectable:n}),e?.label,v.jsx(pl,{type:"source",position:a,isConnectable:n})]})}function GT(){return null}function ZT({data:e,isConnectable:n,targetPosition:i=be.Top}){return v.jsxs(v.Fragment,{children:[v.jsx(pl,{type:"target",position:i,isConnectable:n}),e?.label]})}const Uc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Ub={input:XT,default:FT,output:ZT,group:GT};function QT(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const KT=e=>{const{width:n,height:i,x:a,y:s}=uo(e.nodeLookup,{filter:o=>!!o.selected});return{width:$n(n)?n:null,height:$n(i)?i:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${a}px,${s}px)`}};function JT({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:i}){const a=ct(),{width:s,height:o,transformString:u,userSelectionActive:f}=Ye(KT,ut),h=jw(),d=Q.useRef(null);if(Q.useEffect(()=>{i||d.current?.focus({preventScroll:!0})},[i]),zw({nodeRef:d}),f||!s||!o)return null;const g=e?x=>{const b=a.getState().nodes.filter(w=>w.selected);e(x,b)}:void 0,m=x=>{Object.prototype.hasOwnProperty.call(Uc,x.key)&&(x.preventDefault(),h({direction:Uc[x.key],factor:x.shiftKey?4:1}))};return v.jsx("div",{className:_t(["react-flow__nodesselection","react-flow__container",n]),style:{transform:u},children:v.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:i?void 0:-1,onKeyDown:i?void 0:m,style:{width:s,height:o}})})}const Ib=typeof window<"u"?window:void 0,WT=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Rw({children:e,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:u,paneClickDistance:f,deleteKeyCode:h,selectionKeyCode:d,selectionOnDrag:g,selectionMode:m,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:w,panActivationKeyCode:E,zoomActivationKeyCode:N,elementsSelectable:_,zoomOnScroll:D,zoomOnPinch:k,panOnScroll:C,panOnScrollSpeed:L,panOnScrollMode:A,zoomOnDoubleClick:H,panOnDrag:F,defaultViewport:G,translateExtent:q,minZoom:V,maxZoom:P,preventScrolling:te,onSelectionContextMenu:O,noWheelClassName:B,noPanClassName:j,disableKeyboardA11y:U,onViewportChange:Y,isControlledViewport:K}){const{nodesSelectionActive:z,userSelectionActive:R}=Ye(WT,ut),$=eo(d,{target:Ib}),T=eo(E,{target:Ib}),ie=T||F,ce=T||C,fe=g&&ie!==!0,he=$||R||fe;return DT({deleteKeyCode:h,multiSelectionKeyCode:w}),v.jsx(LT,{onPaneContextMenu:o,elementsSelectable:_,zoomOnScroll:D,zoomOnPinch:k,panOnScroll:ce,panOnScrollSpeed:L,panOnScrollMode:A,zoomOnDoubleClick:H,panOnDrag:!$&&ie,defaultViewport:G,translateExtent:q,minZoom:V,maxZoom:P,zoomActivationKeyCode:N,preventScrolling:te,noWheelClassName:B,noPanClassName:j,onViewportChange:Y,isControlledViewport:K,paneClickDistance:f,selectionOnDrag:fe,children:v.jsxs(IT,{onSelectionStart:x,onSelectionEnd:b,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:u,panOnDrag:ie,isSelecting:!!he,selectionMode:m,selectionKeyPressed:$,paneClickDistance:f,selectionOnDrag:fe,children:[e,z&&v.jsx(JT,{onSelectionContextMenu:O,noPanClassName:j,disableKeyboardA11y:U})]})})}Rw.displayName="FlowRenderer";const eA=Q.memo(Rw),tA=e=>n=>e?hm(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(i=>i.id):Array.from(n.nodeLookup.keys());function nA(e){return Ye(Q.useCallback(tA(e),[e]),ut)}const iA=e=>e.updateNodeInternals;function rA(){const e=Ye(iA),[n]=Q.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const a=new Map;i.forEach(s=>{const o=s.target.getAttribute("data-id");a.set(o,{id:o,nodeElement:s.target,force:!0})}),e(a)}));return Q.useEffect(()=>()=>{n?.disconnect()},[n]),n}function aA({node:e,nodeType:n,hasDimensions:i,resizeObserver:a}){const s=ct(),o=Q.useRef(null),u=Q.useRef(null),f=Q.useRef(e.sourcePosition),h=Q.useRef(e.targetPosition),d=Q.useRef(n),g=i&&!!e.internals.handleBounds;return Q.useEffect(()=>{o.current&&!e.hidden&&(!g||u.current!==o.current)&&(u.current&&a?.unobserve(u.current),a?.observe(o.current),u.current=o.current)},[g,e.hidden]),Q.useEffect(()=>()=>{u.current&&(a?.unobserve(u.current),u.current=null)},[]),Q.useEffect(()=>{if(o.current){const m=d.current!==n,x=f.current!==e.sourcePosition,b=h.current!==e.targetPosition;(m||x||b)&&(d.current=n,f.current=e.sourcePosition,h.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),o}function lA({id:e,onClick:n,onMouseEnter:i,onMouseMove:a,onMouseLeave:s,onContextMenu:o,onDoubleClick:u,nodesDraggable:f,elementsSelectable:h,nodesConnectable:d,nodesFocusable:g,resizeObserver:m,noDragClassName:x,noPanClassName:b,disableKeyboardA11y:w,rfId:E,nodeTypes:N,nodeClickDistance:_,onError:D}){const{node:k,internals:C,isParent:L}=Ye(ue=>{const me=ue.nodeLookup.get(e),Ee=ue.parentLookup.has(e);return{node:me,internals:me.internals,isParent:Ee}},ut);let A=k.type||"default",H=N?.[A]||Ub[A];H===void 0&&(D?.("003",ri.error003(A)),A="default",H=N?.default||Ub.default);const F=!!(k.draggable||f&&typeof k.draggable>"u"),G=!!(k.selectable||h&&typeof k.selectable>"u"),q=!!(k.connectable||d&&typeof k.connectable>"u"),V=!!(k.focusable||g&&typeof k.focusable>"u"),P=ct(),te=ew(k),O=aA({node:k,nodeType:A,hasDimensions:te,resizeObserver:m}),B=zw({nodeRef:O,disabled:k.hidden||!F,noDragClassName:x,handleSelector:k.dragHandle,nodeId:e,isSelectable:G,nodeClickDistance:_}),j=jw();if(k.hidden)return null;const U=Bi(k),Y=QT(k),K=G||F||n||i||a||s,z=i?ue=>i(ue,{...C.userNode}):void 0,R=a?ue=>a(ue,{...C.userNode}):void 0,$=s?ue=>s(ue,{...C.userNode}):void 0,T=o?ue=>o(ue,{...C.userNode}):void 0,ie=u?ue=>u(ue,{...C.userNode}):void 0,ce=ue=>{const{selectNodesOnDrag:me,nodeDragThreshold:Ee}=P.getState();G&&(!me||!F||Ee>0)&&Bp({id:e,store:P,nodeRef:O}),n&&n(ue,{...C.userNode})},fe=ue=>{if(!(iw(ue.nativeEvent)||w)){if(Yv.includes(ue.key)&&G){const me=ue.key==="Escape";Bp({id:e,store:P,unselect:me,nodeRef:O})}else if(F&&k.selected&&Object.prototype.hasOwnProperty.call(Uc,ue.key)){ue.preventDefault();const{ariaLabelConfig:me}=P.getState();P.setState({ariaLiveMessage:me["node.a11yDescription.ariaLiveMessage"]({direction:ue.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),j({direction:Uc[ue.key],factor:ue.shiftKey?4:1})}}},he=()=>{if(w||!O.current?.matches(":focus-visible"))return;const{transform:ue,width:me,height:Ee,autoPanOnNodeFocus:Ce,setCenter:we}=P.getState();if(!Ce)return;hm(new Map([[e,k]]),{x:0,y:0,width:me,height:Ee},ue,!0).length>0||we(k.position.x+U.width/2,k.position.y+U.height/2,{zoom:ue[2]})};return v.jsx("div",{className:_t(["react-flow__node",`react-flow__node-${A}`,{[b]:F},k.className,{selected:k.selected,selectable:G,parent:L,draggable:F,dragging:B}]),ref:O,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:K?"all":"none",visibility:te?"visible":"hidden",...k.style,...Y},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:R,onMouseLeave:$,onContextMenu:T,onClick:ce,onDoubleClick:ie,onKeyDown:V?fe:void 0,tabIndex:V?0:void 0,onFocus:V?he:void 0,role:k.ariaRole??(V?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${_w}-${E}`,"aria-label":k.ariaLabel,...k.domAttributes,children:v.jsx($T,{value:e,children:v.jsx(H,{id:e,data:k.data,type:A,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:k.selected??!1,selectable:G,draggable:F,deletable:k.deletable??!0,isConnectable:q,sourcePosition:k.sourcePosition,targetPosition:k.targetPosition,dragging:B,dragHandle:k.dragHandle,zIndex:C.z,parentId:k.parentId,...U})})})}var sA=Q.memo(lA);const oA=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Ow(e){const{nodesDraggable:n,nodesConnectable:i,nodesFocusable:a,elementsSelectable:s,onError:o}=Ye(oA,ut),u=nA(e.onlyRenderVisibleElements),f=rA();return v.jsx("div",{className:"react-flow__nodes",style:af,children:u.map(h=>v.jsx(sA,{id:h,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:f,nodesDraggable:n,nodesConnectable:i,nodesFocusable:a,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:o},h))})}Ow.displayName="NodeRenderer";const uA=Q.memo(Ow);function cA(e){return Ye(Q.useCallback(i=>{if(!e)return i.edges.map(s=>s.id);const a=[];if(i.width&&i.height)for(const s of i.edges){const o=i.nodeLookup.get(s.source),u=i.nodeLookup.get(s.target);o&&u&&uM({sourceNode:o,targetNode:u,width:i.width,height:i.height,transform:i.transform})&&a.push(s.id)}return a},[e]),ut)}const fA=({color:e="none",strokeWidth:n=1})=>{const i={strokeWidth:n,...e&&{stroke:e}};return v.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},dA=({color:e="none",strokeWidth:n=1})=>{const i={strokeWidth:n,...e&&{stroke:e,fill:e}};return v.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},qb={[Lc.Arrow]:fA,[Lc.ArrowClosed]:dA};function hA(e){const n=ct();return Q.useMemo(()=>Object.prototype.hasOwnProperty.call(qb,e)?qb[e]:(n.getState().onError?.("009",ri.error009(e)),null),[e])}const pA=({id:e,type:n,color:i,width:a=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:u,orient:f="auto-start-reverse"})=>{const h=hA(n);return h?v.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${a}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:f,refX:"0",refY:"0",children:v.jsx(h,{color:i,strokeWidth:u})}):null},Lw=({defaultColor:e,rfId:n})=>{const i=Ye(o=>o.edges),a=Ye(o=>o.defaultEdgeOptions),s=Q.useMemo(()=>gM(i,{id:n,defaultColor:e,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[i,a,n,e]);return s.length?v.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:v.jsx("defs",{children:s.map(o=>v.jsx(pA,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};Lw.displayName="MarkerDefinitions";var mA=Q.memo(Lw);function Hw({x:e,y:n,label:i,labelStyle:a,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:u=[2,4],labelBgBorderRadius:f=2,children:h,className:d,...g}){const[m,x]=Q.useState({x:1,y:0,width:0,height:0}),b=_t(["react-flow__edge-textwrapper",d]),w=Q.useRef(null);return Q.useEffect(()=>{if(w.current){const E=w.current.getBBox();x({x:E.x,y:E.y,width:E.width,height:E.height})}},[i]),i?v.jsxs("g",{transform:`translate(${e-m.width/2} ${n-m.height/2})`,className:b,visibility:m.width?"visible":"hidden",...g,children:[s&&v.jsx("rect",{width:m.width+2*u[0],x:-u[0],y:-u[1],height:m.height+2*u[1],className:"react-flow__edge-textbg",style:o,rx:f,ry:f}),v.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:w,style:a,children:i}),h]}):null}Hw.displayName="EdgeText";const gA=Q.memo(Hw);function lf({path:e,labelX:n,labelY:i,label:a,labelStyle:s,labelShowBg:o,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h,interactionWidth:d=20,...g}){return v.jsxs(v.Fragment,{children:[v.jsx("path",{...g,d:e,fill:"none",className:_t(["react-flow__edge-path",g.className])}),d?v.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,a&&$n(n)&&$n(i)?v.jsx(gA,{x:n,y:i,label:a,labelStyle:s,labelShowBg:o,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h}):null]})}function $b({pos:e,x1:n,y1:i,x2:a,y2:s}){return e===be.Left||e===be.Right?[.5*(n+a),i]:[n,.5*(i+s)]}function Bw({sourceX:e,sourceY:n,sourcePosition:i=be.Bottom,targetX:a,targetY:s,targetPosition:o=be.Top}){const[u,f]=$b({pos:i,x1:e,y1:n,x2:a,y2:s}),[h,d]=$b({pos:o,x1:a,y1:s,x2:e,y2:n}),[g,m,x,b]=aw({sourceX:e,sourceY:n,targetX:a,targetY:s,sourceControlX:u,sourceControlY:f,targetControlX:h,targetControlY:d});return[`M${e},${n} C${u},${f} ${h},${d} ${a},${s}`,g,m,x,b]}function Uw(e){return Q.memo(({id:n,sourceX:i,sourceY:a,targetX:s,targetY:o,sourcePosition:u,targetPosition:f,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,interactionWidth:_})=>{const[D,k,C]=Bw({sourceX:i,sourceY:a,sourcePosition:u,targetX:s,targetY:o,targetPosition:f}),L=e.isInternal?void 0:n;return v.jsx(lf,{id:L,path:D,labelX:k,labelY:C,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,interactionWidth:_})})}const yA=Uw({isInternal:!1}),Iw=Uw({isInternal:!0});yA.displayName="SimpleBezierEdge";Iw.displayName="SimpleBezierEdgeInternal";function qw(e){return Q.memo(({id:n,sourceX:i,sourceY:a,targetX:s,targetY:o,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,sourcePosition:b=be.Bottom,targetPosition:w=be.Top,markerEnd:E,markerStart:N,pathOptions:_,interactionWidth:D})=>{const[k,C,L]=Rp({sourceX:i,sourceY:a,sourcePosition:b,targetX:s,targetY:o,targetPosition:w,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition}),A=e.isInternal?void 0:n;return v.jsx(lf,{id:A,path:k,labelX:C,labelY:L,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:E,markerStart:N,interactionWidth:D})})}const $w=qw({isInternal:!1}),Vw=qw({isInternal:!0});$w.displayName="SmoothStepEdge";Vw.displayName="SmoothStepEdgeInternal";function Pw(e){return Q.memo(({id:n,...i})=>{const a=e.isInternal?void 0:n;return v.jsx($w,{...i,id:a,pathOptions:Q.useMemo(()=>({borderRadius:0,offset:i.pathOptions?.offset}),[i.pathOptions?.offset])})})}const xA=Pw({isInternal:!1}),Yw=Pw({isInternal:!0});xA.displayName="StepEdge";Yw.displayName="StepEdgeInternal";function Xw(e){return Q.memo(({id:n,sourceX:i,sourceY:a,targetX:s,targetY:o,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:b,markerStart:w,interactionWidth:E})=>{const[N,_,D]=uw({sourceX:i,sourceY:a,targetX:s,targetY:o}),k=e.isInternal?void 0:n;return v.jsx(lf,{id:k,path:N,labelX:_,labelY:D,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:b,markerStart:w,interactionWidth:E})})}const bA=Xw({isInternal:!1}),Fw=Xw({isInternal:!0});bA.displayName="StraightEdge";Fw.displayName="StraightEdgeInternal";function Gw(e){return Q.memo(({id:n,sourceX:i,sourceY:a,targetX:s,targetY:o,sourcePosition:u=be.Bottom,targetPosition:f=be.Top,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,pathOptions:_,interactionWidth:D})=>{const[k,C,L]=lw({sourceX:i,sourceY:a,sourcePosition:u,targetX:s,targetY:o,targetPosition:f,curvature:_?.curvature}),A=e.isInternal?void 0:n;return v.jsx(lf,{id:A,path:k,labelX:C,labelY:L,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,interactionWidth:D})})}const vA=Gw({isInternal:!1}),Zw=Gw({isInternal:!0});vA.displayName="BezierEdge";Zw.displayName="BezierEdgeInternal";const Vb={default:Zw,straight:Fw,step:Yw,smoothstep:Vw,simplebezier:Iw},Pb={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},wA=(e,n,i)=>i===be.Left?e-n:i===be.Right?e+n:e,SA=(e,n,i)=>i===be.Top?e-n:i===be.Bottom?e+n:e,Yb="react-flow__edgeupdater";function Xb({position:e,centerX:n,centerY:i,radius:a=10,onMouseDown:s,onMouseEnter:o,onMouseOut:u,type:f}){return v.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:u,className:_t([Yb,`${Yb}-${f}`]),cx:wA(n,a,e),cy:SA(i,a,e),r:a,stroke:"transparent",fill:"transparent"})}function _A({isReconnectable:e,reconnectRadius:n,edge:i,sourceX:a,sourceY:s,targetX:o,targetY:u,sourcePosition:f,targetPosition:h,onReconnect:d,onReconnectStart:g,onReconnectEnd:m,setReconnecting:x,setUpdateHover:b}){const w=ct(),E=(C,L)=>{if(C.button!==0)return;const{autoPanOnConnect:A,domNode:H,isValidConnection:F,connectionMode:G,connectionRadius:q,lib:V,onConnectStart:P,onConnectEnd:te,cancelConnection:O,nodeLookup:B,rfId:j,panBy:U,updateConnection:Y}=w.getState(),K=L.type==="target",z=(T,ie)=>{x(!1),m?.(T,i,L.type,ie)},R=T=>d?.(i,T),$=(T,ie)=>{x(!0),g?.(C,i,L.type),P?.(T,ie)};Hp.onPointerDown(C.nativeEvent,{autoPanOnConnect:A,connectionMode:G,connectionRadius:q,domNode:H,handleId:L.id,nodeId:L.nodeId,nodeLookup:B,isTarget:K,edgeUpdaterType:L.type,lib:V,flowId:j,cancelConnection:O,panBy:U,isValidConnection:F,onConnect:R,onConnectStart:$,onConnectEnd:te,onReconnectEnd:z,updateConnection:Y,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},N=C=>E(C,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),_=C=>E(C,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),D=()=>b(!0),k=()=>b(!1);return v.jsxs(v.Fragment,{children:[(e===!0||e==="source")&&v.jsx(Xb,{position:f,centerX:a,centerY:s,radius:n,onMouseDown:N,onMouseEnter:D,onMouseOut:k,type:"source"}),(e===!0||e==="target")&&v.jsx(Xb,{position:h,centerX:o,centerY:u,radius:n,onMouseDown:_,onMouseEnter:D,onMouseOut:k,type:"target"})]})}function kA({id:e,edgesFocusable:n,edgesReconnectable:i,elementsSelectable:a,onClick:s,onDoubleClick:o,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,reconnectRadius:g,onReconnect:m,onReconnectStart:x,onReconnectEnd:b,rfId:w,edgeTypes:E,noPanClassName:N,onError:_,disableKeyboardA11y:D}){let k=Ye(we=>we.edgeLookup.get(e));const C=Ye(we=>we.defaultEdgeOptions);k=C?{...C,...k}:k;let L=k.type||"default",A=E?.[L]||Vb[L];A===void 0&&(_?.("011",ri.error011(L)),L="default",A=E?.default||Vb.default);const H=!!(k.focusable||n&&typeof k.focusable>"u"),F=typeof m<"u"&&(k.reconnectable||i&&typeof k.reconnectable>"u"),G=!!(k.selectable||a&&typeof k.selectable>"u"),q=Q.useRef(null),[V,P]=Q.useState(!1),[te,O]=Q.useState(!1),B=ct(),{zIndex:j,sourceX:U,sourceY:Y,targetX:K,targetY:z,sourcePosition:R,targetPosition:$}=Ye(Q.useCallback(we=>{const Ne=we.nodeLookup.get(k.source),Re=we.nodeLookup.get(k.target);if(!Ne||!Re)return{zIndex:k.zIndex,...Pb};const Ze=mM({id:e,sourceNode:Ne,targetNode:Re,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:we.connectionMode,onError:_});return{zIndex:oM({selected:k.selected,zIndex:k.zIndex,sourceNode:Ne,targetNode:Re,elevateOnSelect:we.elevateEdgesOnSelect,zIndexMode:we.zIndexMode}),...Ze||Pb}},[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),ut),T=Q.useMemo(()=>k.markerStart?`url('#${Op(k.markerStart,w)}')`:void 0,[k.markerStart,w]),ie=Q.useMemo(()=>k.markerEnd?`url('#${Op(k.markerEnd,w)}')`:void 0,[k.markerEnd,w]);if(k.hidden||U===null||Y===null||K===null||z===null)return null;const ce=we=>{const{addSelectedEdges:Ne,unselectNodesAndEdges:Re,multiSelectionActive:Ze}=B.getState();G&&(B.setState({nodesSelectionActive:!1}),k.selected&&Ze?(Re({nodes:[],edges:[k]}),q.current?.blur()):Ne([e])),s&&s(we,k)},fe=o?we=>{o(we,{...k})}:void 0,he=u?we=>{u(we,{...k})}:void 0,ue=f?we=>{f(we,{...k})}:void 0,me=h?we=>{h(we,{...k})}:void 0,Ee=d?we=>{d(we,{...k})}:void 0,Ce=we=>{if(!D&&Yv.includes(we.key)&&G){const{unselectNodesAndEdges:Ne,addSelectedEdges:Re}=B.getState();we.key==="Escape"?(q.current?.blur(),Ne({edges:[k]})):Re([e])}};return v.jsx("svg",{style:{zIndex:j},children:v.jsxs("g",{className:_t(["react-flow__edge",`react-flow__edge-${L}`,k.className,N,{selected:k.selected,animated:k.animated,inactive:!G&&!s,updating:V,selectable:G}]),onClick:ce,onDoubleClick:fe,onContextMenu:he,onMouseEnter:ue,onMouseMove:me,onMouseLeave:Ee,onKeyDown:H?Ce:void 0,tabIndex:H?0:void 0,role:k.ariaRole??(H?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":k.ariaLabel===null?void 0:k.ariaLabel||`Edge from ${k.source} to ${k.target}`,"aria-describedby":H?`${kw}-${w}`:void 0,ref:q,...k.domAttributes,children:[!te&&v.jsx(A,{id:e,source:k.source,target:k.target,type:k.type,selected:k.selected,animated:k.animated,selectable:G,deletable:k.deletable??!0,label:k.label,labelStyle:k.labelStyle,labelShowBg:k.labelShowBg,labelBgStyle:k.labelBgStyle,labelBgPadding:k.labelBgPadding,labelBgBorderRadius:k.labelBgBorderRadius,sourceX:U,sourceY:Y,targetX:K,targetY:z,sourcePosition:R,targetPosition:$,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:T,markerEnd:ie,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),F&&v.jsx(_A,{edge:k,isReconnectable:F,reconnectRadius:g,onReconnect:m,onReconnectStart:x,onReconnectEnd:b,sourceX:U,sourceY:Y,targetX:K,targetY:z,sourcePosition:R,targetPosition:$,setUpdateHover:P,setReconnecting:O})]})})}var EA=Q.memo(kA);const NA=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Qw({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:i,edgeTypes:a,noPanClassName:s,onReconnect:o,onEdgeContextMenu:u,onEdgeMouseEnter:f,onEdgeMouseMove:h,onEdgeMouseLeave:d,onEdgeClick:g,reconnectRadius:m,onEdgeDoubleClick:x,onReconnectStart:b,onReconnectEnd:w,disableKeyboardA11y:E}){const{edgesFocusable:N,edgesReconnectable:_,elementsSelectable:D,onError:k}=Ye(NA,ut),C=cA(n);return v.jsxs("div",{className:"react-flow__edges",children:[v.jsx(mA,{defaultColor:e,rfId:i}),C.map(L=>v.jsx(EA,{id:L,edgesFocusable:N,edgesReconnectable:_,elementsSelectable:D,noPanClassName:s,onReconnect:o,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,onClick:g,reconnectRadius:m,onDoubleClick:x,onReconnectStart:b,onReconnectEnd:w,rfId:i,onError:k,edgeTypes:a,disableKeyboardA11y:E},L))]})}Qw.displayName="EdgeRenderer";const CA=Q.memo(Qw),MA=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function TA({children:e}){const n=Ye(MA);return v.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function AA(e){const n=wm(),i=Q.useRef(!1);Q.useEffect(()=>{!i.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),i.current=!0)},[e,n.viewportInitialized])}const zA=e=>e.panZoom?.syncViewport;function jA(e){const n=Ye(zA),i=ct();return Q.useEffect(()=>{e&&(n?.(e),i.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function DA(e){return e.connection.inProgress?{...e.connection,to:fo(e.connection.to,e.transform)}:{...e.connection}}function RA(e){return DA}function OA(e){const n=RA();return Ye(n,ut)}const LA=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function HA({containerStyle:e,style:n,type:i,component:a}){const{nodesConnectable:s,width:o,height:u,isValid:f,inProgress:h}=Ye(LA,ut);return!(o&&s&&h)?null:v.jsx("svg",{style:e,width:o,height:u,className:"react-flow__connectionline react-flow__container",children:v.jsx("g",{className:_t(["react-flow__connection",Gv(f)]),children:v.jsx(Kw,{style:n,type:i,CustomComponent:a,isValid:f})})})}const Kw=({style:e,type:n=wr.Bezier,CustomComponent:i,isValid:a})=>{const{inProgress:s,from:o,fromNode:u,fromHandle:f,fromPosition:h,to:d,toNode:g,toHandle:m,toPosition:x,pointer:b}=OA();if(!s)return;if(i)return v.jsx(i,{connectionLineType:n,connectionLineStyle:e,fromNode:u,fromHandle:f,fromX:o.x,fromY:o.y,toX:d.x,toY:d.y,fromPosition:h,toPosition:x,connectionStatus:Gv(a),toNode:g,toHandle:m,pointer:b});let w="";const E={sourceX:o.x,sourceY:o.y,sourcePosition:h,targetX:d.x,targetY:d.y,targetPosition:x};switch(n){case wr.Bezier:[w]=lw(E);break;case wr.SimpleBezier:[w]=Bw(E);break;case wr.Step:[w]=Rp({...E,borderRadius:0});break;case wr.SmoothStep:[w]=Rp(E);break;default:[w]=uw(E)}return v.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};Kw.displayName="ConnectionLine";const BA={};function Fb(e=BA){Q.useRef(e),ct(),Q.useEffect(()=>{},[e])}function UA(){ct(),Q.useRef(!1),Q.useEffect(()=>{},[])}function Jw({nodeTypes:e,edgeTypes:n,onInit:i,onNodeClick:a,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:u,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:g,onSelectionContextMenu:m,onSelectionStart:x,onSelectionEnd:b,connectionLineType:w,connectionLineStyle:E,connectionLineComponent:N,connectionLineContainerStyle:_,selectionKeyCode:D,selectionOnDrag:k,selectionMode:C,multiSelectionKeyCode:L,panActivationKeyCode:A,zoomActivationKeyCode:H,deleteKeyCode:F,onlyRenderVisibleElements:G,elementsSelectable:q,defaultViewport:V,translateExtent:P,minZoom:te,maxZoom:O,preventScrolling:B,defaultMarkerColor:j,zoomOnScroll:U,zoomOnPinch:Y,panOnScroll:K,panOnScrollSpeed:z,panOnScrollMode:R,zoomOnDoubleClick:$,panOnDrag:T,onPaneClick:ie,onPaneMouseEnter:ce,onPaneMouseMove:fe,onPaneMouseLeave:he,onPaneScroll:ue,onPaneContextMenu:me,paneClickDistance:Ee,nodeClickDistance:Ce,onEdgeContextMenu:we,onEdgeMouseEnter:Ne,onEdgeMouseMove:Re,onEdgeMouseLeave:Ze,reconnectRadius:Xe,onReconnect:ht,onReconnectStart:sn,onReconnectEnd:Lt,noDragClassName:Gt,noWheelClassName:Rn,noPanClassName:si,disableKeyboardA11y:oi,nodeExtent:Et,rfId:Ii,viewport:ae,onViewportChange:pe}){return Fb(e),Fb(n),UA(),AA(i),jA(ae),v.jsx(eA,{onPaneClick:ie,onPaneMouseEnter:ce,onPaneMouseMove:fe,onPaneMouseLeave:he,onPaneContextMenu:me,onPaneScroll:ue,paneClickDistance:Ee,deleteKeyCode:F,selectionKeyCode:D,selectionOnDrag:k,selectionMode:C,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:L,panActivationKeyCode:A,zoomActivationKeyCode:H,elementsSelectable:q,zoomOnScroll:U,zoomOnPinch:Y,zoomOnDoubleClick:$,panOnScroll:K,panOnScrollSpeed:z,panOnScrollMode:R,panOnDrag:T,defaultViewport:V,translateExtent:P,minZoom:te,maxZoom:O,onSelectionContextMenu:m,preventScrolling:B,noDragClassName:Gt,noWheelClassName:Rn,noPanClassName:si,disableKeyboardA11y:oi,onViewportChange:pe,isControlledViewport:!!ae,children:v.jsxs(TA,{children:[v.jsx(CA,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:u,onReconnect:ht,onReconnectStart:sn,onReconnectEnd:Lt,onlyRenderVisibleElements:G,onEdgeContextMenu:we,onEdgeMouseEnter:Ne,onEdgeMouseMove:Re,onEdgeMouseLeave:Ze,reconnectRadius:Xe,defaultMarkerColor:j,noPanClassName:si,disableKeyboardA11y:oi,rfId:Ii}),v.jsx(HA,{style:E,type:w,component:N,containerStyle:_}),v.jsx("div",{className:"react-flow__edgelabel-renderer"}),v.jsx(uA,{nodeTypes:e,onNodeClick:a,onNodeDoubleClick:o,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:g,nodeClickDistance:Ce,onlyRenderVisibleElements:G,noPanClassName:si,noDragClassName:Gt,disableKeyboardA11y:oi,nodeExtent:Et,rfId:Ii}),v.jsx("div",{className:"react-flow__viewport-portal"})]})})}Jw.displayName="GraphView";const IA=Q.memo(Jw),Gb=({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,width:s,height:o,fitView:u,fitViewOptions:f,minZoom:h=.5,maxZoom:d=2,nodeOrigin:g,nodeExtent:m,zIndexMode:x="basic"}={})=>{const b=new Map,w=new Map,E=new Map,N=new Map,_=a??n??[],D=i??e??[],k=g??[0,0],C=m??Qs;dw(E,N,_);const L=Lp(D,b,w,{nodeOrigin:k,nodeExtent:C,zIndexMode:x});let A=[0,0,1];if(u&&s&&o){const H=uo(b,{filter:V=>!!((V.width||V.initialWidth)&&(V.height||V.initialHeight))}),{x:F,y:G,zoom:q}=pm(H,s,o,h,d,f?.padding??.1);A=[F,G,q]}return{rfId:"1",width:s??0,height:o??0,transform:A,nodes:D,nodesInitialized:L,nodeLookup:b,parentLookup:w,edges:_,edgeLookup:N,connectionLookup:E,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:h,maxZoom:d,translateExtent:Qs,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ul.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:k,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:u??!1,fitViewOptions:f,fitViewResolver:null,connection:{...Fv},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:nM,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Xv,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},qA=({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,width:s,height:o,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:g,nodeExtent:m,zIndexMode:x})=>aT((b,w)=>{async function E(){const{nodeLookup:N,panZoom:_,fitViewOptions:D,fitViewResolver:k,width:C,height:L,minZoom:A,maxZoom:H}=w();_&&(await eM({nodes:N,width:C,height:L,panZoom:_,minZoom:A,maxZoom:H},D),k?.resolve(!0),b({fitViewResolver:null}))}return{...Gb({nodes:e,edges:n,width:s,height:o,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:g,nodeExtent:m,defaultNodes:i,defaultEdges:a,zIndexMode:x}),setNodes:N=>{const{nodeLookup:_,parentLookup:D,nodeOrigin:k,elevateNodesOnSelect:C,fitViewQueued:L,zIndexMode:A}=w(),H=Lp(N,_,D,{nodeOrigin:k,nodeExtent:m,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:A});L&&H?(E(),b({nodes:N,nodesInitialized:H,fitViewQueued:!1,fitViewOptions:void 0})):b({nodes:N,nodesInitialized:H})},setEdges:N=>{const{connectionLookup:_,edgeLookup:D}=w();dw(_,D,N),b({edges:N})},setDefaultNodesAndEdges:(N,_)=>{if(N){const{setNodes:D}=w();D(N),b({hasDefaultNodes:!0})}if(_){const{setEdges:D}=w();D(_),b({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:_,nodeLookup:D,parentLookup:k,domNode:C,nodeOrigin:L,nodeExtent:A,debug:H,fitViewQueued:F,zIndexMode:G}=w(),{changes:q,updatedInternals:V}=_M(N,D,k,C,L,A,G);V&&(bM(D,k,{nodeOrigin:L,nodeExtent:A,zIndexMode:G}),F?(E(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),q?.length>0&&(H&&console.log("React Flow: trigger node changes",q),_?.(q)))},updateNodePositions:(N,_=!1)=>{const D=[];let k=[];const{nodeLookup:C,triggerNodeChanges:L,connection:A,updateConnection:H,onNodesChangeMiddlewareMap:F}=w();for(const[G,q]of N){const V=C.get(G),P=!!(V?.expandParent&&V?.parentId&&q?.position),te={id:G,type:"position",position:P?{x:Math.max(0,q.position.x),y:Math.max(0,q.position.y)}:q.position,dragging:_};if(V&&A.inProgress&&A.fromNode.id===V.id){const O=na(V,A.fromHandle,be.Left,!0);H({...A,from:O})}P&&V.parentId&&D.push({id:G,parentId:V.parentId,rect:{...q.internals.positionAbsolute,width:q.measured.width??0,height:q.measured.height??0}}),k.push(te)}if(D.length>0){const{parentLookup:G,nodeOrigin:q}=w(),V=vm(D,C,G,q);k.push(...V)}for(const G of F.values())k=G(k);L(k)},triggerNodeChanges:N=>{const{onNodesChange:_,setNodes:D,nodes:k,hasDefaultNodes:C,debug:L}=w();if(N?.length){if(C){const A=Cw(N,k);D(A)}L&&console.log("React Flow: trigger node changes",N),_?.(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:_,setEdges:D,edges:k,hasDefaultEdges:C,debug:L}=w();if(N?.length){if(C){const A=Mw(N,k);D(A)}L&&console.log("React Flow: trigger edge changes",N),_?.(N)}},addSelectedNodes:N=>{const{multiSelectionActive:_,edgeLookup:D,nodeLookup:k,triggerNodeChanges:C,triggerEdgeChanges:L}=w();if(_){const A=N.map(H=>Gr(H,!0));C(A);return}C(el(k,new Set([...N]),!0)),L(el(D))},addSelectedEdges:N=>{const{multiSelectionActive:_,edgeLookup:D,nodeLookup:k,triggerNodeChanges:C,triggerEdgeChanges:L}=w();if(_){const A=N.map(H=>Gr(H,!0));L(A);return}L(el(D,new Set([...N]))),C(el(k,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:_}={})=>{const{edges:D,nodes:k,nodeLookup:C,triggerNodeChanges:L,triggerEdgeChanges:A}=w(),H=N||k,F=_||D,G=H.map(V=>{const P=C.get(V.id);return P&&(P.selected=!1),Gr(V.id,!1)}),q=F.map(V=>Gr(V.id,!1));L(G),A(q)},setMinZoom:N=>{const{panZoom:_,maxZoom:D}=w();_?.setScaleExtent([N,D]),b({minZoom:N})},setMaxZoom:N=>{const{panZoom:_,minZoom:D}=w();_?.setScaleExtent([D,N]),b({maxZoom:N})},setTranslateExtent:N=>{w().panZoom?.setTranslateExtent(N),b({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:_,triggerNodeChanges:D,triggerEdgeChanges:k,elementsSelectable:C}=w();if(!C)return;const L=_.reduce((H,F)=>F.selected?[...H,Gr(F.id,!1)]:H,[]),A=N.reduce((H,F)=>F.selected?[...H,Gr(F.id,!1)]:H,[]);D(L),k(A)},setNodeExtent:N=>{const{nodes:_,nodeLookup:D,parentLookup:k,nodeOrigin:C,elevateNodesOnSelect:L,nodeExtent:A,zIndexMode:H}=w();N[0][0]===A[0][0]&&N[0][1]===A[0][1]&&N[1][0]===A[1][0]&&N[1][1]===A[1][1]||(Lp(_,D,k,{nodeOrigin:C,nodeExtent:N,elevateNodesOnSelect:L,checkEquality:!1,zIndexMode:H}),b({nodeExtent:N}))},panBy:N=>{const{transform:_,width:D,height:k,panZoom:C,translateExtent:L}=w();return kM({delta:N,panZoom:C,transform:_,translateExtent:L,width:D,height:k})},setCenter:async(N,_,D)=>{const{width:k,height:C,maxZoom:L,panZoom:A}=w();if(!A)return Promise.resolve(!1);const H=typeof D?.zoom<"u"?D.zoom:L;return await A.setViewport({x:k/2-N*H,y:C/2-_*H,zoom:H},{duration:D?.duration,ease:D?.ease,interpolate:D?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{b({connection:{...Fv}})},updateConnection:N=>{b({connection:N})},reset:()=>b({...Gb()})}},Object.is);function Ww({initialNodes:e,initialEdges:n,defaultNodes:i,defaultEdges:a,initialWidth:s,initialHeight:o,initialMinZoom:u,initialMaxZoom:f,initialFitViewOptions:h,fitView:d,nodeOrigin:g,nodeExtent:m,zIndexMode:x,children:b}){const[w]=Q.useState(()=>qA({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,width:s,height:o,fitView:d,minZoom:u,maxZoom:f,fitViewOptions:h,nodeOrigin:g,nodeExtent:m,zIndexMode:x}));return v.jsx(lT,{value:w,children:v.jsx(TT,{children:b})})}function $A({children:e,nodes:n,edges:i,defaultNodes:a,defaultEdges:s,width:o,height:u,fitView:f,fitViewOptions:h,minZoom:d,maxZoom:g,nodeOrigin:m,nodeExtent:x,zIndexMode:b}){return Q.useContext(nf)?v.jsx(v.Fragment,{children:e}):v.jsx(Ww,{initialNodes:n,initialEdges:i,defaultNodes:a,defaultEdges:s,initialWidth:o,initialHeight:u,fitView:f,initialFitViewOptions:h,initialMinZoom:d,initialMaxZoom:g,nodeOrigin:m,nodeExtent:x,zIndexMode:b,children:e})}const VA={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function PA({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,className:s,nodeTypes:o,edgeTypes:u,onNodeClick:f,onEdgeClick:h,onInit:d,onMove:g,onMoveStart:m,onMoveEnd:x,onConnect:b,onConnectStart:w,onConnectEnd:E,onClickConnectStart:N,onClickConnectEnd:_,onNodeMouseEnter:D,onNodeMouseMove:k,onNodeMouseLeave:C,onNodeContextMenu:L,onNodeDoubleClick:A,onNodeDragStart:H,onNodeDrag:F,onNodeDragStop:G,onNodesDelete:q,onEdgesDelete:V,onDelete:P,onSelectionChange:te,onSelectionDragStart:O,onSelectionDrag:B,onSelectionDragStop:j,onSelectionContextMenu:U,onSelectionStart:Y,onSelectionEnd:K,onBeforeDelete:z,connectionMode:R,connectionLineType:$=wr.Bezier,connectionLineStyle:T,connectionLineComponent:ie,connectionLineContainerStyle:ce,deleteKeyCode:fe="Backspace",selectionKeyCode:he="Shift",selectionOnDrag:ue=!1,selectionMode:me=Ks.Full,panActivationKeyCode:Ee="Space",multiSelectionKeyCode:Ce=Ws()?"Meta":"Control",zoomActivationKeyCode:we=Ws()?"Meta":"Control",snapToGrid:Ne,snapGrid:Re,onlyRenderVisibleElements:Ze=!1,selectNodesOnDrag:Xe,nodesDraggable:ht,autoPanOnNodeFocus:sn,nodesConnectable:Lt,nodesFocusable:Gt,nodeOrigin:Rn=Ew,edgesFocusable:si,edgesReconnectable:oi,elementsSelectable:Et=!0,defaultViewport:Ii=bT,minZoom:ae=.5,maxZoom:pe=2,translateExtent:_e=Qs,preventScrolling:De=!0,nodeExtent:$e,defaultMarkerColor:Vt="#b1b1b7",zoomOnScroll:On=!0,zoomOnPinch:At=!0,panOnScroll:pt=!1,panOnScrollSpeed:Ht=.5,panOnScrollMode:Ke=Jr.Free,zoomOnDoubleClick:Gn=!0,panOnDrag:on=!0,onPaneClick:Sf,onPaneMouseEnter:aa,onPaneMouseMove:la,onPaneMouseLeave:sa,onPaneScroll:ui,onPaneContextMenu:oa,paneClickDistance:_r=1,nodeClickDistance:_f=0,children:So,onReconnect:vl,onReconnectStart:kr,onReconnectEnd:kf,onEdgeContextMenu:_o,onEdgeDoubleClick:ko,onEdgeMouseEnter:Eo,onEdgeMouseMove:wl,onEdgeMouseLeave:Sl,reconnectRadius:No=10,onNodesChange:Co,onEdgesChange:Zn,noDragClassName:Nt="nodrag",noWheelClassName:Bt="nowheel",noPanClassName:ci="nopan",fitView:ua,fitViewOptions:Mo,connectOnClick:Ef,attributionPosition:To,proOptions:Er,defaultEdgeOptions:_l,elevateNodesOnSelect:qi=!0,elevateEdgesOnSelect:$i=!1,disableKeyboardA11y:Vi=!1,autoPanOnConnect:Pi,autoPanOnNodeDrag:yt,autoPanSpeed:Ao,connectionRadius:zo,isValidConnection:fi,onError:Yi,style:Nf,id:kl,nodeDragThreshold:jo,connectionDragThreshold:Cf,viewport:ca,onViewportChange:fa,width:Ln,height:Zt,colorMode:Do="light",debug:Mf,onScroll:da,ariaLabelConfig:Ro,zIndexMode:Nr="basic",...Tf},Qt){const Cr=kl||"1",Oo=_T(Do),El=Q.useCallback(di=>{di.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),da?.(di)},[da]);return v.jsx("div",{"data-testid":"rf__wrapper",...Tf,onScroll:El,style:{...Nf,...VA},ref:Qt,className:_t(["react-flow",s,Oo]),id:kl,role:"application",children:v.jsxs($A,{nodes:e,edges:n,width:Ln,height:Zt,fitView:ua,fitViewOptions:Mo,minZoom:ae,maxZoom:pe,nodeOrigin:Rn,nodeExtent:$e,zIndexMode:Nr,children:[v.jsx(IA,{onInit:d,onNodeClick:f,onEdgeClick:h,onNodeMouseEnter:D,onNodeMouseMove:k,onNodeMouseLeave:C,onNodeContextMenu:L,onNodeDoubleClick:A,nodeTypes:o,edgeTypes:u,connectionLineType:$,connectionLineStyle:T,connectionLineComponent:ie,connectionLineContainerStyle:ce,selectionKeyCode:he,selectionOnDrag:ue,selectionMode:me,deleteKeyCode:fe,multiSelectionKeyCode:Ce,panActivationKeyCode:Ee,zoomActivationKeyCode:we,onlyRenderVisibleElements:Ze,defaultViewport:Ii,translateExtent:_e,minZoom:ae,maxZoom:pe,preventScrolling:De,zoomOnScroll:On,zoomOnPinch:At,zoomOnDoubleClick:Gn,panOnScroll:pt,panOnScrollSpeed:Ht,panOnScrollMode:Ke,panOnDrag:on,onPaneClick:Sf,onPaneMouseEnter:aa,onPaneMouseMove:la,onPaneMouseLeave:sa,onPaneScroll:ui,onPaneContextMenu:oa,paneClickDistance:_r,nodeClickDistance:_f,onSelectionContextMenu:U,onSelectionStart:Y,onSelectionEnd:K,onReconnect:vl,onReconnectStart:kr,onReconnectEnd:kf,onEdgeContextMenu:_o,onEdgeDoubleClick:ko,onEdgeMouseEnter:Eo,onEdgeMouseMove:wl,onEdgeMouseLeave:Sl,reconnectRadius:No,defaultMarkerColor:Vt,noDragClassName:Nt,noWheelClassName:Bt,noPanClassName:ci,rfId:Cr,disableKeyboardA11y:Vi,nodeExtent:$e,viewport:ca,onViewportChange:fa}),v.jsx(ST,{nodes:e,edges:n,defaultNodes:i,defaultEdges:a,onConnect:b,onConnectStart:w,onConnectEnd:E,onClickConnectStart:N,onClickConnectEnd:_,nodesDraggable:ht,autoPanOnNodeFocus:sn,nodesConnectable:Lt,nodesFocusable:Gt,edgesFocusable:si,edgesReconnectable:oi,elementsSelectable:Et,elevateNodesOnSelect:qi,elevateEdgesOnSelect:$i,minZoom:ae,maxZoom:pe,nodeExtent:$e,onNodesChange:Co,onEdgesChange:Zn,snapToGrid:Ne,snapGrid:Re,connectionMode:R,translateExtent:_e,connectOnClick:Ef,defaultEdgeOptions:_l,fitView:ua,fitViewOptions:Mo,onNodesDelete:q,onEdgesDelete:V,onDelete:P,onNodeDragStart:H,onNodeDrag:F,onNodeDragStop:G,onSelectionDrag:B,onSelectionDragStart:O,onSelectionDragStop:j,onMove:g,onMoveStart:m,onMoveEnd:x,noPanClassName:ci,nodeOrigin:Rn,rfId:Cr,autoPanOnConnect:Pi,autoPanOnNodeDrag:yt,autoPanSpeed:Ao,onError:Yi,connectionRadius:zo,isValidConnection:fi,selectNodesOnDrag:Xe,nodeDragThreshold:jo,connectionDragThreshold:Cf,onBeforeDelete:z,debug:Mf,ariaLabelConfig:Ro,zIndexMode:Nr}),v.jsx(xT,{onSelectionChange:te}),So,v.jsx(hT,{proOptions:Er,position:To}),v.jsx(dT,{rfId:Cr,disableKeyboardA11y:Vi})]})})}var YA=Tw(PA);function XA({dimensions:e,lineWidth:n,variant:i,className:a}){return v.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:_t(["react-flow__background-pattern",i,a])})}function FA({radius:e,className:n}){return v.jsx("circle",{cx:e,cy:e,r:e,className:_t(["react-flow__background-pattern","dots",n])})}var Oi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Oi||(Oi={}));const GA={[Oi.Dots]:1,[Oi.Lines]:1,[Oi.Cross]:6},ZA=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function eS({id:e,variant:n=Oi.Dots,gap:i=20,size:a,lineWidth:s=1,offset:o=0,color:u,bgColor:f,style:h,className:d,patternClassName:g}){const m=Q.useRef(null),{transform:x,patternId:b}=Ye(ZA,ut),w=a||GA[n],E=n===Oi.Dots,N=n===Oi.Cross,_=Array.isArray(i)?i:[i,i],D=[_[0]*x[2]||1,_[1]*x[2]||1],k=w*x[2],C=Array.isArray(o)?o:[o,o],L=N?[k,k]:D,A=[C[0]*x[2]||1+L[0]/2,C[1]*x[2]||1+L[1]/2],H=`${b}${e||""}`;return v.jsxs("svg",{className:_t(["react-flow__background",d]),style:{...h,...af,"--xy-background-color-props":f,"--xy-background-pattern-color-props":u},ref:m,"data-testid":"rf__background",children:[v.jsx("pattern",{id:H,x:x[0]%D[0],y:x[1]%D[1],width:D[0],height:D[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:E?v.jsx(FA,{radius:k/2,className:g}):v.jsx(XA,{dimensions:L,lineWidth:s,variant:n,className:g})}),v.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${H})`})]})}eS.displayName="Background";const QA=Q.memo(eS);function KA(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:v.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function JA(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:v.jsx("path",{d:"M0 0h32v4.2H0z"})})}function WA(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:v.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function e3(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function t3(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Wu({children:e,className:n,...i}){return v.jsx("button",{type:"button",className:_t(["react-flow__controls-button",n]),...i,children:e})}const n3=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function tS({style:e,showZoom:n=!0,showFitView:i=!0,showInteractive:a=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:u,onFitView:f,onInteractiveChange:h,className:d,children:g,position:m="bottom-left",orientation:x="vertical","aria-label":b}){const w=ct(),{isInteractive:E,minZoomReached:N,maxZoomReached:_,ariaLabelConfig:D}=Ye(n3,ut),{zoomIn:k,zoomOut:C,fitView:L}=wm(),A=()=>{k(),o?.()},H=()=>{C(),u?.()},F=()=>{L(s),f?.()},G=()=>{w.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),h?.(!E)},q=x==="horizontal"?"horizontal":"vertical";return v.jsxs(rf,{className:_t(["react-flow__controls",q,d]),position:m,style:e,"data-testid":"rf__controls","aria-label":b??D["controls.ariaLabel"],children:[n&&v.jsxs(v.Fragment,{children:[v.jsx(Wu,{onClick:A,className:"react-flow__controls-zoomin",title:D["controls.zoomIn.ariaLabel"],"aria-label":D["controls.zoomIn.ariaLabel"],disabled:_,children:v.jsx(KA,{})}),v.jsx(Wu,{onClick:H,className:"react-flow__controls-zoomout",title:D["controls.zoomOut.ariaLabel"],"aria-label":D["controls.zoomOut.ariaLabel"],disabled:N,children:v.jsx(JA,{})})]}),i&&v.jsx(Wu,{className:"react-flow__controls-fitview",onClick:F,title:D["controls.fitView.ariaLabel"],"aria-label":D["controls.fitView.ariaLabel"],children:v.jsx(WA,{})}),a&&v.jsx(Wu,{className:"react-flow__controls-interactive",onClick:G,title:D["controls.interactive.ariaLabel"],"aria-label":D["controls.interactive.ariaLabel"],children:E?v.jsx(t3,{}):v.jsx(e3,{})}),g]})}tS.displayName="Controls";const i3=Q.memo(tS);function r3({id:e,x:n,y:i,width:a,height:s,style:o,color:u,strokeColor:f,strokeWidth:h,className:d,borderRadius:g,shapeRendering:m,selected:x,onClick:b}){const{background:w,backgroundColor:E}=o||{},N=u||w||E;return v.jsx("rect",{className:_t(["react-flow__minimap-node",{selected:x},d]),x:n,y:i,rx:g,ry:g,width:a,height:s,style:{fill:N,stroke:f,strokeWidth:h},shapeRendering:m,onClick:b?_=>b(_,e):void 0})}const a3=Q.memo(r3),l3=e=>e.nodes.map(n=>n.id),Jh=e=>e instanceof Function?e:()=>e;function s3({nodeStrokeColor:e,nodeColor:n,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:s,nodeComponent:o=a3,onClick:u}){const f=Ye(l3,ut),h=Jh(n),d=Jh(e),g=Jh(i),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return v.jsx(v.Fragment,{children:f.map(x=>v.jsx(u3,{id:x,nodeColorFunc:h,nodeStrokeColorFunc:d,nodeClassNameFunc:g,nodeBorderRadius:a,nodeStrokeWidth:s,NodeComponent:o,onClick:u,shapeRendering:m},x))})}function o3({id:e,nodeColorFunc:n,nodeStrokeColorFunc:i,nodeClassNameFunc:a,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:u,NodeComponent:f,onClick:h}){const{node:d,x:g,y:m,width:x,height:b}=Ye(w=>{const{internals:E}=w.nodeLookup.get(e),N=E.userNode,{x:_,y:D}=E.positionAbsolute,{width:k,height:C}=Bi(N);return{node:N,x:_,y:D,width:k,height:C}},ut);return!d||d.hidden||!ew(d)?null:v.jsx(f,{x:g,y:m,width:x,height:b,style:d.style,selected:!!d.selected,className:a(d),color:n(d),borderRadius:s,strokeColor:i(d),strokeWidth:o,shapeRendering:u,onClick:h,id:d.id})}const u3=Q.memo(o3);var c3=Q.memo(s3);const f3=200,d3=150,h3=e=>!e.hidden,p3=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?Wv(uo(e.nodeLookup,{filter:h3}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},m3="react-flow__minimap-desc";function nS({style:e,className:n,nodeStrokeColor:i,nodeColor:a,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:u,nodeComponent:f,bgColor:h,maskColor:d,maskStrokeColor:g,maskStrokeWidth:m,position:x="bottom-right",onClick:b,onNodeClick:w,pannable:E=!1,zoomable:N=!1,ariaLabel:_,inversePan:D,zoomStep:k=1,offsetScale:C=5}){const L=ct(),A=Q.useRef(null),{boundingRect:H,viewBB:F,rfId:G,panZoom:q,translateExtent:V,flowWidth:P,flowHeight:te,ariaLabelConfig:O}=Ye(p3,ut),B=e?.width??f3,j=e?.height??d3,U=H.width/B,Y=H.height/j,K=Math.max(U,Y),z=K*B,R=K*j,$=C*K,T=H.x-(z-H.width)/2-$,ie=H.y-(R-H.height)/2-$,ce=z+$*2,fe=R+$*2,he=`${m3}-${G}`,ue=Q.useRef(0),me=Q.useRef();ue.current=K,Q.useEffect(()=>{if(A.current&&q)return me.current=DM({domNode:A.current,panZoom:q,getTransform:()=>L.getState().transform,getViewScale:()=>ue.current}),()=>{me.current?.destroy()}},[q]),Q.useEffect(()=>{me.current?.update({translateExtent:V,width:P,height:te,inversePan:D,pannable:E,zoomStep:k,zoomable:N})},[E,N,D,k,V,P,te]);const Ee=b?Ne=>{const[Re,Ze]=me.current?.pointer(Ne)||[0,0];b(Ne,{x:Re,y:Ze})}:void 0,Ce=w?Q.useCallback((Ne,Re)=>{const Ze=L.getState().nodeLookup.get(Re).internals.userNode;w(Ne,Ze)},[]):void 0,we=_??O["minimap.ariaLabel"];return v.jsx(rf,{position:x,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*K:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:_t(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:v.jsxs("svg",{width:B,height:j,viewBox:`${T} ${ie} ${ce} ${fe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":he,ref:A,onClick:Ee,children:[we&&v.jsx("title",{id:he,children:we}),v.jsx(c3,{onClick:Ce,nodeColor:a,nodeStrokeColor:i,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:u,nodeComponent:f}),v.jsx("path",{className:"react-flow__minimap-mask",d:`M${T-$},${ie-$}h${ce+$*2}v${fe+$*2}h${-ce-$*2}z
|
|
15
|
-
M${F.x},${F.y}h${F.width}v${F.height}h${-F.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}nS.displayName="MiniMap";const g3=Q.memo(nS),y3=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,x3={[hl.Line]:"right",[hl.Handle]:"bottom-right"};function b3({nodeId:e,position:n,variant:i=hl.Handle,className:a,style:s=void 0,children:o,color:u,minWidth:f=10,minHeight:h=10,maxWidth:d=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:x,autoScale:b=!0,shouldResize:w,onResizeStart:E,onResize:N,onResizeEnd:_}){const D=Dw(),k=typeof e=="string"?e:D,C=ct(),L=Q.useRef(null),A=i===hl.Handle,H=Ye(Q.useCallback(y3(A&&b),[A,b]),ut),F=Q.useRef(null),G=n??x3[i];Q.useEffect(()=>{if(!(!L.current||!k))return F.current||(F.current=FM({domNode:L.current,nodeId:k,getStoreItems:()=>{const{nodeLookup:V,transform:P,snapGrid:te,snapToGrid:O,nodeOrigin:B,domNode:j}=C.getState();return{nodeLookup:V,transform:P,snapGrid:te,snapToGrid:O,nodeOrigin:B,paneDomNode:j}},onChange:(V,P)=>{const{triggerNodeChanges:te,nodeLookup:O,parentLookup:B,nodeOrigin:j}=C.getState(),U=[],Y={x:V.x,y:V.y},K=O.get(k);if(K&&K.expandParent&&K.parentId){const z=K.origin??j,R=V.width??K.measured.width??0,$=V.height??K.measured.height??0,T={id:K.id,parentId:K.parentId,rect:{width:R,height:$,...tw({x:V.x??K.position.x,y:V.y??K.position.y},{width:R,height:$},K.parentId,O,z)}},ie=vm([T],O,B,j);U.push(...ie),Y.x=V.x?Math.max(z[0]*R,V.x):void 0,Y.y=V.y?Math.max(z[1]*$,V.y):void 0}if(Y.x!==void 0&&Y.y!==void 0){const z={id:k,type:"position",position:{...Y}};U.push(z)}if(V.width!==void 0&&V.height!==void 0){const R={id:k,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:V.width,height:V.height}};U.push(R)}for(const z of P){const R={...z,type:"position"};U.push(R)}te(U)},onEnd:({width:V,height:P})=>{const te={id:k,type:"dimensions",resizing:!1,dimensions:{width:V,height:P}};C.getState().triggerNodeChanges([te])}})),F.current.update({controlPosition:G,boundaries:{minWidth:f,minHeight:h,maxWidth:d,maxHeight:g},keepAspectRatio:m,resizeDirection:x,onResizeStart:E,onResize:N,onResizeEnd:_,shouldResize:w}),()=>{F.current?.destroy()}},[G,f,h,d,g,m,E,N,_,w]);const q=G.split("-");return v.jsx("div",{className:_t(["react-flow__resize-control","nodrag",...q,i,a]),ref:L,style:{...s,scale:H,...u&&{[A?"backgroundColor":"borderColor"]:u}},children:o})}Q.memo(b3);const iS=(...e)=>e.filter((n,i,a)=>!!n&&n.trim()!==""&&a.indexOf(n)===i).join(" ").trim();const v3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const w3=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,a)=>a?a.toUpperCase():i.toLowerCase());const Zb=e=>{const n=w3(e);return n.charAt(0).toUpperCase()+n.slice(1)};var S3={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const _3=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1};const k3=Q.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:s="",children:o,iconNode:u,...f},h)=>Q.createElement("svg",{ref:h,...S3,width:n,height:n,stroke:e,strokeWidth:a?Number(i)*24/Number(n):i,className:iS("lucide",s),...!o&&!_3(f)&&{"aria-hidden":"true"},...f},[...u.map(([d,g])=>Q.createElement(d,g)),...Array.isArray(o)?o:[o]]));const Oe=(e,n)=>{const i=Q.forwardRef(({className:a,...s},o)=>Q.createElement(k3,{ref:o,iconNode:n,className:iS(`lucide-${v3(Zb(e))}`,`lucide-${e}`,a),...s}));return i.displayName=Zb(e),i};const E3=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],N3=Oe("arrow-left",E3);const C3=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],M3=Oe("bot",C3);const T3=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],sf=Oe("chart-column",T3);const A3=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],z3=Oe("check",A3);const j3=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],D3=Oe("chevron-down",j3);const R3=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],O3=Oe("chevron-up",R3);const L3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Up=Oe("circle-alert",L3);const H3=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],rS=Oe("circle-check-big",H3);const B3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],U3=Oe("circle-check",B3);const I3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aS=Oe("circle-x",I3);const q3=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],il=Oe("download",q3);const $3=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],V3=Oe("eye-off",$3);const P3=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],lS=Oe("eye",P3);const Y3=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],rl=Oe("file-text",Y3);const X3=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Qb=Oe("folder-open",X3);const F3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],G3=Oe("globe",F3);const Z3=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],sS=Oe("image",Z3);const Q3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],K3=Oe("info",Q3);const J3=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],W3=Oe("key",J3);const e5=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],t5=Oe("link-2",e5);const n5=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],oS=Oe("loader-circle",n5);const i5=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],r5=Oe("maximize-2",i5);const a5=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],of=Oe("message-square",a5);const l5=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],s5=Oe("minimize-2",l5);const o5=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],_m=Oe("play",o5);const u5=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],km=Oe("plug",u5);const c5=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],f5=Oe("save",c5);const d5=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],h5=Oe("send",d5);const p5=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],m5=Oe("server",p5);const g5=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],y5=Oe("settings-2",g5);const x5=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],uS=Oe("settings",x5);const b5=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],ho=Oe("sparkles",b5);const v5=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],uf=Oe("terminal",v5);const w5=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],cf=Oe("trash-2",w5);const S5=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],_5=Oe("triangle-alert",S5);const k5=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],E5=Oe("upload",k5);const N5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Em=Oe("x",N5);const C5=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],ff=Oe("zap",C5),Kb=e=>{let n;const i=new Set,a=(d,g)=>{const m=typeof d=="function"?d(n):d;if(!Object.is(m,n)){const x=n;n=g??(typeof m!="object"||m===null)?m:Object.assign({},n,m),i.forEach(b=>b(n,x))}},s=()=>n,f={setState:a,getState:s,getInitialState:()=>h,subscribe:d=>(i.add(d),()=>i.delete(d))},h=n=e(a,s,f);return f},M5=(e=>e?Kb(e):Kb),T5=e=>e;function A5(e,n=T5){const i=Ls.useSyncExternalStore(e.subscribe,Ls.useCallback(()=>n(e.getState()),[e,n]),Ls.useCallback(()=>n(e.getInitialState()),[e,n]));return Ls.useDebugValue(i),i}const Jb=e=>{const n=M5(e),i=a=>A5(n,a);return Object.assign(i,n),i},df=(e=>e?Jb(e):Jb);function z5(e,n){let i;try{i=e()}catch{return}return{getItem:s=>{var o;const u=h=>h===null?null:JSON.parse(h,void 0),f=(o=i.getItem(s))!=null?o:null;return f instanceof Promise?f.then(u):u(f)},setItem:(s,o)=>i.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>i.removeItem(s)}}const Ip=e=>n=>{try{const i=e(n);return i instanceof Promise?i:{then(a){return Ip(a)(i)},catch(a){return this}}}catch(i){return{then(a){return this},catch(a){return Ip(a)(i)}}}},j5=(e,n)=>(i,a,s)=>{let o={storage:z5(()=>localStorage),partialize:N=>N,version:0,merge:(N,_)=>({..._,...N}),...n},u=!1,f=0;const h=new Set,d=new Set;let g=o.storage;if(!g)return e((...N)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),i(...N)},a,s);const m=()=>{const N=o.partialize({...a()});return g.setItem(o.name,{state:N,version:o.version})},x=s.setState;s.setState=(N,_)=>(x(N,_),m());const b=e((...N)=>(i(...N),m()),a,s);s.getInitialState=()=>b;let w;const E=()=>{var N,_;if(!g)return;const D=++f;u=!1,h.forEach(C=>{var L;return C((L=a())!=null?L:b)});const k=((_=o.onRehydrateStorage)==null?void 0:_.call(o,(N=a())!=null?N:b))||void 0;return Ip(g.getItem.bind(g))(o.name).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==o.version){if(o.migrate){const L=o.migrate(C.state,C.version);return L instanceof Promise?L.then(A=>[!0,A]):[!0,L]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,C.state];return[!1,void 0]}).then(C=>{var L;if(D!==f)return;const[A,H]=C;if(w=o.merge(H,(L=a())!=null?L:b),i(w,!0),A)return m()}).then(()=>{D===f&&(k?.(w,void 0),w=a(),u=!0,d.forEach(C=>C(w)))}).catch(C=>{D===f&&k?.(void 0,C)})};return s.persist={setOptions:N=>{o={...o,...N},N.storage&&(g=N.storage)},clearStorage:()=>{g?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>E(),hasHydrated:()=>u,onHydrate:N=>(h.add(N),()=>{h.delete(N)}),onFinishHydration:N=>(d.add(N),()=>{d.delete(N)})},o.skipHydration||E(),w||b},cS=j5,D5="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let to=(e=21)=>{let n="",i=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)n+=D5[i[e]&63];return n};const Hi=df()(cS(e=>({nodes:[],edges:[],selectedNodeId:null,workflowId:to(),workflowName:"Untitled Workflow",isDraft:!0,addNode:n=>e(i=>({nodes:[...i.nodes,n]})),updateNode:(n,i)=>e(a=>({nodes:a.nodes.map(s=>s.id===n?{...s,data:{...s.data,...i}}:s)})),updateNodeStatus:(n,i,a)=>e(s=>({nodes:s.nodes.map(o=>o.id===n?{...o,data:{...o.data,status:i,progress:a??o.data.progress}}:o)})),removeNode:n=>e(i=>({nodes:i.nodes.filter(a=>a.id!==n),edges:i.edges.filter(a=>a.source!==n&&a.target!==n),selectedNodeId:i.selectedNodeId===n?null:i.selectedNodeId})),setSelectedNode:n=>e({selectedNodeId:n}),addEdge:n=>e(i=>({edges:[...i.edges,n]})),removeEdge:n=>e(i=>({edges:i.edges.filter(a=>a.id!==n)})),setWorkflowName:n=>e({workflowName:n}),loadWorkflow:n=>e({nodes:n.nodes,edges:n.edges,workflowName:n.name||"Imported Workflow",selectedNodeId:null}),clearWorkflow:()=>e({nodes:[],edges:[],selectedNodeId:null}),newWorkflow:()=>e({nodes:[],edges:[],selectedNodeId:null,workflowId:to(),workflowName:"Untitled Workflow",isDraft:!0}),setNodes:n=>e({nodes:n}),setEdges:n=>e({edges:n})}),{name:"workflow-storage",partialize:e=>({nodes:e.nodes,edges:e.edges,workflowId:e.workflowId,workflowName:e.workflowName})})),fS=e=>e.nodes.find(n=>n.id===e.selectedNodeId),po=df((e,n)=>({isRunning:!1,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:null,endTime:null,workflowResults:[],outputDir:null,logs:[],startExecution:()=>{e({isRunning:!0,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:Date.now(),endTime:null,workflowResults:[],outputDir:null}),n().addLog("info","Workflow execution started")},stopExecution:()=>{e({isRunning:!1,currentNodeId:null,endTime:Date.now()}),n().addLog("info","Workflow execution stopped")},setCurrentNode:i=>{e({currentNodeId:i}),i&&n().addLog("info","Processing node",i)},markNodeCompleted:(i,a)=>{e(s=>{const o=new Set(s.completedNodes);o.add(i);const u=new Map(s.results);return a!==void 0&&u.set(i,a),{completedNodes:o,results:u}}),n().addLog("success","Node completed",i)},markNodeFailed:(i,a)=>{e(s=>{const o=new Set(s.failedNodes);return o.add(i),{failedNodes:o}}),n().addLog("error",a||"Node failed",i)},setWorkflowResults:(i,a)=>{e({workflowResults:i,outputDir:a||null}),i.forEach(s=>{s.result&&e(o=>{const u=new Map(o.results);return u.set(s.nodeId,s.result),{results:u}})})},resetExecution:()=>{e({isRunning:!1,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:null,endTime:null,workflowResults:[],outputDir:null})},addLog:(i,a,s,o)=>{const u={id:to(),timestamp:Date.now(),level:i,message:a,nodeId:s,details:o};e(f=>({logs:[...f.logs,u]}))},clearLogs:()=>e({logs:[]})}));function ge(e,n,i,a,s){if(typeof n=="function"?e!==n||!0:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n.set(e,i),i}function ne(e,n,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!a:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(e):a?a.value:n.get(e)}let dS=function(){const{crypto:e}=globalThis;if(e?.randomUUID)return dS=e.randomUUID.bind(e),e.randomUUID();const n=new Uint8Array(1),i=e?()=>e.getRandomValues(n)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,a=>(+a^i()&15>>+a/4).toString(16))};function no(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}const qp=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){const n=new Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(n.stack=e.stack),e.cause&&!n.cause&&(n.cause=e.cause),e.name&&(n.name=e.name),n}}catch{}try{return new Error(JSON.stringify(e))}catch{}}return new Error(e)};class Te extends Error{}class qt extends Te{constructor(n,i,a,s){super(`${qt.makeMessage(n,i,a)}`),this.status=n,this.headers=s,this.requestID=s?.get("request-id"),this.error=i}static makeMessage(n,i,a){const s=i?.message?typeof i.message=="string"?i.message:JSON.stringify(i.message):i?JSON.stringify(i):a;return n&&s?`${n} ${s}`:n?`${n} status code (no body)`:s||"(no status code or body)"}static generate(n,i,a,s){if(!n||!s)return new hf({message:a,cause:qp(i)});const o=i;return n===400?new pS(n,o,a,s):n===401?new mS(n,o,a,s):n===403?new gS(n,o,a,s):n===404?new yS(n,o,a,s):n===409?new xS(n,o,a,s):n===422?new bS(n,o,a,s):n===429?new vS(n,o,a,s):n>=500?new wS(n,o,a,s):new qt(n,o,a,s)}}class Pn extends qt{constructor({message:n}={}){super(void 0,void 0,n||"Request was aborted.",void 0)}}class hf extends qt{constructor({message:n,cause:i}){super(void 0,void 0,n||"Connection error.",void 0),i&&(this.cause=i)}}class hS extends hf{constructor({message:n}={}){super({message:n??"Request timed out."})}}class pS extends qt{}class mS extends qt{}class gS extends qt{}class yS extends qt{}class xS extends qt{}class bS extends qt{}class vS extends qt{}class wS extends qt{}const R5=/^[a-z][a-z0-9+.-]*:/i,O5=e=>R5.test(e);let $p=e=>($p=Array.isArray,$p(e)),Wb=$p;function Vp(e){return typeof e!="object"?{}:e??{}}function L5(e){if(!e)return!0;for(const n in e)return!1;return!0}function H5(e,n){return Object.prototype.hasOwnProperty.call(e,n)}const B5=(e,n)=>{if(typeof n!="number"||!Number.isInteger(n))throw new Te(`${e} must be an integer`);if(n<0)throw new Te(`${e} must be a positive integer`);return n},SS=e=>{try{return JSON.parse(e)}catch{return}},U5=e=>new Promise(n=>setTimeout(n,e)),Qa="0.71.2",I5=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function q5(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const $5=()=>{const e=q5();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":t1(Deno.build.os),"X-Stainless-Arch":e1(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":t1(globalThis.process.platform??"unknown"),"X-Stainless-Arch":e1(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const n=V5();return n?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${n.browser}`,"X-Stainless-Runtime-Version":n.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function V5(){if(typeof navigator>"u"||!navigator)return null;const e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:n,pattern:i}of e){const a=i.exec(navigator.userAgent);if(a){const s=a[1]||0,o=a[2]||0,u=a[3]||0;return{browser:n,version:`${s}.${o}.${u}`}}}return null}const e1=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",t1=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown");let n1;const P5=()=>n1??(n1=$5());function Y5(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function _S(...e){const n=globalThis.ReadableStream;if(typeof n>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new n(...e)}function kS(e){let n=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return _S({start(){},async pull(i){const{done:a,value:s}=await n.next();a?i.close():i.enqueue(s)},async cancel(){await n.return?.()}})}function Nm(e){if(e[Symbol.asyncIterator])return e;const n=e.getReader();return{async next(){try{const i=await n.read();return i?.done&&n.releaseLock(),i}catch(i){throw n.releaseLock(),i}},async return(){const i=n.cancel();return n.releaseLock(),await i,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function X5(e){if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}const n=e.getReader(),i=n.cancel();n.releaseLock(),await i}const F5=({headers:e,body:n})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(n)});function G5(e){let n=0;for(const s of e)n+=s.length;const i=new Uint8Array(n);let a=0;for(const s of e)i.set(s,a),a+=s.length;return i}let i1;function Cm(e){let n;return(i1??(n=new globalThis.TextEncoder,i1=n.encode.bind(n)))(e)}let r1;function a1(e){let n;return(r1??(n=new globalThis.TextDecoder,r1=n.decode.bind(n)))(e)}var yn,xn;class mo{constructor(){yn.set(this,void 0),xn.set(this,void 0),ge(this,yn,new Uint8Array),ge(this,xn,null)}decode(n){if(n==null)return[];const i=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?Cm(n):n;ge(this,yn,G5([ne(this,yn,"f"),i]));const a=[];let s;for(;(s=Z5(ne(this,yn,"f"),ne(this,xn,"f")))!=null;){if(s.carriage&&ne(this,xn,"f")==null){ge(this,xn,s.index);continue}if(ne(this,xn,"f")!=null&&(s.index!==ne(this,xn,"f")+1||s.carriage)){a.push(a1(ne(this,yn,"f").subarray(0,ne(this,xn,"f")-1))),ge(this,yn,ne(this,yn,"f").subarray(ne(this,xn,"f"))),ge(this,xn,null);continue}const o=ne(this,xn,"f")!==null?s.preceding-1:s.preceding,u=a1(ne(this,yn,"f").subarray(0,o));a.push(u),ge(this,yn,ne(this,yn,"f").subarray(s.index)),ge(this,xn,null)}return a}flush(){return ne(this,yn,"f").length?this.decode(`
|
|
16
|
-
`):[]}}yn=new WeakMap,xn=new WeakMap;
|
|
17
|
-
`,"\r"]);
|
|
18
|
-
`);a.enqueue(u)}catch(
|
|
19
|
-
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],
|
|
20
|
-
${
|
|
14
|
+
`)),g=d.reduce((m,x)=>m.concat(...x),[]);return[d,g]}return[[],[]]},[e]);return Q.useEffect(()=>{const h=n?.target??Db,d=n?.actInsideInputWithModifier??!0;if(e!==null){const g=b=>{if(o.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!o.current||o.current&&!d)&&aw(b))return!1;const E=Ob(b.code,f);if(s.current.add(b[E]),Rb(u,s.current,!1)){const N=b.composedPath?.()?.[0]||b.target,_=N?.nodeName==="BUTTON"||N?.nodeName==="A";n.preventDefault!==!1&&(o.current||!_)&&b.preventDefault(),a(!0)}},m=b=>{const w=Ob(b.code,f);Rb(u,s.current,!0)?(a(!1),s.current.clear()):s.current.delete(b[w]),b.key==="Meta"&&s.current.clear(),o.current=!1},x=()=>{s.current.clear(),a(!1)};return h?.addEventListener("keydown",g),h?.addEventListener("keyup",m),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{h?.removeEventListener("keydown",g),h?.removeEventListener("keyup",m),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[e,a]),i}function Rb(e,n,i){return e.filter(a=>i||a.length===n.size).some(a=>a.every(o=>n.has(o)))}function Ob(e,n){return n.includes(e)?"code":"key"}const kT=()=>{const e=ct();return Q.useMemo(()=>({zoomIn:n=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomOut:n=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1/1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomTo:(n,i)=>{const{panZoom:a}=e.getState();return a?a.scaleTo(n,{duration:i?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(n,i)=>{const{transform:[a,o,s],panZoom:u}=e.getState();return u?(await u.setViewport({x:n.x??a,y:n.y??o,zoom:n.zoom??s},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[n,i,a]=e.getState().transform;return{x:n,y:i,zoom:a}},setCenter:async(n,i,a)=>e.getState().setCenter(n,i,a),fitBounds:async(n,i)=>{const{width:a,height:o,minZoom:s,maxZoom:u,panZoom:f}=e.getState(),h=pm(n,a,o,s,u,i?.padding??.1);return f?(await f.setViewport(h,{duration:i?.duration,ease:i?.ease,interpolate:i?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(n,i={})=>{const{transform:a,snapGrid:o,snapToGrid:s,domNode:u}=e.getState();if(!u)return n;const{x:f,y:h}=u.getBoundingClientRect(),d={x:n.x-f,y:n.y-h},g=i.snapGrid??o,m=i.snapToGrid??s;return ps(d,a,m,g)},flowToScreenPosition:n=>{const{transform:i,domNode:a}=e.getState();if(!a)return n;const{x:o,y:s}=a.getBoundingClientRect(),u=Uc(n,i);return{x:u.x+o,y:u.y+s}}}),[])};function Mw(e,n){const i=[],a=new Map,o=[];for(const s of e)if(s.type==="add"){o.push(s);continue}else if(s.type==="remove"||s.type==="replace")a.set(s.id,[s]);else{const u=a.get(s.id);u?u.push(s):a.set(s.id,[s])}for(const s of n){const u=a.get(s.id);if(!u){i.push(s);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){i.push({...u[0].item});continue}const f={...s};for(const h of u)ET(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 ET(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function Tw(e,n){return Mw(e,n)}function Aw(e,n){return Mw(e,n)}function Gr(e,n){return{id:e,type:"select",selected:n}}function tl(e,n=new Set,i=!1){const a=[];for(const[o,s]of e){const u=n.has(o);!(s.selected===void 0&&!u)&&s.selected!==u&&(i&&(s.selected=u),a.push(Gr(s.id,u)))}return a}function Lb({items:e=[],lookup:n}){const i=[],a=new Map(e.map(o=>[o.id,o]));for(const[o,s]of e.entries()){const u=n.get(s.id),f=u?.internals?.userNode??u;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)a.get(o)===void 0&&i.push({id:o,type:"remove"});return i}function Hb(e){return{id:e.id,type:"remove"}}const Bb=e=>Q4(e),NT=e=>Kv(e);function zw(e){return Q.forwardRef(e)}const CT=typeof window<"u"?Q.useLayoutEffect:Q.useEffect;function Ub(e){const[n,i]=Q.useState(BigInt(0)),[a]=Q.useState(()=>MT(()=>i(o=>o+BigInt(1))));return CT(()=>{const o=a.get();o.length&&(e(o),a.reset())},[n]),a}function MT(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:i=>{n.push(i),e()}}}const jw=Q.createContext(null);function TT({children:e}){const n=ct(),i=Q.useCallback(f=>{const{nodes:h=[],setNodes:d,hasDefaultNodes:g,onNodesChange:m,nodeLookup:x,fitViewQueued:b,onNodesChangeMiddlewareMap:w}=n.getState();let E=h;for(const _ of f)E=typeof _=="function"?_(E):_;let N=Lb({items:E,lookup:x});for(const _ of w.values())N=_(N);g&&d(E),N.length>0?m?.(N):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:_,nodes:D,setNodes:k}=n.getState();_&&k(D)})},[]),a=Ub(i),o=Q.useCallback(f=>{const{edges:h=[],setEdges:d,hasDefaultEdges:g,onEdgesChange:m,edgeLookup:x}=n.getState();let b=h;for(const w of f)b=typeof w=="function"?w(b):w;g?d(b):m&&m(Lb({items:b,lookup:x}))},[]),s=Ub(o),u=Q.useMemo(()=>({nodeQueue:a,edgeQueue:s}),[]);return v.jsx(jw.Provider,{value:u,children:e})}function AT(){const e=Q.useContext(jw);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const zT=e=>!!e.panZoom;function wm(){const e=kT(),n=ct(),i=AT(),a=Ye(zT),o=Q.useMemo(()=>{const s=m=>n.getState().nodeLookup.get(m),u=m=>{i.nodeQueue.push(m)},f=m=>{i.edgeQueue.push(m)},h=m=>{const{nodeLookup:x,nodeOrigin:b}=n.getState(),w=Bb(m)?m:x.get(m.id),E=w.parentId?iw(w.position,w.measured,w.parentId,x,b):w.position,N={...w,position:E,width:w.measured?.width??w.width,height:w.measured?.height??w.height};return dl(N)},d=(m,x,b={replace:!1})=>{u(w=>w.map(E=>{if(E.id===m){const N=typeof x=="function"?x(E):x;return b.replace&&Bb(N)?N:{...E,...N}}return E}))},g=(m,x,b={replace:!1})=>{f(w=>w.map(E=>{if(E.id===m){const N=typeof x=="function"?x(E):x;return b.replace&&NT(N)?N:{...E,...N}}return E}))};return{getNodes:()=>n.getState().nodes.map(m=>({...m})),getNode:m=>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:u,setEdges:f,addNodes:m=>{const x=Array.isArray(m)?m:[m];i.nodeQueue.push(b=>[...b,...x])},addEdges:m=>{const x=Array.isArray(m)?m:[m];i.edgeQueue.push(b=>[...b,...x])},toObject:()=>{const{nodes:m=[],edges:x=[],transform:b}=n.getState(),[w,E,N]=b;return{nodes:m.map(_=>({..._})),edges:x.map(_=>({..._})),viewport:{x:w,y:E,zoom:N}}},deleteElements:async({nodes:m=[],edges:x=[]})=>{const{nodes:b,edges:w,onNodesDelete:E,onEdgesDelete:N,triggerNodeChanges:_,triggerEdgeChanges:D,onDelete:k,onBeforeDelete:C}=n.getState(),{nodes:L,edges:A}=await tM({nodesToRemove:m,edgesToRemove:x,nodes:b,edges:w,onBeforeDelete:C}),H=A.length>0,F=L.length>0;if(H){const G=A.map(Hb);N?.(A),D(G)}if(F){const G=L.map(Hb);E?.(L),_(G)}return(F||H)&&k?.({nodes:L,edges:A}),{deletedNodes:L,deletedEdges:A}},getIntersectingNodes:(m,x=!0,b)=>{const w=cb(m),E=w?m:h(m),N=b!==void 0;return E?(b||n.getState().nodes).filter(_=>{const D=n.getState().nodeLookup.get(_.id);if(D&&!w&&(_.id===m.id||!D.internals.positionAbsolute))return!1;const k=dl(N?_:D),C=ts(k,E);return x&&C>0||C>=k.width*k.height||C>=E.width*E.height}):[]},isNodeIntersecting:(m,x,b=!0)=>{const E=cb(m)?m:h(m);if(!E)return!1;const N=ts(E,x);return b&&N>0||N>=x.width*x.height||N>=E.width*E.height},updateNode:d,updateNodeData:(m,x,b={replace:!1})=>{d(m,w=>{const E=typeof x=="function"?x(w):x;return b.replace?{...w,data:E}:{...w,data:{...w.data,...E}}},b)},updateEdge:g,updateEdgeData:(m,x,b={replace:!1})=>{g(m,w=>{const E=typeof x=="function"?x(w):x;return b.replace?{...w,data:E}:{...w,data:{...w.data,...E}}},b)},getNodesBounds:m=>{const{nodeLookup:x,nodeOrigin:b}=n.getState();return K4(m,{nodeLookup:x,nodeOrigin:b})},getHandleConnections:({type:m,id:x,nodeId:b})=>Array.from(n.getState().connectionLookup.get(`${b}-${m}${x?`-${x}`:""}`)?.values()??[]),getNodeConnections:({type:m,handleId:x,nodeId:b})=>Array.from(n.getState().connectionLookup.get(`${b}${m?x?`-${m}-${x}`:`-${m}`:""}`)?.values()??[]),fitView:async m=>{const x=n.getState().fitViewResolver??aM();return n.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:x}),i.nodeQueue.push(b=>[...b]),x.promise}}},[]);return Q.useMemo(()=>({...o,...e,viewportInitialized:a}),[a])}const Ib=e=>e.selected,jT=typeof window<"u"?window:void 0;function DT({deleteKeyCode:e,multiSelectionKeyCode:n}){const i=ct(),{deleteElements:a}=wm(),o=is(e,{actInsideInputWithModifier:!1}),s=is(n,{target:jT});Q.useEffect(()=>{if(o){const{edges:u,nodes:f}=i.getState();a({nodes:f.filter(Ib),edges:u.filter(Ib)}),i.setState({nodesSelectionActive:!1})}},[o]),Q.useEffect(()=>{i.setState({multiSelectionActive:s})},[s])}function RT(e){const n=ct();Q.useEffect(()=>{const i=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const a=mm(e.current);(a.height===0||a.width===0)&&n.getState().onError?.("004",ri.error004()),n.setState({width:a.width||500,height:a.height||500})};if(e.current){i(),window.addEventListener("resize",i);const a=new ResizeObserver(()=>i());return a.observe(e.current),()=>{window.removeEventListener("resize",i),a&&e.current&&a.unobserve(e.current)}}},[])}const lf={position:"absolute",width:"100%",height:"100%",top:0,left:0},OT=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function LT({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:o=.5,panOnScrollMode:s=Jr.Free,zoomOnDoubleClick:u=!0,panOnDrag:f=!0,defaultViewport:h,translateExtent:d,minZoom:g,maxZoom:m,zoomActivationKeyCode:x,preventScrolling:b=!0,children:w,noWheelClassName:E,noPanClassName:N,onViewportChange:_,isControlledViewport:D,paneClickDistance:k,selectionOnDrag:C}){const L=ct(),A=Q.useRef(null),{userSelectionActive:H,lib:F,connectionInProgress:G}=Ye(OT,ut),q=is(x),V=Q.useRef();RT(A);const P=Q.useCallback(te=>{_?.({x:te[0],y:te[1],zoom:te[2]}),D||L.setState({transform:te})},[_,D]);return Q.useEffect(()=>{if(A.current){V.current=qM({domNode:A.current,minZoom:g,maxZoom:m,translateExtent:d,viewport:h,onDraggingChange:j=>L.setState({paneDragging:j}),onPanZoomStart:(j,U)=>{const{onViewportChangeStart:Y,onMoveStart:K}=L.getState();K?.(j,U),Y?.(U)},onPanZoom:(j,U)=>{const{onViewportChange:Y,onMove:K}=L.getState();K?.(j,U),Y?.(U)},onPanZoomEnd:(j,U)=>{const{onViewportChangeEnd:Y,onMoveEnd:K}=L.getState();K?.(j,U),Y?.(U)}});const{x:te,y:O,zoom:B}=V.current.getViewport();return L.setState({panZoom:V.current,transform:[te,O,B],domNode:A.current.closest(".react-flow")}),()=>{V.current?.destroy()}}},[]),Q.useEffect(()=>{V.current?.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:i,panOnScroll:a,panOnScrollSpeed:o,panOnScrollMode:s,zoomOnDoubleClick:u,panOnDrag:f,zoomActivationKeyPressed:q,preventScrolling:b,noPanClassName:N,userSelectionActive:H,noWheelClassName:E,lib:F,onTransformChange:P,connectionInProgress:G,selectionOnDrag:C,paneClickDistance:k})},[e,n,i,a,o,s,u,f,q,b,N,H,E,F,P,G,C,k]),v.jsx("div",{className:"react-flow__renderer",ref:A,style:lf,children:w})}const HT=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function BT(){const{userSelectionActive:e,userSelectionRect:n}=Ye(HT,ut);return e&&n?v.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Kh=(e,n)=>i=>{i.target===n.current&&e?.(i)},UT=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function IT({isSelecting:e,selectionKeyPressed:n,selectionMode:i=es.Full,panOnDrag:a,paneClickDistance:o,selectionOnDrag:s,onSelectionStart:u,onSelectionEnd:f,onPaneClick:h,onPaneContextMenu:d,onPaneScroll:g,onPaneMouseEnter:m,onPaneMouseMove:x,onPaneMouseLeave:b,children:w}){const E=ct(),{userSelectionActive:N,elementsSelectable:_,dragging:D,connectionInProgress:k}=Ye(UT,ut),C=_&&(e||N),L=Q.useRef(null),A=Q.useRef(),H=Q.useRef(new Set),F=Q.useRef(new Set),G=Q.useRef(!1),q=Y=>{if(G.current||k){G.current=!1;return}h?.(Y),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},V=Y=>{if(Array.isArray(a)&&a?.includes(2)){Y.preventDefault();return}d?.(Y)},P=g?Y=>g(Y):void 0,te=Y=>{G.current&&(Y.stopPropagation(),G.current=!1)},O=Y=>{const{domNode:K}=E.getState();if(A.current=K?.getBoundingClientRect(),!A.current)return;const z=Y.target===L.current;if(!z&&!!Y.target.closest(".nokey")||!e||!(s&&z||n)||Y.button!==0||!Y.isPrimary)return;Y.target?.setPointerCapture?.(Y.pointerId),G.current=!1;const{x:T,y:ie}=Vn(Y.nativeEvent,A.current);E.setState({userSelectionRect:{width:0,height:0,startX:T,startY:ie,x:T,y:ie}}),z||(Y.stopPropagation(),Y.preventDefault())},B=Y=>{const{userSelectionRect:K,transform:z,nodeLookup:R,edgeLookup:$,connectionLookup:T,triggerNodeChanges:ie,triggerEdgeChanges:ce,defaultEdgeOptions:fe,resetSelectedElements:he}=E.getState();if(!A.current||!K)return;const{x:ue,y:me}=Vn(Y.nativeEvent,A.current),{startX:Ee,startY:Ce}=K;if(!G.current){const Xe=n?0:o;if(Math.hypot(ue-Ee,me-Ce)<=Xe)return;he(),u?.(Y)}G.current=!0;const we={startX:Ee,startY:Ce,x:ue<Ee?ue:Ee,y:me<Ce?me:Ce,width:Math.abs(ue-Ee),height:Math.abs(me-Ce)},Ne=H.current,Re=F.current;H.current=new Set(hm(R,we,z,i===es.Partial,!0).map(Xe=>Xe.id)),F.current=new Set;const Ze=fe?.selectable??!0;for(const Xe of H.current){const ht=T.get(Xe);if(ht)for(const{edgeId:on}of ht.values()){const Lt=$.get(on);Lt&&(Lt.selectable??Ze)&&F.current.add(on)}}if(!fb(Ne,H.current)){const Xe=tl(R,H.current,!0);ie(Xe)}if(!fb(Re,F.current)){const Xe=tl($,F.current);ce(Xe)}E.setState({userSelectionRect:we,userSelectionActive:!0,nodesSelectionActive:!1})},j=Y=>{Y.button===0&&(Y.target?.releasePointerCapture?.(Y.pointerId),!N&&Y.target===L.current&&E.getState().userSelectionRect&&q?.(Y),E.setState({userSelectionActive:!1,userSelectionRect:null}),G.current&&(f?.(Y),E.setState({nodesSelectionActive:H.current.size>0})))},U=a===!0||Array.isArray(a)&&a.includes(0);return v.jsxs("div",{className:_t(["react-flow__pane",{draggable:U,dragging:D,selection:e}]),onClick:C?void 0:Kh(q,L),onContextMenu:Kh(V,L),onWheel:Kh(P,L),onPointerEnter:C?void 0:m,onPointerMove:C?B:x,onPointerUp:C?j:void 0,onPointerDownCapture:C?O:void 0,onClickCapture:C?te:void 0,onPointerLeave:b,ref:L,style:lf,children:[w,v.jsx(BT,{})]})}function Bp({id:e,store:n,unselect:i=!1,nodeRef:a}){const{addSelectedNodes:o,unselectNodesAndEdges:s,multiSelectionActive:u,nodeLookup:f,onError:h}=n.getState(),d=f.get(e);if(!d){h?.("012",ri.error012(e));return}n.setState({nodesSelectionActive:!1}),d.selected?(i||d.selected&&u)&&(s({nodes:[d],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):o([e])}function Dw({nodeRef:e,disabled:n=!1,noDragClassName:i,handleSelector:a,nodeId:o,isSelectable:s,nodeClickDistance:u}){const f=ct(),[h,d]=Q.useState(!1),g=Q.useRef();return Q.useEffect(()=>{g.current=CM({getStoreItems:()=>f.getState(),onNodeMouseDown:m=>{Bp({id:m,store:f,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),Q.useEffect(()=>{if(n)g.current?.destroy();else if(e.current)return g.current?.update({noDragClassName:i,handleSelector:a,domNode:e.current,isSelectable:s,nodeId:o,nodeClickDistance:u}),()=>{g.current?.destroy()}},[i,a,n,s,e,o]),h}const qT=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function Rw(){const e=ct();return Q.useCallback(i=>{const{nodeExtent:a,snapToGrid:o,snapGrid:s,nodesDraggable:u,onError:f,updateNodePositions:h,nodeLookup:d,nodeOrigin:g}=e.getState(),m=new Map,x=qT(u),b=o?s[0]:5,w=o?s[1]:5,E=i.direction.x*b*i.factor,N=i.direction.y*w*i.factor;for(const[,_]of d){if(!x(_))continue;let D={x:_.internals.positionAbsolute.x+E,y:_.internals.positionAbsolute.y+N};o&&(D=hs(D,s));const{position:k,positionAbsolute:C}=Jv({nodeId:_.id,nextPosition:D,nodeLookup:d,nodeExtent:a,nodeOrigin:g,onError:f});_.position=k,_.internals.positionAbsolute=C,m.set(_.id,_)}h(m)},[])}const Sm=Q.createContext(null),$T=Sm.Provider;Sm.Consumer;const Ow=()=>Q.useContext(Sm),VT=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),PT=(e,n,i)=>a=>{const{connectionClickStartHandle:o,connectionMode:s,connection:u}=a,{fromHandle:f,toHandle:h,isValid:d}=u,g=h?.nodeId===e&&h?.id===n&&h?.type===i;return{connectingFrom:f?.nodeId===e&&f?.id===n&&f?.type===i,connectingTo:g,clickConnecting:o?.nodeId===e&&o?.id===n&&o?.type===i,isPossibleEndHandle:s===cl.Strict?f?.type!==i:e!==f?.nodeId||n!==f?.id,connectionInProcess:!!f,clickConnectionInProcess:!!o,valid:g&&d}};function YT({type:e="source",position:n=be.Top,isValidConnection:i,isConnectable:a=!0,isConnectableStart:o=!0,isConnectableEnd:s=!0,id:u,onConnect:f,children:h,className:d,onMouseDown:g,onTouchStart:m,...x},b){const w=u||null,E=e==="target",N=ct(),_=Ow(),{connectOnClick:D,noPanClassName:k,rfId:C}=Ye(VT,ut),{connectingFrom:L,connectingTo:A,clickConnecting:H,isPossibleEndHandle:F,connectionInProcess:G,clickConnectionInProcess:q,valid:V}=Ye(PT(_,w,e),ut);_||N.getState().onError?.("010",ri.error010());const P=B=>{const{defaultEdgeOptions:j,onConnect:U,hasDefaultEdges:Y}=N.getState(),K={...j,...B};if(Y){const{edges:z,setEdges:R}=N.getState();R(cw(K,z))}U?.(K),f?.(K)},te=B=>{if(!_)return;const j=lw(B.nativeEvent);if(o&&(j&&B.button===0||!j)){const U=N.getState();Hp.onPointerDown(B.nativeEvent,{handleDomNode:B.currentTarget,autoPanOnConnect:U.autoPanOnConnect,connectionMode:U.connectionMode,connectionRadius:U.connectionRadius,domNode:U.domNode,nodeLookup:U.nodeLookup,lib:U.lib,isTarget:E,handleId:w,nodeId:_,flowId:U.rfId,panBy:U.panBy,cancelConnection:U.cancelConnection,onConnectStart:U.onConnectStart,onConnectEnd:U.onConnectEnd,updateConnection:U.updateConnection,onConnect:P,isValidConnection:i||U.isValidConnection,getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:U.autoPanSpeed,dragThreshold:U.connectionDragThreshold})}j?g?.(B):m?.(B)},O=B=>{const{onClickConnectStart:j,onClickConnectEnd:U,connectionClickStartHandle:Y,connectionMode:K,isValidConnection:z,lib:R,rfId:$,nodeLookup:T,connection:ie}=N.getState();if(!_||!Y&&!o)return;if(!Y){j?.(B.nativeEvent,{nodeId:_,handleId:w,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:_,type:e,id:w}});return}const ce=rw(B.target),fe=i||z,{connection:he,isValid:ue}=Hp.isValid(B.nativeEvent,{handle:{nodeId:_,id:w,type:e},connectionMode:K,fromNodeId:Y.nodeId,fromHandleId:Y.id||null,fromType:Y.type,isValidConnection:fe,flowId:$,doc:ce,lib:R,nodeLookup:T});ue&&he&&P(he);const me=structuredClone(ie);delete me.inProgress,me.toPosition=me.toHandle?me.toHandle.position:null,U?.(B,me),N.setState({connectionClickStartHandle:null})};return v.jsx("div",{"data-handleid":w,"data-nodeid":_,"data-handlepos":n,"data-id":`${C}-${_}-${w}-${e}`,className:_t(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",k,d,{source:!E,target:E,connectable:a,connectablestart:o,connectableend:s,clickconnecting:H,connectingfrom:L,connectingto:A,valid:V,connectionindicator:a&&(!G||F)&&(G||q?s:o)}]),onMouseDown:te,onTouchStart:te,onClick:D?O:void 0,ref:b,...x,children:h})}const ml=Q.memo(zw(YT));function XT({data:e,isConnectable:n,sourcePosition:i=be.Bottom}){return v.jsxs(v.Fragment,{children:[e?.label,v.jsx(ml,{type:"source",position:i,isConnectable:n})]})}function FT({data:e,isConnectable:n,targetPosition:i=be.Top,sourcePosition:a=be.Bottom}){return v.jsxs(v.Fragment,{children:[v.jsx(ml,{type:"target",position:i,isConnectable:n}),e?.label,v.jsx(ml,{type:"source",position:a,isConnectable:n})]})}function GT(){return null}function ZT({data:e,isConnectable:n,targetPosition:i=be.Top}){return v.jsxs(v.Fragment,{children:[v.jsx(ml,{type:"target",position:i,isConnectable:n}),e?.label]})}const Ic={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},qb={input:XT,default:FT,output:ZT,group:GT};function QT(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const KT=e=>{const{width:n,height:i,x:a,y:o}=ds(e.nodeLookup,{filter:s=>!!s.selected});return{width:$n(n)?n:null,height:$n(i)?i:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${a}px,${o}px)`}};function JT({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:i}){const a=ct(),{width:o,height:s,transformString:u,userSelectionActive:f}=Ye(KT,ut),h=Rw(),d=Q.useRef(null);if(Q.useEffect(()=>{i||d.current?.focus({preventScroll:!0})},[i]),Dw({nodeRef:d}),f||!o||!s)return null;const g=e?x=>{const b=a.getState().nodes.filter(w=>w.selected);e(x,b)}:void 0,m=x=>{Object.prototype.hasOwnProperty.call(Ic,x.key)&&(x.preventDefault(),h({direction:Ic[x.key],factor:x.shiftKey?4:1}))};return v.jsx("div",{className:_t(["react-flow__nodesselection","react-flow__container",n]),style:{transform:u},children:v.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:i?void 0:-1,onKeyDown:i?void 0:m,style:{width:o,height:s}})})}const $b=typeof window<"u"?window:void 0,WT=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Lw({children:e,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:u,paneClickDistance:f,deleteKeyCode:h,selectionKeyCode:d,selectionOnDrag:g,selectionMode:m,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:w,panActivationKeyCode:E,zoomActivationKeyCode:N,elementsSelectable:_,zoomOnScroll:D,zoomOnPinch:k,panOnScroll:C,panOnScrollSpeed:L,panOnScrollMode:A,zoomOnDoubleClick:H,panOnDrag:F,defaultViewport:G,translateExtent:q,minZoom:V,maxZoom:P,preventScrolling:te,onSelectionContextMenu:O,noWheelClassName:B,noPanClassName:j,disableKeyboardA11y:U,onViewportChange:Y,isControlledViewport:K}){const{nodesSelectionActive:z,userSelectionActive:R}=Ye(WT,ut),$=is(d,{target:$b}),T=is(E,{target:$b}),ie=T||F,ce=T||C,fe=g&&ie!==!0,he=$||R||fe;return DT({deleteKeyCode:h,multiSelectionKeyCode:w}),v.jsx(LT,{onPaneContextMenu:s,elementsSelectable:_,zoomOnScroll:D,zoomOnPinch:k,panOnScroll:ce,panOnScrollSpeed:L,panOnScrollMode:A,zoomOnDoubleClick:H,panOnDrag:!$&&ie,defaultViewport:G,translateExtent:q,minZoom:V,maxZoom:P,zoomActivationKeyCode:N,preventScrolling:te,noWheelClassName:B,noPanClassName:j,onViewportChange:Y,isControlledViewport:K,paneClickDistance:f,selectionOnDrag:fe,children:v.jsxs(IT,{onSelectionStart:x,onSelectionEnd:b,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:u,panOnDrag:ie,isSelecting:!!he,selectionMode:m,selectionKeyPressed:$,paneClickDistance:f,selectionOnDrag:fe,children:[e,z&&v.jsx(JT,{onSelectionContextMenu:O,noPanClassName:j,disableKeyboardA11y:U})]})})}Lw.displayName="FlowRenderer";const eA=Q.memo(Lw),tA=e=>n=>e?hm(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(i=>i.id):Array.from(n.nodeLookup.keys());function nA(e){return Ye(Q.useCallback(tA(e),[e]),ut)}const iA=e=>e.updateNodeInternals;function rA(){const e=Ye(iA),[n]=Q.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const a=new Map;i.forEach(o=>{const s=o.target.getAttribute("data-id");a.set(s,{id:s,nodeElement:o.target,force:!0})}),e(a)}));return Q.useEffect(()=>()=>{n?.disconnect()},[n]),n}function aA({node:e,nodeType:n,hasDimensions:i,resizeObserver:a}){const o=ct(),s=Q.useRef(null),u=Q.useRef(null),f=Q.useRef(e.sourcePosition),h=Q.useRef(e.targetPosition),d=Q.useRef(n),g=i&&!!e.internals.handleBounds;return Q.useEffect(()=>{s.current&&!e.hidden&&(!g||u.current!==s.current)&&(u.current&&a?.unobserve(u.current),a?.observe(s.current),u.current=s.current)},[g,e.hidden]),Q.useEffect(()=>()=>{u.current&&(a?.unobserve(u.current),u.current=null)},[]),Q.useEffect(()=>{if(s.current){const m=d.current!==n,x=f.current!==e.sourcePosition,b=h.current!==e.targetPosition;(m||x||b)&&(d.current=n,f.current=e.sourcePosition,h.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),s}function lA({id:e,onClick:n,onMouseEnter:i,onMouseMove:a,onMouseLeave:o,onContextMenu:s,onDoubleClick:u,nodesDraggable:f,elementsSelectable:h,nodesConnectable:d,nodesFocusable:g,resizeObserver:m,noDragClassName:x,noPanClassName:b,disableKeyboardA11y:w,rfId:E,nodeTypes:N,nodeClickDistance:_,onError:D}){const{node:k,internals:C,isParent:L}=Ye(ue=>{const me=ue.nodeLookup.get(e),Ee=ue.parentLookup.has(e);return{node:me,internals:me.internals,isParent:Ee}},ut);let A=k.type||"default",H=N?.[A]||qb[A];H===void 0&&(D?.("003",ri.error003(A)),A="default",H=N?.default||qb.default);const F=!!(k.draggable||f&&typeof k.draggable>"u"),G=!!(k.selectable||h&&typeof k.selectable>"u"),q=!!(k.connectable||d&&typeof k.connectable>"u"),V=!!(k.focusable||g&&typeof k.focusable>"u"),P=ct(),te=nw(k),O=aA({node:k,nodeType:A,hasDimensions:te,resizeObserver:m}),B=Dw({nodeRef:O,disabled:k.hidden||!F,noDragClassName:x,handleSelector:k.dragHandle,nodeId:e,isSelectable:G,nodeClickDistance:_}),j=Rw();if(k.hidden)return null;const U=Bi(k),Y=QT(k),K=G||F||n||i||a||o,z=i?ue=>i(ue,{...C.userNode}):void 0,R=a?ue=>a(ue,{...C.userNode}):void 0,$=o?ue=>o(ue,{...C.userNode}):void 0,T=s?ue=>s(ue,{...C.userNode}):void 0,ie=u?ue=>u(ue,{...C.userNode}):void 0,ce=ue=>{const{selectNodesOnDrag:me,nodeDragThreshold:Ee}=P.getState();G&&(!me||!F||Ee>0)&&Bp({id:e,store:P,nodeRef:O}),n&&n(ue,{...C.userNode})},fe=ue=>{if(!(aw(ue.nativeEvent)||w)){if(Fv.includes(ue.key)&&G){const me=ue.key==="Escape";Bp({id:e,store:P,unselect:me,nodeRef:O})}else if(F&&k.selected&&Object.prototype.hasOwnProperty.call(Ic,ue.key)){ue.preventDefault();const{ariaLabelConfig:me}=P.getState();P.setState({ariaLiveMessage:me["node.a11yDescription.ariaLiveMessage"]({direction:ue.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),j({direction:Ic[ue.key],factor:ue.shiftKey?4:1})}}},he=()=>{if(w||!O.current?.matches(":focus-visible"))return;const{transform:ue,width:me,height:Ee,autoPanOnNodeFocus:Ce,setCenter:we}=P.getState();if(!Ce)return;hm(new Map([[e,k]]),{x:0,y:0,width:me,height:Ee},ue,!0).length>0||we(k.position.x+U.width/2,k.position.y+U.height/2,{zoom:ue[2]})};return v.jsx("div",{className:_t(["react-flow__node",`react-flow__node-${A}`,{[b]:F},k.className,{selected:k.selected,selectable:G,parent:L,draggable:F,dragging:B}]),ref:O,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:K?"all":"none",visibility:te?"visible":"hidden",...k.style,...Y},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:R,onMouseLeave:$,onContextMenu:T,onClick:ce,onDoubleClick:ie,onKeyDown:V?fe:void 0,tabIndex:V?0:void 0,onFocus:V?he:void 0,role:k.ariaRole??(V?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${Ew}-${E}`,"aria-label":k.ariaLabel,...k.domAttributes,children:v.jsx($T,{value:e,children:v.jsx(H,{id:e,data:k.data,type:A,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:k.selected??!1,selectable:G,draggable:F,deletable:k.deletable??!0,isConnectable:q,sourcePosition:k.sourcePosition,targetPosition:k.targetPosition,dragging:B,dragHandle:k.dragHandle,zIndex:C.z,parentId:k.parentId,...U})})})}var oA=Q.memo(lA);const sA=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Hw(e){const{nodesDraggable:n,nodesConnectable:i,nodesFocusable:a,elementsSelectable:o,onError:s}=Ye(sA,ut),u=nA(e.onlyRenderVisibleElements),f=rA();return v.jsx("div",{className:"react-flow__nodes",style:lf,children:u.map(h=>v.jsx(oA,{id:h,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:f,nodesDraggable:n,nodesConnectable:i,nodesFocusable:a,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:s},h))})}Hw.displayName="NodeRenderer";const uA=Q.memo(Hw);function cA(e){return Ye(Q.useCallback(i=>{if(!e)return i.edges.map(o=>o.id);const a=[];if(i.width&&i.height)for(const o of i.edges){const s=i.nodeLookup.get(o.source),u=i.nodeLookup.get(o.target);s&&u&&uM({sourceNode:s,targetNode:u,width:i.width,height:i.height,transform:i.transform})&&a.push(o.id)}return a},[e]),ut)}const fA=({color:e="none",strokeWidth:n=1})=>{const i={strokeWidth:n,...e&&{stroke:e}};return v.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},dA=({color:e="none",strokeWidth:n=1})=>{const i={strokeWidth:n,...e&&{stroke:e,fill:e}};return v.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Vb={[Hc.Arrow]:fA,[Hc.ArrowClosed]:dA};function hA(e){const n=ct();return Q.useMemo(()=>Object.prototype.hasOwnProperty.call(Vb,e)?Vb[e]:(n.getState().onError?.("009",ri.error009(e)),null),[e])}const pA=({id:e,type:n,color:i,width:a=12.5,height:o=12.5,markerUnits:s="strokeWidth",strokeWidth:u,orient:f="auto-start-reverse"})=>{const h=hA(n);return h?v.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${a}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:f,refX:"0",refY:"0",children:v.jsx(h,{color:i,strokeWidth:u})}):null},Bw=({defaultColor:e,rfId:n})=>{const i=Ye(s=>s.edges),a=Ye(s=>s.defaultEdgeOptions),o=Q.useMemo(()=>gM(i,{id:n,defaultColor:e,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[i,a,n,e]);return o.length?v.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:v.jsx("defs",{children:o.map(s=>v.jsx(pA,{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};Bw.displayName="MarkerDefinitions";var mA=Q.memo(Bw);function Uw({x:e,y:n,label:i,labelStyle:a,labelShowBg:o=!0,labelBgStyle:s,labelBgPadding:u=[2,4],labelBgBorderRadius:f=2,children:h,className:d,...g}){const[m,x]=Q.useState({x:1,y:0,width:0,height:0}),b=_t(["react-flow__edge-textwrapper",d]),w=Q.useRef(null);return Q.useEffect(()=>{if(w.current){const E=w.current.getBBox();x({x:E.x,y:E.y,width:E.width,height:E.height})}},[i]),i?v.jsxs("g",{transform:`translate(${e-m.width/2} ${n-m.height/2})`,className:b,visibility:m.width?"visible":"hidden",...g,children:[o&&v.jsx("rect",{width:m.width+2*u[0],x:-u[0],y:-u[1],height:m.height+2*u[1],className:"react-flow__edge-textbg",style:s,rx:f,ry:f}),v.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:w,style:a,children:i}),h]}):null}Uw.displayName="EdgeText";const gA=Q.memo(Uw);function of({path:e,labelX:n,labelY:i,label:a,labelStyle:o,labelShowBg:s,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h,interactionWidth:d=20,...g}){return v.jsxs(v.Fragment,{children:[v.jsx("path",{...g,d:e,fill:"none",className:_t(["react-flow__edge-path",g.className])}),d?v.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,a&&$n(n)&&$n(i)?v.jsx(gA,{x:n,y:i,label:a,labelStyle:o,labelShowBg:s,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h}):null]})}function Pb({pos:e,x1:n,y1:i,x2:a,y2:o}){return e===be.Left||e===be.Right?[.5*(n+a),i]:[n,.5*(i+o)]}function Iw({sourceX:e,sourceY:n,sourcePosition:i=be.Bottom,targetX:a,targetY:o,targetPosition:s=be.Top}){const[u,f]=Pb({pos:i,x1:e,y1:n,x2:a,y2:o}),[h,d]=Pb({pos:s,x1:a,y1:o,x2:e,y2:n}),[g,m,x,b]=ow({sourceX:e,sourceY:n,targetX:a,targetY:o,sourceControlX:u,sourceControlY:f,targetControlX:h,targetControlY:d});return[`M${e},${n} C${u},${f} ${h},${d} ${a},${o}`,g,m,x,b]}function qw(e){return Q.memo(({id:n,sourceX:i,sourceY:a,targetX:o,targetY:s,sourcePosition:u,targetPosition:f,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,interactionWidth:_})=>{const[D,k,C]=Iw({sourceX:i,sourceY:a,sourcePosition:u,targetX:o,targetY:s,targetPosition:f}),L=e.isInternal?void 0:n;return v.jsx(of,{id:L,path:D,labelX:k,labelY:C,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,interactionWidth:_})})}const yA=qw({isInternal:!1}),$w=qw({isInternal:!0});yA.displayName="SimpleBezierEdge";$w.displayName="SimpleBezierEdgeInternal";function Vw(e){return Q.memo(({id:n,sourceX:i,sourceY:a,targetX:o,targetY:s,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,sourcePosition:b=be.Bottom,targetPosition:w=be.Top,markerEnd:E,markerStart:N,pathOptions:_,interactionWidth:D})=>{const[k,C,L]=Rp({sourceX:i,sourceY:a,sourcePosition:b,targetX:o,targetY:s,targetPosition:w,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition}),A=e.isInternal?void 0:n;return v.jsx(of,{id:A,path:k,labelX:C,labelY:L,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:E,markerStart:N,interactionWidth:D})})}const Pw=Vw({isInternal:!1}),Yw=Vw({isInternal:!0});Pw.displayName="SmoothStepEdge";Yw.displayName="SmoothStepEdgeInternal";function Xw(e){return Q.memo(({id:n,...i})=>{const a=e.isInternal?void 0:n;return v.jsx(Pw,{...i,id:a,pathOptions:Q.useMemo(()=>({borderRadius:0,offset:i.pathOptions?.offset}),[i.pathOptions?.offset])})})}const xA=Xw({isInternal:!1}),Fw=Xw({isInternal:!0});xA.displayName="StepEdge";Fw.displayName="StepEdgeInternal";function Gw(e){return Q.memo(({id:n,sourceX:i,sourceY:a,targetX:o,targetY:s,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:b,markerStart:w,interactionWidth:E})=>{const[N,_,D]=fw({sourceX:i,sourceY:a,targetX:o,targetY:s}),k=e.isInternal?void 0:n;return v.jsx(of,{id:k,path:N,labelX:_,labelY:D,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:b,markerStart:w,interactionWidth:E})})}const bA=Gw({isInternal:!1}),Zw=Gw({isInternal:!0});bA.displayName="StraightEdge";Zw.displayName="StraightEdgeInternal";function Qw(e){return Q.memo(({id:n,sourceX:i,sourceY:a,targetX:o,targetY:s,sourcePosition:u=be.Bottom,targetPosition:f=be.Top,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,pathOptions:_,interactionWidth:D})=>{const[k,C,L]=sw({sourceX:i,sourceY:a,sourcePosition:u,targetX:o,targetY:s,targetPosition:f,curvature:_?.curvature}),A=e.isInternal?void 0:n;return v.jsx(of,{id:A,path:k,labelX:C,labelY:L,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,interactionWidth:D})})}const vA=Qw({isInternal:!1}),Kw=Qw({isInternal:!0});vA.displayName="BezierEdge";Kw.displayName="BezierEdgeInternal";const Yb={default:Kw,straight:Zw,step:Fw,smoothstep:Yw,simplebezier:$w},Xb={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},wA=(e,n,i)=>i===be.Left?e-n:i===be.Right?e+n:e,SA=(e,n,i)=>i===be.Top?e-n:i===be.Bottom?e+n:e,Fb="react-flow__edgeupdater";function Gb({position:e,centerX:n,centerY:i,radius:a=10,onMouseDown:o,onMouseEnter:s,onMouseOut:u,type:f}){return v.jsx("circle",{onMouseDown:o,onMouseEnter:s,onMouseOut:u,className:_t([Fb,`${Fb}-${f}`]),cx:wA(n,a,e),cy:SA(i,a,e),r:a,stroke:"transparent",fill:"transparent"})}function _A({isReconnectable:e,reconnectRadius:n,edge:i,sourceX:a,sourceY:o,targetX:s,targetY:u,sourcePosition:f,targetPosition:h,onReconnect:d,onReconnectStart:g,onReconnectEnd:m,setReconnecting:x,setUpdateHover:b}){const w=ct(),E=(C,L)=>{if(C.button!==0)return;const{autoPanOnConnect:A,domNode:H,isValidConnection:F,connectionMode:G,connectionRadius:q,lib:V,onConnectStart:P,onConnectEnd:te,cancelConnection:O,nodeLookup:B,rfId:j,panBy:U,updateConnection:Y}=w.getState(),K=L.type==="target",z=(T,ie)=>{x(!1),m?.(T,i,L.type,ie)},R=T=>d?.(i,T),$=(T,ie)=>{x(!0),g?.(C,i,L.type),P?.(T,ie)};Hp.onPointerDown(C.nativeEvent,{autoPanOnConnect:A,connectionMode:G,connectionRadius:q,domNode:H,handleId:L.id,nodeId:L.nodeId,nodeLookup:B,isTarget:K,edgeUpdaterType:L.type,lib:V,flowId:j,cancelConnection:O,panBy:U,isValidConnection:F,onConnect:R,onConnectStart:$,onConnectEnd:te,onReconnectEnd:z,updateConnection:Y,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},N=C=>E(C,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),_=C=>E(C,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),D=()=>b(!0),k=()=>b(!1);return v.jsxs(v.Fragment,{children:[(e===!0||e==="source")&&v.jsx(Gb,{position:f,centerX:a,centerY:o,radius:n,onMouseDown:N,onMouseEnter:D,onMouseOut:k,type:"source"}),(e===!0||e==="target")&&v.jsx(Gb,{position:h,centerX:s,centerY:u,radius:n,onMouseDown:_,onMouseEnter:D,onMouseOut:k,type:"target"})]})}function kA({id:e,edgesFocusable:n,edgesReconnectable:i,elementsSelectable:a,onClick:o,onDoubleClick:s,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,reconnectRadius:g,onReconnect:m,onReconnectStart:x,onReconnectEnd:b,rfId:w,edgeTypes:E,noPanClassName:N,onError:_,disableKeyboardA11y:D}){let k=Ye(we=>we.edgeLookup.get(e));const C=Ye(we=>we.defaultEdgeOptions);k=C?{...C,...k}:k;let L=k.type||"default",A=E?.[L]||Yb[L];A===void 0&&(_?.("011",ri.error011(L)),L="default",A=E?.default||Yb.default);const H=!!(k.focusable||n&&typeof k.focusable>"u"),F=typeof m<"u"&&(k.reconnectable||i&&typeof k.reconnectable>"u"),G=!!(k.selectable||a&&typeof k.selectable>"u"),q=Q.useRef(null),[V,P]=Q.useState(!1),[te,O]=Q.useState(!1),B=ct(),{zIndex:j,sourceX:U,sourceY:Y,targetX:K,targetY:z,sourcePosition:R,targetPosition:$}=Ye(Q.useCallback(we=>{const Ne=we.nodeLookup.get(k.source),Re=we.nodeLookup.get(k.target);if(!Ne||!Re)return{zIndex:k.zIndex,...Xb};const Ze=mM({id:e,sourceNode:Ne,targetNode:Re,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:we.connectionMode,onError:_});return{zIndex:sM({selected:k.selected,zIndex:k.zIndex,sourceNode:Ne,targetNode:Re,elevateOnSelect:we.elevateEdgesOnSelect,zIndexMode:we.zIndexMode}),...Ze||Xb}},[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),ut),T=Q.useMemo(()=>k.markerStart?`url('#${Op(k.markerStart,w)}')`:void 0,[k.markerStart,w]),ie=Q.useMemo(()=>k.markerEnd?`url('#${Op(k.markerEnd,w)}')`:void 0,[k.markerEnd,w]);if(k.hidden||U===null||Y===null||K===null||z===null)return null;const ce=we=>{const{addSelectedEdges:Ne,unselectNodesAndEdges:Re,multiSelectionActive:Ze}=B.getState();G&&(B.setState({nodesSelectionActive:!1}),k.selected&&Ze?(Re({nodes:[],edges:[k]}),q.current?.blur()):Ne([e])),o&&o(we,k)},fe=s?we=>{s(we,{...k})}:void 0,he=u?we=>{u(we,{...k})}:void 0,ue=f?we=>{f(we,{...k})}:void 0,me=h?we=>{h(we,{...k})}:void 0,Ee=d?we=>{d(we,{...k})}:void 0,Ce=we=>{if(!D&&Fv.includes(we.key)&&G){const{unselectNodesAndEdges:Ne,addSelectedEdges:Re}=B.getState();we.key==="Escape"?(q.current?.blur(),Ne({edges:[k]})):Re([e])}};return v.jsx("svg",{style:{zIndex:j},children:v.jsxs("g",{className:_t(["react-flow__edge",`react-flow__edge-${L}`,k.className,N,{selected:k.selected,animated:k.animated,inactive:!G&&!o,updating:V,selectable:G}]),onClick:ce,onDoubleClick:fe,onContextMenu:he,onMouseEnter:ue,onMouseMove:me,onMouseLeave:Ee,onKeyDown:H?Ce:void 0,tabIndex:H?0:void 0,role:k.ariaRole??(H?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":k.ariaLabel===null?void 0:k.ariaLabel||`Edge from ${k.source} to ${k.target}`,"aria-describedby":H?`${Nw}-${w}`:void 0,ref:q,...k.domAttributes,children:[!te&&v.jsx(A,{id:e,source:k.source,target:k.target,type:k.type,selected:k.selected,animated:k.animated,selectable:G,deletable:k.deletable??!0,label:k.label,labelStyle:k.labelStyle,labelShowBg:k.labelShowBg,labelBgStyle:k.labelBgStyle,labelBgPadding:k.labelBgPadding,labelBgBorderRadius:k.labelBgBorderRadius,sourceX:U,sourceY:Y,targetX:K,targetY:z,sourcePosition:R,targetPosition:$,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:T,markerEnd:ie,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),F&&v.jsx(_A,{edge:k,isReconnectable:F,reconnectRadius:g,onReconnect:m,onReconnectStart:x,onReconnectEnd:b,sourceX:U,sourceY:Y,targetX:K,targetY:z,sourcePosition:R,targetPosition:$,setUpdateHover:P,setReconnecting:O})]})})}var EA=Q.memo(kA);const NA=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Jw({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:i,edgeTypes:a,noPanClassName:o,onReconnect:s,onEdgeContextMenu:u,onEdgeMouseEnter:f,onEdgeMouseMove:h,onEdgeMouseLeave:d,onEdgeClick:g,reconnectRadius:m,onEdgeDoubleClick:x,onReconnectStart:b,onReconnectEnd:w,disableKeyboardA11y:E}){const{edgesFocusable:N,edgesReconnectable:_,elementsSelectable:D,onError:k}=Ye(NA,ut),C=cA(n);return v.jsxs("div",{className:"react-flow__edges",children:[v.jsx(mA,{defaultColor:e,rfId:i}),C.map(L=>v.jsx(EA,{id:L,edgesFocusable:N,edgesReconnectable:_,elementsSelectable:D,noPanClassName:o,onReconnect:s,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,onClick:g,reconnectRadius:m,onDoubleClick:x,onReconnectStart:b,onReconnectEnd:w,rfId:i,onError:k,edgeTypes:a,disableKeyboardA11y:E},L))]})}Jw.displayName="EdgeRenderer";const CA=Q.memo(Jw),MA=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function TA({children:e}){const n=Ye(MA);return v.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function AA(e){const n=wm(),i=Q.useRef(!1);Q.useEffect(()=>{!i.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),i.current=!0)},[e,n.viewportInitialized])}const zA=e=>e.panZoom?.syncViewport;function jA(e){const n=Ye(zA),i=ct();return Q.useEffect(()=>{e&&(n?.(e),i.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function DA(e){return e.connection.inProgress?{...e.connection,to:ps(e.connection.to,e.transform)}:{...e.connection}}function RA(e){return DA}function OA(e){const n=RA();return Ye(n,ut)}const LA=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function HA({containerStyle:e,style:n,type:i,component:a}){const{nodesConnectable:o,width:s,height:u,isValid:f,inProgress:h}=Ye(LA,ut);return!(s&&o&&h)?null:v.jsx("svg",{style:e,width:s,height:u,className:"react-flow__connectionline react-flow__container",children:v.jsx("g",{className:_t(["react-flow__connection",Qv(f)]),children:v.jsx(Ww,{style:n,type:i,CustomComponent:a,isValid:f})})})}const Ww=({style:e,type:n=wr.Bezier,CustomComponent:i,isValid:a})=>{const{inProgress:o,from:s,fromNode:u,fromHandle:f,fromPosition:h,to:d,toNode:g,toHandle:m,toPosition:x,pointer:b}=OA();if(!o)return;if(i)return v.jsx(i,{connectionLineType:n,connectionLineStyle:e,fromNode:u,fromHandle:f,fromX:s.x,fromY:s.y,toX:d.x,toY:d.y,fromPosition:h,toPosition:x,connectionStatus:Qv(a),toNode:g,toHandle:m,pointer:b});let w="";const E={sourceX:s.x,sourceY:s.y,sourcePosition:h,targetX:d.x,targetY:d.y,targetPosition:x};switch(n){case wr.Bezier:[w]=sw(E);break;case wr.SimpleBezier:[w]=Iw(E);break;case wr.Step:[w]=Rp({...E,borderRadius:0});break;case wr.SmoothStep:[w]=Rp(E);break;default:[w]=fw(E)}return v.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};Ww.displayName="ConnectionLine";const BA={};function Zb(e=BA){Q.useRef(e),ct(),Q.useEffect(()=>{},[e])}function UA(){ct(),Q.useRef(!1),Q.useEffect(()=>{},[])}function eS({nodeTypes:e,edgeTypes:n,onInit:i,onNodeClick:a,onEdgeClick:o,onNodeDoubleClick:s,onEdgeDoubleClick:u,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:g,onSelectionContextMenu:m,onSelectionStart:x,onSelectionEnd:b,connectionLineType:w,connectionLineStyle:E,connectionLineComponent:N,connectionLineContainerStyle:_,selectionKeyCode:D,selectionOnDrag:k,selectionMode:C,multiSelectionKeyCode:L,panActivationKeyCode:A,zoomActivationKeyCode:H,deleteKeyCode:F,onlyRenderVisibleElements:G,elementsSelectable:q,defaultViewport:V,translateExtent:P,minZoom:te,maxZoom:O,preventScrolling:B,defaultMarkerColor:j,zoomOnScroll:U,zoomOnPinch:Y,panOnScroll:K,panOnScrollSpeed:z,panOnScrollMode:R,zoomOnDoubleClick:$,panOnDrag:T,onPaneClick:ie,onPaneMouseEnter:ce,onPaneMouseMove:fe,onPaneMouseLeave:he,onPaneScroll:ue,onPaneContextMenu:me,paneClickDistance:Ee,nodeClickDistance:Ce,onEdgeContextMenu:we,onEdgeMouseEnter:Ne,onEdgeMouseMove:Re,onEdgeMouseLeave:Ze,reconnectRadius:Xe,onReconnect:ht,onReconnectStart:on,onReconnectEnd:Lt,noDragClassName:Gt,noWheelClassName:Rn,noPanClassName:oi,disableKeyboardA11y:si,nodeExtent:Et,rfId:Ii,viewport:ae,onViewportChange:pe}){return Zb(e),Zb(n),UA(),AA(i),jA(ae),v.jsx(eA,{onPaneClick:ie,onPaneMouseEnter:ce,onPaneMouseMove:fe,onPaneMouseLeave:he,onPaneContextMenu:me,onPaneScroll:ue,paneClickDistance:Ee,deleteKeyCode:F,selectionKeyCode:D,selectionOnDrag:k,selectionMode:C,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:L,panActivationKeyCode:A,zoomActivationKeyCode:H,elementsSelectable:q,zoomOnScroll:U,zoomOnPinch:Y,zoomOnDoubleClick:$,panOnScroll:K,panOnScrollSpeed:z,panOnScrollMode:R,panOnDrag:T,defaultViewport:V,translateExtent:P,minZoom:te,maxZoom:O,onSelectionContextMenu:m,preventScrolling:B,noDragClassName:Gt,noWheelClassName:Rn,noPanClassName:oi,disableKeyboardA11y:si,onViewportChange:pe,isControlledViewport:!!ae,children:v.jsxs(TA,{children:[v.jsx(CA,{edgeTypes:n,onEdgeClick:o,onEdgeDoubleClick:u,onReconnect:ht,onReconnectStart:on,onReconnectEnd:Lt,onlyRenderVisibleElements:G,onEdgeContextMenu:we,onEdgeMouseEnter:Ne,onEdgeMouseMove:Re,onEdgeMouseLeave:Ze,reconnectRadius:Xe,defaultMarkerColor:j,noPanClassName:oi,disableKeyboardA11y:si,rfId:Ii}),v.jsx(HA,{style:E,type:w,component:N,containerStyle:_}),v.jsx("div",{className:"react-flow__edgelabel-renderer"}),v.jsx(uA,{nodeTypes:e,onNodeClick:a,onNodeDoubleClick:s,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:g,nodeClickDistance:Ce,onlyRenderVisibleElements:G,noPanClassName:oi,noDragClassName:Gt,disableKeyboardA11y:si,nodeExtent:Et,rfId:Ii}),v.jsx("div",{className:"react-flow__viewport-portal"})]})})}eS.displayName="GraphView";const IA=Q.memo(eS),Qb=({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,width:o,height:s,fitView:u,fitViewOptions:f,minZoom:h=.5,maxZoom:d=2,nodeOrigin:g,nodeExtent:m,zIndexMode:x="basic"}={})=>{const b=new Map,w=new Map,E=new Map,N=new Map,_=a??n??[],D=i??e??[],k=g??[0,0],C=m??Wo;pw(E,N,_);const L=Lp(D,b,w,{nodeOrigin:k,nodeExtent:C,zIndexMode:x});let A=[0,0,1];if(u&&o&&s){const H=ds(b,{filter:V=>!!((V.width||V.initialWidth)&&(V.height||V.initialHeight))}),{x:F,y:G,zoom:q}=pm(H,o,s,h,d,f?.padding??.1);A=[F,G,q]}return{rfId:"1",width:o??0,height:s??0,transform:A,nodes:D,nodesInitialized:L,nodeLookup:b,parentLookup:w,edges:_,edgeLookup:N,connectionLookup:E,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:h,maxZoom:d,translateExtent:Wo,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:cl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:k,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:u??!1,fitViewOptions:f,fitViewResolver:null,connection:{...Zv},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:nM,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Gv,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},qA=({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,width:o,height:s,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:g,nodeExtent:m,zIndexMode:x})=>aT((b,w)=>{async function E(){const{nodeLookup:N,panZoom:_,fitViewOptions:D,fitViewResolver:k,width:C,height:L,minZoom:A,maxZoom:H}=w();_&&(await eM({nodes:N,width:C,height:L,panZoom:_,minZoom:A,maxZoom:H},D),k?.resolve(!0),b({fitViewResolver:null}))}return{...Qb({nodes:e,edges:n,width:o,height:s,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:g,nodeExtent:m,defaultNodes:i,defaultEdges:a,zIndexMode:x}),setNodes:N=>{const{nodeLookup:_,parentLookup:D,nodeOrigin:k,elevateNodesOnSelect:C,fitViewQueued:L,zIndexMode:A}=w(),H=Lp(N,_,D,{nodeOrigin:k,nodeExtent:m,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:A});L&&H?(E(),b({nodes:N,nodesInitialized:H,fitViewQueued:!1,fitViewOptions:void 0})):b({nodes:N,nodesInitialized:H})},setEdges:N=>{const{connectionLookup:_,edgeLookup:D}=w();pw(_,D,N),b({edges:N})},setDefaultNodesAndEdges:(N,_)=>{if(N){const{setNodes:D}=w();D(N),b({hasDefaultNodes:!0})}if(_){const{setEdges:D}=w();D(_),b({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:_,nodeLookup:D,parentLookup:k,domNode:C,nodeOrigin:L,nodeExtent:A,debug:H,fitViewQueued:F,zIndexMode:G}=w(),{changes:q,updatedInternals:V}=_M(N,D,k,C,L,A,G);V&&(bM(D,k,{nodeOrigin:L,nodeExtent:A,zIndexMode:G}),F?(E(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),q?.length>0&&(H&&console.log("React Flow: trigger node changes",q),_?.(q)))},updateNodePositions:(N,_=!1)=>{const D=[];let k=[];const{nodeLookup:C,triggerNodeChanges:L,connection:A,updateConnection:H,onNodesChangeMiddlewareMap:F}=w();for(const[G,q]of N){const V=C.get(G),P=!!(V?.expandParent&&V?.parentId&&q?.position),te={id:G,type:"position",position:P?{x:Math.max(0,q.position.x),y:Math.max(0,q.position.y)}:q.position,dragging:_};if(V&&A.inProgress&&A.fromNode.id===V.id){const O=na(V,A.fromHandle,be.Left,!0);H({...A,from:O})}P&&V.parentId&&D.push({id:G,parentId:V.parentId,rect:{...q.internals.positionAbsolute,width:q.measured.width??0,height:q.measured.height??0}}),k.push(te)}if(D.length>0){const{parentLookup:G,nodeOrigin:q}=w(),V=vm(D,C,G,q);k.push(...V)}for(const G of F.values())k=G(k);L(k)},triggerNodeChanges:N=>{const{onNodesChange:_,setNodes:D,nodes:k,hasDefaultNodes:C,debug:L}=w();if(N?.length){if(C){const A=Tw(N,k);D(A)}L&&console.log("React Flow: trigger node changes",N),_?.(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:_,setEdges:D,edges:k,hasDefaultEdges:C,debug:L}=w();if(N?.length){if(C){const A=Aw(N,k);D(A)}L&&console.log("React Flow: trigger edge changes",N),_?.(N)}},addSelectedNodes:N=>{const{multiSelectionActive:_,edgeLookup:D,nodeLookup:k,triggerNodeChanges:C,triggerEdgeChanges:L}=w();if(_){const A=N.map(H=>Gr(H,!0));C(A);return}C(tl(k,new Set([...N]),!0)),L(tl(D))},addSelectedEdges:N=>{const{multiSelectionActive:_,edgeLookup:D,nodeLookup:k,triggerNodeChanges:C,triggerEdgeChanges:L}=w();if(_){const A=N.map(H=>Gr(H,!0));L(A);return}L(tl(D,new Set([...N]))),C(tl(k,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:_}={})=>{const{edges:D,nodes:k,nodeLookup:C,triggerNodeChanges:L,triggerEdgeChanges:A}=w(),H=N||k,F=_||D,G=H.map(V=>{const P=C.get(V.id);return P&&(P.selected=!1),Gr(V.id,!1)}),q=F.map(V=>Gr(V.id,!1));L(G),A(q)},setMinZoom:N=>{const{panZoom:_,maxZoom:D}=w();_?.setScaleExtent([N,D]),b({minZoom:N})},setMaxZoom:N=>{const{panZoom:_,minZoom:D}=w();_?.setScaleExtent([D,N]),b({maxZoom:N})},setTranslateExtent:N=>{w().panZoom?.setTranslateExtent(N),b({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:_,triggerNodeChanges:D,triggerEdgeChanges:k,elementsSelectable:C}=w();if(!C)return;const L=_.reduce((H,F)=>F.selected?[...H,Gr(F.id,!1)]:H,[]),A=N.reduce((H,F)=>F.selected?[...H,Gr(F.id,!1)]:H,[]);D(L),k(A)},setNodeExtent:N=>{const{nodes:_,nodeLookup:D,parentLookup:k,nodeOrigin:C,elevateNodesOnSelect:L,nodeExtent:A,zIndexMode:H}=w();N[0][0]===A[0][0]&&N[0][1]===A[0][1]&&N[1][0]===A[1][0]&&N[1][1]===A[1][1]||(Lp(_,D,k,{nodeOrigin:C,nodeExtent:N,elevateNodesOnSelect:L,checkEquality:!1,zIndexMode:H}),b({nodeExtent:N}))},panBy:N=>{const{transform:_,width:D,height:k,panZoom:C,translateExtent:L}=w();return kM({delta:N,panZoom:C,transform:_,translateExtent:L,width:D,height:k})},setCenter:async(N,_,D)=>{const{width:k,height:C,maxZoom:L,panZoom:A}=w();if(!A)return Promise.resolve(!1);const H=typeof D?.zoom<"u"?D.zoom:L;return await A.setViewport({x:k/2-N*H,y:C/2-_*H,zoom:H},{duration:D?.duration,ease:D?.ease,interpolate:D?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{b({connection:{...Zv}})},updateConnection:N=>{b({connection:N})},reset:()=>b({...Qb()})}},Object.is);function tS({initialNodes:e,initialEdges:n,defaultNodes:i,defaultEdges:a,initialWidth:o,initialHeight:s,initialMinZoom:u,initialMaxZoom:f,initialFitViewOptions:h,fitView:d,nodeOrigin:g,nodeExtent:m,zIndexMode:x,children:b}){const[w]=Q.useState(()=>qA({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,width:o,height:s,fitView:d,minZoom:u,maxZoom:f,fitViewOptions:h,nodeOrigin:g,nodeExtent:m,zIndexMode:x}));return v.jsx(lT,{value:w,children:v.jsx(TT,{children:b})})}function $A({children:e,nodes:n,edges:i,defaultNodes:a,defaultEdges:o,width:s,height:u,fitView:f,fitViewOptions:h,minZoom:d,maxZoom:g,nodeOrigin:m,nodeExtent:x,zIndexMode:b}){return Q.useContext(rf)?v.jsx(v.Fragment,{children:e}):v.jsx(tS,{initialNodes:n,initialEdges:i,defaultNodes:a,defaultEdges:o,initialWidth:s,initialHeight:u,fitView:f,initialFitViewOptions:h,initialMinZoom:d,initialMaxZoom:g,nodeOrigin:m,nodeExtent:x,zIndexMode:b,children:e})}const VA={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function PA({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,className:o,nodeTypes:s,edgeTypes:u,onNodeClick:f,onEdgeClick:h,onInit:d,onMove:g,onMoveStart:m,onMoveEnd:x,onConnect:b,onConnectStart:w,onConnectEnd:E,onClickConnectStart:N,onClickConnectEnd:_,onNodeMouseEnter:D,onNodeMouseMove:k,onNodeMouseLeave:C,onNodeContextMenu:L,onNodeDoubleClick:A,onNodeDragStart:H,onNodeDrag:F,onNodeDragStop:G,onNodesDelete:q,onEdgesDelete:V,onDelete:P,onSelectionChange:te,onSelectionDragStart:O,onSelectionDrag:B,onSelectionDragStop:j,onSelectionContextMenu:U,onSelectionStart:Y,onSelectionEnd:K,onBeforeDelete:z,connectionMode:R,connectionLineType:$=wr.Bezier,connectionLineStyle:T,connectionLineComponent:ie,connectionLineContainerStyle:ce,deleteKeyCode:fe="Backspace",selectionKeyCode:he="Shift",selectionOnDrag:ue=!1,selectionMode:me=es.Full,panActivationKeyCode:Ee="Space",multiSelectionKeyCode:Ce=ns()?"Meta":"Control",zoomActivationKeyCode:we=ns()?"Meta":"Control",snapToGrid:Ne,snapGrid:Re,onlyRenderVisibleElements:Ze=!1,selectNodesOnDrag:Xe,nodesDraggable:ht,autoPanOnNodeFocus:on,nodesConnectable:Lt,nodesFocusable:Gt,nodeOrigin:Rn=Cw,edgesFocusable:oi,edgesReconnectable:si,elementsSelectable:Et=!0,defaultViewport:Ii=bT,minZoom:ae=.5,maxZoom:pe=2,translateExtent:_e=Wo,preventScrolling:De=!0,nodeExtent:$e,defaultMarkerColor:Vt="#b1b1b7",zoomOnScroll:On=!0,zoomOnPinch:At=!0,panOnScroll:pt=!1,panOnScrollSpeed:Ht=.5,panOnScrollMode:Ke=Jr.Free,zoomOnDoubleClick:Gn=!0,panOnDrag:sn=!0,onPaneClick:Sf,onPaneMouseEnter:la,onPaneMouseMove:oa,onPaneMouseLeave:sa,onPaneScroll:ui,onPaneContextMenu:ua,paneClickDistance:_r=1,nodeClickDistance:_f=0,children:_s,onReconnect:Sl,onReconnectStart:kr,onReconnectEnd:kf,onEdgeContextMenu:ks,onEdgeDoubleClick:Es,onEdgeMouseEnter:Ns,onEdgeMouseMove:_l,onEdgeMouseLeave:kl,reconnectRadius:Cs=10,onNodesChange:Ms,onEdgesChange:Zn,noDragClassName:Nt="nodrag",noWheelClassName:Bt="nowheel",noPanClassName:ci="nopan",fitView:ca,fitViewOptions:Ts,connectOnClick:Ef,attributionPosition:As,proOptions:Er,defaultEdgeOptions:El,elevateNodesOnSelect:qi=!0,elevateEdgesOnSelect:$i=!1,disableKeyboardA11y:Vi=!1,autoPanOnConnect:Pi,autoPanOnNodeDrag:yt,autoPanSpeed:zs,connectionRadius:js,isValidConnection:fi,onError:Yi,style:Nf,id:Nl,nodeDragThreshold:Ds,connectionDragThreshold:Cf,viewport:fa,onViewportChange:da,width:Ln,height:Zt,colorMode:Rs="light",debug:Mf,onScroll:ha,ariaLabelConfig:Os,zIndexMode:Nr="basic",...Tf},Qt){const Cr=Nl||"1",Ls=_T(Rs),Cl=Q.useCallback(di=>{di.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ha?.(di)},[ha]);return v.jsx("div",{"data-testid":"rf__wrapper",...Tf,onScroll:Cl,style:{...Nf,...VA},ref:Qt,className:_t(["react-flow",o,Ls]),id:Nl,role:"application",children:v.jsxs($A,{nodes:e,edges:n,width:Ln,height:Zt,fitView:ca,fitViewOptions:Ts,minZoom:ae,maxZoom:pe,nodeOrigin:Rn,nodeExtent:$e,zIndexMode:Nr,children:[v.jsx(IA,{onInit:d,onNodeClick:f,onEdgeClick:h,onNodeMouseEnter:D,onNodeMouseMove:k,onNodeMouseLeave:C,onNodeContextMenu:L,onNodeDoubleClick:A,nodeTypes:s,edgeTypes:u,connectionLineType:$,connectionLineStyle:T,connectionLineComponent:ie,connectionLineContainerStyle:ce,selectionKeyCode:he,selectionOnDrag:ue,selectionMode:me,deleteKeyCode:fe,multiSelectionKeyCode:Ce,panActivationKeyCode:Ee,zoomActivationKeyCode:we,onlyRenderVisibleElements:Ze,defaultViewport:Ii,translateExtent:_e,minZoom:ae,maxZoom:pe,preventScrolling:De,zoomOnScroll:On,zoomOnPinch:At,zoomOnDoubleClick:Gn,panOnScroll:pt,panOnScrollSpeed:Ht,panOnScrollMode:Ke,panOnDrag:sn,onPaneClick:Sf,onPaneMouseEnter:la,onPaneMouseMove:oa,onPaneMouseLeave:sa,onPaneScroll:ui,onPaneContextMenu:ua,paneClickDistance:_r,nodeClickDistance:_f,onSelectionContextMenu:U,onSelectionStart:Y,onSelectionEnd:K,onReconnect:Sl,onReconnectStart:kr,onReconnectEnd:kf,onEdgeContextMenu:ks,onEdgeDoubleClick:Es,onEdgeMouseEnter:Ns,onEdgeMouseMove:_l,onEdgeMouseLeave:kl,reconnectRadius:Cs,defaultMarkerColor:Vt,noDragClassName:Nt,noWheelClassName:Bt,noPanClassName:ci,rfId:Cr,disableKeyboardA11y:Vi,nodeExtent:$e,viewport:fa,onViewportChange:da}),v.jsx(ST,{nodes:e,edges:n,defaultNodes:i,defaultEdges:a,onConnect:b,onConnectStart:w,onConnectEnd:E,onClickConnectStart:N,onClickConnectEnd:_,nodesDraggable:ht,autoPanOnNodeFocus:on,nodesConnectable:Lt,nodesFocusable:Gt,edgesFocusable:oi,edgesReconnectable:si,elementsSelectable:Et,elevateNodesOnSelect:qi,elevateEdgesOnSelect:$i,minZoom:ae,maxZoom:pe,nodeExtent:$e,onNodesChange:Ms,onEdgesChange:Zn,snapToGrid:Ne,snapGrid:Re,connectionMode:R,translateExtent:_e,connectOnClick:Ef,defaultEdgeOptions:El,fitView:ca,fitViewOptions:Ts,onNodesDelete:q,onEdgesDelete:V,onDelete:P,onNodeDragStart:H,onNodeDrag:F,onNodeDragStop:G,onSelectionDrag:B,onSelectionDragStart:O,onSelectionDragStop:j,onMove:g,onMoveStart:m,onMoveEnd:x,noPanClassName:ci,nodeOrigin:Rn,rfId:Cr,autoPanOnConnect:Pi,autoPanOnNodeDrag:yt,autoPanSpeed:zs,onError:Yi,connectionRadius:js,isValidConnection:fi,selectNodesOnDrag:Xe,nodeDragThreshold:Ds,connectionDragThreshold:Cf,onBeforeDelete:z,debug:Mf,ariaLabelConfig:Os,zIndexMode:Nr}),v.jsx(xT,{onSelectionChange:te}),_s,v.jsx(hT,{proOptions:Er,position:As}),v.jsx(dT,{rfId:Cr,disableKeyboardA11y:Vi})]})})}var YA=zw(PA);function XA({dimensions:e,lineWidth:n,variant:i,className:a}){return v.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:_t(["react-flow__background-pattern",i,a])})}function FA({radius:e,className:n}){return v.jsx("circle",{cx:e,cy:e,r:e,className:_t(["react-flow__background-pattern","dots",n])})}var Oi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Oi||(Oi={}));const GA={[Oi.Dots]:1,[Oi.Lines]:1,[Oi.Cross]:6},ZA=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function nS({id:e,variant:n=Oi.Dots,gap:i=20,size:a,lineWidth:o=1,offset:s=0,color:u,bgColor:f,style:h,className:d,patternClassName:g}){const m=Q.useRef(null),{transform:x,patternId:b}=Ye(ZA,ut),w=a||GA[n],E=n===Oi.Dots,N=n===Oi.Cross,_=Array.isArray(i)?i:[i,i],D=[_[0]*x[2]||1,_[1]*x[2]||1],k=w*x[2],C=Array.isArray(s)?s:[s,s],L=N?[k,k]:D,A=[C[0]*x[2]||1+L[0]/2,C[1]*x[2]||1+L[1]/2],H=`${b}${e||""}`;return v.jsxs("svg",{className:_t(["react-flow__background",d]),style:{...h,...lf,"--xy-background-color-props":f,"--xy-background-pattern-color-props":u},ref:m,"data-testid":"rf__background",children:[v.jsx("pattern",{id:H,x:x[0]%D[0],y:x[1]%D[1],width:D[0],height:D[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:E?v.jsx(FA,{radius:k/2,className:g}):v.jsx(XA,{dimensions:L,lineWidth:o,variant:n,className:g})}),v.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${H})`})]})}nS.displayName="Background";const QA=Q.memo(nS);function KA(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:v.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function JA(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:v.jsx("path",{d:"M0 0h32v4.2H0z"})})}function WA(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:v.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function e3(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function t3(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function ec({children:e,className:n,...i}){return v.jsx("button",{type:"button",className:_t(["react-flow__controls-button",n]),...i,children:e})}const n3=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function iS({style:e,showZoom:n=!0,showFitView:i=!0,showInteractive:a=!0,fitViewOptions:o,onZoomIn:s,onZoomOut:u,onFitView:f,onInteractiveChange:h,className:d,children:g,position:m="bottom-left",orientation:x="vertical","aria-label":b}){const w=ct(),{isInteractive:E,minZoomReached:N,maxZoomReached:_,ariaLabelConfig:D}=Ye(n3,ut),{zoomIn:k,zoomOut:C,fitView:L}=wm(),A=()=>{k(),s?.()},H=()=>{C(),u?.()},F=()=>{L(o),f?.()},G=()=>{w.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),h?.(!E)},q=x==="horizontal"?"horizontal":"vertical";return v.jsxs(af,{className:_t(["react-flow__controls",q,d]),position:m,style:e,"data-testid":"rf__controls","aria-label":b??D["controls.ariaLabel"],children:[n&&v.jsxs(v.Fragment,{children:[v.jsx(ec,{onClick:A,className:"react-flow__controls-zoomin",title:D["controls.zoomIn.ariaLabel"],"aria-label":D["controls.zoomIn.ariaLabel"],disabled:_,children:v.jsx(KA,{})}),v.jsx(ec,{onClick:H,className:"react-flow__controls-zoomout",title:D["controls.zoomOut.ariaLabel"],"aria-label":D["controls.zoomOut.ariaLabel"],disabled:N,children:v.jsx(JA,{})})]}),i&&v.jsx(ec,{className:"react-flow__controls-fitview",onClick:F,title:D["controls.fitView.ariaLabel"],"aria-label":D["controls.fitView.ariaLabel"],children:v.jsx(WA,{})}),a&&v.jsx(ec,{className:"react-flow__controls-interactive",onClick:G,title:D["controls.interactive.ariaLabel"],"aria-label":D["controls.interactive.ariaLabel"],children:E?v.jsx(t3,{}):v.jsx(e3,{})}),g]})}iS.displayName="Controls";const i3=Q.memo(iS);function r3({id:e,x:n,y:i,width:a,height:o,style:s,color:u,strokeColor:f,strokeWidth:h,className:d,borderRadius:g,shapeRendering:m,selected:x,onClick:b}){const{background:w,backgroundColor:E}=s||{},N=u||w||E;return v.jsx("rect",{className:_t(["react-flow__minimap-node",{selected:x},d]),x:n,y:i,rx:g,ry:g,width:a,height:o,style:{fill:N,stroke:f,strokeWidth:h},shapeRendering:m,onClick:b?_=>b(_,e):void 0})}const a3=Q.memo(r3),l3=e=>e.nodes.map(n=>n.id),Jh=e=>e instanceof Function?e:()=>e;function o3({nodeStrokeColor:e,nodeColor:n,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s=a3,onClick:u}){const f=Ye(l3,ut),h=Jh(n),d=Jh(e),g=Jh(i),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return v.jsx(v.Fragment,{children:f.map(x=>v.jsx(u3,{id:x,nodeColorFunc:h,nodeStrokeColorFunc:d,nodeClassNameFunc:g,nodeBorderRadius:a,nodeStrokeWidth:o,NodeComponent:s,onClick:u,shapeRendering:m},x))})}function s3({id:e,nodeColorFunc:n,nodeStrokeColorFunc:i,nodeClassNameFunc:a,nodeBorderRadius:o,nodeStrokeWidth:s,shapeRendering:u,NodeComponent:f,onClick:h}){const{node:d,x:g,y:m,width:x,height:b}=Ye(w=>{const{internals:E}=w.nodeLookup.get(e),N=E.userNode,{x:_,y:D}=E.positionAbsolute,{width:k,height:C}=Bi(N);return{node:N,x:_,y:D,width:k,height:C}},ut);return!d||d.hidden||!nw(d)?null:v.jsx(f,{x:g,y:m,width:x,height:b,style:d.style,selected:!!d.selected,className:a(d),color:n(d),borderRadius:o,strokeColor:i(d),strokeWidth:s,shapeRendering:u,onClick:h,id:d.id})}const u3=Q.memo(s3);var c3=Q.memo(o3);const f3=200,d3=150,h3=e=>!e.hidden,p3=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?tw(ds(e.nodeLookup,{filter:h3}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},m3="react-flow__minimap-desc";function rS({style:e,className:n,nodeStrokeColor:i,nodeColor:a,nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:u,nodeComponent:f,bgColor:h,maskColor:d,maskStrokeColor:g,maskStrokeWidth:m,position:x="bottom-right",onClick:b,onNodeClick:w,pannable:E=!1,zoomable:N=!1,ariaLabel:_,inversePan:D,zoomStep:k=1,offsetScale:C=5}){const L=ct(),A=Q.useRef(null),{boundingRect:H,viewBB:F,rfId:G,panZoom:q,translateExtent:V,flowWidth:P,flowHeight:te,ariaLabelConfig:O}=Ye(p3,ut),B=e?.width??f3,j=e?.height??d3,U=H.width/B,Y=H.height/j,K=Math.max(U,Y),z=K*B,R=K*j,$=C*K,T=H.x-(z-H.width)/2-$,ie=H.y-(R-H.height)/2-$,ce=z+$*2,fe=R+$*2,he=`${m3}-${G}`,ue=Q.useRef(0),me=Q.useRef();ue.current=K,Q.useEffect(()=>{if(A.current&&q)return me.current=DM({domNode:A.current,panZoom:q,getTransform:()=>L.getState().transform,getViewScale:()=>ue.current}),()=>{me.current?.destroy()}},[q]),Q.useEffect(()=>{me.current?.update({translateExtent:V,width:P,height:te,inversePan:D,pannable:E,zoomStep:k,zoomable:N})},[E,N,D,k,V,P,te]);const Ee=b?Ne=>{const[Re,Ze]=me.current?.pointer(Ne)||[0,0];b(Ne,{x:Re,y:Ze})}:void 0,Ce=w?Q.useCallback((Ne,Re)=>{const Ze=L.getState().nodeLookup.get(Re).internals.userNode;w(Ne,Ze)},[]):void 0,we=_??O["minimap.ariaLabel"];return v.jsx(af,{position:x,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*K:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:_t(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:v.jsxs("svg",{width:B,height:j,viewBox:`${T} ${ie} ${ce} ${fe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":he,ref:A,onClick:Ee,children:[we&&v.jsx("title",{id:he,children:we}),v.jsx(c3,{onClick:Ce,nodeColor:a,nodeStrokeColor:i,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:u,nodeComponent:f}),v.jsx("path",{className:"react-flow__minimap-mask",d:`M${T-$},${ie-$}h${ce+$*2}v${fe+$*2}h${-ce-$*2}z
|
|
15
|
+
M${F.x},${F.y}h${F.width}v${F.height}h${-F.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}rS.displayName="MiniMap";const g3=Q.memo(rS),y3=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,x3={[pl.Line]:"right",[pl.Handle]:"bottom-right"};function b3({nodeId:e,position:n,variant:i=pl.Handle,className:a,style:o=void 0,children:s,color:u,minWidth:f=10,minHeight:h=10,maxWidth:d=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:x,autoScale:b=!0,shouldResize:w,onResizeStart:E,onResize:N,onResizeEnd:_}){const D=Ow(),k=typeof e=="string"?e:D,C=ct(),L=Q.useRef(null),A=i===pl.Handle,H=Ye(Q.useCallback(y3(A&&b),[A,b]),ut),F=Q.useRef(null),G=n??x3[i];Q.useEffect(()=>{if(!(!L.current||!k))return F.current||(F.current=FM({domNode:L.current,nodeId:k,getStoreItems:()=>{const{nodeLookup:V,transform:P,snapGrid:te,snapToGrid:O,nodeOrigin:B,domNode:j}=C.getState();return{nodeLookup:V,transform:P,snapGrid:te,snapToGrid:O,nodeOrigin:B,paneDomNode:j}},onChange:(V,P)=>{const{triggerNodeChanges:te,nodeLookup:O,parentLookup:B,nodeOrigin:j}=C.getState(),U=[],Y={x:V.x,y:V.y},K=O.get(k);if(K&&K.expandParent&&K.parentId){const z=K.origin??j,R=V.width??K.measured.width??0,$=V.height??K.measured.height??0,T={id:K.id,parentId:K.parentId,rect:{width:R,height:$,...iw({x:V.x??K.position.x,y:V.y??K.position.y},{width:R,height:$},K.parentId,O,z)}},ie=vm([T],O,B,j);U.push(...ie),Y.x=V.x?Math.max(z[0]*R,V.x):void 0,Y.y=V.y?Math.max(z[1]*$,V.y):void 0}if(Y.x!==void 0&&Y.y!==void 0){const z={id:k,type:"position",position:{...Y}};U.push(z)}if(V.width!==void 0&&V.height!==void 0){const R={id:k,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:V.width,height:V.height}};U.push(R)}for(const z of P){const R={...z,type:"position"};U.push(R)}te(U)},onEnd:({width:V,height:P})=>{const te={id:k,type:"dimensions",resizing:!1,dimensions:{width:V,height:P}};C.getState().triggerNodeChanges([te])}})),F.current.update({controlPosition:G,boundaries:{minWidth:f,minHeight:h,maxWidth:d,maxHeight:g},keepAspectRatio:m,resizeDirection:x,onResizeStart:E,onResize:N,onResizeEnd:_,shouldResize:w}),()=>{F.current?.destroy()}},[G,f,h,d,g,m,E,N,_,w]);const q=G.split("-");return v.jsx("div",{className:_t(["react-flow__resize-control","nodrag",...q,i,a]),ref:L,style:{...o,scale:H,...u&&{[A?"backgroundColor":"borderColor"]:u}},children:s})}Q.memo(b3);const aS=(...e)=>e.filter((n,i,a)=>!!n&&n.trim()!==""&&a.indexOf(n)===i).join(" ").trim();const v3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const w3=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,a)=>a?a.toUpperCase():i.toLowerCase());const Kb=e=>{const n=w3(e);return n.charAt(0).toUpperCase()+n.slice(1)};var S3={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const _3=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1};const k3=Q.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:o="",children:s,iconNode:u,...f},h)=>Q.createElement("svg",{ref:h,...S3,width:n,height:n,stroke:e,strokeWidth:a?Number(i)*24/Number(n):i,className:aS("lucide",o),...!s&&!_3(f)&&{"aria-hidden":"true"},...f},[...u.map(([d,g])=>Q.createElement(d,g)),...Array.isArray(s)?s:[s]]));const Oe=(e,n)=>{const i=Q.forwardRef(({className:a,...o},s)=>Q.createElement(k3,{ref:s,iconNode:n,className:aS(`lucide-${v3(Kb(e))}`,`lucide-${e}`,a),...o}));return i.displayName=Kb(e),i};const E3=[["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"}]],_m=Oe("anchor",E3);const N3=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],C3=Oe("arrow-left",N3);const M3=[["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"}]],T3=Oe("bot",M3);const A3=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],sf=Oe("chart-column",A3);const z3=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],j3=Oe("check",z3);const D3=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],R3=Oe("chevron-down",D3);const O3=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],L3=Oe("chevron-up",O3);const H3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Up=Oe("circle-alert",H3);const B3=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],km=Oe("circle-check-big",B3);const U3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],I3=Oe("circle-check",U3);const q3=[["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"}]],lS=Oe("circle-x",q3);const $3=[["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"}]],rl=Oe("download",$3);const V3=[["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"}]],P3=Oe("eye-off",V3);const Y3=[["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"}]],oS=Oe("eye",Y3);const X3=[["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"}]],al=Oe("file-text",X3);const F3=[["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"}]],Jb=Oe("folder-open",F3);const G3=[["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"}]],Z3=Oe("globe",G3);const Q3=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],sS=Oe("image",Q3);const K3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],J3=Oe("info",K3);const W3=[["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"}]],e5=Oe("key",W3);const t5=[["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"}]],n5=Oe("link-2",t5);const i5=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],uS=Oe("loader-circle",i5);const r5=[["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"}]],a5=Oe("maximize-2",r5);const l5=[["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"}]],uf=Oe("message-square",l5);const o5=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],s5=Oe("minimize-2",o5);const u5=[["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"}]],Em=Oe("play",u5);const c5=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],f5=Oe("save",c5);const d5=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],h5=Oe("send",d5);const p5=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],m5=Oe("server",p5);const g5=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],y5=Oe("settings-2",g5);const x5=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],cS=Oe("settings",x5);const b5=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],ms=Oe("sparkles",b5);const v5=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],ra=Oe("terminal",v5);const w5=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],cf=Oe("trash-2",w5);const S5=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],_5=Oe("triangle-alert",S5);const k5=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],E5=Oe("upload",k5);const N5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Nm=Oe("x",N5);const C5=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],ff=Oe("zap",C5),Wb=e=>{let n;const i=new Set,a=(d,g)=>{const m=typeof d=="function"?d(n):d;if(!Object.is(m,n)){const x=n;n=g??(typeof m!="object"||m===null)?m:Object.assign({},n,m),i.forEach(b=>b(n,x))}},o=()=>n,f={setState:a,getState:o,getInitialState:()=>h,subscribe:d=>(i.add(d),()=>i.delete(d))},h=n=e(a,o,f);return f},M5=(e=>e?Wb(e):Wb),T5=e=>e;function A5(e,n=T5){const i=Uo.useSyncExternalStore(e.subscribe,Uo.useCallback(()=>n(e.getState()),[e,n]),Uo.useCallback(()=>n(e.getInitialState()),[e,n]));return Uo.useDebugValue(i),i}const e1=e=>{const n=M5(e),i=a=>A5(n,a);return Object.assign(i,n),i},df=(e=>e?e1(e):e1);function z5(e,n){let i;try{i=e()}catch{return}return{getItem:o=>{var s;const u=h=>h===null?null:JSON.parse(h,void 0),f=(s=i.getItem(o))!=null?s:null;return f instanceof Promise?f.then(u):u(f)},setItem:(o,s)=>i.setItem(o,JSON.stringify(s,void 0)),removeItem:o=>i.removeItem(o)}}const Ip=e=>n=>{try{const i=e(n);return i instanceof Promise?i:{then(a){return Ip(a)(i)},catch(a){return this}}}catch(i){return{then(a){return this},catch(a){return Ip(a)(i)}}}},j5=(e,n)=>(i,a,o)=>{let s={storage:z5(()=>localStorage),partialize:N=>N,version:0,merge:(N,_)=>({..._,...N}),...n},u=!1,f=0;const h=new Set,d=new Set;let g=s.storage;if(!g)return e((...N)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),i(...N)},a,o);const m=()=>{const N=s.partialize({...a()});return g.setItem(s.name,{state:N,version:s.version})},x=o.setState;o.setState=(N,_)=>(x(N,_),m());const b=e((...N)=>(i(...N),m()),a,o);o.getInitialState=()=>b;let w;const E=()=>{var N,_;if(!g)return;const D=++f;u=!1,h.forEach(C=>{var L;return C((L=a())!=null?L:b)});const k=((_=s.onRehydrateStorage)==null?void 0:_.call(s,(N=a())!=null?N:b))||void 0;return Ip(g.getItem.bind(g))(s.name).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==s.version){if(s.migrate){const L=s.migrate(C.state,C.version);return L instanceof Promise?L.then(A=>[!0,A]):[!0,L]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,C.state];return[!1,void 0]}).then(C=>{var L;if(D!==f)return;const[A,H]=C;if(w=s.merge(H,(L=a())!=null?L:b),i(w,!0),A)return m()}).then(()=>{D===f&&(k?.(w,void 0),w=a(),u=!0,d.forEach(C=>C(w)))}).catch(C=>{D===f&&k?.(void 0,C)})};return o.persist={setOptions:N=>{s={...s,...N},N.storage&&(g=N.storage)},clearStorage:()=>{g?.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>E(),hasHydrated:()=>u,onHydrate:N=>(h.add(N),()=>{h.delete(N)}),onFinishHydration:N=>(d.add(N),()=>{d.delete(N)})},s.skipHydration||E(),w||b},fS=j5,D5="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let rs=(e=21)=>{let n="",i=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)n+=D5[i[e]&63];return n};const Hi=df()(fS(e=>({nodes:[],edges:[],selectedNodeId:null,workflowId:rs(),workflowName:"Untitled Workflow",isDraft:!0,addNode:n=>e(i=>({nodes:[...i.nodes,n]})),updateNode:(n,i)=>e(a=>({nodes:a.nodes.map(o=>o.id===n?{...o,data:{...o.data,...i}}:o)})),updateNodeStatus:(n,i,a)=>e(o=>({nodes:o.nodes.map(s=>s.id===n?{...s,data:{...s.data,status:i,progress:a??s.data.progress}}:s)})),removeNode:n=>e(i=>({nodes:i.nodes.filter(a=>a.id!==n),edges:i.edges.filter(a=>a.source!==n&&a.target!==n),selectedNodeId:i.selectedNodeId===n?null:i.selectedNodeId})),setSelectedNode:n=>e({selectedNodeId:n}),addEdge:n=>e(i=>({edges:[...i.edges,n]})),removeEdge:n=>e(i=>({edges:i.edges.filter(a=>a.id!==n)})),setWorkflowName:n=>e({workflowName:n}),loadWorkflow:n=>e({nodes:n.nodes,edges:n.edges,workflowName:n.name||"Imported Workflow",selectedNodeId:null}),clearWorkflow:()=>e({nodes:[],edges:[],selectedNodeId:null}),newWorkflow:()=>e({nodes:[],edges:[],selectedNodeId:null,workflowId:rs(),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})})),dS=e=>e.nodes.find(n=>n.id===e.selectedNodeId),gs=df((e,n)=>({isRunning:!1,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:null,endTime:null,workflowResults:[],outputDir:null,logs:[],startExecution:()=>{e({isRunning:!0,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:Date.now(),endTime:null,workflowResults:[],outputDir:null}),n().addLog("info","Workflow execution started")},stopExecution:()=>{e({isRunning:!1,currentNodeId:null,endTime:Date.now()}),n().addLog("info","Workflow execution stopped")},setCurrentNode:i=>{e({currentNodeId:i}),i&&n().addLog("info","Processing node",i)},markNodeCompleted:(i,a)=>{e(o=>{const s=new Set(o.completedNodes);s.add(i);const u=new Map(o.results);return a!==void 0&&u.set(i,a),{completedNodes:s,results:u}}),n().addLog("success","Node completed",i)},markNodeFailed:(i,a)=>{e(o=>{const s=new Set(o.failedNodes);return s.add(i),{failedNodes:s}}),n().addLog("error",a||"Node failed",i)},setWorkflowResults:(i,a)=>{e({workflowResults:i,outputDir:a||null}),i.forEach(o=>{o.result&&e(s=>{const u=new Map(s.results);return u.set(o.nodeId,o.result),{results:u}})})},resetExecution:()=>{e({isRunning:!1,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:null,endTime:null,workflowResults:[],outputDir:null})},addLog:(i,a,o,s)=>{const u={id:rs(),timestamp:Date.now(),level:i,message:a,nodeId:o,details:s};e(f=>({logs:[...f.logs,u]}))},clearLogs:()=>e({logs:[]})}));function ge(e,n,i,a,o){if(typeof n=="function"?e!==n||!0:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n.set(e,i),i}function ne(e,n,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!a:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(e):a?a.value:n.get(e)}let hS=function(){const{crypto:e}=globalThis;if(e?.randomUUID)return hS=e.randomUUID.bind(e),e.randomUUID();const n=new Uint8Array(1),i=e?()=>e.getRandomValues(n)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,a=>(+a^i()&15>>+a/4).toString(16))};function as(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}const qp=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){const n=new Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(n.stack=e.stack),e.cause&&!n.cause&&(n.cause=e.cause),e.name&&(n.name=e.name),n}}catch{}try{return new Error(JSON.stringify(e))}catch{}}return new Error(e)};class Te extends Error{}class qt extends Te{constructor(n,i,a,o){super(`${qt.makeMessage(n,i,a)}`),this.status=n,this.headers=o,this.requestID=o?.get("request-id"),this.error=i}static makeMessage(n,i,a){const o=i?.message?typeof i.message=="string"?i.message:JSON.stringify(i.message):i?JSON.stringify(i):a;return n&&o?`${n} ${o}`:n?`${n} status code (no body)`:o||"(no status code or body)"}static generate(n,i,a,o){if(!n||!o)return new hf({message:a,cause:qp(i)});const s=i;return n===400?new mS(n,s,a,o):n===401?new gS(n,s,a,o):n===403?new yS(n,s,a,o):n===404?new xS(n,s,a,o):n===409?new bS(n,s,a,o):n===422?new vS(n,s,a,o):n===429?new wS(n,s,a,o):n>=500?new SS(n,s,a,o):new qt(n,s,a,o)}}class Pn extends qt{constructor({message:n}={}){super(void 0,void 0,n||"Request was aborted.",void 0)}}class hf extends qt{constructor({message:n,cause:i}){super(void 0,void 0,n||"Connection error.",void 0),i&&(this.cause=i)}}class pS extends hf{constructor({message:n}={}){super({message:n??"Request timed out."})}}class mS extends qt{}class gS extends qt{}class yS extends qt{}class xS extends qt{}class bS extends qt{}class vS extends qt{}class wS extends qt{}class SS extends qt{}const R5=/^[a-z][a-z0-9+.-]*:/i,O5=e=>R5.test(e);let $p=e=>($p=Array.isArray,$p(e)),t1=$p;function Vp(e){return typeof e!="object"?{}:e??{}}function L5(e){if(!e)return!0;for(const n in e)return!1;return!0}function H5(e,n){return Object.prototype.hasOwnProperty.call(e,n)}const B5=(e,n)=>{if(typeof n!="number"||!Number.isInteger(n))throw new Te(`${e} must be an integer`);if(n<0)throw new Te(`${e} must be a positive integer`);return n},_S=e=>{try{return JSON.parse(e)}catch{return}},U5=e=>new Promise(n=>setTimeout(n,e)),Ka="0.71.2",I5=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function q5(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const $5=()=>{const e=q5();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ka,"X-Stainless-OS":i1(Deno.build.os),"X-Stainless-Arch":n1(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ka,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ka,"X-Stainless-OS":i1(globalThis.process.platform??"unknown"),"X-Stainless-Arch":n1(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const n=V5();return n?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ka,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${n.browser}`,"X-Stainless-Runtime-Version":n.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ka,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function V5(){if(typeof navigator>"u"||!navigator)return null;const e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:n,pattern:i}of e){const a=i.exec(navigator.userAgent);if(a){const o=a[1]||0,s=a[2]||0,u=a[3]||0;return{browser:n,version:`${o}.${s}.${u}`}}}return null}const n1=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",i1=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown");let r1;const P5=()=>r1??(r1=$5());function Y5(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function kS(...e){const n=globalThis.ReadableStream;if(typeof n>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new n(...e)}function ES(e){let n=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return kS({start(){},async pull(i){const{done:a,value:o}=await n.next();a?i.close():i.enqueue(o)},async cancel(){await n.return?.()}})}function Cm(e){if(e[Symbol.asyncIterator])return e;const n=e.getReader();return{async next(){try{const i=await n.read();return i?.done&&n.releaseLock(),i}catch(i){throw n.releaseLock(),i}},async return(){const i=n.cancel();return n.releaseLock(),await i,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function X5(e){if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}const n=e.getReader(),i=n.cancel();n.releaseLock(),await i}const F5=({headers:e,body:n})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(n)});function G5(e){let n=0;for(const o of e)n+=o.length;const i=new Uint8Array(n);let a=0;for(const o of e)i.set(o,a),a+=o.length;return i}let a1;function Mm(e){let n;return(a1??(n=new globalThis.TextEncoder,a1=n.encode.bind(n)))(e)}let l1;function o1(e){let n;return(l1??(n=new globalThis.TextDecoder,l1=n.decode.bind(n)))(e)}var yn,xn;class ys{constructor(){yn.set(this,void 0),xn.set(this,void 0),ge(this,yn,new Uint8Array),ge(this,xn,null)}decode(n){if(n==null)return[];const i=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?Mm(n):n;ge(this,yn,G5([ne(this,yn,"f"),i]));const a=[];let o;for(;(o=Z5(ne(this,yn,"f"),ne(this,xn,"f")))!=null;){if(o.carriage&&ne(this,xn,"f")==null){ge(this,xn,o.index);continue}if(ne(this,xn,"f")!=null&&(o.index!==ne(this,xn,"f")+1||o.carriage)){a.push(o1(ne(this,yn,"f").subarray(0,ne(this,xn,"f")-1))),ge(this,yn,ne(this,yn,"f").subarray(ne(this,xn,"f"))),ge(this,xn,null);continue}const s=ne(this,xn,"f")!==null?o.preceding-1:o.preceding,u=o1(ne(this,yn,"f").subarray(0,s));a.push(u),ge(this,yn,ne(this,yn,"f").subarray(o.index)),ge(this,xn,null)}return a}flush(){return ne(this,yn,"f").length?this.decode(`
|
|
16
|
+
`):[]}}yn=new WeakMap,xn=new WeakMap;ys.NEWLINE_CHARS=new Set([`
|
|
17
|
+
`,"\r"]);ys.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function Z5(e,n){for(let o=n??0;o<e.length;o++){if(e[o]===10)return{preceding:o,index:o+1,carriage:!1};if(e[o]===13)return{preceding:o,index:o+1,carriage:!0}}return null}function Q5(e){for(let a=0;a<e.length-1;a++){if(e[a]===10&&e[a+1]===10||e[a]===13&&e[a+1]===13)return a+2;if(e[a]===13&&e[a+1]===10&&a+3<e.length&&e[a+2]===13&&e[a+3]===10)return a+4}return-1}const qc={off:0,error:200,warn:300,info:400,debug:500},s1=(e,n,i)=>{if(e){if(H5(qc,e))return e;Yt(i).warn(`${n} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(qc))}`)}};function $o(){}function tc(e,n,i){return!n||qc[e]>qc[i]?$o:n[e].bind(n)}const K5={error:$o,warn:$o,info:$o,debug:$o};let u1=new WeakMap;function Yt(e){const n=e.logger,i=e.logLevel??"off";if(!n)return K5;const a=u1.get(n);if(a&&a[0]===i)return a[1];const o={error:tc("error",n,i),warn:tc("warn",n,i),info:tc("info",n,i),debug:tc("debug",n,i)};return u1.set(n,[i,o]),o}const Zr=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([n,i])=>[n,n.toLowerCase()==="x-api-key"||n.toLowerCase()==="authorization"||n.toLowerCase()==="cookie"||n.toLowerCase()==="set-cookie"?"***":i]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e);var vo;class ni{constructor(n,i,a){this.iterator=n,vo.set(this,void 0),this.controller=i,ge(this,vo,a)}static fromSSEResponse(n,i,a){let o=!1;const s=a?Yt(a):console;async function*u(){if(o)throw new Te("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let f=!1;try{for await(const h of J5(n,i)){if(h.event==="completion")try{yield JSON.parse(h.data)}catch(d){throw s.error("Could not parse message into JSON:",h.data),s.error("From chunk:",h.raw),d}if(h.event==="message_start"||h.event==="message_delta"||h.event==="message_stop"||h.event==="content_block_start"||h.event==="content_block_delta"||h.event==="content_block_stop")try{yield JSON.parse(h.data)}catch(d){throw s.error("Could not parse message into JSON:",h.data),s.error("From chunk:",h.raw),d}if(h.event!=="ping"&&h.event==="error")throw new qt(void 0,_S(h.data)??h.data,void 0,n.headers)}f=!0}catch(h){if(as(h))return;throw h}finally{f||i.abort()}}return new ni(u,i,a)}static fromReadableStream(n,i,a){let o=!1;async function*s(){const f=new ys,h=Cm(n);for await(const d of h)for(const g of f.decode(d))yield g;for(const d of f.flush())yield d}async function*u(){if(o)throw new Te("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let f=!1;try{for await(const h of s())f||h&&(yield JSON.parse(h));f=!0}catch(h){if(as(h))return;throw h}finally{f||i.abort()}}return new ni(u,i,a)}[(vo=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){const n=[],i=[],a=this.iterator(),o=s=>({next:()=>{if(s.length===0){const u=a.next();n.push(u),i.push(u)}return s.shift()}});return[new ni(()=>o(n),this.controller,ne(this,vo,"f")),new ni(()=>o(i),this.controller,ne(this,vo,"f"))]}toReadableStream(){const n=this;let i;return kS({async start(){i=n[Symbol.asyncIterator]()},async pull(a){try{const{value:o,done:s}=await i.next();if(s)return a.close();const u=Mm(JSON.stringify(o)+`
|
|
18
|
+
`);a.enqueue(u)}catch(o){a.error(o)}},async cancel(){await i.return?.()}})}}async function*J5(e,n){if(!e.body)throw n.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Te("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Te("Attempted to iterate over a response with no body");const i=new ez,a=new ys,o=Cm(e.body);for await(const s of W5(o))for(const u of a.decode(s)){const f=i.decode(u);f&&(yield f)}for(const s of a.flush()){const u=i.decode(s);u&&(yield u)}}async function*W5(e){let n=new Uint8Array;for await(const i of e){if(i==null)continue;const a=i instanceof ArrayBuffer?new Uint8Array(i):typeof i=="string"?Mm(i):i;let o=new Uint8Array(n.length+a.length);o.set(n),o.set(a,n.length),n=o;let s;for(;(s=Q5(n))!==-1;)yield n.slice(0,s),n=n.slice(s)}n.length>0&&(yield n)}class ez{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(n){if(n.endsWith("\r")&&(n=n.substring(0,n.length-1)),!n){if(!this.event&&!this.data.length)return null;const s={event:this.event,data:this.data.join(`
|
|
19
|
+
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(n),n.startsWith(":"))return null;let[i,a,o]=tz(n,":");return o.startsWith(" ")&&(o=o.substring(1)),i==="event"?this.event=o:i==="data"&&this.data.push(o),null}}function tz(e,n){const i=e.indexOf(n);return i!==-1?[e.substring(0,i),n,e.substring(i+n.length)]:[e,"",""]}async function NS(e,n){const{response:i,requestLogID:a,retryOfRequestLogID:o,startTime:s}=n,u=await(async()=>{if(n.options.stream)return Yt(e).debug("response",i.status,i.url,i.headers,i.body),n.options.__streamClass?n.options.__streamClass.fromSSEResponse(i,n.controller):ni.fromSSEResponse(i,n.controller);if(i.status===204)return null;if(n.options.__binaryResponse)return i;const h=i.headers.get("content-type")?.split(";")[0]?.trim();if(h?.includes("application/json")||h?.endsWith("+json")){const m=await i.json();return CS(m,i)}return await i.text()})();return Yt(e).debug(`[${a}] response parsed`,Zr({retryOfRequestLogID:o,url:i.url,status:i.status,body:u,durationMs:Date.now()-s})),u}function CS(e,n){return!e||typeof e!="object"||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:n.headers.get("request-id"),enumerable:!1})}var Vo;class pf extends Promise{constructor(n,i,a=NS){super(o=>{o(null)}),this.responsePromise=i,this.parseResponse=a,Vo.set(this,void 0),ge(this,Vo,n)}_thenUnwrap(n){return new pf(ne(this,Vo,"f"),this.responsePromise,async(i,a)=>CS(n(await this.parseResponse(i,a),a),a.response))}asResponse(){return this.responsePromise.then(n=>n.response)}async withResponse(){const[n,i]=await Promise.all([this.parse(),this.asResponse()]);return{data:n,response:i,request_id:i.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(n=>this.parseResponse(ne(this,Vo,"f"),n))),this.parsedPromise}then(n,i){return this.parse().then(n,i)}catch(n){return this.parse().catch(n)}finally(n){return this.parse().finally(n)}}Vo=new WeakMap;var nc;class MS{constructor(n,i,a,o){nc.set(this,void 0),ge(this,nc,n),this.options=o,this.response=i,this.body=a}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){const n=this.nextPageRequestOptions();if(!n)throw new Te("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await ne(this,nc,"f").requestAPIList(this.constructor,n)}async*iterPages(){let n=this;for(yield n;n.hasNextPage();)n=await n.getNextPage(),yield n}async*[(nc=new WeakMap,Symbol.asyncIterator)](){for await(const n of this.iterPages())for(const i of n.getPaginatedItems())yield i}}class nz extends pf{constructor(n,i,a){super(n,i,async(o,s)=>new a(o,s.response,await NS(o,s),s.options))}async*[Symbol.asyncIterator](){const n=await this;for await(const i of n)yield i}}class xs extends MS{constructor(n,i,a,o){super(n,i,a,o),this.data=a.data||[],this.has_more=a.has_more||!1,this.first_id=a.first_id||null,this.last_id=a.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){const i=this.first_id;return i?{...this.options,query:{...Vp(this.options.query),before_id:i}}:null}const n=this.last_id;return n?{...this.options,query:{...Vp(this.options.query),after_id:n}}:null}}class TS extends MS{constructor(n,i,a,o){super(n,i,a,o),this.data=a.data||[],this.has_more=a.has_more||!1,this.next_page=a.next_page||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){const n=this.next_page;return n?{...this.options,query:{...Vp(this.options.query),page:n}}:null}}const AS=()=>{if(typeof File>"u"){const{process:e}=globalThis,n=typeof e?.versions?.node=="string"&&parseInt(e.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(n?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function ll(e,n,i){return AS(),new File(e,n??"unknown_file",i)}function Cc(e){return(typeof e=="object"&&e!==null&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"").split(/[\\/]/).pop()||void 0}const zS=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",Tm=async(e,n)=>({...e,body:await rz(e.body,n)}),c1=new WeakMap;function iz(e){const n=typeof e=="function"?e:e.fetch,i=c1.get(n);if(i)return i;const a=(async()=>{try{const o="Response"in n?n.Response:(await n("data:,")).constructor,s=new FormData;return s.toString()!==await new o(s).text()}catch{return!0}})();return c1.set(n,a),a}const rz=async(e,n)=>{if(!await iz(n))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");const i=new FormData;return await Promise.all(Object.entries(e||{}).map(([a,o])=>Pp(i,a,o))),i},az=e=>e instanceof Blob&&"name"in e,Pp=async(e,n,i)=>{if(i!==void 0){if(i==null)throw new TypeError(`Received null for "${n}"; to pass null in FormData, you must use the string 'null'`);if(typeof i=="string"||typeof i=="number"||typeof i=="boolean")e.append(n,String(i));else if(i instanceof Response){let a={};const o=i.headers.get("Content-Type");o&&(a={type:o}),e.append(n,ll([await i.blob()],Cc(i),a))}else if(zS(i))e.append(n,ll([await new Response(ES(i)).blob()],Cc(i)));else if(az(i))e.append(n,ll([i],Cc(i),{type:i.type}));else if(Array.isArray(i))await Promise.all(i.map(a=>Pp(e,n+"[]",a)));else if(typeof i=="object")await Promise.all(Object.entries(i).map(([a,o])=>Pp(e,`${n}[${a}]`,o)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${i} instead`)}},jS=e=>e!=null&&typeof e=="object"&&typeof e.size=="number"&&typeof e.type=="string"&&typeof e.text=="function"&&typeof e.slice=="function"&&typeof e.arrayBuffer=="function",lz=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&jS(e),oz=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function";async function sz(e,n,i){if(AS(),e=await e,n||(n=Cc(e)),lz(e))return e instanceof File&&n==null&&i==null?e:ll([await e.arrayBuffer()],n??e.name,{type:e.type,lastModified:e.lastModified,...i});if(oz(e)){const o=await e.blob();return n||(n=new URL(e.url).pathname.split(/[\\/]/).pop()),ll(await Yp(o),n,i)}const a=await Yp(e);if(!i?.type){const o=a.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof o=="string"&&(i={...i,type:o})}return ll(a,n,i)}async function Yp(e){let n=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)n.push(e);else if(jS(e))n.push(e instanceof Blob?e:await e.arrayBuffer());else if(zS(e))for await(const i of e)n.push(...await Yp(i));else{const i=e?.constructor?.name;throw new Error(`Unexpected data type: ${typeof e}${i?`; constructor: ${i}`:""}${uz(e)}`)}return n}function uz(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(i=>`"${i}"`).join(", ")}]`}class Fn{constructor(n){this._client=n}}const DS=Symbol.for("brand.privateNullableHeaders");function*cz(e){if(!e)return;if(DS in e){const{values:a,nulls:o}=e;yield*a.entries();for(const s of o)yield[s,null];return}let n=!1,i;e instanceof Headers?i=e.entries():t1(e)?i=e:(n=!0,i=Object.entries(e??{}));for(let a of i){const o=a[0];if(typeof o!="string")throw new TypeError("expected header name to be a string");const s=t1(a[1])?a[1]:[a[1]];let u=!1;for(const f of s)f!==void 0&&(n&&!u&&(u=!0,yield[o,null]),yield[o,f])}}const Ve=e=>{const n=new Headers,i=new Set;for(const a of e){const o=new Set;for(const[s,u]of cz(a)){const f=s.toLowerCase();o.has(f)||(n.delete(s),o.add(f)),u===null?(n.delete(s),i.add(f)):(n.append(s,u),i.delete(f))}}return{[DS]:!0,values:n,nulls:i}};function RS(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const f1=Object.freeze(Object.create(null)),fz=(e=RS)=>function(i,...a){if(i.length===1)return i[0];let o=!1;const s=[],u=i.reduce((g,m,x)=>{/[?#]/.test(m)&&(o=!0);const b=a[x];let w=(o?encodeURIComponent:e)(""+b);return x!==a.length&&(b==null||typeof b=="object"&&b.toString===Object.getPrototypeOf(Object.getPrototypeOf(b.hasOwnProperty??f1)??f1)?.toString)&&(w=b+"",s.push({start:g.length+m.length,length:w.length,error:`Value of type ${Object.prototype.toString.call(b).slice(8,-1)} is not a valid path parameter`})),g+m+(x===a.length?"":w)},""),f=u.split(/[?#]/,1)[0],h=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let d;for(;(d=h.exec(f))!==null;)s.push({start:d.index,length:d[0].length,error:`Value "${d[0]}" can't be safely passed as a path parameter`});if(s.sort((g,m)=>g.start-m.start),s.length>0){let g=0;const m=s.reduce((x,b)=>{const w=" ".repeat(b.start-g),E="^".repeat(b.length);return g=b.start+b.length,x+w+E},"");throw new Te(`Path parameters result in path with invalid segments:
|
|
20
|
+
${s.map(x=>x.error).join(`
|
|
21
21
|
`)}
|
|
22
22
|
${u}
|
|
23
|
-
${m}`)}return u},Ot=fz(DS);class RS extends Fn{list(n={},i){const{betas:a,...s}=n??{};return this._client.getAPIList("/v1/files",go,{query:s,...i,headers:Ve([{"anthropic-beta":[...a??[],"files-api-2025-04-14"].toString()},i?.headers])})}delete(n,i={},a){const{betas:s}=i??{};return this._client.delete(Ot`/v1/files/${n}`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"files-api-2025-04-14"].toString()},a?.headers])})}download(n,i={},a){const{betas:s}=i??{};return this._client.get(Ot`/v1/files/${n}/content`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},a?.headers]),__binaryResponse:!0})}retrieveMetadata(n,i={},a){const{betas:s}=i??{};return this._client.get(Ot`/v1/files/${n}`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"files-api-2025-04-14"].toString()},a?.headers])})}upload(n,i){const{betas:a,...s}=n;return this._client.post("/v1/files",Mm({body:s,...i,headers:Ve([{"anthropic-beta":[...a??[],"files-api-2025-04-14"].toString()},i?.headers])},this._client))}}let OS=class extends Fn{retrieve(n,i={},a){const{betas:s}=i??{};return this._client.get(Ot`/v1/models/${n}?beta=true`,{...a,headers:Ve([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},a?.headers])})}list(n={},i){const{betas:a,...s}=n??{};return this._client.getAPIList("/v1/models?beta=true",go,{query:s,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}};const LS={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192};function c1(e,n,i){return!n||!("parse"in(n.output_format??{}))?{...e,content:e.content.map(a=>{if(a.type==="text"){const s=Object.defineProperty({...a},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(s,"parsed",{get(){return i.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return a}),parsed_output:null}:HS(e,n,i)}function HS(e,n,i){let a=null;const s=e.content.map(o=>{if(o.type==="text"){const u=dz(n,o.text);a===null&&(a=u);const f=Object.defineProperty({...o},"parsed_output",{value:u,enumerable:!1});return Object.defineProperty(f,"parsed",{get(){return i.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),u},enumerable:!1})}return o});return{...e,content:s,parsed_output:a}}function dz(e,n){if(e.output_format?.type!=="json_schema")return null;try{return"parse"in e.output_format?e.output_format.parse(n):JSON.parse(n)}catch(i){throw new Te(`Failed to parse structured output: ${i}`)}}const hz=e=>{let n=0,i=[];for(;n<e.length;){let a=e[n];if(a==="\\"){n++;continue}if(a==="{"){i.push({type:"brace",value:"{"}),n++;continue}if(a==="}"){i.push({type:"brace",value:"}"}),n++;continue}if(a==="["){i.push({type:"paren",value:"["}),n++;continue}if(a==="]"){i.push({type:"paren",value:"]"}),n++;continue}if(a===":"){i.push({type:"separator",value:":"}),n++;continue}if(a===","){i.push({type:"delimiter",value:","}),n++;continue}if(a==='"'){let f="",h=!1;for(a=e[++n];a!=='"';){if(n===e.length){h=!0;break}if(a==="\\"){if(n++,n===e.length){h=!0;break}f+=a+e[n],a=e[++n]}else f+=a,a=e[++n]}a=e[++n],h||i.push({type:"string",value:f});continue}if(a&&/\s/.test(a)){n++;continue}let o=/[0-9]/;if(a&&o.test(a)||a==="-"||a==="."){let f="";for(a==="-"&&(f+=a,a=e[++n]);a&&o.test(a)||a===".";)f+=a,a=e[++n];i.push({type:"number",value:f});continue}let u=/[a-z]/i;if(a&&u.test(a)){let f="";for(;a&&u.test(a)&&n!==e.length;)f+=a,a=e[++n];if(f=="true"||f=="false"||f==="null")i.push({type:"name",value:f});else{n++;continue}continue}n++}return i},Ka=e=>{if(e.length===0)return e;let n=e[e.length-1];switch(n.type){case"separator":return e=e.slice(0,e.length-1),Ka(e);case"number":let i=n.value[n.value.length-1];if(i==="."||i==="-")return e=e.slice(0,e.length-1),Ka(e);case"string":let a=e[e.length-2];if(a?.type==="delimiter")return e=e.slice(0,e.length-1),Ka(e);if(a?.type==="brace"&&a.value==="{")return e=e.slice(0,e.length-1),Ka(e);break;case"delimiter":return e=e.slice(0,e.length-1),Ka(e)}return e},pz=e=>{let n=[];return e.map(i=>{i.type==="brace"&&(i.value==="{"?n.push("}"):n.splice(n.lastIndexOf("}"),1)),i.type==="paren"&&(i.value==="["?n.push("]"):n.splice(n.lastIndexOf("]"),1))}),n.length>0&&n.reverse().map(i=>{i==="}"?e.push({type:"brace",value:"}"}):i==="]"&&e.push({type:"paren",value:"]"})}),e},mz=e=>{let n="";return e.map(i=>{i.type==="string"?n+='"'+i.value+'"':n+=i.value}),n},BS=e=>JSON.parse(mz(pz(Ka(hz(e)))));var zn,yr,Xa,xs,nc,bs,vs,ic,ws,zi,Ss,rc,ac,Pr,lc,sc,_s,Wh,f1,oc,ep,tp,np,d1;const h1="__json_buf";function p1(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}class qc{constructor(n,i){zn.add(this),this.messages=[],this.receivedMessages=[],yr.set(this,void 0),Xa.set(this,null),this.controller=new AbortController,xs.set(this,void 0),nc.set(this,()=>{}),bs.set(this,()=>{}),vs.set(this,void 0),ic.set(this,()=>{}),ws.set(this,()=>{}),zi.set(this,{}),Ss.set(this,!1),rc.set(this,!1),ac.set(this,!1),Pr.set(this,!1),lc.set(this,void 0),sc.set(this,void 0),_s.set(this,void 0),oc.set(this,a=>{if(ge(this,rc,!0),no(a)&&(a=new Pn),a instanceof Pn)return ge(this,ac,!0),this._emit("abort",a);if(a instanceof Te)return this._emit("error",a);if(a instanceof Error){const s=new Te(a.message);return s.cause=a,this._emit("error",s)}return this._emit("error",new Te(String(a)))}),ge(this,xs,new Promise((a,s)=>{ge(this,nc,a,"f"),ge(this,bs,s,"f")})),ge(this,vs,new Promise((a,s)=>{ge(this,ic,a,"f"),ge(this,ws,s,"f")})),ne(this,xs,"f").catch(()=>{}),ne(this,vs,"f").catch(()=>{}),ge(this,Xa,n),ge(this,_s,i?.logger??console)}get response(){return ne(this,lc,"f")}get request_id(){return ne(this,sc,"f")}async withResponse(){ge(this,Pr,!0);const n=await ne(this,xs,"f");if(!n)throw new Error("Could not resolve a `Response` object");return{data:this,response:n,request_id:n.headers.get("request-id")}}static fromReadableStream(n){const i=new qc(null);return i._run(()=>i._fromReadableStream(n)),i}static createMessage(n,i,a,{logger:s}={}){const o=new qc(i,{logger:s});for(const u of i.messages)o._addMessageParam(u);return ge(o,Xa,{...i,stream:!0}),o._run(()=>o._createMessage(n,{...i,stream:!0},{...a,headers:{...a?.headers,"X-Stainless-Helper-Method":"stream"}})),o}_run(n){n().then(()=>{this._emitFinal(),this._emit("end")},ne(this,oc,"f"))}_addMessageParam(n){this.messages.push(n)}_addMessage(n,i=!0){this.receivedMessages.push(n),i&&this._emit("message",n)}async _createMessage(n,i,a){const s=a?.signal;let o;s&&(s.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),s.addEventListener("abort",o));try{ne(this,zn,"m",ep).call(this);const{response:u,data:f}=await n.create({...i,stream:!0},{...a,signal:this.controller.signal}).withResponse();this._connected(u);for await(const h of f)ne(this,zn,"m",tp).call(this,h);if(f.controller.signal?.aborted)throw new Pn;ne(this,zn,"m",np).call(this)}finally{s&&o&&s.removeEventListener("abort",o)}}_connected(n){this.ended||(ge(this,lc,n),ge(this,sc,n?.headers.get("request-id")),ne(this,nc,"f").call(this,n),this._emit("connect"))}get ended(){return ne(this,Ss,"f")}get errored(){return ne(this,rc,"f")}get aborted(){return ne(this,ac,"f")}abort(){this.controller.abort()}on(n,i){return(ne(this,zi,"f")[n]||(ne(this,zi,"f")[n]=[])).push({listener:i}),this}off(n,i){const a=ne(this,zi,"f")[n];if(!a)return this;const s=a.findIndex(o=>o.listener===i);return s>=0&&a.splice(s,1),this}once(n,i){return(ne(this,zi,"f")[n]||(ne(this,zi,"f")[n]=[])).push({listener:i,once:!0}),this}emitted(n){return new Promise((i,a)=>{ge(this,Pr,!0),n!=="error"&&this.once("error",a),this.once(n,i)})}async done(){ge(this,Pr,!0),await ne(this,vs,"f")}get currentMessage(){return ne(this,yr,"f")}async finalMessage(){return await this.done(),ne(this,zn,"m",Wh).call(this)}async finalText(){return await this.done(),ne(this,zn,"m",f1).call(this)}_emit(n,...i){if(ne(this,Ss,"f"))return;n==="end"&&(ge(this,Ss,!0),ne(this,ic,"f").call(this));const a=ne(this,zi,"f")[n];if(a&&(ne(this,zi,"f")[n]=a.filter(s=>!s.once),a.forEach(({listener:s})=>s(...i))),n==="abort"){const s=i[0];!ne(this,Pr,"f")&&!a?.length&&Promise.reject(s),ne(this,bs,"f").call(this,s),ne(this,ws,"f").call(this,s),this._emit("end");return}if(n==="error"){const s=i[0];!ne(this,Pr,"f")&&!a?.length&&Promise.reject(s),ne(this,bs,"f").call(this,s),ne(this,ws,"f").call(this,s),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ne(this,zn,"m",Wh).call(this))}async _fromReadableStream(n,i){const a=i?.signal;let s;a&&(a.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),a.addEventListener("abort",s));try{ne(this,zn,"m",ep).call(this),this._connected(null);const o=ni.fromReadableStream(n,this.controller);for await(const u of o)ne(this,zn,"m",tp).call(this,u);if(o.controller.signal?.aborted)throw new Pn;ne(this,zn,"m",np).call(this)}finally{a&&s&&a.removeEventListener("abort",s)}}[(yr=new WeakMap,Xa=new WeakMap,xs=new WeakMap,nc=new WeakMap,bs=new WeakMap,vs=new WeakMap,ic=new WeakMap,ws=new WeakMap,zi=new WeakMap,Ss=new WeakMap,rc=new WeakMap,ac=new WeakMap,Pr=new WeakMap,lc=new WeakMap,sc=new WeakMap,_s=new WeakMap,oc=new WeakMap,zn=new WeakSet,Wh=function(){if(this.receivedMessages.length===0)throw new Te("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},f1=function(){if(this.receivedMessages.length===0)throw new Te("stream ended without producing a Message with role=assistant");const i=this.receivedMessages.at(-1).content.filter(a=>a.type==="text").map(a=>a.text);if(i.length===0)throw new Te("stream ended without producing a content block with type=text");return i.join(" ")},ep=function(){this.ended||ge(this,yr,void 0)},tp=function(i){if(this.ended)return;const a=ne(this,zn,"m",d1).call(this,i);switch(this._emit("streamEvent",i,a),i.type){case"content_block_delta":{const s=a.content.at(-1);switch(i.delta.type){case"text_delta":{s.type==="text"&&this._emit("text",i.delta.text,s.text||"");break}case"citations_delta":{s.type==="text"&&this._emit("citation",i.delta.citation,s.citations??[]);break}case"input_json_delta":{p1(s)&&s.input&&this._emit("inputJson",i.delta.partial_json,s.input);break}case"thinking_delta":{s.type==="thinking"&&this._emit("thinking",i.delta.thinking,s.thinking);break}case"signature_delta":{s.type==="thinking"&&this._emit("signature",s.signature);break}default:i.delta}break}case"message_stop":{this._addMessageParam(a),this._addMessage(c1(a,ne(this,Xa,"f"),{logger:ne(this,_s,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",a.content.at(-1));break}case"message_start":{ge(this,yr,a);break}}},np=function(){if(this.ended)throw new Te("stream has ended, this shouldn't happen");const i=ne(this,yr,"f");if(!i)throw new Te("request ended without sending any chunks");return ge(this,yr,void 0),c1(i,ne(this,Xa,"f"),{logger:ne(this,_s,"f")})},d1=function(i){let a=ne(this,yr,"f");if(i.type==="message_start"){if(a)throw new Te(`Unexpected event order, got ${i.type} before receiving "message_stop"`);return i.message}if(!a)throw new Te(`Unexpected event order, got ${i.type} before "message_start"`);switch(i.type){case"message_stop":return a;case"message_delta":return a.container=i.delta.container,a.stop_reason=i.delta.stop_reason,a.stop_sequence=i.delta.stop_sequence,a.usage.output_tokens=i.usage.output_tokens,a.context_management=i.context_management,i.usage.input_tokens!=null&&(a.usage.input_tokens=i.usage.input_tokens),i.usage.cache_creation_input_tokens!=null&&(a.usage.cache_creation_input_tokens=i.usage.cache_creation_input_tokens),i.usage.cache_read_input_tokens!=null&&(a.usage.cache_read_input_tokens=i.usage.cache_read_input_tokens),i.usage.server_tool_use!=null&&(a.usage.server_tool_use=i.usage.server_tool_use),a;case"content_block_start":return a.content.push(i.content_block),a;case"content_block_delta":{const s=a.content.at(i.index);switch(i.delta.type){case"text_delta":{s?.type==="text"&&(a.content[i.index]={...s,text:(s.text||"")+i.delta.text});break}case"citations_delta":{s?.type==="text"&&(a.content[i.index]={...s,citations:[...s.citations??[],i.delta.citation]});break}case"input_json_delta":{if(s&&p1(s)){let o=s[h1]||"";o+=i.delta.partial_json;const u={...s};if(Object.defineProperty(u,h1,{value:o,enumerable:!1,writable:!0}),o)try{u.input=BS(o)}catch(f){const h=new Te(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${f}. JSON: ${o}`);ne(this,oc,"f").call(this,h)}a.content[i.index]=u}break}case"thinking_delta":{s?.type==="thinking"&&(a.content[i.index]={...s,thinking:s.thinking+i.delta.thinking});break}case"signature_delta":{s?.type==="thinking"&&(a.content[i.index]={...s,signature:i.delta.signature});break}default:i.delta}return a}case"content_block_stop":return a}},Symbol.asyncIterator)](){const n=[],i=[];let a=!1;return this.on("streamEvent",s=>{const o=i.shift();o?o.resolve(s):n.push(s)}),this.on("end",()=>{a=!0;for(const s of i)s.resolve(void 0);i.length=0}),this.on("abort",s=>{a=!0;for(const o of i)o.reject(s);i.length=0}),this.on("error",s=>{a=!0;for(const o of i)o.reject(s);i.length=0}),{next:async()=>n.length?{value:n.shift(),done:!1}:a?{value:void 0,done:!0}:new Promise((o,u)=>i.push({resolve:o,reject:u})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new ni(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}const gz=1e5,yz=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
|
|
23
|
+
${m}`)}return u},Ot=fz(RS);class OS extends Fn{list(n={},i){const{betas:a,...o}=n??{};return this._client.getAPIList("/v1/files",xs,{query:o,...i,headers:Ve([{"anthropic-beta":[...a??[],"files-api-2025-04-14"].toString()},i?.headers])})}delete(n,i={},a){const{betas:o}=i??{};return this._client.delete(Ot`/v1/files/${n}`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},a?.headers])})}download(n,i={},a){const{betas:o}=i??{};return this._client.get(Ot`/v1/files/${n}/content`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},a?.headers]),__binaryResponse:!0})}retrieveMetadata(n,i={},a){const{betas:o}=i??{};return this._client.get(Ot`/v1/files/${n}`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},a?.headers])})}upload(n,i){const{betas:a,...o}=n;return this._client.post("/v1/files",Tm({body:o,...i,headers:Ve([{"anthropic-beta":[...a??[],"files-api-2025-04-14"].toString()},i?.headers])},this._client))}}let LS=class extends Fn{retrieve(n,i={},a){const{betas:o}=i??{};return this._client.get(Ot`/v1/models/${n}?beta=true`,{...a,headers:Ve([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},a?.headers])})}list(n={},i){const{betas:a,...o}=n??{};return this._client.getAPIList("/v1/models?beta=true",xs,{query:o,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}};const HS={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192};function d1(e,n,i){return!n||!("parse"in(n.output_format??{}))?{...e,content:e.content.map(a=>{if(a.type==="text"){const o=Object.defineProperty({...a},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(o,"parsed",{get(){return i.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return a}),parsed_output:null}:BS(e,n,i)}function BS(e,n,i){let a=null;const o=e.content.map(s=>{if(s.type==="text"){const u=dz(n,s.text);a===null&&(a=u);const f=Object.defineProperty({...s},"parsed_output",{value:u,enumerable:!1});return Object.defineProperty(f,"parsed",{get(){return i.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),u},enumerable:!1})}return s});return{...e,content:o,parsed_output:a}}function dz(e,n){if(e.output_format?.type!=="json_schema")return null;try{return"parse"in e.output_format?e.output_format.parse(n):JSON.parse(n)}catch(i){throw new Te(`Failed to parse structured output: ${i}`)}}const hz=e=>{let n=0,i=[];for(;n<e.length;){let a=e[n];if(a==="\\"){n++;continue}if(a==="{"){i.push({type:"brace",value:"{"}),n++;continue}if(a==="}"){i.push({type:"brace",value:"}"}),n++;continue}if(a==="["){i.push({type:"paren",value:"["}),n++;continue}if(a==="]"){i.push({type:"paren",value:"]"}),n++;continue}if(a===":"){i.push({type:"separator",value:":"}),n++;continue}if(a===","){i.push({type:"delimiter",value:","}),n++;continue}if(a==='"'){let f="",h=!1;for(a=e[++n];a!=='"';){if(n===e.length){h=!0;break}if(a==="\\"){if(n++,n===e.length){h=!0;break}f+=a+e[n],a=e[++n]}else f+=a,a=e[++n]}a=e[++n],h||i.push({type:"string",value:f});continue}if(a&&/\s/.test(a)){n++;continue}let s=/[0-9]/;if(a&&s.test(a)||a==="-"||a==="."){let f="";for(a==="-"&&(f+=a,a=e[++n]);a&&s.test(a)||a===".";)f+=a,a=e[++n];i.push({type:"number",value:f});continue}let u=/[a-z]/i;if(a&&u.test(a)){let f="";for(;a&&u.test(a)&&n!==e.length;)f+=a,a=e[++n];if(f=="true"||f=="false"||f==="null")i.push({type:"name",value:f});else{n++;continue}continue}n++}return i},Ja=e=>{if(e.length===0)return e;let n=e[e.length-1];switch(n.type){case"separator":return e=e.slice(0,e.length-1),Ja(e);case"number":let i=n.value[n.value.length-1];if(i==="."||i==="-")return e=e.slice(0,e.length-1),Ja(e);case"string":let a=e[e.length-2];if(a?.type==="delimiter")return e=e.slice(0,e.length-1),Ja(e);if(a?.type==="brace"&&a.value==="{")return e=e.slice(0,e.length-1),Ja(e);break;case"delimiter":return e=e.slice(0,e.length-1),Ja(e)}return e},pz=e=>{let n=[];return e.map(i=>{i.type==="brace"&&(i.value==="{"?n.push("}"):n.splice(n.lastIndexOf("}"),1)),i.type==="paren"&&(i.value==="["?n.push("]"):n.splice(n.lastIndexOf("]"),1))}),n.length>0&&n.reverse().map(i=>{i==="}"?e.push({type:"brace",value:"}"}):i==="]"&&e.push({type:"paren",value:"]"})}),e},mz=e=>{let n="";return e.map(i=>{i.type==="string"?n+='"'+i.value+'"':n+=i.value}),n},US=e=>JSON.parse(mz(pz(Ja(hz(e)))));var zn,yr,Fa,wo,ic,So,_o,rc,ko,zi,Eo,ac,lc,Pr,oc,sc,No,Wh,h1,uc,ep,tp,np,p1;const m1="__json_buf";function g1(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}class $c{constructor(n,i){zn.add(this),this.messages=[],this.receivedMessages=[],yr.set(this,void 0),Fa.set(this,null),this.controller=new AbortController,wo.set(this,void 0),ic.set(this,()=>{}),So.set(this,()=>{}),_o.set(this,void 0),rc.set(this,()=>{}),ko.set(this,()=>{}),zi.set(this,{}),Eo.set(this,!1),ac.set(this,!1),lc.set(this,!1),Pr.set(this,!1),oc.set(this,void 0),sc.set(this,void 0),No.set(this,void 0),uc.set(this,a=>{if(ge(this,ac,!0),as(a)&&(a=new Pn),a instanceof Pn)return ge(this,lc,!0),this._emit("abort",a);if(a instanceof Te)return this._emit("error",a);if(a instanceof Error){const o=new Te(a.message);return o.cause=a,this._emit("error",o)}return this._emit("error",new Te(String(a)))}),ge(this,wo,new Promise((a,o)=>{ge(this,ic,a,"f"),ge(this,So,o,"f")})),ge(this,_o,new Promise((a,o)=>{ge(this,rc,a,"f"),ge(this,ko,o,"f")})),ne(this,wo,"f").catch(()=>{}),ne(this,_o,"f").catch(()=>{}),ge(this,Fa,n),ge(this,No,i?.logger??console)}get response(){return ne(this,oc,"f")}get request_id(){return ne(this,sc,"f")}async withResponse(){ge(this,Pr,!0);const n=await ne(this,wo,"f");if(!n)throw new Error("Could not resolve a `Response` object");return{data:this,response:n,request_id:n.headers.get("request-id")}}static fromReadableStream(n){const i=new $c(null);return i._run(()=>i._fromReadableStream(n)),i}static createMessage(n,i,a,{logger:o}={}){const s=new $c(i,{logger:o});for(const u of i.messages)s._addMessageParam(u);return ge(s,Fa,{...i,stream:!0}),s._run(()=>s._createMessage(n,{...i,stream:!0},{...a,headers:{...a?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(n){n().then(()=>{this._emitFinal(),this._emit("end")},ne(this,uc,"f"))}_addMessageParam(n){this.messages.push(n)}_addMessage(n,i=!0){this.receivedMessages.push(n),i&&this._emit("message",n)}async _createMessage(n,i,a){const o=a?.signal;let s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{ne(this,zn,"m",ep).call(this);const{response:u,data:f}=await n.create({...i,stream:!0},{...a,signal:this.controller.signal}).withResponse();this._connected(u);for await(const h of f)ne(this,zn,"m",tp).call(this,h);if(f.controller.signal?.aborted)throw new Pn;ne(this,zn,"m",np).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(n){this.ended||(ge(this,oc,n),ge(this,sc,n?.headers.get("request-id")),ne(this,ic,"f").call(this,n),this._emit("connect"))}get ended(){return ne(this,Eo,"f")}get errored(){return ne(this,ac,"f")}get aborted(){return ne(this,lc,"f")}abort(){this.controller.abort()}on(n,i){return(ne(this,zi,"f")[n]||(ne(this,zi,"f")[n]=[])).push({listener:i}),this}off(n,i){const a=ne(this,zi,"f")[n];if(!a)return this;const o=a.findIndex(s=>s.listener===i);return o>=0&&a.splice(o,1),this}once(n,i){return(ne(this,zi,"f")[n]||(ne(this,zi,"f")[n]=[])).push({listener:i,once:!0}),this}emitted(n){return new Promise((i,a)=>{ge(this,Pr,!0),n!=="error"&&this.once("error",a),this.once(n,i)})}async done(){ge(this,Pr,!0),await ne(this,_o,"f")}get currentMessage(){return ne(this,yr,"f")}async finalMessage(){return await this.done(),ne(this,zn,"m",Wh).call(this)}async finalText(){return await this.done(),ne(this,zn,"m",h1).call(this)}_emit(n,...i){if(ne(this,Eo,"f"))return;n==="end"&&(ge(this,Eo,!0),ne(this,rc,"f").call(this));const a=ne(this,zi,"f")[n];if(a&&(ne(this,zi,"f")[n]=a.filter(o=>!o.once),a.forEach(({listener:o})=>o(...i))),n==="abort"){const o=i[0];!ne(this,Pr,"f")&&!a?.length&&Promise.reject(o),ne(this,So,"f").call(this,o),ne(this,ko,"f").call(this,o),this._emit("end");return}if(n==="error"){const o=i[0];!ne(this,Pr,"f")&&!a?.length&&Promise.reject(o),ne(this,So,"f").call(this,o),ne(this,ko,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ne(this,zn,"m",Wh).call(this))}async _fromReadableStream(n,i){const a=i?.signal;let o;a&&(a.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),a.addEventListener("abort",o));try{ne(this,zn,"m",ep).call(this),this._connected(null);const s=ni.fromReadableStream(n,this.controller);for await(const u of s)ne(this,zn,"m",tp).call(this,u);if(s.controller.signal?.aborted)throw new Pn;ne(this,zn,"m",np).call(this)}finally{a&&o&&a.removeEventListener("abort",o)}}[(yr=new WeakMap,Fa=new WeakMap,wo=new WeakMap,ic=new WeakMap,So=new WeakMap,_o=new WeakMap,rc=new WeakMap,ko=new WeakMap,zi=new WeakMap,Eo=new WeakMap,ac=new WeakMap,lc=new WeakMap,Pr=new WeakMap,oc=new WeakMap,sc=new WeakMap,No=new WeakMap,uc=new WeakMap,zn=new WeakSet,Wh=function(){if(this.receivedMessages.length===0)throw new Te("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},h1=function(){if(this.receivedMessages.length===0)throw new Te("stream ended without producing a Message with role=assistant");const i=this.receivedMessages.at(-1).content.filter(a=>a.type==="text").map(a=>a.text);if(i.length===0)throw new Te("stream ended without producing a content block with type=text");return i.join(" ")},ep=function(){this.ended||ge(this,yr,void 0)},tp=function(i){if(this.ended)return;const a=ne(this,zn,"m",p1).call(this,i);switch(this._emit("streamEvent",i,a),i.type){case"content_block_delta":{const o=a.content.at(-1);switch(i.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",i.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",i.delta.citation,o.citations??[]);break}case"input_json_delta":{g1(o)&&o.input&&this._emit("inputJson",i.delta.partial_json,o.input);break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",i.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}default:i.delta}break}case"message_stop":{this._addMessageParam(a),this._addMessage(d1(a,ne(this,Fa,"f"),{logger:ne(this,No,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",a.content.at(-1));break}case"message_start":{ge(this,yr,a);break}}},np=function(){if(this.ended)throw new Te("stream has ended, this shouldn't happen");const i=ne(this,yr,"f");if(!i)throw new Te("request ended without sending any chunks");return ge(this,yr,void 0),d1(i,ne(this,Fa,"f"),{logger:ne(this,No,"f")})},p1=function(i){let a=ne(this,yr,"f");if(i.type==="message_start"){if(a)throw new Te(`Unexpected event order, got ${i.type} before receiving "message_stop"`);return i.message}if(!a)throw new Te(`Unexpected event order, got ${i.type} before "message_start"`);switch(i.type){case"message_stop":return a;case"message_delta":return a.container=i.delta.container,a.stop_reason=i.delta.stop_reason,a.stop_sequence=i.delta.stop_sequence,a.usage.output_tokens=i.usage.output_tokens,a.context_management=i.context_management,i.usage.input_tokens!=null&&(a.usage.input_tokens=i.usage.input_tokens),i.usage.cache_creation_input_tokens!=null&&(a.usage.cache_creation_input_tokens=i.usage.cache_creation_input_tokens),i.usage.cache_read_input_tokens!=null&&(a.usage.cache_read_input_tokens=i.usage.cache_read_input_tokens),i.usage.server_tool_use!=null&&(a.usage.server_tool_use=i.usage.server_tool_use),a;case"content_block_start":return a.content.push(i.content_block),a;case"content_block_delta":{const o=a.content.at(i.index);switch(i.delta.type){case"text_delta":{o?.type==="text"&&(a.content[i.index]={...o,text:(o.text||"")+i.delta.text});break}case"citations_delta":{o?.type==="text"&&(a.content[i.index]={...o,citations:[...o.citations??[],i.delta.citation]});break}case"input_json_delta":{if(o&&g1(o)){let s=o[m1]||"";s+=i.delta.partial_json;const u={...o};if(Object.defineProperty(u,m1,{value:s,enumerable:!1,writable:!0}),s)try{u.input=US(s)}catch(f){const h=new Te(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${f}. JSON: ${s}`);ne(this,uc,"f").call(this,h)}a.content[i.index]=u}break}case"thinking_delta":{o?.type==="thinking"&&(a.content[i.index]={...o,thinking:o.thinking+i.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(a.content[i.index]={...o,signature:i.delta.signature});break}default:i.delta}return a}case"content_block_stop":return a}},Symbol.asyncIterator)](){const n=[],i=[];let a=!1;return this.on("streamEvent",o=>{const s=i.shift();s?s.resolve(o):n.push(o)}),this.on("end",()=>{a=!0;for(const o of i)o.resolve(void 0);i.length=0}),this.on("abort",o=>{a=!0;for(const s of i)s.reject(o);i.length=0}),this.on("error",o=>{a=!0;for(const s of i)s.reject(o);i.length=0}),{next:async()=>n.length?{value:n.shift(),done:!1}:a?{value:void 0,done:!0}:new Promise((s,u)=>i.push({resolve:s,reject:u})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new ni(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}const gz=1e5,yz=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
|
|
24
24
|
1. Task Overview
|
|
25
25
|
The user's core request and success criteria
|
|
26
26
|
Any clarifications or constraints they specified
|
|
@@ -42,20 +42,20 @@ User preferences or style requirements
|
|
|
42
42
|
Domain-specific details that aren't obvious
|
|
43
43
|
Any promises made to the user
|
|
44
44
|
Be concise but complete—err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task.
|
|
45
|
-
Wrap your summary in <summary></summary> tags.`;var
|
|
46
|
-
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let o=this._client._options.timeout;if(!s.stream&&o==null){const u=LS[s.model]??void 0;o=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}return this._client.post("/v1/messages?beta=true",{body:s,timeout:o??6e5,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers]),stream:n.stream??!1})}parse(n,i){return i={...i,headers:Ve([{"anthropic-beta":[...n.betas??[],"structured-outputs-2025-11-13"].toString()},i?.headers])},this.create(n,i).then(a=>HS(a,n,{logger:this._client.logger??console}))}stream(n,i){return qc.createMessage(this,n,i)}countTokens(n,i){const{betas:a,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...i,headers:Ve([{"anthropic-beta":[...a??[],"token-counting-2024-11-01"].toString()},i?.headers])})}toolRunner(n,i){return new US(this._client,n,i)}};gf.Batches=IS;gf.BetaToolRunner=US;class qS extends Fn{create(n,i={},a){const{betas:s,...o}=i??{};return this._client.post(Ot`/v1/skills/${n}/versions?beta=true`,Mm({body:o,...a,headers:Ve([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},a?.headers])},this._client))}retrieve(n,i,a){const{skill_id:s,betas:o}=i;return this._client.get(Ot`/v1/skills/${s}/versions/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},a?.headers])})}list(n,i={},a){const{betas:s,...o}=i??{};return this._client.getAPIList(Ot`/v1/skills/${n}/versions?beta=true`,MS,{query:o,...a,headers:Ve([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},a?.headers])})}delete(n,i,a){const{skill_id:s,betas:o}=i;return this._client.delete(Ot`/v1/skills/${s}/versions/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},a?.headers])})}}class Tm extends Fn{constructor(){super(...arguments),this.versions=new qS(this._client)}create(n={},i){const{betas:a,...s}=n??{};return this._client.post("/v1/skills?beta=true",Mm({body:s,...i,headers:Ve([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},i?.headers])},this._client))}retrieve(n,i={},a){const{betas:s}=i??{};return this._client.get(Ot`/v1/skills/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},a?.headers])})}list(n={},i){const{betas:a,...s}=n??{};return this._client.getAPIList("/v1/skills?beta=true",MS,{query:s,...i,headers:Ve([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},i?.headers])})}delete(n,i={},a){const{betas:s}=i??{};return this._client.delete(Ot`/v1/skills/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},a?.headers])})}}Tm.Versions=qS;class gl extends Fn{constructor(){super(...arguments),this.models=new OS(this._client),this.messages=new gf(this._client),this.files=new RS(this._client),this.skills=new Tm(this._client)}}gl.Models=OS;gl.Messages=gf;gl.Files=RS;gl.Skills=Tm;class $S extends Fn{create(n,i){const{betas:a,...s}=n;return this._client.post("/v1/complete",{body:s,timeout:this._client._options.timeout??6e5,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers]),stream:n.stream??!1})}}var jn,br,Cs,uc,Ms,Ts,cc,As,ji,zs,fc,dc,Xr,hc,pc,ip,x1,rp,ap,lp,sp,b1;const v1="__json_buf";function w1(e){return e.type==="tool_use"||e.type==="server_tool_use"}class $c{constructor(){jn.add(this),this.messages=[],this.receivedMessages=[],br.set(this,void 0),this.controller=new AbortController,Cs.set(this,void 0),uc.set(this,()=>{}),Ms.set(this,()=>{}),Ts.set(this,void 0),cc.set(this,()=>{}),As.set(this,()=>{}),ji.set(this,{}),zs.set(this,!1),fc.set(this,!1),dc.set(this,!1),Xr.set(this,!1),hc.set(this,void 0),pc.set(this,void 0),rp.set(this,n=>{if(ge(this,fc,!0),no(n)&&(n=new Pn),n instanceof Pn)return ge(this,dc,!0),this._emit("abort",n);if(n instanceof Te)return this._emit("error",n);if(n instanceof Error){const i=new Te(n.message);return i.cause=n,this._emit("error",i)}return this._emit("error",new Te(String(n)))}),ge(this,Cs,new Promise((n,i)=>{ge(this,uc,n,"f"),ge(this,Ms,i,"f")})),ge(this,Ts,new Promise((n,i)=>{ge(this,cc,n,"f"),ge(this,As,i,"f")})),ne(this,Cs,"f").catch(()=>{}),ne(this,Ts,"f").catch(()=>{})}get response(){return ne(this,hc,"f")}get request_id(){return ne(this,pc,"f")}async withResponse(){ge(this,Xr,!0);const n=await ne(this,Cs,"f");if(!n)throw new Error("Could not resolve a `Response` object");return{data:this,response:n,request_id:n.headers.get("request-id")}}static fromReadableStream(n){const i=new $c;return i._run(()=>i._fromReadableStream(n)),i}static createMessage(n,i,a){const s=new $c;for(const o of i.messages)s._addMessageParam(o);return s._run(()=>s._createMessage(n,{...i,stream:!0},{...a,headers:{...a?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(n){n().then(()=>{this._emitFinal(),this._emit("end")},ne(this,rp,"f"))}_addMessageParam(n){this.messages.push(n)}_addMessage(n,i=!0){this.receivedMessages.push(n),i&&this._emit("message",n)}async _createMessage(n,i,a){const s=a?.signal;let o;s&&(s.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),s.addEventListener("abort",o));try{ne(this,jn,"m",ap).call(this);const{response:u,data:f}=await n.create({...i,stream:!0},{...a,signal:this.controller.signal}).withResponse();this._connected(u);for await(const h of f)ne(this,jn,"m",lp).call(this,h);if(f.controller.signal?.aborted)throw new Pn;ne(this,jn,"m",sp).call(this)}finally{s&&o&&s.removeEventListener("abort",o)}}_connected(n){this.ended||(ge(this,hc,n),ge(this,pc,n?.headers.get("request-id")),ne(this,uc,"f").call(this,n),this._emit("connect"))}get ended(){return ne(this,zs,"f")}get errored(){return ne(this,fc,"f")}get aborted(){return ne(this,dc,"f")}abort(){this.controller.abort()}on(n,i){return(ne(this,ji,"f")[n]||(ne(this,ji,"f")[n]=[])).push({listener:i}),this}off(n,i){const a=ne(this,ji,"f")[n];if(!a)return this;const s=a.findIndex(o=>o.listener===i);return s>=0&&a.splice(s,1),this}once(n,i){return(ne(this,ji,"f")[n]||(ne(this,ji,"f")[n]=[])).push({listener:i,once:!0}),this}emitted(n){return new Promise((i,a)=>{ge(this,Xr,!0),n!=="error"&&this.once("error",a),this.once(n,i)})}async done(){ge(this,Xr,!0),await ne(this,Ts,"f")}get currentMessage(){return ne(this,br,"f")}async finalMessage(){return await this.done(),ne(this,jn,"m",ip).call(this)}async finalText(){return await this.done(),ne(this,jn,"m",x1).call(this)}_emit(n,...i){if(ne(this,zs,"f"))return;n==="end"&&(ge(this,zs,!0),ne(this,cc,"f").call(this));const a=ne(this,ji,"f")[n];if(a&&(ne(this,ji,"f")[n]=a.filter(s=>!s.once),a.forEach(({listener:s})=>s(...i))),n==="abort"){const s=i[0];!ne(this,Xr,"f")&&!a?.length&&Promise.reject(s),ne(this,Ms,"f").call(this,s),ne(this,As,"f").call(this,s),this._emit("end");return}if(n==="error"){const s=i[0];!ne(this,Xr,"f")&&!a?.length&&Promise.reject(s),ne(this,Ms,"f").call(this,s),ne(this,As,"f").call(this,s),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ne(this,jn,"m",ip).call(this))}async _fromReadableStream(n,i){const a=i?.signal;let s;a&&(a.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),a.addEventListener("abort",s));try{ne(this,jn,"m",ap).call(this),this._connected(null);const o=ni.fromReadableStream(n,this.controller);for await(const u of o)ne(this,jn,"m",lp).call(this,u);if(o.controller.signal?.aborted)throw new Pn;ne(this,jn,"m",sp).call(this)}finally{a&&s&&a.removeEventListener("abort",s)}}[(br=new WeakMap,Cs=new WeakMap,uc=new WeakMap,Ms=new WeakMap,Ts=new WeakMap,cc=new WeakMap,As=new WeakMap,ji=new WeakMap,zs=new WeakMap,fc=new WeakMap,dc=new WeakMap,Xr=new WeakMap,hc=new WeakMap,pc=new WeakMap,rp=new WeakMap,jn=new WeakSet,ip=function(){if(this.receivedMessages.length===0)throw new Te("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},x1=function(){if(this.receivedMessages.length===0)throw new Te("stream ended without producing a Message with role=assistant");const i=this.receivedMessages.at(-1).content.filter(a=>a.type==="text").map(a=>a.text);if(i.length===0)throw new Te("stream ended without producing a content block with type=text");return i.join(" ")},ap=function(){this.ended||ge(this,br,void 0)},lp=function(i){if(this.ended)return;const a=ne(this,jn,"m",b1).call(this,i);switch(this._emit("streamEvent",i,a),i.type){case"content_block_delta":{const s=a.content.at(-1);switch(i.delta.type){case"text_delta":{s.type==="text"&&this._emit("text",i.delta.text,s.text||"");break}case"citations_delta":{s.type==="text"&&this._emit("citation",i.delta.citation,s.citations??[]);break}case"input_json_delta":{w1(s)&&s.input&&this._emit("inputJson",i.delta.partial_json,s.input);break}case"thinking_delta":{s.type==="thinking"&&this._emit("thinking",i.delta.thinking,s.thinking);break}case"signature_delta":{s.type==="thinking"&&this._emit("signature",s.signature);break}default:i.delta}break}case"message_stop":{this._addMessageParam(a),this._addMessage(a,!0);break}case"content_block_stop":{this._emit("contentBlock",a.content.at(-1));break}case"message_start":{ge(this,br,a);break}}},sp=function(){if(this.ended)throw new Te("stream has ended, this shouldn't happen");const i=ne(this,br,"f");if(!i)throw new Te("request ended without sending any chunks");return ge(this,br,void 0),i},b1=function(i){let a=ne(this,br,"f");if(i.type==="message_start"){if(a)throw new Te(`Unexpected event order, got ${i.type} before receiving "message_stop"`);return i.message}if(!a)throw new Te(`Unexpected event order, got ${i.type} before "message_start"`);switch(i.type){case"message_stop":return a;case"message_delta":return a.stop_reason=i.delta.stop_reason,a.stop_sequence=i.delta.stop_sequence,a.usage.output_tokens=i.usage.output_tokens,i.usage.input_tokens!=null&&(a.usage.input_tokens=i.usage.input_tokens),i.usage.cache_creation_input_tokens!=null&&(a.usage.cache_creation_input_tokens=i.usage.cache_creation_input_tokens),i.usage.cache_read_input_tokens!=null&&(a.usage.cache_read_input_tokens=i.usage.cache_read_input_tokens),i.usage.server_tool_use!=null&&(a.usage.server_tool_use=i.usage.server_tool_use),a;case"content_block_start":return a.content.push({...i.content_block}),a;case"content_block_delta":{const s=a.content.at(i.index);switch(i.delta.type){case"text_delta":{s?.type==="text"&&(a.content[i.index]={...s,text:(s.text||"")+i.delta.text});break}case"citations_delta":{s?.type==="text"&&(a.content[i.index]={...s,citations:[...s.citations??[],i.delta.citation]});break}case"input_json_delta":{if(s&&w1(s)){let o=s[v1]||"";o+=i.delta.partial_json;const u={...s};Object.defineProperty(u,v1,{value:o,enumerable:!1,writable:!0}),o&&(u.input=BS(o)),a.content[i.index]=u}break}case"thinking_delta":{s?.type==="thinking"&&(a.content[i.index]={...s,thinking:s.thinking+i.delta.thinking});break}case"signature_delta":{s?.type==="thinking"&&(a.content[i.index]={...s,signature:i.delta.signature});break}default:i.delta}return a}case"content_block_stop":return a}},Symbol.asyncIterator)](){const n=[],i=[];let a=!1;return this.on("streamEvent",s=>{const o=i.shift();o?o.resolve(s):n.push(s)}),this.on("end",()=>{a=!0;for(const s of i)s.resolve(void 0);i.length=0}),this.on("abort",s=>{a=!0;for(const o of i)o.reject(s);i.length=0}),this.on("error",s=>{a=!0;for(const o of i)o.reject(s);i.length=0}),{next:async()=>n.length?{value:n.shift(),done:!1}:a?{value:void 0,done:!0}:new Promise((o,u)=>i.push({resolve:o,reject:u})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new ni(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}class VS extends Fn{create(n,i){return this._client.post("/v1/messages/batches",{body:n,...i})}retrieve(n,i){return this._client.get(Ot`/v1/messages/batches/${n}`,i)}list(n={},i){return this._client.getAPIList("/v1/messages/batches",go,{query:n,...i})}delete(n,i){return this._client.delete(Ot`/v1/messages/batches/${n}`,i)}cancel(n,i){return this._client.post(Ot`/v1/messages/batches/${n}/cancel`,i)}async results(n,i){const a=await this.retrieve(n);if(!a.results_url)throw new Te(`No batch \`results_url\`; Has it finished processing? ${a.processing_status} - ${a.id}`);return this._client.get(a.results_url,{...i,headers:Ve([{Accept:"application/binary"},i?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((s,o)=>mf.fromResponse(o.response,o.controller))}}class Am extends Fn{constructor(){super(...arguments),this.batches=new VS(this._client)}create(n,i){n.model in S1&&console.warn(`The model '${n.model}' is deprecated and will reach end-of-life on ${S1[n.model]}
|
|
47
|
-
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let a=this._client._options.timeout;if(!n.stream&&a==null){const
|
|
45
|
+
Wrap your summary in <summary></summary> tags.`;var Co,Ga,Yr,Mt,Mo,gn,Di,xr,To,y1,Xp;function x1(){let e,n;return{promise:new Promise((a,o)=>{e=a,n=o}),resolve:e,reject:n}}class IS{constructor(n,i,a){Co.add(this),this.client=n,Ga.set(this,!1),Yr.set(this,!1),Mt.set(this,void 0),Mo.set(this,void 0),gn.set(this,void 0),Di.set(this,void 0),xr.set(this,void 0),To.set(this,0),ge(this,Mt,{params:{...i,messages:structuredClone(i.messages)}}),ge(this,Mo,{...a,headers:Ve([{"x-stainless-helper":"BetaToolRunner"},a?.headers])}),ge(this,xr,x1())}async*[(Ga=new WeakMap,Yr=new WeakMap,Mt=new WeakMap,Mo=new WeakMap,gn=new WeakMap,Di=new WeakMap,xr=new WeakMap,To=new WeakMap,Co=new WeakSet,y1=async function(){const i=ne(this,Mt,"f").params.compactionControl;if(!i||!i.enabled)return!1;let a=0;if(ne(this,gn,"f")!==void 0)try{const d=await ne(this,gn,"f");a=d.usage.input_tokens+(d.usage.cache_creation_input_tokens??0)+(d.usage.cache_read_input_tokens??0)+d.usage.output_tokens}catch{return!1}const o=i.contextTokenThreshold??gz;if(a<o)return!1;const s=i.model??ne(this,Mt,"f").params.model,u=i.summaryPrompt??yz,f=ne(this,Mt,"f").params.messages;if(f[f.length-1].role==="assistant"){const d=f[f.length-1];if(Array.isArray(d.content)){const g=d.content.filter(m=>m.type!=="tool_use");g.length===0?f.pop():d.content=g}}const h=await this.client.beta.messages.create({model:s,messages:[...f,{role:"user",content:[{type:"text",text:u}]}],max_tokens:ne(this,Mt,"f").params.max_tokens},{headers:{"x-stainless-helper":"compaction"}});if(h.content[0]?.type!=="text")throw new Te("Expected text response for compaction");return ne(this,Mt,"f").params.messages=[{role:"user",content:h.content}],!0},Symbol.asyncIterator)](){var n;if(ne(this,Ga,"f"))throw new Te("Cannot iterate over a consumed stream");ge(this,Ga,!0),ge(this,Yr,!0),ge(this,Di,void 0);try{for(;;){let i;try{if(ne(this,Mt,"f").params.max_iterations&&ne(this,To,"f")>=ne(this,Mt,"f").params.max_iterations)break;ge(this,Yr,!1,"f"),ge(this,Di,void 0,"f"),ge(this,To,(n=ne(this,To,"f"),n++,n),"f"),ge(this,gn,void 0,"f");const{max_iterations:a,compactionControl:o,...s}=ne(this,Mt,"f").params;if(s.stream?(i=this.client.beta.messages.stream({...s},ne(this,Mo,"f")),ge(this,gn,i.finalMessage(),"f"),ne(this,gn,"f").catch(()=>{}),yield i):(ge(this,gn,this.client.beta.messages.create({...s,stream:!1},ne(this,Mo,"f")),"f"),yield ne(this,gn,"f")),!await ne(this,Co,"m",y1).call(this)){if(!ne(this,Yr,"f")){const{role:h,content:d}=await ne(this,gn,"f");ne(this,Mt,"f").params.messages.push({role:h,content:d})}const f=await ne(this,Co,"m",Xp).call(this,ne(this,Mt,"f").params.messages.at(-1));if(f)ne(this,Mt,"f").params.messages.push(f);else if(!ne(this,Yr,"f"))break}}finally{i&&i.abort()}}if(!ne(this,gn,"f"))throw new Te("ToolRunner concluded without a message from the server");ne(this,xr,"f").resolve(await ne(this,gn,"f"))}catch(i){throw ge(this,Ga,!1),ne(this,xr,"f").promise.catch(()=>{}),ne(this,xr,"f").reject(i),ge(this,xr,x1()),i}}setMessagesParams(n){typeof n=="function"?ne(this,Mt,"f").params=n(ne(this,Mt,"f").params):ne(this,Mt,"f").params=n,ge(this,Yr,!0),ge(this,Di,void 0)}async generateToolResponse(){const n=await ne(this,gn,"f")??this.params.messages.at(-1);return n?ne(this,Co,"m",Xp).call(this,n):null}done(){return ne(this,xr,"f").promise}async runUntilDone(){if(!ne(this,Ga,"f"))for await(const n of this);return this.done()}get params(){return ne(this,Mt,"f").params}pushMessages(...n){this.setMessagesParams(i=>({...i,messages:[...i.messages,...n]}))}then(n,i){return this.runUntilDone().then(n,i)}}Xp=async function(n){return ne(this,Di,"f")!==void 0?ne(this,Di,"f"):(ge(this,Di,xz(ne(this,Mt,"f").params,n)),ne(this,Di,"f"))};async function xz(e,n=e.messages.at(-1)){if(!n||n.role!=="assistant"||!n.content||typeof n.content=="string")return null;const i=n.content.filter(o=>o.type==="tool_use");return i.length===0?null:{role:"user",content:await Promise.all(i.map(async o=>{const s=e.tools.find(u=>("name"in u?u.name:u.mcp_server_name)===o.name);if(!s||!("run"in s))return{type:"tool_result",tool_use_id:o.id,content:`Error: Tool '${o.name}' not found`,is_error:!0};try{let u=o.input;"parse"in s&&s.parse&&(u=s.parse(u));const f=await s.run(u);return{type:"tool_result",tool_use_id:o.id,content:f}}catch(u){return{type:"tool_result",tool_use_id:o.id,content:`Error: ${u instanceof Error?u.message:String(u)}`,is_error:!0}}}))}}class mf{constructor(n,i){this.iterator=n,this.controller=i}async*decoder(){const n=new ys;for await(const i of this.iterator)for(const a of n.decode(i))yield JSON.parse(a);for(const i of n.flush())yield JSON.parse(i)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(n,i){if(!n.body)throw i.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Te("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Te("Attempted to iterate over a response with no body");return new mf(Cm(n.body),i)}}let qS=class extends Fn{create(n,i){const{betas:a,...o}=n;return this._client.post("/v1/messages/batches?beta=true",{body:o,...i,headers:Ve([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString()},i?.headers])})}retrieve(n,i={},a){const{betas:o}=i??{};return this._client.get(Ot`/v1/messages/batches/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},a?.headers])})}list(n={},i){const{betas:a,...o}=n??{};return this._client.getAPIList("/v1/messages/batches?beta=true",xs,{query:o,...i,headers:Ve([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString()},i?.headers])})}delete(n,i={},a){const{betas:o}=i??{};return this._client.delete(Ot`/v1/messages/batches/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},a?.headers])})}cancel(n,i={},a){const{betas:o}=i??{};return this._client.post(Ot`/v1/messages/batches/${n}/cancel?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},a?.headers])})}async results(n,i={},a){const o=await this.retrieve(n);if(!o.results_url)throw new Te(`No batch \`results_url\`; Has it finished processing? ${o.processing_status} - ${o.id}`);const{betas:s}=i??{};return this._client.get(o.results_url,{...a,headers:Ve([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},a?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((u,f)=>mf.fromResponse(f.response,f.controller))}};const b1={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"};let gf=class extends Fn{constructor(){super(...arguments),this.batches=new qS(this._client)}create(n,i){const{betas:a,...o}=n;o.model in b1&&console.warn(`The model '${o.model}' is deprecated and will reach end-of-life on ${b1[o.model]}
|
|
46
|
+
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let s=this._client._options.timeout;if(!o.stream&&s==null){const u=HS[o.model]??void 0;s=this._client.calculateNonstreamingTimeout(o.max_tokens,u)}return this._client.post("/v1/messages?beta=true",{body:o,timeout:s??6e5,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers]),stream:n.stream??!1})}parse(n,i){return i={...i,headers:Ve([{"anthropic-beta":[...n.betas??[],"structured-outputs-2025-11-13"].toString()},i?.headers])},this.create(n,i).then(a=>BS(a,n,{logger:this._client.logger??console}))}stream(n,i){return $c.createMessage(this,n,i)}countTokens(n,i){const{betas:a,...o}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:o,...i,headers:Ve([{"anthropic-beta":[...a??[],"token-counting-2024-11-01"].toString()},i?.headers])})}toolRunner(n,i){return new IS(this._client,n,i)}};gf.Batches=qS;gf.BetaToolRunner=IS;class $S extends Fn{create(n,i={},a){const{betas:o,...s}=i??{};return this._client.post(Ot`/v1/skills/${n}/versions?beta=true`,Tm({body:s,...a,headers:Ve([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},a?.headers])},this._client))}retrieve(n,i,a){const{skill_id:o,betas:s}=i;return this._client.get(Ot`/v1/skills/${o}/versions/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},a?.headers])})}list(n,i={},a){const{betas:o,...s}=i??{};return this._client.getAPIList(Ot`/v1/skills/${n}/versions?beta=true`,TS,{query:s,...a,headers:Ve([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},a?.headers])})}delete(n,i,a){const{skill_id:o,betas:s}=i;return this._client.delete(Ot`/v1/skills/${o}/versions/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},a?.headers])})}}class Am extends Fn{constructor(){super(...arguments),this.versions=new $S(this._client)}create(n={},i){const{betas:a,...o}=n??{};return this._client.post("/v1/skills?beta=true",Tm({body:o,...i,headers:Ve([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},i?.headers])},this._client))}retrieve(n,i={},a){const{betas:o}=i??{};return this._client.get(Ot`/v1/skills/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},a?.headers])})}list(n={},i){const{betas:a,...o}=n??{};return this._client.getAPIList("/v1/skills?beta=true",TS,{query:o,...i,headers:Ve([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},i?.headers])})}delete(n,i={},a){const{betas:o}=i??{};return this._client.delete(Ot`/v1/skills/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},a?.headers])})}}Am.Versions=$S;class yl extends Fn{constructor(){super(...arguments),this.models=new LS(this._client),this.messages=new gf(this._client),this.files=new OS(this._client),this.skills=new Am(this._client)}}yl.Models=LS;yl.Messages=gf;yl.Files=OS;yl.Skills=Am;class VS extends Fn{create(n,i){const{betas:a,...o}=n;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers]),stream:n.stream??!1})}}var jn,br,Ao,cc,zo,jo,fc,Do,ji,Ro,dc,hc,Xr,pc,mc,ip,v1,rp,ap,lp,op,w1;const S1="__json_buf";function _1(e){return e.type==="tool_use"||e.type==="server_tool_use"}class Vc{constructor(){jn.add(this),this.messages=[],this.receivedMessages=[],br.set(this,void 0),this.controller=new AbortController,Ao.set(this,void 0),cc.set(this,()=>{}),zo.set(this,()=>{}),jo.set(this,void 0),fc.set(this,()=>{}),Do.set(this,()=>{}),ji.set(this,{}),Ro.set(this,!1),dc.set(this,!1),hc.set(this,!1),Xr.set(this,!1),pc.set(this,void 0),mc.set(this,void 0),rp.set(this,n=>{if(ge(this,dc,!0),as(n)&&(n=new Pn),n instanceof Pn)return ge(this,hc,!0),this._emit("abort",n);if(n instanceof Te)return this._emit("error",n);if(n instanceof Error){const i=new Te(n.message);return i.cause=n,this._emit("error",i)}return this._emit("error",new Te(String(n)))}),ge(this,Ao,new Promise((n,i)=>{ge(this,cc,n,"f"),ge(this,zo,i,"f")})),ge(this,jo,new Promise((n,i)=>{ge(this,fc,n,"f"),ge(this,Do,i,"f")})),ne(this,Ao,"f").catch(()=>{}),ne(this,jo,"f").catch(()=>{})}get response(){return ne(this,pc,"f")}get request_id(){return ne(this,mc,"f")}async withResponse(){ge(this,Xr,!0);const n=await ne(this,Ao,"f");if(!n)throw new Error("Could not resolve a `Response` object");return{data:this,response:n,request_id:n.headers.get("request-id")}}static fromReadableStream(n){const i=new Vc;return i._run(()=>i._fromReadableStream(n)),i}static createMessage(n,i,a){const o=new Vc;for(const s of i.messages)o._addMessageParam(s);return o._run(()=>o._createMessage(n,{...i,stream:!0},{...a,headers:{...a?.headers,"X-Stainless-Helper-Method":"stream"}})),o}_run(n){n().then(()=>{this._emitFinal(),this._emit("end")},ne(this,rp,"f"))}_addMessageParam(n){this.messages.push(n)}_addMessage(n,i=!0){this.receivedMessages.push(n),i&&this._emit("message",n)}async _createMessage(n,i,a){const o=a?.signal;let s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{ne(this,jn,"m",ap).call(this);const{response:u,data:f}=await n.create({...i,stream:!0},{...a,signal:this.controller.signal}).withResponse();this._connected(u);for await(const h of f)ne(this,jn,"m",lp).call(this,h);if(f.controller.signal?.aborted)throw new Pn;ne(this,jn,"m",op).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(n){this.ended||(ge(this,pc,n),ge(this,mc,n?.headers.get("request-id")),ne(this,cc,"f").call(this,n),this._emit("connect"))}get ended(){return ne(this,Ro,"f")}get errored(){return ne(this,dc,"f")}get aborted(){return ne(this,hc,"f")}abort(){this.controller.abort()}on(n,i){return(ne(this,ji,"f")[n]||(ne(this,ji,"f")[n]=[])).push({listener:i}),this}off(n,i){const a=ne(this,ji,"f")[n];if(!a)return this;const o=a.findIndex(s=>s.listener===i);return o>=0&&a.splice(o,1),this}once(n,i){return(ne(this,ji,"f")[n]||(ne(this,ji,"f")[n]=[])).push({listener:i,once:!0}),this}emitted(n){return new Promise((i,a)=>{ge(this,Xr,!0),n!=="error"&&this.once("error",a),this.once(n,i)})}async done(){ge(this,Xr,!0),await ne(this,jo,"f")}get currentMessage(){return ne(this,br,"f")}async finalMessage(){return await this.done(),ne(this,jn,"m",ip).call(this)}async finalText(){return await this.done(),ne(this,jn,"m",v1).call(this)}_emit(n,...i){if(ne(this,Ro,"f"))return;n==="end"&&(ge(this,Ro,!0),ne(this,fc,"f").call(this));const a=ne(this,ji,"f")[n];if(a&&(ne(this,ji,"f")[n]=a.filter(o=>!o.once),a.forEach(({listener:o})=>o(...i))),n==="abort"){const o=i[0];!ne(this,Xr,"f")&&!a?.length&&Promise.reject(o),ne(this,zo,"f").call(this,o),ne(this,Do,"f").call(this,o),this._emit("end");return}if(n==="error"){const o=i[0];!ne(this,Xr,"f")&&!a?.length&&Promise.reject(o),ne(this,zo,"f").call(this,o),ne(this,Do,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ne(this,jn,"m",ip).call(this))}async _fromReadableStream(n,i){const a=i?.signal;let o;a&&(a.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),a.addEventListener("abort",o));try{ne(this,jn,"m",ap).call(this),this._connected(null);const s=ni.fromReadableStream(n,this.controller);for await(const u of s)ne(this,jn,"m",lp).call(this,u);if(s.controller.signal?.aborted)throw new Pn;ne(this,jn,"m",op).call(this)}finally{a&&o&&a.removeEventListener("abort",o)}}[(br=new WeakMap,Ao=new WeakMap,cc=new WeakMap,zo=new WeakMap,jo=new WeakMap,fc=new WeakMap,Do=new WeakMap,ji=new WeakMap,Ro=new WeakMap,dc=new WeakMap,hc=new WeakMap,Xr=new WeakMap,pc=new WeakMap,mc=new WeakMap,rp=new WeakMap,jn=new WeakSet,ip=function(){if(this.receivedMessages.length===0)throw new Te("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},v1=function(){if(this.receivedMessages.length===0)throw new Te("stream ended without producing a Message with role=assistant");const i=this.receivedMessages.at(-1).content.filter(a=>a.type==="text").map(a=>a.text);if(i.length===0)throw new Te("stream ended without producing a content block with type=text");return i.join(" ")},ap=function(){this.ended||ge(this,br,void 0)},lp=function(i){if(this.ended)return;const a=ne(this,jn,"m",w1).call(this,i);switch(this._emit("streamEvent",i,a),i.type){case"content_block_delta":{const o=a.content.at(-1);switch(i.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",i.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",i.delta.citation,o.citations??[]);break}case"input_json_delta":{_1(o)&&o.input&&this._emit("inputJson",i.delta.partial_json,o.input);break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",i.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}default:i.delta}break}case"message_stop":{this._addMessageParam(a),this._addMessage(a,!0);break}case"content_block_stop":{this._emit("contentBlock",a.content.at(-1));break}case"message_start":{ge(this,br,a);break}}},op=function(){if(this.ended)throw new Te("stream has ended, this shouldn't happen");const i=ne(this,br,"f");if(!i)throw new Te("request ended without sending any chunks");return ge(this,br,void 0),i},w1=function(i){let a=ne(this,br,"f");if(i.type==="message_start"){if(a)throw new Te(`Unexpected event order, got ${i.type} before receiving "message_stop"`);return i.message}if(!a)throw new Te(`Unexpected event order, got ${i.type} before "message_start"`);switch(i.type){case"message_stop":return a;case"message_delta":return a.stop_reason=i.delta.stop_reason,a.stop_sequence=i.delta.stop_sequence,a.usage.output_tokens=i.usage.output_tokens,i.usage.input_tokens!=null&&(a.usage.input_tokens=i.usage.input_tokens),i.usage.cache_creation_input_tokens!=null&&(a.usage.cache_creation_input_tokens=i.usage.cache_creation_input_tokens),i.usage.cache_read_input_tokens!=null&&(a.usage.cache_read_input_tokens=i.usage.cache_read_input_tokens),i.usage.server_tool_use!=null&&(a.usage.server_tool_use=i.usage.server_tool_use),a;case"content_block_start":return a.content.push({...i.content_block}),a;case"content_block_delta":{const o=a.content.at(i.index);switch(i.delta.type){case"text_delta":{o?.type==="text"&&(a.content[i.index]={...o,text:(o.text||"")+i.delta.text});break}case"citations_delta":{o?.type==="text"&&(a.content[i.index]={...o,citations:[...o.citations??[],i.delta.citation]});break}case"input_json_delta":{if(o&&_1(o)){let s=o[S1]||"";s+=i.delta.partial_json;const u={...o};Object.defineProperty(u,S1,{value:s,enumerable:!1,writable:!0}),s&&(u.input=US(s)),a.content[i.index]=u}break}case"thinking_delta":{o?.type==="thinking"&&(a.content[i.index]={...o,thinking:o.thinking+i.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(a.content[i.index]={...o,signature:i.delta.signature});break}default:i.delta}return a}case"content_block_stop":return a}},Symbol.asyncIterator)](){const n=[],i=[];let a=!1;return this.on("streamEvent",o=>{const s=i.shift();s?s.resolve(o):n.push(o)}),this.on("end",()=>{a=!0;for(const o of i)o.resolve(void 0);i.length=0}),this.on("abort",o=>{a=!0;for(const s of i)s.reject(o);i.length=0}),this.on("error",o=>{a=!0;for(const s of i)s.reject(o);i.length=0}),{next:async()=>n.length?{value:n.shift(),done:!1}:a?{value:void 0,done:!0}:new Promise((s,u)=>i.push({resolve:s,reject:u})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new ni(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}class PS extends Fn{create(n,i){return this._client.post("/v1/messages/batches",{body:n,...i})}retrieve(n,i){return this._client.get(Ot`/v1/messages/batches/${n}`,i)}list(n={},i){return this._client.getAPIList("/v1/messages/batches",xs,{query:n,...i})}delete(n,i){return this._client.delete(Ot`/v1/messages/batches/${n}`,i)}cancel(n,i){return this._client.post(Ot`/v1/messages/batches/${n}/cancel`,i)}async results(n,i){const a=await this.retrieve(n);if(!a.results_url)throw new Te(`No batch \`results_url\`; Has it finished processing? ${a.processing_status} - ${a.id}`);return this._client.get(a.results_url,{...i,headers:Ve([{Accept:"application/binary"},i?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>mf.fromResponse(s.response,s.controller))}}class zm extends Fn{constructor(){super(...arguments),this.batches=new PS(this._client)}create(n,i){n.model in k1&&console.warn(`The model '${n.model}' is deprecated and will reach end-of-life on ${k1[n.model]}
|
|
47
|
+
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let a=this._client._options.timeout;if(!n.stream&&a==null){const o=HS[n.model]??void 0;a=this._client.calculateNonstreamingTimeout(n.max_tokens,o)}return this._client.post("/v1/messages",{body:n,timeout:a??6e5,...i,stream:n.stream??!1})}stream(n,i){return Vc.createMessage(this,n,i)}countTokens(n,i){return this._client.post("/v1/messages/count_tokens",{body:n,...i})}}const k1={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"};zm.Batches=PS;class YS extends Fn{retrieve(n,i={},a){const{betas:o}=i??{};return this._client.get(Ot`/v1/models/${n}`,{...a,headers:Ve([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},a?.headers])})}list(n={},i){const{betas:a,...o}=n??{};return this._client.getAPIList("/v1/models",xs,{query:o,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}}var bz={};const gc=e=>{if(typeof globalThis.process<"u")return bz?.[e]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()};var Fp,jm,Mc,XS;const vz="\\n\\nHuman:",wz="\\n\\nAssistant:";class kt{constructor({baseURL:n=gc("ANTHROPIC_BASE_URL"),apiKey:i=gc("ANTHROPIC_API_KEY")??null,authToken:a=gc("ANTHROPIC_AUTH_TOKEN")??null,...o}={}){Fp.add(this),Mc.set(this,void 0);const s={apiKey:i,authToken:a,...o,baseURL:n||"https://api.anthropic.com"};if(!s.dangerouslyAllowBrowser&&I5())throw new Te(`It looks like you're running in a browser-like environment.
|
|
48
48
|
|
|
49
49
|
This is disabled by default, as it risks exposing your secret API credentials to attackers.
|
|
50
50
|
If you understand the risks and have appropriate mitigations in place,
|
|
51
51
|
you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
|
|
52
52
|
|
|
53
53
|
new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
|
|
54
|
-
`);this.baseURL=o.baseURL,this.timeout=o.timeout??zm.DEFAULT_TIMEOUT,this.logger=o.logger??console;const u="warn";this.logLevel=u,this.logLevel=l1(o.logLevel,"ClientOptions.logLevel",this)??l1(mc("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??u,this.fetchOptions=o.fetchOptions,this.maxRetries=o.maxRetries??2,this.fetch=o.fetch??Y5(),ge(this,Cc,F5),this._options=o,this.apiKey=typeof i=="string"?i:null,this.authToken=a}withOptions(n){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...n})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:n,nulls:i}){if(!(n.get("x-api-key")||n.get("authorization"))&&!(this.apiKey&&n.get("x-api-key"))&&!i.has("x-api-key")&&!(this.authToken&&n.get("authorization"))&&!i.has("authorization"))throw new Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}async authHeaders(n){return Ve([await this.apiKeyAuth(n),await this.bearerAuth(n)])}async apiKeyAuth(n){if(this.apiKey!=null)return Ve([{"X-Api-Key":this.apiKey}])}async bearerAuth(n){if(this.authToken!=null)return Ve([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(n){return Object.entries(n).filter(([i,a])=>typeof a<"u").map(([i,a])=>{if(typeof a=="string"||typeof a=="number"||typeof a=="boolean")return`${encodeURIComponent(i)}=${encodeURIComponent(a)}`;if(a===null)return`${encodeURIComponent(i)}=`;throw new Te(`Cannot stringify type ${typeof a}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${Qa}`}defaultIdempotencyKey(){return`stainless-node-retry-${dS()}`}makeStatusError(n,i,a,s){return qt.generate(n,i,a,s)}buildURL(n,i,a){const s=!ne(this,Fp,"m",YS).call(this)&&a||this.baseURL,o=O5(n)?new URL(n):new URL(s+(s.endsWith("/")&&n.startsWith("/")?n.slice(1):n)),u=this.defaultQuery();return L5(u)||(i={...u,...i}),typeof i=="object"&&i&&!Array.isArray(i)&&(o.search=this.stringifyQuery(i)),o.toString()}_calculateNonstreamingTimeout(n){if(3600*n/128e3>600)throw new Te("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(n){}async prepareRequest(n,{url:i,options:a}){}get(n,i){return this.methodRequest("get",n,i)}post(n,i){return this.methodRequest("post",n,i)}patch(n,i){return this.methodRequest("patch",n,i)}put(n,i){return this.methodRequest("put",n,i)}delete(n,i){return this.methodRequest("delete",n,i)}methodRequest(n,i,a){return this.request(Promise.resolve(a).then(s=>({method:n,path:i,...s})))}request(n,i=null){return new pf(this,this.makeRequest(n,i,void 0))}async makeRequest(n,i,a){const s=await n,o=s.maxRetries??this.maxRetries;i==null&&(i=o),await this.prepareOptions(s);const{req:u,url:f,timeout:h}=await this.buildRequest(s,{retryCount:o-i});await this.prepareRequest(u,{url:f,options:s});const d="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),g=a===void 0?"":`, retryOf: ${a}`,m=Date.now();if(Yt(this).debug(`[${d}] sending request`,Zr({retryOfRequestLogID:a,method:s.method,url:f,options:s,headers:u.headers})),s.signal?.aborted)throw new Pn;const x=new AbortController,b=await this.fetchWithTimeout(f,u,h,x).catch(qp),w=Date.now();if(b instanceof globalThis.Error){const _=`retrying, ${i} attempts remaining`;if(s.signal?.aborted)throw new Pn;const D=no(b)||/timed? ?out/i.test(String(b)+("cause"in b?String(b.cause):""));if(i)return Yt(this).info(`[${d}] connection ${D?"timed out":"failed"} - ${_}`),Yt(this).debug(`[${d}] connection ${D?"timed out":"failed"} (${_})`,Zr({retryOfRequestLogID:a,url:f,durationMs:w-m,message:b.message})),this.retryRequest(s,i,a??d);throw Yt(this).info(`[${d}] connection ${D?"timed out":"failed"} - error; no more retries left`),Yt(this).debug(`[${d}] connection ${D?"timed out":"failed"} (error; no more retries left)`,Zr({retryOfRequestLogID:a,url:f,durationMs:w-m,message:b.message})),D?new hS:new hf({cause:b})}const E=[...b.headers.entries()].filter(([_])=>_==="request-id").map(([_,D])=>", "+_+": "+JSON.stringify(D)).join(""),N=`[${d}${g}${E}] ${u.method} ${f} ${b.ok?"succeeded":"failed"} with status ${b.status} in ${w-m}ms`;if(!b.ok){const _=await this.shouldRetry(b);if(i&&_){const H=`retrying, ${i} attempts remaining`;return await X5(b.body),Yt(this).info(`${N} - ${H}`),Yt(this).debug(`[${d}] response error (${H})`,Zr({retryOfRequestLogID:a,url:b.url,status:b.status,headers:b.headers,durationMs:w-m})),this.retryRequest(s,i,a??d,b.headers)}const D=_?"error; no more retries left":"error; not retryable";Yt(this).info(`${N} - ${D}`);const k=await b.text().catch(H=>qp(H).message),C=SS(k),L=C?void 0:k;throw Yt(this).debug(`[${d}] response error (${D})`,Zr({retryOfRequestLogID:a,url:b.url,status:b.status,headers:b.headers,message:L,durationMs:Date.now()-m})),this.makeStatusError(b.status,C,L,b.headers)}return Yt(this).info(N),Yt(this).debug(`[${d}] response start`,Zr({retryOfRequestLogID:a,url:b.url,status:b.status,headers:b.headers,durationMs:w-m})),{response:b,options:s,controller:x,requestLogID:d,retryOfRequestLogID:a,startTime:m}}getAPIList(n,i,a){return this.requestAPIList(i,{method:"get",path:n,...a})}requestAPIList(n,i){const a=this.makeRequest(i,null,void 0);return new nz(this,a,n)}async fetchWithTimeout(n,i,a,s){const{signal:o,method:u,...f}=i||{};o&&o.addEventListener("abort",()=>s.abort());const h=setTimeout(()=>s.abort(),a),d=globalThis.ReadableStream&&f.body instanceof globalThis.ReadableStream||typeof f.body=="object"&&f.body!==null&&Symbol.asyncIterator in f.body,g={signal:s.signal,...d?{duplex:"half"}:{},method:"GET",...f};u&&(g.method=u.toUpperCase());try{return await this.fetch.call(void 0,n,g)}finally{clearTimeout(h)}}async shouldRetry(n){const i=n.headers.get("x-should-retry");return i==="true"?!0:i==="false"?!1:n.status===408||n.status===409||n.status===429||n.status>=500}async retryRequest(n,i,a,s){let o;const u=s?.get("retry-after-ms");if(u){const h=parseFloat(u);Number.isNaN(h)||(o=h)}const f=s?.get("retry-after");if(f&&!o){const h=parseFloat(f);Number.isNaN(h)?o=Date.parse(f)-Date.now():o=h*1e3}if(!(o&&0<=o&&o<60*1e3)){const h=n.maxRetries??this.maxRetries;o=this.calculateDefaultRetryTimeoutMillis(i,h)}return await U5(o),this.makeRequest(n,i-1,a)}calculateDefaultRetryTimeoutMillis(n,i){const o=i-n,u=Math.min(.5*Math.pow(2,o),8),f=1-Math.random()*.25;return u*f*1e3}calculateNonstreamingTimeout(n,i){if(36e5*n/128e3>6e5||i!=null&&n>i)throw new Te("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(n,{retryCount:i=0}={}){const a={...n},{method:s,path:o,query:u,defaultBaseURL:f}=a,h=this.buildURL(o,u,f);"timeout"in a&&B5("timeout",a.timeout),a.timeout=a.timeout??this.timeout;const{bodyHeaders:d,body:g}=this.buildBody({options:a}),m=await this.buildHeaders({options:n,method:s,bodyHeaders:d,retryCount:i});return{req:{method:s,headers:m,...a.signal&&{signal:a.signal},...globalThis.ReadableStream&&g instanceof globalThis.ReadableStream&&{duplex:"half"},...g&&{body:g},...this.fetchOptions??{},...a.fetchOptions??{}},url:h,timeout:a.timeout}}async buildHeaders({options:n,method:i,bodyHeaders:a,retryCount:s}){let o={};this.idempotencyHeader&&i!=="get"&&(n.idempotencyKey||(n.idempotencyKey=this.defaultIdempotencyKey()),o[this.idempotencyHeader]=n.idempotencyKey);const u=Ve([o,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(s),...n.timeout?{"X-Stainless-Timeout":String(Math.trunc(n.timeout/1e3))}:{},...P5(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(n),this._options.defaultHeaders,a,n.headers]);return this.validateHeaders(u),u.values}buildBody({options:{body:n,headers:i}}){if(!n)return{bodyHeaders:void 0,body:void 0};const a=Ve([i]);return ArrayBuffer.isView(n)||n instanceof ArrayBuffer||n instanceof DataView||typeof n=="string"&&a.values.has("content-type")||globalThis.Blob&&n instanceof globalThis.Blob||n instanceof FormData||n instanceof URLSearchParams||globalThis.ReadableStream&&n instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:n}:typeof n=="object"&&(Symbol.asyncIterator in n||Symbol.iterator in n&&"next"in n&&typeof n.next=="function")?{bodyHeaders:void 0,body:kS(n)}:ne(this,Cc,"f").call(this,{body:n,headers:a})}}zm=kt,Cc=new WeakMap,Fp=new WeakSet,YS=function(){return this.baseURL!=="https://api.anthropic.com"};kt.Anthropic=zm;kt.HUMAN_PROMPT=vz;kt.AI_PROMPT=wz;kt.DEFAULT_TIMEOUT=6e5;kt.AnthropicError=Te;kt.APIError=qt;kt.APIConnectionError=hf;kt.APIConnectionTimeoutError=hS;kt.APIUserAbortError=Pn;kt.NotFoundError=yS;kt.ConflictError=xS;kt.RateLimitError=vS;kt.BadRequestError=pS;kt.AuthenticationError=mS;kt.InternalServerError=wS;kt.PermissionDeniedError=gS;kt.UnprocessableEntityError=bS;kt.toFile=oz;class yo extends kt{constructor(){super(...arguments),this.completions=new $S(this),this.messages=new Am(this),this.models=new PS(this),this.beta=new gl(this)}}yo.Completions=$S;yo.Messages=Am;yo.Models=PS;yo.Beta=gl;let gc=null;function XS(){return gc||(gc=localStorage.getItem("claude_api_key"),gc)}async function Sz(e,n,i="sonnet"){const a=XS();if(!a)throw new Error("API key not set. Please configure your Claude API key.");const s=new yo({apiKey:a,dangerouslyAllowBrowser:!0}),o={sonnet:"claude-sonnet-4-20250514",opus:"claude-opus-4-20250514",haiku:"claude-3-5-haiku-20241022"},f=(await s.messages.create({model:o[i],max_tokens:4096,system:e,messages:[{role:"user",content:n}]})).content.find(h=>h.type==="text");if(!f||f.type!=="text")throw new Error("No text response from Claude");return f.text}function _z(){return!!XS()}function kz(e,n){const i=new Map(e.map(f=>[f.id,f])),a=new Map,s=new Map;e.forEach(f=>{a.set(f.id,0),s.set(f.id,[])}),n.forEach(f=>{s.get(f.source)?.push(f.target),a.set(f.target,(a.get(f.target)||0)+1)});const o=[];a.forEach((f,h)=>{f===0&&o.push(h)});const u=[];for(;o.length>0;){const f=o.shift(),h=i.get(f);h&&u.push(h),s.get(f)?.forEach(d=>{const g=(a.get(d)||0)-1;a.set(d,g),g===0&&o.push(d)})}return u}function Ez(e,n,i){const a=n.filter(o=>o.target===e),s=[];for(const o of a){const u=i.get(o.source);u!==void 0&&s.push(typeof u=="string"?u:JSON.stringify(u,null,2))}return s.join(`
|
|
54
|
+
`);this.baseURL=s.baseURL,this.timeout=s.timeout??jm.DEFAULT_TIMEOUT,this.logger=s.logger??console;const u="warn";this.logLevel=u,this.logLevel=s1(s.logLevel,"ClientOptions.logLevel",this)??s1(gc("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??u,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??Y5(),ge(this,Mc,F5),this._options=s,this.apiKey=typeof i=="string"?i:null,this.authToken=a}withOptions(n){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...n})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:n,nulls:i}){if(!(n.get("x-api-key")||n.get("authorization"))&&!(this.apiKey&&n.get("x-api-key"))&&!i.has("x-api-key")&&!(this.authToken&&n.get("authorization"))&&!i.has("authorization"))throw new Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}async authHeaders(n){return Ve([await this.apiKeyAuth(n),await this.bearerAuth(n)])}async apiKeyAuth(n){if(this.apiKey!=null)return Ve([{"X-Api-Key":this.apiKey}])}async bearerAuth(n){if(this.authToken!=null)return Ve([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(n){return Object.entries(n).filter(([i,a])=>typeof a<"u").map(([i,a])=>{if(typeof a=="string"||typeof a=="number"||typeof a=="boolean")return`${encodeURIComponent(i)}=${encodeURIComponent(a)}`;if(a===null)return`${encodeURIComponent(i)}=`;throw new Te(`Cannot stringify type ${typeof a}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${Ka}`}defaultIdempotencyKey(){return`stainless-node-retry-${hS()}`}makeStatusError(n,i,a,o){return qt.generate(n,i,a,o)}buildURL(n,i,a){const o=!ne(this,Fp,"m",XS).call(this)&&a||this.baseURL,s=O5(n)?new URL(n):new URL(o+(o.endsWith("/")&&n.startsWith("/")?n.slice(1):n)),u=this.defaultQuery();return L5(u)||(i={...u,...i}),typeof i=="object"&&i&&!Array.isArray(i)&&(s.search=this.stringifyQuery(i)),s.toString()}_calculateNonstreamingTimeout(n){if(3600*n/128e3>600)throw new Te("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(n){}async prepareRequest(n,{url:i,options:a}){}get(n,i){return this.methodRequest("get",n,i)}post(n,i){return this.methodRequest("post",n,i)}patch(n,i){return this.methodRequest("patch",n,i)}put(n,i){return this.methodRequest("put",n,i)}delete(n,i){return this.methodRequest("delete",n,i)}methodRequest(n,i,a){return this.request(Promise.resolve(a).then(o=>({method:n,path:i,...o})))}request(n,i=null){return new pf(this,this.makeRequest(n,i,void 0))}async makeRequest(n,i,a){const o=await n,s=o.maxRetries??this.maxRetries;i==null&&(i=s),await this.prepareOptions(o);const{req:u,url:f,timeout:h}=await this.buildRequest(o,{retryCount:s-i});await this.prepareRequest(u,{url:f,options:o});const d="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),g=a===void 0?"":`, retryOf: ${a}`,m=Date.now();if(Yt(this).debug(`[${d}] sending request`,Zr({retryOfRequestLogID:a,method:o.method,url:f,options:o,headers:u.headers})),o.signal?.aborted)throw new Pn;const x=new AbortController,b=await this.fetchWithTimeout(f,u,h,x).catch(qp),w=Date.now();if(b instanceof globalThis.Error){const _=`retrying, ${i} attempts remaining`;if(o.signal?.aborted)throw new Pn;const D=as(b)||/timed? ?out/i.test(String(b)+("cause"in b?String(b.cause):""));if(i)return Yt(this).info(`[${d}] connection ${D?"timed out":"failed"} - ${_}`),Yt(this).debug(`[${d}] connection ${D?"timed out":"failed"} (${_})`,Zr({retryOfRequestLogID:a,url:f,durationMs:w-m,message:b.message})),this.retryRequest(o,i,a??d);throw Yt(this).info(`[${d}] connection ${D?"timed out":"failed"} - error; no more retries left`),Yt(this).debug(`[${d}] connection ${D?"timed out":"failed"} (error; no more retries left)`,Zr({retryOfRequestLogID:a,url:f,durationMs:w-m,message:b.message})),D?new pS:new hf({cause:b})}const E=[...b.headers.entries()].filter(([_])=>_==="request-id").map(([_,D])=>", "+_+": "+JSON.stringify(D)).join(""),N=`[${d}${g}${E}] ${u.method} ${f} ${b.ok?"succeeded":"failed"} with status ${b.status} in ${w-m}ms`;if(!b.ok){const _=await this.shouldRetry(b);if(i&&_){const H=`retrying, ${i} attempts remaining`;return await X5(b.body),Yt(this).info(`${N} - ${H}`),Yt(this).debug(`[${d}] response error (${H})`,Zr({retryOfRequestLogID:a,url:b.url,status:b.status,headers:b.headers,durationMs:w-m})),this.retryRequest(o,i,a??d,b.headers)}const D=_?"error; no more retries left":"error; not retryable";Yt(this).info(`${N} - ${D}`);const k=await b.text().catch(H=>qp(H).message),C=_S(k),L=C?void 0:k;throw Yt(this).debug(`[${d}] response error (${D})`,Zr({retryOfRequestLogID:a,url:b.url,status:b.status,headers:b.headers,message:L,durationMs:Date.now()-m})),this.makeStatusError(b.status,C,L,b.headers)}return Yt(this).info(N),Yt(this).debug(`[${d}] response start`,Zr({retryOfRequestLogID:a,url:b.url,status:b.status,headers:b.headers,durationMs:w-m})),{response:b,options:o,controller:x,requestLogID:d,retryOfRequestLogID:a,startTime:m}}getAPIList(n,i,a){return this.requestAPIList(i,{method:"get",path:n,...a})}requestAPIList(n,i){const a=this.makeRequest(i,null,void 0);return new nz(this,a,n)}async fetchWithTimeout(n,i,a,o){const{signal:s,method:u,...f}=i||{};s&&s.addEventListener("abort",()=>o.abort());const h=setTimeout(()=>o.abort(),a),d=globalThis.ReadableStream&&f.body instanceof globalThis.ReadableStream||typeof f.body=="object"&&f.body!==null&&Symbol.asyncIterator in f.body,g={signal:o.signal,...d?{duplex:"half"}:{},method:"GET",...f};u&&(g.method=u.toUpperCase());try{return await this.fetch.call(void 0,n,g)}finally{clearTimeout(h)}}async shouldRetry(n){const i=n.headers.get("x-should-retry");return i==="true"?!0:i==="false"?!1:n.status===408||n.status===409||n.status===429||n.status>=500}async retryRequest(n,i,a,o){let s;const u=o?.get("retry-after-ms");if(u){const h=parseFloat(u);Number.isNaN(h)||(s=h)}const f=o?.get("retry-after");if(f&&!s){const h=parseFloat(f);Number.isNaN(h)?s=Date.parse(f)-Date.now():s=h*1e3}if(!(s&&0<=s&&s<60*1e3)){const h=n.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(i,h)}return await U5(s),this.makeRequest(n,i-1,a)}calculateDefaultRetryTimeoutMillis(n,i){const s=i-n,u=Math.min(.5*Math.pow(2,s),8),f=1-Math.random()*.25;return u*f*1e3}calculateNonstreamingTimeout(n,i){if(36e5*n/128e3>6e5||i!=null&&n>i)throw new Te("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(n,{retryCount:i=0}={}){const a={...n},{method:o,path:s,query:u,defaultBaseURL:f}=a,h=this.buildURL(s,u,f);"timeout"in a&&B5("timeout",a.timeout),a.timeout=a.timeout??this.timeout;const{bodyHeaders:d,body:g}=this.buildBody({options:a}),m=await this.buildHeaders({options:n,method:o,bodyHeaders:d,retryCount:i});return{req:{method:o,headers:m,...a.signal&&{signal:a.signal},...globalThis.ReadableStream&&g instanceof globalThis.ReadableStream&&{duplex:"half"},...g&&{body:g},...this.fetchOptions??{},...a.fetchOptions??{}},url:h,timeout:a.timeout}}async buildHeaders({options:n,method:i,bodyHeaders:a,retryCount:o}){let s={};this.idempotencyHeader&&i!=="get"&&(n.idempotencyKey||(n.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=n.idempotencyKey);const u=Ve([s,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(o),...n.timeout?{"X-Stainless-Timeout":String(Math.trunc(n.timeout/1e3))}:{},...P5(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(n),this._options.defaultHeaders,a,n.headers]);return this.validateHeaders(u),u.values}buildBody({options:{body:n,headers:i}}){if(!n)return{bodyHeaders:void 0,body:void 0};const a=Ve([i]);return ArrayBuffer.isView(n)||n instanceof ArrayBuffer||n instanceof DataView||typeof n=="string"&&a.values.has("content-type")||globalThis.Blob&&n instanceof globalThis.Blob||n instanceof FormData||n instanceof URLSearchParams||globalThis.ReadableStream&&n instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:n}:typeof n=="object"&&(Symbol.asyncIterator in n||Symbol.iterator in n&&"next"in n&&typeof n.next=="function")?{bodyHeaders:void 0,body:ES(n)}:ne(this,Mc,"f").call(this,{body:n,headers:a})}}jm=kt,Mc=new WeakMap,Fp=new WeakSet,XS=function(){return this.baseURL!=="https://api.anthropic.com"};kt.Anthropic=jm;kt.HUMAN_PROMPT=vz;kt.AI_PROMPT=wz;kt.DEFAULT_TIMEOUT=6e5;kt.AnthropicError=Te;kt.APIError=qt;kt.APIConnectionError=hf;kt.APIConnectionTimeoutError=pS;kt.APIUserAbortError=Pn;kt.NotFoundError=xS;kt.ConflictError=bS;kt.RateLimitError=wS;kt.BadRequestError=mS;kt.AuthenticationError=gS;kt.InternalServerError=SS;kt.PermissionDeniedError=yS;kt.UnprocessableEntityError=vS;kt.toFile=sz;class bs extends kt{constructor(){super(...arguments),this.completions=new VS(this),this.messages=new zm(this),this.models=new YS(this),this.beta=new yl(this)}}bs.Completions=VS;bs.Messages=zm;bs.Models=YS;bs.Beta=yl;let yc=null;function FS(){return yc||(yc=localStorage.getItem("claude_api_key"),yc)}async function Sz(e,n,i="sonnet"){const a=FS();if(!a)throw new Error("API key not set. Please configure your Claude API key.");const o=new bs({apiKey:a,dangerouslyAllowBrowser:!0}),s={sonnet:"claude-sonnet-4-20250514",opus:"claude-opus-4-20250514",haiku:"claude-3-5-haiku-20241022"},f=(await o.messages.create({model:s[i],max_tokens:4096,system:e,messages:[{role:"user",content:n}]})).content.find(h=>h.type==="text");if(!f||f.type!=="text")throw new Error("No text response from Claude");return f.text}function _z(){return!!FS()}function kz(e,n){const i=new Map(e.map(f=>[f.id,f])),a=new Map,o=new Map;e.forEach(f=>{a.set(f.id,0),o.set(f.id,[])}),n.forEach(f=>{o.get(f.source)?.push(f.target),a.set(f.target,(a.get(f.target)||0)+1)});const s=[];a.forEach((f,h)=>{f===0&&s.push(h)});const u=[];for(;s.length>0;){const f=s.shift(),h=i.get(f);h&&u.push(h),o.get(f)?.forEach(d=>{const g=(a.get(d)||0)-1;a.set(d,g),g===0&&s.push(d)})}return u}function Ez(e,n,i){const a=n.filter(s=>s.target===e),o=[];for(const s of a){const u=i.get(s.source);u!==void 0&&o.push(typeof u=="string"?u:JSON.stringify(u,null,2))}return o.join(`
|
|
55
55
|
|
|
56
56
|
---
|
|
57
57
|
|
|
58
|
-
`)}async function Nz(e,n){const i=e.data;n.onNodeProgress(e.id,50);const a=i.value||i.placeholder||"User input placeholder";return n.onNodeProgress(e.id,100),n.onLog("info",`Input received: ${a.slice(0,50)}...`,e.id),a}async function Cz(e,n,i){const a=e.data;if(!_z())throw new Error("API key not configured. Please set your Claude API key.");i.onNodeProgress(e.id,20),i.onLog("info",`Starting AI agent: ${a.label}`,e.id);const
|
|
58
|
+
`)}async function Nz(e,n){const i=e.data;n.onNodeProgress(e.id,50);const a=i.value||i.placeholder||"User input placeholder";return n.onNodeProgress(e.id,100),n.onLog("info",`Input received: ${a.slice(0,50)}...`,e.id),a}async function Cz(e,n,i){const a=e.data;if(!_z())throw new Error("API key not configured. Please set your Claude API key.");i.onNodeProgress(e.id,20),i.onLog("info",`Starting AI agent: ${a.label}`,e.id);const o=a.systemPrompt||`You are an AI assistant. ${a.description||""}`,s=n||"Please help me with the following task.";i.onNodeProgress(e.id,50);try{const u=await Sz(o,s,a.model||"sonnet");return i.onNodeProgress(e.id,100),i.onLog("success",`Agent completed: ${u.slice(0,100)}...`,e.id),u}catch(u){throw new Error(`Subagent execution failed: ${u instanceof Error?u.message:"Unknown error"}`)}}async function Mz(e,n,i){const a=e.data;i.onNodeProgress(e.id,50),i.onLog("info",`Executing skill: ${a.label}`,e.id);const o=`# Skill: ${a.label}
|
|
59
59
|
|
|
60
60
|
Category: ${a.category||"general"}
|
|
61
61
|
Skill ID: ${a.skillId||"custom-skill"}
|
|
@@ -67,19 +67,26 @@ ${a.description||"Custom skill"}
|
|
|
67
67
|
${n}
|
|
68
68
|
|
|
69
69
|
## Output
|
|
70
|
-
Skill executed successfully with the provided input.`;return i.onNodeProgress(e.id,100),i.onLog("success",`Skill ${a.label} completed`,e.id),
|
|
70
|
+
Skill executed successfully with the provided input.`;return i.onNodeProgress(e.id,100),i.onLog("success",`Skill ${a.label} completed`,e.id),o}async function Tz(e,n,i){const a=e.data;i.onNodeProgress(e.id,50),i.onLog("info",`Executing command: /${a.commandName||"unnamed"}`,e.id);const o=`# Command Execution
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
Command: /${a.commandName||"command"}
|
|
73
|
+
Path: ${a.commandPath||"default"}
|
|
74
74
|
|
|
75
75
|
## Input
|
|
76
76
|
${n}
|
|
77
77
|
|
|
78
|
-
##
|
|
79
|
-
|
|
78
|
+
## Status
|
|
79
|
+
Command executed successfully. In production, this would run the actual slash command.`;return i.onNodeProgress(e.id,100),i.onLog("success",`Command /${a.commandName||"unnamed"} completed`,e.id),o}async function Az(e,n,i){const a=e.data;i.onNodeProgress(e.id,50),i.onLog("info",`Configuring hook: ${a.hookEvent||"PreToolUse"}`,e.id);const o=`# Hook Configuration
|
|
80
|
+
|
|
81
|
+
Event: ${a.hookEvent||"PreToolUse"}
|
|
82
|
+
Matcher: ${a.hookMatcher||"*"}
|
|
83
|
+
Command: ${a.hookCommand||'echo "Hook executed"'}
|
|
84
|
+
|
|
85
|
+
## Input
|
|
86
|
+
${n}
|
|
80
87
|
|
|
81
88
|
## Status
|
|
82
|
-
|
|
89
|
+
Hook configured successfully. In production, this would set up the actual hook.`;return i.onNodeProgress(e.id,100),i.onLog("success",`Hook ${a.hookEvent||"unnamed"} configured`,e.id),o}async function zz(e,n,i){const a=e.data;i.onNodeProgress(e.id,50),i.onLog("info",`Preparing output: ${a.label}`,e.id);const o=`# Workflow Output
|
|
83
90
|
|
|
84
91
|
## Result
|
|
85
92
|
${n}
|
|
@@ -88,53 +95,53 @@ ${n}
|
|
|
88
95
|
${a.outputType||"auto"}
|
|
89
96
|
|
|
90
97
|
## Generated at
|
|
91
|
-
${new Date().toISOString()}`;return i.onNodeProgress(e.id,100),i.onLog("success","Workflow completed successfully",e.id),
|
|
92
|
-
`)}function
|
|
93
|
-
`)}function
|
|
94
|
-
`)}function yl(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Iz(e,n){const i=new Map(e.map(f=>[f.id,f])),a=new Map,s=new Map;e.forEach(f=>{a.set(f.id,0),s.set(f.id,[])}),n.forEach(f=>{s.get(f.source)?.push(f.target),a.set(f.target,(a.get(f.target)||0)+1)});const o=[];a.forEach((f,h)=>{f===0&&o.push(h)});const u=[];for(;o.length>0;){const f=o.shift(),h=i.get(f);h&&u.push(h),s.get(f)?.forEach(d=>{const g=(a.get(d)||0)-1;a.set(d,g),g===0&&o.push(d)})}return u}function GS(e){var n,i,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(n=0;n<s;n++)e[n]&&(i=GS(e[n]))&&(a&&(a+=" "),a+=i)}else for(i in e)e[i]&&(a&&(a+=" "),a+=i);return a}function Xt(){for(var e,n,i=0,a="",s=arguments.length;i<s;i++)(e=arguments[i])&&(n=GS(e))&&(a&&(a+=" "),a+=n);return a}const ZS="http://localhost:3001/api";async function qz(e,n){const i=await fetch(`${ZS}/save/workflow`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:e,options:n})});if(!i.ok){const a=await i.json().catch(()=>({}));throw new Error(a.message||"Failed to save workflow")}return i.json()}async function $z(){const e=await fetch(`${ZS}/project-path`);if(!e.ok)throw new Error("Failed to get project path");return(await e.json()).path}async function Vz(e,n){const i=[];return n.includeSkills&&e.skills.forEach(a=>{i.push({path:a.path,content:a.content,type:"skill"})}),n.includeCommands&&e.commands.forEach(a=>{i.push({path:a.path,content:a.content,type:"command"})}),n.includeAgents&&e.agents.forEach(a=>{i.push({path:a.path,content:a.content,type:"agent"})}),n.includeMcpSettings&&e.mcpSettings&&i.push({path:n.location==="global"?"~/.claude/settings.local.json":".claude/settings.local.json",content:JSON.stringify(e.mcpSettings,null,2),type:"mcp"}),{files:i}}function Pz({isOpen:e,onClose:n,config:i}){const[a,s]=Q.useState("local"),[o,u]=Q.useState(!0),[f,h]=Q.useState(!0),[d,g]=Q.useState(!0),[m,x]=Q.useState(!0),[b,w]=Q.useState(""),[E,N]=Q.useState([]),[_,D]=Q.useState(null),[k,C]=Q.useState(!1),[L,A]=Q.useState(null),[H,F]=Q.useState(null);Q.useEffect(()=>{e&&$z().then(w).catch(()=>w("."))},[e]),Q.useEffect(()=>{if(!e)return;Vz(i,{location:a,includeSkills:o,includeCommands:f,includeAgents:d,includeMcpSettings:m}).then(({files:te})=>{N(te),te.length>0&&!_&&D(te[0])})},[e,i,a,o,f,d,m]);const G=async()=>{C(!0),F(null),A(null);const P={location:a,includeSkills:o,includeCommands:f,includeAgents:d,includeMcpSettings:m};try{const te=await qz(i,P);A(te),te.success&&setTimeout(()=>n(),2e3)}catch(te){F(te instanceof Error?te.message:"Failed to save")}finally{C(!1)}},q=P=>{switch(P){case"skill":return v.jsx(rl,{className:"w-4 h-4 text-node-skill"});case"agent":return v.jsx(M3,{className:"w-4 h-4 text-node-generate"});case"command":return v.jsx(uf,{className:"w-4 h-4 text-accent"});case"mcp":return v.jsx(uS,{className:"w-4 h-4 text-node-mcp"});default:return v.jsx(rl,{className:"w-4 h-4 text-gray-400"})}},V=i.skills.length>0||i.commands.length>0||i.agents.length>0||i.mcpSettings;return e?v.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:v.jsxs("div",{className:"bg-surface border border-border rounded-xl shadow-2xl w-[900px] max-h-[80vh] flex flex-col",children:[v.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(il,{className:"w-5 h-5 text-accent"}),v.jsx("h2",{className:"text-lg font-semibold text-white",children:"Export to Claude Code"})]}),v.jsx("button",{onClick:n,className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(Em,{className:"w-5 h-5 text-gray-400"})})]}),v.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[v.jsxs("div",{className:"w-64 border-r border-border p-4 space-y-6 overflow-y-auto",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Save Location"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("button",{onClick:()=>s("local"),className:Xt("w-full flex items-center gap-3 px-3 py-2 rounded-lg border transition-colors text-left",a==="local"?"border-accent bg-accent/10 text-white":"border-border hover:border-gray-500 text-gray-400"),children:[v.jsx(Qb,{className:"w-4 h-4"}),v.jsxs("div",{children:[v.jsx("div",{className:"text-sm font-medium",children:"Local"}),v.jsx("div",{className:"text-xs text-gray-500",children:".claude/"})]})]}),v.jsxs("button",{onClick:()=>s("global"),className:Xt("w-full flex items-center gap-3 px-3 py-2 rounded-lg border transition-colors text-left",a==="global"?"border-accent bg-accent/10 text-white":"border-border hover:border-gray-500 text-gray-400"),children:[v.jsx(Qb,{className:"w-4 h-4"}),v.jsxs("div",{children:[v.jsx("div",{className:"text-sm font-medium",children:"Global"}),v.jsx("div",{className:"text-xs text-gray-500",children:"~/.claude/"})]})]})]})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Include Files"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:o,onChange:P=>u(P.target.checked),disabled:i.skills.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsxs("span",{className:Xt("text-sm",i.skills.length===0?"text-gray-600":"text-gray-300"),children:["Skills (",i.skills.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:f,onChange:P=>h(P.target.checked),disabled:i.commands.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsxs("span",{className:Xt("text-sm",i.commands.length===0?"text-gray-600":"text-gray-300"),children:["Commands (",i.commands.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:d,onChange:P=>g(P.target.checked),disabled:i.agents.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsxs("span",{className:Xt("text-sm",i.agents.length===0?"text-gray-600":"text-gray-300"),children:["Agents (",i.agents.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:m,onChange:P=>x(P.target.checked),disabled:!i.mcpSettings,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsx("span",{className:Xt("text-sm",i.mcpSettings?"text-gray-300":"text-gray-600"),children:"MCP Settings"})]})]})]}),v.jsxs("div",{className:"pt-4 border-t border-border",children:[v.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Project Path"}),v.jsx("div",{className:"text-xs text-gray-400 font-mono truncate",title:b,children:b||"Loading..."})]})]}),v.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[v.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border overflow-x-auto",children:[E.map((P,te)=>v.jsxs("button",{onClick:()=>D(P),className:Xt("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm whitespace-nowrap transition-colors",_===P?"bg-surface-hover text-white":"text-gray-400 hover:text-white hover:bg-surface-hover/50"),children:[q(P.type),v.jsx("span",{children:P.path.split("/").pop()})]},te)),E.length===0&&v.jsx("span",{className:"text-sm text-gray-500",children:"No files to export"})]}),v.jsx("div",{className:"flex-1 overflow-auto p-4",children:_?v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"text-xs text-gray-500 font-mono",children:_.path}),v.jsx("pre",{className:"text-sm text-gray-300 font-mono bg-canvas p-4 rounded-lg overflow-auto max-h-[400px]",children:_.content})]}):v.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Select a file to preview"})})]})]}),v.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[L&&L.success&&v.jsxs("div",{className:"flex items-center gap-2 text-status-completed text-sm",children:[v.jsx(z3,{className:"w-4 h-4"}),v.jsx("span",{children:"Saved successfully!"})]}),L&&!L.success&&v.jsxs("div",{className:"flex items-center gap-2 text-status-error text-sm",children:[v.jsx(Up,{className:"w-4 h-4"}),v.jsx("span",{children:"Some files failed to save"})]}),H&&v.jsxs("div",{className:"flex items-center gap-2 text-status-error text-sm",children:[v.jsx(Up,{className:"w-4 h-4"}),v.jsx("span",{children:H})]})]}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-400 hover:text-white transition-colors",children:"Cancel"}),v.jsxs("button",{onClick:G,disabled:k||E.length===0||!V,className:Xt("flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors",k||E.length===0||!V?"bg-gray-600 text-gray-400 cursor-not-allowed":"bg-accent hover:bg-accent-hover text-white"),children:[v.jsx(il,{className:"w-4 h-4"}),k?"Saving...":"Export"]})]})]})]})}):null}const QS=df()(cS(e=>({apiMode:"proxy",apiKey:"",proxyUrl:"https://api.anthropic.com",setApiMode:n=>e({apiMode:n}),setApiKey:n=>e({apiKey:n}),setProxyUrl:n=>e({proxyUrl:n})}),{name:"makecc-settings"}));function Yz({isOpen:e,onClose:n}){const{apiMode:i,apiKey:a,proxyUrl:s,setApiMode:o,setApiKey:u,setProxyUrl:f}=QS(),[h,d]=Q.useState(i),[g,m]=Q.useState(a),[x,b]=Q.useState(s),[w,E]=Q.useState(!1);if(Q.useEffect(()=>{e&&(d(i),m(a),b(s))},[e,i,a,s]),!e)return null;const N=()=>{o(h),u(g),f(x),n()};return v.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:v.jsxs("div",{className:"bg-surface border border-border rounded-xl w-full max-w-md mx-4 shadow-2xl",children:[v.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[v.jsx("h2",{className:"text-lg font-semibold text-white",children:"설정"}),v.jsx("button",{onClick:n,className:"p-1 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(Em,{className:"w-5 h-5 text-gray-400"})})]}),v.jsxs("div",{className:"p-6 space-y-6",children:[v.jsxs("div",{className:"space-y-3",children:[v.jsx("label",{className:"text-sm font-medium text-gray-300",children:"API 모드"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:`
|
|
98
|
+
${new Date().toISOString()}`;return i.onNodeProgress(e.id,100),i.onLog("success","Workflow completed successfully",e.id),o}async function jz(e,n,i){const a={results:new Map,cancelled:!1},o=kz(e,n);i.onLog("info",`Starting workflow execution with ${o.length} nodes`);for(const s of o){i.onNodeStart(s.id);try{const u=Ez(s.id,n,a.results);let f;switch(s.type){case"input":f=await Nz(s,i);break;case"subagent":f=await Cz(s,u,i);break;case"skill":f=await Mz(s,u,i);break;case"command":f=await Tz(s,u,i);break;case"hook":f=await Az(s,u,i);break;case"output":f=await zz(s,u,i);break;default:f=u}a.results.set(s.id,f),i.onNodeComplete(s.id,f)}catch(u){const f=u instanceof Error?u.message:"Unknown error";throw i.onNodeError(s.id,f),i.onLog("error",`Node ${s.data.label} failed: ${f}`,s.id),u}}return a.results}function GS(){const{nodes:e,edges:n,workflowName:i,updateNodeStatus:a}=Hi(),{isRunning:o,startExecution:s,stopExecution:u,setCurrentNode:f,markNodeCompleted:h,markNodeFailed:d,setWorkflowResults:g,addLog:m,clearLogs:x}=gs(),[b,w]=Q.useState([]),E=Q.useCallback(async()=>{if(e.length===0){m("warning","No nodes to execute");return}x(),s(),w([]),m("info",`워크플로우 "${i}" 실행 시작...`);try{const D=await jz(e,n,{onNodeStart:L=>{a(L,"running",0),f(L)},onNodeProgress:(L,A)=>{a(L,"running",A)},onNodeComplete:(L,A)=>{a(L,"completed",100),h(L,A)},onNodeError:(L,A)=>{a(L,"error",0),d(L,A)},onLog:(L,A,H)=>{m(L,A,H)}}),k=[],C=[];for(const[L,A]of D){const H=e.find(G=>G.id===L),F=typeof A=="string"?A:JSON.stringify(A,null,2);if(k.push({nodeId:L,label:H?.data.label||L,success:!0,result:F}),H?.type==="output"){const G=`${i.replace(/\s+/g,"_")}_${H.data.label.replace(/\s+/g,"_")}.md`;C.push({name:G,content:F})}}w(C),g(k),u(),m("success","워크플로우 실행 완료!"),C.length>0&&(m("info",`${C.length}개 파일 생성됨`),C.forEach(L=>{m("info",` - ${L.name}`)}))}catch(D){const k=D instanceof Error?D.message:"Unknown error";u(),m("error",`실행 오류: ${k}`)}},[e,n,i,m,x,s,u,a,f,h,d,g]),N=Q.useCallback((D,k)=>{const C=new Blob([k],{type:"text/markdown;charset=utf-8"}),L=URL.createObjectURL(C),A=document.createElement("a");A.href=L,A.download=D,document.body.appendChild(A),A.click(),document.body.removeChild(A),URL.revokeObjectURL(L),m("info",`파일 다운로드: ${D}`)},[m]),_=Q.useCallback(()=>{b.forEach(D=>{N(D.name,D.content)})},[b,N]);return{isRunning:o,execute:E,generatedFiles:b,downloadFile:N,downloadAllFiles:_}}function Dz(e,n,i,a="local"){const o=a==="global"?"~/.claude":".claude",s=Rz(n,o),u=Oz(n,o),f=Lz(e,n,i,o),h=Hz(n);return{skills:s,commands:f,agents:u,mcpSettings:h}}function Rz(e,n){return e.filter(a=>a.type==="skill").filter(a=>a.data.skillType==="custom").map(a=>{const o=a.data,s=xl(o.skillId||o.label),u=`${n}/skills/${s}/SKILL.md`,f=Bz(o);return{name:s,path:u,content:f}})}function Oz(e,n){return e.filter(a=>a.type==="subagent").map(a=>{const o=a.data,s=xl(o.label),u=`${n}/agents/${s}.md`,f=Uz(o);return{name:s,path:u,content:f}})}function Lz(e,n,i,a){if(n.length===0)return[];const o=xl(e),s=`${a}/commands/${o}.md`,u=Iz(e,n,i);return[{name:o,path:s,content:u}]}function Hz(e){return e.filter(i=>i.type==="hook").length===0,null}function Bz(e){if(e.skillContent)return e.skillContent;const n=xl(e.skillId||e.label),i=e.description||e.label,a=["---",`name: ${n}`,`description: ${i}`,"---","",`# ${e.label}`,""];return e.mdContent?a.push(e.mdContent):a.push(`Execute the ${e.label} skill.`),a.join(`
|
|
99
|
+
`)}function Uz(e){const n=xl(e.label),i=e.description||e.label,a=e.tools.length>0?e.tools.join(", "):"Read, Write, Edit",o=e.model||"sonnet",s=["---",`name: ${n}`,`description: ${i}`,`tools: ${a}`,`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(`
|
|
100
|
+
`)}function Iz(e,n,i){const a=n.filter(g=>g.type==="input"),o=n.filter(g=>g.type==="output"),s=a.map(g=>`<${xl(g.data.label)}>`).join(" "),f=["---",`description: ${`Workflow: ${e}`}`];s&&f.push(`argument-hint: ${s}`),f.push("---"),f.push(""),f.push(`# ${e}`),f.push(""),a.length>0&&(f.push("## Inputs"),f.push(""),a.forEach(g=>{const m=g.data;f.push(`- **${m.label}**: ${m.description||m.placeholder||"User input"}`)}),f.push("")),f.push("## Workflow Steps"),f.push("");const h=qz(n,i);let d=1;return h.forEach(g=>{if(g.type!=="input"){if(f.push(`${d}. **${g.data.label}**`),g.data.description&&f.push(` ${g.data.description}`),g.type==="subagent"){const m=g.data;m.systemPrompt&&f.push(` - Prompt: ${m.systemPrompt.substring(0,100)}${m.systemPrompt.length>100?"...":""}`),m.tools.length>0&&f.push(` - Tools: ${m.tools.join(", ")}`)}if(g.type==="skill"){const m=g.data;m.skillId&&f.push(` - Invoke skill: ${m.skillId}`)}if(g.type==="command"){const m=g.data;f.push(` - Command: /${m.commandName}`)}if(g.type==="hook"){const m=g.data;f.push(` - Hook: ${m.hookEvent} (${m.hookMatcher||"*"})`)}f.push(""),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(`
|
|
101
|
+
`)}function xl(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function qz(e,n){const i=new Map(e.map(f=>[f.id,f])),a=new Map,o=new Map;e.forEach(f=>{a.set(f.id,0),o.set(f.id,[])}),n.forEach(f=>{o.get(f.source)?.push(f.target),a.set(f.target,(a.get(f.target)||0)+1)});const s=[];a.forEach((f,h)=>{f===0&&s.push(h)});const u=[];for(;s.length>0;){const f=s.shift(),h=i.get(f);h&&u.push(h),o.get(f)?.forEach(d=>{const g=(a.get(d)||0)-1;a.set(d,g),g===0&&s.push(d)})}return u}function ZS(e){var n,i,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(i=ZS(e[n]))&&(a&&(a+=" "),a+=i)}else for(i in e)e[i]&&(a&&(a+=" "),a+=i);return a}function Xt(){for(var e,n,i=0,a="",o=arguments.length;i<o;i++)(e=arguments[i])&&(n=ZS(e))&&(a&&(a+=" "),a+=n);return a}const QS="http://localhost:3001/api";async function $z(e,n){const i=await fetch(`${QS}/save/workflow`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:e,options:n})});if(!i.ok){const a=await i.json().catch(()=>({}));throw new Error(a.message||"Failed to save workflow")}return i.json()}async function Vz(){const e=await fetch(`${QS}/project-path`);if(!e.ok)throw new Error("Failed to get project path");return(await e.json()).path}async function Pz(e,n){const i=[];return n.includeSkills&&e.skills.forEach(a=>{i.push({path:a.path,content:a.content,type:"skill"})}),n.includeCommands&&e.commands.forEach(a=>{i.push({path:a.path,content:a.content,type:"command"})}),n.includeAgents&&e.agents.forEach(a=>{i.push({path:a.path,content:a.content,type:"agent"})}),n.includeMcpSettings&&e.mcpSettings&&i.push({path:n.location==="global"?"~/.claude/settings.local.json":".claude/settings.local.json",content:JSON.stringify(e.mcpSettings,null,2),type:"mcp"}),{files:i}}function Yz({isOpen:e,onClose:n,config:i}){const[a,o]=Q.useState("local"),[s,u]=Q.useState(!0),[f,h]=Q.useState(!0),[d,g]=Q.useState(!0),[m,x]=Q.useState(!0),[b,w]=Q.useState(""),[E,N]=Q.useState([]),[_,D]=Q.useState(null),[k,C]=Q.useState(!1),[L,A]=Q.useState(null),[H,F]=Q.useState(null);Q.useEffect(()=>{e&&Vz().then(w).catch(()=>w("."))},[e]),Q.useEffect(()=>{if(!e)return;Pz(i,{location:a,includeSkills:s,includeCommands:f,includeAgents:d,includeMcpSettings:m}).then(({files:te})=>{N(te),te.length>0&&!_&&D(te[0])})},[e,i,a,s,f,d,m]);const G=async()=>{C(!0),F(null),A(null);const P={location:a,includeSkills:s,includeCommands:f,includeAgents:d,includeMcpSettings:m};try{const te=await $z(i,P);A(te),te.success&&setTimeout(()=>n(),2e3)}catch(te){F(te instanceof Error?te.message:"Failed to save")}finally{C(!1)}},q=P=>{switch(P){case"skill":return v.jsx(al,{className:"w-4 h-4 text-node-skill"});case"agent":return v.jsx(T3,{className:"w-4 h-4 text-node-generate"});case"command":return v.jsx(ra,{className:"w-4 h-4 text-accent"});case"mcp":return v.jsx(cS,{className:"w-4 h-4 text-node-mcp"});default:return v.jsx(al,{className:"w-4 h-4 text-gray-400"})}},V=i.skills.length>0||i.commands.length>0||i.agents.length>0||i.mcpSettings;return e?v.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:v.jsxs("div",{className:"bg-surface border border-border rounded-xl shadow-2xl w-[900px] max-h-[80vh] flex flex-col",children:[v.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(rl,{className:"w-5 h-5 text-accent"}),v.jsx("h2",{className:"text-lg font-semibold text-white",children:"Export to Claude Code"})]}),v.jsx("button",{onClick:n,className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(Nm,{className:"w-5 h-5 text-gray-400"})})]}),v.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[v.jsxs("div",{className:"w-64 border-r border-border p-4 space-y-6 overflow-y-auto",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Save Location"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("button",{onClick:()=>o("local"),className:Xt("w-full flex items-center gap-3 px-3 py-2 rounded-lg border transition-colors text-left",a==="local"?"border-accent bg-accent/10 text-white":"border-border hover:border-gray-500 text-gray-400"),children:[v.jsx(Jb,{className:"w-4 h-4"}),v.jsxs("div",{children:[v.jsx("div",{className:"text-sm font-medium",children:"Local"}),v.jsx("div",{className:"text-xs text-gray-500",children:".claude/"})]})]}),v.jsxs("button",{onClick:()=>o("global"),className:Xt("w-full flex items-center gap-3 px-3 py-2 rounded-lg border transition-colors text-left",a==="global"?"border-accent bg-accent/10 text-white":"border-border hover:border-gray-500 text-gray-400"),children:[v.jsx(Jb,{className:"w-4 h-4"}),v.jsxs("div",{children:[v.jsx("div",{className:"text-sm font-medium",children:"Global"}),v.jsx("div",{className:"text-xs text-gray-500",children:"~/.claude/"})]})]})]})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Include Files"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:s,onChange:P=>u(P.target.checked),disabled:i.skills.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsxs("span",{className:Xt("text-sm",i.skills.length===0?"text-gray-600":"text-gray-300"),children:["Skills (",i.skills.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:f,onChange:P=>h(P.target.checked),disabled:i.commands.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsxs("span",{className:Xt("text-sm",i.commands.length===0?"text-gray-600":"text-gray-300"),children:["Commands (",i.commands.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:d,onChange:P=>g(P.target.checked),disabled:i.agents.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsxs("span",{className:Xt("text-sm",i.agents.length===0?"text-gray-600":"text-gray-300"),children:["Agents (",i.agents.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:m,onChange:P=>x(P.target.checked),disabled:!i.mcpSettings,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsx("span",{className:Xt("text-sm",i.mcpSettings?"text-gray-300":"text-gray-600"),children:"MCP Settings"})]})]})]}),v.jsxs("div",{className:"pt-4 border-t border-border",children:[v.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Project Path"}),v.jsx("div",{className:"text-xs text-gray-400 font-mono truncate",title:b,children:b||"Loading..."})]})]}),v.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[v.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border overflow-x-auto",children:[E.map((P,te)=>v.jsxs("button",{onClick:()=>D(P),className:Xt("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm whitespace-nowrap transition-colors",_===P?"bg-surface-hover text-white":"text-gray-400 hover:text-white hover:bg-surface-hover/50"),children:[q(P.type),v.jsx("span",{children:P.path.split("/").pop()})]},te)),E.length===0&&v.jsx("span",{className:"text-sm text-gray-500",children:"No files to export"})]}),v.jsx("div",{className:"flex-1 overflow-auto p-4",children:_?v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"text-xs text-gray-500 font-mono",children:_.path}),v.jsx("pre",{className:"text-sm text-gray-300 font-mono bg-canvas p-4 rounded-lg overflow-auto max-h-[400px]",children:_.content})]}):v.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Select a file to preview"})})]})]}),v.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[L&&L.success&&v.jsxs("div",{className:"flex items-center gap-2 text-status-completed text-sm",children:[v.jsx(j3,{className:"w-4 h-4"}),v.jsx("span",{children:"Saved successfully!"})]}),L&&!L.success&&v.jsxs("div",{className:"flex items-center gap-2 text-status-error text-sm",children:[v.jsx(Up,{className:"w-4 h-4"}),v.jsx("span",{children:"Some files failed to save"})]}),H&&v.jsxs("div",{className:"flex items-center gap-2 text-status-error text-sm",children:[v.jsx(Up,{className:"w-4 h-4"}),v.jsx("span",{children:H})]})]}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-400 hover:text-white transition-colors",children:"Cancel"}),v.jsxs("button",{onClick:G,disabled:k||E.length===0||!V,className:Xt("flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors",k||E.length===0||!V?"bg-gray-600 text-gray-400 cursor-not-allowed":"bg-accent hover:bg-accent-hover text-white"),children:[v.jsx(rl,{className:"w-4 h-4"}),k?"Saving...":"Export"]})]})]})]})}):null}const Dm=df()(fS(e=>({apiMode:"proxy",apiKey:"",proxyUrl:"https://api.anthropic.com",setApiMode:n=>e({apiMode:n}),setApiKey:n=>e({apiKey:n}),setProxyUrl:n=>e({proxyUrl:n})}),{name:"makecc-settings"}));function Xz({isOpen:e,onClose:n}){const{apiMode:i,apiKey:a,proxyUrl:o,setApiMode:s,setApiKey:u,setProxyUrl:f}=Dm(),[h,d]=Q.useState(i),[g,m]=Q.useState(a),[x,b]=Q.useState(o),[w,E]=Q.useState(!1);if(Q.useEffect(()=>{e&&(d(i),m(a),b(o))},[e,i,a,o]),!e)return null;const N=async()=>{if(s(h),u(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(_){console.error("Failed to save API key:",_)}n()};return v.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:v.jsxs("div",{className:"bg-surface border border-border rounded-xl w-full max-w-md mx-4 shadow-2xl",children:[v.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[v.jsx("h2",{className:"text-lg font-semibold text-white",children:"설정"}),v.jsx("button",{onClick:n,className:"p-1 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(Nm,{className:"w-5 h-5 text-gray-400"})})]}),v.jsxs("div",{className:"p-6 space-y-6",children:[v.jsxs("div",{className:"space-y-3",children:[v.jsx("label",{className:"text-sm font-medium text-gray-300",children:"API 모드"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:`
|
|
95
102
|
flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-colors
|
|
96
103
|
${h==="proxy"?"border-accent bg-accent/10":"border-border hover:border-gray-600"}
|
|
97
104
|
`,children:[v.jsx("input",{type:"radio",name:"apiMode",value:"proxy",checked:h==="proxy",onChange:()=>d("proxy"),className:"sr-only"}),v.jsx(m5,{className:`w-5 h-5 ${h==="proxy"?"text-accent":"text-gray-400"}`}),v.jsxs("div",{className:"flex-1",children:[v.jsx("div",{className:`font-medium ${h==="proxy"?"text-white":"text-gray-300"}`,children:"프록시 서버"}),v.jsx("div",{className:"text-sm text-gray-500",children:"프록시 서버의 API 키를 사용합니다"})]}),h==="proxy"&&v.jsx("div",{className:"w-2 h-2 bg-accent rounded-full"})]}),v.jsxs("label",{className:`
|
|
98
105
|
flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-colors
|
|
99
106
|
${h==="direct"?"border-accent bg-accent/10":"border-border hover:border-gray-600"}
|
|
100
|
-
`,children:[v.jsx("input",{type:"radio",name:"apiMode",value:"direct",checked:h==="direct",onChange:()=>d("direct"),className:"sr-only"}),v.jsx(
|
|
107
|
+
`,children:[v.jsx("input",{type:"radio",name:"apiMode",value:"direct",checked:h==="direct",onChange:()=>d("direct"),className:"sr-only"}),v.jsx(e5,{className:`w-5 h-5 ${h==="direct"?"text-accent":"text-gray-400"}`}),v.jsxs("div",{className:"flex-1",children:[v.jsx("div",{className:`font-medium ${h==="direct"?"text-white":"text-gray-300"}`,children:"직접 입력"}),v.jsx("div",{className:"text-sm text-gray-500",children:"나만의 API 키를 사용합니다"})]}),h==="direct"&&v.jsx("div",{className:"w-2 h-2 bg-accent rounded-full"})]})]})]}),h==="proxy"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm font-medium text-gray-300",children:"프록시 서버 URL"}),v.jsx("input",{type:"text",value:x,onChange:_=>b(_.target.value),placeholder:"https://your-proxy-server.com",className:"w-full px-4 py-2.5 bg-surface-hover border border-border rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent"}),v.jsx("p",{className:"text-xs text-gray-500",children:"서버에서 API 키를 관리하는 프록시 서버 주소"})]}),h==="direct"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm font-medium text-gray-300",children:"Anthropic API 키"}),v.jsxs("div",{className:"relative",children:[v.jsx("input",{type:w?"text":"password",value:g,onChange:_=>m(_.target.value),placeholder:"sk-ant-...",className:"w-full px-4 py-2.5 pr-10 bg-surface-hover border border-border rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent"}),v.jsx("button",{type:"button",onClick:()=>E(!w),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-300",children:w?v.jsx(P3,{className:"w-4 h-4"}):v.jsx(oS,{className:"w-4 h-4"})})]}),v.jsx("p",{className:"text-xs text-gray-500",children:"API 키는 브라우저에 안전하게 저장됩니다"})]})]}),v.jsxs("div",{className:"flex justify-end gap-3 px-6 py-4 border-t border-border",children:[v.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-400 hover:text-white transition-colors",children:"취소"}),v.jsx("button",{onClick:N,className:"px-4 py-2 text-sm font-medium bg-accent hover:bg-accent-hover text-white rounded-lg transition-colors",children:"저장"})]})]})})}function Fz(){const{workflowName:e,setWorkflowName:n,isDraft:i,nodes:a,edges:o,clearWorkflow:s}=Hi(),{isRunning:u,execute:f}=GS(),[h,d]=Q.useState(!1),[g,m]=Q.useState(!1),[x,b]=Q.useState(null),w=()=>{const D=Dz(e,a,o,"local");b(D),d(!0)},E=()=>{d(!1),b(null)},N=()=>{u||f()},_=()=>{a.length!==0&&window.confirm("모든 워크플로우를 삭제하시겠습니까?")&&s()};return v.jsxs("header",{className:"flex items-center justify-between px-4 py-3 bg-surface border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx("button",{className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(C3,{className:"w-5 h-5 text-gray-400"})}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("input",{type:"text",value:e,onChange:D=>n(D.target.value),className:"bg-transparent border-none text-lg font-semibold text-white focus:outline-none focus:ring-2 focus:ring-accent rounded px-2 py-1"}),i&&v.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-yellow-500/20 text-yellow-400 rounded",children:"Draft"})]})]}),v.jsx("div",{className:"text-sm font-medium text-gray-400",children:"Visual Workflow Builder"}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"text-sm text-gray-500",children:"Saved"}),v.jsxs("button",{onClick:N,disabled:u,className:`
|
|
101
108
|
flex items-center gap-2 px-4 py-2 rounded-lg font-medium transition-colors
|
|
102
109
|
${u?"bg-gray-500 cursor-not-allowed text-white":"bg-accent hover:bg-accent-hover text-white"}
|
|
103
|
-
`,children:[v.jsx(
|
|
110
|
+
`,children:[v.jsx(Em,{className:"w-4 h-4"}),u?"Running...":"Run"]}),v.jsxs("button",{onClick:w,className:"flex items-center gap-2 px-3 py-2 bg-surface-hover hover:bg-border rounded-lg transition-colors",children:[v.jsx(rl,{className:"w-4 h-4 text-gray-400"}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Export"})]}),v.jsxs("button",{onClick:_,disabled:a.length===0,className:`
|
|
104
111
|
flex items-center gap-2 px-3 py-2 rounded-lg transition-colors
|
|
105
112
|
${a.length===0?"bg-surface-hover cursor-not-allowed opacity-50":"bg-surface-hover hover:bg-red-500/20 hover:text-red-400"}
|
|
106
|
-
`,title:"모든 노드 삭제",children:[v.jsx(cf,{className:"w-4 h-4 text-gray-400"}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Clear"})]}),v.jsx("button",{className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(f5,{className:"w-5 h-5 text-gray-400"})}),v.jsx("button",{onClick:()=>m(!0),className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",title:"설정",children:v.jsx(
|
|
113
|
+
`,title:"모든 노드 삭제",children:[v.jsx(cf,{className:"w-4 h-4 text-gray-400"}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Clear"})]}),v.jsx("button",{className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(f5,{className:"w-5 h-5 text-gray-400"})}),v.jsx("button",{onClick:()=>m(!0),className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",title:"설정",children:v.jsx(cS,{className:"w-5 h-5 text-gray-400"})})]}),x&&v.jsx(Yz,{isOpen:h,onClose:E,config:x}),v.jsx(Xz,{isOpen:g,onClose:()=>m(!1)})]})}const Gz=[{type:"input",label:"User Input",icon:v.jsx(uf,{className:"w-4 h-4"}),color:"text-yellow-400",hoverColor:"hover:bg-yellow-500/10"},{type:"subagent",label:"Sub Agent",icon:v.jsx(ms,{className:"w-4 h-4"}),color:"text-purple-400",hoverColor:"hover:bg-purple-500/10"},{type:"skill",label:"Skill",icon:v.jsx(ff,{className:"w-4 h-4"}),color:"text-cyan-400",hoverColor:"hover:bg-cyan-500/10"},{type:"command",label:"Command",icon:v.jsx(ra,{className:"w-4 h-4"}),color:"text-orange-400",hoverColor:"hover:bg-orange-500/10"},{type:"hook",label:"Hook",icon:v.jsx(_m,{className:"w-4 h-4"}),color:"text-pink-400",hoverColor:"hover:bg-pink-500/10"},{type:"output",label:"Output",icon:v.jsx(sf,{className:"w-4 h-4"}),color:"text-emerald-400",hoverColor:"hover:bg-emerald-500/10"}];function Zz(e){const n=rs(),i={x:100+Math.random()*200,y:100+Math.random()*200};switch(e){case"input":return{id:n,type:"input",position:i,data:{label:"User Input",description:"Enter your input here...",inputType:"text",status:"idle",placeholder:"Enter your prompt..."}};case"subagent":return{id:n,type:"subagent",position:i,data:{label:"Sub Agent",description:"Conduct in-depth research...",role:"researcher",tools:["WebSearch","WebFetch","Read"],status:"idle",usedInputs:[]}};case"skill":return{id:n,type:"skill",position:i,data:{label:"Skill",description:"Apply a specialized skill...",skillType:"official",status:"idle",usedInputs:[]}};case"command":return{id:n,type:"command",position:i,data:{label:"Command",description:"Execute a slash command...",commandName:"",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 Qz(){const e=Hi(i=>i.addNode),n=i=>{const a=Zz(i);e(a)};return v.jsx("div",{className:"flex items-center justify-center gap-2 py-3 bg-canvas border-b border-border",children:Gz.map(i=>v.jsxs("button",{onClick:()=>n(i.type),className:`
|
|
107
114
|
flex items-center gap-2 px-4 py-2 rounded-lg
|
|
108
115
|
bg-surface border border-border
|
|
109
116
|
${i.hoverColor}
|
|
110
117
|
transition-all duration-200
|
|
111
118
|
hover:border-gray-500
|
|
112
|
-
`,children:[v.jsx("span",{className:i.color,children:i.icon}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:i.label})]},i.type))})}function Qz({status:e}){switch(e){case"running":return v.jsx(oS,{className:"w-4 h-4 animate-spin text-blue-400"});case"completed":return v.jsx(U3,{className:"w-4 h-4 text-green-400"});case"error":return v.jsx(Up,{className:"w-4 h-4 text-red-400"});default:return v.jsx(_m,{className:"w-4 h-4"})}}function Kz({data:e,selected:n,children:i,headerIcon:a,headerColor:s="bg-gray-700",showSourceHandle:o=!0,showTargetHandle:u=!0}){const f=()=>{switch(e.status){case"running":return"border-indigo-500 animate-pulse-border";case"completed":return"border-green-500";case"error":return"border-red-500";default:return""}};return v.jsxs("div",{className:Xt("workflow-node",n&&"ring-2 ring-accent ring-offset-2 ring-offset-canvas",f()),children:[v.jsxs("div",{className:Xt("node-header flex items-center justify-between",s),children:[v.jsxs("div",{className:"flex items-center gap-2",children:[a,v.jsx("span",{className:"font-semibold text-sm text-white",children:e.label})]}),v.jsx("div",{className:"flex items-center gap-1",children:v.jsx(Qz,{status:e.status})})]}),v.jsxs("div",{className:"node-content",children:[e.description&&v.jsx("p",{className:"text-sm text-gray-400 mb-3",children:e.description}),i,e.usedInputs&&e.usedInputs.length>0&&v.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-700/50",children:[v.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"Used in this step"}),v.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.usedInputs.map(h=>v.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs bg-gray-700/50 border border-gray-600 text-gray-300",children:[v.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"}),h]},h))})]})]}),u&&v.jsx(pl,{type:"target",position:be.Left}),o&&v.jsx(pl,{type:"source",position:be.Right})]})}const xo=Q.memo(Kz);function Jz({data:e,selected:n}){return v.jsx(xo,{data:e,selected:n,headerIcon:v.jsx(of,{className:"w-4 h-4 text-amber-100"}),headerColor:"bg-gradient-to-br from-amber-500 to-orange-600",showTargetHandle:!1,showSourceHandle:!0,children:v.jsxs("div",{className:"text-gray-300",children:[e.inputType==="text"&&v.jsx("div",{className:"text-sm text-gray-400",children:e.value||e.placeholder||"Enter your input..."}),e.inputType==="file"&&v.jsx("div",{className:"text-sm text-gray-400",children:"Drop files here or click to upload"}),e.inputType==="select"&&e.options&&v.jsx("select",{className:"w-full px-2 py-1 text-sm bg-gray-700 border border-gray-600 rounded text-gray-300",children:e.options.map(i=>v.jsx("option",{value:i,children:i},i))})]})})}const Wz=Q.memo(Jz);function ej({data:e,selected:n}){return v.jsx(xo,{data:e,selected:n,headerIcon:v.jsx(ho,{className:"w-4 h-4 text-violet-100"}),headerColor:"bg-gradient-to-br from-violet-500 to-purple-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.tools&&e.tools.length>0&&v.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.tools.slice(0,3).map(i=>v.jsx("span",{className:"px-2 py-0.5 text-xs bg-purple-900/50 text-purple-300 rounded",children:i},i)),e.tools.length>3&&v.jsxs("span",{className:"px-2 py-0.5 text-xs bg-purple-900/50 text-purple-300 rounded",children:["+",e.tools.length-3]})]}),e.model&&v.jsxs("div",{className:"text-xs text-gray-500",children:["Model: ",e.model]})]})})}const tj=Q.memo(ej);function nj({data:e,selected:n}){return v.jsx(xo,{data:e,selected:n,headerIcon:v.jsx(ff,{className:"w-4 h-4 text-cyan-100"}),headerColor:"bg-gradient-to-br from-cyan-500 to-cyan-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.skillType==="official"&&e.skillId&&v.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-cyan-900/50 text-cyan-300 rounded",children:e.skillId}),e.skillCategory&&v.jsxs("div",{className:"text-xs text-gray-500",children:["Category: ",e.skillCategory]})]})})}const ij=Q.memo(nj);function rj({data:e,selected:n}){return v.jsx(xo,{data:e,selected:n,headerIcon:v.jsx(km,{className:"w-4 h-4 text-pink-100"}),headerColor:"bg-gradient-to-br from-pink-500 to-rose-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.serverName&&v.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-pink-900/50 text-pink-300 rounded",children:e.serverName}),v.jsxs("div",{className:"text-xs text-gray-500",children:["Type: ",e.serverType]})]})})}const aj=Q.memo(rj);function lj(e){switch(e){case"markdown":case"document":return v.jsx(rl,{className:"w-4 h-4 text-emerald-100"});case"image":return v.jsx(sS,{className:"w-4 h-4 text-emerald-100"});case"webpage":return v.jsx(G3,{className:"w-4 h-4 text-emerald-100"});case"link":return v.jsx(t5,{className:"w-4 h-4 text-emerald-100"});default:return v.jsx(sf,{className:"w-4 h-4 text-emerald-100"})}}function sj({data:e,selected:n}){return v.jsx(xo,{data:e,selected:n,headerIcon:lj(e.outputType),headerColor:"bg-gradient-to-br from-emerald-500 to-green-700",showTargetHandle:!0,showSourceHandle:!1,children:v.jsxs("div",{className:"space-y-2",children:[e.layoutType&&v.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-emerald-900/50 text-emerald-300 rounded",children:e.layoutType}),e.result&&v.jsxs("div",{className:"text-xs text-gray-400 truncate max-w-[200px]",children:[e.result.substring(0,50),"..."]})]})})}const oj=Q.memo(sj),jm=df(e=>({activeTab:"preview",isCollapsed:!1,width:400,setActiveTab:n=>e({activeTab:n}),toggleCollapsed:()=>e(n=>({isCollapsed:!n.isCollapsed})),setWidth:n=>e({width:Math.max(300,Math.min(600,n))}),openStepPanel:()=>e({activeTab:"step",isCollapsed:!1})}));function uj(e,n){const{source:i,target:a}=e;if(i===a)return!1;const s=n.find(u=>u.id===i),o=n.find(u=>u.id===a);return!s||!o?!1:s.type==="output"?(console.warn("Output nodes cannot have outgoing connections"),!1):o.type==="input"?(console.warn("Input nodes cannot have incoming connections"),!1):!0}const cj={input:Wz,subagent:tj,skill:ij,mcp:aj,output:oj};function fj(){const{nodes:e,edges:n,setNodes:i,setEdges:a,addEdge:s,setSelectedNode:o}=Hi(),u=jm(x=>x.openStepPanel),f=Q.useCallback(x=>{i(Cw(x,e))},[e,i]),h=Q.useCallback(x=>{a(Mw(x,n))},[n,a]),d=Q.useCallback(x=>{uj(x,e)&&(a(ow({...x,animated:!0},n)),s({id:`e-${x.source}-${x.target}`,source:x.source,target:x.target,animated:!0}))},[e,n,a,s]),g=Q.useCallback((x,b)=>{o(b.id),u()},[o,u]),m=Q.useCallback(()=>{o(null)},[o]);return v.jsxs(YA,{nodes:e,edges:n,onNodesChange:f,onEdgesChange:h,onConnect:d,onNodeClick:g,onPaneClick:m,nodeTypes:cj,fitView:!0,fitViewOptions:{padding:.2},defaultEdgeOptions:{animated:!0,style:{strokeDasharray:"5 5"}},connectionLineStyle:{strokeDasharray:"5 5"},snapToGrid:!0,snapGrid:[15,15],connectionRadius:40,connectOnClick:!0,children:[v.jsx(QA,{variant:Oi.Dots,gap:20,size:1,color:"#333333"}),v.jsx(i3,{}),v.jsx(g3,{nodeColor:x=>{switch(x.type){case"input":return"#fef3c7";case"subagent":return"#4f46e5";case"skill":return"#06b6d4";case"mcp":return"#ec4899";case"output":return"#10b981";default:return"#6b7280"}},maskColor:"rgba(0, 0, 0, 0.8)"})]})}function dj(e,n){const i={};return(e[e.length-1]===""?[...e,""]:e).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const hj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,mj={};function _1(e,n){return(mj.jsx?pj:hj).test(e)}const gj=/[ \t\n\f\r]/g;function yj(e){return typeof e=="object"?e.type==="text"?k1(e.value):!1:k1(e)}function k1(e){return e.replace(gj,"")===""}class bo{constructor(n,i,a){this.normal=i,this.property=n,a&&(this.space=a)}}bo.prototype.normal={};bo.prototype.property={};bo.prototype.space=void 0;function KS(e,n){const i={},a={};for(const s of e)Object.assign(i,s.property),Object.assign(a,s.normal);return new bo(i,a,n)}function Gp(e){return e.toLowerCase()}class ln{constructor(n,i){this.attribute=i,this.property=n}}ln.prototype.attribute="";ln.prototype.booleanish=!1;ln.prototype.boolean=!1;ln.prototype.commaOrSpaceSeparated=!1;ln.prototype.commaSeparated=!1;ln.prototype.defined=!1;ln.prototype.mustUseProperty=!1;ln.prototype.number=!1;ln.prototype.overloadedBoolean=!1;ln.prototype.property="";ln.prototype.spaceSeparated=!1;ln.prototype.space=void 0;let xj=0;const je=ra(),St=ra(),Zp=ra(),de=ra(),at=ra(),ll=ra(),bn=ra();function ra(){return 2**++xj}const Qp=Object.freeze(Object.defineProperty({__proto__:null,boolean:je,booleanish:St,commaOrSpaceSeparated:bn,commaSeparated:ll,number:de,overloadedBoolean:Zp,spaceSeparated:at},Symbol.toStringTag,{value:"Module"})),op=Object.keys(Qp);class Dm extends ln{constructor(n,i,a,s){let o=-1;if(super(n,i),E1(this,"space",s),typeof a=="number")for(;++o<op.length;){const u=op[o];E1(this,op[o],(a&Qp[u])===Qp[u])}}}Dm.prototype.defined=!0;function E1(e,n,i){i&&(e[n]=i)}function xl(e){const n={},i={};for(const[a,s]of Object.entries(e.properties)){const o=new Dm(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),n[a]=o,i[Gp(a)]=a,i[Gp(o.attribute)]=a}return new bo(n,i,e.space)}const JS=xl({properties:{ariaActiveDescendant:null,ariaAtomic:St,ariaAutoComplete:null,ariaBusy:St,ariaChecked:St,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:St,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:St,ariaFlowTo:at,ariaGrabbed:St,ariaHasPopup:null,ariaHidden:St,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:de,ariaLive:null,ariaModal:St,ariaMultiLine:St,ariaMultiSelectable:St,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:St,ariaReadOnly:St,ariaRelevant:null,ariaRequired:St,ariaRoleDescription:at,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:St,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function WS(e,n){return n in e?e[n]:n}function e2(e,n){return WS(e,n.toLowerCase())}const bj=xl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ll,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:je,allowPaymentRequest:je,allowUserMedia:je,alt:null,as:null,async:je,autoCapitalize:null,autoComplete:at,autoFocus:je,autoPlay:je,blocking:at,capture:null,charSet:null,checked:je,cite:null,className:at,cols:de,colSpan:null,content:null,contentEditable:St,controls:je,controlsList:at,coords:de|ll,crossOrigin:null,data:null,dateTime:null,decoding:null,default:je,defer:je,dir:null,dirName:null,disabled:je,download:Zp,draggable:St,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:je,formTarget:null,headers:at,height:de,hidden:Zp,high:de,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:je,inputMode:null,integrity:null,is:null,isMap:je,itemId:null,itemProp:at,itemRef:at,itemScope:je,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:je,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:je,muted:je,name:null,nonce:null,noModule:je,noValidate:je,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:je,optimum:de,pattern:null,ping:at,placeholder:null,playsInline:je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:je,referrerPolicy:null,rel:at,required:je,reversed:je,rows:de,rowSpan:de,sandbox:at,scope:null,scoped:je,seamless:je,selected:je,shadowRootClonable:je,shadowRootDelegatesFocus:je,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:St,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:je,useMap:null,value:St,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:at,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:je,declare:je,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:je,noHref:je,noShade:je,noWrap:je,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:St,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:je,disableRemotePlayback:je,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:e2}),vj=xl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:bn,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:at,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:je,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ll,g2:ll,glyphName:ll,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:bn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:de,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:at,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bn,rev:bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bn,requiredFeatures:bn,requiredFonts:bn,requiredFormats:bn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:bn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bn,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:WS}),t2=xl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),n2=xl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:e2}),i2=xl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),wj={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Sj=/[A-Z]/g,N1=/-[a-z]/g,_j=/^data[-\w.:]+$/i;function kj(e,n){const i=Gp(n);let a=n,s=ln;if(i in e.normal)return e.property[e.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&_j.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(N1,Nj);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!N1.test(o)){let u=o.replace(Sj,Ej);u.charAt(0)!=="-"&&(u="-"+u),n="data"+u}}s=Dm}return new s(a,n)}function Ej(e){return"-"+e.toLowerCase()}function Nj(e){return e.charAt(1).toUpperCase()}const Cj=KS([JS,bj,t2,n2,i2],"html"),Rm=KS([JS,vj,t2,n2,i2],"svg");function Mj(e){return e.join(" ").trim()}var Ga={},up,C1;function Tj(){if(C1)return up;C1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
|
|
113
|
-
`,d="/",g="*",m="",x="comment",b="declaration";function w(N,_){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];_=_||{};var D=1,k=1;function C(O){var B=O.match(n);B&&(D+=B.length);var j=O.lastIndexOf(h);k=~j?O.length-j:k+O.length}function L(){var O={line:D,column:k};return function(B){return B.position=new A(O),G(),B}}function A(O){this.start=O,this.end={line:D,column:k},this.source=_.source}A.prototype.content=N;function H(O){var B=new Error(_.source+":"+D+":"+k+": "+O);if(B.reason=O,B.filename=_.source,B.line=D,B.column=k,B.source=N,!_.silent)throw B}function F(O){var B=O.exec(N);if(B){var j=B[0];return C(j),N=N.slice(j.length),B}}function G(){F(i)}function q(O){var B;for(O=O||[];B=V();)B!==!1&&O.push(B);return O}function V(){var O=L();if(!(d!=N.charAt(0)||g!=N.charAt(1))){for(var B=2;m!=N.charAt(B)&&(g!=N.charAt(B)||d!=N.charAt(B+1));)++B;if(B+=2,m===N.charAt(B-1))return H("End of comment missing");var j=N.slice(2,B-2);return k+=2,C(j),N=N.slice(B),k+=2,O({type:x,comment:j})}}function P(){var O=L(),B=F(a);if(B){if(V(),!F(s))return H("property missing ':'");var j=F(o),U=O({type:b,property:E(B[0].replace(e,m)),value:j?E(j[0].replace(e,m)):m});return F(u),U}}function te(){var O=[];q(O);for(var B;B=P();)B!==!1&&(O.push(B),q(O));return O}return G(),te()}function E(N){return N?N.replace(f,m):m}return up=w,up}var M1;function Aj(){if(M1)return Ga;M1=1;var e=Ga&&Ga.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.default=i;const n=e(Tj());function i(a,s){let o=null;if(!a||typeof a!="string")return o;const u=(0,n.default)(a),f=typeof s=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:g}=h;f?s(d,g,h):g&&(o=o||{},o[d]=g)}),o}return Ga}var js={},T1;function zj(){if(T1)return js;T1=1,Object.defineProperty(js,"__esModule",{value:!0}),js.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,i=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(d){return!d||i.test(d)||e.test(d)},u=function(d,g){return g.toUpperCase()},f=function(d,g){return"".concat(g,"-")},h=function(d,g){return g===void 0&&(g={}),o(d)?d:(d=d.toLowerCase(),g.reactCompat?d=d.replace(s,f):d=d.replace(a,f),d.replace(n,u))};return js.camelCase=h,js}var Ds,A1;function jj(){if(A1)return Ds;A1=1;var e=Ds&&Ds.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(Aj()),i=zj();function a(s,o){var u={};return!s||typeof s!="string"||(0,n.default)(s,function(f,h){f&&h&&(u[(0,i.camelCase)(f,o)]=h)}),u}return a.default=a,Ds=a,Ds}var Dj=jj();const Rj=Fc(Dj),r2=a2("end"),Om=a2("start");function a2(e){return n;function n(i){const a=i&&i.position&&i.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function Oj(e){const n=Om(e),i=r2(e);if(n&&i)return{start:n,end:i}}function Vs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?z1(e.position):"start"in e||"end"in e?z1(e):"line"in e||"column"in e?Kp(e):""}function Kp(e){return j1(e&&e.line)+":"+j1(e&&e.column)}function z1(e){return Kp(e&&e.start)+"-"+Kp(e&&e.end)}function j1(e){return e&&typeof e=="number"?e:1}class $t extends Error{constructor(n,i,a){super(),typeof i=="string"&&(a=i,i=void 0);let s="",o={},u=!1;if(i&&("line"in i&&"column"in i?o={place:i}:"start"in i&&"end"in i?o={place:i}:"type"in i?o={ancestors:[i],place:i.position}:o={...i}),typeof n=="string"?s=n:!o.cause&&n&&(u=!0,s=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?o.ruleId=a:(o.source=a.slice(0,h),o.ruleId=a.slice(h+1))}if(!o.place&&o.ancestors&&o.ancestors){const h=o.ancestors[o.ancestors.length-1];h&&(o.place=h.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=f?f.line:void 0,this.name=Vs(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=u&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}$t.prototype.file="";$t.prototype.name="";$t.prototype.reason="";$t.prototype.message="";$t.prototype.stack="";$t.prototype.column=void 0;$t.prototype.line=void 0;$t.prototype.ancestors=void 0;$t.prototype.cause=void 0;$t.prototype.fatal=void 0;$t.prototype.place=void 0;$t.prototype.ruleId=void 0;$t.prototype.source=void 0;const Lm={}.hasOwnProperty,Lj=new Map,Hj=/[A-Z]/g,Bj=new Set(["table","tbody","thead","tfoot","tr"]),Uj=new Set(["td","th"]),l2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Ij(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=n.filePath||void 0;let a;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=Gj(i,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=Fj(i,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:a,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Rm:Cj,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=s2(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function s2(e,n,i){if(n.type==="element")return qj(e,n,i);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return $j(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Pj(e,n,i);if(n.type==="mdxjsEsm")return Vj(e,n);if(n.type==="root")return Yj(e,n,i);if(n.type==="text")return Xj(e,n)}function qj(e,n,i){const a=e.schema;let s=a;n.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=Rm,e.schema=s),e.ancestors.push(n);const o=u2(e,n.tagName,!1),u=Zj(e,n);let f=Bm(e,n);return Bj.has(n.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!yj(h):!0})),o2(e,u,o,n),Hm(u,f),e.ancestors.pop(),e.schema=a,e.create(n,o,u,i)}function $j(e,n){if(n.data&&n.data.estree&&e.evaluater){const a=n.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}io(e,n.position)}function Vj(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);io(e,n.position)}function Pj(e,n,i){const a=e.schema;let s=a;n.name==="svg"&&a.space==="html"&&(s=Rm,e.schema=s),e.ancestors.push(n);const o=n.name===null?e.Fragment:u2(e,n.name,!0),u=Qj(e,n),f=Bm(e,n);return o2(e,u,o,n),Hm(u,f),e.ancestors.pop(),e.schema=a,e.create(n,o,u,i)}function Yj(e,n,i){const a={};return Hm(a,Bm(e,n)),e.create(n,e.Fragment,a,i)}function Xj(e,n){return n.value}function o2(e,n,i,a){typeof i!="string"&&i!==e.Fragment&&e.passNode&&(n.node=a)}function Hm(e,n){if(n.length>0){const i=n.length>1?n:n[0];i&&(e.children=i)}}function Fj(e,n,i){return a;function a(s,o,u,f){const d=Array.isArray(u.children)?i:n;return f?d(o,u,f):d(o,u)}}function Gj(e,n){return i;function i(a,s,o,u){const f=Array.isArray(o.children),h=Om(a);return n(s,o,u,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function Zj(e,n){const i={};let a,s;for(s in n.properties)if(s!=="children"&&Lm.call(n.properties,s)){const o=Kj(e,s,n.properties[s]);if(o){const[u,f]=o;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&Uj.has(n.tagName)?a=f:i[u]=f}}if(a){const o=i.style||(i.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return i}function Qj(e,n){const i={};for(const a of n.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const u=o.expression;u.type;const f=u.properties[0];f.type,Object.assign(i,e.evaluater.evaluateExpression(f.argument))}else io(e,n.position);else{const s=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else io(e,n.position);else o=a.value===null?!0:a.value;i[s]=o}return i}function Bm(e,n){const i=[];let a=-1;const s=e.passKeys?new Map:Lj;for(;++a<n.children.length;){const o=n.children[a];let u;if(e.passKeys){const h=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(h){const d=s.get(h)||0;u=h+"-"+d,s.set(h,d+1)}}const f=s2(e,o,u);f!==void 0&&i.push(f)}return i}function Kj(e,n,i){const a=kj(e.schema,n);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=a.commaSeparated?dj(i):Mj(i)),a.property==="style"){let s=typeof i=="object"?i:Jj(e,String(i));return e.stylePropertyNameCase==="css"&&(s=Wj(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?wj[a.property]||a.property:a.attribute,i]}}function Jj(e,n){try{return Rj(n,{reactCompat:!0})}catch(i){if(e.ignoreInvalidStyle)return{};const a=i,s=new $t("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=l2+"#cannot-parse-style-attribute",s}}function u2(e,n,i){let a;if(!i)a={type:"Literal",value:n};else if(n.includes(".")){const s=n.split(".");let o=-1,u;for(;++o<s.length;){const f=_1(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=u}else a=_1(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(a.type==="Literal"){const s=a.value;return Lm.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);io(e)}function io(e,n){const i=new $t("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=l2+"#cannot-handle-mdx-estrees-without-createevaluater",i}function Wj(e){const n={};let i;for(i in e)Lm.call(e,i)&&(n[eD(i)]=e[i]);return n}function eD(e){let n=e.replace(Hj,tD);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function tD(e){return"-"+e.toLowerCase()}const cp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},nD={};function Um(e,n){const i=nD,a=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,s=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return c2(e,a,s)}function c2(e,n,i){if(iD(e)){if("value"in e)return e.type==="html"&&!i?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return D1(e.children,n,i)}return Array.isArray(e)?D1(e,n,i):""}function D1(e,n,i){const a=[];let s=-1;for(;++s<e.length;)a[s]=c2(e[s],n,i);return a.join("")}function iD(e){return!!(e&&typeof e=="object")}const R1=document.createElement("i");function Im(e){const n="&"+e+";";R1.innerHTML=n;const i=R1.textContent;return i.charCodeAt(i.length-1)===59&&e!=="semi"||i===n?!1:i}function wn(e,n,i,a){const s=e.length;let o=0,u;if(n<0?n=-n>s?0:s+n:n=n>s?s:n,i=i>0?i:0,a.length<1e4)u=Array.from(a),u.unshift(n,i),e.splice(...u);else for(i&&e.splice(n,i);o<a.length;)u=a.slice(o,o+1e4),u.unshift(n,0),e.splice(...u),o+=1e4,n+=1e4}function Dn(e,n){return e.length>0?(wn(e,e.length,0,n),e):n}const O1={}.hasOwnProperty;function f2(e){const n={};let i=-1;for(;++i<e.length;)rD(n,e[i]);return n}function rD(e,n){let i;for(i in n){const s=(O1.call(e,i)?e[i]:void 0)||(e[i]={}),o=n[i];let u;if(o)for(u in o){O1.call(s,u)||(s[u]=[]);const f=o[u];aD(s[u],Array.isArray(f)?f:f?[f]:[])}}}function aD(e,n){let i=-1;const a=[];for(;++i<n.length;)(n[i].add==="after"?e:a).push(n[i]);wn(e,0,0,a)}function d2(e,n){const i=Number.parseInt(e,n);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function Yn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ft=Sr(/[A-Za-z]/),It=Sr(/[\dA-Za-z]/),lD=Sr(/[#-'*+\--9=?A-Z^-~]/);function Vc(e){return e!==null&&(e<32||e===127)}const Jp=Sr(/\d/),sD=Sr(/[\dA-Fa-f]/),oD=Sr(/[!-/:-@[-`{-~]/);function Se(e){return e!==null&&e<-2}function rt(e){return e!==null&&(e<0||e===32)}function Be(e){return e===-2||e===-1||e===32}const yf=Sr(new RegExp("\\p{P}|\\p{S}","u")),ia=Sr(/\s/);function Sr(e){return n;function n(i){return i!==null&&i>-1&&e.test(String.fromCharCode(i))}}function bl(e){const n=[];let i=-1,a=0,s=0;for(;++i<e.length;){const o=e.charCodeAt(i);let u="";if(o===37&&It(e.charCodeAt(i+1))&&It(e.charCodeAt(i+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(i+1);o<56320&&f>56319&&f<57344?(u=String.fromCharCode(o,f),s=1):u="�"}else u=String.fromCharCode(o);u&&(n.push(e.slice(a,i),encodeURIComponent(u)),a=i+s+1,u=""),s&&(i+=s,s=0)}return n.join("")+e.slice(a)}function Pe(e,n,i,a){const s=a?a-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(h){return Be(h)?(e.enter(i),f(h)):n(h)}function f(h){return Be(h)&&o++<s?(e.consume(h),f):(e.exit(i),n(h))}}const uD={tokenize:cD};function cD(e){const n=e.attempt(this.parser.constructs.contentInitial,a,s);let i;return n;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Pe(e,n,"linePrefix")}function s(f){return e.enter("paragraph"),o(f)}function o(f){const h=e.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=h),i=h,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Se(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),u)}}const fD={tokenize:dD},L1={tokenize:hD};function dD(e){const n=this,i=[];let a=0,s,o,u;return f;function f(k){if(a<i.length){const C=i[a];return n.containerState=C[1],e.attempt(C[0].continuation,h,d)(k)}return d(k)}function h(k){if(a++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,s&&D();const C=n.events.length;let L=C,A;for(;L--;)if(n.events[L][0]==="exit"&&n.events[L][1].type==="chunkFlow"){A=n.events[L][1].end;break}_(a);let H=C;for(;H<n.events.length;)n.events[H][1].end={...A},H++;return wn(n.events,L+1,0,n.events.slice(C)),n.events.length=H,d(k)}return f(k)}function d(k){if(a===i.length){if(!s)return x(k);if(s.currentConstruct&&s.currentConstruct.concrete)return w(k);n.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(L1,g,m)(k)}function g(k){return s&&D(),_(a),x(k)}function m(k){return n.parser.lazy[n.now().line]=a!==i.length,u=n.now().offset,w(k)}function x(k){return n.containerState={},e.attempt(L1,b,w)(k)}function b(k){return a++,i.push([n.currentConstruct,n.containerState]),x(k)}function w(k){if(k===null){s&&D(),_(0),e.consume(k);return}return s=s||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),E(k)}function E(k){if(k===null){N(e.exit("chunkFlow"),!0),_(0),e.consume(k);return}return Se(k)?(e.consume(k),N(e.exit("chunkFlow")),a=0,n.interrupt=void 0,f):(e.consume(k),E)}function N(k,C){const L=n.sliceStream(k);if(C&&L.push(null),k.previous=o,o&&(o.next=k),o=k,s.defineSkip(k.start),s.write(L),n.parser.lazy[k.start.line]){let A=s.events.length;for(;A--;)if(s.events[A][1].start.offset<u&&(!s.events[A][1].end||s.events[A][1].end.offset>u))return;const H=n.events.length;let F=H,G,q;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){if(G){q=n.events[F][1].end;break}G=!0}for(_(a),A=H;A<n.events.length;)n.events[A][1].end={...q},A++;wn(n.events,F+1,0,n.events.slice(H)),n.events.length=A}}function _(k){let C=i.length;for(;C-- >k;){const L=i[C];n.containerState=L[1],L[0].exit.call(n,e)}i.length=k}function D(){s.write([null]),o=void 0,s=void 0,n.containerState._closeFlow=void 0}}function hD(e,n,i){return Pe(e,e.attempt(this.parser.constructs.document,n,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ml(e){if(e===null||rt(e)||ia(e))return 1;if(yf(e))return 2}function xf(e,n,i){const a=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!a.includes(o)&&(n=o(n,i),a.push(o))}return n}const Wp={name:"attention",resolveAll:pD,tokenize:mD};function pD(e,n){let i=-1,a,s,o,u,f,h,d,g;for(;++i<e.length;)if(e[i][0]==="enter"&&e[i][1].type==="attentionSequence"&&e[i][1]._close){for(a=i;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&n.sliceSerialize(e[a][1]).charCodeAt(0)===n.sliceSerialize(e[i][1]).charCodeAt(0)){if((e[a][1]._close||e[i][1]._open)&&(e[i][1].end.offset-e[i][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[i][1].end.offset-e[i][1].start.offset)%3))continue;h=e[a][1].end.offset-e[a][1].start.offset>1&&e[i][1].end.offset-e[i][1].start.offset>1?2:1;const m={...e[a][1].end},x={...e[i][1].start};H1(m,-h),H1(x,h),u={type:h>1?"strongSequence":"emphasisSequence",start:m,end:{...e[a][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[i][1].start},end:x},o={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[i][1].start}},s={type:h>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[a][1].end={...u.start},e[i][1].start={...f.end},d=[],e[a][1].end.offset-e[a][1].start.offset&&(d=Dn(d,[["enter",e[a][1],n],["exit",e[a][1],n]])),d=Dn(d,[["enter",s,n],["enter",u,n],["exit",u,n],["enter",o,n]]),d=Dn(d,xf(n.parser.constructs.insideSpan.null,e.slice(a+1,i),n)),d=Dn(d,[["exit",o,n],["enter",f,n],["exit",f,n],["exit",s,n]]),e[i][1].end.offset-e[i][1].start.offset?(g=2,d=Dn(d,[["enter",e[i][1],n],["exit",e[i][1],n]])):g=0,wn(e,a-1,i-a+3,d),i=a+d.length-g-2;break}}for(i=-1;++i<e.length;)e[i][1].type==="attentionSequence"&&(e[i][1].type="data");return e}function mD(e,n){const i=this.parser.constructs.attentionMarkers.null,a=this.previous,s=ml(a);let o;return u;function u(h){return o=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===o)return e.consume(h),f;const d=e.exit("attentionSequence"),g=ml(h),m=!g||g===2&&s||i.includes(h),x=!s||s===2&&g||i.includes(a);return d._open=!!(o===42?m:m&&(s||!x)),d._close=!!(o===42?x:x&&(g||!m)),n(h)}}function H1(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const gD={name:"autolink",tokenize:yD};function yD(e,n,i){let a=0;return s;function s(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(b){return Ft(b)?(e.consume(b),u):b===64?i(b):d(b)}function u(b){return b===43||b===45||b===46||It(b)?(a=1,f(b)):d(b)}function f(b){return b===58?(e.consume(b),a=0,h):(b===43||b===45||b===46||It(b))&&a++<32?(e.consume(b),f):(a=0,d(b))}function h(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),n):b===null||b===32||b===60||Vc(b)?i(b):(e.consume(b),h)}function d(b){return b===64?(e.consume(b),g):lD(b)?(e.consume(b),d):i(b)}function g(b){return It(b)?m(b):i(b)}function m(b){return b===46?(e.consume(b),a=0,g):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),n):x(b)}function x(b){if((b===45||It(b))&&a++<63){const w=b===45?x:m;return e.consume(b),w}return i(b)}}const vo={partial:!0,tokenize:xD};function xD(e,n,i){return a;function a(o){return Be(o)?Pe(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||Se(o)?n(o):i(o)}}const h2={continuation:{tokenize:vD},exit:wD,name:"blockQuote",tokenize:bD};function bD(e,n,i){const a=this;return s;function s(u){if(u===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),o}return i(u)}function o(u){return Be(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(u))}}function vD(e,n,i){const a=this;return s;function s(u){return Be(u)?Pe(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(h2,n,i)(u)}}function wD(e){e.exit("blockQuote")}const p2={name:"characterEscape",tokenize:SD};function SD(e,n,i){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return oD(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):i(o)}}const m2={name:"characterReference",tokenize:_D};function _D(e,n,i){const a=this;let s=0,o,u;return f;function f(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),h}function h(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),o=31,u=It,g(m))}function d(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=sD,g):(e.enter("characterReferenceValue"),o=7,u=Jp,g(m))}function g(m){if(m===59&&s){const x=e.exit("characterReferenceValue");return u===It&&!Im(a.sliceSerialize(x))?i(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return u(m)&&s++<o?(e.consume(m),g):i(m)}}const B1={partial:!0,tokenize:ED},U1={concrete:!0,name:"codeFenced",tokenize:kD};function kD(e,n,i){const a=this,s={partial:!0,tokenize:L};let o=0,u=0,f;return h;function h(A){return d(A)}function d(A){const H=a.events[a.events.length-1];return o=H&&H[1].type==="linePrefix"?H[2].sliceSerialize(H[1],!0).length:0,f=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(A)}function g(A){return A===f?(u++,e.consume(A),g):u<3?i(A):(e.exit("codeFencedFenceSequence"),Be(A)?Pe(e,m,"whitespace")(A):m(A))}function m(A){return A===null||Se(A)?(e.exit("codeFencedFence"),a.interrupt?n(A):e.check(B1,E,C)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(A))}function x(A){return A===null||Se(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(A)):Be(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Pe(e,b,"whitespace")(A)):A===96&&A===f?i(A):(e.consume(A),x)}function b(A){return A===null||Se(A)?m(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(A))}function w(A){return A===null||Se(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(A)):A===96&&A===f?i(A):(e.consume(A),w)}function E(A){return e.attempt(s,C,N)(A)}function N(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),_}function _(A){return o>0&&Be(A)?Pe(e,D,"linePrefix",o+1)(A):D(A)}function D(A){return A===null||Se(A)?e.check(B1,E,C)(A):(e.enter("codeFlowValue"),k(A))}function k(A){return A===null||Se(A)?(e.exit("codeFlowValue"),D(A)):(e.consume(A),k)}function C(A){return e.exit("codeFenced"),n(A)}function L(A,H,F){let G=0;return q;function q(B){return A.enter("lineEnding"),A.consume(B),A.exit("lineEnding"),V}function V(B){return A.enter("codeFencedFence"),Be(B)?Pe(A,P,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):P(B)}function P(B){return B===f?(A.enter("codeFencedFenceSequence"),te(B)):F(B)}function te(B){return B===f?(G++,A.consume(B),te):G>=u?(A.exit("codeFencedFenceSequence"),Be(B)?Pe(A,O,"whitespace")(B):O(B)):F(B)}function O(B){return B===null||Se(B)?(A.exit("codeFencedFence"),H(B)):F(B)}}}function ED(e,n,i){const a=this;return s;function s(u){return u===null?i(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return a.parser.lazy[a.now().line]?i(u):n(u)}}const fp={name:"codeIndented",tokenize:CD},ND={partial:!0,tokenize:MD};function CD(e,n,i){const a=this;return s;function s(d){return e.enter("codeIndented"),Pe(e,o,"linePrefix",5)(d)}function o(d){const g=a.events[a.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?u(d):i(d)}function u(d){return d===null?h(d):Se(d)?e.attempt(ND,u,h)(d):(e.enter("codeFlowValue"),f(d))}function f(d){return d===null||Se(d)?(e.exit("codeFlowValue"),u(d)):(e.consume(d),f)}function h(d){return e.exit("codeIndented"),n(d)}}function MD(e,n,i){const a=this;return s;function s(u){return a.parser.lazy[a.now().line]?i(u):Se(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):Pe(e,o,"linePrefix",5)(u)}function o(u){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(u):Se(u)?s(u):i(u)}}const TD={name:"codeText",previous:zD,resolve:AD,tokenize:jD};function AD(e){let n=e.length-4,i=3,a,s;if((e[i][1].type==="lineEnding"||e[i][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(a=i;++a<n;)if(e[a][1].type==="codeTextData"){e[i][1].type="codeTextPadding",e[n][1].type="codeTextPadding",i+=2,n-=2;break}}for(a=i-1,n++;++a<=n;)s===void 0?a!==n&&e[a][1].type!=="lineEnding"&&(s=a):(a===n||e[a][1].type==="lineEnding")&&(e[s][1].type="codeTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),n-=a-s-2,a=s+2),s=void 0);return e}function zD(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function jD(e,n,i){let a=0,s,o;return u;function u(m){return e.enter("codeText"),e.enter("codeTextSequence"),f(m)}function f(m){return m===96?(e.consume(m),a++,f):(e.exit("codeTextSequence"),h(m))}function h(m){return m===null?i(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),h):m===96?(o=e.enter("codeTextSequence"),s=0,g(m)):Se(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||Se(m)?(e.exit("codeTextData"),h(m)):(e.consume(m),d)}function g(m){return m===96?(e.consume(m),s++,g):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),n(m)):(o.type="codeTextData",d(m))}}class DD{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,i){const a=i??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(n,a):n>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(n,i,a){const s=i||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&Rs(this.left,a),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Rs(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Rs(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const i=this.left.splice(n,Number.POSITIVE_INFINITY);Rs(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Rs(this.left,i.reverse())}}}function Rs(e,n){let i=0;if(n.length<1e4)e.push(...n);else for(;i<n.length;)e.push(...n.slice(i,i+1e4)),i+=1e4}function g2(e){const n={};let i=-1,a,s,o,u,f,h,d;const g=new DD(e);for(;++i<g.length;){for(;i in n;)i=n[i];if(a=g.get(i),i&&a[1].type==="chunkFlow"&&g.get(i-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,o=0,o<h.length&&h[o][1].type==="lineEndingBlank"&&(o+=2),o<h.length&&h[o][1].type==="content"))for(;++o<h.length&&h[o][1].type!=="content";)h[o][1].type==="chunkText"&&(h[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(n,RD(g,i)),i=n[i],d=!0);else if(a[1]._container){for(o=i,s=void 0;o--;)if(u=g.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(s&&(g.get(s)[1].type="lineEndingBlank"),u[1].type="lineEnding",s=o);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;s&&(a[1].end={...g.get(s)[1].start},f=g.slice(s,i),f.unshift(a),g.splice(s,i-s+1,f))}}return wn(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!d}function RD(e,n){const i=e.get(n)[1],a=e.get(n)[2];let s=n-1;const o=[];let u=i._tokenizer;u||(u=a.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,h=[],d={};let g,m,x=-1,b=i,w=0,E=0;const N=[E];for(;b;){for(;e.get(++s)[1]!==b;);o.push(s),b._tokenizer||(g=a.sliceStream(b),b.next||g.push(null),m&&u.defineSkip(b.start),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(g),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),m=b,b=b.next}for(b=i;++x<f.length;)f[x][0]==="exit"&&f[x-1][0]==="enter"&&f[x][1].type===f[x-1][1].type&&f[x][1].start.line!==f[x][1].end.line&&(E=x+1,N.push(E),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(u.events=[],b?(b._tokenizer=void 0,b.previous=void 0):N.pop(),x=N.length;x--;){const _=f.slice(N[x],N[x+1]),D=o.pop();h.push([D,D+_.length-1]),e.splice(D,2,_)}for(h.reverse(),x=-1;++x<h.length;)d[w+h[x][0]]=w+h[x][1],w+=h[x][1]-h[x][0]-1;return d}const OD={resolve:HD,tokenize:BD},LD={partial:!0,tokenize:UD};function HD(e){return g2(e),e}function BD(e,n){let i;return a;function a(f){return e.enter("content"),i=e.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?o(f):Se(f)?e.check(LD,u,o)(f):(e.consume(f),s)}function o(f){return e.exit("chunkContent"),e.exit("content"),n(f)}function u(f){return e.consume(f),e.exit("chunkContent"),i.next=e.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,s}}function UD(e,n,i){const a=this;return s;function s(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Pe(e,o,"linePrefix")}function o(u){if(u===null||Se(u))return i(u);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(u):e.interrupt(a.parser.constructs.flow,i,n)(u)}}function y2(e,n,i,a,s,o,u,f,h){const d=h||Number.POSITIVE_INFINITY;let g=0;return m;function m(_){return _===60?(e.enter(a),e.enter(s),e.enter(o),e.consume(_),e.exit(o),x):_===null||_===32||_===41||Vc(_)?i(_):(e.enter(a),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),E(_))}function x(_){return _===62?(e.enter(o),e.consume(_),e.exit(o),e.exit(s),e.exit(a),n):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(_))}function b(_){return _===62?(e.exit("chunkString"),e.exit(f),x(_)):_===null||_===60||Se(_)?i(_):(e.consume(_),_===92?w:b)}function w(_){return _===60||_===62||_===92?(e.consume(_),b):b(_)}function E(_){return!g&&(_===null||_===41||rt(_))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(a),n(_)):g<d&&_===40?(e.consume(_),g++,E):_===41?(e.consume(_),g--,E):_===null||_===32||_===40||Vc(_)?i(_):(e.consume(_),_===92?N:E)}function N(_){return _===40||_===41||_===92?(e.consume(_),E):E(_)}}function x2(e,n,i,a,s,o){const u=this;let f=0,h;return d;function d(b){return e.enter(a),e.enter(s),e.consume(b),e.exit(s),e.enter(o),g}function g(b){return f>999||b===null||b===91||b===93&&!h||b===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?i(b):b===93?(e.exit(o),e.enter(s),e.consume(b),e.exit(s),e.exit(a),n):Se(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||b===91||b===93||Se(b)||f++>999?(e.exit("chunkString"),g(b)):(e.consume(b),h||(h=!Be(b)),b===92?x:m)}function x(b){return b===91||b===92||b===93?(e.consume(b),f++,m):m(b)}}function b2(e,n,i,a,s,o){let u;return f;function f(x){return x===34||x===39||x===40?(e.enter(a),e.enter(s),e.consume(x),e.exit(s),u=x===40?41:x,h):i(x)}function h(x){return x===u?(e.enter(s),e.consume(x),e.exit(s),e.exit(a),n):(e.enter(o),d(x))}function d(x){return x===u?(e.exit(o),h(u)):x===null?i(x):Se(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Pe(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===u||x===null||Se(x)?(e.exit("chunkString"),d(x)):(e.consume(x),x===92?m:g)}function m(x){return x===u||x===92?(e.consume(x),g):g(x)}}function Ps(e,n){let i;return a;function a(s){return Se(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i=!0,a):Be(s)?Pe(e,a,i?"linePrefix":"lineSuffix")(s):n(s)}}const ID={name:"definition",tokenize:$D},qD={partial:!0,tokenize:VD};function $D(e,n,i){const a=this;let s;return o;function o(b){return e.enter("definition"),u(b)}function u(b){return x2.call(a,e,f,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return s=Yn(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),h):i(b)}function h(b){return rt(b)?Ps(e,d)(b):d(b)}function d(b){return y2(e,g,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(qD,m,m)(b)}function m(b){return Be(b)?Pe(e,x,"whitespace")(b):x(b)}function x(b){return b===null||Se(b)?(e.exit("definition"),a.parser.defined.push(s),n(b)):i(b)}}function VD(e,n,i){return a;function a(f){return rt(f)?Ps(e,s)(f):i(f)}function s(f){return b2(e,o,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return Be(f)?Pe(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Se(f)?n(f):i(f)}}const PD={name:"hardBreakEscape",tokenize:YD};function YD(e,n,i){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return Se(o)?(e.exit("hardBreakEscape"),n(o)):i(o)}}const XD={name:"headingAtx",resolve:FD,tokenize:GD};function FD(e,n){let i=e.length-2,a=3,s,o;return e[a][1].type==="whitespace"&&(a+=2),i-2>a&&e[i][1].type==="whitespace"&&(i-=2),e[i][1].type==="atxHeadingSequence"&&(a===i-1||i-4>a&&e[i-2][1].type==="whitespace")&&(i-=a+1===i?2:4),i>a&&(s={type:"atxHeadingText",start:e[a][1].start,end:e[i][1].end},o={type:"chunkText",start:e[a][1].start,end:e[i][1].end,contentType:"text"},wn(e,a,i-a+1,[["enter",s,n],["enter",o,n],["exit",o,n],["exit",s,n]])),e}function GD(e,n,i){let a=0;return s;function s(g){return e.enter("atxHeading"),o(g)}function o(g){return e.enter("atxHeadingSequence"),u(g)}function u(g){return g===35&&a++<6?(e.consume(g),u):g===null||rt(g)?(e.exit("atxHeadingSequence"),f(g)):i(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||Se(g)?(e.exit("atxHeading"),n(g)):Be(g)?Pe(e,f,"whitespace")(g):(e.enter("atxHeadingText"),d(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),f(g))}function d(g){return g===null||g===35||rt(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),d)}}const ZD=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],I1=["pre","script","style","textarea"],QD={concrete:!0,name:"htmlFlow",resolveTo:WD,tokenize:eR},KD={partial:!0,tokenize:nR},JD={partial:!0,tokenize:tR};function WD(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function eR(e,n,i){const a=this;let s,o,u,f,h;return d;function d(T){return g(T)}function g(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),m}function m(T){return T===33?(e.consume(T),x):T===47?(e.consume(T),o=!0,E):T===63?(e.consume(T),s=3,a.interrupt?n:z):Ft(T)?(e.consume(T),u=String.fromCharCode(T),N):i(T)}function x(T){return T===45?(e.consume(T),s=2,b):T===91?(e.consume(T),s=5,f=0,w):Ft(T)?(e.consume(T),s=4,a.interrupt?n:z):i(T)}function b(T){return T===45?(e.consume(T),a.interrupt?n:z):i(T)}function w(T){const ie="CDATA[";return T===ie.charCodeAt(f++)?(e.consume(T),f===ie.length?a.interrupt?n:P:w):i(T)}function E(T){return Ft(T)?(e.consume(T),u=String.fromCharCode(T),N):i(T)}function N(T){if(T===null||T===47||T===62||rt(T)){const ie=T===47,ce=u.toLowerCase();return!ie&&!o&&I1.includes(ce)?(s=1,a.interrupt?n(T):P(T)):ZD.includes(u.toLowerCase())?(s=6,ie?(e.consume(T),_):a.interrupt?n(T):P(T)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?i(T):o?D(T):k(T))}return T===45||It(T)?(e.consume(T),u+=String.fromCharCode(T),N):i(T)}function _(T){return T===62?(e.consume(T),a.interrupt?n:P):i(T)}function D(T){return Be(T)?(e.consume(T),D):q(T)}function k(T){return T===47?(e.consume(T),q):T===58||T===95||Ft(T)?(e.consume(T),C):Be(T)?(e.consume(T),k):q(T)}function C(T){return T===45||T===46||T===58||T===95||It(T)?(e.consume(T),C):L(T)}function L(T){return T===61?(e.consume(T),A):Be(T)?(e.consume(T),L):k(T)}function A(T){return T===null||T===60||T===61||T===62||T===96?i(T):T===34||T===39?(e.consume(T),h=T,H):Be(T)?(e.consume(T),A):F(T)}function H(T){return T===h?(e.consume(T),h=null,G):T===null||Se(T)?i(T):(e.consume(T),H)}function F(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||rt(T)?L(T):(e.consume(T),F)}function G(T){return T===47||T===62||Be(T)?k(T):i(T)}function q(T){return T===62?(e.consume(T),V):i(T)}function V(T){return T===null||Se(T)?P(T):Be(T)?(e.consume(T),V):i(T)}function P(T){return T===45&&s===2?(e.consume(T),j):T===60&&s===1?(e.consume(T),U):T===62&&s===4?(e.consume(T),R):T===63&&s===3?(e.consume(T),z):T===93&&s===5?(e.consume(T),K):Se(T)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(KD,$,te)(T)):T===null||Se(T)?(e.exit("htmlFlowData"),te(T)):(e.consume(T),P)}function te(T){return e.check(JD,O,$)(T)}function O(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),B}function B(T){return T===null||Se(T)?te(T):(e.enter("htmlFlowData"),P(T))}function j(T){return T===45?(e.consume(T),z):P(T)}function U(T){return T===47?(e.consume(T),u="",Y):P(T)}function Y(T){if(T===62){const ie=u.toLowerCase();return I1.includes(ie)?(e.consume(T),R):P(T)}return Ft(T)&&u.length<8?(e.consume(T),u+=String.fromCharCode(T),Y):P(T)}function K(T){return T===93?(e.consume(T),z):P(T)}function z(T){return T===62?(e.consume(T),R):T===45&&s===2?(e.consume(T),z):P(T)}function R(T){return T===null||Se(T)?(e.exit("htmlFlowData"),$(T)):(e.consume(T),R)}function $(T){return e.exit("htmlFlow"),n(T)}}function tR(e,n,i){const a=this;return s;function s(u){return Se(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):i(u)}function o(u){return a.parser.lazy[a.now().line]?i(u):n(u)}}function nR(e,n,i){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(vo,n,i)}}const iR={name:"htmlText",tokenize:rR};function rR(e,n,i){const a=this;let s,o,u;return f;function f(z){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(z),h}function h(z){return z===33?(e.consume(z),d):z===47?(e.consume(z),L):z===63?(e.consume(z),k):Ft(z)?(e.consume(z),F):i(z)}function d(z){return z===45?(e.consume(z),g):z===91?(e.consume(z),o=0,w):Ft(z)?(e.consume(z),D):i(z)}function g(z){return z===45?(e.consume(z),b):i(z)}function m(z){return z===null?i(z):z===45?(e.consume(z),x):Se(z)?(u=m,U(z)):(e.consume(z),m)}function x(z){return z===45?(e.consume(z),b):m(z)}function b(z){return z===62?j(z):z===45?x(z):m(z)}function w(z){const R="CDATA[";return z===R.charCodeAt(o++)?(e.consume(z),o===R.length?E:w):i(z)}function E(z){return z===null?i(z):z===93?(e.consume(z),N):Se(z)?(u=E,U(z)):(e.consume(z),E)}function N(z){return z===93?(e.consume(z),_):E(z)}function _(z){return z===62?j(z):z===93?(e.consume(z),_):E(z)}function D(z){return z===null||z===62?j(z):Se(z)?(u=D,U(z)):(e.consume(z),D)}function k(z){return z===null?i(z):z===63?(e.consume(z),C):Se(z)?(u=k,U(z)):(e.consume(z),k)}function C(z){return z===62?j(z):k(z)}function L(z){return Ft(z)?(e.consume(z),A):i(z)}function A(z){return z===45||It(z)?(e.consume(z),A):H(z)}function H(z){return Se(z)?(u=H,U(z)):Be(z)?(e.consume(z),H):j(z)}function F(z){return z===45||It(z)?(e.consume(z),F):z===47||z===62||rt(z)?G(z):i(z)}function G(z){return z===47?(e.consume(z),j):z===58||z===95||Ft(z)?(e.consume(z),q):Se(z)?(u=G,U(z)):Be(z)?(e.consume(z),G):j(z)}function q(z){return z===45||z===46||z===58||z===95||It(z)?(e.consume(z),q):V(z)}function V(z){return z===61?(e.consume(z),P):Se(z)?(u=V,U(z)):Be(z)?(e.consume(z),V):G(z)}function P(z){return z===null||z===60||z===61||z===62||z===96?i(z):z===34||z===39?(e.consume(z),s=z,te):Se(z)?(u=P,U(z)):Be(z)?(e.consume(z),P):(e.consume(z),O)}function te(z){return z===s?(e.consume(z),s=void 0,B):z===null?i(z):Se(z)?(u=te,U(z)):(e.consume(z),te)}function O(z){return z===null||z===34||z===39||z===60||z===61||z===96?i(z):z===47||z===62||rt(z)?G(z):(e.consume(z),O)}function B(z){return z===47||z===62||rt(z)?G(z):i(z)}function j(z){return z===62?(e.consume(z),e.exit("htmlTextData"),e.exit("htmlText"),n):i(z)}function U(z){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),Y}function Y(z){return Be(z)?Pe(e,K,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):K(z)}function K(z){return e.enter("htmlTextData"),u(z)}}const qm={name:"labelEnd",resolveAll:oR,resolveTo:uR,tokenize:cR},aR={tokenize:fR},lR={tokenize:dR},sR={tokenize:hR};function oR(e){let n=-1;const i=[];for(;++n<e.length;){const a=e[n][1];if(i.push(e[n]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const s=a.type==="labelImage"?4:2;a.type="data",n+=s}}return e.length!==i.length&&wn(e,0,e.length,i),e}function uR(e,n){let i=e.length,a=0,s,o,u,f;for(;i--;)if(s=e[i][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[i][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(u){if(e[i][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=i,s.type!=="labelLink")){a=2;break}}else s.type==="labelEnd"&&(u=i);const h={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[o][1].start},end:{...e[u][1].end}},g={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",h,n],["enter",d,n]],f=Dn(f,e.slice(o+1,o+a+3)),f=Dn(f,[["enter",g,n]]),f=Dn(f,xf(n.parser.constructs.insideSpan.null,e.slice(o+a+4,u-3),n)),f=Dn(f,[["exit",g,n],e[u-2],e[u-1],["exit",d,n]]),f=Dn(f,e.slice(u+1)),f=Dn(f,[["exit",h,n]]),wn(e,o,e.length,f),e}function cR(e,n,i){const a=this;let s=a.events.length,o,u;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){o=a.events[s][1];break}return f;function f(x){return o?o._inactive?m(x):(u=a.parser.defined.includes(Yn(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),h):i(x)}function h(x){return x===40?e.attempt(aR,g,u?g:m)(x):x===91?e.attempt(lR,g,u?d:m)(x):u?g(x):m(x)}function d(x){return e.attempt(sR,g,m)(x)}function g(x){return n(x)}function m(x){return o._balanced=!0,i(x)}}function fR(e,n,i){return a;function a(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),s}function s(m){return rt(m)?Ps(e,o)(m):o(m)}function o(m){return m===41?g(m):y2(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function u(m){return rt(m)?Ps(e,h)(m):g(m)}function f(m){return i(m)}function h(m){return m===34||m===39||m===40?b2(e,d,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):g(m)}function d(m){return rt(m)?Ps(e,g)(m):g(m)}function g(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),n):i(m)}}function dR(e,n,i){const a=this;return s;function s(f){return x2.call(a,e,o,u,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Yn(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?n(f):i(f)}function u(f){return i(f)}}function hR(e,n,i){return a;function a(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),s}function s(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):i(o)}}const pR={name:"labelStartImage",resolveAll:qm.resolveAll,tokenize:mR};function mR(e,n,i){const a=this;return s;function s(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):i(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?i(f):n(f)}}const gR={name:"labelStartLink",resolveAll:qm.resolveAll,tokenize:yR};function yR(e,n,i){const a=this;return s;function s(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),o}function o(u){return u===94&&"_hiddenFootnoteSupport"in a.parser.constructs?i(u):n(u)}}const dp={name:"lineEnding",tokenize:xR};function xR(e,n){return i;function i(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Pe(e,n,"linePrefix")}}const Mc={name:"thematicBreak",tokenize:bR};function bR(e,n,i){let a=0,s;return o;function o(d){return e.enter("thematicBreak"),u(d)}function u(d){return s=d,f(d)}function f(d){return d===s?(e.enter("thematicBreakSequence"),h(d)):a>=3&&(d===null||Se(d))?(e.exit("thematicBreak"),n(d)):i(d)}function h(d){return d===s?(e.consume(d),a++,h):(e.exit("thematicBreakSequence"),Be(d)?Pe(e,f,"whitespace")(d):f(d))}}const rn={continuation:{tokenize:_R},exit:ER,name:"list",tokenize:SR},vR={partial:!0,tokenize:NR},wR={partial:!0,tokenize:kR};function SR(e,n,i){const a=this,s=a.events[a.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,u=0;return f;function f(b){const w=a.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!a.containerState.marker||b===a.containerState.marker:Jp(b)){if(a.containerState.type||(a.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Mc,i,d)(b):d(b);if(!a.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(b)}return i(b)}function h(b){return Jp(b)&&++u<10?(e.consume(b),h):(!a.interrupt||u<2)&&(a.containerState.marker?b===a.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),d(b)):i(b)}function d(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||b,e.check(vo,a.interrupt?i:g,e.attempt(vR,x,m))}function g(b){return a.containerState.initialBlankLine=!0,o++,x(b)}function m(b){return Be(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),x):i(b)}function x(b){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(b)}}function _R(e,n,i){const a=this;return a.containerState._closeFlow=void 0,e.check(vo,s,o);function s(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,Pe(e,n,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!Be(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,u(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(wR,n,u)(f))}function u(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,Pe(e,e.attempt(rn,n,i),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function kR(e,n,i){const a=this;return Pe(e,s,"listItemIndent",a.containerState.size+1);function s(o){const u=a.events[a.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===a.containerState.size?n(o):i(o)}}function ER(e){e.exit(this.containerState.type)}function NR(e,n,i){const a=this;return Pe(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const u=a.events[a.events.length-1];return!Be(o)&&u&&u[1].type==="listItemPrefixWhitespace"?n(o):i(o)}}const q1={name:"setextUnderline",resolveTo:CR,tokenize:MR};function CR(e,n){let i=e.length,a,s,o;for(;i--;)if(e[i][0]==="enter"){if(e[i][1].type==="content"){a=i;break}e[i][1].type==="paragraph"&&(s=i)}else e[i][1].type==="content"&&e.splice(i,1),!o&&e[i][1].type==="definition"&&(o=i);const u={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",u,n]),e.splice(o+1,0,["exit",e[a][1],n]),e[a][1].end={...e[o][1].end}):e[a][1]=u,e.push(["exit",u,n]),e}function MR(e,n,i){const a=this;let s;return o;function o(d){let g=a.events.length,m;for(;g--;)if(a.events[g][1].type!=="lineEnding"&&a.events[g][1].type!=="linePrefix"&&a.events[g][1].type!=="content"){m=a.events[g][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||m)?(e.enter("setextHeadingLine"),s=d,u(d)):i(d)}function u(d){return e.enter("setextHeadingLineSequence"),f(d)}function f(d){return d===s?(e.consume(d),f):(e.exit("setextHeadingLineSequence"),Be(d)?Pe(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||Se(d)?(e.exit("setextHeadingLine"),n(d)):i(d)}}const TR={tokenize:AR};function AR(e){const n=this,i=e.attempt(vo,a,e.attempt(this.parser.constructs.flowInitial,s,Pe(e,e.attempt(this.parser.constructs.flow,s,e.attempt(OD,s)),"linePrefix")));return i;function a(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,i}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,i}}const zR={resolveAll:w2()},jR=v2("string"),DR=v2("text");function v2(e){return{resolveAll:w2(e==="text"?RR:void 0),tokenize:n};function n(i){const a=this,s=this.parser.constructs[e],o=i.attempt(s,u,f);return u;function u(g){return d(g)?o(g):f(g)}function f(g){if(g===null){i.consume(g);return}return i.enter("data"),i.consume(g),h}function h(g){return d(g)?(i.exit("data"),o(g)):(i.consume(g),h)}function d(g){if(g===null)return!0;const m=s[g];let x=-1;if(m)for(;++x<m.length;){const b=m[x];if(!b.previous||b.previous.call(a,a.previous))return!0}return!1}}}function w2(e){return n;function n(i,a){let s=-1,o;for(;++s<=i.length;)o===void 0?i[s]&&i[s][1].type==="data"&&(o=s,s++):(!i[s]||i[s][1].type!=="data")&&(s!==o+2&&(i[o][1].end=i[s-1][1].end,i.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(i,a):i}}function RR(e,n){let i=0;for(;++i<=e.length;)if((i===e.length||e[i][1].type==="lineEnding")&&e[i-1][1].type==="data"){const a=e[i-1][1],s=n.sliceStream(a);let o=s.length,u=-1,f=0,h;for(;o--;){const d=s[o];if(typeof d=="string"){for(u=d.length;d.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(d===-2)h=!0,f++;else if(d!==-1){o++;break}}if(n._contentTypeTextTrailing&&i===e.length&&(f=0),f){const d={type:i===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?u:a.start._bufferIndex+u,_index:a.start._index+o,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...d.start},a.start.offset===a.end.offset?Object.assign(a,d):(e.splice(i,0,["enter",d,n],["exit",d,n]),i+=2)}i++}return e}const OR={42:rn,43:rn,45:rn,48:rn,49:rn,50:rn,51:rn,52:rn,53:rn,54:rn,55:rn,56:rn,57:rn,62:h2},LR={91:ID},HR={[-2]:fp,[-1]:fp,32:fp},BR={35:XD,42:Mc,45:[q1,Mc],60:QD,61:q1,95:Mc,96:U1,126:U1},UR={38:m2,92:p2},IR={[-5]:dp,[-4]:dp,[-3]:dp,33:pR,38:m2,42:Wp,60:[gD,iR],91:gR,92:[PD,p2],93:qm,95:Wp,96:TD},qR={null:[Wp,zR]},$R={null:[42,95]},VR={null:[]},PR=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:$R,contentInitial:LR,disable:VR,document:OR,flow:BR,flowInitial:HR,insideSpan:qR,string:UR,text:IR},Symbol.toStringTag,{value:"Module"}));function YR(e,n,i){let a={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const s={},o=[];let u=[],f=[];const h={attempt:H(L),check:H(A),consume:D,enter:k,exit:C,interrupt:H(A,{interrupt:!0})},d={code:null,containerState:{},defineSkip:E,events:[],now:w,parser:e,previous:null,sliceSerialize:x,sliceStream:b,write:m};let g=n.tokenize.call(d,h);return n.resolveAll&&o.push(n),d;function m(V){return u=Dn(u,V),N(),u[u.length-1]!==null?[]:(F(n,0),d.events=xf(o,d.events,d),d.events)}function x(V,P){return FR(b(V),P)}function b(V){return XR(u,V)}function w(){const{_bufferIndex:V,_index:P,line:te,column:O,offset:B}=a;return{_bufferIndex:V,_index:P,line:te,column:O,offset:B}}function E(V){s[V.line]=V.column,q()}function N(){let V;for(;a._index<u.length;){const P=u[a._index];if(typeof P=="string")for(V=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===V&&a._bufferIndex<P.length;)_(P.charCodeAt(a._bufferIndex));else _(P)}}function _(V){g=g(V)}function D(V){Se(V)?(a.line++,a.column=1,a.offset+=V===-3?2:1,q()):V!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===u[a._index].length&&(a._bufferIndex=-1,a._index++)),d.previous=V}function k(V,P){const te=P||{};return te.type=V,te.start=w(),d.events.push(["enter",te,d]),f.push(te),te}function C(V){const P=f.pop();return P.end=w(),d.events.push(["exit",P,d]),P}function L(V,P){F(V,P.from)}function A(V,P){P.restore()}function H(V,P){return te;function te(O,B,j){let U,Y,K,z;return Array.isArray(O)?$(O):"tokenize"in O?$([O]):R(O);function R(fe){return he;function he(ue){const me=ue!==null&&fe[ue],Ee=ue!==null&&fe.null,Ce=[...Array.isArray(me)?me:me?[me]:[],...Array.isArray(Ee)?Ee:Ee?[Ee]:[]];return $(Ce)(ue)}}function $(fe){return U=fe,Y=0,fe.length===0?j:T(fe[Y])}function T(fe){return he;function he(ue){return z=G(),K=fe,fe.partial||(d.currentConstruct=fe),fe.name&&d.parser.constructs.disable.null.includes(fe.name)?ce():fe.tokenize.call(P?Object.assign(Object.create(d),P):d,h,ie,ce)(ue)}}function ie(fe){return V(K,z),B}function ce(fe){return z.restore(),++Y<U.length?T(U[Y]):j}}}function F(V,P){V.resolveAll&&!o.includes(V)&&o.push(V),V.resolve&&wn(d.events,P,d.events.length-P,V.resolve(d.events.slice(P),d)),V.resolveTo&&(d.events=V.resolveTo(d.events,d))}function G(){const V=w(),P=d.previous,te=d.currentConstruct,O=d.events.length,B=Array.from(f);return{from:O,restore:j};function j(){a=V,d.previous=P,d.currentConstruct=te,d.events.length=O,f=B,q()}}function q(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function XR(e,n){const i=n.start._index,a=n.start._bufferIndex,s=n.end._index,o=n.end._bufferIndex;let u;if(i===s)u=[e[i].slice(a,o)];else{if(u=e.slice(i,s),a>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(a):u.shift()}o>0&&u.push(e[s].slice(0,o))}return u}function FR(e,n){let i=-1;const a=[];let s;for(;++i<e.length;){const o=e[i];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
|
|
119
|
+
`,children:[v.jsx("span",{className:i.color,children:i.icon}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:i.label})]},i.type))})}function Kz({status:e}){switch(e){case"running":return v.jsx(uS,{className:"w-4 h-4 animate-spin text-blue-400"});case"completed":return v.jsx(I3,{className:"w-4 h-4 text-green-400"});case"error":return v.jsx(Up,{className:"w-4 h-4 text-red-400"});default:return v.jsx(Em,{className:"w-4 h-4"})}}function Jz({data:e,selected:n,children:i,headerIcon:a,headerColor:o="bg-gray-700",showSourceHandle:s=!0,showTargetHandle:u=!0}){const f=()=>{switch(e.status){case"running":return"border-indigo-500 animate-pulse-border";case"completed":return"border-green-500";case"error":return"border-red-500";default:return""}};return v.jsxs("div",{className:Xt("workflow-node",n&&"ring-2 ring-accent ring-offset-2 ring-offset-canvas",f()),children:[v.jsxs("div",{className:Xt("node-header flex items-center justify-between",o),children:[v.jsxs("div",{className:"flex items-center gap-2",children:[a,v.jsx("span",{className:"font-semibold text-sm text-white",children:e.label})]}),v.jsx("div",{className:"flex items-center gap-1",children:v.jsx(Kz,{status:e.status})})]}),v.jsxs("div",{className:"node-content",children:[e.description&&v.jsx("p",{className:"text-sm text-gray-400 mb-3",children:e.description}),i,e.usedInputs&&e.usedInputs.length>0&&v.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-700/50",children:[v.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"Used in this step"}),v.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.usedInputs.map(h=>v.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs bg-gray-700/50 border border-gray-600 text-gray-300",children:[v.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"}),h]},h))})]})]}),u&&v.jsx(ml,{type:"target",position:be.Left}),s&&v.jsx(ml,{type:"source",position:be.Right})]})}const bl=Q.memo(Jz);function Wz({data:e,selected:n}){return v.jsx(bl,{data:e,selected:n,headerIcon:v.jsx(uf,{className:"w-4 h-4 text-amber-100"}),headerColor:"bg-gradient-to-br from-amber-500 to-orange-600",showTargetHandle:!1,showSourceHandle:!0,children:v.jsxs("div",{className:"text-gray-300",children:[e.inputType==="text"&&v.jsx("div",{className:"text-sm text-gray-400",children:e.value||e.placeholder||"Enter your input..."}),e.inputType==="file"&&v.jsx("div",{className:"text-sm text-gray-400",children:"Drop files here or click to upload"}),e.inputType==="select"&&e.options&&v.jsx("select",{className:"w-full px-2 py-1 text-sm bg-gray-700 border border-gray-600 rounded text-gray-300",children:e.options.map(i=>v.jsx("option",{value:i,children:i},i))})]})})}const ej=Q.memo(Wz);function tj({data:e,selected:n}){return v.jsx(bl,{data:e,selected:n,headerIcon:v.jsx(ms,{className:"w-4 h-4 text-violet-100"}),headerColor:"bg-gradient-to-br from-violet-500 to-purple-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.tools&&e.tools.length>0&&v.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.tools.slice(0,3).map(i=>v.jsx("span",{className:"px-2 py-0.5 text-xs bg-purple-900/50 text-purple-300 rounded",children:i},i)),e.tools.length>3&&v.jsxs("span",{className:"px-2 py-0.5 text-xs bg-purple-900/50 text-purple-300 rounded",children:["+",e.tools.length-3]})]}),e.model&&v.jsxs("div",{className:"text-xs text-gray-500",children:["Model: ",e.model]})]})})}const nj=Q.memo(tj);function ij({data:e,selected:n}){return v.jsx(bl,{data:e,selected:n,headerIcon:v.jsx(ff,{className:"w-4 h-4 text-cyan-100"}),headerColor:"bg-gradient-to-br from-cyan-500 to-cyan-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.skillType==="official"&&e.skillId&&v.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-cyan-900/50 text-cyan-300 rounded",children:e.skillId}),e.skillCategory&&v.jsxs("div",{className:"text-xs text-gray-500",children:["Category: ",e.skillCategory]})]})})}const rj=Q.memo(ij);function aj({data:e,selected:n}){return v.jsx(bl,{data:e,selected:n,headerIcon:v.jsx(ra,{className:"w-4 h-4 text-orange-100"}),headerColor:"bg-gradient-to-br from-orange-500 to-orange-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.commandName&&v.jsxs("span",{className:"inline-block px-2 py-0.5 text-xs bg-orange-900/50 text-orange-300 rounded",children:["/",e.commandName]}),e.commandPath&&v.jsx("div",{className:"text-xs text-gray-500 truncate",children:e.commandPath})]})})}const lj=Q.memo(aj);function oj({data:e,selected:n}){return v.jsx(bl,{data:e,selected:n,headerIcon:v.jsx(_m,{className:"w-4 h-4 text-pink-100"}),headerColor:"bg-gradient-to-br from-pink-500 to-rose-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.hookEvent&&v.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-pink-900/50 text-pink-300 rounded",children:e.hookEvent}),e.hookMatcher&&v.jsx("div",{className:"text-xs text-gray-500 truncate",children:e.hookMatcher})]})})}const sj=Q.memo(oj);function uj(e){switch(e){case"markdown":case"document":return v.jsx(al,{className:"w-4 h-4 text-emerald-100"});case"image":return v.jsx(sS,{className:"w-4 h-4 text-emerald-100"});case"webpage":return v.jsx(Z3,{className:"w-4 h-4 text-emerald-100"});case"link":return v.jsx(n5,{className:"w-4 h-4 text-emerald-100"});default:return v.jsx(sf,{className:"w-4 h-4 text-emerald-100"})}}function cj({data:e,selected:n}){return v.jsx(bl,{data:e,selected:n,headerIcon:uj(e.outputType),headerColor:"bg-gradient-to-br from-emerald-500 to-green-700",showTargetHandle:!0,showSourceHandle:!1,children:v.jsxs("div",{className:"space-y-2",children:[e.layoutType&&v.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-emerald-900/50 text-emerald-300 rounded",children:e.layoutType}),e.result&&v.jsxs("div",{className:"text-xs text-gray-400 truncate max-w-[200px]",children:[e.result.substring(0,50),"..."]})]})})}const fj=Q.memo(cj),Rm=df(e=>({activeTab:"preview",isCollapsed:!1,width:400,setActiveTab:n=>e({activeTab:n}),toggleCollapsed:()=>e(n=>({isCollapsed:!n.isCollapsed})),setWidth:n=>e({width:Math.max(300,Math.min(600,n))}),openStepPanel:()=>e({activeTab:"step",isCollapsed:!1})}));function dj(e,n){const{source:i,target:a}=e;if(i===a)return!1;const o=n.find(u=>u.id===i),s=n.find(u=>u.id===a);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 hj={input:ej,subagent:nj,skill:rj,command:lj,hook:sj,output:fj};function pj(){const{nodes:e,edges:n,setNodes:i,setEdges:a,addEdge:o,setSelectedNode:s}=Hi(),u=Rm(x=>x.openStepPanel),f=Q.useCallback(x=>{i(Tw(x,e))},[e,i]),h=Q.useCallback(x=>{a(Aw(x,n))},[n,a]),d=Q.useCallback(x=>{dj(x,e)&&(a(cw({...x,animated:!0},n)),o({id:`e-${x.source}-${x.target}`,source:x.source,target:x.target,animated:!0}))},[e,n,a,o]),g=Q.useCallback((x,b)=>{s(b.id),u()},[s,u]),m=Q.useCallback(()=>{s(null)},[s]);return v.jsxs(YA,{nodes:e,edges:n,onNodesChange:f,onEdgesChange:h,onConnect:d,onNodeClick:g,onPaneClick:m,nodeTypes:hj,defaultViewport:{x:100,y:100,zoom:.7},defaultEdgeOptions:{animated:!0,style:{strokeDasharray:"5 5"}},connectionLineStyle:{strokeDasharray:"5 5"},snapToGrid:!0,snapGrid:[15,15],connectionRadius:40,connectOnClick:!0,children:[v.jsx(QA,{variant:Oi.Dots,gap:20,size:1,color:"#333333"}),v.jsx(i3,{}),v.jsx(g3,{nodeColor:x=>{switch(x.type){case"input":return"#fef3c7";case"subagent":return"#4f46e5";case"skill":return"#06b6d4";case"command":return"#f97316";case"hook":return"#ec4899";case"output":return"#10b981";default:return"#6b7280"}},maskColor:"rgba(0, 0, 0, 0.8)"})]})}function mj(e,n){const i={};return(e[e.length-1]===""?[...e,""]:e).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const gj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xj={};function E1(e,n){return(xj.jsx?yj:gj).test(e)}const bj=/[ \t\n\f\r]/g;function vj(e){return typeof e=="object"?e.type==="text"?N1(e.value):!1:N1(e)}function N1(e){return e.replace(bj,"")===""}class vs{constructor(n,i,a){this.normal=i,this.property=n,a&&(this.space=a)}}vs.prototype.normal={};vs.prototype.property={};vs.prototype.space=void 0;function KS(e,n){const i={},a={};for(const o of e)Object.assign(i,o.property),Object.assign(a,o.normal);return new vs(i,a,n)}function Gp(e){return e.toLowerCase()}class ln{constructor(n,i){this.attribute=i,this.property=n}}ln.prototype.attribute="";ln.prototype.booleanish=!1;ln.prototype.boolean=!1;ln.prototype.commaOrSpaceSeparated=!1;ln.prototype.commaSeparated=!1;ln.prototype.defined=!1;ln.prototype.mustUseProperty=!1;ln.prototype.number=!1;ln.prototype.overloadedBoolean=!1;ln.prototype.property="";ln.prototype.spaceSeparated=!1;ln.prototype.space=void 0;let wj=0;const je=aa(),St=aa(),Zp=aa(),de=aa(),at=aa(),ol=aa(),bn=aa();function aa(){return 2**++wj}const Qp=Object.freeze(Object.defineProperty({__proto__:null,boolean:je,booleanish:St,commaOrSpaceSeparated:bn,commaSeparated:ol,number:de,overloadedBoolean:Zp,spaceSeparated:at},Symbol.toStringTag,{value:"Module"})),sp=Object.keys(Qp);class Om extends ln{constructor(n,i,a,o){let s=-1;if(super(n,i),C1(this,"space",o),typeof a=="number")for(;++s<sp.length;){const u=sp[s];C1(this,sp[s],(a&Qp[u])===Qp[u])}}}Om.prototype.defined=!0;function C1(e,n,i){i&&(e[n]=i)}function vl(e){const n={},i={};for(const[a,o]of Object.entries(e.properties)){const s=new Om(a,e.transform(e.attributes||{},a),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(s.mustUseProperty=!0),n[a]=s,i[Gp(a)]=a,i[Gp(s.attribute)]=a}return new vs(n,i,e.space)}const JS=vl({properties:{ariaActiveDescendant:null,ariaAtomic:St,ariaAutoComplete:null,ariaBusy:St,ariaChecked:St,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:St,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:St,ariaFlowTo:at,ariaGrabbed:St,ariaHasPopup:null,ariaHidden:St,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:de,ariaLive:null,ariaModal:St,ariaMultiLine:St,ariaMultiSelectable:St,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:St,ariaReadOnly:St,ariaRelevant:null,ariaRequired:St,ariaRoleDescription:at,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:St,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function WS(e,n){return n in e?e[n]:n}function e2(e,n){return WS(e,n.toLowerCase())}const Sj=vl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ol,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:je,allowPaymentRequest:je,allowUserMedia:je,alt:null,as:null,async:je,autoCapitalize:null,autoComplete:at,autoFocus:je,autoPlay:je,blocking:at,capture:null,charSet:null,checked:je,cite:null,className:at,cols:de,colSpan:null,content:null,contentEditable:St,controls:je,controlsList:at,coords:de|ol,crossOrigin:null,data:null,dateTime:null,decoding:null,default:je,defer:je,dir:null,dirName:null,disabled:je,download:Zp,draggable:St,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:je,formTarget:null,headers:at,height:de,hidden:Zp,high:de,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:je,inputMode:null,integrity:null,is:null,isMap:je,itemId:null,itemProp:at,itemRef:at,itemScope:je,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:je,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:je,muted:je,name:null,nonce:null,noModule:je,noValidate:je,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:je,optimum:de,pattern:null,ping:at,placeholder:null,playsInline:je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:je,referrerPolicy:null,rel:at,required:je,reversed:je,rows:de,rowSpan:de,sandbox:at,scope:null,scoped:je,seamless:je,selected:je,shadowRootClonable:je,shadowRootDelegatesFocus:je,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:St,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:je,useMap:null,value:St,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:at,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:je,declare:je,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:je,noHref:je,noShade:je,noWrap:je,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:St,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:je,disableRemotePlayback:je,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:e2}),_j=vl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:bn,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:at,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:je,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ol,g2:ol,glyphName:ol,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:bn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:de,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:at,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bn,rev:bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bn,requiredFeatures:bn,requiredFonts:bn,requiredFormats:bn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:bn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bn,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:WS}),t2=vl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),n2=vl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:e2}),i2=vl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),kj={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"},Ej=/[A-Z]/g,M1=/-[a-z]/g,Nj=/^data[-\w.:]+$/i;function Cj(e,n){const i=Gp(n);let a=n,o=ln;if(i in e.normal)return e.property[e.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&Nj.test(n)){if(n.charAt(4)==="-"){const s=n.slice(5).replace(M1,Tj);a="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=n.slice(4);if(!M1.test(s)){let u=s.replace(Ej,Mj);u.charAt(0)!=="-"&&(u="-"+u),n="data"+u}}o=Om}return new o(a,n)}function Mj(e){return"-"+e.toLowerCase()}function Tj(e){return e.charAt(1).toUpperCase()}const Aj=KS([JS,Sj,t2,n2,i2],"html"),Lm=KS([JS,_j,t2,n2,i2],"svg");function zj(e){return e.join(" ").trim()}var Za={},up,T1;function jj(){if(T1)return up;T1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
|
|
120
|
+
`,d="/",g="*",m="",x="comment",b="declaration";function w(N,_){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];_=_||{};var D=1,k=1;function C(O){var B=O.match(n);B&&(D+=B.length);var j=O.lastIndexOf(h);k=~j?O.length-j:k+O.length}function L(){var O={line:D,column:k};return function(B){return B.position=new A(O),G(),B}}function A(O){this.start=O,this.end={line:D,column:k},this.source=_.source}A.prototype.content=N;function H(O){var B=new Error(_.source+":"+D+":"+k+": "+O);if(B.reason=O,B.filename=_.source,B.line=D,B.column=k,B.source=N,!_.silent)throw B}function F(O){var B=O.exec(N);if(B){var j=B[0];return C(j),N=N.slice(j.length),B}}function G(){F(i)}function q(O){var B;for(O=O||[];B=V();)B!==!1&&O.push(B);return O}function V(){var O=L();if(!(d!=N.charAt(0)||g!=N.charAt(1))){for(var B=2;m!=N.charAt(B)&&(g!=N.charAt(B)||d!=N.charAt(B+1));)++B;if(B+=2,m===N.charAt(B-1))return H("End of comment missing");var j=N.slice(2,B-2);return k+=2,C(j),N=N.slice(B),k+=2,O({type:x,comment:j})}}function P(){var O=L(),B=F(a);if(B){if(V(),!F(o))return H("property missing ':'");var j=F(s),U=O({type:b,property:E(B[0].replace(e,m)),value:j?E(j[0].replace(e,m)):m});return F(u),U}}function te(){var O=[];q(O);for(var B;B=P();)B!==!1&&(O.push(B),q(O));return O}return G(),te()}function E(N){return N?N.replace(f,m):m}return up=w,up}var A1;function Dj(){if(A1)return Za;A1=1;var e=Za&&Za.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Za,"__esModule",{value:!0}),Za.default=i;const n=e(jj());function i(a,o){let s=null;if(!a||typeof a!="string")return s;const u=(0,n.default)(a),f=typeof o=="function";return u.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 Za}var Oo={},z1;function Rj(){if(z1)return Oo;z1=1,Object.defineProperty(Oo,"__esModule",{value:!0}),Oo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,i=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(d){return!d||i.test(d)||e.test(d)},u=function(d,g){return g.toUpperCase()},f=function(d,g){return"".concat(g,"-")},h=function(d,g){return g===void 0&&(g={}),s(d)?d:(d=d.toLowerCase(),g.reactCompat?d=d.replace(o,f):d=d.replace(a,f),d.replace(n,u))};return Oo.camelCase=h,Oo}var Lo,j1;function Oj(){if(j1)return Lo;j1=1;var e=Lo&&Lo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},n=e(Dj()),i=Rj();function a(o,s){var u={};return!o||typeof o!="string"||(0,n.default)(o,function(f,h){f&&h&&(u[(0,i.camelCase)(f,s)]=h)}),u}return a.default=a,Lo=a,Lo}var Lj=Oj();const Hj=Gc(Lj),r2=a2("end"),Hm=a2("start");function a2(e){return n;function n(i){const a=i&&i.position&&i.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function Bj(e){const n=Hm(e),i=r2(e);if(n&&i)return{start:n,end:i}}function Xo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?D1(e.position):"start"in e||"end"in e?D1(e):"line"in e||"column"in e?Kp(e):""}function Kp(e){return R1(e&&e.line)+":"+R1(e&&e.column)}function D1(e){return Kp(e&&e.start)+"-"+Kp(e&&e.end)}function R1(e){return e&&typeof e=="number"?e:1}class $t extends Error{constructor(n,i,a){super(),typeof i=="string"&&(a=i,i=void 0);let o="",s={},u=!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&&(u=!0,o=n.message,s.cause=n),!s.ruleId&&!s.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?s.ruleId=a:(s.source=a.slice(0,h),s.ruleId=a.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=Xo(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=u&&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}}$t.prototype.file="";$t.prototype.name="";$t.prototype.reason="";$t.prototype.message="";$t.prototype.stack="";$t.prototype.column=void 0;$t.prototype.line=void 0;$t.prototype.ancestors=void 0;$t.prototype.cause=void 0;$t.prototype.fatal=void 0;$t.prototype.place=void 0;$t.prototype.ruleId=void 0;$t.prototype.source=void 0;const Bm={}.hasOwnProperty,Uj=new Map,Ij=/[A-Z]/g,qj=new Set(["table","tbody","thead","tfoot","tr"]),$j=new Set(["td","th"]),l2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Vj(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=n.filePath||void 0;let a;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=Kj(i,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=Qj(i,n.jsx,n.jsxs)}const o={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:a,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Lm:Aj,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},s=o2(o,e,void 0);return s&&typeof s!="string"?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}function o2(e,n,i){if(n.type==="element")return Pj(e,n,i);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Yj(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Fj(e,n,i);if(n.type==="mdxjsEsm")return Xj(e,n);if(n.type==="root")return Gj(e,n,i);if(n.type==="text")return Zj(e,n)}function Pj(e,n,i){const a=e.schema;let o=a;n.tagName.toLowerCase()==="svg"&&a.space==="html"&&(o=Lm,e.schema=o),e.ancestors.push(n);const s=u2(e,n.tagName,!1),u=Jj(e,n);let f=Im(e,n);return qj.has(n.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!vj(h):!0})),s2(e,u,s,n),Um(u,f),e.ancestors.pop(),e.schema=a,e.create(n,s,u,i)}function Yj(e,n){if(n.data&&n.data.estree&&e.evaluater){const a=n.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}ls(e,n.position)}function Xj(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);ls(e,n.position)}function Fj(e,n,i){const a=e.schema;let o=a;n.name==="svg"&&a.space==="html"&&(o=Lm,e.schema=o),e.ancestors.push(n);const s=n.name===null?e.Fragment:u2(e,n.name,!0),u=Wj(e,n),f=Im(e,n);return s2(e,u,s,n),Um(u,f),e.ancestors.pop(),e.schema=a,e.create(n,s,u,i)}function Gj(e,n,i){const a={};return Um(a,Im(e,n)),e.create(n,e.Fragment,a,i)}function Zj(e,n){return n.value}function s2(e,n,i,a){typeof i!="string"&&i!==e.Fragment&&e.passNode&&(n.node=a)}function Um(e,n){if(n.length>0){const i=n.length>1?n:n[0];i&&(e.children=i)}}function Qj(e,n,i){return a;function a(o,s,u,f){const d=Array.isArray(u.children)?i:n;return f?d(s,u,f):d(s,u)}}function Kj(e,n){return i;function i(a,o,s,u){const f=Array.isArray(s.children),h=Hm(a);return n(o,s,u,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function Jj(e,n){const i={};let a,o;for(o in n.properties)if(o!=="children"&&Bm.call(n.properties,o)){const s=eD(e,o,n.properties[o]);if(s){const[u,f]=s;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&$j.has(n.tagName)?a=f:i[u]=f}}if(a){const s=i.style||(i.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return i}function Wj(e,n){const i={};for(const a of n.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const s=a.data.estree.body[0];s.type;const u=s.expression;u.type;const f=u.properties[0];f.type,Object.assign(i,e.evaluater.evaluateExpression(f.argument))}else ls(e,n.position);else{const o=a.name;let s;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,s=e.evaluater.evaluateExpression(f.expression)}else ls(e,n.position);else s=a.value===null?!0:a.value;i[o]=s}return i}function Im(e,n){const i=[];let a=-1;const o=e.passKeys?new Map:Uj;for(;++a<n.children.length;){const s=n.children[a];let u;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;u=h+"-"+d,o.set(h,d+1)}}const f=o2(e,s,u);f!==void 0&&i.push(f)}return i}function eD(e,n,i){const a=Cj(e.schema,n);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=a.commaSeparated?mj(i):zj(i)),a.property==="style"){let o=typeof i=="object"?i:tD(e,String(i));return e.stylePropertyNameCase==="css"&&(o=nD(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&a.space?kj[a.property]||a.property:a.attribute,i]}}function tD(e,n){try{return Hj(n,{reactCompat:!0})}catch(i){if(e.ignoreInvalidStyle)return{};const a=i,o=new $t("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=l2+"#cannot-parse-style-attribute",o}}function u2(e,n,i){let a;if(!i)a={type:"Literal",value:n};else if(n.includes(".")){const o=n.split(".");let s=-1,u;for(;++s<o.length;){const f=E1(o[s])?{type:"Identifier",name:o[s]}:{type:"Literal",value:o[s]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(s&&f.type==="Literal"),optional:!1}:f}a=u}else a=E1(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(a.type==="Literal"){const o=a.value;return Bm.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(a);ls(e)}function ls(e,n){const i=new $t("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=l2+"#cannot-handle-mdx-estrees-without-createevaluater",i}function nD(e){const n={};let i;for(i in e)Bm.call(e,i)&&(n[iD(i)]=e[i]);return n}function iD(e){let n=e.replace(Ij,rD);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function rD(e){return"-"+e.toLowerCase()}const cp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},aD={};function qm(e,n){const i=aD,a=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,o=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return c2(e,a,o)}function c2(e,n,i){if(lD(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 O1(e.children,n,i)}return Array.isArray(e)?O1(e,n,i):""}function O1(e,n,i){const a=[];let o=-1;for(;++o<e.length;)a[o]=c2(e[o],n,i);return a.join("")}function lD(e){return!!(e&&typeof e=="object")}const L1=document.createElement("i");function $m(e){const n="&"+e+";";L1.innerHTML=n;const i=L1.textContent;return i.charCodeAt(i.length-1)===59&&e!=="semi"||i===n?!1:i}function wn(e,n,i,a){const o=e.length;let s=0,u;if(n<0?n=-n>o?0:o+n:n=n>o?o:n,i=i>0?i:0,a.length<1e4)u=Array.from(a),u.unshift(n,i),e.splice(...u);else for(i&&e.splice(n,i);s<a.length;)u=a.slice(s,s+1e4),u.unshift(n,0),e.splice(...u),s+=1e4,n+=1e4}function Dn(e,n){return e.length>0?(wn(e,e.length,0,n),e):n}const H1={}.hasOwnProperty;function f2(e){const n={};let i=-1;for(;++i<e.length;)oD(n,e[i]);return n}function oD(e,n){let i;for(i in n){const o=(H1.call(e,i)?e[i]:void 0)||(e[i]={}),s=n[i];let u;if(s)for(u in s){H1.call(o,u)||(o[u]=[]);const f=s[u];sD(o[u],Array.isArray(f)?f:f?[f]:[])}}}function sD(e,n){let i=-1;const a=[];for(;++i<n.length;)(n[i].add==="after"?e:a).push(n[i]);wn(e,0,0,a)}function d2(e,n){const i=Number.parseInt(e,n);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function Yn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ft=Sr(/[A-Za-z]/),It=Sr(/[\dA-Za-z]/),uD=Sr(/[#-'*+\--9=?A-Z^-~]/);function Pc(e){return e!==null&&(e<32||e===127)}const Jp=Sr(/\d/),cD=Sr(/[\dA-Fa-f]/),fD=Sr(/[!-/:-@[-`{-~]/);function Se(e){return e!==null&&e<-2}function rt(e){return e!==null&&(e<0||e===32)}function Be(e){return e===-2||e===-1||e===32}const yf=Sr(new RegExp("\\p{P}|\\p{S}","u")),ia=Sr(/\s/);function Sr(e){return n;function n(i){return i!==null&&i>-1&&e.test(String.fromCharCode(i))}}function wl(e){const n=[];let i=-1,a=0,o=0;for(;++i<e.length;){const s=e.charCodeAt(i);let u="";if(s===37&&It(e.charCodeAt(i+1))&&It(e.charCodeAt(i+2)))o=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(u=String.fromCharCode(s));else if(s>55295&&s<57344){const f=e.charCodeAt(i+1);s<56320&&f>56319&&f<57344?(u=String.fromCharCode(s,f),o=1):u="�"}else u=String.fromCharCode(s);u&&(n.push(e.slice(a,i),encodeURIComponent(u)),a=i+o+1,u=""),o&&(i+=o,o=0)}return n.join("")+e.slice(a)}function Pe(e,n,i,a){const o=a?a-1:Number.POSITIVE_INFINITY;let s=0;return u;function u(h){return Be(h)?(e.enter(i),f(h)):n(h)}function f(h){return Be(h)&&s++<o?(e.consume(h),f):(e.exit(i),n(h))}}const dD={tokenize:hD};function hD(e){const n=e.attempt(this.parser.constructs.contentInitial,a,o);let i;return n;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Pe(e,n,"linePrefix")}function 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,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Se(f)?(e.consume(f),e.exit("chunkText"),s):(e.consume(f),u)}}const pD={tokenize:mD},B1={tokenize:gD};function mD(e){const n=this,i=[];let a=0,o,s,u;return f;function f(k){if(a<i.length){const C=i[a];return n.containerState=C[1],e.attempt(C[0].continuation,h,d)(k)}return d(k)}function h(k){if(a++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,o&&D();const C=n.events.length;let L=C,A;for(;L--;)if(n.events[L][0]==="exit"&&n.events[L][1].type==="chunkFlow"){A=n.events[L][1].end;break}_(a);let H=C;for(;H<n.events.length;)n.events[H][1].end={...A},H++;return wn(n.events,L+1,0,n.events.slice(C)),n.events.length=H,d(k)}return f(k)}function d(k){if(a===i.length){if(!o)return x(k);if(o.currentConstruct&&o.currentConstruct.concrete)return w(k);n.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(B1,g,m)(k)}function g(k){return o&&D(),_(a),x(k)}function m(k){return n.parser.lazy[n.now().line]=a!==i.length,u=n.now().offset,w(k)}function x(k){return n.containerState={},e.attempt(B1,b,w)(k)}function b(k){return a++,i.push([n.currentConstruct,n.containerState]),x(k)}function w(k){if(k===null){o&&D(),_(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){N(e.exit("chunkFlow"),!0),_(0),e.consume(k);return}return Se(k)?(e.consume(k),N(e.exit("chunkFlow")),a=0,n.interrupt=void 0,f):(e.consume(k),E)}function N(k,C){const L=n.sliceStream(k);if(C&&L.push(null),k.previous=s,s&&(s.next=k),s=k,o.defineSkip(k.start),o.write(L),n.parser.lazy[k.start.line]){let A=o.events.length;for(;A--;)if(o.events[A][1].start.offset<u&&(!o.events[A][1].end||o.events[A][1].end.offset>u))return;const H=n.events.length;let F=H,G,q;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){if(G){q=n.events[F][1].end;break}G=!0}for(_(a),A=H;A<n.events.length;)n.events[A][1].end={...q},A++;wn(n.events,F+1,0,n.events.slice(H)),n.events.length=A}}function _(k){let C=i.length;for(;C-- >k;){const L=i[C];n.containerState=L[1],L[0].exit.call(n,e)}i.length=k}function D(){o.write([null]),s=void 0,o=void 0,n.containerState._closeFlow=void 0}}function gD(e,n,i){return Pe(e,e.attempt(this.parser.constructs.document,n,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function gl(e){if(e===null||rt(e)||ia(e))return 1;if(yf(e))return 2}function xf(e,n,i){const a=[];let o=-1;for(;++o<e.length;){const s=e[o].resolveAll;s&&!a.includes(s)&&(n=s(n,i),a.push(s))}return n}const Wp={name:"attention",resolveAll:yD,tokenize:xD};function yD(e,n){let i=-1,a,o,s,u,f,h,d,g;for(;++i<e.length;)if(e[i][0]==="enter"&&e[i][1].type==="attentionSequence"&&e[i][1]._close){for(a=i;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&n.sliceSerialize(e[a][1]).charCodeAt(0)===n.sliceSerialize(e[i][1]).charCodeAt(0)){if((e[a][1]._close||e[i][1]._open)&&(e[i][1].end.offset-e[i][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[i][1].end.offset-e[i][1].start.offset)%3))continue;h=e[a][1].end.offset-e[a][1].start.offset>1&&e[i][1].end.offset-e[i][1].start.offset>1?2:1;const m={...e[a][1].end},x={...e[i][1].start};U1(m,-h),U1(x,h),u={type:h>1?"strongSequence":"emphasisSequence",start:m,end:{...e[a][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[i][1].start},end:x},s={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[i][1].start}},o={type:h>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[a][1].end={...u.start},e[i][1].start={...f.end},d=[],e[a][1].end.offset-e[a][1].start.offset&&(d=Dn(d,[["enter",e[a][1],n],["exit",e[a][1],n]])),d=Dn(d,[["enter",o,n],["enter",u,n],["exit",u,n],["enter",s,n]]),d=Dn(d,xf(n.parser.constructs.insideSpan.null,e.slice(a+1,i),n)),d=Dn(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=Dn(d,[["enter",e[i][1],n],["exit",e[i][1],n]])):g=0,wn(e,a-1,i-a+3,d),i=a+d.length-g-2;break}}for(i=-1;++i<e.length;)e[i][1].type==="attentionSequence"&&(e[i][1].type="data");return e}function xD(e,n){const i=this.parser.constructs.attentionMarkers.null,a=this.previous,o=gl(a);let s;return u;function u(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=gl(h),m=!g||g===2&&o||i.includes(h),x=!o||o===2&&g||i.includes(a);return d._open=!!(s===42?m:m&&(o||!x)),d._close=!!(s===42?x:x&&(g||!m)),n(h)}}function U1(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const bD={name:"autolink",tokenize:vD};function vD(e,n,i){let a=0;return o;function o(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(b){return Ft(b)?(e.consume(b),u):b===64?i(b):d(b)}function u(b){return b===43||b===45||b===46||It(b)?(a=1,f(b)):d(b)}function f(b){return b===58?(e.consume(b),a=0,h):(b===43||b===45||b===46||It(b))&&a++<32?(e.consume(b),f):(a=0,d(b))}function h(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),n):b===null||b===32||b===60||Pc(b)?i(b):(e.consume(b),h)}function d(b){return b===64?(e.consume(b),g):uD(b)?(e.consume(b),d):i(b)}function g(b){return It(b)?m(b):i(b)}function m(b){return b===46?(e.consume(b),a=0,g):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),n):x(b)}function x(b){if((b===45||It(b))&&a++<63){const w=b===45?x:m;return e.consume(b),w}return i(b)}}const ws={partial:!0,tokenize:wD};function wD(e,n,i){return a;function a(s){return Be(s)?Pe(e,o,"linePrefix")(s):o(s)}function o(s){return s===null||Se(s)?n(s):i(s)}}const h2={continuation:{tokenize:_D},exit:kD,name:"blockQuote",tokenize:SD};function SD(e,n,i){const a=this;return o;function o(u){if(u===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),s}return i(u)}function s(u){return Be(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(u))}}function _D(e,n,i){const a=this;return o;function o(u){return Be(u)?Pe(e,s,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):s(u)}function s(u){return e.attempt(h2,n,i)(u)}}function kD(e){e.exit("blockQuote")}const p2={name:"characterEscape",tokenize:ED};function ED(e,n,i){return a;function a(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),o}function o(s){return fD(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):i(s)}}const m2={name:"characterReference",tokenize:ND};function ND(e,n,i){const a=this;let o=0,s,u;return f;function f(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),h}function h(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),s=31,u=It,g(m))}function d(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,u=cD,g):(e.enter("characterReferenceValue"),s=7,u=Jp,g(m))}function g(m){if(m===59&&o){const x=e.exit("characterReferenceValue");return u===It&&!$m(a.sliceSerialize(x))?i(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return u(m)&&o++<s?(e.consume(m),g):i(m)}}const I1={partial:!0,tokenize:MD},q1={concrete:!0,name:"codeFenced",tokenize:CD};function CD(e,n,i){const a=this,o={partial:!0,tokenize:L};let s=0,u=0,f;return h;function h(A){return d(A)}function d(A){const H=a.events[a.events.length-1];return s=H&&H[1].type==="linePrefix"?H[2].sliceSerialize(H[1],!0).length:0,f=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(A)}function g(A){return A===f?(u++,e.consume(A),g):u<3?i(A):(e.exit("codeFencedFenceSequence"),Be(A)?Pe(e,m,"whitespace")(A):m(A))}function m(A){return A===null||Se(A)?(e.exit("codeFencedFence"),a.interrupt?n(A):e.check(I1,E,C)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(A))}function x(A){return A===null||Se(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(A)):Be(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Pe(e,b,"whitespace")(A)):A===96&&A===f?i(A):(e.consume(A),x)}function b(A){return A===null||Se(A)?m(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(A))}function w(A){return A===null||Se(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(A)):A===96&&A===f?i(A):(e.consume(A),w)}function E(A){return e.attempt(o,C,N)(A)}function N(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),_}function _(A){return s>0&&Be(A)?Pe(e,D,"linePrefix",s+1)(A):D(A)}function D(A){return A===null||Se(A)?e.check(I1,E,C)(A):(e.enter("codeFlowValue"),k(A))}function k(A){return A===null||Se(A)?(e.exit("codeFlowValue"),D(A)):(e.consume(A),k)}function C(A){return e.exit("codeFenced"),n(A)}function L(A,H,F){let G=0;return q;function q(B){return A.enter("lineEnding"),A.consume(B),A.exit("lineEnding"),V}function V(B){return A.enter("codeFencedFence"),Be(B)?Pe(A,P,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):P(B)}function P(B){return B===f?(A.enter("codeFencedFenceSequence"),te(B)):F(B)}function te(B){return B===f?(G++,A.consume(B),te):G>=u?(A.exit("codeFencedFenceSequence"),Be(B)?Pe(A,O,"whitespace")(B):O(B)):F(B)}function O(B){return B===null||Se(B)?(A.exit("codeFencedFence"),H(B)):F(B)}}}function MD(e,n,i){const a=this;return o;function o(u){return u===null?i(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s)}function s(u){return a.parser.lazy[a.now().line]?i(u):n(u)}}const fp={name:"codeIndented",tokenize:AD},TD={partial:!0,tokenize:zD};function AD(e,n,i){const a=this;return o;function o(d){return e.enter("codeIndented"),Pe(e,s,"linePrefix",5)(d)}function s(d){const g=a.events[a.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?u(d):i(d)}function u(d){return d===null?h(d):Se(d)?e.attempt(TD,u,h)(d):(e.enter("codeFlowValue"),f(d))}function f(d){return d===null||Se(d)?(e.exit("codeFlowValue"),u(d)):(e.consume(d),f)}function h(d){return e.exit("codeIndented"),n(d)}}function zD(e,n,i){const a=this;return o;function o(u){return a.parser.lazy[a.now().line]?i(u):Se(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):Pe(e,s,"linePrefix",5)(u)}function s(u){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(u):Se(u)?o(u):i(u)}}const jD={name:"codeText",previous:RD,resolve:DD,tokenize:OD};function DD(e){let n=e.length-4,i=3,a,o;if((e[i][1].type==="lineEnding"||e[i][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(a=i;++a<n;)if(e[a][1].type==="codeTextData"){e[i][1].type="codeTextPadding",e[n][1].type="codeTextPadding",i+=2,n-=2;break}}for(a=i-1,n++;++a<=n;)o===void 0?a!==n&&e[a][1].type!=="lineEnding"&&(o=a):(a===n||e[a][1].type==="lineEnding")&&(e[o][1].type="codeTextData",a!==o+2&&(e[o][1].end=e[a-1][1].end,e.splice(o+2,a-o-2),n-=a-o-2,a=o+2),o=void 0);return e}function RD(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function OD(e,n,i){let a=0,o,s;return u;function u(m){return e.enter("codeText"),e.enter("codeTextSequence"),f(m)}function f(m){return m===96?(e.consume(m),a++,f):(e.exit("codeTextSequence"),h(m))}function h(m){return m===null?i(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),h):m===96?(s=e.enter("codeTextSequence"),o=0,g(m)):Se(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||Se(m)?(e.exit("codeTextData"),h(m)):(e.consume(m),d)}function g(m){return m===96?(e.consume(m),o++,g):o===a?(e.exit("codeTextSequence"),e.exit("codeText"),n(m)):(s.type="codeTextData",d(m))}}class LD{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,i){const a=i??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(n,a):n>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(n,i,a){const o=i||0;this.setCursor(Math.trunc(n));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return a&&Ho(this.left,a),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),Ho(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Ho(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);Ho(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Ho(this.left,i.reverse())}}}function Ho(e,n){let i=0;if(n.length<1e4)e.push(...n);else for(;i<n.length;)e.push(...n.slice(i,i+1e4)),i+=1e4}function g2(e){const n={};let i=-1,a,o,s,u,f,h,d;const g=new LD(e);for(;++i<g.length;){for(;i in n;)i=n[i];if(a=g.get(i),i&&a[1].type==="chunkFlow"&&g.get(i-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,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(a[0]==="enter")a[1].contentType&&(Object.assign(n,HD(g,i)),i=n[i],d=!0);else if(a[1]._container){for(s=i,o=void 0;s--;)if(u=g.get(s),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(o&&(g.get(o)[1].type="lineEndingBlank"),u[1].type="lineEnding",o=s);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;o&&(a[1].end={...g.get(o)[1].start},f=g.slice(o,i),f.unshift(a),g.splice(o,i-o+1,f))}}return wn(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!d}function HD(e,n){const i=e.get(n)[1],a=e.get(n)[2];let o=n-1;const s=[];let u=i._tokenizer;u||(u=a.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,h=[],d={};let g,m,x=-1,b=i,w=0,E=0;const N=[E];for(;b;){for(;e.get(++o)[1]!==b;);s.push(o),b._tokenizer||(g=a.sliceStream(b),b.next||g.push(null),m&&u.defineSkip(b.start),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(g),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),m=b,b=b.next}for(b=i;++x<f.length;)f[x][0]==="exit"&&f[x-1][0]==="enter"&&f[x][1].type===f[x-1][1].type&&f[x][1].start.line!==f[x][1].end.line&&(E=x+1,N.push(E),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(u.events=[],b?(b._tokenizer=void 0,b.previous=void 0):N.pop(),x=N.length;x--;){const _=f.slice(N[x],N[x+1]),D=s.pop();h.push([D,D+_.length-1]),e.splice(D,2,_)}for(h.reverse(),x=-1;++x<h.length;)d[w+h[x][0]]=w+h[x][1],w+=h[x][1]-h[x][0]-1;return d}const BD={resolve:ID,tokenize:qD},UD={partial:!0,tokenize:$D};function ID(e){return g2(e),e}function qD(e,n){let i;return a;function a(f){return e.enter("content"),i=e.enter("chunkContent",{contentType:"content"}),o(f)}function o(f){return f===null?s(f):Se(f)?e.check(UD,u,s)(f):(e.consume(f),o)}function s(f){return e.exit("chunkContent"),e.exit("content"),n(f)}function u(f){return e.consume(f),e.exit("chunkContent"),i.next=e.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,o}}function $D(e,n,i){const a=this;return o;function o(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Pe(e,s,"linePrefix")}function s(u){if(u===null||Se(u))return i(u);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(u):e.interrupt(a.parser.constructs.flow,i,n)(u)}}function y2(e,n,i,a,o,s,u,f,h){const d=h||Number.POSITIVE_INFINITY;let g=0;return m;function m(_){return _===60?(e.enter(a),e.enter(o),e.enter(s),e.consume(_),e.exit(s),x):_===null||_===32||_===41||Pc(_)?i(_):(e.enter(a),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),E(_))}function x(_){return _===62?(e.enter(s),e.consume(_),e.exit(s),e.exit(o),e.exit(a),n):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(_))}function b(_){return _===62?(e.exit("chunkString"),e.exit(f),x(_)):_===null||_===60||Se(_)?i(_):(e.consume(_),_===92?w:b)}function w(_){return _===60||_===62||_===92?(e.consume(_),b):b(_)}function E(_){return!g&&(_===null||_===41||rt(_))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(a),n(_)):g<d&&_===40?(e.consume(_),g++,E):_===41?(e.consume(_),g--,E):_===null||_===32||_===40||Pc(_)?i(_):(e.consume(_),_===92?N:E)}function N(_){return _===40||_===41||_===92?(e.consume(_),E):E(_)}}function x2(e,n,i,a,o,s){const u=this;let f=0,h;return d;function d(b){return e.enter(a),e.enter(o),e.consume(b),e.exit(o),e.enter(s),g}function g(b){return f>999||b===null||b===91||b===93&&!h||b===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?i(b):b===93?(e.exit(s),e.enter(o),e.consume(b),e.exit(o),e.exit(a),n):Se(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||b===91||b===93||Se(b)||f++>999?(e.exit("chunkString"),g(b)):(e.consume(b),h||(h=!Be(b)),b===92?x:m)}function x(b){return b===91||b===92||b===93?(e.consume(b),f++,m):m(b)}}function b2(e,n,i,a,o,s){let u;return f;function f(x){return x===34||x===39||x===40?(e.enter(a),e.enter(o),e.consume(x),e.exit(o),u=x===40?41:x,h):i(x)}function h(x){return x===u?(e.enter(o),e.consume(x),e.exit(o),e.exit(a),n):(e.enter(s),d(x))}function d(x){return x===u?(e.exit(s),h(u)):x===null?i(x):Se(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Pe(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===u||x===null||Se(x)?(e.exit("chunkString"),d(x)):(e.consume(x),x===92?m:g)}function m(x){return x===u||x===92?(e.consume(x),g):g(x)}}function Fo(e,n){let i;return a;function a(o){return Se(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i=!0,a):Be(o)?Pe(e,a,i?"linePrefix":"lineSuffix")(o):n(o)}}const VD={name:"definition",tokenize:YD},PD={partial:!0,tokenize:XD};function YD(e,n,i){const a=this;let o;return s;function s(b){return e.enter("definition"),u(b)}function u(b){return x2.call(a,e,f,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return o=Yn(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),h):i(b)}function h(b){return rt(b)?Fo(e,d)(b):d(b)}function d(b){return y2(e,g,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(PD,m,m)(b)}function m(b){return Be(b)?Pe(e,x,"whitespace")(b):x(b)}function x(b){return b===null||Se(b)?(e.exit("definition"),a.parser.defined.push(o),n(b)):i(b)}}function XD(e,n,i){return a;function a(f){return rt(f)?Fo(e,o)(f):i(f)}function o(f){return b2(e,s,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function s(f){return Be(f)?Pe(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Se(f)?n(f):i(f)}}const FD={name:"hardBreakEscape",tokenize:GD};function GD(e,n,i){return a;function a(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Se(s)?(e.exit("hardBreakEscape"),n(s)):i(s)}}const ZD={name:"headingAtx",resolve:QD,tokenize:KD};function QD(e,n){let i=e.length-2,a=3,o,s;return e[a][1].type==="whitespace"&&(a+=2),i-2>a&&e[i][1].type==="whitespace"&&(i-=2),e[i][1].type==="atxHeadingSequence"&&(a===i-1||i-4>a&&e[i-2][1].type==="whitespace")&&(i-=a+1===i?2:4),i>a&&(o={type:"atxHeadingText",start:e[a][1].start,end:e[i][1].end},s={type:"chunkText",start:e[a][1].start,end:e[i][1].end,contentType:"text"},wn(e,a,i-a+1,[["enter",o,n],["enter",s,n],["exit",s,n],["exit",o,n]])),e}function KD(e,n,i){let a=0;return o;function o(g){return e.enter("atxHeading"),s(g)}function s(g){return e.enter("atxHeadingSequence"),u(g)}function u(g){return g===35&&a++<6?(e.consume(g),u):g===null||rt(g)?(e.exit("atxHeadingSequence"),f(g)):i(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||Se(g)?(e.exit("atxHeading"),n(g)):Be(g)?Pe(e,f,"whitespace")(g):(e.enter("atxHeadingText"),d(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),f(g))}function d(g){return g===null||g===35||rt(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),d)}}const JD=["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"],$1=["pre","script","style","textarea"],WD={concrete:!0,name:"htmlFlow",resolveTo:nR,tokenize:iR},eR={partial:!0,tokenize:aR},tR={partial:!0,tokenize:rR};function nR(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 iR(e,n,i){const a=this;let o,s,u,f,h;return d;function d(T){return g(T)}function g(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),m}function m(T){return T===33?(e.consume(T),x):T===47?(e.consume(T),s=!0,E):T===63?(e.consume(T),o=3,a.interrupt?n:z):Ft(T)?(e.consume(T),u=String.fromCharCode(T),N):i(T)}function x(T){return T===45?(e.consume(T),o=2,b):T===91?(e.consume(T),o=5,f=0,w):Ft(T)?(e.consume(T),o=4,a.interrupt?n:z):i(T)}function b(T){return T===45?(e.consume(T),a.interrupt?n:z):i(T)}function w(T){const ie="CDATA[";return T===ie.charCodeAt(f++)?(e.consume(T),f===ie.length?a.interrupt?n:P:w):i(T)}function E(T){return Ft(T)?(e.consume(T),u=String.fromCharCode(T),N):i(T)}function N(T){if(T===null||T===47||T===62||rt(T)){const ie=T===47,ce=u.toLowerCase();return!ie&&!s&&$1.includes(ce)?(o=1,a.interrupt?n(T):P(T)):JD.includes(u.toLowerCase())?(o=6,ie?(e.consume(T),_):a.interrupt?n(T):P(T)):(o=7,a.interrupt&&!a.parser.lazy[a.now().line]?i(T):s?D(T):k(T))}return T===45||It(T)?(e.consume(T),u+=String.fromCharCode(T),N):i(T)}function _(T){return T===62?(e.consume(T),a.interrupt?n:P):i(T)}function D(T){return Be(T)?(e.consume(T),D):q(T)}function k(T){return T===47?(e.consume(T),q):T===58||T===95||Ft(T)?(e.consume(T),C):Be(T)?(e.consume(T),k):q(T)}function C(T){return T===45||T===46||T===58||T===95||It(T)?(e.consume(T),C):L(T)}function L(T){return T===61?(e.consume(T),A):Be(T)?(e.consume(T),L):k(T)}function A(T){return T===null||T===60||T===61||T===62||T===96?i(T):T===34||T===39?(e.consume(T),h=T,H):Be(T)?(e.consume(T),A):F(T)}function H(T){return T===h?(e.consume(T),h=null,G):T===null||Se(T)?i(T):(e.consume(T),H)}function F(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||rt(T)?L(T):(e.consume(T),F)}function G(T){return T===47||T===62||Be(T)?k(T):i(T)}function q(T){return T===62?(e.consume(T),V):i(T)}function V(T){return T===null||Se(T)?P(T):Be(T)?(e.consume(T),V):i(T)}function P(T){return T===45&&o===2?(e.consume(T),j):T===60&&o===1?(e.consume(T),U):T===62&&o===4?(e.consume(T),R):T===63&&o===3?(e.consume(T),z):T===93&&o===5?(e.consume(T),K):Se(T)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(eR,$,te)(T)):T===null||Se(T)?(e.exit("htmlFlowData"),te(T)):(e.consume(T),P)}function te(T){return e.check(tR,O,$)(T)}function O(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),B}function B(T){return T===null||Se(T)?te(T):(e.enter("htmlFlowData"),P(T))}function j(T){return T===45?(e.consume(T),z):P(T)}function U(T){return T===47?(e.consume(T),u="",Y):P(T)}function Y(T){if(T===62){const ie=u.toLowerCase();return $1.includes(ie)?(e.consume(T),R):P(T)}return Ft(T)&&u.length<8?(e.consume(T),u+=String.fromCharCode(T),Y):P(T)}function K(T){return T===93?(e.consume(T),z):P(T)}function z(T){return T===62?(e.consume(T),R):T===45&&o===2?(e.consume(T),z):P(T)}function R(T){return T===null||Se(T)?(e.exit("htmlFlowData"),$(T)):(e.consume(T),R)}function $(T){return e.exit("htmlFlow"),n(T)}}function rR(e,n,i){const a=this;return o;function o(u){return Se(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):i(u)}function s(u){return a.parser.lazy[a.now().line]?i(u):n(u)}}function aR(e,n,i){return a;function a(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(ws,n,i)}}const lR={name:"htmlText",tokenize:oR};function oR(e,n,i){const a=this;let o,s,u;return f;function f(z){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(z),h}function h(z){return z===33?(e.consume(z),d):z===47?(e.consume(z),L):z===63?(e.consume(z),k):Ft(z)?(e.consume(z),F):i(z)}function d(z){return z===45?(e.consume(z),g):z===91?(e.consume(z),s=0,w):Ft(z)?(e.consume(z),D):i(z)}function g(z){return z===45?(e.consume(z),b):i(z)}function m(z){return z===null?i(z):z===45?(e.consume(z),x):Se(z)?(u=m,U(z)):(e.consume(z),m)}function x(z){return z===45?(e.consume(z),b):m(z)}function b(z){return z===62?j(z):z===45?x(z):m(z)}function w(z){const R="CDATA[";return z===R.charCodeAt(s++)?(e.consume(z),s===R.length?E:w):i(z)}function E(z){return z===null?i(z):z===93?(e.consume(z),N):Se(z)?(u=E,U(z)):(e.consume(z),E)}function N(z){return z===93?(e.consume(z),_):E(z)}function _(z){return z===62?j(z):z===93?(e.consume(z),_):E(z)}function D(z){return z===null||z===62?j(z):Se(z)?(u=D,U(z)):(e.consume(z),D)}function k(z){return z===null?i(z):z===63?(e.consume(z),C):Se(z)?(u=k,U(z)):(e.consume(z),k)}function C(z){return z===62?j(z):k(z)}function L(z){return Ft(z)?(e.consume(z),A):i(z)}function A(z){return z===45||It(z)?(e.consume(z),A):H(z)}function H(z){return Se(z)?(u=H,U(z)):Be(z)?(e.consume(z),H):j(z)}function F(z){return z===45||It(z)?(e.consume(z),F):z===47||z===62||rt(z)?G(z):i(z)}function G(z){return z===47?(e.consume(z),j):z===58||z===95||Ft(z)?(e.consume(z),q):Se(z)?(u=G,U(z)):Be(z)?(e.consume(z),G):j(z)}function q(z){return z===45||z===46||z===58||z===95||It(z)?(e.consume(z),q):V(z)}function V(z){return z===61?(e.consume(z),P):Se(z)?(u=V,U(z)):Be(z)?(e.consume(z),V):G(z)}function P(z){return z===null||z===60||z===61||z===62||z===96?i(z):z===34||z===39?(e.consume(z),o=z,te):Se(z)?(u=P,U(z)):Be(z)?(e.consume(z),P):(e.consume(z),O)}function te(z){return z===o?(e.consume(z),o=void 0,B):z===null?i(z):Se(z)?(u=te,U(z)):(e.consume(z),te)}function O(z){return z===null||z===34||z===39||z===60||z===61||z===96?i(z):z===47||z===62||rt(z)?G(z):(e.consume(z),O)}function B(z){return z===47||z===62||rt(z)?G(z):i(z)}function j(z){return z===62?(e.consume(z),e.exit("htmlTextData"),e.exit("htmlText"),n):i(z)}function U(z){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),Y}function Y(z){return Be(z)?Pe(e,K,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):K(z)}function K(z){return e.enter("htmlTextData"),u(z)}}const Vm={name:"labelEnd",resolveAll:fR,resolveTo:dR,tokenize:hR},sR={tokenize:pR},uR={tokenize:mR},cR={tokenize:gR};function fR(e){let n=-1;const i=[];for(;++n<e.length;){const a=e[n][1];if(i.push(e[n]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const o=a.type==="labelImage"?4:2;a.type="data",n+=o}}return e.length!==i.length&&wn(e,0,e.length,i),e}function dR(e,n){let i=e.length,a=0,o,s,u,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(u){if(e[i][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(s=i,o.type!=="labelLink")){a=2;break}}else o.type==="labelEnd"&&(u=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[u][1].end}},g={type:"labelText",start:{...e[s+a+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",h,n],["enter",d,n]],f=Dn(f,e.slice(s+1,s+a+3)),f=Dn(f,[["enter",g,n]]),f=Dn(f,xf(n.parser.constructs.insideSpan.null,e.slice(s+a+4,u-3),n)),f=Dn(f,[["exit",g,n],e[u-2],e[u-1],["exit",d,n]]),f=Dn(f,e.slice(u+1)),f=Dn(f,[["exit",h,n]]),wn(e,s,e.length,f),e}function hR(e,n,i){const a=this;let o=a.events.length,s,u;for(;o--;)if((a.events[o][1].type==="labelImage"||a.events[o][1].type==="labelLink")&&!a.events[o][1]._balanced){s=a.events[o][1];break}return f;function f(x){return s?s._inactive?m(x):(u=a.parser.defined.includes(Yn(a.sliceSerialize({start:s.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),h):i(x)}function h(x){return x===40?e.attempt(sR,g,u?g:m)(x):x===91?e.attempt(uR,g,u?d:m)(x):u?g(x):m(x)}function d(x){return e.attempt(cR,g,m)(x)}function g(x){return n(x)}function m(x){return s._balanced=!0,i(x)}}function pR(e,n,i){return a;function a(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),o}function o(m){return rt(m)?Fo(e,s)(m):s(m)}function s(m){return m===41?g(m):y2(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function u(m){return rt(m)?Fo(e,h)(m):g(m)}function f(m){return i(m)}function h(m){return m===34||m===39||m===40?b2(e,d,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):g(m)}function d(m){return rt(m)?Fo(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 mR(e,n,i){const a=this;return o;function o(f){return x2.call(a,e,s,u,"reference","referenceMarker","referenceString")(f)}function s(f){return a.parser.defined.includes(Yn(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?n(f):i(f)}function u(f){return i(f)}}function gR(e,n,i){return a;function a(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 yR={name:"labelStartImage",resolveAll:Vm.resolveAll,tokenize:xR};function xR(e,n,i){const a=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"),u):i(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?i(f):n(f)}}const bR={name:"labelStartLink",resolveAll:Vm.resolveAll,tokenize:vR};function vR(e,n,i){const a=this;return o;function o(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),s}function s(u){return u===94&&"_hiddenFootnoteSupport"in a.parser.constructs?i(u):n(u)}}const dp={name:"lineEnding",tokenize:wR};function wR(e,n){return i;function i(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Pe(e,n,"linePrefix")}}const Tc={name:"thematicBreak",tokenize:SR};function SR(e,n,i){let a=0,o;return s;function s(d){return e.enter("thematicBreak"),u(d)}function u(d){return o=d,f(d)}function f(d){return d===o?(e.enter("thematicBreakSequence"),h(d)):a>=3&&(d===null||Se(d))?(e.exit("thematicBreak"),n(d)):i(d)}function h(d){return d===o?(e.consume(d),a++,h):(e.exit("thematicBreakSequence"),Be(d)?Pe(e,f,"whitespace")(d):f(d))}}const rn={continuation:{tokenize:NR},exit:MR,name:"list",tokenize:ER},_R={partial:!0,tokenize:TR},kR={partial:!0,tokenize:CR};function ER(e,n,i){const a=this,o=a.events[a.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,u=0;return f;function f(b){const w=a.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!a.containerState.marker||b===a.containerState.marker:Jp(b)){if(a.containerState.type||(a.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Tc,i,d)(b):d(b);if(!a.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(b)}return i(b)}function h(b){return Jp(b)&&++u<10?(e.consume(b),h):(!a.interrupt||u<2)&&(a.containerState.marker?b===a.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),d(b)):i(b)}function d(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||b,e.check(ws,a.interrupt?i:g,e.attempt(_R,x,m))}function g(b){return a.containerState.initialBlankLine=!0,s++,x(b)}function m(b){return Be(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),x):i(b)}function x(b){return a.containerState.size=s+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(b)}}function NR(e,n,i){const a=this;return a.containerState._closeFlow=void 0,e.check(ws,o,s);function o(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,Pe(e,n,"listItemIndent",a.containerState.size+1)(f)}function s(f){return a.containerState.furtherBlankLines||!Be(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,u(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(kR,n,u)(f))}function u(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,Pe(e,e.attempt(rn,n,i),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function CR(e,n,i){const a=this;return Pe(e,o,"listItemIndent",a.containerState.size+1);function o(s){const u=a.events[a.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===a.containerState.size?n(s):i(s)}}function MR(e){e.exit(this.containerState.type)}function TR(e,n,i){const a=this;return Pe(e,o,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const u=a.events[a.events.length-1];return!Be(s)&&u&&u[1].type==="listItemPrefixWhitespace"?n(s):i(s)}}const V1={name:"setextUnderline",resolveTo:AR,tokenize:zR};function AR(e,n){let i=e.length,a,o,s;for(;i--;)if(e[i][0]==="enter"){if(e[i][1].type==="content"){a=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 u={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",u,n]),e.splice(s+1,0,["exit",e[a][1],n]),e[a][1].end={...e[s][1].end}):e[a][1]=u,e.push(["exit",u,n]),e}function zR(e,n,i){const a=this;let o;return s;function s(d){let g=a.events.length,m;for(;g--;)if(a.events[g][1].type!=="lineEnding"&&a.events[g][1].type!=="linePrefix"&&a.events[g][1].type!=="content"){m=a.events[g][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||m)?(e.enter("setextHeadingLine"),o=d,u(d)):i(d)}function u(d){return e.enter("setextHeadingLineSequence"),f(d)}function f(d){return d===o?(e.consume(d),f):(e.exit("setextHeadingLineSequence"),Be(d)?Pe(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||Se(d)?(e.exit("setextHeadingLine"),n(d)):i(d)}}const jR={tokenize:DR};function DR(e){const n=this,i=e.attempt(ws,a,e.attempt(this.parser.constructs.flowInitial,o,Pe(e,e.attempt(this.parser.constructs.flow,o,e.attempt(BD,o)),"linePrefix")));return i;function a(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 RR={resolveAll:w2()},OR=v2("string"),LR=v2("text");function v2(e){return{resolveAll:w2(e==="text"?HR:void 0),tokenize:n};function n(i){const a=this,o=this.parser.constructs[e],s=i.attempt(o,u,f);return u;function u(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 b=m[x];if(!b.previous||b.previous.call(a,a.previous))return!0}return!1}}}function w2(e){return n;function n(i,a){let 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,a):i}}function HR(e,n){let i=0;for(;++i<=e.length;)if((i===e.length||e[i][1].type==="lineEnding")&&e[i-1][1].type==="data"){const a=e[i-1][1],o=n.sliceStream(a);let s=o.length,u=-1,f=0,h;for(;s--;){const d=o[s];if(typeof d=="string"){for(u=d.length;d.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(d===-2)h=!0,f++;else if(d!==-1){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?u:a.start._bufferIndex+u,_index:a.start._index+s,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...d.start},a.start.offset===a.end.offset?Object.assign(a,d):(e.splice(i,0,["enter",d,n],["exit",d,n]),i+=2)}i++}return e}const BR={42:rn,43:rn,45:rn,48:rn,49:rn,50:rn,51:rn,52:rn,53:rn,54:rn,55:rn,56:rn,57:rn,62:h2},UR={91:VD},IR={[-2]:fp,[-1]:fp,32:fp},qR={35:ZD,42:Tc,45:[V1,Tc],60:WD,61:V1,95:Tc,96:q1,126:q1},$R={38:m2,92:p2},VR={[-5]:dp,[-4]:dp,[-3]:dp,33:yR,38:m2,42:Wp,60:[bD,lR],91:bR,92:[FD,p2],93:Vm,95:Wp,96:jD},PR={null:[Wp,RR]},YR={null:[42,95]},XR={null:[]},FR=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:YR,contentInitial:UR,disable:XR,document:BR,flow:qR,flowInitial:IR,insideSpan:PR,string:$R,text:VR},Symbol.toStringTag,{value:"Module"}));function GR(e,n,i){let a={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const o={},s=[];let u=[],f=[];const h={attempt:H(L),check:H(A),consume:D,enter:k,exit:C,interrupt:H(A,{interrupt:!0})},d={code:null,containerState:{},defineSkip:E,events:[],now:w,parser:e,previous:null,sliceSerialize:x,sliceStream:b,write:m};let g=n.tokenize.call(d,h);return n.resolveAll&&s.push(n),d;function m(V){return u=Dn(u,V),N(),u[u.length-1]!==null?[]:(F(n,0),d.events=xf(s,d.events,d),d.events)}function x(V,P){return QR(b(V),P)}function b(V){return ZR(u,V)}function w(){const{_bufferIndex:V,_index:P,line:te,column:O,offset:B}=a;return{_bufferIndex:V,_index:P,line:te,column:O,offset:B}}function E(V){o[V.line]=V.column,q()}function N(){let V;for(;a._index<u.length;){const P=u[a._index];if(typeof P=="string")for(V=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===V&&a._bufferIndex<P.length;)_(P.charCodeAt(a._bufferIndex));else _(P)}}function _(V){g=g(V)}function D(V){Se(V)?(a.line++,a.column=1,a.offset+=V===-3?2:1,q()):V!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===u[a._index].length&&(a._bufferIndex=-1,a._index++)),d.previous=V}function k(V,P){const te=P||{};return te.type=V,te.start=w(),d.events.push(["enter",te,d]),f.push(te),te}function C(V){const P=f.pop();return P.end=w(),d.events.push(["exit",P,d]),P}function L(V,P){F(V,P.from)}function A(V,P){P.restore()}function H(V,P){return te;function te(O,B,j){let U,Y,K,z;return Array.isArray(O)?$(O):"tokenize"in O?$([O]):R(O);function R(fe){return he;function he(ue){const me=ue!==null&&fe[ue],Ee=ue!==null&&fe.null,Ce=[...Array.isArray(me)?me:me?[me]:[],...Array.isArray(Ee)?Ee:Ee?[Ee]:[]];return $(Ce)(ue)}}function $(fe){return U=fe,Y=0,fe.length===0?j:T(fe[Y])}function T(fe){return he;function he(ue){return z=G(),K=fe,fe.partial||(d.currentConstruct=fe),fe.name&&d.parser.constructs.disable.null.includes(fe.name)?ce():fe.tokenize.call(P?Object.assign(Object.create(d),P):d,h,ie,ce)(ue)}}function ie(fe){return V(K,z),B}function ce(fe){return z.restore(),++Y<U.length?T(U[Y]):j}}}function F(V,P){V.resolveAll&&!s.includes(V)&&s.push(V),V.resolve&&wn(d.events,P,d.events.length-P,V.resolve(d.events.slice(P),d)),V.resolveTo&&(d.events=V.resolveTo(d.events,d))}function G(){const V=w(),P=d.previous,te=d.currentConstruct,O=d.events.length,B=Array.from(f);return{from:O,restore:j};function j(){a=V,d.previous=P,d.currentConstruct=te,d.events.length=O,f=B,q()}}function q(){a.line in o&&a.column<2&&(a.column=o[a.line],a.offset+=o[a.line]-1)}}function ZR(e,n){const i=n.start._index,a=n.start._bufferIndex,o=n.end._index,s=n.end._bufferIndex;let u;if(i===o)u=[e[i].slice(a,s)];else{if(u=e.slice(i,o),a>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(a):u.shift()}s>0&&u.push(e[o].slice(0,s))}return u}function QR(e,n){let i=-1;const a=[];let o;for(;++i<e.length;){const s=e[i];let u;if(typeof s=="string")u=s;else switch(s){case-5:{u="\r";break}case-4:{u=`
|
|
114
121
|
`;break}case-3:{u=`\r
|
|
115
|
-
`;break}case-2:{u=n?" ":" ";break}case-1:{if(!n&&s)continue;u=" ";break}default:u=String.fromCharCode(o)}s=o===-2,a.push(u)}return a.join("")}function GR(e){const a={constructs:f2([PR,...(e||{}).extensions||[]]),content:s(uD),defined:[],document:s(fD),flow:s(TR),lazy:{},string:s(jR),text:s(DR)};return a;function s(o){return u;function u(f){return YR(a,o,f)}}}function ZR(e){for(;!g2(e););return e}const $1=/[\0\t\n\r]/g;function QR(){let e=1,n="",i=!0,a;return s;function s(o,u,f){const h=[];let d,g,m,x,b;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),m=0,n="",i&&(o.charCodeAt(0)===65279&&m++,i=void 0);m<o.length;){if($1.lastIndex=m,d=$1.exec(o),x=d&&d.index!==void 0?d.index:o.length,b=o.charCodeAt(x),!d){n=o.slice(m);break}if(b===10&&m===x&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),m<x&&(h.push(o.slice(m,x)),e+=x-m),b){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}m=x+1}return f&&(a&&h.push(-5),n&&h.push(n),h.push(null)),h}}const KR=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function JR(e){return e.replace(KR,WR)}function WR(e,n,i){if(n)return n;if(i.charCodeAt(0)===35){const s=i.charCodeAt(1),o=s===120||s===88;return d2(i.slice(o?2:1),o?16:10)}return Im(i)||e}const S2={}.hasOwnProperty;function eO(e,n,i){return typeof n!="string"&&(i=n,n=void 0),tO(i)(ZR(GR(i).document().write(QR()(e,n,!0))))}function tO(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Lt),autolinkProtocol:G,autolinkEmail:G,atxHeading:o(Ze),blockQuote:o(Ee),characterEscape:G,characterReference:G,codeFenced:o(Ce),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o(Ce,u),codeText:o(we,u),codeTextData:G,data:G,codeFlowValue:G,definition:o(Ne),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(Re),hardBreakEscape:o(Xe),hardBreakTrailing:o(Xe),htmlFlow:o(ht,u),htmlFlowData:G,htmlText:o(ht,u),htmlTextData:G,image:o(sn),label:u,link:o(Lt),listItem:o(Rn),listItemValue:x,listOrdered:o(Gt,m),listUnordered:o(Gt),paragraph:o(si),reference:T,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o(Ze),strong:o(oi),thematicBreak:o(Ii)},exit:{atxHeading:h(),atxHeadingSequence:L,autolink:h(),autolinkEmail:me,autolinkProtocol:ue,blockQuote:h(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:fe,characterReference:he,codeFenced:h(N),codeFencedFence:E,codeFencedFenceInfo:b,codeFencedFenceMeta:w,codeFlowValue:q,codeIndented:h(_),codeText:h(B),codeTextData:q,data:q,definition:h(),definitionDestinationString:C,definitionLabelString:D,definitionTitleString:k,emphasis:h(),hardBreakEscape:h(P),hardBreakTrailing:h(P),htmlFlow:h(te),htmlFlowData:q,htmlText:h(O),htmlTextData:q,image:h(U),label:K,labelText:Y,lineEnding:V,link:h(j),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ie,resourceDestinationString:z,resourceTitleString:R,resource:$,setextHeading:h(F),setextHeadingLineSequence:H,setextHeadingText:A,strong:h(),thematicBreak:h()}};_2(n,(e||{}).mdastExtensions||[]);const i={};return a;function a(ae){let pe={type:"root",children:[]};const _e={stack:[pe],tokenStack:[],config:n,enter:f,exit:d,buffer:u,resume:g,data:i},De=[];let $e=-1;for(;++$e<ae.length;)if(ae[$e][1].type==="listOrdered"||ae[$e][1].type==="listUnordered")if(ae[$e][0]==="enter")De.push($e);else{const Vt=De.pop();$e=s(ae,Vt,$e)}for($e=-1;++$e<ae.length;){const Vt=n[ae[$e][0]];S2.call(Vt,ae[$e][1].type)&&Vt[ae[$e][1].type].call(Object.assign({sliceSerialize:ae[$e][2].sliceSerialize},_e),ae[$e][1])}if(_e.tokenStack.length>0){const Vt=_e.tokenStack[_e.tokenStack.length-1];(Vt[1]||V1).call(_e,void 0,Vt[0])}for(pe.position={start:vr(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:vr(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},$e=-1;++$e<n.transforms.length;)pe=n.transforms[$e](pe)||pe;return pe}function s(ae,pe,_e){let De=pe-1,$e=-1,Vt=!1,On,At,pt,Ht;for(;++De<=_e;){const Ke=ae[De];switch(Ke[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ke[0]==="enter"?$e++:$e--,Ht=void 0;break}case"lineEndingBlank":{Ke[0]==="enter"&&(On&&!Ht&&!$e&&!pt&&(pt=De),Ht=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ht=void 0}if(!$e&&Ke[0]==="enter"&&Ke[1].type==="listItemPrefix"||$e===-1&&Ke[0]==="exit"&&(Ke[1].type==="listUnordered"||Ke[1].type==="listOrdered")){if(On){let Gn=De;for(At=void 0;Gn--;){const on=ae[Gn];if(on[1].type==="lineEnding"||on[1].type==="lineEndingBlank"){if(on[0]==="exit")continue;At&&(ae[At][1].type="lineEndingBlank",Vt=!0),on[1].type="lineEnding",At=Gn}else if(!(on[1].type==="linePrefix"||on[1].type==="blockQuotePrefix"||on[1].type==="blockQuotePrefixWhitespace"||on[1].type==="blockQuoteMarker"||on[1].type==="listItemIndent"))break}pt&&(!At||pt<At)&&(On._spread=!0),On.end=Object.assign({},At?ae[At][1].start:Ke[1].end),ae.splice(At||De,0,["exit",On,Ke[2]]),De++,_e++}if(Ke[1].type==="listItemPrefix"){const Gn={type:"listItem",_spread:!1,start:Object.assign({},Ke[1].start),end:void 0};On=Gn,ae.splice(De,0,["enter",Gn,Ke[2]]),De++,_e++,pt=void 0,Ht=!0}}}return ae[pe][1]._spread=Vt,_e}function o(ae,pe){return _e;function _e(De){f.call(this,ae(De),De),pe&&pe.call(this,De)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(ae,pe,_e){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([pe,_e||void 0]),ae.position={start:vr(pe.start),end:void 0}}function h(ae){return pe;function pe(_e){ae&&ae.call(this,_e),d.call(this,_e)}}function d(ae,pe){const _e=this.stack.pop(),De=this.tokenStack.pop();if(De)De[0].type!==ae.type&&(pe?pe.call(this,ae,De[0]):(De[1]||V1).call(this,ae,De[0]));else throw new Error("Cannot close `"+ae.type+"` ("+Vs({start:ae.start,end:ae.end})+"): it’s not open");_e.position.end=vr(ae.end)}function g(){return Um(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function x(ae){if(this.data.expectingFirstListItemValue){const pe=this.stack[this.stack.length-2];pe.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.lang=ae}function w(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.meta=ae}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae.replace(/(\r?\n|\r)$/g,"")}function D(ae){const pe=this.resume(),_e=this.stack[this.stack.length-1];_e.label=pe,_e.identifier=Yn(this.sliceSerialize(ae)).toLowerCase()}function k(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.title=ae}function C(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.url=ae}function L(ae){const pe=this.stack[this.stack.length-1];if(!pe.depth){const _e=this.sliceSerialize(ae).length;pe.depth=_e}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function H(ae){const pe=this.stack[this.stack.length-1];pe.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function G(ae){const _e=this.stack[this.stack.length-1].children;let De=_e[_e.length-1];(!De||De.type!=="text")&&(De=Et(),De.position={start:vr(ae.start),end:void 0},_e.push(De)),this.stack.push(De)}function q(ae){const pe=this.stack.pop();pe.value+=this.sliceSerialize(ae),pe.position.end=vr(ae.end)}function V(ae){const pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _e=pe.children[pe.children.length-1];_e.position.end=vr(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(pe.type)&&(G.call(this,ae),q.call(this,ae))}function P(){this.data.atHardBreak=!0}function te(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae}function O(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae}function B(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae}function j(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=pe,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function U(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=pe,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function Y(ae){const pe=this.sliceSerialize(ae),_e=this.stack[this.stack.length-2];_e.label=JR(pe),_e.identifier=Yn(pe).toLowerCase()}function K(){const ae=this.stack[this.stack.length-1],pe=this.resume(),_e=this.stack[this.stack.length-1];if(this.data.inReference=!0,_e.type==="link"){const De=ae.children;_e.children=De}else _e.alt=pe}function z(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.url=ae}function R(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.title=ae}function $(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function ie(ae){const pe=this.resume(),_e=this.stack[this.stack.length-1];_e.label=pe,_e.identifier=Yn(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function ce(ae){this.data.characterReferenceType=ae.type}function fe(ae){const pe=this.sliceSerialize(ae),_e=this.data.characterReferenceType;let De;_e?(De=d2(pe,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):De=Im(pe);const $e=this.stack[this.stack.length-1];$e.value+=De}function he(ae){const pe=this.stack.pop();pe.position.end=vr(ae.end)}function ue(ae){q.call(this,ae);const pe=this.stack[this.stack.length-1];pe.url=this.sliceSerialize(ae)}function me(ae){q.call(this,ae);const pe=this.stack[this.stack.length-1];pe.url="mailto:"+this.sliceSerialize(ae)}function Ee(){return{type:"blockquote",children:[]}}function Ce(){return{type:"code",lang:null,meta:null,value:""}}function we(){return{type:"inlineCode",value:""}}function Ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Re(){return{type:"emphasis",children:[]}}function Ze(){return{type:"heading",depth:0,children:[]}}function Xe(){return{type:"break"}}function ht(){return{type:"html",value:""}}function sn(){return{type:"image",title:null,url:"",alt:null}}function Lt(){return{type:"link",title:null,url:"",children:[]}}function Gt(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function Rn(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function si(){return{type:"paragraph",children:[]}}function oi(){return{type:"strong",children:[]}}function Et(){return{type:"text",value:""}}function Ii(){return{type:"thematicBreak"}}}function vr(e){return{line:e.line,column:e.column,offset:e.offset}}function _2(e,n){let i=-1;for(;++i<n.length;){const a=n[i];Array.isArray(a)?_2(e,a):nO(e,a)}}function nO(e,n){let i;for(i in n)if(S2.call(n,i))switch(i){case"canContainEols":{const a=n[i];a&&e[i].push(...a);break}case"transforms":{const a=n[i];a&&e[i].push(...a);break}case"enter":case"exit":{const a=n[i];a&&Object.assign(e[i],a);break}}}function V1(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Vs({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Vs({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Vs({start:n.start,end:n.end})+") is still open")}function iO(e){const n=this;n.parser=i;function i(a){return eO(a,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function rO(e,n){const i={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,i),e.applyData(n,i)}function aO(e,n){const i={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,i),[e.applyData(n,i),{type:"text",value:`
|
|
116
|
-
`}]}function
|
|
117
|
-
`:"",a={},
|
|
118
|
-
`}),g.type==="element"&&g.tagName==="p"&&!
|
|
119
|
-
`});const d={type:"element",tagName:"li",properties:
|
|
122
|
+
`;break}case-2:{u=n?" ":" ";break}case-1:{if(!n&&o)continue;u=" ";break}default:u=String.fromCharCode(s)}o=s===-2,a.push(u)}return a.join("")}function KR(e){const a={constructs:f2([FR,...(e||{}).extensions||[]]),content:o(dD),defined:[],document:o(pD),flow:o(jR),lazy:{},string:o(OR),text:o(LR)};return a;function o(s){return u;function u(f){return GR(a,s,f)}}}function JR(e){for(;!g2(e););return e}const P1=/[\0\t\n\r]/g;function WR(){let e=1,n="",i=!0,a;return o;function o(s,u,f){const h=[];let d,g,m,x,b;for(s=n+(typeof s=="string"?s.toString():new TextDecoder(u||void 0).decode(s)),m=0,n="",i&&(s.charCodeAt(0)===65279&&m++,i=void 0);m<s.length;){if(P1.lastIndex=m,d=P1.exec(s),x=d&&d.index!==void 0?d.index:s.length,b=s.charCodeAt(x),!d){n=s.slice(m);break}if(b===10&&m===x&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),m<x&&(h.push(s.slice(m,x)),e+=x-m),b){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}m=x+1}return f&&(a&&h.push(-5),n&&h.push(n),h.push(null)),h}}const eO=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tO(e){return e.replace(eO,nO)}function nO(e,n,i){if(n)return n;if(i.charCodeAt(0)===35){const o=i.charCodeAt(1),s=o===120||o===88;return d2(i.slice(s?2:1),s?16:10)}return $m(i)||e}const S2={}.hasOwnProperty;function iO(e,n,i){return typeof n!="string"&&(i=n,n=void 0),rO(i)(JR(KR(i).document().write(WR()(e,n,!0))))}function rO(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Lt),autolinkProtocol:G,autolinkEmail:G,atxHeading:s(Ze),blockQuote:s(Ee),characterEscape:G,characterReference:G,codeFenced:s(Ce),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:s(Ce,u),codeText:s(we,u),codeTextData:G,data:G,codeFlowValue:G,definition:s(Ne),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:s(Re),hardBreakEscape:s(Xe),hardBreakTrailing:s(Xe),htmlFlow:s(ht,u),htmlFlowData:G,htmlText:s(ht,u),htmlTextData:G,image:s(on),label:u,link:s(Lt),listItem:s(Rn),listItemValue:x,listOrdered:s(Gt,m),listUnordered:s(Gt),paragraph:s(oi),reference:T,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:s(Ze),strong:s(si),thematicBreak:s(Ii)},exit:{atxHeading:h(),atxHeadingSequence:L,autolink:h(),autolinkEmail:me,autolinkProtocol:ue,blockQuote:h(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:fe,characterReference:he,codeFenced:h(N),codeFencedFence:E,codeFencedFenceInfo:b,codeFencedFenceMeta:w,codeFlowValue:q,codeIndented:h(_),codeText:h(B),codeTextData:q,data:q,definition:h(),definitionDestinationString:C,definitionLabelString:D,definitionTitleString:k,emphasis:h(),hardBreakEscape:h(P),hardBreakTrailing:h(P),htmlFlow:h(te),htmlFlowData:q,htmlText:h(O),htmlTextData:q,image:h(U),label:K,labelText:Y,lineEnding:V,link:h(j),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ie,resourceDestinationString:z,resourceTitleString:R,resource:$,setextHeading:h(F),setextHeadingLineSequence:H,setextHeadingText:A,strong:h(),thematicBreak:h()}};_2(n,(e||{}).mdastExtensions||[]);const i={};return a;function a(ae){let pe={type:"root",children:[]};const _e={stack:[pe],tokenStack:[],config:n,enter:f,exit:d,buffer:u,resume:g,data:i},De=[];let $e=-1;for(;++$e<ae.length;)if(ae[$e][1].type==="listOrdered"||ae[$e][1].type==="listUnordered")if(ae[$e][0]==="enter")De.push($e);else{const Vt=De.pop();$e=o(ae,Vt,$e)}for($e=-1;++$e<ae.length;){const Vt=n[ae[$e][0]];S2.call(Vt,ae[$e][1].type)&&Vt[ae[$e][1].type].call(Object.assign({sliceSerialize:ae[$e][2].sliceSerialize},_e),ae[$e][1])}if(_e.tokenStack.length>0){const Vt=_e.tokenStack[_e.tokenStack.length-1];(Vt[1]||Y1).call(_e,void 0,Vt[0])}for(pe.position={start:vr(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:vr(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},$e=-1;++$e<n.transforms.length;)pe=n.transforms[$e](pe)||pe;return pe}function o(ae,pe,_e){let De=pe-1,$e=-1,Vt=!1,On,At,pt,Ht;for(;++De<=_e;){const Ke=ae[De];switch(Ke[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ke[0]==="enter"?$e++:$e--,Ht=void 0;break}case"lineEndingBlank":{Ke[0]==="enter"&&(On&&!Ht&&!$e&&!pt&&(pt=De),Ht=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ht=void 0}if(!$e&&Ke[0]==="enter"&&Ke[1].type==="listItemPrefix"||$e===-1&&Ke[0]==="exit"&&(Ke[1].type==="listUnordered"||Ke[1].type==="listOrdered")){if(On){let Gn=De;for(At=void 0;Gn--;){const sn=ae[Gn];if(sn[1].type==="lineEnding"||sn[1].type==="lineEndingBlank"){if(sn[0]==="exit")continue;At&&(ae[At][1].type="lineEndingBlank",Vt=!0),sn[1].type="lineEnding",At=Gn}else if(!(sn[1].type==="linePrefix"||sn[1].type==="blockQuotePrefix"||sn[1].type==="blockQuotePrefixWhitespace"||sn[1].type==="blockQuoteMarker"||sn[1].type==="listItemIndent"))break}pt&&(!At||pt<At)&&(On._spread=!0),On.end=Object.assign({},At?ae[At][1].start:Ke[1].end),ae.splice(At||De,0,["exit",On,Ke[2]]),De++,_e++}if(Ke[1].type==="listItemPrefix"){const Gn={type:"listItem",_spread:!1,start:Object.assign({},Ke[1].start),end:void 0};On=Gn,ae.splice(De,0,["enter",Gn,Ke[2]]),De++,_e++,pt=void 0,Ht=!0}}}return ae[pe][1]._spread=Vt,_e}function s(ae,pe){return _e;function _e(De){f.call(this,ae(De),De),pe&&pe.call(this,De)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(ae,pe,_e){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([pe,_e||void 0]),ae.position={start:vr(pe.start),end:void 0}}function h(ae){return pe;function pe(_e){ae&&ae.call(this,_e),d.call(this,_e)}}function d(ae,pe){const _e=this.stack.pop(),De=this.tokenStack.pop();if(De)De[0].type!==ae.type&&(pe?pe.call(this,ae,De[0]):(De[1]||Y1).call(this,ae,De[0]));else throw new Error("Cannot close `"+ae.type+"` ("+Xo({start:ae.start,end:ae.end})+"): it’s not open");_e.position.end=vr(ae.end)}function g(){return qm(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function x(ae){if(this.data.expectingFirstListItemValue){const pe=this.stack[this.stack.length-2];pe.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.lang=ae}function w(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.meta=ae}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae.replace(/(\r?\n|\r)$/g,"")}function D(ae){const pe=this.resume(),_e=this.stack[this.stack.length-1];_e.label=pe,_e.identifier=Yn(this.sliceSerialize(ae)).toLowerCase()}function k(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.title=ae}function C(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.url=ae}function L(ae){const pe=this.stack[this.stack.length-1];if(!pe.depth){const _e=this.sliceSerialize(ae).length;pe.depth=_e}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function H(ae){const pe=this.stack[this.stack.length-1];pe.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function G(ae){const _e=this.stack[this.stack.length-1].children;let De=_e[_e.length-1];(!De||De.type!=="text")&&(De=Et(),De.position={start:vr(ae.start),end:void 0},_e.push(De)),this.stack.push(De)}function q(ae){const pe=this.stack.pop();pe.value+=this.sliceSerialize(ae),pe.position.end=vr(ae.end)}function V(ae){const pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _e=pe.children[pe.children.length-1];_e.position.end=vr(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(pe.type)&&(G.call(this,ae),q.call(this,ae))}function P(){this.data.atHardBreak=!0}function te(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae}function O(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae}function B(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae}function j(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=pe,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function U(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=pe,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function Y(ae){const pe=this.sliceSerialize(ae),_e=this.stack[this.stack.length-2];_e.label=tO(pe),_e.identifier=Yn(pe).toLowerCase()}function K(){const ae=this.stack[this.stack.length-1],pe=this.resume(),_e=this.stack[this.stack.length-1];if(this.data.inReference=!0,_e.type==="link"){const De=ae.children;_e.children=De}else _e.alt=pe}function z(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.url=ae}function R(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.title=ae}function $(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function ie(ae){const pe=this.resume(),_e=this.stack[this.stack.length-1];_e.label=pe,_e.identifier=Yn(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function ce(ae){this.data.characterReferenceType=ae.type}function fe(ae){const pe=this.sliceSerialize(ae),_e=this.data.characterReferenceType;let De;_e?(De=d2(pe,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):De=$m(pe);const $e=this.stack[this.stack.length-1];$e.value+=De}function he(ae){const pe=this.stack.pop();pe.position.end=vr(ae.end)}function ue(ae){q.call(this,ae);const pe=this.stack[this.stack.length-1];pe.url=this.sliceSerialize(ae)}function me(ae){q.call(this,ae);const pe=this.stack[this.stack.length-1];pe.url="mailto:"+this.sliceSerialize(ae)}function Ee(){return{type:"blockquote",children:[]}}function Ce(){return{type:"code",lang:null,meta:null,value:""}}function we(){return{type:"inlineCode",value:""}}function Ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Re(){return{type:"emphasis",children:[]}}function Ze(){return{type:"heading",depth:0,children:[]}}function Xe(){return{type:"break"}}function ht(){return{type:"html",value:""}}function on(){return{type:"image",title:null,url:"",alt:null}}function Lt(){return{type:"link",title:null,url:"",children:[]}}function Gt(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function Rn(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function oi(){return{type:"paragraph",children:[]}}function si(){return{type:"strong",children:[]}}function Et(){return{type:"text",value:""}}function Ii(){return{type:"thematicBreak"}}}function vr(e){return{line:e.line,column:e.column,offset:e.offset}}function _2(e,n){let i=-1;for(;++i<n.length;){const a=n[i];Array.isArray(a)?_2(e,a):aO(e,a)}}function aO(e,n){let i;for(i in n)if(S2.call(n,i))switch(i){case"canContainEols":{const a=n[i];a&&e[i].push(...a);break}case"transforms":{const a=n[i];a&&e[i].push(...a);break}case"enter":case"exit":{const a=n[i];a&&Object.assign(e[i],a);break}}}function Y1(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Xo({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Xo({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Xo({start:n.start,end:n.end})+") is still open")}function lO(e){const n=this;n.parser=i;function i(a){return iO(a,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function oO(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 sO(e,n){const i={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,i),[e.applyData(n,i),{type:"text",value:`
|
|
123
|
+
`}]}function uO(e,n){const i=n.value?n.value+`
|
|
124
|
+
`:"",a={},o=n.lang?n.lang.split(/\s+/):[];o.length>0&&(a.className=["language-"+o[0]]);let s={type:"element",tagName:"code",properties:a,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 cO(e,n){const i={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function fO(e,n){const i={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function dO(e,n){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(n.identifier).toUpperCase(),o=wl(a.toLowerCase()),s=e.footnoteOrder.indexOf(a);let u,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),u=e.footnoteOrder.length):u=s+1,f+=1,e.footnoteCounts.set(a,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(u)}]};e.patch(n,h);const d={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(n,d),e.applyData(n,d)}function hO(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 pO(e,n){if(e.options.allowDangerousHtml){const i={type:"raw",value:n.value};return e.patch(n,i),e.applyData(n,i)}}function k2(e,n){const i=n.referenceType;let a="]";if(i==="collapsed"?a+="[]":i==="full"&&(a+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+a}];const o=e.all(n),s=o[0];s&&s.type==="text"?s.value="["+s.value:o.unshift({type:"text",value:"["});const u=o[o.length-1];return u&&u.type==="text"?u.value+=a:o.push({type:"text",value:a}),o}function mO(e,n){const i=String(n.identifier).toUpperCase(),a=e.definitionById.get(i);if(!a)return k2(e,n);const o={src:wl(a.url||""),alt:n.alt};a.title!==null&&a.title!==void 0&&(o.title=a.title);const s={type:"element",tagName:"img",properties:o,children:[]};return e.patch(n,s),e.applyData(n,s)}function gO(e,n){const i={src:wl(n.url)};n.alt!==null&&n.alt!==void 0&&(i.alt=n.alt),n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,a),e.applyData(n,a)}function yO(e,n){const i={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,i);const a={type:"element",tagName:"code",properties:{},children:[i]};return e.patch(n,a),e.applyData(n,a)}function xO(e,n){const i=String(n.identifier).toUpperCase(),a=e.definitionById.get(i);if(!a)return k2(e,n);const o={href:wl(a.url||"")};a.title!==null&&a.title!==void 0&&(o.title=a.title);const s={type:"element",tagName:"a",properties:o,children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function bO(e,n){const i={href:wl(n.url)};n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function vO(e,n,i){const a=e.all(n),o=i?wO(i):E2(n),s={},u=[];if(typeof n.checked=="boolean"){const g=a[0];let m;g&&g.type==="element"&&g.tagName==="p"?m=g:(m={type:"element",tagName:"p",properties:{},children:[]},a.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let f=-1;for(;++f<a.length;){const g=a[f];(o||f!==0||g.type!=="element"||g.tagName!=="p")&&u.push({type:"text",value:`
|
|
125
|
+
`}),g.type==="element"&&g.tagName==="p"&&!o?u.push(...g.children):u.push(g)}const h=a[a.length-1];h&&(o||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
|
|
126
|
+
`});const d={type:"element",tagName:"li",properties:s,children:u};return e.patch(n,d),e.applyData(n,d)}function wO(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const i=e.children;let a=-1;for(;!n&&++a<i.length;)n=E2(i[a])}return n}function E2(e){const n=e.spread;return n??e.children.length>1}function SO(e,n){const i={},a=e.all(n);let o=-1;for(typeof n.start=="number"&&n.start!==1&&(i.start=n.start);++o<a.length;){const u=a[o];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){i.className=["contains-task-list"];break}}const s={type:"element",tagName:n.ordered?"ol":"ul",properties:i,children:e.wrap(a,!0)};return e.patch(n,s),e.applyData(n,s)}function _O(e,n){const i={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function kO(e,n){const i={type:"root",children:e.wrap(e.all(n))};return e.patch(n,i),e.applyData(n,i)}function EO(e,n){const i={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function NO(e,n){const i=e.all(n),a=i.shift(),o=[];if(a){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(n.children[0],u),o.push(u)}if(i.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(i,!0)},f=Hm(n.children[1]),h=r2(n.children[n.children.length-1]);f&&h&&(u.position={start:f,end:h}),o.push(u)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(n,s),e.applyData(n,s)}function CO(e,n,i){const a=i?i.children:void 0,s=(a?a.indexOf(n):1)===0?"th":"td",u=i&&i.type==="table"?i.align:void 0,f=u?u.length:n.children.length;let h=-1;const d=[];for(;++h<f;){const m=n.children[h],x={},b=u?u[h]:void 0;b&&(x.align=b);let w={type:"element",tagName:s,properties:x,children:[]};m&&(w.children=e.all(m),e.patch(m,w),w=e.applyData(m,w)),d.push(w)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(n,g),e.applyData(n,g)}function MO(e,n){const i={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}const X1=9,F1=32;function TO(e){const n=String(e),i=/\r?\n|\r/g;let a=i.exec(n),o=0;const s=[];for(;a;)s.push(G1(n.slice(o,a.index),o>0,!0),a[0]),o=a.index+a[0].length,a=i.exec(n);return s.push(G1(n.slice(o),o>0,!1)),s.join("")}function G1(e,n,i){let a=0,o=e.length;if(n){let s=e.codePointAt(a);for(;s===X1||s===F1;)a++,s=e.codePointAt(a)}if(i){let s=e.codePointAt(o-1);for(;s===X1||s===F1;)o--,s=e.codePointAt(o-1)}return o>a?e.slice(a,o):""}function AO(e,n){const i={type:"text",value:TO(String(n.value))};return e.patch(n,i),e.applyData(n,i)}function zO(e,n){const i={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,i),e.applyData(n,i)}const jO={blockquote:oO,break:sO,code:uO,delete:cO,emphasis:fO,footnoteReference:dO,heading:hO,html:pO,imageReference:mO,image:gO,inlineCode:yO,linkReference:xO,link:bO,listItem:vO,list:SO,paragraph:_O,root:kO,strong:EO,table:NO,tableCell:MO,tableRow:CO,text:AO,thematicBreak:zO,toml:xc,yaml:xc,definition:xc,footnoteDefinition:xc};function xc(){}const N2=-1,bf=0,Go=1,Yc=2,Pm=3,Ym=4,Xm=5,Fm=6,C2=7,M2=8,Z1=typeof self=="object"?self:globalThis,DO=(e,n)=>{const i=(o,s)=>(e.set(s,o),o),a=o=>{if(e.has(o))return e.get(o);const[s,u]=n[o];switch(s){case bf:case N2:return i(u,o);case Go:{const f=i([],o);for(const h of u)f.push(a(h));return f}case Yc:{const f=i({},o);for(const[h,d]of u)f[a(h)]=a(d);return f}case Pm:return i(new Date(u),o);case Ym:{const{source:f,flags:h}=u;return i(new RegExp(f,h),o)}case Xm:{const f=i(new Map,o);for(const[h,d]of u)f.set(a(h),a(d));return f}case Fm:{const f=i(new Set,o);for(const h of u)f.add(a(h));return f}case C2:{const{name:f,message:h}=u;return i(new Z1[f](h),o)}case M2:return i(BigInt(u),o);case"BigInt":return i(Object(BigInt(u)),o);case"ArrayBuffer":return i(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return i(new DataView(f),u)}}return i(new Z1[s](u),o)};return a},Q1=e=>DO(new Map,e)(0),Qa="",{toString:RO}={},{keys:OO}=Object,Bo=e=>{const n=typeof e;if(n!=="object"||!e)return[bf,n];const i=RO.call(e).slice(8,-1);switch(i){case"Array":return[Go,Qa];case"Object":return[Yc,Qa];case"Date":return[Pm,Qa];case"RegExp":return[Ym,Qa];case"Map":return[Xm,Qa];case"Set":return[Fm,Qa];case"DataView":return[Go,i]}return i.includes("Array")?[Go,i]:i.includes("Error")?[C2,i]:[Yc,i]},bc=([e,n])=>e===bf&&(n==="function"||n==="symbol"),LO=(e,n,i,a)=>{const o=(u,f)=>{const h=a.push(u)-1;return i.set(f,h),h},s=u=>{if(i.has(u))return i.get(u);let[f,h]=Bo(u);switch(f){case bf:{let g=u;switch(h){case"bigint":f=M2,g=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return o([N2],u)}return o([f,g],u)}case Go:{if(h){let x=u;return h==="DataView"?x=new Uint8Array(u.buffer):h==="ArrayBuffer"&&(x=new Uint8Array(u)),o([h,[...x]],u)}const g=[],m=o([f,g],u);for(const x of u)g.push(s(x));return m}case Yc:{if(h)switch(h){case"BigInt":return o([h,u.toString()],u);case"Boolean":case"Number":case"String":return o([h,u.valueOf()],u)}if(n&&"toJSON"in u)return s(u.toJSON());const g=[],m=o([f,g],u);for(const x of OO(u))(e||!bc(Bo(u[x])))&&g.push([s(x),s(u[x])]);return m}case Pm:return o([f,u.toISOString()],u);case Ym:{const{source:g,flags:m}=u;return o([f,{source:g,flags:m}],u)}case Xm:{const g=[],m=o([f,g],u);for(const[x,b]of u)(e||!(bc(Bo(x))||bc(Bo(b))))&&g.push([s(x),s(b)]);return m}case Fm:{const g=[],m=o([f,g],u);for(const x of u)(e||!bc(Bo(x)))&&g.push(s(x));return m}}const{message:d}=u;return o([f,{name:h,message:d}],u)};return s},K1=(e,{json:n,lossy:i}={})=>{const a=[];return LO(!(n||i),!!n,new Map,a)(e),a},Xc=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?Q1(K1(e,n)):structuredClone(e):(e,n)=>Q1(K1(e,n));function HO(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 BO(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function UO(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=e.options.footnoteBackContent||HO,a=e.options.footnoteBackLabel||BO,o=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[h]);if(!d)continue;const g=e.all(d),m=String(d.identifier).toUpperCase(),x=wl(m.toLowerCase());let b=0;const w=[],E=e.footnoteCounts.get(m);for(;E!==void 0&&++b<=E;){w.length>0&&w.push({type:"text",value:" "});let D=typeof i=="string"?i:i(h,b);typeof D=="string"&&(D={type:"text",value:D}),w.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+x+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,b),className:["data-footnote-backref"]},children:Array.isArray(D)?D:[D]})}const N=g[g.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const D=N.children[N.children.length-1];D&&D.type==="text"?D.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...w)}else g.push(...w);const _={type:"element",tagName:"li",properties:{id:n+"fn-"+x},children:e.wrap(g,!0)};e.patch(d,_),f.push(_)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Xc(u),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
120
127
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
121
|
-
`}]}}const vf=(function(e){if(e==null)return
|
|
128
|
+
`}]}}const vf=(function(e){if(e==null)return VO;if(typeof e=="function")return wf(e);if(typeof e=="object")return Array.isArray(e)?IO(e):qO(e);if(typeof e=="string")return $O(e);throw new Error("Expected function, string, or object as test")});function IO(e){const n=[];let i=-1;for(;++i<e.length;)n[i]=vf(e[i]);return wf(a);function a(...o){let s=-1;for(;++s<n.length;)if(n[s].apply(this,o))return!0;return!1}}function qO(e){const n=e;return wf(i);function i(a){const o=a;let s;for(s in e)if(o[s]!==n[s])return!1;return!0}}function $O(e){return wf(n);function n(i){return i&&i.type===e}}function wf(e){return n;function n(i,a,o){return!!(PO(i)&&e.call(this,i,typeof a=="number"?a:void 0,o||void 0))}}function VO(){return!0}function PO(e){return e!==null&&typeof e=="object"&&"type"in e}const T2=[],YO=!0,em=!1,XO="skip";function A2(e,n,i,a){let o;typeof n=="function"&&typeof i!="function"?(a=i,i=n):o=n;const s=vf(o),u=a?-1:1;f(e,void 0,[])();function f(h,d,g){const m=h&&typeof h=="object"?h:{};if(typeof m.type=="string"){const b=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(h.type+(b?"<"+b+">":""))+")"})}return x;function x(){let b=T2,w,E,N;if((!n||s(h,d,g[g.length-1]||void 0))&&(b=FO(i(h,g)),b[0]===em))return b;if("children"in h&&h.children){const _=h;if(_.children&&b[0]!==XO)for(E=(a?_.children.length:-1)+u,N=g.concat(_);E>-1&&E<_.children.length;){const D=_.children[E];if(w=f(D,E,N)(),w[0]===em)return w;E=typeof w[1]=="number"?w[1]:E+u}}return b}}}function FO(e){return Array.isArray(e)?e:typeof e=="number"?[YO,e]:e==null?T2:[e]}function Gm(e,n,i,a){let o,s,u;typeof n=="function"&&typeof i!="function"?(s=void 0,u=n,o=i):(s=n,u=i,o=a),A2(e,s,f,o);function f(h,d){const g=d[d.length-1],m=g?g.children.indexOf(h):void 0;return u(h,m,g)}}const tm={}.hasOwnProperty,GO={};function ZO(e,n){const i=n||GO,a=new Map,o=new Map,s=new Map,u={...jO,...i.handlers},f={all:d,applyData:KO,definitionById:a,footnoteById:o,footnoteCounts:s,footnoteOrder:[],handlers:u,one:h,options:i,patch:QO,wrap:WO};return Gm(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const m=g.type==="definition"?a:o,x=String(g.identifier).toUpperCase();m.has(x)||m.set(x,g)}}),f;function h(g,m){const x=g.type,b=f.handlers[x];if(tm.call(f.handlers,x)&&b)return b(f,g,m);if(f.options.passThrough&&f.options.passThrough.includes(x)){if("children"in g){const{children:E,...N}=g,_=Xc(N);return _.children=f.all(g),_}return Xc(g)}return(f.options.unknownHandler||JO)(f,g,m)}function d(g){const m=[];if("children"in g){const x=g.children;let b=-1;for(;++b<x.length;){const w=f.one(x[b],g);if(w){if(b&&x[b-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=J1(w.value)),!Array.isArray(w)&&w.type==="element")){const E=w.children[0];E&&E.type==="text"&&(E.value=J1(E.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function QO(e,n){e.position&&(n.position=Bj(e))}function KO(e,n){let i=n;if(e&&e.data){const a=e.data.hName,o=e.data.hChildren,s=e.data.hProperties;if(typeof a=="string")if(i.type==="element")i.tagName=a;else{const u="children"in i?i.children:[i];i={type:"element",tagName:a,properties:{},children:u}}i.type==="element"&&s&&Object.assign(i.properties,Xc(s)),"children"in i&&i.children&&o!==null&&o!==void 0&&(i.children=o)}return i}function JO(e,n){const i=n.data||{},a="value"in n&&!(tm.call(i,"hProperties")||tm.call(i,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function WO(e,n){const i=[];let a=-1;for(n&&i.push({type:"text",value:`
|
|
122
129
|
`});++a<e.length;)a&&i.push({type:"text",value:`
|
|
123
130
|
`}),i.push(e[a]);return n&&e.length>0&&i.push({type:"text",value:`
|
|
124
|
-
`}),i}function
|
|
125
|
-
`},s),o}function KO(e,n){return e&&"run"in e?async function(i,a){const s=K1(i,{file:a,...n});await e.run(s,a)}:function(i,a){return K1(i,{file:a,...e||n})}}function J1(e){if(e)throw e}var hp,W1;function JO(){if(W1)return hp;W1=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):n.call(d)==="[object Array]"},o=function(d){if(!d||n.call(d)!=="[object Object]")return!1;var g=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!g&&!m)return!1;var x;for(x in d);return typeof x>"u"||e.call(d,x)},u=function(d,g){i&&g.name==="__proto__"?i(d,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):d[g.name]=g.newValue},f=function(d,g){if(g==="__proto__")if(e.call(d,g)){if(a)return a(d,g).value}else return;return d[g]};return hp=function h(){var d,g,m,x,b,w,E=arguments[0],N=1,_=arguments.length,D=!1;for(typeof E=="boolean"&&(D=E,E=arguments[1]||{},N=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});N<_;++N)if(d=arguments[N],d!=null)for(g in d)m=f(E,g),x=f(d,g),E!==x&&(D&&x&&(o(x)||(b=s(x)))?(b?(b=!1,w=m&&s(m)?m:[]):w=m&&o(m)?m:{},u(E,{name:g,newValue:h(D,w,x)})):typeof x<"u"&&u(E,{name:g,newValue:x}));return E},hp}var WO=JO();const pp=Fc(WO);function nm(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function e6(){const e=[],n={run:i,use:a};return n;function i(...s){let o=-1;const u=s.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...s);function f(h,...d){const g=e[++o];let m=-1;if(h){u(h);return}for(;++m<s.length;)(d[m]===null||d[m]===void 0)&&(d[m]=s[m]);s=d,g?t6(g,f)(...d):u(null,...d)}}function a(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),n}}function t6(e,n){let i;return a;function a(...u){const f=e.length>u.length;let h;f&&u.push(s);try{h=e.apply(this,u)}catch(d){const g=d;if(f&&i)throw g;return s(g)}f||(h&&h.then&&typeof h.then=="function"?h.then(o,s):h instanceof Error?s(h):o(h))}function s(u,...f){i||(i=!0,n(u,...f))}function o(u){s(null,u)}}const ei={basename:n6,dirname:i6,extname:r6,join:a6,sep:"/"};function n6(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');wo(e);let i=0,a=-1,s=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){i=s+1;break}}else a<0&&(o=!0,a=s+1);return a<0?"":e.slice(i,a)}if(n===e)return"";let u=-1,f=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){i=s+1;break}}else u<0&&(o=!0,u=s+1),f>-1&&(e.codePointAt(s)===n.codePointAt(f--)?f<0&&(a=s):(f=-1,a=u));return i===a?a=u:a<0&&(a=e.length),e.slice(i,a)}function i6(e){if(wo(e),e.length===0)return".";let n=-1,i=e.length,a;for(;--i;)if(e.codePointAt(i)===47){if(a){n=i;break}}else a||(a=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function r6(e){wo(e);let n=e.length,i=-1,a=0,s=-1,o=0,u;for(;n--;){const f=e.codePointAt(n);if(f===47){if(u){a=n+1;break}continue}i<0&&(u=!0,i=n+1),f===46?s<0?s=n:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||i<0||o===0||o===1&&s===i-1&&s===a+1?"":e.slice(s,i)}function a6(...e){let n=-1,i;for(;++n<e.length;)wo(e[n]),e[n]&&(i=i===void 0?e[n]:i+"/"+e[n]);return i===void 0?".":l6(i)}function l6(e){wo(e);const n=e.codePointAt(0)===47;let i=s6(e,!n);return i.length===0&&!n&&(i="."),i.length>0&&e.codePointAt(e.length-1)===47&&(i+="/"),n?"/"+i:i}function s6(e,n){let i="",a=0,s=-1,o=0,u=-1,f,h;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(s===u-1||o===1))if(s!==u-1&&o===2){if(i.length<2||a!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(h=i.lastIndexOf("/"),h!==i.length-1){h<0?(i="",a=0):(i=i.slice(0,h),a=i.length-1-i.lastIndexOf("/")),s=u,o=0;continue}}else if(i.length>0){i="",a=0,s=u,o=0;continue}}n&&(i=i.length>0?i+"/..":"..",a=2)}else i.length>0?i+="/"+e.slice(s+1,u):i=e.slice(s+1,u),a=u-s-1;s=u,o=0}else f===46&&o>-1?o++:o=-1}return i}function wo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const o6={cwd:u6};function u6(){return"/"}function im(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function c6(e){if(typeof e=="string")e=new URL(e);else if(!im(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return f6(e)}function f6(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const n=e.pathname;let i=-1;for(;++i<n.length;)if(n.codePointAt(i)===37&&n.codePointAt(i+1)===50){const a=n.codePointAt(i+2);if(a===70||a===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(n)}const mp=["history","path","basename","stem","extname","dirname"];class z2{constructor(n){let i;n?im(n)?i={path:n}:typeof n=="string"||d6(n)?i={value:n}:i=n:i={},this.cwd="cwd"in i?"":o6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<mp.length;){const o=mp[a];o in i&&i[o]!==void 0&&i[o]!==null&&(this[o]=o==="history"?[...i[o]]:i[o])}let s;for(s in i)mp.includes(s)||(this[s]=i[s])}get basename(){return typeof this.path=="string"?ei.basename(this.path):void 0}set basename(n){yp(n,"basename"),gp(n,"basename"),this.path=ei.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?ei.dirname(this.path):void 0}set dirname(n){ev(this.basename,"dirname"),this.path=ei.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?ei.extname(this.path):void 0}set extname(n){if(gp(n,"extname"),ev(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ei.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){im(n)&&(n=c6(n)),yp(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?ei.basename(this.path,this.extname):void 0}set stem(n){yp(n,"stem"),gp(n,"stem"),this.path=ei.join(this.dirname||"",n+(this.extname||""))}fail(n,i,a){const s=this.message(n,i,a);throw s.fatal=!0,s}info(n,i,a){const s=this.message(n,i,a);return s.fatal=void 0,s}message(n,i,a){const s=new $t(n,i,a);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function gp(e,n){if(e&&e.includes(ei.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+ei.sep+"`")}function yp(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function ev(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function d6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const h6=(function(e){const a=this.constructor.prototype,s=a[e],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),p6={}.hasOwnProperty;class Fm extends h6{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=e6()}copy(){const n=new Fm;let i=-1;for(;++i<this.attachers.length;){const a=this.attachers[i];n.use(...a)}return n.data(pp(!0,{},this.namespace)),n}data(n,i){return typeof n=="string"?arguments.length===2?(vp("data",this.frozen),this.namespace[n]=i,this):p6.call(this.namespace,n)&&this.namespace[n]||void 0:n?(vp("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const s=i.call(n,...a);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const i=bc(n),a=this.parser||this.Parser;return xp("parse",a),a(String(i),i)}process(n,i){const a=this;return this.freeze(),xp("process",this.parser||this.Parser),bp("process",this.compiler||this.Compiler),i?s(void 0,i):new Promise(s);function s(o,u){const f=bc(n),h=a.parse(f);a.run(h,f,function(g,m,x){if(g||!m||!x)return d(g);const b=m,w=a.stringify(b,x);y6(w)?x.value=w:x.result=w,d(g,x)});function d(g,m){g||!m?u(g):o?o(m):i(void 0,m)}}}processSync(n){let i=!1,a;return this.freeze(),xp("processSync",this.parser||this.Parser),bp("processSync",this.compiler||this.Compiler),this.process(n,s),nv("processSync","process",i),a;function s(o,u){i=!0,J1(o),a=u}}run(n,i,a){tv(n),this.freeze();const s=this.transformers;return!a&&typeof i=="function"&&(a=i,i=void 0),a?o(void 0,a):new Promise(o);function o(u,f){const h=bc(i);s.run(n,h,d);function d(g,m,x){const b=m||n;g?f(g):u?u(b):a(void 0,b,x)}}}runSync(n,i){let a=!1,s;return this.run(n,i,o),nv("runSync","run",a),s;function o(u,f){J1(u),s=f,a=!0}}stringify(n,i){this.freeze();const a=bc(i),s=this.compiler||this.Compiler;return bp("stringify",s),tv(n),s(n,a)}use(n,...i){const a=this.attachers,s=this.namespace;if(vp("use",this.frozen),n!=null)if(typeof n=="function")h(n,i);else if(typeof n=="object")Array.isArray(n)?f(n):u(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[g,...m]=d;h(g,m)}else u(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function u(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(d.plugins),d.settings&&(s.settings=pp(!0,s.settings,d.settings))}function f(d){let g=-1;if(d!=null)if(Array.isArray(d))for(;++g<d.length;){const m=d[g];o(m)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,g){let m=-1,x=-1;for(;++m<a.length;)if(a[m][0]===d){x=m;break}if(x===-1)a.push([d,...g]);else if(g.length>0){let[b,...w]=g;const E=a[x][1];nm(E)&&nm(b)&&(b=pp(!0,E,b)),a[x]=[d,b,...w]}}}}const m6=new Fm().freeze();function xp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function bp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function vp(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function tv(e){if(!nm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function nv(e,n,i){if(!i)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function bc(e){return g6(e)?e:new z2(e)}function g6(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function y6(e){return typeof e=="string"||x6(e)}function x6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const b6="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",iv=[],rv={allowDangerousHtml:!0},v6=/^(https?|ircs?|mailto|xmpp)$/i,w6=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function av(e){const n=S6(e),i=_6(e);return k6(n.runSync(n.parse(i),i),e)}function S6(e){const n=e.rehypePlugins||iv,i=e.remarkPlugins||iv,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...rv}:rv;return m6().use(iO).use(i).use(KO,a).use(n)}function _6(e){const n=e.children||"",i=new z2;return typeof n=="string"&&(i.value=n),i}function k6(e,n){const i=n.allowedElements,a=n.allowElement,s=n.components,o=n.disallowedElements,u=n.skipHtml,f=n.unwrapDisallowed,h=n.urlTransform||E6;for(const g of w6)Object.hasOwn(n,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+b6+g.id,void 0);return Xm(e,d),Ij(e,{Fragment:v.Fragment,components:s,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function d(g,m,x){if(g.type==="raw"&&x&&typeof m=="number")return u?x.children.splice(m,1):x.children[m]={type:"text",value:g.value},m;if(g.type==="element"){let b;for(b in cp)if(Object.hasOwn(cp,b)&&Object.hasOwn(g.properties,b)){const w=g.properties[b],E=cp[b];(E===null||E.includes(g.tagName))&&(g.properties[b]=h(String(w||""),b,g))}}if(g.type==="element"){let b=i?!i.includes(g.tagName):o?o.includes(g.tagName):!1;if(!b&&a&&typeof m=="number"&&(b=!a(g,m,x)),b&&x&&typeof m=="number")return f&&g.children?x.children.splice(m,1,...g.children):x.children.splice(m,1),m}}}function E6(e){const n=e.indexOf(":"),i=e.indexOf("?"),a=e.indexOf("#"),s=e.indexOf("/");return n===-1||s!==-1&&n>s||i!==-1&&n>i||a!==-1&&n>a||v6.test(e.slice(0,n))?e:""}function lv(e,n){const i=String(e);if(typeof n!="string")throw new TypeError("Expected character");let a=0,s=i.indexOf(n);for(;s!==-1;)a++,s=i.indexOf(n,s+n.length);return a}function N6(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function C6(e,n,i){const s=vf((i||{}).ignore||[]),o=M6(n);let u=-1;for(;++u<o.length;)A2(e,"text",f);function f(d,g){let m=-1,x;for(;++m<g.length;){const b=g[m],w=x?x.children:void 0;if(s(b,w?w.indexOf(b):void 0,x))return;x=b}if(x)return h(d,g)}function h(d,g){const m=g[g.length-1],x=o[u][0],b=o[u][1];let w=0;const N=m.children.indexOf(d);let _=!1,D=[];x.lastIndex=0;let k=x.exec(d.value);for(;k;){const C=k.index,L={index:k.index,input:k.input,stack:[...g,d]};let A=b(...k,L);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?x.lastIndex=C+1:(w!==C&&D.push({type:"text",value:d.value.slice(w,C)}),Array.isArray(A)?D.push(...A):A&&D.push(A),w=C+k[0].length,_=!0),!x.global)break;k=x.exec(d.value)}return _?(w<d.value.length&&D.push({type:"text",value:d.value.slice(w)}),m.children.splice(N,1,...D)):D=[d],N+D.length}}function M6(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const i=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<i.length;){const s=i[a];n.push([T6(s[0]),A6(s[1])])}return n}function T6(e){return typeof e=="string"?new RegExp(N6(e),"g"):e}function A6(e){return typeof e=="function"?e:function(){return e}}const wp="phrasing",Sp=["autolink","link","image","label"];function z6(){return{transforms:[B6],enter:{literalAutolink:D6,literalAutolinkEmail:_p,literalAutolinkHttp:_p,literalAutolinkWww:_p},exit:{literalAutolink:H6,literalAutolinkEmail:L6,literalAutolinkHttp:R6,literalAutolinkWww:O6}}}function j6(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:wp,notInConstruct:Sp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:wp,notInConstruct:Sp},{character:":",before:"[ps]",after:"\\/",inConstruct:wp,notInConstruct:Sp}]}}function D6(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function _p(e){this.config.enter.autolinkProtocol.call(this,e)}function R6(e){this.config.exit.autolinkProtocol.call(this,e)}function O6(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function L6(e){this.config.exit.autolinkEmail.call(this,e)}function H6(e){this.exit(e)}function B6(e){C6(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,U6],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),I6]],{ignore:["link","linkReference"]})}function U6(e,n,i,a,s){let o="";if(!j2(s)||(/^w/i.test(n)&&(i=n+i,n="",o="http://"),!q6(i)))return!1;const u=$6(i+a);if(!u[0])return!1;const f={type:"link",title:null,url:o+n+u[0],children:[{type:"text",value:n+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function I6(e,n,i,a){return!j2(a,!0)||/[-\d_]$/.test(i)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+i,children:[{type:"text",value:n+"@"+i}]}}function q6(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function $6(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let i=n[0],a=i.indexOf(")");const s=lv(e,"(");let o=lv(e,")");for(;a!==-1&&s>o;)e+=i.slice(0,a+1),i=i.slice(a+1),a=i.indexOf(")"),o++;return[e,i]}function j2(e,n){const i=e.input.charCodeAt(e.index-1);return(e.index===0||ia(i)||yf(i))&&(!n||i!==47)}D2.peek=K6;function V6(){this.buffer()}function P6(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Y6(){this.buffer()}function X6(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function F6(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Yn(this.sliceSerialize(e)).toLowerCase(),i.label=n}function G6(e){this.exit(e)}function Z6(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Yn(this.sliceSerialize(e)).toLowerCase(),i.label=n}function Q6(e){this.exit(e)}function K6(){return"["}function D2(e,n,i,a){const s=i.createTracker(a);let o=s.move("[^");const u=i.enter("footnoteReference"),f=i.enter("reference");return o+=s.move(i.safe(i.associationId(e),{after:"]",before:o})),f(),u(),o+=s.move("]"),o}function J6(){return{enter:{gfmFootnoteCallString:V6,gfmFootnoteCall:P6,gfmFootnoteDefinitionLabelString:Y6,gfmFootnoteDefinition:X6},exit:{gfmFootnoteCallString:F6,gfmFootnoteCall:G6,gfmFootnoteDefinitionLabelString:Z6,gfmFootnoteDefinition:Q6}}}function W6(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:i,footnoteReference:D2},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function i(a,s,o,u){const f=o.createTracker(u);let h=f.move("[^");const d=o.enter("footnoteDefinition"),g=o.enter("label");return h+=f.move(o.safe(o.associationId(a),{before:h,after:"]"})),g(),h+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),h+=f.move((n?`
|
|
126
|
-
`:" ")+
|
|
127
|
-
`)}function
|
|
128
|
-
`&&
|
|
129
|
-
`}function
|
|
131
|
+
`}),i}function J1(e){let n=0,i=e.charCodeAt(n);for(;i===9||i===32;)n++,i=e.charCodeAt(n);return e.slice(n)}function W1(e,n){const i=ZO(e,n),a=i.one(e,void 0),o=UO(i),s=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
|
|
132
|
+
`},o),s}function e6(e,n){return e&&"run"in e?async function(i,a){const o=W1(i,{file:a,...n});await e.run(o,a)}:function(i,a){return W1(i,{file:a,...e||n})}}function ev(e){if(e)throw e}var hp,tv;function t6(){if(tv)return hp;tv=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,a=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)},u=function(d,g){i&&g.name==="__proto__"?i(d,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):d[g.name]=g.newValue},f=function(d,g){if(g==="__proto__")if(e.call(d,g)){if(a)return a(d,g).value}else return;return d[g]};return hp=function h(){var d,g,m,x,b,w,E=arguments[0],N=1,_=arguments.length,D=!1;for(typeof E=="boolean"&&(D=E,E=arguments[1]||{},N=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});N<_;++N)if(d=arguments[N],d!=null)for(g in d)m=f(E,g),x=f(d,g),E!==x&&(D&&x&&(s(x)||(b=o(x)))?(b?(b=!1,w=m&&o(m)?m:[]):w=m&&s(m)?m:{},u(E,{name:g,newValue:h(D,w,x)})):typeof x<"u"&&u(E,{name:g,newValue:x}));return E},hp}var n6=t6();const pp=Gc(n6);function nm(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function i6(){const e=[],n={run:i,use:a};return n;function i(...o){let s=-1;const u=o.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...o);function f(h,...d){const g=e[++s];let m=-1;if(h){u(h);return}for(;++m<o.length;)(d[m]===null||d[m]===void 0)&&(d[m]=o[m]);o=d,g?r6(g,f)(...d):u(null,...d)}}function a(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),n}}function r6(e,n){let i;return a;function a(...u){const f=e.length>u.length;let h;f&&u.push(o);try{h=e.apply(this,u)}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(u,...f){i||(i=!0,n(u,...f))}function s(u){o(null,u)}}const ei={basename:a6,dirname:l6,extname:o6,join:s6,sep:"/"};function a6(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Ss(e);let i=0,a=-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 a<0&&(s=!0,a=o+1);return a<0?"":e.slice(i,a)}if(n===e)return"";let u=-1,f=n.length-1;for(;o--;)if(e.codePointAt(o)===47){if(s){i=o+1;break}}else u<0&&(s=!0,u=o+1),f>-1&&(e.codePointAt(o)===n.codePointAt(f--)?f<0&&(a=o):(f=-1,a=u));return i===a?a=u:a<0&&(a=e.length),e.slice(i,a)}function l6(e){if(Ss(e),e.length===0)return".";let n=-1,i=e.length,a;for(;--i;)if(e.codePointAt(i)===47){if(a){n=i;break}}else a||(a=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function o6(e){Ss(e);let n=e.length,i=-1,a=0,o=-1,s=0,u;for(;n--;){const f=e.codePointAt(n);if(f===47){if(u){a=n+1;break}continue}i<0&&(u=!0,i=n+1),f===46?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===a+1?"":e.slice(o,i)}function s6(...e){let n=-1,i;for(;++n<e.length;)Ss(e[n]),e[n]&&(i=i===void 0?e[n]:i+"/"+e[n]);return i===void 0?".":u6(i)}function u6(e){Ss(e);const n=e.codePointAt(0)===47;let i=c6(e,!n);return i.length===0&&!n&&(i="."),i.length>0&&e.codePointAt(e.length-1)===47&&(i+="/"),n?"/"+i:i}function c6(e,n){let i="",a=0,o=-1,s=0,u=-1,f,h;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(o===u-1||s===1))if(o!==u-1&&s===2){if(i.length<2||a!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(h=i.lastIndexOf("/"),h!==i.length-1){h<0?(i="",a=0):(i=i.slice(0,h),a=i.length-1-i.lastIndexOf("/")),o=u,s=0;continue}}else if(i.length>0){i="",a=0,o=u,s=0;continue}}n&&(i=i.length>0?i+"/..":"..",a=2)}else i.length>0?i+="/"+e.slice(o+1,u):i=e.slice(o+1,u),a=u-o-1;o=u,s=0}else f===46&&s>-1?s++:s=-1}return i}function Ss(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const f6={cwd:d6};function d6(){return"/"}function im(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function h6(e){if(typeof e=="string")e=new URL(e);else if(!im(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return p6(e)}function p6(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const n=e.pathname;let i=-1;for(;++i<n.length;)if(n.codePointAt(i)===37&&n.codePointAt(i+1)===50){const a=n.codePointAt(i+2);if(a===70||a===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(n)}const mp=["history","path","basename","stem","extname","dirname"];class z2{constructor(n){let i;n?im(n)?i={path:n}:typeof n=="string"||m6(n)?i={value:n}:i=n:i={},this.cwd="cwd"in i?"":f6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<mp.length;){const s=mp[a];s in i&&i[s]!==void 0&&i[s]!==null&&(this[s]=s==="history"?[...i[s]]:i[s])}let o;for(o in i)mp.includes(o)||(this[o]=i[o])}get basename(){return typeof this.path=="string"?ei.basename(this.path):void 0}set basename(n){yp(n,"basename"),gp(n,"basename"),this.path=ei.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?ei.dirname(this.path):void 0}set dirname(n){nv(this.basename,"dirname"),this.path=ei.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?ei.extname(this.path):void 0}set extname(n){if(gp(n,"extname"),nv(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ei.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){im(n)&&(n=h6(n)),yp(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?ei.basename(this.path,this.extname):void 0}set stem(n){yp(n,"stem"),gp(n,"stem"),this.path=ei.join(this.dirname||"",n+(this.extname||""))}fail(n,i,a){const o=this.message(n,i,a);throw o.fatal=!0,o}info(n,i,a){const o=this.message(n,i,a);return o.fatal=void 0,o}message(n,i,a){const o=new $t(n,i,a);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 gp(e,n){if(e&&e.includes(ei.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+ei.sep+"`")}function yp(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function nv(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function m6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const g6=(function(e){const a=this.constructor.prototype,o=a[e],s=function(){return o.apply(s,arguments)};return Object.setPrototypeOf(s,a),s}),y6={}.hasOwnProperty;class Zm extends g6{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=i6()}copy(){const n=new Zm;let i=-1;for(;++i<this.attachers.length;){const a=this.attachers[i];n.use(...a)}return n.data(pp(!0,{},this.namespace)),n}data(n,i){return typeof n=="string"?arguments.length===2?(vp("data",this.frozen),this.namespace[n]=i,this):y6.call(this.namespace,n)&&this.namespace[n]||void 0:n?(vp("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const o=i.call(n,...a);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const i=vc(n),a=this.parser||this.Parser;return xp("parse",a),a(String(i),i)}process(n,i){const a=this;return this.freeze(),xp("process",this.parser||this.Parser),bp("process",this.compiler||this.Compiler),i?o(void 0,i):new Promise(o);function o(s,u){const f=vc(n),h=a.parse(f);a.run(h,f,function(g,m,x){if(g||!m||!x)return d(g);const b=m,w=a.stringify(b,x);v6(w)?x.value=w:x.result=w,d(g,x)});function d(g,m){g||!m?u(g):s?s(m):i(void 0,m)}}}processSync(n){let i=!1,a;return this.freeze(),xp("processSync",this.parser||this.Parser),bp("processSync",this.compiler||this.Compiler),this.process(n,o),rv("processSync","process",i),a;function o(s,u){i=!0,ev(s),a=u}}run(n,i,a){iv(n),this.freeze();const o=this.transformers;return!a&&typeof i=="function"&&(a=i,i=void 0),a?s(void 0,a):new Promise(s);function s(u,f){const h=vc(i);o.run(n,h,d);function d(g,m,x){const b=m||n;g?f(g):u?u(b):a(void 0,b,x)}}}runSync(n,i){let a=!1,o;return this.run(n,i,s),rv("runSync","run",a),o;function s(u,f){ev(u),o=f,a=!0}}stringify(n,i){this.freeze();const a=vc(i),o=this.compiler||this.Compiler;return bp("stringify",o),iv(n),o(n,a)}use(n,...i){const a=this.attachers,o=this.namespace;if(vp("use",this.frozen),n!=null)if(typeof n=="function")h(n,i);else if(typeof n=="object")Array.isArray(n)?f(n):u(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function 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 u(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function u(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(d.plugins),d.settings&&(o.settings=pp(!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<a.length;)if(a[m][0]===d){x=m;break}if(x===-1)a.push([d,...g]);else if(g.length>0){let[b,...w]=g;const E=a[x][1];nm(E)&&nm(b)&&(b=pp(!0,E,b)),a[x]=[d,b,...w]}}}}const x6=new Zm().freeze();function xp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function bp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function vp(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function iv(e){if(!nm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function rv(e,n,i){if(!i)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function vc(e){return b6(e)?e:new z2(e)}function b6(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function v6(e){return typeof e=="string"||w6(e)}function w6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const S6="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",av=[],lv={allowDangerousHtml:!0},_6=/^(https?|ircs?|mailto|xmpp)$/i,k6=[{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 ov(e){const n=E6(e),i=N6(e);return C6(n.runSync(n.parse(i),i),e)}function E6(e){const n=e.rehypePlugins||av,i=e.remarkPlugins||av,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...lv}:lv;return x6().use(lO).use(i).use(e6,a).use(n)}function N6(e){const n=e.children||"",i=new z2;return typeof n=="string"&&(i.value=n),i}function C6(e,n){const i=n.allowedElements,a=n.allowElement,o=n.components,s=n.disallowedElements,u=n.skipHtml,f=n.unwrapDisallowed,h=n.urlTransform||M6;for(const g of k6)Object.hasOwn(n,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+S6+g.id,void 0);return Gm(e,d),Vj(e,{Fragment:v.Fragment,components:o,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function d(g,m,x){if(g.type==="raw"&&x&&typeof m=="number")return u?x.children.splice(m,1):x.children[m]={type:"text",value:g.value},m;if(g.type==="element"){let b;for(b in cp)if(Object.hasOwn(cp,b)&&Object.hasOwn(g.properties,b)){const w=g.properties[b],E=cp[b];(E===null||E.includes(g.tagName))&&(g.properties[b]=h(String(w||""),b,g))}}if(g.type==="element"){let b=i?!i.includes(g.tagName):s?s.includes(g.tagName):!1;if(!b&&a&&typeof m=="number"&&(b=!a(g,m,x)),b&&x&&typeof m=="number")return f&&g.children?x.children.splice(m,1,...g.children):x.children.splice(m,1),m}}}function M6(e){const n=e.indexOf(":"),i=e.indexOf("?"),a=e.indexOf("#"),o=e.indexOf("/");return n===-1||o!==-1&&n>o||i!==-1&&n>i||a!==-1&&n>a||_6.test(e.slice(0,n))?e:""}function sv(e,n){const i=String(e);if(typeof n!="string")throw new TypeError("Expected character");let a=0,o=i.indexOf(n);for(;o!==-1;)a++,o=i.indexOf(n,o+n.length);return a}function T6(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function A6(e,n,i){const o=vf((i||{}).ignore||[]),s=z6(n);let u=-1;for(;++u<s.length;)A2(e,"text",f);function f(d,g){let m=-1,x;for(;++m<g.length;){const b=g[m],w=x?x.children:void 0;if(o(b,w?w.indexOf(b):void 0,x))return;x=b}if(x)return h(d,g)}function h(d,g){const m=g[g.length-1],x=s[u][0],b=s[u][1];let w=0;const N=m.children.indexOf(d);let _=!1,D=[];x.lastIndex=0;let k=x.exec(d.value);for(;k;){const C=k.index,L={index:k.index,input:k.input,stack:[...g,d]};let A=b(...k,L);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?x.lastIndex=C+1:(w!==C&&D.push({type:"text",value:d.value.slice(w,C)}),Array.isArray(A)?D.push(...A):A&&D.push(A),w=C+k[0].length,_=!0),!x.global)break;k=x.exec(d.value)}return _?(w<d.value.length&&D.push({type:"text",value:d.value.slice(w)}),m.children.splice(N,1,...D)):D=[d],N+D.length}}function z6(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const i=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<i.length;){const o=i[a];n.push([j6(o[0]),D6(o[1])])}return n}function j6(e){return typeof e=="string"?new RegExp(T6(e),"g"):e}function D6(e){return typeof e=="function"?e:function(){return e}}const wp="phrasing",Sp=["autolink","link","image","label"];function R6(){return{transforms:[q6],enter:{literalAutolink:L6,literalAutolinkEmail:_p,literalAutolinkHttp:_p,literalAutolinkWww:_p},exit:{literalAutolink:I6,literalAutolinkEmail:U6,literalAutolinkHttp:H6,literalAutolinkWww:B6}}}function O6(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:wp,notInConstruct:Sp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:wp,notInConstruct:Sp},{character:":",before:"[ps]",after:"\\/",inConstruct:wp,notInConstruct:Sp}]}}function L6(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function _p(e){this.config.enter.autolinkProtocol.call(this,e)}function H6(e){this.config.exit.autolinkProtocol.call(this,e)}function B6(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 U6(e){this.config.exit.autolinkEmail.call(this,e)}function I6(e){this.exit(e)}function q6(e){A6(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$6],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),V6]],{ignore:["link","linkReference"]})}function $6(e,n,i,a,o){let s="";if(!j2(o)||(/^w/i.test(n)&&(i=n+i,n="",s="http://"),!P6(i)))return!1;const u=Y6(i+a);if(!u[0])return!1;const f={type:"link",title:null,url:s+n+u[0],children:[{type:"text",value:n+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function V6(e,n,i,a){return!j2(a,!0)||/[-\d_]$/.test(i)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+i,children:[{type:"text",value:n+"@"+i}]}}function P6(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 Y6(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let i=n[0],a=i.indexOf(")");const o=sv(e,"(");let s=sv(e,")");for(;a!==-1&&o>s;)e+=i.slice(0,a+1),i=i.slice(a+1),a=i.indexOf(")"),s++;return[e,i]}function j2(e,n){const i=e.input.charCodeAt(e.index-1);return(e.index===0||ia(i)||yf(i))&&(!n||i!==47)}D2.peek=e8;function X6(){this.buffer()}function F6(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function G6(){this.buffer()}function Z6(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Q6(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Yn(this.sliceSerialize(e)).toLowerCase(),i.label=n}function K6(e){this.exit(e)}function J6(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Yn(this.sliceSerialize(e)).toLowerCase(),i.label=n}function W6(e){this.exit(e)}function e8(){return"["}function D2(e,n,i,a){const o=i.createTracker(a);let s=o.move("[^");const u=i.enter("footnoteReference"),f=i.enter("reference");return s+=o.move(i.safe(i.associationId(e),{after:"]",before:s})),f(),u(),s+=o.move("]"),s}function t8(){return{enter:{gfmFootnoteCallString:X6,gfmFootnoteCall:F6,gfmFootnoteDefinitionLabelString:G6,gfmFootnoteDefinition:Z6},exit:{gfmFootnoteCallString:Q6,gfmFootnoteCall:K6,gfmFootnoteDefinitionLabelString:J6,gfmFootnoteDefinition:W6}}}function n8(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:i,footnoteReference:D2},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function i(a,o,s,u){const f=s.createTracker(u);let h=f.move("[^");const d=s.enter("footnoteDefinition"),g=s.enter("label");return h+=f.move(s.safe(s.associationId(a),{before:h,after:"]"})),g(),h+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),h+=f.move((n?`
|
|
133
|
+
`:" ")+s.indentLines(s.containerFlow(a,f.current()),n?R2:i8))),d(),h}}function i8(e,n,i){return n===0?e:R2(e,n,i)}function R2(e,n,i){return(i?"":" ")+e}const r8=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];O2.peek=u8;function a8(){return{canContainEols:["delete"],enter:{strikethrough:o8},exit:{strikethrough:s8}}}function l8(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:r8}],handlers:{delete:O2}}}function o8(e){this.enter({type:"delete",children:[]},e)}function s8(e){this.exit(e)}function O2(e,n,i,a){const o=i.createTracker(a),s=i.enter("strikethrough");let u=o.move("~~");return u+=i.containerPhrasing(e,{...o.current(),before:u,after:"~"}),u+=o.move("~~"),s(),u}function u8(){return"~"}function c8(e){return e.length}function f8(e,n){const i=n||{},a=(i.align||[]).concat(),o=i.stringLength||c8,s=[],u=[],f=[],h=[];let d=0,g=-1;for(;++g<e.length;){const E=[],N=[];let _=-1;for(e[g].length>d&&(d=e[g].length);++_<e[g].length;){const D=d8(e[g][_]);if(i.alignDelimiters!==!1){const k=o(D);N[_]=k,(h[_]===void 0||k>h[_])&&(h[_]=k)}E.push(D)}u[g]=E,f[g]=N}let m=-1;if(typeof a=="object"&&"length"in a)for(;++m<d;)s[m]=uv(a[m]);else{const E=uv(a);for(;++m<d;)s[m]=E}m=-1;const x=[],b=[];for(;++m<d;){const E=s[m];let N="",_="";E===99?(N=":",_=":"):E===108?N=":":E===114&&(_=":");let D=i.alignDelimiters===!1?1:Math.max(1,h[m]-N.length-_.length);const k=N+"-".repeat(D)+_;i.alignDelimiters!==!1&&(D=N.length+D+_.length,D>h[m]&&(h[m]=D),b[m]=D),x[m]=k}u.splice(1,0,x),f.splice(1,0,b),g=-1;const w=[];for(;++g<u.length;){const E=u[g],N=f[g];m=-1;const _=[];for(;++m<d;){const D=E[m]||"";let k="",C="";if(i.alignDelimiters!==!1){const L=h[m]-(N[m]||0),A=s[m];A===114?k=" ".repeat(L):A===99?L%2?(k=" ".repeat(L/2+.5),C=" ".repeat(L/2-.5)):(k=" ".repeat(L/2),C=k):C=" ".repeat(L)}i.delimiterStart!==!1&&!m&&_.push("|"),i.padding!==!1&&!(i.alignDelimiters===!1&&D==="")&&(i.delimiterStart!==!1||m)&&_.push(" "),i.alignDelimiters!==!1&&_.push(k),_.push(D),i.alignDelimiters!==!1&&_.push(C),i.padding!==!1&&_.push(" "),(i.delimiterEnd!==!1||m!==d-1)&&_.push("|")}w.push(i.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return w.join(`
|
|
134
|
+
`)}function d8(e){return e==null?"":String(e)}function uv(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 h8(e,n,i,a){const o=i.enter("blockquote"),s=i.createTracker(a);s.move("> "),s.shift(2);const u=i.indentLines(i.containerFlow(e,s.current()),p8);return o(),u}function p8(e,n,i){return">"+(i?"":" ")+e}function m8(e,n){return cv(e,n.inConstruct,!0)&&!cv(e,n.notInConstruct,!1)}function cv(e,n,i){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return i;let a=-1;for(;++a<n.length;)if(e.includes(n[a]))return!0;return!1}function fv(e,n,i,a){let o=-1;for(;++o<i.unsafe.length;)if(i.unsafe[o].character===`
|
|
135
|
+
`&&m8(i.stack,i.unsafe[o]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
136
|
+
`}function g8(e,n){const i=String(e);let a=i.indexOf(n),o=a,s=0,u=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===o?++s>u&&(u=s):s=1,o=a+n.length,a=i.indexOf(n,o);return u}function y8(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 x8(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 b8(e,n,i,a){const o=x8(i),s=e.value||"",u=o==="`"?"GraveAccent":"Tilde";if(y8(e,i)){const m=i.enter("codeIndented"),x=i.indentLines(s,v8);return m(),x}const f=i.createTracker(a),h=o.repeat(Math.max(g8(s,o)+1,3)),d=i.enter("codeFenced");let g=f.move(h);if(e.lang){const m=i.enter(`codeFencedLang${u}`);g+=f.move(i.safe(e.lang,{before:g,after:" ",encode:["`"],...f.current()})),m()}if(e.lang&&e.meta){const m=i.enter(`codeFencedMeta${u}`);g+=f.move(" "),g+=f.move(i.safe(e.meta,{before:g,after:`
|
|
130
137
|
`,encode:["`"],...f.current()})),m()}return g+=f.move(`
|
|
131
|
-
`),
|
|
132
|
-
`)),g+=f.move(h),d(),g}function
|
|
133
|
-
`,...h.current()}))),f(),e.title&&(f=i.enter(`title${
|
|
138
|
+
`),s&&(g+=f.move(s+`
|
|
139
|
+
`)),g+=f.move(h),d(),g}function v8(e,n,i){return(i?"":" ")+e}function Qm(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 w8(e,n,i,a){const o=Qm(i),s=o==='"'?"Quote":"Apostrophe",u=i.enter("definition");let f=i.enter("label");const h=i.createTracker(a);let d=h.move("[");return d+=h.move(i.safe(i.associationId(e),{before:d,after:"]",...h.current()})),d+=h.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=i.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(i.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(f=i.enter("destinationRaw"),d+=h.move(i.safe(e.url,{before:d,after:e.title?" ":`
|
|
140
|
+
`,...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()),u(),d}function S8(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 os(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Fc(e,n,i){const a=gl(e),o=gl(n);return a===void 0?o===void 0?i==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===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}}L2.peek=_8;function L2(e,n,i,a){const o=S8(i),s=i.enter("emphasis"),u=i.createTracker(a),f=u.move(o);let h=u.move(i.containerPhrasing(e,{after:o,before:f,...u.current()}));const d=h.charCodeAt(0),g=Fc(a.before.charCodeAt(a.before.length-1),d,o);g.inside&&(h=os(d)+h.slice(1));const m=h.charCodeAt(h.length-1),x=Fc(a.after.charCodeAt(0),m,o);x.inside&&(h=h.slice(0,-1)+os(m));const b=u.move(o);return s(),i.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},f+h+b}function _8(e,n,i){return i.options.emphasis||"*"}function k8(e,n){let i=!1;return Gm(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return i=!0,em}),!!((!e.depth||e.depth<3)&&qm(e)&&(n.options.setext||i))}function E8(e,n,i,a){const o=Math.max(Math.min(6,e.depth||1),1),s=i.createTracker(a);if(k8(e,i)){const g=i.enter("headingSetext"),m=i.enter("phrasing"),x=i.containerPhrasing(e,{...s.current(),before:`
|
|
134
141
|
`,after:`
|
|
135
142
|
`});return m(),g(),x+`
|
|
136
|
-
`+(
|
|
137
|
-
`))+1))}const u="#".repeat(
|
|
138
|
-
`,...
|
|
143
|
+
`+(o===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
144
|
+
`))+1))}const u="#".repeat(o),f=i.enter("headingAtx"),h=i.enter("phrasing");s.move(u+" ");let d=i.containerPhrasing(e,{before:"# ",after:`
|
|
145
|
+
`,...s.current()});return/^[\t ]/.test(d)&&(d=os(d.charCodeAt(0))+d.slice(1)),d=d?u+" "+d:u,i.options.closeAtx&&(d+=" "+u),h(),f(),d}H2.peek=N8;function H2(e){return e.value||""}function N8(){return"<"}B2.peek=C8;function B2(e,n,i,a){const o=Qm(i),s=o==='"'?"Quote":"Apostrophe",u=i.enter("image");let f=i.enter("label");const h=i.createTracker(a);let d=h.move("![");return d+=h.move(i.safe(e.alt,{before:d,after:"]",...h.current()})),d+=h.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=i.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(i.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(f=i.enter("destinationRaw"),d+=h.move(i.safe(e.url,{before:d,after:e.title?" ":")",...h.current()}))),f(),e.title&&(f=i.enter(`title${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(")"),u(),d}function C8(){return"!"}U2.peek=M8;function U2(e,n,i,a){const o=e.referenceType,s=i.enter("imageReference");let u=i.enter("label");const f=i.createTracker(a);let h=f.move("![");const d=i.safe(e.alt,{before:h,after:"]",...f.current()});h+=f.move(d+"]["),u();const g=i.stack;i.stack=[],u=i.enter("reference");const m=i.safe(i.associationId(e),{before:h,after:"]",...f.current()});return u(),i.stack=g,s(),o==="full"||!d||d!==m?h+=f.move(m+"]"):o==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function M8(){return"!"}I2.peek=T8;function I2(e,n,i){let a=e.value||"",o="`",s=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(a);)o+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++s<i.unsafe.length;){const u=i.unsafe[s],f=i.compilePattern(u);let h;if(u.atBreak)for(;h=f.exec(a);){let d=h.index;a.charCodeAt(d)===10&&a.charCodeAt(d-1)===13&&d--,a=a.slice(0,d)+" "+a.slice(h.index+1)}}return o+a+o}function T8(){return"`"}function q2(e,n){const i=qm(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(i===e.url||"mailto:"+i===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}$2.peek=A8;function $2(e,n,i,a){const o=Qm(i),s=o==='"'?"Quote":"Apostrophe",u=i.createTracker(a);let f,h;if(q2(e,i)){const g=i.stack;i.stack=[],f=i.enter("autolink");let m=u.move("<");return m+=u.move(i.containerPhrasing(e,{before:m,after:">",...u.current()})),m+=u.move(">"),f(),i.stack=g,m}f=i.enter("link"),h=i.enter("label");let d=u.move("[");return d+=u.move(i.containerPhrasing(e,{before:d,after:"](",...u.current()})),d+=u.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=i.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(i.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(h=i.enter("destinationRaw"),d+=u.move(i.safe(e.url,{before:d,after:e.title?" ":")",...u.current()}))),h(),e.title&&(h=i.enter(`title${s}`),d+=u.move(" "+o),d+=u.move(i.safe(e.title,{before:d,after:o,...u.current()})),d+=u.move(o),h()),d+=u.move(")"),f(),d}function A8(e,n,i){return q2(e,i)?"<":"["}V2.peek=z8;function V2(e,n,i,a){const o=e.referenceType,s=i.enter("linkReference");let u=i.enter("label");const f=i.createTracker(a);let h=f.move("[");const d=i.containerPhrasing(e,{before:h,after:"]",...f.current()});h+=f.move(d+"]["),u();const g=i.stack;i.stack=[],u=i.enter("reference");const m=i.safe(i.associationId(e),{before:h,after:"]",...f.current()});return u(),i.stack=g,s(),o==="full"||!d||d!==m?h+=f.move(m+"]"):o==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function z8(){return"["}function Km(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 j8(e){const n=Km(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 D8(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function P2(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function R8(e,n,i,a){const o=i.enter("list"),s=i.bulletCurrent;let u=e.ordered?D8(i):Km(i);const f=e.ordered?u==="."?")":".":j8(i);let h=n&&i.bulletLastUsed?u===i.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&g&&(!g.children||!g.children[0])&&i.stack[i.stack.length-1]==="list"&&i.stack[i.stack.length-2]==="listItem"&&i.stack[i.stack.length-3]==="list"&&i.stack[i.stack.length-4]==="listItem"&&i.indexStack[i.indexStack.length-1]===0&&i.indexStack[i.indexStack.length-2]===0&&i.indexStack[i.indexStack.length-3]===0&&(h=!0),P2(i)===u&&g){let m=-1;for(;++m<e.children.length;){const x=e.children[m];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(u=f),i.bulletCurrent=u;const d=i.containerFlow(e,a);return i.bulletLastUsed=u,i.bulletCurrent=s,o(),d}function O8(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 L8(e,n,i,a){const o=O8(i);let s=i.bulletCurrent||Km(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 u=s.length+1;(o==="tab"||o==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=i.createTracker(a);f.move(s+" ".repeat(u-s.length)),f.shift(u);const h=i.enter("listItem"),d=i.indentLines(i.containerFlow(e,f.current()),g);return h(),d;function g(m,x,b){return x?(b?"":" ".repeat(u))+m:(b?s:s+" ".repeat(u-s.length))+m}}function H8(e,n,i,a){const o=i.enter("paragraph"),s=i.enter("phrasing"),u=i.containerPhrasing(e,a);return s(),o(),u}const B8=vf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function U8(e,n,i,a){return(e.children.some(function(u){return B8(u)})?i.containerPhrasing:i.containerFlow).call(i,e,a)}function I8(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Y2.peek=q8;function Y2(e,n,i,a){const o=I8(i),s=i.enter("strong"),u=i.createTracker(a),f=u.move(o+o);let h=u.move(i.containerPhrasing(e,{after:o,before:f,...u.current()}));const d=h.charCodeAt(0),g=Fc(a.before.charCodeAt(a.before.length-1),d,o);g.inside&&(h=os(d)+h.slice(1));const m=h.charCodeAt(h.length-1),x=Fc(a.after.charCodeAt(0),m,o);x.inside&&(h=h.slice(0,-1)+os(m));const b=u.move(o+o);return s(),i.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},f+h+b}function q8(e,n,i){return i.options.strong||"*"}function $8(e,n,i,a){return i.safe(e.value,a)}function V8(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 P8(e,n,i){const a=(P2(i)+(i.options.ruleSpaces?" ":"")).repeat(V8(i));return i.options.ruleSpaces?a.slice(0,-1):a}const X2={blockquote:h8,break:fv,code:b8,definition:w8,emphasis:L2,hardBreak:fv,heading:E8,html:H2,image:B2,imageReference:U2,inlineCode:I2,link:$2,linkReference:V2,list:R8,listItem:L8,paragraph:H8,root:U8,strong:Y2,text:$8,thematicBreak:P8};function Y8(){return{enter:{table:X8,tableData:dv,tableHeader:dv,tableRow:G8},exit:{codeText:Z8,table:F8,tableData:kp,tableHeader:kp,tableRow:kp}}}function X8(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 F8(e){this.exit(e),this.data.inTable=void 0}function G8(e){this.enter({type:"tableRow",children:[]},e)}function kp(e){this.exit(e)}function dv(e){this.enter({type:"tableCell",children:[]},e)}function Z8(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,Q8));const i=this.stack[this.stack.length-1];i.type,i.value=n,this.exit(e)}function Q8(e,n){return n==="|"?n:e}function K8(e){const n=e||{},i=n.tableCellPadding,a=n.tablePipeAlign,o=n.stringLength,s=i?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
139
146
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:u,tableCell:h,tableRow:f}};function u(b,w,E,N){return d(g(b,E,N),b.align)}function f(b,w,E,N){const _=m(b,E,N),D=d([_]);return D.slice(0,D.indexOf(`
|
|
140
|
-
`))}function h(b,w,E,N){const _=E.enter("tableCell"),D=E.enter("phrasing"),k=E.containerPhrasing(b,{...N,before:o,after:o});return D(),_(),k}function d(b,w){return o8(b,{align:w,alignDelimiters:a,padding:i,stringLength:s})}function g(b,w,E){const N=b.children;let _=-1;const D=[],k=w.enter("table");for(;++_<N.length;)D[_]=m(N[_],w,E);return k(),D}function m(b,w,E){const N=b.children;let _=-1;const D=[],k=w.enter("tableRow");for(;++_<N.length;)D[_]=h(N[_],b,w,E);return k(),D}function x(b,w,E){let N=X2.inlineCode(b,w,E);return E.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function Z8(){return{exit:{taskListCheckValueChecked:fv,taskListCheckValueUnchecked:fv,paragraph:K8}}}function Q8(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:J8}}}function fv(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function K8(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const i=this.stack[this.stack.length-1];i.type;const a=i.children[0];if(a&&a.type==="text"){const s=n.children;let o=-1,u;for(;++o<s.length;){const f=s[o];if(f.type==="paragraph"){u=f;break}}u===i&&(a.value=a.value.slice(1),a.value.length===0?i.children.shift():i.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,i.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function J8(e,n,i,a){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=i.createTracker(a);o&&f.move(u);let h=X2.listItem(e,n,i,{...a,...f.current()});return o&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),h;function d(g){return g+u}}function W8(){return[z6(),J6(),n8(),$8(),Z8()]}function eL(e){return{extensions:[j6(),W6(e),i8(),G8(e),Q8()]}}const tL={tokenize:sL,partial:!0},F2={tokenize:oL,partial:!0},G2={tokenize:uL,partial:!0},Z2={tokenize:cL,partial:!0},nL={tokenize:fL,partial:!0},Q2={name:"wwwAutolink",tokenize:aL,previous:J2},K2={name:"protocolAutolink",tokenize:lL,previous:W2},Ui={name:"emailAutolink",tokenize:rL,previous:e_},li={};function iL(){return{text:li}}let Fr=48;for(;Fr<123;)li[Fr]=Ui,Fr++,Fr===58?Fr=65:Fr===91&&(Fr=97);li[43]=Ui;li[45]=Ui;li[46]=Ui;li[95]=Ui;li[72]=[Ui,K2];li[104]=[Ui,K2];li[87]=[Ui,Q2];li[119]=[Ui,Q2];function rL(e,n,i){const a=this;let s,o;return u;function u(m){return!rm(m)||!e_.call(a,a.previous)||Qm(a.events)?i(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(m))}function f(m){return rm(m)?(e.consume(m),f):m===64?(e.consume(m),h):i(m)}function h(m){return m===46?e.check(nL,g,d)(m):m===45||m===95||It(m)?(o=!0,e.consume(m),h):g(m)}function d(m){return e.consume(m),s=!0,h}function g(m){return o&&s&&Ft(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(m)):i(m)}}function aL(e,n,i){const a=this;return s;function s(u){return u!==87&&u!==119||!J2.call(a,a.previous)||Qm(a.events)?i(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(tL,e.attempt(F2,e.attempt(G2,o),i),i)(u))}function o(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(u)}}function lL(e,n,i){const a=this;let s="",o=!1;return u;function u(m){return(m===72||m===104)&&W2.call(a,a.previous)&&!Qm(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(m),e.consume(m),f):i(m)}function f(m){if(Ft(m)&&s.length<5)return s+=String.fromCodePoint(m),e.consume(m),f;if(m===58){const x=s.toLowerCase();if(x==="http"||x==="https")return e.consume(m),h}return i(m)}function h(m){return m===47?(e.consume(m),o?d:(o=!0,h)):i(m)}function d(m){return m===null||Vc(m)||rt(m)||ia(m)||yf(m)?i(m):e.attempt(F2,e.attempt(G2,g),i)(m)}function g(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(m)}}function sL(e,n,i){let a=0;return s;function s(u){return(u===87||u===119)&&a<3?(a++,e.consume(u),s):u===46&&a===3?(e.consume(u),o):i(u)}function o(u){return u===null?i(u):n(u)}}function oL(e,n,i){let a,s,o;return u;function u(d){return d===46||d===95?e.check(Z2,h,f)(d):d===null||rt(d)||ia(d)||d!==45&&yf(d)?h(d):(o=!0,e.consume(d),u)}function f(d){return d===95?a=!0:(s=a,a=void 0),e.consume(d),u}function h(d){return s||a||!o?i(d):n(d)}}function uL(e,n){let i=0,a=0;return s;function s(u){return u===40?(i++,e.consume(u),s):u===41&&a<i?o(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(Z2,n,o)(u):u===null||rt(u)||ia(u)?n(u):(e.consume(u),s)}function o(u){return u===41&&a++,e.consume(u),s}}function cL(e,n,i){return a;function a(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),a):f===38?(e.consume(f),o):f===93?(e.consume(f),s):f===60||f===null||rt(f)||ia(f)?n(f):i(f)}function s(f){return f===null||f===40||f===91||rt(f)||ia(f)?n(f):a(f)}function o(f){return Ft(f)?u(f):i(f)}function u(f){return f===59?(e.consume(f),a):Ft(f)?(e.consume(f),u):i(f)}}function fL(e,n,i){return a;function a(o){return e.consume(o),s}function s(o){return It(o)?i(o):n(o)}}function J2(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||rt(e)}function W2(e){return!Ft(e)}function e_(e){return!(e===47||rm(e))}function rm(e){return e===43||e===45||e===46||e===95||It(e)}function Qm(e){let n=e.length,i=!1;for(;n--;){const a=e[n][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){i=!0;break}if(a._gfmAutolinkLiteralWalkedInto){i=!1;break}}return e.length>0&&!i&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),i}const dL={tokenize:vL,partial:!0};function hL(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:yL,continuation:{tokenize:xL},exit:bL}},text:{91:{name:"gfmFootnoteCall",tokenize:gL},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:pL,resolveTo:mL}}}}function pL(e,n,i){const a=this;let s=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u;for(;s--;){const h=a.events[s][1];if(h.type==="labelImage"){u=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return f;function f(h){if(!u||!u._balanced)return i(h);const d=Yn(a.sliceSerialize({start:u.end,end:a.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?i(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),n(h))}}function mL(e,n){let i=e.length;for(;i--;)if(e[i][1].type==="labelImage"&&e[i][0]==="enter"){e[i][1];break}e[i+1][1].type="data",e[i+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[i+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[i+3][1].end),end:Object.assign({},e[i+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[i+1],e[i+2],["enter",a,n],e[i+3],e[i+4],["enter",s,n],["exit",s,n],["enter",o,n],["enter",u,n],["exit",u,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",a,n]];return e.splice(i,e.length-i+1,...f),e}function gL(e,n,i){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,u;return f;function f(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),h}function h(m){return m!==94?i(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(o>999||m===93&&!u||m===null||m===91||rt(m))return i(m);if(m===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return s.includes(Yn(a.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):i(m)}return rt(m)||(u=!0),o++,e.consume(m),m===92?g:d}function g(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function yL(e,n,i){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,u=0,f;return h;function h(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):i(w)}function g(w){if(u>999||w===93&&!f||w===null||w===91||rt(w))return i(w);if(w===93){e.exit("chunkString");const E=e.exit("gfmFootnoteDefinitionLabelString");return o=Yn(a.sliceSerialize(E)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return rt(w)||(f=!0),u++,e.consume(w),w===92?m:g}function m(w){return w===91||w===92||w===93?(e.consume(w),u++,g):g(w)}function x(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),s.includes(o)||s.push(o),Pe(e,b,"gfmFootnoteDefinitionWhitespace")):i(w)}function b(w){return n(w)}}function xL(e,n,i){return e.check(vo,n,e.attempt(dL,n,i))}function bL(e){e.exit("gfmFootnoteDefinition")}function vL(e,n,i){const a=this;return Pe(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const u=a.events[a.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?n(o):i(o)}}function wL(e){let i=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:s};return i==null&&(i=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function s(u,f){let h=-1;for(;++h<u.length;)if(u[h][0]==="enter"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._close){let d=h;for(;d--;)if(u[d][0]==="exit"&&u[d][1].type==="strikethroughSequenceTemporary"&&u[d][1]._open&&u[h][1].end.offset-u[h][1].start.offset===u[d][1].end.offset-u[d][1].start.offset){u[h][1].type="strikethroughSequence",u[d][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},u[d][1].start),end:Object.assign({},u[h][1].end)},m={type:"strikethroughText",start:Object.assign({},u[d][1].end),end:Object.assign({},u[h][1].start)},x=[["enter",g,f],["enter",u[d][1],f],["exit",u[d][1],f],["enter",m,f]],b=f.parser.constructs.insideSpan.null;b&&wn(x,x.length,0,xf(b,u.slice(d+1,h),f)),wn(x,x.length,0,[["exit",m,f],["enter",u[h][1],f],["exit",u[h][1],f],["exit",g,f]]),wn(u,d-1,h-d+3,x),h=d+x.length-2;break}}for(h=-1;++h<u.length;)u[h][1].type==="strikethroughSequenceTemporary"&&(u[h][1].type="data");return u}function o(u,f,h){const d=this.previous,g=this.events;let m=0;return x;function x(w){return d===126&&g[g.length-1][1].type!=="characterEscape"?h(w):(u.enter("strikethroughSequenceTemporary"),b(w))}function b(w){const E=ml(d);if(w===126)return m>1?h(w):(u.consume(w),m++,b);if(m<2&&!i)return h(w);const N=u.exit("strikethroughSequenceTemporary"),_=ml(w);return N._open=!_||_===2&&!!E,N._close=!E||E===2&&!!_,f(w)}}}class SL{constructor(){this.map=[]}add(n,i,a){_L(this,n,i,a)}consume(n){if(this.map.sort(function(o,u){return o[0]-u[0]}),this.map.length===0)return;let i=this.map.length;const a=[];for(;i>0;)i-=1,a.push(n.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),n.length=this.map[i][0];a.push(n.slice()),n.length=0;let s=a.pop();for(;s;){for(const o of s)n.push(o);s=a.pop()}this.map.length=0}}function _L(e,n,i,a){let s=0;if(!(i===0&&a.length===0)){for(;s<e.map.length;){if(e.map[s][0]===n){e.map[s][1]+=i,e.map[s][2].push(...a);return}s+=1}e.map.push([n,i,a])}}function kL(e,n){let i=!1;const a=[];for(;n<e.length;){const s=e[n];if(i){if(s[0]==="enter")s[1].type==="tableContent"&&a.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(i=!0);n+=1}return a}function EL(){return{flow:{null:{name:"table",tokenize:NL,resolveAll:CL}}}}function NL(e,n,i){const a=this;let s=0,o=0,u;return f;function f(q){let V=a.events.length-1;for(;V>-1;){const O=a.events[V][1].type;if(O==="lineEnding"||O==="linePrefix")V--;else break}const P=V>-1?a.events[V][1].type:null,te=P==="tableHead"||P==="tableRow"?A:h;return te===A&&a.parser.lazy[a.now().line]?i(q):te(q)}function h(q){return e.enter("tableHead"),e.enter("tableRow"),d(q)}function d(q){return q===124||(u=!0,o+=1),g(q)}function g(q){return q===null?i(q):Se(q)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),b):i(q):Be(q)?Pe(e,g,"whitespace")(q):(o+=1,u&&(u=!1,s+=1),q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),u=!0,g):(e.enter("data"),m(q)))}function m(q){return q===null||q===124||rt(q)?(e.exit("data"),g(q)):(e.consume(q),q===92?x:m)}function x(q){return q===92||q===124?(e.consume(q),m):m(q)}function b(q){return a.interrupt=!1,a.parser.lazy[a.now().line]?i(q):(e.enter("tableDelimiterRow"),u=!1,Be(q)?Pe(e,w,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):w(q))}function w(q){return q===45||q===58?N(q):q===124?(u=!0,e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),E):L(q)}function E(q){return Be(q)?Pe(e,N,"whitespace")(q):N(q)}function N(q){return q===58?(o+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),_):q===45?(o+=1,_(q)):q===null||Se(q)?C(q):L(q)}function _(q){return q===45?(e.enter("tableDelimiterFiller"),D(q)):L(q)}function D(q){return q===45?(e.consume(q),D):q===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(q))}function k(q){return Be(q)?Pe(e,C,"whitespace")(q):C(q)}function C(q){return q===124?w(q):q===null||Se(q)?!u||s!==o?L(q):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(q)):L(q)}function L(q){return i(q)}function A(q){return e.enter("tableRow"),H(q)}function H(q){return q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),H):q===null||Se(q)?(e.exit("tableRow"),n(q)):Be(q)?Pe(e,H,"whitespace")(q):(e.enter("data"),F(q))}function F(q){return q===null||q===124||rt(q)?(e.exit("data"),H(q)):(e.consume(q),q===92?G:F)}function G(q){return q===92||q===124?(e.consume(q),F):F(q)}}function CL(e,n){let i=-1,a=!0,s=0,o=[0,0,0,0],u=[0,0,0,0],f=!1,h=0,d,g,m;const x=new SL;for(;++i<e.length;){const b=e[i],w=b[1];b[0]==="enter"?w.type==="tableHead"?(f=!1,h!==0&&(dv(x,n,h,d,g),g=void 0,h=0),d={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(i,0,[["enter",d,n]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(a=!0,m=void 0,o=[0,0,0,0],u=[0,i+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(i,0,[["enter",g,n]])),s=w.type==="tableDelimiterRow"?2:g?3:1):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(a=!1,u[2]===0&&(o[1]!==0&&(u[0]=u[1],m=vc(x,n,o,s,void 0,m),o=[0,0,0,0]),u[2]=i)):w.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(u[0]=u[1],m=vc(x,n,o,s,void 0,m)),o=u,u=[o[1],i,0,0])):w.type==="tableHead"?(f=!0,h=i):w.type==="tableRow"||w.type==="tableDelimiterRow"?(h=i,o[1]!==0?(u[0]=u[1],m=vc(x,n,o,s,i,m)):u[1]!==0&&(m=vc(x,n,u,s,i,m)),s=0):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(u[3]=i)}for(h!==0&&dv(x,n,h,d,g),x.consume(n.events),i=-1;++i<n.events.length;){const b=n.events[i];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=kL(n.events,i))}return e}function vc(e,n,i,a,s,o){const u=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";i[0]!==0&&(o.end=Object.assign({},Ja(n.events,i[0])),e.add(i[0],0,[["exit",o,n]]));const h=Ja(n.events,i[1]);if(o={type:u,start:Object.assign({},h),end:Object.assign({},h)},e.add(i[1],0,[["enter",o,n]]),i[2]!==0){const d=Ja(n.events,i[2]),g=Ja(n.events,i[3]),m={type:f,start:Object.assign({},d),end:Object.assign({},g)};if(e.add(i[2],0,[["enter",m,n]]),a!==2){const x=n.events[i[2]],b=n.events[i[3]];if(x[1].end=Object.assign({},b[1].end),x[1].type="chunkText",x[1].contentType="text",i[3]>i[2]+1){const w=i[2]+1,E=i[3]-i[2]-1;e.add(w,E,[])}}e.add(i[3]+1,0,[["exit",m,n]])}return s!==void 0&&(o.end=Object.assign({},Ja(n.events,s)),e.add(s,0,[["exit",o,n]]),o=void 0),o}function dv(e,n,i,a,s){const o=[],u=Ja(n.events,i);s&&(s.end=Object.assign({},u),o.push(["exit",s,n])),a.end=Object.assign({},u),o.push(["exit",a,n]),e.add(i+1,0,o)}function Ja(e,n){const i=e[n],a=i[0]==="enter"?"start":"end";return i[1][a]}const ML={name:"tasklistCheck",tokenize:AL};function TL(){return{text:{91:ML}}}function AL(e,n,i){const a=this;return s;function s(h){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?i(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),o)}function o(h){return rt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),u):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),u):i(h)}function u(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):i(h)}function f(h){return Se(h)?n(h):Be(h)?e.check({tokenize:zL},n,i)(h):i(h)}}function zL(e,n,i){return Pe(e,a,"whitespace");function a(s){return s===null?i(s):n(s)}}function jL(e){return f2([iL(),hL(),wL(e),EL(),TL()])}const DL={};function hv(e){const n=this,i=e||DL,a=n.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),u=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(jL(i)),o.push(W8()),u.push(eL(i))}function RL(){const{isRunning:e,results:n,workflowResults:i,logs:a}=po(),{nodes:s,selectedNodeId:o,updateNode:u}=Hi(),f=Hi(fS),{execute:h,generatedFiles:d,downloadFile:g,downloadAllFiles:m}=FS(),[x,b]=Q.useState("");Q.useEffect(()=>{if(f?.type==="input"){const C=f.data;b(C.value||"")}},[o,f]);const w=s.filter(C=>C.type==="output"),E=w.length>0?n.get(w[0].id):null,N=f?.type==="input",_=N?f.data:null,D=C=>{b(C),o&&u(o,{value:C})},k=()=>{h()};return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(lS,{className:"w-5 h-5 text-gray-400"}),v.jsx("h3",{className:"text-lg font-semibold text-white",children:"Preview"})]}),e&&v.jsx("span",{className:"text-sm text-blue-400 animate-pulse",children:"Running..."})]}),e&&v.jsx("div",{className:"p-4 border-b border-border",children:v.jsx("div",{className:"space-y-3",children:s.map(C=>v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${C.data.status==="completed"?"bg-green-500":C.data.status==="running"?"bg-blue-500 animate-pulse":C.data.status==="error"?"bg-red-500":"bg-gray-500"}`}),v.jsx("span",{className:"text-sm text-gray-300",children:C.data.label}),C.data.status==="running"&&C.data.progress!==void 0&&v.jsxs("span",{className:"text-xs text-gray-500",children:[C.data.progress,"%"]})]},C.id))})}),v.jsxs("div",{className:"p-4 border-b border-border",children:[v.jsxs("button",{onClick:k,disabled:e||s.length===0,className:"w-full flex items-center justify-center gap-2 px-4 py-3 bg-amber-600 hover:bg-amber-700 disabled:bg-gray-600 disabled:cursor-not-allowed text-white rounded-lg font-medium transition-colors",children:[v.jsx(_m,{className:"w-4 h-4"}),e?"Running...":"Run Workflow"]}),s.length===0&&v.jsx("p",{className:"text-xs text-gray-500 text-center mt-2",children:"노드를 추가해주세요"})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[N&&_&&v.jsxs("div",{className:"space-y-4 mb-4 p-4 bg-surface rounded-lg border border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(of,{className:"w-5 h-5 text-amber-500"}),v.jsx("h4",{className:"text-md font-medium text-white",children:_.label})]}),_.inputType==="text"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm text-gray-400",children:_.description||"Enter your input"}),v.jsx("textarea",{className:"w-full h-32 px-3 py-2 text-sm bg-surface border border-border rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-amber-500 focus:border-transparent resize-none",placeholder:_.placeholder||"Type your message here...",value:x||_.value||"",onChange:C=>D(C.target.value)})]}),_.inputType==="file"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm text-gray-400",children:_.description||"Upload a file"}),v.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-32 border-2 border-dashed border-gray-600 rounded-lg hover:border-amber-500 transition-colors cursor-pointer",children:[v.jsx(E5,{className:"w-8 h-8 text-gray-500 mb-2"}),v.jsx("p",{className:"text-sm text-gray-400",children:"Drop files here or click to upload"}),_.fileTypes&&v.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Supported: ",_.fileTypes.join(", ")]})]})]}),_.inputType==="select"&&_.options&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm text-gray-400",children:_.description||"Select an option"}),v.jsxs("select",{className:"w-full px-3 py-2 text-sm bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-amber-500",value:x||_.value||"",onChange:C=>D(C.target.value),children:[v.jsx("option",{value:"",children:"Select..."}),_.options.map(C=>v.jsx("option",{value:C,children:C},C))]})]})]}),d.length>0&&v.jsxs("div",{className:"mb-4 p-4 bg-green-900/20 border border-green-700 rounded-lg",children:[v.jsxs("div",{className:"flex items-center justify-between mb-3",children:[v.jsx("h4",{className:"text-sm font-medium text-green-300",children:"생성된 파일"}),v.jsxs("button",{onClick:m,className:"flex items-center gap-1 px-2 py-1 text-xs bg-green-600 hover:bg-green-700 text-white rounded transition-colors",children:[v.jsx(il,{className:"w-3 h-3"}),"전체 다운로드"]})]}),v.jsx("div",{className:"space-y-2",children:d.map((C,L)=>v.jsxs("div",{className:"flex items-center justify-between p-2 bg-surface rounded",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(rl,{className:"w-4 h-4 text-blue-400"}),v.jsx("span",{className:"text-sm text-white",children:C.name})]}),v.jsx("button",{onClick:()=>g(C.name,C.content),className:"p-1 hover:bg-surface-hover rounded transition-colors",children:v.jsx(il,{className:"w-4 h-4 text-gray-400"})})]},L))})]}),i.length>0?v.jsx("div",{className:"space-y-4",children:i.map(C=>v.jsxs("div",{className:`p-4 rounded-lg border ${C.success?"bg-surface border-border":"bg-red-900/20 border-red-700"}`,children:[v.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[C.success?v.jsx(rS,{className:"w-5 h-5 text-green-500"}):v.jsx(aS,{className:"w-5 h-5 text-red-500"}),v.jsx("h5",{className:"text-sm font-medium text-white",children:C.label})]}),C.error&&v.jsx("p",{className:"text-sm text-red-400 mb-3",children:C.error}),C.files&&C.files.length>0&&v.jsxs("div",{className:"space-y-2 mb-3",children:[v.jsx("p",{className:"text-xs text-gray-400",children:"생성된 파일:"}),C.files.map((L,A)=>v.jsxs("div",{className:"flex items-center gap-2 p-2 bg-surface-hover rounded",children:[L.type==="image"?v.jsx(sS,{className:"w-4 h-4 text-purple-400"}):v.jsx(rl,{className:"w-4 h-4 text-blue-400"}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("p",{className:"text-sm text-white truncate",children:L.name}),v.jsx("p",{className:"text-xs text-gray-500 truncate",children:L.path})]})]},A))]}),C.result&&v.jsxs("details",{className:"group",open:!0,children:[v.jsx("summary",{className:"text-xs text-gray-400 cursor-pointer hover:text-gray-300",children:"결과 보기"}),v.jsx("div",{className:"mt-2 p-2 bg-black/30 rounded max-h-64 overflow-y-auto",children:v.jsx("div",{className:"markdown-content text-sm",children:v.jsx(av,{remarkPlugins:[hv],children:C.result.length>2e3?C.result.substring(0,2e3)+"...":C.result})})})]})]},C.nodeId))}):E?v.jsx("div",{className:"markdown-content",children:v.jsx(av,{remarkPlugins:[hv],children:typeof E=="string"?E:JSON.stringify(E,null,2)})}):a.length>0?v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-sm font-medium text-white mb-3",children:"실행 로그"}),a.slice(-20).map(C=>v.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[v.jsx("span",{className:"text-gray-500 shrink-0",children:new Date(C.timestamp).toLocaleTimeString("ko-KR")}),v.jsx("span",{className:C.level==="error"?"text-red-400":C.level==="warning"?"text-yellow-400":C.level==="success"?"text-green-400":"text-gray-300",children:C.message})]},C.id))]}):v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500",children:[v.jsx(rl,{className:"w-12 h-12 mb-4 opacity-50"}),v.jsx("p",{className:"text-sm",children:"Run the workflow to see results"}),v.jsx("p",{className:"text-xs mt-2",children:"노드를 연결하고 Run Workflow 버튼을 클릭하세요"})]})]}),(E||d.length>0)&&v.jsx("div",{className:"flex items-center gap-2 p-4 border-t border-border",children:v.jsxs("button",{onClick:m,disabled:d.length===0,className:"flex items-center gap-2 px-3 py-2 bg-surface-hover rounded-lg text-sm hover:bg-border transition-colors disabled:opacity-50",children:[v.jsx(il,{className:"w-4 h-4"}),"Download .md"]})})]})}function t_({level:e}){switch(e){case"success":return v.jsx(rS,{className:"w-4 h-4 text-green-400"});case"error":return v.jsx(aS,{className:"w-4 h-4 text-red-400"});case"warning":return v.jsx(_5,{className:"w-4 h-4 text-yellow-400"});default:return v.jsx(K3,{className:"w-4 h-4 text-blue-400"})}}function n_(e){return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function OL({isOpen:e,onClose:n}){const{logs:i,clearLogs:a,isRunning:s}=po(),[o,u]=Q.useState(!1),[f,h]=Q.useState(250),d=Q.useRef(null);Q.useEffect(()=>{d.current&&!o&&d.current.scrollIntoView({behavior:"smooth"})},[i,o]);const g=m=>{m.preventDefault();const x=m.clientY,b=f,w=N=>{const _=x-N.clientY,D=Math.min(Math.max(b+_,100),500);h(D)},E=()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",E)};document.addEventListener("mousemove",w),document.addEventListener("mouseup",E)};return e?v.jsxs("div",{className:"fixed bottom-0 left-0 right-0 bg-[#1a1a1a] border-t border-gray-700 z-50 shadow-2xl",style:{height:o?40:f},children:[!o&&v.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 cursor-ns-resize hover:bg-amber-500 transition-colors",onMouseDown:g}),v.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-[#252525] border-b border-gray-700",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(uf,{className:"w-4 h-4 text-amber-500"}),v.jsx("span",{className:"text-sm font-medium text-white",children:"Console"}),s&&v.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-500/20 text-blue-400 rounded",children:[v.jsx("span",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full animate-pulse"}),"Running"]}),v.jsxs("span",{className:"text-xs text-gray-500",children:["(",i.length," logs)"]})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("button",{onClick:a,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Clear logs",children:v.jsx(cf,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:()=>u(!o),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:o?"Expand":"Minimize",children:o?v.jsx(O3,{className:"w-4 h-4 text-gray-400"}):v.jsx(D3,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:()=>h(f===250?400:250),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Toggle size",children:f>250?v.jsx(s5,{className:"w-4 h-4 text-gray-400"}):v.jsx(r5,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:n,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Close",children:v.jsx(Em,{className:"w-4 h-4 text-gray-400"})})]})]}),!o&&v.jsx("div",{className:"overflow-y-auto font-mono text-sm p-3",style:{height:f-44},children:i.length===0?v.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:v.jsx("p",{children:"No logs yet. Run the workflow to see output."})}):v.jsxs("div",{className:"space-y-1",children:[i.map(m=>v.jsxs("div",{className:Xt("flex items-start gap-2 px-2 py-1 rounded hover:bg-gray-800/50",m.level==="error"&&"bg-red-500/10",m.level==="warning"&&"bg-yellow-500/10",m.level==="success"&&"bg-green-500/10"),children:[v.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",n_(m.timestamp),"]"]}),v.jsx(t_,{level:m.level}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("span",{className:Xt("text-xs",m.level==="error"&&"text-red-400",m.level==="warning"&&"text-yellow-400",m.level==="success"&&"text-green-400",m.level==="info"&&"text-gray-300"),children:m.message}),m.nodeId&&v.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",m.nodeId.slice(0,8),"]"]}),m.details&&v.jsx("pre",{className:"mt-1 p-2 bg-black/30 rounded text-xs text-gray-400 overflow-x-auto",children:typeof m.details=="string"?m.details:JSON.stringify(m.details,null,2)})]})]},m.id)),v.jsx("div",{ref:d})]})})]}):null}function LL(){const{logs:e,clearLogs:n,isRunning:i}=po(),a=Q.useRef(null);return Q.useEffect(()=>{a.current&&a.current.scrollIntoView({behavior:"smooth"})},[e]),v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(uf,{className:"w-5 h-5 text-amber-500"}),v.jsx("h3",{className:"text-lg font-semibold text-white",children:"Console"}),i&&v.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-500/20 text-blue-400 rounded",children:[v.jsx("span",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full animate-pulse"}),"Running"]}),v.jsxs("span",{className:"text-xs text-gray-500",children:["(",e.length," logs)"]})]}),v.jsx("button",{onClick:n,className:"p-2 text-gray-400 hover:text-white hover:bg-surface-hover rounded-lg transition-colors",title:"Clear logs",children:v.jsx(cf,{className:"w-4 h-4"})})]}),v.jsx("div",{className:"flex-1 overflow-y-auto p-4 font-mono text-sm",children:e.length===0?v.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:v.jsx("p",{children:"No logs yet. Run the workflow to see output."})}):v.jsxs("div",{className:"space-y-1",children:[e.map(s=>v.jsxs("div",{className:Xt("flex items-start gap-2 px-2 py-1 rounded hover:bg-surface-hover",s.level==="error"&&"bg-red-500/10",s.level==="warning"&&"bg-yellow-500/10",s.level==="success"&&"bg-green-500/10"),children:[v.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",n_(s.timestamp),"]"]}),v.jsx(t_,{level:s.level}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("span",{className:Xt("text-xs",s.level==="error"&&"text-red-400",s.level==="warning"&&"text-yellow-400",s.level==="success"&&"text-green-400",s.level==="info"&&"text-gray-300"),children:s.message}),s.nodeId&&v.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",s.nodeId.slice(0,8),"]"]}),s.details&&v.jsx("pre",{className:"mt-1 p-2 bg-black/30 rounded text-xs text-gray-400 overflow-x-auto",children:typeof s.details=="string"?s.details:JSON.stringify(s.details,null,2)})]})]},s.id)),v.jsx("div",{ref:a})]})})]})}const HL=["Read","Write","Edit","Bash","Glob","Grep","WebSearch","WebFetch","Task","TodoWrite"],BL=[{id:"sonnet",name:"Claude 4 Sonnet",description:"Fast, cost-efficient"},{id:"opus",name:"Claude 4.5 Opus",description:"Best for complex tasks"},{id:"haiku",name:"Claude 3.5 Haiku",description:"Fastest, for simple tasks"}];function UL(e){switch(e){case"input":return v.jsx(of,{className:"w-5 h-5 text-yellow-400"});case"subagent":return v.jsx(ho,{className:"w-5 h-5 text-purple-400"});case"skill":return v.jsx(ff,{className:"w-5 h-5 text-cyan-400"});case"mcp":return v.jsx(km,{className:"w-5 h-5 text-pink-400"});case"output":return v.jsx(sf,{className:"w-5 h-5 text-emerald-400"});default:return null}}function IL(e){switch(e){case"input":return"User Input";case"subagent":return"Sub Agent";case"skill":return"Skill";case"mcp":return"MCP Server";case"output":return"Output";default:return"Node"}}function qL({node:e}){const{updateNode:n,removeNode:i}=Hi();if(!e)return v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500 p-8",children:[v.jsx(y5,{className:"w-12 h-12 mb-4 opacity-50"}),v.jsx("p",{className:"text-center",children:"Select a node to configure its settings"})]});const a=()=>{i(e.id)},s=u=>{n(e.id,{label:u})},o=u=>{n(e.id,{description:u})};return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border bg-surface-hover/50",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:"p-2 rounded-lg bg-surface",children:UL(e.type)}),v.jsxs("div",{children:[v.jsx("h3",{className:"text-base font-semibold text-white",children:e.data.label}),v.jsx("p",{className:"text-xs text-gray-500",children:IL(e.type)})]})]}),v.jsx("button",{onClick:a,className:"p-2 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded-lg transition-colors",title:"Delete node",children:v.jsx(cf,{className:"w-4 h-4"})})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-5",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Name"}),v.jsx("input",{type:"text",value:e.data.label,onChange:u=>s(u.target.value),className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent transition-all"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:e.type==="subagent"?"Prompt":"Description"}),v.jsx("textarea",{value:e.data.description||"",onChange:u=>o(u.target.value),rows:4,placeholder:e.type==="subagent"?"Enter instructions for this agent...":"Describe what this step does...",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent transition-all resize-none"})]}),e.type==="input"&&v.jsx($L,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="subagent"&&v.jsx(VL,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="skill"&&v.jsx(PL,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="mcp"&&v.jsx(YL,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="output"&&v.jsx(XL,{onUpdate:u=>n(e.id,u)})]})]})}function $L({data:e,onUpdate:n}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Input Type"}),v.jsx("div",{className:"grid grid-cols-3 gap-2",children:["text","file","select"].map(i=>v.jsx("button",{onClick:()=>n({inputType:i}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.inputType===i?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:i.charAt(0).toUpperCase()+i.slice(1)},i))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Default Value"}),v.jsx("textarea",{value:e.value||"",onChange:i=>n({value:i.target.value}),rows:3,placeholder:"Enter default value...",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent resize-none"})]})]})}function VL({data:e,onUpdate:n}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Model"}),v.jsx("div",{className:"space-y-2",children:BL.map(i=>v.jsxs("button",{onClick:()=>n({model:i.id}),className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-colors ${e.model===i.id?"bg-accent/20 border-accent":"bg-surface-hover border-border hover:border-gray-500"}`,children:[v.jsx(ho,{className:"w-5 h-5 text-purple-400"}),v.jsxs("div",{className:"text-left",children:[v.jsx("div",{className:"font-medium text-white",children:i.name}),v.jsx("div",{className:"text-xs text-gray-500",children:i.description})]})]},i.id))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Allowed Tools"}),v.jsx("div",{className:"grid grid-cols-2 gap-2",children:HL.map(i=>v.jsxs("label",{className:"flex items-center gap-2 p-2 bg-surface-hover rounded-lg cursor-pointer hover:bg-border transition-colors",children:[v.jsx("input",{type:"checkbox",checked:e.tools?.includes(i)??!1,onChange:a=>{const s=a.target.checked?[...e.tools||[],i]:(e.tools||[]).filter(o=>o!==i);n({tools:s})},className:"rounded border-gray-600 bg-surface text-accent focus:ring-accent"}),v.jsx("span",{className:"text-sm text-gray-300",children:i})]},i))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"System Prompt"}),v.jsx("textarea",{value:e.systemPrompt||"",onChange:i=>n({systemPrompt:i.target.value}),rows:4,placeholder:"Enter custom instructions for this agent...",className:"w-full px-3 py-2 bg-surface-hover border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent resize-none"})]})]})}function PL({data:e,onUpdate:n}){const i=[{id:"ppt-generator",name:"PPT Generator",description:"Create PowerPoint presentations"},{id:"image-gen-nanobanana",name:"Image Generator",description:"Generate images with AI"},{id:"pdf",name:"PDF Processor",description:"Process and create PDF documents"},{id:"xlsx",name:"Excel Processor",description:"Work with spreadsheets"},{id:"docx",name:"Word Processor",description:"Create and edit documents"}];return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Skill Type"}),v.jsx("div",{className:"grid grid-cols-2 gap-2 mb-4",children:["official","custom"].map(a=>v.jsx("button",{onClick:()=>n({skillType:a}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.skillType===a?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:a.charAt(0).toUpperCase()+a.slice(1)},a))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Select Skill"}),v.jsx("div",{className:"space-y-2",children:i.map(a=>v.jsxs("button",{onClick:()=>n({skillId:a.id}),className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-colors text-left ${e.skillId===a.id?"bg-accent/20 border-accent":"bg-surface border-border hover:border-gray-500"}`,children:[v.jsx(ff,{className:"w-5 h-5 text-cyan-400"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-medium text-white",children:a.name}),v.jsx("div",{className:"text-xs text-gray-500",children:a.description})]})]},a.id))})]})]})}function YL({data:e,onUpdate:n}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Server Type"}),v.jsx("div",{className:"grid grid-cols-2 gap-2",children:["stdio","sse"].map(i=>v.jsx("button",{onClick:()=>n({serverType:i}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.serverType===i?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:i.toUpperCase()},i))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Server Name"}),v.jsx("input",{type:"text",value:e.serverName||"",onChange:i=>n({serverName:i.target.value}),placeholder:"e.g., my-mcp-server",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Server Command (for stdio)"}),v.jsx("input",{type:"text",value:e.serverConfig?.command||"",onChange:i=>n({serverConfig:{...e.serverConfig,command:i.target.value}}),placeholder:"e.g., npx @anthropic/mcp-server",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent"})]})]})}function XL({onUpdate:e}){const n=[{id:"auto",name:"Auto Format",description:"Automatically format output"},{id:"markdown",name:"Markdown",description:"Plain markdown text"},{id:"document",name:"Document",description:"Formatted document output"}];return v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Output Format"}),v.jsx("div",{className:"space-y-2",children:n.map(i=>v.jsxs("button",{onClick:()=>e({layoutType:i.id}),className:"w-full flex items-center gap-3 p-3 rounded-lg border bg-surface-hover border-border hover:border-gray-500 transition-colors text-left",children:[v.jsx(sf,{className:"w-5 h-5 text-emerald-400"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-medium text-white",children:i.name}),v.jsx("div",{className:"text-xs text-gray-500",children:i.description})]})]},i.id))})]})}const FL=[{id:"preview",label:"Preview"},{id:"console",label:"Console"},{id:"step",label:"Step"},{id:"theme",label:"Theme"}];function GL(){const{activeTab:e,setActiveTab:n}=jm(),i=Hi(fS);return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsx("div",{className:"flex items-center gap-1 p-2 border-b border-border",children:FL.map(a=>v.jsx("button",{onClick:()=>n(a.id),className:Xt("px-4 py-2 text-sm font-medium rounded-lg transition-colors",e===a.id?"bg-surface-hover text-white":"text-gray-400 hover:text-white hover:bg-surface-hover/50"),children:a.label},a.id))}),v.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="preview"&&v.jsx(RL,{}),e==="console"&&v.jsx(LL,{}),e==="step"&&v.jsx(qL,{node:i}),e==="theme"&&v.jsx("div",{className:"p-4 text-gray-500",children:"Theme customization coming soon..."})]})]})}async function ZL(e){let n;const{apiMode:i,apiKey:a,proxyUrl:s}=QS.getState(),o={"Content-Type":"application/json","X-API-Mode":i};i==="direct"&&a?o["X-API-Key"]=a:i==="proxy"&&s&&(o["X-Proxy-URL"]=s);try{n=await fetch("/api/generate/workflow",{method:"POST",headers:o,body:JSON.stringify({prompt:e})})}catch{throw new Error("서버에 연결할 수 없습니다. 서버가 실행 중인지 확인하세요.")}if(!n.ok){let h=`서버 오류 (${n.status})`;try{h=(await n.json()).message||h}catch{}throw new Error(h)}let u;try{u=await n.json()}catch{throw new Error("서버 응답을 파싱할 수 없습니다.")}return{workflow:KL(u),workflowName:u.workflowName}}function QL(e,n){if(e.length===0)return e;const i=300,a=150,s=100,o=100,u=new Map,f=new Map;e.forEach(w=>{u.set(w.id,[]),f.set(w.id,[])}),n.forEach(w=>{const E=u.get(w.target)||[];E.push(w.source),u.set(w.target,E);const N=f.get(w.source)||[];N.push(w.target),f.set(w.source,N)});const h=e.filter(w=>(u.get(w.id)||[]).length===0),d=new Map,g=[];for(h.forEach(w=>{d.set(w.id,0),g.push({id:w.id,depth:0})}),h.length===0&&e.length>0&&(d.set(e[0].id,0),g.push({id:e[0].id,depth:0}));g.length>0;){const w=g.shift();(f.get(w.id)||[]).forEach(N=>{const _=d.get(N),D=w.depth+1;(_===void 0||D>_)&&(d.set(N,D),g.push({id:N,depth:D}))})}const m=new Map;d.forEach((w,E)=>{const N=m.get(w)||[];N.push(E),m.set(w,N)});const x=Math.max(...Array.from(d.values()),0),b=new Map;for(let w=0;w<=x;w++){const E=m.get(w)||[],_=(E.length-1)*a,D=o+(300-_)/2;E.forEach((k,C)=>{b.set(k,{x:s+w*i,y:D+C*a})})}return e.map(w=>{const E=b.get(w.id)||w.position;return{...w,position:E}})}function KL(e){const n=[],i=new Map,a={x:0,y:0};e.nodes.forEach((u,f)=>{const h=to();i.set(f,h);const d={label:u.label,description:u.description,status:"idle",usedInputs:[]};switch(u.type){case"input":n.push({id:h,type:"input",position:{...a},data:{...d,inputType:u.config.inputType||"text",placeholder:u.config.placeholder||u.description}});break;case"subagent":n.push({id:h,type:"subagent",position:{...a},data:{...d,role:u.config.role||"custom",tools:u.config.tools||["Read","Write"],model:u.config.model||"sonnet",systemPrompt:u.config.systemPrompt}});break;case"skill":n.push({id:h,type:"skill",position:{...a},data:{...d,skillType:u.config.skillType||"official",skillId:u.config.skillId,skillContent:u.config.skillContent}});break;case"mcp":n.push({id:h,type:"mcp",position:{...a},data:{...d,serverType:"stdio",serverName:u.label,serverConfig:{}}});break;case"output":n.push({id:h,type:"output",position:{...a},data:{...d,outputType:u.config.outputType||"auto"}});break}}),e.edges.forEach(u=>{const f=i.get(u.to),h=i.get(u.from);if(f&&h){const d=n.find(g=>g.id===f);d&&d.data.usedInputs&&d.data.usedInputs.push(h)}});const s=e.edges.map(u=>{const f=i.get(u.from),h=i.get(u.to);return!f||!h?null:{id:`e-${f}-${h}`,source:f,target:h,animated:!0}}).filter(u=>u!==null);return{nodes:QL(n,s),edges:s}}function JL(){const[e,n]=Q.useState(""),[i,a]=Q.useState(!1),[s,o]=Q.useState(null),{loadWorkflow:u}=Hi(),f=async()=>{if(!(!e.trim()||i)){a(!0),o(null);try{const{workflow:d,workflowName:g}=await ZL(e);u({nodes:d.nodes,edges:d.edges,name:g}),n("")}catch(d){console.error("AI workflow generation failed:",d);const g=d instanceof Error?d.message:"워크플로우 생성에 실패했습니다.";o(g)}finally{a(!1)}}},h=d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),f())};return v.jsxs("div",{className:"bg-surface border border-border rounded-2xl px-5 py-3 shadow-2xl flex items-center gap-3",children:[v.jsx(ho,{className:"w-5 h-5 text-accent flex-shrink-0"}),v.jsx("input",{type:"text",value:e,onChange:d=>n(d.target.value),onKeyDown:h,placeholder:"Describe your workflow... (e.g., 'Create an HTML page with images')",className:"flex-1 bg-transparent border-none outline-none text-white placeholder-gray-500 text-sm",disabled:i}),v.jsx("button",{onClick:f,disabled:!e.trim()||i,className:`p-2 rounded-full transition-all duration-200 ${e.trim()&&!i?"bg-accent text-white hover:bg-accent-hover hover:scale-105":"bg-surface-hover text-gray-500"}`,title:"Generate Workflow",children:i?v.jsx(oS,{className:"w-5 h-5 animate-spin"}):v.jsx(h5,{className:"w-5 h-5"})}),v.jsx("div",{className:"absolute -bottom-6 left-1/2 -translate-x-1/2 text-xs",children:s?v.jsx("span",{className:"text-red-400",children:s}):i?v.jsx("span",{className:"text-accent",children:"AI가 워크플로우를 생성하고 있습니다..."}):v.jsx("span",{className:"text-gray-600",children:"AI가 워크플로우를 자동 생성합니다"})})]})}function WL(){const{isCollapsed:e,width:n}=jm(),{isRunning:i,logs:a}=po(),[s,o]=Q.useState(!1);return Q.useEffect(()=>{i&&o(!0)},[i]),v.jsx(Ww,{children:v.jsxs("div",{className:"flex flex-col h-screen bg-canvas",children:[v.jsx(Xz,{}),v.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[v.jsxs("div",{className:"flex-1 flex flex-col",children:[v.jsx(Zz,{}),v.jsxs("div",{className:"flex-1 relative",children:[v.jsx(fj,{}),v.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 w-full max-w-2xl px-4",children:v.jsx(JL,{})})]})]}),!e&&v.jsx("div",{className:"border-l border-border bg-surface",style:{width:`${n}px`},children:v.jsx(GL,{})})]}),v.jsxs("button",{onClick:()=>o(!s),className:`fixed bottom-4 left-4 z-40 flex items-center gap-2 px-3 py-2 rounded-lg shadow-lg transition-all ${s?"bg-amber-600 text-white":"bg-gray-800 text-gray-300 hover:bg-gray-700"} ${s?"opacity-0 pointer-events-none":"opacity-100"}`,children:[v.jsx(uf,{className:"w-4 h-4"}),v.jsx("span",{className:"text-sm font-medium",children:"Console"}),a.length>0&&!s&&v.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-amber-500 text-white rounded-full",children:a.length}),i&&v.jsx("span",{className:"w-2 h-2 bg-green-400 rounded-full animate-pulse"})]}),v.jsx(OL,{isOpen:s,onClose:()=>o(!1)})]})})}gE.createRoot(document.getElementById("root")).render(v.jsx(Q.StrictMode,{children:v.jsx(WL,{})}));
|
|
147
|
+
`))}function h(b,w,E,N){const _=E.enter("tableCell"),D=E.enter("phrasing"),k=E.containerPhrasing(b,{...N,before:s,after:s});return D(),_(),k}function d(b,w){return f8(b,{align:w,alignDelimiters:a,padding:i,stringLength:o})}function g(b,w,E){const N=b.children;let _=-1;const D=[],k=w.enter("table");for(;++_<N.length;)D[_]=m(N[_],w,E);return k(),D}function m(b,w,E){const N=b.children;let _=-1;const D=[],k=w.enter("tableRow");for(;++_<N.length;)D[_]=h(N[_],b,w,E);return k(),D}function x(b,w,E){let N=X2.inlineCode(b,w,E);return E.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function J8(){return{exit:{taskListCheckValueChecked:hv,taskListCheckValueUnchecked:hv,paragraph:eL}}}function W8(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:tL}}}function hv(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function eL(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const i=this.stack[this.stack.length-1];i.type;const a=i.children[0];if(a&&a.type==="text"){const o=n.children;let s=-1,u;for(;++s<o.length;){const f=o[s];if(f.type==="paragraph"){u=f;break}}u===i&&(a.value=a.value.slice(1),a.value.length===0?i.children.shift():i.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,i.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function tL(e,n,i,a){const o=e.children[0],s=typeof e.checked=="boolean"&&o&&o.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=i.createTracker(a);s&&f.move(u);let h=X2.listItem(e,n,i,{...a,...f.current()});return s&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),h;function d(g){return g+u}}function nL(){return[R6(),t8(),a8(),Y8(),J8()]}function iL(e){return{extensions:[O6(),n8(e),l8(),K8(e),W8()]}}const rL={tokenize:cL,partial:!0},F2={tokenize:fL,partial:!0},G2={tokenize:dL,partial:!0},Z2={tokenize:hL,partial:!0},aL={tokenize:pL,partial:!0},Q2={name:"wwwAutolink",tokenize:sL,previous:J2},K2={name:"protocolAutolink",tokenize:uL,previous:W2},Ui={name:"emailAutolink",tokenize:oL,previous:e_},li={};function lL(){return{text:li}}let Fr=48;for(;Fr<123;)li[Fr]=Ui,Fr++,Fr===58?Fr=65:Fr===91&&(Fr=97);li[43]=Ui;li[45]=Ui;li[46]=Ui;li[95]=Ui;li[72]=[Ui,K2];li[104]=[Ui,K2];li[87]=[Ui,Q2];li[119]=[Ui,Q2];function oL(e,n,i){const a=this;let o,s;return u;function u(m){return!rm(m)||!e_.call(a,a.previous)||Jm(a.events)?i(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(m))}function f(m){return rm(m)?(e.consume(m),f):m===64?(e.consume(m),h):i(m)}function h(m){return m===46?e.check(aL,g,d)(m):m===45||m===95||It(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&&Ft(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(m)):i(m)}}function sL(e,n,i){const a=this;return o;function o(u){return u!==87&&u!==119||!J2.call(a,a.previous)||Jm(a.events)?i(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(rL,e.attempt(F2,e.attempt(G2,s),i),i)(u))}function s(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(u)}}function uL(e,n,i){const a=this;let o="",s=!1;return u;function u(m){return(m===72||m===104)&&W2.call(a,a.previous)&&!Jm(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(m),e.consume(m),f):i(m)}function f(m){if(Ft(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||Pc(m)||rt(m)||ia(m)||yf(m)?i(m):e.attempt(F2,e.attempt(G2,g),i)(m)}function g(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(m)}}function cL(e,n,i){let a=0;return o;function o(u){return(u===87||u===119)&&a<3?(a++,e.consume(u),o):u===46&&a===3?(e.consume(u),s):i(u)}function s(u){return u===null?i(u):n(u)}}function fL(e,n,i){let a,o,s;return u;function u(d){return d===46||d===95?e.check(Z2,h,f)(d):d===null||rt(d)||ia(d)||d!==45&&yf(d)?h(d):(s=!0,e.consume(d),u)}function f(d){return d===95?a=!0:(o=a,a=void 0),e.consume(d),u}function h(d){return o||a||!s?i(d):n(d)}}function dL(e,n){let i=0,a=0;return o;function o(u){return u===40?(i++,e.consume(u),o):u===41&&a<i?s(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(Z2,n,s)(u):u===null||rt(u)||ia(u)?n(u):(e.consume(u),o)}function s(u){return u===41&&a++,e.consume(u),o}}function hL(e,n,i){return a;function a(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),a):f===38?(e.consume(f),s):f===93?(e.consume(f),o):f===60||f===null||rt(f)||ia(f)?n(f):i(f)}function o(f){return f===null||f===40||f===91||rt(f)||ia(f)?n(f):a(f)}function s(f){return Ft(f)?u(f):i(f)}function u(f){return f===59?(e.consume(f),a):Ft(f)?(e.consume(f),u):i(f)}}function pL(e,n,i){return a;function a(s){return e.consume(s),o}function o(s){return It(s)?i(s):n(s)}}function J2(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||rt(e)}function W2(e){return!Ft(e)}function e_(e){return!(e===47||rm(e))}function rm(e){return e===43||e===45||e===46||e===95||It(e)}function Jm(e){let n=e.length,i=!1;for(;n--;){const a=e[n][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){i=!0;break}if(a._gfmAutolinkLiteralWalkedInto){i=!1;break}}return e.length>0&&!i&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),i}const mL={tokenize:_L,partial:!0};function gL(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:vL,continuation:{tokenize:wL},exit:SL}},text:{91:{name:"gfmFootnoteCall",tokenize:bL},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:yL,resolveTo:xL}}}}function yL(e,n,i){const a=this;let o=a.events.length;const s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u;for(;o--;){const h=a.events[o][1];if(h.type==="labelImage"){u=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return f;function f(h){if(!u||!u._balanced)return i(h);const d=Yn(a.sliceSerialize({start:u.end,end:a.now()}));return d.codePointAt(0)!==94||!s.includes(d.slice(1))?i(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),n(h))}}function xL(e,n){let i=e.length;for(;i--;)if(e[i][1].type==="labelImage"&&e[i][0]==="enter"){e[i][1];break}e[i+1][1].type="data",e[i+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[i+3][1].start),end:Object.assign({},e[e.length-1][1].end)},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)},u={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},f=[e[i+1],e[i+2],["enter",a,n],e[i+3],e[i+4],["enter",o,n],["exit",o,n],["enter",s,n],["enter",u,n],["exit",u,n],["exit",s,n],e[e.length-2],e[e.length-1],["exit",a,n]];return e.splice(i,e.length-i+1,...f),e}function bL(e,n,i){const a=this,o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let s=0,u;return f;function f(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),h}function h(m){return m!==94?i(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(s>999||m===93&&!u||m===null||m===91||rt(m))return i(m);if(m===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return o.includes(Yn(a.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):i(m)}return rt(m)||(u=!0),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 vL(e,n,i){const a=this,o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let s,u=0,f;return h;function h(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):i(w)}function g(w){if(u>999||w===93&&!f||w===null||w===91||rt(w))return i(w);if(w===93){e.exit("chunkString");const E=e.exit("gfmFootnoteDefinitionLabelString");return s=Yn(a.sliceSerialize(E)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return rt(w)||(f=!0),u++,e.consume(w),w===92?m:g}function m(w){return w===91||w===92||w===93?(e.consume(w),u++,g):g(w)}function x(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),o.includes(s)||o.push(s),Pe(e,b,"gfmFootnoteDefinitionWhitespace")):i(w)}function b(w){return n(w)}}function wL(e,n,i){return e.check(ws,n,e.attempt(mL,n,i))}function SL(e){e.exit("gfmFootnoteDefinition")}function _L(e,n,i){const a=this;return Pe(e,o,"gfmFootnoteDefinitionIndent",5);function o(s){const u=a.events[a.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?n(s):i(s)}}function kL(e){let i=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:s,resolveAll:o};return i==null&&(i=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function o(u,f){let h=-1;for(;++h<u.length;)if(u[h][0]==="enter"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._close){let d=h;for(;d--;)if(u[d][0]==="exit"&&u[d][1].type==="strikethroughSequenceTemporary"&&u[d][1]._open&&u[h][1].end.offset-u[h][1].start.offset===u[d][1].end.offset-u[d][1].start.offset){u[h][1].type="strikethroughSequence",u[d][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},u[d][1].start),end:Object.assign({},u[h][1].end)},m={type:"strikethroughText",start:Object.assign({},u[d][1].end),end:Object.assign({},u[h][1].start)},x=[["enter",g,f],["enter",u[d][1],f],["exit",u[d][1],f],["enter",m,f]],b=f.parser.constructs.insideSpan.null;b&&wn(x,x.length,0,xf(b,u.slice(d+1,h),f)),wn(x,x.length,0,[["exit",m,f],["enter",u[h][1],f],["exit",u[h][1],f],["exit",g,f]]),wn(u,d-1,h-d+3,x),h=d+x.length-2;break}}for(h=-1;++h<u.length;)u[h][1].type==="strikethroughSequenceTemporary"&&(u[h][1].type="data");return u}function s(u,f,h){const d=this.previous,g=this.events;let m=0;return x;function x(w){return d===126&&g[g.length-1][1].type!=="characterEscape"?h(w):(u.enter("strikethroughSequenceTemporary"),b(w))}function b(w){const E=gl(d);if(w===126)return m>1?h(w):(u.consume(w),m++,b);if(m<2&&!i)return h(w);const N=u.exit("strikethroughSequenceTemporary"),_=gl(w);return N._open=!_||_===2&&!!E,N._close=!E||E===2&&!!_,f(w)}}}class EL{constructor(){this.map=[]}add(n,i,a){NL(this,n,i,a)}consume(n){if(this.map.sort(function(s,u){return s[0]-u[0]}),this.map.length===0)return;let i=this.map.length;const a=[];for(;i>0;)i-=1,a.push(n.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),n.length=this.map[i][0];a.push(n.slice()),n.length=0;let o=a.pop();for(;o;){for(const s of o)n.push(s);o=a.pop()}this.map.length=0}}function NL(e,n,i,a){let o=0;if(!(i===0&&a.length===0)){for(;o<e.map.length;){if(e.map[o][0]===n){e.map[o][1]+=i,e.map[o][2].push(...a);return}o+=1}e.map.push([n,i,a])}}function CL(e,n){let i=!1;const a=[];for(;n<e.length;){const o=e[n];if(i){if(o[0]==="enter")o[1].type==="tableContent"&&a.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const s=a.length-1;a[s]=a[s]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(i=!0);n+=1}return a}function ML(){return{flow:{null:{name:"table",tokenize:TL,resolveAll:AL}}}}function TL(e,n,i){const a=this;let o=0,s=0,u;return f;function f(q){let V=a.events.length-1;for(;V>-1;){const O=a.events[V][1].type;if(O==="lineEnding"||O==="linePrefix")V--;else break}const P=V>-1?a.events[V][1].type:null,te=P==="tableHead"||P==="tableRow"?A:h;return te===A&&a.parser.lazy[a.now().line]?i(q):te(q)}function h(q){return e.enter("tableHead"),e.enter("tableRow"),d(q)}function d(q){return q===124||(u=!0,s+=1),g(q)}function g(q){return q===null?i(q):Se(q)?s>1?(s=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),b):i(q):Be(q)?Pe(e,g,"whitespace")(q):(s+=1,u&&(u=!1,o+=1),q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),u=!0,g):(e.enter("data"),m(q)))}function m(q){return q===null||q===124||rt(q)?(e.exit("data"),g(q)):(e.consume(q),q===92?x:m)}function x(q){return q===92||q===124?(e.consume(q),m):m(q)}function b(q){return a.interrupt=!1,a.parser.lazy[a.now().line]?i(q):(e.enter("tableDelimiterRow"),u=!1,Be(q)?Pe(e,w,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):w(q))}function w(q){return q===45||q===58?N(q):q===124?(u=!0,e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),E):L(q)}function E(q){return Be(q)?Pe(e,N,"whitespace")(q):N(q)}function N(q){return q===58?(s+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),_):q===45?(s+=1,_(q)):q===null||Se(q)?C(q):L(q)}function _(q){return q===45?(e.enter("tableDelimiterFiller"),D(q)):L(q)}function D(q){return q===45?(e.consume(q),D):q===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(q))}function k(q){return Be(q)?Pe(e,C,"whitespace")(q):C(q)}function C(q){return q===124?w(q):q===null||Se(q)?!u||o!==s?L(q):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(q)):L(q)}function L(q){return i(q)}function A(q){return e.enter("tableRow"),H(q)}function H(q){return q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),H):q===null||Se(q)?(e.exit("tableRow"),n(q)):Be(q)?Pe(e,H,"whitespace")(q):(e.enter("data"),F(q))}function F(q){return q===null||q===124||rt(q)?(e.exit("data"),H(q)):(e.consume(q),q===92?G:F)}function G(q){return q===92||q===124?(e.consume(q),F):F(q)}}function AL(e,n){let i=-1,a=!0,o=0,s=[0,0,0,0],u=[0,0,0,0],f=!1,h=0,d,g,m;const x=new EL;for(;++i<e.length;){const b=e[i],w=b[1];b[0]==="enter"?w.type==="tableHead"?(f=!1,h!==0&&(pv(x,n,h,d,g),g=void 0,h=0),d={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(i,0,[["enter",d,n]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(a=!0,m=void 0,s=[0,0,0,0],u=[0,i+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(i,0,[["enter",g,n]])),o=w.type==="tableDelimiterRow"?2:g?3:1):o&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(a=!1,u[2]===0&&(s[1]!==0&&(u[0]=u[1],m=wc(x,n,s,o,void 0,m),s=[0,0,0,0]),u[2]=i)):w.type==="tableCellDivider"&&(a?a=!1:(s[1]!==0&&(u[0]=u[1],m=wc(x,n,s,o,void 0,m)),s=u,u=[s[1],i,0,0])):w.type==="tableHead"?(f=!0,h=i):w.type==="tableRow"||w.type==="tableDelimiterRow"?(h=i,s[1]!==0?(u[0]=u[1],m=wc(x,n,s,o,i,m)):u[1]!==0&&(m=wc(x,n,u,o,i,m)),o=0):o&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(u[3]=i)}for(h!==0&&pv(x,n,h,d,g),x.consume(n.events),i=-1;++i<n.events.length;){const b=n.events[i];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=CL(n.events,i))}return e}function wc(e,n,i,a,o,s){const u=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";i[0]!==0&&(s.end=Object.assign({},Wa(n.events,i[0])),e.add(i[0],0,[["exit",s,n]]));const h=Wa(n.events,i[1]);if(s={type:u,start:Object.assign({},h),end:Object.assign({},h)},e.add(i[1],0,[["enter",s,n]]),i[2]!==0){const d=Wa(n.events,i[2]),g=Wa(n.events,i[3]),m={type:f,start:Object.assign({},d),end:Object.assign({},g)};if(e.add(i[2],0,[["enter",m,n]]),a!==2){const x=n.events[i[2]],b=n.events[i[3]];if(x[1].end=Object.assign({},b[1].end),x[1].type="chunkText",x[1].contentType="text",i[3]>i[2]+1){const w=i[2]+1,E=i[3]-i[2]-1;e.add(w,E,[])}}e.add(i[3]+1,0,[["exit",m,n]])}return o!==void 0&&(s.end=Object.assign({},Wa(n.events,o)),e.add(o,0,[["exit",s,n]]),s=void 0),s}function pv(e,n,i,a,o){const s=[],u=Wa(n.events,i);o&&(o.end=Object.assign({},u),s.push(["exit",o,n])),a.end=Object.assign({},u),s.push(["exit",a,n]),e.add(i+1,0,s)}function Wa(e,n){const i=e[n],a=i[0]==="enter"?"start":"end";return i[1][a]}const zL={name:"tasklistCheck",tokenize:DL};function jL(){return{text:{91:zL}}}function DL(e,n,i){const a=this;return o;function o(h){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?i(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),s)}function s(h){return rt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),u):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),u):i(h)}function u(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):i(h)}function f(h){return Se(h)?n(h):Be(h)?e.check({tokenize:RL},n,i)(h):i(h)}}function RL(e,n,i){return Pe(e,a,"whitespace");function a(o){return o===null?i(o):n(o)}}function OL(e){return f2([lL(),gL(),kL(e),ML(),jL()])}const LL={};function mv(e){const n=this,i=e||LL,a=n.data(),o=a.micromarkExtensions||(a.micromarkExtensions=[]),s=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),u=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);o.push(OL(i)),s.push(nL()),u.push(iL(i))}function HL(){const{isRunning:e,results:n,workflowResults:i,logs:a}=gs(),{nodes:o,selectedNodeId:s,updateNode:u}=Hi(),f=Hi(dS),{execute:h,generatedFiles:d,downloadFile:g,downloadAllFiles:m}=GS(),[x,b]=Q.useState("");Q.useEffect(()=>{if(f?.type==="input"){const C=f.data;b(C.value||"")}},[s,f]);const w=o.filter(C=>C.type==="output"),E=w.length>0?n.get(w[0].id):null,N=f?.type==="input",_=N?f.data:null,D=C=>{b(C),s&&u(s,{value:C})},k=()=>{h()};return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(oS,{className:"w-5 h-5 text-gray-400"}),v.jsx("h3",{className:"text-lg font-semibold text-white",children:"Preview"})]}),e&&v.jsx("span",{className:"text-sm text-blue-400 animate-pulse",children:"Running..."})]}),e&&v.jsx("div",{className:"p-4 border-b border-border",children:v.jsx("div",{className:"space-y-3",children:o.map(C=>v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${C.data.status==="completed"?"bg-green-500":C.data.status==="running"?"bg-blue-500 animate-pulse":C.data.status==="error"?"bg-red-500":"bg-gray-500"}`}),v.jsx("span",{className:"text-sm text-gray-300",children:C.data.label}),C.data.status==="running"&&C.data.progress!==void 0&&v.jsxs("span",{className:"text-xs text-gray-500",children:[C.data.progress,"%"]})]},C.id))})}),v.jsxs("div",{className:"p-4 border-b border-border",children:[v.jsxs("button",{onClick:k,disabled:e||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:[v.jsx(Em,{className:"w-4 h-4"}),e?"Running...":"Run Workflow"]}),o.length===0&&v.jsx("p",{className:"text-xs text-gray-500 text-center mt-2",children:"노드를 추가해주세요"})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[N&&_&&v.jsxs("div",{className:"space-y-4 mb-4 p-4 bg-surface rounded-lg border border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(uf,{className:"w-5 h-5 text-amber-500"}),v.jsx("h4",{className:"text-md font-medium text-white",children:_.label})]}),_.inputType==="text"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm text-gray-400",children:_.description||"Enter your input"}),v.jsx("textarea",{className:"w-full h-32 px-3 py-2 text-sm bg-surface border border-border rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-amber-500 focus:border-transparent resize-none",placeholder:_.placeholder||"Type your message here...",value:x||_.value||"",onChange:C=>D(C.target.value)})]}),_.inputType==="file"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm text-gray-400",children:_.description||"Upload a file"}),v.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-32 border-2 border-dashed border-gray-600 rounded-lg hover:border-amber-500 transition-colors cursor-pointer",children:[v.jsx(E5,{className:"w-8 h-8 text-gray-500 mb-2"}),v.jsx("p",{className:"text-sm text-gray-400",children:"Drop files here or click to upload"}),_.fileTypes&&v.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Supported: ",_.fileTypes.join(", ")]})]})]}),_.inputType==="select"&&_.options&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm text-gray-400",children:_.description||"Select an option"}),v.jsxs("select",{className:"w-full px-3 py-2 text-sm bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-amber-500",value:x||_.value||"",onChange:C=>D(C.target.value),children:[v.jsx("option",{value:"",children:"Select..."}),_.options.map(C=>v.jsx("option",{value:C,children:C},C))]})]})]}),d.length>0&&v.jsxs("div",{className:"mb-4 p-4 bg-green-900/20 border border-green-700 rounded-lg",children:[v.jsxs("div",{className:"flex items-center justify-between mb-3",children:[v.jsx("h4",{className:"text-sm font-medium text-green-300",children:"생성된 파일"}),v.jsxs("button",{onClick:m,className:"flex items-center gap-1 px-2 py-1 text-xs bg-green-600 hover:bg-green-700 text-white rounded transition-colors",children:[v.jsx(rl,{className:"w-3 h-3"}),"전체 다운로드"]})]}),v.jsx("div",{className:"space-y-2",children:d.map((C,L)=>v.jsxs("div",{className:"flex items-center justify-between p-2 bg-surface rounded",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(al,{className:"w-4 h-4 text-blue-400"}),v.jsx("span",{className:"text-sm text-white",children:C.name})]}),v.jsx("button",{onClick:()=>g(C.name,C.content),className:"p-1 hover:bg-surface-hover rounded transition-colors",children:v.jsx(rl,{className:"w-4 h-4 text-gray-400"})})]},L))})]}),i.length>0?v.jsx("div",{className:"space-y-4",children:i.map(C=>v.jsxs("div",{className:`p-4 rounded-lg border ${C.success?"bg-surface border-border":"bg-red-900/20 border-red-700"}`,children:[v.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[C.success?v.jsx(km,{className:"w-5 h-5 text-green-500"}):v.jsx(lS,{className:"w-5 h-5 text-red-500"}),v.jsx("h5",{className:"text-sm font-medium text-white",children:C.label})]}),C.error&&v.jsx("p",{className:"text-sm text-red-400 mb-3",children:C.error}),C.files&&C.files.length>0&&v.jsxs("div",{className:"space-y-2 mb-3",children:[v.jsx("p",{className:"text-xs text-gray-400",children:"생성된 파일:"}),C.files.map((L,A)=>v.jsxs("div",{className:"flex items-center gap-2 p-2 bg-surface-hover rounded",children:[L.type==="image"?v.jsx(sS,{className:"w-4 h-4 text-purple-400"}):v.jsx(al,{className:"w-4 h-4 text-blue-400"}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("p",{className:"text-sm text-white truncate",children:L.name}),v.jsx("p",{className:"text-xs text-gray-500 truncate",children:L.path})]})]},A))]}),C.result&&v.jsxs("details",{className:"group",open:!0,children:[v.jsx("summary",{className:"text-xs text-gray-400 cursor-pointer hover:text-gray-300",children:"결과 보기"}),v.jsx("div",{className:"mt-2 p-2 bg-black/30 rounded max-h-64 overflow-y-auto",children:v.jsx("div",{className:"markdown-content text-sm",children:v.jsx(ov,{remarkPlugins:[mv],children:C.result.length>2e3?C.result.substring(0,2e3)+"...":C.result})})})]})]},C.nodeId))}):E?v.jsx("div",{className:"markdown-content",children:v.jsx(ov,{remarkPlugins:[mv],children:typeof E=="string"?E:JSON.stringify(E,null,2)})}):a.length>0?v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-sm font-medium text-white mb-3",children:"실행 로그"}),a.slice(-20).map(C=>v.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[v.jsx("span",{className:"text-gray-500 shrink-0",children:new Date(C.timestamp).toLocaleTimeString("ko-KR")}),v.jsx("span",{className:C.level==="error"?"text-red-400":C.level==="warning"?"text-yellow-400":C.level==="success"?"text-green-400":"text-gray-300",children:C.message})]},C.id))]}):v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500",children:[v.jsx(al,{className:"w-12 h-12 mb-4 opacity-50"}),v.jsx("p",{className:"text-sm",children:"Run the workflow to see results"}),v.jsx("p",{className:"text-xs mt-2",children:"노드를 연결하고 Run Workflow 버튼을 클릭하세요"})]})]}),(E||d.length>0)&&v.jsx("div",{className:"flex items-center gap-2 p-4 border-t border-border",children:v.jsxs("button",{onClick:m,disabled:d.length===0,className:"flex items-center gap-2 px-3 py-2 bg-surface-hover rounded-lg text-sm hover:bg-border transition-colors disabled:opacity-50",children:[v.jsx(rl,{className:"w-4 h-4"}),"Download .md"]})})]})}function t_({level:e}){switch(e){case"success":return v.jsx(km,{className:"w-4 h-4 text-green-400"});case"error":return v.jsx(lS,{className:"w-4 h-4 text-red-400"});case"warning":return v.jsx(_5,{className:"w-4 h-4 text-yellow-400"});default:return v.jsx(J3,{className:"w-4 h-4 text-blue-400"})}}function n_(e){return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function BL({isOpen:e,onClose:n}){const{logs:i,clearLogs:a,isRunning:o}=gs(),[s,u]=Q.useState(!1),[f,h]=Q.useState(250),d=Q.useRef(null);Q.useEffect(()=>{d.current&&!s&&d.current.scrollIntoView({behavior:"smooth"})},[i,s]);const g=m=>{m.preventDefault();const x=m.clientY,b=f,w=N=>{const _=x-N.clientY,D=Math.min(Math.max(b+_,100),500);h(D)},E=()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",E)};document.addEventListener("mousemove",w),document.addEventListener("mouseup",E)};return e?v.jsxs("div",{className:"fixed bottom-0 left-0 right-0 bg-[#1a1a1a] border-t border-gray-700 z-50 shadow-2xl",style:{height:s?40:f},children:[!s&&v.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 cursor-ns-resize hover:bg-amber-500 transition-colors",onMouseDown:g}),v.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-[#252525] border-b border-gray-700",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(ra,{className:"w-4 h-4 text-amber-500"}),v.jsx("span",{className:"text-sm font-medium text-white",children:"Console"}),o&&v.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-500/20 text-blue-400 rounded",children:[v.jsx("span",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full animate-pulse"}),"Running"]}),v.jsxs("span",{className:"text-xs text-gray-500",children:["(",i.length," logs)"]})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("button",{onClick:a,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Clear logs",children:v.jsx(cf,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:()=>u(!s),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:s?"Expand":"Minimize",children:s?v.jsx(L3,{className:"w-4 h-4 text-gray-400"}):v.jsx(R3,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:()=>h(f===250?400:250),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Toggle size",children:f>250?v.jsx(s5,{className:"w-4 h-4 text-gray-400"}):v.jsx(a5,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:n,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Close",children:v.jsx(Nm,{className:"w-4 h-4 text-gray-400"})})]})]}),!s&&v.jsx("div",{className:"overflow-y-auto font-mono text-sm p-3",style:{height:f-44},children:i.length===0?v.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:v.jsx("p",{children:"No logs yet. Run the workflow to see output."})}):v.jsxs("div",{className:"space-y-1",children:[i.map(m=>v.jsxs("div",{className:Xt("flex items-start gap-2 px-2 py-1 rounded hover:bg-gray-800/50",m.level==="error"&&"bg-red-500/10",m.level==="warning"&&"bg-yellow-500/10",m.level==="success"&&"bg-green-500/10"),children:[v.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",n_(m.timestamp),"]"]}),v.jsx(t_,{level:m.level}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("span",{className:Xt("text-xs",m.level==="error"&&"text-red-400",m.level==="warning"&&"text-yellow-400",m.level==="success"&&"text-green-400",m.level==="info"&&"text-gray-300"),children:m.message}),m.nodeId&&v.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",m.nodeId.slice(0,8),"]"]}),m.details&&v.jsx("pre",{className:"mt-1 p-2 bg-black/30 rounded text-xs text-gray-400 overflow-x-auto",children:typeof m.details=="string"?m.details:JSON.stringify(m.details,null,2)})]})]},m.id)),v.jsx("div",{ref:d})]})})]}):null}function UL(){const{logs:e,clearLogs:n,isRunning:i}=gs(),a=Q.useRef(null);return Q.useEffect(()=>{a.current&&a.current.scrollIntoView({behavior:"smooth"})},[e]),v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(ra,{className:"w-5 h-5 text-amber-500"}),v.jsx("h3",{className:"text-lg font-semibold text-white",children:"Console"}),i&&v.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-500/20 text-blue-400 rounded",children:[v.jsx("span",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full animate-pulse"}),"Running"]}),v.jsxs("span",{className:"text-xs text-gray-500",children:["(",e.length," logs)"]})]}),v.jsx("button",{onClick:n,className:"p-2 text-gray-400 hover:text-white hover:bg-surface-hover rounded-lg transition-colors",title:"Clear logs",children:v.jsx(cf,{className:"w-4 h-4"})})]}),v.jsx("div",{className:"flex-1 overflow-y-auto p-4 font-mono text-sm",children:e.length===0?v.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:v.jsx("p",{children:"No logs yet. Run the workflow to see output."})}):v.jsxs("div",{className:"space-y-1",children:[e.map(o=>v.jsxs("div",{className:Xt("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:[v.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",n_(o.timestamp),"]"]}),v.jsx(t_,{level:o.level}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("span",{className:Xt("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&&v.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",o.nodeId.slice(0,8),"]"]}),o.details&&v.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)),v.jsx("div",{ref:a})]})})]})}const IL=["Read","Write","Edit","Bash","Glob","Grep","WebSearch","WebFetch","Task","TodoWrite"],qL=[{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 $L(e){switch(e){case"input":return v.jsx(uf,{className:"w-5 h-5 text-yellow-400"});case"subagent":return v.jsx(ms,{className:"w-5 h-5 text-purple-400"});case"skill":return v.jsx(ff,{className:"w-5 h-5 text-cyan-400"});case"command":return v.jsx(ra,{className:"w-5 h-5 text-orange-400"});case"hook":return v.jsx(_m,{className:"w-5 h-5 text-pink-400"});case"output":return v.jsx(sf,{className:"w-5 h-5 text-emerald-400"});default:return null}}function VL(e){switch(e){case"input":return"User Input";case"subagent":return"Sub Agent";case"skill":return"Skill";case"command":return"Command";case"hook":return"Hook";case"output":return"Output";default:return"Node"}}function PL({node:e}){const{updateNode:n,removeNode:i}=Hi();if(!e)return v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500 p-8",children:[v.jsx(y5,{className:"w-12 h-12 mb-4 opacity-50"}),v.jsx("p",{className:"text-center",children:"Select a node to configure its settings"})]});const a=()=>{i(e.id)},o=u=>{n(e.id,{label:u})},s=u=>{n(e.id,{description:u})};return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border bg-surface-hover/50",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:"p-2 rounded-lg bg-surface",children:$L(e.type)}),v.jsxs("div",{children:[v.jsx("h3",{className:"text-base font-semibold text-white",children:e.data.label}),v.jsx("p",{className:"text-xs text-gray-500",children:VL(e.type)})]})]}),v.jsx("button",{onClick:a,className:"p-2 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded-lg transition-colors",title:"Delete node",children:v.jsx(cf,{className:"w-4 h-4"})})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-5",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Name"}),v.jsx("input",{type:"text",value:e.data.label,onChange:u=>o(u.target.value),className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent transition-all"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:e.type==="subagent"?"Prompt":"Description"}),v.jsx("textarea",{value:e.data.description||"",onChange:u=>s(u.target.value),rows:4,placeholder:e.type==="subagent"?"Enter instructions for this agent...":"Describe what this step does...",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent transition-all resize-none"})]}),e.type==="input"&&v.jsx(YL,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="subagent"&&v.jsx(XL,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="skill"&&v.jsx(FL,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="command"&&v.jsx(GL,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="hook"&&v.jsx(ZL,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="output"&&v.jsx(QL,{onUpdate:u=>n(e.id,u)})]})]})}function YL({data:e,onUpdate:n}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Input Type"}),v.jsx("div",{className:"grid grid-cols-3 gap-2",children:["text","file","select"].map(i=>v.jsx("button",{onClick:()=>n({inputType:i}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.inputType===i?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:i.charAt(0).toUpperCase()+i.slice(1)},i))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Default Value"}),v.jsx("textarea",{value:e.value||"",onChange:i=>n({value:i.target.value}),rows:3,placeholder:"Enter default value...",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent resize-none"})]})]})}function XL({data:e,onUpdate:n}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Model"}),v.jsx("div",{className:"space-y-2",children:qL.map(i=>v.jsxs("button",{onClick:()=>n({model:i.id}),className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-colors ${e.model===i.id?"bg-accent/20 border-accent":"bg-surface-hover border-border hover:border-gray-500"}`,children:[v.jsx(ms,{className:"w-5 h-5 text-purple-400"}),v.jsxs("div",{className:"text-left",children:[v.jsx("div",{className:"font-medium text-white",children:i.name}),v.jsx("div",{className:"text-xs text-gray-500",children:i.description})]})]},i.id))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Allowed Tools"}),v.jsx("div",{className:"grid grid-cols-2 gap-2",children:IL.map(i=>v.jsxs("label",{className:"flex items-center gap-2 p-2 bg-surface-hover rounded-lg cursor-pointer hover:bg-border transition-colors",children:[v.jsx("input",{type:"checkbox",checked:e.tools?.includes(i)??!1,onChange:a=>{const o=a.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"}),v.jsx("span",{className:"text-sm text-gray-300",children:i})]},i))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"System Prompt"}),v.jsx("textarea",{value:e.systemPrompt||"",onChange:i=>n({systemPrompt:i.target.value}),rows:4,placeholder:"Enter custom instructions for this agent...",className:"w-full px-3 py-2 bg-surface-hover border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent resize-none"})]})]})}function FL({data:e,onUpdate:n}){const i=[{id:"ppt-generator",name:"PPT Generator",description:"Create PowerPoint presentations"},{id:"image-gen-nanobanana",name:"Image Generator",description:"Generate images with AI"},{id:"pdf",name:"PDF Processor",description:"Process and create PDF documents"},{id:"xlsx",name:"Excel Processor",description:"Work with spreadsheets"},{id:"docx",name:"Word Processor",description:"Create and edit documents"}];return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Skill Type"}),v.jsx("div",{className:"grid grid-cols-2 gap-2 mb-4",children:["official","custom"].map(a=>v.jsx("button",{onClick:()=>n({skillType:a}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.skillType===a?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:a.charAt(0).toUpperCase()+a.slice(1)},a))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Select Skill"}),v.jsx("div",{className:"space-y-2",children:i.map(a=>v.jsxs("button",{onClick:()=>n({skillId:a.id}),className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-colors text-left ${e.skillId===a.id?"bg-accent/20 border-accent":"bg-surface border-border hover:border-gray-500"}`,children:[v.jsx(ff,{className:"w-5 h-5 text-cyan-400"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-medium text-white",children:a.name}),v.jsx("div",{className:"text-xs text-gray-500",children:a.description})]})]},a.id))})]})]})}function GL({data:e,onUpdate:n}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Command Name"}),v.jsx("input",{type:"text",value:e.commandName||"",onChange:i=>n({commandName:i.target.value}),placeholder:"e.g., commit, review-pr",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent"}),v.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Slash command to execute (without /)"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Command Path (optional)"}),v.jsx("input",{type:"text",value:e.commandPath||"",onChange:i=>n({commandPath:i.target.value}),placeholder:"e.g., .claude/commands/my-command.md",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent"})]})]})}function ZL({data:e,onUpdate:n}){const i=["PreToolUse","PostToolUse","Notification","Stop"];return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Hook Event"}),v.jsx("div",{className:"grid grid-cols-2 gap-2",children:i.map(a=>v.jsx("button",{onClick:()=>n({hookEvent:a}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.hookEvent===a?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:a},a))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Tool Matcher (optional)"}),v.jsx("input",{type:"text",value:e.hookMatcher||"",onChange:a=>n({hookMatcher:a.target.value}),placeholder:"e.g., Bash, Write, Edit",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent"}),v.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Filter by tool name pattern"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Hook Command"}),v.jsx("input",{type:"text",value:e.hookCommand||"",onChange:a=>n({hookCommand:a.target.value}),placeholder:"e.g., npm run lint",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent"}),v.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Shell command to execute"})]})]})}function QL({onUpdate:e}){const n=[{id:"auto",name:"Auto Format",description:"Automatically format output"},{id:"markdown",name:"Markdown",description:"Plain markdown text"},{id:"document",name:"Document",description:"Formatted document output"}];return v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Output Format"}),v.jsx("div",{className:"space-y-2",children:n.map(i=>v.jsxs("button",{onClick:()=>e({layoutType:i.id}),className:"w-full flex items-center gap-3 p-3 rounded-lg border bg-surface-hover border-border hover:border-gray-500 transition-colors text-left",children:[v.jsx(sf,{className:"w-5 h-5 text-emerald-400"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-medium text-white",children:i.name}),v.jsx("div",{className:"text-xs text-gray-500",children:i.description})]})]},i.id))})]})}const KL=[{id:"preview",label:"Preview"},{id:"console",label:"Console"},{id:"step",label:"Step"},{id:"theme",label:"Theme"}];function JL(){const{activeTab:e,setActiveTab:n}=Rm(),i=Hi(dS);return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsx("div",{className:"flex items-center gap-1 p-2 border-b border-border",children:KL.map(a=>v.jsx("button",{onClick:()=>n(a.id),className:Xt("px-4 py-2 text-sm font-medium rounded-lg transition-colors",e===a.id?"bg-surface-hover text-white":"text-gray-400 hover:text-white hover:bg-surface-hover/50"),children:a.label},a.id))}),v.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="preview"&&v.jsx(HL,{}),e==="console"&&v.jsx(UL,{}),e==="step"&&v.jsx(PL,{node:i}),e==="theme"&&v.jsx("div",{className:"p-4 text-gray-500",children:"Theme customization coming soon..."})]})]})}async function WL(e){let n;const{apiMode:i,apiKey:a,proxyUrl:o}=Dm.getState(),s={"Content-Type":"application/json","X-API-Mode":i};i==="direct"&&a?s["X-API-Key"]=a: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 u;try{u=await n.json()}catch{throw new Error("서버 응답을 파싱할 수 없습니다.")}return{workflow:t9(u),workflowName:u.workflowName}}function e9(e,n){if(e.length===0)return e;const i=300,a=150,o=100,s=100,u=new Map,f=new Map;e.forEach(w=>{u.set(w.id,[]),f.set(w.id,[])}),n.forEach(w=>{const E=u.get(w.target)||[];E.push(w.source),u.set(w.target,E);const N=f.get(w.source)||[];N.push(w.target),f.set(w.source,N)});const h=e.filter(w=>(u.get(w.id)||[]).length===0),d=new Map,g=[];for(h.forEach(w=>{d.set(w.id,0),g.push({id:w.id,depth:0})}),h.length===0&&e.length>0&&(d.set(e[0].id,0),g.push({id:e[0].id,depth:0}));g.length>0;){const w=g.shift();(f.get(w.id)||[]).forEach(N=>{const _=d.get(N),D=w.depth+1;(_===void 0||D>_)&&(d.set(N,D),g.push({id:N,depth:D}))})}const m=new Map;d.forEach((w,E)=>{const N=m.get(w)||[];N.push(E),m.set(w,N)});const x=Math.max(...Array.from(d.values()),0),b=new Map;for(let w=0;w<=x;w++){const E=m.get(w)||[],_=(E.length-1)*a,D=s+(300-_)/2;E.forEach((k,C)=>{b.set(k,{x:o+w*i,y:D+C*a})})}return e.map(w=>{const E=b.get(w.id)||w.position;return{...w,position:E}})}function t9(e){const n=[],i=new Map,a={x:0,y:0};e.nodes.forEach((u,f)=>{const h=rs();i.set(f,h);const d={label:u.label,description:u.description,status:"idle",usedInputs:[]};switch(u.type){case"input":n.push({id:h,type:"input",position:{...a},data:{...d,inputType:u.config.inputType||"text",placeholder:u.config.placeholder||u.description}});break;case"subagent":n.push({id:h,type:"subagent",position:{...a},data:{...d,role:u.config.role||"custom",tools:u.config.tools||["Read","Write"],model:u.config.model||"sonnet",systemPrompt:u.config.systemPrompt}});break;case"skill":n.push({id:h,type:"skill",position:{...a},data:{...d,skillType:u.config.skillType||"official",skillId:u.config.skillId,skillContent:u.config.skillContent}});break;case"command":n.push({id:h,type:"command",position:{...a},data:{...d,commandName:u.config.commandName||u.label,commandPath:u.config.commandPath}});break;case"hook":n.push({id:h,type:"hook",position:{...a},data:{...d,hookEvent:u.config.hookEvent||"PreToolUse",hookMatcher:u.config.hookMatcher,hookCommand:u.config.hookCommand}});break;case"output":n.push({id:h,type:"output",position:{...a},data:{...d,outputType:u.config.outputType||"auto"}});break}}),e.edges.forEach(u=>{const f=i.get(u.to),h=i.get(u.from);if(f&&h){const d=n.find(g=>g.id===f);d&&d.data.usedInputs&&d.data.usedInputs.push(h)}});const o=e.edges.map(u=>{const f=i.get(u.from),h=i.get(u.to);return!f||!h?null:{id:`e-${f}-${h}`,source:f,target:h,animated:!0}}).filter(u=>u!==null);return{nodes:e9(n,o),edges:o}}function n9(e){const n=e.toLowerCase();if(n.includes("스킬")||n.includes("skill"))return!0;const i=[/만들어\s*(줘|주세요|줘요)/,/작성해\s*(줘|주세요|줘요)/,/생성해\s*(줘|주세요|줘요)/];for(const a of i)if(a.test(e))return!0;return!1}async function i9(e){const{apiMode:n,apiKey:i,proxyUrl:a}=Dm.getState(),o={"Content-Type":"application/json","X-API-Mode":n};n==="direct"&&i?o["X-API-Key"]=i:n==="proxy"&&a&&(o["X-Proxy-URL"]=a);try{const s=await fetch("/api/generate/skill",{method:"POST",headers:o,body:JSON.stringify({prompt:e})});if(!s.ok){let u=`서버 오류 (${s.status})`;try{u=(await s.json()).message||u}catch{}return{success:!1,error:u}}return await s.json()}catch{return{success:!1,error:"서버에 연결할 수 없습니다. 서버가 실행 중인지 확인하세요."}}}function r9(){const[e,n]=Q.useState(""),[i,a]=Q.useState(!1),[o,s]=Q.useState(null),[u,f]=Q.useState(null),[h,d]=Q.useState("workflow"),{loadWorkflow:g}=Hi(),m=async()=>{if(!e.trim()||i)return;a(!0),s(null),f(null);const b=n9(e);d(b?"skill":"workflow");try{if(b){const w=await i9(e);if(w.success&&w.skill)f(`스킬 "${w.skill.skillName}"이 ${w.savedPath}에 저장되었습니다!`),n(""),setTimeout(()=>f(null),5e3);else throw new Error(w.error||"스킬 생성에 실패했습니다.")}else{const{workflow:w,workflowName:E}=await WL(e);g({nodes:w.nodes,edges:w.edges,name:E}),n("")}}catch(w){console.error("Generation failed:",w);const E=w instanceof Error?w.message:"생성에 실패했습니다.";s(E)}finally{a(!1)}},x=b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),m())};return v.jsxs("div",{className:"bg-surface border border-border rounded-2xl px-5 py-3 shadow-2xl flex items-center gap-3",children:[v.jsx(ms,{className:"w-5 h-5 text-accent flex-shrink-0"}),v.jsx("input",{type:"text",value:e,onChange:b=>n(b.target.value),onKeyDown:x,placeholder:"Describe your workflow... (e.g., 'Create an HTML page with images')",className:"flex-1 bg-transparent border-none outline-none text-white placeholder-gray-500 text-sm",disabled:i}),v.jsx("button",{onClick:m,disabled:!e.trim()||i,className:`p-2 rounded-full transition-all duration-200 ${e.trim()&&!i?"bg-accent text-white hover:bg-accent-hover hover:scale-105":"bg-surface-hover text-gray-500"}`,title:"Generate Workflow",children:i?v.jsx(uS,{className:"w-5 h-5 animate-spin"}):v.jsx(h5,{className:"w-5 h-5"})}),v.jsx("div",{className:"absolute -bottom-6 left-1/2 -translate-x-1/2 text-xs whitespace-nowrap",children:o?v.jsx("span",{className:"text-red-400",children:o}):u?v.jsxs("span",{className:"text-green-400 flex items-center gap-1",children:[v.jsx(km,{className:"w-3 h-3"}),u]}):i?v.jsxs("span",{className:"text-accent",children:["AI가 ",h==="skill"?"스킬":"워크플로우","을 생성하고 있습니다..."]}):v.jsx("span",{className:"text-gray-600",children:'"스킬 만들어줘" 또는 워크플로우 설명을 입력하세요'})})]})}function a9(){const{isCollapsed:e,width:n}=Rm(),{isRunning:i,logs:a}=gs(),[o,s]=Q.useState(!1);return Q.useEffect(()=>{i&&s(!0)},[i]),v.jsx(tS,{children:v.jsxs("div",{className:"flex flex-col h-screen bg-canvas",children:[v.jsx(Fz,{}),v.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[v.jsxs("div",{className:"flex-1 flex flex-col",children:[v.jsx(Qz,{}),v.jsxs("div",{className:"flex-1 relative",children:[v.jsx(pj,{}),v.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 w-full max-w-2xl px-4",children:v.jsx(r9,{})})]})]}),!e&&v.jsx("div",{className:"border-l border-border bg-surface",style:{width:`${n}px`},children:v.jsx(JL,{})})]}),v.jsxs("button",{onClick:()=>s(!o),className:`fixed bottom-4 left-4 z-40 flex items-center gap-2 px-3 py-2 rounded-lg shadow-lg transition-all ${o?"bg-amber-600 text-white":"bg-gray-800 text-gray-300 hover:bg-gray-700"} ${o?"opacity-0 pointer-events-none":"opacity-100"}`,children:[v.jsx(ra,{className:"w-4 h-4"}),v.jsx("span",{className:"text-sm font-medium",children:"Console"}),a.length>0&&!o&&v.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-amber-500 text-white rounded-full",children:a.length}),i&&v.jsx("span",{className:"w-2 h-2 bg-green-400 rounded-full animate-pulse"})]}),v.jsx(BL,{isOpen:o,onClose:()=>s(!1)})]})})}gE.createRoot(document.getElementById("root")).render(v.jsx(Q.StrictMode,{children:v.jsx(a9,{})}));
|