emviz 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const u of r)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function s(r){const u={};return r.integrity&&(u.integrity=r.integrity),r.referrerPolicy&&(u.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?u.credentials="include":r.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(r){if(r.ep)return;r.ep=!0;const u=s(r);fetch(r.href,u)}})();function Ev(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Od={exports:{}},Ja={};var Gy;function px(){if(Gy)return Ja;Gy=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function s(a,r,u){var c=null;if(u!==void 0&&(c=""+u),r.key!==void 0&&(c=""+r.key),"key"in r){u={};for(var m in r)m!=="key"&&(u[m]=r[m])}else u=r;return r=u.ref,{$$typeof:t,type:a,key:c,ref:r!==void 0?r:null,props:u}}return Ja.Fragment=i,Ja.jsx=s,Ja.jsxs=s,Ja}var Xy;function yx(){return Xy||(Xy=1,Od.exports=px()),Od.exports}var z=yx(),zd={exports:{}},we={};var Ky;function vx(){if(Ky)return we;Ky=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),y=Symbol.iterator;function w(C){return C===null||typeof C!="object"?null:(C=y&&C[y]||C["@@iterator"],typeof C=="function"?C:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,N={};function S(C,$,P){this.props=C,this.context=$,this.refs=N,this.updater=P||E}S.prototype.isReactComponent={},S.prototype.setState=function(C,$){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,$,"setState")},S.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function O(){}O.prototype=S.prototype;function x(C,$,P){this.props=C,this.context=$,this.refs=N,this.updater=P||E}var M=x.prototype=new O;M.constructor=x,_(M,S.prototype),M.isPureReactComponent=!0;var R=Array.isArray;function L(){}var H={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function Y(C,$,P){var ie=P.ref;return{$$typeof:t,type:C,key:$,ref:ie!==void 0?ie:null,props:P}}function ae(C,$){return Y(C.type,$,C.props)}function K(C){return typeof C=="object"&&C!==null&&C.$$typeof===t}function I(C){var $={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(P){return $[P]})}var oe=/\/+/g;function B(C,$){return typeof C=="object"&&C!==null&&C.key!=null?I(""+C.key):$.toString(36)}function G(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(L,L):(C.status="pending",C.then(function($){C.status==="pending"&&(C.status="fulfilled",C.value=$)},function($){C.status==="pending"&&(C.status="rejected",C.reason=$)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function T(C,$,P,ie,re){var de=typeof C;(de==="undefined"||de==="boolean")&&(C=null);var ue=!1;if(C===null)ue=!0;else switch(de){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(C.$$typeof){case t:case i:ue=!0;break;case v:return ue=C._init,T(ue(C._payload),$,P,ie,re)}}if(ue)return re=re(C),ue=ie===""?"."+B(C,0):ie,R(re)?(P="",ue!=null&&(P=ue.replace(oe,"$&/")+"/"),T(re,$,P,"",function(Se){return Se})):re!=null&&(K(re)&&(re=ae(re,P+(re.key==null||C&&C.key===re.key?"":(""+re.key).replace(oe,"$&/")+"/")+ue)),$.push(re)),1;ue=0;var ee=ie===""?".":ie+":";if(R(C))for(var ce=0;ce<C.length;ce++)ie=C[ce],de=ee+B(ie,ce),ue+=T(ie,$,P,de,re);else if(ce=w(C),typeof ce=="function")for(C=ce.call(C),ce=0;!(ie=C.next()).done;)ie=ie.value,de=ee+B(ie,ce++),ue+=T(ie,$,P,de,re);else if(de==="object"){if(typeof C.then=="function")return T(G(C),$,P,ie,re);throw $=String(C),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return ue}function D(C,$,P){if(C==null)return C;var ie=[],re=0;return T(C,ie,"","",function(de){return $.call(P,de,re++)}),ie}function q(C){if(C._status===-1){var $=C._result;$=$(),$.then(function(P){(C._status===0||C._status===-1)&&(C._status=1,C._result=P)},function(P){(C._status===0||C._status===-1)&&(C._status=2,C._result=P)}),C._status===-1&&(C._status=0,C._result=$)}if(C._status===1)return C._result.default;throw C._result}var X=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},te={map:D,forEach:function(C,$,P){D(C,function(){$.apply(this,arguments)},P)},count:function(C){var $=0;return D(C,function(){$++}),$},toArray:function(C){return D(C,function($){return $})||[]},only:function(C){if(!K(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return we.Activity=p,we.Children=te,we.Component=S,we.Fragment=s,we.Profiler=r,we.PureComponent=x,we.StrictMode=a,we.Suspense=h,we.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,we.__COMPILER_RUNTIME={__proto__:null,c:function(C){return H.H.useMemoCache(C)}},we.cache=function(C){return function(){return C.apply(null,arguments)}},we.cacheSignal=function(){return null},we.cloneElement=function(C,$,P){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var ie=_({},C.props),re=C.key;if($!=null)for(de in $.key!==void 0&&(re=""+$.key),$)!j.call($,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&$.ref===void 0||(ie[de]=$[de]);var de=arguments.length-2;if(de===1)ie.children=P;else if(1<de){for(var ue=Array(de),ee=0;ee<de;ee++)ue[ee]=arguments[ee+2];ie.children=ue}return Y(C.type,re,ie)},we.createContext=function(C){return C={$$typeof:c,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:u,_context:C},C},we.createElement=function(C,$,P){var ie,re={},de=null;if($!=null)for(ie in $.key!==void 0&&(de=""+$.key),$)j.call($,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(re[ie]=$[ie]);var ue=arguments.length-2;if(ue===1)re.children=P;else if(1<ue){for(var ee=Array(ue),ce=0;ce<ue;ce++)ee[ce]=arguments[ce+2];re.children=ee}if(C&&C.defaultProps)for(ie in ue=C.defaultProps,ue)re[ie]===void 0&&(re[ie]=ue[ie]);return Y(C,de,re)},we.createRef=function(){return{current:null}},we.forwardRef=function(C){return{$$typeof:m,render:C}},we.isValidElement=K,we.lazy=function(C){return{$$typeof:v,_payload:{_status:-1,_result:C},_init:q}},we.memo=function(C,$){return{$$typeof:g,type:C,compare:$===void 0?null:$}},we.startTransition=function(C){var $=H.T,P={};H.T=P;try{var ie=C(),re=H.S;re!==null&&re(P,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(L,X)}catch(de){X(de)}finally{$!==null&&P.types!==null&&($.types=P.types),H.T=$}},we.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},we.use=function(C){return H.H.use(C)},we.useActionState=function(C,$,P){return H.H.useActionState(C,$,P)},we.useCallback=function(C,$){return H.H.useCallback(C,$)},we.useContext=function(C){return H.H.useContext(C)},we.useDebugValue=function(){},we.useDeferredValue=function(C,$){return H.H.useDeferredValue(C,$)},we.useEffect=function(C,$){return H.H.useEffect(C,$)},we.useEffectEvent=function(C){return H.H.useEffectEvent(C)},we.useId=function(){return H.H.useId()},we.useImperativeHandle=function(C,$,P){return H.H.useImperativeHandle(C,$,P)},we.useInsertionEffect=function(C,$){return H.H.useInsertionEffect(C,$)},we.useLayoutEffect=function(C,$){return H.H.useLayoutEffect(C,$)},we.useMemo=function(C,$){return H.H.useMemo(C,$)},we.useOptimistic=function(C,$){return H.H.useOptimistic(C,$)},we.useReducer=function(C,$,P){return H.H.useReducer(C,$,P)},we.useRef=function(C){return H.H.useRef(C)},we.useState=function(C){return H.H.useState(C)},we.useSyncExternalStore=function(C,$,P){return H.H.useSyncExternalStore(C,$,P)},we.useTransition=function(){return H.H.useTransition()},we.version="19.2.7",we}var Zy;function xo(){return Zy||(Zy=1,zd.exports=vx()),zd.exports}var F=xo();const _v=Ev(F);var Dd={exports:{}},Fa={},Ld={exports:{}},Rd={};var Qy;function bx(){return Qy||(Qy=1,(function(t){function i(T,D){var q=T.length;T.push(D);e:for(;0<q;){var X=q-1>>>1,te=T[X];if(0<r(te,D))T[X]=D,T[q]=te,q=X;else break e}}function s(T){return T.length===0?null:T[0]}function a(T){if(T.length===0)return null;var D=T[0],q=T.pop();if(q!==D){T[0]=q;e:for(var X=0,te=T.length,C=te>>>1;X<C;){var $=2*(X+1)-1,P=T[$],ie=$+1,re=T[ie];if(0>r(P,q))ie<te&&0>r(re,P)?(T[X]=re,T[ie]=q,X=ie):(T[X]=P,T[$]=q,X=$);else if(ie<te&&0>r(re,q))T[X]=re,T[ie]=q,X=ie;else break e}}return D}function r(T,D){var q=T.sortIndex-D.sortIndex;return q!==0?q:T.id-D.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var c=Date,m=c.now();t.unstable_now=function(){return c.now()-m}}var h=[],g=[],v=1,p=null,y=3,w=!1,E=!1,_=!1,N=!1,S=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function M(T){for(var D=s(g);D!==null;){if(D.callback===null)a(g);else if(D.startTime<=T)a(g),D.sortIndex=D.expirationTime,i(h,D);else break;D=s(g)}}function R(T){if(_=!1,M(T),!E)if(s(h)!==null)E=!0,L||(L=!0,I());else{var D=s(g);D!==null&&G(R,D.startTime-T)}}var L=!1,H=-1,j=5,Y=-1;function ae(){return N?!0:!(t.unstable_now()-Y<j)}function K(){if(N=!1,L){var T=t.unstable_now();Y=T;var D=!0;try{e:{E=!1,_&&(_=!1,O(H),H=-1),w=!0;var q=y;try{t:{for(M(T),p=s(h);p!==null&&!(p.expirationTime>T&&ae());){var X=p.callback;if(typeof X=="function"){p.callback=null,y=p.priorityLevel;var te=X(p.expirationTime<=T);if(T=t.unstable_now(),typeof te=="function"){p.callback=te,M(T),D=!0;break t}p===s(h)&&a(h),M(T)}else a(h);p=s(h)}if(p!==null)D=!0;else{var C=s(g);C!==null&&G(R,C.startTime-T),D=!1}}break e}finally{p=null,y=q,w=!1}D=void 0}}finally{D?I():L=!1}}}var I;if(typeof x=="function")I=function(){x(K)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,B=oe.port2;oe.port1.onmessage=K,I=function(){B.postMessage(null)}}else I=function(){S(K,0)};function G(T,D){H=S(function(){T(t.unstable_now())},D)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(T){T.callback=null},t.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<T?Math.floor(1e3/T):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_next=function(T){switch(y){case 1:case 2:case 3:var D=3;break;default:D=y}var q=y;y=D;try{return T()}finally{y=q}},t.unstable_requestPaint=function(){N=!0},t.unstable_runWithPriority=function(T,D){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var q=y;y=T;try{return D()}finally{y=q}},t.unstable_scheduleCallback=function(T,D,q){var X=t.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?X+q:X):q=X,T){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=q+te,T={id:v++,callback:D,priorityLevel:T,startTime:q,expirationTime:te,sortIndex:-1},q>X?(T.sortIndex=q,i(g,T),s(h)===null&&T===s(g)&&(_?(O(H),H=-1):_=!0,G(R,q-X))):(T.sortIndex=te,i(h,T),E||w||(E=!0,L||(L=!0,I()))),T},t.unstable_shouldYield=ae,t.unstable_wrapCallback=function(T){var D=y;return function(){var q=y;y=D;try{return T.apply(this,arguments)}finally{y=q}}}})(Rd)),Rd}var Iy;function Sx(){return Iy||(Iy=1,Ld.exports=bx()),Ld.exports}var Bd={exports:{}},bt={};var Jy;function wx(){if(Jy)return bt;Jy=1;var t=xo();function i(h){var g="https://react.dev/errors/"+h;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)g+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+h+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var a={d:{f:s,r:function(){throw Error(i(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},r=Symbol.for("react.portal");function u(h,g,v){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:p==null?null:""+p,children:h,containerInfo:g,implementation:v}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(h,g){if(h==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return bt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,bt.createPortal=function(h,g){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(i(299));return u(h,g,null,v)},bt.flushSync=function(h){var g=c.T,v=a.p;try{if(c.T=null,a.p=2,h)return h()}finally{c.T=g,a.p=v,a.d.f()}},bt.preconnect=function(h,g){typeof h=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,a.d.C(h,g))},bt.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},bt.preinit=function(h,g){if(typeof h=="string"&&g&&typeof g.as=="string"){var v=g.as,p=m(v,g.crossOrigin),y=typeof g.integrity=="string"?g.integrity:void 0,w=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;v==="style"?a.d.S(h,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:p,integrity:y,fetchPriority:w}):v==="script"&&a.d.X(h,{crossOrigin:p,integrity:y,fetchPriority:w,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},bt.preinitModule=function(h,g){if(typeof h=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var v=m(g.as,g.crossOrigin);a.d.M(h,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&a.d.M(h)},bt.preload=function(h,g){if(typeof h=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var v=g.as,p=m(v,g.crossOrigin);a.d.L(h,v,{crossOrigin:p,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},bt.preloadModule=function(h,g){if(typeof h=="string")if(g){var v=m(g.as,g.crossOrigin);a.d.m(h,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else a.d.m(h)},bt.requestFormReset=function(h){a.d.r(h)},bt.unstable_batchedUpdates=function(h,g){return h(g)},bt.useFormState=function(h,g,v){return c.H.useFormState(h,g,v)},bt.useFormStatus=function(){return c.H.useHostTransitionStatus()},bt.version="19.2.7",bt}var Fy;function Nv(){if(Fy)return Bd.exports;Fy=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(i){console.error(i)}}return t(),Bd.exports=wx(),Bd.exports}var Wy;function xx(){if(Wy)return Fa;Wy=1;var t=Sx(),i=xo(),s=Nv();function a(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)n+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var n=e,l=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(l=n.return),e=n.return;while(e)}return n.tag===3?l:null}function c(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function h(e){if(u(e)!==e)throw Error(a(188))}function g(e){var n=e.alternate;if(!n){if(n=u(e),n===null)throw Error(a(188));return n!==e?null:e}for(var l=e,o=n;;){var f=l.return;if(f===null)break;var d=f.alternate;if(d===null){if(o=f.return,o!==null){l=o;continue}break}if(f.child===d.child){for(d=f.child;d;){if(d===l)return h(f),e;if(d===o)return h(f),n;d=d.sibling}throw Error(a(188))}if(l.return!==o.return)l=f,o=d;else{for(var b=!1,A=f.child;A;){if(A===l){b=!0,l=f,o=d;break}if(A===o){b=!0,o=f,l=d;break}A=A.sibling}if(!b){for(A=d.child;A;){if(A===l){b=!0,l=d,o=f;break}if(A===o){b=!0,o=d,l=f;break}A=A.sibling}if(!b)throw Error(a(189))}}if(l.alternate!==o)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?e:n}function v(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=v(e),n!==null)return n;e=e.sibling}return null}var p=Object.assign,y=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),x=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),ae=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function I(e){return e===null||typeof e!="object"?null:(e=K&&e[K]||e["@@iterator"],typeof e=="function"?e:null)}var oe=Symbol.for("react.client.reference");function B(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case _:return"Fragment";case S:return"Profiler";case N:return"StrictMode";case R:return"Suspense";case L:return"SuspenseList";case Y:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case x:return e.displayName||"Context";case O:return(e._context.displayName||"Context")+".Consumer";case M:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case H:return n=e.displayName||null,n!==null?n:B(e.type)||"Memo";case j:n=e._payload,e=e._init;try{return B(e(n))}catch{}}return null}var G=Array.isArray,T=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},X=[],te=-1;function C(e){return{current:e}}function $(e){0>te||(e.current=X[te],X[te]=null,te--)}function P(e,n){te++,X[te]=e.current,e.current=n}var ie=C(null),re=C(null),de=C(null),ue=C(null);function ee(e,n){switch(P(de,n),P(re,e),P(ie,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?hy(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=hy(n),e=my(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(ie),P(ie,e)}function ce(){$(ie),$(re),$(de)}function Se(e){e.memoizedState!==null&&P(ue,e);var n=ie.current,l=my(n,e.type);n!==l&&(P(re,e),P(ie,l))}function be(e){re.current===e&&($(ie),$(re)),ue.current===e&&($(ue),Ka._currentValue=q)}var ge,ye;function Ee(e){if(ge===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);ge=n&&n[1]||"",ye=-1<l.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+ge+e+ye}var De=!1;function Ge(e,n){if(!e||De)return"";De=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(W){var J=W}Reflect.construct(e,[],le)}else{try{le.call()}catch(W){J=W}e.call(le.prototype)}}else{try{throw Error()}catch(W){J=W}(le=e())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(W){if(W&&J&&typeof W.stack=="string")return[W.stack,J.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=o.DetermineComponentFrameRoot(),b=d[0],A=d[1];if(b&&A){var k=b.split(`
|
|
4
|
+
`),Q=A.split(`
|
|
5
|
+
`);for(f=o=0;o<k.length&&!k[o].includes("DetermineComponentFrameRoot");)o++;for(;f<Q.length&&!Q[f].includes("DetermineComponentFrameRoot");)f++;if(o===k.length||f===Q.length)for(o=k.length-1,f=Q.length-1;1<=o&&0<=f&&k[o]!==Q[f];)f--;for(;1<=o&&0<=f;o--,f--)if(k[o]!==Q[f]){if(o!==1||f!==1)do if(o--,f--,0>f||k[o]!==Q[f]){var ne=`
|
|
6
|
+
`+k[o].replace(" at new "," at ");return e.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",e.displayName)),ne}while(1<=o&&0<=f);break}}}finally{De=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Ee(l):""}function yt(e,n){switch(e.tag){case 26:case 27:case 5:return Ee(e.type);case 16:return Ee("Lazy");case 13:return e.child!==n&&n!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return Ge(e.type,!1);case 11:return Ge(e.type.render,!1);case 1:return Ge(e.type,!0);case 31:return Ee("Activity");default:return""}}function It(e){try{var n="",l=null;do n+=yt(e,l),l=e,e=e.return;while(e);return n}catch(o){return`
|
|
7
|
+
Error generating stack: `+o.message+`
|
|
8
|
+
`+o.stack}}var Nt=Object.prototype.hasOwnProperty,At=t.unstable_scheduleCallback,Ht=t.unstable_cancelCallback,Qi=t.unstable_shouldYield,Bn=t.unstable_requestPaint,tt=t.unstable_now,jt=t.unstable_getCurrentPriorityLevel,Jt=t.unstable_ImmediatePriority,Ft=t.unstable_UserBlockingPriority,Wt=t.unstable_NormalPriority,hc=t.unstable_LowPriority,Ds=t.unstable_IdlePriority,mc=t.log,gc=t.unstable_setDisableYieldValue,Ii=null,wt=null;function _n(e){if(typeof mc=="function"&&gc(e),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(Ii,e)}catch{}}var xt=Math.clz32?Math.clz32:vc,pc=Math.log,yc=Math.LN2;function vc(e){return e>>>=0,e===0?32:31-(pc(e)/yc|0)|0}var Ls=256,Rs=262144,Bs=4194304;function kn(e){var n=e&42;if(n!==0)return n;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ks(e,n,l){var o=e.pendingLanes;if(o===0)return 0;var f=0,d=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var A=o&134217727;return A!==0?(o=A&~d,o!==0?f=kn(o):(b&=A,b!==0?f=kn(b):l||(l=A&~e,l!==0&&(f=kn(l))))):(A=o&~d,A!==0?f=kn(A):b!==0?f=kn(b):l||(l=o&~e,l!==0&&(f=kn(l)))),f===0?0:n!==0&&n!==f&&(n&d)===0&&(d=f&-f,l=n&-n,d>=l||d===32&&(l&4194048)!==0)?n:f}function Ji(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function bc(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Do(){var e=Bs;return Bs<<=1,(Bs&62914560)===0&&(Bs=4194304),e}function Pl(e){for(var n=[],l=0;31>l;l++)n.push(e);return n}function Fi(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Sc(e,n,l,o,f,d){var b=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var A=e.entanglements,k=e.expirationTimes,Q=e.hiddenUpdates;for(l=b&~l;0<l;){var ne=31-xt(l),le=1<<ne;A[ne]=0,k[ne]=-1;var J=Q[ne];if(J!==null)for(Q[ne]=null,ne=0;ne<J.length;ne++){var W=J[ne];W!==null&&(W.lane&=-536870913)}l&=~le}o!==0&&Lo(e,o,0),d!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=d&~(b&~n))}function Lo(e,n,l){e.pendingLanes|=n,e.suspendedLanes&=~n;var o=31-xt(n);e.entangledLanes|=n,e.entanglements[o]=e.entanglements[o]|1073741824|l&261930}function Ro(e,n){var l=e.entangledLanes|=n;for(e=e.entanglements;l;){var o=31-xt(l),f=1<<o;f&n|e[o]&n&&(e[o]|=n),l&=~f}}function Bo(e,n){var l=n&-n;return l=(l&42)!==0?1:ea(l),(l&(e.suspendedLanes|n))!==0?0:l}function ea(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ta(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ko(){var e=D.p;return e!==0?e:(e=window.event,e===void 0?32:Hy(e.type))}function Ho(e,n){var l=D.p;try{return D.p=e,n()}finally{D.p=l}}var Nn=Math.random().toString(36).slice(2),ct="__reactFiber$"+Nn,vt="__reactProps$"+Nn,Hn="__reactContainer$"+Nn,Hs="__reactEvents$"+Nn,jo="__reactListeners$"+Nn,wc="__reactHandles$"+Nn,$o="__reactResources$"+Nn,Wi="__reactMarker$"+Nn;function na(e){delete e[ct],delete e[vt],delete e[Hs],delete e[jo],delete e[wc]}function ui(e){var n=e[ct];if(n)return n;for(var l=e.parentNode;l;){if(n=l[Hn]||l[ct]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(e=wy(e);e!==null;){if(l=e[ct])return l;e=wy(e)}return n}e=l,l=e.parentNode}return null}function ci(e){if(e=e[ct]||e[Hn]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function fi(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(a(33))}function di(e){var n=e[$o];return n||(n=e[$o]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function st(e){e[Wi]=!0}var Uo=new Set,qo={};function jn(e,n){hi(e,n),hi(e+"Capture",n)}function hi(e,n){for(qo[e]=n,e=0;e<n.length;e++)Uo.add(n[e])}var xc=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]*$"),Vo={},ia={};function Ec(e){return Nt.call(ia,e)?!0:Nt.call(Vo,e)?!1:xc.test(e)?ia[e]=!0:(Vo[e]=!0,!1)}function js(e,n,l){if(Ec(n))if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+l)}}function $s(e,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+l)}}function fn(e,n,l,o){if(o===null)e.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(n,l,""+o)}}function Tt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Yo(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function _c(e,n,l){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,d=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(b){l=""+b,d.call(this,b)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(b){l=""+b},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function sa(e){if(!e._valueTracker){var n=Yo(e)?"checked":"value";e._valueTracker=_c(e,n,""+e[n])}}function la(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var l=n.getValue(),o="";return e&&(o=Yo(e)?e.checked?"true":"false":e.value),e=o,e!==l?(n.setValue(e),!0):!1}function Us(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Go=/[\n"\\]/g;function Mt(e){return e.replace(Go,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function aa(e,n,l,o,f,d,b,A){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),n!=null?b==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Tt(n)):e.value!==""+Tt(n)&&(e.value=""+Tt(n)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),n!=null?oa(e,b,Tt(n)):l!=null?oa(e,b,Tt(l)):o!=null&&e.removeAttribute("value"),f==null&&d!=null&&(e.defaultChecked=!!d),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?e.name=""+Tt(A):e.removeAttribute("name")}function qs(e,n,l,o,f,d,b,A){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),n!=null||l!=null){if(!(d!=="submit"&&d!=="reset"||n!=null)){sa(e);return}l=l!=null?""+Tt(l):"",n=n!=null?""+Tt(n):l,A||n===e.value||(e.value=n),e.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=A?e.checked:!!o,e.defaultChecked=!!o,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),sa(e)}function oa(e,n,l){n==="number"&&Us(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function mi(e,n,l,o){if(e=e.options,n){n={};for(var f=0;f<l.length;f++)n["$"+l[f]]=!0;for(l=0;l<e.length;l++)f=n.hasOwnProperty("$"+e[l].value),e[l].selected!==f&&(e[l].selected=f),f&&o&&(e[l].defaultSelected=!0)}else{for(l=""+Tt(l),n=null,f=0;f<e.length;f++){if(e[f].value===l){e[f].selected=!0,o&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function ra(e,n,l){if(n!=null&&(n=""+Tt(n),n!==e.value&&(e.value=n),l==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=l!=null?""+Tt(l):""}function um(e,n,l,o){if(n==null){if(o!=null){if(l!=null)throw Error(a(92));if(G(o)){if(1<o.length)throw Error(a(93));o=o[0]}l=o}l==null&&(l=""),n=l}l=Tt(n),e.defaultValue=l,o=e.textContent,o===l&&o!==""&&o!==null&&(e.value=o),sa(e)}function Vs(e,n){if(n){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=n;return}}e.textContent=n}var fS=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 cm(e,n,l){var o=n.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?o?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":o?e.setProperty(n,l):typeof l!="number"||l===0||fS.has(n)?n==="float"?e.cssFloat=l:e[n]=(""+l).trim():e[n]=l+"px"}function fm(e,n,l){if(n!=null&&typeof n!="object")throw Error(a(62));if(e=e.style,l!=null){for(var o in l)!l.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var f in n)o=n[f],n.hasOwnProperty(f)&&l[f]!==o&&cm(e,f,o)}else for(var d in n)n.hasOwnProperty(d)&&cm(e,d,n[d])}function Nc(e){if(e.indexOf("-")===-1)return!1;switch(e){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 dS=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"]]),hS=/^[\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 Xo(e){return hS.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function $n(){}var Ac=null;function Tc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ys=null,Gs=null;function dm(e){var n=ci(e);if(n&&(e=n.stateNode)){var l=e[vt]||null;e:switch(e=n.stateNode,n.type){case"input":if(aa(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),n=l.name,l.type==="radio"&&n!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Mt(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var o=l[n];if(o!==e&&o.form===e.form){var f=o[vt]||null;if(!f)throw Error(a(90));aa(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<l.length;n++)o=l[n],o.form===e.form&&la(o)}break e;case"textarea":ra(e,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&mi(e,!!l.multiple,n,!1)}}}var Mc=!1;function hm(e,n,l){if(Mc)return e(n,l);Mc=!0;try{var o=e(n);return o}finally{if(Mc=!1,(Ys!==null||Gs!==null)&&(Dr(),Ys&&(n=Ys,e=Gs,Gs=Ys=null,dm(n),e)))for(n=0;n<e.length;n++)dm(e[n])}}function ua(e,n){var l=e.stateNode;if(l===null)return null;var o=l[vt]||null;if(o===null)return null;l=o[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(a(231,n,typeof l));return l}var Un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cc=!1;if(Un)try{var ca={};Object.defineProperty(ca,"passive",{get:function(){Cc=!0}}),window.addEventListener("test",ca,ca),window.removeEventListener("test",ca,ca)}catch{Cc=!1}var gi=null,Oc=null,Ko=null;function mm(){if(Ko)return Ko;var e,n=Oc,l=n.length,o,f="value"in gi?gi.value:gi.textContent,d=f.length;for(e=0;e<l&&n[e]===f[e];e++);var b=l-e;for(o=1;o<=b&&n[l-o]===f[d-o];o++);return Ko=f.slice(e,1<o?1-o:void 0)}function Zo(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Qo(){return!0}function gm(){return!1}function Ct(e){function n(l,o,f,d,b){this._reactName=l,this._targetInst=f,this.type=o,this.nativeEvent=d,this.target=b,this.currentTarget=null;for(var A in e)e.hasOwnProperty(A)&&(l=e[A],this[A]=l?l(d):d[A]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Qo:gm,this.isPropagationStopped=gm,this}return p(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Qo)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Qo)},persist:function(){},isPersistent:Qo}),n}var Pi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Io=Ct(Pi),fa=p({},Pi,{view:0,detail:0}),mS=Ct(fa),zc,Dc,da,Jo=p({},fa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==da&&(da&&e.type==="mousemove"?(zc=e.screenX-da.screenX,Dc=e.screenY-da.screenY):Dc=zc=0,da=e),zc)},movementY:function(e){return"movementY"in e?e.movementY:Dc}}),pm=Ct(Jo),gS=p({},Jo,{dataTransfer:0}),pS=Ct(gS),yS=p({},fa,{relatedTarget:0}),Lc=Ct(yS),vS=p({},Pi,{animationName:0,elapsedTime:0,pseudoElement:0}),bS=Ct(vS),SS=p({},Pi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),wS=Ct(SS),xS=p({},Pi,{data:0}),ym=Ct(xS),ES={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_S={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"},NS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AS(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=NS[e])?!!n[e]:!1}function Rc(){return AS}var TS=p({},fa,{key:function(e){if(e.key){var n=ES[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Zo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?_S[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rc,charCode:function(e){return e.type==="keypress"?Zo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Zo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),MS=Ct(TS),CS=p({},Jo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vm=Ct(CS),OS=p({},fa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rc}),zS=Ct(OS),DS=p({},Pi,{propertyName:0,elapsedTime:0,pseudoElement:0}),LS=Ct(DS),RS=p({},Jo,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),BS=Ct(RS),kS=p({},Pi,{newState:0,oldState:0}),HS=Ct(kS),jS=[9,13,27,32],Bc=Un&&"CompositionEvent"in window,ha=null;Un&&"documentMode"in document&&(ha=document.documentMode);var $S=Un&&"TextEvent"in window&&!ha,bm=Un&&(!Bc||ha&&8<ha&&11>=ha),Sm=" ",wm=!1;function xm(e,n){switch(e){case"keyup":return jS.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Em(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xs=!1;function US(e,n){switch(e){case"compositionend":return Em(n);case"keypress":return n.which!==32?null:(wm=!0,Sm);case"textInput":return e=n.data,e===Sm&&wm?null:e;default:return null}}function qS(e,n){if(Xs)return e==="compositionend"||!Bc&&xm(e,n)?(e=mm(),Ko=Oc=gi=null,Xs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return bm&&n.locale!=="ko"?null:n.data;default:return null}}var VS={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 _m(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!VS[e.type]:n==="textarea"}function Nm(e,n,l,o){Ys?Gs?Gs.push(o):Gs=[o]:Ys=o,n=$r(n,"onChange"),0<n.length&&(l=new Io("onChange","change",null,l,o),e.push({event:l,listeners:n}))}var ma=null,ga=null;function YS(e){oy(e,0)}function Fo(e){var n=fi(e);if(la(n))return e}function Am(e,n){if(e==="change")return n}var Tm=!1;if(Un){var kc;if(Un){var Hc="oninput"in document;if(!Hc){var Mm=document.createElement("div");Mm.setAttribute("oninput","return;"),Hc=typeof Mm.oninput=="function"}kc=Hc}else kc=!1;Tm=kc&&(!document.documentMode||9<document.documentMode)}function Cm(){ma&&(ma.detachEvent("onpropertychange",Om),ga=ma=null)}function Om(e){if(e.propertyName==="value"&&Fo(ga)){var n=[];Nm(n,ga,e,Tc(e)),hm(YS,n)}}function GS(e,n,l){e==="focusin"?(Cm(),ma=n,ga=l,ma.attachEvent("onpropertychange",Om)):e==="focusout"&&Cm()}function XS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Fo(ga)}function KS(e,n){if(e==="click")return Fo(n)}function ZS(e,n){if(e==="input"||e==="change")return Fo(n)}function QS(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var $t=typeof Object.is=="function"?Object.is:QS;function pa(e,n){if($t(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var l=Object.keys(e),o=Object.keys(n);if(l.length!==o.length)return!1;for(o=0;o<l.length;o++){var f=l[o];if(!Nt.call(n,f)||!$t(e[f],n[f]))return!1}return!0}function zm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dm(e,n){var l=zm(e);e=0;for(var o;l;){if(l.nodeType===3){if(o=e+l.textContent.length,e<=n&&o>=n)return{node:l,offset:n-e};e=o}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=zm(l)}}function Lm(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Lm(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Rm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Us(e.document);n instanceof e.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)e=n.contentWindow;else break;n=Us(e.document)}return n}function jc(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var IS=Un&&"documentMode"in document&&11>=document.documentMode,Ks=null,$c=null,ya=null,Uc=!1;function Bm(e,n,l){var o=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Uc||Ks==null||Ks!==Us(o)||(o=Ks,"selectionStart"in o&&jc(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),ya&&pa(ya,o)||(ya=o,o=$r($c,"onSelect"),0<o.length&&(n=new Io("onSelect","select",null,n,l),e.push({event:n,listeners:o}),n.target=Ks)))}function es(e,n){var l={};return l[e.toLowerCase()]=n.toLowerCase(),l["Webkit"+e]="webkit"+n,l["Moz"+e]="moz"+n,l}var Zs={animationend:es("Animation","AnimationEnd"),animationiteration:es("Animation","AnimationIteration"),animationstart:es("Animation","AnimationStart"),transitionrun:es("Transition","TransitionRun"),transitionstart:es("Transition","TransitionStart"),transitioncancel:es("Transition","TransitionCancel"),transitionend:es("Transition","TransitionEnd")},qc={},km={};Un&&(km=document.createElement("div").style,"AnimationEvent"in window||(delete Zs.animationend.animation,delete Zs.animationiteration.animation,delete Zs.animationstart.animation),"TransitionEvent"in window||delete Zs.transitionend.transition);function ts(e){if(qc[e])return qc[e];if(!Zs[e])return e;var n=Zs[e],l;for(l in n)if(n.hasOwnProperty(l)&&l in km)return qc[e]=n[l];return e}var Hm=ts("animationend"),jm=ts("animationiteration"),$m=ts("animationstart"),JS=ts("transitionrun"),FS=ts("transitionstart"),WS=ts("transitioncancel"),Um=ts("transitionend"),qm=new Map,Vc="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(" ");Vc.push("scrollEnd");function dn(e,n){qm.set(e,n),jn(n,[e])}var Wo=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Pt=[],Qs=0,Yc=0;function Po(){for(var e=Qs,n=Yc=Qs=0;n<e;){var l=Pt[n];Pt[n++]=null;var o=Pt[n];Pt[n++]=null;var f=Pt[n];Pt[n++]=null;var d=Pt[n];if(Pt[n++]=null,o!==null&&f!==null){var b=o.pending;b===null?f.next=f:(f.next=b.next,b.next=f),o.pending=f}d!==0&&Vm(l,f,d)}}function er(e,n,l,o){Pt[Qs++]=e,Pt[Qs++]=n,Pt[Qs++]=l,Pt[Qs++]=o,Yc|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function Gc(e,n,l,o){return er(e,n,l,o),tr(e)}function ns(e,n){return er(e,null,null,n),tr(e)}function Vm(e,n,l){e.lanes|=l;var o=e.alternate;o!==null&&(o.lanes|=l);for(var f=!1,d=e.return;d!==null;)d.childLanes|=l,o=d.alternate,o!==null&&(o.childLanes|=l),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(f=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,f&&n!==null&&(f=31-xt(l),e=d.hiddenUpdates,o=e[f],o===null?e[f]=[n]:o.push(n),n.lane=l|536870912),d):null}function tr(e){if(50<$a)throw $a=0,ed=null,Error(a(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Is={};function PS(e,n,l,o){this.tag=e,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=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ut(e,n,l,o){return new PS(e,n,l,o)}function Xc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qn(e,n){var l=e.alternate;return l===null?(l=Ut(e.tag,n,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=n,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,n=e.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function Ym(e,n){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,n=l.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function nr(e,n,l,o,f,d){var b=0;if(o=e,typeof e=="function")Xc(e)&&(b=1);else if(typeof e=="string")b=sx(e,l,ie.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Y:return e=Ut(31,l,n,f),e.elementType=Y,e.lanes=d,e;case _:return is(l.children,f,d,n);case N:b=8,f|=24;break;case S:return e=Ut(12,l,n,f|2),e.elementType=S,e.lanes=d,e;case R:return e=Ut(13,l,n,f),e.elementType=R,e.lanes=d,e;case L:return e=Ut(19,l,n,f),e.elementType=L,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case x:b=10;break e;case O:b=9;break e;case M:b=11;break e;case H:b=14;break e;case j:b=16,o=null;break e}b=29,l=Error(a(130,e===null?"null":typeof e,"")),o=null}return n=Ut(b,l,n,f),n.elementType=e,n.type=o,n.lanes=d,n}function is(e,n,l,o){return e=Ut(7,e,o,n),e.lanes=l,e}function Kc(e,n,l){return e=Ut(6,e,null,n),e.lanes=l,e}function Gm(e){var n=Ut(18,null,null,0);return n.stateNode=e,n}function Zc(e,n,l){return n=Ut(4,e.children!==null?e.children:[],e.key,n),n.lanes=l,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Xm=new WeakMap;function en(e,n){if(typeof e=="object"&&e!==null){var l=Xm.get(e);return l!==void 0?l:(n={value:e,source:n,stack:It(n)},Xm.set(e,n),n)}return{value:e,source:n,stack:It(n)}}var Js=[],Fs=0,ir=null,va=0,tn=[],nn=0,pi=null,An=1,Tn="";function Vn(e,n){Js[Fs++]=va,Js[Fs++]=ir,ir=e,va=n}function Km(e,n,l){tn[nn++]=An,tn[nn++]=Tn,tn[nn++]=pi,pi=e;var o=An;e=Tn;var f=32-xt(o)-1;o&=~(1<<f),l+=1;var d=32-xt(n)+f;if(30<d){var b=f-f%5;d=(o&(1<<b)-1).toString(32),o>>=b,f-=b,An=1<<32-xt(n)+f|l<<f|o,Tn=d+e}else An=1<<d|l<<f|o,Tn=e}function Qc(e){e.return!==null&&(Vn(e,1),Km(e,1,0))}function Ic(e){for(;e===ir;)ir=Js[--Fs],Js[Fs]=null,va=Js[--Fs],Js[Fs]=null;for(;e===pi;)pi=tn[--nn],tn[nn]=null,Tn=tn[--nn],tn[nn]=null,An=tn[--nn],tn[nn]=null}function Zm(e,n){tn[nn++]=An,tn[nn++]=Tn,tn[nn++]=pi,An=n.id,Tn=n.overflow,pi=e}var ht=null,Xe=null,Oe=!1,yi=null,sn=!1,Jc=Error(a(519));function vi(e){var n=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ba(en(n,e)),Jc}function Qm(e){var n=e.stateNode,l=e.type,o=e.memoizedProps;switch(n[ct]=e,n[vt]=o,l){case"dialog":Te("cancel",n),Te("close",n);break;case"iframe":case"object":case"embed":Te("load",n);break;case"video":case"audio":for(l=0;l<qa.length;l++)Te(qa[l],n);break;case"source":Te("error",n);break;case"img":case"image":case"link":Te("error",n),Te("load",n);break;case"details":Te("toggle",n);break;case"input":Te("invalid",n),qs(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Te("invalid",n);break;case"textarea":Te("invalid",n),um(n,o.value,o.defaultValue,o.children)}l=o.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||o.suppressHydrationWarning===!0||fy(n.textContent,l)?(o.popover!=null&&(Te("beforetoggle",n),Te("toggle",n)),o.onScroll!=null&&Te("scroll",n),o.onScrollEnd!=null&&Te("scrollend",n),o.onClick!=null&&(n.onclick=$n),n=!0):n=!1,n||vi(e,!0)}function Im(e){for(ht=e.return;ht;)switch(ht.tag){case 5:case 31:case 13:sn=!1;return;case 27:case 3:sn=!0;return;default:ht=ht.return}}function Ws(e){if(e!==ht)return!1;if(!Oe)return Im(e),Oe=!0,!1;var n=e.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||gd(e.type,e.memoizedProps)),l=!l),l&&Xe&&vi(e),Im(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Xe=Sy(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Xe=Sy(e)}else n===27?(n=Xe,Di(e.type)?(e=Sd,Sd=null,Xe=e):Xe=n):Xe=ht?an(e.stateNode.nextSibling):null;return!0}function ss(){Xe=ht=null,Oe=!1}function Fc(){var e=yi;return e!==null&&(Lt===null?Lt=e:Lt.push.apply(Lt,e),yi=null),e}function ba(e){yi===null?yi=[e]:yi.push(e)}var Wc=C(null),ls=null,Yn=null;function bi(e,n,l){P(Wc,n._currentValue),n._currentValue=l}function Gn(e){e._currentValue=Wc.current,$(Wc)}function Pc(e,n,l){for(;e!==null;){var o=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),e===l)break;e=e.return}}function ef(e,n,l,o){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var d=f.dependencies;if(d!==null){var b=f.child;d=d.firstContext;e:for(;d!==null;){var A=d;d=f;for(var k=0;k<n.length;k++)if(A.context===n[k]){d.lanes|=l,A=d.alternate,A!==null&&(A.lanes|=l),Pc(d.return,l,e),o||(b=null);break e}d=A.next}}else if(f.tag===18){if(b=f.return,b===null)throw Error(a(341));b.lanes|=l,d=b.alternate,d!==null&&(d.lanes|=l),Pc(b,l,e),b=null}else b=f.child;if(b!==null)b.return=f;else for(b=f;b!==null;){if(b===e){b=null;break}if(f=b.sibling,f!==null){f.return=b.return,b=f;break}b=b.return}f=b}}function Ps(e,n,l,o){e=null;for(var f=n,d=!1;f!==null;){if(!d){if((f.flags&524288)!==0)d=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var b=f.alternate;if(b===null)throw Error(a(387));if(b=b.memoizedProps,b!==null){var A=f.type;$t(f.pendingProps.value,b.value)||(e!==null?e.push(A):e=[A])}}else if(f===ue.current){if(b=f.alternate,b===null)throw Error(a(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(Ka):e=[Ka])}f=f.return}e!==null&&ef(n,e,l,o),n.flags|=262144}function sr(e){for(e=e.firstContext;e!==null;){if(!$t(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function as(e){ls=e,Yn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function mt(e){return Jm(ls,e)}function lr(e,n){return ls===null&&as(e),Jm(e,n)}function Jm(e,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},Yn===null){if(e===null)throw Error(a(308));Yn=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Yn=Yn.next=n;return l}var ew=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(l,o){e.push(o)}};this.abort=function(){n.aborted=!0,e.forEach(function(l){return l()})}},tw=t.unstable_scheduleCallback,nw=t.unstable_NormalPriority,lt={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function tf(){return{controller:new ew,data:new Map,refCount:0}}function Sa(e){e.refCount--,e.refCount===0&&tw(nw,function(){e.controller.abort()})}var wa=null,nf=0,el=0,tl=null;function iw(e,n){if(wa===null){var l=wa=[];nf=0,el=ad(),tl={status:"pending",value:void 0,then:function(o){l.push(o)}}}return nf++,n.then(Fm,Fm),n}function Fm(){if(--nf===0&&wa!==null){tl!==null&&(tl.status="fulfilled");var e=wa;wa=null,el=0,tl=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function sw(e,n){var l=[],o={status:"pending",value:null,reason:null,then:function(f){l.push(f)}};return e.then(function(){o.status="fulfilled",o.value=n;for(var f=0;f<l.length;f++)(0,l[f])(n)},function(f){for(o.status="rejected",o.reason=f,f=0;f<l.length;f++)(0,l[f])(void 0)}),o}var Wm=T.S;T.S=function(e,n){Bp=tt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&iw(e,n),Wm!==null&&Wm(e,n)};var os=C(null);function sf(){var e=os.current;return e!==null?e:Ve.pooledCache}function ar(e,n){n===null?P(os,os.current):P(os,n.pool)}function Pm(){var e=sf();return e===null?null:{parent:lt._currentValue,pool:e}}var nl=Error(a(460)),lf=Error(a(474)),or=Error(a(542)),rr={then:function(){}};function eg(e){return e=e.status,e==="fulfilled"||e==="rejected"}function tg(e,n,l){switch(l=e[l],l===void 0?e.push(n):l!==n&&(n.then($n,$n),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,ig(e),e;default:if(typeof n.status=="string")n.then($n,$n);else{if(e=Ve,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=n,e.status="pending",e.then(function(o){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=o}},function(o){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,ig(e),e}throw us=n,nl}}function rs(e){try{var n=e._init;return n(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(us=l,nl):l}}var us=null;function ng(){if(us===null)throw Error(a(459));var e=us;return us=null,e}function ig(e){if(e===nl||e===or)throw Error(a(483))}var il=null,xa=0;function ur(e){var n=xa;return xa+=1,il===null&&(il=[]),tg(il,e,n)}function Ea(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function cr(e,n){throw n.$$typeof===y?Error(a(525)):(e=Object.prototype.toString.call(n),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function sg(e){function n(V,U){if(e){var Z=V.deletions;Z===null?(V.deletions=[U],V.flags|=16):Z.push(U)}}function l(V,U){if(!e)return null;for(;U!==null;)n(V,U),U=U.sibling;return null}function o(V){for(var U=new Map;V!==null;)V.key!==null?U.set(V.key,V):U.set(V.index,V),V=V.sibling;return U}function f(V,U){return V=qn(V,U),V.index=0,V.sibling=null,V}function d(V,U,Z){return V.index=Z,e?(Z=V.alternate,Z!==null?(Z=Z.index,Z<U?(V.flags|=67108866,U):Z):(V.flags|=67108866,U)):(V.flags|=1048576,U)}function b(V){return e&&V.alternate===null&&(V.flags|=67108866),V}function A(V,U,Z,se){return U===null||U.tag!==6?(U=Kc(Z,V.mode,se),U.return=V,U):(U=f(U,Z),U.return=V,U)}function k(V,U,Z,se){var pe=Z.type;return pe===_?ne(V,U,Z.props.children,se,Z.key):U!==null&&(U.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===j&&rs(pe)===U.type)?(U=f(U,Z.props),Ea(U,Z),U.return=V,U):(U=nr(Z.type,Z.key,Z.props,null,V.mode,se),Ea(U,Z),U.return=V,U)}function Q(V,U,Z,se){return U===null||U.tag!==4||U.stateNode.containerInfo!==Z.containerInfo||U.stateNode.implementation!==Z.implementation?(U=Zc(Z,V.mode,se),U.return=V,U):(U=f(U,Z.children||[]),U.return=V,U)}function ne(V,U,Z,se,pe){return U===null||U.tag!==7?(U=is(Z,V.mode,se,pe),U.return=V,U):(U=f(U,Z),U.return=V,U)}function le(V,U,Z){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Kc(""+U,V.mode,Z),U.return=V,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case w:return Z=nr(U.type,U.key,U.props,null,V.mode,Z),Ea(Z,U),Z.return=V,Z;case E:return U=Zc(U,V.mode,Z),U.return=V,U;case j:return U=rs(U),le(V,U,Z)}if(G(U)||I(U))return U=is(U,V.mode,Z,null),U.return=V,U;if(typeof U.then=="function")return le(V,ur(U),Z);if(U.$$typeof===x)return le(V,lr(V,U),Z);cr(V,U)}return null}function J(V,U,Z,se){var pe=U!==null?U.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return pe!==null?null:A(V,U,""+Z,se);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case w:return Z.key===pe?k(V,U,Z,se):null;case E:return Z.key===pe?Q(V,U,Z,se):null;case j:return Z=rs(Z),J(V,U,Z,se)}if(G(Z)||I(Z))return pe!==null?null:ne(V,U,Z,se,null);if(typeof Z.then=="function")return J(V,U,ur(Z),se);if(Z.$$typeof===x)return J(V,U,lr(V,Z),se);cr(V,Z)}return null}function W(V,U,Z,se,pe){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return V=V.get(Z)||null,A(U,V,""+se,pe);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case w:return V=V.get(se.key===null?Z:se.key)||null,k(U,V,se,pe);case E:return V=V.get(se.key===null?Z:se.key)||null,Q(U,V,se,pe);case j:return se=rs(se),W(V,U,Z,se,pe)}if(G(se)||I(se))return V=V.get(Z)||null,ne(U,V,se,pe,null);if(typeof se.then=="function")return W(V,U,Z,ur(se),pe);if(se.$$typeof===x)return W(V,U,Z,lr(U,se),pe);cr(U,se)}return null}function he(V,U,Z,se){for(var pe=null,Le=null,me=U,Ne=U=0,Ce=null;me!==null&&Ne<Z.length;Ne++){me.index>Ne?(Ce=me,me=null):Ce=me.sibling;var Re=J(V,me,Z[Ne],se);if(Re===null){me===null&&(me=Ce);break}e&&me&&Re.alternate===null&&n(V,me),U=d(Re,U,Ne),Le===null?pe=Re:Le.sibling=Re,Le=Re,me=Ce}if(Ne===Z.length)return l(V,me),Oe&&Vn(V,Ne),pe;if(me===null){for(;Ne<Z.length;Ne++)me=le(V,Z[Ne],se),me!==null&&(U=d(me,U,Ne),Le===null?pe=me:Le.sibling=me,Le=me);return Oe&&Vn(V,Ne),pe}for(me=o(me);Ne<Z.length;Ne++)Ce=W(me,V,Ne,Z[Ne],se),Ce!==null&&(e&&Ce.alternate!==null&&me.delete(Ce.key===null?Ne:Ce.key),U=d(Ce,U,Ne),Le===null?pe=Ce:Le.sibling=Ce,Le=Ce);return e&&me.forEach(function(Hi){return n(V,Hi)}),Oe&&Vn(V,Ne),pe}function ve(V,U,Z,se){if(Z==null)throw Error(a(151));for(var pe=null,Le=null,me=U,Ne=U=0,Ce=null,Re=Z.next();me!==null&&!Re.done;Ne++,Re=Z.next()){me.index>Ne?(Ce=me,me=null):Ce=me.sibling;var Hi=J(V,me,Re.value,se);if(Hi===null){me===null&&(me=Ce);break}e&&me&&Hi.alternate===null&&n(V,me),U=d(Hi,U,Ne),Le===null?pe=Hi:Le.sibling=Hi,Le=Hi,me=Ce}if(Re.done)return l(V,me),Oe&&Vn(V,Ne),pe;if(me===null){for(;!Re.done;Ne++,Re=Z.next())Re=le(V,Re.value,se),Re!==null&&(U=d(Re,U,Ne),Le===null?pe=Re:Le.sibling=Re,Le=Re);return Oe&&Vn(V,Ne),pe}for(me=o(me);!Re.done;Ne++,Re=Z.next())Re=W(me,V,Ne,Re.value,se),Re!==null&&(e&&Re.alternate!==null&&me.delete(Re.key===null?Ne:Re.key),U=d(Re,U,Ne),Le===null?pe=Re:Le.sibling=Re,Le=Re);return e&&me.forEach(function(gx){return n(V,gx)}),Oe&&Vn(V,Ne),pe}function qe(V,U,Z,se){if(typeof Z=="object"&&Z!==null&&Z.type===_&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case w:e:{for(var pe=Z.key;U!==null;){if(U.key===pe){if(pe=Z.type,pe===_){if(U.tag===7){l(V,U.sibling),se=f(U,Z.props.children),se.return=V,V=se;break e}}else if(U.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===j&&rs(pe)===U.type){l(V,U.sibling),se=f(U,Z.props),Ea(se,Z),se.return=V,V=se;break e}l(V,U);break}else n(V,U);U=U.sibling}Z.type===_?(se=is(Z.props.children,V.mode,se,Z.key),se.return=V,V=se):(se=nr(Z.type,Z.key,Z.props,null,V.mode,se),Ea(se,Z),se.return=V,V=se)}return b(V);case E:e:{for(pe=Z.key;U!==null;){if(U.key===pe)if(U.tag===4&&U.stateNode.containerInfo===Z.containerInfo&&U.stateNode.implementation===Z.implementation){l(V,U.sibling),se=f(U,Z.children||[]),se.return=V,V=se;break e}else{l(V,U);break}else n(V,U);U=U.sibling}se=Zc(Z,V.mode,se),se.return=V,V=se}return b(V);case j:return Z=rs(Z),qe(V,U,Z,se)}if(G(Z))return he(V,U,Z,se);if(I(Z)){if(pe=I(Z),typeof pe!="function")throw Error(a(150));return Z=pe.call(Z),ve(V,U,Z,se)}if(typeof Z.then=="function")return qe(V,U,ur(Z),se);if(Z.$$typeof===x)return qe(V,U,lr(V,Z),se);cr(V,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,U!==null&&U.tag===6?(l(V,U.sibling),se=f(U,Z),se.return=V,V=se):(l(V,U),se=Kc(Z,V.mode,se),se.return=V,V=se),b(V)):l(V,U)}return function(V,U,Z,se){try{xa=0;var pe=qe(V,U,Z,se);return il=null,pe}catch(me){if(me===nl||me===or)throw me;var Le=Ut(29,me,null,V.mode);return Le.lanes=se,Le.return=V,Le}}}var cs=sg(!0),lg=sg(!1),Si=!1;function af(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function of(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function wi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xi(e,n,l){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Be&2)!==0){var f=o.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),o.pending=n,n=tr(e),Vm(e,null,l),n}return er(e,o,n,l),tr(e)}function _a(e,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var o=n.lanes;o&=e.pendingLanes,l|=o,n.lanes=l,Ro(e,l)}}function rf(e,n){var l=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,l===o)){var f=null,d=null;if(l=l.firstBaseUpdate,l!==null){do{var b={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};d===null?f=d=b:d=d.next=b,l=l.next}while(l!==null);d===null?f=d=n:d=d.next=n}else f=d=n;l={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:d,shared:o.shared,callbacks:o.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=n:e.next=n,l.lastBaseUpdate=n}var uf=!1;function Na(){if(uf){var e=tl;if(e!==null)throw e}}function Aa(e,n,l,o){uf=!1;var f=e.updateQueue;Si=!1;var d=f.firstBaseUpdate,b=f.lastBaseUpdate,A=f.shared.pending;if(A!==null){f.shared.pending=null;var k=A,Q=k.next;k.next=null,b===null?d=Q:b.next=Q,b=k;var ne=e.alternate;ne!==null&&(ne=ne.updateQueue,A=ne.lastBaseUpdate,A!==b&&(A===null?ne.firstBaseUpdate=Q:A.next=Q,ne.lastBaseUpdate=k))}if(d!==null){var le=f.baseState;b=0,ne=Q=k=null,A=d;do{var J=A.lane&-536870913,W=J!==A.lane;if(W?(Me&J)===J:(o&J)===J){J!==0&&J===el&&(uf=!0),ne!==null&&(ne=ne.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var he=e,ve=A;J=n;var qe=l;switch(ve.tag){case 1:if(he=ve.payload,typeof he=="function"){le=he.call(qe,le,J);break e}le=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=ve.payload,J=typeof he=="function"?he.call(qe,le,J):he,J==null)break e;le=p({},le,J);break e;case 2:Si=!0}}J=A.callback,J!==null&&(e.flags|=64,W&&(e.flags|=8192),W=f.callbacks,W===null?f.callbacks=[J]:W.push(J))}else W={lane:J,tag:A.tag,payload:A.payload,callback:A.callback,next:null},ne===null?(Q=ne=W,k=le):ne=ne.next=W,b|=J;if(A=A.next,A===null){if(A=f.shared.pending,A===null)break;W=A,A=W.next,W.next=null,f.lastBaseUpdate=W,f.shared.pending=null}}while(!0);ne===null&&(k=le),f.baseState=k,f.firstBaseUpdate=Q,f.lastBaseUpdate=ne,d===null&&(f.shared.lanes=0),Ti|=b,e.lanes=b,e.memoizedState=le}}function ag(e,n){if(typeof e!="function")throw Error(a(191,e));e.call(n)}function og(e,n){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)ag(l[e],n)}var sl=C(null),fr=C(0);function rg(e,n){e=Pn,P(fr,e),P(sl,n),Pn=e|n.baseLanes}function cf(){P(fr,Pn),P(sl,sl.current)}function ff(){Pn=fr.current,$(sl),$(fr)}var qt=C(null),ln=null;function Ei(e){var n=e.alternate;P(nt,nt.current&1),P(qt,e),ln===null&&(n===null||sl.current!==null||n.memoizedState!==null)&&(ln=e)}function df(e){P(nt,nt.current),P(qt,e),ln===null&&(ln=e)}function ug(e){e.tag===22?(P(nt,nt.current),P(qt,e),ln===null&&(ln=e)):_i()}function _i(){P(nt,nt.current),P(qt,qt.current)}function Vt(e){$(qt),ln===e&&(ln=null),$(nt)}var nt=C(0);function dr(e){for(var n=e;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||vd(l)||bd(l)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Xn=0,_e=null,$e=null,at=null,hr=!1,ll=!1,fs=!1,mr=0,Ta=0,al=null,lw=0;function Pe(){throw Error(a(321))}function hf(e,n){if(n===null)return!1;for(var l=0;l<n.length&&l<e.length;l++)if(!$t(e[l],n[l]))return!1;return!0}function mf(e,n,l,o,f,d){return Xn=d,_e=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,T.H=e===null||e.memoizedState===null?Kg:Cf,fs=!1,d=l(o,f),fs=!1,ll&&(d=fg(n,l,o,f)),cg(e),d}function cg(e){T.H=Oa;var n=$e!==null&&$e.next!==null;if(Xn=0,at=$e=_e=null,hr=!1,Ta=0,al=null,n)throw Error(a(300));e===null||ot||(e=e.dependencies,e!==null&&sr(e)&&(ot=!0))}function fg(e,n,l,o){_e=e;var f=0;do{if(ll&&(al=null),Ta=0,ll=!1,25<=f)throw Error(a(301));if(f+=1,at=$e=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}T.H=Zg,d=n(l,o)}while(ll);return d}function aw(){var e=T.H,n=e.useState()[0];return n=typeof n.then=="function"?Ma(n):n,e=e.useState()[0],($e!==null?$e.memoizedState:null)!==e&&(_e.flags|=1024),n}function gf(){var e=mr!==0;return mr=0,e}function pf(e,n,l){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l}function yf(e){if(hr){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}hr=!1}Xn=0,at=$e=_e=null,ll=!1,Ta=mr=0,al=null}function Et(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return at===null?_e.memoizedState=at=e:at=at.next=e,at}function it(){if($e===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var n=at===null?_e.memoizedState:at.next;if(n!==null)at=n,$e=e;else{if(e===null)throw _e.alternate===null?Error(a(467)):Error(a(310));$e=e,e={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},at===null?_e.memoizedState=at=e:at=at.next=e}return at}function gr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ma(e){var n=Ta;return Ta+=1,al===null&&(al=[]),e=tg(al,e,n),n=_e,(at===null?n.memoizedState:at.next)===null&&(n=n.alternate,T.H=n===null||n.memoizedState===null?Kg:Cf),e}function pr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ma(e);if(e.$$typeof===x)return mt(e)}throw Error(a(438,String(e)))}function vf(e){var n=null,l=_e.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var o=_e.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=gr(),_e.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(e),o=0;o<e;o++)l[o]=ae;return n.index++,l}function Kn(e,n){return typeof n=="function"?n(e):n}function yr(e){var n=it();return bf(n,$e,e)}function bf(e,n,l){var o=e.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=l;var f=e.baseQueue,d=o.pending;if(d!==null){if(f!==null){var b=f.next;f.next=d.next,d.next=b}n.baseQueue=f=d,o.pending=null}if(d=e.baseState,f===null)e.memoizedState=d;else{n=f.next;var A=b=null,k=null,Q=n,ne=!1;do{var le=Q.lane&-536870913;if(le!==Q.lane?(Me&le)===le:(Xn&le)===le){var J=Q.revertLane;if(J===0)k!==null&&(k=k.next={lane:0,revertLane:0,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),le===el&&(ne=!0);else if((Xn&J)===J){Q=Q.next,J===el&&(ne=!0);continue}else le={lane:0,revertLane:Q.revertLane,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},k===null?(A=k=le,b=d):k=k.next=le,_e.lanes|=J,Ti|=J;le=Q.action,fs&&l(d,le),d=Q.hasEagerState?Q.eagerState:l(d,le)}else J={lane:le,revertLane:Q.revertLane,gesture:Q.gesture,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},k===null?(A=k=J,b=d):k=k.next=J,_e.lanes|=le,Ti|=le;Q=Q.next}while(Q!==null&&Q!==n);if(k===null?b=d:k.next=A,!$t(d,e.memoizedState)&&(ot=!0,ne&&(l=tl,l!==null)))throw l;e.memoizedState=d,e.baseState=b,e.baseQueue=k,o.lastRenderedState=d}return f===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function Sf(e){var n=it(),l=n.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=e;var o=l.dispatch,f=l.pending,d=n.memoizedState;if(f!==null){l.pending=null;var b=f=f.next;do d=e(d,b.action),b=b.next;while(b!==f);$t(d,n.memoizedState)||(ot=!0),n.memoizedState=d,n.baseQueue===null&&(n.baseState=d),l.lastRenderedState=d}return[d,o]}function dg(e,n,l){var o=_e,f=it(),d=Oe;if(d){if(l===void 0)throw Error(a(407));l=l()}else l=n();var b=!$t(($e||f).memoizedState,l);if(b&&(f.memoizedState=l,ot=!0),f=f.queue,Ef(gg.bind(null,o,f,e),[e]),f.getSnapshot!==n||b||at!==null&&at.memoizedState.tag&1){if(o.flags|=2048,ol(9,{destroy:void 0},mg.bind(null,o,f,l,n),null),Ve===null)throw Error(a(349));d||(Xn&127)!==0||hg(o,n,l)}return l}function hg(e,n,l){e.flags|=16384,e={getSnapshot:n,value:l},n=_e.updateQueue,n===null?(n=gr(),_e.updateQueue=n,n.stores=[e]):(l=n.stores,l===null?n.stores=[e]:l.push(e))}function mg(e,n,l,o){n.value=l,n.getSnapshot=o,pg(n)&&yg(e)}function gg(e,n,l){return l(function(){pg(n)&&yg(e)})}function pg(e){var n=e.getSnapshot;e=e.value;try{var l=n();return!$t(e,l)}catch{return!0}}function yg(e){var n=ns(e,2);n!==null&&Rt(n,e,2)}function wf(e){var n=Et();if(typeof e=="function"){var l=e;if(e=l(),fs){_n(!0);try{l()}finally{_n(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:e},n}function vg(e,n,l,o){return e.baseState=l,bf(e,$e,typeof o=="function"?o:Kn)}function ow(e,n,l,o,f){if(Sr(e))throw Error(a(485));if(e=n.action,e!==null){var d={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){d.listeners.push(b)}};T.T!==null?l(!0):d.isTransition=!1,o(d),l=n.pending,l===null?(d.next=n.pending=d,bg(n,d)):(d.next=l.next,n.pending=l.next=d)}}function bg(e,n){var l=n.action,o=n.payload,f=e.state;if(n.isTransition){var d=T.T,b={};T.T=b;try{var A=l(f,o),k=T.S;k!==null&&k(b,A),Sg(e,n,A)}catch(Q){xf(e,n,Q)}finally{d!==null&&b.types!==null&&(d.types=b.types),T.T=d}}else try{d=l(f,o),Sg(e,n,d)}catch(Q){xf(e,n,Q)}}function Sg(e,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(o){wg(e,n,o)},function(o){return xf(e,n,o)}):wg(e,n,l)}function wg(e,n,l){n.status="fulfilled",n.value=l,xg(n),e.state=l,n=e.pending,n!==null&&(l=n.next,l===n?e.pending=null:(l=l.next,n.next=l,bg(e,l)))}function xf(e,n,l){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=l,xg(n),n=n.next;while(n!==o)}e.action=null}function xg(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Eg(e,n){return n}function _g(e,n){if(Oe){var l=Ve.formState;if(l!==null){e:{var o=_e;if(Oe){if(Xe){t:{for(var f=Xe,d=sn;f.nodeType!==8;){if(!d){f=null;break t}if(f=an(f.nextSibling),f===null){f=null;break t}}d=f.data,f=d==="F!"||d==="F"?f:null}if(f){Xe=an(f.nextSibling),o=f.data==="F!";break e}}vi(o)}o=!1}o&&(n=l[0])}}return l=Et(),l.memoizedState=l.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Eg,lastRenderedState:n},l.queue=o,l=Yg.bind(null,_e,o),o.dispatch=l,o=wf(!1),d=Mf.bind(null,_e,!1,o.queue),o=Et(),f={state:n,dispatch:null,action:e,pending:null},o.queue=f,l=ow.bind(null,_e,f,d,l),f.dispatch=l,o.memoizedState=e,[n,l,!1]}function Ng(e){var n=it();return Ag(n,$e,e)}function Ag(e,n,l){if(n=bf(e,n,Eg)[0],e=yr(Kn)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=Ma(n)}catch(b){throw b===nl?or:b}else o=n;n=it();var f=n.queue,d=f.dispatch;return l!==n.memoizedState&&(_e.flags|=2048,ol(9,{destroy:void 0},rw.bind(null,f,l),null)),[o,d,e]}function rw(e,n){e.action=n}function Tg(e){var n=it(),l=$e;if(l!==null)return Ag(n,l,e);it(),n=n.memoizedState,l=it();var o=l.queue.dispatch;return l.memoizedState=e,[n,o,!1]}function ol(e,n,l,o){return e={tag:e,create:l,deps:o,inst:n,next:null},n=_e.updateQueue,n===null&&(n=gr(),_e.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=e.next=e:(o=l.next,l.next=e,e.next=o,n.lastEffect=e),e}function Mg(){return it().memoizedState}function vr(e,n,l,o){var f=Et();_e.flags|=e,f.memoizedState=ol(1|n,{destroy:void 0},l,o===void 0?null:o)}function br(e,n,l,o){var f=it();o=o===void 0?null:o;var d=f.memoizedState.inst;$e!==null&&o!==null&&hf(o,$e.memoizedState.deps)?f.memoizedState=ol(n,d,l,o):(_e.flags|=e,f.memoizedState=ol(1|n,d,l,o))}function Cg(e,n){vr(8390656,8,e,n)}function Ef(e,n){br(2048,8,e,n)}function uw(e){_e.flags|=4;var n=_e.updateQueue;if(n===null)n=gr(),_e.updateQueue=n,n.events=[e];else{var l=n.events;l===null?n.events=[e]:l.push(e)}}function Og(e){var n=it().memoizedState;return uw({ref:n,nextImpl:e}),function(){if((Be&2)!==0)throw Error(a(440));return n.impl.apply(void 0,arguments)}}function zg(e,n){return br(4,2,e,n)}function Dg(e,n){return br(4,4,e,n)}function Lg(e,n){if(typeof n=="function"){e=e();var l=n(e);return function(){typeof l=="function"?l():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Rg(e,n,l){l=l!=null?l.concat([e]):null,br(4,4,Lg.bind(null,n,e),l)}function _f(){}function Bg(e,n){var l=it();n=n===void 0?null:n;var o=l.memoizedState;return n!==null&&hf(n,o[1])?o[0]:(l.memoizedState=[e,n],e)}function kg(e,n){var l=it();n=n===void 0?null:n;var o=l.memoizedState;if(n!==null&&hf(n,o[1]))return o[0];if(o=e(),fs){_n(!0);try{e()}finally{_n(!1)}}return l.memoizedState=[o,n],o}function Nf(e,n,l){return l===void 0||(Xn&1073741824)!==0&&(Me&261930)===0?e.memoizedState=n:(e.memoizedState=l,e=Hp(),_e.lanes|=e,Ti|=e,l)}function Hg(e,n,l,o){return $t(l,n)?l:sl.current!==null?(e=Nf(e,l,o),$t(e,n)||(ot=!0),e):(Xn&42)===0||(Xn&1073741824)!==0&&(Me&261930)===0?(ot=!0,e.memoizedState=l):(e=Hp(),_e.lanes|=e,Ti|=e,n)}function jg(e,n,l,o,f){var d=D.p;D.p=d!==0&&8>d?d:8;var b=T.T,A={};T.T=A,Mf(e,!1,n,l);try{var k=f(),Q=T.S;if(Q!==null&&Q(A,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var ne=sw(k,o);Ca(e,n,ne,Xt(e))}else Ca(e,n,o,Xt(e))}catch(le){Ca(e,n,{then:function(){},status:"rejected",reason:le},Xt())}finally{D.p=d,b!==null&&A.types!==null&&(b.types=A.types),T.T=b}}function cw(){}function Af(e,n,l,o){if(e.tag!==5)throw Error(a(476));var f=$g(e).queue;jg(e,f,n,q,l===null?cw:function(){return Ug(e),l(o)})}function $g(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:q},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:l},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Ug(e){var n=$g(e);n.next===null&&(n=e.alternate.memoizedState),Ca(e,n.next.queue,{},Xt())}function Tf(){return mt(Ka)}function qg(){return it().memoizedState}function Vg(){return it().memoizedState}function fw(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var l=Xt();e=wi(l);var o=xi(n,e,l);o!==null&&(Rt(o,n,l),_a(o,n,l)),n={cache:tf()},e.payload=n;return}n=n.return}}function dw(e,n,l){var o=Xt();l={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Sr(e)?Gg(n,l):(l=Gc(e,n,l,o),l!==null&&(Rt(l,e,o),Xg(l,n,o)))}function Yg(e,n,l){var o=Xt();Ca(e,n,l,o)}function Ca(e,n,l,o){var f={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Sr(e))Gg(n,f);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=n.lastRenderedReducer,d!==null))try{var b=n.lastRenderedState,A=d(b,l);if(f.hasEagerState=!0,f.eagerState=A,$t(A,b))return er(e,n,f,0),Ve===null&&Po(),!1}catch{}if(l=Gc(e,n,f,o),l!==null)return Rt(l,e,o),Xg(l,n,o),!0}return!1}function Mf(e,n,l,o){if(o={lane:2,revertLane:ad(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Sr(e)){if(n)throw Error(a(479))}else n=Gc(e,l,o,2),n!==null&&Rt(n,e,2)}function Sr(e){var n=e.alternate;return e===_e||n!==null&&n===_e}function Gg(e,n){ll=hr=!0;var l=e.pending;l===null?n.next=n:(n.next=l.next,l.next=n),e.pending=n}function Xg(e,n,l){if((l&4194048)!==0){var o=n.lanes;o&=e.pendingLanes,l|=o,n.lanes=l,Ro(e,l)}}var Oa={readContext:mt,use:pr,useCallback:Pe,useContext:Pe,useEffect:Pe,useImperativeHandle:Pe,useLayoutEffect:Pe,useInsertionEffect:Pe,useMemo:Pe,useReducer:Pe,useRef:Pe,useState:Pe,useDebugValue:Pe,useDeferredValue:Pe,useTransition:Pe,useSyncExternalStore:Pe,useId:Pe,useHostTransitionStatus:Pe,useFormState:Pe,useActionState:Pe,useOptimistic:Pe,useMemoCache:Pe,useCacheRefresh:Pe};Oa.useEffectEvent=Pe;var Kg={readContext:mt,use:pr,useCallback:function(e,n){return Et().memoizedState=[e,n===void 0?null:n],e},useContext:mt,useEffect:Cg,useImperativeHandle:function(e,n,l){l=l!=null?l.concat([e]):null,vr(4194308,4,Lg.bind(null,n,e),l)},useLayoutEffect:function(e,n){return vr(4194308,4,e,n)},useInsertionEffect:function(e,n){vr(4,2,e,n)},useMemo:function(e,n){var l=Et();n=n===void 0?null:n;var o=e();if(fs){_n(!0);try{e()}finally{_n(!1)}}return l.memoizedState=[o,n],o},useReducer:function(e,n,l){var o=Et();if(l!==void 0){var f=l(n);if(fs){_n(!0);try{l(n)}finally{_n(!1)}}}else f=n;return o.memoizedState=o.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},o.queue=e,e=e.dispatch=dw.bind(null,_e,e),[o.memoizedState,e]},useRef:function(e){var n=Et();return e={current:e},n.memoizedState=e},useState:function(e){e=wf(e);var n=e.queue,l=Yg.bind(null,_e,n);return n.dispatch=l,[e.memoizedState,l]},useDebugValue:_f,useDeferredValue:function(e,n){var l=Et();return Nf(l,e,n)},useTransition:function(){var e=wf(!1);return e=jg.bind(null,_e,e.queue,!0,!1),Et().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,l){var o=_e,f=Et();if(Oe){if(l===void 0)throw Error(a(407));l=l()}else{if(l=n(),Ve===null)throw Error(a(349));(Me&127)!==0||hg(o,n,l)}f.memoizedState=l;var d={value:l,getSnapshot:n};return f.queue=d,Cg(gg.bind(null,o,d,e),[e]),o.flags|=2048,ol(9,{destroy:void 0},mg.bind(null,o,d,l,n),null),l},useId:function(){var e=Et(),n=Ve.identifierPrefix;if(Oe){var l=Tn,o=An;l=(o&~(1<<32-xt(o)-1)).toString(32)+l,n="_"+n+"R_"+l,l=mr++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=lw++,n="_"+n+"r_"+l.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Tf,useFormState:_g,useActionState:_g,useOptimistic:function(e){var n=Et();n.memoizedState=n.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=Mf.bind(null,_e,!0,l),l.dispatch=n,[e,n]},useMemoCache:vf,useCacheRefresh:function(){return Et().memoizedState=fw.bind(null,_e)},useEffectEvent:function(e){var n=Et(),l={impl:e};return n.memoizedState=l,function(){if((Be&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},Cf={readContext:mt,use:pr,useCallback:Bg,useContext:mt,useEffect:Ef,useImperativeHandle:Rg,useInsertionEffect:zg,useLayoutEffect:Dg,useMemo:kg,useReducer:yr,useRef:Mg,useState:function(){return yr(Kn)},useDebugValue:_f,useDeferredValue:function(e,n){var l=it();return Hg(l,$e.memoizedState,e,n)},useTransition:function(){var e=yr(Kn)[0],n=it().memoizedState;return[typeof e=="boolean"?e:Ma(e),n]},useSyncExternalStore:dg,useId:qg,useHostTransitionStatus:Tf,useFormState:Ng,useActionState:Ng,useOptimistic:function(e,n){var l=it();return vg(l,$e,e,n)},useMemoCache:vf,useCacheRefresh:Vg};Cf.useEffectEvent=Og;var Zg={readContext:mt,use:pr,useCallback:Bg,useContext:mt,useEffect:Ef,useImperativeHandle:Rg,useInsertionEffect:zg,useLayoutEffect:Dg,useMemo:kg,useReducer:Sf,useRef:Mg,useState:function(){return Sf(Kn)},useDebugValue:_f,useDeferredValue:function(e,n){var l=it();return $e===null?Nf(l,e,n):Hg(l,$e.memoizedState,e,n)},useTransition:function(){var e=Sf(Kn)[0],n=it().memoizedState;return[typeof e=="boolean"?e:Ma(e),n]},useSyncExternalStore:dg,useId:qg,useHostTransitionStatus:Tf,useFormState:Tg,useActionState:Tg,useOptimistic:function(e,n){var l=it();return $e!==null?vg(l,$e,e,n):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:vf,useCacheRefresh:Vg};Zg.useEffectEvent=Og;function Of(e,n,l,o){n=e.memoizedState,l=l(o,n),l=l==null?n:p({},n,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var zf={enqueueSetState:function(e,n,l){e=e._reactInternals;var o=Xt(),f=wi(o);f.payload=n,l!=null&&(f.callback=l),n=xi(e,f,o),n!==null&&(Rt(n,e,o),_a(n,e,o))},enqueueReplaceState:function(e,n,l){e=e._reactInternals;var o=Xt(),f=wi(o);f.tag=1,f.payload=n,l!=null&&(f.callback=l),n=xi(e,f,o),n!==null&&(Rt(n,e,o),_a(n,e,o))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var l=Xt(),o=wi(l);o.tag=2,n!=null&&(o.callback=n),n=xi(e,o,l),n!==null&&(Rt(n,e,l),_a(n,e,l))}};function Qg(e,n,l,o,f,d,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,d,b):n.prototype&&n.prototype.isPureReactComponent?!pa(l,o)||!pa(f,d):!0}function Ig(e,n,l,o){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,o),n.state!==e&&zf.enqueueReplaceState(n,n.state,null)}function ds(e,n){var l=n;if("ref"in n){l={};for(var o in n)o!=="ref"&&(l[o]=n[o])}if(e=e.defaultProps){l===n&&(l=p({},l));for(var f in e)l[f]===void 0&&(l[f]=e[f])}return l}function Jg(e){Wo(e)}function Fg(e){console.error(e)}function Wg(e){Wo(e)}function wr(e,n){try{var l=e.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Pg(e,n,l){try{var o=e.onCaughtError;o(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Df(e,n,l){return l=wi(l),l.tag=3,l.payload={element:null},l.callback=function(){wr(e,n)},l}function ep(e){return e=wi(e),e.tag=3,e}function tp(e,n,l,o){var f=l.type.getDerivedStateFromError;if(typeof f=="function"){var d=o.value;e.payload=function(){return f(d)},e.callback=function(){Pg(n,l,o)}}var b=l.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Pg(n,l,o),typeof f!="function"&&(Mi===null?Mi=new Set([this]):Mi.add(this));var A=o.stack;this.componentDidCatch(o.value,{componentStack:A!==null?A:""})})}function hw(e,n,l,o,f){if(l.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=l.alternate,n!==null&&Ps(n,l,f,!0),l=qt.current,l!==null){switch(l.tag){case 31:case 13:return ln===null?Lr():l.alternate===null&&et===0&&(et=3),l.flags&=-257,l.flags|=65536,l.lanes=f,o===rr?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([o]):n.add(o),id(e,o,f)),!1;case 22:return l.flags|=65536,o===rr?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([o]):l.add(o)),id(e,o,f)),!1}throw Error(a(435,l.tag))}return id(e,o,f),Lr(),!1}if(Oe)return n=qt.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,o!==Jc&&(e=Error(a(422),{cause:o}),ba(en(e,l)))):(o!==Jc&&(n=Error(a(423),{cause:o}),ba(en(n,l))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,o=en(o,l),f=Df(e.stateNode,o,f),rf(e,f),et!==4&&(et=2)),!1;var d=Error(a(520),{cause:o});if(d=en(d,l),ja===null?ja=[d]:ja.push(d),et!==4&&(et=2),n===null)return!0;o=en(o,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,e=f&-f,l.lanes|=e,e=Df(l.stateNode,o,e),rf(l,e),!1;case 1:if(n=l.type,d=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Mi===null||!Mi.has(d))))return l.flags|=65536,f&=-f,l.lanes|=f,f=ep(f),tp(f,e,l,o),rf(l,f),!1}l=l.return}while(l!==null);return!1}var Lf=Error(a(461)),ot=!1;function gt(e,n,l,o){n.child=e===null?lg(n,null,l,o):cs(n,e.child,l,o)}function np(e,n,l,o,f){l=l.render;var d=n.ref;if("ref"in o){var b={};for(var A in o)A!=="ref"&&(b[A]=o[A])}else b=o;return as(n),o=mf(e,n,l,b,d,f),A=gf(),e!==null&&!ot?(pf(e,n,f),Zn(e,n,f)):(Oe&&A&&Qc(n),n.flags|=1,gt(e,n,o,f),n.child)}function ip(e,n,l,o,f){if(e===null){var d=l.type;return typeof d=="function"&&!Xc(d)&&d.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=d,sp(e,n,d,o,f)):(e=nr(l.type,null,o,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(d=e.child,!qf(e,f)){var b=d.memoizedProps;if(l=l.compare,l=l!==null?l:pa,l(b,o)&&e.ref===n.ref)return Zn(e,n,f)}return n.flags|=1,e=qn(d,o),e.ref=n.ref,e.return=n,n.child=e}function sp(e,n,l,o,f){if(e!==null){var d=e.memoizedProps;if(pa(d,o)&&e.ref===n.ref)if(ot=!1,n.pendingProps=o=d,qf(e,f))(e.flags&131072)!==0&&(ot=!0);else return n.lanes=e.lanes,Zn(e,n,f)}return Rf(e,n,l,o,f)}function lp(e,n,l,o){var f=o.children,d=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(d=d!==null?d.baseLanes|l:l,e!==null){for(o=n.child=e.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~d}else o=0,n.child=null;return ap(e,n,d,l,o)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&ar(n,d!==null?d.cachePool:null),d!==null?rg(n,d):cf(),ug(n);else return o=n.lanes=536870912,ap(e,n,d!==null?d.baseLanes|l:l,l,o)}else d!==null?(ar(n,d.cachePool),rg(n,d),_i(),n.memoizedState=null):(e!==null&&ar(n,null),cf(),_i());return gt(e,n,f,l),n.child}function za(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function ap(e,n,l,o,f){var d=sf();return d=d===null?null:{parent:lt._currentValue,pool:d},n.memoizedState={baseLanes:l,cachePool:d},e!==null&&ar(n,null),cf(),ug(n),e!==null&&Ps(e,n,o,!0),n.childLanes=f,null}function xr(e,n){return n=_r({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function op(e,n,l){return cs(n,e.child,null,l),e=xr(n,n.pendingProps),e.flags|=2,Vt(n),n.memoizedState=null,e}function mw(e,n,l){var o=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Oe){if(o.mode==="hidden")return e=xr(n,o),n.lanes=536870912,za(null,e);if(df(n),(e=Xe)?(e=by(e,sn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:pi!==null?{id:An,overflow:Tn}:null,retryLane:536870912,hydrationErrors:null},l=Gm(e),l.return=n,n.child=l,ht=n,Xe=null)):e=null,e===null)throw vi(n);return n.lanes=536870912,null}return xr(n,o)}var d=e.memoizedState;if(d!==null){var b=d.dehydrated;if(df(n),f)if(n.flags&256)n.flags&=-257,n=op(e,n,l);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(a(558));else if(ot||Ps(e,n,l,!1),f=(l&e.childLanes)!==0,ot||f){if(o=Ve,o!==null&&(b=Bo(o,l),b!==0&&b!==d.retryLane))throw d.retryLane=b,ns(e,b),Rt(o,e,b),Lf;Lr(),n=op(e,n,l)}else e=d.treeContext,Xe=an(b.nextSibling),ht=n,Oe=!0,yi=null,sn=!1,e!==null&&Zm(n,e),n=xr(n,o),n.flags|=4096;return n}return e=qn(e.child,{mode:o.mode,children:o.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Er(e,n){var l=n.ref;if(l===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(e===null||e.ref!==l)&&(n.flags|=4194816)}}function Rf(e,n,l,o,f){return as(n),l=mf(e,n,l,o,void 0,f),o=gf(),e!==null&&!ot?(pf(e,n,f),Zn(e,n,f)):(Oe&&o&&Qc(n),n.flags|=1,gt(e,n,l,f),n.child)}function rp(e,n,l,o,f,d){return as(n),n.updateQueue=null,l=fg(n,o,l,f),cg(e),o=gf(),e!==null&&!ot?(pf(e,n,d),Zn(e,n,d)):(Oe&&o&&Qc(n),n.flags|=1,gt(e,n,l,d),n.child)}function up(e,n,l,o,f){if(as(n),n.stateNode===null){var d=Is,b=l.contextType;typeof b=="object"&&b!==null&&(d=mt(b)),d=new l(o,d),n.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=zf,n.stateNode=d,d._reactInternals=n,d=n.stateNode,d.props=o,d.state=n.memoizedState,d.refs={},af(n),b=l.contextType,d.context=typeof b=="object"&&b!==null?mt(b):Is,d.state=n.memoizedState,b=l.getDerivedStateFromProps,typeof b=="function"&&(Of(n,l,b,o),d.state=n.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(b=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),b!==d.state&&zf.enqueueReplaceState(d,d.state,null),Aa(n,o,d,f),Na(),d.state=n.memoizedState),typeof d.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(e===null){d=n.stateNode;var A=n.memoizedProps,k=ds(l,A);d.props=k;var Q=d.context,ne=l.contextType;b=Is,typeof ne=="object"&&ne!==null&&(b=mt(ne));var le=l.getDerivedStateFromProps;ne=typeof le=="function"||typeof d.getSnapshotBeforeUpdate=="function",A=n.pendingProps!==A,ne||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(A||Q!==b)&&Ig(n,d,o,b),Si=!1;var J=n.memoizedState;d.state=J,Aa(n,o,d,f),Na(),Q=n.memoizedState,A||J!==Q||Si?(typeof le=="function"&&(Of(n,l,le,o),Q=n.memoizedState),(k=Si||Qg(n,l,k,o,J,Q,b))?(ne||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(n.flags|=4194308)):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=Q),d.props=o,d.state=Q,d.context=b,o=k):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{d=n.stateNode,of(e,n),b=n.memoizedProps,ne=ds(l,b),d.props=ne,le=n.pendingProps,J=d.context,Q=l.contextType,k=Is,typeof Q=="object"&&Q!==null&&(k=mt(Q)),A=l.getDerivedStateFromProps,(Q=typeof A=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b!==le||J!==k)&&Ig(n,d,o,k),Si=!1,J=n.memoizedState,d.state=J,Aa(n,o,d,f),Na();var W=n.memoizedState;b!==le||J!==W||Si||e!==null&&e.dependencies!==null&&sr(e.dependencies)?(typeof A=="function"&&(Of(n,l,A,o),W=n.memoizedState),(ne=Si||Qg(n,l,ne,o,J,W,k)||e!==null&&e.dependencies!==null&&sr(e.dependencies))?(Q||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(o,W,k),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(o,W,k)),typeof d.componentDidUpdate=="function"&&(n.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&J===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&J===e.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=W),d.props=o,d.state=W,d.context=k,o=ne):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&J===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&J===e.memoizedState||(n.flags|=1024),o=!1)}return d=o,Er(e,n),o=(n.flags&128)!==0,d||o?(d=n.stateNode,l=o&&typeof l.getDerivedStateFromError!="function"?null:d.render(),n.flags|=1,e!==null&&o?(n.child=cs(n,e.child,null,f),n.child=cs(n,null,l,f)):gt(e,n,l,f),n.memoizedState=d.state,e=n.child):e=Zn(e,n,f),e}function cp(e,n,l,o){return ss(),n.flags|=256,gt(e,n,l,o),n.child}var Bf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function kf(e){return{baseLanes:e,cachePool:Pm()}}function Hf(e,n,l){return e=e!==null?e.childLanes&~l:0,n&&(e|=Gt),e}function fp(e,n,l){var o=n.pendingProps,f=!1,d=(n.flags&128)!==0,b;if((b=d)||(b=e!==null&&e.memoizedState===null?!1:(nt.current&2)!==0),b&&(f=!0,n.flags&=-129),b=(n.flags&32)!==0,n.flags&=-33,e===null){if(Oe){if(f?Ei(n):_i(),(e=Xe)?(e=by(e,sn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:pi!==null?{id:An,overflow:Tn}:null,retryLane:536870912,hydrationErrors:null},l=Gm(e),l.return=n,n.child=l,ht=n,Xe=null)):e=null,e===null)throw vi(n);return bd(e)?n.lanes=32:n.lanes=536870912,null}var A=o.children;return o=o.fallback,f?(_i(),f=n.mode,A=_r({mode:"hidden",children:A},f),o=is(o,f,l,null),A.return=n,o.return=n,A.sibling=o,n.child=A,o=n.child,o.memoizedState=kf(l),o.childLanes=Hf(e,b,l),n.memoizedState=Bf,za(null,o)):(Ei(n),jf(n,A))}var k=e.memoizedState;if(k!==null&&(A=k.dehydrated,A!==null)){if(d)n.flags&256?(Ei(n),n.flags&=-257,n=$f(e,n,l)):n.memoizedState!==null?(_i(),n.child=e.child,n.flags|=128,n=null):(_i(),A=o.fallback,f=n.mode,o=_r({mode:"visible",children:o.children},f),A=is(A,f,l,null),A.flags|=2,o.return=n,A.return=n,o.sibling=A,n.child=o,cs(n,e.child,null,l),o=n.child,o.memoizedState=kf(l),o.childLanes=Hf(e,b,l),n.memoizedState=Bf,n=za(null,o));else if(Ei(n),bd(A)){if(b=A.nextSibling&&A.nextSibling.dataset,b)var Q=b.dgst;b=Q,o=Error(a(419)),o.stack="",o.digest=b,ba({value:o,source:null,stack:null}),n=$f(e,n,l)}else if(ot||Ps(e,n,l,!1),b=(l&e.childLanes)!==0,ot||b){if(b=Ve,b!==null&&(o=Bo(b,l),o!==0&&o!==k.retryLane))throw k.retryLane=o,ns(e,o),Rt(b,e,o),Lf;vd(A)||Lr(),n=$f(e,n,l)}else vd(A)?(n.flags|=192,n.child=e.child,n=null):(e=k.treeContext,Xe=an(A.nextSibling),ht=n,Oe=!0,yi=null,sn=!1,e!==null&&Zm(n,e),n=jf(n,o.children),n.flags|=4096);return n}return f?(_i(),A=o.fallback,f=n.mode,k=e.child,Q=k.sibling,o=qn(k,{mode:"hidden",children:o.children}),o.subtreeFlags=k.subtreeFlags&65011712,Q!==null?A=qn(Q,A):(A=is(A,f,l,null),A.flags|=2),A.return=n,o.return=n,o.sibling=A,n.child=o,za(null,o),o=n.child,A=e.child.memoizedState,A===null?A=kf(l):(f=A.cachePool,f!==null?(k=lt._currentValue,f=f.parent!==k?{parent:k,pool:k}:f):f=Pm(),A={baseLanes:A.baseLanes|l,cachePool:f}),o.memoizedState=A,o.childLanes=Hf(e,b,l),n.memoizedState=Bf,za(e.child,o)):(Ei(n),l=e.child,e=l.sibling,l=qn(l,{mode:"visible",children:o.children}),l.return=n,l.sibling=null,e!==null&&(b=n.deletions,b===null?(n.deletions=[e],n.flags|=16):b.push(e)),n.child=l,n.memoizedState=null,l)}function jf(e,n){return n=_r({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function _r(e,n){return e=Ut(22,e,null,n),e.lanes=0,e}function $f(e,n,l){return cs(n,e.child,null,l),e=jf(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function dp(e,n,l){e.lanes|=n;var o=e.alternate;o!==null&&(o.lanes|=n),Pc(e.return,n,l)}function Uf(e,n,l,o,f,d){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:l,tailMode:f,treeForkCount:d}:(b.isBackwards=n,b.rendering=null,b.renderingStartTime=0,b.last=o,b.tail=l,b.tailMode=f,b.treeForkCount=d)}function hp(e,n,l){var o=n.pendingProps,f=o.revealOrder,d=o.tail;o=o.children;var b=nt.current,A=(b&2)!==0;if(A?(b=b&1|2,n.flags|=128):b&=1,P(nt,b),gt(e,n,o,l),o=Oe?va:0,!A&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&dp(e,l,n);else if(e.tag===19)dp(e,l,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"forwards":for(l=n.child,f=null;l!==null;)e=l.alternate,e!==null&&dr(e)===null&&(f=l),l=l.sibling;l=f,l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null),Uf(n,!1,f,l,d,o);break;case"backwards":case"unstable_legacy-backwards":for(l=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&dr(e)===null){n.child=f;break}e=f.sibling,f.sibling=l,l=f,f=e}Uf(n,!0,l,null,d,o);break;case"together":Uf(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function Zn(e,n,l){if(e!==null&&(n.dependencies=e.dependencies),Ti|=n.lanes,(l&n.childLanes)===0)if(e!==null){if(Ps(e,n,l,!1),(l&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(a(153));if(n.child!==null){for(e=n.child,l=qn(e,e.pendingProps),n.child=l,l.return=n;e.sibling!==null;)e=e.sibling,l=l.sibling=qn(e,e.pendingProps),l.return=n;l.sibling=null}return n.child}function qf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&sr(e)))}function gw(e,n,l){switch(n.tag){case 3:ee(n,n.stateNode.containerInfo),bi(n,lt,e.memoizedState.cache),ss();break;case 27:case 5:Se(n);break;case 4:ee(n,n.stateNode.containerInfo);break;case 10:bi(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,df(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(Ei(n),n.flags|=128,null):(l&n.child.childLanes)!==0?fp(e,n,l):(Ei(n),e=Zn(e,n,l),e!==null?e.sibling:null);Ei(n);break;case 19:var f=(e.flags&128)!==0;if(o=(l&n.childLanes)!==0,o||(Ps(e,n,l,!1),o=(l&n.childLanes)!==0),f){if(o)return hp(e,n,l);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),P(nt,nt.current),o)break;return null;case 22:return n.lanes=0,lp(e,n,l,n.pendingProps);case 24:bi(n,lt,e.memoizedState.cache)}return Zn(e,n,l)}function mp(e,n,l){if(e!==null)if(e.memoizedProps!==n.pendingProps)ot=!0;else{if(!qf(e,l)&&(n.flags&128)===0)return ot=!1,gw(e,n,l);ot=(e.flags&131072)!==0}else ot=!1,Oe&&(n.flags&1048576)!==0&&Km(n,va,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(e=rs(n.elementType),n.type=e,typeof e=="function")Xc(e)?(o=ds(e,o),n.tag=1,n=up(null,n,e,o,l)):(n.tag=0,n=Rf(null,n,e,o,l));else{if(e!=null){var f=e.$$typeof;if(f===M){n.tag=11,n=np(null,n,e,o,l);break e}else if(f===H){n.tag=14,n=ip(null,n,e,o,l);break e}}throw n=B(e)||e,Error(a(306,n,""))}}return n;case 0:return Rf(e,n,n.type,n.pendingProps,l);case 1:return o=n.type,f=ds(o,n.pendingProps),up(e,n,o,f,l);case 3:e:{if(ee(n,n.stateNode.containerInfo),e===null)throw Error(a(387));o=n.pendingProps;var d=n.memoizedState;f=d.element,of(e,n),Aa(n,o,null,l);var b=n.memoizedState;if(o=b.cache,bi(n,lt,o),o!==d.cache&&ef(n,[lt],l,!0),Na(),o=b.element,d.isDehydrated)if(d={element:o,isDehydrated:!1,cache:b.cache},n.updateQueue.baseState=d,n.memoizedState=d,n.flags&256){n=cp(e,n,o,l);break e}else if(o!==f){f=en(Error(a(424)),n),ba(f),n=cp(e,n,o,l);break e}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Xe=an(e.firstChild),ht=n,Oe=!0,yi=null,sn=!0,l=lg(n,null,o,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(ss(),o===f){n=Zn(e,n,l);break e}gt(e,n,o,l)}n=n.child}return n;case 26:return Er(e,n),e===null?(l=Ny(n.type,null,n.pendingProps,null))?n.memoizedState=l:Oe||(l=n.type,e=n.pendingProps,o=Ur(de.current).createElement(l),o[ct]=n,o[vt]=e,pt(o,l,e),st(o),n.stateNode=o):n.memoizedState=Ny(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Se(n),e===null&&Oe&&(o=n.stateNode=xy(n.type,n.pendingProps,de.current),ht=n,sn=!0,f=Xe,Di(n.type)?(Sd=f,Xe=an(o.firstChild)):Xe=f),gt(e,n,n.pendingProps.children,l),Er(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Oe&&((f=o=Xe)&&(o=Xw(o,n.type,n.pendingProps,sn),o!==null?(n.stateNode=o,ht=n,Xe=an(o.firstChild),sn=!1,f=!0):f=!1),f||vi(n)),Se(n),f=n.type,d=n.pendingProps,b=e!==null?e.memoizedProps:null,o=d.children,gd(f,d)?o=null:b!==null&&gd(f,b)&&(n.flags|=32),n.memoizedState!==null&&(f=mf(e,n,aw,null,null,l),Ka._currentValue=f),Er(e,n),gt(e,n,o,l),n.child;case 6:return e===null&&Oe&&((e=l=Xe)&&(l=Kw(l,n.pendingProps,sn),l!==null?(n.stateNode=l,ht=n,Xe=null,e=!0):e=!1),e||vi(n)),null;case 13:return fp(e,n,l);case 4:return ee(n,n.stateNode.containerInfo),o=n.pendingProps,e===null?n.child=cs(n,null,o,l):gt(e,n,o,l),n.child;case 11:return np(e,n,n.type,n.pendingProps,l);case 7:return gt(e,n,n.pendingProps,l),n.child;case 8:return gt(e,n,n.pendingProps.children,l),n.child;case 12:return gt(e,n,n.pendingProps.children,l),n.child;case 10:return o=n.pendingProps,bi(n,n.type,o.value),gt(e,n,o.children,l),n.child;case 9:return f=n.type._context,o=n.pendingProps.children,as(n),f=mt(f),o=o(f),n.flags|=1,gt(e,n,o,l),n.child;case 14:return ip(e,n,n.type,n.pendingProps,l);case 15:return sp(e,n,n.type,n.pendingProps,l);case 19:return hp(e,n,l);case 31:return mw(e,n,l);case 22:return lp(e,n,l,n.pendingProps);case 24:return as(n),o=mt(lt),e===null?(f=sf(),f===null&&(f=Ve,d=tf(),f.pooledCache=d,d.refCount++,d!==null&&(f.pooledCacheLanes|=l),f=d),n.memoizedState={parent:o,cache:f},af(n),bi(n,lt,f)):((e.lanes&l)!==0&&(of(e,n),Aa(n,null,null,l),Na()),f=e.memoizedState,d=n.memoizedState,f.parent!==o?(f={parent:o,cache:o},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),bi(n,lt,o)):(o=d.cache,bi(n,lt,o),o!==f.cache&&ef(n,[lt],l,!0))),gt(e,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function Qn(e){e.flags|=4}function Vf(e,n,l,o,f){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(qp())e.flags|=8192;else throw us=rr,lf}else e.flags&=-16777217}function gp(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Oy(n))if(qp())e.flags|=8192;else throw us=rr,lf}function Nr(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Do():536870912,e.lanes|=n,fl|=n)}function Da(e,n){if(!Oe)switch(e.tailMode){case"hidden":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var o=null;l!==null;)l.alternate!==null&&(o=l),l=l.sibling;o===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function Ke(e){var n=e.alternate!==null&&e.alternate.child===e.child,l=0,o=0;if(n)for(var f=e.child;f!==null;)l|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)l|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=o,e.childLanes=l,n}function pw(e,n,l){var o=n.pendingProps;switch(Ic(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ke(n),null;case 1:return Ke(n),null;case 3:return l=n.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),Gn(lt),ce(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ws(n)?Qn(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Fc())),Ke(n),null;case 26:var f=n.type,d=n.memoizedState;return e===null?(Qn(n),d!==null?(Ke(n),gp(n,d)):(Ke(n),Vf(n,f,null,o,l))):d?d!==e.memoizedState?(Qn(n),Ke(n),gp(n,d)):(Ke(n),n.flags&=-16777217):(e=e.memoizedProps,e!==o&&Qn(n),Ke(n),Vf(n,f,e,o,l)),null;case 27:if(be(n),l=de.current,f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&Qn(n);else{if(!o){if(n.stateNode===null)throw Error(a(166));return Ke(n),null}e=ie.current,Ws(n)?Qm(n):(e=xy(f,o,l),n.stateNode=e,Qn(n))}return Ke(n),null;case 5:if(be(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&Qn(n);else{if(!o){if(n.stateNode===null)throw Error(a(166));return Ke(n),null}if(d=ie.current,Ws(n))Qm(n);else{var b=Ur(de.current);switch(d){case 1:d=b.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:d=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":d=b.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":d=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":d=b.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof o.is=="string"?b.createElement("select",{is:o.is}):b.createElement("select"),o.multiple?d.multiple=!0:o.size&&(d.size=o.size);break;default:d=typeof o.is=="string"?b.createElement(f,{is:o.is}):b.createElement(f)}}d[ct]=n,d[vt]=o;e:for(b=n.child;b!==null;){if(b.tag===5||b.tag===6)d.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===n)break e;for(;b.sibling===null;){if(b.return===null||b.return===n)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}n.stateNode=d;e:switch(pt(d,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Qn(n)}}return Ke(n),Vf(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,l),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==o&&Qn(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(a(166));if(e=de.current,Ws(n)){if(e=n.stateNode,l=n.memoizedProps,o=null,f=ht,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}e[ct]=n,e=!!(e.nodeValue===l||o!==null&&o.suppressHydrationWarning===!0||fy(e.nodeValue,l)),e||vi(n,!0)}else e=Ur(e).createTextNode(o),e[ct]=n,n.stateNode=e}return Ke(n),null;case 31:if(l=n.memoizedState,e===null||e.memoizedState!==null){if(o=Ws(n),l!==null){if(e===null){if(!o)throw Error(a(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(557));e[ct]=n}else ss(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ke(n),e=!1}else l=Fc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return n.flags&256?(Vt(n),n):(Vt(n),null);if((n.flags&128)!==0)throw Error(a(558))}return Ke(n),null;case 13:if(o=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=Ws(n),o!==null&&o.dehydrated!==null){if(e===null){if(!f)throw Error(a(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(a(317));f[ct]=n}else ss(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ke(n),f=!1}else f=Fc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Vt(n),n):(Vt(n),null)}return Vt(n),(n.flags&128)!==0?(n.lanes=l,n):(l=o!==null,e=e!==null&&e.memoizedState!==null,l&&(o=n.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),d=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),d!==f&&(o.flags|=2048)),l!==e&&l&&(n.child.flags|=8192),Nr(n,n.updateQueue),Ke(n),null);case 4:return ce(),e===null&&cd(n.stateNode.containerInfo),Ke(n),null;case 10:return Gn(n.type),Ke(n),null;case 19:if($(nt),o=n.memoizedState,o===null)return Ke(n),null;if(f=(n.flags&128)!==0,d=o.rendering,d===null)if(f)Da(o,!1);else{if(et!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(d=dr(e),d!==null){for(n.flags|=128,Da(o,!1),e=d.updateQueue,n.updateQueue=e,Nr(n,e),n.subtreeFlags=0,e=l,l=n.child;l!==null;)Ym(l,e),l=l.sibling;return P(nt,nt.current&1|2),Oe&&Vn(n,o.treeForkCount),n.child}e=e.sibling}o.tail!==null&&tt()>Or&&(n.flags|=128,f=!0,Da(o,!1),n.lanes=4194304)}else{if(!f)if(e=dr(d),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,Nr(n,e),Da(o,!0),o.tail===null&&o.tailMode==="hidden"&&!d.alternate&&!Oe)return Ke(n),null}else 2*tt()-o.renderingStartTime>Or&&l!==536870912&&(n.flags|=128,f=!0,Da(o,!1),n.lanes=4194304);o.isBackwards?(d.sibling=n.child,n.child=d):(e=o.last,e!==null?e.sibling=d:n.child=d,o.last=d)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=tt(),e.sibling=null,l=nt.current,P(nt,f?l&1|2:l&1),Oe&&Vn(n,o.treeForkCount),e):(Ke(n),null);case 22:case 23:return Vt(n),ff(),o=n.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(l&536870912)!==0&&(n.flags&128)===0&&(Ke(n),n.subtreeFlags&6&&(n.flags|=8192)):Ke(n),l=n.updateQueue,l!==null&&Nr(n,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==l&&(n.flags|=2048),e!==null&&$(os),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Gn(lt),Ke(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function yw(e,n){switch(Ic(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Gn(lt),ce(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return be(n),null;case 31:if(n.memoizedState!==null){if(Vt(n),n.alternate===null)throw Error(a(340));ss()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Vt(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(a(340));ss()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return $(nt),null;case 4:return ce(),null;case 10:return Gn(n.type),null;case 22:case 23:return Vt(n),ff(),e!==null&&$(os),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Gn(lt),null;case 25:return null;default:return null}}function pp(e,n){switch(Ic(n),n.tag){case 3:Gn(lt),ce();break;case 26:case 27:case 5:be(n);break;case 4:ce();break;case 31:n.memoizedState!==null&&Vt(n);break;case 13:Vt(n);break;case 19:$(nt);break;case 10:Gn(n.type);break;case 22:case 23:Vt(n),ff(),e!==null&&$(os);break;case 24:Gn(lt)}}function La(e,n){try{var l=n.updateQueue,o=l!==null?l.lastEffect:null;if(o!==null){var f=o.next;l=f;do{if((l.tag&e)===e){o=void 0;var d=l.create,b=l.inst;o=d(),b.destroy=o}l=l.next}while(l!==f)}}catch(A){He(n,n.return,A)}}function Ni(e,n,l){try{var o=n.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var d=f.next;o=d;do{if((o.tag&e)===e){var b=o.inst,A=b.destroy;if(A!==void 0){b.destroy=void 0,f=n;var k=l,Q=A;try{Q()}catch(ne){He(f,k,ne)}}}o=o.next}while(o!==d)}}catch(ne){He(n,n.return,ne)}}function yp(e){var n=e.updateQueue;if(n!==null){var l=e.stateNode;try{og(n,l)}catch(o){He(e,e.return,o)}}}function vp(e,n,l){l.props=ds(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(o){He(e,n,o)}}function Ra(e,n){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof l=="function"?e.refCleanup=l(o):l.current=o}}catch(f){He(e,n,f)}}function Mn(e,n){var l=e.ref,o=e.refCleanup;if(l!==null)if(typeof o=="function")try{o()}catch(f){He(e,n,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(f){He(e,n,f)}else l.current=null}function bp(e){var n=e.type,l=e.memoizedProps,o=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":l.autoFocus&&o.focus();break e;case"img":l.src?o.src=l.src:l.srcSet&&(o.srcset=l.srcSet)}}catch(f){He(e,e.return,f)}}function Yf(e,n,l){try{var o=e.stateNode;$w(o,e.type,l,n),o[vt]=n}catch(f){He(e,e.return,f)}}function Sp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Di(e.type)||e.tag===4}function Gf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Sp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Di(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xf(e,n,l){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,n):(n=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,n.appendChild(e),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=$n));else if(o!==4&&(o===27&&Di(e.type)&&(l=e.stateNode,n=null),e=e.child,e!==null))for(Xf(e,n,l),e=e.sibling;e!==null;)Xf(e,n,l),e=e.sibling}function Ar(e,n,l){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?l.insertBefore(e,n):l.appendChild(e);else if(o!==4&&(o===27&&Di(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Ar(e,n,l),e=e.sibling;e!==null;)Ar(e,n,l),e=e.sibling}function wp(e){var n=e.stateNode,l=e.memoizedProps;try{for(var o=e.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);pt(n,o,l),n[ct]=e,n[vt]=l}catch(d){He(e,e.return,d)}}var In=!1,rt=!1,Kf=!1,xp=typeof WeakSet=="function"?WeakSet:Set,dt=null;function vw(e,n){if(e=e.containerInfo,hd=Zr,e=Rm(e),jc(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var o=l.getSelection&&l.getSelection();if(o&&o.rangeCount!==0){l=o.anchorNode;var f=o.anchorOffset,d=o.focusNode;o=o.focusOffset;try{l.nodeType,d.nodeType}catch{l=null;break e}var b=0,A=-1,k=-1,Q=0,ne=0,le=e,J=null;t:for(;;){for(var W;le!==l||f!==0&&le.nodeType!==3||(A=b+f),le!==d||o!==0&&le.nodeType!==3||(k=b+o),le.nodeType===3&&(b+=le.nodeValue.length),(W=le.firstChild)!==null;)J=le,le=W;for(;;){if(le===e)break t;if(J===l&&++Q===f&&(A=b),J===d&&++ne===o&&(k=b),(W=le.nextSibling)!==null)break;le=J,J=le.parentNode}le=W}l=A===-1||k===-1?null:{start:A,end:k}}else l=null}l=l||{start:0,end:0}}else l=null;for(md={focusedElem:e,selectionRange:l},Zr=!1,dt=n;dt!==null;)if(n=dt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,dt=e;else for(;dt!==null;){switch(n=dt,d=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)f=e[l],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,l=n,f=d.memoizedProps,d=d.memoizedState,o=l.stateNode;try{var he=ds(l.type,f);e=o.getSnapshotBeforeUpdate(he,d),o.__reactInternalSnapshotBeforeUpdate=e}catch(ve){He(l,l.return,ve)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,l=e.nodeType,l===9)yd(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":yd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(a(163))}if(e=n.sibling,e!==null){e.return=n.return,dt=e;break}dt=n.return}}function Ep(e,n,l){var o=l.flags;switch(l.tag){case 0:case 11:case 15:Fn(e,l),o&4&&La(5,l);break;case 1:if(Fn(e,l),o&4)if(e=l.stateNode,n===null)try{e.componentDidMount()}catch(b){He(l,l.return,b)}else{var f=ds(l.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(b){He(l,l.return,b)}}o&64&&yp(l),o&512&&Ra(l,l.return);break;case 3:if(Fn(e,l),o&64&&(e=l.updateQueue,e!==null)){if(n=null,l.child!==null)switch(l.child.tag){case 27:case 5:n=l.child.stateNode;break;case 1:n=l.child.stateNode}try{og(e,n)}catch(b){He(l,l.return,b)}}break;case 27:n===null&&o&4&&wp(l);case 26:case 5:Fn(e,l),n===null&&o&4&&bp(l),o&512&&Ra(l,l.return);break;case 12:Fn(e,l);break;case 31:Fn(e,l),o&4&&Ap(e,l);break;case 13:Fn(e,l),o&4&&Tp(e,l),o&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Tw.bind(null,l),Zw(e,l))));break;case 22:if(o=l.memoizedState!==null||In,!o){n=n!==null&&n.memoizedState!==null||rt,f=In;var d=rt;In=o,(rt=n)&&!d?Wn(e,l,(l.subtreeFlags&8772)!==0):Fn(e,l),In=f,rt=d}break;case 30:break;default:Fn(e,l)}}function _p(e){var n=e.alternate;n!==null&&(e.alternate=null,_p(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&na(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ze=null,Ot=!1;function Jn(e,n,l){for(l=l.child;l!==null;)Np(e,n,l),l=l.sibling}function Np(e,n,l){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(Ii,l)}catch{}switch(l.tag){case 26:rt||Mn(l,n),Jn(e,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:rt||Mn(l,n);var o=Ze,f=Ot;Di(l.type)&&(Ze=l.stateNode,Ot=!1),Jn(e,n,l),Ya(l.stateNode),Ze=o,Ot=f;break;case 5:rt||Mn(l,n);case 6:if(o=Ze,f=Ot,Ze=null,Jn(e,n,l),Ze=o,Ot=f,Ze!==null)if(Ot)try{(Ze.nodeType===9?Ze.body:Ze.nodeName==="HTML"?Ze.ownerDocument.body:Ze).removeChild(l.stateNode)}catch(d){He(l,n,d)}else try{Ze.removeChild(l.stateNode)}catch(d){He(l,n,d)}break;case 18:Ze!==null&&(Ot?(e=Ze,yy(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),bl(e)):yy(Ze,l.stateNode));break;case 4:o=Ze,f=Ot,Ze=l.stateNode.containerInfo,Ot=!0,Jn(e,n,l),Ze=o,Ot=f;break;case 0:case 11:case 14:case 15:Ni(2,l,n),rt||Ni(4,l,n),Jn(e,n,l);break;case 1:rt||(Mn(l,n),o=l.stateNode,typeof o.componentWillUnmount=="function"&&vp(l,n,o)),Jn(e,n,l);break;case 21:Jn(e,n,l);break;case 22:rt=(o=rt)||l.memoizedState!==null,Jn(e,n,l),rt=o;break;default:Jn(e,n,l)}}function Ap(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{bl(e)}catch(l){He(n,n.return,l)}}}function Tp(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{bl(e)}catch(l){He(n,n.return,l)}}function bw(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new xp),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new xp),n;default:throw Error(a(435,e.tag))}}function Tr(e,n){var l=bw(e);n.forEach(function(o){if(!l.has(o)){l.add(o);var f=Mw.bind(null,e,o);o.then(f,f)}})}function zt(e,n){var l=n.deletions;if(l!==null)for(var o=0;o<l.length;o++){var f=l[o],d=e,b=n,A=b;e:for(;A!==null;){switch(A.tag){case 27:if(Di(A.type)){Ze=A.stateNode,Ot=!1;break e}break;case 5:Ze=A.stateNode,Ot=!1;break e;case 3:case 4:Ze=A.stateNode.containerInfo,Ot=!0;break e}A=A.return}if(Ze===null)throw Error(a(160));Np(d,b,f),Ze=null,Ot=!1,d=f.alternate,d!==null&&(d.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Mp(n,e),n=n.sibling}var hn=null;function Mp(e,n){var l=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:zt(n,e),Dt(e),o&4&&(Ni(3,e,e.return),La(3,e),Ni(5,e,e.return));break;case 1:zt(n,e),Dt(e),o&512&&(rt||l===null||Mn(l,l.return)),o&64&&In&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?o:l.concat(o))));break;case 26:var f=hn;if(zt(n,e),Dt(e),o&512&&(rt||l===null||Mn(l,l.return)),o&4){var d=l!==null?l.memoizedState:null;if(o=e.memoizedState,l===null)if(o===null)if(e.stateNode===null){e:{o=e.type,l=e.memoizedProps,f=f.ownerDocument||f;t:switch(o){case"title":d=f.getElementsByTagName("title")[0],(!d||d[Wi]||d[ct]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=f.createElement(o),f.head.insertBefore(d,f.querySelector("head > title"))),pt(d,o,l),d[ct]=e,st(d),o=d;break e;case"link":var b=My("link","href",f).get(o+(l.href||""));if(b){for(var A=0;A<b.length;A++)if(d=b[A],d.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&d.getAttribute("rel")===(l.rel==null?null:l.rel)&&d.getAttribute("title")===(l.title==null?null:l.title)&&d.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){b.splice(A,1);break t}}d=f.createElement(o),pt(d,o,l),f.head.appendChild(d);break;case"meta":if(b=My("meta","content",f).get(o+(l.content||""))){for(A=0;A<b.length;A++)if(d=b[A],d.getAttribute("content")===(l.content==null?null:""+l.content)&&d.getAttribute("name")===(l.name==null?null:l.name)&&d.getAttribute("property")===(l.property==null?null:l.property)&&d.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&d.getAttribute("charset")===(l.charSet==null?null:l.charSet)){b.splice(A,1);break t}}d=f.createElement(o),pt(d,o,l),f.head.appendChild(d);break;default:throw Error(a(468,o))}d[ct]=e,st(d),o=d}e.stateNode=o}else Cy(f,e.type,e.stateNode);else e.stateNode=Ty(f,o,e.memoizedProps);else d!==o?(d===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):d.count--,o===null?Cy(f,e.type,e.stateNode):Ty(f,o,e.memoizedProps)):o===null&&e.stateNode!==null&&Yf(e,e.memoizedProps,l.memoizedProps)}break;case 27:zt(n,e),Dt(e),o&512&&(rt||l===null||Mn(l,l.return)),l!==null&&o&4&&Yf(e,e.memoizedProps,l.memoizedProps);break;case 5:if(zt(n,e),Dt(e),o&512&&(rt||l===null||Mn(l,l.return)),e.flags&32){f=e.stateNode;try{Vs(f,"")}catch(he){He(e,e.return,he)}}o&4&&e.stateNode!=null&&(f=e.memoizedProps,Yf(e,f,l!==null?l.memoizedProps:f)),o&1024&&(Kf=!0);break;case 6:if(zt(n,e),Dt(e),o&4){if(e.stateNode===null)throw Error(a(162));o=e.memoizedProps,l=e.stateNode;try{l.nodeValue=o}catch(he){He(e,e.return,he)}}break;case 3:if(Yr=null,f=hn,hn=qr(n.containerInfo),zt(n,e),hn=f,Dt(e),o&4&&l!==null&&l.memoizedState.isDehydrated)try{bl(n.containerInfo)}catch(he){He(e,e.return,he)}Kf&&(Kf=!1,Cp(e));break;case 4:o=hn,hn=qr(e.stateNode.containerInfo),zt(n,e),Dt(e),hn=o;break;case 12:zt(n,e),Dt(e);break;case 31:zt(n,e),Dt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,Tr(e,o)));break;case 13:zt(n,e),Dt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Cr=tt()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,Tr(e,o)));break;case 22:f=e.memoizedState!==null;var k=l!==null&&l.memoizedState!==null,Q=In,ne=rt;if(In=Q||f,rt=ne||k,zt(n,e),rt=ne,In=Q,Dt(e),o&8192)e:for(n=e.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(l===null||k||In||rt||hs(e)),l=null,n=e;;){if(n.tag===5||n.tag===26){if(l===null){k=l=n;try{if(d=k.stateNode,f)b=d.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{A=k.stateNode;var le=k.memoizedProps.style,J=le!=null&&le.hasOwnProperty("display")?le.display:null;A.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(he){He(k,k.return,he)}}}else if(n.tag===6){if(l===null){k=n;try{k.stateNode.nodeValue=f?"":k.memoizedProps}catch(he){He(k,k.return,he)}}}else if(n.tag===18){if(l===null){k=n;try{var W=k.stateNode;f?vy(W,!0):vy(k.stateNode,!1)}catch(he){He(k,k.return,he)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;l===n&&(l=null),n=n.return}l===n&&(l=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=e.updateQueue,o!==null&&(l=o.retryQueue,l!==null&&(o.retryQueue=null,Tr(e,l))));break;case 19:zt(n,e),Dt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,Tr(e,o)));break;case 30:break;case 21:break;default:zt(n,e),Dt(e)}}function Dt(e){var n=e.flags;if(n&2){try{for(var l,o=e.return;o!==null;){if(Sp(o)){l=o;break}o=o.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var f=l.stateNode,d=Gf(e);Ar(e,d,f);break;case 5:var b=l.stateNode;l.flags&32&&(Vs(b,""),l.flags&=-33);var A=Gf(e);Ar(e,A,b);break;case 3:case 4:var k=l.stateNode.containerInfo,Q=Gf(e);Xf(e,Q,k);break;default:throw Error(a(161))}}catch(ne){He(e,e.return,ne)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Cp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Cp(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Fn(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Ep(e,n.alternate,n),n=n.sibling}function hs(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Ni(4,n,n.return),hs(n);break;case 1:Mn(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&vp(n,n.return,l),hs(n);break;case 27:Ya(n.stateNode);case 26:case 5:Mn(n,n.return),hs(n);break;case 22:n.memoizedState===null&&hs(n);break;case 30:hs(n);break;default:hs(n)}e=e.sibling}}function Wn(e,n,l){for(l=l&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,f=e,d=n,b=d.flags;switch(d.tag){case 0:case 11:case 15:Wn(f,d,l),La(4,d);break;case 1:if(Wn(f,d,l),o=d,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(Q){He(o,o.return,Q)}if(o=d,f=o.updateQueue,f!==null){var A=o.stateNode;try{var k=f.shared.hiddenCallbacks;if(k!==null)for(f.shared.hiddenCallbacks=null,f=0;f<k.length;f++)ag(k[f],A)}catch(Q){He(o,o.return,Q)}}l&&b&64&&yp(d),Ra(d,d.return);break;case 27:wp(d);case 26:case 5:Wn(f,d,l),l&&o===null&&b&4&&bp(d),Ra(d,d.return);break;case 12:Wn(f,d,l);break;case 31:Wn(f,d,l),l&&b&4&&Ap(f,d);break;case 13:Wn(f,d,l),l&&b&4&&Tp(f,d);break;case 22:d.memoizedState===null&&Wn(f,d,l),Ra(d,d.return);break;case 30:break;default:Wn(f,d,l)}n=n.sibling}}function Zf(e,n){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Sa(l))}function Qf(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Sa(e))}function mn(e,n,l,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Op(e,n,l,o),n=n.sibling}function Op(e,n,l,o){var f=n.flags;switch(n.tag){case 0:case 11:case 15:mn(e,n,l,o),f&2048&&La(9,n);break;case 1:mn(e,n,l,o);break;case 3:mn(e,n,l,o),f&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Sa(e)));break;case 12:if(f&2048){mn(e,n,l,o),e=n.stateNode;try{var d=n.memoizedProps,b=d.id,A=d.onPostCommit;typeof A=="function"&&A(b,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(k){He(n,n.return,k)}}else mn(e,n,l,o);break;case 31:mn(e,n,l,o);break;case 13:mn(e,n,l,o);break;case 23:break;case 22:d=n.stateNode,b=n.alternate,n.memoizedState!==null?d._visibility&2?mn(e,n,l,o):Ba(e,n):d._visibility&2?mn(e,n,l,o):(d._visibility|=2,rl(e,n,l,o,(n.subtreeFlags&10256)!==0||!1)),f&2048&&Zf(b,n);break;case 24:mn(e,n,l,o),f&2048&&Qf(n.alternate,n);break;default:mn(e,n,l,o)}}function rl(e,n,l,o,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var d=e,b=n,A=l,k=o,Q=b.flags;switch(b.tag){case 0:case 11:case 15:rl(d,b,A,k,f),La(8,b);break;case 23:break;case 22:var ne=b.stateNode;b.memoizedState!==null?ne._visibility&2?rl(d,b,A,k,f):Ba(d,b):(ne._visibility|=2,rl(d,b,A,k,f)),f&&Q&2048&&Zf(b.alternate,b);break;case 24:rl(d,b,A,k,f),f&&Q&2048&&Qf(b.alternate,b);break;default:rl(d,b,A,k,f)}n=n.sibling}}function Ba(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var l=e,o=n,f=o.flags;switch(o.tag){case 22:Ba(l,o),f&2048&&Zf(o.alternate,o);break;case 24:Ba(l,o),f&2048&&Qf(o.alternate,o);break;default:Ba(l,o)}n=n.sibling}}var ka=8192;function ul(e,n,l){if(e.subtreeFlags&ka)for(e=e.child;e!==null;)zp(e,n,l),e=e.sibling}function zp(e,n,l){switch(e.tag){case 26:ul(e,n,l),e.flags&ka&&e.memoizedState!==null&&lx(l,hn,e.memoizedState,e.memoizedProps);break;case 5:ul(e,n,l);break;case 3:case 4:var o=hn;hn=qr(e.stateNode.containerInfo),ul(e,n,l),hn=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=ka,ka=16777216,ul(e,n,l),ka=o):ul(e,n,l));break;default:ul(e,n,l)}}function Dp(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Ha(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var o=n[l];dt=o,Rp(o,e)}Dp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Lp(e),e=e.sibling}function Lp(e){switch(e.tag){case 0:case 11:case 15:Ha(e),e.flags&2048&&Ni(9,e,e.return);break;case 3:Ha(e);break;case 12:Ha(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Mr(e)):Ha(e);break;default:Ha(e)}}function Mr(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var o=n[l];dt=o,Rp(o,e)}Dp(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Ni(8,n,n.return),Mr(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,Mr(n));break;default:Mr(n)}e=e.sibling}}function Rp(e,n){for(;dt!==null;){var l=dt;switch(l.tag){case 0:case 11:case 15:Ni(8,l,n);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var o=l.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:Sa(l.memoizedState.cache)}if(o=l.child,o!==null)o.return=l,dt=o;else e:for(l=e;dt!==null;){o=dt;var f=o.sibling,d=o.return;if(_p(o),o===l){dt=null;break e}if(f!==null){f.return=d,dt=f;break e}dt=d}}}var Sw={getCacheForType:function(e){var n=mt(lt),l=n.data.get(e);return l===void 0&&(l=e(),n.data.set(e,l)),l},cacheSignal:function(){return mt(lt).controller.signal}},ww=typeof WeakMap=="function"?WeakMap:Map,Be=0,Ve=null,Ae=null,Me=0,ke=0,Yt=null,Ai=!1,cl=!1,If=!1,Pn=0,et=0,Ti=0,ms=0,Jf=0,Gt=0,fl=0,ja=null,Lt=null,Ff=!1,Cr=0,Bp=0,Or=1/0,zr=null,Mi=null,ft=0,Ci=null,dl=null,ei=0,Wf=0,Pf=null,kp=null,$a=0,ed=null;function Xt(){return(Be&2)!==0&&Me!==0?Me&-Me:T.T!==null?ad():ko()}function Hp(){if(Gt===0)if((Me&536870912)===0||Oe){var e=Rs;Rs<<=1,(Rs&3932160)===0&&(Rs=262144),Gt=e}else Gt=536870912;return e=qt.current,e!==null&&(e.flags|=32),Gt}function Rt(e,n,l){(e===Ve&&(ke===2||ke===9)||e.cancelPendingCommit!==null)&&(hl(e,0),Oi(e,Me,Gt,!1)),Fi(e,l),((Be&2)===0||e!==Ve)&&(e===Ve&&((Be&2)===0&&(ms|=l),et===4&&Oi(e,Me,Gt,!1)),Cn(e))}function jp(e,n,l){if((Be&6)!==0)throw Error(a(327));var o=!l&&(n&127)===0&&(n&e.expiredLanes)===0||Ji(e,n),f=o?_w(e,n):nd(e,n,!0),d=o;do{if(f===0){cl&&!o&&Oi(e,n,0,!1);break}else{if(l=e.current.alternate,d&&!xw(l)){f=nd(e,n,!1),d=!1;continue}if(f===2){if(d=n,e.errorRecoveryDisabledLanes&d)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){n=b;e:{var A=e;f=ja;var k=A.current.memoizedState.isDehydrated;if(k&&(hl(A,b).flags|=256),b=nd(A,b,!1),b!==2){if(If&&!k){A.errorRecoveryDisabledLanes|=d,ms|=d,f=4;break e}d=Lt,Lt=f,d!==null&&(Lt===null?Lt=d:Lt.push.apply(Lt,d))}f=b}if(d=!1,f!==2)continue}}if(f===1){hl(e,0),Oi(e,n,0,!0);break}e:{switch(o=e,d=f,d){case 0:case 1:throw Error(a(345));case 4:if((n&4194048)!==n)break;case 6:Oi(o,n,Gt,!Ai);break e;case 2:Lt=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(f=Cr+300-tt(),10<f)){if(Oi(o,n,Gt,!Ai),ks(o,0,!0)!==0)break e;ei=n,o.timeoutHandle=gy($p.bind(null,o,l,Lt,zr,Ff,n,Gt,ms,fl,Ai,d,"Throttled",-0,0),f);break e}$p(o,l,Lt,zr,Ff,n,Gt,ms,fl,Ai,d,null,-0,0)}}break}while(!0);Cn(e)}function $p(e,n,l,o,f,d,b,A,k,Q,ne,le,J,W){if(e.timeoutHandle=-1,le=n.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$n},zp(n,d,le);var he=(d&62914560)===d?Cr-tt():(d&4194048)===d?Bp-tt():0;if(he=ax(le,he),he!==null){ei=d,e.cancelPendingCommit=he(Zp.bind(null,e,n,d,l,o,f,b,A,k,ne,le,null,J,W)),Oi(e,d,b,!Q);return}}Zp(e,n,d,l,o,f,b,A,k)}function xw(e){for(var n=e;;){var l=n.tag;if((l===0||l===11||l===15)&&n.flags&16384&&(l=n.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var o=0;o<l.length;o++){var f=l[o],d=f.getSnapshot;f=f.value;try{if(!$t(d(),f))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Oi(e,n,l,o){n&=~Jf,n&=~ms,e.suspendedLanes|=n,e.pingedLanes&=~n,o&&(e.warmLanes|=n),o=e.expirationTimes;for(var f=n;0<f;){var d=31-xt(f),b=1<<d;o[d]=-1,f&=~b}l!==0&&Lo(e,l,n)}function Dr(){return(Be&6)===0?(Ua(0),!1):!0}function td(){if(Ae!==null){if(ke===0)var e=Ae.return;else e=Ae,Yn=ls=null,yf(e),il=null,xa=0,e=Ae;for(;e!==null;)pp(e.alternate,e),e=e.return;Ae=null}}function hl(e,n){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Vw(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),ei=0,td(),Ve=e,Ae=l=qn(e.current,null),Me=n,ke=0,Yt=null,Ai=!1,cl=Ji(e,n),If=!1,fl=Gt=Jf=ms=Ti=et=0,Lt=ja=null,Ff=!1,(n&8)!==0&&(n|=n&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=n;0<o;){var f=31-xt(o),d=1<<f;n|=e[f],o&=~d}return Pn=n,Po(),l}function Up(e,n){_e=null,T.H=Oa,n===nl||n===or?(n=ng(),ke=3):n===lf?(n=ng(),ke=4):ke=n===Lf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Yt=n,Ae===null&&(et=1,wr(e,en(n,e.current)))}function qp(){var e=qt.current;return e===null?!0:(Me&4194048)===Me?ln===null:(Me&62914560)===Me||(Me&536870912)!==0?e===ln:!1}function Vp(){var e=T.H;return T.H=Oa,e===null?Oa:e}function Yp(){var e=T.A;return T.A=Sw,e}function Lr(){et=4,Ai||(Me&4194048)!==Me&&qt.current!==null||(cl=!0),(Ti&134217727)===0&&(ms&134217727)===0||Ve===null||Oi(Ve,Me,Gt,!1)}function nd(e,n,l){var o=Be;Be|=2;var f=Vp(),d=Yp();(Ve!==e||Me!==n)&&(zr=null,hl(e,n)),n=!1;var b=et;e:do try{if(ke!==0&&Ae!==null){var A=Ae,k=Yt;switch(ke){case 8:td(),b=6;break e;case 3:case 2:case 9:case 6:qt.current===null&&(n=!0);var Q=ke;if(ke=0,Yt=null,ml(e,A,k,Q),l&&cl){b=0;break e}break;default:Q=ke,ke=0,Yt=null,ml(e,A,k,Q)}}Ew(),b=et;break}catch(ne){Up(e,ne)}while(!0);return n&&e.shellSuspendCounter++,Yn=ls=null,Be=o,T.H=f,T.A=d,Ae===null&&(Ve=null,Me=0,Po()),b}function Ew(){for(;Ae!==null;)Gp(Ae)}function _w(e,n){var l=Be;Be|=2;var o=Vp(),f=Yp();Ve!==e||Me!==n?(zr=null,Or=tt()+500,hl(e,n)):cl=Ji(e,n);e:do try{if(ke!==0&&Ae!==null){n=Ae;var d=Yt;t:switch(ke){case 1:ke=0,Yt=null,ml(e,n,d,1);break;case 2:case 9:if(eg(d)){ke=0,Yt=null,Xp(n);break}n=function(){ke!==2&&ke!==9||Ve!==e||(ke=7),Cn(e)},d.then(n,n);break e;case 3:ke=7;break e;case 4:ke=5;break e;case 7:eg(d)?(ke=0,Yt=null,Xp(n)):(ke=0,Yt=null,ml(e,n,d,7));break;case 5:var b=null;switch(Ae.tag){case 26:b=Ae.memoizedState;case 5:case 27:var A=Ae;if(b?Oy(b):A.stateNode.complete){ke=0,Yt=null;var k=A.sibling;if(k!==null)Ae=k;else{var Q=A.return;Q!==null?(Ae=Q,Rr(Q)):Ae=null}break t}}ke=0,Yt=null,ml(e,n,d,5);break;case 6:ke=0,Yt=null,ml(e,n,d,6);break;case 8:td(),et=6;break e;default:throw Error(a(462))}}Nw();break}catch(ne){Up(e,ne)}while(!0);return Yn=ls=null,T.H=o,T.A=f,Be=l,Ae!==null?0:(Ve=null,Me=0,Po(),et)}function Nw(){for(;Ae!==null&&!Qi();)Gp(Ae)}function Gp(e){var n=mp(e.alternate,e,Pn);e.memoizedProps=e.pendingProps,n===null?Rr(e):Ae=n}function Xp(e){var n=e,l=n.alternate;switch(n.tag){case 15:case 0:n=rp(l,n,n.pendingProps,n.type,void 0,Me);break;case 11:n=rp(l,n,n.pendingProps,n.type.render,n.ref,Me);break;case 5:yf(n);default:pp(l,n),n=Ae=Ym(n,Pn),n=mp(l,n,Pn)}e.memoizedProps=e.pendingProps,n===null?Rr(e):Ae=n}function ml(e,n,l,o){Yn=ls=null,yf(n),il=null,xa=0;var f=n.return;try{if(hw(e,f,n,l,Me)){et=1,wr(e,en(l,e.current)),Ae=null;return}}catch(d){if(f!==null)throw Ae=f,d;et=1,wr(e,en(l,e.current)),Ae=null;return}n.flags&32768?(Oe||o===1?e=!0:cl||(Me&536870912)!==0?e=!1:(Ai=e=!0,(o===2||o===9||o===3||o===6)&&(o=qt.current,o!==null&&o.tag===13&&(o.flags|=16384))),Kp(n,e)):Rr(n)}function Rr(e){var n=e;do{if((n.flags&32768)!==0){Kp(n,Ai);return}e=n.return;var l=pw(n.alternate,n,Pn);if(l!==null){Ae=l;return}if(n=n.sibling,n!==null){Ae=n;return}Ae=n=e}while(n!==null);et===0&&(et=5)}function Kp(e,n){do{var l=yw(e.alternate,e);if(l!==null){l.flags&=32767,Ae=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(e=e.sibling,e!==null)){Ae=e;return}Ae=e=l}while(e!==null);et=6,Ae=null}function Zp(e,n,l,o,f,d,b,A,k){e.cancelPendingCommit=null;do Br();while(ft!==0);if((Be&6)!==0)throw Error(a(327));if(n!==null){if(n===e.current)throw Error(a(177));if(d=n.lanes|n.childLanes,d|=Yc,Sc(e,l,d,b,A,k),e===Ve&&(Ae=Ve=null,Me=0),dl=n,Ci=e,ei=l,Wf=d,Pf=f,kp=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Cw(Wt,function(){return Wp(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=T.T,T.T=null,f=D.p,D.p=2,b=Be,Be|=4;try{vw(e,n,l)}finally{Be=b,D.p=f,T.T=o}}ft=1,Qp(),Ip(),Jp()}}function Qp(){if(ft===1){ft=0;var e=Ci,n=dl,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=T.T,T.T=null;var o=D.p;D.p=2;var f=Be;Be|=4;try{Mp(n,e);var d=md,b=Rm(e.containerInfo),A=d.focusedElem,k=d.selectionRange;if(b!==A&&A&&A.ownerDocument&&Lm(A.ownerDocument.documentElement,A)){if(k!==null&&jc(A)){var Q=k.start,ne=k.end;if(ne===void 0&&(ne=Q),"selectionStart"in A)A.selectionStart=Q,A.selectionEnd=Math.min(ne,A.value.length);else{var le=A.ownerDocument||document,J=le&&le.defaultView||window;if(J.getSelection){var W=J.getSelection(),he=A.textContent.length,ve=Math.min(k.start,he),qe=k.end===void 0?ve:Math.min(k.end,he);!W.extend&&ve>qe&&(b=qe,qe=ve,ve=b);var V=Dm(A,ve),U=Dm(A,qe);if(V&&U&&(W.rangeCount!==1||W.anchorNode!==V.node||W.anchorOffset!==V.offset||W.focusNode!==U.node||W.focusOffset!==U.offset)){var Z=le.createRange();Z.setStart(V.node,V.offset),W.removeAllRanges(),ve>qe?(W.addRange(Z),W.extend(U.node,U.offset)):(Z.setEnd(U.node,U.offset),W.addRange(Z))}}}}for(le=[],W=A;W=W.parentNode;)W.nodeType===1&&le.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<le.length;A++){var se=le[A];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}Zr=!!hd,md=hd=null}finally{Be=f,D.p=o,T.T=l}}e.current=n,ft=2}}function Ip(){if(ft===2){ft=0;var e=Ci,n=dl,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=T.T,T.T=null;var o=D.p;D.p=2;var f=Be;Be|=4;try{Ep(e,n.alternate,n)}finally{Be=f,D.p=o,T.T=l}}ft=3}}function Jp(){if(ft===4||ft===3){ft=0,Bn();var e=Ci,n=dl,l=ei,o=kp;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?ft=5:(ft=0,dl=Ci=null,Fp(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(Mi=null),ta(l),n=n.stateNode,wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(Ii,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=T.T,f=D.p,D.p=2,T.T=null;try{for(var d=e.onRecoverableError,b=0;b<o.length;b++){var A=o[b];d(A.value,{componentStack:A.stack})}}finally{T.T=n,D.p=f}}(ei&3)!==0&&Br(),Cn(e),f=e.pendingLanes,(l&261930)!==0&&(f&42)!==0?e===ed?$a++:($a=0,ed=e):$a=0,Ua(0)}}function Fp(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Sa(n)))}function Br(){return Qp(),Ip(),Jp(),Wp()}function Wp(){if(ft!==5)return!1;var e=Ci,n=Wf;Wf=0;var l=ta(ei),o=T.T,f=D.p;try{D.p=32>l?32:l,T.T=null,l=Pf,Pf=null;var d=Ci,b=ei;if(ft=0,dl=Ci=null,ei=0,(Be&6)!==0)throw Error(a(331));var A=Be;if(Be|=4,Lp(d.current),Op(d,d.current,b,l),Be=A,Ua(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(Ii,d)}catch{}return!0}finally{D.p=f,T.T=o,Fp(e,n)}}function Pp(e,n,l){n=en(l,n),n=Df(e.stateNode,n,2),e=xi(e,n,2),e!==null&&(Fi(e,2),Cn(e))}function He(e,n,l){if(e.tag===3)Pp(e,e,l);else for(;n!==null;){if(n.tag===3){Pp(n,e,l);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Mi===null||!Mi.has(o))){e=en(l,e),l=ep(2),o=xi(n,l,2),o!==null&&(tp(l,o,n,e),Fi(o,2),Cn(o));break}}n=n.return}}function id(e,n,l){var o=e.pingCache;if(o===null){o=e.pingCache=new ww;var f=new Set;o.set(n,f)}else f=o.get(n),f===void 0&&(f=new Set,o.set(n,f));f.has(l)||(If=!0,f.add(l),e=Aw.bind(null,e,n,l),n.then(e,e))}function Aw(e,n,l){var o=e.pingCache;o!==null&&o.delete(n),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Ve===e&&(Me&l)===l&&(et===4||et===3&&(Me&62914560)===Me&&300>tt()-Cr?(Be&2)===0&&hl(e,0):Jf|=l,fl===Me&&(fl=0)),Cn(e)}function ey(e,n){n===0&&(n=Do()),e=ns(e,n),e!==null&&(Fi(e,n),Cn(e))}function Tw(e){var n=e.memoizedState,l=0;n!==null&&(l=n.retryLane),ey(e,l)}function Mw(e,n){var l=0;switch(e.tag){case 31:case 13:var o=e.stateNode,f=e.memoizedState;f!==null&&(l=f.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(a(314))}o!==null&&o.delete(n),ey(e,l)}function Cw(e,n){return At(e,n)}var kr=null,gl=null,sd=!1,Hr=!1,ld=!1,zi=0;function Cn(e){e!==gl&&e.next===null&&(gl===null?kr=gl=e:gl=gl.next=e),Hr=!0,sd||(sd=!0,zw())}function Ua(e,n){if(!ld&&Hr){ld=!0;do for(var l=!1,o=kr;o!==null;){if(e!==0){var f=o.pendingLanes;if(f===0)var d=0;else{var b=o.suspendedLanes,A=o.pingedLanes;d=(1<<31-xt(42|e)+1)-1,d&=f&~(b&~A),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(l=!0,sy(o,d))}else d=Me,d=ks(o,o===Ve?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(d&3)===0||Ji(o,d)||(l=!0,sy(o,d));o=o.next}while(l);ld=!1}}function Ow(){ty()}function ty(){Hr=sd=!1;var e=0;zi!==0&&qw()&&(e=zi);for(var n=tt(),l=null,o=kr;o!==null;){var f=o.next,d=ny(o,n);d===0?(o.next=null,l===null?kr=f:l.next=f,f===null&&(gl=l)):(l=o,(e!==0||(d&3)!==0)&&(Hr=!0)),o=f}ft!==0&&ft!==5||Ua(e),zi!==0&&(zi=0)}function ny(e,n){for(var l=e.suspendedLanes,o=e.pingedLanes,f=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var b=31-xt(d),A=1<<b,k=f[b];k===-1?((A&l)===0||(A&o)!==0)&&(f[b]=bc(A,n)):k<=n&&(e.expiredLanes|=A),d&=~A}if(n=Ve,l=Me,l=ks(e,e===n?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,l===0||e===n&&(ke===2||ke===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&Ht(o),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Ji(e,l)){if(n=l&-l,n===e.callbackPriority)return n;switch(o!==null&&Ht(o),ta(l)){case 2:case 8:l=Ft;break;case 32:l=Wt;break;case 268435456:l=Ds;break;default:l=Wt}return o=iy.bind(null,e),l=At(l,o),e.callbackPriority=n,e.callbackNode=l,n}return o!==null&&o!==null&&Ht(o),e.callbackPriority=2,e.callbackNode=null,2}function iy(e,n){if(ft!==0&&ft!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Br()&&e.callbackNode!==l)return null;var o=Me;return o=ks(e,e===Ve?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(jp(e,o,n),ny(e,tt()),e.callbackNode!=null&&e.callbackNode===l?iy.bind(null,e):null)}function sy(e,n){if(Br())return null;jp(e,n,!0)}function zw(){Yw(function(){(Be&6)!==0?At(Jt,Ow):ty()})}function ad(){if(zi===0){var e=el;e===0&&(e=Ls,Ls<<=1,(Ls&261888)===0&&(Ls=256)),zi=e}return zi}function ly(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Xo(""+e)}function ay(e,n){var l=n.ownerDocument.createElement("input");return l.name=n.name,l.value=n.value,e.id&&l.setAttribute("form",e.id),n.parentNode.insertBefore(l,n),e=new FormData(e),l.parentNode.removeChild(l),e}function Dw(e,n,l,o,f){if(n==="submit"&&l&&l.stateNode===f){var d=ly((f[vt]||null).action),b=o.submitter;b&&(n=(n=b[vt]||null)?ly(n.formAction):b.getAttribute("formAction"),n!==null&&(d=n,b=null));var A=new Io("action","action",null,o,f);e.push({event:A,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(zi!==0){var k=b?ay(f,b):new FormData(f);Af(l,{pending:!0,data:k,method:f.method,action:d},null,k)}}else typeof d=="function"&&(A.preventDefault(),k=b?ay(f,b):new FormData(f),Af(l,{pending:!0,data:k,method:f.method,action:d},d,k))},currentTarget:f}]})}}for(var od=0;od<Vc.length;od++){var rd=Vc[od],Lw=rd.toLowerCase(),Rw=rd[0].toUpperCase()+rd.slice(1);dn(Lw,"on"+Rw)}dn(Hm,"onAnimationEnd"),dn(jm,"onAnimationIteration"),dn($m,"onAnimationStart"),dn("dblclick","onDoubleClick"),dn("focusin","onFocus"),dn("focusout","onBlur"),dn(JS,"onTransitionRun"),dn(FS,"onTransitionStart"),dn(WS,"onTransitionCancel"),dn(Um,"onTransitionEnd"),hi("onMouseEnter",["mouseout","mouseover"]),hi("onMouseLeave",["mouseout","mouseover"]),hi("onPointerEnter",["pointerout","pointerover"]),hi("onPointerLeave",["pointerout","pointerover"]),jn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),jn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),jn("onBeforeInput",["compositionend","keypress","textInput","paste"]),jn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),jn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),jn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qa="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(" "),Bw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qa));function oy(e,n){n=(n&4)!==0;for(var l=0;l<e.length;l++){var o=e[l],f=o.event;o=o.listeners;e:{var d=void 0;if(n)for(var b=o.length-1;0<=b;b--){var A=o[b],k=A.instance,Q=A.currentTarget;if(A=A.listener,k!==d&&f.isPropagationStopped())break e;d=A,f.currentTarget=Q;try{d(f)}catch(ne){Wo(ne)}f.currentTarget=null,d=k}else for(b=0;b<o.length;b++){if(A=o[b],k=A.instance,Q=A.currentTarget,A=A.listener,k!==d&&f.isPropagationStopped())break e;d=A,f.currentTarget=Q;try{d(f)}catch(ne){Wo(ne)}f.currentTarget=null,d=k}}}}function Te(e,n){var l=n[Hs];l===void 0&&(l=n[Hs]=new Set);var o=e+"__bubble";l.has(o)||(ry(n,e,2,!1),l.add(o))}function ud(e,n,l){var o=0;n&&(o|=4),ry(l,e,o,n)}var jr="_reactListening"+Math.random().toString(36).slice(2);function cd(e){if(!e[jr]){e[jr]=!0,Uo.forEach(function(l){l!=="selectionchange"&&(Bw.has(l)||ud(l,!1,e),ud(l,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[jr]||(n[jr]=!0,ud("selectionchange",!1,n))}}function ry(e,n,l,o){switch(Hy(n)){case 2:var f=ux;break;case 8:f=cx;break;default:f=Nd}l=f.bind(null,n,l,e),f=void 0,!Cc||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),o?f!==void 0?e.addEventListener(n,l,{capture:!0,passive:f}):e.addEventListener(n,l,!0):f!==void 0?e.addEventListener(n,l,{passive:f}):e.addEventListener(n,l,!1)}function fd(e,n,l,o,f){var d=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var b=o.tag;if(b===3||b===4){var A=o.stateNode.containerInfo;if(A===f)break;if(b===4)for(b=o.return;b!==null;){var k=b.tag;if((k===3||k===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;A!==null;){if(b=ui(A),b===null)return;if(k=b.tag,k===5||k===6||k===26||k===27){o=d=b;continue e}A=A.parentNode}}o=o.return}hm(function(){var Q=d,ne=Tc(l),le=[];e:{var J=qm.get(e);if(J!==void 0){var W=Io,he=e;switch(e){case"keypress":if(Zo(l)===0)break e;case"keydown":case"keyup":W=MS;break;case"focusin":he="focus",W=Lc;break;case"focusout":he="blur",W=Lc;break;case"beforeblur":case"afterblur":W=Lc;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":W=pm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":W=pS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=zS;break;case Hm:case jm:case $m:W=bS;break;case Um:W=LS;break;case"scroll":case"scrollend":W=mS;break;case"wheel":W=BS;break;case"copy":case"cut":case"paste":W=wS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":W=vm;break;case"toggle":case"beforetoggle":W=HS}var ve=(n&4)!==0,qe=!ve&&(e==="scroll"||e==="scrollend"),V=ve?J!==null?J+"Capture":null:J;ve=[];for(var U=Q,Z;U!==null;){var se=U;if(Z=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||Z===null||V===null||(se=ua(U,V),se!=null&&ve.push(Va(U,se,Z))),qe)break;U=U.return}0<ve.length&&(J=new W(J,he,null,l,ne),le.push({event:J,listeners:ve}))}}if((n&7)===0){e:{if(J=e==="mouseover"||e==="pointerover",W=e==="mouseout"||e==="pointerout",J&&l!==Ac&&(he=l.relatedTarget||l.fromElement)&&(ui(he)||he[Hn]))break e;if((W||J)&&(J=ne.window===ne?ne:(J=ne.ownerDocument)?J.defaultView||J.parentWindow:window,W?(he=l.relatedTarget||l.toElement,W=Q,he=he?ui(he):null,he!==null&&(qe=u(he),ve=he.tag,he!==qe||ve!==5&&ve!==27&&ve!==6)&&(he=null)):(W=null,he=Q),W!==he)){if(ve=pm,se="onMouseLeave",V="onMouseEnter",U="mouse",(e==="pointerout"||e==="pointerover")&&(ve=vm,se="onPointerLeave",V="onPointerEnter",U="pointer"),qe=W==null?J:fi(W),Z=he==null?J:fi(he),J=new ve(se,U+"leave",W,l,ne),J.target=qe,J.relatedTarget=Z,se=null,ui(ne)===Q&&(ve=new ve(V,U+"enter",he,l,ne),ve.target=Z,ve.relatedTarget=qe,se=ve),qe=se,W&&he)t:{for(ve=kw,V=W,U=he,Z=0,se=V;se;se=ve(se))Z++;se=0;for(var pe=U;pe;pe=ve(pe))se++;for(;0<Z-se;)V=ve(V),Z--;for(;0<se-Z;)U=ve(U),se--;for(;Z--;){if(V===U||U!==null&&V===U.alternate){ve=V;break t}V=ve(V),U=ve(U)}ve=null}else ve=null;W!==null&&uy(le,J,W,ve,!1),he!==null&&qe!==null&&uy(le,qe,he,ve,!0)}}e:{if(J=Q?fi(Q):window,W=J.nodeName&&J.nodeName.toLowerCase(),W==="select"||W==="input"&&J.type==="file")var Le=Am;else if(_m(J))if(Tm)Le=ZS;else{Le=XS;var me=GS}else W=J.nodeName,!W||W.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?Q&&Nc(Q.elementType)&&(Le=Am):Le=KS;if(Le&&(Le=Le(e,Q))){Nm(le,Le,l,ne);break e}me&&me(e,J,Q),e==="focusout"&&Q&&J.type==="number"&&Q.memoizedProps.value!=null&&oa(J,"number",J.value)}switch(me=Q?fi(Q):window,e){case"focusin":(_m(me)||me.contentEditable==="true")&&(Ks=me,$c=Q,ya=null);break;case"focusout":ya=$c=Ks=null;break;case"mousedown":Uc=!0;break;case"contextmenu":case"mouseup":case"dragend":Uc=!1,Bm(le,l,ne);break;case"selectionchange":if(IS)break;case"keydown":case"keyup":Bm(le,l,ne)}var Ne;if(Bc)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else Xs?xm(e,l)&&(Ce="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Ce="onCompositionStart");Ce&&(bm&&l.locale!=="ko"&&(Xs||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&Xs&&(Ne=mm()):(gi=ne,Oc="value"in gi?gi.value:gi.textContent,Xs=!0)),me=$r(Q,Ce),0<me.length&&(Ce=new ym(Ce,e,null,l,ne),le.push({event:Ce,listeners:me}),Ne?Ce.data=Ne:(Ne=Em(l),Ne!==null&&(Ce.data=Ne)))),(Ne=$S?US(e,l):qS(e,l))&&(Ce=$r(Q,"onBeforeInput"),0<Ce.length&&(me=new ym("onBeforeInput","beforeinput",null,l,ne),le.push({event:me,listeners:Ce}),me.data=Ne)),Dw(le,e,Q,l,ne)}oy(le,n)})}function Va(e,n,l){return{instance:e,listener:n,currentTarget:l}}function $r(e,n){for(var l=n+"Capture",o=[];e!==null;){var f=e,d=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||d===null||(f=ua(e,l),f!=null&&o.unshift(Va(e,f,d)),f=ua(e,n),f!=null&&o.push(Va(e,f,d))),e.tag===3)return o;e=e.return}return[]}function kw(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function uy(e,n,l,o,f){for(var d=n._reactName,b=[];l!==null&&l!==o;){var A=l,k=A.alternate,Q=A.stateNode;if(A=A.tag,k!==null&&k===o)break;A!==5&&A!==26&&A!==27||Q===null||(k=Q,f?(Q=ua(l,d),Q!=null&&b.unshift(Va(l,Q,k))):f||(Q=ua(l,d),Q!=null&&b.push(Va(l,Q,k)))),l=l.return}b.length!==0&&e.push({event:n,listeners:b})}var Hw=/\r\n?/g,jw=/\u0000|\uFFFD/g;function cy(e){return(typeof e=="string"?e:""+e).replace(Hw,`
|
|
9
|
+
`).replace(jw,"")}function fy(e,n){return n=cy(n),cy(e)===n}function Ue(e,n,l,o,f,d){switch(l){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||Vs(e,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&Vs(e,""+o);break;case"className":$s(e,"class",o);break;case"tabIndex":$s(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":$s(e,l,o);break;case"style":fm(e,o,d);break;case"data":if(n!=="object"){$s(e,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||l!=="href")){e.removeAttribute(l);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(l);break}o=Xo(""+o),e.setAttribute(l,o);break;case"action":case"formAction":if(typeof o=="function"){e.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 d=="function"&&(l==="formAction"?(n!=="input"&&Ue(e,n,"name",f.name,f,null),Ue(e,n,"formEncType",f.formEncType,f,null),Ue(e,n,"formMethod",f.formMethod,f,null),Ue(e,n,"formTarget",f.formTarget,f,null)):(Ue(e,n,"encType",f.encType,f,null),Ue(e,n,"method",f.method,f,null),Ue(e,n,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(l);break}o=Xo(""+o),e.setAttribute(l,o);break;case"onClick":o!=null&&(e.onclick=$n);break;case"onScroll":o!=null&&Te("scroll",e);break;case"onScrollEnd":o!=null&&Te("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(l=o.__html,l!=null){if(f.children!=null)throw Error(a(60));e.innerHTML=l}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}l=Xo(""+o),e.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":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(l,""+o):e.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":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":o===!0?e.setAttribute(l,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(l,o):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(l,o):e.removeAttribute(l);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(l):e.setAttribute(l,o);break;case"popover":Te("beforetoggle",e),Te("toggle",e),js(e,"popover",o);break;case"xlinkActuate":fn(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":fn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":fn(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":fn(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":fn(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":fn(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":fn(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":fn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":fn(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":js(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=dS.get(l)||l,js(e,l,o))}}function dd(e,n,l,o,f,d){switch(l){case"style":fm(e,o,d);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(l=o.__html,l!=null){if(f.children!=null)throw Error(a(60));e.innerHTML=l}}break;case"children":typeof o=="string"?Vs(e,o):(typeof o=="number"||typeof o=="bigint")&&Vs(e,""+o);break;case"onScroll":o!=null&&Te("scroll",e);break;case"onScrollEnd":o!=null&&Te("scrollend",e);break;case"onClick":o!=null&&(e.onclick=$n);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qo.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(f=l.endsWith("Capture"),n=l.slice(2,f?l.length-7:void 0),d=e[vt]||null,d=d!=null?d[l]:null,typeof d=="function"&&e.removeEventListener(n,d,f),typeof o=="function")){typeof d!="function"&&d!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(n,o,f);break e}l in e?e[l]=o:o===!0?e.setAttribute(l,""):js(e,l,o)}}}function pt(e,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Te("error",e),Te("load",e);var o=!1,f=!1,d;for(d in l)if(l.hasOwnProperty(d)){var b=l[d];if(b!=null)switch(d){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:Ue(e,n,d,b,l,null)}}f&&Ue(e,n,"srcSet",l.srcSet,l,null),o&&Ue(e,n,"src",l.src,l,null);return;case"input":Te("invalid",e);var A=d=b=f=null,k=null,Q=null;for(o in l)if(l.hasOwnProperty(o)){var ne=l[o];if(ne!=null)switch(o){case"name":f=ne;break;case"type":b=ne;break;case"checked":k=ne;break;case"defaultChecked":Q=ne;break;case"value":d=ne;break;case"defaultValue":A=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,n));break;default:Ue(e,n,o,ne,l,null)}}qs(e,d,A,k,Q,b,f,!1);return;case"select":Te("invalid",e),o=b=d=null;for(f in l)if(l.hasOwnProperty(f)&&(A=l[f],A!=null))switch(f){case"value":d=A;break;case"defaultValue":b=A;break;case"multiple":o=A;default:Ue(e,n,f,A,l,null)}n=d,l=b,e.multiple=!!o,n!=null?mi(e,!!o,n,!1):l!=null&&mi(e,!!o,l,!0);return;case"textarea":Te("invalid",e),d=f=o=null;for(b in l)if(l.hasOwnProperty(b)&&(A=l[b],A!=null))switch(b){case"value":o=A;break;case"defaultValue":f=A;break;case"children":d=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(a(91));break;default:Ue(e,n,b,A,l,null)}um(e,o,f,d);return;case"option":for(k in l)l.hasOwnProperty(k)&&(o=l[k],o!=null)&&(k==="selected"?e.selected=o&&typeof o!="function"&&typeof o!="symbol":Ue(e,n,k,o,l,null));return;case"dialog":Te("beforetoggle",e),Te("toggle",e),Te("cancel",e),Te("close",e);break;case"iframe":case"object":Te("load",e);break;case"video":case"audio":for(o=0;o<qa.length;o++)Te(qa[o],e);break;case"image":Te("error",e),Te("load",e);break;case"details":Te("toggle",e);break;case"embed":case"source":case"link":Te("error",e),Te("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Q in l)if(l.hasOwnProperty(Q)&&(o=l[Q],o!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:Ue(e,n,Q,o,l,null)}return;default:if(Nc(n)){for(ne in l)l.hasOwnProperty(ne)&&(o=l[ne],o!==void 0&&dd(e,n,ne,o,l,void 0));return}}for(A in l)l.hasOwnProperty(A)&&(o=l[A],o!=null&&Ue(e,n,A,o,l,null))}function $w(e,n,l,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,d=null,b=null,A=null,k=null,Q=null,ne=null;for(W in l){var le=l[W];if(l.hasOwnProperty(W)&&le!=null)switch(W){case"checked":break;case"value":break;case"defaultValue":k=le;default:o.hasOwnProperty(W)||Ue(e,n,W,null,o,le)}}for(var J in o){var W=o[J];if(le=l[J],o.hasOwnProperty(J)&&(W!=null||le!=null))switch(J){case"type":d=W;break;case"name":f=W;break;case"checked":Q=W;break;case"defaultChecked":ne=W;break;case"value":b=W;break;case"defaultValue":A=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(a(137,n));break;default:W!==le&&Ue(e,n,J,W,o,le)}}aa(e,b,A,k,Q,ne,d,f);return;case"select":W=b=A=J=null;for(d in l)if(k=l[d],l.hasOwnProperty(d)&&k!=null)switch(d){case"value":break;case"multiple":W=k;default:o.hasOwnProperty(d)||Ue(e,n,d,null,o,k)}for(f in o)if(d=o[f],k=l[f],o.hasOwnProperty(f)&&(d!=null||k!=null))switch(f){case"value":J=d;break;case"defaultValue":A=d;break;case"multiple":b=d;default:d!==k&&Ue(e,n,f,d,o,k)}n=A,l=b,o=W,J!=null?mi(e,!!l,J,!1):!!o!=!!l&&(n!=null?mi(e,!!l,n,!0):mi(e,!!l,l?[]:"",!1));return;case"textarea":W=J=null;for(A in l)if(f=l[A],l.hasOwnProperty(A)&&f!=null&&!o.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:Ue(e,n,A,null,o,f)}for(b in o)if(f=o[b],d=l[b],o.hasOwnProperty(b)&&(f!=null||d!=null))switch(b){case"value":J=f;break;case"defaultValue":W=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(a(91));break;default:f!==d&&Ue(e,n,b,f,o,d)}ra(e,J,W);return;case"option":for(var he in l)J=l[he],l.hasOwnProperty(he)&&J!=null&&!o.hasOwnProperty(he)&&(he==="selected"?e.selected=!1:Ue(e,n,he,null,o,J));for(k in o)J=o[k],W=l[k],o.hasOwnProperty(k)&&J!==W&&(J!=null||W!=null)&&(k==="selected"?e.selected=J&&typeof J!="function"&&typeof J!="symbol":Ue(e,n,k,J,o,W));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 ve in l)J=l[ve],l.hasOwnProperty(ve)&&J!=null&&!o.hasOwnProperty(ve)&&Ue(e,n,ve,null,o,J);for(Q in o)if(J=o[Q],W=l[Q],o.hasOwnProperty(Q)&&J!==W&&(J!=null||W!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,n));break;default:Ue(e,n,Q,J,o,W)}return;default:if(Nc(n)){for(var qe in l)J=l[qe],l.hasOwnProperty(qe)&&J!==void 0&&!o.hasOwnProperty(qe)&&dd(e,n,qe,void 0,o,J);for(ne in o)J=o[ne],W=l[ne],!o.hasOwnProperty(ne)||J===W||J===void 0&&W===void 0||dd(e,n,ne,J,o,W);return}}for(var V in l)J=l[V],l.hasOwnProperty(V)&&J!=null&&!o.hasOwnProperty(V)&&Ue(e,n,V,null,o,J);for(le in o)J=o[le],W=l[le],!o.hasOwnProperty(le)||J===W||J==null&&W==null||Ue(e,n,le,J,o,W)}function dy(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Uw(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,l=performance.getEntriesByType("resource"),o=0;o<l.length;o++){var f=l[o],d=f.transferSize,b=f.initiatorType,A=f.duration;if(d&&A&&dy(b)){for(b=0,A=f.responseEnd,o+=1;o<l.length;o++){var k=l[o],Q=k.startTime;if(Q>A)break;var ne=k.transferSize,le=k.initiatorType;ne&&dy(le)&&(k=k.responseEnd,b+=ne*(k<A?1:(A-Q)/(k-Q)))}if(--o,n+=8*(d+b)/(f.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var hd=null,md=null;function Ur(e){return e.nodeType===9?e:e.ownerDocument}function hy(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function my(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function gd(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var pd=null;function qw(){var e=window.event;return e&&e.type==="popstate"?e===pd?!1:(pd=e,!0):(pd=null,!1)}var gy=typeof setTimeout=="function"?setTimeout:void 0,Vw=typeof clearTimeout=="function"?clearTimeout:void 0,py=typeof Promise=="function"?Promise:void 0,Yw=typeof queueMicrotask=="function"?queueMicrotask:typeof py<"u"?function(e){return py.resolve(null).then(e).catch(Gw)}:gy;function Gw(e){setTimeout(function(){throw e})}function Di(e){return e==="head"}function yy(e,n){var l=n,o=0;do{var f=l.nextSibling;if(e.removeChild(l),f&&f.nodeType===8)if(l=f.data,l==="/$"||l==="/&"){if(o===0){e.removeChild(f),bl(n);return}o--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")o++;else if(l==="html")Ya(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Ya(l);for(var d=l.firstChild;d;){var b=d.nextSibling,A=d.nodeName;d[Wi]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&d.rel.toLowerCase()==="stylesheet"||l.removeChild(d),d=b}}else l==="body"&&Ya(e.ownerDocument.body);l=f}while(l);bl(n)}function vy(e,n){var l=e;e=0;do{var o=l.nextSibling;if(l.nodeType===1?n?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(n?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),o&&o.nodeType===8)if(l=o.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=o}while(l)}function yd(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var l=n;switch(n=n.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":yd(l),na(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Xw(e,n,l,o){for(;e.nodeType===1;){var f=l;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[Wi])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var d=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=an(e.nextSibling),e===null)break}return null}function Kw(e,n,l){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=an(e.nextSibling),e===null))return null;return e}function by(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=an(e.nextSibling),e===null))return null;return e}function vd(e){return e.data==="$?"||e.data==="$~"}function bd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Zw(e,n){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||l.readyState!=="loading")n();else{var o=function(){n(),l.removeEventListener("DOMContentLoaded",o)};l.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function an(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var Sd=null;function Sy(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(n===0)return an(e.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}e=e.nextSibling}return null}function wy(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(n===0)return e;n--}else l!=="/$"&&l!=="/&"||n++}e=e.previousSibling}return null}function xy(e,n,l){switch(n=Ur(l),e){case"html":if(e=n.documentElement,!e)throw Error(a(452));return e;case"head":if(e=n.head,!e)throw Error(a(453));return e;case"body":if(e=n.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Ya(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);na(e)}var on=new Map,Ey=new Set;function qr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ti=D.d;D.d={f:Qw,r:Iw,D:Jw,C:Fw,L:Ww,m:Pw,X:tx,S:ex,M:nx};function Qw(){var e=ti.f(),n=Dr();return e||n}function Iw(e){var n=ci(e);n!==null&&n.tag===5&&n.type==="form"?Ug(n):ti.r(e)}var pl=typeof document>"u"?null:document;function _y(e,n,l){var o=pl;if(o&&typeof n=="string"&&n){var f=Mt(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),Ey.has(f)||(Ey.add(f),e={rel:e,crossOrigin:l,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),pt(n,"link",e),st(n),o.head.appendChild(n)))}}function Jw(e){ti.D(e),_y("dns-prefetch",e,null)}function Fw(e,n){ti.C(e,n),_y("preconnect",e,n)}function Ww(e,n,l){ti.L(e,n,l);var o=pl;if(o&&e&&n){var f='link[rel="preload"][as="'+Mt(n)+'"]';n==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+Mt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+Mt(l.imageSizes)+'"]')):f+='[href="'+Mt(e)+'"]';var d=f;switch(n){case"style":d=yl(e);break;case"script":d=vl(e)}on.has(d)||(e=p({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:e,as:n},l),on.set(d,e),o.querySelector(f)!==null||n==="style"&&o.querySelector(Ga(d))||n==="script"&&o.querySelector(Xa(d))||(n=o.createElement("link"),pt(n,"link",e),st(n),o.head.appendChild(n)))}}function Pw(e,n){ti.m(e,n);var l=pl;if(l&&e){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+Mt(o)+'"][href="'+Mt(e)+'"]',d=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=vl(e)}if(!on.has(d)&&(e=p({rel:"modulepreload",href:e},n),on.set(d,e),l.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Xa(d)))return}o=l.createElement("link"),pt(o,"link",e),st(o),l.head.appendChild(o)}}}function ex(e,n,l){ti.S(e,n,l);var o=pl;if(o&&e){var f=di(o).hoistableStyles,d=yl(e);n=n||"default";var b=f.get(d);if(!b){var A={loading:0,preload:null};if(b=o.querySelector(Ga(d)))A.loading=5;else{e=p({rel:"stylesheet",href:e,"data-precedence":n},l),(l=on.get(d))&&wd(e,l);var k=b=o.createElement("link");st(k),pt(k,"link",e),k._p=new Promise(function(Q,ne){k.onload=Q,k.onerror=ne}),k.addEventListener("load",function(){A.loading|=1}),k.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Vr(b,n,o)}b={type:"stylesheet",instance:b,count:1,state:A},f.set(d,b)}}}function tx(e,n){ti.X(e,n);var l=pl;if(l&&e){var o=di(l).hoistableScripts,f=vl(e),d=o.get(f);d||(d=l.querySelector(Xa(f)),d||(e=p({src:e,async:!0},n),(n=on.get(f))&&xd(e,n),d=l.createElement("script"),st(d),pt(d,"link",e),l.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(f,d))}}function nx(e,n){ti.M(e,n);var l=pl;if(l&&e){var o=di(l).hoistableScripts,f=vl(e),d=o.get(f);d||(d=l.querySelector(Xa(f)),d||(e=p({src:e,async:!0,type:"module"},n),(n=on.get(f))&&xd(e,n),d=l.createElement("script"),st(d),pt(d,"link",e),l.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(f,d))}}function Ny(e,n,l,o){var f=(f=de.current)?qr(f):null;if(!f)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(n=yl(l.href),l=di(f).hoistableStyles,o=l.get(n),o||(o={type:"style",instance:null,count:0,state:null},l.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=yl(l.href);var d=di(f).hoistableStyles,b=d.get(e);if(b||(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,b),(d=f.querySelector(Ga(e)))&&!d._p&&(b.instance=d,b.state.loading=5),on.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},on.set(e,l),d||ix(f,e,l,b.state))),n&&o===null)throw Error(a(528,""));return b}if(n&&o!==null)throw Error(a(529,""));return null;case"script":return n=l.async,l=l.src,typeof l=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=vl(l),l=di(f).hoistableScripts,o=l.get(n),o||(o={type:"script",instance:null,count:0,state:null},l.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function yl(e){return'href="'+Mt(e)+'"'}function Ga(e){return'link[rel="stylesheet"]['+e+"]"}function Ay(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function ix(e,n,l,o){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=e.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),pt(n,"link",l),st(n),e.head.appendChild(n))}function vl(e){return'[src="'+Mt(e)+'"]'}function Xa(e){return"script[async]"+e}function Ty(e,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var o=e.querySelector('style[data-href~="'+Mt(l.href)+'"]');if(o)return n.instance=o,st(o),o;var f=p({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),st(o),pt(o,"style",f),Vr(o,l.precedence,e),n.instance=o;case"stylesheet":f=yl(l.href);var d=e.querySelector(Ga(f));if(d)return n.state.loading|=4,n.instance=d,st(d),d;o=Ay(l),(f=on.get(f))&&wd(o,f),d=(e.ownerDocument||e).createElement("link"),st(d);var b=d;return b._p=new Promise(function(A,k){b.onload=A,b.onerror=k}),pt(d,"link",o),n.state.loading|=4,Vr(d,l.precedence,e),n.instance=d;case"script":return d=vl(l.src),(f=e.querySelector(Xa(d)))?(n.instance=f,st(f),f):(o=l,(f=on.get(d))&&(o=p({},l),xd(o,f)),e=e.ownerDocument||e,f=e.createElement("script"),st(f),pt(f,"link",o),e.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(a(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Vr(o,l.precedence,e));return n.instance}function Vr(e,n,l){for(var o=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,d=f,b=0;b<o.length;b++){var A=o[b];if(A.dataset.precedence===n)d=A;else if(d!==f)break}d?d.parentNode.insertBefore(e,d.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(e,n.firstChild))}function wd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function xd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Yr=null;function My(e,n,l){if(Yr===null){var o=new Map,f=Yr=new Map;f.set(l,o)}else f=Yr,o=f.get(l),o||(o=new Map,f.set(l,o));if(o.has(e))return o;for(o.set(e,null),l=l.getElementsByTagName(e),f=0;f<l.length;f++){var d=l[f];if(!(d[Wi]||d[ct]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var b=d.getAttribute(n)||"";b=e+b;var A=o.get(b);A?A.push(d):o.set(b,[d])}}return o}function Cy(e,n,l){e=e.ownerDocument||e,e.head.insertBefore(l,n==="title"?e.querySelector("head > title"):null)}function sx(e,n,l){if(l===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Oy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function lx(e,n,l,o){if(l.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var f=yl(o.href),d=n.querySelector(Ga(f));if(d){n=d._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Gr.bind(e),n.then(e,e)),l.state.loading|=4,l.instance=d,st(d);return}d=n.ownerDocument||n,o=Ay(o),(f=on.get(f))&&wd(o,f),d=d.createElement("link"),st(d);var b=d;b._p=new Promise(function(A,k){b.onload=A,b.onerror=k}),pt(d,"link",o),l.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Gr.bind(e),n.addEventListener("load",l),n.addEventListener("error",l))}}var Ed=0;function ax(e,n){return e.stylesheets&&e.count===0&&Kr(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var o=setTimeout(function(){if(e.stylesheets&&Kr(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+n);0<e.imgBytes&&Ed===0&&(Ed=62500*Uw());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Kr(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Ed?50:800)+n);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function Gr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xr=null;function Kr(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xr=new Map,n.forEach(ox,e),Xr=null,Gr.call(e))}function ox(e,n){if(!(n.state.loading&4)){var l=Xr.get(e);if(l)var o=l.get(null);else{l=new Map,Xr.set(e,l);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<f.length;d++){var b=f[d];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(l.set(b.dataset.precedence,b),o=b)}o&&l.set(null,o)}f=n.instance,b=f.getAttribute("data-precedence"),d=l.get(b)||o,d===o&&l.set(null,f),l.set(b,f),this.count++,o=Gr.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),d?d.parentNode.insertBefore(f,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),n.state.loading|=4}}var Ka={$$typeof:x,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function rx(e,n,l,o,f,d,b,A,k){this.tag=1,this.containerInfo=e,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=Pl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pl(0),this.hiddenUpdates=Pl(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=d,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function zy(e,n,l,o,f,d,b,A,k,Q,ne,le){return e=new rx(e,n,l,b,k,Q,ne,le,A),n=1,d===!0&&(n|=24),d=Ut(3,null,null,n),e.current=d,d.stateNode=e,n=tf(),n.refCount++,e.pooledCache=n,n.refCount++,d.memoizedState={element:o,isDehydrated:l,cache:n},af(d),e}function Dy(e){return e?(e=Is,e):Is}function Ly(e,n,l,o,f,d){f=Dy(f),o.context===null?o.context=f:o.pendingContext=f,o=wi(n),o.payload={element:l},d=d===void 0?null:d,d!==null&&(o.callback=d),l=xi(e,o,n),l!==null&&(Rt(l,e,n),_a(l,e,n))}function Ry(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<n?l:n}}function _d(e,n){Ry(e,n),(e=e.alternate)&&Ry(e,n)}function By(e){if(e.tag===13||e.tag===31){var n=ns(e,67108864);n!==null&&Rt(n,e,67108864),_d(e,67108864)}}function ky(e){if(e.tag===13||e.tag===31){var n=Xt();n=ea(n);var l=ns(e,n);l!==null&&Rt(l,e,n),_d(e,n)}}var Zr=!0;function ux(e,n,l,o){var f=T.T;T.T=null;var d=D.p;try{D.p=2,Nd(e,n,l,o)}finally{D.p=d,T.T=f}}function cx(e,n,l,o){var f=T.T;T.T=null;var d=D.p;try{D.p=8,Nd(e,n,l,o)}finally{D.p=d,T.T=f}}function Nd(e,n,l,o){if(Zr){var f=Ad(o);if(f===null)fd(e,n,o,Qr,l),jy(e,o);else if(dx(f,e,n,l,o))o.stopPropagation();else if(jy(e,o),n&4&&-1<fx.indexOf(e)){for(;f!==null;){var d=ci(f);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var b=kn(d.pendingLanes);if(b!==0){var A=d;for(A.pendingLanes|=2,A.entangledLanes|=2;b;){var k=1<<31-xt(b);A.entanglements[1]|=k,b&=~k}Cn(d),(Be&6)===0&&(Or=tt()+500,Ua(0))}}break;case 31:case 13:A=ns(d,2),A!==null&&Rt(A,d,2),Dr(),_d(d,2)}if(d=Ad(o),d===null&&fd(e,n,o,Qr,l),d===f)break;f=d}f!==null&&o.stopPropagation()}else fd(e,n,o,null,l)}}function Ad(e){return e=Tc(e),Td(e)}var Qr=null;function Td(e){if(Qr=null,e=ui(e),e!==null){var n=u(e);if(n===null)e=null;else{var l=n.tag;if(l===13){if(e=c(n),e!==null)return e;e=null}else if(l===31){if(e=m(n),e!==null)return e;e=null}else if(l===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Qr=e,null}function Hy(e){switch(e){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(jt()){case Jt:return 2;case Ft:return 8;case Wt:case hc:return 32;case Ds:return 268435456;default:return 32}default:return 32}}var Md=!1,Li=null,Ri=null,Bi=null,Za=new Map,Qa=new Map,ki=[],fx="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 jy(e,n){switch(e){case"focusin":case"focusout":Li=null;break;case"dragenter":case"dragleave":Ri=null;break;case"mouseover":case"mouseout":Bi=null;break;case"pointerover":case"pointerout":Za.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qa.delete(n.pointerId)}}function Ia(e,n,l,o,f,d){return e===null||e.nativeEvent!==d?(e={blockedOn:n,domEventName:l,eventSystemFlags:o,nativeEvent:d,targetContainers:[f]},n!==null&&(n=ci(n),n!==null&&By(n)),e):(e.eventSystemFlags|=o,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function dx(e,n,l,o,f){switch(n){case"focusin":return Li=Ia(Li,e,n,l,o,f),!0;case"dragenter":return Ri=Ia(Ri,e,n,l,o,f),!0;case"mouseover":return Bi=Ia(Bi,e,n,l,o,f),!0;case"pointerover":var d=f.pointerId;return Za.set(d,Ia(Za.get(d)||null,e,n,l,o,f)),!0;case"gotpointercapture":return d=f.pointerId,Qa.set(d,Ia(Qa.get(d)||null,e,n,l,o,f)),!0}return!1}function $y(e){var n=ui(e.target);if(n!==null){var l=u(n);if(l!==null){if(n=l.tag,n===13){if(n=c(l),n!==null){e.blockedOn=n,Ho(e.priority,function(){ky(l)});return}}else if(n===31){if(n=m(l),n!==null){e.blockedOn=n,Ho(e.priority,function(){ky(l)});return}}else if(n===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ir(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var l=Ad(e.nativeEvent);if(l===null){l=e.nativeEvent;var o=new l.constructor(l.type,l);Ac=o,l.target.dispatchEvent(o),Ac=null}else return n=ci(l),n!==null&&By(n),e.blockedOn=l,!1;n.shift()}return!0}function Uy(e,n,l){Ir(e)&&l.delete(n)}function hx(){Md=!1,Li!==null&&Ir(Li)&&(Li=null),Ri!==null&&Ir(Ri)&&(Ri=null),Bi!==null&&Ir(Bi)&&(Bi=null),Za.forEach(Uy),Qa.forEach(Uy)}function Jr(e,n){e.blockedOn===n&&(e.blockedOn=null,Md||(Md=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,hx)))}var Fr=null;function qy(e){Fr!==e&&(Fr=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Fr===e&&(Fr=null);for(var n=0;n<e.length;n+=3){var l=e[n],o=e[n+1],f=e[n+2];if(typeof o!="function"){if(Td(o||l)===null)continue;break}var d=ci(l);d!==null&&(e.splice(n,3),n-=3,Af(d,{pending:!0,data:f,method:l.method,action:o},o,f))}}))}function bl(e){function n(k){return Jr(k,e)}Li!==null&&Jr(Li,e),Ri!==null&&Jr(Ri,e),Bi!==null&&Jr(Bi,e),Za.forEach(n),Qa.forEach(n);for(var l=0;l<ki.length;l++){var o=ki[l];o.blockedOn===e&&(o.blockedOn=null)}for(;0<ki.length&&(l=ki[0],l.blockedOn===null);)$y(l),l.blockedOn===null&&ki.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(o=0;o<l.length;o+=3){var f=l[o],d=l[o+1],b=f[vt]||null;if(typeof d=="function")b||qy(l);else if(b){var A=null;if(d&&d.hasAttribute("formAction")){if(f=d,b=d[vt]||null)A=b.formAction;else if(Td(f)!==null)continue}else A=b.action;typeof A=="function"?l[o+1]=A:(l.splice(o,3),o-=3),qy(l)}}}function Vy(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(b){return f=b})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),o||setTimeout(l,20)}function l(){if(!o&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Cd(e){this._internalRoot=e}Wr.prototype.render=Cd.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(a(409));var l=n.current,o=Xt();Ly(l,o,e,n,null,null)},Wr.prototype.unmount=Cd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Ly(e.current,2,null,e,null,null),Dr(),n[Hn]=null}};function Wr(e){this._internalRoot=e}Wr.prototype.unstable_scheduleHydration=function(e){if(e){var n=ko();e={blockedOn:null,target:e,priority:n};for(var l=0;l<ki.length&&n!==0&&n<ki[l].priority;l++);ki.splice(l,0,e),l===0&&$y(e)}};var Yy=i.version;if(Yy!=="19.2.7")throw Error(a(527,Yy,"19.2.7"));D.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=g(n),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var mx={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pr.isDisabled&&Pr.supportsFiber)try{Ii=Pr.inject(mx),wt=Pr}catch{}}return Fa.createRoot=function(e,n){if(!r(e))throw Error(a(299));var l=!1,o="",f=Jg,d=Fg,b=Wg;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(b=n.onRecoverableError)),n=zy(e,1,!1,null,null,l,o,null,f,d,b,Vy),e[Hn]=n.current,cd(e),new Cd(n)},Fa.hydrateRoot=function(e,n,l){if(!r(e))throw Error(a(299));var o=!1,f="",d=Jg,b=Fg,A=Wg,k=null;return l!=null&&(l.unstable_strictMode===!0&&(o=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(d=l.onUncaughtError),l.onCaughtError!==void 0&&(b=l.onCaughtError),l.onRecoverableError!==void 0&&(A=l.onRecoverableError),l.formState!==void 0&&(k=l.formState)),n=zy(e,1,!0,n,l??null,o,f,k,d,b,A,Vy),n.context=Dy(null),l=n.current,o=Xt(),o=ea(o),f=wi(o),f.callback=null,xi(l,f,o),l=o,n.current.lanes=l,Fi(n,l),Cn(n),e[Hn]=n.current,cd(e),new Wr(n)},Fa.version="19.2.7",Fa}var Py;function Ex(){if(Py)return Dd.exports;Py=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(i){console.error(i)}}return t(),Dd.exports=xx(),Dd.exports}var _x=Ex();function ut(t){if(typeof t=="string"||typeof t=="number")return""+t;let i="";if(Array.isArray(t))for(let s=0,a;s<t.length;s++)(a=ut(t[s]))!==""&&(i+=(i&&" ")+a);else for(let s in t)t[s]&&(i+=(i&&" ")+s);return i}var Nx={value:()=>{}};function Uu(){for(var t=0,i=arguments.length,s={},a;t<i;++t){if(!(a=arguments[t]+"")||a in s||/[\s.]/.test(a))throw new Error("illegal type: "+a);s[a]=[]}return new gu(s)}function gu(t){this._=t}function Ax(t,i){return t.trim().split(/^|\s+/).map(function(s){var a="",r=s.indexOf(".");if(r>=0&&(a=s.slice(r+1),s=s.slice(0,r)),s&&!i.hasOwnProperty(s))throw new Error("unknown type: "+s);return{type:s,name:a}})}gu.prototype=Uu.prototype={constructor:gu,on:function(t,i){var s=this._,a=Ax(t+"",s),r,u=-1,c=a.length;if(arguments.length<2){for(;++u<c;)if((r=(t=a[u]).type)&&(r=Tx(s[r],t.name)))return r;return}if(i!=null&&typeof i!="function")throw new Error("invalid callback: "+i);for(;++u<c;)if(r=(t=a[u]).type)s[r]=e0(s[r],t.name,i);else if(i==null)for(r in s)s[r]=e0(s[r],t.name,null);return this},copy:function(){var t={},i=this._;for(var s in i)t[s]=i[s].slice();return new gu(t)},call:function(t,i){if((r=arguments.length-2)>0)for(var s=new Array(r),a=0,r,u;a<r;++a)s[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(u=this._[t],a=0,r=u.length;a<r;++a)u[a].value.apply(i,s)},apply:function(t,i,s){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var a=this._[t],r=0,u=a.length;r<u;++r)a[r].value.apply(i,s)}};function Tx(t,i){for(var s=0,a=t.length,r;s<a;++s)if((r=t[s]).name===i)return r.value}function e0(t,i,s){for(var a=0,r=t.length;a<r;++a)if(t[a].name===i){t[a]=Nx,t=t.slice(0,a).concat(t.slice(a+1));break}return s!=null&&t.push({name:i,value:s}),t}var ah="http://www.w3.org/1999/xhtml";const t0={svg:"http://www.w3.org/2000/svg",xhtml:ah,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function qu(t){var i=t+="",s=i.indexOf(":");return s>=0&&(i=t.slice(0,s))!=="xmlns"&&(t=t.slice(s+1)),t0.hasOwnProperty(i)?{space:t0[i],local:t}:t}function Mx(t){return function(){var i=this.ownerDocument,s=this.namespaceURI;return s===ah&&i.documentElement.namespaceURI===ah?i.createElement(t):i.createElementNS(s,t)}}function Cx(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Av(t){var i=qu(t);return(i.local?Cx:Mx)(i)}function Ox(){}function Oh(t){return t==null?Ox:function(){return this.querySelector(t)}}function zx(t){typeof t!="function"&&(t=Oh(t));for(var i=this._groups,s=i.length,a=new Array(s),r=0;r<s;++r)for(var u=i[r],c=u.length,m=a[r]=new Array(c),h,g,v=0;v<c;++v)(h=u[v])&&(g=t.call(h,h.__data__,v,u))&&("__data__"in h&&(g.__data__=h.__data__),m[v]=g);return new Qt(a,this._parents)}function Dx(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Lx(){return[]}function Tv(t){return t==null?Lx:function(){return this.querySelectorAll(t)}}function Rx(t){return function(){return Dx(t.apply(this,arguments))}}function Bx(t){typeof t=="function"?t=Rx(t):t=Tv(t);for(var i=this._groups,s=i.length,a=[],r=[],u=0;u<s;++u)for(var c=i[u],m=c.length,h,g=0;g<m;++g)(h=c[g])&&(a.push(t.call(h,h.__data__,g,c)),r.push(h));return new Qt(a,r)}function Mv(t){return function(){return this.matches(t)}}function Cv(t){return function(i){return i.matches(t)}}var kx=Array.prototype.find;function Hx(t){return function(){return kx.call(this.children,t)}}function jx(){return this.firstElementChild}function $x(t){return this.select(t==null?jx:Hx(typeof t=="function"?t:Cv(t)))}var Ux=Array.prototype.filter;function qx(){return Array.from(this.children)}function Vx(t){return function(){return Ux.call(this.children,t)}}function Yx(t){return this.selectAll(t==null?qx:Vx(typeof t=="function"?t:Cv(t)))}function Gx(t){typeof t!="function"&&(t=Mv(t));for(var i=this._groups,s=i.length,a=new Array(s),r=0;r<s;++r)for(var u=i[r],c=u.length,m=a[r]=[],h,g=0;g<c;++g)(h=u[g])&&t.call(h,h.__data__,g,u)&&m.push(h);return new Qt(a,this._parents)}function Ov(t){return new Array(t.length)}function Xx(){return new Qt(this._enter||this._groups.map(Ov),this._parents)}function Nu(t,i){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=i}Nu.prototype={constructor:Nu,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,i){return this._parent.insertBefore(t,i)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Kx(t){return function(){return t}}function Zx(t,i,s,a,r,u){for(var c=0,m,h=i.length,g=u.length;c<g;++c)(m=i[c])?(m.__data__=u[c],a[c]=m):s[c]=new Nu(t,u[c]);for(;c<h;++c)(m=i[c])&&(r[c]=m)}function Qx(t,i,s,a,r,u,c){var m,h,g=new Map,v=i.length,p=u.length,y=new Array(v),w;for(m=0;m<v;++m)(h=i[m])&&(y[m]=w=c.call(h,h.__data__,m,i)+"",g.has(w)?r[m]=h:g.set(w,h));for(m=0;m<p;++m)w=c.call(t,u[m],m,u)+"",(h=g.get(w))?(a[m]=h,h.__data__=u[m],g.delete(w)):s[m]=new Nu(t,u[m]);for(m=0;m<v;++m)(h=i[m])&&g.get(y[m])===h&&(r[m]=h)}function Ix(t){return t.__data__}function Jx(t,i){if(!arguments.length)return Array.from(this,Ix);var s=i?Qx:Zx,a=this._parents,r=this._groups;typeof t!="function"&&(t=Kx(t));for(var u=r.length,c=new Array(u),m=new Array(u),h=new Array(u),g=0;g<u;++g){var v=a[g],p=r[g],y=p.length,w=Fx(t.call(v,v&&v.__data__,g,a)),E=w.length,_=m[g]=new Array(E),N=c[g]=new Array(E),S=h[g]=new Array(y);s(v,p,_,N,S,w,i);for(var O=0,x=0,M,R;O<E;++O)if(M=_[O]){for(O>=x&&(x=O+1);!(R=N[x])&&++x<E;);M._next=R||null}}return c=new Qt(c,a),c._enter=m,c._exit=h,c}function Fx(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Wx(){return new Qt(this._exit||this._groups.map(Ov),this._parents)}function Px(t,i,s){var a=this.enter(),r=this,u=this.exit();return typeof t=="function"?(a=t(a),a&&(a=a.selection())):a=a.append(t+""),i!=null&&(r=i(r),r&&(r=r.selection())),s==null?u.remove():s(u),a&&r?a.merge(r).order():r}function eE(t){for(var i=t.selection?t.selection():t,s=this._groups,a=i._groups,r=s.length,u=a.length,c=Math.min(r,u),m=new Array(r),h=0;h<c;++h)for(var g=s[h],v=a[h],p=g.length,y=m[h]=new Array(p),w,E=0;E<p;++E)(w=g[E]||v[E])&&(y[E]=w);for(;h<r;++h)m[h]=s[h];return new Qt(m,this._parents)}function tE(){for(var t=this._groups,i=-1,s=t.length;++i<s;)for(var a=t[i],r=a.length-1,u=a[r],c;--r>=0;)(c=a[r])&&(u&&c.compareDocumentPosition(u)^4&&u.parentNode.insertBefore(c,u),u=c);return this}function nE(t){t||(t=iE);function i(p,y){return p&&y?t(p.__data__,y.__data__):!p-!y}for(var s=this._groups,a=s.length,r=new Array(a),u=0;u<a;++u){for(var c=s[u],m=c.length,h=r[u]=new Array(m),g,v=0;v<m;++v)(g=c[v])&&(h[v]=g);h.sort(i)}return new Qt(r,this._parents).order()}function iE(t,i){return t<i?-1:t>i?1:t>=i?0:NaN}function sE(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function lE(){return Array.from(this)}function aE(){for(var t=this._groups,i=0,s=t.length;i<s;++i)for(var a=t[i],r=0,u=a.length;r<u;++r){var c=a[r];if(c)return c}return null}function oE(){let t=0;for(const i of this)++t;return t}function rE(){return!this.node()}function uE(t){for(var i=this._groups,s=0,a=i.length;s<a;++s)for(var r=i[s],u=0,c=r.length,m;u<c;++u)(m=r[u])&&t.call(m,m.__data__,u,r);return this}function cE(t){return function(){this.removeAttribute(t)}}function fE(t){return function(){this.removeAttributeNS(t.space,t.local)}}function dE(t,i){return function(){this.setAttribute(t,i)}}function hE(t,i){return function(){this.setAttributeNS(t.space,t.local,i)}}function mE(t,i){return function(){var s=i.apply(this,arguments);s==null?this.removeAttribute(t):this.setAttribute(t,s)}}function gE(t,i){return function(){var s=i.apply(this,arguments);s==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,s)}}function pE(t,i){var s=qu(t);if(arguments.length<2){var a=this.node();return s.local?a.getAttributeNS(s.space,s.local):a.getAttribute(s)}return this.each((i==null?s.local?fE:cE:typeof i=="function"?s.local?gE:mE:s.local?hE:dE)(s,i))}function zv(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function yE(t){return function(){this.style.removeProperty(t)}}function vE(t,i,s){return function(){this.style.setProperty(t,i,s)}}function bE(t,i,s){return function(){var a=i.apply(this,arguments);a==null?this.style.removeProperty(t):this.style.setProperty(t,a,s)}}function SE(t,i,s){return arguments.length>1?this.each((i==null?yE:typeof i=="function"?bE:vE)(t,i,s??"")):Hl(this.node(),t)}function Hl(t,i){return t.style.getPropertyValue(i)||zv(t).getComputedStyle(t,null).getPropertyValue(i)}function wE(t){return function(){delete this[t]}}function xE(t,i){return function(){this[t]=i}}function EE(t,i){return function(){var s=i.apply(this,arguments);s==null?delete this[t]:this[t]=s}}function _E(t,i){return arguments.length>1?this.each((i==null?wE:typeof i=="function"?EE:xE)(t,i)):this.node()[t]}function Dv(t){return t.trim().split(/^|\s+/)}function zh(t){return t.classList||new Lv(t)}function Lv(t){this._node=t,this._names=Dv(t.getAttribute("class")||"")}Lv.prototype={add:function(t){var i=this._names.indexOf(t);i<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var i=this._names.indexOf(t);i>=0&&(this._names.splice(i,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Rv(t,i){for(var s=zh(t),a=-1,r=i.length;++a<r;)s.add(i[a])}function Bv(t,i){for(var s=zh(t),a=-1,r=i.length;++a<r;)s.remove(i[a])}function NE(t){return function(){Rv(this,t)}}function AE(t){return function(){Bv(this,t)}}function TE(t,i){return function(){(i.apply(this,arguments)?Rv:Bv)(this,t)}}function ME(t,i){var s=Dv(t+"");if(arguments.length<2){for(var a=zh(this.node()),r=-1,u=s.length;++r<u;)if(!a.contains(s[r]))return!1;return!0}return this.each((typeof i=="function"?TE:i?NE:AE)(s,i))}function CE(){this.textContent=""}function OE(t){return function(){this.textContent=t}}function zE(t){return function(){var i=t.apply(this,arguments);this.textContent=i??""}}function DE(t){return arguments.length?this.each(t==null?CE:(typeof t=="function"?zE:OE)(t)):this.node().textContent}function LE(){this.innerHTML=""}function RE(t){return function(){this.innerHTML=t}}function BE(t){return function(){var i=t.apply(this,arguments);this.innerHTML=i??""}}function kE(t){return arguments.length?this.each(t==null?LE:(typeof t=="function"?BE:RE)(t)):this.node().innerHTML}function HE(){this.nextSibling&&this.parentNode.appendChild(this)}function jE(){return this.each(HE)}function $E(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function UE(){return this.each($E)}function qE(t){var i=typeof t=="function"?t:Av(t);return this.select(function(){return this.appendChild(i.apply(this,arguments))})}function VE(){return null}function YE(t,i){var s=typeof t=="function"?t:Av(t),a=i==null?VE:typeof i=="function"?i:Oh(i);return this.select(function(){return this.insertBefore(s.apply(this,arguments),a.apply(this,arguments)||null)})}function GE(){var t=this.parentNode;t&&t.removeChild(this)}function XE(){return this.each(GE)}function KE(){var t=this.cloneNode(!1),i=this.parentNode;return i?i.insertBefore(t,this.nextSibling):t}function ZE(){var t=this.cloneNode(!0),i=this.parentNode;return i?i.insertBefore(t,this.nextSibling):t}function QE(t){return this.select(t?ZE:KE)}function IE(t){return arguments.length?this.property("__data__",t):this.node().__data__}function JE(t){return function(i){t.call(this,i,this.__data__)}}function FE(t){return t.trim().split(/^|\s+/).map(function(i){var s="",a=i.indexOf(".");return a>=0&&(s=i.slice(a+1),i=i.slice(0,a)),{type:i,name:s}})}function WE(t){return function(){var i=this.__on;if(i){for(var s=0,a=-1,r=i.length,u;s<r;++s)u=i[s],(!t.type||u.type===t.type)&&u.name===t.name?this.removeEventListener(u.type,u.listener,u.options):i[++a]=u;++a?i.length=a:delete this.__on}}}function PE(t,i,s){return function(){var a=this.__on,r,u=JE(i);if(a){for(var c=0,m=a.length;c<m;++c)if((r=a[c]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=u,r.options=s),r.value=i;return}}this.addEventListener(t.type,u,s),r={type:t.type,name:t.name,value:i,listener:u,options:s},a?a.push(r):this.__on=[r]}}function e2(t,i,s){var a=FE(t+""),r,u=a.length,c;if(arguments.length<2){var m=this.node().__on;if(m){for(var h=0,g=m.length,v;h<g;++h)for(r=0,v=m[h];r<u;++r)if((c=a[r]).type===v.type&&c.name===v.name)return v.value}return}for(m=i?PE:WE,r=0;r<u;++r)this.each(m(a[r],i,s));return this}function kv(t,i,s){var a=zv(t),r=a.CustomEvent;typeof r=="function"?r=new r(i,s):(r=a.document.createEvent("Event"),s?(r.initEvent(i,s.bubbles,s.cancelable),r.detail=s.detail):r.initEvent(i,!1,!1)),t.dispatchEvent(r)}function t2(t,i){return function(){return kv(this,t,i)}}function n2(t,i){return function(){return kv(this,t,i.apply(this,arguments))}}function i2(t,i){return this.each((typeof i=="function"?n2:t2)(t,i))}function*s2(){for(var t=this._groups,i=0,s=t.length;i<s;++i)for(var a=t[i],r=0,u=a.length,c;r<u;++r)(c=a[r])&&(yield c)}var Hv=[null];function Qt(t,i){this._groups=t,this._parents=i}function Eo(){return new Qt([[document.documentElement]],Hv)}function l2(){return this}Qt.prototype=Eo.prototype={constructor:Qt,select:zx,selectAll:Bx,selectChild:$x,selectChildren:Yx,filter:Gx,data:Jx,enter:Xx,exit:Wx,join:Px,merge:eE,selection:l2,order:tE,sort:nE,call:sE,nodes:lE,node:aE,size:oE,empty:rE,each:uE,attr:pE,style:SE,property:_E,classed:ME,text:DE,html:kE,raise:jE,lower:UE,append:qE,insert:YE,remove:XE,clone:QE,datum:IE,on:e2,dispatch:i2,[Symbol.iterator]:s2};function Kt(t){return typeof t=="string"?new Qt([[document.querySelector(t)]],[document.documentElement]):new Qt([[t]],Hv)}function a2(t){let i;for(;i=t.sourceEvent;)t=i;return t}function yn(t,i){if(t=a2(t),i===void 0&&(i=t.currentTarget),i){var s=i.ownerSVGElement||i;if(s.createSVGPoint){var a=s.createSVGPoint();return a.x=t.clientX,a.y=t.clientY,a=a.matrixTransform(i.getScreenCTM().inverse()),[a.x,a.y]}if(i.getBoundingClientRect){var r=i.getBoundingClientRect();return[t.clientX-r.left-i.clientLeft,t.clientY-r.top-i.clientTop]}}return[t.pageX,t.pageY]}const o2={passive:!1},ro={capture:!0,passive:!1};function kd(t){t.stopImmediatePropagation()}function zl(t){t.preventDefault(),t.stopImmediatePropagation()}function jv(t){var i=t.document.documentElement,s=Kt(t).on("dragstart.drag",zl,ro);"onselectstart"in i?s.on("selectstart.drag",zl,ro):(i.__noselect=i.style.MozUserSelect,i.style.MozUserSelect="none")}function $v(t,i){var s=t.document.documentElement,a=Kt(t).on("dragstart.drag",null);i&&(a.on("click.drag",zl,ro),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in s?a.on("selectstart.drag",null):(s.style.MozUserSelect=s.__noselect,delete s.__noselect)}const eu=t=>()=>t;function oh(t,{sourceEvent:i,subject:s,target:a,identifier:r,active:u,x:c,y:m,dx:h,dy:g,dispatch:v}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:i,enumerable:!0,configurable:!0},subject:{value:s,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:u,enumerable:!0,configurable:!0},x:{value:c,enumerable:!0,configurable:!0},y:{value:m,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:g,enumerable:!0,configurable:!0},_:{value:v}})}oh.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function r2(t){return!t.ctrlKey&&!t.button}function u2(){return this.parentNode}function c2(t,i){return i??{x:t.x,y:t.y}}function f2(){return navigator.maxTouchPoints||"ontouchstart"in this}function Uv(){var t=r2,i=u2,s=c2,a=f2,r={},u=Uu("start","drag","end"),c=0,m,h,g,v,p=0;function y(M){M.on("mousedown.drag",w).filter(a).on("touchstart.drag",N).on("touchmove.drag",S,o2).on("touchend.drag touchcancel.drag",O).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(M,R){if(!(v||!t.call(this,M,R))){var L=x(this,i.call(this,M,R),M,R,"mouse");L&&(Kt(M.view).on("mousemove.drag",E,ro).on("mouseup.drag",_,ro),jv(M.view),kd(M),g=!1,m=M.clientX,h=M.clientY,L("start",M))}}function E(M){if(zl(M),!g){var R=M.clientX-m,L=M.clientY-h;g=R*R+L*L>p}r.mouse("drag",M)}function _(M){Kt(M.view).on("mousemove.drag mouseup.drag",null),$v(M.view,g),zl(M),r.mouse("end",M)}function N(M,R){if(t.call(this,M,R)){var L=M.changedTouches,H=i.call(this,M,R),j=L.length,Y,ae;for(Y=0;Y<j;++Y)(ae=x(this,H,M,R,L[Y].identifier,L[Y]))&&(kd(M),ae("start",M,L[Y]))}}function S(M){var R=M.changedTouches,L=R.length,H,j;for(H=0;H<L;++H)(j=r[R[H].identifier])&&(zl(M),j("drag",M,R[H]))}function O(M){var R=M.changedTouches,L=R.length,H,j;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),H=0;H<L;++H)(j=r[R[H].identifier])&&(kd(M),j("end",M,R[H]))}function x(M,R,L,H,j,Y){var ae=u.copy(),K=yn(Y||L,R),I,oe,B;if((B=s.call(M,new oh("beforestart",{sourceEvent:L,target:y,identifier:j,active:c,x:K[0],y:K[1],dx:0,dy:0,dispatch:ae}),H))!=null)return I=B.x-K[0]||0,oe=B.y-K[1]||0,function G(T,D,q){var X=K,te;switch(T){case"start":r[j]=G,te=c++;break;case"end":delete r[j],--c;case"drag":K=yn(q||D,R),te=c;break}ae.call(T,M,new oh(T,{sourceEvent:D,subject:B,target:y,identifier:j,active:te,x:K[0]+I,y:K[1]+oe,dx:K[0]-X[0],dy:K[1]-X[1],dispatch:ae}),H)}}return y.filter=function(M){return arguments.length?(t=typeof M=="function"?M:eu(!!M),y):t},y.container=function(M){return arguments.length?(i=typeof M=="function"?M:eu(M),y):i},y.subject=function(M){return arguments.length?(s=typeof M=="function"?M:eu(M),y):s},y.touchable=function(M){return arguments.length?(a=typeof M=="function"?M:eu(!!M),y):a},y.on=function(){var M=u.on.apply(u,arguments);return M===u?y:M},y.clickDistance=function(M){return arguments.length?(p=(M=+M)*M,y):Math.sqrt(p)},y}function Dh(t,i,s){t.prototype=i.prototype=s,s.constructor=t}function qv(t,i){var s=Object.create(t.prototype);for(var a in i)s[a]=i[a];return s}function _o(){}var uo=.7,Au=1/uo,Dl="\\s*([+-]?\\d+)\\s*",co="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",zn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",d2=/^#([0-9a-f]{3,8})$/,h2=new RegExp(`^rgb\\(${Dl},${Dl},${Dl}\\)$`),m2=new RegExp(`^rgb\\(${zn},${zn},${zn}\\)$`),g2=new RegExp(`^rgba\\(${Dl},${Dl},${Dl},${co}\\)$`),p2=new RegExp(`^rgba\\(${zn},${zn},${zn},${co}\\)$`),y2=new RegExp(`^hsl\\(${co},${zn},${zn}\\)$`),v2=new RegExp(`^hsla\\(${co},${zn},${zn},${co}\\)$`),n0={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};Dh(_o,Es,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:i0,formatHex:i0,formatHex8:b2,formatHsl:S2,formatRgb:s0,toString:s0});function i0(){return this.rgb().formatHex()}function b2(){return this.rgb().formatHex8()}function S2(){return Vv(this).formatHsl()}function s0(){return this.rgb().formatRgb()}function Es(t){var i,s;return t=(t+"").trim().toLowerCase(),(i=d2.exec(t))?(s=i[1].length,i=parseInt(i[1],16),s===6?l0(i):s===3?new kt(i>>8&15|i>>4&240,i>>4&15|i&240,(i&15)<<4|i&15,1):s===8?tu(i>>24&255,i>>16&255,i>>8&255,(i&255)/255):s===4?tu(i>>12&15|i>>8&240,i>>8&15|i>>4&240,i>>4&15|i&240,((i&15)<<4|i&15)/255):null):(i=h2.exec(t))?new kt(i[1],i[2],i[3],1):(i=m2.exec(t))?new kt(i[1]*255/100,i[2]*255/100,i[3]*255/100,1):(i=g2.exec(t))?tu(i[1],i[2],i[3],i[4]):(i=p2.exec(t))?tu(i[1]*255/100,i[2]*255/100,i[3]*255/100,i[4]):(i=y2.exec(t))?r0(i[1],i[2]/100,i[3]/100,1):(i=v2.exec(t))?r0(i[1],i[2]/100,i[3]/100,i[4]):n0.hasOwnProperty(t)?l0(n0[t]):t==="transparent"?new kt(NaN,NaN,NaN,0):null}function l0(t){return new kt(t>>16&255,t>>8&255,t&255,1)}function tu(t,i,s,a){return a<=0&&(t=i=s=NaN),new kt(t,i,s,a)}function w2(t){return t instanceof _o||(t=Es(t)),t?(t=t.rgb(),new kt(t.r,t.g,t.b,t.opacity)):new kt}function rh(t,i,s,a){return arguments.length===1?w2(t):new kt(t,i,s,a??1)}function kt(t,i,s,a){this.r=+t,this.g=+i,this.b=+s,this.opacity=+a}Dh(kt,rh,qv(_o,{brighter(t){return t=t==null?Au:Math.pow(Au,t),new kt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?uo:Math.pow(uo,t),new kt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new kt(ws(this.r),ws(this.g),ws(this.b),Tu(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:a0,formatHex:a0,formatHex8:x2,formatRgb:o0,toString:o0}));function a0(){return`#${ps(this.r)}${ps(this.g)}${ps(this.b)}`}function x2(){return`#${ps(this.r)}${ps(this.g)}${ps(this.b)}${ps((isNaN(this.opacity)?1:this.opacity)*255)}`}function o0(){const t=Tu(this.opacity);return`${t===1?"rgb(":"rgba("}${ws(this.r)}, ${ws(this.g)}, ${ws(this.b)}${t===1?")":`, ${t})`}`}function Tu(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ws(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ps(t){return t=ws(t),(t<16?"0":"")+t.toString(16)}function r0(t,i,s,a){return a<=0?t=i=s=NaN:s<=0||s>=1?t=i=NaN:i<=0&&(t=NaN),new vn(t,i,s,a)}function Vv(t){if(t instanceof vn)return new vn(t.h,t.s,t.l,t.opacity);if(t instanceof _o||(t=Es(t)),!t)return new vn;if(t instanceof vn)return t;t=t.rgb();var i=t.r/255,s=t.g/255,a=t.b/255,r=Math.min(i,s,a),u=Math.max(i,s,a),c=NaN,m=u-r,h=(u+r)/2;return m?(i===u?c=(s-a)/m+(s<a)*6:s===u?c=(a-i)/m+2:c=(i-s)/m+4,m/=h<.5?u+r:2-u-r,c*=60):m=h>0&&h<1?0:c,new vn(c,m,h,t.opacity)}function E2(t,i,s,a){return arguments.length===1?Vv(t):new vn(t,i,s,a??1)}function vn(t,i,s,a){this.h=+t,this.s=+i,this.l=+s,this.opacity=+a}Dh(vn,E2,qv(_o,{brighter(t){return t=t==null?Au:Math.pow(Au,t),new vn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?uo:Math.pow(uo,t),new vn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,i=isNaN(t)||isNaN(this.s)?0:this.s,s=this.l,a=s+(s<.5?s:1-s)*i,r=2*s-a;return new kt(Hd(t>=240?t-240:t+120,r,a),Hd(t,r,a),Hd(t<120?t+240:t-120,r,a),this.opacity)},clamp(){return new vn(u0(this.h),nu(this.s),nu(this.l),Tu(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 t=Tu(this.opacity);return`${t===1?"hsl(":"hsla("}${u0(this.h)}, ${nu(this.s)*100}%, ${nu(this.l)*100}%${t===1?")":`, ${t})`}`}}));function u0(t){return t=(t||0)%360,t<0?t+360:t}function nu(t){return Math.max(0,Math.min(1,t||0))}function Hd(t,i,s){return(t<60?i+(s-i)*t/60:t<180?s:t<240?i+(s-i)*(240-t)/60:i)*255}const Lh=t=>()=>t;function _2(t,i){return function(s){return t+s*i}}function N2(t,i,s){return t=Math.pow(t,s),i=Math.pow(i,s)-t,s=1/s,function(a){return Math.pow(t+a*i,s)}}function A2(t){return(t=+t)==1?Yv:function(i,s){return s-i?N2(i,s,t):Lh(isNaN(i)?s:i)}}function Yv(t,i){var s=i-t;return s?_2(t,s):Lh(isNaN(t)?i:t)}const Mu=(function t(i){var s=A2(i);function a(r,u){var c=s((r=rh(r)).r,(u=rh(u)).r),m=s(r.g,u.g),h=s(r.b,u.b),g=Yv(r.opacity,u.opacity);return function(v){return r.r=c(v),r.g=m(v),r.b=h(v),r.opacity=g(v),r+""}}return a.gamma=t,a})(1);function T2(t,i){i||(i=[]);var s=t?Math.min(i.length,t.length):0,a=i.slice(),r;return function(u){for(r=0;r<s;++r)a[r]=t[r]*(1-u)+i[r]*u;return a}}function M2(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function C2(t,i){var s=i?i.length:0,a=t?Math.min(s,t.length):0,r=new Array(a),u=new Array(s),c;for(c=0;c<a;++c)r[c]=so(t[c],i[c]);for(;c<s;++c)u[c]=i[c];return function(m){for(c=0;c<a;++c)u[c]=r[c](m);return u}}function O2(t,i){var s=new Date;return t=+t,i=+i,function(a){return s.setTime(t*(1-a)+i*a),s}}function On(t,i){return t=+t,i=+i,function(s){return t*(1-s)+i*s}}function z2(t,i){var s={},a={},r;(t===null||typeof t!="object")&&(t={}),(i===null||typeof i!="object")&&(i={});for(r in i)r in t?s[r]=so(t[r],i[r]):a[r]=i[r];return function(u){for(r in s)a[r]=s[r](u);return a}}var uh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,jd=new RegExp(uh.source,"g");function D2(t){return function(){return t}}function L2(t){return function(i){return t(i)+""}}function Gv(t,i){var s=uh.lastIndex=jd.lastIndex=0,a,r,u,c=-1,m=[],h=[];for(t=t+"",i=i+"";(a=uh.exec(t))&&(r=jd.exec(i));)(u=r.index)>s&&(u=i.slice(s,u),m[c]?m[c]+=u:m[++c]=u),(a=a[0])===(r=r[0])?m[c]?m[c]+=r:m[++c]=r:(m[++c]=null,h.push({i:c,x:On(a,r)})),s=jd.lastIndex;return s<i.length&&(u=i.slice(s),m[c]?m[c]+=u:m[++c]=u),m.length<2?h[0]?L2(h[0].x):D2(i):(i=h.length,function(g){for(var v=0,p;v<i;++v)m[(p=h[v]).i]=p.x(g);return m.join("")})}function so(t,i){var s=typeof i,a;return i==null||s==="boolean"?Lh(i):(s==="number"?On:s==="string"?(a=Es(i))?(i=a,Mu):Gv:i instanceof Es?Mu:i instanceof Date?O2:M2(i)?T2:Array.isArray(i)?C2:typeof i.valueOf!="function"&&typeof i.toString!="function"||isNaN(i)?z2:On)(t,i)}var c0=180/Math.PI,ch={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Xv(t,i,s,a,r,u){var c,m,h;return(c=Math.sqrt(t*t+i*i))&&(t/=c,i/=c),(h=t*s+i*a)&&(s-=t*h,a-=i*h),(m=Math.sqrt(s*s+a*a))&&(s/=m,a/=m,h/=m),t*a<i*s&&(t=-t,i=-i,h=-h,c=-c),{translateX:r,translateY:u,rotate:Math.atan2(i,t)*c0,skewX:Math.atan(h)*c0,scaleX:c,scaleY:m}}var iu;function R2(t){const i=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return i.isIdentity?ch:Xv(i.a,i.b,i.c,i.d,i.e,i.f)}function B2(t){return t==null||(iu||(iu=document.createElementNS("http://www.w3.org/2000/svg","g")),iu.setAttribute("transform",t),!(t=iu.transform.baseVal.consolidate()))?ch:(t=t.matrix,Xv(t.a,t.b,t.c,t.d,t.e,t.f))}function Kv(t,i,s,a){function r(g){return g.length?g.pop()+" ":""}function u(g,v,p,y,w,E){if(g!==p||v!==y){var _=w.push("translate(",null,i,null,s);E.push({i:_-4,x:On(g,p)},{i:_-2,x:On(v,y)})}else(p||y)&&w.push("translate("+p+i+y+s)}function c(g,v,p,y){g!==v?(g-v>180?v+=360:v-g>180&&(g+=360),y.push({i:p.push(r(p)+"rotate(",null,a)-2,x:On(g,v)})):v&&p.push(r(p)+"rotate("+v+a)}function m(g,v,p,y){g!==v?y.push({i:p.push(r(p)+"skewX(",null,a)-2,x:On(g,v)}):v&&p.push(r(p)+"skewX("+v+a)}function h(g,v,p,y,w,E){if(g!==p||v!==y){var _=w.push(r(w)+"scale(",null,",",null,")");E.push({i:_-4,x:On(g,p)},{i:_-2,x:On(v,y)})}else(p!==1||y!==1)&&w.push(r(w)+"scale("+p+","+y+")")}return function(g,v){var p=[],y=[];return g=t(g),v=t(v),u(g.translateX,g.translateY,v.translateX,v.translateY,p,y),c(g.rotate,v.rotate,p,y),m(g.skewX,v.skewX,p,y),h(g.scaleX,g.scaleY,v.scaleX,v.scaleY,p,y),g=v=null,function(w){for(var E=-1,_=y.length,N;++E<_;)p[(N=y[E]).i]=N.x(w);return p.join("")}}}var k2=Kv(R2,"px, ","px)","deg)"),H2=Kv(B2,", ",")",")"),j2=1e-12;function f0(t){return((t=Math.exp(t))+1/t)/2}function $2(t){return((t=Math.exp(t))-1/t)/2}function U2(t){return((t=Math.exp(2*t))-1)/(t+1)}const pu=(function t(i,s,a){function r(u,c){var m=u[0],h=u[1],g=u[2],v=c[0],p=c[1],y=c[2],w=v-m,E=p-h,_=w*w+E*E,N,S;if(_<j2)S=Math.log(y/g)/i,N=function(H){return[m+H*w,h+H*E,g*Math.exp(i*H*S)]};else{var O=Math.sqrt(_),x=(y*y-g*g+a*_)/(2*g*s*O),M=(y*y-g*g-a*_)/(2*y*s*O),R=Math.log(Math.sqrt(x*x+1)-x),L=Math.log(Math.sqrt(M*M+1)-M);S=(L-R)/i,N=function(H){var j=H*S,Y=f0(R),ae=g/(s*O)*(Y*U2(i*j+R)-$2(R));return[m+ae*w,h+ae*E,g*Y/f0(i*j+R)]}}return N.duration=S*1e3*i/Math.SQRT2,N}return r.rho=function(u){var c=Math.max(.001,+u),m=c*c,h=m*m;return t(c,m,h)},r})(Math.SQRT2,2,4);var jl=0,to=0,Wa=0,Zv=1e3,Cu,no,Ou=0,_s=0,Vu=0,fo=typeof performance=="object"&&performance.now?performance:Date,Qv=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Rh(){return _s||(Qv(q2),_s=fo.now()+Vu)}function q2(){_s=0}function zu(){this._call=this._time=this._next=null}zu.prototype=Iv.prototype={constructor:zu,restart:function(t,i,s){if(typeof t!="function")throw new TypeError("callback is not a function");s=(s==null?Rh():+s)+(i==null?0:+i),!this._next&&no!==this&&(no?no._next=this:Cu=this,no=this),this._call=t,this._time=s,fh()},stop:function(){this._call&&(this._call=null,this._time=1/0,fh())}};function Iv(t,i,s){var a=new zu;return a.restart(t,i,s),a}function V2(){Rh(),++jl;for(var t=Cu,i;t;)(i=_s-t._time)>=0&&t._call.call(void 0,i),t=t._next;--jl}function d0(){_s=(Ou=fo.now())+Vu,jl=to=0;try{V2()}finally{jl=0,G2(),_s=0}}function Y2(){var t=fo.now(),i=t-Ou;i>Zv&&(Vu-=i,Ou=t)}function G2(){for(var t,i=Cu,s,a=1/0;i;)i._call?(a>i._time&&(a=i._time),t=i,i=i._next):(s=i._next,i._next=null,i=t?t._next=s:Cu=s);no=t,fh(a)}function fh(t){if(!jl){to&&(to=clearTimeout(to));var i=t-_s;i>24?(t<1/0&&(to=setTimeout(d0,t-fo.now()-Vu)),Wa&&(Wa=clearInterval(Wa))):(Wa||(Ou=fo.now(),Wa=setInterval(Y2,Zv)),jl=1,Qv(d0))}}function h0(t,i,s){var a=new zu;return i=i==null?0:+i,a.restart(r=>{a.stop(),t(r+i)},i,s),a}var X2=Uu("start","end","cancel","interrupt"),K2=[],Jv=0,m0=1,dh=2,yu=3,g0=4,hh=5,vu=6;function Yu(t,i,s,a,r,u){var c=t.__transition;if(!c)t.__transition={};else if(s in c)return;Z2(t,s,{name:i,index:a,group:r,on:X2,tween:K2,time:u.time,delay:u.delay,duration:u.duration,ease:u.ease,timer:null,state:Jv})}function Bh(t,i){var s=xn(t,i);if(s.state>Jv)throw new Error("too late; already scheduled");return s}function Rn(t,i){var s=xn(t,i);if(s.state>yu)throw new Error("too late; already running");return s}function xn(t,i){var s=t.__transition;if(!s||!(s=s[i]))throw new Error("transition not found");return s}function Z2(t,i,s){var a=t.__transition,r;a[i]=s,s.timer=Iv(u,0,s.time);function u(g){s.state=m0,s.timer.restart(c,s.delay,s.time),s.delay<=g&&c(g-s.delay)}function c(g){var v,p,y,w;if(s.state!==m0)return h();for(v in a)if(w=a[v],w.name===s.name){if(w.state===yu)return h0(c);w.state===g0?(w.state=vu,w.timer.stop(),w.on.call("interrupt",t,t.__data__,w.index,w.group),delete a[v]):+v<i&&(w.state=vu,w.timer.stop(),w.on.call("cancel",t,t.__data__,w.index,w.group),delete a[v])}if(h0(function(){s.state===yu&&(s.state=g0,s.timer.restart(m,s.delay,s.time),m(g))}),s.state=dh,s.on.call("start",t,t.__data__,s.index,s.group),s.state===dh){for(s.state=yu,r=new Array(y=s.tween.length),v=0,p=-1;v<y;++v)(w=s.tween[v].value.call(t,t.__data__,s.index,s.group))&&(r[++p]=w);r.length=p+1}}function m(g){for(var v=g<s.duration?s.ease.call(null,g/s.duration):(s.timer.restart(h),s.state=hh,1),p=-1,y=r.length;++p<y;)r[p].call(t,v);s.state===hh&&(s.on.call("end",t,t.__data__,s.index,s.group),h())}function h(){s.state=vu,s.timer.stop(),delete a[i];for(var g in a)return;delete t.__transition}}function bu(t,i){var s=t.__transition,a,r,u=!0,c;if(s){i=i==null?null:i+"";for(c in s){if((a=s[c]).name!==i){u=!1;continue}r=a.state>dh&&a.state<hh,a.state=vu,a.timer.stop(),a.on.call(r?"interrupt":"cancel",t,t.__data__,a.index,a.group),delete s[c]}u&&delete t.__transition}}function Q2(t){return this.each(function(){bu(this,t)})}function I2(t,i){var s,a;return function(){var r=Rn(this,t),u=r.tween;if(u!==s){a=s=u;for(var c=0,m=a.length;c<m;++c)if(a[c].name===i){a=a.slice(),a.splice(c,1);break}}r.tween=a}}function J2(t,i,s){var a,r;if(typeof s!="function")throw new Error;return function(){var u=Rn(this,t),c=u.tween;if(c!==a){r=(a=c).slice();for(var m={name:i,value:s},h=0,g=r.length;h<g;++h)if(r[h].name===i){r[h]=m;break}h===g&&r.push(m)}u.tween=r}}function F2(t,i){var s=this._id;if(t+="",arguments.length<2){for(var a=xn(this.node(),s).tween,r=0,u=a.length,c;r<u;++r)if((c=a[r]).name===t)return c.value;return null}return this.each((i==null?I2:J2)(s,t,i))}function kh(t,i,s){var a=t._id;return t.each(function(){var r=Rn(this,a);(r.value||(r.value={}))[i]=s.apply(this,arguments)}),function(r){return xn(r,a).value[i]}}function Fv(t,i){var s;return(typeof i=="number"?On:i instanceof Es?Mu:(s=Es(i))?(i=s,Mu):Gv)(t,i)}function W2(t){return function(){this.removeAttribute(t)}}function P2(t){return function(){this.removeAttributeNS(t.space,t.local)}}function e_(t,i,s){var a,r=s+"",u;return function(){var c=this.getAttribute(t);return c===r?null:c===a?u:u=i(a=c,s)}}function t_(t,i,s){var a,r=s+"",u;return function(){var c=this.getAttributeNS(t.space,t.local);return c===r?null:c===a?u:u=i(a=c,s)}}function n_(t,i,s){var a,r,u;return function(){var c,m=s(this),h;return m==null?void this.removeAttribute(t):(c=this.getAttribute(t),h=m+"",c===h?null:c===a&&h===r?u:(r=h,u=i(a=c,m)))}}function i_(t,i,s){var a,r,u;return function(){var c,m=s(this),h;return m==null?void this.removeAttributeNS(t.space,t.local):(c=this.getAttributeNS(t.space,t.local),h=m+"",c===h?null:c===a&&h===r?u:(r=h,u=i(a=c,m)))}}function s_(t,i){var s=qu(t),a=s==="transform"?H2:Fv;return this.attrTween(t,typeof i=="function"?(s.local?i_:n_)(s,a,kh(this,"attr."+t,i)):i==null?(s.local?P2:W2)(s):(s.local?t_:e_)(s,a,i))}function l_(t,i){return function(s){this.setAttribute(t,i.call(this,s))}}function a_(t,i){return function(s){this.setAttributeNS(t.space,t.local,i.call(this,s))}}function o_(t,i){var s,a;function r(){var u=i.apply(this,arguments);return u!==a&&(s=(a=u)&&a_(t,u)),s}return r._value=i,r}function r_(t,i){var s,a;function r(){var u=i.apply(this,arguments);return u!==a&&(s=(a=u)&&l_(t,u)),s}return r._value=i,r}function u_(t,i){var s="attr."+t;if(arguments.length<2)return(s=this.tween(s))&&s._value;if(i==null)return this.tween(s,null);if(typeof i!="function")throw new Error;var a=qu(t);return this.tween(s,(a.local?o_:r_)(a,i))}function c_(t,i){return function(){Bh(this,t).delay=+i.apply(this,arguments)}}function f_(t,i){return i=+i,function(){Bh(this,t).delay=i}}function d_(t){var i=this._id;return arguments.length?this.each((typeof t=="function"?c_:f_)(i,t)):xn(this.node(),i).delay}function h_(t,i){return function(){Rn(this,t).duration=+i.apply(this,arguments)}}function m_(t,i){return i=+i,function(){Rn(this,t).duration=i}}function g_(t){var i=this._id;return arguments.length?this.each((typeof t=="function"?h_:m_)(i,t)):xn(this.node(),i).duration}function p_(t,i){if(typeof i!="function")throw new Error;return function(){Rn(this,t).ease=i}}function y_(t){var i=this._id;return arguments.length?this.each(p_(i,t)):xn(this.node(),i).ease}function v_(t,i){return function(){var s=i.apply(this,arguments);if(typeof s!="function")throw new Error;Rn(this,t).ease=s}}function b_(t){if(typeof t!="function")throw new Error;return this.each(v_(this._id,t))}function S_(t){typeof t!="function"&&(t=Mv(t));for(var i=this._groups,s=i.length,a=new Array(s),r=0;r<s;++r)for(var u=i[r],c=u.length,m=a[r]=[],h,g=0;g<c;++g)(h=u[g])&&t.call(h,h.__data__,g,u)&&m.push(h);return new oi(a,this._parents,this._name,this._id)}function w_(t){if(t._id!==this._id)throw new Error;for(var i=this._groups,s=t._groups,a=i.length,r=s.length,u=Math.min(a,r),c=new Array(a),m=0;m<u;++m)for(var h=i[m],g=s[m],v=h.length,p=c[m]=new Array(v),y,w=0;w<v;++w)(y=h[w]||g[w])&&(p[w]=y);for(;m<a;++m)c[m]=i[m];return new oi(c,this._parents,this._name,this._id)}function x_(t){return(t+"").trim().split(/^|\s+/).every(function(i){var s=i.indexOf(".");return s>=0&&(i=i.slice(0,s)),!i||i==="start"})}function E_(t,i,s){var a,r,u=x_(i)?Bh:Rn;return function(){var c=u(this,t),m=c.on;m!==a&&(r=(a=m).copy()).on(i,s),c.on=r}}function __(t,i){var s=this._id;return arguments.length<2?xn(this.node(),s).on.on(t):this.each(E_(s,t,i))}function N_(t){return function(){var i=this.parentNode;for(var s in this.__transition)if(+s!==t)return;i&&i.removeChild(this)}}function A_(){return this.on("end.remove",N_(this._id))}function T_(t){var i=this._name,s=this._id;typeof t!="function"&&(t=Oh(t));for(var a=this._groups,r=a.length,u=new Array(r),c=0;c<r;++c)for(var m=a[c],h=m.length,g=u[c]=new Array(h),v,p,y=0;y<h;++y)(v=m[y])&&(p=t.call(v,v.__data__,y,m))&&("__data__"in v&&(p.__data__=v.__data__),g[y]=p,Yu(g[y],i,s,y,g,xn(v,s)));return new oi(u,this._parents,i,s)}function M_(t){var i=this._name,s=this._id;typeof t!="function"&&(t=Tv(t));for(var a=this._groups,r=a.length,u=[],c=[],m=0;m<r;++m)for(var h=a[m],g=h.length,v,p=0;p<g;++p)if(v=h[p]){for(var y=t.call(v,v.__data__,p,h),w,E=xn(v,s),_=0,N=y.length;_<N;++_)(w=y[_])&&Yu(w,i,s,_,y,E);u.push(y),c.push(v)}return new oi(u,c,i,s)}var C_=Eo.prototype.constructor;function O_(){return new C_(this._groups,this._parents)}function z_(t,i){var s,a,r;return function(){var u=Hl(this,t),c=(this.style.removeProperty(t),Hl(this,t));return u===c?null:u===s&&c===a?r:r=i(s=u,a=c)}}function Wv(t){return function(){this.style.removeProperty(t)}}function D_(t,i,s){var a,r=s+"",u;return function(){var c=Hl(this,t);return c===r?null:c===a?u:u=i(a=c,s)}}function L_(t,i,s){var a,r,u;return function(){var c=Hl(this,t),m=s(this),h=m+"";return m==null&&(h=m=(this.style.removeProperty(t),Hl(this,t))),c===h?null:c===a&&h===r?u:(r=h,u=i(a=c,m))}}function R_(t,i){var s,a,r,u="style."+i,c="end."+u,m;return function(){var h=Rn(this,t),g=h.on,v=h.value[u]==null?m||(m=Wv(i)):void 0;(g!==s||r!==v)&&(a=(s=g).copy()).on(c,r=v),h.on=a}}function B_(t,i,s){var a=(t+="")=="transform"?k2:Fv;return i==null?this.styleTween(t,z_(t,a)).on("end.style."+t,Wv(t)):typeof i=="function"?this.styleTween(t,L_(t,a,kh(this,"style."+t,i))).each(R_(this._id,t)):this.styleTween(t,D_(t,a,i),s).on("end.style."+t,null)}function k_(t,i,s){return function(a){this.style.setProperty(t,i.call(this,a),s)}}function H_(t,i,s){var a,r;function u(){var c=i.apply(this,arguments);return c!==r&&(a=(r=c)&&k_(t,c,s)),a}return u._value=i,u}function j_(t,i,s){var a="style."+(t+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(i==null)return this.tween(a,null);if(typeof i!="function")throw new Error;return this.tween(a,H_(t,i,s??""))}function $_(t){return function(){this.textContent=t}}function U_(t){return function(){var i=t(this);this.textContent=i??""}}function q_(t){return this.tween("text",typeof t=="function"?U_(kh(this,"text",t)):$_(t==null?"":t+""))}function V_(t){return function(i){this.textContent=t.call(this,i)}}function Y_(t){var i,s;function a(){var r=t.apply(this,arguments);return r!==s&&(i=(s=r)&&V_(r)),i}return a._value=t,a}function G_(t){var i="text";if(arguments.length<1)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,Y_(t))}function X_(){for(var t=this._name,i=this._id,s=Pv(),a=this._groups,r=a.length,u=0;u<r;++u)for(var c=a[u],m=c.length,h,g=0;g<m;++g)if(h=c[g]){var v=xn(h,i);Yu(h,t,s,g,c,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new oi(a,this._parents,t,s)}function K_(){var t,i,s=this,a=s._id,r=s.size();return new Promise(function(u,c){var m={value:c},h={value:function(){--r===0&&u()}};s.each(function(){var g=Rn(this,a),v=g.on;v!==t&&(i=(t=v).copy(),i._.cancel.push(m),i._.interrupt.push(m),i._.end.push(h)),g.on=i}),r===0&&u()})}var Z_=0;function oi(t,i,s,a){this._groups=t,this._parents=i,this._name=s,this._id=a}function Pv(){return++Z_}var ni=Eo.prototype;oi.prototype={constructor:oi,select:T_,selectAll:M_,selectChild:ni.selectChild,selectChildren:ni.selectChildren,filter:S_,merge:w_,selection:O_,transition:X_,call:ni.call,nodes:ni.nodes,node:ni.node,size:ni.size,empty:ni.empty,each:ni.each,on:__,attr:s_,attrTween:u_,style:B_,styleTween:j_,text:q_,textTween:G_,remove:A_,tween:F2,delay:d_,duration:g_,ease:y_,easeVarying:b_,end:K_,[Symbol.iterator]:ni[Symbol.iterator]};function Q_(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var I_={time:null,delay:0,duration:250,ease:Q_};function J_(t,i){for(var s;!(s=t.__transition)||!(s=s[i]);)if(!(t=t.parentNode))throw new Error(`transition ${i} not found`);return s}function F_(t){var i,s;t instanceof oi?(i=t._id,t=t._name):(i=Pv(),(s=I_).time=Rh(),t=t==null?null:t+"");for(var a=this._groups,r=a.length,u=0;u<r;++u)for(var c=a[u],m=c.length,h,g=0;g<m;++g)(h=c[g])&&Yu(h,t,i,g,c,s||J_(h,i));return new oi(a,this._parents,t,i)}Eo.prototype.interrupt=Q2;Eo.prototype.transition=F_;const su=t=>()=>t;function W_(t,{sourceEvent:i,target:s,transform:a,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:i,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:r}})}function si(t,i,s){this.k=t,this.x=i,this.y=s}si.prototype={constructor:si,scale:function(t){return t===1?this:new si(this.k*t,this.x,this.y)},translate:function(t,i){return t===0&i===0?this:new si(this.k,this.x+this.k*t,this.y+this.k*i)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Gu=new si(1,0,0);e1.prototype=si.prototype;function e1(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Gu;return t.__zoom}function $d(t){t.stopImmediatePropagation()}function Pa(t){t.preventDefault(),t.stopImmediatePropagation()}function P_(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function eN(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function p0(){return this.__zoom||Gu}function tN(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function nN(){return navigator.maxTouchPoints||"ontouchstart"in this}function iN(t,i,s){var a=t.invertX(i[0][0])-s[0][0],r=t.invertX(i[1][0])-s[1][0],u=t.invertY(i[0][1])-s[0][1],c=t.invertY(i[1][1])-s[1][1];return t.translate(r>a?(a+r)/2:Math.min(0,a)||Math.max(0,r),c>u?(u+c)/2:Math.min(0,u)||Math.max(0,c))}function t1(){var t=P_,i=eN,s=iN,a=tN,r=nN,u=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],m=250,h=pu,g=Uu("start","zoom","end"),v,p,y,w=500,E=150,_=0,N=10;function S(B){B.property("__zoom",p0).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",Y).on("dblclick.zoom",ae).filter(r).on("touchstart.zoom",K).on("touchmove.zoom",I).on("touchend.zoom touchcancel.zoom",oe).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(B,G,T,D){var q=B.selection?B.selection():B;q.property("__zoom",p0),B!==q?R(B,G,T,D):q.interrupt().each(function(){L(this,arguments).event(D).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},S.scaleBy=function(B,G,T,D){S.scaleTo(B,function(){var q=this.__zoom.k,X=typeof G=="function"?G.apply(this,arguments):G;return q*X},T,D)},S.scaleTo=function(B,G,T,D){S.transform(B,function(){var q=i.apply(this,arguments),X=this.__zoom,te=T==null?M(q):typeof T=="function"?T.apply(this,arguments):T,C=X.invert(te),$=typeof G=="function"?G.apply(this,arguments):G;return s(x(O(X,$),te,C),q,c)},T,D)},S.translateBy=function(B,G,T,D){S.transform(B,function(){return s(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof T=="function"?T.apply(this,arguments):T),i.apply(this,arguments),c)},null,D)},S.translateTo=function(B,G,T,D,q){S.transform(B,function(){var X=i.apply(this,arguments),te=this.__zoom,C=D==null?M(X):typeof D=="function"?D.apply(this,arguments):D;return s(Gu.translate(C[0],C[1]).scale(te.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof T=="function"?-T.apply(this,arguments):-T),X,c)},D,q)};function O(B,G){return G=Math.max(u[0],Math.min(u[1],G)),G===B.k?B:new si(G,B.x,B.y)}function x(B,G,T){var D=G[0]-T[0]*B.k,q=G[1]-T[1]*B.k;return D===B.x&&q===B.y?B:new si(B.k,D,q)}function M(B){return[(+B[0][0]+ +B[1][0])/2,(+B[0][1]+ +B[1][1])/2]}function R(B,G,T,D){B.on("start.zoom",function(){L(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(D).end()}).tween("zoom",function(){var q=this,X=arguments,te=L(q,X).event(D),C=i.apply(q,X),$=T==null?M(C):typeof T=="function"?T.apply(q,X):T,P=Math.max(C[1][0]-C[0][0],C[1][1]-C[0][1]),ie=q.__zoom,re=typeof G=="function"?G.apply(q,X):G,de=h(ie.invert($).concat(P/ie.k),re.invert($).concat(P/re.k));return function(ue){if(ue===1)ue=re;else{var ee=de(ue),ce=P/ee[2];ue=new si(ce,$[0]-ee[0]*ce,$[1]-ee[1]*ce)}te.zoom(null,ue)}})}function L(B,G,T){return!T&&B.__zooming||new H(B,G)}function H(B,G){this.that=B,this.args=G,this.active=0,this.sourceEvent=null,this.extent=i.apply(B,G),this.taps=0}H.prototype={event:function(B){return B&&(this.sourceEvent=B),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(B,G){return this.mouse&&B!=="mouse"&&(this.mouse[1]=G.invert(this.mouse[0])),this.touch0&&B!=="touch"&&(this.touch0[1]=G.invert(this.touch0[0])),this.touch1&&B!=="touch"&&(this.touch1[1]=G.invert(this.touch1[0])),this.that.__zoom=G,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(B){var G=Kt(this.that).datum();g.call(B,this.that,new W_(B,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:g}),G)}};function j(B,...G){if(!t.apply(this,arguments))return;var T=L(this,G).event(B),D=this.__zoom,q=Math.max(u[0],Math.min(u[1],D.k*Math.pow(2,a.apply(this,arguments)))),X=yn(B);if(T.wheel)(T.mouse[0][0]!==X[0]||T.mouse[0][1]!==X[1])&&(T.mouse[1]=D.invert(T.mouse[0]=X)),clearTimeout(T.wheel);else{if(D.k===q)return;T.mouse=[X,D.invert(X)],bu(this),T.start()}Pa(B),T.wheel=setTimeout(te,E),T.zoom("mouse",s(x(O(D,q),T.mouse[0],T.mouse[1]),T.extent,c));function te(){T.wheel=null,T.end()}}function Y(B,...G){if(y||!t.apply(this,arguments))return;var T=B.currentTarget,D=L(this,G,!0).event(B),q=Kt(B.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",P,!0),X=yn(B,T),te=B.clientX,C=B.clientY;jv(B.view),$d(B),D.mouse=[X,this.__zoom.invert(X)],bu(this),D.start();function $(ie){if(Pa(ie),!D.moved){var re=ie.clientX-te,de=ie.clientY-C;D.moved=re*re+de*de>_}D.event(ie).zoom("mouse",s(x(D.that.__zoom,D.mouse[0]=yn(ie,T),D.mouse[1]),D.extent,c))}function P(ie){q.on("mousemove.zoom mouseup.zoom",null),$v(ie.view,D.moved),Pa(ie),D.event(ie).end()}}function ae(B,...G){if(t.apply(this,arguments)){var T=this.__zoom,D=yn(B.changedTouches?B.changedTouches[0]:B,this),q=T.invert(D),X=T.k*(B.shiftKey?.5:2),te=s(x(O(T,X),D,q),i.apply(this,G),c);Pa(B),m>0?Kt(this).transition().duration(m).call(R,te,D,B):Kt(this).call(S.transform,te,D,B)}}function K(B,...G){if(t.apply(this,arguments)){var T=B.touches,D=T.length,q=L(this,G,B.changedTouches.length===D).event(B),X,te,C,$;for($d(B),te=0;te<D;++te)C=T[te],$=yn(C,this),$=[$,this.__zoom.invert($),C.identifier],q.touch0?!q.touch1&&q.touch0[2]!==$[2]&&(q.touch1=$,q.taps=0):(q.touch0=$,X=!0,q.taps=1+!!v);v&&(v=clearTimeout(v)),X&&(q.taps<2&&(p=$[0],v=setTimeout(function(){v=null},w)),bu(this),q.start())}}function I(B,...G){if(this.__zooming){var T=L(this,G).event(B),D=B.changedTouches,q=D.length,X,te,C,$;for(Pa(B),X=0;X<q;++X)te=D[X],C=yn(te,this),T.touch0&&T.touch0[2]===te.identifier?T.touch0[0]=C:T.touch1&&T.touch1[2]===te.identifier&&(T.touch1[0]=C);if(te=T.that.__zoom,T.touch1){var P=T.touch0[0],ie=T.touch0[1],re=T.touch1[0],de=T.touch1[1],ue=(ue=re[0]-P[0])*ue+(ue=re[1]-P[1])*ue,ee=(ee=de[0]-ie[0])*ee+(ee=de[1]-ie[1])*ee;te=O(te,Math.sqrt(ue/ee)),C=[(P[0]+re[0])/2,(P[1]+re[1])/2],$=[(ie[0]+de[0])/2,(ie[1]+de[1])/2]}else if(T.touch0)C=T.touch0[0],$=T.touch0[1];else return;T.zoom("touch",s(x(te,C,$),T.extent,c))}}function oe(B,...G){if(this.__zooming){var T=L(this,G).event(B),D=B.changedTouches,q=D.length,X,te;for($d(B),y&&clearTimeout(y),y=setTimeout(function(){y=null},w),X=0;X<q;++X)te=D[X],T.touch0&&T.touch0[2]===te.identifier?delete T.touch0:T.touch1&&T.touch1[2]===te.identifier&&delete T.touch1;if(T.touch1&&!T.touch0&&(T.touch0=T.touch1,delete T.touch1),T.touch0)T.touch0[1]=this.__zoom.invert(T.touch0[0]);else if(T.end(),T.taps===2&&(te=yn(te,this),Math.hypot(p[0]-te[0],p[1]-te[1])<N)){var C=Kt(this).on("dblclick.zoom");C&&C.apply(this,arguments)}}}return S.wheelDelta=function(B){return arguments.length?(a=typeof B=="function"?B:su(+B),S):a},S.filter=function(B){return arguments.length?(t=typeof B=="function"?B:su(!!B),S):t},S.touchable=function(B){return arguments.length?(r=typeof B=="function"?B:su(!!B),S):r},S.extent=function(B){return arguments.length?(i=typeof B=="function"?B:su([[+B[0][0],+B[0][1]],[+B[1][0],+B[1][1]]]),S):i},S.scaleExtent=function(B){return arguments.length?(u[0]=+B[0],u[1]=+B[1],S):[u[0],u[1]]},S.translateExtent=function(B){return arguments.length?(c[0][0]=+B[0][0],c[1][0]=+B[1][0],c[0][1]=+B[0][1],c[1][1]=+B[1][1],S):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},S.constrain=function(B){return arguments.length?(s=B,S):s},S.duration=function(B){return arguments.length?(m=+B,S):m},S.interpolate=function(B){return arguments.length?(h=B,S):h},S.on=function(){var B=g.on.apply(g,arguments);return B===g?S:B},S.clickDistance=function(B){return arguments.length?(_=(B=+B)*B,S):Math.sqrt(_)},S.tapDistance=function(B){return arguments.length?(N=+B,S):N},S}const wn={error001:(t="react")=>`Seems like you have not used zustand provider as an ancestor. Help: https://${t}flow.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:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The 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:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:i,sourceHandle:s,targetHandle:a})=>`Couldn't create edge for ${t} handle id: "${t==="source"?s:a}", edge id: ${i}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/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.",error016:t=>`Edge with id "${t}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},ho=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],n1=["Enter"," ","Escape"],i1={"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:t,x:i,y:s})=>`Moved selected node ${t}. New position, x: ${i}, y: ${s}`,"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 $l;(function(t){t.Strict="strict",t.Loose="loose"})($l||($l={}));var xs;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(xs||(xs={}));var mo;(function(t){t.Partial="partial",t.Full="full"})(mo||(mo={}));const s1={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Yi;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(Yi||(Yi={}));var go;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(go||(go={}));var fe;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(fe||(fe={}));const y0={[fe.Left]:fe.Right,[fe.Right]:fe.Left,[fe.Top]:fe.Bottom,[fe.Bottom]:fe.Top};function l1(t){return t===null?null:t?"valid":"invalid"}const a1=t=>"id"in t&&"source"in t&&"target"in t,sN=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Hh=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),No=(t,i=[0,0])=>{const{width:s,height:a}=ri(t),r=t.origin??i,u=s*r[0],c=a*r[1];return{x:t.position.x-u,y:t.position.y-c}},lN=(t,i={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const s=t.reduce((a,r)=>{const u=typeof r=="string";let c=!i.nodeLookup&&!u?r:void 0;i.nodeLookup&&(c=u?i.nodeLookup.get(r):Hh(r)?r:i.nodeLookup.get(r.id));const m=c?Du(c,i.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Xu(a,m)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Ku(s)},Ao=(t,i={})=>{let s={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return t.forEach(r=>{(i.filter===void 0||i.filter(r))&&(s=Xu(s,Du(r)),a=!0)}),a?Ku(s):{x:0,y:0,width:0,height:0}},jh=(t,i,[s,a,r]=[0,0,1],u=!1,c=!1)=>{const m={...Kl(i,[s,a,r]),width:i.width/r,height:i.height/r},h=[];for(const g of t.values()){const{measured:v,selectable:p=!0,hidden:y=!1}=g;if(c&&!p||y)continue;const w=v.width??g.width??g.initialWidth??null,E=v.height??g.height??g.initialHeight??null,_=po(m,ql(g)),N=(w??0)*(E??0),S=u&&_>0;(!g.internals.handleBounds||S||_>=N||g.dragging)&&h.push(g)}return h},aN=(t,i)=>{const s=new Set;return t.forEach(a=>{s.add(a.id)}),i.filter(a=>s.has(a.source)||s.has(a.target))};function oN(t,i){const s=new Map,a=i?.nodes?new Set(i.nodes.map(r=>r.id)):null;return t.forEach(r=>{r.measured.width&&r.measured.height&&(i?.includeHiddenNodes||!r.hidden)&&(!a||a.has(r.id))&&s.set(r.id,r)}),s}async function rN({nodes:t,width:i,height:s,panZoom:a,minZoom:r,maxZoom:u},c){if(t.size===0)return!0;const m=oN(t,c),h=Ao(m),g=Uh(h,i,s,c?.minZoom??r,c?.maxZoom??u,c?.padding??.1);return await a.setViewport(g,{duration:c?.duration,ease:c?.ease,interpolate:c?.interpolate}),!0}function o1({nodeId:t,nextPosition:i,nodeLookup:s,nodeOrigin:a=[0,0],nodeExtent:r,onError:u}){const c=s.get(t),m=c.parentId?s.get(c.parentId):void 0,{x:h,y:g}=m?m.internals.positionAbsolute:{x:0,y:0},v=c.origin??a;let p=c.extent||r;if(c.extent==="parent"&&!c.expandParent)if(!m)u?.("005",wn.error005());else{const w=m.measured.width,E=m.measured.height;w&&E&&(p=[[h,g],[h+w,g+E]])}else m&&As(c.extent)&&(p=[[c.extent[0][0]+h,c.extent[0][1]+g],[c.extent[1][0]+h,c.extent[1][1]+g]]);const y=As(p)?Ns(i,p,c.measured):i;return(c.measured.width===void 0||c.measured.height===void 0)&&u?.("015",wn.error015()),{position:{x:y.x-h+(c.measured.width??0)*v[0],y:y.y-g+(c.measured.height??0)*v[1]},positionAbsolute:y}}async function uN({nodesToRemove:t=[],edgesToRemove:i=[],nodes:s,edges:a,onBeforeDelete:r}){const u=new Set(t.map(y=>y.id)),c=[];for(const y of s){if(y.deletable===!1)continue;const w=u.has(y.id),E=!w&&y.parentId&&c.find(_=>_.id===y.parentId);(w||E)&&c.push(y)}const m=new Set(i.map(y=>y.id)),h=a.filter(y=>y.deletable!==!1),v=aN(c,h);for(const y of h)m.has(y.id)&&!v.find(E=>E.id===y.id)&&v.push(y);if(!r)return{edges:v,nodes:c};const p=await r({nodes:c,edges:v});return typeof p=="boolean"?p?{edges:v,nodes:c}:{edges:[],nodes:[]}:p}const Ul=(t,i=0,s=1)=>Math.min(Math.max(t,i),s),Ns=(t={x:0,y:0},i,s)=>({x:Ul(t.x,i[0][0],i[1][0]-(s?.width??0)),y:Ul(t.y,i[0][1],i[1][1]-(s?.height??0))});function r1(t,i,s){const{width:a,height:r}=ri(s),{x:u,y:c}=s.internals.positionAbsolute;return Ns(t,[[u,c],[u+a,c+r]],i)}const v0=(t,i,s)=>t<i?Ul(Math.abs(t-i),1,i)/i:t>s?-Ul(Math.abs(t-s),1,i)/i:0,$h=(t,i,s=15,a=40)=>{const r=v0(t.x,a,i.width-a)*s,u=v0(t.y,a,i.height-a)*s;return[r,u]},Xu=(t,i)=>({x:Math.min(t.x,i.x),y:Math.min(t.y,i.y),x2:Math.max(t.x2,i.x2),y2:Math.max(t.y2,i.y2)}),mh=({x:t,y:i,width:s,height:a})=>({x:t,y:i,x2:t+s,y2:i+a}),Ku=({x:t,y:i,x2:s,y2:a})=>({x:t,y:i,width:s-t,height:a-i}),ql=(t,i=[0,0])=>{const{x:s,y:a}=Hh(t)?t.internals.positionAbsolute:No(t,i);return{x:s,y:a,width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}},Du=(t,i=[0,0])=>{const{x:s,y:a}=Hh(t)?t.internals.positionAbsolute:No(t,i);return{x:s,y:a,x2:s+(t.measured?.width??t.width??t.initialWidth??0),y2:a+(t.measured?.height??t.height??t.initialHeight??0)}},u1=(t,i)=>Ku(Xu(mh(t),mh(i))),po=(t,i)=>{const s=Math.max(0,Math.min(t.x+t.width,i.x+i.width)-Math.max(t.x,i.x)),a=Math.max(0,Math.min(t.y+t.height,i.y+i.height)-Math.max(t.y,i.y));return Math.ceil(s*a)},b0=t=>bn(t.width)&&bn(t.height)&&bn(t.x)&&bn(t.y),bn=t=>!isNaN(t)&&isFinite(t),c1=(t,i)=>(s,a)=>{},To=(t,i=[1,1])=>({x:i[0]*Math.round(t.x/i[0]),y:i[1]*Math.round(t.y/i[1])}),Kl=({x:t,y:i},[s,a,r],u=!1,c=[1,1])=>{const m={x:(t-s)/r,y:(i-a)/r};return u?To(m,c):m},Vl=({x:t,y:i},[s,a,r])=>({x:t*r+s,y:i*r+a});function Sl(t,i){if(typeof t=="number")return Math.floor((i-i/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const s=parseFloat(t);if(!Number.isNaN(s))return Math.floor(s)}if(typeof t=="string"&&t.endsWith("%")){const s=parseFloat(t);if(!Number.isNaN(s))return Math.floor(i*s*.01)}return console.error(`The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function cN(t,i,s){if(typeof t=="string"||typeof t=="number"){const a=Sl(t,s),r=Sl(t,i);return{top:a,right:r,bottom:a,left:r,x:r*2,y:a*2}}if(typeof t=="object"){const a=Sl(t.top??t.y??0,s),r=Sl(t.bottom??t.y??0,s),u=Sl(t.left??t.x??0,i),c=Sl(t.right??t.x??0,i);return{top:a,right:c,bottom:r,left:u,x:u+c,y:a+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function fN(t,i,s,a,r,u){const{x:c,y:m}=Vl(t,[i,s,a]),{x:h,y:g}=Vl({x:t.x+t.width,y:t.y+t.height},[i,s,a]),v=r-h,p=u-g;return{left:Math.floor(c),top:Math.floor(m),right:Math.floor(v),bottom:Math.floor(p)}}const Uh=(t,i,s,a,r,u)=>{const c=cN(u,i,s),m=(i-c.x)/t.width,h=(s-c.y)/t.height,g=Math.min(m,h),v=Ul(g,a,r),p=t.x+t.width/2,y=t.y+t.height/2,w=i/2-p*v,E=s/2-y*v,_=fN(t,w,E,v,i,s),N={left:Math.min(_.left-c.left,0),top:Math.min(_.top-c.top,0),right:Math.min(_.right-c.right,0),bottom:Math.min(_.bottom-c.bottom,0)};return{x:w-N.left+N.right,y:E-N.top+N.bottom,zoom:v}},yo=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function As(t){return t!=null&&t!=="parent"}function ri(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}function f1(t){return(t.measured?.width??t.width??t.initialWidth)!==void 0&&(t.measured?.height??t.height??t.initialHeight)!==void 0}function d1(t,i={width:0,height:0},s,a,r){const u={...t},c=a.get(s);if(c){const m=c.origin||r;u.x+=c.internals.positionAbsolute.x-(i.width??0)*m[0],u.y+=c.internals.positionAbsolute.y-(i.height??0)*m[1]}return u}function S0(t,i){if(t.size!==i.size)return!1;for(const s of t)if(!i.has(s))return!1;return!0}function dN(){let t,i;return{promise:new Promise((a,r)=>{t=a,i=r}),resolve:t,reject:i}}function hN(t){return{...i1,...t||{}}}function lo(t,{snapGrid:i=[0,0],snapToGrid:s=!1,transform:a,containerBounds:r}){const{x:u,y:c}=Sn(t),m=Kl({x:u-(r?.left??0),y:c-(r?.top??0)},a),{x:h,y:g}=s?To(m,i):m;return{xSnapped:h,ySnapped:g,...m}}const qh=t=>({width:t.offsetWidth,height:t.offsetHeight}),h1=t=>t?.getRootNode?.()||window?.document,mN=["INPUT","SELECT","TEXTAREA"];function m1(t){const i=t.composedPath?.()?.[0]||t.target;return i?.nodeType!==1?!1:mN.includes(i.nodeName)||i.hasAttribute("contenteditable")||!!i.closest(".nokey")}const g1=t=>"clientX"in t,Sn=(t,i)=>{const s=g1(t),a=s?t.clientX:t.touches?.[0].clientX,r=s?t.clientY:t.touches?.[0].clientY;return{x:a-(i?.left??0),y:r-(i?.top??0)}},w0=(t,i,s,a,r)=>{const u=i.querySelectorAll(`.${t}`);return!u||!u.length?null:Array.from(u).map(c=>{const m=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),type:t,nodeId:r,position:c.getAttribute("data-handlepos"),x:(m.left-s.left)/a,y:(m.top-s.top)/a,...qh(c)}})};function p1({sourceX:t,sourceY:i,targetX:s,targetY:a,sourceControlX:r,sourceControlY:u,targetControlX:c,targetControlY:m}){const h=t*.125+r*.375+c*.375+s*.125,g=i*.125+u*.375+m*.375+a*.125,v=Math.abs(h-t),p=Math.abs(g-i);return[h,g,v,p]}function lu(t,i){return t>=0?.5*t:i*25*Math.sqrt(-t)}function x0({pos:t,x1:i,y1:s,x2:a,y2:r,c:u}){switch(t){case fe.Left:return[i-lu(i-a,u),s];case fe.Right:return[i+lu(a-i,u),s];case fe.Top:return[i,s-lu(s-r,u)];case fe.Bottom:return[i,s+lu(r-s,u)]}}function y1({sourceX:t,sourceY:i,sourcePosition:s=fe.Bottom,targetX:a,targetY:r,targetPosition:u=fe.Top,curvature:c=.25}){const[m,h]=x0({pos:s,x1:t,y1:i,x2:a,y2:r,c}),[g,v]=x0({pos:u,x1:a,y1:r,x2:t,y2:i,c}),[p,y,w,E]=p1({sourceX:t,sourceY:i,targetX:a,targetY:r,sourceControlX:m,sourceControlY:h,targetControlX:g,targetControlY:v});return[`M${t},${i} C${m},${h} ${g},${v} ${a},${r}`,p,y,w,E]}function v1({sourceX:t,sourceY:i,targetX:s,targetY:a}){const r=Math.abs(s-t)/2,u=s<t?s+r:s-r,c=Math.abs(a-i)/2,m=a<i?a+c:a-c;return[u,m,r,c]}function gN({sourceNode:t,targetNode:i,selected:s=!1,zIndex:a=0,elevateOnSelect:r=!1,zIndexMode:u="basic"}){if(u==="manual")return a;const c=r&&s?a+1e3:a,m=Math.max(t.parentId||r&&t.selected?t.internals.z:0,i.parentId||r&&i.selected?i.internals.z:0);return c+m}function pN({sourceNode:t,targetNode:i,width:s,height:a,transform:r}){const u=Xu(Du(t),Du(i));u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c={x:-r[0]/r[2],y:-r[1]/r[2],width:s/r[2],height:a/r[2]};return po(c,Ku(u))>0}const yN=({source:t,sourceHandle:i,target:s,targetHandle:a})=>`xy-edge__${t}${i||""}-${s}${a||""}`,vN=(t,i)=>i.some(s=>s.source===t.source&&s.target===t.target&&(s.sourceHandle===t.sourceHandle||!s.sourceHandle&&!t.sourceHandle)&&(s.targetHandle===t.targetHandle||!s.targetHandle&&!t.targetHandle)),bN=(t,i,s={})=>{if(!t.source||!t.target)return s.onError?.("006",wn.error006()),i;const a=s.getEdgeId||yN;let r;return a1(t)?r={...t}:r={...t,id:a(t)},vN(r,i)?i:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,i.concat(r))};function b1({sourceX:t,sourceY:i,targetX:s,targetY:a}){const[r,u,c,m]=v1({sourceX:t,sourceY:i,targetX:s,targetY:a});return[`M ${t},${i}L ${s},${a}`,r,u,c,m]}const E0={[fe.Left]:{x:-1,y:0},[fe.Right]:{x:1,y:0},[fe.Top]:{x:0,y:-1},[fe.Bottom]:{x:0,y:1}},SN=({source:t,sourcePosition:i=fe.Bottom,target:s})=>i===fe.Left||i===fe.Right?t.x<s.x?{x:1,y:0}:{x:-1,y:0}:t.y<s.y?{x:0,y:1}:{x:0,y:-1},_0=(t,i)=>Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2));function wN({source:t,sourcePosition:i=fe.Bottom,target:s,targetPosition:a=fe.Top,center:r,offset:u,stepPosition:c}){const m=E0[i],h=E0[a],g={x:t.x+m.x*u,y:t.y+m.y*u},v={x:s.x+h.x*u,y:s.y+h.y*u},p=SN({source:g,sourcePosition:i,target:v}),y=p.x!==0?"x":"y",w=p[y];let E=[],_,N;const S={x:0,y:0},O={x:0,y:0},[,,x,M]=v1({sourceX:t.x,sourceY:t.y,targetX:s.x,targetY:s.y});if(m[y]*h[y]===-1){y==="x"?(_=r.x??g.x+(v.x-g.x)*c,N=r.y??(g.y+v.y)/2):(_=r.x??(g.x+v.x)/2,N=r.y??g.y+(v.y-g.y)*c);const j=[{x:_,y:g.y},{x:_,y:v.y}],Y=[{x:g.x,y:N},{x:v.x,y:N}];m[y]===w?E=y==="x"?j:Y:E=y==="x"?Y:j}else{const j=[{x:g.x,y:v.y}],Y=[{x:v.x,y:g.y}];if(y==="x"?E=m.x===w?Y:j:E=m.y===w?j:Y,i===a){const B=Math.abs(t[y]-s[y]);if(B<=u){const G=Math.min(u-1,u-B);m[y]===w?S[y]=(g[y]>t[y]?-1:1)*G:O[y]=(v[y]>s[y]?-1:1)*G}}if(i!==a){const B=y==="x"?"y":"x",G=m[y]===h[B],T=g[B]>v[B],D=g[B]<v[B];(m[y]===1&&(!G&&T||G&&D)||m[y]!==1&&(!G&&D||G&&T))&&(E=y==="x"?j:Y)}const ae={x:g.x+S.x,y:g.y+S.y},K={x:v.x+O.x,y:v.y+O.y},I=Math.max(Math.abs(ae.x-E[0].x),Math.abs(K.x-E[0].x)),oe=Math.max(Math.abs(ae.y-E[0].y),Math.abs(K.y-E[0].y));I>=oe?(_=(ae.x+K.x)/2,N=E[0].y):(_=E[0].x,N=(ae.y+K.y)/2)}const R={x:g.x+S.x,y:g.y+S.y},L={x:v.x+O.x,y:v.y+O.y};return[[t,...R.x!==E[0].x||R.y!==E[0].y?[R]:[],...E,...L.x!==E[E.length-1].x||L.y!==E[E.length-1].y?[L]:[],s],_,N,x,M]}function xN(t,i,s,a){const r=Math.min(_0(t,i)/2,_0(i,s)/2,a),{x:u,y:c}=i;if(t.x===u&&u===s.x||t.y===c&&c===s.y)return`L${u} ${c}`;if(t.y===c){const g=t.x<s.x?-1:1,v=t.y<s.y?1:-1;return`L ${u+r*g},${c}Q ${u},${c} ${u},${c+r*v}`}const m=t.x<s.x?1:-1,h=t.y<s.y?-1:1;return`L ${u},${c+r*h}Q ${u},${c} ${u+r*m},${c}`}function gh({sourceX:t,sourceY:i,sourcePosition:s=fe.Bottom,targetX:a,targetY:r,targetPosition:u=fe.Top,borderRadius:c=5,centerX:m,centerY:h,offset:g=20,stepPosition:v=.5}){const[p,y,w,E,_]=wN({source:{x:t,y:i},sourcePosition:s,target:{x:a,y:r},targetPosition:u,center:{x:m,y:h},offset:g,stepPosition:v});let N=`M${p[0].x} ${p[0].y}`;for(let S=1;S<p.length-1;S++)N+=xN(p[S-1],p[S],p[S+1],c);return N+=`L${p[p.length-1].x} ${p[p.length-1].y}`,[N,y,w,E,_]}function N0(t){return t&&!!(t.internals.handleBounds||t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}function EN(t){const{sourceNode:i,targetNode:s}=t;if(!N0(i)||!N0(s))return null;const a=i.internals.handleBounds||A0(i.handles),r=s.internals.handleBounds||A0(s.handles),u=T0(a?.source??[],t.sourceHandle),c=T0(t.connectionMode===$l.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),t.targetHandle);if(!u||!c)return t.onError?.("008",wn.error008(u?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const m=u?.position||fe.Bottom,h=c?.position||fe.Top,g=Ts(i,u,m),v=Ts(s,c,h);return{sourceX:g.x,sourceY:g.y,targetX:v.x,targetY:v.y,sourcePosition:m,targetPosition:h}}function A0(t){if(!t)return null;const i=[],s=[];for(const a of t)a.width=a.width??1,a.height=a.height??1,a.type==="source"?i.push(a):a.type==="target"&&s.push(a);return{source:i,target:s}}function Ts(t,i,s=fe.Left,a=!1){const r=(i?.x??0)+t.internals.positionAbsolute.x,u=(i?.y??0)+t.internals.positionAbsolute.y,{width:c,height:m}=i??ri(t);if(a)return{x:r+c/2,y:u+m/2};switch(i?.position??s){case fe.Top:return{x:r+c/2,y:u};case fe.Right:return{x:r+c,y:u+m/2};case fe.Bottom:return{x:r+c/2,y:u+m};case fe.Left:return{x:r,y:u+m/2}}}function T0(t,i){return t&&(i?t.find(s=>s.id===i):t[0])||null}function ph(t,i){return t?typeof t=="string"?t:`${i?`${i}__`:""}${Object.keys(t).sort().map(a=>`${a}=${t[a]}`).join("&")}`:""}function _N(t,{id:i,defaultColor:s,defaultMarkerStart:a,defaultMarkerEnd:r}){const u=new Set;return t.reduce((c,m)=>([m.markerStart||a,m.markerEnd||r].forEach(h=>{if(h&&typeof h=="object"){const g=ph(h,i);u.has(g)||(c.push({id:g,color:h.color||s,...h}),u.add(g))}}),c),[]).sort((c,m)=>c.id.localeCompare(m.id))}const S1=1e3,NN=10,Vh={nodeOrigin:[0,0],nodeExtent:ho,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},AN={...Vh,checkEquality:!0};function Yh(t,i){const s={...t};for(const a in i)i[a]!==void 0&&(s[a]=i[a]);return s}function TN(t,i,s){const a=Yh(Vh,s);for(const r of t.values())if(r.parentId)Xh(r,t,i,a);else{const u=No(r,a.nodeOrigin),c=As(r.extent)?r.extent:a.nodeExtent,m=Ns(u,c,ri(r));r.internals.positionAbsolute=m}}function MN(t,i){if(!t.handles)return t.measured?i?.internals.handleBounds:void 0;const s=[],a=[];for(const r of t.handles){const u={id:r.id,width:r.width??1,height:r.height??1,nodeId:t.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?s.push(u):r.type==="target"&&a.push(u)}return{source:s,target:a}}function Gh(t){return t==="manual"}function yh(t,i,s,a={}){const r=Yh(AN,a),u={i:0},c=new Map(i),m=r?.elevateNodesOnSelect&&!Gh(r.zIndexMode)?S1:0;let h=t.length>0,g=!1;i.clear(),s.clear();for(const v of t){let p=c.get(v.id);if(r.checkEquality&&v===p?.internals.userNode)i.set(v.id,p);else{const y=No(v,r.nodeOrigin),w=As(v.extent)?v.extent:r.nodeExtent,E=Ns(y,w,ri(v));p={...r.defaults,...v,measured:{width:v.measured?.width,height:v.measured?.height},internals:{positionAbsolute:E,handleBounds:MN(v,p),z:w1(v,m,r.zIndexMode),userNode:v}},i.set(v.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(h=!1),v.parentId&&Xh(p,i,s,a,u),g||=v.selected??!1}return{nodesInitialized:h,hasSelectedNodes:g}}function CN(t,i){if(!t.parentId)return;const s=i.get(t.parentId);s?s.set(t.id,t):i.set(t.parentId,new Map([[t.id,t]]))}function Xh(t,i,s,a,r){const{elevateNodesOnSelect:u,nodeOrigin:c,nodeExtent:m,zIndexMode:h}=Yh(Vh,a),g=t.parentId,v=i.get(g);if(!v){console.warn(`Parent node ${g} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}CN(t,s),r&&!v.parentId&&v.internals.rootParentIndex===void 0&&h==="auto"&&(v.internals.rootParentIndex=++r.i,v.internals.z=v.internals.z+r.i*NN),r&&v.internals.rootParentIndex!==void 0&&(r.i=v.internals.rootParentIndex);const p=u&&!Gh(h)?S1:0,{x:y,y:w,z:E}=ON(t,v,c,m,p,h),{positionAbsolute:_}=t.internals,N=y!==_.x||w!==_.y;(N||E!==t.internals.z)&&i.set(t.id,{...t,internals:{...t.internals,positionAbsolute:N?{x:y,y:w}:_,z:E}})}function w1(t,i,s){const a=bn(t.zIndex)?t.zIndex:0;return Gh(s)?a:a+(t.selected?i:0)}function ON(t,i,s,a,r,u){const{x:c,y:m}=i.internals.positionAbsolute,h=ri(t),g=No(t,s),v=As(t.extent)?Ns(g,t.extent,h):g;let p=Ns({x:c+v.x,y:m+v.y},a,h);t.extent==="parent"&&(p=r1(p,h,i));const y=w1(t,r,u),w=i.internals.z??0;return{x:p.x,y:p.y,z:w>=y?w+1:y}}function Kh(t,i,s,a=[0,0]){const r=[],u=new Map;for(const c of t){const m=i.get(c.parentId);if(!m)continue;const h=u.get(c.parentId)?.expandedRect??ql(m),g=u1(h,c.rect);u.set(c.parentId,{expandedRect:g,parent:m})}return u.size>0&&u.forEach(({expandedRect:c,parent:m},h)=>{const g=m.internals.positionAbsolute,v=ri(m),p=m.origin??a,y=c.x<g.x?Math.round(Math.abs(g.x-c.x)):0,w=c.y<g.y?Math.round(Math.abs(g.y-c.y)):0,E=Math.max(v.width,Math.round(c.width)),_=Math.max(v.height,Math.round(c.height)),N=(E-v.width)*p[0],S=(_-v.height)*p[1];(y>0||w>0||N||S)&&(r.push({id:h,type:"position",position:{x:m.position.x-y+N,y:m.position.y-w+S}}),s.get(h)?.forEach(O=>{t.some(x=>x.id===O.id)||r.push({id:O.id,type:"position",position:{x:O.position.x+y,y:O.position.y+w}})})),(v.width<c.width||v.height<c.height||y||w)&&r.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:E+(y?p[0]*y-N:0),height:_+(w?p[1]*w-S:0)}})}),r}function zN(t,i,s,a,r,u,c){const m=a?.querySelector(".xyflow__viewport");let h=!1;if(!m)return{changes:[],updatedInternals:h};const g=[],v=window.getComputedStyle(m),{m22:p}=new window.DOMMatrixReadOnly(v.transform),y=[];for(const w of t.values()){const E=i.get(w.id);if(!E)continue;if(E.hidden){i.set(E.id,{...E,internals:{...E.internals,handleBounds:void 0}}),h=!0;continue}const _=qh(w.nodeElement),N=E.measured.width!==_.width||E.measured.height!==_.height;if(!!(_.width&&_.height&&(N||!E.internals.handleBounds||w.force))){const O=w.nodeElement.getBoundingClientRect(),x=As(E.extent)?E.extent:u;let{positionAbsolute:M}=E.internals;E.parentId&&E.extent==="parent"?M=r1(M,_,i.get(E.parentId)):x&&(M=Ns(M,x,_));const R={...E,measured:_,internals:{...E.internals,positionAbsolute:M,handleBounds:{source:w0("source",w.nodeElement,O,p,E.id),target:w0("target",w.nodeElement,O,p,E.id)}}};i.set(E.id,R),E.parentId&&Xh(R,i,s,{nodeOrigin:r,zIndexMode:c}),h=!0,N&&(g.push({id:E.id,type:"dimensions",dimensions:_}),E.expandParent&&E.parentId&&y.push({id:E.id,parentId:E.parentId,rect:ql(R,r)}))}}if(y.length>0){const w=Kh(y,i,s,r);g.push(...w)}return{changes:g,updatedInternals:h}}async function DN({delta:t,panZoom:i,transform:s,translateExtent:a,width:r,height:u}){if(!i||!t.x&&!t.y)return!1;const c=await i.setViewportConstrained({x:s[0]+t.x,y:s[1]+t.y,zoom:s[2]},[[0,0],[r,u]],a);return!!c&&(c.x!==s[0]||c.y!==s[1]||c.k!==s[2])}function M0(t,i,s,a,r,u){let c=r;const m=a.get(c)||new Map;a.set(c,m.set(s,i)),c=`${r}-${t}`;const h=a.get(c)||new Map;if(a.set(c,h.set(s,i)),u){c=`${r}-${t}-${u}`;const g=a.get(c)||new Map;a.set(c,g.set(s,i))}}function x1(t,i,s){t.clear(),i.clear();for(const a of s){const{source:r,target:u,sourceHandle:c=null,targetHandle:m=null}=a,h={edgeId:a.id,source:r,target:u,sourceHandle:c,targetHandle:m},g=`${r}-${c}--${u}-${m}`,v=`${u}-${m}--${r}-${c}`;M0("source",h,v,t,r,c),M0("target",h,g,t,u,m),i.set(a.id,a)}}function E1(t,i){if(!t.parentId)return!1;const s=i.get(t.parentId);return s?s.selected?!0:E1(s,i):!1}function C0(t,i,s){let a=t;do{if(a?.matches?.(i))return!0;if(a===s)return!1;a=a?.parentElement}while(a);return!1}function LN(t,i,s,a){const r=new Map;for(const[u,c]of t)if((c.selected||c.id===a)&&(!c.parentId||!E1(c,t))&&(c.draggable||i&&typeof c.draggable>"u")){const m=t.get(u);m&&r.set(u,{id:u,position:m.position||{x:0,y:0},distance:{x:s.x-m.internals.positionAbsolute.x,y:s.y-m.internals.positionAbsolute.y},extent:m.extent,parentId:m.parentId,origin:m.origin,expandParent:m.expandParent,internals:{positionAbsolute:m.internals.positionAbsolute||{x:0,y:0}},measured:{width:m.measured.width??0,height:m.measured.height??0}})}return r}function Ud({nodeId:t,dragItems:i,nodeLookup:s,dragging:a=!0}){const r=[];for(const[c,m]of i){const h=s.get(c)?.internals.userNode;h&&r.push({...h,position:m.position,dragging:a})}if(!t)return[r[0],r];const u=s.get(t)?.internals.userNode;return[u?{...u,position:i.get(t)?.position||u.position,dragging:a}:r[0],r]}function RN({dragItems:t,snapGrid:i,x:s,y:a}){const r=t.values().next().value;if(!r)return null;const u={x:s-r.distance.x,y:a-r.distance.y},c=To(u,i);return{x:c.x-u.x,y:c.y-u.y}}function BN({onNodeMouseDown:t,getStoreItems:i,onDragStart:s,onDrag:a,onDragStop:r}){let u={x:null,y:null},c=0,m=new Map,h=!1,g={x:0,y:0},v=null,p=!1,y=null,w=!1,E=!1,_=null;function N({noDragClassName:O,handleSelector:x,domNode:M,isSelectable:R,nodeId:L,nodeClickDistance:H=0}){y=Kt(M);function j({x:I,y:oe}){const{nodeLookup:B,nodeExtent:G,snapGrid:T,snapToGrid:D,nodeOrigin:q,onNodeDrag:X,onSelectionDrag:te,onError:C,updateNodePositions:$}=i();u={x:I,y:oe};let P=!1;const ie=m.size>1,re=ie&&G?mh(Ao(m)):null,de=ie&&D?RN({dragItems:m,snapGrid:T,x:I,y:oe}):null;for(const[ue,ee]of m){if(!B.has(ue))continue;let ce={x:I-ee.distance.x,y:oe-ee.distance.y};D&&(ce=de?{x:Math.round(ce.x+de.x),y:Math.round(ce.y+de.y)}:To(ce,T));let Se=null;if(ie&&G&&!ee.extent&&re){const{positionAbsolute:ye}=ee.internals,Ee=ye.x-re.x+G[0][0],De=ye.x+ee.measured.width-re.x2+G[1][0],Ge=ye.y-re.y+G[0][1],yt=ye.y+ee.measured.height-re.y2+G[1][1];Se=[[Ee,Ge],[De,yt]]}const{position:be,positionAbsolute:ge}=o1({nodeId:ue,nextPosition:ce,nodeLookup:B,nodeExtent:Se||G,nodeOrigin:q,onError:C});P=P||ee.position.x!==be.x||ee.position.y!==be.y,ee.position=be,ee.internals.positionAbsolute=ge}if(E=E||P,!!P&&($(m,!0),_&&(a||X||!L&&te))){const[ue,ee]=Ud({nodeId:L,dragItems:m,nodeLookup:B});a?.(_,m,ue,ee),X?.(_,ue,ee),L||te?.(_,ee)}}async function Y(){if(!v)return;const{transform:I,panBy:oe,autoPanSpeed:B,autoPanOnNodeDrag:G}=i();if(!G){h=!1,cancelAnimationFrame(c);return}const[T,D]=$h(g,v,B);(T!==0||D!==0)&&(u.x=(u.x??0)-T/I[2],u.y=(u.y??0)-D/I[2],await oe({x:T,y:D})&&j(u)),c=requestAnimationFrame(Y)}function ae(I){const{nodeLookup:oe,multiSelectionActive:B,nodesDraggable:G,transform:T,snapGrid:D,snapToGrid:q,selectNodesOnDrag:X,onNodeDragStart:te,onSelectionDragStart:C,unselectNodesAndEdges:$}=i();p=!0,(!X||!R)&&!B&&L&&(oe.get(L)?.selected||$()),R&&X&&L&&t?.(L);const P=lo(I.sourceEvent,{transform:T,snapGrid:D,snapToGrid:q,containerBounds:v});if(u=P,m=LN(oe,G,P,L),m.size>0&&(s||te||!L&&C)){const[ie,re]=Ud({nodeId:L,dragItems:m,nodeLookup:oe});s?.(I.sourceEvent,m,ie,re),te?.(I.sourceEvent,ie,re),L||C?.(I.sourceEvent,re)}}const K=Uv().clickDistance(H).on("start",I=>{const{domNode:oe,nodeDragThreshold:B,transform:G,snapGrid:T,snapToGrid:D}=i();v=oe?.getBoundingClientRect()||null,w=!1,E=!1,_=I.sourceEvent,B===0&&ae(I),u=lo(I.sourceEvent,{transform:G,snapGrid:T,snapToGrid:D,containerBounds:v}),g=Sn(I.sourceEvent,v)}).on("drag",I=>{const{autoPanOnNodeDrag:oe,transform:B,snapGrid:G,snapToGrid:T,nodeDragThreshold:D,nodeLookup:q}=i(),X=lo(I.sourceEvent,{transform:B,snapGrid:G,snapToGrid:T,containerBounds:v});if(_=I.sourceEvent,(I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1||L&&!q.has(L))&&(w=!0),!w){if(!h&&oe&&p&&(h=!0,Y()),!p){const te=Sn(I.sourceEvent,v),C=te.x-g.x,$=te.y-g.y;Math.sqrt(C*C+$*$)>D&&ae(I)}(u.x!==X.xSnapped||u.y!==X.ySnapped)&&m&&p&&(g=Sn(I.sourceEvent,v),j(X))}}).on("end",I=>{if(!p||w){w&&m.size>0&&i().updateNodePositions(m,!1);return}if(h=!1,p=!1,cancelAnimationFrame(c),m.size>0){const{nodeLookup:oe,updateNodePositions:B,onNodeDragStop:G,onSelectionDragStop:T}=i();if(E&&(B(m,!1),E=!1),r||G||!L&&T){const[D,q]=Ud({nodeId:L,dragItems:m,nodeLookup:oe,dragging:!1});r?.(I.sourceEvent,m,D,q),G?.(I.sourceEvent,D,q),L||T?.(I.sourceEvent,q)}}}).filter(I=>{const oe=I.target;return!I.button&&(!O||!C0(oe,`.${O}`,M))&&(!x||C0(oe,x,M))});y.call(K)}function S(){y?.on(".drag",null)}return{update:N,destroy:S}}function kN(t,i,s){const a=[],r={x:t.x-s,y:t.y-s,width:s*2,height:s*2};for(const u of i.values())po(r,ql(u))>0&&a.push(u);return a}const HN=250;function jN(t,i,s,a){let r=[],u=1/0;const c=kN(t,s,i+HN);for(const m of c){const h=[...m.internals.handleBounds?.source??[],...m.internals.handleBounds?.target??[]];for(const g of h){if(a.nodeId===g.nodeId&&a.type===g.type&&a.id===g.id)continue;const{x:v,y:p}=Ts(m,g,g.position,!0),y=Math.sqrt(Math.pow(v-t.x,2)+Math.pow(p-t.y,2));y>i||(y<u?(r=[{...g,x:v,y:p}],u=y):y===u&&r.push({...g,x:v,y:p}))}}if(!r.length)return null;if(r.length>1){const m=a.type==="source"?"target":"source";return r.find(h=>h.type===m)??r[0]}return r[0]}function _1(t,i,s,a,r,u=!1){const c=a.get(t);if(!c)return null;const m=r==="strict"?c.internals.handleBounds?.[i]:[...c.internals.handleBounds?.source??[],...c.internals.handleBounds?.target??[]],h=(s?m?.find(g=>g.id===s):m?.[0])??null;return h&&u?{...h,...Ts(c,h,h.position,!0)}:h}function N1(t,i){return t||(i?.classList.contains("target")?"target":i?.classList.contains("source")?"source":null)}function $N(t,i){let s=null;return i?s=!0:t&&!i&&(s=!1),s}const A1=()=>!0;function UN(t,{connectionMode:i,connectionRadius:s,handleId:a,nodeId:r,edgeUpdaterType:u,isTarget:c,domNode:m,nodeLookup:h,lib:g,autoPanOnConnect:v,flowId:p,panBy:y,cancelConnection:w,onConnectStart:E,onConnect:_,onConnectEnd:N,isValidConnection:S=A1,onReconnectEnd:O,updateConnection:x,getTransform:M,getFromHandle:R,autoPanSpeed:L,dragThreshold:H=1,handleDomNode:j}){const Y=h1(t.target);let ae=0,K;const{x:I,y:oe}=Sn(t),B=N1(u,j),G=m?.getBoundingClientRect();let T=!1;if(!G||!B)return;const D=_1(r,B,a,h,i);if(!D)return;let q=Sn(t,G),X=!1,te=null,C=!1,$=null;function P(){if(!v||!G)return;const[be,ge]=$h(q,G,L);y({x:be,y:ge}),ae=requestAnimationFrame(P)}const ie={...D,nodeId:r,type:B,position:D.position},re=h.get(r);let ue={inProgress:!0,isValid:null,from:Ts(re,ie,fe.Left,!0),fromHandle:ie,fromPosition:ie.position,fromNode:re,to:q,toHandle:null,toPosition:y0[ie.position],toNode:null,pointer:q};function ee(){T=!0,x(ue),E?.(t,{nodeId:r,handleId:a,handleType:B})}H===0&&ee();function ce(be){if(!T){const{x:yt,y:It}=Sn(be),Nt=yt-I,At=It-oe;if(!(Nt*Nt+At*At>H*H))return;ee()}if(!R()||!ie){Se(be);return}const ge=M();q=Sn(be,G),K=jN(Kl(q,ge,!1,[1,1]),s,h,ie),X||(P(),X=!0);const ye=T1(be,{handle:K,connectionMode:i,fromNodeId:r,fromHandleId:a,fromType:c?"target":"source",isValidConnection:S,doc:Y,lib:g,flowId:p,nodeLookup:h});$=ye.handleDomNode,te=ye.connection,C=$N(!!K,ye.isValid);const Ee=h.get(r),De=Ee?Ts(Ee,ie,fe.Left,!0):ue.from,Ge={...ue,from:De,isValid:C,to:ye.toHandle&&C?Vl({x:ye.toHandle.x,y:ye.toHandle.y},ge):q,toHandle:ye.toHandle,toPosition:C&&ye.toHandle?ye.toHandle.position:y0[ie.position],toNode:ye.toHandle?h.get(ye.toHandle.nodeId):null,pointer:q};x(Ge),ue=Ge}function Se(be){if(!("touches"in be&&be.touches.length>0)){if(T){(K||$)&&te&&C&&_?.(te);const{inProgress:ge,...ye}=ue,Ee={...ye,toPosition:ue.toHandle?ue.toPosition:null};N?.(be,Ee),u&&O?.(be,Ee)}w(),cancelAnimationFrame(ae),X=!1,C=!1,te=null,$=null,Y.removeEventListener("mousemove",ce),Y.removeEventListener("mouseup",Se),Y.removeEventListener("touchmove",ce),Y.removeEventListener("touchend",Se)}}Y.addEventListener("mousemove",ce),Y.addEventListener("mouseup",Se),Y.addEventListener("touchmove",ce),Y.addEventListener("touchend",Se)}function T1(t,{handle:i,connectionMode:s,fromNodeId:a,fromHandleId:r,fromType:u,doc:c,lib:m,flowId:h,isValidConnection:g=A1,nodeLookup:v}){const p=u==="target",y=i?c.querySelector(`.${m}-flow__handle[data-id="${h}-${i?.nodeId}-${i?.id}-${i?.type}"]`):null,{x:w,y:E}=Sn(t),_=c.elementFromPoint(w,E),N=_?.classList.contains(`${m}-flow__handle`)?_:y,S={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const O=N1(void 0,N),x=N.getAttribute("data-nodeid"),M=N.getAttribute("data-handleid"),R=N.classList.contains("connectable"),L=N.classList.contains("connectableend");if(!x||!O)return S;const H={source:p?x:a,sourceHandle:p?M:r,target:p?a:x,targetHandle:p?r:M};S.connection=H;const Y=R&&L&&(s===$l.Strict?p&&O==="source"||!p&&O==="target":x!==a||M!==r);S.isValid=Y&&g(H),S.toHandle=_1(x,O,M,v,s,!0)}return S}const vh={onPointerDown:UN,isValid:T1};function qN({domNode:t,panZoom:i,getTransform:s,getViewScale:a}){const r=Kt(t);function u({translateExtent:m,width:h,height:g,zoomStep:v=1,pannable:p=!0,zoomable:y=!0,inversePan:w=!1}){const E=x=>{if(x.sourceEvent.type!=="wheel"||!i)return;const M=s(),R=x.sourceEvent.ctrlKey&&yo()?10:1,L=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*v,H=M[2]*Math.pow(2,L*R);i.scaleTo(H)};let _=[0,0];const N=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(_=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},S=x=>{const M=s();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!i)return;const R=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],L=[R[0]-_[0],R[1]-_[1]];_=R;const H=a()*Math.max(M[2],Math.log(M[2]))*(w?-1:1),j={x:M[0]-L[0]*H,y:M[1]-L[1]*H},Y=[[0,0],[h,g]];i.setViewportConstrained({x:j.x,y:j.y,zoom:M[2]},Y,m)},O=t1().on("start",N).on("zoom",p?S:null).on("zoom.wheel",y?E:null);r.call(O,{})}function c(){r.on("zoom",null)}return{update:u,destroy:c,pointer:yn}}const Zu=t=>({x:t.x,y:t.y,zoom:t.k}),qd=({x:t,y:i,zoom:s})=>Gu.translate(t,i).scale(s),Nl=(t,i)=>t.target.closest(`.${i}`),M1=(t,i)=>i===2&&Array.isArray(t)&&t.includes(2),VN=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Vd=(t,i=0,s=VN,a=()=>{})=>{const r=typeof i=="number"&&i>0;return r||a(),r?t.transition().duration(i).ease(s).on("end",a):t},C1=t=>{const i=t.ctrlKey&&yo()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*i};function YN({zoomPanValues:t,noWheelClassName:i,d3Selection:s,d3Zoom:a,panOnScrollMode:r,panOnScrollSpeed:u,zoomOnPinch:c,onPanZoomStart:m,onPanZoom:h,onPanZoomEnd:g}){return v=>{if(Nl(v,i))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const p=s.property("__zoom").k||1;if(v.ctrlKey&&c){const N=yn(v),S=C1(v),O=p*Math.pow(2,S);a.scaleTo(s,O,N,v);return}const y=v.deltaMode===1?20:1;let w=r===xs.Vertical?0:v.deltaX*y,E=r===xs.Horizontal?0:v.deltaY*y;!yo()&&v.shiftKey&&r!==xs.Vertical&&(w=v.deltaY*y,E=0),a.translateBy(s,-(w/p)*u,-(E/p)*u,{internal:!0});const _=Zu(s.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(h?.(v,_),t.panScrollTimeout=setTimeout(()=>{g?.(v,_),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,m?.(v,_))}}function GN({noWheelClassName:t,preventScrolling:i,d3ZoomHandler:s}){return function(a,r){const u=a.type==="wheel",c=!i&&u&&!a.ctrlKey,m=Nl(a,t);if(a.ctrlKey&&u&&m&&a.preventDefault(),c||m)return null;a.preventDefault(),s.call(this,a,r)}}function XN({zoomPanValues:t,onDraggingChange:i,onPanZoomStart:s}){return a=>{if(a.sourceEvent?.internal)return;const r=Zu(a.transform);t.mouseButton=a.sourceEvent?.button||0,t.isZoomingOrPanning=!0,t.prevViewport=r,a.sourceEvent?.type==="mousedown"&&i(!0),s&&s?.(a.sourceEvent,r)}}function KN({zoomPanValues:t,panOnDrag:i,onPaneContextMenu:s,onTransformChange:a,onPanZoom:r}){return u=>{t.usedRightMouseButton=!!(s&&M1(i,t.mouseButton??0)),u.sourceEvent?.sync||a([u.transform.x,u.transform.y,u.transform.k]),r&&!u.sourceEvent?.internal&&r?.(u.sourceEvent,Zu(u.transform))}}function ZN({zoomPanValues:t,panOnDrag:i,panOnScroll:s,onDraggingChange:a,onPanZoomEnd:r,onPaneContextMenu:u}){return c=>{if(!c.sourceEvent?.internal&&(t.isZoomingOrPanning=!1,u&&M1(i,t.mouseButton??0)&&!t.usedRightMouseButton&&c.sourceEvent&&u(c.sourceEvent),t.usedRightMouseButton=!1,a(!1),r)){const m=Zu(c.transform);t.prevViewport=m,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{r?.(c.sourceEvent,m)},s?150:0)}}}function QN({zoomActivationKeyPressed:t,zoomOnScroll:i,zoomOnPinch:s,panOnDrag:a,panOnScroll:r,zoomOnDoubleClick:u,userSelectionActive:c,noWheelClassName:m,noPanClassName:h,lib:g,connectionInProgress:v}){return p=>{const y=t||i,w=s&&p.ctrlKey,E=p.type==="wheel";if(p.button===1&&p.type==="mousedown"&&(Nl(p,`${g}-flow__node`)||Nl(p,`${g}-flow__edge`)))return!0;if(!a&&!y&&!r&&!u&&!s||c||v&&!E||Nl(p,m)&&E||Nl(p,h)&&(!E||r&&E&&!t)||!s&&p.ctrlKey&&E)return!1;if(!s&&p.type==="touchstart"&&p.touches?.length>1)return p.preventDefault(),!1;if(!y&&!r&&!w&&E||!a&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(a)&&!a.includes(p.button)&&p.type==="mousedown")return!1;const _=Array.isArray(a)&&a.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||E)&&_}}function IN({domNode:t,minZoom:i,maxZoom:s,translateExtent:a,viewport:r,onPanZoom:u,onPanZoomStart:c,onPanZoomEnd:m,onDraggingChange:h}){const g={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},v=t.getBoundingClientRect(),p=t1().scaleExtent([i,s]).translateExtent(a),y=Kt(t).call(p);O({x:r.x,y:r.y,zoom:Ul(r.zoom,i,s)},[[0,0],[v.width,v.height]],a);const w=y.on("wheel.zoom"),E=y.on("dblclick.zoom");p.wheelDelta(C1);async function _(K,I){return y?new Promise(oe=>{p?.interpolate(I?.interpolate==="linear"?so:pu).transform(Vd(y,I?.duration,I?.ease,()=>oe(!0)),K)}):!1}function N({noWheelClassName:K,noPanClassName:I,onPaneContextMenu:oe,userSelectionActive:B,panOnScroll:G,panOnDrag:T,panOnScrollMode:D,panOnScrollSpeed:q,preventScrolling:X,zoomOnPinch:te,zoomOnScroll:C,zoomOnDoubleClick:$,zoomActivationKeyPressed:P,lib:ie,onTransformChange:re,connectionInProgress:de,paneClickDistance:ue,selectionOnDrag:ee}){B&&!g.isZoomingOrPanning&&S();const ce=G&&!P&&!B;p.clickDistance(ee?1/0:!bn(ue)||ue<0?0:ue);const Se=ce?YN({zoomPanValues:g,noWheelClassName:K,d3Selection:y,d3Zoom:p,panOnScrollMode:D,panOnScrollSpeed:q,zoomOnPinch:te,onPanZoomStart:c,onPanZoom:u,onPanZoomEnd:m}):GN({noWheelClassName:K,preventScrolling:X,d3ZoomHandler:w});y.on("wheel.zoom",Se,{passive:!1});const be=XN({zoomPanValues:g,onDraggingChange:h,onPanZoomStart:c});p.on("start",be);const ge=KN({zoomPanValues:g,panOnDrag:T,onPaneContextMenu:!!oe,onPanZoom:u,onTransformChange:re});p.on("zoom",ge);const ye=ZN({zoomPanValues:g,panOnDrag:T,panOnScroll:G,onPaneContextMenu:oe,onPanZoomEnd:m,onDraggingChange:h});p.on("end",ye);const Ee=QN({zoomActivationKeyPressed:P,panOnDrag:T,zoomOnScroll:C,panOnScroll:G,zoomOnDoubleClick:$,zoomOnPinch:te,userSelectionActive:B,noPanClassName:I,noWheelClassName:K,lib:ie,connectionInProgress:de});p.filter(Ee),$?y.on("dblclick.zoom",E):y.on("dblclick.zoom",null)}function S(){p.on("zoom",null)}async function O(K,I,oe){const B=qd(K),G=p?.constrain()(B,I,oe);return G&&await _(G),G}async function x(K,I){const oe=qd(K);return await _(oe,I),oe}function M(K){if(y){const I=qd(K),oe=y.property("__zoom");(oe.k!==K.zoom||oe.x!==K.x||oe.y!==K.y)&&p?.transform(y,I,null,{sync:!0})}}function R(){const K=y?e1(y.node()):{x:0,y:0,k:1};return{x:K.x,y:K.y,zoom:K.k}}async function L(K,I){return y?new Promise(oe=>{p?.interpolate(I?.interpolate==="linear"?so:pu).scaleTo(Vd(y,I?.duration,I?.ease,()=>oe(!0)),K)}):!1}async function H(K,I){return y?new Promise(oe=>{p?.interpolate(I?.interpolate==="linear"?so:pu).scaleBy(Vd(y,I?.duration,I?.ease,()=>oe(!0)),K)}):!1}function j(K){p?.scaleExtent(K)}function Y(K){p?.translateExtent(K)}function ae(K){const I=!bn(K)||K<0?0:K;p?.clickDistance(I)}return{update:N,destroy:S,setViewport:x,setViewportConstrained:O,getViewport:R,scaleTo:L,scaleBy:H,setScaleExtent:j,setTranslateExtent:Y,syncViewport:M,setClickDistance:ae}}var Yl;(function(t){t.Line="line",t.Handle="handle"})(Yl||(Yl={}));function JN({width:t,prevWidth:i,height:s,prevHeight:a,affectsX:r,affectsY:u}){const c=t-i,m=s-a,h=[c>0?1:c<0?-1:0,m>0?1:m<0?-1:0];return c&&r&&(h[0]=h[0]*-1),m&&u&&(h[1]=h[1]*-1),h}function O0(t){const i=t.includes("right")||t.includes("left"),s=t.includes("bottom")||t.includes("top"),a=t.includes("left"),r=t.includes("top");return{isHorizontal:i,isVertical:s,affectsX:a,affectsY:r}}function ji(t,i){return Math.max(0,i-t)}function $i(t,i){return Math.max(0,t-i)}function au(t,i,s){return Math.max(0,i-t,t-s)}function z0(t,i){return t?!i:i}function FN(t,i,s,a,r,u,c,m){let{affectsX:h,affectsY:g}=i;const{isHorizontal:v,isVertical:p}=i,y=v&&p,{xSnapped:w,ySnapped:E}=s,{minWidth:_,maxWidth:N,minHeight:S,maxHeight:O}=a,{x,y:M,width:R,height:L,aspectRatio:H}=t;let j=Math.floor(v?w-t.pointerX:0),Y=Math.floor(p?E-t.pointerY:0);const ae=R+(h?-j:j),K=L+(g?-Y:Y),I=-u[0]*R,oe=-u[1]*L;let B=au(ae,_,N),G=au(K,S,O);if(c){let q=0,X=0;h&&j<0?q=ji(x+j+I,c[0][0]):!h&&j>0&&(q=$i(x+ae+I,c[1][0])),g&&Y<0?X=ji(M+Y+oe,c[0][1]):!g&&Y>0&&(X=$i(M+K+oe,c[1][1])),B=Math.max(B,q),G=Math.max(G,X)}if(m){let q=0,X=0;h&&j>0?q=$i(x+j,m[0][0]):!h&&j<0&&(q=ji(x+ae,m[1][0])),g&&Y>0?X=$i(M+Y,m[0][1]):!g&&Y<0&&(X=ji(M+K,m[1][1])),B=Math.max(B,q),G=Math.max(G,X)}if(r){if(v){const q=au(ae/H,S,O)*H;if(B=Math.max(B,q),c){let X=0;!h&&!g||h&&!g&&y?X=$i(M+oe+ae/H,c[1][1])*H:X=ji(M+oe+(h?j:-j)/H,c[0][1])*H,B=Math.max(B,X)}if(m){let X=0;!h&&!g||h&&!g&&y?X=ji(M+ae/H,m[1][1])*H:X=$i(M+(h?j:-j)/H,m[0][1])*H,B=Math.max(B,X)}}if(p){const q=au(K*H,_,N)/H;if(G=Math.max(G,q),c){let X=0;!h&&!g||g&&!h&&y?X=$i(x+K*H+I,c[1][0])/H:X=ji(x+(g?Y:-Y)*H+I,c[0][0])/H,G=Math.max(G,X)}if(m){let X=0;!h&&!g||g&&!h&&y?X=ji(x+K*H,m[1][0])/H:X=$i(x+(g?Y:-Y)*H,m[0][0])/H,G=Math.max(G,X)}}}Y=Y+(Y<0?G:-G),j=j+(j<0?B:-B),r&&(y?ae>K*H?Y=(z0(h,g)?-j:j)/H:j=(z0(h,g)?-Y:Y)*H:v?(Y=j/H,g=h):(j=Y*H,h=g));const T=h?x+j:x,D=g?M+Y:M;return{width:R+(h?-j:j),height:L+(g?-Y:Y),x:u[0]*j*(h?-1:1)+T,y:u[1]*Y*(g?-1:1)+D}}const O1={width:0,height:0,x:0,y:0},WN={...O1,pointerX:0,pointerY:0,aspectRatio:1};function PN(t,i,s){const a=i.position.x+t.position.x,r=i.position.y+t.position.y,u=t.measured.width??0,c=t.measured.height??0,m=s[0]*u,h=s[1]*c;return[[a-m,r-h],[a+u-m,r+c-h]]}function eA({domNode:t,nodeId:i,getStoreItems:s,onChange:a,onEnd:r}){const u=Kt(t);let c={controlDirection:O0("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function m({controlPosition:g,boundaries:v,keepAspectRatio:p,resizeDirection:y,onResizeStart:w,onResize:E,onResizeEnd:_,shouldResize:N}){let S={...O1},O={...WN};c={boundaries:v,resizeDirection:y,keepAspectRatio:p,controlDirection:O0(g)};let x,M=null,R=[],L,H,j,Y=!1;const ae=Uv().on("start",K=>{const{nodeLookup:I,transform:oe,snapGrid:B,snapToGrid:G,nodeOrigin:T,paneDomNode:D}=s();if(x=I.get(i),!x)return;M=D?.getBoundingClientRect()??null;const{xSnapped:q,ySnapped:X}=lo(K.sourceEvent,{transform:oe,snapGrid:B,snapToGrid:G,containerBounds:M});S={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},O={...S,pointerX:q,pointerY:X,aspectRatio:S.width/S.height},L=void 0,H=As(x.extent)?x.extent:void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(L=I.get(x.parentId)),L&&x.extent==="parent"&&(H=[[0,0],[L.measured.width,L.measured.height]]),R=[],j=void 0;for(const[te,C]of I)if(C.parentId===i&&(R.push({id:te,position:{...C.position},extent:C.extent}),C.extent==="parent"||C.expandParent)){const $=PN(C,x,C.origin??T);j?j=[[Math.min($[0][0],j[0][0]),Math.min($[0][1],j[0][1])],[Math.max($[1][0],j[1][0]),Math.max($[1][1],j[1][1])]]:j=$}w?.(K,{...S})}).on("drag",K=>{const{transform:I,snapGrid:oe,snapToGrid:B,nodeOrigin:G}=s(),T=lo(K.sourceEvent,{transform:I,snapGrid:oe,snapToGrid:B,containerBounds:M}),D=[];if(!x)return;const{x:q,y:X,width:te,height:C}=S,$={},P=x.origin??G,{width:ie,height:re,x:de,y:ue}=FN(O,c.controlDirection,T,c.boundaries,c.keepAspectRatio,P,H,j),ee=ie!==te,ce=re!==C,Se=de!==q&&ee,be=ue!==X&&ce;if(!Se&&!be&&!ee&&!ce)return;if((Se||be||P[0]===1||P[1]===1)&&($.x=Se?de:S.x,$.y=be?ue:S.y,S.x=$.x,S.y=$.y,R.length>0)){const De=de-q,Ge=ue-X;for(const yt of R)yt.position={x:yt.position.x-De+P[0]*(ie-te),y:yt.position.y-Ge+P[1]*(re-C)},D.push(yt)}if((ee||ce)&&($.width=ee&&(!c.resizeDirection||c.resizeDirection==="horizontal")?ie:S.width,$.height=ce&&(!c.resizeDirection||c.resizeDirection==="vertical")?re:S.height,S.width=$.width,S.height=$.height),L&&x.expandParent){const De=P[0]*($.width??0);$.x&&$.x<De&&(S.x=De,O.x=O.x-($.x-De));const Ge=P[1]*($.height??0);$.y&&$.y<Ge&&(S.y=Ge,O.y=O.y-($.y-Ge))}const ge=JN({width:S.width,prevWidth:te,height:S.height,prevHeight:C,affectsX:c.controlDirection.affectsX,affectsY:c.controlDirection.affectsY}),ye={...S,direction:ge};N?.(K,ye)!==!1&&(Y=!0,E?.(K,ye),a($,D))}).on("end",K=>{Y&&(_?.(K,{...S}),r?.({...S}),Y=!1)});u.call(ae)}function h(){u.on(".drag",null)}return{update:m,destroy:h}}var Yd={exports:{}},Gd={},Xd={exports:{}},Kd={};var D0;function tA(){if(D0)return Kd;D0=1;var t=xo();function i(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var s=typeof Object.is=="function"?Object.is:i,a=t.useState,r=t.useEffect,u=t.useLayoutEffect,c=t.useDebugValue;function m(p,y){var w=y(),E=a({inst:{value:w,getSnapshot:y}}),_=E[0].inst,N=E[1];return u(function(){_.value=w,_.getSnapshot=y,h(_)&&N({inst:_})},[p,w,y]),r(function(){return h(_)&&N({inst:_}),p(function(){h(_)&&N({inst:_})})},[p]),c(w),w}function h(p){var y=p.getSnapshot;p=p.value;try{var w=y();return!s(p,w)}catch{return!0}}function g(p,y){return y()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:m;return Kd.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:v,Kd}var L0;function nA(){return L0||(L0=1,Xd.exports=tA()),Xd.exports}var R0;function iA(){if(R0)return Gd;R0=1;var t=xo(),i=nA();function s(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var a=typeof Object.is=="function"?Object.is:s,r=i.useSyncExternalStore,u=t.useRef,c=t.useEffect,m=t.useMemo,h=t.useDebugValue;return Gd.useSyncExternalStoreWithSelector=function(g,v,p,y,w){var E=u(null);if(E.current===null){var _={hasValue:!1,value:null};E.current=_}else _=E.current;E=m(function(){function S(L){if(!O){if(O=!0,x=L,L=y(L),w!==void 0&&_.hasValue){var H=_.value;if(w(H,L))return M=H}return M=L}if(H=M,a(x,L))return H;var j=y(L);return w!==void 0&&w(H,j)?(x=L,H):(x=L,M=j)}var O=!1,x,M,R=p===void 0?null:p;return[function(){return S(v())},R===null?void 0:function(){return S(R())}]},[v,p,y,w]);var N=r(g,E[0],E[1]);return c(function(){_.hasValue=!0,_.value=N},[N]),h(N),N},Gd}var B0;function sA(){return B0||(B0=1,Yd.exports=iA()),Yd.exports}var lA=sA();const aA=Ev(lA),oA={},k0=t=>{let i;const s=new Set,a=(v,p)=>{const y=typeof v=="function"?v(i):v;if(!Object.is(y,i)){const w=i;i=p??(typeof y!="object"||y===null)?y:Object.assign({},i,y),s.forEach(E=>E(i,w))}},r=()=>i,h={setState:a,getState:r,getInitialState:()=>g,subscribe:v=>(s.add(v),()=>s.delete(v)),destroy:()=>{(oA?"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."),s.clear()}},g=i=t(a,r,h);return h},rA=t=>t?k0(t):k0,{useDebugValue:uA}=_v,{useSyncExternalStoreWithSelector:cA}=aA,fA=t=>t;function z1(t,i=fA,s){const a=cA(t.subscribe,t.getState,t.getServerState||t.getInitialState,i,s);return uA(a),a}const H0=(t,i)=>{const s=rA(t),a=(r,u=i)=>z1(s,r,u);return Object.assign(a,s),a},dA=(t,i)=>t?H0(t,i):H0;function Qe(t,i){if(Object.is(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;if(t instanceof Map&&i instanceof Map){if(t.size!==i.size)return!1;for(const[a,r]of t)if(!Object.is(r,i.get(a)))return!1;return!0}if(t instanceof Set&&i instanceof Set){if(t.size!==i.size)return!1;for(const a of t)if(!i.has(a))return!1;return!0}const s=Object.keys(t);if(s.length!==Object.keys(i).length)return!1;for(const a of s)if(!Object.prototype.hasOwnProperty.call(i,a)||!Object.is(t[a],i[a]))return!1;return!0}Nv();const Qu=F.createContext(null),hA=Qu.Provider,D1=wn.error001("react");function ze(t,i){const s=F.useContext(Qu);if(s===null)throw new Error(D1);return z1(s,t,i)}function Je(){const t=F.useContext(Qu);if(t===null)throw new Error(D1);return F.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const j0={display:"none"},mA={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},L1="react-flow__node-desc",R1="react-flow__edge-desc",gA="react-flow__aria-live",pA=t=>t.ariaLiveMessage,yA=t=>t.ariaLabelConfig;function vA({rfId:t}){const i=ze(pA);return z.jsx("div",{id:`${gA}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:mA,children:i})}function bA({rfId:t,disableKeyboardA11y:i}){const s=ze(yA);return z.jsxs(z.Fragment,{children:[z.jsx("div",{id:`${L1}-${t}`,style:j0,children:i?s["node.a11yDescription.default"]:s["node.a11yDescription.keyboardDisabled"]}),z.jsx("div",{id:`${R1}-${t}`,style:j0,children:s["edge.a11yDescription.default"]}),!i&&z.jsx(vA,{rfId:t})]})}const Iu=F.forwardRef(({position:t="top-left",children:i,className:s,style:a,...r},u)=>{const c=`${t}`.split("-");return z.jsx("div",{className:ut(["react-flow__panel",s,...c]),style:a,ref:u,...r,children:i})});Iu.displayName="Panel";function SA({proOptions:t,position:i="bottom-right"}){return t?.hideAttribution?null:z.jsx(Iu,{position:i,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:z.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const wA=t=>{const i=[],s=[];for(const[,a]of t.nodeLookup)a.selected&&i.push(a.internals.userNode);for(const[,a]of t.edgeLookup)a.selected&&s.push(a);return{selectedNodes:i,selectedEdges:s}},ou=t=>t.id;function xA(t,i){return Qe(t.selectedNodes.map(ou),i.selectedNodes.map(ou))&&Qe(t.selectedEdges.map(ou),i.selectedEdges.map(ou))}function EA({onSelectionChange:t}){const i=Je(),{selectedNodes:s,selectedEdges:a}=ze(wA,xA);return F.useEffect(()=>{const r={nodes:s,edges:a};t?.(r),i.getState().onSelectionChangeHandlers.forEach(u=>u(r))},[s,a,t]),null}const _A=t=>!!t.onSelectionChangeHandlers;function NA({onSelectionChange:t}){const i=ze(_A);return t||i?z.jsx(EA,{onSelectionChange:t}):null}const B1=[0,0],AA={x:0,y:0,zoom:1},TA=["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"],$0=[...TA,"rfId"],MA=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),U0={translateExtent:ho,nodeOrigin:B1,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function CA(t){const{setNodes:i,setEdges:s,setMinZoom:a,setMaxZoom:r,setTranslateExtent:u,setNodeExtent:c,reset:m,setDefaultNodesAndEdges:h}=ze(MA,Qe),g=Je();F.useEffect(()=>(h(t.defaultNodes,t.defaultEdges),()=>{v.current=U0,m()}),[]);const v=F.useRef(U0);return F.useEffect(()=>{for(const p of $0){const y=t[p],w=v.current[p];y!==w&&(typeof t[p]>"u"||(p==="nodes"?i(y):p==="edges"?s(y):p==="minZoom"?a(y):p==="maxZoom"?r(y):p==="translateExtent"?u(y):p==="nodeExtent"?c(y):p==="ariaLabelConfig"?g.setState({ariaLabelConfig:hN(y)}):p==="fitView"?g.setState({fitViewQueued:y}):p==="fitViewOptions"?g.setState({fitViewOptions:y}):g.setState({[p]:y})))}v.current=t},$0.map(p=>t[p])),null}function q0(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function OA(t){const[i,s]=F.useState(t==="system"?null:t);return F.useEffect(()=>{if(t!=="system"){s(t);return}const a=q0(),r=()=>s(a?.matches?"dark":"light");return r(),a?.addEventListener("change",r),()=>{a?.removeEventListener("change",r)}},[t]),i!==null?i:q0()?.matches?"dark":"light"}const V0=typeof document<"u"?document:null;function vo(t=null,i={target:V0,actInsideInputWithModifier:!0}){const[s,a]=F.useState(!1),r=F.useRef(!1),u=F.useRef(new Set([])),[c,m]=F.useMemo(()=>{if(t!==null){const g=(Array.isArray(t)?t:[t]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
|
|
10
|
+
`).replace(`
|
|
11
|
+
|
|
12
|
+
`,`
|
|
13
|
+
+`).split(`
|
|
14
|
+
`)),v=g.reduce((p,y)=>p.concat(...y),[]);return[g,v]}return[[],[]]},[t]);return F.useEffect(()=>{const h=i?.target??V0,g=i?.actInsideInputWithModifier??!0;if(t!==null){const v=w=>{if(r.current=w.ctrlKey||w.metaKey||w.shiftKey||w.altKey,(!r.current||r.current&&!g)&&m1(w))return!1;const _=G0(w.code,m);if(u.current.add(w[_]),Y0(c,u.current,!1)){const N=w.composedPath?.()?.[0]||w.target,S=N?.nodeName==="BUTTON"||N?.nodeName==="A";i.preventDefault!==!1&&(r.current||!S)&&w.preventDefault(),a(!0)}},p=w=>{const E=G0(w.code,m);Y0(c,u.current,!0)?(a(!1),u.current.clear()):u.current.delete(w[E]),w.key==="Meta"&&u.current.clear(),r.current=!1},y=()=>{u.current.clear(),a(!1)};return h?.addEventListener("keydown",v),h?.addEventListener("keyup",p),window.addEventListener("blur",y),window.addEventListener("contextmenu",y),()=>{h?.removeEventListener("keydown",v),h?.removeEventListener("keyup",p),window.removeEventListener("blur",y),window.removeEventListener("contextmenu",y)}}},[t,a]),s}function Y0(t,i,s){return t.filter(a=>s||a.length===i.size).some(a=>a.every(r=>i.has(r)))}function G0(t,i){return i.includes(t)?"code":"key"}const zA=()=>{const t=Je();return F.useMemo(()=>({zoomIn:async i=>{const{panZoom:s}=t.getState();return s?s.scaleBy(1.2,i):!1},zoomOut:async i=>{const{panZoom:s}=t.getState();return s?s.scaleBy(1/1.2,i):!1},zoomTo:async(i,s)=>{const{panZoom:a}=t.getState();return a?a.scaleTo(i,s):!1},getZoom:()=>t.getState().transform[2],setViewport:async(i,s)=>{const{transform:[a,r,u],panZoom:c}=t.getState();return c?(await c.setViewport({x:i.x??a,y:i.y??r,zoom:i.zoom??u},s),!0):!1},getViewport:()=>{const[i,s,a]=t.getState().transform;return{x:i,y:s,zoom:a}},setCenter:async(i,s,a)=>t.getState().setCenter(i,s,a),fitBounds:async(i,s)=>{const{width:a,height:r,minZoom:u,maxZoom:c,panZoom:m}=t.getState(),h=Uh(i,a,r,u,c,s?.padding??.1);return m?(await m.setViewport(h,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),!0):!1},screenToFlowPosition:(i,s={})=>{const{transform:a,snapGrid:r,snapToGrid:u,domNode:c}=t.getState();if(!c)return i;const{x:m,y:h}=c.getBoundingClientRect(),g={x:i.x-m,y:i.y-h},v=s.snapGrid??r,p=s.snapToGrid??u;return Kl(g,a,p,v)},flowToScreenPosition:i=>{const{transform:s,domNode:a}=t.getState();if(!a)return i;const{x:r,y:u}=a.getBoundingClientRect(),c=Vl(i,s);return{x:c.x+r,y:c.y+u}}}),[])};function k1(t,i){const s=[],a=new Map,r=[];for(const u of t)if(u.type==="add"){r.push(u);continue}else if(u.type==="remove"||u.type==="replace")a.set(u.id,[u]);else{const c=a.get(u.id);c?c.push(u):a.set(u.id,[u])}for(const u of i){const c=a.get(u.id);if(!c){s.push(u);continue}if(c[0].type==="remove")continue;if(c[0].type==="replace"){s.push({...c[0].item});continue}const m={...u};for(const h of c)DA(h,m);s.push(m)}return r.length&&r.forEach(u=>{u.index!==void 0?s.splice(u.index,0,{...u.item}):s.push({...u.item})}),s}function DA(t,i){switch(t.type){case"select":{i.selected=t.selected;break}case"position":{typeof t.position<"u"&&(i.position=t.position),typeof t.dragging<"u"&&(i.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(i.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(i.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(i.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(i.resizing=t.resizing);break}}}function LA(t,i){return k1(t,i)}function RA(t,i){return k1(t,i)}function gs(t,i){return{id:t,type:"select",selected:i}}function Al(t,i=new Set,s=!1){const a=[];for(const[r,u]of t){const c=i.has(r);!(u.selected===void 0&&!c)&&u.selected!==c&&(s&&(u.selected=c),a.push(gs(u.id,c)))}return a}function X0({items:t=[],lookup:i}){const s=[],a=new Map(t.map(r=>[r.id,r]));for(const[r,u]of t.entries()){const c=i.get(u.id),m=c?.internals?.userNode??c;m!==void 0&&m!==u&&s.push({id:u.id,item:u,type:"replace"}),m===void 0&&s.push({item:u,type:"add",index:r})}for(const[r]of i)a.get(r)===void 0&&s.push({id:r,type:"remove"});return s}function K0(t){return{id:t.id,type:"remove"}}const BA=c1();function kA(t,i,s={}){return bN(t,i,{...s,onError:s.onError??BA})}const Z0=t=>sN(t),HA=t=>a1(t);function H1(t){return F.forwardRef(t)}const jA=typeof window<"u"?F.useLayoutEffect:F.useEffect;function Q0(t){const[i,s]=F.useState(BigInt(0)),[a]=F.useState(()=>$A(()=>s(r=>r+BigInt(1))));return jA(()=>{const r=a.get();r.length&&(t(r),a.reset())},[i]),a}function $A(t){let i=[];return{get:()=>i,reset:()=>{i=[]},push:s=>{i.push(s),t()}}}const j1=F.createContext(null);function UA({children:t}){const i=Je(),s=F.useCallback(m=>{const{nodes:h=[],setNodes:g,hasDefaultNodes:v,onNodesChange:p,nodeLookup:y,fitViewQueued:w,onNodesChangeMiddlewareMap:E}=i.getState();let _=h;for(const S of m)_=typeof S=="function"?S(_):S;let N=X0({items:_,lookup:y});for(const S of E.values())N=S(N);v&&g(_),N.length>0?p?.(N):w&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:O,setNodes:x}=i.getState();S&&x(O)})},[]),a=Q0(s),r=F.useCallback(m=>{const{edges:h=[],setEdges:g,hasDefaultEdges:v,onEdgesChange:p,edgeLookup:y}=i.getState();let w=h;for(const E of m)w=typeof E=="function"?E(w):E;v?g(w):p&&p(X0({items:w,lookup:y}))},[]),u=Q0(r),c=F.useMemo(()=>({nodeQueue:a,edgeQueue:u}),[]);return z.jsx(j1.Provider,{value:c,children:t})}function qA(){const t=F.useContext(j1);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const VA=t=>!!t.panZoom;function Ju(){const t=zA(),i=Je(),s=qA(),a=ze(VA),r=F.useMemo(()=>{const u=p=>i.getState().nodeLookup.get(p),c=p=>{s.nodeQueue.push(p)},m=p=>{s.edgeQueue.push(p)},h=p=>{const{nodeLookup:y,nodeOrigin:w}=i.getState(),E=Z0(p)?p:y.get(p.id),_=E.parentId?d1(E.position,E.measured,E.parentId,y,w):E.position,N={...E,position:_,width:E.measured?.width??E.width,height:E.measured?.height??E.height};return ql(N)},g=(p,y,w={replace:!1})=>{c(E=>E.map(_=>{if(_.id===p){const N=typeof y=="function"?y(_):y;return w.replace&&Z0(N)?N:{..._,...N}}return _}))},v=(p,y,w={replace:!1})=>{m(E=>E.map(_=>{if(_.id===p){const N=typeof y=="function"?y(_):y;return w.replace&&HA(N)?N:{..._,...N}}return _}))};return{getNodes:()=>i.getState().nodes.map(p=>({...p})),getNode:p=>u(p)?.internals.userNode,getInternalNode:u,getEdges:()=>{const{edges:p=[]}=i.getState();return p.map(y=>({...y}))},getEdge:p=>i.getState().edgeLookup.get(p),setNodes:c,setEdges:m,addNodes:p=>{const y=Array.isArray(p)?p:[p];s.nodeQueue.push(w=>[...w,...y])},addEdges:p=>{const y=Array.isArray(p)?p:[p];s.edgeQueue.push(w=>[...w,...y])},toObject:()=>{const{nodes:p=[],edges:y=[],transform:w}=i.getState(),[E,_,N]=w;return{nodes:p.map(S=>({...S})),edges:y.map(S=>({...S})),viewport:{x:E,y:_,zoom:N}}},deleteElements:async({nodes:p=[],edges:y=[]})=>{const{nodes:w,edges:E,onNodesDelete:_,onEdgesDelete:N,triggerNodeChanges:S,triggerEdgeChanges:O,onDelete:x,onBeforeDelete:M}=i.getState(),{nodes:R,edges:L}=await uN({nodesToRemove:p,edgesToRemove:y,nodes:w,edges:E,onBeforeDelete:M}),H=L.length>0,j=R.length>0;if(H){const Y=L.map(K0);N?.(L),O(Y)}if(j){const Y=R.map(K0);_?.(R),S(Y)}return(j||H)&&x?.({nodes:R,edges:L}),{deletedNodes:R,deletedEdges:L}},getIntersectingNodes:(p,y=!0,w)=>{const E=b0(p),_=E?p:h(p),N=w!==void 0;return _?(w||i.getState().nodes).filter(S=>{const O=i.getState().nodeLookup.get(S.id);if(O&&!E&&(S.id===p.id||!O.internals.positionAbsolute))return!1;const x=ql(N?S:O),M=po(x,_);return y&&M>0||M>=x.width*x.height||M>=_.width*_.height}):[]},isNodeIntersecting:(p,y,w=!0)=>{const _=b0(p)?p:h(p);if(!_)return!1;const N=po(_,y);return w&&N>0||N>=y.width*y.height||N>=_.width*_.height},updateNode:g,updateNodeData:(p,y,w={replace:!1})=>{g(p,E=>{const _=typeof y=="function"?y(E):y;return w.replace?{...E,data:_}:{...E,data:{...E.data,..._}}},w)},updateEdge:v,updateEdgeData:(p,y,w={replace:!1})=>{v(p,E=>{const _=typeof y=="function"?y(E):y;return w.replace?{...E,data:_}:{...E,data:{...E.data,..._}}},w)},getNodesBounds:p=>{const{nodeLookup:y,nodeOrigin:w}=i.getState();return lN(p,{nodeLookup:y,nodeOrigin:w})},getHandleConnections:({type:p,id:y,nodeId:w})=>Array.from(i.getState().connectionLookup.get(`${w}-${p}${y?`-${y}`:""}`)?.values()??[]),getNodeConnections:({type:p,handleId:y,nodeId:w})=>Array.from(i.getState().connectionLookup.get(`${w}${p?y?`-${p}-${y}`:`-${p}`:""}`)?.values()??[]),fitView:async p=>{const y=i.getState().fitViewResolver??dN();return i.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:y}),s.nodeQueue.push(w=>[...w]),y.promise}}},[]);return F.useMemo(()=>({...r,...t,viewportInitialized:a}),[a])}const I0=t=>t.selected,YA=typeof window<"u"?window:void 0;function GA({deleteKeyCode:t,multiSelectionKeyCode:i}){const s=Je(),{deleteElements:a}=Ju(),r=vo(t,{actInsideInputWithModifier:!1}),u=vo(i,{target:YA});F.useEffect(()=>{if(r){const{edges:c,nodes:m}=s.getState();a({nodes:m.filter(I0),edges:c.filter(I0)}),s.setState({nodesSelectionActive:!1})}},[r]),F.useEffect(()=>{s.setState({multiSelectionActive:u})},[u])}function XA(t){const i=Je();F.useEffect(()=>{const s=()=>{if(!t.current||!(t.current.checkVisibility?.()??!0))return!1;const a=qh(t.current);(a.height===0||a.width===0)&&i.getState().onError?.("004",wn.error004()),i.setState({width:a.width||500,height:a.height||500})};if(t.current){s(),window.addEventListener("resize",s);const a=new ResizeObserver(()=>s());return a.observe(t.current),()=>{window.removeEventListener("resize",s),a&&t.current&&a.unobserve(t.current)}}},[])}const Fu={position:"absolute",width:"100%",height:"100%",top:0,left:0},KA=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function ZA({onPaneContextMenu:t,zoomOnScroll:i=!0,zoomOnPinch:s=!0,panOnScroll:a=!1,panOnScrollSpeed:r=.5,panOnScrollMode:u=xs.Free,zoomOnDoubleClick:c=!0,panOnDrag:m=!0,defaultViewport:h,translateExtent:g,minZoom:v,maxZoom:p,zoomActivationKeyCode:y,preventScrolling:w=!0,children:E,noWheelClassName:_,noPanClassName:N,onViewportChange:S,isControlledViewport:O,paneClickDistance:x,selectionOnDrag:M}){const R=Je(),L=F.useRef(null),{userSelectionActive:H,lib:j,connectionInProgress:Y}=ze(KA,Qe),ae=vo(y),K=F.useRef();XA(L);const I=F.useCallback(oe=>{S?.({x:oe[0],y:oe[1],zoom:oe[2]}),O||R.setState({transform:oe})},[S,O]);return F.useEffect(()=>{if(L.current){K.current=IN({domNode:L.current,minZoom:v,maxZoom:p,translateExtent:g,viewport:h,onDraggingChange:T=>R.setState(D=>D.paneDragging===T?D:{paneDragging:T}),onPanZoomStart:(T,D)=>{const{onViewportChangeStart:q,onMoveStart:X}=R.getState();X?.(T,D),q?.(D)},onPanZoom:(T,D)=>{const{onViewportChange:q,onMove:X}=R.getState();X?.(T,D),q?.(D)},onPanZoomEnd:(T,D)=>{const{onViewportChangeEnd:q,onMoveEnd:X}=R.getState();X?.(T,D),q?.(D)}});const{x:oe,y:B,zoom:G}=K.current.getViewport();return R.setState({panZoom:K.current,transform:[oe,B,G],domNode:L.current.closest(".react-flow")}),()=>{K.current?.destroy()}}},[]),F.useEffect(()=>{K.current?.update({onPaneContextMenu:t,zoomOnScroll:i,zoomOnPinch:s,panOnScroll:a,panOnScrollSpeed:r,panOnScrollMode:u,zoomOnDoubleClick:c,panOnDrag:m,zoomActivationKeyPressed:ae,preventScrolling:w,noPanClassName:N,userSelectionActive:H,noWheelClassName:_,lib:j,onTransformChange:I,connectionInProgress:Y,selectionOnDrag:M,paneClickDistance:x})},[t,i,s,a,r,u,c,m,ae,w,N,H,_,j,I,Y,M,x]),z.jsx("div",{className:"react-flow__renderer",ref:L,style:Fu,children:E})}const QA=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function IA(){const{userSelectionActive:t,userSelectionRect:i}=ze(QA,Qe);return t&&i?z.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:i.width,height:i.height,transform:`translate(${i.x}px, ${i.y}px)`}}):null}const Zd=(t,i)=>s=>{s.target===i.current&&t?.(s)},JA=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging,panBy:t.panBy,autoPanSpeed:t.autoPanSpeed});function FA({isSelecting:t,selectionKeyPressed:i,selectionMode:s=mo.Full,panOnDrag:a,autoPanOnSelection:r,paneClickDistance:u,selectionOnDrag:c,onSelectionStart:m,onSelectionEnd:h,onPaneClick:g,onPaneContextMenu:v,onPaneScroll:p,onPaneMouseEnter:y,onPaneMouseMove:w,onPaneMouseLeave:E,children:_}){const N=F.useRef(0),S=Je(),{userSelectionActive:O,elementsSelectable:x,dragging:M,connectionInProgress:R,panBy:L,autoPanSpeed:H}=ze(JA,Qe),j=x&&(t||O),Y=F.useRef(null),ae=F.useRef(),K=F.useRef(new Set),I=F.useRef(new Set),oe=F.useRef(!1),B=F.useRef({x:0,y:0}),G=F.useRef(!1),T=ee=>{if(oe.current||R){oe.current=!1;return}g?.(ee),S.getState().resetSelectedElements(),S.setState({nodesSelectionActive:!1})},D=ee=>{if(Array.isArray(a)&&a?.includes(2)){ee.preventDefault();return}v?.(ee)},q=p?ee=>p(ee):void 0,X=ee=>{oe.current&&(ee.stopPropagation(),oe.current=!1)},te=ee=>{const{domNode:ce,transform:Se}=S.getState();if(ae.current=ce?.getBoundingClientRect(),!ae.current)return;const be=ee.target===Y.current;if(!be&&!!ee.target.closest(".nokey")||!t||!(c&&be||i)||ee.button!==0||!ee.isPrimary)return;ee.target?.setPointerCapture?.(ee.pointerId),oe.current=!1;const{x:Ee,y:De}=Sn(ee.nativeEvent,ae.current),Ge=Kl({x:Ee,y:De},Se);S.setState({userSelectionRect:{width:0,height:0,startX:Ge.x,startY:Ge.y,x:Ee,y:De}}),be||(ee.stopPropagation(),ee.preventDefault())};function C(ee,ce){const{userSelectionRect:Se}=S.getState();if(!Se)return;const{transform:be,nodeLookup:ge,edgeLookup:ye,connectionLookup:Ee,triggerNodeChanges:De,triggerEdgeChanges:Ge,defaultEdgeOptions:yt}=S.getState(),It={x:Se.startX,y:Se.startY},{x:Nt,y:At}=Vl(It,be),Ht={startX:It.x,startY:It.y,x:ee<Nt?ee:Nt,y:ce<At?ce:At,width:Math.abs(ee-Nt),height:Math.abs(ce-At)},Qi=K.current,Bn=I.current;K.current=new Set(jh(ge,Ht,be,s===mo.Partial,!0).map(jt=>jt.id)),I.current=new Set;const tt=yt?.selectable??!0;for(const jt of K.current){const Jt=Ee.get(jt);if(Jt)for(const{edgeId:Ft}of Jt.values()){const Wt=ye.get(Ft);Wt&&(Wt.selectable??tt)&&I.current.add(Ft)}}if(!S0(Qi,K.current)){const jt=Al(ge,K.current,!0);De(jt)}if(!S0(Bn,I.current)){const jt=Al(ye,I.current);Ge(jt)}S.setState({userSelectionRect:Ht,userSelectionActive:!0,nodesSelectionActive:!1})}function $(){if(!r||!ae.current)return;const[ee,ce]=$h(B.current,ae.current,H);L({x:ee,y:ce}).then(Se=>{if(!oe.current||!Se){N.current=requestAnimationFrame($);return}const{x:be,y:ge}=B.current;C(be,ge),N.current=requestAnimationFrame($)})}const P=()=>{cancelAnimationFrame(N.current),N.current=0,G.current=!1};F.useEffect(()=>()=>P(),[]);const ie=ee=>{const{userSelectionRect:ce,transform:Se,resetSelectedElements:be}=S.getState();if(!ae.current||!ce)return;const{x:ge,y:ye}=Sn(ee.nativeEvent,ae.current);B.current={x:ge,y:ye};const Ee=Vl({x:ce.startX,y:ce.startY},Se);if(!oe.current){const De=i?0:u;if(Math.hypot(ge-Ee.x,ye-Ee.y)<=De)return;be(),m?.(ee)}oe.current=!0,G.current||($(),G.current=!0),C(ge,ye)},re=ee=>{ee.button===0&&(ee.target?.releasePointerCapture?.(ee.pointerId),!O&&ee.target===Y.current&&S.getState().userSelectionRect&&T?.(ee),S.setState({userSelectionActive:!1,userSelectionRect:null}),oe.current&&(h?.(ee),S.setState({nodesSelectionActive:K.current.size>0})),P())},de=ee=>{ee.target?.releasePointerCapture?.(ee.pointerId),P()},ue=a===!0||Array.isArray(a)&&a.includes(0);return z.jsxs("div",{className:ut(["react-flow__pane",{draggable:ue,dragging:M,selection:t}]),onClick:j?void 0:Zd(T,Y),onContextMenu:Zd(D,Y),onWheel:Zd(q,Y),onPointerEnter:j?void 0:y,onPointerMove:j?ie:w,onPointerUp:j?re:void 0,onPointerCancel:j?de:void 0,onPointerDownCapture:j?te:void 0,onClickCapture:j?X:void 0,onPointerLeave:E,ref:Y,style:Fu,children:[_,z.jsx(IA,{})]})}function bh({id:t,store:i,unselect:s=!1,nodeRef:a}){const{addSelectedNodes:r,unselectNodesAndEdges:u,multiSelectionActive:c,nodeLookup:m,onError:h}=i.getState(),g=m.get(t);if(!g){h?.("012",wn.error012(t));return}i.setState({nodesSelectionActive:!1}),g.selected?(s||g.selected&&c)&&(u({nodes:[g],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):r([t])}function $1({nodeRef:t,disabled:i=!1,noDragClassName:s,handleSelector:a,nodeId:r,isSelectable:u,nodeClickDistance:c}){const m=Je(),[h,g]=F.useState(!1),v=F.useRef();return F.useEffect(()=>{v.current=BN({getStoreItems:()=>m.getState(),onNodeMouseDown:p=>{bh({id:p,store:m,nodeRef:t})},onDragStart:()=>{g(!0)},onDragStop:()=>{g(!1)}})},[]),F.useEffect(()=>{if(!(i||!t.current||!v.current))return v.current.update({noDragClassName:s,handleSelector:a,domNode:t.current,isSelectable:u,nodeId:r,nodeClickDistance:c}),()=>{v.current?.destroy()}},[s,a,i,u,t,r,c]),h}const WA=t=>i=>i.selected&&(i.draggable||t&&typeof i.draggable>"u");function U1(){const t=Je();return F.useCallback(s=>{const{nodeExtent:a,snapToGrid:r,snapGrid:u,nodesDraggable:c,onError:m,updateNodePositions:h,nodeLookup:g,nodeOrigin:v}=t.getState(),p=new Map,y=WA(c),w=r?u[0]:5,E=r?u[1]:5,_=s.direction.x*w*s.factor,N=s.direction.y*E*s.factor;for(const[,S]of g){if(!y(S))continue;let O={x:S.internals.positionAbsolute.x+_,y:S.internals.positionAbsolute.y+N};r&&(O=To(O,u));const{position:x,positionAbsolute:M}=o1({nodeId:S.id,nextPosition:O,nodeLookup:g,nodeExtent:a,nodeOrigin:v,onError:m});S.position=x,S.internals.positionAbsolute=M,p.set(S.id,S)}h(p)},[])}const Zh=F.createContext(null),PA=Zh.Provider;Zh.Consumer;const q1=()=>F.useContext(Zh),eT=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),tT=(t,i,s)=>a=>{const{connectionClickStartHandle:r,connectionMode:u,connection:c}=a,{fromHandle:m,toHandle:h,isValid:g}=c,v=h?.nodeId===t&&h?.id===i&&h?.type===s;return{connectingFrom:m?.nodeId===t&&m?.id===i&&m?.type===s,connectingTo:v,clickConnecting:r?.nodeId===t&&r?.id===i&&r?.type===s,isPossibleEndHandle:u===$l.Strict?m?.type!==s:t!==m?.nodeId||i!==m?.id,connectionInProcess:!!m,clickConnectionInProcess:!!r,valid:v&&g}};function nT({type:t="source",position:i=fe.Top,isValidConnection:s,isConnectable:a=!0,isConnectableStart:r=!0,isConnectableEnd:u=!0,id:c,onConnect:m,children:h,className:g,onMouseDown:v,onTouchStart:p,...y},w){const E=c||null,_=t==="target",N=Je(),S=q1(),{connectOnClick:O,noPanClassName:x,rfId:M}=ze(eT,Qe),{connectingFrom:R,connectingTo:L,clickConnecting:H,isPossibleEndHandle:j,connectionInProcess:Y,clickConnectionInProcess:ae,valid:K}=ze(tT(S,E,t),Qe);S||N.getState().onError?.("010",wn.error010());const I=G=>{const{defaultEdgeOptions:T,onConnect:D,hasDefaultEdges:q}=N.getState(),X={...T,...G};if(q){const{edges:te,setEdges:C,onError:$}=N.getState();C(kA(X,te,{onError:$}))}D?.(X),m?.(X)},oe=G=>{if(!S)return;const T=g1(G.nativeEvent);if(r&&(T&&G.button===0||!T)){const D=N.getState();vh.onPointerDown(G.nativeEvent,{handleDomNode:G.currentTarget,autoPanOnConnect:D.autoPanOnConnect,connectionMode:D.connectionMode,connectionRadius:D.connectionRadius,domNode:D.domNode,nodeLookup:D.nodeLookup,lib:D.lib,isTarget:_,handleId:E,nodeId:S,flowId:D.rfId,panBy:D.panBy,cancelConnection:D.cancelConnection,onConnectStart:D.onConnectStart,onConnectEnd:(...q)=>N.getState().onConnectEnd?.(...q),updateConnection:D.updateConnection,onConnect:I,isValidConnection:s||((...q)=>N.getState().isValidConnection?.(...q)??!0),getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:D.autoPanSpeed,dragThreshold:D.connectionDragThreshold})}T?v?.(G):p?.(G)},B=G=>{const{onClickConnectStart:T,onClickConnectEnd:D,connectionClickStartHandle:q,connectionMode:X,isValidConnection:te,lib:C,rfId:$,nodeLookup:P,connection:ie}=N.getState();if(!S||!q&&!r)return;if(!q){T?.(G.nativeEvent,{nodeId:S,handleId:E,handleType:t}),N.setState({connectionClickStartHandle:{nodeId:S,type:t,id:E}});return}const re=h1(G.target),de=s||te,{connection:ue,isValid:ee}=vh.isValid(G.nativeEvent,{handle:{nodeId:S,id:E,type:t},connectionMode:X,fromNodeId:q.nodeId,fromHandleId:q.id||null,fromType:q.type,isValidConnection:de,flowId:$,doc:re,lib:C,nodeLookup:P});ee&&ue&&I(ue);const ce=structuredClone(ie);delete ce.inProgress,ce.toPosition=ce.toHandle?ce.toHandle.position:null,D?.(G,ce),N.setState({connectionClickStartHandle:null})};return z.jsx("div",{"data-handleid":E,"data-nodeid":S,"data-handlepos":i,"data-id":`${M}-${S}-${E}-${t}`,className:ut(["react-flow__handle",`react-flow__handle-${i}`,"nodrag",x,g,{source:!_,target:_,connectable:a,connectablestart:r,connectableend:u,clickconnecting:H,connectingfrom:R,connectingto:L,valid:K,connectionindicator:a&&(!Y||j)&&(Y||ae?u:r)}]),onMouseDown:oe,onTouchStart:oe,onClick:O?B:void 0,ref:w,...y,children:h})}const rn=F.memo(H1(nT));function iT({data:t,isConnectable:i,sourcePosition:s=fe.Bottom}){return z.jsxs(z.Fragment,{children:[t?.label,z.jsx(rn,{type:"source",position:s,isConnectable:i})]})}function sT({data:t,isConnectable:i,targetPosition:s=fe.Top,sourcePosition:a=fe.Bottom}){return z.jsxs(z.Fragment,{children:[z.jsx(rn,{type:"target",position:s,isConnectable:i}),t?.label,z.jsx(rn,{type:"source",position:a,isConnectable:i})]})}function lT(){return null}function aT({data:t,isConnectable:i,targetPosition:s=fe.Top}){return z.jsxs(z.Fragment,{children:[z.jsx(rn,{type:"target",position:s,isConnectable:i}),t?.label]})}const Lu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},J0={input:iT,default:sT,output:aT,group:lT};function oT(t){return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??t.style?.width,height:t.height??t.initialHeight??t.style?.height}:{width:t.width??t.style?.width,height:t.height??t.style?.height}}const rT=t=>{const{width:i,height:s,x:a,y:r}=Ao(t.nodeLookup,{filter:u=>!!u.selected});return{width:bn(i)?i:null,height:bn(s)?s:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${a}px,${r}px)`}};function uT({onSelectionContextMenu:t,noPanClassName:i,disableKeyboardA11y:s}){const a=Je(),{width:r,height:u,transformString:c,userSelectionActive:m}=ze(rT,Qe),h=U1(),g=F.useRef(null);F.useEffect(()=>{s||g.current?.focus({preventScroll:!0})},[s]);const v=!m&&r!==null&&u!==null;if($1({nodeRef:g,disabled:!v}),!v)return null;const p=t?w=>{const E=a.getState().nodes.filter(_=>_.selected);t(w,E)}:void 0,y=w=>{Object.prototype.hasOwnProperty.call(Lu,w.key)&&(w.preventDefault(),h({direction:Lu[w.key],factor:w.shiftKey?4:1}))};return z.jsx("div",{className:ut(["react-flow__nodesselection","react-flow__container",i]),style:{transform:c},children:z.jsx("div",{ref:g,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:s?void 0:-1,onKeyDown:s?void 0:y,style:{width:r,height:u}})})}const F0=typeof window<"u"?window:void 0,cT=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function V1({children:t,onPaneClick:i,onPaneMouseEnter:s,onPaneMouseMove:a,onPaneMouseLeave:r,onPaneContextMenu:u,onPaneScroll:c,paneClickDistance:m,deleteKeyCode:h,selectionKeyCode:g,selectionOnDrag:v,selectionMode:p,onSelectionStart:y,onSelectionEnd:w,multiSelectionKeyCode:E,panActivationKeyCode:_,zoomActivationKeyCode:N,elementsSelectable:S,zoomOnScroll:O,zoomOnPinch:x,panOnScroll:M,panOnScrollSpeed:R,panOnScrollMode:L,zoomOnDoubleClick:H,panOnDrag:j,autoPanOnSelection:Y,defaultViewport:ae,translateExtent:K,minZoom:I,maxZoom:oe,preventScrolling:B,onSelectionContextMenu:G,noWheelClassName:T,noPanClassName:D,disableKeyboardA11y:q,onViewportChange:X,isControlledViewport:te}){const{nodesSelectionActive:C,userSelectionActive:$}=ze(cT,Qe),P=vo(g,{target:F0}),ie=vo(_,{target:F0}),re=ie||j,de=ie||M,ue=v&&re!==!0,ee=P||$||ue;return GA({deleteKeyCode:h,multiSelectionKeyCode:E}),z.jsx(ZA,{onPaneContextMenu:u,elementsSelectable:S,zoomOnScroll:O,zoomOnPinch:x,panOnScroll:de,panOnScrollSpeed:R,panOnScrollMode:L,zoomOnDoubleClick:H,panOnDrag:!P&&re,defaultViewport:ae,translateExtent:K,minZoom:I,maxZoom:oe,zoomActivationKeyCode:N,preventScrolling:B,noWheelClassName:T,noPanClassName:D,onViewportChange:X,isControlledViewport:te,paneClickDistance:m,selectionOnDrag:ue,children:z.jsxs(FA,{onSelectionStart:y,onSelectionEnd:w,onPaneClick:i,onPaneMouseEnter:s,onPaneMouseMove:a,onPaneMouseLeave:r,onPaneContextMenu:u,onPaneScroll:c,panOnDrag:re,autoPanOnSelection:Y,isSelecting:!!ee,selectionMode:p,selectionKeyPressed:P,paneClickDistance:m,selectionOnDrag:ue,children:[t,C&&z.jsx(uT,{onSelectionContextMenu:G,noPanClassName:D,disableKeyboardA11y:q})]})})}V1.displayName="FlowRenderer";const fT=F.memo(V1),dT=t=>i=>t?jh(i.nodeLookup,{x:0,y:0,width:i.width,height:i.height},i.transform,!0).map(s=>s.id):Array.from(i.nodeLookup.keys());function hT(t){return ze(F.useCallback(dT(t),[t]),Qe)}const mT=t=>t.updateNodeInternals;function gT(){const t=ze(mT),[i]=F.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(s=>{const a=new Map;s.forEach(r=>{const u=r.target.getAttribute("data-id");a.set(u,{id:u,nodeElement:r.target,force:!0})}),t(a)}));return F.useEffect(()=>()=>{i?.disconnect()},[i]),i}function pT({node:t,nodeType:i,hasDimensions:s,resizeObserver:a}){const r=Je(),u=F.useRef(null),c=F.useRef(null),m=F.useRef(t.sourcePosition),h=F.useRef(t.targetPosition),g=F.useRef(i),v=s&&!!t.internals.handleBounds;return F.useEffect(()=>{u.current&&!t.hidden&&(!v||c.current!==u.current)&&(c.current&&a?.unobserve(c.current),a?.observe(u.current),c.current=u.current)},[v,t.hidden]),F.useEffect(()=>()=>{c.current&&(a?.unobserve(c.current),c.current=null)},[]),F.useEffect(()=>{if(u.current){const p=g.current!==i,y=m.current!==t.sourcePosition,w=h.current!==t.targetPosition;(p||y||w)&&(g.current=i,m.current=t.sourcePosition,h.current=t.targetPosition,r.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:u.current,force:!0}]])))}},[t.id,i,t.sourcePosition,t.targetPosition]),u}function yT({id:t,onClick:i,onMouseEnter:s,onMouseMove:a,onMouseLeave:r,onContextMenu:u,onDoubleClick:c,nodesDraggable:m,elementsSelectable:h,nodesConnectable:g,nodesFocusable:v,resizeObserver:p,noDragClassName:y,noPanClassName:w,disableKeyboardA11y:E,rfId:_,nodeTypes:N,nodeClickDistance:S,onError:O}){const{node:x,internals:M,isParent:R}=ze(ee=>{const ce=ee.nodeLookup.get(t),Se=ee.parentLookup.has(t);return{node:ce,internals:ce.internals,isParent:Se}},Qe);let L=x.type||"default",H=N?.[L]||J0[L];H===void 0&&(O?.("003",wn.error003(L)),L="default",H=N?.default||J0.default);const j=!!(x.draggable||m&&typeof x.draggable>"u"),Y=!!(x.selectable||h&&typeof x.selectable>"u"),ae=!!(x.connectable||g&&typeof x.connectable>"u"),K=!!(x.focusable||v&&typeof x.focusable>"u"),I=Je(),oe=f1(x),B=pT({node:x,nodeType:L,hasDimensions:oe,resizeObserver:p}),G=$1({nodeRef:B,disabled:x.hidden||!j,noDragClassName:y,handleSelector:x.dragHandle,nodeId:t,isSelectable:Y,nodeClickDistance:S}),T=U1();if(x.hidden)return null;const D=ri(x),q=oT(x),X=Y||j||i||s||a||r,te=s?ee=>s(ee,{...M.userNode}):void 0,C=a?ee=>a(ee,{...M.userNode}):void 0,$=r?ee=>r(ee,{...M.userNode}):void 0,P=u?ee=>u(ee,{...M.userNode}):void 0,ie=c?ee=>c(ee,{...M.userNode}):void 0,re=ee=>{const{selectNodesOnDrag:ce,nodeDragThreshold:Se}=I.getState();Y&&(!ce||!j||Se>0)&&bh({id:t,store:I,nodeRef:B}),i&&i(ee,{...M.userNode})},de=ee=>{if(!(m1(ee.nativeEvent)||E)){if(n1.includes(ee.key)&&Y){const ce=ee.key==="Escape";bh({id:t,store:I,unselect:ce,nodeRef:B})}else if(j&&x.selected&&Object.prototype.hasOwnProperty.call(Lu,ee.key)){ee.preventDefault();const{ariaLabelConfig:ce}=I.getState();I.setState({ariaLiveMessage:ce["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~M.positionAbsolute.x,y:~~M.positionAbsolute.y})}),T({direction:Lu[ee.key],factor:ee.shiftKey?4:1})}}},ue=()=>{if(E||!B.current?.matches(":focus-visible"))return;const{transform:ee,width:ce,height:Se,autoPanOnNodeFocus:be,setCenter:ge}=I.getState();if(!be)return;jh(new Map([[t,x]]),{x:0,y:0,width:ce,height:Se},ee,!0).length>0||ge(x.position.x+D.width/2,x.position.y+D.height/2,{zoom:ee[2]})};return z.jsx("div",{className:ut(["react-flow__node",`react-flow__node-${L}`,{[w]:j},x.className,{selected:x.selected,selectable:Y,parent:R,draggable:j,dragging:G}]),ref:B,style:{zIndex:M.z,transform:`translate(${M.positionAbsolute.x}px,${M.positionAbsolute.y}px)`,pointerEvents:X?"all":"none",visibility:oe?"visible":"hidden",...x.style,...q},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:te,onMouseMove:C,onMouseLeave:$,onContextMenu:P,onClick:re,onDoubleClick:ie,onKeyDown:K?de:void 0,tabIndex:K?0:void 0,onFocus:K?ue:void 0,role:x.ariaRole??(K?"group":void 0),"aria-roledescription":"node","aria-describedby":E?void 0:`${L1}-${_}`,"aria-label":x.ariaLabel,...x.domAttributes,children:z.jsx(PA,{value:t,children:z.jsx(H,{id:t,data:x.data,type:L,positionAbsoluteX:M.positionAbsolute.x,positionAbsoluteY:M.positionAbsolute.y,selected:x.selected??!1,selectable:Y,draggable:j,deletable:x.deletable??!0,isConnectable:ae,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:G,dragHandle:x.dragHandle,zIndex:M.z,parentId:x.parentId,...D})})})}var vT=F.memo(yT);const bT=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function Y1(t){const{nodesDraggable:i,nodesConnectable:s,nodesFocusable:a,elementsSelectable:r,onError:u}=ze(bT,Qe),c=hT(t.onlyRenderVisibleElements),m=gT();return z.jsx("div",{className:"react-flow__nodes",style:Fu,children:c.map(h=>z.jsx(vT,{id:h,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:m,nodesDraggable:i,nodesConnectable:s,nodesFocusable:a,elementsSelectable:r,nodeClickDistance:t.nodeClickDistance,onError:u},h))})}Y1.displayName="NodeRenderer";const ST=F.memo(Y1);function wT(t){return ze(F.useCallback(s=>{if(!t)return s.edges.map(r=>r.id);const a=[];if(s.width&&s.height)for(const r of s.edges){const u=s.nodeLookup.get(r.source),c=s.nodeLookup.get(r.target);u&&c&&pN({sourceNode:u,targetNode:c,width:s.width,height:s.height,transform:s.transform})&&a.push(r.id)}return a},[t]),Qe)}const xT=({color:t="none",strokeWidth:i=1})=>{const s={strokeWidth:i,...t&&{stroke:t}};return z.jsx("polyline",{className:"arrow",style:s,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},ET=({color:t="none",strokeWidth:i=1})=>{const s={strokeWidth:i,...t&&{stroke:t,fill:t}};return z.jsx("polyline",{className:"arrowclosed",style:s,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},W0={[go.Arrow]:xT,[go.ArrowClosed]:ET};function _T(t){const i=Je();return F.useMemo(()=>Object.prototype.hasOwnProperty.call(W0,t)?W0[t]:(i.getState().onError?.("009",wn.error009(t)),null),[t])}const NT=({id:t,type:i,color:s,width:a=12.5,height:r=12.5,markerUnits:u="strokeWidth",strokeWidth:c,orient:m="auto-start-reverse"})=>{const h=_T(i);return h?z.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${a}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:u,orient:m,refX:"0",refY:"0",children:z.jsx(h,{color:s,strokeWidth:c})}):null},G1=({defaultColor:t,rfId:i})=>{const s=ze(u=>u.edges),a=ze(u=>u.defaultEdgeOptions),r=F.useMemo(()=>_N(s,{id:i,defaultColor:t,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[s,a,i,t]);return r.length?z.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:z.jsx("defs",{children:r.map(u=>z.jsx(NT,{id:u.id,type:u.type,color:u.color,width:u.width,height:u.height,markerUnits:u.markerUnits,strokeWidth:u.strokeWidth,orient:u.orient},u.id))})}):null};G1.displayName="MarkerDefinitions";var AT=F.memo(G1);function X1({x:t,y:i,label:s,labelStyle:a,labelShowBg:r=!0,labelBgStyle:u,labelBgPadding:c=[2,4],labelBgBorderRadius:m=2,children:h,className:g,...v}){const[p,y]=F.useState({x:1,y:0,width:0,height:0}),w=ut(["react-flow__edge-textwrapper",g]),E=F.useRef(null);return F.useEffect(()=>{if(E.current){const _=E.current.getBBox();y({x:_.x,y:_.y,width:_.width,height:_.height})}},[s]),s?z.jsxs("g",{transform:`translate(${t-p.width/2} ${i-p.height/2})`,className:w,visibility:p.width?"visible":"hidden",...v,children:[r&&z.jsx("rect",{width:p.width+2*c[0],x:-c[0],y:-c[1],height:p.height+2*c[1],className:"react-flow__edge-textbg",style:u,rx:m,ry:m}),z.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:E,style:a,children:s}),h]}):null}X1.displayName="EdgeText";const TT=F.memo(X1);function Mo({path:t,labelX:i,labelY:s,label:a,labelStyle:r,labelShowBg:u,labelBgStyle:c,labelBgPadding:m,labelBgBorderRadius:h,interactionWidth:g=20,...v}){return z.jsxs(z.Fragment,{children:[z.jsx("path",{...v,d:t,fill:"none",className:ut(["react-flow__edge-path",v.className])}),g?z.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:g,className:"react-flow__edge-interaction"}):null,a&&bn(i)&&bn(s)?z.jsx(TT,{x:i,y:s,label:a,labelStyle:r,labelShowBg:u,labelBgStyle:c,labelBgPadding:m,labelBgBorderRadius:h}):null]})}function P0({pos:t,x1:i,y1:s,x2:a,y2:r}){return t===fe.Left||t===fe.Right?[.5*(i+a),s]:[i,.5*(s+r)]}function K1({sourceX:t,sourceY:i,sourcePosition:s=fe.Bottom,targetX:a,targetY:r,targetPosition:u=fe.Top}){const[c,m]=P0({pos:s,x1:t,y1:i,x2:a,y2:r}),[h,g]=P0({pos:u,x1:a,y1:r,x2:t,y2:i}),[v,p,y,w]=p1({sourceX:t,sourceY:i,targetX:a,targetY:r,sourceControlX:c,sourceControlY:m,targetControlX:h,targetControlY:g});return[`M${t},${i} C${c},${m} ${h},${g} ${a},${r}`,v,p,y,w]}function Z1(t){return F.memo(({id:i,sourceX:s,sourceY:a,targetX:r,targetY:u,sourcePosition:c,targetPosition:m,label:h,labelStyle:g,labelShowBg:v,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:w,style:E,markerEnd:_,markerStart:N,interactionWidth:S})=>{const[O,x,M]=K1({sourceX:s,sourceY:a,sourcePosition:c,targetX:r,targetY:u,targetPosition:m}),R=t.isInternal?void 0:i;return z.jsx(Mo,{id:R,path:O,labelX:x,labelY:M,label:h,labelStyle:g,labelShowBg:v,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:w,style:E,markerEnd:_,markerStart:N,interactionWidth:S})})}const MT=Z1({isInternal:!1}),Q1=Z1({isInternal:!0});MT.displayName="SimpleBezierEdge";Q1.displayName="SimpleBezierEdgeInternal";function I1(t){return F.memo(({id:i,sourceX:s,sourceY:a,targetX:r,targetY:u,label:c,labelStyle:m,labelShowBg:h,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:p,style:y,sourcePosition:w=fe.Bottom,targetPosition:E=fe.Top,markerEnd:_,markerStart:N,pathOptions:S,interactionWidth:O})=>{const[x,M,R]=gh({sourceX:s,sourceY:a,sourcePosition:w,targetX:r,targetY:u,targetPosition:E,borderRadius:S?.borderRadius,offset:S?.offset,stepPosition:S?.stepPosition}),L=t.isInternal?void 0:i;return z.jsx(Mo,{id:L,path:x,labelX:M,labelY:R,label:c,labelStyle:m,labelShowBg:h,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:p,style:y,markerEnd:_,markerStart:N,interactionWidth:O})})}const J1=I1({isInternal:!1}),F1=I1({isInternal:!0});J1.displayName="SmoothStepEdge";F1.displayName="SmoothStepEdgeInternal";function W1(t){return F.memo(({id:i,...s})=>{const a=t.isInternal?void 0:i;return z.jsx(J1,{...s,id:a,pathOptions:F.useMemo(()=>({borderRadius:0,offset:s.pathOptions?.offset}),[s.pathOptions?.offset])})})}const CT=W1({isInternal:!1}),P1=W1({isInternal:!0});CT.displayName="StepEdge";P1.displayName="StepEdgeInternal";function eb(t){return F.memo(({id:i,sourceX:s,sourceY:a,targetX:r,targetY:u,label:c,labelStyle:m,labelShowBg:h,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:p,style:y,markerEnd:w,markerStart:E,interactionWidth:_})=>{const[N,S,O]=b1({sourceX:s,sourceY:a,targetX:r,targetY:u}),x=t.isInternal?void 0:i;return z.jsx(Mo,{id:x,path:N,labelX:S,labelY:O,label:c,labelStyle:m,labelShowBg:h,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:p,style:y,markerEnd:w,markerStart:E,interactionWidth:_})})}const OT=eb({isInternal:!1}),tb=eb({isInternal:!0});OT.displayName="StraightEdge";tb.displayName="StraightEdgeInternal";function nb(t){return F.memo(({id:i,sourceX:s,sourceY:a,targetX:r,targetY:u,sourcePosition:c=fe.Bottom,targetPosition:m=fe.Top,label:h,labelStyle:g,labelShowBg:v,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:w,style:E,markerEnd:_,markerStart:N,pathOptions:S,interactionWidth:O})=>{const[x,M,R]=y1({sourceX:s,sourceY:a,sourcePosition:c,targetX:r,targetY:u,targetPosition:m,curvature:S?.curvature}),L=t.isInternal?void 0:i;return z.jsx(Mo,{id:L,path:x,labelX:M,labelY:R,label:h,labelStyle:g,labelShowBg:v,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:w,style:E,markerEnd:_,markerStart:N,interactionWidth:O})})}const zT=nb({isInternal:!1}),ib=nb({isInternal:!0});zT.displayName="BezierEdge";ib.displayName="BezierEdgeInternal";const ev={default:ib,straight:tb,step:P1,smoothstep:F1,simplebezier:Q1},tv={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},DT=(t,i,s)=>s===fe.Left?t-i:s===fe.Right?t+i:t,LT=(t,i,s)=>s===fe.Top?t-i:s===fe.Bottom?t+i:t,nv="react-flow__edgeupdater";function iv({position:t,centerX:i,centerY:s,radius:a=10,onMouseDown:r,onMouseEnter:u,onMouseOut:c,type:m}){return z.jsx("circle",{onMouseDown:r,onMouseEnter:u,onMouseOut:c,className:ut([nv,`${nv}-${m}`]),cx:DT(i,a,t),cy:LT(s,a,t),r:a,stroke:"transparent",fill:"transparent"})}function RT({isReconnectable:t,reconnectRadius:i,edge:s,sourceX:a,sourceY:r,targetX:u,targetY:c,sourcePosition:m,targetPosition:h,onReconnect:g,onReconnectStart:v,onReconnectEnd:p,setReconnecting:y,setUpdateHover:w}){const E=Je(),_=(M,R)=>{if(M.button!==0)return;const{autoPanOnConnect:L,domNode:H,connectionMode:j,connectionRadius:Y,lib:ae,onConnectStart:K,cancelConnection:I,nodeLookup:oe,rfId:B,panBy:G,updateConnection:T}=E.getState(),D=R.type==="target",q=(C,$)=>{y(!1),p?.(C,s,R.type,$)},X=C=>g?.(s,C),te=(C,$)=>{y(!0),v?.(M,s,R.type),K?.(C,$)};vh.onPointerDown(M.nativeEvent,{autoPanOnConnect:L,connectionMode:j,connectionRadius:Y,domNode:H,handleId:R.id,nodeId:R.nodeId,nodeLookup:oe,isTarget:D,edgeUpdaterType:R.type,lib:ae,flowId:B,cancelConnection:I,panBy:G,isValidConnection:(...C)=>E.getState().isValidConnection?.(...C)??!0,onConnect:X,onConnectStart:te,onConnectEnd:(...C)=>E.getState().onConnectEnd?.(...C),onReconnectEnd:q,updateConnection:T,getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,dragThreshold:E.getState().connectionDragThreshold,handleDomNode:M.currentTarget})},N=M=>_(M,{nodeId:s.target,id:s.targetHandle??null,type:"target"}),S=M=>_(M,{nodeId:s.source,id:s.sourceHandle??null,type:"source"}),O=()=>w(!0),x=()=>w(!1);return z.jsxs(z.Fragment,{children:[(t===!0||t==="source")&&z.jsx(iv,{position:m,centerX:a,centerY:r,radius:i,onMouseDown:N,onMouseEnter:O,onMouseOut:x,type:"source"}),(t===!0||t==="target")&&z.jsx(iv,{position:h,centerX:u,centerY:c,radius:i,onMouseDown:S,onMouseEnter:O,onMouseOut:x,type:"target"})]})}function BT({id:t,edgesFocusable:i,edgesReconnectable:s,elementsSelectable:a,onClick:r,onDoubleClick:u,onContextMenu:c,onMouseEnter:m,onMouseMove:h,onMouseLeave:g,reconnectRadius:v,onReconnect:p,onReconnectStart:y,onReconnectEnd:w,rfId:E,edgeTypes:_,noPanClassName:N,onError:S,disableKeyboardA11y:O}){let x=ze(ge=>ge.edgeLookup.get(t));const M=ze(ge=>ge.defaultEdgeOptions);x=M?{...M,...x}:x;let R=x.type||"default",L=_?.[R]||ev[R];L===void 0&&(S?.("011",wn.error011(R)),R="default",L=_?.default||ev.default);const H=!!(x.focusable||i&&typeof x.focusable>"u"),j=typeof p<"u"&&(x.reconnectable||s&&typeof x.reconnectable>"u"),Y=!!(x.selectable||a&&typeof x.selectable>"u"),ae=F.useRef(null),[K,I]=F.useState(!1),[oe,B]=F.useState(!1),G=Je(),{zIndex:T,sourceX:D,sourceY:q,targetX:X,targetY:te,sourcePosition:C,targetPosition:$}=ze(F.useCallback(ge=>{const ye=ge.nodeLookup.get(x.source),Ee=ge.nodeLookup.get(x.target);if(!ye||!Ee)return{zIndex:x.zIndex,...tv};const De=EN({id:t,sourceNode:ye,targetNode:Ee,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:ge.connectionMode,onError:S});return{zIndex:gN({selected:x.selected,zIndex:x.zIndex,sourceNode:ye,targetNode:Ee,elevateOnSelect:ge.elevateEdgesOnSelect,zIndexMode:ge.zIndexMode}),...De||tv}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),Qe),P=F.useMemo(()=>x.markerStart?`url('#${ph(x.markerStart,E)}')`:void 0,[x.markerStart,E]),ie=F.useMemo(()=>x.markerEnd?`url('#${ph(x.markerEnd,E)}')`:void 0,[x.markerEnd,E]);if(x.hidden||D===null||q===null||X===null||te===null)return null;const re=ge=>{const{addSelectedEdges:ye,unselectNodesAndEdges:Ee,multiSelectionActive:De}=G.getState();Y&&(G.setState({nodesSelectionActive:!1}),x.selected&&De?(Ee({nodes:[],edges:[x]}),ae.current?.blur()):ye([t])),r&&r(ge,x)},de=u?ge=>{u(ge,{...x})}:void 0,ue=c?ge=>{c(ge,{...x})}:void 0,ee=m?ge=>{m(ge,{...x})}:void 0,ce=h?ge=>{h(ge,{...x})}:void 0,Se=g?ge=>{g(ge,{...x})}:void 0,be=ge=>{if(!O&&n1.includes(ge.key)&&Y){const{unselectNodesAndEdges:ye,addSelectedEdges:Ee}=G.getState();ge.key==="Escape"?(ae.current?.blur(),ye({edges:[x]})):Ee([t])}};return z.jsx("svg",{style:{zIndex:T},children:z.jsxs("g",{className:ut(["react-flow__edge",`react-flow__edge-${R}`,x.className,N,{selected:x.selected,animated:x.animated,inactive:!Y&&!r,updating:K,selectable:Y}]),onClick:re,onDoubleClick:de,onContextMenu:ue,onMouseEnter:ee,onMouseMove:ce,onMouseLeave:Se,onKeyDown:H?be:void 0,tabIndex:H?0:void 0,role:x.ariaRole??(H?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":H?`${R1}-${E}`:void 0,ref:ae,...x.domAttributes,children:[!oe&&z.jsx(L,{id:t,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:Y,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:D,sourceY:q,targetX:X,targetY:te,sourcePosition:C,targetPosition:$,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:P,markerEnd:ie,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),j&&z.jsx(RT,{edge:x,isReconnectable:j,reconnectRadius:v,onReconnect:p,onReconnectStart:y,onReconnectEnd:w,sourceX:D,sourceY:q,targetX:X,targetY:te,sourcePosition:C,targetPosition:$,setUpdateHover:I,setReconnecting:B})]})})}var kT=F.memo(BT);const HT=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function sb({defaultMarkerColor:t,onlyRenderVisibleElements:i,rfId:s,edgeTypes:a,noPanClassName:r,onReconnect:u,onEdgeContextMenu:c,onEdgeMouseEnter:m,onEdgeMouseMove:h,onEdgeMouseLeave:g,onEdgeClick:v,reconnectRadius:p,onEdgeDoubleClick:y,onReconnectStart:w,onReconnectEnd:E,disableKeyboardA11y:_}){const{edgesFocusable:N,edgesReconnectable:S,elementsSelectable:O,onError:x}=ze(HT,Qe),M=wT(i);return z.jsxs("div",{className:"react-flow__edges",children:[z.jsx(AT,{defaultColor:t,rfId:s}),M.map(R=>z.jsx(kT,{id:R,edgesFocusable:N,edgesReconnectable:S,elementsSelectable:O,noPanClassName:r,onReconnect:u,onContextMenu:c,onMouseEnter:m,onMouseMove:h,onMouseLeave:g,onClick:v,reconnectRadius:p,onDoubleClick:y,onReconnectStart:w,onReconnectEnd:E,rfId:s,onError:x,edgeTypes:a,disableKeyboardA11y:_},R))]})}sb.displayName="EdgeRenderer";const jT=F.memo(sb),$T=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function UT({children:t}){const i=ze($T);return z.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:i},children:t})}function qT(t){const i=Ju(),s=F.useRef(!1);F.useEffect(()=>{!s.current&&i.viewportInitialized&&t&&(setTimeout(()=>t(i),1),s.current=!0)},[t,i.viewportInitialized])}const VT=t=>t.panZoom?.syncViewport;function YT(t){const i=ze(VT),s=Je();return F.useEffect(()=>{t&&(i?.(t),s.setState({transform:[t.x,t.y,t.zoom]}))},[t,i]),null}function GT(t){return t.connection.inProgress?{...t.connection,to:Kl(t.connection.to,t.transform)}:{...t.connection}}function XT(t){return GT}function KT(t){const i=XT();return ze(i,Qe)}const ZT=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function QT({containerStyle:t,style:i,type:s,component:a}){const{nodesConnectable:r,width:u,height:c,isValid:m,inProgress:h}=ze(ZT,Qe);return!(u&&r&&h)?null:z.jsx("svg",{style:t,width:u,height:c,className:"react-flow__connectionline react-flow__container",children:z.jsx("g",{className:ut(["react-flow__connection",l1(m)]),children:z.jsx(lb,{style:i,type:s,CustomComponent:a,isValid:m})})})}const lb=({style:t,type:i=Yi.Bezier,CustomComponent:s,isValid:a})=>{const{inProgress:r,from:u,fromNode:c,fromHandle:m,fromPosition:h,to:g,toNode:v,toHandle:p,toPosition:y,pointer:w}=KT();if(!r)return;if(s)return z.jsx(s,{connectionLineType:i,connectionLineStyle:t,fromNode:c,fromHandle:m,fromX:u.x,fromY:u.y,toX:g.x,toY:g.y,fromPosition:h,toPosition:y,connectionStatus:l1(a),toNode:v,toHandle:p,pointer:w});let E="";const _={sourceX:u.x,sourceY:u.y,sourcePosition:h,targetX:g.x,targetY:g.y,targetPosition:y};switch(i){case Yi.Bezier:[E]=y1(_);break;case Yi.SimpleBezier:[E]=K1(_);break;case Yi.Step:[E]=gh({..._,borderRadius:0});break;case Yi.SmoothStep:[E]=gh(_);break;default:[E]=b1(_)}return z.jsx("path",{d:E,fill:"none",className:"react-flow__connection-path",style:t})};lb.displayName="ConnectionLine";const IT={};function sv(t=IT){F.useRef(t),Je(),F.useEffect(()=>{},[t])}function JT(){Je(),F.useRef(!1),F.useEffect(()=>{},[])}function ab({nodeTypes:t,edgeTypes:i,onInit:s,onNodeClick:a,onEdgeClick:r,onNodeDoubleClick:u,onEdgeDoubleClick:c,onNodeMouseEnter:m,onNodeMouseMove:h,onNodeMouseLeave:g,onNodeContextMenu:v,onSelectionContextMenu:p,onSelectionStart:y,onSelectionEnd:w,connectionLineType:E,connectionLineStyle:_,connectionLineComponent:N,connectionLineContainerStyle:S,selectionKeyCode:O,selectionOnDrag:x,selectionMode:M,multiSelectionKeyCode:R,panActivationKeyCode:L,zoomActivationKeyCode:H,deleteKeyCode:j,onlyRenderVisibleElements:Y,elementsSelectable:ae,defaultViewport:K,translateExtent:I,minZoom:oe,maxZoom:B,preventScrolling:G,defaultMarkerColor:T,zoomOnScroll:D,zoomOnPinch:q,panOnScroll:X,panOnScrollSpeed:te,panOnScrollMode:C,zoomOnDoubleClick:$,panOnDrag:P,autoPanOnSelection:ie,onPaneClick:re,onPaneMouseEnter:de,onPaneMouseMove:ue,onPaneMouseLeave:ee,onPaneScroll:ce,onPaneContextMenu:Se,paneClickDistance:be,nodeClickDistance:ge,onEdgeContextMenu:ye,onEdgeMouseEnter:Ee,onEdgeMouseMove:De,onEdgeMouseLeave:Ge,reconnectRadius:yt,onReconnect:It,onReconnectStart:Nt,onReconnectEnd:At,noDragClassName:Ht,noWheelClassName:Qi,noPanClassName:Bn,disableKeyboardA11y:tt,nodeExtent:jt,rfId:Jt,viewport:Ft,onViewportChange:Wt}){return sv(t),sv(i),JT(),qT(s),YT(Ft),z.jsx(fT,{onPaneClick:re,onPaneMouseEnter:de,onPaneMouseMove:ue,onPaneMouseLeave:ee,onPaneContextMenu:Se,onPaneScroll:ce,paneClickDistance:be,deleteKeyCode:j,selectionKeyCode:O,selectionOnDrag:x,selectionMode:M,onSelectionStart:y,onSelectionEnd:w,multiSelectionKeyCode:R,panActivationKeyCode:L,zoomActivationKeyCode:H,elementsSelectable:ae,zoomOnScroll:D,zoomOnPinch:q,zoomOnDoubleClick:$,panOnScroll:X,panOnScrollSpeed:te,panOnScrollMode:C,panOnDrag:P,autoPanOnSelection:ie,defaultViewport:K,translateExtent:I,minZoom:oe,maxZoom:B,onSelectionContextMenu:p,preventScrolling:G,noDragClassName:Ht,noWheelClassName:Qi,noPanClassName:Bn,disableKeyboardA11y:tt,onViewportChange:Wt,isControlledViewport:!!Ft,children:z.jsxs(UT,{children:[z.jsx(jT,{edgeTypes:i,onEdgeClick:r,onEdgeDoubleClick:c,onReconnect:It,onReconnectStart:Nt,onReconnectEnd:At,onlyRenderVisibleElements:Y,onEdgeContextMenu:ye,onEdgeMouseEnter:Ee,onEdgeMouseMove:De,onEdgeMouseLeave:Ge,reconnectRadius:yt,defaultMarkerColor:T,noPanClassName:Bn,disableKeyboardA11y:tt,rfId:Jt}),z.jsx(QT,{style:_,type:E,component:N,containerStyle:S}),z.jsx("div",{className:"react-flow__edgelabel-renderer"}),z.jsx(ST,{nodeTypes:t,onNodeClick:a,onNodeDoubleClick:u,onNodeMouseEnter:m,onNodeMouseMove:h,onNodeMouseLeave:g,onNodeContextMenu:v,nodeClickDistance:ge,onlyRenderVisibleElements:Y,noPanClassName:Bn,noDragClassName:Ht,disableKeyboardA11y:tt,nodeExtent:jt,rfId:Jt}),z.jsx("div",{className:"react-flow__viewport-portal"})]})})}ab.displayName="GraphView";const FT=F.memo(ab),WT=c1(),lv=({nodes:t,edges:i,defaultNodes:s,defaultEdges:a,width:r,height:u,fitView:c,fitViewOptions:m,minZoom:h=.5,maxZoom:g=2,nodeOrigin:v,nodeExtent:p,zIndexMode:y="basic"}={})=>{const w=new Map,E=new Map,_=new Map,N=new Map,S=a??i??[],O=s??t??[],x=v??[0,0],M=p??ho;x1(_,N,S);const{nodesInitialized:R}=yh(O,w,E,{nodeOrigin:x,nodeExtent:M,zIndexMode:y});let L=[0,0,1];if(c&&r&&u){const H=Ao(w,{filter:K=>!!((K.width||K.initialWidth)&&(K.height||K.initialHeight))}),{x:j,y:Y,zoom:ae}=Uh(H,r,u,h,g,m?.padding??.1);L=[j,Y,ae]}return{rfId:"1",width:r??0,height:u??0,transform:L,nodes:O,nodesInitialized:R,nodeLookup:w,parentLookup:E,edges:S,edgeLookup:N,connectionLookup:_,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:s!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:h,maxZoom:g,translateExtent:ho,nodeExtent:M,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:$l.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:c??!1,fitViewOptions:m,fitViewResolver:null,connection:{...s1},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:WT,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:i1,zIndexMode:y,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},PT=({nodes:t,edges:i,defaultNodes:s,defaultEdges:a,width:r,height:u,fitView:c,fitViewOptions:m,minZoom:h,maxZoom:g,nodeOrigin:v,nodeExtent:p,zIndexMode:y})=>dA((w,E)=>{async function _(){const{nodeLookup:N,panZoom:S,fitViewOptions:O,fitViewResolver:x,width:M,height:R,minZoom:L,maxZoom:H}=E();S&&(await rN({nodes:N,width:M,height:R,panZoom:S,minZoom:L,maxZoom:H},O),x?.resolve(!0),w({fitViewResolver:null}))}return{...lv({nodes:t,edges:i,width:r,height:u,fitView:c,fitViewOptions:m,minZoom:h,maxZoom:g,nodeOrigin:v,nodeExtent:p,defaultNodes:s,defaultEdges:a,zIndexMode:y}),setNodes:N=>{const{nodeLookup:S,parentLookup:O,nodeOrigin:x,elevateNodesOnSelect:M,fitViewQueued:R,zIndexMode:L,nodesSelectionActive:H}=E(),{nodesInitialized:j,hasSelectedNodes:Y}=yh(N,S,O,{nodeOrigin:x,nodeExtent:p,elevateNodesOnSelect:M,checkEquality:!0,zIndexMode:L}),ae=H&&Y;R&&j?(_(),w({nodes:N,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:ae})):w({nodes:N,nodesInitialized:j,nodesSelectionActive:ae})},setEdges:N=>{const{connectionLookup:S,edgeLookup:O}=E();x1(S,O,N),w({edges:N})},setDefaultNodesAndEdges:(N,S)=>{if(N){const{setNodes:O}=E();O(N),w({hasDefaultNodes:!0})}if(S){const{setEdges:O}=E();O(S),w({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:S,nodeLookup:O,parentLookup:x,domNode:M,nodeOrigin:R,nodeExtent:L,debug:H,fitViewQueued:j,zIndexMode:Y}=E(),{changes:ae,updatedInternals:K}=zN(N,O,x,M,R,L,Y);K&&(TN(O,x,{nodeOrigin:R,nodeExtent:L,zIndexMode:Y}),j?(_(),w({fitViewQueued:!1,fitViewOptions:void 0})):w({}),ae?.length>0&&(H&&console.log("React Flow: trigger node changes",ae),S?.(ae)))},updateNodePositions:(N,S=!1)=>{const O=[];let x=[];const{nodeLookup:M,triggerNodeChanges:R,connection:L,updateConnection:H,onNodesChangeMiddlewareMap:j}=E();for(const[Y,ae]of N){const K=M.get(Y),I=!!(K?.expandParent&&K?.parentId&&ae?.position),oe={id:Y,type:"position",position:I?{x:Math.max(0,ae.position.x),y:Math.max(0,ae.position.y)}:ae.position,dragging:S};if(K&&L.inProgress&&L.fromNode.id===K.id){const B=Ts(K,L.fromHandle,fe.Left,!0);H({...L,from:B})}I&&K.parentId&&O.push({id:Y,parentId:K.parentId,rect:{...ae.internals.positionAbsolute,width:ae.measured.width??0,height:ae.measured.height??0}}),x.push(oe)}if(O.length>0){const{parentLookup:Y,nodeOrigin:ae}=E(),K=Kh(O,M,Y,ae);x.push(...K)}for(const Y of j.values())x=Y(x);R(x)},triggerNodeChanges:N=>{const{onNodesChange:S,setNodes:O,nodes:x,hasDefaultNodes:M,debug:R}=E();if(N?.length){if(M){const L=LA(N,x);O(L)}R&&console.log("React Flow: trigger node changes",N),S?.(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:S,setEdges:O,edges:x,hasDefaultEdges:M,debug:R}=E();if(N?.length){if(M){const L=RA(N,x);O(L)}R&&console.log("React Flow: trigger edge changes",N),S?.(N)}},addSelectedNodes:N=>{const{multiSelectionActive:S,edgeLookup:O,nodeLookup:x,triggerNodeChanges:M,triggerEdgeChanges:R}=E();if(S){const L=N.map(H=>gs(H,!0));M(L);return}M(Al(x,new Set([...N]),!0)),R(Al(O))},addSelectedEdges:N=>{const{multiSelectionActive:S,edgeLookup:O,nodeLookup:x,triggerNodeChanges:M,triggerEdgeChanges:R}=E();if(S){const L=N.map(H=>gs(H,!0));R(L);return}R(Al(O,new Set([...N]))),M(Al(x,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:S}={})=>{const{edges:O,nodes:x,nodeLookup:M,triggerNodeChanges:R,triggerEdgeChanges:L}=E(),H=N||x,j=S||O,Y=[];for(const K of H){if(!K.selected)continue;const I=M.get(K.id);I&&(I.selected=!1),Y.push(gs(K.id,!1))}const ae=[];for(const K of j)K.selected&&ae.push(gs(K.id,!1));R(Y),L(ae)},setMinZoom:N=>{const{panZoom:S,maxZoom:O}=E();S?.setScaleExtent([N,O]),w({minZoom:N})},setMaxZoom:N=>{const{panZoom:S,minZoom:O}=E();S?.setScaleExtent([O,N]),w({maxZoom:N})},setTranslateExtent:N=>{E().panZoom?.setTranslateExtent(N),w({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:S,triggerNodeChanges:O,triggerEdgeChanges:x,elementsSelectable:M}=E();if(!M)return;const R=S.reduce((H,j)=>j.selected?[...H,gs(j.id,!1)]:H,[]),L=N.reduce((H,j)=>j.selected?[...H,gs(j.id,!1)]:H,[]);O(R),x(L)},setNodeExtent:N=>{const{nodes:S,nodeLookup:O,parentLookup:x,nodeOrigin:M,elevateNodesOnSelect:R,nodeExtent:L,zIndexMode:H}=E();N[0][0]===L[0][0]&&N[0][1]===L[0][1]&&N[1][0]===L[1][0]&&N[1][1]===L[1][1]||(yh(S,O,x,{nodeOrigin:M,nodeExtent:N,elevateNodesOnSelect:R,checkEquality:!1,zIndexMode:H}),w({nodeExtent:N}))},panBy:N=>{const{transform:S,width:O,height:x,panZoom:M,translateExtent:R}=E();return DN({delta:N,panZoom:M,transform:S,translateExtent:R,width:O,height:x})},setCenter:async(N,S,O)=>{const{width:x,height:M,maxZoom:R,panZoom:L}=E();if(!L)return!1;const H=typeof O?.zoom<"u"?O.zoom:R;return await L.setViewport({x:x/2-N*H,y:M/2-S*H,zoom:H},{duration:O?.duration,ease:O?.ease,interpolate:O?.interpolate}),!0},cancelConnection:()=>{w({connection:{...s1}})},updateConnection:N=>{w({connection:N})},reset:()=>w({...lv()})}},Object.is);function ob({initialNodes:t,initialEdges:i,defaultNodes:s,defaultEdges:a,initialWidth:r,initialHeight:u,initialMinZoom:c,initialMaxZoom:m,initialFitViewOptions:h,fitView:g,nodeOrigin:v,nodeExtent:p,zIndexMode:y,children:w}){const[E]=F.useState(()=>PT({nodes:t,edges:i,defaultNodes:s,defaultEdges:a,width:r,height:u,fitView:g,minZoom:c,maxZoom:m,fitViewOptions:h,nodeOrigin:v,nodeExtent:p,zIndexMode:y}));return z.jsx(hA,{value:E,children:z.jsx(UA,{children:w})})}function eM({children:t,nodes:i,edges:s,defaultNodes:a,defaultEdges:r,width:u,height:c,fitView:m,fitViewOptions:h,minZoom:g,maxZoom:v,nodeOrigin:p,nodeExtent:y,zIndexMode:w}){return F.useContext(Qu)?z.jsx(z.Fragment,{children:t}):z.jsx(ob,{initialNodes:i,initialEdges:s,defaultNodes:a,defaultEdges:r,initialWidth:u,initialHeight:c,fitView:m,initialFitViewOptions:h,initialMinZoom:g,initialMaxZoom:v,nodeOrigin:p,nodeExtent:y,zIndexMode:w,children:t})}const tM={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function nM({nodes:t,edges:i,defaultNodes:s,defaultEdges:a,className:r,nodeTypes:u,edgeTypes:c,onNodeClick:m,onEdgeClick:h,onInit:g,onMove:v,onMoveStart:p,onMoveEnd:y,onConnect:w,onConnectStart:E,onConnectEnd:_,onClickConnectStart:N,onClickConnectEnd:S,onNodeMouseEnter:O,onNodeMouseMove:x,onNodeMouseLeave:M,onNodeContextMenu:R,onNodeDoubleClick:L,onNodeDragStart:H,onNodeDrag:j,onNodeDragStop:Y,onNodesDelete:ae,onEdgesDelete:K,onDelete:I,onSelectionChange:oe,onSelectionDragStart:B,onSelectionDrag:G,onSelectionDragStop:T,onSelectionContextMenu:D,onSelectionStart:q,onSelectionEnd:X,onBeforeDelete:te,connectionMode:C,connectionLineType:$=Yi.Bezier,connectionLineStyle:P,connectionLineComponent:ie,connectionLineContainerStyle:re,deleteKeyCode:de="Backspace",selectionKeyCode:ue="Shift",selectionOnDrag:ee=!1,selectionMode:ce=mo.Full,panActivationKeyCode:Se="Space",multiSelectionKeyCode:be=yo()?"Meta":"Control",zoomActivationKeyCode:ge=yo()?"Meta":"Control",snapToGrid:ye,snapGrid:Ee,onlyRenderVisibleElements:De=!1,selectNodesOnDrag:Ge,nodesDraggable:yt,autoPanOnNodeFocus:It,nodesConnectable:Nt,nodesFocusable:At,nodeOrigin:Ht=B1,edgesFocusable:Qi,edgesReconnectable:Bn,elementsSelectable:tt=!0,defaultViewport:jt=AA,minZoom:Jt=.5,maxZoom:Ft=2,translateExtent:Wt=ho,preventScrolling:hc=!0,nodeExtent:Ds,defaultMarkerColor:mc="#b1b1b7",zoomOnScroll:gc=!0,zoomOnPinch:Ii=!0,panOnScroll:wt=!1,panOnScrollSpeed:_n=.5,panOnScrollMode:xt=xs.Free,zoomOnDoubleClick:pc=!0,panOnDrag:yc=!0,onPaneClick:vc,onPaneMouseEnter:Ls,onPaneMouseMove:Rs,onPaneMouseLeave:Bs,onPaneScroll:kn,onPaneContextMenu:ks,paneClickDistance:Ji=1,nodeClickDistance:bc=0,children:Do,onReconnect:Pl,onReconnectStart:Fi,onReconnectEnd:Sc,onEdgeContextMenu:Lo,onEdgeDoubleClick:Ro,onEdgeMouseEnter:Bo,onEdgeMouseMove:ea,onEdgeMouseLeave:ta,reconnectRadius:ko=10,onNodesChange:Ho,onEdgesChange:Nn,noDragClassName:ct="nodrag",noWheelClassName:vt="nowheel",noPanClassName:Hn="nopan",fitView:Hs,fitViewOptions:jo,connectOnClick:wc,attributionPosition:$o,proOptions:Wi,defaultEdgeOptions:na,elevateNodesOnSelect:ui=!0,elevateEdgesOnSelect:ci=!1,disableKeyboardA11y:fi=!1,autoPanOnConnect:di,autoPanOnNodeDrag:st,autoPanOnSelection:Uo=!0,autoPanSpeed:qo,connectionRadius:jn,isValidConnection:hi,onError:xc,style:Vo,id:ia,nodeDragThreshold:Ec,connectionDragThreshold:js,viewport:$s,onViewportChange:fn,width:Tt,height:Yo,colorMode:_c="light",debug:sa,onScroll:la,ariaLabelConfig:Us,zIndexMode:Go="basic",...Mt},aa){const qs=ia||"1",oa=OA(_c),mi=F.useCallback(ra=>{ra.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),la?.(ra)},[la]);return z.jsx("div",{"data-testid":"rf__wrapper",...Mt,onScroll:mi,style:{...Vo,...tM},ref:aa,className:ut(["react-flow",r,oa]),id:ia,role:"application",children:z.jsxs(eM,{nodes:t,edges:i,width:Tt,height:Yo,fitView:Hs,fitViewOptions:jo,minZoom:Jt,maxZoom:Ft,nodeOrigin:Ht,nodeExtent:Ds,zIndexMode:Go,children:[z.jsx(CA,{nodes:t,edges:i,defaultNodes:s,defaultEdges:a,onConnect:w,onConnectStart:E,onConnectEnd:_,onClickConnectStart:N,onClickConnectEnd:S,nodesDraggable:yt,autoPanOnNodeFocus:It,nodesConnectable:Nt,nodesFocusable:At,edgesFocusable:Qi,edgesReconnectable:Bn,elementsSelectable:tt,elevateNodesOnSelect:ui,elevateEdgesOnSelect:ci,minZoom:Jt,maxZoom:Ft,nodeExtent:Ds,onNodesChange:Ho,onEdgesChange:Nn,snapToGrid:ye,snapGrid:Ee,connectionMode:C,translateExtent:Wt,connectOnClick:wc,defaultEdgeOptions:na,fitView:Hs,fitViewOptions:jo,onNodesDelete:ae,onEdgesDelete:K,onDelete:I,onNodeDragStart:H,onNodeDrag:j,onNodeDragStop:Y,onSelectionDrag:G,onSelectionDragStart:B,onSelectionDragStop:T,onMove:v,onMoveStart:p,onMoveEnd:y,noPanClassName:Hn,nodeOrigin:Ht,rfId:qs,autoPanOnConnect:di,autoPanOnNodeDrag:st,autoPanSpeed:qo,onError:xc,connectionRadius:jn,isValidConnection:hi,selectNodesOnDrag:Ge,nodeDragThreshold:Ec,connectionDragThreshold:js,onBeforeDelete:te,debug:sa,ariaLabelConfig:Us,zIndexMode:Go}),z.jsx(FT,{onInit:g,onNodeClick:m,onEdgeClick:h,onNodeMouseEnter:O,onNodeMouseMove:x,onNodeMouseLeave:M,onNodeContextMenu:R,onNodeDoubleClick:L,nodeTypes:u,edgeTypes:c,connectionLineType:$,connectionLineStyle:P,connectionLineComponent:ie,connectionLineContainerStyle:re,selectionKeyCode:ue,selectionOnDrag:ee,selectionMode:ce,deleteKeyCode:de,multiSelectionKeyCode:be,panActivationKeyCode:Se,zoomActivationKeyCode:ge,onlyRenderVisibleElements:De,defaultViewport:jt,translateExtent:Wt,minZoom:Jt,maxZoom:Ft,preventScrolling:hc,zoomOnScroll:gc,zoomOnPinch:Ii,zoomOnDoubleClick:pc,panOnScroll:wt,panOnScrollSpeed:_n,panOnScrollMode:xt,panOnDrag:yc,autoPanOnSelection:Uo,onPaneClick:vc,onPaneMouseEnter:Ls,onPaneMouseMove:Rs,onPaneMouseLeave:Bs,onPaneScroll:kn,onPaneContextMenu:ks,paneClickDistance:Ji,nodeClickDistance:bc,onSelectionContextMenu:D,onSelectionStart:q,onSelectionEnd:X,onReconnect:Pl,onReconnectStart:Fi,onReconnectEnd:Sc,onEdgeContextMenu:Lo,onEdgeDoubleClick:Ro,onEdgeMouseEnter:Bo,onEdgeMouseMove:ea,onEdgeMouseLeave:ta,reconnectRadius:ko,defaultMarkerColor:mc,noDragClassName:ct,noWheelClassName:vt,noPanClassName:Hn,rfId:qs,disableKeyboardA11y:fi,nodeExtent:Ds,viewport:$s,onViewportChange:fn}),z.jsx(NA,{onSelectionChange:oe}),Do,z.jsx(SA,{proOptions:Wi,position:$o}),z.jsx(bA,{rfId:qs,disableKeyboardA11y:fi})]})})}var iM=H1(nM);function sM({dimensions:t,lineWidth:i,variant:s,className:a}){return z.jsx("path",{strokeWidth:i,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:ut(["react-flow__background-pattern",s,a])})}function lM({radius:t,className:i}){return z.jsx("circle",{cx:t,cy:t,r:t,className:ut(["react-flow__background-pattern","dots",i])})}var Gi;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Gi||(Gi={}));const aM={[Gi.Dots]:1,[Gi.Lines]:1,[Gi.Cross]:6},oM=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function rb({id:t,variant:i=Gi.Dots,gap:s=20,size:a,lineWidth:r=1,offset:u=0,color:c,bgColor:m,style:h,className:g,patternClassName:v}){const p=F.useRef(null),{transform:y,patternId:w}=ze(oM,Qe),E=a||aM[i],_=i===Gi.Dots,N=i===Gi.Cross,S=Array.isArray(s)?s:[s,s],O=[S[0]*y[2]||1,S[1]*y[2]||1],x=E*y[2],M=Array.isArray(u)?u:[u,u],R=N?[x,x]:O,L=[M[0]*y[2]||1+R[0]/2,M[1]*y[2]||1+R[1]/2],H=`${w}${t||""}`;return z.jsxs("svg",{className:ut(["react-flow__background",g]),style:{...h,...Fu,"--xy-background-color-props":m,"--xy-background-pattern-color-props":c},ref:p,"data-testid":"rf__background",children:[z.jsx("pattern",{id:H,x:y[0]%O[0],y:y[1]%O[1],width:O[0],height:O[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${L[0]},-${L[1]})`,children:_?z.jsx(lM,{radius:x/2,className:v}):z.jsx(sM,{dimensions:R,lineWidth:r,variant:i,className:v})}),z.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${H})`})]})}rb.displayName="Background";const rM=F.memo(rb);function uM(){return z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:z.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function cM(){return z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:z.jsx("path",{d:"M0 0h32v4.2H0z"})})}function fM(){return z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:z.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 dM(){return z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:z.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 hM(){return z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:z.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 ru({children:t,className:i,...s}){return z.jsx("button",{type:"button",className:ut(["react-flow__controls-button",i]),...s,children:t})}const mM=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function ub({style:t,showZoom:i=!0,showFitView:s=!0,showInteractive:a=!0,fitViewOptions:r,onZoomIn:u,onZoomOut:c,onFitView:m,onInteractiveChange:h,className:g,children:v,position:p="bottom-left",orientation:y="vertical","aria-label":w}){const E=Je(),{isInteractive:_,minZoomReached:N,maxZoomReached:S,ariaLabelConfig:O}=ze(mM,Qe),{zoomIn:x,zoomOut:M,fitView:R}=Ju(),L=()=>{x(),u?.()},H=()=>{M(),c?.()},j=()=>{R(r),m?.()},Y=()=>{E.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),h?.(!_)},ae=y==="horizontal"?"horizontal":"vertical";return z.jsxs(Iu,{className:ut(["react-flow__controls",ae,g]),position:p,style:t,"data-testid":"rf__controls","aria-label":w??O["controls.ariaLabel"],children:[i&&z.jsxs(z.Fragment,{children:[z.jsx(ru,{onClick:L,className:"react-flow__controls-zoomin",title:O["controls.zoomIn.ariaLabel"],"aria-label":O["controls.zoomIn.ariaLabel"],disabled:S,children:z.jsx(uM,{})}),z.jsx(ru,{onClick:H,className:"react-flow__controls-zoomout",title:O["controls.zoomOut.ariaLabel"],"aria-label":O["controls.zoomOut.ariaLabel"],disabled:N,children:z.jsx(cM,{})})]}),s&&z.jsx(ru,{className:"react-flow__controls-fitview",onClick:j,title:O["controls.fitView.ariaLabel"],"aria-label":O["controls.fitView.ariaLabel"],children:z.jsx(fM,{})}),a&&z.jsx(ru,{className:"react-flow__controls-interactive",onClick:Y,title:O["controls.interactive.ariaLabel"],"aria-label":O["controls.interactive.ariaLabel"],children:_?z.jsx(hM,{}):z.jsx(dM,{})}),v]})}ub.displayName="Controls";const gM=F.memo(ub);function pM({id:t,x:i,y:s,width:a,height:r,style:u,color:c,strokeColor:m,strokeWidth:h,className:g,borderRadius:v,shapeRendering:p,selected:y,onClick:w}){const{background:E,backgroundColor:_}=u||{},N=c||E||_;return z.jsx("rect",{className:ut(["react-flow__minimap-node",{selected:y},g]),x:i,y:s,rx:v,ry:v,width:a,height:r,style:{fill:N,stroke:m,strokeWidth:h},shapeRendering:p,onClick:w?S=>w(S,t):void 0})}const yM=F.memo(pM),vM=t=>t.nodes.map(i=>i.id),Qd=t=>t instanceof Function?t:()=>t;function bM({nodeStrokeColor:t,nodeColor:i,nodeClassName:s="",nodeBorderRadius:a=5,nodeStrokeWidth:r,nodeComponent:u=yM,onClick:c}){const m=ze(vM,Qe),h=Qd(i),g=Qd(t),v=Qd(s),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return z.jsx(z.Fragment,{children:m.map(y=>z.jsx(wM,{id:y,nodeColorFunc:h,nodeStrokeColorFunc:g,nodeClassNameFunc:v,nodeBorderRadius:a,nodeStrokeWidth:r,NodeComponent:u,onClick:c,shapeRendering:p},y))})}function SM({id:t,nodeColorFunc:i,nodeStrokeColorFunc:s,nodeClassNameFunc:a,nodeBorderRadius:r,nodeStrokeWidth:u,shapeRendering:c,NodeComponent:m,onClick:h}){const{node:g,x:v,y:p,width:y,height:w}=ze(E=>{const _=E.nodeLookup.get(t);if(!_)return{node:void 0,x:0,y:0,width:0,height:0};const N=_.internals.userNode,{x:S,y:O}=_.internals.positionAbsolute,{width:x,height:M}=ri(N);return{node:N,x:S,y:O,width:x,height:M}},Qe);return!g||g.hidden||!f1(g)?null:z.jsx(m,{x:v,y:p,width:y,height:w,style:g.style,selected:!!g.selected,className:a(g),color:i(g),borderRadius:r,strokeColor:s(g),strokeWidth:u,shapeRendering:c,onClick:h,id:g.id})}const wM=F.memo(SM);var xM=F.memo(bM);const EM=200,_M=150,NM=t=>!t.hidden,AM=t=>{const i={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:i,boundingRect:t.nodeLookup.size>0?u1(Ao(t.nodeLookup,{filter:NM}),i):i,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},TM="react-flow__minimap-desc";function cb({style:t,className:i,nodeStrokeColor:s,nodeColor:a,nodeClassName:r="",nodeBorderRadius:u=5,nodeStrokeWidth:c,nodeComponent:m,bgColor:h,maskColor:g,maskStrokeColor:v,maskStrokeWidth:p,position:y="bottom-right",onClick:w,onNodeClick:E,pannable:_=!1,zoomable:N=!1,ariaLabel:S,inversePan:O,zoomStep:x=1,offsetScale:M=5}){const R=Je(),L=F.useRef(null),{boundingRect:H,viewBB:j,rfId:Y,panZoom:ae,translateExtent:K,flowWidth:I,flowHeight:oe,ariaLabelConfig:B}=ze(AM,Qe),G=t?.width??EM,T=t?.height??_M,D=H.width/G,q=H.height/T,X=Math.max(D,q),te=X*G,C=X*T,$=M*X,P=H.x-(te-H.width)/2-$,ie=H.y-(C-H.height)/2-$,re=te+$*2,de=C+$*2,ue=`${TM}-${Y}`,ee=F.useRef(0),ce=F.useRef();ee.current=X,F.useEffect(()=>{if(L.current&&ae)return ce.current=qN({domNode:L.current,panZoom:ae,getTransform:()=>R.getState().transform,getViewScale:()=>ee.current}),()=>{ce.current?.destroy()}},[ae]),F.useEffect(()=>{ce.current?.update({translateExtent:K,width:I,height:oe,inversePan:O,pannable:_,zoomStep:x,zoomable:N})},[_,N,O,x,K,I,oe]);const Se=w?ye=>{const[Ee,De]=ce.current?.pointer(ye)||[0,0];w(ye,{x:Ee,y:De})}:void 0,be=E?F.useCallback((ye,Ee)=>{const De=R.getState().nodeLookup.get(Ee).internals.userNode;E(ye,De)},[]):void 0,ge=S??B["minimap.ariaLabel"];return z.jsx(Iu,{position:y,style:{...t,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*X:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-width-props":typeof c=="number"?c:void 0},className:ut(["react-flow__minimap",i]),"data-testid":"rf__minimap",children:z.jsxs("svg",{width:G,height:T,viewBox:`${P} ${ie} ${re} ${de}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ue,ref:L,onClick:Se,children:[ge&&z.jsx("title",{id:ue,children:ge}),z.jsx(xM,{onClick:be,nodeColor:a,nodeStrokeColor:s,nodeBorderRadius:u,nodeClassName:r,nodeStrokeWidth:c,nodeComponent:m}),z.jsx("path",{className:"react-flow__minimap-mask",d:`M${P-$},${ie-$}h${re+$*2}v${de+$*2}h${-re-$*2}z
|
|
15
|
+
M${j.x},${j.y}h${j.width}v${j.height}h${-j.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}cb.displayName="MiniMap";F.memo(cb);const MM=t=>i=>t?`${Math.max(1/i.transform[2],1)}`:void 0,CM={[Yl.Line]:"right",[Yl.Handle]:"bottom-right"};function OM({nodeId:t,position:i,variant:s=Yl.Handle,className:a,style:r=void 0,children:u,color:c,minWidth:m=10,minHeight:h=10,maxWidth:g=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:y,autoScale:w=!0,shouldResize:E,onResizeStart:_,onResize:N,onResizeEnd:S}){const O=q1(),x=typeof t=="string"?t:O,M=Je(),R=F.useRef(null),L=s===Yl.Handle,H=ze(F.useCallback(MM(L&&w),[L,w]),Qe),j=F.useRef(null),Y=i??CM[s];F.useEffect(()=>{if(!(!R.current||!x))return j.current||(j.current=eA({domNode:R.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:K,transform:I,snapGrid:oe,snapToGrid:B,nodeOrigin:G,domNode:T}=M.getState();return{nodeLookup:K,transform:I,snapGrid:oe,snapToGrid:B,nodeOrigin:G,paneDomNode:T}},onChange:(K,I)=>{const{triggerNodeChanges:oe,nodeLookup:B,parentLookup:G,nodeOrigin:T}=M.getState(),D=[],q={x:K.x,y:K.y},X=B.get(x);if(X&&X.expandParent&&X.parentId){const te=X.origin??T,C=K.width??X.measured.width??0,$=K.height??X.measured.height??0,P={id:X.id,parentId:X.parentId,rect:{width:C,height:$,...d1({x:K.x??X.position.x,y:K.y??X.position.y},{width:C,height:$},X.parentId,B,te)}},ie=Kh([P],B,G,T);D.push(...ie),q.x=K.x?Math.max(te[0]*C,K.x):void 0,q.y=K.y?Math.max(te[1]*$,K.y):void 0}if(q.x!==void 0&&q.y!==void 0){const te={id:x,type:"position",position:{...q}};D.push(te)}if(K.width!==void 0&&K.height!==void 0){const C={id:x,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:K.width,height:K.height}};D.push(C)}for(const te of I){const C={...te,type:"position"};D.push(C)}oe(D)},onEnd:({width:K,height:I})=>{const oe={id:x,type:"dimensions",resizing:!1,dimensions:{width:K,height:I}};M.getState().triggerNodeChanges([oe])}})),j.current.update({controlPosition:Y,boundaries:{minWidth:m,minHeight:h,maxWidth:g,maxHeight:v},keepAspectRatio:p,resizeDirection:y,onResizeStart:_,onResize:N,onResizeEnd:S,shouldResize:E}),()=>{j.current?.destroy()}},[Y,m,h,g,v,p,_,N,S,E]);const ae=Y.split("-");return z.jsx("div",{className:ut(["react-flow__resize-control","nodrag",...ae,s,a]),ref:R,style:{...r,scale:H,...c&&{[L?"backgroundColor":"borderColor"]:c}},children:u})}F.memo(OM);const Ui=180,qi=80,fb=80,ii=430,Ll=390,db=130,pn=178,zM=92,Sh=300,wh=170,Ru=18,xh=48,Id=30,Su=92,hb=38,DM=42,av=154,ov=278,mb=408;function LM(t){return t==="slice-screen"||t==="story-slice"?"#cbd5e1":"#64748b"}function RM(t){return t.type==="event"?{sourcePosition:fe.Right,targetPosition:fe.Left}:{sourcePosition:fe.Bottom,targetPosition:fe.Top}}function BM(t){return new Map(t.stories.map((i,s)=>[i.name,s]))}function ys(t,i){return t===0?0:t*i+(t-1)*Ru}function Jd(t,i,s){return t.nodes.filter(a=>a.sliceTitle===i&&a.type===s)}function kM(t,i,s){return[...new Set(t.edges.filter(r=>r.kind==="command-event"&&i.get(r.source)?.sliceTitle===s).map(r=>r.target))].map(r=>i.get(r)).filter(r=>!!r)}function HM(t,i){return new Map(t.slices.map(s=>{const a=Jd(t,s.title,"query"),r=Jd(t,s.title,"command"),u=kM(t,i,s.title),c=Jd(t,s.title,"gwt"),m=ys(a.length,pn),h=ys(r.length,pn),g=m+h+(m>0&&h>0?xh:0),v=ys(u.length,pn),p=ys(c.length,Sh),y=Math.max(ii,g+Id*2,v+Id*2,p+Id*2),w=c.length>0?mb+wh+36:Ll;return[s.title,{width:y,height:w,queryIds:a.map(E=>E.id),commandIds:r.map(E=>E.id),eventIds:u.map(E=>E.id),gwtIds:c.map(E=>E.id)}]}))}function jM(t,i){const s=new Map;let a=qi;for(const r of t.stories){const u=t.slices.filter(v=>v.storyName===r.name),c=u.reduce((v,p)=>v+(i.get(p.title)?.width??ii),0),m=Math.max(c+Math.max(u.length-1,0)*db,ii),h=Math.max(...u.map(v=>i.get(v.title)?.height??Ll),Ll),g=Su+h+hb;s.set(r.name,{y:a,width:m,height:g}),a+=g+fb}return s}function rv(t,i,s,a,r,u){const c=ys(t.length,u),m=s.x+(a-c)/2;t.forEach((h,g)=>{i.set(h,{x:m+g*(u+Ru),y:s.y+r})})}function $M(t){return t==="essential"?new Set(["command-event","event-query"]):t==="normal"?new Set(["query-screen","screen-command","command-event","event-query"]):new Set(["story-slice","slice-screen","query-screen","screen-command","command-event","event-query"])}function UM(t,i,s="all"){if(!i||s==="all")return new Set(t.stories.map(c=>c.name));if(s==="story")return new Set([i]);const a=new Set([i]),r=new Set(t.nodes.filter(c=>c.storyName===i).map(c=>c.id)),u=new Set(t.edges.filter(c=>r.has(c.source)||r.has(c.target)).flatMap(c=>[c.source,c.target]).filter(c=>t.nodes.find(m=>m.id===c)?.type==="event"));for(const c of t.edges){if(!u.has(c.source)&&!u.has(c.target))continue;const m=t.nodes.find(g=>g.id===c.source),h=t.nodes.find(g=>g.id===c.target);m?.storyName&&a.add(m.storyName),h?.storyName&&a.add(h.storyName)}return a}function qM(t){return t==="event-query"?{sourceSide:"top",targetSide:"bottom"}:t==="query-screen"?{sourceSide:"top",targetSide:"bottom"}:t==="screen-command"?{sourceSide:"bottom",targetSide:"top"}:t==="command-event"?{sourceSide:"bottom",targetSide:"top"}:t==="slice-screen"?{sourceSide:"bottom",targetSide:"top"}:{sourceSide:"right",targetSide:"left"}}function VM(t,i,s,a,r){const u=qM(t),c=i?.sliceTitle&&i.sliceTitle===s?.sliceTitle;if(t==="event-query"&&c)return{...u,route:"same-slice-read"};if(!(t==="event-query"&&i?.sliceTitle!==s?.sliceTitle)||!a||!r)return{...u,route:"semantic"};const h=a.x+a.width/2,g=a.y+a.height/2,v=r.x+r.width/2,p=r.y+r.height/2;return{sourceSide:i?.storyName&&i.storyName===s?.storyName||p>=g?"bottom":"top",targetSide:v>=h?"left":"right",route:"event-read"}}function YM(t,i,s={}){const a=BM(t),r=new Map(t.nodes.map(S=>[S.id,S])),u=HM(t,r),c=jM(t,u),m=new Map,h=new Map,g=new Map,v=new Set,p=UM(t,s.focusedStory,s.scope??"all"),y=$M(s.edgeDetail??"normal");if(i){v.add(i);for(const S of t.edges)S.source===i&&v.add(S.target),S.target===i&&v.add(S.source)}const w=new Map;for(const S of t.stories)w.set(S.name,Ui);for(const S of t.stories)for(const O of S.slices){const x=t.slices.find(L=>L.path===O);if(!x)continue;const M=c.get(S.name)??{y:qi},R=w.get(S.name)??Ui;g.set(x.title,{x:R,y:M.y+Su}),w.set(S.name,R+(u.get(x.title)?.width??ii)+db)}for(const S of t.slices){if(g.has(S.title))continue;const O=qi+(a.get(S.storyName??"")??0)*(Ll+Su+hb+fb),x=Ui;g.set(S.title,{x,y:O+Su})}for(const S of t.nodes){if(S.type==="story"&&m.set(S.id,{x:Ui-20,y:c.get(S.label)?.y??qi}),S.type==="slice"){const O=g.get(S.label)??{x:Ui,y:qi};m.set(S.id,O)}if(S.type==="screen"||S.type==="processor"){const O=g.get(S.sliceTitle??"")??{x:Ui,y:qi},M=u.get(S.sliceTitle??"")?.width??ii;m.set(S.id,{x:O.x+(M-pn)/2,y:O.y+DM})}}for(const S of t.slices){const O=g.get(S.title)??{x:Ui,y:qi},x=u.get(S.title),M=x?.width??ii;if(!x)continue;const R=ys(x.queryIds.length,pn),L=ys(x.commandIds.length,pn),H=R+L+(R>0&&L>0?xh:0);let j=O.x+(M-H)/2;x.queryIds.forEach((Y,ae)=>{m.set(Y,{x:j+ae*(pn+Ru),y:O.y+av})}),R>0&&(j+=R+(L>0?xh:0)),x.commandIds.forEach((Y,ae)=>{m.set(Y,{x:j+ae*(pn+Ru),y:O.y+av})}),rv(x.eventIds,m,O,M,ov,pn),rv(x.gwtIds,m,O,M,mb,Sh)}for(const S of t.nodes.filter(O=>O.type==="event")){const O=t.edges.find(M=>M.kind==="command-event"&&M.target===S.id),x=O?r.get(O.source):void 0;if(!m.has(S.id)){const M=g.get(x?.sliceTitle??"")??{x:Ui,y:qi},R=u.get(x?.sliceTitle??"");m.set(S.id,{x:M.x+((R?.width??ii)-pn)/2,y:M.y+ov})}S.storyName=x?.storyName}const E=t.nodes.map(S=>{const O=m.get(S.id)??{x:0,y:0},x=S.type==="story"||S.type==="slice",M=S.type==="story"?c.get(S.label)?.width??ii:u.get(S.label)?.width??ii,R=S.type==="story"?c.get(S.label)?.height??Ll:u.get(S.label)?.height??Ll,L=x?M:S.type==="gwt"?Sh:pn,H=x?R:S.type==="gwt"?wh:zM;return h.set(S.id,{x:O.x,y:O.y,width:L,height:H}),{id:S.id,type:x?"groupNode":"eventModelNode",position:O,selectable:!0,draggable:!1,data:{projectNode:S,selected:S.id===i,connected:v.has(S.id)},hidden:!!(S.storyName&&!p.has(S.storyName)),style:x?{width:M,height:R,zIndex:S.type==="story"?-20:-10,opacity:S.storyName&&!p.has(S.storyName)?.18:1}:{width:L,height:S.type==="gwt"?wh:void 0,opacity:S.storyName&&!p.has(S.storyName)?.18:1},...RM(S)}}),N=t.edges.filter(S=>y.has(S.kind)).filter(S=>{const O=r.get(S.source),x=r.get(S.target),M=!O?.storyName||p.has(O.storyName),R=!x?.storyName||p.has(x.storyName);return M&&R}).map(S=>{const O=r.get(S.source),x=r.get(S.target),M=!!s.focusedEdgeIds?.has(S.id),{sourceSide:R,targetSide:L,route:H}=VM(S.kind,O,x,h.get(S.source),h.get(S.target));return{id:S.id,source:S.source,target:S.target,type:"eventModelEdge",sourceHandle:`${R}-source`,targetHandle:`${L}-target`,data:{kind:S.kind,route:H,active:M},markerEnd:{type:go.ArrowClosed,color:M?"#111827":LM(S.kind)},label:s.edgeDetail==="verbose"?S.label:void 0,className:M?"edge edge-active":"edge",animated:M}});return{nodes:E,edges:N}}const Qh=Symbol.for("yaml.alias"),Eh=Symbol.for("yaml.document"),Xi=Symbol.for("yaml.map"),gb=Symbol.for("yaml.pair"),Ln=Symbol.for("yaml.scalar"),Zl=Symbol.for("yaml.seq"),cn=Symbol.for("yaml.node.type"),Cs=t=>!!t&&typeof t=="object"&&t[cn]===Qh,Os=t=>!!t&&typeof t=="object"&&t[cn]===Eh,Ql=t=>!!t&&typeof t=="object"&&t[cn]===Xi,Ie=t=>!!t&&typeof t=="object"&&t[cn]===gb,Ye=t=>!!t&&typeof t=="object"&&t[cn]===Ln,Il=t=>!!t&&typeof t=="object"&&t[cn]===Zl;function Fe(t){if(t&&typeof t=="object")switch(t[cn]){case Xi:case Zl:return!0}return!1}function We(t){if(t&&typeof t=="object")switch(t[cn]){case Qh:case Xi:case Ln:case Zl:return!0}return!1}const pb=t=>(Ye(t)||Fe(t))&&!!t.anchor,Bt=Symbol("break visit"),yb=Symbol("skip children"),Dn=Symbol("remove node");function zs(t,i){const s=vb(i);Os(t)?Tl(null,t.contents,s,Object.freeze([t]))===Dn&&(t.contents=null):Tl(null,t,s,Object.freeze([]))}zs.BREAK=Bt;zs.SKIP=yb;zs.REMOVE=Dn;function Tl(t,i,s,a){const r=bb(t,i,s,a);if(We(r)||Ie(r))return Sb(t,a,r),Tl(t,r,s,a);if(typeof r!="symbol"){if(Fe(i)){a=Object.freeze(a.concat(i));for(let u=0;u<i.items.length;++u){const c=Tl(u,i.items[u],s,a);if(typeof c=="number")u=c-1;else{if(c===Bt)return Bt;c===Dn&&(i.items.splice(u,1),u-=1)}}}else if(Ie(i)){a=Object.freeze(a.concat(i));const u=Tl("key",i.key,s,a);if(u===Bt)return Bt;u===Dn&&(i.key=null);const c=Tl("value",i.value,s,a);if(c===Bt)return Bt;c===Dn&&(i.value=null)}}return r}async function Wu(t,i){const s=vb(i);Os(t)?await Ml(null,t.contents,s,Object.freeze([t]))===Dn&&(t.contents=null):await Ml(null,t,s,Object.freeze([]))}Wu.BREAK=Bt;Wu.SKIP=yb;Wu.REMOVE=Dn;async function Ml(t,i,s,a){const r=await bb(t,i,s,a);if(We(r)||Ie(r))return Sb(t,a,r),Ml(t,r,s,a);if(typeof r!="symbol"){if(Fe(i)){a=Object.freeze(a.concat(i));for(let u=0;u<i.items.length;++u){const c=await Ml(u,i.items[u],s,a);if(typeof c=="number")u=c-1;else{if(c===Bt)return Bt;c===Dn&&(i.items.splice(u,1),u-=1)}}}else if(Ie(i)){a=Object.freeze(a.concat(i));const u=await Ml("key",i.key,s,a);if(u===Bt)return Bt;u===Dn&&(i.key=null);const c=await Ml("value",i.value,s,a);if(c===Bt)return Bt;c===Dn&&(i.value=null)}}return r}function vb(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function bb(t,i,s,a){if(typeof s=="function")return s(t,i,a);if(Ql(i))return s.Map?.(t,i,a);if(Il(i))return s.Seq?.(t,i,a);if(Ie(i))return s.Pair?.(t,i,a);if(Ye(i))return s.Scalar?.(t,i,a);if(Cs(i))return s.Alias?.(t,i,a)}function Sb(t,i,s){const a=i[i.length-1];if(Fe(a))a.items[t]=s;else if(Ie(a))t==="key"?a.key=s:a.value=s;else if(Os(a))a.contents=s;else{const r=Cs(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const GM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},XM=t=>t.replace(/[!,[\]{}]/g,i=>GM[i]);class _t{constructor(i,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},_t.defaultYaml,i),this.tags=Object.assign({},_t.defaultTags,s)}clone(){const i=new _t(this.yaml,this.tags);return i.docStart=this.docStart,i}atDocument(){const i=new _t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:_t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},_t.defaultTags);break}return i}add(i,s){this.atNextDocument&&(this.yaml={explicit:_t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},_t.defaultTags),this.atNextDocument=!1);const a=i.trim().split(/[ \t]+/),r=a.shift();switch(r){case"%TAG":{if(a.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),a.length<2))return!1;const[u,c]=a;return this.tags[u]=c,!0}case"%YAML":{if(this.yaml.explicit=!0,a.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;const[u]=a;if(u==="1.1"||u==="1.2")return this.yaml.version=u,!0;{const c=/^\d+\.\d+$/.test(u);return s(6,`Unsupported YAML version ${u}`,c),!1}}default:return s(0,`Unknown directive ${r}`,!0),!1}}tagName(i,s){if(i==="!")return"!";if(i[0]!=="!")return s(`Not a valid tag: ${i}`),null;if(i[1]==="<"){const c=i.slice(2,-1);return c==="!"||c==="!!"?(s(`Verbatim tags aren't resolved, so ${i} is invalid.`),null):(i[i.length-1]!==">"&&s("Verbatim tags must end with a >"),c)}const[,a,r]=i.match(/^(.*!)([^!]*)$/s);r||s(`The ${i} tag has no suffix`);const u=this.tags[a];if(u)try{return u+decodeURIComponent(r)}catch(c){return s(String(c)),null}return a==="!"?i:(s(`Could not resolve tag: ${i}`),null)}tagString(i){for(const[s,a]of Object.entries(this.tags))if(i.startsWith(a))return s+XM(i.substring(a.length));return i[0]==="!"?i:`!<${i}>`}toString(i){const s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],a=Object.entries(this.tags);let r;if(i&&a.length>0&&We(i.contents)){const u={};zs(i.contents,(c,m)=>{We(m)&&m.tag&&(u[m.tag]=!0)}),r=Object.keys(u)}else r=[];for(const[u,c]of a)u==="!!"&&c==="tag:yaml.org,2002:"||(!i||r.some(m=>m.startsWith(c)))&&s.push(`%TAG ${u} ${c}`);return s.join(`
|
|
16
|
+
`)}}_t.defaultYaml={explicit:!1,version:"1.2"};_t.defaultTags={"!!":"tag:yaml.org,2002:"};function wb(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(s)}return!0}function xb(t){const i=new Set;return zs(t,{Value(s,a){a.anchor&&i.add(a.anchor)}}),i}function Eb(t,i){for(let s=1;;++s){const a=`${t}${s}`;if(!i.has(a))return a}}function KM(t,i){const s=[],a=new Map;let r=null;return{onAnchor:u=>{s.push(u),r??(r=xb(t));const c=Eb(i,r);return r.add(c),c},setAnchors:()=>{for(const u of s){const c=a.get(u);if(typeof c=="object"&&c.anchor&&(Ye(c.node)||Fe(c.node)))c.node.anchor=c.anchor;else{const m=new Error("Failed to resolve repeated object (this should not happen)");throw m.source=u,m}}},sourceObjects:a}}function Cl(t,i,s,a){if(a&&typeof a=="object")if(Array.isArray(a))for(let r=0,u=a.length;r<u;++r){const c=a[r],m=Cl(t,a,String(r),c);m===void 0?delete a[r]:m!==c&&(a[r]=m)}else if(a instanceof Map)for(const r of Array.from(a.keys())){const u=a.get(r),c=Cl(t,a,r,u);c===void 0?a.delete(r):c!==u&&a.set(r,c)}else if(a instanceof Set)for(const r of Array.from(a)){const u=Cl(t,a,r,r);u===void 0?a.delete(r):u!==r&&(a.delete(r),a.add(u))}else for(const[r,u]of Object.entries(a)){const c=Cl(t,a,r,u);c===void 0?delete a[r]:c!==u&&(a[r]=c)}return t.call(i,s,a)}function un(t,i,s){if(Array.isArray(t))return t.map((a,r)=>un(a,String(r),s));if(t&&typeof t.toJSON=="function"){if(!s||!pb(t))return t.toJSON(i,s);const a={aliasCount:0,count:1,res:void 0};s.anchors.set(t,a),s.onCreate=u=>{a.res=u,delete s.onCreate};const r=t.toJSON(i,s);return s.onCreate&&s.onCreate(r),r}return typeof t=="bigint"&&!s?.keep?Number(t):t}class Ih{constructor(i){Object.defineProperty(this,cn,{value:i})}clone(){const i=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(i.range=this.range.slice()),i}toJS(i,{mapAsMap:s,maxAliasCount:a,onAnchor:r,reviver:u}={}){if(!Os(i))throw new TypeError("A document argument is required");const c={anchors:new Map,doc:i,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},m=un(this,"",c);if(typeof r=="function")for(const{count:h,res:g}of c.anchors.values())r(g,h);return typeof u=="function"?Cl(u,{"":m},"",m):m}}class Pu extends Ih{constructor(i){super(Qh),this.source=i,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(i,s){if(s?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let a;s?.aliasResolveCache?a=s.aliasResolveCache:(a=[],zs(i,{Node:(u,c)=>{(Cs(c)||pb(c))&&a.push(c)}}),s&&(s.aliasResolveCache=a));let r;for(const u of a){if(u===this)break;u.anchor===this.source&&(r=u)}return r}toJSON(i,s){if(!s)return{source:this.source};const{anchors:a,doc:r,maxAliasCount:u}=s,c=this.resolve(r,s);if(!c){const h=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(h)}let m=a.get(c);if(m||(un(c,null,s),m=a.get(c)),m?.res===void 0){const h="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(h)}if(u>=0&&(m.count+=1,m.aliasCount===0&&(m.aliasCount=wu(r,c,a)),m.count*m.aliasCount>u)){const h="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(h)}return m.res}toString(i,s,a){const r=`*${this.source}`;if(i){if(wb(this.source),i.options.verifyAliasOrder&&!i.anchors.has(this.source)){const u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(u)}if(i.implicitKey)return`${r} `}return r}}function wu(t,i,s){if(Cs(i)){const a=i.resolve(t),r=s&&a&&s.get(a);return r?r.count*r.aliasCount:0}else if(Fe(i)){let a=0;for(const r of i.items){const u=wu(t,r,s);u>a&&(a=u)}return a}else if(Ie(i)){const a=wu(t,i.key,s),r=wu(t,i.value,s);return Math.max(a,r)}return 1}const _b=t=>!t||typeof t!="function"&&typeof t!="object";class xe extends Ih{constructor(i){super(Ln),this.value=i}toJSON(i,s){return s?.keep?this.value:un(this.value,i,s)}toString(){return String(this.value)}}xe.BLOCK_FOLDED="BLOCK_FOLDED";xe.BLOCK_LITERAL="BLOCK_LITERAL";xe.PLAIN="PLAIN";xe.QUOTE_DOUBLE="QUOTE_DOUBLE";xe.QUOTE_SINGLE="QUOTE_SINGLE";const ZM="tag:yaml.org,2002:";function QM(t,i,s){if(i){const a=s.filter(u=>u.tag===i),r=a.find(u=>!u.format)??a[0];if(!r)throw new Error(`Tag ${i} not found`);return r}return s.find(a=>a.identify?.(t)&&!a.format)}function bo(t,i,s){if(Os(t)&&(t=t.contents),We(t))return t;if(Ie(t)){const p=s.schema[Xi].createNode?.(s.schema,null,s);return p.items.push(t),p}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:a,onAnchor:r,onTagObj:u,schema:c,sourceObjects:m}=s;let h;if(a&&t&&typeof t=="object"){if(h=m.get(t),h)return h.anchor??(h.anchor=r(t)),new Pu(h.anchor);h={anchor:null,node:null},m.set(t,h)}i?.startsWith("!!")&&(i=ZM+i.slice(2));let g=QM(t,i,c.tags);if(!g){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const p=new xe(t);return h&&(h.node=p),p}g=t instanceof Map?c[Xi]:Symbol.iterator in Object(t)?c[Zl]:c[Xi]}u&&(u(g),delete s.onTagObj);const v=g?.createNode?g.createNode(s.schema,t,s):typeof g?.nodeClass?.from=="function"?g.nodeClass.from(s.schema,t,s):new xe(t);return i?v.tag=i:g.default||(v.tag=g.tag),h&&(h.node=v),v}function Bu(t,i,s){let a=s;for(let r=i.length-1;r>=0;--r){const u=i[r];if(typeof u=="number"&&Number.isInteger(u)&&u>=0){const c=[];c[u]=a,a=c}else a=new Map([[u,a]])}return bo(a,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const io=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;class Nb extends Ih{constructor(i,s){super(i),Object.defineProperty(this,"schema",{value:s,configurable:!0,enumerable:!1,writable:!0})}clone(i){const s=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return i&&(s.schema=i),s.items=s.items.map(a=>We(a)||Ie(a)?a.clone(i):a),this.range&&(s.range=this.range.slice()),s}addIn(i,s){if(io(i))this.add(s);else{const[a,...r]=i,u=this.get(a,!0);if(Fe(u))u.addIn(r,s);else if(u===void 0&&this.schema)this.set(a,Bu(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}deleteIn(i){const[s,...a]=i;if(a.length===0)return this.delete(s);const r=this.get(s,!0);if(Fe(r))return r.deleteIn(a);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${a}`)}getIn(i,s){const[a,...r]=i,u=this.get(a,!0);return r.length===0?!s&&Ye(u)?u.value:u:Fe(u)?u.getIn(r,s):void 0}hasAllNullValues(i){return this.items.every(s=>{if(!Ie(s))return!1;const a=s.value;return a==null||i&&Ye(a)&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn(i){const[s,...a]=i;if(a.length===0)return this.has(s);const r=this.get(s,!0);return Fe(r)?r.hasIn(a):!1}setIn(i,s){const[a,...r]=i;if(r.length===0)this.set(a,s);else{const u=this.get(a,!0);if(Fe(u))u.setIn(r,s);else if(u===void 0&&this.schema)this.set(a,Bu(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}}const IM=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function li(t,i){return/^\n+$/.test(t)?t.substring(1):i?t.replace(/^(?! *$)/gm,i):t}const vs=(t,i,s)=>t.endsWith(`
|
|
17
|
+
`)?li(s,i):s.includes(`
|
|
18
|
+
`)?`
|
|
19
|
+
`+li(s,i):(t.endsWith(" ")?"":" ")+s,Ab="flow",_h="block",xu="quoted";function ec(t,i,s="flow",{indentAtStart:a,lineWidth:r=80,minContentWidth:u=20,onFold:c,onOverflow:m}={}){if(!r||r<0)return t;r<u&&(u=0);const h=Math.max(1+u,1+r-i.length);if(t.length<=h)return t;const g=[],v={};let p=r-i.length;typeof a=="number"&&(a>r-Math.max(2,u)?g.push(0):p=r-a);let y,w,E=!1,_=-1,N=-1,S=-1;s===_h&&(_=uv(t,_,i.length),_!==-1&&(p=_+h));for(let x;x=t[_+=1];){if(s===xu&&x==="\\"){switch(N=_,t[_+1]){case"x":_+=3;break;case"u":_+=5;break;case"U":_+=9;break;default:_+=1}S=_}if(x===`
|
|
20
|
+
`)s===_h&&(_=uv(t,_,i.length)),p=_+i.length+h,y=void 0;else{if(x===" "&&w&&w!==" "&&w!==`
|
|
21
|
+
`&&w!==" "){const M=t[_+1];M&&M!==" "&&M!==`
|
|
22
|
+
`&&M!==" "&&(y=_)}if(_>=p)if(y)g.push(y),p=y+h,y=void 0;else if(s===xu){for(;w===" "||w===" ";)w=x,x=t[_+=1],E=!0;const M=_>S+1?_-2:N-1;if(v[M])return t;g.push(M),v[M]=!0,p=M+h,y=void 0}else E=!0}w=x}if(E&&m&&m(),g.length===0)return t;c&&c();let O=t.slice(0,g[0]);for(let x=0;x<g.length;++x){const M=g[x],R=g[x+1]||t.length;M===0?O=`
|
|
23
|
+
${i}${t.slice(0,R)}`:(s===xu&&v[M]&&(O+=`${t[M]}\\`),O+=`
|
|
24
|
+
${i}${t.slice(M+1,R)}`)}return O}function uv(t,i,s){let a=i,r=i+1,u=t[r];for(;u===" "||u===" ";)if(i<r+s)u=t[++i];else{do u=t[++i];while(u&&u!==`
|
|
25
|
+
`);a=i,r=i+1,u=t[r]}return a}const tc=(t,i)=>({indentAtStart:i?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),nc=t=>/^(%|---|\.\.\.)/m.test(t);function JM(t,i,s){if(!i||i<0)return!1;const a=i-s,r=t.length;if(r<=a)return!1;for(let u=0,c=0;u<r;++u)if(t[u]===`
|
|
26
|
+
`){if(u-c>a)return!0;if(c=u+1,r-c<=a)return!1}return!0}function ao(t,i){const s=JSON.stringify(t);if(i.options.doubleQuotedAsJSON)return s;const{implicitKey:a}=i,r=i.options.doubleQuotedMinMultiLineLength,u=i.indent||(nc(t)?" ":"");let c="",m=0;for(let h=0,g=s[h];g;g=s[++h])if(g===" "&&s[h+1]==="\\"&&s[h+2]==="n"&&(c+=s.slice(m,h)+"\\ ",h+=1,m=h,g="\\"),g==="\\")switch(s[h+1]){case"u":{c+=s.slice(m,h);const v=s.substr(h+2,4);switch(v){case"0000":c+="\\0";break;case"0007":c+="\\a";break;case"000b":c+="\\v";break;case"001b":c+="\\e";break;case"0085":c+="\\N";break;case"00a0":c+="\\_";break;case"2028":c+="\\L";break;case"2029":c+="\\P";break;default:v.substr(0,2)==="00"?c+="\\x"+v.substr(2):c+=s.substr(h,6)}h+=5,m=h+1}break;case"n":if(a||s[h+2]==='"'||s.length<r)h+=1;else{for(c+=s.slice(m,h)+`
|
|
27
|
+
|
|
28
|
+
`;s[h+2]==="\\"&&s[h+3]==="n"&&s[h+4]!=='"';)c+=`
|
|
29
|
+
`,h+=2;c+=u,s[h+2]===" "&&(c+="\\"),h+=1,m=h+1}break;default:h+=1}return c=m?c+s.slice(m):s,a?c:ec(c,u,xu,tc(i,!1))}function Nh(t,i){if(i.options.singleQuote===!1||i.implicitKey&&t.includes(`
|
|
30
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return ao(t,i);const s=i.indent||(nc(t)?" ":""),a="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
31
|
+
${s}`)+"'";return i.implicitKey?a:ec(a,s,Ab,tc(i,!1))}function Ol(t,i){const{singleQuote:s}=i.options;let a;if(s===!1)a=ao;else{const r=t.includes('"'),u=t.includes("'");r&&!u?a=Nh:u&&!r?a=ao:a=s?Nh:ao}return a(t,i)}let Ah;try{Ah=new RegExp(`(^|(?<!
|
|
32
|
+
))
|
|
33
|
+
+(?!
|
|
34
|
+
|$)`,"g")}catch{Ah=/\n+(?!\n|$)/g}function Eu({comment:t,type:i,value:s},a,r,u){const{blockQuote:c,commentString:m,lineWidth:h}=a.options;if(!c||/\n[\t ]+$/.test(s))return Ol(s,a);const g=a.indent||(a.forceBlockIndent||nc(s)?" ":""),v=c==="literal"?!0:c==="folded"||i===xe.BLOCK_FOLDED?!1:i===xe.BLOCK_LITERAL?!0:!JM(s,h,g.length);if(!s)return v?`|
|
|
35
|
+
`:`>
|
|
36
|
+
`;let p,y;for(y=s.length;y>0;--y){const R=s[y-1];if(R!==`
|
|
37
|
+
`&&R!==" "&&R!==" ")break}let w=s.substring(y);const E=w.indexOf(`
|
|
38
|
+
`);E===-1?p="-":s===w||E!==w.length-1?(p="+",u&&u()):p="",w&&(s=s.slice(0,-w.length),w[w.length-1]===`
|
|
39
|
+
`&&(w=w.slice(0,-1)),w=w.replace(Ah,`$&${g}`));let _=!1,N,S=-1;for(N=0;N<s.length;++N){const R=s[N];if(R===" ")_=!0;else if(R===`
|
|
40
|
+
`)S=N;else break}let O=s.substring(0,S<N?S+1:N);O&&(s=s.substring(O.length),O=O.replace(/\n+/g,`$&${g}`));let M=(_?g?"2":"1":"")+p;if(t&&(M+=" "+m(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!v){const R=s.replace(/\n+/g,`
|
|
41
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${g}`);let L=!1;const H=tc(a,!0);c!=="folded"&&i!==xe.BLOCK_FOLDED&&(H.onOverflow=()=>{L=!0});const j=ec(`${O}${R}${w}`,g,_h,H);if(!L)return`>${M}
|
|
42
|
+
${g}${j}`}return s=s.replace(/\n+/g,`$&${g}`),`|${M}
|
|
43
|
+
${g}${O}${s}${w}`}function FM(t,i,s,a){const{type:r,value:u}=t,{actualString:c,implicitKey:m,indent:h,indentStep:g,inFlow:v}=i;if(m&&u.includes(`
|
|
44
|
+
`)||v&&/[[\]{},]/.test(u))return Ol(u,i);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(u))return m||v||!u.includes(`
|
|
45
|
+
`)?Ol(u,i):Eu(t,i,s,a);if(!m&&!v&&r!==xe.PLAIN&&u.includes(`
|
|
46
|
+
`))return Eu(t,i,s,a);if(nc(u)){if(h==="")return i.forceBlockIndent=!0,Eu(t,i,s,a);if(m&&h===g)return Ol(u,i)}const p=u.replace(/\n+/g,`$&
|
|
47
|
+
${h}`);if(c){const y=_=>_.default&&_.tag!=="tag:yaml.org,2002:str"&&_.test?.test(p),{compat:w,tags:E}=i.doc.schema;if(E.some(y)||w?.some(y))return Ol(u,i)}return m?p:ec(p,h,Ab,tc(i,!1))}function Co(t,i,s,a){const{implicitKey:r,inFlow:u}=i,c=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)});let{type:m}=t;m!==xe.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(c.value)&&(m=xe.QUOTE_DOUBLE);const h=v=>{switch(v){case xe.BLOCK_FOLDED:case xe.BLOCK_LITERAL:return r||u?Ol(c.value,i):Eu(c,i,s,a);case xe.QUOTE_DOUBLE:return ao(c.value,i);case xe.QUOTE_SINGLE:return Nh(c.value,i);case xe.PLAIN:return FM(c,i,s,a);default:return null}};let g=h(m);if(g===null){const{defaultKeyType:v,defaultStringType:p}=i.options,y=r&&v||p;if(g=h(y),g===null)throw new Error(`Unsupported default string type ${y}`)}return g}function Tb(t,i){const s=Object.assign({blockQuote:!0,commentString:IM,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,i);let a;switch(s.collectionStyle){case"block":a=!1;break;case"flow":a=!0;break;default:a=null}return{anchors:new Set,doc:t,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent=="number"?" ".repeat(s.indent):" ",inFlow:a,options:s}}function WM(t,i){if(i.tag){const r=t.filter(u=>u.tag===i.tag);if(r.length>0)return r.find(u=>u.format===i.format)??r[0]}let s,a;if(Ye(i)){a=i.value;let r=t.filter(u=>u.identify?.(a));if(r.length>1){const u=r.filter(c=>c.test);u.length>0&&(r=u)}s=r.find(u=>u.format===i.format)??r.find(u=>!u.format)}else a=i,s=t.find(r=>r.nodeClass&&a instanceof r.nodeClass);if(!s){const r=a?.constructor?.name??(a===null?"null":typeof a);throw new Error(`Tag not resolved for ${r} value`)}return s}function PM(t,i,{anchors:s,doc:a}){if(!a.directives)return"";const r=[],u=(Ye(t)||Fe(t))&&t.anchor;u&&wb(u)&&(s.add(u),r.push(`&${u}`));const c=t.tag??(i.default?null:i.tag);return c&&r.push(a.directives.tagString(c)),r.join(" ")}function Gl(t,i,s,a){if(Ie(t))return t.toString(i,s,a);if(Cs(t)){if(i.doc.directives)return t.toString(i);if(i.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");i.resolvedAliases?i.resolvedAliases.add(t):i.resolvedAliases=new Set([t]),t=t.resolve(i.doc)}let r;const u=We(t)?t:i.doc.createNode(t,{onTagObj:h=>r=h});r??(r=WM(i.doc.schema.tags,u));const c=PM(u,r,i);c.length>0&&(i.indentAtStart=(i.indentAtStart??0)+c.length+1);const m=typeof r.stringify=="function"?r.stringify(u,i,s,a):Ye(u)?Co(u,i,s,a):u.toString(i,s,a);return c?Ye(u)||m[0]==="{"||m[0]==="["?`${c} ${m}`:`${c}
|
|
48
|
+
${i.indent}${m}`:m}function eC({key:t,value:i},s,a,r){const{allNullValues:u,doc:c,indent:m,indentStep:h,options:{commentString:g,indentSeq:v,simpleKeys:p}}=s;let y=We(t)&&t.comment||null;if(p){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(Fe(t)||!We(t)&&typeof t=="object"){const H="With simple keys, collection cannot be used as a key value";throw new Error(H)}}let w=!p&&(!t||y&&i==null&&!s.inFlow||Fe(t)||(Ye(t)?t.type===xe.BLOCK_FOLDED||t.type===xe.BLOCK_LITERAL:typeof t=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!w&&(p||!u),indent:m+h});let E=!1,_=!1,N=Gl(t,s,()=>E=!0,()=>_=!0);if(!w&&!s.inFlow&&N.length>1024){if(p)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");w=!0}if(s.inFlow){if(u||i==null)return E&&a&&a(),N===""?"?":w?`? ${N}`:N}else if(u&&!p||i==null&&w)return N=`? ${N}`,y&&!E?N+=vs(N,s.indent,g(y)):_&&r&&r(),N;E&&(y=null),w?(y&&(N+=vs(N,s.indent,g(y))),N=`? ${N}
|
|
49
|
+
${m}:`):(N=`${N}:`,y&&(N+=vs(N,s.indent,g(y))));let S,O,x;We(i)?(S=!!i.spaceBefore,O=i.commentBefore,x=i.comment):(S=!1,O=null,x=null,i&&typeof i=="object"&&(i=c.createNode(i))),s.implicitKey=!1,!w&&!y&&Ye(i)&&(s.indentAtStart=N.length+1),_=!1,!v&&h.length>=2&&!s.inFlow&&!w&&Il(i)&&!i.flow&&!i.tag&&!i.anchor&&(s.indent=s.indent.substring(2));let M=!1;const R=Gl(i,s,()=>M=!0,()=>_=!0);let L=" ";if(y||S||O){if(L=S?`
|
|
50
|
+
`:"",O){const H=g(O);L+=`
|
|
51
|
+
${li(H,s.indent)}`}R===""&&!s.inFlow?L===`
|
|
52
|
+
`&&x&&(L=`
|
|
53
|
+
|
|
54
|
+
`):L+=`
|
|
55
|
+
${s.indent}`}else if(!w&&Fe(i)){const H=R[0],j=R.indexOf(`
|
|
56
|
+
`),Y=j!==-1,ae=s.inFlow??i.flow??i.items.length===0;if(Y||!ae){let K=!1;if(Y&&(H==="&"||H==="!")){let I=R.indexOf(" ");H==="&"&&I!==-1&&I<j&&R[I+1]==="!"&&(I=R.indexOf(" ",I+1)),(I===-1||j<I)&&(K=!0)}K||(L=`
|
|
57
|
+
${s.indent}`)}}else(R===""||R[0]===`
|
|
58
|
+
`)&&(L="");return N+=L+R,s.inFlow?M&&a&&a():x&&!M?N+=vs(N,s.indent,g(x)):_&&r&&r(),N}function Mb(t,i){(t==="debug"||t==="warn")&&console.warn(i)}const uu="<<",ai={identify:t=>t===uu||typeof t=="symbol"&&t.description===uu,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new xe(Symbol(uu)),{addToJSMap:Cb}),stringify:()=>uu},tC=(t,i)=>(ai.identify(i)||Ye(i)&&(!i.type||i.type===xe.PLAIN)&&ai.identify(i.value))&&t?.doc.schema.tags.some(s=>s.tag===ai.tag&&s.default);function Cb(t,i,s){const a=Ob(t,s);if(Il(a))for(const r of a.items)Fd(t,i,r);else if(Array.isArray(a))for(const r of a)Fd(t,i,r);else Fd(t,i,a)}function Fd(t,i,s){const a=Ob(t,s);if(!Ql(a))throw new Error("Merge sources must be maps or map aliases");const r=a.toJSON(null,t,Map);for(const[u,c]of r)i instanceof Map?i.has(u)||i.set(u,c):i instanceof Set?i.add(u):Object.prototype.hasOwnProperty.call(i,u)||Object.defineProperty(i,u,{value:c,writable:!0,enumerable:!0,configurable:!0});return i}function Ob(t,i){return t&&Cs(i)?i.resolve(t.doc,t):i}function zb(t,i,{key:s,value:a}){if(We(s)&&s.addToJSMap)s.addToJSMap(t,i,a);else if(tC(t,s))Cb(t,i,a);else{const r=un(s,"",t);if(i instanceof Map)i.set(r,un(a,r,t));else if(i instanceof Set)i.add(r);else{const u=nC(s,r,t),c=un(a,u,t);u in i?Object.defineProperty(i,u,{value:c,writable:!0,enumerable:!0,configurable:!0}):i[u]=c}}return i}function nC(t,i,s){if(i===null)return"";if(typeof i!="object")return String(i);if(We(t)&&s?.doc){const a=Tb(s.doc,{});a.anchors=new Set;for(const u of s.anchors.keys())a.anchors.add(u.anchor);a.inFlow=!0,a.inStringifyKey=!0;const r=t.toString(a);if(!s.mapKeyWarned){let u=JSON.stringify(r);u.length>40&&(u=u.substring(0,36)+'..."'),Mb(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${u}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return r}return JSON.stringify(i)}function Jh(t,i,s){const a=bo(t,void 0,s),r=bo(i,void 0,s);return new St(a,r)}class St{constructor(i,s=null){Object.defineProperty(this,cn,{value:gb}),this.key=i,this.value=s}clone(i){let{key:s,value:a}=this;return We(s)&&(s=s.clone(i)),We(a)&&(a=a.clone(i)),new St(s,a)}toJSON(i,s){const a=s?.mapAsMap?new Map:{};return zb(s,a,this)}toString(i,s,a){return i?.doc?eC(this,i,s,a):JSON.stringify(this)}}function Db(t,i,s){return(i.inFlow??t.flow?sC:iC)(t,i,s)}function iC({comment:t,items:i},s,{blockItemPrefix:a,flowChars:r,itemIndent:u,onChompKeep:c,onComment:m}){const{indent:h,options:{commentString:g}}=s,v=Object.assign({},s,{indent:u,type:null});let p=!1;const y=[];for(let E=0;E<i.length;++E){const _=i[E];let N=null;if(We(_))!p&&_.spaceBefore&&y.push(""),ku(s,y,_.commentBefore,p),_.comment&&(N=_.comment);else if(Ie(_)){const O=We(_.key)?_.key:null;O&&(!p&&O.spaceBefore&&y.push(""),ku(s,y,O.commentBefore,p))}p=!1;let S=Gl(_,v,()=>N=null,()=>p=!0);N&&(S+=vs(S,u,g(N))),p&&N&&(p=!1),y.push(a+S)}let w;if(y.length===0)w=r.start+r.end;else{w=y[0];for(let E=1;E<y.length;++E){const _=y[E];w+=_?`
|
|
59
|
+
${h}${_}`:`
|
|
60
|
+
`}}return t?(w+=`
|
|
61
|
+
`+li(g(t),h),m&&m()):p&&c&&c(),w}function sC({items:t},i,{flowChars:s,itemIndent:a}){const{indent:r,indentStep:u,flowCollectionPadding:c,options:{commentString:m}}=i;a+=u;const h=Object.assign({},i,{indent:a,inFlow:!0,type:null});let g=!1,v=0;const p=[];for(let E=0;E<t.length;++E){const _=t[E];let N=null;if(We(_))_.spaceBefore&&p.push(""),ku(i,p,_.commentBefore,!1),_.comment&&(N=_.comment);else if(Ie(_)){const O=We(_.key)?_.key:null;O&&(O.spaceBefore&&p.push(""),ku(i,p,O.commentBefore,!1),O.comment&&(g=!0));const x=We(_.value)?_.value:null;x?(x.comment&&(N=x.comment),x.commentBefore&&(g=!0)):_.value==null&&O?.comment&&(N=O.comment)}N&&(g=!0);let S=Gl(_,h,()=>N=null);g||(g=p.length>v||S.includes(`
|
|
62
|
+
`)),E<t.length-1?S+=",":i.options.trailingComma&&(i.options.lineWidth>0&&(g||(g=p.reduce((O,x)=>O+x.length+2,2)+(S.length+2)>i.options.lineWidth)),g&&(S+=",")),N&&(S+=vs(S,a,m(N))),p.push(S),v=p.length}const{start:y,end:w}=s;if(p.length===0)return y+w;if(!g){const E=p.reduce((_,N)=>_+N.length+2,2);g=i.options.lineWidth>0&&E>i.options.lineWidth}if(g){let E=y;for(const _ of p)E+=_?`
|
|
63
|
+
${u}${r}${_}`:`
|
|
64
|
+
`;return`${E}
|
|
65
|
+
${r}${w}`}else return`${y}${c}${p.join(" ")}${c}${w}`}function ku({indent:t,options:{commentString:i}},s,a,r){if(a&&r&&(a=a.replace(/^\n+/,"")),a){const u=li(i(a),t);s.push(u.trimStart())}}function bs(t,i){const s=Ye(i)?i.value:i;for(const a of t)if(Ie(a)&&(a.key===i||a.key===s||Ye(a.key)&&a.key.value===s))return a}class Zt extends Nb{static get tagName(){return"tag:yaml.org,2002:map"}constructor(i){super(Xi,i),this.items=[]}static from(i,s,a){const{keepUndefined:r,replacer:u}=a,c=new this(i),m=(h,g)=>{if(typeof u=="function")g=u.call(s,h,g);else if(Array.isArray(u)&&!u.includes(h))return;(g!==void 0||r)&&c.items.push(Jh(h,g,a))};if(s instanceof Map)for(const[h,g]of s)m(h,g);else if(s&&typeof s=="object")for(const h of Object.keys(s))m(h,s[h]);return typeof i.sortMapEntries=="function"&&c.items.sort(i.sortMapEntries),c}add(i,s){let a;Ie(i)?a=i:!i||typeof i!="object"||!("key"in i)?a=new St(i,i?.value):a=new St(i.key,i.value);const r=bs(this.items,a.key),u=this.schema?.sortMapEntries;if(r){if(!s)throw new Error(`Key ${a.key} already set`);Ye(r.value)&&_b(a.value)?r.value.value=a.value:r.value=a.value}else if(u){const c=this.items.findIndex(m=>u(a,m)<0);c===-1?this.items.push(a):this.items.splice(c,0,a)}else this.items.push(a)}delete(i){const s=bs(this.items,i);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(i,s){const r=bs(this.items,i)?.value;return(!s&&Ye(r)?r.value:r)??void 0}has(i){return!!bs(this.items,i)}set(i,s){this.add(new St(i,s),!0)}toJSON(i,s,a){const r=a?new a:s?.mapAsMap?new Map:{};s?.onCreate&&s.onCreate(r);for(const u of this.items)zb(s,r,u);return r}toString(i,s,a){if(!i)return JSON.stringify(this);for(const r of this.items)if(!Ie(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!i.allNullValues&&this.hasAllNullValues(!1)&&(i=Object.assign({},i,{allNullValues:!0})),Db(this,i,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:i.indent||"",onChompKeep:a,onComment:s})}}const Jl={collection:"map",default:!0,nodeClass:Zt,tag:"tag:yaml.org,2002:map",resolve(t,i){return Ql(t)||i("Expected a mapping for this tag"),t},createNode:(t,i,s)=>Zt.from(t,i,s)};class Ki extends Nb{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(i){super(Zl,i),this.items=[]}add(i){this.items.push(i)}delete(i){const s=cu(i);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(i,s){const a=cu(i);if(typeof a!="number")return;const r=this.items[a];return!s&&Ye(r)?r.value:r}has(i){const s=cu(i);return typeof s=="number"&&s<this.items.length}set(i,s){const a=cu(i);if(typeof a!="number")throw new Error(`Expected a valid index, not ${i}.`);const r=this.items[a];Ye(r)&&_b(s)?r.value=s:this.items[a]=s}toJSON(i,s){const a=[];s?.onCreate&&s.onCreate(a);let r=0;for(const u of this.items)a.push(un(u,String(r++),s));return a}toString(i,s,a){return i?Db(this,i,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(i.indent||"")+" ",onChompKeep:a,onComment:s}):JSON.stringify(this)}static from(i,s,a){const{replacer:r}=a,u=new this(i);if(s&&Symbol.iterator in Object(s)){let c=0;for(let m of s){if(typeof r=="function"){const h=s instanceof Set?m:String(c++);m=r.call(s,h,m)}u.items.push(bo(m,void 0,a))}}return u}}function cu(t){let i=Ye(t)?t.value:t;return i&&typeof i=="string"&&(i=Number(i)),typeof i=="number"&&Number.isInteger(i)&&i>=0?i:null}const Fl={collection:"seq",default:!0,nodeClass:Ki,tag:"tag:yaml.org,2002:seq",resolve(t,i){return Il(t)||i("Expected a sequence for this tag"),t},createNode:(t,i,s)=>Ki.from(t,i,s)},ic={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,i,s,a){return i=Object.assign({actualString:!0},i),Co(t,i,s,a)}},sc={identify:t=>t==null,createNode:()=>new xe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new xe(null),stringify:({source:t},i)=>typeof t=="string"&&sc.test.test(t)?t:i.options.nullStr},Fh={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new xe(t[0]==="t"||t[0]==="T"),stringify({source:t,value:i},s){if(t&&Fh.test.test(t)){const a=t[0]==="t"||t[0]==="T";if(i===a)return t}return i?s.options.trueStr:s.options.falseStr}};function En({format:t,minFractionDigits:i,tag:s,value:a}){if(typeof a=="bigint")return String(a);const r=typeof a=="number"?a:Number(a);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let u=Object.is(a,-0)?"-0":JSON.stringify(a);if(!t&&i&&(!s||s==="tag:yaml.org,2002:float")&&/^-?\d/.test(u)&&!u.includes("e")){let c=u.indexOf(".");c<0&&(c=u.length,u+=".");let m=i-(u.length-c-1);for(;m-- >0;)u+="0"}return u}const Lb={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:En},Rb={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const i=Number(t.value);return isFinite(i)?i.toExponential():En(t)}},Bb={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const i=new xe(parseFloat(t)),s=t.indexOf(".");return s!==-1&&t[t.length-1]==="0"&&(i.minFractionDigits=t.length-s-1),i},stringify:En},lc=t=>typeof t=="bigint"||Number.isInteger(t),Wh=(t,i,s,{intAsBigInt:a})=>a?BigInt(t):parseInt(t.substring(i),s);function kb(t,i,s){const{value:a}=t;return lc(a)&&a>=0?s+a.toString(i):En(t)}const Hb={identify:t=>lc(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,i,s)=>Wh(t,2,8,s),stringify:t=>kb(t,8,"0o")},jb={identify:lc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,i,s)=>Wh(t,0,10,s),stringify:En},$b={identify:t=>lc(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,i,s)=>Wh(t,2,16,s),stringify:t=>kb(t,16,"0x")},lC=[Jl,Fl,ic,sc,Fh,Hb,jb,$b,Lb,Rb,Bb];function cv(t){return typeof t=="bigint"||Number.isInteger(t)}const fu=({value:t})=>JSON.stringify(t),aC=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:fu},{identify:t=>t==null,createNode:()=>new xe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:fu},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:fu},{identify:cv,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,i,{intAsBigInt:s})=>s?BigInt(t):parseInt(t,10),stringify:({value:t})=>cv(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:fu}],oC={default:!0,tag:"",test:/^/,resolve(t,i){return i(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},rC=[Jl,Fl].concat(aC,oC),Ph={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,i){if(typeof atob=="function"){const s=atob(t.replace(/[\n\r]/g,"")),a=new Uint8Array(s.length);for(let r=0;r<s.length;++r)a[r]=s.charCodeAt(r);return a}else return i("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:i,value:s},a,r,u){if(!s)return"";const c=s;let m;if(typeof btoa=="function"){let h="";for(let g=0;g<c.length;++g)h+=String.fromCharCode(c[g]);m=btoa(h)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(i??(i=xe.BLOCK_LITERAL),i!==xe.QUOTE_DOUBLE){const h=Math.max(a.options.lineWidth-a.indent.length,a.options.minContentWidth),g=Math.ceil(m.length/h),v=new Array(g);for(let p=0,y=0;p<g;++p,y+=h)v[p]=m.substr(y,h);m=v.join(i===xe.BLOCK_LITERAL?`
|
|
66
|
+
`:" ")}return Co({comment:t,type:i,value:m},a,r,u)}};function Ub(t,i){if(Il(t))for(let s=0;s<t.items.length;++s){let a=t.items[s];if(!Ie(a)){if(Ql(a)){a.items.length>1&&i("Each pair must have its own sequence indicator");const r=a.items[0]||new St(new xe(null));if(a.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${a.commentBefore}
|
|
67
|
+
${r.key.commentBefore}`:a.commentBefore),a.comment){const u=r.value??r.key;u.comment=u.comment?`${a.comment}
|
|
68
|
+
${u.comment}`:a.comment}a=r}t.items[s]=Ie(a)?a:new St(a)}}else i("Expected a sequence for this tag");return t}function qb(t,i,s){const{replacer:a}=s,r=new Ki(t);r.tag="tag:yaml.org,2002:pairs";let u=0;if(i&&Symbol.iterator in Object(i))for(let c of i){typeof a=="function"&&(c=a.call(i,String(u++),c));let m,h;if(Array.isArray(c))if(c.length===2)m=c[0],h=c[1];else throw new TypeError(`Expected [key, value] tuple: ${c}`);else if(c&&c instanceof Object){const g=Object.keys(c);if(g.length===1)m=g[0],h=c[m];else throw new TypeError(`Expected tuple with one key, not ${g.length} keys`)}else m=c;r.items.push(Jh(m,h,s))}return r}const em={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ub,createNode:qb};class Rl extends Ki{constructor(){super(),this.add=Zt.prototype.add.bind(this),this.delete=Zt.prototype.delete.bind(this),this.get=Zt.prototype.get.bind(this),this.has=Zt.prototype.has.bind(this),this.set=Zt.prototype.set.bind(this),this.tag=Rl.tag}toJSON(i,s){if(!s)return super.toJSON(i);const a=new Map;s?.onCreate&&s.onCreate(a);for(const r of this.items){let u,c;if(Ie(r)?(u=un(r.key,"",s),c=un(r.value,u,s)):u=un(r,"",s),a.has(u))throw new Error("Ordered maps must not include duplicate keys");a.set(u,c)}return a}static from(i,s,a){const r=qb(i,s,a),u=new this;return u.items=r.items,u}}Rl.tag="tag:yaml.org,2002:omap";const tm={collection:"seq",identify:t=>t instanceof Map,nodeClass:Rl,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,i){const s=Ub(t,i),a=[];for(const{key:r}of s.items)Ye(r)&&(a.includes(r.value)?i(`Ordered maps must not include duplicate keys: ${r.value}`):a.push(r.value));return Object.assign(new Rl,s)},createNode:(t,i,s)=>Rl.from(t,i,s)};function Vb({value:t,source:i},s){return i&&(t?Yb:Gb).test.test(i)?i:t?s.options.trueStr:s.options.falseStr}const Yb={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new xe(!0),stringify:Vb},Gb={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new xe(!1),stringify:Vb},uC={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:En},cC={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const i=Number(t.value);return isFinite(i)?i.toExponential():En(t)}},fC={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const i=new xe(parseFloat(t.replace(/_/g,""))),s=t.indexOf(".");if(s!==-1){const a=t.substring(s+1).replace(/_/g,"");a[a.length-1]==="0"&&(i.minFractionDigits=a.length)}return i},stringify:En},Oo=t=>typeof t=="bigint"||Number.isInteger(t);function ac(t,i,s,{intAsBigInt:a}){const r=t[0];if((r==="-"||r==="+")&&(i+=1),t=t.substring(i).replace(/_/g,""),a){switch(s){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}const c=BigInt(t);return r==="-"?BigInt(-1)*c:c}const u=parseInt(t,s);return r==="-"?-1*u:u}function nm(t,i,s){const{value:a}=t;if(Oo(a)){const r=a.toString(i);return a<0?"-"+s+r.substr(1):s+r}return En(t)}const dC={identify:Oo,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,i,s)=>ac(t,2,2,s),stringify:t=>nm(t,2,"0b")},hC={identify:Oo,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,i,s)=>ac(t,1,8,s),stringify:t=>nm(t,8,"0")},mC={identify:Oo,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,i,s)=>ac(t,0,10,s),stringify:En},gC={identify:Oo,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,i,s)=>ac(t,2,16,s),stringify:t=>nm(t,16,"0x")};class Bl extends Zt{constructor(i){super(i),this.tag=Bl.tag}add(i){let s;Ie(i)?s=i:i&&typeof i=="object"&&"key"in i&&"value"in i&&i.value===null?s=new St(i.key,null):s=new St(i,null),bs(this.items,s.key)||this.items.push(s)}get(i,s){const a=bs(this.items,i);return!s&&Ie(a)?Ye(a.key)?a.key.value:a.key:a}set(i,s){if(typeof s!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof s}`);const a=bs(this.items,i);a&&!s?this.items.splice(this.items.indexOf(a),1):!a&&s&&this.items.push(new St(i))}toJSON(i,s){return super.toJSON(i,s,Set)}toString(i,s,a){if(!i)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},i,{allNullValues:!0}),s,a);throw new Error("Set items must all have null values")}static from(i,s,a){const{replacer:r}=a,u=new this(i);if(s&&Symbol.iterator in Object(s))for(let c of s)typeof r=="function"&&(c=r.call(s,c,c)),u.items.push(Jh(c,null,a));return u}}Bl.tag="tag:yaml.org,2002:set";const im={collection:"map",identify:t=>t instanceof Set,nodeClass:Bl,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,i,s)=>Bl.from(t,i,s),resolve(t,i){if(Ql(t)){if(t.hasAllNullValues(!0))return Object.assign(new Bl,t);i("Set items must all have null values")}else i("Expected a mapping for this tag");return t}};function sm(t,i){const s=t[0],a=s==="-"||s==="+"?t.substring(1):t,r=c=>i?BigInt(c):Number(c),u=a.replace(/_/g,"").split(":").reduce((c,m)=>c*r(60)+r(m),r(0));return s==="-"?r(-1)*u:u}function Xb(t){let{value:i}=t,s=c=>c;if(typeof i=="bigint")s=c=>BigInt(c);else if(isNaN(i)||!isFinite(i))return En(t);let a="";i<0&&(a="-",i*=s(-1));const r=s(60),u=[i%r];return i<60?u.unshift(0):(i=(i-u[0])/r,u.unshift(i%r),i>=60&&(i=(i-u[0])/r,u.unshift(i))),a+u.map(c=>String(c).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Kb={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,i,{intAsBigInt:s})=>sm(t,s),stringify:Xb},Zb={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>sm(t,!1),stringify:Xb},oc={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){const i=t.match(oc.test);if(!i)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,a,r,u,c,m]=i.map(Number),h=i[7]?Number((i[7]+"00").substr(1,3)):0;let g=Date.UTC(s,a-1,r,u||0,c||0,m||0,h);const v=i[8];if(v&&v!=="Z"){let p=sm(v,!1);Math.abs(p)<30&&(p*=60),g-=6e4*p}return new Date(g)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},fv=[Jl,Fl,ic,sc,Yb,Gb,dC,hC,mC,gC,uC,cC,fC,Ph,ai,tm,em,im,Kb,Zb,oc],dv=new Map([["core",lC],["failsafe",[Jl,Fl,ic]],["json",rC],["yaml11",fv],["yaml-1.1",fv]]),hv={binary:Ph,bool:Fh,float:Bb,floatExp:Rb,floatNaN:Lb,floatTime:Zb,int:jb,intHex:$b,intOct:Hb,intTime:Kb,map:Jl,merge:ai,null:sc,omap:tm,pairs:em,seq:Fl,set:im,timestamp:oc},pC={"tag:yaml.org,2002:binary":Ph,"tag:yaml.org,2002:merge":ai,"tag:yaml.org,2002:omap":tm,"tag:yaml.org,2002:pairs":em,"tag:yaml.org,2002:set":im,"tag:yaml.org,2002:timestamp":oc};function Wd(t,i,s){const a=dv.get(i);if(a&&!t)return s&&!a.includes(ai)?a.concat(ai):a.slice();let r=a;if(!r)if(Array.isArray(t))r=[];else{const u=Array.from(dv.keys()).filter(c=>c!=="yaml11").map(c=>JSON.stringify(c)).join(", ");throw new Error(`Unknown schema "${i}"; use one of ${u} or define customTags array`)}if(Array.isArray(t))for(const u of t)r=r.concat(u);else typeof t=="function"&&(r=t(r.slice()));return s&&(r=r.concat(ai)),r.reduce((u,c)=>{const m=typeof c=="string"?hv[c]:c;if(!m){const h=JSON.stringify(c),g=Object.keys(hv).map(v=>JSON.stringify(v)).join(", ");throw new Error(`Unknown custom tag ${h}; use one of ${g}`)}return u.includes(m)||u.push(m),u},[])}const yC=(t,i)=>t.key<i.key?-1:t.key>i.key?1:0;class rc{constructor({compat:i,customTags:s,merge:a,resolveKnownTags:r,schema:u,sortMapEntries:c,toStringDefaults:m}){this.compat=Array.isArray(i)?Wd(i,"compat"):i?Wd(null,i):null,this.name=typeof u=="string"&&u||"core",this.knownTags=r?pC:{},this.tags=Wd(s,this.name,a),this.toStringOptions=m??null,Object.defineProperty(this,Xi,{value:Jl}),Object.defineProperty(this,Ln,{value:ic}),Object.defineProperty(this,Zl,{value:Fl}),this.sortMapEntries=typeof c=="function"?c:c===!0?yC:null}clone(){const i=Object.create(rc.prototype,Object.getOwnPropertyDescriptors(this));return i.tags=this.tags.slice(),i}}function vC(t,i){const s=[];let a=i.directives===!0;if(i.directives!==!1&&t.directives){const h=t.directives.toString(t);h?(s.push(h),a=!0):t.directives.docStart&&(a=!0)}a&&s.push("---");const r=Tb(t,i),{commentString:u}=r.options;if(t.commentBefore){s.length!==1&&s.unshift("");const h=u(t.commentBefore);s.unshift(li(h,""))}let c=!1,m=null;if(t.contents){if(We(t.contents)){if(t.contents.spaceBefore&&a&&s.push(""),t.contents.commentBefore){const v=u(t.contents.commentBefore);s.push(li(v,""))}r.forceBlockIndent=!!t.comment,m=t.contents.comment}const h=m?void 0:()=>c=!0;let g=Gl(t.contents,r,()=>m=null,h);m&&(g+=vs(g,"",u(m))),(g[0]==="|"||g[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${g}`:s.push(g)}else s.push(Gl(t.contents,r));if(t.directives?.docEnd)if(t.comment){const h=u(t.comment);h.includes(`
|
|
69
|
+
`)?(s.push("..."),s.push(li(h,""))):s.push(`... ${h}`)}else s.push("...");else{let h=t.comment;h&&c&&(h=h.replace(/^\n+/,"")),h&&((!c||m)&&s[s.length-1]!==""&&s.push(""),s.push(li(u(h),"")))}return s.join(`
|
|
70
|
+
`)+`
|
|
71
|
+
`}class Wl{constructor(i,s,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,cn,{value:Eh});let r=null;typeof s=="function"||Array.isArray(s)?r=s:a===void 0&&s&&(a=s,s=void 0);const u=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},a);this.options=u;let{version:c}=u;a?._directives?(this.directives=a._directives.atDocument(),this.directives.yaml.explicit&&(c=this.directives.yaml.version)):this.directives=new _t({version:c}),this.setSchema(c,a),this.contents=i===void 0?null:this.createNode(i,r,a)}clone(){const i=Object.create(Wl.prototype,{[cn]:{value:Eh}});return i.commentBefore=this.commentBefore,i.comment=this.comment,i.errors=this.errors.slice(),i.warnings=this.warnings.slice(),i.options=Object.assign({},this.options),this.directives&&(i.directives=this.directives.clone()),i.schema=this.schema.clone(),i.contents=We(this.contents)?this.contents.clone(i.schema):this.contents,this.range&&(i.range=this.range.slice()),i}add(i){wl(this.contents)&&this.contents.add(i)}addIn(i,s){wl(this.contents)&&this.contents.addIn(i,s)}createAlias(i,s){if(!i.anchor){const a=xb(this);i.anchor=!s||a.has(s)?Eb(s||"a",a):s}return new Pu(i.anchor)}createNode(i,s,a){let r;if(typeof s=="function")i=s.call({"":i},"",i),r=s;else if(Array.isArray(s)){const N=O=>typeof O=="number"||O instanceof String||O instanceof Number,S=s.filter(N).map(String);S.length>0&&(s=s.concat(S)),r=s}else a===void 0&&s&&(a=s,s=void 0);const{aliasDuplicateObjects:u,anchorPrefix:c,flow:m,keepUndefined:h,onTagObj:g,tag:v}=a??{},{onAnchor:p,setAnchors:y,sourceObjects:w}=KM(this,c||"a"),E={aliasDuplicateObjects:u??!0,keepUndefined:h??!1,onAnchor:p,onTagObj:g,replacer:r,schema:this.schema,sourceObjects:w},_=bo(i,v,E);return m&&Fe(_)&&(_.flow=!0),y(),_}createPair(i,s,a={}){const r=this.createNode(i,null,a),u=this.createNode(s,null,a);return new St(r,u)}delete(i){return wl(this.contents)?this.contents.delete(i):!1}deleteIn(i){return io(i)?this.contents==null?!1:(this.contents=null,!0):wl(this.contents)?this.contents.deleteIn(i):!1}get(i,s){return Fe(this.contents)?this.contents.get(i,s):void 0}getIn(i,s){return io(i)?!s&&Ye(this.contents)?this.contents.value:this.contents:Fe(this.contents)?this.contents.getIn(i,s):void 0}has(i){return Fe(this.contents)?this.contents.has(i):!1}hasIn(i){return io(i)?this.contents!==void 0:Fe(this.contents)?this.contents.hasIn(i):!1}set(i,s){this.contents==null?this.contents=Bu(this.schema,[i],s):wl(this.contents)&&this.contents.set(i,s)}setIn(i,s){io(i)?this.contents=s:this.contents==null?this.contents=Bu(this.schema,Array.from(i),s):wl(this.contents)&&this.contents.setIn(i,s)}setSchema(i,s={}){typeof i=="number"&&(i=String(i));let a;switch(i){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new _t({version:"1.1"}),a={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=i:this.directives=new _t({version:i}),a={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,a=null;break;default:{const r=JSON.stringify(i);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(s.schema instanceof Object)this.schema=s.schema;else if(a)this.schema=new rc(Object.assign(a,s));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:i,jsonArg:s,mapAsMap:a,maxAliasCount:r,onAnchor:u,reviver:c}={}){const m={anchors:new Map,doc:this,keep:!i,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},h=un(this.contents,s??"",m);if(typeof u=="function")for(const{count:g,res:v}of m.anchors.values())u(v,g);return typeof c=="function"?Cl(c,{"":h},"",h):h}toJSON(i,s){return this.toJS({json:!0,jsonArg:i,mapAsMap:!1,onAnchor:s})}toString(i={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in i&&(!Number.isInteger(i.indent)||Number(i.indent)<=0)){const s=JSON.stringify(i.indent);throw new Error(`"indent" option must be a positive integer, not ${s}`)}return vC(this,i)}}function wl(t){if(Fe(t))return!0;throw new Error("Expected a YAML collection as document contents")}class lm extends Error{constructor(i,s,a,r){super(),this.name=i,this.code=a,this.message=r,this.pos=s}}class Ss extends lm{constructor(i,s,a){super("YAMLParseError",i,s,a)}}class Qb extends lm{constructor(i,s,a){super("YAMLWarning",i,s,a)}}const Hu=(t,i)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(m=>i.linePos(m));const{line:a,col:r}=s.linePos[0];s.message+=` at line ${a}, column ${r}`;let u=r-1,c=t.substring(i.lineStarts[a-1],i.lineStarts[a]).replace(/[\n\r]+$/,"");if(u>=60&&c.length>80){const m=Math.min(u-39,c.length-79);c="…"+c.substring(m),u-=m-1}if(c.length>80&&(c=c.substring(0,79)+"…"),a>1&&/^ *$/.test(c.substring(0,u))){let m=t.substring(i.lineStarts[a-2],i.lineStarts[a-1]);m.length>80&&(m=m.substring(0,79)+`…
|
|
72
|
+
`),c=m+c}if(/[^ ]/.test(c)){let m=1;const h=s.linePos[1];h?.line===a&&h.col>r&&(m=Math.max(1,Math.min(h.col-r,80-u)));const g=" ".repeat(u)+"^".repeat(m);s.message+=`:
|
|
73
|
+
|
|
74
|
+
${c}
|
|
75
|
+
${g}
|
|
76
|
+
`}};function Xl(t,{flow:i,indicator:s,next:a,offset:r,onError:u,parentIndent:c,startOnNewline:m}){let h=!1,g=m,v=m,p="",y="",w=!1,E=!1,_=null,N=null,S=null,O=null,x=null,M=null,R=null;for(const j of t)switch(E&&(j.type!=="space"&&j.type!=="newline"&&j.type!=="comma"&&u(j.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),E=!1),_&&(g&&j.type!=="comment"&&j.type!=="newline"&&u(_,"TAB_AS_INDENT","Tabs are not allowed as indentation"),_=null),j.type){case"space":!i&&(s!=="doc-start"||a?.type!=="flow-collection")&&j.source.includes(" ")&&(_=j),v=!0;break;case"comment":{v||u(j,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const Y=j.source.substring(1)||" ";p?p+=y+Y:p=Y,y="",g=!1;break}case"newline":g?p?p+=j.source:(!M||s!=="seq-item-ind")&&(h=!0):y+=j.source,g=!0,w=!0,(N||S)&&(O=j),v=!0;break;case"anchor":N&&u(j,"MULTIPLE_ANCHORS","A node can have at most one anchor"),j.source.endsWith(":")&&u(j.offset+j.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),N=j,R??(R=j.offset),g=!1,v=!1,E=!0;break;case"tag":{S&&u(j,"MULTIPLE_TAGS","A node can have at most one tag"),S=j,R??(R=j.offset),g=!1,v=!1,E=!0;break}case s:(N||S)&&u(j,"BAD_PROP_ORDER",`Anchors and tags must be after the ${j.source} indicator`),M&&u(j,"UNEXPECTED_TOKEN",`Unexpected ${j.source} in ${i??"collection"}`),M=j,g=s==="seq-item-ind"||s==="explicit-key-ind",v=!1;break;case"comma":if(i){x&&u(j,"UNEXPECTED_TOKEN",`Unexpected , in ${i}`),x=j,g=!1,v=!1;break}default:u(j,"UNEXPECTED_TOKEN",`Unexpected ${j.type} token`),g=!1,v=!1}const L=t[t.length-1],H=L?L.offset+L.source.length:r;return E&&a&&a.type!=="space"&&a.type!=="newline"&&a.type!=="comma"&&(a.type!=="scalar"||a.source!=="")&&u(a.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),_&&(g&&_.indent<=c||a?.type==="block-map"||a?.type==="block-seq")&&u(_,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:x,found:M,spaceBefore:h,comment:p,hasNewline:w,anchor:N,tag:S,newlineAfterProp:O,end:H,start:R??H}}function So(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
77
|
+
`))return!0;if(t.end){for(const i of t.end)if(i.type==="newline")return!0}return!1;case"flow-collection":for(const i of t.items){for(const s of i.start)if(s.type==="newline")return!0;if(i.sep){for(const s of i.sep)if(s.type==="newline")return!0}if(So(i.key)||So(i.value))return!0}return!1;default:return!0}}function Th(t,i,s){if(i?.type==="flow-collection"){const a=i.end[0];a.indent===t&&(a.source==="]"||a.source==="}")&&So(i)&&s(a,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Ib(t,i,s){const{uniqueKeys:a}=t.options;if(a===!1)return!1;const r=typeof a=="function"?a:(u,c)=>u===c||Ye(u)&&Ye(c)&&u.value===c.value;return i.some(u=>r(u.key,s))}const mv="All mapping items must start at the same column";function bC({composeNode:t,composeEmptyNode:i},s,a,r,u){const c=u?.nodeClass??Zt,m=new c(s.schema);s.atRoot&&(s.atRoot=!1);let h=a.offset,g=null;for(const v of a.items){const{start:p,key:y,sep:w,value:E}=v,_=Xl(p,{indicator:"explicit-key-ind",next:y??w?.[0],offset:h,onError:r,parentIndent:a.indent,startOnNewline:!0}),N=!_.found;if(N){if(y&&(y.type==="block-seq"?r(h,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==a.indent&&r(h,"BAD_INDENT",mv)),!_.anchor&&!_.tag&&!w){g=_.end,_.comment&&(m.comment?m.comment+=`
|
|
78
|
+
`+_.comment:m.comment=_.comment);continue}(_.newlineAfterProp||So(y))&&r(y??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else _.found?.indent!==a.indent&&r(h,"BAD_INDENT",mv);s.atKey=!0;const S=_.end,O=y?t(s,y,_,r):i(s,S,p,null,_,r);s.schema.compat&&Th(a.indent,y,r),s.atKey=!1,Ib(s,m.items,O)&&r(S,"DUPLICATE_KEY","Map keys must be unique");const x=Xl(w??[],{indicator:"map-value-ind",next:E,offset:O.range[2],onError:r,parentIndent:a.indent,startOnNewline:!y||y.type==="block-scalar"});if(h=x.end,x.found){N&&(E?.type==="block-map"&&!x.hasNewline&&r(h,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&_.start<x.found.offset-1024&&r(O.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const M=E?t(s,E,x,r):i(s,h,w,null,x,r);s.schema.compat&&Th(a.indent,E,r),h=M.range[2];const R=new St(O,M);s.options.keepSourceTokens&&(R.srcToken=v),m.items.push(R)}else{N&&r(O.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),x.comment&&(O.comment?O.comment+=`
|
|
79
|
+
`+x.comment:O.comment=x.comment);const M=new St(O);s.options.keepSourceTokens&&(M.srcToken=v),m.items.push(M)}}return g&&g<h&&r(g,"IMPOSSIBLE","Map comment with trailing content"),m.range=[a.offset,h,g??h],m}function SC({composeNode:t,composeEmptyNode:i},s,a,r,u){const c=u?.nodeClass??Ki,m=new c(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let h=a.offset,g=null;for(const{start:v,value:p}of a.items){const y=Xl(v,{indicator:"seq-item-ind",next:p,offset:h,onError:r,parentIndent:a.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||p)p?.type==="block-seq"?r(y.end,"BAD_INDENT","All sequence items must start at the same column"):r(h,"MISSING_CHAR","Sequence item without - indicator");else{g=y.end,y.comment&&(m.comment=y.comment);continue}const w=p?t(s,p,y,r):i(s,y.end,v,null,y,r);s.schema.compat&&Th(a.indent,p,r),h=w.range[2],m.items.push(w)}return m.range=[a.offset,h,g??h],m}function zo(t,i,s,a){let r="";if(t){let u=!1,c="";for(const m of t){const{source:h,type:g}=m;switch(g){case"space":u=!0;break;case"comment":{s&&!u&&a(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const v=h.substring(1)||" ";r?r+=c+v:r=v,c="";break}case"newline":r&&(c+=h),u=!0;break;default:a(m,"UNEXPECTED_TOKEN",`Unexpected ${g} at node end`)}i+=h.length}}return{comment:r,offset:i}}const Pd="Block collections are not allowed within flow collections",eh=t=>t&&(t.type==="block-map"||t.type==="block-seq");function wC({composeNode:t,composeEmptyNode:i},s,a,r,u){const c=a.start.source==="{",m=c?"flow map":"flow sequence",h=u?.nodeClass??(c?Zt:Ki),g=new h(s.schema);g.flow=!0;const v=s.atRoot;v&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let p=a.offset+a.start.source.length;for(let N=0;N<a.items.length;++N){const S=a.items[N],{start:O,key:x,sep:M,value:R}=S,L=Xl(O,{flow:m,indicator:"explicit-key-ind",next:x??M?.[0],offset:p,onError:r,parentIndent:a.indent,startOnNewline:!1});if(!L.found){if(!L.anchor&&!L.tag&&!M&&!R){N===0&&L.comma?r(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${m}`):N<a.items.length-1&&r(L.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${m}`),L.comment&&(g.comment?g.comment+=`
|
|
80
|
+
`+L.comment:g.comment=L.comment),p=L.end;continue}!c&&s.options.strict&&So(x)&&r(x,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(N===0)L.comma&&r(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${m}`);else if(L.comma||r(L.start,"MISSING_CHAR",`Missing , between ${m} items`),L.comment){let H="";e:for(const j of O)switch(j.type){case"comma":case"space":break;case"comment":H=j.source.substring(1);break e;default:break e}if(H){let j=g.items[g.items.length-1];Ie(j)&&(j=j.value??j.key),j.comment?j.comment+=`
|
|
81
|
+
`+H:j.comment=H,L.comment=L.comment.substring(H.length+1)}}if(!c&&!M&&!L.found){const H=R?t(s,R,L,r):i(s,L.end,M,null,L,r);g.items.push(H),p=H.range[2],eh(R)&&r(H.range,"BLOCK_IN_FLOW",Pd)}else{s.atKey=!0;const H=L.end,j=x?t(s,x,L,r):i(s,H,O,null,L,r);eh(x)&&r(j.range,"BLOCK_IN_FLOW",Pd),s.atKey=!1;const Y=Xl(M??[],{flow:m,indicator:"map-value-ind",next:R,offset:j.range[2],onError:r,parentIndent:a.indent,startOnNewline:!1});if(Y.found){if(!c&&!L.found&&s.options.strict){if(M)for(const I of M){if(I===Y.found)break;if(I.type==="newline"){r(I,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}L.start<Y.found.offset-1024&&r(Y.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else R&&("source"in R&&R.source?.[0]===":"?r(R,"MISSING_CHAR",`Missing space after : in ${m}`):r(Y.start,"MISSING_CHAR",`Missing , or : between ${m} items`));const ae=R?t(s,R,Y,r):Y.found?i(s,Y.end,M,null,Y,r):null;ae?eh(R)&&r(ae.range,"BLOCK_IN_FLOW",Pd):Y.comment&&(j.comment?j.comment+=`
|
|
82
|
+
`+Y.comment:j.comment=Y.comment);const K=new St(j,ae);if(s.options.keepSourceTokens&&(K.srcToken=S),c){const I=g;Ib(s,I.items,j)&&r(H,"DUPLICATE_KEY","Map keys must be unique"),I.items.push(K)}else{const I=new Zt(s.schema);I.flow=!0,I.items.push(K);const oe=(ae??j).range;I.range=[j.range[0],oe[1],oe[2]],g.items.push(I)}p=ae?ae.range[2]:Y.end}}const y=c?"}":"]",[w,...E]=a.end;let _=p;if(w?.source===y)_=w.offset+w.source.length;else{const N=m[0].toUpperCase()+m.substring(1),S=v?`${N} must end with a ${y}`:`${N} in block collection must be sufficiently indented and end with a ${y}`;r(p,v?"MISSING_CHAR":"BAD_INDENT",S),w&&w.source.length!==1&&E.unshift(w)}if(E.length>0){const N=zo(E,_,s.options.strict,r);N.comment&&(g.comment?g.comment+=`
|
|
83
|
+
`+N.comment:g.comment=N.comment),g.range=[a.offset,_,N.offset]}else g.range=[a.offset,_,_];return g}function th(t,i,s,a,r,u){const c=s.type==="block-map"?bC(t,i,s,a,u):s.type==="block-seq"?SC(t,i,s,a,u):wC(t,i,s,a,u),m=c.constructor;return r==="!"||r===m.tagName?(c.tag=m.tagName,c):(r&&(c.tag=r),c)}function xC(t,i,s,a,r){const u=a.tag,c=u?i.directives.tagName(u.source,y=>r(u,"TAG_RESOLVE_FAILED",y)):null;if(s.type==="block-seq"){const{anchor:y,newlineAfterProp:w}=a,E=y&&u?y.offset>u.offset?y:u:y??u;E&&(!w||w.offset<E.offset)&&r(E,"MISSING_CHAR","Missing newline after block sequence props")}const m=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!u||!c||c==="!"||c===Zt.tagName&&m==="map"||c===Ki.tagName&&m==="seq")return th(t,i,s,r,c);let h=i.schema.tags.find(y=>y.tag===c&&y.collection===m);if(!h){const y=i.schema.knownTags[c];if(y?.collection===m)i.schema.tags.push(Object.assign({},y,{default:!1})),h=y;else return y?r(u,"BAD_COLLECTION_TYPE",`${y.tag} used for ${m} collection, but expects ${y.collection??"scalar"}`,!0):r(u,"TAG_RESOLVE_FAILED",`Unresolved tag: ${c}`,!0),th(t,i,s,r,c)}const g=th(t,i,s,r,c,h),v=h.resolve?.(g,y=>r(u,"TAG_RESOLVE_FAILED",y),i.options)??g,p=We(v)?v:new xe(v);return p.range=g.range,p.tag=c,h?.format&&(p.format=h.format),p}function Jb(t,i,s){const a=i.offset,r=EC(i,t.options.strict,s);if(!r)return{value:"",type:null,comment:"",range:[a,a,a]};const u=r.mode===">"?xe.BLOCK_FOLDED:xe.BLOCK_LITERAL,c=i.source?_C(i.source):[];let m=c.length;for(let _=c.length-1;_>=0;--_){const N=c[_][1];if(N===""||N==="\r")m=_;else break}if(m===0){const _=r.chomp==="+"&&c.length>0?`
|
|
84
|
+
`.repeat(Math.max(1,c.length-1)):"";let N=a+r.length;return i.source&&(N+=i.source.length),{value:_,type:u,comment:r.comment,range:[a,N,N]}}let h=i.indent+r.indent,g=i.offset+r.length,v=0;for(let _=0;_<m;++_){const[N,S]=c[_];if(S===""||S==="\r")r.indent===0&&N.length>h&&(h=N.length);else{N.length<h&&s(g+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(h=N.length),v=_,h===0&&!t.atRoot&&s(g,"BAD_INDENT","Block scalar values in collections must be indented");break}g+=N.length+S.length+1}for(let _=c.length-1;_>=m;--_)c[_][0].length>h&&(m=_+1);let p="",y="",w=!1;for(let _=0;_<v;++_)p+=c[_][0].slice(h)+`
|
|
85
|
+
`;for(let _=v;_<m;++_){let[N,S]=c[_];g+=N.length+S.length+1;const O=S[S.length-1]==="\r";if(O&&(S=S.slice(0,-1)),S&&N.length<h){const M=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;s(g-S.length-(O?2:1),"BAD_INDENT",M),N=""}u===xe.BLOCK_LITERAL?(p+=y+N.slice(h)+S,y=`
|
|
86
|
+
`):N.length>h||S[0]===" "?(y===" "?y=`
|
|
87
|
+
`:!w&&y===`
|
|
88
|
+
`&&(y=`
|
|
89
|
+
|
|
90
|
+
`),p+=y+N.slice(h)+S,y=`
|
|
91
|
+
`,w=!0):S===""?y===`
|
|
92
|
+
`?p+=`
|
|
93
|
+
`:y=`
|
|
94
|
+
`:(p+=y+S,y=" ",w=!1)}switch(r.chomp){case"-":break;case"+":for(let _=m;_<c.length;++_)p+=`
|
|
95
|
+
`+c[_][0].slice(h);p[p.length-1]!==`
|
|
96
|
+
`&&(p+=`
|
|
97
|
+
`);break;default:p+=`
|
|
98
|
+
`}const E=a+r.length+i.source.length;return{value:p,type:u,comment:r.comment,range:[a,E,E]}}function EC({offset:t,props:i},s,a){if(i[0].type!=="block-scalar-header")return a(i[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=i[0],u=r[0];let c=0,m="",h=-1;for(let y=1;y<r.length;++y){const w=r[y];if(!m&&(w==="-"||w==="+"))m=w;else{const E=Number(w);!c&&E?c=E:h===-1&&(h=t+y)}}h!==-1&&a(h,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let g=!1,v="",p=r.length;for(let y=1;y<i.length;++y){const w=i[y];switch(w.type){case"space":g=!0;case"newline":p+=w.source.length;break;case"comment":s&&!g&&a(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),p+=w.source.length,v=w.source.substring(1);break;case"error":a(w,"UNEXPECTED_TOKEN",w.message),p+=w.source.length;break;default:{const E=`Unexpected token in block scalar header: ${w.type}`;a(w,"UNEXPECTED_TOKEN",E);const _=w.source;_&&typeof _=="string"&&(p+=_.length)}}}return{mode:u,indent:c,chomp:m,comment:v,length:p}}function _C(t){const i=t.split(/\n( *)/),s=i[0],a=s.match(/^( *)/),u=[a?.[1]?[a[1],s.slice(a[1].length)]:["",s]];for(let c=1;c<i.length;c+=2)u.push([i[c],i[c+1]]);return u}function Fb(t,i,s){const{offset:a,type:r,source:u,end:c}=t;let m,h;const g=(y,w,E)=>s(a+y,w,E);switch(r){case"scalar":m=xe.PLAIN,h=NC(u,g);break;case"single-quoted-scalar":m=xe.QUOTE_SINGLE,h=AC(u,g);break;case"double-quoted-scalar":m=xe.QUOTE_DOUBLE,h=TC(u,g);break;default:return s(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[a,a+u.length,a+u.length]}}const v=a+u.length,p=zo(c,v,i,s);return{value:h,type:m,comment:p.comment,range:[a,v,p.offset]}}function NC(t,i){let s="";switch(t[0]){case" ":s="a tab character";break;case",":s="flow indicator character ,";break;case"%":s="directive indicator character %";break;case"|":case">":{s=`block scalar indicator ${t[0]}`;break}case"@":case"`":{s=`reserved character ${t[0]}`;break}}return s&&i(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`),Wb(t)}function AC(t,i){return(t[t.length-1]!=="'"||t.length===1)&&i(t.length,"MISSING_CHAR","Missing closing 'quote"),Wb(t.slice(1,-1)).replace(/''/g,"'")}function Wb(t){let i,s;try{i=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
99
|
+
`,"sy"),s=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
100
|
+
`,"sy")}catch{i=/(.*?)[ \t]*\r?\n/sy,s=/[ \t]*(.*?)[ \t]*\r?\n/sy}let a=i.exec(t);if(!a)return t;let r=a[1],u=" ",c=i.lastIndex;for(s.lastIndex=c;a=s.exec(t);)a[1]===""?u===`
|
|
101
|
+
`?r+=u:u=`
|
|
102
|
+
`:(r+=u+a[1],u=" "),c=s.lastIndex;const m=/[ \t]*(.*)/sy;return m.lastIndex=c,a=m.exec(t),r+u+(a?.[1]??"")}function TC(t,i){let s="";for(let a=1;a<t.length-1;++a){const r=t[a];if(!(r==="\r"&&t[a+1]===`
|
|
103
|
+
`))if(r===`
|
|
104
|
+
`){const{fold:u,offset:c}=MC(t,a);s+=u,a=c}else if(r==="\\"){let u=t[++a];const c=CC[u];if(c)s+=c;else if(u===`
|
|
105
|
+
`)for(u=t[a+1];u===" "||u===" ";)u=t[++a+1];else if(u==="\r"&&t[a+1]===`
|
|
106
|
+
`)for(u=t[++a+1];u===" "||u===" ";)u=t[++a+1];else if(u==="x"||u==="u"||u==="U"){const m=u==="x"?2:u==="u"?4:8;s+=OC(t,a+1,m,i),a+=m}else{const m=t.substr(a-1,2);i(a-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${m}`),s+=m}}else if(r===" "||r===" "){const u=a;let c=t[a+1];for(;c===" "||c===" ";)c=t[++a+1];c!==`
|
|
107
|
+
`&&!(c==="\r"&&t[a+2]===`
|
|
108
|
+
`)&&(s+=a>u?t.slice(u,a+1):r)}else s+=r}return(t[t.length-1]!=='"'||t.length===1)&&i(t.length,"MISSING_CHAR",'Missing closing "quote'),s}function MC(t,i){let s="",a=t[i+1];for(;(a===" "||a===" "||a===`
|
|
109
|
+
`||a==="\r")&&!(a==="\r"&&t[i+2]!==`
|
|
110
|
+
`);)a===`
|
|
111
|
+
`&&(s+=`
|
|
112
|
+
`),i+=1,a=t[i+1];return s||(s=" "),{fold:s,offset:i}}const CC={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
113
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function OC(t,i,s,a){const r=t.substr(i,s),c=r.length===s&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(c)}catch{const m=t.substr(i-2,s+2);return a(i-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${m}`),m}}function Pb(t,i,s,a){const{value:r,type:u,comment:c,range:m}=i.type==="block-scalar"?Jb(t,i,a):Fb(i,t.options.strict,a),h=s?t.directives.tagName(s.source,p=>a(s,"TAG_RESOLVE_FAILED",p)):null;let g;t.options.stringKeys&&t.atKey?g=t.schema[Ln]:h?g=zC(t.schema,r,h,s,a):i.type==="scalar"?g=DC(t,r,i,a):g=t.schema[Ln];let v;try{const p=g.resolve(r,y=>a(s??i,"TAG_RESOLVE_FAILED",y),t.options);v=Ye(p)?p:new xe(p)}catch(p){const y=p instanceof Error?p.message:String(p);a(s??i,"TAG_RESOLVE_FAILED",y),v=new xe(r)}return v.range=m,v.source=r,u&&(v.type=u),h&&(v.tag=h),g.format&&(v.format=g.format),c&&(v.comment=c),v}function zC(t,i,s,a,r){if(s==="!")return t[Ln];const u=[];for(const m of t.tags)if(!m.collection&&m.tag===s)if(m.default&&m.test)u.push(m);else return m;for(const m of u)if(m.test?.test(i))return m;const c=t.knownTags[s];return c&&!c.collection?(t.tags.push(Object.assign({},c,{default:!1,test:void 0})),c):(r(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),t[Ln])}function DC({atKey:t,directives:i,schema:s},a,r,u){const c=s.tags.find(m=>(m.default===!0||t&&m.default==="key")&&m.test?.test(a))||s[Ln];if(s.compat){const m=s.compat.find(h=>h.default&&h.test?.test(a))??s[Ln];if(c.tag!==m.tag){const h=i.tagString(c.tag),g=i.tagString(m.tag),v=`Value may be parsed as either ${h} or ${g}`;u(r,"TAG_RESOLVE_FAILED",v,!0)}}return c}function LC(t,i,s){if(i){s??(s=i.length);for(let a=s-1;a>=0;--a){let r=i[a];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=i[++a];r?.type==="space";)t+=r.source.length,r=i[++a];break}}return t}const RC={composeNode:eS,composeEmptyNode:am};function eS(t,i,s,a){const r=t.atKey,{spaceBefore:u,comment:c,anchor:m,tag:h}=s;let g,v=!0;switch(i.type){case"alias":g=BC(t,i,a),(m||h)&&a(i,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":g=Pb(t,i,h,a),m&&(g.anchor=m.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{g=xC(RC,t,i,s,a),m&&(g.anchor=m.source.substring(1))}catch(p){const y=p instanceof Error?p.message:String(p);a(i,"RESOURCE_EXHAUSTION",y)}break;default:{const p=i.type==="error"?i.message:`Unsupported token (type: ${i.type})`;a(i,"UNEXPECTED_TOKEN",p),v=!1}}return g??(g=am(t,i.offset,void 0,null,s,a)),m&&g.anchor===""&&a(m,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!Ye(g)||typeof g.value!="string"||g.tag&&g.tag!=="tag:yaml.org,2002:str")&&a(h??i,"NON_STRING_KEY","With stringKeys, all keys must be strings"),u&&(g.spaceBefore=!0),c&&(i.type==="scalar"&&i.source===""?g.comment=c:g.commentBefore=c),t.options.keepSourceTokens&&v&&(g.srcToken=i),g}function am(t,i,s,a,{spaceBefore:r,comment:u,anchor:c,tag:m,end:h},g){const v={type:"scalar",offset:LC(i,s,a),indent:-1,source:""},p=Pb(t,v,m,g);return c&&(p.anchor=c.source.substring(1),p.anchor===""&&g(c,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(p.spaceBefore=!0),u&&(p.comment=u,p.range[2]=h),p}function BC({options:t},{offset:i,source:s,end:a},r){const u=new Pu(s.substring(1));u.source===""&&r(i,"BAD_ALIAS","Alias cannot be an empty string"),u.source.endsWith(":")&&r(i+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const c=i+s.length,m=zo(a,c,t.strict,r);return u.range=[i,c,m.offset],m.comment&&(u.comment=m.comment),u}function kC(t,i,{offset:s,start:a,value:r,end:u},c){const m=Object.assign({_directives:i},t),h=new Wl(void 0,m),g={atKey:!1,atRoot:!0,directives:h.directives,options:h.options,schema:h.schema},v=Xl(a,{indicator:"doc-start",next:r??u?.[0],offset:s,onError:c,parentIndent:0,startOnNewline:!0});v.found&&(h.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!v.hasNewline&&c(v.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),h.contents=r?eS(g,r,v,c):am(g,v.end,a,null,v,c);const p=h.contents.range[2],y=zo(u,p,!1,c);return y.comment&&(h.comment=y.comment),h.range=[s,p,y.offset],h}function eo(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];const{offset:i,source:s}=t;return[i,i+(typeof s=="string"?s.length:1)]}function gv(t){let i="",s=!1,a=!1;for(let r=0;r<t.length;++r){const u=t[r];switch(u[0]){case"#":i+=(i===""?"":a?`
|
|
114
|
+
|
|
115
|
+
`:`
|
|
116
|
+
`)+(u.substring(1)||" "),s=!0,a=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),s=!1;break;default:s||(a=!0),s=!1}}return{comment:i,afterEmptyLine:a}}class om{constructor(i={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,a,r,u)=>{const c=eo(s);u?this.warnings.push(new Qb(c,a,r)):this.errors.push(new Ss(c,a,r))},this.directives=new _t({version:i.version||"1.2"}),this.options=i}decorate(i,s){const{comment:a,afterEmptyLine:r}=gv(this.prelude);if(a){const u=i.contents;if(s)i.comment=i.comment?`${i.comment}
|
|
117
|
+
${a}`:a;else if(r||i.directives.docStart||!u)i.commentBefore=a;else if(Fe(u)&&!u.flow&&u.items.length>0){let c=u.items[0];Ie(c)&&(c=c.key);const m=c.commentBefore;c.commentBefore=m?`${a}
|
|
118
|
+
${m}`:a}else{const c=u.commentBefore;u.commentBefore=c?`${a}
|
|
119
|
+
${c}`:a}}if(s){for(let u=0;u<this.errors.length;++u)i.errors.push(this.errors[u]);for(let u=0;u<this.warnings.length;++u)i.warnings.push(this.warnings[u])}else i.errors=this.errors,i.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:gv(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(i,s=!1,a=-1){for(const r of i)yield*this.next(r);yield*this.end(s,a)}*next(i){switch(i.type){case"directive":this.directives.add(i.source,(s,a,r)=>{const u=eo(i);u[0]+=s,this.onError(u,"BAD_DIRECTIVE",a,r)}),this.prelude.push(i.source),this.atDirectives=!0;break;case"document":{const s=kC(this.options,this.directives,i,this.onError);this.atDirectives&&!s.directives.docStart&&this.onError(i,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(s,!1),this.doc&&(yield this.doc),this.doc=s,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(i.source);break;case"error":{const s=i.source?`${i.message}: ${JSON.stringify(i.source)}`:i.message,a=new Ss(eo(i),"UNEXPECTED_TOKEN",s);this.atDirectives||!this.doc?this.errors.push(a):this.doc.errors.push(a);break}case"doc-end":{if(!this.doc){const a="Unexpected doc-end without preceding document";this.errors.push(new Ss(eo(i),"UNEXPECTED_TOKEN",a));break}this.doc.directives.docEnd=!0;const s=zo(i.end,i.offset+i.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),s.comment){const a=this.doc.comment;this.doc.comment=a?`${a}
|
|
120
|
+
${s.comment}`:s.comment}this.doc.range[2]=s.offset;break}default:this.errors.push(new Ss(eo(i),"UNEXPECTED_TOKEN",`Unsupported token ${i.type}`))}}*end(i=!1,s=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(i){const a=Object.assign({_directives:this.directives},this.options),r=new Wl(void 0,a);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,s,s],this.decorate(r,!1),yield r}}}function HC(t,i=!0,s){if(t){const a=(r,u,c)=>{const m=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(s)s(m,u,c);else throw new Ss([m,m+1],u,c)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Fb(t,i,a);case"block-scalar":return Jb({options:{strict:i}},t,a)}}return null}function jC(t,i){const{implicitKey:s=!1,indent:a,inFlow:r=!1,offset:u=-1,type:c="PLAIN"}=i,m=Co({type:c,value:t},{implicitKey:s,indent:a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),h=i.end??[{type:"newline",offset:-1,indent:a,source:`
|
|
121
|
+
`}];switch(m[0]){case"|":case">":{const g=m.indexOf(`
|
|
122
|
+
`),v=m.substring(0,g),p=m.substring(g+1)+`
|
|
123
|
+
`,y=[{type:"block-scalar-header",offset:u,indent:a,source:v}];return tS(y,h)||y.push({type:"newline",offset:-1,indent:a,source:`
|
|
124
|
+
`}),{type:"block-scalar",offset:u,indent:a,props:y,source:p}}case'"':return{type:"double-quoted-scalar",offset:u,indent:a,source:m,end:h};case"'":return{type:"single-quoted-scalar",offset:u,indent:a,source:m,end:h};default:return{type:"scalar",offset:u,indent:a,source:m,end:h}}}function $C(t,i,s={}){let{afterKey:a=!1,implicitKey:r=!1,inFlow:u=!1,type:c}=s,m="indent"in t?t.indent:null;if(a&&typeof m=="number"&&(m+=2),!c)switch(t.type){case"single-quoted-scalar":c="QUOTE_SINGLE";break;case"double-quoted-scalar":c="QUOTE_DOUBLE";break;case"block-scalar":{const g=t.props[0];if(g.type!=="block-scalar-header")throw new Error("Invalid block scalar header");c=g.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:c="PLAIN"}const h=Co({type:c,value:i},{implicitKey:r||m===null,indent:m!==null&&m>0?" ".repeat(m):"",inFlow:u,options:{blockQuote:!0,lineWidth:-1}});switch(h[0]){case"|":case">":UC(t,h);break;case'"':nh(t,h,"double-quoted-scalar");break;case"'":nh(t,h,"single-quoted-scalar");break;default:nh(t,h,"scalar")}}function UC(t,i){const s=i.indexOf(`
|
|
125
|
+
`),a=i.substring(0,s),r=i.substring(s+1)+`
|
|
126
|
+
`;if(t.type==="block-scalar"){const u=t.props[0];if(u.type!=="block-scalar-header")throw new Error("Invalid block scalar header");u.source=a,t.source=r}else{const{offset:u}=t,c="indent"in t?t.indent:-1,m=[{type:"block-scalar-header",offset:u,indent:c,source:a}];tS(m,"end"in t?t.end:void 0)||m.push({type:"newline",offset:-1,indent:c,source:`
|
|
127
|
+
`});for(const h of Object.keys(t))h!=="type"&&h!=="offset"&&delete t[h];Object.assign(t,{type:"block-scalar",indent:c,props:m,source:r})}}function tS(t,i){if(i)for(const s of i)switch(s.type){case"space":case"comment":t.push(s);break;case"newline":return t.push(s),!0}return!1}function nh(t,i,s){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=s,t.source=i;break;case"block-scalar":{const a=t.props.slice(1);let r=i.length;t.props[0].type==="block-scalar-header"&&(r-=t.props[0].source.length);for(const u of a)u.offset+=r;delete t.props,Object.assign(t,{type:s,source:i,end:a});break}case"block-map":case"block-seq":{const r={type:"newline",offset:t.offset+i.length,indent:t.indent,source:`
|
|
128
|
+
`};delete t.items,Object.assign(t,{type:s,source:i,end:[r]});break}default:{const a="indent"in t?t.indent:-1,r="end"in t&&Array.isArray(t.end)?t.end.filter(u=>u.type==="space"||u.type==="comment"||u.type==="newline"):[];for(const u of Object.keys(t))u!=="type"&&u!=="offset"&&delete t[u];Object.assign(t,{type:s,indent:a,source:i,end:r})}}}const qC=t=>"type"in t?ju(t):_u(t);function ju(t){switch(t.type){case"block-scalar":{let i="";for(const s of t.props)i+=ju(s);return i+t.source}case"block-map":case"block-seq":{let i="";for(const s of t.items)i+=_u(s);return i}case"flow-collection":{let i=t.start.source;for(const s of t.items)i+=_u(s);for(const s of t.end)i+=s.source;return i}case"document":{let i=_u(t);if(t.end)for(const s of t.end)i+=s.source;return i}default:{let i=t.source;if("end"in t&&t.end)for(const s of t.end)i+=s.source;return i}}}function _u({start:t,key:i,sep:s,value:a}){let r="";for(const u of t)r+=u.source;if(i&&(r+=ju(i)),s)for(const u of s)r+=u.source;return a&&(r+=ju(a)),r}const Mh=Symbol("break visit"),VC=Symbol("skip children"),nS=Symbol("remove item");function Ms(t,i){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),iS(Object.freeze([]),t,i)}Ms.BREAK=Mh;Ms.SKIP=VC;Ms.REMOVE=nS;Ms.itemAtPath=(t,i)=>{let s=t;for(const[a,r]of i){const u=s?.[a];if(u&&"items"in u)s=u.items[r];else return}return s};Ms.parentCollection=(t,i)=>{const s=Ms.itemAtPath(t,i.slice(0,-1)),a=i[i.length-1][0],r=s?.[a];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function iS(t,i,s){let a=s(i,t);if(typeof a=="symbol")return a;for(const r of["key","value"]){const u=i[r];if(u&&"items"in u){for(let c=0;c<u.items.length;++c){const m=iS(Object.freeze(t.concat([[r,c]])),u.items[c],s);if(typeof m=="number")c=m-1;else{if(m===Mh)return Mh;m===nS&&(u.items.splice(c,1),c-=1)}}typeof a=="function"&&r==="key"&&(a=a(i,t))}}return typeof a=="function"?a(i,t):a}const uc="\uFEFF",cc="",fc="",wo="",YC=t=>!!t&&"items"in t,GC=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function XC(t){switch(t){case uc:return"<BOM>";case cc:return"<DOC>";case fc:return"<FLOW_END>";case wo:return"<SCALAR>";default:return JSON.stringify(t)}}function sS(t){switch(t){case uc:return"byte-order-mark";case cc:return"doc-mode";case fc:return"flow-error-end";case wo:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
129
|
+
`:case`\r
|
|
130
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const KC=Object.freeze(Object.defineProperty({__proto__:null,BOM:uc,DOCUMENT:cc,FLOW_END:fc,SCALAR:wo,createScalarToken:jC,isCollection:YC,isScalar:GC,prettyToken:XC,resolveAsScalar:HC,setScalarValue:$C,stringify:qC,tokenType:sS,visit:Ms},Symbol.toStringTag,{value:"Module"}));function gn(t){switch(t){case void 0:case" ":case`
|
|
131
|
+
`:case"\r":case" ":return!0;default:return!1}}const pv=new Set("0123456789ABCDEFabcdef"),ZC=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),du=new Set(",[]{}"),QC=new Set(` ,[]{}
|
|
132
|
+
\r `),ih=t=>!t||QC.has(t);class lS{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(i,s=!1){if(i){if(typeof i!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+i:i,this.lineEndPos=null}this.atEnd=!s;let a=this.next??"stream";for(;a&&(s||this.hasChars(1));)a=yield*this.parseNext(a)}atLineEnd(){let i=this.pos,s=this.buffer[i];for(;s===" "||s===" ";)s=this.buffer[++i];return!s||s==="#"||s===`
|
|
133
|
+
`?!0:s==="\r"?this.buffer[i+1]===`
|
|
134
|
+
`:!1}charAt(i){return this.buffer[this.pos+i]}continueScalar(i){let s=this.buffer[i];if(this.indentNext>0){let a=0;for(;s===" ";)s=this.buffer[++a+i];if(s==="\r"){const r=this.buffer[a+i+1];if(r===`
|
|
135
|
+
`||!r&&!this.atEnd)return i+a+1}return s===`
|
|
136
|
+
`||a>=this.indentNext||!s&&!this.atEnd?i+a:-1}if(s==="-"||s==="."){const a=this.buffer.substr(i,3);if((a==="---"||a==="...")&&gn(this.buffer[i+3]))return-1}return i}getLine(){let i=this.lineEndPos;return(typeof i!="number"||i!==-1&&i<this.pos)&&(i=this.buffer.indexOf(`
|
|
137
|
+
`,this.pos),this.lineEndPos=i),i===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[i-1]==="\r"&&(i-=1),this.buffer.substring(this.pos,i))}hasChars(i){return this.pos+i<=this.buffer.length}setNext(i){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=i,null}peek(i){return this.buffer.substr(this.pos,i)}*parseNext(i){switch(i){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let i=this.getLine();if(i===null)return this.setNext("stream");if(i[0]===uc&&(yield*this.pushCount(1),i=i.substring(1)),i[0]==="%"){let s=i.length,a=i.indexOf("#");for(;a!==-1;){const u=i[a-1];if(u===" "||u===" "){s=a-1;break}else a=i.indexOf("#",a+1)}for(;;){const u=i[s-1];if(u===" "||u===" ")s-=1;else break}const r=(yield*this.pushCount(s))+(yield*this.pushSpaces(!0));return yield*this.pushCount(i.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const s=yield*this.pushSpaces(!0);return yield*this.pushCount(i.length-s),yield*this.pushNewline(),"stream"}return yield cc,yield*this.parseLineStart()}*parseLineStart(){const i=this.charAt(0);if(!i&&!this.atEnd)return this.setNext("line-start");if(i==="-"||i==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const s=this.peek(3);if((s==="---"||s==="...")&&gn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,s==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!gn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[i,s]=this.peek(2);if(!s&&!this.atEnd)return this.setNext("block-start");if((i==="-"||i==="?"||i===":")&&gn(s)){const a=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=a,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const i=this.getLine();if(i===null)return this.setNext("doc");let s=yield*this.pushIndicators();switch(i[s]){case"#":yield*this.pushCount(i.length-s);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(ih),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return s+=yield*this.parseBlockScalarHeader(),s+=yield*this.pushSpaces(!0),yield*this.pushCount(i.length-s),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let i,s,a=-1;do i=yield*this.pushNewline(),i>0?(s=yield*this.pushSpaces(!1),this.indentValue=a=s):s=0,s+=yield*this.pushSpaces(!0);while(i+s>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((a!==-1&&a<this.indentNext&&r[0]!=="#"||a===0&&(r.startsWith("---")||r.startsWith("..."))&&gn(r[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield fc,yield*this.parseLineStart();let u=0;for(;r[u]===",";)u+=yield*this.pushCount(1),u+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(u+=yield*this.pushIndicators(),r[u]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-u),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(ih),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const c=this.charAt(1);if(this.flowKey||gn(c)||c===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const i=this.charAt(0);let s=this.buffer.indexOf(i,this.pos+1);if(i==="'")for(;s!==-1&&this.buffer[s+1]==="'";)s=this.buffer.indexOf("'",s+2);else for(;s!==-1;){let u=0;for(;this.buffer[s-1-u]==="\\";)u+=1;if(u%2===0)break;s=this.buffer.indexOf('"',s+1)}const a=this.buffer.substring(0,s);let r=a.indexOf(`
|
|
138
|
+
`,this.pos);if(r!==-1){for(;r!==-1;){const u=this.continueScalar(r+1);if(u===-1)break;r=a.indexOf(`
|
|
139
|
+
`,u)}r!==-1&&(s=r-(a[r-1]==="\r"?2:1))}if(s===-1){if(!this.atEnd)return this.setNext("quoted-scalar");s=this.buffer.length}return yield*this.pushToIndex(s+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let i=this.pos;for(;;){const s=this.buffer[++i];if(s==="+")this.blockScalarKeep=!0;else if(s>"0"&&s<="9")this.blockScalarIndent=Number(s)-1;else if(s!=="-")break}return yield*this.pushUntil(s=>gn(s)||s==="#")}*parseBlockScalar(){let i=this.pos-1,s=0,a;e:for(let u=this.pos;a=this.buffer[u];++u)switch(a){case" ":s+=1;break;case`
|
|
140
|
+
`:i=u,s=0;break;case"\r":{const c=this.buffer[u+1];if(!c&&!this.atEnd)return this.setNext("block-scalar");if(c===`
|
|
141
|
+
`)break}default:break e}if(!a&&!this.atEnd)return this.setNext("block-scalar");if(s>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=s:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const u=this.continueScalar(i+1);if(u===-1)break;i=this.buffer.indexOf(`
|
|
142
|
+
`,u)}while(i!==-1);if(i===-1){if(!this.atEnd)return this.setNext("block-scalar");i=this.buffer.length}}let r=i+1;for(a=this.buffer[r];a===" ";)a=this.buffer[++r];if(a===" "){for(;a===" "||a===" "||a==="\r"||a===`
|
|
143
|
+
`;)a=this.buffer[++r];i=r-1}else if(!this.blockScalarKeep)do{let u=i-1,c=this.buffer[u];c==="\r"&&(c=this.buffer[--u]);const m=u;for(;c===" ";)c=this.buffer[--u];if(c===`
|
|
144
|
+
`&&u>=this.pos&&u+1+s>m)i=u;else break}while(!0);return yield wo,yield*this.pushToIndex(i+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const i=this.flowLevel>0;let s=this.pos-1,a=this.pos-1,r;for(;r=this.buffer[++a];)if(r===":"){const u=this.buffer[a+1];if(gn(u)||i&&du.has(u))break;s=a}else if(gn(r)){let u=this.buffer[a+1];if(r==="\r"&&(u===`
|
|
145
|
+
`?(a+=1,r=`
|
|
146
|
+
`,u=this.buffer[a+1]):s=a),u==="#"||i&&du.has(u))break;if(r===`
|
|
147
|
+
`){const c=this.continueScalar(a+1);if(c===-1)break;a=Math.max(a,c-2)}}else{if(i&&du.has(r))break;s=a}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield wo,yield*this.pushToIndex(s+1,!0),i?"flow":"doc")}*pushCount(i){return i>0?(yield this.buffer.substr(this.pos,i),this.pos+=i,i):0}*pushToIndex(i,s){const a=this.buffer.slice(this.pos,i);return a?(yield a,this.pos+=a.length,a.length):(s&&(yield""),0)}*pushIndicators(){let i=0;e:for(;;){switch(this.charAt(0)){case"!":i+=yield*this.pushTag(),i+=yield*this.pushSpaces(!0);continue e;case"&":i+=yield*this.pushUntil(ih),i+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const s=this.flowLevel>0,a=this.charAt(1);if(gn(a)||s&&du.has(a)){s?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0);continue e}}}break e}return i}*pushTag(){if(this.charAt(1)==="<"){let i=this.pos+2,s=this.buffer[i];for(;!gn(s)&&s!==">";)s=this.buffer[++i];return yield*this.pushToIndex(s===">"?i+1:i,!1)}else{let i=this.pos+1,s=this.buffer[i];for(;s;)if(ZC.has(s))s=this.buffer[++i];else if(s==="%"&&pv.has(this.buffer[i+1])&&pv.has(this.buffer[i+2]))s=this.buffer[i+=3];else break;return yield*this.pushToIndex(i,!1)}}*pushNewline(){const i=this.buffer[this.pos];return i===`
|
|
148
|
+
`?yield*this.pushCount(1):i==="\r"&&this.charAt(1)===`
|
|
149
|
+
`?yield*this.pushCount(2):0}*pushSpaces(i){let s=this.pos-1,a;do a=this.buffer[++s];while(a===" "||i&&a===" ");const r=s-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=s),r}*pushUntil(i){let s=this.pos,a=this.buffer[s];for(;!i(a);)a=this.buffer[++s];return yield*this.pushToIndex(s,!1)}}class aS{constructor(){this.lineStarts=[],this.addNewLine=i=>this.lineStarts.push(i),this.linePos=i=>{let s=0,a=this.lineStarts.length;for(;s<a;){const u=s+a>>1;this.lineStarts[u]<i?s=u+1:a=u}if(this.lineStarts[s]===i)return{line:s+1,col:1};if(s===0)return{line:0,col:i};const r=this.lineStarts[s-1];return{line:s,col:i-r+1}}}}function Vi(t,i){for(let s=0;s<t.length;++s)if(t[s].type===i)return!0;return!1}function yv(t){for(let i=0;i<t.length;++i)switch(t[i].type){case"space":case"comment":case"newline":break;default:return i}return-1}function oS(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function hu(t){switch(t.type){case"document":return t.start;case"block-map":{const i=t.items[t.items.length-1];return i.sep??i.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function xl(t){if(t.length===0)return[];let i=t.length;e:for(;--i>=0;)switch(t[i].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++i]?.type==="space";);return t.splice(i,t.length)}function $u(t,i){if(i.length<1e5)Array.prototype.push.apply(t,i);else for(let s=0;s<i.length;++s)t.push(i[s])}function vv(t){if(t.start.type==="flow-seq-start")for(const i of t.items)i.sep&&!i.value&&!Vi(i.start,"explicit-key-ind")&&!Vi(i.sep,"map-value-ind")&&(i.key&&(i.value=i.key),delete i.key,oS(i.value)?i.value.end?$u(i.value.end,i.sep):i.value.end=i.sep:$u(i.start,i.sep),delete i.sep)}class rm{constructor(i){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new lS,this.onNewLine=i}*parse(i,s=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const a of this.lexer.lex(i,s))yield*this.next(a);s||(yield*this.end())}*next(i){if(this.source=i,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=i.length;return}const s=sS(i);if(s)if(s==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=s,yield*this.step(),s){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+i.length);break;case"space":this.atNewLine&&i[0]===" "&&(this.indent+=i.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=i.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=i.length}else{const a=`Not a YAML token: ${i}`;yield*this.pop({type:"error",offset:this.offset,message:a,source:i}),this.offset+=i.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const i=this.peek(1);if(this.type==="doc-end"&&i?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!i)return yield*this.stream();switch(i.type){case"document":return yield*this.document(i);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(i);case"block-scalar":return yield*this.blockScalar(i);case"block-map":return yield*this.blockMap(i);case"block-seq":return yield*this.blockSequence(i);case"flow-collection":return yield*this.flowCollection(i);case"doc-end":return yield*this.documentEnd(i)}yield*this.pop()}peek(i){return this.stack[this.stack.length-i]}*pop(i){const s=i??this.stack.pop();if(!s)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield s;else{const a=this.peek(1);switch(s.type==="block-scalar"?s.indent="indent"in a?a.indent:0:s.type==="flow-collection"&&a.type==="document"&&(s.indent=0),s.type==="flow-collection"&&vv(s),a.type){case"document":a.value=s;break;case"block-scalar":a.props.push(s);break;case"block-map":{const r=a.items[a.items.length-1];if(r.value){a.items.push({start:[],key:s,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=s;else{Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=a.items[a.items.length-1];r.value?a.items.push({start:[],value:s}):r.value=s;break}case"flow-collection":{const r=a.items[a.items.length-1];!r||r.value?a.items.push({start:[],key:s,sep:[]}):r.sep?r.value=s:Object.assign(r,{key:s,sep:[]});return}default:yield*this.pop(),yield*this.pop(s)}if((a.type==="document"||a.type==="block-map"||a.type==="block-seq")&&(s.type==="block-map"||s.type==="block-seq")){const r=s.items[s.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&yv(r.start)===-1&&(s.indent===0||r.start.every(u=>u.type!=="comment"||u.indent<s.indent))&&(a.type==="document"?a.end=r.start:a.items.push({start:r.start}),s.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const i={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&i.start.push(this.sourceToken),this.stack.push(i);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(i){if(i.value)return yield*this.lineEnd(i);switch(this.type){case"doc-start":{yv(i.start)!==-1?(yield*this.pop(),yield*this.step()):i.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":i.start.push(this.sourceToken);return}const s=this.startBlockValue(i);s?this.stack.push(s):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(i){if(this.type==="map-value-ind"){const s=hu(this.peek(2)),a=xl(s);let r;i.end?(r=i.end,r.push(this.sourceToken),delete i.end):r=[this.sourceToken];const u={type:"block-map",offset:i.offset,indent:i.indent,items:[{start:a,key:i,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=u}else yield*this.lineEnd(i)}*blockScalar(i){switch(this.type){case"space":case"comment":case"newline":i.props.push(this.sourceToken);return;case"scalar":if(i.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let s=this.source.indexOf(`
|
|
150
|
+
`)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
|
|
151
|
+
`,s)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(i){const s=i.items[i.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):i.items.push({start:[this.sourceToken]})}else s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)i.items.push({start:[this.sourceToken]});else if(s.sep)s.sep.push(this.sourceToken);else{if(this.atIndentedComment(s.start,i.indent)){const r=i.items[i.items.length-2]?.value?.end;if(Array.isArray(r)){$u(r,s.start),r.push(this.sourceToken),i.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=i.indent){const a=!this.onKeyLine&&this.indent===i.indent,r=a&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind";let u=[];if(r&&s.sep&&!s.value){const c=[];for(let m=0;m<s.sep.length;++m){const h=s.sep[m];switch(h.type){case"newline":c.push(m);break;case"space":break;case"comment":h.indent>i.indent&&(c.length=0);break;default:c.length=0}}c.length>=2&&(u=s.sep.splice(c[1]))}switch(this.type){case"anchor":case"tag":r||s.value?(u.push(this.sourceToken),i.items.push({start:u}),this.onKeyLine=!0):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"explicit-key-ind":!s.sep&&!s.explicitKey?(s.start.push(this.sourceToken),s.explicitKey=!0):r||s.value?(u.push(this.sourceToken),i.items.push({start:u,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(s.explicitKey)if(s.sep)if(s.value)i.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Vi(s.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:null,sep:[this.sourceToken]}]});else if(oS(s.key)&&!Vi(s.sep,"newline")){const c=xl(s.start),m=s.key,h=s.sep;h.push(this.sourceToken),delete s.key,delete s.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:m,sep:h}]})}else u.length>0?s.sep=s.sep.concat(u,this.sourceToken):s.sep.push(this.sourceToken);else if(Vi(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const c=xl(s.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]})}else s.sep?s.value||r?i.items.push({start:u,key:null,sep:[this.sourceToken]}):Vi(s.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const c=this.flowScalar(this.type);r||s.value?(i.items.push({start:u,key:c,sep:[]}),this.onKeyLine=!0):s.sep?this.stack.push(c):(Object.assign(s,{key:c,sep:[]}),this.onKeyLine=!0);return}default:{const c=this.startBlockValue(i);if(c){if(c.type==="block-seq"){if(!s.explicitKey&&s.sep&&!Vi(s.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else a&&i.items.push({start:u});this.stack.push(c);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(i){const s=i.items[i.items.length-1];switch(this.type){case"newline":if(s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):i.items.push({start:[this.sourceToken]})}else s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)i.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(s.start,i.indent)){const r=i.items[i.items.length-2]?.value?.end;if(Array.isArray(r)){$u(r,s.start),r.push(this.sourceToken),i.items.pop();return}}s.start.push(this.sourceToken)}return;case"anchor":case"tag":if(s.value||this.indent<=i.indent)break;s.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==i.indent)break;s.value||Vi(s.start,"seq-item-ind")?i.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return}if(this.indent>i.indent){const a=this.startBlockValue(i);if(a){this.stack.push(a);return}}yield*this.pop(),yield*this.step()}*flowCollection(i){const s=i.items[i.items.length-1];if(this.type==="flow-error-end"){let a;do yield*this.pop(),a=this.peek(1);while(a?.type==="flow-collection")}else if(i.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!s||s.sep?i.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return;case"map-value-ind":!s||s.value?i.items.push({start:[],key:null,sep:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!s||s.value?i.items.push({start:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!s||s.value?i.items.push({start:[],key:r,sep:[]}):s.sep?this.stack.push(r):Object.assign(s,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":i.end.push(this.sourceToken);return}const a=this.startBlockValue(i);a?this.stack.push(a):(yield*this.pop(),yield*this.step())}else{const a=this.peek(2);if(a.type==="block-map"&&(this.type==="map-value-ind"&&a.indent===i.indent||this.type==="newline"&&!a.items[a.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&a.type!=="flow-collection"){const r=hu(a),u=xl(r);vv(i);const c=i.end.splice(1,i.end.length);c.push(this.sourceToken);const m={type:"block-map",offset:i.offset,indent:i.indent,items:[{start:u,key:i,sep:c}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=m}else yield*this.lineEnd(i)}}flowScalar(i){if(this.onNewLine){let s=this.source.indexOf(`
|
|
152
|
+
`)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
|
|
153
|
+
`,s)+1}return{type:i,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(i){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const s=hu(i),a=xl(s);return a.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const s=hu(i),a=xl(s);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(i,s){return this.type!=="comment"||this.indent<=s?!1:i.every(a=>a.type==="newline"||a.type==="space")}*documentEnd(i){this.type!=="doc-mode"&&(i.end?i.end.push(this.sourceToken):i.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(i){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:i.end?i.end.push(this.sourceToken):i.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function rS(t){const i=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||i&&new aS||null,prettyErrors:i}}function IC(t,i={}){const{lineCounter:s,prettyErrors:a}=rS(i),r=new rm(s?.addNewLine),u=new om(i),c=Array.from(u.compose(r.parse(t)));if(a&&s)for(const m of c)m.errors.forEach(Hu(t,s)),m.warnings.forEach(Hu(t,s));return c.length>0?c:Object.assign([],{empty:!0},u.streamInfo())}function uS(t,i={}){const{lineCounter:s,prettyErrors:a}=rS(i),r=new rm(s?.addNewLine),u=new om(i);let c=null;for(const m of u.compose(r.parse(t),!0,t.length))if(!c)c=m;else if(c.options.logLevel!=="silent"){c.errors.push(new Ss(m.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return a&&s&&(c.errors.forEach(Hu(t,s)),c.warnings.forEach(Hu(t,s))),c}function JC(t,i,s){let a;typeof i=="function"?a=i:s===void 0&&i&&typeof i=="object"&&(s=i);const r=uS(t,s);if(!r)return null;if(r.warnings.forEach(u=>Mb(r.options.logLevel,u)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:a},s))}function FC(t,i,s){let a=null;if(typeof i=="function"||Array.isArray(i)?a=i:s===void 0&&i&&(s=i),typeof s=="string"&&(s=s.length),typeof s=="number"){const r=Math.round(s);s=r<1?void 0:r>8?{indent:8}:{indent:r}}if(t===void 0){const{keepUndefined:r}=s??i??{};if(!r)return}return Os(t)&&!a?t.toString(s):new Wl(t,a,s).toString(s)}const dc=Object.freeze(Object.defineProperty({__proto__:null,Alias:Pu,CST:KC,Composer:om,Document:Wl,Lexer:lS,LineCounter:aS,Pair:St,Parser:rm,Scalar:xe,Schema:rc,YAMLError:lm,YAMLMap:Zt,YAMLParseError:Ss,YAMLSeq:Ki,YAMLWarning:Qb,isAlias:Cs,isCollection:Fe,isDocument:Os,isMap:Ql,isNode:We,isPair:Ie,isScalar:Ye,isSeq:Il,parse:JC,parseAllDocuments:IC,parseDocument:uS,stringify:FC,visit:zs,visitAsync:Wu},Symbol.toStringTag,{value:"Module"}));function Zi(t){return t.normalize("NFKC").replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").toLowerCase()||"unnamed"}function bv(t){return`story_${Zi(t).replaceAll("-","_")}`}function WC(t){return`slc_${Zi(t).replaceAll("-","_")}`}function PC(t){return`scr_${Zi(t).replaceAll("-","_")}`}function eO(t){return`cmd_${Zi(t).replaceAll("-","_")}`}function tO(t){return`qry_${Zi(t).replaceAll("-","_")}`}function sh(t){return`evt_${Zi(t).replaceAll("-","_")}`}function nO(t,i,s){const a=s?Zi(s):`case-${i+1}`;return`gwt_${Zi(t).replaceAll("-","_")}_${a.replaceAll("-","_")}`}function El(t,i,s){return`${t}:${i}->${s}`}function oo(t){return t.replaceAll("\\","/").replace(/^\/+/,"")}function cS(t,i=""){const s=oo(t).split("/").at(-1)??t;return i&&s.endsWith(i)?s.slice(0,-i.length):s}function kl(t){return Array.isArray(t)?t.filter(i=>typeof i=="string"):[]}function iO(t,i){const s=dc.parse(i),a=s?.events&&typeof s.events=="object"?s.events:s??{};return Object.entries(a).map(([r,u])=>({name:r,fields:typeof u?.fields=="string"?u.fields:void 0,description:typeof u?.description=="string"?u.description:void 0,sourcePath:t}))}function sO(t,i){const s=dc.parse(i);return{name:typeof s?.name=="string"?s.name:cS(t,".yaml"),description:typeof s?.description=="string"?s.description:"",path:t,slices:kl(s?.slices).map(oo)}}function lO(t){return Array.isArray(t)?t.filter(i=>!!i&&typeof i=="object").map(i=>({name:typeof i.name=="string"?i.name:"",fields:typeof i.fields=="string"?i.fields:void 0,notes:typeof i.notes=="string"?i.notes:void 0,produces:kl(i.produces)})):[]}function aO(t){return Array.isArray(t)?t.filter(i=>!!i&&typeof i=="object").map(i=>({name:typeof i.name=="string"?i.name:"",fields:typeof i.fields=="string"?i.fields:void 0,notes:typeof i.notes=="string"?i.notes:void 0,fromEvents:kl(i.from_events)})):[]}function oO(t){return Array.isArray(t)?t.filter(i=>!!i&&typeof i=="object").map(i=>({name:typeof i.name=="string"?i.name:void 0,description:typeof i.description=="string"?i.description:void 0,given:Array.isArray(i.given)?i.given:[],when:Array.isArray(i.when)?i.when:[],then:Array.isArray(i.then)?i.then:[]})):[]}function rO(t){return{type:t?.type==="system"?"system":"user",name:typeof t?.name=="string"?t.name:void 0,actors:kl(t?.actors),reads:kl(t?.reads),executes:kl(t?.executes)}}function uO(t,i,s){const a=dc.parse(i);return{title:typeof a?.slice=="string"?a.slice:cS(t),path:t,storyName:s.get(t),screen:rO(a?.screen),commands:lO(a?.commands),queries:aO(a?.queries),gwt:oO(a?.gwt),raw:i}}function cO(t){const i=[],s=[],a=new Map,r=new Map;for(const u of t.stories){const c=bv(u.path);r.set(u.name,c),i.push({id:c,type:"story",label:u.name,sourcePath:u.path,description:u.description})}for(const u of t.events){const c=sh(u.name);a.set(u.name,c),i.push({id:c,type:"event",label:u.name,sourceName:u.name,sourcePath:u.sourcePath,fields:u.fields,description:u.description})}for(const u of t.slices){const c=WC(u.path),m=PC(u.path),h=u.screen.type==="system"?"processor":"screen";if(i.push({id:c,type:"slice",label:u.title,storyName:u.storyName,sliceTitle:u.title,sourcePath:u.path,raw:u.raw}),u.storyName){const g=r.get(u.storyName)??bv(u.storyName);s.push({id:El("story-slice",g,c),kind:"story-slice",source:g,target:c})}i.push({id:m,type:h,label:u.screen.name??(u.screen.type==="system"?"Processor":"Screen"),storyName:u.storyName,sliceTitle:u.title,sourcePath:u.path,actors:u.screen.actors,screenType:u.screen.type,raw:u.raw}),s.push({id:El("slice-screen",c,m),kind:"slice-screen",source:c,target:m});for(const g of u.queries){const v=tO(g.name);i.push({id:v,type:"query",label:g.name,storyName:u.storyName,sliceTitle:u.title,sourceName:g.name,sourcePath:u.path,fields:g.fields,raw:u.raw}),u.screen.reads.includes(g.name)&&s.push({id:El("query-screen",v,m),kind:"query-screen",source:v,target:m});for(const p of g.fromEvents){const y=a.get(p)??sh(p);s.push({id:El("event-query",y,v),kind:"event-query",source:y,target:v,label:p})}}for(const g of u.commands){const v=eO(g.name);i.push({id:v,type:"command",label:g.name,storyName:u.storyName,sliceTitle:u.title,sourceName:g.name,sourcePath:u.path,fields:g.fields,raw:u.raw}),u.screen.executes.includes(g.name)&&s.push({id:El("screen-command",m,v),kind:"screen-command",source:m,target:v});for(const p of g.produces){const y=a.get(p)??sh(p);s.push({id:El("command-event",v,y),kind:"command-event",source:v,target:y,label:p})}}u.gwt.forEach((g,v)=>{i.push({id:nO(u.path,v,g.name),type:"gwt",label:g.name??`Case ${v+1}`,storyName:u.storyName,sliceTitle:u.title,sourceName:g.name,sourcePath:u.path,description:g.description,given:g.given,when:g.when,then:g.then,raw:u.raw})})}return{nodes:i,edges:s}}function fO(t,i={}){const s=new Map(t.map(M=>[oo(M.path),M.content])),a=s.get(".event-modeling/config.yaml"),r=a?dc.parse(a):null,u=r?.paths?.event_model_dir??"event-model",c=r?.paths?.features_dir??"event-model/features",m=r?.paths?.slice_extension??".slice.yaml",h=r?.paths?.events_file??`${u}/events.yaml`,g=r?.paths?.stories_dir??`${u}/stories`,v=s.get(h);if(!v)throw new Error(`Missing events file: ${h}`);const p=iO(h,v),y=[...s.entries()].filter(([M])=>M.startsWith(`${g}/`)&&M.endsWith(".yaml")).sort(([M],[R])=>M.localeCompare(R)).map(([M,R])=>sO(M,R)),w=new Map;for(const M of y)for(const R of M.slices)w.set(oo(R),M.name);const E=y.flatMap(M=>M.slices.map(oo)),_=[...s.keys()].filter(M=>M.startsWith(`${c}/`)&&M.endsWith(m)),S=[...new Set([...E,..._])].sort().filter(M=>s.has(M)).map(M=>uO(M,s.get(M)??"",w)),O={root:i.root??"browser-import",config:{language:r?.language,paths:{eventModelDir:u,featuresDir:c,sliceExtension:m,eventsFile:h,storiesDir:g}},events:p,stories:y,slices:S},x=cO(O);return{...O,...x}}function je(t,i,s,a,r){return{id:`${i}:${a??"project"}:${s}`,severity:t,check:i,message:s,path:a,nodeId:r}}function _l(t){const i=new Set,s=new Set;for(const a of t){const r=a.trim().toLowerCase();r&&(i.has(r)&&s.add(a),i.add(r))}return[...s]}function dO(t){return/(ed|en|d|sent|built|made|booked|paid)$/i.test(t)}function Sv(t){return/(Requested|Triggered|Scheduled|Enqueued|Dispatched|Required)$/.test(t)}function hO(t){return["Selected","Shown","Viewed","Clicked","Opened","Closed","Ticked","Incremented","Reached","Displayed","Navigated"].find(i=>t.includes(i))}function mO(t){const i=new Set(t.nodes.map(u=>u.id)),s=new Map;for(const u of i)s.set(u,new Set);for(const u of t.edges)!i.has(u.source)||!i.has(u.target)||(s.get(u.source)?.add(u.target),s.get(u.target)?.add(u.source));let a=0;const r=new Set;for(const u of i){if(r.has(u))continue;a+=1;const c=[u];for(r.add(u);c.length>0;){const m=c.shift();if(m)for(const h of s.get(m)??[])r.has(h)||(r.add(h),c.push(h))}}return a}function gO(t){const i=[],s=new Set(t.events.map(h=>h.name)),a=new Set(t.slices.map(h=>h.path)),r=new Map,u=new Map;for(const h of t.stories){h.slices.length>15&&i.push(je("warning","S4",`Story "${h.name}" has ${h.slices.length} slices; consider splitting it.`,h.path));for(const g of h.slices)a.has(g)||i.push(je("error","S2",`Story "${h.name}" lists missing slice "${g}".`,h.path))}for(const h of t.events){h.fields?.trim()||i.push(je("error","C4",`Event "${h.name}" has no fields block.`,h.sourcePath)),!dO(h.name)&&!Sv(h.name)&&i.push(je("warning","C3",`Event "${h.name}" does not obviously read as a past-tense domain event.`,h.sourcePath));const g=hO(h.name);g&&i.push(je("warning","D1",`Event "${h.name}" contains red-flag verb "${g}"; confirm this is persisted domain state.`,h.sourcePath))}for(const h of t.slices){const g=h.commands.map(p=>p.name),v=h.queries.map(p=>p.name);for(const p of _l(g))i.push(je("error","L9",`Command "${p}" is duplicated within slice "${h.title}".`,h.path));for(const p of _l(v))i.push(je("error","L9",`Query "${p}" is duplicated within slice "${h.title}".`,h.path));for(const p of _l(h.screen.reads))i.push(je("error","L9",`screen.reads lists "${p}" more than once.`,h.path));for(const p of _l(h.screen.executes))i.push(je("error","L9",`screen.executes lists "${p}" more than once.`,h.path));for(const p of h.screen.reads)v.includes(p)||i.push(je("error","W2",`screen.reads references missing local query "${p}".`,h.path));for(const p of h.screen.executes)g.includes(p)||i.push(je("error","W1",`screen.executes references missing local command "${p}".`,h.path));h.screen.type==="system"&&h.screen.actors.length>0&&i.push(je("error","L5",`System slice "${h.title}" must not declare screen.actors.`,h.path)),h.storyName||i.push(je("warning","M2",`Slice "${h.title}" is not listed by any story.`,h.path)),h.commands.length>0&&h.gwt.length===0&&i.push(je("warning","M1",`Command slice "${h.title}" has no GWT scenarios.`,h.path));for(const p of h.commands){p.fields?.trim()||i.push(je("warning","L6",`Command "${p.name}" has no fields block.`,h.path));for(const y of p.produces)s.has(y)||i.push(je("error","G1",`Command "${p.name}" produces unregistered event "${y}".`,h.path)),r.set(y,[...r.get(y)??[],`${h.title}.${p.name}`])}for(const p of h.queries){p.fields?.trim()||i.push(je("warning","L7",`Query "${p.name}" has no fields block.`,h.path)),p.name.includes("For")||i.push(je("warning","N1",`Query "${p.name}" should use a descriptive <Thing>For<UseCaseOrScreen> name.`,h.path));for(const y of p.fromEvents)s.has(y)||i.push(je("error","G2",`Query "${p.name}" reads unregistered event "${y}".`,h.path)),u.set(y,[...u.get(y)??[],`${h.title}.${p.name}`])}for(const p of h.gwt)for(const y of[...p.given,...p.when,...p.then])(!y.type||!["event","command","query","error"].includes(y.type))&&i.push(je("error","L8",`GWT scenario "${p.name??"Unnamed"}" has invalid item type "${y.type??""}".`,h.path)),y.name||i.push(je("error","L8",`GWT scenario "${p.name??"Unnamed"}" has an item without a name.`,h.path))}for(const h of s){const g=r.get(h)??[],v=u.get(h)??[];g.length===0&&i.push(je("error","G3",`Event "${h}" is registered but no command produces it.`)),g.length>1&&i.push(je("warning","G8",`Event "${h}" has multiple producers: ${g.join(", ")}.`)),g.length>0&&v.length===0&&i.push(je("warning",Sv(h)?"G4b":"G4a",`Event "${h}" is produced but no query consumes it.`))}for(const[h,g]of u.entries())(r.get(h)??[]).length===0&&i.push(je("error","G3",`Event "${h}" is read by ${g.join(", ")} but no command produces it.`));for(const h of _l(t.slices.flatMap(g=>g.commands.map(v=>v.name))))i.push(je("warning","M5",`Command name "${h}" is used in multiple slices; command names should be globally unique.`));for(const h of _l(t.slices.flatMap(g=>g.queries.map(v=>v.name))))i.push(je("warning","G7",`Query name "${h}" is used in multiple slices; query names should be globally unique.`));const c=t.slices.filter(h=>h.commands.length>0).length;c>0&&t.events.length/c>2&&i.push(je("warning","M4",`The model has ${(t.events.length/c).toFixed(1)} events per command slice; check for UI/runtime events leaking into the model.`));const m=mO(t);return m>1&&i.push(je("info","I3",`The graph has ${m} disconnected islands.`)),{errors:i.filter(h=>h.severity==="error").length,warnings:i.filter(h=>h.severity==="warning").length,findings:i}}function wv(){return z.jsxs(z.Fragment,{children:[z.jsx(rn,{id:"top-target",type:"target",position:fe.Top,style:{left:"46%"}}),z.jsx(rn,{id:"top-source",type:"source",position:fe.Top,style:{left:"54%"}}),z.jsx(rn,{id:"bottom-target",type:"target",position:fe.Bottom,style:{left:"46%"}}),z.jsx(rn,{id:"bottom-source",type:"source",position:fe.Bottom,style:{left:"54%"}}),z.jsx(rn,{id:"left-target",type:"target",position:fe.Left,style:{top:"46%"}}),z.jsx(rn,{id:"left-source",type:"source",position:fe.Left,style:{top:"54%"}}),z.jsx(rn,{id:"right-target",type:"target",position:fe.Right,style:{top:"46%"}}),z.jsx(rn,{id:"right-source",type:"source",position:fe.Right,style:{top:"54%"}})]})}function lh({title:t,items:i}){const s=i&&i.length>0?i:[{type:"empty",name:"empty"}];return z.jsxs("div",{className:"gwt-step",children:[z.jsx("div",{className:"gwt-step-title",children:t}),z.jsx("div",{className:"gwt-step-items",children:s.map((a,r)=>z.jsxs("div",{className:`gwt-step-item gwt-step-item-${a.type??"empty"}`,children:[z.jsx("span",{children:a.type??"empty"}),z.jsx("strong",{children:a.name??"empty"})]},`${a.type??"empty"}-${a.name??r}`))})]})}function pO({data:t}){const i=t,s=i.projectNode;return s.type==="gwt"?z.jsxs("div",{className:`em-node em-node-${s.type} ${i.selected?"selected":""} ${i.connected?"connected":""}`,children:[z.jsx(wv,{}),z.jsx("div",{className:"node-type",children:"GWT case"}),z.jsx("div",{className:"node-label",children:s.label}),s.description?z.jsx("div",{className:"gwt-description",children:s.description}):null,z.jsxs("div",{className:"gwt-steps",children:[z.jsx(lh,{title:"Given",items:s.given}),z.jsx(lh,{title:"When",items:s.when}),z.jsx(lh,{title:"Then",items:s.then})]})]}):z.jsxs("div",{className:`em-node em-node-${s.type} ${i.selected?"selected":""} ${i.connected?"connected":""}`,children:[z.jsx(wv,{}),z.jsx("div",{className:"node-type",children:s.type}),z.jsx("div",{className:"node-label",children:s.label}),s.actors&&s.actors.length>0?z.jsx("div",{className:"chips",children:s.actors.map(a=>z.jsx("span",{children:a},a))}):null]})}function yO({data:t}){const i=t,s=i.projectNode;return z.jsxs("div",{className:`group-node group-${s.type} ${i.selected?"selected":""}`,children:[z.jsx("div",{className:"group-title",children:s.label}),s.description?z.jsx("div",{className:"group-description",children:s.description}):null]})}const vO={eventModelNode:pO,groupNode:yO};function xv(t){return t===fe.Top?{x:0,y:-1}:t===fe.Right?{x:1,y:0}:t===fe.Bottom?{x:0,y:1}:{x:-1,y:0}}function bO({sourceX:t,sourceY:i,targetX:s,targetY:a,sourcePosition:r,targetPosition:u,data:c}){const m=c,h=s-t,g=a-i,v=Math.max(56,Math.min(180,Math.abs(g)*.42)),p=Math.max(70,Math.min(180,Math.abs(h)*.38)),y=Math.max(72,Math.min(180,Math.max(Math.abs(h),Math.abs(g))*.38));if(m?.route==="same-slice-read"){const _=r===fe.Top?-1:1,N=u===fe.Bottom?1:-1,S=Math.max(72,Math.min(150,Math.abs(g)*.65));return`M ${t},${i} C ${t},${i+_*S} ${s},${a+N*S} ${s},${a}`}if(m?.route==="event-read"){const _=xv(r),N=xv(u);return`M ${t},${i} C ${t+_.x*y},${i+_.y*y} ${s+N.x*y},${a+N.y*y} ${s},${a}`}if(r===fe.Bottom||r===fe.Top){const _=r===fe.Top?-1:1,N=u===fe.Top?-1:1;return`M ${t},${i} C ${t},${i+_*v} ${s},${a+N*v} ${s},${a}`}const w=r===fe.Left?-1:1,E=u===fe.Left?-1:1;return`M ${t},${i} C ${t+w*p},${i} ${s+E*p},${a} ${s},${a}`}function SO(t){const i=t.data,s=i?.active?"#111827":"#64748b";return z.jsx(Mo,{path:bO(t),markerEnd:t.markerEnd,style:{...t.style,stroke:s},className:i?.active?"edge-path-active":"edge-path"})}const wO={eventModelEdge:SO};function mu({label:t,description:i,value:s,copiedKey:a,onCopy:r}){return z.jsx("button",{type:"button",className:"copy-action",onClick:()=>r(a,s),children:z.jsxs("span",{children:[z.jsx("strong",{children:t}),z.jsx("small",{children:i})]})})}function Ch(t){return t==="query-screen"||t==="screen-command"||t==="command-event"||t==="event-query"}async function xO(t){return await Promise.all(Array.from(t).filter(s=>/\.(ya?ml|json)$/i.test(s.name)).map(async s=>({path:s.webkitRelativePath||s.name,content:await s.text()})))}function EO(t){const i=t.find(s=>s.path===".event-modeling/graph.json"||s.path.endsWith("/.event-modeling/graph.json"));if(i)try{return JSON.parse(i.content)}catch{return}}function _O(t){return t.type==="story"?{name:t.label}:t.type==="slice"?{slice:t.label}:t.type==="screen"||t.type==="processor"?{slice:t.sliceTitle??t.label}:t.type==="command"||t.type==="query"?{slice:t.sliceTitle??"",name:t.sourceName??t.label}:{name:t.sourceName??t.label}}function NO(t){const i=t.graphSidecar?.nodes;return i?Object.entries(i).flatMap(([s,a])=>{const r=a,u=t.nodes.filter(c=>{if(r.type==="screen"&&c.type!=="screen"&&c.type!=="processor"||r.type!=="screen"&&r.type!==c.type)return!1;const m=_O(c);return Object.entries(r.selector??{}).every(([h,g])=>m[h]===g)});return u.length===0?[{id:`V1:.event-modeling/graph.json:${s}`,severity:"warning",check:"V1",message:`graph.json node "${s}" selector does not resolve.`,path:".event-modeling/graph.json",nodeId:s}]:u.length>1?[{id:`V2:.event-modeling/graph.json:${s}`,severity:"warning",check:"V2",message:`graph.json node "${s}" selector resolves to ${u.length} nodes.`,path:".event-modeling/graph.json",nodeId:s}]:[]}):[]}function AO({onImport:t,error:i}){return z.jsx("div",{className:"import-panel",children:z.jsxs("div",{className:"import-card",children:[z.jsx("h1",{children:"emviz"}),z.jsx("p",{children:"Import an Event Modeling project folder or select YAML/JSON files to visualize the model."}),z.jsxs("div",{className:"import-actions",children:[z.jsxs("label",{children:["Import folder",z.jsx("input",{type:"file",multiple:!0,webkitdirectory:"",directory:"",onChange:s=>s.currentTarget.files&&t(s.currentTarget.files)})]}),z.jsxs("label",{children:["Import files",z.jsx("input",{type:"file",multiple:!0,accept:".yaml,.yml,.json",onChange:s=>s.currentTarget.files&&t(s.currentTarget.files)})]})]}),i?z.jsx("p",{className:"import-error",children:i}):null]})})}function TO({project:t,selectedNode:i,findings:s,onSelect:a,onPreviewConnection:r,onClearPreview:u}){const[c,m]=F.useState(),h=F.useCallback((S,O)=>{navigator.clipboard?.writeText(O).then(()=>{m(S),window.setTimeout(()=>m(x=>x===S?void 0:x),1400)})},[]);if(!i)return z.jsxs("aside",{className:"panel panel-right",children:[z.jsx("h2",{children:"Selection"}),z.jsx("p",{className:"muted",children:"Select a node to inspect source and connections."})]});const g=t.edges.filter(S=>S.target===i.id&&Ch(S.kind)),v=t.edges.filter(S=>S.source===i.id&&Ch(S.kind)),p=new Map(t.nodes.map(S=>[S.id,S])),w=`em://${t.graphSidecar?.model?.id??"event_model"}/${i.id}`,E=i.raw??i.fields??i.description??i.label,_=[`Reference: ${w}`,`Node: ${i.label} (${i.type})`,`Source: ${i.sourcePath??"unknown"}`,"","Incoming:",...g.length===0?["- none"]:g.map(S=>`- ${p.get(S.source)?.label??S.source} -> ${i.label}`),"","Outgoing:",...v.length===0?["- none"]:v.map(S=>`- ${i.label} -> ${p.get(S.target)?.label??S.target}`),"","Source excerpt:",E].join(`
|
|
154
|
+
`),N=`Please update this event model node.
|
|
155
|
+
|
|
156
|
+
Reference:
|
|
157
|
+
${w}
|
|
158
|
+
|
|
159
|
+
Source path:
|
|
160
|
+
${i.sourcePath??"unknown"}
|
|
161
|
+
|
|
162
|
+
Current context:
|
|
163
|
+
${E}
|
|
164
|
+
|
|
165
|
+
Goal:
|
|
166
|
+
`;return z.jsxs("aside",{className:"panel panel-right",children:[z.jsx("h2",{children:i.label}),z.jsxs("div",{className:"meta-row",children:[z.jsx("span",{children:"Type"}),z.jsx("strong",{children:i.type})]}),z.jsxs("div",{className:"meta-row",children:[z.jsx("span",{children:"Reference"}),z.jsx("code",{children:w})]}),i.sourcePath?z.jsxs("div",{className:"meta-row",children:[z.jsx("span",{children:"Source"}),z.jsx("code",{children:i.sourcePath})]}):null,z.jsxs("details",{className:"copy-section",children:[z.jsxs("summary",{children:[z.jsx("span",{children:"Copy for LLM"}),c?z.jsxs("strong",{className:"copy-feedback","aria-live":"polite",children:["Copied ",c]}):null]}),z.jsxs("div",{className:"copy-actions",children:[z.jsx(mu,{label:"Reference",description:"Stable em:// node handle",value:w,copiedKey:"reference",onCopy:h}),z.jsx(mu,{label:"YAML",description:"Source excerpt for this node",value:E,copiedKey:"YAML",onCopy:h}),z.jsx(mu,{label:"Context",description:"Reference plus incoming/outgoing links",value:_,copiedKey:"context",onCopy:h}),z.jsx(mu,{label:"Edit prompt",description:"Prompt scaffold for asking an LLM to edit",value:N,copiedKey:"prompt",onCopy:h})]})]}),z.jsx("h3",{children:"Connections"}),z.jsxs("div",{className:"connection-list",children:[z.jsx("strong",{children:"Incoming"}),g.length===0?z.jsx("p",{className:"muted",children:"None"}):g.map(S=>z.jsx("button",{type:"button",className:"connection-button",onClick:()=>a(S.source),onMouseEnter:()=>r(S.id),onMouseLeave:u,onFocus:()=>r(S.id),onBlur:u,children:p.get(S.source)?.label??S.source},S.id)),z.jsx("strong",{children:"Outgoing"}),v.length===0?z.jsx("p",{className:"muted",children:"None"}):v.map(S=>z.jsx("button",{type:"button",className:"connection-button",onClick:()=>a(S.target),onMouseEnter:()=>r(S.id),onMouseLeave:u,onFocus:()=>r(S.id),onBlur:u,children:p.get(S.target)?.label??S.target},S.id))]}),z.jsx("h3",{children:"Findings"}),s.length===0?z.jsx("p",{className:"muted",children:"No findings for this node."}):s.map(S=>z.jsxs("div",{className:`finding finding-${S.severity}`,children:[z.jsx("strong",{children:S.check}),z.jsx("span",{children:S.message})]},S.id)),z.jsx("h3",{children:"Source"}),z.jsx("pre",{children:E})]})}function MO({report:t,onSelect:i}){return z.jsxs("aside",{className:"panel panel-left",children:[z.jsx("h2",{children:"Validation"}),t?z.jsxs(z.Fragment,{children:[z.jsxs("div",{className:"status-row",children:[z.jsxs("span",{className:"status error",children:[t.errors," errors"]}),z.jsxs("span",{className:"status warning",children:[t.warnings," warnings"]})]}),z.jsx("div",{className:"findings-list",children:t.findings.length===0?z.jsx("p",{className:"muted",children:"No validation findings."}):t.findings.map(s=>z.jsxs("button",{type:"button",className:`finding finding-${s.severity}`,onClick:()=>s.nodeId&&i(s.nodeId),children:[z.jsx("strong",{children:s.check}),z.jsx("span",{children:s.message}),s.path?z.jsx("code",{children:s.path}):null]},s.id))})]}):z.jsx("p",{className:"muted",children:"Loading validation..."})]})}function CO(){const[t,i]=F.useState(),[s,a]=F.useState(),[r,u]=F.useState("loading"),[c,m]=F.useState(),[h,g]=F.useState(),[v,p]=F.useState([]),[y,w]=F.useState([]),[E,_]=F.useState(""),[N,S]=F.useState(),{setCenter:O,fitView:x}=Ju();F.useEffect(()=>{Promise.all([fetch("/api/model").then(T=>T.json()),fetch("/api/validation").then(T=>T.json())]).then(([T,D])=>{i(T),a(D),u("ready"),window.setTimeout(()=>{x({padding:.18,duration:300})},50)}).catch(()=>{u("import")})},[x]);const M=F.useMemo(()=>t?.nodes.find(T=>T.id===h),[t,h]),R=F.useMemo(()=>s?.findings.filter(T=>T.nodeId===h)??[],[s,h]),L=F.useMemo(()=>{if(N)return new Set([N]);if(!(!t||!h))return new Set(t.edges.filter(T=>Ch(T.kind)&&(T.source===h||T.target===h)).map(T=>T.id))},[N,t,h]),H=F.useMemo(()=>t?YM(t,h,{focusedEdgeIds:L}):{nodes:[],edges:[]},[L,t,h]),j=F.useMemo(()=>{if(!t||E.trim().length<2)return[];const T=E.trim().toLowerCase();return t.nodes.filter(D=>`${D.label} ${D.type} ${D.sourcePath??""}`.toLowerCase().includes(T)).slice(0,8)},[t,E]),Y=F.useCallback((T,D=!0)=>{const q=H.nodes.find(X=>X.id===T);S(void 0),D&&h&&h!==T&&(p(X=>[...X,h]),w([])),g(T),q&&O(q.position.x+80,q.position.y+60,{zoom:1.2,duration:350})},[H.nodes,h,O]),ae=F.useCallback(()=>{g(void 0),S(void 0)},[]),K=F.useCallback(T=>{const D=t?.edges.find(X=>X.id===T);if(!D)return;S(T);const q=H.nodes.filter(X=>X.id===D.source||X.id===D.target);q.length>0&&x({nodes:q,padding:.36,duration:260,maxZoom:1.25})},[x,H.nodes,t?.edges]),I=F.useCallback(()=>{S(void 0)},[]);F.useEffect(()=>{const T=D=>{D.key==="Escape"&&ae()};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[ae]);const oe=F.useCallback(()=>{const T=v.at(-1);T&&(p(D=>D.slice(0,-1)),h&&w(D=>[...D,h]),Y(T,!1))},[v,Y,h]),B=F.useCallback(()=>{const T=y.at(-1);T&&(w(D=>D.slice(0,-1)),h&&p(D=>[...D,h]),Y(T,!1))},[Y,y,h]),G=F.useCallback(T=>{xO(T).then(D=>{const q=fO(D),X=q;X.graphSidecar=EO(D)??{model:{id:"browser_import",name:"Browser Import"}},i(X);const te=gO(q),C=NO(X);a({errors:te.errors,warnings:te.warnings+C.filter($=>$.severity==="warning").length,findings:[...te.findings,...C]}),g(void 0),S(void 0),p([]),w([]),u("ready"),m(void 0),window.setTimeout(()=>{x({padding:.18,duration:300})},50)}).catch(D=>{m(D instanceof Error?D.message:String(D)),u("import")})},[x]);return r==="import"?z.jsx(AO,{onImport:G,error:c}):t?z.jsxs("div",{className:"app-shell",children:[z.jsxs("header",{className:"toolbar",children:[z.jsxs("div",{className:"model-summary",children:[z.jsx("strong",{children:"emviz"}),z.jsxs("span",{children:[t.stories.length," stories"]}),z.jsxs("span",{children:[t.slices.length," slices"]}),z.jsxs("span",{children:[t.nodes.filter(T=>T.type==="event").length," events"]})]}),z.jsxs("div",{className:"segmented toolbar-history","aria-label":"Selection history",children:[z.jsx("button",{type:"button",disabled:v.length===0,onClick:oe,children:"Back"}),z.jsx("button",{type:"button",disabled:y.length===0,onClick:B,children:"Forward"})]}),z.jsxs("div",{className:"search-box",children:[z.jsx("input",{"aria-label":"Search event model",value:E,onChange:T=>_(T.target.value),placeholder:"Search nodes by name or type..."}),j.length>0?z.jsx("div",{className:"search-results",children:j.map(T=>z.jsxs("button",{type:"button",onClick:()=>Y(T.id),children:[z.jsx("span",{children:T.label}),z.jsx("small",{children:T.type})]},T.id))}):null]})]}),z.jsx(MO,{report:s,onSelect:Y}),z.jsx(TO,{project:t,selectedNode:M,findings:R,onSelect:Y,onPreviewConnection:K,onClearPreview:I}),z.jsx("main",{className:"canvas",children:z.jsxs(iM,{nodes:H.nodes,edges:H.edges,nodeTypes:vO,edgeTypes:wO,onNodeClick:(T,D)=>Y(D.id),fitView:!0,minZoom:.2,maxZoom:1.8,nodesDraggable:!1,colorMode:"light",children:[z.jsx(rM,{gap:18,size:1}),z.jsx(gM,{})]})})]}):z.jsx("div",{className:"loading",children:"Loading event model..."})}function OO(){return z.jsx(ob,{children:z.jsx(CO,{})})}_x.createRoot(document.getElementById("root")).render(z.jsx(_v.StrictMode,{children:z.jsx(OO,{})}));
|