emviz 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,171 @@
1
+ (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function s(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(o){if(o.ep)return;o.ep=!0;const c=s(o);fetch(o.href,c)}})();function db(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Jd={exports:{}},To={};var S0;function EE(){if(S0)return To;S0=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function s(a,o,c){var u=null;if(c!==void 0&&(u=""+c),o.key!==void 0&&(u=""+o.key),"key"in o){c={};for(var d in o)d!=="key"&&(c[d]=o[d])}else c=o;return o=c.ref,{$$typeof:e,type:a,key:u,ref:o!==void 0?o:null,props:c}}return To.Fragment=n,To.jsx=s,To.jsxs=s,To}var w0;function NE(){return w0||(w0=1,Jd.exports=EE()),Jd.exports}var S=NE(),Wd={exports:{}},_e={};var x0;function _E(){if(x0)return _e;x0=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function w(k){return k===null||typeof k!="object"?null:(k=y&&k[y]||k["@@iterator"],typeof k=="function"?k:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,A={};function T(k,U,P){this.props=k,this.context=U,this.refs=A,this.updater=P||x}T.prototype.isReactComponent={},T.prototype.setState=function(k,U){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,U,"setState")},T.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function z(){}z.prototype=T.prototype;function _(k,U,P){this.props=k,this.context=U,this.refs=A,this.updater=P||x}var N=_.prototype=new z;N.constructor=_,E(N,T.prototype),N.isPureReactComponent=!0;var j=Array.isArray;function D(){}var $={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function I(k,U,P){var se=P.ref;return{$$typeof:e,type:k,key:U,ref:se!==void 0?se:null,props:P}}function V(k,U){return I(k.type,U,k.props)}function G(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function Z(k){var U={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(P){return U[P]})}var le=/\/+/g;function H(k,U){return typeof k=="object"&&k!==null&&k.key!=null?Z(""+k.key):U.toString(36)}function O(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(D,D):(k.status="pending",k.then(function(U){k.status==="pending"&&(k.status="fulfilled",k.value=U)},function(U){k.status==="pending"&&(k.status="rejected",k.reason=U)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function C(k,U,P,se,fe){var de=typeof k;(de==="undefined"||de==="boolean")&&(k=null);var ae=!1;if(k===null)ae=!0;else switch(de){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(k.$$typeof){case e:case n:ae=!0;break;case v:return ae=k._init,C(ae(k._payload),U,P,se,fe)}}if(ae)return fe=fe(k),ae=se===""?"."+H(k,0):se,j(fe)?(P="",ae!=null&&(P=ae.replace(le,"$&/")+"/"),C(fe,U,P,"",function(Se){return Se})):fe!=null&&(G(fe)&&(fe=V(fe,P+(fe.key==null||k&&k.key===fe.key?"":(""+fe.key).replace(le,"$&/")+"/")+ae)),U.push(fe)),1;ae=0;var ne=se===""?".":se+":";if(j(k))for(var ce=0;ce<k.length;ce++)se=k[ce],de=ne+H(se,ce),ae+=C(se,U,P,de,fe);else if(ce=w(k),typeof ce=="function")for(k=ce.call(k),ce=0;!(se=k.next()).done;)se=se.value,de=ne+H(se,ce++),ae+=C(se,U,P,de,fe);else if(de==="object"){if(typeof k.then=="function")return C(O(k),U,P,se,fe);throw U=String(k),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ae}function B(k,U,P){if(k==null)return k;var se=[],fe=0;return C(k,se,"","",function(de){return U.call(P,de,fe++)}),se}function R(k){if(k._status===-1){var U=k._result;U=U(),U.then(function(P){(k._status===0||k._status===-1)&&(k._status=1,k._result=P)},function(P){(k._status===0||k._status===-1)&&(k._status=2,k._result=P)}),k._status===-1&&(k._status=0,k._result=U)}if(k._status===1)return k._result.default;throw k._result}var K=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},ee={map:B,forEach:function(k,U,P){B(k,function(){U.apply(this,arguments)},P)},count:function(k){var U=0;return B(k,function(){U++}),U},toArray:function(k){return B(k,function(U){return U})||[]},only:function(k){if(!G(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return _e.Activity=g,_e.Children=ee,_e.Component=T,_e.Fragment=s,_e.Profiler=o,_e.PureComponent=_,_e.StrictMode=a,_e.Suspense=h,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,_e.__COMPILER_RUNTIME={__proto__:null,c:function(k){return $.H.useMemoCache(k)}},_e.cache=function(k){return function(){return k.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(k,U,P){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var se=E({},k.props),fe=k.key;if(U!=null)for(de in U.key!==void 0&&(fe=""+U.key),U)!L.call(U,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&U.ref===void 0||(se[de]=U[de]);var de=arguments.length-2;if(de===1)se.children=P;else if(1<de){for(var ae=Array(de),ne=0;ne<de;ne++)ae[ne]=arguments[ne+2];se.children=ae}return I(k.type,fe,se)},_e.createContext=function(k){return k={$$typeof:u,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:c,_context:k},k},_e.createElement=function(k,U,P){var se,fe={},de=null;if(U!=null)for(se in U.key!==void 0&&(de=""+U.key),U)L.call(U,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(fe[se]=U[se]);var ae=arguments.length-2;if(ae===1)fe.children=P;else if(1<ae){for(var ne=Array(ae),ce=0;ce<ae;ce++)ne[ce]=arguments[ce+2];fe.children=ne}if(k&&k.defaultProps)for(se in ae=k.defaultProps,ae)fe[se]===void 0&&(fe[se]=ae[se]);return I(k,de,fe)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(k){return{$$typeof:d,render:k}},_e.isValidElement=G,_e.lazy=function(k){return{$$typeof:v,_payload:{_status:-1,_result:k},_init:R}},_e.memo=function(k,U){return{$$typeof:p,type:k,compare:U===void 0?null:U}},_e.startTransition=function(k){var U=$.T,P={};$.T=P;try{var se=k(),fe=$.S;fe!==null&&fe(P,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(D,K)}catch(de){K(de)}finally{U!==null&&P.types!==null&&(U.types=P.types),$.T=U}},_e.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},_e.use=function(k){return $.H.use(k)},_e.useActionState=function(k,U,P){return $.H.useActionState(k,U,P)},_e.useCallback=function(k,U){return $.H.useCallback(k,U)},_e.useContext=function(k){return $.H.useContext(k)},_e.useDebugValue=function(){},_e.useDeferredValue=function(k,U){return $.H.useDeferredValue(k,U)},_e.useEffect=function(k,U){return $.H.useEffect(k,U)},_e.useEffectEvent=function(k){return $.H.useEffectEvent(k)},_e.useId=function(){return $.H.useId()},_e.useImperativeHandle=function(k,U,P){return $.H.useImperativeHandle(k,U,P)},_e.useInsertionEffect=function(k,U){return $.H.useInsertionEffect(k,U)},_e.useLayoutEffect=function(k,U){return $.H.useLayoutEffect(k,U)},_e.useMemo=function(k,U){return $.H.useMemo(k,U)},_e.useOptimistic=function(k,U){return $.H.useOptimistic(k,U)},_e.useReducer=function(k,U,P){return $.H.useReducer(k,U,P)},_e.useRef=function(k){return $.H.useRef(k)},_e.useState=function(k){return $.H.useState(k)},_e.useSyncExternalStore=function(k,U,P){return $.H.useSyncExternalStore(k,U,P)},_e.useTransition=function(){return $.H.useTransition()},_e.version="19.2.7",_e}var E0;function ar(){return E0||(E0=1,Wd.exports=_E()),Wd.exports}var Y=ar();const Sl=db(Y);var Pd={exports:{}},Co={},eh={exports:{}},th={};var N0;function AE(){return N0||(N0=1,(function(e){function n(C,B){var R=C.length;C.push(B);e:for(;0<R;){var K=R-1>>>1,ee=C[K];if(0<o(ee,B))C[K]=B,C[R]=ee,R=K;else break e}}function s(C){return C.length===0?null:C[0]}function a(C){if(C.length===0)return null;var B=C[0],R=C.pop();if(R!==B){C[0]=R;e:for(var K=0,ee=C.length,k=ee>>>1;K<k;){var U=2*(K+1)-1,P=C[U],se=U+1,fe=C[se];if(0>o(P,R))se<ee&&0>o(fe,P)?(C[K]=fe,C[se]=R,K=se):(C[K]=P,C[U]=R,K=U);else if(se<ee&&0>o(fe,R))C[K]=fe,C[se]=R,K=se;else break e}}return B}function o(C,B){var R=C.sortIndex-B.sortIndex;return R!==0?R:C.id-B.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var h=[],p=[],v=1,g=null,y=3,w=!1,x=!1,E=!1,A=!1,T=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function N(C){for(var B=s(p);B!==null;){if(B.callback===null)a(p);else if(B.startTime<=C)a(p),B.sortIndex=B.expirationTime,n(h,B);else break;B=s(p)}}function j(C){if(E=!1,N(C),!x)if(s(h)!==null)x=!0,D||(D=!0,Z());else{var B=s(p);B!==null&&O(j,B.startTime-C)}}var D=!1,$=-1,L=5,I=-1;function V(){return A?!0:!(e.unstable_now()-I<L)}function G(){if(A=!1,D){var C=e.unstable_now();I=C;var B=!0;try{e:{x=!1,E&&(E=!1,z($),$=-1),w=!0;var R=y;try{t:{for(N(C),g=s(h);g!==null&&!(g.expirationTime>C&&V());){var K=g.callback;if(typeof K=="function"){g.callback=null,y=g.priorityLevel;var ee=K(g.expirationTime<=C);if(C=e.unstable_now(),typeof ee=="function"){g.callback=ee,N(C),B=!0;break t}g===s(h)&&a(h),N(C)}else a(h);g=s(h)}if(g!==null)B=!0;else{var k=s(p);k!==null&&O(j,k.startTime-C),B=!1}}break e}finally{g=null,y=R,w=!1}B=void 0}}finally{B?Z():D=!1}}}var Z;if(typeof _=="function")Z=function(){_(G)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,H=le.port2;le.port1.onmessage=G,Z=function(){H.postMessage(null)}}else Z=function(){T(G,0)};function O(C,B){$=T(function(){C(e.unstable_now())},B)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(C){C.callback=null},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(C){switch(y){case 1:case 2:case 3:var B=3;break;default:B=y}var R=y;y=B;try{return C()}finally{y=R}},e.unstable_requestPaint=function(){A=!0},e.unstable_runWithPriority=function(C,B){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var R=y;y=C;try{return B()}finally{y=R}},e.unstable_scheduleCallback=function(C,B,R){var K=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?K+R:K):R=K,C){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=R+ee,C={id:v++,callback:B,priorityLevel:C,startTime:R,expirationTime:ee,sortIndex:-1},R>K?(C.sortIndex=R,n(p,C),s(h)===null&&C===s(p)&&(E?(z($),$=-1):E=!0,O(j,R-K))):(C.sortIndex=ee,n(h,C),x||w||(x=!0,D||(D=!0,Z()))),C},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(C){var B=y;return function(){var R=y;y=B;try{return C.apply(this,arguments)}finally{y=R}}}})(th)),th}var _0;function TE(){return _0||(_0=1,eh.exports=AE()),eh.exports}var nh={exports:{}},Rt={};var A0;function CE(){if(A0)return Rt;A0=1;var e=ar();function n(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)p+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+h+"; visit "+p+" 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(n(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(h,p,v){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:h,containerInfo:p,implementation:v}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Rt.createPortal=function(h,p){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(n(299));return c(h,p,null,v)},Rt.flushSync=function(h){var p=u.T,v=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.T=p,a.p=v,a.d.f()}},Rt.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(h,p))},Rt.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},Rt.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var v=p.as,g=d(v,p.crossOrigin),y=typeof p.integrity=="string"?p.integrity:void 0,w=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;v==="style"?a.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:w}):v==="script"&&a.d.X(h,{crossOrigin:g,integrity:y,fetchPriority:w,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Rt.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var v=d(p.as,p.crossOrigin);a.d.M(h,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(h)},Rt.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var v=p.as,g=d(v,p.crossOrigin);a.d.L(h,v,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Rt.preloadModule=function(h,p){if(typeof h=="string")if(p){var v=d(p.as,p.crossOrigin);a.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(h)},Rt.requestFormReset=function(h){a.d.r(h)},Rt.unstable_batchedUpdates=function(h,p){return h(p)},Rt.useFormState=function(h,p,v){return u.H.useFormState(h,p,v)},Rt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Rt.version="19.2.7",Rt}var T0;function hb(){if(T0)return nh.exports;T0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),nh.exports=CE(),nh.exports}var C0;function ME(){if(C0)return Co;C0=1;var e=TE(),n=ar(),s=hb();function a(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var i=t,l=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(l=i.return),t=i.return;while(t)}return i.tag===3?l:null}function u(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function d(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function h(t){if(c(t)!==t)throw Error(a(188))}function p(t){var i=t.alternate;if(!i){if(i=c(t),i===null)throw Error(a(188));return i!==t?null:t}for(var l=t,r=i;;){var f=l.return;if(f===null)break;var m=f.alternate;if(m===null){if(r=f.return,r!==null){l=r;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===l)return h(f),t;if(m===r)return h(f),i;m=m.sibling}throw Error(a(188))}if(l.return!==r.return)l=f,r=m;else{for(var b=!1,M=f.child;M;){if(M===l){b=!0,l=f,r=m;break}if(M===r){b=!0,r=f,l=m;break}M=M.sibling}if(!b){for(M=m.child;M;){if(M===l){b=!0,l=m,r=f;break}if(M===r){b=!0,r=m,l=f;break}M=M.sibling}if(!b)throw Error(a(189))}}if(l.alternate!==r)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?t:i}function v(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=v(t),i!==null)return i;t=t.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),_=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function Z(t){return t===null||typeof t!="object"?null:(t=G&&t[G]||t["@@iterator"],typeof t=="function"?t:null)}var le=Symbol.for("react.client.reference");function H(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===le?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case E:return"Fragment";case T:return"Profiler";case A:return"StrictMode";case j:return"Suspense";case D:return"SuspenseList";case I:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case x:return"Portal";case _:return t.displayName||"Context";case z:return(t._context.displayName||"Context")+".Consumer";case N:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case $:return i=t.displayName||null,i!==null?i:H(t.type)||"Memo";case L:i=t._payload,t=t._init;try{return H(t(i))}catch{}}return null}var O=Array.isArray,C=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R={pending:!1,data:null,method:null,action:null},K=[],ee=-1;function k(t){return{current:t}}function U(t){0>ee||(t.current=K[ee],K[ee]=null,ee--)}function P(t,i){ee++,K[ee]=t.current,t.current=i}var se=k(null),fe=k(null),de=k(null),ae=k(null);function ne(t,i){switch(P(de,i),P(fe,t),P(se,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?Vy(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=Vy(i),t=Yy(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}U(se),P(se,t)}function ce(){U(se),U(fe),U(de)}function Se(t){t.memoizedState!==null&&P(ae,t);var i=se.current,l=Yy(i,t.type);i!==l&&(P(fe,t),P(se,l))}function we(t){fe.current===t&&(U(se),U(fe)),ae.current===t&&(U(ae),Eo._currentValue=R)}var ge,pe;function Ee(t){if(ge===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);ge=i&&i[1]||"",pe=-1<l.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+ge+t+pe}var Ce=!1;function Ue(t,i){if(!t||Ce)return"";Ce=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(i){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(ie){var te=ie}Reflect.construct(t,[],ue)}else{try{ue.call()}catch(ie){te=ie}t.call(ue.prototype)}}else{try{throw Error()}catch(ie){te=ie}(ue=t())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(ie){if(ie&&te&&typeof ie.stack=="string")return[ie.stack,te.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=r.DetermineComponentFrameRoot(),b=m[0],M=m[1];if(b&&M){var q=b.split(`
4
+ `),W=M.split(`
5
+ `);for(f=r=0;r<q.length&&!q[r].includes("DetermineComponentFrameRoot");)r++;for(;f<W.length&&!W[f].includes("DetermineComponentFrameRoot");)f++;if(r===q.length||f===W.length)for(r=q.length-1,f=W.length-1;1<=r&&0<=f&&q[r]!==W[f];)f--;for(;1<=r&&0<=f;r--,f--)if(q[r]!==W[f]){if(r!==1||f!==1)do if(r--,f--,0>f||q[r]!==W[f]){var oe=`
6
+ `+q[r].replace(" at new "," at ");return t.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",t.displayName)),oe}while(1<=r&&0<=f);break}}}finally{Ce=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?Ee(l):""}function Pe(t,i){switch(t.tag){case 26:case 27:case 5:return Ee(t.type);case 16:return Ee("Lazy");case 13:return t.child!==i&&i!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return Ue(t.type,!1);case 11:return Ue(t.type.render,!1);case 1:return Ue(t.type,!0);case 31:return Ee("Activity");default:return""}}function zt(t){try{var i="",l=null;do i+=Pe(t,l),l=t,t=t.return;while(t);return i}catch(r){return`
7
+ Error generating stack: `+r.message+`
8
+ `+r.stack}}var ot=Object.prototype.hasOwnProperty,wt=e.unstable_scheduleCallback,Dt=e.unstable_cancelCallback,kn=e.unstable_shouldYield,_t=e.unstable_requestPaint,Ke=e.unstable_now,ut=e.unstable_getCurrentPriorityLevel,Ut=e.unstable_ImmediatePriority,Lt=e.unstable_UserBlockingPriority,jt=e.unstable_NormalPriority,hn=e.unstable_LowPriority,mn=e.unstable_IdlePriority,Ml=e.log,Fe=e.unstable_setDisableYieldValue,It=null,ht=null;function pn(t){if(typeof Ml=="function"&&Fe(t),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(It,t)}catch{}}var At=Math.clz32?Math.clz32:Ri,Ol=Math.log,mt=Math.LN2;function Ri(t){return t>>>=0,t===0?32:31-(Ol(t)/mt|0)|0}var Zn=256,ri=262144,Bi=4194304;function qt(t){var i=t&42;if(i!==0)return i;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ci(t,i,l){var r=t.pendingLanes;if(r===0)return 0;var f=0,m=t.suspendedLanes,b=t.pingedLanes;t=t.warmLanes;var M=r&134217727;return M!==0?(r=M&~m,r!==0?f=qt(r):(b&=M,b!==0?f=qt(b):l||(l=M&~t,l!==0&&(f=qt(l))))):(M=r&~m,M!==0?f=qt(M):b!==0?f=qt(b):l||(l=r&~t,l!==0&&(f=qt(l)))),f===0?0:i!==0&&i!==f&&(i&m)===0&&(m=f&-f,l=i&-i,m>=l||m===32&&(l&4194048)!==0)?i:f}function Et(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function ia(t,i){switch(t){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 Tt(){var t=Bi;return Bi<<=1,(Bi&62914560)===0&&(Bi=4194304),t}function ui(t){for(var i=[],l=0;31>l;l++)i.push(t);return i}function zn(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function kl(t,i,l,r,f,m){var b=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var M=t.entanglements,q=t.expirationTimes,W=t.hiddenUpdates;for(l=b&~l;0<l;){var oe=31-At(l),ue=1<<oe;M[oe]=0,q[oe]=-1;var te=W[oe];if(te!==null)for(W[oe]=null,oe=0;oe<te.length;oe++){var ie=te[oe];ie!==null&&(ie.lane&=-536870913)}l&=~ue}r!==0&&gn(t,r,0),m!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=m&~(b&~i))}function gn(t,i,l){t.pendingLanes|=i,t.suspendedLanes&=~i;var r=31-At(i);t.entangledLanes|=i,t.entanglements[r]=t.entanglements[r]|1073741824|l&261930}function sa(t,i){var l=t.entangledLanes|=i;for(t=t.entanglements;l;){var r=31-At(l),f=1<<r;f&i|t[r]&i&&(t[r]|=i),l&=~f}}function aa(t,i){var l=i&-i;return l=(l&42)!==0?1:ws(l),(l&(t.suspendedLanes|i))!==0?0:l}function ws(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function xs(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function la(){var t=B.p;return t!==0?t:(t=window.event,t===void 0?32:h0(t.type))}function oa(t,i){var l=B.p;try{return B.p=t,i()}finally{B.p=l}}var yn=Math.random().toString(36).slice(2),F="__reactFiber$"+yn,he="__reactProps$"+yn,Ne="__reactContainer$"+yn,Ie="__reactEvents$"+yn,en="__reactListeners$"+yn,Qn="__reactHandles$"+yn,et="__reactResources$"+yn,vn="__reactMarker$"+yn;function zl(t){delete t[F],delete t[he],delete t[Ie],delete t[en],delete t[Qn]}function Li(t){var i=t[F];if(i)return i;for(var l=t.parentNode;l;){if(i=l[Ne]||l[F]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(t=Jy(t);t!==null;){if(l=t[F])return l;t=Jy(t)}return i}t=l,l=t.parentNode}return null}function $i(t){if(t=t[F]||t[Ne]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function Hi(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(a(33))}function Ui(t){var i=t[et];return i||(i=t[et]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function pt(t){t[vn]=!0}var gr=new Set,yr={};function fi(t,i){Ii(t,i),Ii(t+"Capture",i)}function Ii(t,i){for(yr[t]=i,t=0;t<i.length;t++)gr.add(i[t])}var Vu=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]*$"),vr={},Dl={};function Yu(t){return ot.call(Dl,t)?!0:ot.call(vr,t)?!1:Vu.test(t)?Dl[t]=!0:(vr[t]=!0,!1)}function ra(t,i,l){if(Yu(i))if(l===null)t.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var r=i.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+l)}}function ca(t,i,l){if(l===null)t.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+l)}}function Dn(t,i,l,r){if(r===null)t.removeAttribute(l);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(i,l,""+r)}}function Vt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function br(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Gu(t,i,l){var r=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var f=r.get,m=r.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return f.call(this)},set:function(b){l=""+b,m.call(this,b)}}),Object.defineProperty(t,i,{enumerable:r.enumerable}),{getValue:function(){return l},setValue:function(b){l=""+b},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function jl(t){if(!t._valueTracker){var i=br(t)?"checked":"value";t._valueTracker=Gu(t,i,""+t[i])}}function Rl(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var l=i.getValue(),r="";return t&&(r=br(t)?t.checked?"true":"false":t.value),t=r,t!==l?(i.setValue(t),!0):!1}function ua(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Sr=/[\n"\\]/g;function Yt(t){return t.replace(Sr,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Bl(t,i,l,r,f,m,b,M){t.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?t.type=b:t.removeAttribute("type"),i!=null?b==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+Vt(i)):t.value!==""+Vt(i)&&(t.value=""+Vt(i)):b!=="submit"&&b!=="reset"||t.removeAttribute("value"),i!=null?Ll(t,b,Vt(i)):l!=null?Ll(t,b,Vt(l)):r!=null&&t.removeAttribute("value"),f==null&&m!=null&&(t.defaultChecked=!!m),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?t.name=""+Vt(M):t.removeAttribute("name")}function fa(t,i,l,r,f,m,b,M){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.type=m),i!=null||l!=null){if(!(m!=="submit"&&m!=="reset"||i!=null)){jl(t);return}l=l!=null?""+Vt(l):"",i=i!=null?""+Vt(i):l,M||i===t.value||(t.value=i),t.defaultValue=i}r=r??f,r=typeof r!="function"&&typeof r!="symbol"&&!!r,t.checked=M?t.checked:!!r,t.defaultChecked=!!r,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(t.name=b),jl(t)}function Ll(t,i,l){i==="number"&&ua(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function qi(t,i,l,r){if(t=t.options,i){i={};for(var f=0;f<l.length;f++)i["$"+l[f]]=!0;for(l=0;l<t.length;l++)f=i.hasOwnProperty("$"+t[l].value),t[l].selected!==f&&(t[l].selected=f),f&&r&&(t[l].defaultSelected=!0)}else{for(l=""+Vt(l),i=null,f=0;f<t.length;f++){if(t[f].value===l){t[f].selected=!0,r&&(t[f].defaultSelected=!0);return}i!==null||t[f].disabled||(i=t[f])}i!==null&&(i.selected=!0)}}function $l(t,i,l){if(i!=null&&(i=""+Vt(i),i!==t.value&&(t.value=i),l==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=l!=null?""+Vt(l):""}function Hm(t,i,l,r){if(i==null){if(r!=null){if(l!=null)throw Error(a(92));if(O(r)){if(1<r.length)throw Error(a(93));r=r[0]}l=r}l==null&&(l=""),i=l}l=Vt(i),t.defaultValue=l,r=t.textContent,r===l&&r!==""&&r!==null&&(t.value=r),jl(t)}function da(t,i){if(i){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=i;return}}t.textContent=i}var vw=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 Um(t,i,l){var r=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?r?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":r?t.setProperty(i,l):typeof l!="number"||l===0||vw.has(i)?i==="float"?t.cssFloat=l:t[i]=(""+l).trim():t[i]=l+"px"}function Im(t,i,l){if(i!=null&&typeof i!="object")throw Error(a(62));if(t=t.style,l!=null){for(var r in l)!l.hasOwnProperty(r)||i!=null&&i.hasOwnProperty(r)||(r.indexOf("--")===0?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="");for(var f in i)r=i[f],i.hasOwnProperty(f)&&l[f]!==r&&Um(t,f,r)}else for(var m in i)i.hasOwnProperty(m)&&Um(t,m,i[m])}function Xu(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var bw=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"]]),Sw=/^[\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 wr(t){return Sw.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function di(){}var Ku=null;function Zu(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ha=null,ma=null;function qm(t){var i=$i(t);if(i&&(t=i.stateNode)){var l=t[he]||null;e:switch(t=i.stateNode,i.type){case"input":if(Bl(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Yt(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var r=l[i];if(r!==t&&r.form===t.form){var f=r[he]||null;if(!f)throw Error(a(90));Bl(r,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(i=0;i<l.length;i++)r=l[i],r.form===t.form&&Rl(r)}break e;case"textarea":$l(t,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&qi(t,!!l.multiple,i,!1)}}}var Qu=!1;function Vm(t,i,l){if(Qu)return t(i,l);Qu=!0;try{var r=t(i);return r}finally{if(Qu=!1,(ha!==null||ma!==null)&&(rc(),ha&&(i=ha,t=ma,ma=ha=null,qm(i),t)))for(i=0;i<t.length;i++)qm(t[i])}}function Hl(t,i){var l=t.stateNode;if(l===null)return null;var r=l[he]||null;if(r===null)return null;l=r[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(a(231,i,typeof l));return l}var hi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fu=!1;if(hi)try{var Ul={};Object.defineProperty(Ul,"passive",{get:function(){Fu=!0}}),window.addEventListener("test",Ul,Ul),window.removeEventListener("test",Ul,Ul)}catch{Fu=!1}var Vi=null,Ju=null,xr=null;function Ym(){if(xr)return xr;var t,i=Ju,l=i.length,r,f="value"in Vi?Vi.value:Vi.textContent,m=f.length;for(t=0;t<l&&i[t]===f[t];t++);var b=l-t;for(r=1;r<=b&&i[l-r]===f[m-r];r++);return xr=f.slice(t,1<r?1-r:void 0)}function Er(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function Nr(){return!0}function Gm(){return!1}function Gt(t){function i(l,r,f,m,b){this._reactName=l,this._targetInst=f,this.type=r,this.nativeEvent=m,this.target=b,this.currentTarget=null;for(var M in t)t.hasOwnProperty(M)&&(l=t[M],this[M]=l?l(m):m[M]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Nr:Gm,this.isPropagationStopped=Gm,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Nr)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Nr)},persist:function(){},isPersistent:Nr}),i}var Es={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_r=Gt(Es),Il=g({},Es,{view:0,detail:0}),ww=Gt(Il),Wu,Pu,ql,Ar=g({},Il,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tf,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==ql&&(ql&&t.type==="mousemove"?(Wu=t.screenX-ql.screenX,Pu=t.screenY-ql.screenY):Pu=Wu=0,ql=t),Wu)},movementY:function(t){return"movementY"in t?t.movementY:Pu}}),Xm=Gt(Ar),xw=g({},Ar,{dataTransfer:0}),Ew=Gt(xw),Nw=g({},Il,{relatedTarget:0}),ef=Gt(Nw),_w=g({},Es,{animationName:0,elapsedTime:0,pseudoElement:0}),Aw=Gt(_w),Tw=g({},Es,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Cw=Gt(Tw),Mw=g({},Es,{data:0}),Km=Gt(Mw),Ow={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kw={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"},zw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Dw(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=zw[t])?!!i[t]:!1}function tf(){return Dw}var jw=g({},Il,{key:function(t){if(t.key){var i=Ow[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=Er(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?kw[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tf,charCode:function(t){return t.type==="keypress"?Er(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Er(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Rw=Gt(jw),Bw=g({},Ar,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zm=Gt(Bw),Lw=g({},Il,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tf}),$w=Gt(Lw),Hw=g({},Es,{propertyName:0,elapsedTime:0,pseudoElement:0}),Uw=Gt(Hw),Iw=g({},Ar,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),qw=Gt(Iw),Vw=g({},Es,{newState:0,oldState:0}),Yw=Gt(Vw),Gw=[9,13,27,32],nf=hi&&"CompositionEvent"in window,Vl=null;hi&&"documentMode"in document&&(Vl=document.documentMode);var Xw=hi&&"TextEvent"in window&&!Vl,Qm=hi&&(!nf||Vl&&8<Vl&&11>=Vl),Fm=" ",Jm=!1;function Wm(t,i){switch(t){case"keyup":return Gw.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var pa=!1;function Kw(t,i){switch(t){case"compositionend":return Pm(i);case"keypress":return i.which!==32?null:(Jm=!0,Fm);case"textInput":return t=i.data,t===Fm&&Jm?null:t;default:return null}}function Zw(t,i){if(pa)return t==="compositionend"||!nf&&Wm(t,i)?(t=Ym(),xr=Ju=Vi=null,pa=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Qm&&i.locale!=="ko"?null:i.data;default:return null}}var Qw={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 ep(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!Qw[t.type]:i==="textarea"}function tp(t,i,l,r){ha?ma?ma.push(r):ma=[r]:ha=r,i=pc(i,"onChange"),0<i.length&&(l=new _r("onChange","change",null,l,r),t.push({event:l,listeners:i}))}var Yl=null,Gl=null;function Fw(t){Ly(t,0)}function Tr(t){var i=Hi(t);if(Rl(i))return t}function np(t,i){if(t==="change")return i}var ip=!1;if(hi){var sf;if(hi){var af="oninput"in document;if(!af){var sp=document.createElement("div");sp.setAttribute("oninput","return;"),af=typeof sp.oninput=="function"}sf=af}else sf=!1;ip=sf&&(!document.documentMode||9<document.documentMode)}function ap(){Yl&&(Yl.detachEvent("onpropertychange",lp),Gl=Yl=null)}function lp(t){if(t.propertyName==="value"&&Tr(Gl)){var i=[];tp(i,Gl,t,Zu(t)),Vm(Fw,i)}}function Jw(t,i,l){t==="focusin"?(ap(),Yl=i,Gl=l,Yl.attachEvent("onpropertychange",lp)):t==="focusout"&&ap()}function Ww(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Tr(Gl)}function Pw(t,i){if(t==="click")return Tr(i)}function ex(t,i){if(t==="input"||t==="change")return Tr(i)}function tx(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var tn=typeof Object.is=="function"?Object.is:tx;function Xl(t,i){if(tn(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var l=Object.keys(t),r=Object.keys(i);if(l.length!==r.length)return!1;for(r=0;r<l.length;r++){var f=l[r];if(!ot.call(i,f)||!tn(t[f],i[f]))return!1}return!0}function op(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function rp(t,i){var l=op(t);t=0;for(var r;l;){if(l.nodeType===3){if(r=t+l.textContent.length,t<=i&&r>=i)return{node:l,offset:i-t};t=r}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=op(l)}}function cp(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?cp(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function up(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=ua(t.document);i instanceof t.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)t=i.contentWindow;else break;i=ua(t.document)}return i}function lf(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var nx=hi&&"documentMode"in document&&11>=document.documentMode,ga=null,of=null,Kl=null,rf=!1;function fp(t,i,l){var r=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;rf||ga==null||ga!==ua(r)||(r=ga,"selectionStart"in r&&lf(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Kl&&Xl(Kl,r)||(Kl=r,r=pc(of,"onSelect"),0<r.length&&(i=new _r("onSelect","select",null,i,l),t.push({event:i,listeners:r}),i.target=ga)))}function Ns(t,i){var l={};return l[t.toLowerCase()]=i.toLowerCase(),l["Webkit"+t]="webkit"+i,l["Moz"+t]="moz"+i,l}var ya={animationend:Ns("Animation","AnimationEnd"),animationiteration:Ns("Animation","AnimationIteration"),animationstart:Ns("Animation","AnimationStart"),transitionrun:Ns("Transition","TransitionRun"),transitionstart:Ns("Transition","TransitionStart"),transitioncancel:Ns("Transition","TransitionCancel"),transitionend:Ns("Transition","TransitionEnd")},cf={},dp={};hi&&(dp=document.createElement("div").style,"AnimationEvent"in window||(delete ya.animationend.animation,delete ya.animationiteration.animation,delete ya.animationstart.animation),"TransitionEvent"in window||delete ya.transitionend.transition);function _s(t){if(cf[t])return cf[t];if(!ya[t])return t;var i=ya[t],l;for(l in i)if(i.hasOwnProperty(l)&&l in dp)return cf[t]=i[l];return t}var hp=_s("animationend"),mp=_s("animationiteration"),pp=_s("animationstart"),ix=_s("transitionrun"),sx=_s("transitionstart"),ax=_s("transitioncancel"),gp=_s("transitionend"),yp=new Map,uf="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(" ");uf.push("scrollEnd");function jn(t,i){yp.set(t,i),fi(i,[t])}var Cr=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},bn=[],va=0,ff=0;function Mr(){for(var t=va,i=ff=va=0;i<t;){var l=bn[i];bn[i++]=null;var r=bn[i];bn[i++]=null;var f=bn[i];bn[i++]=null;var m=bn[i];if(bn[i++]=null,r!==null&&f!==null){var b=r.pending;b===null?f.next=f:(f.next=b.next,b.next=f),r.pending=f}m!==0&&vp(l,f,m)}}function Or(t,i,l,r){bn[va++]=t,bn[va++]=i,bn[va++]=l,bn[va++]=r,ff|=r,t.lanes|=r,t=t.alternate,t!==null&&(t.lanes|=r)}function df(t,i,l,r){return Or(t,i,l,r),kr(t)}function As(t,i){return Or(t,null,null,i),kr(t)}function vp(t,i,l){t.lanes|=l;var r=t.alternate;r!==null&&(r.lanes|=l);for(var f=!1,m=t.return;m!==null;)m.childLanes|=l,r=m.alternate,r!==null&&(r.childLanes|=l),m.tag===22&&(t=m.stateNode,t===null||t._visibility&1||(f=!0)),t=m,m=m.return;return t.tag===3?(m=t.stateNode,f&&i!==null&&(f=31-At(l),t=m.hiddenUpdates,r=t[f],r===null?t[f]=[i]:r.push(i),i.lane=l|536870912),m):null}function kr(t){if(50<go)throw go=0,wd=null,Error(a(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var ba={};function lx(t,i,l,r){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nn(t,i,l,r){return new lx(t,i,l,r)}function hf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function mi(t,i){var l=t.alternate;return l===null?(l=nn(t.tag,i,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=i,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,i=t.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function bp(t,i){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,i=l.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function zr(t,i,l,r,f,m){var b=0;if(r=t,typeof t=="function")hf(t)&&(b=1);else if(typeof t=="string")b=fE(t,l,se.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case I:return t=nn(31,l,i,f),t.elementType=I,t.lanes=m,t;case E:return Ts(l.children,f,m,i);case A:b=8,f|=24;break;case T:return t=nn(12,l,i,f|2),t.elementType=T,t.lanes=m,t;case j:return t=nn(13,l,i,f),t.elementType=j,t.lanes=m,t;case D:return t=nn(19,l,i,f),t.elementType=D,t.lanes=m,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case _:b=10;break e;case z:b=9;break e;case N:b=11;break e;case $:b=14;break e;case L:b=16,r=null;break e}b=29,l=Error(a(130,t===null?"null":typeof t,"")),r=null}return i=nn(b,l,i,f),i.elementType=t,i.type=r,i.lanes=m,i}function Ts(t,i,l,r){return t=nn(7,t,r,i),t.lanes=l,t}function mf(t,i,l){return t=nn(6,t,null,i),t.lanes=l,t}function Sp(t){var i=nn(18,null,null,0);return i.stateNode=t,i}function pf(t,i,l){return i=nn(4,t.children!==null?t.children:[],t.key,i),i.lanes=l,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var wp=new WeakMap;function Sn(t,i){if(typeof t=="object"&&t!==null){var l=wp.get(t);return l!==void 0?l:(i={value:t,source:i,stack:zt(i)},wp.set(t,i),i)}return{value:t,source:i,stack:zt(i)}}var Sa=[],wa=0,Dr=null,Zl=0,wn=[],xn=0,Yi=null,Fn=1,Jn="";function pi(t,i){Sa[wa++]=Zl,Sa[wa++]=Dr,Dr=t,Zl=i}function xp(t,i,l){wn[xn++]=Fn,wn[xn++]=Jn,wn[xn++]=Yi,Yi=t;var r=Fn;t=Jn;var f=32-At(r)-1;r&=~(1<<f),l+=1;var m=32-At(i)+f;if(30<m){var b=f-f%5;m=(r&(1<<b)-1).toString(32),r>>=b,f-=b,Fn=1<<32-At(i)+f|l<<f|r,Jn=m+t}else Fn=1<<m|l<<f|r,Jn=t}function gf(t){t.return!==null&&(pi(t,1),xp(t,1,0))}function yf(t){for(;t===Dr;)Dr=Sa[--wa],Sa[wa]=null,Zl=Sa[--wa],Sa[wa]=null;for(;t===Yi;)Yi=wn[--xn],wn[xn]=null,Jn=wn[--xn],wn[xn]=null,Fn=wn[--xn],wn[xn]=null}function Ep(t,i){wn[xn++]=Fn,wn[xn++]=Jn,wn[xn++]=Yi,Fn=i.id,Jn=i.overflow,Yi=t}var Ct=null,Je=null,je=!1,Gi=null,En=!1,vf=Error(a(519));function Xi(t){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ql(Sn(i,t)),vf}function Np(t){var i=t.stateNode,l=t.type,r=t.memoizedProps;switch(i[F]=t,i[he]=r,l){case"dialog":ke("cancel",i),ke("close",i);break;case"iframe":case"object":case"embed":ke("load",i);break;case"video":case"audio":for(l=0;l<vo.length;l++)ke(vo[l],i);break;case"source":ke("error",i);break;case"img":case"image":case"link":ke("error",i),ke("load",i);break;case"details":ke("toggle",i);break;case"input":ke("invalid",i),fa(i,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ke("invalid",i);break;case"textarea":ke("invalid",i),Hm(i,r.value,r.defaultValue,r.children)}l=r.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||r.suppressHydrationWarning===!0||Iy(i.textContent,l)?(r.popover!=null&&(ke("beforetoggle",i),ke("toggle",i)),r.onScroll!=null&&ke("scroll",i),r.onScrollEnd!=null&&ke("scrollend",i),r.onClick!=null&&(i.onclick=di),i=!0):i=!1,i||Xi(t,!0)}function _p(t){for(Ct=t.return;Ct;)switch(Ct.tag){case 5:case 31:case 13:En=!1;return;case 27:case 3:En=!0;return;default:Ct=Ct.return}}function xa(t){if(t!==Ct)return!1;if(!je)return _p(t),je=!0,!1;var i=t.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||Bd(t.type,t.memoizedProps)),l=!l),l&&Je&&Xi(t),_p(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Je=Fy(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Je=Fy(t)}else i===27?(i=Je,ls(t.type)?(t=Id,Id=null,Je=t):Je=i):Je=Ct?_n(t.stateNode.nextSibling):null;return!0}function Cs(){Je=Ct=null,je=!1}function bf(){var t=Gi;return t!==null&&(Qt===null?Qt=t:Qt.push.apply(Qt,t),Gi=null),t}function Ql(t){Gi===null?Gi=[t]:Gi.push(t)}var Sf=k(null),Ms=null,gi=null;function Ki(t,i,l){P(Sf,i._currentValue),i._currentValue=l}function yi(t){t._currentValue=Sf.current,U(Sf)}function wf(t,i,l){for(;t!==null;){var r=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,r!==null&&(r.childLanes|=i)):r!==null&&(r.childLanes&i)!==i&&(r.childLanes|=i),t===l)break;t=t.return}}function xf(t,i,l,r){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var m=f.dependencies;if(m!==null){var b=f.child;m=m.firstContext;e:for(;m!==null;){var M=m;m=f;for(var q=0;q<i.length;q++)if(M.context===i[q]){m.lanes|=l,M=m.alternate,M!==null&&(M.lanes|=l),wf(m.return,l,t),r||(b=null);break e}m=M.next}}else if(f.tag===18){if(b=f.return,b===null)throw Error(a(341));b.lanes|=l,m=b.alternate,m!==null&&(m.lanes|=l),wf(b,l,t),b=null}else b=f.child;if(b!==null)b.return=f;else for(b=f;b!==null;){if(b===t){b=null;break}if(f=b.sibling,f!==null){f.return=b.return,b=f;break}b=b.return}f=b}}function Ea(t,i,l,r){t=null;for(var f=i,m=!1;f!==null;){if(!m){if((f.flags&524288)!==0)m=!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 M=f.type;tn(f.pendingProps.value,b.value)||(t!==null?t.push(M):t=[M])}}else if(f===ae.current){if(b=f.alternate,b===null)throw Error(a(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(Eo):t=[Eo])}f=f.return}t!==null&&xf(i,t,l,r),i.flags|=262144}function jr(t){for(t=t.firstContext;t!==null;){if(!tn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Os(t){Ms=t,gi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Mt(t){return Ap(Ms,t)}function Rr(t,i){return Ms===null&&Os(t),Ap(t,i)}function Ap(t,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},gi===null){if(t===null)throw Error(a(308));gi=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else gi=gi.next=i;return l}var ox=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(l,r){t.push(r)}};this.abort=function(){i.aborted=!0,t.forEach(function(l){return l()})}},rx=e.unstable_scheduleCallback,cx=e.unstable_NormalPriority,gt={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ef(){return{controller:new ox,data:new Map,refCount:0}}function Fl(t){t.refCount--,t.refCount===0&&rx(cx,function(){t.controller.abort()})}var Jl=null,Nf=0,Na=0,_a=null;function ux(t,i){if(Jl===null){var l=Jl=[];Nf=0,Na=Td(),_a={status:"pending",value:void 0,then:function(r){l.push(r)}}}return Nf++,i.then(Tp,Tp),i}function Tp(){if(--Nf===0&&Jl!==null){_a!==null&&(_a.status="fulfilled");var t=Jl;Jl=null,Na=0,_a=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function fx(t,i){var l=[],r={status:"pending",value:null,reason:null,then:function(f){l.push(f)}};return t.then(function(){r.status="fulfilled",r.value=i;for(var f=0;f<l.length;f++)(0,l[f])(i)},function(f){for(r.status="rejected",r.reason=f,f=0;f<l.length;f++)(0,l[f])(void 0)}),r}var Cp=C.S;C.S=function(t,i){fy=Ke(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&ux(t,i),Cp!==null&&Cp(t,i)};var ks=k(null);function _f(){var t=ks.current;return t!==null?t:Ze.pooledCache}function Br(t,i){i===null?P(ks,ks.current):P(ks,i.pool)}function Mp(){var t=_f();return t===null?null:{parent:gt._currentValue,pool:t}}var Aa=Error(a(460)),Af=Error(a(474)),Lr=Error(a(542)),$r={then:function(){}};function Op(t){return t=t.status,t==="fulfilled"||t==="rejected"}function kp(t,i,l){switch(l=t[l],l===void 0?t.push(i):l!==i&&(i.then(di,di),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,Dp(t),t;default:if(typeof i.status=="string")i.then(di,di);else{if(t=Ze,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=i,t.status="pending",t.then(function(r){if(i.status==="pending"){var f=i;f.status="fulfilled",f.value=r}},function(r){if(i.status==="pending"){var f=i;f.status="rejected",f.reason=r}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,Dp(t),t}throw Ds=i,Aa}}function zs(t){try{var i=t._init;return i(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Ds=l,Aa):l}}var Ds=null;function zp(){if(Ds===null)throw Error(a(459));var t=Ds;return Ds=null,t}function Dp(t){if(t===Aa||t===Lr)throw Error(a(483))}var Ta=null,Wl=0;function Hr(t){var i=Wl;return Wl+=1,Ta===null&&(Ta=[]),kp(Ta,t,i)}function Pl(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function Ur(t,i){throw i.$$typeof===y?Error(a(525)):(t=Object.prototype.toString.call(i),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function jp(t){function i(Q,X){if(t){var J=Q.deletions;J===null?(Q.deletions=[X],Q.flags|=16):J.push(X)}}function l(Q,X){if(!t)return null;for(;X!==null;)i(Q,X),X=X.sibling;return null}function r(Q){for(var X=new Map;Q!==null;)Q.key!==null?X.set(Q.key,Q):X.set(Q.index,Q),Q=Q.sibling;return X}function f(Q,X){return Q=mi(Q,X),Q.index=0,Q.sibling=null,Q}function m(Q,X,J){return Q.index=J,t?(J=Q.alternate,J!==null?(J=J.index,J<X?(Q.flags|=67108866,X):J):(Q.flags|=67108866,X)):(Q.flags|=1048576,X)}function b(Q){return t&&Q.alternate===null&&(Q.flags|=67108866),Q}function M(Q,X,J,re){return X===null||X.tag!==6?(X=mf(J,Q.mode,re),X.return=Q,X):(X=f(X,J),X.return=Q,X)}function q(Q,X,J,re){var be=J.type;return be===E?oe(Q,X,J.props.children,re,J.key):X!==null&&(X.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===L&&zs(be)===X.type)?(X=f(X,J.props),Pl(X,J),X.return=Q,X):(X=zr(J.type,J.key,J.props,null,Q.mode,re),Pl(X,J),X.return=Q,X)}function W(Q,X,J,re){return X===null||X.tag!==4||X.stateNode.containerInfo!==J.containerInfo||X.stateNode.implementation!==J.implementation?(X=pf(J,Q.mode,re),X.return=Q,X):(X=f(X,J.children||[]),X.return=Q,X)}function oe(Q,X,J,re,be){return X===null||X.tag!==7?(X=Ts(J,Q.mode,re,be),X.return=Q,X):(X=f(X,J),X.return=Q,X)}function ue(Q,X,J){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=mf(""+X,Q.mode,J),X.return=Q,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case w:return J=zr(X.type,X.key,X.props,null,Q.mode,J),Pl(J,X),J.return=Q,J;case x:return X=pf(X,Q.mode,J),X.return=Q,X;case L:return X=zs(X),ue(Q,X,J)}if(O(X)||Z(X))return X=Ts(X,Q.mode,J,null),X.return=Q,X;if(typeof X.then=="function")return ue(Q,Hr(X),J);if(X.$$typeof===_)return ue(Q,Rr(Q,X),J);Ur(Q,X)}return null}function te(Q,X,J,re){var be=X!==null?X.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return be!==null?null:M(Q,X,""+J,re);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case w:return J.key===be?q(Q,X,J,re):null;case x:return J.key===be?W(Q,X,J,re):null;case L:return J=zs(J),te(Q,X,J,re)}if(O(J)||Z(J))return be!==null?null:oe(Q,X,J,re,null);if(typeof J.then=="function")return te(Q,X,Hr(J),re);if(J.$$typeof===_)return te(Q,X,Rr(Q,J),re);Ur(Q,J)}return null}function ie(Q,X,J,re,be){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Q=Q.get(J)||null,M(X,Q,""+re,be);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case w:return Q=Q.get(re.key===null?J:re.key)||null,q(X,Q,re,be);case x:return Q=Q.get(re.key===null?J:re.key)||null,W(X,Q,re,be);case L:return re=zs(re),ie(Q,X,J,re,be)}if(O(re)||Z(re))return Q=Q.get(J)||null,oe(X,Q,re,be,null);if(typeof re.then=="function")return ie(Q,X,J,Hr(re),be);if(re.$$typeof===_)return ie(Q,X,J,Rr(X,re),be);Ur(X,re)}return null}function ye(Q,X,J,re){for(var be=null,Be=null,ve=X,Me=X=0,De=null;ve!==null&&Me<J.length;Me++){ve.index>Me?(De=ve,ve=null):De=ve.sibling;var Le=te(Q,ve,J[Me],re);if(Le===null){ve===null&&(ve=De);break}t&&ve&&Le.alternate===null&&i(Q,ve),X=m(Le,X,Me),Be===null?be=Le:Be.sibling=Le,Be=Le,ve=De}if(Me===J.length)return l(Q,ve),je&&pi(Q,Me),be;if(ve===null){for(;Me<J.length;Me++)ve=ue(Q,J[Me],re),ve!==null&&(X=m(ve,X,Me),Be===null?be=ve:Be.sibling=ve,Be=ve);return je&&pi(Q,Me),be}for(ve=r(ve);Me<J.length;Me++)De=ie(ve,Q,Me,J[Me],re),De!==null&&(t&&De.alternate!==null&&ve.delete(De.key===null?Me:De.key),X=m(De,X,Me),Be===null?be=De:Be.sibling=De,Be=De);return t&&ve.forEach(function(fs){return i(Q,fs)}),je&&pi(Q,Me),be}function xe(Q,X,J,re){if(J==null)throw Error(a(151));for(var be=null,Be=null,ve=X,Me=X=0,De=null,Le=J.next();ve!==null&&!Le.done;Me++,Le=J.next()){ve.index>Me?(De=ve,ve=null):De=ve.sibling;var fs=te(Q,ve,Le.value,re);if(fs===null){ve===null&&(ve=De);break}t&&ve&&fs.alternate===null&&i(Q,ve),X=m(fs,X,Me),Be===null?be=fs:Be.sibling=fs,Be=fs,ve=De}if(Le.done)return l(Q,ve),je&&pi(Q,Me),be;if(ve===null){for(;!Le.done;Me++,Le=J.next())Le=ue(Q,Le.value,re),Le!==null&&(X=m(Le,X,Me),Be===null?be=Le:Be.sibling=Le,Be=Le);return je&&pi(Q,Me),be}for(ve=r(ve);!Le.done;Me++,Le=J.next())Le=ie(ve,Q,Me,Le.value,re),Le!==null&&(t&&Le.alternate!==null&&ve.delete(Le.key===null?Me:Le.key),X=m(Le,X,Me),Be===null?be=Le:Be.sibling=Le,Be=Le);return t&&ve.forEach(function(xE){return i(Q,xE)}),je&&pi(Q,Me),be}function Xe(Q,X,J,re){if(typeof J=="object"&&J!==null&&J.type===E&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case w:e:{for(var be=J.key;X!==null;){if(X.key===be){if(be=J.type,be===E){if(X.tag===7){l(Q,X.sibling),re=f(X,J.props.children),re.return=Q,Q=re;break e}}else if(X.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===L&&zs(be)===X.type){l(Q,X.sibling),re=f(X,J.props),Pl(re,J),re.return=Q,Q=re;break e}l(Q,X);break}else i(Q,X);X=X.sibling}J.type===E?(re=Ts(J.props.children,Q.mode,re,J.key),re.return=Q,Q=re):(re=zr(J.type,J.key,J.props,null,Q.mode,re),Pl(re,J),re.return=Q,Q=re)}return b(Q);case x:e:{for(be=J.key;X!==null;){if(X.key===be)if(X.tag===4&&X.stateNode.containerInfo===J.containerInfo&&X.stateNode.implementation===J.implementation){l(Q,X.sibling),re=f(X,J.children||[]),re.return=Q,Q=re;break e}else{l(Q,X);break}else i(Q,X);X=X.sibling}re=pf(J,Q.mode,re),re.return=Q,Q=re}return b(Q);case L:return J=zs(J),Xe(Q,X,J,re)}if(O(J))return ye(Q,X,J,re);if(Z(J)){if(be=Z(J),typeof be!="function")throw Error(a(150));return J=be.call(J),xe(Q,X,J,re)}if(typeof J.then=="function")return Xe(Q,X,Hr(J),re);if(J.$$typeof===_)return Xe(Q,X,Rr(Q,J),re);Ur(Q,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,X!==null&&X.tag===6?(l(Q,X.sibling),re=f(X,J),re.return=Q,Q=re):(l(Q,X),re=mf(J,Q.mode,re),re.return=Q,Q=re),b(Q)):l(Q,X)}return function(Q,X,J,re){try{Wl=0;var be=Xe(Q,X,J,re);return Ta=null,be}catch(ve){if(ve===Aa||ve===Lr)throw ve;var Be=nn(29,ve,null,Q.mode);return Be.lanes=re,Be.return=Q,Be}}}var js=jp(!0),Rp=jp(!1),Zi=!1;function Tf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Cf(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Qi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Fi(t,i,l){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,($e&2)!==0){var f=r.pending;return f===null?i.next=i:(i.next=f.next,f.next=i),r.pending=i,i=kr(t),vp(t,null,l),i}return Or(t,r,i,l),kr(t)}function eo(t,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var r=i.lanes;r&=t.pendingLanes,l|=r,i.lanes=l,sa(t,l)}}function Mf(t,i){var l=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,l===r)){var f=null,m=null;if(l=l.firstBaseUpdate,l!==null){do{var b={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};m===null?f=m=b:m=m.next=b,l=l.next}while(l!==null);m===null?f=m=i:m=m.next=i}else f=m=i;l={baseState:r.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:r.shared,callbacks:r.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=i:t.next=i,l.lastBaseUpdate=i}var Of=!1;function to(){if(Of){var t=_a;if(t!==null)throw t}}function no(t,i,l,r){Of=!1;var f=t.updateQueue;Zi=!1;var m=f.firstBaseUpdate,b=f.lastBaseUpdate,M=f.shared.pending;if(M!==null){f.shared.pending=null;var q=M,W=q.next;q.next=null,b===null?m=W:b.next=W,b=q;var oe=t.alternate;oe!==null&&(oe=oe.updateQueue,M=oe.lastBaseUpdate,M!==b&&(M===null?oe.firstBaseUpdate=W:M.next=W,oe.lastBaseUpdate=q))}if(m!==null){var ue=f.baseState;b=0,oe=W=q=null,M=m;do{var te=M.lane&-536870913,ie=te!==M.lane;if(ie?(ze&te)===te:(r&te)===te){te!==0&&te===Na&&(Of=!0),oe!==null&&(oe=oe.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var ye=t,xe=M;te=i;var Xe=l;switch(xe.tag){case 1:if(ye=xe.payload,typeof ye=="function"){ue=ye.call(Xe,ue,te);break e}ue=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=xe.payload,te=typeof ye=="function"?ye.call(Xe,ue,te):ye,te==null)break e;ue=g({},ue,te);break e;case 2:Zi=!0}}te=M.callback,te!==null&&(t.flags|=64,ie&&(t.flags|=8192),ie=f.callbacks,ie===null?f.callbacks=[te]:ie.push(te))}else ie={lane:te,tag:M.tag,payload:M.payload,callback:M.callback,next:null},oe===null?(W=oe=ie,q=ue):oe=oe.next=ie,b|=te;if(M=M.next,M===null){if(M=f.shared.pending,M===null)break;ie=M,M=ie.next,ie.next=null,f.lastBaseUpdate=ie,f.shared.pending=null}}while(!0);oe===null&&(q=ue),f.baseState=q,f.firstBaseUpdate=W,f.lastBaseUpdate=oe,m===null&&(f.shared.lanes=0),ts|=b,t.lanes=b,t.memoizedState=ue}}function Bp(t,i){if(typeof t!="function")throw Error(a(191,t));t.call(i)}function Lp(t,i){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Bp(l[t],i)}var Ca=k(null),Ir=k(0);function $p(t,i){t=Ai,P(Ir,t),P(Ca,i),Ai=t|i.baseLanes}function kf(){P(Ir,Ai),P(Ca,Ca.current)}function zf(){Ai=Ir.current,U(Ca),U(Ir)}var sn=k(null),Nn=null;function Ji(t){var i=t.alternate;P(ft,ft.current&1),P(sn,t),Nn===null&&(i===null||Ca.current!==null||i.memoizedState!==null)&&(Nn=t)}function Df(t){P(ft,ft.current),P(sn,t),Nn===null&&(Nn=t)}function Hp(t){t.tag===22?(P(ft,ft.current),P(sn,t),Nn===null&&(Nn=t)):Wi()}function Wi(){P(ft,ft.current),P(sn,sn.current)}function an(t){U(sn),Nn===t&&(Nn=null),U(ft)}var ft=k(0);function qr(t){for(var i=t;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Hd(l)||Ud(l)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var vi=0,Te=null,Ye=null,yt=null,Vr=!1,Ma=!1,Rs=!1,Yr=0,io=0,Oa=null,dx=0;function rt(){throw Error(a(321))}function jf(t,i){if(i===null)return!1;for(var l=0;l<i.length&&l<t.length;l++)if(!tn(t[l],i[l]))return!1;return!0}function Rf(t,i,l,r,f,m){return vi=m,Te=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,C.H=t===null||t.memoizedState===null?xg:Ff,Rs=!1,m=l(r,f),Rs=!1,Ma&&(m=Ip(i,l,r,f)),Up(t),m}function Up(t){C.H=lo;var i=Ye!==null&&Ye.next!==null;if(vi=0,yt=Ye=Te=null,Vr=!1,io=0,Oa=null,i)throw Error(a(300));t===null||vt||(t=t.dependencies,t!==null&&jr(t)&&(vt=!0))}function Ip(t,i,l,r){Te=t;var f=0;do{if(Ma&&(Oa=null),io=0,Ma=!1,25<=f)throw Error(a(301));if(f+=1,yt=Ye=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}C.H=Eg,m=i(l,r)}while(Ma);return m}function hx(){var t=C.H,i=t.useState()[0];return i=typeof i.then=="function"?so(i):i,t=t.useState()[0],(Ye!==null?Ye.memoizedState:null)!==t&&(Te.flags|=1024),i}function Bf(){var t=Yr!==0;return Yr=0,t}function Lf(t,i,l){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~l}function $f(t){if(Vr){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}Vr=!1}vi=0,yt=Ye=Te=null,Ma=!1,io=Yr=0,Oa=null}function $t(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yt===null?Te.memoizedState=yt=t:yt=yt.next=t,yt}function dt(){if(Ye===null){var t=Te.alternate;t=t!==null?t.memoizedState:null}else t=Ye.next;var i=yt===null?Te.memoizedState:yt.next;if(i!==null)yt=i,Ye=t;else{if(t===null)throw Te.alternate===null?Error(a(467)):Error(a(310));Ye=t,t={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},yt===null?Te.memoizedState=yt=t:yt=yt.next=t}return yt}function Gr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function so(t){var i=io;return io+=1,Oa===null&&(Oa=[]),t=kp(Oa,t,i),i=Te,(yt===null?i.memoizedState:yt.next)===null&&(i=i.alternate,C.H=i===null||i.memoizedState===null?xg:Ff),t}function Xr(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return so(t);if(t.$$typeof===_)return Mt(t)}throw Error(a(438,String(t)))}function Hf(t){var i=null,l=Te.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var r=Te.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(i={data:r.data.map(function(f){return f.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=Gr(),Te.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(t),r=0;r<t;r++)l[r]=V;return i.index++,l}function bi(t,i){return typeof i=="function"?i(t):i}function Kr(t){var i=dt();return Uf(i,Ye,t)}function Uf(t,i,l){var r=t.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=l;var f=t.baseQueue,m=r.pending;if(m!==null){if(f!==null){var b=f.next;f.next=m.next,m.next=b}i.baseQueue=f=m,r.pending=null}if(m=t.baseState,f===null)t.memoizedState=m;else{i=f.next;var M=b=null,q=null,W=i,oe=!1;do{var ue=W.lane&-536870913;if(ue!==W.lane?(ze&ue)===ue:(vi&ue)===ue){var te=W.revertLane;if(te===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),ue===Na&&(oe=!0);else if((vi&te)===te){W=W.next,te===Na&&(oe=!0);continue}else ue={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},q===null?(M=q=ue,b=m):q=q.next=ue,Te.lanes|=te,ts|=te;ue=W.action,Rs&&l(m,ue),m=W.hasEagerState?W.eagerState:l(m,ue)}else te={lane:ue,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},q===null?(M=q=te,b=m):q=q.next=te,Te.lanes|=ue,ts|=ue;W=W.next}while(W!==null&&W!==i);if(q===null?b=m:q.next=M,!tn(m,t.memoizedState)&&(vt=!0,oe&&(l=_a,l!==null)))throw l;t.memoizedState=m,t.baseState=b,t.baseQueue=q,r.lastRenderedState=m}return f===null&&(r.lanes=0),[t.memoizedState,r.dispatch]}function If(t){var i=dt(),l=i.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=t;var r=l.dispatch,f=l.pending,m=i.memoizedState;if(f!==null){l.pending=null;var b=f=f.next;do m=t(m,b.action),b=b.next;while(b!==f);tn(m,i.memoizedState)||(vt=!0),i.memoizedState=m,i.baseQueue===null&&(i.baseState=m),l.lastRenderedState=m}return[m,r]}function qp(t,i,l){var r=Te,f=dt(),m=je;if(m){if(l===void 0)throw Error(a(407));l=l()}else l=i();var b=!tn((Ye||f).memoizedState,l);if(b&&(f.memoizedState=l,vt=!0),f=f.queue,Yf(Gp.bind(null,r,f,t),[t]),f.getSnapshot!==i||b||yt!==null&&yt.memoizedState.tag&1){if(r.flags|=2048,ka(9,{destroy:void 0},Yp.bind(null,r,f,l,i),null),Ze===null)throw Error(a(349));m||(vi&127)!==0||Vp(r,i,l)}return l}function Vp(t,i,l){t.flags|=16384,t={getSnapshot:i,value:l},i=Te.updateQueue,i===null?(i=Gr(),Te.updateQueue=i,i.stores=[t]):(l=i.stores,l===null?i.stores=[t]:l.push(t))}function Yp(t,i,l,r){i.value=l,i.getSnapshot=r,Xp(i)&&Kp(t)}function Gp(t,i,l){return l(function(){Xp(i)&&Kp(t)})}function Xp(t){var i=t.getSnapshot;t=t.value;try{var l=i();return!tn(t,l)}catch{return!0}}function Kp(t){var i=As(t,2);i!==null&&Ft(i,t,2)}function qf(t){var i=$t();if(typeof t=="function"){var l=t;if(t=l(),Rs){pn(!0);try{l()}finally{pn(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bi,lastRenderedState:t},i}function Zp(t,i,l,r){return t.baseState=l,Uf(t,Ye,typeof r=="function"?r:bi)}function mx(t,i,l,r,f){if(Fr(t))throw Error(a(485));if(t=i.action,t!==null){var m={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){m.listeners.push(b)}};C.T!==null?l(!0):m.isTransition=!1,r(m),l=i.pending,l===null?(m.next=i.pending=m,Qp(i,m)):(m.next=l.next,i.pending=l.next=m)}}function Qp(t,i){var l=i.action,r=i.payload,f=t.state;if(i.isTransition){var m=C.T,b={};C.T=b;try{var M=l(f,r),q=C.S;q!==null&&q(b,M),Fp(t,i,M)}catch(W){Vf(t,i,W)}finally{m!==null&&b.types!==null&&(m.types=b.types),C.T=m}}else try{m=l(f,r),Fp(t,i,m)}catch(W){Vf(t,i,W)}}function Fp(t,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(r){Jp(t,i,r)},function(r){return Vf(t,i,r)}):Jp(t,i,l)}function Jp(t,i,l){i.status="fulfilled",i.value=l,Wp(i),t.state=l,i=t.pending,i!==null&&(l=i.next,l===i?t.pending=null:(l=l.next,i.next=l,Qp(t,l)))}function Vf(t,i,l){var r=t.pending;if(t.pending=null,r!==null){r=r.next;do i.status="rejected",i.reason=l,Wp(i),i=i.next;while(i!==r)}t.action=null}function Wp(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function Pp(t,i){return i}function eg(t,i){if(je){var l=Ze.formState;if(l!==null){e:{var r=Te;if(je){if(Je){t:{for(var f=Je,m=En;f.nodeType!==8;){if(!m){f=null;break t}if(f=_n(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){Je=_n(f.nextSibling),r=f.data==="F!";break e}}Xi(r)}r=!1}r&&(i=l[0])}}return l=$t(),l.memoizedState=l.baseState=i,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pp,lastRenderedState:i},l.queue=r,l=bg.bind(null,Te,r),r.dispatch=l,r=qf(!1),m=Qf.bind(null,Te,!1,r.queue),r=$t(),f={state:i,dispatch:null,action:t,pending:null},r.queue=f,l=mx.bind(null,Te,f,m,l),f.dispatch=l,r.memoizedState=t,[i,l,!1]}function tg(t){var i=dt();return ng(i,Ye,t)}function ng(t,i,l){if(i=Uf(t,i,Pp)[0],t=Kr(bi)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var r=so(i)}catch(b){throw b===Aa?Lr:b}else r=i;i=dt();var f=i.queue,m=f.dispatch;return l!==i.memoizedState&&(Te.flags|=2048,ka(9,{destroy:void 0},px.bind(null,f,l),null)),[r,m,t]}function px(t,i){t.action=i}function ig(t){var i=dt(),l=Ye;if(l!==null)return ng(i,l,t);dt(),i=i.memoizedState,l=dt();var r=l.queue.dispatch;return l.memoizedState=t,[i,r,!1]}function ka(t,i,l,r){return t={tag:t,create:l,deps:r,inst:i,next:null},i=Te.updateQueue,i===null&&(i=Gr(),Te.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=t.next=t:(r=l.next,l.next=t,t.next=r,i.lastEffect=t),t}function sg(){return dt().memoizedState}function Zr(t,i,l,r){var f=$t();Te.flags|=t,f.memoizedState=ka(1|i,{destroy:void 0},l,r===void 0?null:r)}function Qr(t,i,l,r){var f=dt();r=r===void 0?null:r;var m=f.memoizedState.inst;Ye!==null&&r!==null&&jf(r,Ye.memoizedState.deps)?f.memoizedState=ka(i,m,l,r):(Te.flags|=t,f.memoizedState=ka(1|i,m,l,r))}function ag(t,i){Zr(8390656,8,t,i)}function Yf(t,i){Qr(2048,8,t,i)}function gx(t){Te.flags|=4;var i=Te.updateQueue;if(i===null)i=Gr(),Te.updateQueue=i,i.events=[t];else{var l=i.events;l===null?i.events=[t]:l.push(t)}}function lg(t){var i=dt().memoizedState;return gx({ref:i,nextImpl:t}),function(){if(($e&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function og(t,i){return Qr(4,2,t,i)}function rg(t,i){return Qr(4,4,t,i)}function cg(t,i){if(typeof i=="function"){t=t();var l=i(t);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function ug(t,i,l){l=l!=null?l.concat([t]):null,Qr(4,4,cg.bind(null,i,t),l)}function Gf(){}function fg(t,i){var l=dt();i=i===void 0?null:i;var r=l.memoizedState;return i!==null&&jf(i,r[1])?r[0]:(l.memoizedState=[t,i],t)}function dg(t,i){var l=dt();i=i===void 0?null:i;var r=l.memoizedState;if(i!==null&&jf(i,r[1]))return r[0];if(r=t(),Rs){pn(!0);try{t()}finally{pn(!1)}}return l.memoizedState=[r,i],r}function Xf(t,i,l){return l===void 0||(vi&1073741824)!==0&&(ze&261930)===0?t.memoizedState=i:(t.memoizedState=l,t=hy(),Te.lanes|=t,ts|=t,l)}function hg(t,i,l,r){return tn(l,i)?l:Ca.current!==null?(t=Xf(t,l,r),tn(t,i)||(vt=!0),t):(vi&42)===0||(vi&1073741824)!==0&&(ze&261930)===0?(vt=!0,t.memoizedState=l):(t=hy(),Te.lanes|=t,ts|=t,i)}function mg(t,i,l,r,f){var m=B.p;B.p=m!==0&&8>m?m:8;var b=C.T,M={};C.T=M,Qf(t,!1,i,l);try{var q=f(),W=C.S;if(W!==null&&W(M,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var oe=fx(q,r);ao(t,i,oe,rn(t))}else ao(t,i,r,rn(t))}catch(ue){ao(t,i,{then:function(){},status:"rejected",reason:ue},rn())}finally{B.p=m,b!==null&&M.types!==null&&(b.types=M.types),C.T=b}}function yx(){}function Kf(t,i,l,r){if(t.tag!==5)throw Error(a(476));var f=pg(t).queue;mg(t,f,i,R,l===null?yx:function(){return gg(t),l(r)})}function pg(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:R,baseState:R,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bi,lastRenderedState:R},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bi,lastRenderedState:l},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function gg(t){var i=pg(t);i.next===null&&(i=t.alternate.memoizedState),ao(t,i.next.queue,{},rn())}function Zf(){return Mt(Eo)}function yg(){return dt().memoizedState}function vg(){return dt().memoizedState}function vx(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var l=rn();t=Qi(l);var r=Fi(i,t,l);r!==null&&(Ft(r,i,l),eo(r,i,l)),i={cache:Ef()},t.payload=i;return}i=i.return}}function bx(t,i,l){var r=rn();l={lane:r,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Fr(t)?Sg(i,l):(l=df(t,i,l,r),l!==null&&(Ft(l,t,r),wg(l,i,r)))}function bg(t,i,l){var r=rn();ao(t,i,l,r)}function ao(t,i,l,r){var f={lane:r,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Fr(t))Sg(i,f);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=i.lastRenderedReducer,m!==null))try{var b=i.lastRenderedState,M=m(b,l);if(f.hasEagerState=!0,f.eagerState=M,tn(M,b))return Or(t,i,f,0),Ze===null&&Mr(),!1}catch{}if(l=df(t,i,f,r),l!==null)return Ft(l,t,r),wg(l,i,r),!0}return!1}function Qf(t,i,l,r){if(r={lane:2,revertLane:Td(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Fr(t)){if(i)throw Error(a(479))}else i=df(t,l,r,2),i!==null&&Ft(i,t,2)}function Fr(t){var i=t.alternate;return t===Te||i!==null&&i===Te}function Sg(t,i){Ma=Vr=!0;var l=t.pending;l===null?i.next=i:(i.next=l.next,l.next=i),t.pending=i}function wg(t,i,l){if((l&4194048)!==0){var r=i.lanes;r&=t.pendingLanes,l|=r,i.lanes=l,sa(t,l)}}var lo={readContext:Mt,use:Xr,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useLayoutEffect:rt,useInsertionEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useSyncExternalStore:rt,useId:rt,useHostTransitionStatus:rt,useFormState:rt,useActionState:rt,useOptimistic:rt,useMemoCache:rt,useCacheRefresh:rt};lo.useEffectEvent=rt;var xg={readContext:Mt,use:Xr,useCallback:function(t,i){return $t().memoizedState=[t,i===void 0?null:i],t},useContext:Mt,useEffect:ag,useImperativeHandle:function(t,i,l){l=l!=null?l.concat([t]):null,Zr(4194308,4,cg.bind(null,i,t),l)},useLayoutEffect:function(t,i){return Zr(4194308,4,t,i)},useInsertionEffect:function(t,i){Zr(4,2,t,i)},useMemo:function(t,i){var l=$t();i=i===void 0?null:i;var r=t();if(Rs){pn(!0);try{t()}finally{pn(!1)}}return l.memoizedState=[r,i],r},useReducer:function(t,i,l){var r=$t();if(l!==void 0){var f=l(i);if(Rs){pn(!0);try{l(i)}finally{pn(!1)}}}else f=i;return r.memoizedState=r.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},r.queue=t,t=t.dispatch=bx.bind(null,Te,t),[r.memoizedState,t]},useRef:function(t){var i=$t();return t={current:t},i.memoizedState=t},useState:function(t){t=qf(t);var i=t.queue,l=bg.bind(null,Te,i);return i.dispatch=l,[t.memoizedState,l]},useDebugValue:Gf,useDeferredValue:function(t,i){var l=$t();return Xf(l,t,i)},useTransition:function(){var t=qf(!1);return t=mg.bind(null,Te,t.queue,!0,!1),$t().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,l){var r=Te,f=$t();if(je){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),Ze===null)throw Error(a(349));(ze&127)!==0||Vp(r,i,l)}f.memoizedState=l;var m={value:l,getSnapshot:i};return f.queue=m,ag(Gp.bind(null,r,m,t),[t]),r.flags|=2048,ka(9,{destroy:void 0},Yp.bind(null,r,m,l,i),null),l},useId:function(){var t=$t(),i=Ze.identifierPrefix;if(je){var l=Jn,r=Fn;l=(r&~(1<<32-At(r)-1)).toString(32)+l,i="_"+i+"R_"+l,l=Yr++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=dx++,i="_"+i+"r_"+l.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:Zf,useFormState:eg,useActionState:eg,useOptimistic:function(t){var i=$t();i.memoizedState=i.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=Qf.bind(null,Te,!0,l),l.dispatch=i,[t,i]},useMemoCache:Hf,useCacheRefresh:function(){return $t().memoizedState=vx.bind(null,Te)},useEffectEvent:function(t){var i=$t(),l={impl:t};return i.memoizedState=l,function(){if(($e&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},Ff={readContext:Mt,use:Xr,useCallback:fg,useContext:Mt,useEffect:Yf,useImperativeHandle:ug,useInsertionEffect:og,useLayoutEffect:rg,useMemo:dg,useReducer:Kr,useRef:sg,useState:function(){return Kr(bi)},useDebugValue:Gf,useDeferredValue:function(t,i){var l=dt();return hg(l,Ye.memoizedState,t,i)},useTransition:function(){var t=Kr(bi)[0],i=dt().memoizedState;return[typeof t=="boolean"?t:so(t),i]},useSyncExternalStore:qp,useId:yg,useHostTransitionStatus:Zf,useFormState:tg,useActionState:tg,useOptimistic:function(t,i){var l=dt();return Zp(l,Ye,t,i)},useMemoCache:Hf,useCacheRefresh:vg};Ff.useEffectEvent=lg;var Eg={readContext:Mt,use:Xr,useCallback:fg,useContext:Mt,useEffect:Yf,useImperativeHandle:ug,useInsertionEffect:og,useLayoutEffect:rg,useMemo:dg,useReducer:If,useRef:sg,useState:function(){return If(bi)},useDebugValue:Gf,useDeferredValue:function(t,i){var l=dt();return Ye===null?Xf(l,t,i):hg(l,Ye.memoizedState,t,i)},useTransition:function(){var t=If(bi)[0],i=dt().memoizedState;return[typeof t=="boolean"?t:so(t),i]},useSyncExternalStore:qp,useId:yg,useHostTransitionStatus:Zf,useFormState:ig,useActionState:ig,useOptimistic:function(t,i){var l=dt();return Ye!==null?Zp(l,Ye,t,i):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Hf,useCacheRefresh:vg};Eg.useEffectEvent=lg;function Jf(t,i,l,r){i=t.memoizedState,l=l(r,i),l=l==null?i:g({},i,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Wf={enqueueSetState:function(t,i,l){t=t._reactInternals;var r=rn(),f=Qi(r);f.payload=i,l!=null&&(f.callback=l),i=Fi(t,f,r),i!==null&&(Ft(i,t,r),eo(i,t,r))},enqueueReplaceState:function(t,i,l){t=t._reactInternals;var r=rn(),f=Qi(r);f.tag=1,f.payload=i,l!=null&&(f.callback=l),i=Fi(t,f,r),i!==null&&(Ft(i,t,r),eo(i,t,r))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var l=rn(),r=Qi(l);r.tag=2,i!=null&&(r.callback=i),i=Fi(t,r,l),i!==null&&(Ft(i,t,l),eo(i,t,l))}};function Ng(t,i,l,r,f,m,b){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,m,b):i.prototype&&i.prototype.isPureReactComponent?!Xl(l,r)||!Xl(f,m):!0}function _g(t,i,l,r){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,r),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,r),i.state!==t&&Wf.enqueueReplaceState(i,i.state,null)}function Bs(t,i){var l=i;if("ref"in i){l={};for(var r in i)r!=="ref"&&(l[r]=i[r])}if(t=t.defaultProps){l===i&&(l=g({},l));for(var f in t)l[f]===void 0&&(l[f]=t[f])}return l}function Ag(t){Cr(t)}function Tg(t){console.error(t)}function Cg(t){Cr(t)}function Jr(t,i){try{var l=t.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(r){setTimeout(function(){throw r})}}function Mg(t,i,l){try{var r=t.onCaughtError;r(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Pf(t,i,l){return l=Qi(l),l.tag=3,l.payload={element:null},l.callback=function(){Jr(t,i)},l}function Og(t){return t=Qi(t),t.tag=3,t}function kg(t,i,l,r){var f=l.type.getDerivedStateFromError;if(typeof f=="function"){var m=r.value;t.payload=function(){return f(m)},t.callback=function(){Mg(i,l,r)}}var b=l.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(t.callback=function(){Mg(i,l,r),typeof f!="function"&&(ns===null?ns=new Set([this]):ns.add(this));var M=r.stack;this.componentDidCatch(r.value,{componentStack:M!==null?M:""})})}function Sx(t,i,l,r,f){if(l.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(i=l.alternate,i!==null&&Ea(i,l,f,!0),l=sn.current,l!==null){switch(l.tag){case 31:case 13:return Nn===null?cc():l.alternate===null&&ct===0&&(ct=3),l.flags&=-257,l.flags|=65536,l.lanes=f,r===$r?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([r]):i.add(r),Nd(t,r,f)),!1;case 22:return l.flags|=65536,r===$r?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([r])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([r]):l.add(r)),Nd(t,r,f)),!1}throw Error(a(435,l.tag))}return Nd(t,r,f),cc(),!1}if(je)return i=sn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=f,r!==vf&&(t=Error(a(422),{cause:r}),Ql(Sn(t,l)))):(r!==vf&&(i=Error(a(423),{cause:r}),Ql(Sn(i,l))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,r=Sn(r,l),f=Pf(t.stateNode,r,f),Mf(t,f),ct!==4&&(ct=2)),!1;var m=Error(a(520),{cause:r});if(m=Sn(m,l),po===null?po=[m]:po.push(m),ct!==4&&(ct=2),i===null)return!0;r=Sn(r,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,t=f&-f,l.lanes|=t,t=Pf(l.stateNode,r,t),Mf(l,t),!1;case 1:if(i=l.type,m=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(ns===null||!ns.has(m))))return l.flags|=65536,f&=-f,l.lanes|=f,f=Og(f),kg(f,t,l,r),Mf(l,f),!1}l=l.return}while(l!==null);return!1}var ed=Error(a(461)),vt=!1;function Ot(t,i,l,r){i.child=t===null?Rp(i,null,l,r):js(i,t.child,l,r)}function zg(t,i,l,r,f){l=l.render;var m=i.ref;if("ref"in r){var b={};for(var M in r)M!=="ref"&&(b[M]=r[M])}else b=r;return Os(i),r=Rf(t,i,l,b,m,f),M=Bf(),t!==null&&!vt?(Lf(t,i,f),Si(t,i,f)):(je&&M&&gf(i),i.flags|=1,Ot(t,i,r,f),i.child)}function Dg(t,i,l,r,f){if(t===null){var m=l.type;return typeof m=="function"&&!hf(m)&&m.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=m,jg(t,i,m,r,f)):(t=zr(l.type,null,r,i,i.mode,f),t.ref=i.ref,t.return=i,i.child=t)}if(m=t.child,!rd(t,f)){var b=m.memoizedProps;if(l=l.compare,l=l!==null?l:Xl,l(b,r)&&t.ref===i.ref)return Si(t,i,f)}return i.flags|=1,t=mi(m,r),t.ref=i.ref,t.return=i,i.child=t}function jg(t,i,l,r,f){if(t!==null){var m=t.memoizedProps;if(Xl(m,r)&&t.ref===i.ref)if(vt=!1,i.pendingProps=r=m,rd(t,f))(t.flags&131072)!==0&&(vt=!0);else return i.lanes=t.lanes,Si(t,i,f)}return td(t,i,l,r,f)}function Rg(t,i,l,r){var f=r.children,m=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((i.flags&128)!==0){if(m=m!==null?m.baseLanes|l:l,t!==null){for(r=i.child=t.child,f=0;r!==null;)f=f|r.lanes|r.childLanes,r=r.sibling;r=f&~m}else r=0,i.child=null;return Bg(t,i,m,l,r)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&Br(i,m!==null?m.cachePool:null),m!==null?$p(i,m):kf(),Hp(i);else return r=i.lanes=536870912,Bg(t,i,m!==null?m.baseLanes|l:l,l,r)}else m!==null?(Br(i,m.cachePool),$p(i,m),Wi(),i.memoizedState=null):(t!==null&&Br(i,null),kf(),Wi());return Ot(t,i,f,l),i.child}function oo(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Bg(t,i,l,r,f){var m=_f();return m=m===null?null:{parent:gt._currentValue,pool:m},i.memoizedState={baseLanes:l,cachePool:m},t!==null&&Br(i,null),kf(),Hp(i),t!==null&&Ea(t,i,r,!0),i.childLanes=f,null}function Wr(t,i){return i=ec({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function Lg(t,i,l){return js(i,t.child,null,l),t=Wr(i,i.pendingProps),t.flags|=2,an(i),i.memoizedState=null,t}function wx(t,i,l){var r=i.pendingProps,f=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(je){if(r.mode==="hidden")return t=Wr(i,r),i.lanes=536870912,oo(null,t);if(Df(i),(t=Je)?(t=Qy(t,En),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Yi!==null?{id:Fn,overflow:Jn}:null,retryLane:536870912,hydrationErrors:null},l=Sp(t),l.return=i,i.child=l,Ct=i,Je=null)):t=null,t===null)throw Xi(i);return i.lanes=536870912,null}return Wr(i,r)}var m=t.memoizedState;if(m!==null){var b=m.dehydrated;if(Df(i),f)if(i.flags&256)i.flags&=-257,i=Lg(t,i,l);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(a(558));else if(vt||Ea(t,i,l,!1),f=(l&t.childLanes)!==0,vt||f){if(r=Ze,r!==null&&(b=aa(r,l),b!==0&&b!==m.retryLane))throw m.retryLane=b,As(t,b),Ft(r,t,b),ed;cc(),i=Lg(t,i,l)}else t=m.treeContext,Je=_n(b.nextSibling),Ct=i,je=!0,Gi=null,En=!1,t!==null&&Ep(i,t),i=Wr(i,r),i.flags|=4096;return i}return t=mi(t.child,{mode:r.mode,children:r.children}),t.ref=i.ref,i.child=t,t.return=i,t}function Pr(t,i){var l=i.ref;if(l===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(t===null||t.ref!==l)&&(i.flags|=4194816)}}function td(t,i,l,r,f){return Os(i),l=Rf(t,i,l,r,void 0,f),r=Bf(),t!==null&&!vt?(Lf(t,i,f),Si(t,i,f)):(je&&r&&gf(i),i.flags|=1,Ot(t,i,l,f),i.child)}function $g(t,i,l,r,f,m){return Os(i),i.updateQueue=null,l=Ip(i,r,l,f),Up(t),r=Bf(),t!==null&&!vt?(Lf(t,i,m),Si(t,i,m)):(je&&r&&gf(i),i.flags|=1,Ot(t,i,l,m),i.child)}function Hg(t,i,l,r,f){if(Os(i),i.stateNode===null){var m=ba,b=l.contextType;typeof b=="object"&&b!==null&&(m=Mt(b)),m=new l(r,m),i.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Wf,i.stateNode=m,m._reactInternals=i,m=i.stateNode,m.props=r,m.state=i.memoizedState,m.refs={},Tf(i),b=l.contextType,m.context=typeof b=="object"&&b!==null?Mt(b):ba,m.state=i.memoizedState,b=l.getDerivedStateFromProps,typeof b=="function"&&(Jf(i,l,b,r),m.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(b=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),b!==m.state&&Wf.enqueueReplaceState(m,m.state,null),no(i,r,m,f),to(),m.state=i.memoizedState),typeof m.componentDidMount=="function"&&(i.flags|=4194308),r=!0}else if(t===null){m=i.stateNode;var M=i.memoizedProps,q=Bs(l,M);m.props=q;var W=m.context,oe=l.contextType;b=ba,typeof oe=="object"&&oe!==null&&(b=Mt(oe));var ue=l.getDerivedStateFromProps;oe=typeof ue=="function"||typeof m.getSnapshotBeforeUpdate=="function",M=i.pendingProps!==M,oe||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(M||W!==b)&&_g(i,m,r,b),Zi=!1;var te=i.memoizedState;m.state=te,no(i,r,m,f),to(),W=i.memoizedState,M||te!==W||Zi?(typeof ue=="function"&&(Jf(i,l,ue,r),W=i.memoizedState),(q=Zi||Ng(i,l,q,r,te,W,b))?(oe||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(i.flags|=4194308)):(typeof m.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=r,i.memoizedState=W),m.props=r,m.state=W,m.context=b,r=q):(typeof m.componentDidMount=="function"&&(i.flags|=4194308),r=!1)}else{m=i.stateNode,Cf(t,i),b=i.memoizedProps,oe=Bs(l,b),m.props=oe,ue=i.pendingProps,te=m.context,W=l.contextType,q=ba,typeof W=="object"&&W!==null&&(q=Mt(W)),M=l.getDerivedStateFromProps,(W=typeof M=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==ue||te!==q)&&_g(i,m,r,q),Zi=!1,te=i.memoizedState,m.state=te,no(i,r,m,f),to();var ie=i.memoizedState;b!==ue||te!==ie||Zi||t!==null&&t.dependencies!==null&&jr(t.dependencies)?(typeof M=="function"&&(Jf(i,l,M,r),ie=i.memoizedState),(oe=Zi||Ng(i,l,oe,r,te,ie,q)||t!==null&&t.dependencies!==null&&jr(t.dependencies))?(W||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(r,ie,q),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(r,ie,q)),typeof m.componentDidUpdate=="function"&&(i.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof m.componentDidUpdate!="function"||b===t.memoizedProps&&te===t.memoizedState||(i.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===t.memoizedProps&&te===t.memoizedState||(i.flags|=1024),i.memoizedProps=r,i.memoizedState=ie),m.props=r,m.state=ie,m.context=q,r=oe):(typeof m.componentDidUpdate!="function"||b===t.memoizedProps&&te===t.memoizedState||(i.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===t.memoizedProps&&te===t.memoizedState||(i.flags|=1024),r=!1)}return m=r,Pr(t,i),r=(i.flags&128)!==0,m||r?(m=i.stateNode,l=r&&typeof l.getDerivedStateFromError!="function"?null:m.render(),i.flags|=1,t!==null&&r?(i.child=js(i,t.child,null,f),i.child=js(i,null,l,f)):Ot(t,i,l,f),i.memoizedState=m.state,t=i.child):t=Si(t,i,f),t}function Ug(t,i,l,r){return Cs(),i.flags|=256,Ot(t,i,l,r),i.child}var nd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function id(t){return{baseLanes:t,cachePool:Mp()}}function sd(t,i,l){return t=t!==null?t.childLanes&~l:0,i&&(t|=on),t}function Ig(t,i,l){var r=i.pendingProps,f=!1,m=(i.flags&128)!==0,b;if((b=m)||(b=t!==null&&t.memoizedState===null?!1:(ft.current&2)!==0),b&&(f=!0,i.flags&=-129),b=(i.flags&32)!==0,i.flags&=-33,t===null){if(je){if(f?Ji(i):Wi(),(t=Je)?(t=Qy(t,En),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Yi!==null?{id:Fn,overflow:Jn}:null,retryLane:536870912,hydrationErrors:null},l=Sp(t),l.return=i,i.child=l,Ct=i,Je=null)):t=null,t===null)throw Xi(i);return Ud(t)?i.lanes=32:i.lanes=536870912,null}var M=r.children;return r=r.fallback,f?(Wi(),f=i.mode,M=ec({mode:"hidden",children:M},f),r=Ts(r,f,l,null),M.return=i,r.return=i,M.sibling=r,i.child=M,r=i.child,r.memoizedState=id(l),r.childLanes=sd(t,b,l),i.memoizedState=nd,oo(null,r)):(Ji(i),ad(i,M))}var q=t.memoizedState;if(q!==null&&(M=q.dehydrated,M!==null)){if(m)i.flags&256?(Ji(i),i.flags&=-257,i=ld(t,i,l)):i.memoizedState!==null?(Wi(),i.child=t.child,i.flags|=128,i=null):(Wi(),M=r.fallback,f=i.mode,r=ec({mode:"visible",children:r.children},f),M=Ts(M,f,l,null),M.flags|=2,r.return=i,M.return=i,r.sibling=M,i.child=r,js(i,t.child,null,l),r=i.child,r.memoizedState=id(l),r.childLanes=sd(t,b,l),i.memoizedState=nd,i=oo(null,r));else if(Ji(i),Ud(M)){if(b=M.nextSibling&&M.nextSibling.dataset,b)var W=b.dgst;b=W,r=Error(a(419)),r.stack="",r.digest=b,Ql({value:r,source:null,stack:null}),i=ld(t,i,l)}else if(vt||Ea(t,i,l,!1),b=(l&t.childLanes)!==0,vt||b){if(b=Ze,b!==null&&(r=aa(b,l),r!==0&&r!==q.retryLane))throw q.retryLane=r,As(t,r),Ft(b,t,r),ed;Hd(M)||cc(),i=ld(t,i,l)}else Hd(M)?(i.flags|=192,i.child=t.child,i=null):(t=q.treeContext,Je=_n(M.nextSibling),Ct=i,je=!0,Gi=null,En=!1,t!==null&&Ep(i,t),i=ad(i,r.children),i.flags|=4096);return i}return f?(Wi(),M=r.fallback,f=i.mode,q=t.child,W=q.sibling,r=mi(q,{mode:"hidden",children:r.children}),r.subtreeFlags=q.subtreeFlags&65011712,W!==null?M=mi(W,M):(M=Ts(M,f,l,null),M.flags|=2),M.return=i,r.return=i,r.sibling=M,i.child=r,oo(null,r),r=i.child,M=t.child.memoizedState,M===null?M=id(l):(f=M.cachePool,f!==null?(q=gt._currentValue,f=f.parent!==q?{parent:q,pool:q}:f):f=Mp(),M={baseLanes:M.baseLanes|l,cachePool:f}),r.memoizedState=M,r.childLanes=sd(t,b,l),i.memoizedState=nd,oo(t.child,r)):(Ji(i),l=t.child,t=l.sibling,l=mi(l,{mode:"visible",children:r.children}),l.return=i,l.sibling=null,t!==null&&(b=i.deletions,b===null?(i.deletions=[t],i.flags|=16):b.push(t)),i.child=l,i.memoizedState=null,l)}function ad(t,i){return i=ec({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function ec(t,i){return t=nn(22,t,null,i),t.lanes=0,t}function ld(t,i,l){return js(i,t.child,null,l),t=ad(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function qg(t,i,l){t.lanes|=i;var r=t.alternate;r!==null&&(r.lanes|=i),wf(t.return,i,l)}function od(t,i,l,r,f,m){var b=t.memoizedState;b===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:r,tail:l,tailMode:f,treeForkCount:m}:(b.isBackwards=i,b.rendering=null,b.renderingStartTime=0,b.last=r,b.tail=l,b.tailMode=f,b.treeForkCount=m)}function Vg(t,i,l){var r=i.pendingProps,f=r.revealOrder,m=r.tail;r=r.children;var b=ft.current,M=(b&2)!==0;if(M?(b=b&1|2,i.flags|=128):b&=1,P(ft,b),Ot(t,i,r,l),r=je?Zl:0,!M&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&qg(t,l,i);else if(t.tag===19)qg(t,l,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(f){case"forwards":for(l=i.child,f=null;l!==null;)t=l.alternate,t!==null&&qr(t)===null&&(f=l),l=l.sibling;l=f,l===null?(f=i.child,i.child=null):(f=l.sibling,l.sibling=null),od(i,!1,f,l,m,r);break;case"backwards":case"unstable_legacy-backwards":for(l=null,f=i.child,i.child=null;f!==null;){if(t=f.alternate,t!==null&&qr(t)===null){i.child=f;break}t=f.sibling,f.sibling=l,l=f,f=t}od(i,!0,l,null,m,r);break;case"together":od(i,!1,null,null,void 0,r);break;default:i.memoizedState=null}return i.child}function Si(t,i,l){if(t!==null&&(i.dependencies=t.dependencies),ts|=i.lanes,(l&i.childLanes)===0)if(t!==null){if(Ea(t,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(a(153));if(i.child!==null){for(t=i.child,l=mi(t,t.pendingProps),i.child=l,l.return=i;t.sibling!==null;)t=t.sibling,l=l.sibling=mi(t,t.pendingProps),l.return=i;l.sibling=null}return i.child}function rd(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&jr(t)))}function xx(t,i,l){switch(i.tag){case 3:ne(i,i.stateNode.containerInfo),Ki(i,gt,t.memoizedState.cache),Cs();break;case 27:case 5:Se(i);break;case 4:ne(i,i.stateNode.containerInfo);break;case 10:Ki(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Df(i),null;break;case 13:var r=i.memoizedState;if(r!==null)return r.dehydrated!==null?(Ji(i),i.flags|=128,null):(l&i.child.childLanes)!==0?Ig(t,i,l):(Ji(i),t=Si(t,i,l),t!==null?t.sibling:null);Ji(i);break;case 19:var f=(t.flags&128)!==0;if(r=(l&i.childLanes)!==0,r||(Ea(t,i,l,!1),r=(l&i.childLanes)!==0),f){if(r)return Vg(t,i,l);i.flags|=128}if(f=i.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),P(ft,ft.current),r)break;return null;case 22:return i.lanes=0,Rg(t,i,l,i.pendingProps);case 24:Ki(i,gt,t.memoizedState.cache)}return Si(t,i,l)}function Yg(t,i,l){if(t!==null)if(t.memoizedProps!==i.pendingProps)vt=!0;else{if(!rd(t,l)&&(i.flags&128)===0)return vt=!1,xx(t,i,l);vt=(t.flags&131072)!==0}else vt=!1,je&&(i.flags&1048576)!==0&&xp(i,Zl,i.index);switch(i.lanes=0,i.tag){case 16:e:{var r=i.pendingProps;if(t=zs(i.elementType),i.type=t,typeof t=="function")hf(t)?(r=Bs(t,r),i.tag=1,i=Hg(null,i,t,r,l)):(i.tag=0,i=td(null,i,t,r,l));else{if(t!=null){var f=t.$$typeof;if(f===N){i.tag=11,i=zg(null,i,t,r,l);break e}else if(f===$){i.tag=14,i=Dg(null,i,t,r,l);break e}}throw i=H(t)||t,Error(a(306,i,""))}}return i;case 0:return td(t,i,i.type,i.pendingProps,l);case 1:return r=i.type,f=Bs(r,i.pendingProps),Hg(t,i,r,f,l);case 3:e:{if(ne(i,i.stateNode.containerInfo),t===null)throw Error(a(387));r=i.pendingProps;var m=i.memoizedState;f=m.element,Cf(t,i),no(i,r,null,l);var b=i.memoizedState;if(r=b.cache,Ki(i,gt,r),r!==m.cache&&xf(i,[gt],l,!0),to(),r=b.element,m.isDehydrated)if(m={element:r,isDehydrated:!1,cache:b.cache},i.updateQueue.baseState=m,i.memoizedState=m,i.flags&256){i=Ug(t,i,r,l);break e}else if(r!==f){f=Sn(Error(a(424)),i),Ql(f),i=Ug(t,i,r,l);break e}else for(t=i.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Je=_n(t.firstChild),Ct=i,je=!0,Gi=null,En=!0,l=Rp(i,null,r,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Cs(),r===f){i=Si(t,i,l);break e}Ot(t,i,r,l)}i=i.child}return i;case 26:return Pr(t,i),t===null?(l=t0(i.type,null,i.pendingProps,null))?i.memoizedState=l:je||(l=i.type,t=i.pendingProps,r=gc(de.current).createElement(l),r[F]=i,r[he]=t,kt(r,l,t),pt(r),i.stateNode=r):i.memoizedState=t0(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return Se(i),t===null&&je&&(r=i.stateNode=Wy(i.type,i.pendingProps,de.current),Ct=i,En=!0,f=Je,ls(i.type)?(Id=f,Je=_n(r.firstChild)):Je=f),Ot(t,i,i.pendingProps.children,l),Pr(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&je&&((f=r=Je)&&(r=Wx(r,i.type,i.pendingProps,En),r!==null?(i.stateNode=r,Ct=i,Je=_n(r.firstChild),En=!1,f=!0):f=!1),f||Xi(i)),Se(i),f=i.type,m=i.pendingProps,b=t!==null?t.memoizedProps:null,r=m.children,Bd(f,m)?r=null:b!==null&&Bd(f,b)&&(i.flags|=32),i.memoizedState!==null&&(f=Rf(t,i,hx,null,null,l),Eo._currentValue=f),Pr(t,i),Ot(t,i,r,l),i.child;case 6:return t===null&&je&&((t=l=Je)&&(l=Px(l,i.pendingProps,En),l!==null?(i.stateNode=l,Ct=i,Je=null,t=!0):t=!1),t||Xi(i)),null;case 13:return Ig(t,i,l);case 4:return ne(i,i.stateNode.containerInfo),r=i.pendingProps,t===null?i.child=js(i,null,r,l):Ot(t,i,r,l),i.child;case 11:return zg(t,i,i.type,i.pendingProps,l);case 7:return Ot(t,i,i.pendingProps,l),i.child;case 8:return Ot(t,i,i.pendingProps.children,l),i.child;case 12:return Ot(t,i,i.pendingProps.children,l),i.child;case 10:return r=i.pendingProps,Ki(i,i.type,r.value),Ot(t,i,r.children,l),i.child;case 9:return f=i.type._context,r=i.pendingProps.children,Os(i),f=Mt(f),r=r(f),i.flags|=1,Ot(t,i,r,l),i.child;case 14:return Dg(t,i,i.type,i.pendingProps,l);case 15:return jg(t,i,i.type,i.pendingProps,l);case 19:return Vg(t,i,l);case 31:return wx(t,i,l);case 22:return Rg(t,i,l,i.pendingProps);case 24:return Os(i),r=Mt(gt),t===null?(f=_f(),f===null&&(f=Ze,m=Ef(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=l),f=m),i.memoizedState={parent:r,cache:f},Tf(i),Ki(i,gt,f)):((t.lanes&l)!==0&&(Cf(t,i),no(i,null,null,l),to()),f=t.memoizedState,m=i.memoizedState,f.parent!==r?(f={parent:r,cache:r},i.memoizedState=f,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=f),Ki(i,gt,r)):(r=m.cache,Ki(i,gt,r),r!==f.cache&&xf(i,[gt],l,!0))),Ot(t,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function wi(t){t.flags|=4}function cd(t,i,l,r,f){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(yy())t.flags|=8192;else throw Ds=$r,Af}else t.flags&=-16777217}function Gg(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!l0(i))if(yy())t.flags|=8192;else throw Ds=$r,Af}function tc(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Tt():536870912,t.lanes|=i,Ra|=i)}function ro(t,i){if(!je)switch(t.tailMode){case"hidden":i=t.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var r=null;l!==null;)l.alternate!==null&&(r=l),l=l.sibling;r===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function We(t){var i=t.alternate!==null&&t.alternate.child===t.child,l=0,r=0;if(i)for(var f=t.child;f!==null;)l|=f.lanes|f.childLanes,r|=f.subtreeFlags&65011712,r|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)l|=f.lanes|f.childLanes,r|=f.subtreeFlags,r|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=r,t.childLanes=l,i}function Ex(t,i,l){var r=i.pendingProps;switch(yf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(i),null;case 1:return We(i),null;case 3:return l=i.stateNode,r=null,t!==null&&(r=t.memoizedState.cache),i.memoizedState.cache!==r&&(i.flags|=2048),yi(gt),ce(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(xa(i)?wi(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,bf())),We(i),null;case 26:var f=i.type,m=i.memoizedState;return t===null?(wi(i),m!==null?(We(i),Gg(i,m)):(We(i),cd(i,f,null,r,l))):m?m!==t.memoizedState?(wi(i),We(i),Gg(i,m)):(We(i),i.flags&=-16777217):(t=t.memoizedProps,t!==r&&wi(i),We(i),cd(i,f,t,r,l)),null;case 27:if(we(i),l=de.current,f=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==r&&wi(i);else{if(!r){if(i.stateNode===null)throw Error(a(166));return We(i),null}t=se.current,xa(i)?Np(i):(t=Wy(f,r,l),i.stateNode=t,wi(i))}return We(i),null;case 5:if(we(i),f=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==r&&wi(i);else{if(!r){if(i.stateNode===null)throw Error(a(166));return We(i),null}if(m=se.current,xa(i))Np(i);else{var b=gc(de.current);switch(m){case 1:m=b.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:m=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":m=b.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":m=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":m=b.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof r.is=="string"?b.createElement("select",{is:r.is}):b.createElement("select"),r.multiple?m.multiple=!0:r.size&&(m.size=r.size);break;default:m=typeof r.is=="string"?b.createElement(f,{is:r.is}):b.createElement(f)}}m[F]=i,m[he]=r;e:for(b=i.child;b!==null;){if(b.tag===5||b.tag===6)m.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===i)break e;for(;b.sibling===null;){if(b.return===null||b.return===i)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}i.stateNode=m;e:switch(kt(m,f,r),f){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&wi(i)}}return We(i),cd(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,l),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==r&&wi(i);else{if(typeof r!="string"&&i.stateNode===null)throw Error(a(166));if(t=de.current,xa(i)){if(t=i.stateNode,l=i.memoizedProps,r=null,f=Ct,f!==null)switch(f.tag){case 27:case 5:r=f.memoizedProps}t[F]=i,t=!!(t.nodeValue===l||r!==null&&r.suppressHydrationWarning===!0||Iy(t.nodeValue,l)),t||Xi(i,!0)}else t=gc(t).createTextNode(r),t[F]=i,i.stateNode=t}return We(i),null;case 31:if(l=i.memoizedState,t===null||t.memoizedState!==null){if(r=xa(i),l!==null){if(t===null){if(!r)throw Error(a(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[F]=i}else Cs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;We(i),t=!1}else l=bf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return i.flags&256?(an(i),i):(an(i),null);if((i.flags&128)!==0)throw Error(a(558))}return We(i),null;case 13:if(r=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=xa(i),r!==null&&r.dehydrated!==null){if(t===null){if(!f)throw Error(a(318));if(f=i.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(a(317));f[F]=i}else Cs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;We(i),f=!1}else f=bf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return i.flags&256?(an(i),i):(an(i),null)}return an(i),(i.flags&128)!==0?(i.lanes=l,i):(l=r!==null,t=t!==null&&t.memoizedState!==null,l&&(r=i.child,f=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(f=r.alternate.memoizedState.cachePool.pool),m=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(m=r.memoizedState.cachePool.pool),m!==f&&(r.flags|=2048)),l!==t&&l&&(i.child.flags|=8192),tc(i,i.updateQueue),We(i),null);case 4:return ce(),t===null&&kd(i.stateNode.containerInfo),We(i),null;case 10:return yi(i.type),We(i),null;case 19:if(U(ft),r=i.memoizedState,r===null)return We(i),null;if(f=(i.flags&128)!==0,m=r.rendering,m===null)if(f)ro(r,!1);else{if(ct!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(m=qr(t),m!==null){for(i.flags|=128,ro(r,!1),t=m.updateQueue,i.updateQueue=t,tc(i,t),i.subtreeFlags=0,t=l,l=i.child;l!==null;)bp(l,t),l=l.sibling;return P(ft,ft.current&1|2),je&&pi(i,r.treeForkCount),i.child}t=t.sibling}r.tail!==null&&Ke()>lc&&(i.flags|=128,f=!0,ro(r,!1),i.lanes=4194304)}else{if(!f)if(t=qr(m),t!==null){if(i.flags|=128,f=!0,t=t.updateQueue,i.updateQueue=t,tc(i,t),ro(r,!0),r.tail===null&&r.tailMode==="hidden"&&!m.alternate&&!je)return We(i),null}else 2*Ke()-r.renderingStartTime>lc&&l!==536870912&&(i.flags|=128,f=!0,ro(r,!1),i.lanes=4194304);r.isBackwards?(m.sibling=i.child,i.child=m):(t=r.last,t!==null?t.sibling=m:i.child=m,r.last=m)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=Ke(),t.sibling=null,l=ft.current,P(ft,f?l&1|2:l&1),je&&pi(i,r.treeForkCount),t):(We(i),null);case 22:case 23:return an(i),zf(),r=i.memoizedState!==null,t!==null?t.memoizedState!==null!==r&&(i.flags|=8192):r&&(i.flags|=8192),r?(l&536870912)!==0&&(i.flags&128)===0&&(We(i),i.subtreeFlags&6&&(i.flags|=8192)):We(i),l=i.updateQueue,l!==null&&tc(i,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==l&&(i.flags|=2048),t!==null&&U(ks),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),yi(gt),We(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function Nx(t,i){switch(yf(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return yi(gt),ce(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return we(i),null;case 31:if(i.memoizedState!==null){if(an(i),i.alternate===null)throw Error(a(340));Cs()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(an(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Cs()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return U(ft),null;case 4:return ce(),null;case 10:return yi(i.type),null;case 22:case 23:return an(i),zf(),t!==null&&U(ks),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return yi(gt),null;case 25:return null;default:return null}}function Xg(t,i){switch(yf(i),i.tag){case 3:yi(gt),ce();break;case 26:case 27:case 5:we(i);break;case 4:ce();break;case 31:i.memoizedState!==null&&an(i);break;case 13:an(i);break;case 19:U(ft);break;case 10:yi(i.type);break;case 22:case 23:an(i),zf(),t!==null&&U(ks);break;case 24:yi(gt)}}function co(t,i){try{var l=i.updateQueue,r=l!==null?l.lastEffect:null;if(r!==null){var f=r.next;l=f;do{if((l.tag&t)===t){r=void 0;var m=l.create,b=l.inst;r=m(),b.destroy=r}l=l.next}while(l!==f)}}catch(M){Ve(i,i.return,M)}}function Pi(t,i,l){try{var r=i.updateQueue,f=r!==null?r.lastEffect:null;if(f!==null){var m=f.next;r=m;do{if((r.tag&t)===t){var b=r.inst,M=b.destroy;if(M!==void 0){b.destroy=void 0,f=i;var q=l,W=M;try{W()}catch(oe){Ve(f,q,oe)}}}r=r.next}while(r!==m)}}catch(oe){Ve(i,i.return,oe)}}function Kg(t){var i=t.updateQueue;if(i!==null){var l=t.stateNode;try{Lp(i,l)}catch(r){Ve(t,t.return,r)}}}function Zg(t,i,l){l.props=Bs(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(r){Ve(t,i,r)}}function uo(t,i){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var r=t.stateNode;break;case 30:r=t.stateNode;break;default:r=t.stateNode}typeof l=="function"?t.refCleanup=l(r):l.current=r}}catch(f){Ve(t,i,f)}}function Wn(t,i){var l=t.ref,r=t.refCleanup;if(l!==null)if(typeof r=="function")try{r()}catch(f){Ve(t,i,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(f){Ve(t,i,f)}else l.current=null}function Qg(t){var i=t.type,l=t.memoizedProps,r=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break e;case"img":l.src?r.src=l.src:l.srcSet&&(r.srcset=l.srcSet)}}catch(f){Ve(t,t.return,f)}}function ud(t,i,l){try{var r=t.stateNode;Xx(r,t.type,l,i),r[he]=i}catch(f){Ve(t,t.return,f)}}function Fg(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ls(t.type)||t.tag===4}function fd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Fg(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ls(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function dd(t,i,l){var r=t.tag;if(r===5||r===6)t=t.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(t),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=di));else if(r!==4&&(r===27&&ls(t.type)&&(l=t.stateNode,i=null),t=t.child,t!==null))for(dd(t,i,l),t=t.sibling;t!==null;)dd(t,i,l),t=t.sibling}function nc(t,i,l){var r=t.tag;if(r===5||r===6)t=t.stateNode,i?l.insertBefore(t,i):l.appendChild(t);else if(r!==4&&(r===27&&ls(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(nc(t,i,l),t=t.sibling;t!==null;)nc(t,i,l),t=t.sibling}function Jg(t){var i=t.stateNode,l=t.memoizedProps;try{for(var r=t.type,f=i.attributes;f.length;)i.removeAttributeNode(f[0]);kt(i,r,l),i[F]=t,i[he]=l}catch(m){Ve(t,t.return,m)}}var xi=!1,bt=!1,hd=!1,Wg=typeof WeakSet=="function"?WeakSet:Set,Nt=null;function _x(t,i){if(t=t.containerInfo,jd=Ec,t=up(t),lf(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var r=l.getSelection&&l.getSelection();if(r&&r.rangeCount!==0){l=r.anchorNode;var f=r.anchorOffset,m=r.focusNode;r=r.focusOffset;try{l.nodeType,m.nodeType}catch{l=null;break e}var b=0,M=-1,q=-1,W=0,oe=0,ue=t,te=null;t:for(;;){for(var ie;ue!==l||f!==0&&ue.nodeType!==3||(M=b+f),ue!==m||r!==0&&ue.nodeType!==3||(q=b+r),ue.nodeType===3&&(b+=ue.nodeValue.length),(ie=ue.firstChild)!==null;)te=ue,ue=ie;for(;;){if(ue===t)break t;if(te===l&&++W===f&&(M=b),te===m&&++oe===r&&(q=b),(ie=ue.nextSibling)!==null)break;ue=te,te=ue.parentNode}ue=ie}l=M===-1||q===-1?null:{start:M,end:q}}else l=null}l=l||{start:0,end:0}}else l=null;for(Rd={focusedElem:t,selectionRange:l},Ec=!1,Nt=i;Nt!==null;)if(i=Nt,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,Nt=t;else for(;Nt!==null;){switch(i=Nt,m=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)f=t[l],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&m!==null){t=void 0,l=i,f=m.memoizedProps,m=m.memoizedState,r=l.stateNode;try{var ye=Bs(l.type,f);t=r.getSnapshotBeforeUpdate(ye,m),r.__reactInternalSnapshotBeforeUpdate=t}catch(xe){Ve(l,l.return,xe)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,l=t.nodeType,l===9)$d(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":$d(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(a(163))}if(t=i.sibling,t!==null){t.return=i.return,Nt=t;break}Nt=i.return}}function Pg(t,i,l){var r=l.flags;switch(l.tag){case 0:case 11:case 15:Ni(t,l),r&4&&co(5,l);break;case 1:if(Ni(t,l),r&4)if(t=l.stateNode,i===null)try{t.componentDidMount()}catch(b){Ve(l,l.return,b)}else{var f=Bs(l.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(f,i,t.__reactInternalSnapshotBeforeUpdate)}catch(b){Ve(l,l.return,b)}}r&64&&Kg(l),r&512&&uo(l,l.return);break;case 3:if(Ni(t,l),r&64&&(t=l.updateQueue,t!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{Lp(t,i)}catch(b){Ve(l,l.return,b)}}break;case 27:i===null&&r&4&&Jg(l);case 26:case 5:Ni(t,l),i===null&&r&4&&Qg(l),r&512&&uo(l,l.return);break;case 12:Ni(t,l);break;case 31:Ni(t,l),r&4&&ny(t,l);break;case 13:Ni(t,l),r&4&&iy(t,l),r&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=jx.bind(null,l),eE(t,l))));break;case 22:if(r=l.memoizedState!==null||xi,!r){i=i!==null&&i.memoizedState!==null||bt,f=xi;var m=bt;xi=r,(bt=i)&&!m?_i(t,l,(l.subtreeFlags&8772)!==0):Ni(t,l),xi=f,bt=m}break;case 30:break;default:Ni(t,l)}}function ey(t){var i=t.alternate;i!==null&&(t.alternate=null,ey(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&zl(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var tt=null,Xt=!1;function Ei(t,i,l){for(l=l.child;l!==null;)ty(t,i,l),l=l.sibling}function ty(t,i,l){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(It,l)}catch{}switch(l.tag){case 26:bt||Wn(l,i),Ei(t,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:bt||Wn(l,i);var r=tt,f=Xt;ls(l.type)&&(tt=l.stateNode,Xt=!1),Ei(t,i,l),So(l.stateNode),tt=r,Xt=f;break;case 5:bt||Wn(l,i);case 6:if(r=tt,f=Xt,tt=null,Ei(t,i,l),tt=r,Xt=f,tt!==null)if(Xt)try{(tt.nodeType===9?tt.body:tt.nodeName==="HTML"?tt.ownerDocument.body:tt).removeChild(l.stateNode)}catch(m){Ve(l,i,m)}else try{tt.removeChild(l.stateNode)}catch(m){Ve(l,i,m)}break;case 18:tt!==null&&(Xt?(t=tt,Ky(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Va(t)):Ky(tt,l.stateNode));break;case 4:r=tt,f=Xt,tt=l.stateNode.containerInfo,Xt=!0,Ei(t,i,l),tt=r,Xt=f;break;case 0:case 11:case 14:case 15:Pi(2,l,i),bt||Pi(4,l,i),Ei(t,i,l);break;case 1:bt||(Wn(l,i),r=l.stateNode,typeof r.componentWillUnmount=="function"&&Zg(l,i,r)),Ei(t,i,l);break;case 21:Ei(t,i,l);break;case 22:bt=(r=bt)||l.memoizedState!==null,Ei(t,i,l),bt=r;break;default:Ei(t,i,l)}}function ny(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Va(t)}catch(l){Ve(i,i.return,l)}}}function iy(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Va(t)}catch(l){Ve(i,i.return,l)}}function Ax(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Wg),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Wg),i;default:throw Error(a(435,t.tag))}}function ic(t,i){var l=Ax(t);i.forEach(function(r){if(!l.has(r)){l.add(r);var f=Rx.bind(null,t,r);r.then(f,f)}})}function Kt(t,i){var l=i.deletions;if(l!==null)for(var r=0;r<l.length;r++){var f=l[r],m=t,b=i,M=b;e:for(;M!==null;){switch(M.tag){case 27:if(ls(M.type)){tt=M.stateNode,Xt=!1;break e}break;case 5:tt=M.stateNode,Xt=!1;break e;case 3:case 4:tt=M.stateNode.containerInfo,Xt=!0;break e}M=M.return}if(tt===null)throw Error(a(160));ty(m,b,f),tt=null,Xt=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)sy(i,t),i=i.sibling}var Rn=null;function sy(t,i){var l=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Kt(i,t),Zt(t),r&4&&(Pi(3,t,t.return),co(3,t),Pi(5,t,t.return));break;case 1:Kt(i,t),Zt(t),r&512&&(bt||l===null||Wn(l,l.return)),r&64&&xi&&(t=t.updateQueue,t!==null&&(r=t.callbacks,r!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?r:l.concat(r))));break;case 26:var f=Rn;if(Kt(i,t),Zt(t),r&512&&(bt||l===null||Wn(l,l.return)),r&4){var m=l!==null?l.memoizedState:null;if(r=t.memoizedState,l===null)if(r===null)if(t.stateNode===null){e:{r=t.type,l=t.memoizedProps,f=f.ownerDocument||f;t:switch(r){case"title":m=f.getElementsByTagName("title")[0],(!m||m[vn]||m[F]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(r),f.head.insertBefore(m,f.querySelector("head > title"))),kt(m,r,l),m[F]=t,pt(m),r=m;break e;case"link":var b=s0("link","href",f).get(r+(l.href||""));if(b){for(var M=0;M<b.length;M++)if(m=b[M],m.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&m.getAttribute("rel")===(l.rel==null?null:l.rel)&&m.getAttribute("title")===(l.title==null?null:l.title)&&m.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){b.splice(M,1);break t}}m=f.createElement(r),kt(m,r,l),f.head.appendChild(m);break;case"meta":if(b=s0("meta","content",f).get(r+(l.content||""))){for(M=0;M<b.length;M++)if(m=b[M],m.getAttribute("content")===(l.content==null?null:""+l.content)&&m.getAttribute("name")===(l.name==null?null:l.name)&&m.getAttribute("property")===(l.property==null?null:l.property)&&m.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&m.getAttribute("charset")===(l.charSet==null?null:l.charSet)){b.splice(M,1);break t}}m=f.createElement(r),kt(m,r,l),f.head.appendChild(m);break;default:throw Error(a(468,r))}m[F]=t,pt(m),r=m}t.stateNode=r}else a0(f,t.type,t.stateNode);else t.stateNode=i0(f,r,t.memoizedProps);else m!==r?(m===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):m.count--,r===null?a0(f,t.type,t.stateNode):i0(f,r,t.memoizedProps)):r===null&&t.stateNode!==null&&ud(t,t.memoizedProps,l.memoizedProps)}break;case 27:Kt(i,t),Zt(t),r&512&&(bt||l===null||Wn(l,l.return)),l!==null&&r&4&&ud(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Kt(i,t),Zt(t),r&512&&(bt||l===null||Wn(l,l.return)),t.flags&32){f=t.stateNode;try{da(f,"")}catch(ye){Ve(t,t.return,ye)}}r&4&&t.stateNode!=null&&(f=t.memoizedProps,ud(t,f,l!==null?l.memoizedProps:f)),r&1024&&(hd=!0);break;case 6:if(Kt(i,t),Zt(t),r&4){if(t.stateNode===null)throw Error(a(162));r=t.memoizedProps,l=t.stateNode;try{l.nodeValue=r}catch(ye){Ve(t,t.return,ye)}}break;case 3:if(bc=null,f=Rn,Rn=yc(i.containerInfo),Kt(i,t),Rn=f,Zt(t),r&4&&l!==null&&l.memoizedState.isDehydrated)try{Va(i.containerInfo)}catch(ye){Ve(t,t.return,ye)}hd&&(hd=!1,ay(t));break;case 4:r=Rn,Rn=yc(t.stateNode.containerInfo),Kt(i,t),Zt(t),Rn=r;break;case 12:Kt(i,t),Zt(t);break;case 31:Kt(i,t),Zt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,ic(t,r)));break;case 13:Kt(i,t),Zt(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(ac=Ke()),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,ic(t,r)));break;case 22:f=t.memoizedState!==null;var q=l!==null&&l.memoizedState!==null,W=xi,oe=bt;if(xi=W||f,bt=oe||q,Kt(i,t),bt=oe,xi=W,Zt(t),r&8192)e:for(i=t.stateNode,i._visibility=f?i._visibility&-2:i._visibility|1,f&&(l===null||q||xi||bt||Ls(t)),l=null,i=t;;){if(i.tag===5||i.tag===26){if(l===null){q=l=i;try{if(m=q.stateNode,f)b=m.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{M=q.stateNode;var ue=q.memoizedProps.style,te=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;M.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(ye){Ve(q,q.return,ye)}}}else if(i.tag===6){if(l===null){q=i;try{q.stateNode.nodeValue=f?"":q.memoizedProps}catch(ye){Ve(q,q.return,ye)}}}else if(i.tag===18){if(l===null){q=i;try{var ie=q.stateNode;f?Zy(ie,!0):Zy(q.stateNode,!1)}catch(ye){Ve(q,q.return,ye)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}r&4&&(r=t.updateQueue,r!==null&&(l=r.retryQueue,l!==null&&(r.retryQueue=null,ic(t,l))));break;case 19:Kt(i,t),Zt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,ic(t,r)));break;case 30:break;case 21:break;default:Kt(i,t),Zt(t)}}function Zt(t){var i=t.flags;if(i&2){try{for(var l,r=t.return;r!==null;){if(Fg(r)){l=r;break}r=r.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var f=l.stateNode,m=fd(t);nc(t,m,f);break;case 5:var b=l.stateNode;l.flags&32&&(da(b,""),l.flags&=-33);var M=fd(t);nc(t,M,b);break;case 3:case 4:var q=l.stateNode.containerInfo,W=fd(t);dd(t,W,q);break;default:throw Error(a(161))}}catch(oe){Ve(t,t.return,oe)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function ay(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;ay(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function Ni(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Pg(t,i.alternate,i),i=i.sibling}function Ls(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:Pi(4,i,i.return),Ls(i);break;case 1:Wn(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&Zg(i,i.return,l),Ls(i);break;case 27:So(i.stateNode);case 26:case 5:Wn(i,i.return),Ls(i);break;case 22:i.memoizedState===null&&Ls(i);break;case 30:Ls(i);break;default:Ls(i)}t=t.sibling}}function _i(t,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var r=i.alternate,f=t,m=i,b=m.flags;switch(m.tag){case 0:case 11:case 15:_i(f,m,l),co(4,m);break;case 1:if(_i(f,m,l),r=m,f=r.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(W){Ve(r,r.return,W)}if(r=m,f=r.updateQueue,f!==null){var M=r.stateNode;try{var q=f.shared.hiddenCallbacks;if(q!==null)for(f.shared.hiddenCallbacks=null,f=0;f<q.length;f++)Bp(q[f],M)}catch(W){Ve(r,r.return,W)}}l&&b&64&&Kg(m),uo(m,m.return);break;case 27:Jg(m);case 26:case 5:_i(f,m,l),l&&r===null&&b&4&&Qg(m),uo(m,m.return);break;case 12:_i(f,m,l);break;case 31:_i(f,m,l),l&&b&4&&ny(f,m);break;case 13:_i(f,m,l),l&&b&4&&iy(f,m);break;case 22:m.memoizedState===null&&_i(f,m,l),uo(m,m.return);break;case 30:break;default:_i(f,m,l)}i=i.sibling}}function md(t,i){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&Fl(l))}function pd(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Fl(t))}function Bn(t,i,l,r){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)ly(t,i,l,r),i=i.sibling}function ly(t,i,l,r){var f=i.flags;switch(i.tag){case 0:case 11:case 15:Bn(t,i,l,r),f&2048&&co(9,i);break;case 1:Bn(t,i,l,r);break;case 3:Bn(t,i,l,r),f&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Fl(t)));break;case 12:if(f&2048){Bn(t,i,l,r),t=i.stateNode;try{var m=i.memoizedProps,b=m.id,M=m.onPostCommit;typeof M=="function"&&M(b,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(q){Ve(i,i.return,q)}}else Bn(t,i,l,r);break;case 31:Bn(t,i,l,r);break;case 13:Bn(t,i,l,r);break;case 23:break;case 22:m=i.stateNode,b=i.alternate,i.memoizedState!==null?m._visibility&2?Bn(t,i,l,r):fo(t,i):m._visibility&2?Bn(t,i,l,r):(m._visibility|=2,za(t,i,l,r,(i.subtreeFlags&10256)!==0||!1)),f&2048&&md(b,i);break;case 24:Bn(t,i,l,r),f&2048&&pd(i.alternate,i);break;default:Bn(t,i,l,r)}}function za(t,i,l,r,f){for(f=f&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var m=t,b=i,M=l,q=r,W=b.flags;switch(b.tag){case 0:case 11:case 15:za(m,b,M,q,f),co(8,b);break;case 23:break;case 22:var oe=b.stateNode;b.memoizedState!==null?oe._visibility&2?za(m,b,M,q,f):fo(m,b):(oe._visibility|=2,za(m,b,M,q,f)),f&&W&2048&&md(b.alternate,b);break;case 24:za(m,b,M,q,f),f&&W&2048&&pd(b.alternate,b);break;default:za(m,b,M,q,f)}i=i.sibling}}function fo(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=t,r=i,f=r.flags;switch(r.tag){case 22:fo(l,r),f&2048&&md(r.alternate,r);break;case 24:fo(l,r),f&2048&&pd(r.alternate,r);break;default:fo(l,r)}i=i.sibling}}var ho=8192;function Da(t,i,l){if(t.subtreeFlags&ho)for(t=t.child;t!==null;)oy(t,i,l),t=t.sibling}function oy(t,i,l){switch(t.tag){case 26:Da(t,i,l),t.flags&ho&&t.memoizedState!==null&&dE(l,Rn,t.memoizedState,t.memoizedProps);break;case 5:Da(t,i,l);break;case 3:case 4:var r=Rn;Rn=yc(t.stateNode.containerInfo),Da(t,i,l),Rn=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=ho,ho=16777216,Da(t,i,l),ho=r):Da(t,i,l));break;default:Da(t,i,l)}}function ry(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function mo(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var r=i[l];Nt=r,uy(r,t)}ry(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)cy(t),t=t.sibling}function cy(t){switch(t.tag){case 0:case 11:case 15:mo(t),t.flags&2048&&Pi(9,t,t.return);break;case 3:mo(t);break;case 12:mo(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,sc(t)):mo(t);break;default:mo(t)}}function sc(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var r=i[l];Nt=r,uy(r,t)}ry(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:Pi(8,i,i.return),sc(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,sc(i));break;default:sc(i)}t=t.sibling}}function uy(t,i){for(;Nt!==null;){var l=Nt;switch(l.tag){case 0:case 11:case 15:Pi(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var r=l.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Fl(l.memoizedState.cache)}if(r=l.child,r!==null)r.return=l,Nt=r;else e:for(l=t;Nt!==null;){r=Nt;var f=r.sibling,m=r.return;if(ey(r),r===l){Nt=null;break e}if(f!==null){f.return=m,Nt=f;break e}Nt=m}}}var Tx={getCacheForType:function(t){var i=Mt(gt),l=i.data.get(t);return l===void 0&&(l=t(),i.data.set(t,l)),l},cacheSignal:function(){return Mt(gt).controller.signal}},Cx=typeof WeakMap=="function"?WeakMap:Map,$e=0,Ze=null,Oe=null,ze=0,qe=0,ln=null,es=!1,ja=!1,gd=!1,Ai=0,ct=0,ts=0,$s=0,yd=0,on=0,Ra=0,po=null,Qt=null,vd=!1,ac=0,fy=0,lc=1/0,oc=null,ns=null,xt=0,is=null,Ba=null,Ti=0,bd=0,Sd=null,dy=null,go=0,wd=null;function rn(){return($e&2)!==0&&ze!==0?ze&-ze:C.T!==null?Td():la()}function hy(){if(on===0)if((ze&536870912)===0||je){var t=ri;ri<<=1,(ri&3932160)===0&&(ri=262144),on=t}else on=536870912;return t=sn.current,t!==null&&(t.flags|=32),on}function Ft(t,i,l){(t===Ze&&(qe===2||qe===9)||t.cancelPendingCommit!==null)&&(La(t,0),ss(t,ze,on,!1)),zn(t,l),(($e&2)===0||t!==Ze)&&(t===Ze&&(($e&2)===0&&($s|=l),ct===4&&ss(t,ze,on,!1)),Pn(t))}function my(t,i,l){if(($e&6)!==0)throw Error(a(327));var r=!l&&(i&127)===0&&(i&t.expiredLanes)===0||Et(t,i),f=r?kx(t,i):Ed(t,i,!0),m=r;do{if(f===0){ja&&!r&&ss(t,i,0,!1);break}else{if(l=t.current.alternate,m&&!Mx(l)){f=Ed(t,i,!1),m=!1;continue}if(f===2){if(m=i,t.errorRecoveryDisabledLanes&m)var b=0;else b=t.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){i=b;e:{var M=t;f=po;var q=M.current.memoizedState.isDehydrated;if(q&&(La(M,b).flags|=256),b=Ed(M,b,!1),b!==2){if(gd&&!q){M.errorRecoveryDisabledLanes|=m,$s|=m,f=4;break e}m=Qt,Qt=f,m!==null&&(Qt===null?Qt=m:Qt.push.apply(Qt,m))}f=b}if(m=!1,f!==2)continue}}if(f===1){La(t,0),ss(t,i,0,!0);break}e:{switch(r=t,m=f,m){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:ss(r,i,on,!es);break e;case 2:Qt=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(f=ac+300-Ke(),10<f)){if(ss(r,i,on,!es),ci(r,0,!0)!==0)break e;Ti=i,r.timeoutHandle=Gy(py.bind(null,r,l,Qt,oc,vd,i,on,$s,Ra,es,m,"Throttled",-0,0),f);break e}py(r,l,Qt,oc,vd,i,on,$s,Ra,es,m,null,-0,0)}}break}while(!0);Pn(t)}function py(t,i,l,r,f,m,b,M,q,W,oe,ue,te,ie){if(t.timeoutHandle=-1,ue=i.subtreeFlags,ue&8192||(ue&16785408)===16785408){ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:di},oy(i,m,ue);var ye=(m&62914560)===m?ac-Ke():(m&4194048)===m?fy-Ke():0;if(ye=hE(ue,ye),ye!==null){Ti=m,t.cancelPendingCommit=ye(Ey.bind(null,t,i,m,l,r,f,b,M,q,oe,ue,null,te,ie)),ss(t,m,b,!W);return}}Ey(t,i,m,l,r,f,b,M,q)}function Mx(t){for(var i=t;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var r=0;r<l.length;r++){var f=l[r],m=f.getSnapshot;f=f.value;try{if(!tn(m(),f))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ss(t,i,l,r){i&=~yd,i&=~$s,t.suspendedLanes|=i,t.pingedLanes&=~i,r&&(t.warmLanes|=i),r=t.expirationTimes;for(var f=i;0<f;){var m=31-At(f),b=1<<m;r[m]=-1,f&=~b}l!==0&&gn(t,l,i)}function rc(){return($e&6)===0?(yo(0),!1):!0}function xd(){if(Oe!==null){if(qe===0)var t=Oe.return;else t=Oe,gi=Ms=null,$f(t),Ta=null,Wl=0,t=Oe;for(;t!==null;)Xg(t.alternate,t),t=t.return;Oe=null}}function La(t,i){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,Qx(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Ti=0,xd(),Ze=t,Oe=l=mi(t.current,null),ze=i,qe=0,ln=null,es=!1,ja=Et(t,i),gd=!1,Ra=on=yd=$s=ts=ct=0,Qt=po=null,vd=!1,(i&8)!==0&&(i|=i&32);var r=t.entangledLanes;if(r!==0)for(t=t.entanglements,r&=i;0<r;){var f=31-At(r),m=1<<f;i|=t[f],r&=~m}return Ai=i,Mr(),l}function gy(t,i){Te=null,C.H=lo,i===Aa||i===Lr?(i=zp(),qe=3):i===Af?(i=zp(),qe=4):qe=i===ed?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,ln=i,Oe===null&&(ct=1,Jr(t,Sn(i,t.current)))}function yy(){var t=sn.current;return t===null?!0:(ze&4194048)===ze?Nn===null:(ze&62914560)===ze||(ze&536870912)!==0?t===Nn:!1}function vy(){var t=C.H;return C.H=lo,t===null?lo:t}function by(){var t=C.A;return C.A=Tx,t}function cc(){ct=4,es||(ze&4194048)!==ze&&sn.current!==null||(ja=!0),(ts&134217727)===0&&($s&134217727)===0||Ze===null||ss(Ze,ze,on,!1)}function Ed(t,i,l){var r=$e;$e|=2;var f=vy(),m=by();(Ze!==t||ze!==i)&&(oc=null,La(t,i)),i=!1;var b=ct;e:do try{if(qe!==0&&Oe!==null){var M=Oe,q=ln;switch(qe){case 8:xd(),b=6;break e;case 3:case 2:case 9:case 6:sn.current===null&&(i=!0);var W=qe;if(qe=0,ln=null,$a(t,M,q,W),l&&ja){b=0;break e}break;default:W=qe,qe=0,ln=null,$a(t,M,q,W)}}Ox(),b=ct;break}catch(oe){gy(t,oe)}while(!0);return i&&t.shellSuspendCounter++,gi=Ms=null,$e=r,C.H=f,C.A=m,Oe===null&&(Ze=null,ze=0,Mr()),b}function Ox(){for(;Oe!==null;)Sy(Oe)}function kx(t,i){var l=$e;$e|=2;var r=vy(),f=by();Ze!==t||ze!==i?(oc=null,lc=Ke()+500,La(t,i)):ja=Et(t,i);e:do try{if(qe!==0&&Oe!==null){i=Oe;var m=ln;t:switch(qe){case 1:qe=0,ln=null,$a(t,i,m,1);break;case 2:case 9:if(Op(m)){qe=0,ln=null,wy(i);break}i=function(){qe!==2&&qe!==9||Ze!==t||(qe=7),Pn(t)},m.then(i,i);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:Op(m)?(qe=0,ln=null,wy(i)):(qe=0,ln=null,$a(t,i,m,7));break;case 5:var b=null;switch(Oe.tag){case 26:b=Oe.memoizedState;case 5:case 27:var M=Oe;if(b?l0(b):M.stateNode.complete){qe=0,ln=null;var q=M.sibling;if(q!==null)Oe=q;else{var W=M.return;W!==null?(Oe=W,uc(W)):Oe=null}break t}}qe=0,ln=null,$a(t,i,m,5);break;case 6:qe=0,ln=null,$a(t,i,m,6);break;case 8:xd(),ct=6;break e;default:throw Error(a(462))}}zx();break}catch(oe){gy(t,oe)}while(!0);return gi=Ms=null,C.H=r,C.A=f,$e=l,Oe!==null?0:(Ze=null,ze=0,Mr(),ct)}function zx(){for(;Oe!==null&&!kn();)Sy(Oe)}function Sy(t){var i=Yg(t.alternate,t,Ai);t.memoizedProps=t.pendingProps,i===null?uc(t):Oe=i}function wy(t){var i=t,l=i.alternate;switch(i.tag){case 15:case 0:i=$g(l,i,i.pendingProps,i.type,void 0,ze);break;case 11:i=$g(l,i,i.pendingProps,i.type.render,i.ref,ze);break;case 5:$f(i);default:Xg(l,i),i=Oe=bp(i,Ai),i=Yg(l,i,Ai)}t.memoizedProps=t.pendingProps,i===null?uc(t):Oe=i}function $a(t,i,l,r){gi=Ms=null,$f(i),Ta=null,Wl=0;var f=i.return;try{if(Sx(t,f,i,l,ze)){ct=1,Jr(t,Sn(l,t.current)),Oe=null;return}}catch(m){if(f!==null)throw Oe=f,m;ct=1,Jr(t,Sn(l,t.current)),Oe=null;return}i.flags&32768?(je||r===1?t=!0:ja||(ze&536870912)!==0?t=!1:(es=t=!0,(r===2||r===9||r===3||r===6)&&(r=sn.current,r!==null&&r.tag===13&&(r.flags|=16384))),xy(i,t)):uc(i)}function uc(t){var i=t;do{if((i.flags&32768)!==0){xy(i,es);return}t=i.return;var l=Ex(i.alternate,i,Ai);if(l!==null){Oe=l;return}if(i=i.sibling,i!==null){Oe=i;return}Oe=i=t}while(i!==null);ct===0&&(ct=5)}function xy(t,i){do{var l=Nx(t.alternate,t);if(l!==null){l.flags&=32767,Oe=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(t=t.sibling,t!==null)){Oe=t;return}Oe=t=l}while(t!==null);ct=6,Oe=null}function Ey(t,i,l,r,f,m,b,M,q){t.cancelPendingCommit=null;do fc();while(xt!==0);if(($e&6)!==0)throw Error(a(327));if(i!==null){if(i===t.current)throw Error(a(177));if(m=i.lanes|i.childLanes,m|=ff,kl(t,l,m,b,M,q),t===Ze&&(Oe=Ze=null,ze=0),Ba=i,is=t,Ti=l,bd=m,Sd=f,dy=r,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Bx(jt,function(){return Cy(),null})):(t.callbackNode=null,t.callbackPriority=0),r=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||r){r=C.T,C.T=null,f=B.p,B.p=2,b=$e,$e|=4;try{_x(t,i,l)}finally{$e=b,B.p=f,C.T=r}}xt=1,Ny(),_y(),Ay()}}function Ny(){if(xt===1){xt=0;var t=is,i=Ba,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=C.T,C.T=null;var r=B.p;B.p=2;var f=$e;$e|=4;try{sy(i,t);var m=Rd,b=up(t.containerInfo),M=m.focusedElem,q=m.selectionRange;if(b!==M&&M&&M.ownerDocument&&cp(M.ownerDocument.documentElement,M)){if(q!==null&&lf(M)){var W=q.start,oe=q.end;if(oe===void 0&&(oe=W),"selectionStart"in M)M.selectionStart=W,M.selectionEnd=Math.min(oe,M.value.length);else{var ue=M.ownerDocument||document,te=ue&&ue.defaultView||window;if(te.getSelection){var ie=te.getSelection(),ye=M.textContent.length,xe=Math.min(q.start,ye),Xe=q.end===void 0?xe:Math.min(q.end,ye);!ie.extend&&xe>Xe&&(b=Xe,Xe=xe,xe=b);var Q=rp(M,xe),X=rp(M,Xe);if(Q&&X&&(ie.rangeCount!==1||ie.anchorNode!==Q.node||ie.anchorOffset!==Q.offset||ie.focusNode!==X.node||ie.focusOffset!==X.offset)){var J=ue.createRange();J.setStart(Q.node,Q.offset),ie.removeAllRanges(),xe>Xe?(ie.addRange(J),ie.extend(X.node,X.offset)):(J.setEnd(X.node,X.offset),ie.addRange(J))}}}}for(ue=[],ie=M;ie=ie.parentNode;)ie.nodeType===1&&ue.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<ue.length;M++){var re=ue[M];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}Ec=!!jd,Rd=jd=null}finally{$e=f,B.p=r,C.T=l}}t.current=i,xt=2}}function _y(){if(xt===2){xt=0;var t=is,i=Ba,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=C.T,C.T=null;var r=B.p;B.p=2;var f=$e;$e|=4;try{Pg(t,i.alternate,i)}finally{$e=f,B.p=r,C.T=l}}xt=3}}function Ay(){if(xt===4||xt===3){xt=0,_t();var t=is,i=Ba,l=Ti,r=dy;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?xt=5:(xt=0,Ba=is=null,Ty(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(ns=null),xs(l),i=i.stateNode,ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(It,i,void 0,(i.current.flags&128)===128)}catch{}if(r!==null){i=C.T,f=B.p,B.p=2,C.T=null;try{for(var m=t.onRecoverableError,b=0;b<r.length;b++){var M=r[b];m(M.value,{componentStack:M.stack})}}finally{C.T=i,B.p=f}}(Ti&3)!==0&&fc(),Pn(t),f=t.pendingLanes,(l&261930)!==0&&(f&42)!==0?t===wd?go++:(go=0,wd=t):go=0,yo(0)}}function Ty(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,Fl(i)))}function fc(){return Ny(),_y(),Ay(),Cy()}function Cy(){if(xt!==5)return!1;var t=is,i=bd;bd=0;var l=xs(Ti),r=C.T,f=B.p;try{B.p=32>l?32:l,C.T=null,l=Sd,Sd=null;var m=is,b=Ti;if(xt=0,Ba=is=null,Ti=0,($e&6)!==0)throw Error(a(331));var M=$e;if($e|=4,cy(m.current),ly(m,m.current,b,l),$e=M,yo(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(It,m)}catch{}return!0}finally{B.p=f,C.T=r,Ty(t,i)}}function My(t,i,l){i=Sn(l,i),i=Pf(t.stateNode,i,2),t=Fi(t,i,2),t!==null&&(zn(t,2),Pn(t))}function Ve(t,i,l){if(t.tag===3)My(t,t,l);else for(;i!==null;){if(i.tag===3){My(i,t,l);break}else if(i.tag===1){var r=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ns===null||!ns.has(r))){t=Sn(l,t),l=Og(2),r=Fi(i,l,2),r!==null&&(kg(l,r,i,t),zn(r,2),Pn(r));break}}i=i.return}}function Nd(t,i,l){var r=t.pingCache;if(r===null){r=t.pingCache=new Cx;var f=new Set;r.set(i,f)}else f=r.get(i),f===void 0&&(f=new Set,r.set(i,f));f.has(l)||(gd=!0,f.add(l),t=Dx.bind(null,t,i,l),i.then(t,t))}function Dx(t,i,l){var r=t.pingCache;r!==null&&r.delete(i),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,Ze===t&&(ze&l)===l&&(ct===4||ct===3&&(ze&62914560)===ze&&300>Ke()-ac?($e&2)===0&&La(t,0):yd|=l,Ra===ze&&(Ra=0)),Pn(t)}function Oy(t,i){i===0&&(i=Tt()),t=As(t,i),t!==null&&(zn(t,i),Pn(t))}function jx(t){var i=t.memoizedState,l=0;i!==null&&(l=i.retryLane),Oy(t,l)}function Rx(t,i){var l=0;switch(t.tag){case 31:case 13:var r=t.stateNode,f=t.memoizedState;f!==null&&(l=f.retryLane);break;case 19:r=t.stateNode;break;case 22:r=t.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(i),Oy(t,l)}function Bx(t,i){return wt(t,i)}var dc=null,Ha=null,_d=!1,hc=!1,Ad=!1,as=0;function Pn(t){t!==Ha&&t.next===null&&(Ha===null?dc=Ha=t:Ha=Ha.next=t),hc=!0,_d||(_d=!0,$x())}function yo(t,i){if(!Ad&&hc){Ad=!0;do for(var l=!1,r=dc;r!==null;){if(t!==0){var f=r.pendingLanes;if(f===0)var m=0;else{var b=r.suspendedLanes,M=r.pingedLanes;m=(1<<31-At(42|t)+1)-1,m&=f&~(b&~M),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(l=!0,jy(r,m))}else m=ze,m=ci(r,r===Ze?m:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(m&3)===0||Et(r,m)||(l=!0,jy(r,m));r=r.next}while(l);Ad=!1}}function Lx(){ky()}function ky(){hc=_d=!1;var t=0;as!==0&&Zx()&&(t=as);for(var i=Ke(),l=null,r=dc;r!==null;){var f=r.next,m=zy(r,i);m===0?(r.next=null,l===null?dc=f:l.next=f,f===null&&(Ha=l)):(l=r,(t!==0||(m&3)!==0)&&(hc=!0)),r=f}xt!==0&&xt!==5||yo(t),as!==0&&(as=0)}function zy(t,i){for(var l=t.suspendedLanes,r=t.pingedLanes,f=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var b=31-At(m),M=1<<b,q=f[b];q===-1?((M&l)===0||(M&r)!==0)&&(f[b]=ia(M,i)):q<=i&&(t.expiredLanes|=M),m&=~M}if(i=Ze,l=ze,l=ci(t,t===i?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r=t.callbackNode,l===0||t===i&&(qe===2||qe===9)||t.cancelPendingCommit!==null)return r!==null&&r!==null&&Dt(r),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||Et(t,l)){if(i=l&-l,i===t.callbackPriority)return i;switch(r!==null&&Dt(r),xs(l)){case 2:case 8:l=Lt;break;case 32:l=jt;break;case 268435456:l=mn;break;default:l=jt}return r=Dy.bind(null,t),l=wt(l,r),t.callbackPriority=i,t.callbackNode=l,i}return r!==null&&r!==null&&Dt(r),t.callbackPriority=2,t.callbackNode=null,2}function Dy(t,i){if(xt!==0&&xt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(fc()&&t.callbackNode!==l)return null;var r=ze;return r=ci(t,t===Ze?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r===0?null:(my(t,r,i),zy(t,Ke()),t.callbackNode!=null&&t.callbackNode===l?Dy.bind(null,t):null)}function jy(t,i){if(fc())return null;my(t,i,!0)}function $x(){Fx(function(){($e&6)!==0?wt(Ut,Lx):ky()})}function Td(){if(as===0){var t=Na;t===0&&(t=Zn,Zn<<=1,(Zn&261888)===0&&(Zn=256)),as=t}return as}function Ry(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:wr(""+t)}function By(t,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,t.id&&l.setAttribute("form",t.id),i.parentNode.insertBefore(l,i),t=new FormData(t),l.parentNode.removeChild(l),t}function Hx(t,i,l,r,f){if(i==="submit"&&l&&l.stateNode===f){var m=Ry((f[he]||null).action),b=r.submitter;b&&(i=(i=b[he]||null)?Ry(i.formAction):b.getAttribute("formAction"),i!==null&&(m=i,b=null));var M=new _r("action","action",null,r,f);t.push({event:M,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(as!==0){var q=b?By(f,b):new FormData(f);Kf(l,{pending:!0,data:q,method:f.method,action:m},null,q)}}else typeof m=="function"&&(M.preventDefault(),q=b?By(f,b):new FormData(f),Kf(l,{pending:!0,data:q,method:f.method,action:m},m,q))},currentTarget:f}]})}}for(var Cd=0;Cd<uf.length;Cd++){var Md=uf[Cd],Ux=Md.toLowerCase(),Ix=Md[0].toUpperCase()+Md.slice(1);jn(Ux,"on"+Ix)}jn(hp,"onAnimationEnd"),jn(mp,"onAnimationIteration"),jn(pp,"onAnimationStart"),jn("dblclick","onDoubleClick"),jn("focusin","onFocus"),jn("focusout","onBlur"),jn(ix,"onTransitionRun"),jn(sx,"onTransitionStart"),jn(ax,"onTransitionCancel"),jn(gp,"onTransitionEnd"),Ii("onMouseEnter",["mouseout","mouseover"]),Ii("onMouseLeave",["mouseout","mouseover"]),Ii("onPointerEnter",["pointerout","pointerover"]),Ii("onPointerLeave",["pointerout","pointerover"]),fi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fi("onBeforeInput",["compositionend","keypress","textInput","paste"]),fi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vo="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(" "),qx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vo));function Ly(t,i){i=(i&4)!==0;for(var l=0;l<t.length;l++){var r=t[l],f=r.event;r=r.listeners;e:{var m=void 0;if(i)for(var b=r.length-1;0<=b;b--){var M=r[b],q=M.instance,W=M.currentTarget;if(M=M.listener,q!==m&&f.isPropagationStopped())break e;m=M,f.currentTarget=W;try{m(f)}catch(oe){Cr(oe)}f.currentTarget=null,m=q}else for(b=0;b<r.length;b++){if(M=r[b],q=M.instance,W=M.currentTarget,M=M.listener,q!==m&&f.isPropagationStopped())break e;m=M,f.currentTarget=W;try{m(f)}catch(oe){Cr(oe)}f.currentTarget=null,m=q}}}}function ke(t,i){var l=i[Ie];l===void 0&&(l=i[Ie]=new Set);var r=t+"__bubble";l.has(r)||($y(i,t,2,!1),l.add(r))}function Od(t,i,l){var r=0;i&&(r|=4),$y(l,t,r,i)}var mc="_reactListening"+Math.random().toString(36).slice(2);function kd(t){if(!t[mc]){t[mc]=!0,gr.forEach(function(l){l!=="selectionchange"&&(qx.has(l)||Od(l,!1,t),Od(l,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[mc]||(i[mc]=!0,Od("selectionchange",!1,i))}}function $y(t,i,l,r){switch(h0(i)){case 2:var f=gE;break;case 8:f=yE;break;default:f=Xd}l=f.bind(null,i,l,t),f=void 0,!Fu||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(f=!0),r?f!==void 0?t.addEventListener(i,l,{capture:!0,passive:f}):t.addEventListener(i,l,!0):f!==void 0?t.addEventListener(i,l,{passive:f}):t.addEventListener(i,l,!1)}function zd(t,i,l,r,f){var m=r;if((i&1)===0&&(i&2)===0&&r!==null)e:for(;;){if(r===null)return;var b=r.tag;if(b===3||b===4){var M=r.stateNode.containerInfo;if(M===f)break;if(b===4)for(b=r.return;b!==null;){var q=b.tag;if((q===3||q===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;M!==null;){if(b=Li(M),b===null)return;if(q=b.tag,q===5||q===6||q===26||q===27){r=m=b;continue e}M=M.parentNode}}r=r.return}Vm(function(){var W=m,oe=Zu(l),ue=[];e:{var te=yp.get(t);if(te!==void 0){var ie=_r,ye=t;switch(t){case"keypress":if(Er(l)===0)break e;case"keydown":case"keyup":ie=Rw;break;case"focusin":ye="focus",ie=ef;break;case"focusout":ye="blur",ie=ef;break;case"beforeblur":case"afterblur":ie=ef;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":ie=Xm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=Ew;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=$w;break;case hp:case mp:case pp:ie=Aw;break;case gp:ie=Uw;break;case"scroll":case"scrollend":ie=ww;break;case"wheel":ie=qw;break;case"copy":case"cut":case"paste":ie=Cw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=Zm;break;case"toggle":case"beforetoggle":ie=Yw}var xe=(i&4)!==0,Xe=!xe&&(t==="scroll"||t==="scrollend"),Q=xe?te!==null?te+"Capture":null:te;xe=[];for(var X=W,J;X!==null;){var re=X;if(J=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||J===null||Q===null||(re=Hl(X,Q),re!=null&&xe.push(bo(X,re,J))),Xe)break;X=X.return}0<xe.length&&(te=new ie(te,ye,null,l,oe),ue.push({event:te,listeners:xe}))}}if((i&7)===0){e:{if(te=t==="mouseover"||t==="pointerover",ie=t==="mouseout"||t==="pointerout",te&&l!==Ku&&(ye=l.relatedTarget||l.fromElement)&&(Li(ye)||ye[Ne]))break e;if((ie||te)&&(te=oe.window===oe?oe:(te=oe.ownerDocument)?te.defaultView||te.parentWindow:window,ie?(ye=l.relatedTarget||l.toElement,ie=W,ye=ye?Li(ye):null,ye!==null&&(Xe=c(ye),xe=ye.tag,ye!==Xe||xe!==5&&xe!==27&&xe!==6)&&(ye=null)):(ie=null,ye=W),ie!==ye)){if(xe=Xm,re="onMouseLeave",Q="onMouseEnter",X="mouse",(t==="pointerout"||t==="pointerover")&&(xe=Zm,re="onPointerLeave",Q="onPointerEnter",X="pointer"),Xe=ie==null?te:Hi(ie),J=ye==null?te:Hi(ye),te=new xe(re,X+"leave",ie,l,oe),te.target=Xe,te.relatedTarget=J,re=null,Li(oe)===W&&(xe=new xe(Q,X+"enter",ye,l,oe),xe.target=J,xe.relatedTarget=Xe,re=xe),Xe=re,ie&&ye)t:{for(xe=Vx,Q=ie,X=ye,J=0,re=Q;re;re=xe(re))J++;re=0;for(var be=X;be;be=xe(be))re++;for(;0<J-re;)Q=xe(Q),J--;for(;0<re-J;)X=xe(X),re--;for(;J--;){if(Q===X||X!==null&&Q===X.alternate){xe=Q;break t}Q=xe(Q),X=xe(X)}xe=null}else xe=null;ie!==null&&Hy(ue,te,ie,xe,!1),ye!==null&&Xe!==null&&Hy(ue,Xe,ye,xe,!0)}}e:{if(te=W?Hi(W):window,ie=te.nodeName&&te.nodeName.toLowerCase(),ie==="select"||ie==="input"&&te.type==="file")var Be=np;else if(ep(te))if(ip)Be=ex;else{Be=Ww;var ve=Jw}else ie=te.nodeName,!ie||ie.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?W&&Xu(W.elementType)&&(Be=np):Be=Pw;if(Be&&(Be=Be(t,W))){tp(ue,Be,l,oe);break e}ve&&ve(t,te,W),t==="focusout"&&W&&te.type==="number"&&W.memoizedProps.value!=null&&Ll(te,"number",te.value)}switch(ve=W?Hi(W):window,t){case"focusin":(ep(ve)||ve.contentEditable==="true")&&(ga=ve,of=W,Kl=null);break;case"focusout":Kl=of=ga=null;break;case"mousedown":rf=!0;break;case"contextmenu":case"mouseup":case"dragend":rf=!1,fp(ue,l,oe);break;case"selectionchange":if(nx)break;case"keydown":case"keyup":fp(ue,l,oe)}var Me;if(nf)e:{switch(t){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else pa?Wm(t,l)&&(De="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(De="onCompositionStart");De&&(Qm&&l.locale!=="ko"&&(pa||De!=="onCompositionStart"?De==="onCompositionEnd"&&pa&&(Me=Ym()):(Vi=oe,Ju="value"in Vi?Vi.value:Vi.textContent,pa=!0)),ve=pc(W,De),0<ve.length&&(De=new Km(De,t,null,l,oe),ue.push({event:De,listeners:ve}),Me?De.data=Me:(Me=Pm(l),Me!==null&&(De.data=Me)))),(Me=Xw?Kw(t,l):Zw(t,l))&&(De=pc(W,"onBeforeInput"),0<De.length&&(ve=new Km("onBeforeInput","beforeinput",null,l,oe),ue.push({event:ve,listeners:De}),ve.data=Me)),Hx(ue,t,W,l,oe)}Ly(ue,i)})}function bo(t,i,l){return{instance:t,listener:i,currentTarget:l}}function pc(t,i){for(var l=i+"Capture",r=[];t!==null;){var f=t,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=Hl(t,l),f!=null&&r.unshift(bo(t,f,m)),f=Hl(t,i),f!=null&&r.push(bo(t,f,m))),t.tag===3)return r;t=t.return}return[]}function Vx(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Hy(t,i,l,r,f){for(var m=i._reactName,b=[];l!==null&&l!==r;){var M=l,q=M.alternate,W=M.stateNode;if(M=M.tag,q!==null&&q===r)break;M!==5&&M!==26&&M!==27||W===null||(q=W,f?(W=Hl(l,m),W!=null&&b.unshift(bo(l,W,q))):f||(W=Hl(l,m),W!=null&&b.push(bo(l,W,q)))),l=l.return}b.length!==0&&t.push({event:i,listeners:b})}var Yx=/\r\n?/g,Gx=/\u0000|\uFFFD/g;function Uy(t){return(typeof t=="string"?t:""+t).replace(Yx,`
9
+ `).replace(Gx,"")}function Iy(t,i){return i=Uy(i),Uy(t)===i}function Ge(t,i,l,r,f,m){switch(l){case"children":typeof r=="string"?i==="body"||i==="textarea"&&r===""||da(t,r):(typeof r=="number"||typeof r=="bigint")&&i!=="body"&&da(t,""+r);break;case"className":ca(t,"class",r);break;case"tabIndex":ca(t,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":ca(t,l,r);break;case"style":Im(t,r,m);break;case"data":if(i!=="object"){ca(t,"data",r);break}case"src":case"href":if(r===""&&(i!=="a"||l!=="href")){t.removeAttribute(l);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(l);break}r=wr(""+r),t.setAttribute(l,r);break;case"action":case"formAction":if(typeof r=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(l==="formAction"?(i!=="input"&&Ge(t,i,"name",f.name,f,null),Ge(t,i,"formEncType",f.formEncType,f,null),Ge(t,i,"formMethod",f.formMethod,f,null),Ge(t,i,"formTarget",f.formTarget,f,null)):(Ge(t,i,"encType",f.encType,f,null),Ge(t,i,"method",f.method,f,null),Ge(t,i,"target",f.target,f,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(l);break}r=wr(""+r),t.setAttribute(l,r);break;case"onClick":r!=null&&(t.onclick=di);break;case"onScroll":r!=null&&ke("scroll",t);break;case"onScrollEnd":r!=null&&ke("scrollend",t);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(a(61));if(l=r.__html,l!=null){if(f.children!=null)throw Error(a(60));t.innerHTML=l}}break;case"multiple":t.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":t.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){t.removeAttribute("xlink:href");break}l=wr(""+r),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(l,""+r):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":r===!0?t.setAttribute(l,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(l,r):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?t.setAttribute(l,r):t.removeAttribute(l);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?t.removeAttribute(l):t.setAttribute(l,r);break;case"popover":ke("beforetoggle",t),ke("toggle",t),ra(t,"popover",r);break;case"xlinkActuate":Dn(t,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Dn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Dn(t,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Dn(t,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Dn(t,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Dn(t,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Dn(t,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Dn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Dn(t,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":ra(t,"is",r);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=bw.get(l)||l,ra(t,l,r))}}function Dd(t,i,l,r,f,m){switch(l){case"style":Im(t,r,m);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(a(61));if(l=r.__html,l!=null){if(f.children!=null)throw Error(a(60));t.innerHTML=l}}break;case"children":typeof r=="string"?da(t,r):(typeof r=="number"||typeof r=="bigint")&&da(t,""+r);break;case"onScroll":r!=null&&ke("scroll",t);break;case"onScrollEnd":r!=null&&ke("scrollend",t);break;case"onClick":r!=null&&(t.onclick=di);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yr.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(f=l.endsWith("Capture"),i=l.slice(2,f?l.length-7:void 0),m=t[he]||null,m=m!=null?m[l]:null,typeof m=="function"&&t.removeEventListener(i,m,f),typeof r=="function")){typeof m!="function"&&m!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(i,r,f);break e}l in t?t[l]=r:r===!0?t.setAttribute(l,""):ra(t,l,r)}}}function kt(t,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ke("error",t),ke("load",t);var r=!1,f=!1,m;for(m in l)if(l.hasOwnProperty(m)){var b=l[m];if(b!=null)switch(m){case"src":r=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Ge(t,i,m,b,l,null)}}f&&Ge(t,i,"srcSet",l.srcSet,l,null),r&&Ge(t,i,"src",l.src,l,null);return;case"input":ke("invalid",t);var M=m=b=f=null,q=null,W=null;for(r in l)if(l.hasOwnProperty(r)){var oe=l[r];if(oe!=null)switch(r){case"name":f=oe;break;case"type":b=oe;break;case"checked":q=oe;break;case"defaultChecked":W=oe;break;case"value":m=oe;break;case"defaultValue":M=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(a(137,i));break;default:Ge(t,i,r,oe,l,null)}}fa(t,m,M,q,W,b,f,!1);return;case"select":ke("invalid",t),r=b=m=null;for(f in l)if(l.hasOwnProperty(f)&&(M=l[f],M!=null))switch(f){case"value":m=M;break;case"defaultValue":b=M;break;case"multiple":r=M;default:Ge(t,i,f,M,l,null)}i=m,l=b,t.multiple=!!r,i!=null?qi(t,!!r,i,!1):l!=null&&qi(t,!!r,l,!0);return;case"textarea":ke("invalid",t),m=f=r=null;for(b in l)if(l.hasOwnProperty(b)&&(M=l[b],M!=null))switch(b){case"value":r=M;break;case"defaultValue":f=M;break;case"children":m=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(a(91));break;default:Ge(t,i,b,M,l,null)}Hm(t,r,f,m);return;case"option":for(q in l)l.hasOwnProperty(q)&&(r=l[q],r!=null)&&(q==="selected"?t.selected=r&&typeof r!="function"&&typeof r!="symbol":Ge(t,i,q,r,l,null));return;case"dialog":ke("beforetoggle",t),ke("toggle",t),ke("cancel",t),ke("close",t);break;case"iframe":case"object":ke("load",t);break;case"video":case"audio":for(r=0;r<vo.length;r++)ke(vo[r],t);break;case"image":ke("error",t),ke("load",t);break;case"details":ke("toggle",t);break;case"embed":case"source":case"link":ke("error",t),ke("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in l)if(l.hasOwnProperty(W)&&(r=l[W],r!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Ge(t,i,W,r,l,null)}return;default:if(Xu(i)){for(oe in l)l.hasOwnProperty(oe)&&(r=l[oe],r!==void 0&&Dd(t,i,oe,r,l,void 0));return}}for(M in l)l.hasOwnProperty(M)&&(r=l[M],r!=null&&Ge(t,i,M,r,l,null))}function Xx(t,i,l,r){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,m=null,b=null,M=null,q=null,W=null,oe=null;for(ie in l){var ue=l[ie];if(l.hasOwnProperty(ie)&&ue!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":q=ue;default:r.hasOwnProperty(ie)||Ge(t,i,ie,null,r,ue)}}for(var te in r){var ie=r[te];if(ue=l[te],r.hasOwnProperty(te)&&(ie!=null||ue!=null))switch(te){case"type":m=ie;break;case"name":f=ie;break;case"checked":W=ie;break;case"defaultChecked":oe=ie;break;case"value":b=ie;break;case"defaultValue":M=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(a(137,i));break;default:ie!==ue&&Ge(t,i,te,ie,r,ue)}}Bl(t,b,M,q,W,oe,m,f);return;case"select":ie=b=M=te=null;for(m in l)if(q=l[m],l.hasOwnProperty(m)&&q!=null)switch(m){case"value":break;case"multiple":ie=q;default:r.hasOwnProperty(m)||Ge(t,i,m,null,r,q)}for(f in r)if(m=r[f],q=l[f],r.hasOwnProperty(f)&&(m!=null||q!=null))switch(f){case"value":te=m;break;case"defaultValue":M=m;break;case"multiple":b=m;default:m!==q&&Ge(t,i,f,m,r,q)}i=M,l=b,r=ie,te!=null?qi(t,!!l,te,!1):!!r!=!!l&&(i!=null?qi(t,!!l,i,!0):qi(t,!!l,l?[]:"",!1));return;case"textarea":ie=te=null;for(M in l)if(f=l[M],l.hasOwnProperty(M)&&f!=null&&!r.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:Ge(t,i,M,null,r,f)}for(b in r)if(f=r[b],m=l[b],r.hasOwnProperty(b)&&(f!=null||m!=null))switch(b){case"value":te=f;break;case"defaultValue":ie=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(a(91));break;default:f!==m&&Ge(t,i,b,f,r,m)}$l(t,te,ie);return;case"option":for(var ye in l)te=l[ye],l.hasOwnProperty(ye)&&te!=null&&!r.hasOwnProperty(ye)&&(ye==="selected"?t.selected=!1:Ge(t,i,ye,null,r,te));for(q in r)te=r[q],ie=l[q],r.hasOwnProperty(q)&&te!==ie&&(te!=null||ie!=null)&&(q==="selected"?t.selected=te&&typeof te!="function"&&typeof te!="symbol":Ge(t,i,q,te,r,ie));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var xe in l)te=l[xe],l.hasOwnProperty(xe)&&te!=null&&!r.hasOwnProperty(xe)&&Ge(t,i,xe,null,r,te);for(W in r)if(te=r[W],ie=l[W],r.hasOwnProperty(W)&&te!==ie&&(te!=null||ie!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(a(137,i));break;default:Ge(t,i,W,te,r,ie)}return;default:if(Xu(i)){for(var Xe in l)te=l[Xe],l.hasOwnProperty(Xe)&&te!==void 0&&!r.hasOwnProperty(Xe)&&Dd(t,i,Xe,void 0,r,te);for(oe in r)te=r[oe],ie=l[oe],!r.hasOwnProperty(oe)||te===ie||te===void 0&&ie===void 0||Dd(t,i,oe,te,r,ie);return}}for(var Q in l)te=l[Q],l.hasOwnProperty(Q)&&te!=null&&!r.hasOwnProperty(Q)&&Ge(t,i,Q,null,r,te);for(ue in r)te=r[ue],ie=l[ue],!r.hasOwnProperty(ue)||te===ie||te==null&&ie==null||Ge(t,i,ue,te,r,ie)}function qy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Kx(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,l=performance.getEntriesByType("resource"),r=0;r<l.length;r++){var f=l[r],m=f.transferSize,b=f.initiatorType,M=f.duration;if(m&&M&&qy(b)){for(b=0,M=f.responseEnd,r+=1;r<l.length;r++){var q=l[r],W=q.startTime;if(W>M)break;var oe=q.transferSize,ue=q.initiatorType;oe&&qy(ue)&&(q=q.responseEnd,b+=oe*(q<M?1:(M-W)/(q-W)))}if(--r,i+=8*(m+b)/(f.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var jd=null,Rd=null;function gc(t){return t.nodeType===9?t:t.ownerDocument}function Vy(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Yy(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function Bd(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Ld=null;function Zx(){var t=window.event;return t&&t.type==="popstate"?t===Ld?!1:(Ld=t,!0):(Ld=null,!1)}var Gy=typeof setTimeout=="function"?setTimeout:void 0,Qx=typeof clearTimeout=="function"?clearTimeout:void 0,Xy=typeof Promise=="function"?Promise:void 0,Fx=typeof queueMicrotask=="function"?queueMicrotask:typeof Xy<"u"?function(t){return Xy.resolve(null).then(t).catch(Jx)}:Gy;function Jx(t){setTimeout(function(){throw t})}function ls(t){return t==="head"}function Ky(t,i){var l=i,r=0;do{var f=l.nextSibling;if(t.removeChild(l),f&&f.nodeType===8)if(l=f.data,l==="/$"||l==="/&"){if(r===0){t.removeChild(f),Va(i);return}r--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")r++;else if(l==="html")So(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,So(l);for(var m=l.firstChild;m;){var b=m.nextSibling,M=m.nodeName;m[vn]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&m.rel.toLowerCase()==="stylesheet"||l.removeChild(m),m=b}}else l==="body"&&So(t.ownerDocument.body);l=f}while(l);Va(i)}function Zy(t,i){var l=t;t=0;do{var r=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),r&&r.nodeType===8)if(l=r.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=r}while(l)}function $d(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":$d(l),zl(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function Wx(t,i,l,r){for(;t.nodeType===1;){var f=l;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!r&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(r){if(!t[vn])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(m=t.getAttribute("rel"),m==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(m!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(m=t.getAttribute("src"),(m!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===m)return t}else return t;if(t=_n(t.nextSibling),t===null)break}return null}function Px(t,i,l){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=_n(t.nextSibling),t===null))return null;return t}function Qy(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=_n(t.nextSibling),t===null))return null;return t}function Hd(t){return t.data==="$?"||t.data==="$~"}function Ud(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function eE(t,i){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||l.readyState!=="loading")i();else{var r=function(){i(),l.removeEventListener("DOMContentLoaded",r)};l.addEventListener("DOMContentLoaded",r),t._reactRetry=r}}function _n(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var Id=null;function Fy(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(i===0)return _n(t.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}t=t.nextSibling}return null}function Jy(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return t;i--}else l!=="/$"&&l!=="/&"||i++}t=t.previousSibling}return null}function Wy(t,i,l){switch(i=gc(l),t){case"html":if(t=i.documentElement,!t)throw Error(a(452));return t;case"head":if(t=i.head,!t)throw Error(a(453));return t;case"body":if(t=i.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function So(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zl(t)}var An=new Map,Py=new Set;function yc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ci=B.d;B.d={f:tE,r:nE,D:iE,C:sE,L:aE,m:lE,X:rE,S:oE,M:cE};function tE(){var t=Ci.f(),i=rc();return t||i}function nE(t){var i=$i(t);i!==null&&i.tag===5&&i.type==="form"?gg(i):Ci.r(t)}var Ua=typeof document>"u"?null:document;function e0(t,i,l){var r=Ua;if(r&&typeof i=="string"&&i){var f=Yt(i);f='link[rel="'+t+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),Py.has(f)||(Py.add(f),t={rel:t,crossOrigin:l,href:i},r.querySelector(f)===null&&(i=r.createElement("link"),kt(i,"link",t),pt(i),r.head.appendChild(i)))}}function iE(t){Ci.D(t),e0("dns-prefetch",t,null)}function sE(t,i){Ci.C(t,i),e0("preconnect",t,i)}function aE(t,i,l){Ci.L(t,i,l);var r=Ua;if(r&&t&&i){var f='link[rel="preload"][as="'+Yt(i)+'"]';i==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+Yt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+Yt(l.imageSizes)+'"]')):f+='[href="'+Yt(t)+'"]';var m=f;switch(i){case"style":m=Ia(t);break;case"script":m=qa(t)}An.has(m)||(t=g({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:t,as:i},l),An.set(m,t),r.querySelector(f)!==null||i==="style"&&r.querySelector(wo(m))||i==="script"&&r.querySelector(xo(m))||(i=r.createElement("link"),kt(i,"link",t),pt(i),r.head.appendChild(i)))}}function lE(t,i){Ci.m(t,i);var l=Ua;if(l&&t){var r=i&&typeof i.as=="string"?i.as:"script",f='link[rel="modulepreload"][as="'+Yt(r)+'"][href="'+Yt(t)+'"]',m=f;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=qa(t)}if(!An.has(m)&&(t=g({rel:"modulepreload",href:t},i),An.set(m,t),l.querySelector(f)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(xo(m)))return}r=l.createElement("link"),kt(r,"link",t),pt(r),l.head.appendChild(r)}}}function oE(t,i,l){Ci.S(t,i,l);var r=Ua;if(r&&t){var f=Ui(r).hoistableStyles,m=Ia(t);i=i||"default";var b=f.get(m);if(!b){var M={loading:0,preload:null};if(b=r.querySelector(wo(m)))M.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":i},l),(l=An.get(m))&&qd(t,l);var q=b=r.createElement("link");pt(q),kt(q,"link",t),q._p=new Promise(function(W,oe){q.onload=W,q.onerror=oe}),q.addEventListener("load",function(){M.loading|=1}),q.addEventListener("error",function(){M.loading|=2}),M.loading|=4,vc(b,i,r)}b={type:"stylesheet",instance:b,count:1,state:M},f.set(m,b)}}}function rE(t,i){Ci.X(t,i);var l=Ua;if(l&&t){var r=Ui(l).hoistableScripts,f=qa(t),m=r.get(f);m||(m=l.querySelector(xo(f)),m||(t=g({src:t,async:!0},i),(i=An.get(f))&&Vd(t,i),m=l.createElement("script"),pt(m),kt(m,"link",t),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},r.set(f,m))}}function cE(t,i){Ci.M(t,i);var l=Ua;if(l&&t){var r=Ui(l).hoistableScripts,f=qa(t),m=r.get(f);m||(m=l.querySelector(xo(f)),m||(t=g({src:t,async:!0,type:"module"},i),(i=An.get(f))&&Vd(t,i),m=l.createElement("script"),pt(m),kt(m,"link",t),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},r.set(f,m))}}function t0(t,i,l,r){var f=(f=de.current)?yc(f):null;if(!f)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=Ia(l.href),l=Ui(f).hoistableStyles,r=l.get(i),r||(r={type:"style",instance:null,count:0,state:null},l.set(i,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=Ia(l.href);var m=Ui(f).hoistableStyles,b=m.get(t);if(b||(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,b),(m=f.querySelector(wo(t)))&&!m._p&&(b.instance=m,b.state.loading=5),An.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},An.set(t,l),m||uE(f,t,l,b.state))),i&&r===null)throw Error(a(528,""));return b}if(i&&r!==null)throw Error(a(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=qa(l),l=Ui(f).hoistableScripts,r=l.get(i),r||(r={type:"script",instance:null,count:0,state:null},l.set(i,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function Ia(t){return'href="'+Yt(t)+'"'}function wo(t){return'link[rel="stylesheet"]['+t+"]"}function n0(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function uE(t,i,l,r){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?r.loading=1:(i=t.createElement("link"),r.preload=i,i.addEventListener("load",function(){return r.loading|=1}),i.addEventListener("error",function(){return r.loading|=2}),kt(i,"link",l),pt(i),t.head.appendChild(i))}function qa(t){return'[src="'+Yt(t)+'"]'}function xo(t){return"script[async]"+t}function i0(t,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var r=t.querySelector('style[data-href~="'+Yt(l.href)+'"]');if(r)return i.instance=r,pt(r),r;var f=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return r=(t.ownerDocument||t).createElement("style"),pt(r),kt(r,"style",f),vc(r,l.precedence,t),i.instance=r;case"stylesheet":f=Ia(l.href);var m=t.querySelector(wo(f));if(m)return i.state.loading|=4,i.instance=m,pt(m),m;r=n0(l),(f=An.get(f))&&qd(r,f),m=(t.ownerDocument||t).createElement("link"),pt(m);var b=m;return b._p=new Promise(function(M,q){b.onload=M,b.onerror=q}),kt(m,"link",r),i.state.loading|=4,vc(m,l.precedence,t),i.instance=m;case"script":return m=qa(l.src),(f=t.querySelector(xo(m)))?(i.instance=f,pt(f),f):(r=l,(f=An.get(m))&&(r=g({},l),Vd(r,f)),t=t.ownerDocument||t,f=t.createElement("script"),pt(f),kt(f,"link",r),t.head.appendChild(f),i.instance=f);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(r=i.instance,i.state.loading|=4,vc(r,l.precedence,t));return i.instance}function vc(t,i,l){for(var r=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=r.length?r[r.length-1]:null,m=f,b=0;b<r.length;b++){var M=r[b];if(M.dataset.precedence===i)m=M;else if(m!==f)break}m?m.parentNode.insertBefore(t,m.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(t,i.firstChild))}function qd(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function Vd(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var bc=null;function s0(t,i,l){if(bc===null){var r=new Map,f=bc=new Map;f.set(l,r)}else f=bc,r=f.get(l),r||(r=new Map,f.set(l,r));if(r.has(t))return r;for(r.set(t,null),l=l.getElementsByTagName(t),f=0;f<l.length;f++){var m=l[f];if(!(m[vn]||m[F]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var b=m.getAttribute(i)||"";b=t+b;var M=r.get(b);M?M.push(m):r.set(b,[m])}}return r}function a0(t,i,l){t=t.ownerDocument||t,t.head.insertBefore(l,i==="title"?t.querySelector("head > title"):null)}function fE(t,i,l){if(l===1||i.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(t=i.disabled,typeof i.precedence=="string"&&t==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function l0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function dE(t,i,l,r){if(l.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var f=Ia(r.href),m=i.querySelector(wo(f));if(m){i=m._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=Sc.bind(t),i.then(t,t)),l.state.loading|=4,l.instance=m,pt(m);return}m=i.ownerDocument||i,r=n0(r),(f=An.get(f))&&qd(r,f),m=m.createElement("link"),pt(m);var b=m;b._p=new Promise(function(M,q){b.onload=M,b.onerror=q}),kt(m,"link",r),l.instance=m}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Sc.bind(t),i.addEventListener("load",l),i.addEventListener("error",l))}}var Yd=0;function hE(t,i){return t.stylesheets&&t.count===0&&xc(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var r=setTimeout(function(){if(t.stylesheets&&xc(t,t.stylesheets),t.unsuspend){var m=t.unsuspend;t.unsuspend=null,m()}},6e4+i);0<t.imgBytes&&Yd===0&&(Yd=62500*Kx());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&xc(t,t.stylesheets),t.unsuspend)){var m=t.unsuspend;t.unsuspend=null,m()}},(t.imgBytes>Yd?50:800)+i);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(r),clearTimeout(f)}}:null}function Sc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var wc=null;function xc(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,wc=new Map,i.forEach(mE,t),wc=null,Sc.call(t))}function mE(t,i){if(!(i.state.loading&4)){var l=wc.get(t);if(l)var r=l.get(null);else{l=new Map,wc.set(t,l);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var b=f[m];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(l.set(b.dataset.precedence,b),r=b)}r&&l.set(null,r)}f=i.instance,b=f.getAttribute("data-precedence"),m=l.get(b)||r,m===r&&l.set(null,f),l.set(b,f),this.count++,r=Sc.bind(this),f.addEventListener("load",r),f.addEventListener("error",r),m?m.parentNode.insertBefore(f,m.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),i.state.loading|=4}}var Eo={$$typeof:_,Provider:null,Consumer:null,_currentValue:R,_currentValue2:R,_threadCount:0};function pE(t,i,l,r,f,m,b,M,q){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ui(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ui(0),this.hiddenUpdates=ui(null),this.identifierPrefix=r,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function o0(t,i,l,r,f,m,b,M,q,W,oe,ue){return t=new pE(t,i,l,b,q,W,oe,ue,M),i=1,m===!0&&(i|=24),m=nn(3,null,null,i),t.current=m,m.stateNode=t,i=Ef(),i.refCount++,t.pooledCache=i,i.refCount++,m.memoizedState={element:r,isDehydrated:l,cache:i},Tf(m),t}function r0(t){return t?(t=ba,t):ba}function c0(t,i,l,r,f,m){f=r0(f),r.context===null?r.context=f:r.pendingContext=f,r=Qi(i),r.payload={element:l},m=m===void 0?null:m,m!==null&&(r.callback=m),l=Fi(t,r,i),l!==null&&(Ft(l,t,i),eo(l,t,i))}function u0(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<i?l:i}}function Gd(t,i){u0(t,i),(t=t.alternate)&&u0(t,i)}function f0(t){if(t.tag===13||t.tag===31){var i=As(t,67108864);i!==null&&Ft(i,t,67108864),Gd(t,67108864)}}function d0(t){if(t.tag===13||t.tag===31){var i=rn();i=ws(i);var l=As(t,i);l!==null&&Ft(l,t,i),Gd(t,i)}}var Ec=!0;function gE(t,i,l,r){var f=C.T;C.T=null;var m=B.p;try{B.p=2,Xd(t,i,l,r)}finally{B.p=m,C.T=f}}function yE(t,i,l,r){var f=C.T;C.T=null;var m=B.p;try{B.p=8,Xd(t,i,l,r)}finally{B.p=m,C.T=f}}function Xd(t,i,l,r){if(Ec){var f=Kd(r);if(f===null)zd(t,i,r,Nc,l),m0(t,r);else if(bE(f,t,i,l,r))r.stopPropagation();else if(m0(t,r),i&4&&-1<vE.indexOf(t)){for(;f!==null;){var m=$i(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=qt(m.pendingLanes);if(b!==0){var M=m;for(M.pendingLanes|=2,M.entangledLanes|=2;b;){var q=1<<31-At(b);M.entanglements[1]|=q,b&=~q}Pn(m),($e&6)===0&&(lc=Ke()+500,yo(0))}}break;case 31:case 13:M=As(m,2),M!==null&&Ft(M,m,2),rc(),Gd(m,2)}if(m=Kd(r),m===null&&zd(t,i,r,Nc,l),m===f)break;f=m}f!==null&&r.stopPropagation()}else zd(t,i,r,null,l)}}function Kd(t){return t=Zu(t),Zd(t)}var Nc=null;function Zd(t){if(Nc=null,t=Li(t),t!==null){var i=c(t);if(i===null)t=null;else{var l=i.tag;if(l===13){if(t=u(i),t!==null)return t;t=null}else if(l===31){if(t=d(i),t!==null)return t;t=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return Nc=t,null}function h0(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ut()){case Ut:return 2;case Lt:return 8;case jt:case hn:return 32;case mn:return 268435456;default:return 32}default:return 32}}var Qd=!1,os=null,rs=null,cs=null,No=new Map,_o=new Map,us=[],vE="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 m0(t,i){switch(t){case"focusin":case"focusout":os=null;break;case"dragenter":case"dragleave":rs=null;break;case"mouseover":case"mouseout":cs=null;break;case"pointerover":case"pointerout":No.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":_o.delete(i.pointerId)}}function Ao(t,i,l,r,f,m){return t===null||t.nativeEvent!==m?(t={blockedOn:i,domEventName:l,eventSystemFlags:r,nativeEvent:m,targetContainers:[f]},i!==null&&(i=$i(i),i!==null&&f0(i)),t):(t.eventSystemFlags|=r,i=t.targetContainers,f!==null&&i.indexOf(f)===-1&&i.push(f),t)}function bE(t,i,l,r,f){switch(i){case"focusin":return os=Ao(os,t,i,l,r,f),!0;case"dragenter":return rs=Ao(rs,t,i,l,r,f),!0;case"mouseover":return cs=Ao(cs,t,i,l,r,f),!0;case"pointerover":var m=f.pointerId;return No.set(m,Ao(No.get(m)||null,t,i,l,r,f)),!0;case"gotpointercapture":return m=f.pointerId,_o.set(m,Ao(_o.get(m)||null,t,i,l,r,f)),!0}return!1}function p0(t){var i=Li(t.target);if(i!==null){var l=c(i);if(l!==null){if(i=l.tag,i===13){if(i=u(l),i!==null){t.blockedOn=i,oa(t.priority,function(){d0(l)});return}}else if(i===31){if(i=d(l),i!==null){t.blockedOn=i,oa(t.priority,function(){d0(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function _c(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var l=Kd(t.nativeEvent);if(l===null){l=t.nativeEvent;var r=new l.constructor(l.type,l);Ku=r,l.target.dispatchEvent(r),Ku=null}else return i=$i(l),i!==null&&f0(i),t.blockedOn=l,!1;i.shift()}return!0}function g0(t,i,l){_c(t)&&l.delete(i)}function SE(){Qd=!1,os!==null&&_c(os)&&(os=null),rs!==null&&_c(rs)&&(rs=null),cs!==null&&_c(cs)&&(cs=null),No.forEach(g0),_o.forEach(g0)}function Ac(t,i){t.blockedOn===i&&(t.blockedOn=null,Qd||(Qd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,SE)))}var Tc=null;function y0(t){Tc!==t&&(Tc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Tc===t&&(Tc=null);for(var i=0;i<t.length;i+=3){var l=t[i],r=t[i+1],f=t[i+2];if(typeof r!="function"){if(Zd(r||l)===null)continue;break}var m=$i(l);m!==null&&(t.splice(i,3),i-=3,Kf(m,{pending:!0,data:f,method:l.method,action:r},r,f))}}))}function Va(t){function i(q){return Ac(q,t)}os!==null&&Ac(os,t),rs!==null&&Ac(rs,t),cs!==null&&Ac(cs,t),No.forEach(i),_o.forEach(i);for(var l=0;l<us.length;l++){var r=us[l];r.blockedOn===t&&(r.blockedOn=null)}for(;0<us.length&&(l=us[0],l.blockedOn===null);)p0(l),l.blockedOn===null&&us.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(r=0;r<l.length;r+=3){var f=l[r],m=l[r+1],b=f[he]||null;if(typeof m=="function")b||y0(l);else if(b){var M=null;if(m&&m.hasAttribute("formAction")){if(f=m,b=m[he]||null)M=b.formAction;else if(Zd(f)!==null)continue}else M=b.action;typeof M=="function"?l[r+1]=M:(l.splice(r,3),r-=3),y0(l)}}}function v0(){function t(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(b){return f=b})},focusReset:"manual",scroll:"manual"})}function i(){f!==null&&(f(),f=null),r||setTimeout(l,20)}function l(){if(!r&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){r=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),f!==null&&(f(),f=null)}}}function Fd(t){this._internalRoot=t}Cc.prototype.render=Fd.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(a(409));var l=i.current,r=rn();c0(l,r,t,i,null,null)},Cc.prototype.unmount=Fd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;c0(t.current,2,null,t,null,null),rc(),i[Ne]=null}};function Cc(t){this._internalRoot=t}Cc.prototype.unstable_scheduleHydration=function(t){if(t){var i=la();t={blockedOn:null,target:t,priority:i};for(var l=0;l<us.length&&i!==0&&i<us[l].priority;l++);us.splice(l,0,t),l===0&&p0(t)}};var b0=n.version;if(b0!=="19.2.7")throw Error(a(527,b0,"19.2.7"));B.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=p(i),t=t!==null?v(t):null,t=t===null?null:t.stateNode,t};var wE={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Mc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mc.isDisabled&&Mc.supportsFiber)try{It=Mc.inject(wE),ht=Mc}catch{}}return Co.createRoot=function(t,i){if(!o(t))throw Error(a(299));var l=!1,r="",f=Ag,m=Tg,b=Cg;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(r=i.identifierPrefix),i.onUncaughtError!==void 0&&(f=i.onUncaughtError),i.onCaughtError!==void 0&&(m=i.onCaughtError),i.onRecoverableError!==void 0&&(b=i.onRecoverableError)),i=o0(t,1,!1,null,null,l,r,null,f,m,b,v0),t[Ne]=i.current,kd(t),new Fd(i)},Co.hydrateRoot=function(t,i,l){if(!o(t))throw Error(a(299));var r=!1,f="",m=Ag,b=Tg,M=Cg,q=null;return l!=null&&(l.unstable_strictMode===!0&&(r=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(m=l.onUncaughtError),l.onCaughtError!==void 0&&(b=l.onCaughtError),l.onRecoverableError!==void 0&&(M=l.onRecoverableError),l.formState!==void 0&&(q=l.formState)),i=o0(t,1,!0,i,l??null,r,f,q,m,b,M,v0),i.context=r0(null),l=i.current,r=rn(),r=ws(r),f=Qi(r),f.callback=null,Fi(l,f,r),l=r,i.current.lanes=l,zn(i,l),Pn(i),t[Ne]=i.current,kd(t),new Cc(i)},Co.version="19.2.7",Co}var M0;function OE(){if(M0)return Pd.exports;M0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Pd.exports=ME(),Pd.exports}var kE=OE();function St(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let s=0,a;s<e.length;s++)(a=St(e[s]))!==""&&(n+=(n&&" ")+a);else for(let s in e)e[s]&&(n+=(n&&" ")+s);return n}var zE={value:()=>{}};function vu(){for(var e=0,n=arguments.length,s={},a;e<n;++e){if(!(a=arguments[e]+"")||a in s||/[\s.]/.test(a))throw new Error("illegal type: "+a);s[a]=[]}return new Gc(s)}function Gc(e){this._=e}function DE(e,n){return e.trim().split(/^|\s+/).map(function(s){var a="",o=s.indexOf(".");if(o>=0&&(a=s.slice(o+1),s=s.slice(0,o)),s&&!n.hasOwnProperty(s))throw new Error("unknown type: "+s);return{type:s,name:a}})}Gc.prototype=vu.prototype={constructor:Gc,on:function(e,n){var s=this._,a=DE(e+"",s),o,c=-1,u=a.length;if(arguments.length<2){for(;++c<u;)if((o=(e=a[c]).type)&&(o=jE(s[o],e.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++c<u;)if(o=(e=a[c]).type)s[o]=O0(s[o],e.name,n);else if(n==null)for(o in s)s[o]=O0(s[o],e.name,null);return this},copy:function(){var e={},n=this._;for(var s in n)e[s]=n[s].slice();return new Gc(e)},call:function(e,n){if((o=arguments.length-2)>0)for(var s=new Array(o),a=0,o,c;a<o;++a)s[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(c=this._[e],a=0,o=c.length;a<o;++a)c[a].value.apply(n,s)},apply:function(e,n,s){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var a=this._[e],o=0,c=a.length;o<c;++o)a[o].value.apply(n,s)}};function jE(e,n){for(var s=0,a=e.length,o;s<a;++s)if((o=e[s]).name===n)return o.value}function O0(e,n,s){for(var a=0,o=e.length;a<o;++a)if(e[a].name===n){e[a]=zE,e=e.slice(0,a).concat(e.slice(a+1));break}return s!=null&&e.push({name:n,value:s}),e}var Ch="http://www.w3.org/1999/xhtml";const k0={svg:"http://www.w3.org/2000/svg",xhtml:Ch,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function bu(e){var n=e+="",s=n.indexOf(":");return s>=0&&(n=e.slice(0,s))!=="xmlns"&&(e=e.slice(s+1)),k0.hasOwnProperty(n)?{space:k0[n],local:e}:e}function RE(e){return function(){var n=this.ownerDocument,s=this.namespaceURI;return s===Ch&&n.documentElement.namespaceURI===Ch?n.createElement(e):n.createElementNS(s,e)}}function BE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mb(e){var n=bu(e);return(n.local?BE:RE)(n)}function LE(){}function tm(e){return e==null?LE:function(){return this.querySelector(e)}}function $E(e){typeof e!="function"&&(e=tm(e));for(var n=this._groups,s=n.length,a=new Array(s),o=0;o<s;++o)for(var c=n[o],u=c.length,d=a[o]=new Array(u),h,p,v=0;v<u;++v)(h=c[v])&&(p=e.call(h,h.__data__,v,c))&&("__data__"in h&&(p.__data__=h.__data__),d[v]=p);return new dn(a,this._parents)}function HE(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function UE(){return[]}function pb(e){return e==null?UE:function(){return this.querySelectorAll(e)}}function IE(e){return function(){return HE(e.apply(this,arguments))}}function qE(e){typeof e=="function"?e=IE(e):e=pb(e);for(var n=this._groups,s=n.length,a=[],o=[],c=0;c<s;++c)for(var u=n[c],d=u.length,h,p=0;p<d;++p)(h=u[p])&&(a.push(e.call(h,h.__data__,p,u)),o.push(h));return new dn(a,o)}function gb(e){return function(){return this.matches(e)}}function yb(e){return function(n){return n.matches(e)}}var VE=Array.prototype.find;function YE(e){return function(){return VE.call(this.children,e)}}function GE(){return this.firstElementChild}function XE(e){return this.select(e==null?GE:YE(typeof e=="function"?e:yb(e)))}var KE=Array.prototype.filter;function ZE(){return Array.from(this.children)}function QE(e){return function(){return KE.call(this.children,e)}}function FE(e){return this.selectAll(e==null?ZE:QE(typeof e=="function"?e:yb(e)))}function JE(e){typeof e!="function"&&(e=gb(e));for(var n=this._groups,s=n.length,a=new Array(s),o=0;o<s;++o)for(var c=n[o],u=c.length,d=a[o]=[],h,p=0;p<u;++p)(h=c[p])&&e.call(h,h.__data__,p,c)&&d.push(h);return new dn(a,this._parents)}function vb(e){return new Array(e.length)}function WE(){return new dn(this._enter||this._groups.map(vb),this._parents)}function iu(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}iu.prototype={constructor:iu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function PE(e){return function(){return e}}function eN(e,n,s,a,o,c){for(var u=0,d,h=n.length,p=c.length;u<p;++u)(d=n[u])?(d.__data__=c[u],a[u]=d):s[u]=new iu(e,c[u]);for(;u<h;++u)(d=n[u])&&(o[u]=d)}function tN(e,n,s,a,o,c,u){var d,h,p=new Map,v=n.length,g=c.length,y=new Array(v),w;for(d=0;d<v;++d)(h=n[d])&&(y[d]=w=u.call(h,h.__data__,d,n)+"",p.has(w)?o[d]=h:p.set(w,h));for(d=0;d<g;++d)w=u.call(e,c[d],d,c)+"",(h=p.get(w))?(a[d]=h,h.__data__=c[d],p.delete(w)):s[d]=new iu(e,c[d]);for(d=0;d<v;++d)(h=n[d])&&p.get(y[d])===h&&(o[d]=h)}function nN(e){return e.__data__}function iN(e,n){if(!arguments.length)return Array.from(this,nN);var s=n?tN:eN,a=this._parents,o=this._groups;typeof e!="function"&&(e=PE(e));for(var c=o.length,u=new Array(c),d=new Array(c),h=new Array(c),p=0;p<c;++p){var v=a[p],g=o[p],y=g.length,w=sN(e.call(v,v&&v.__data__,p,a)),x=w.length,E=d[p]=new Array(x),A=u[p]=new Array(x),T=h[p]=new Array(y);s(v,g,E,A,T,w,n);for(var z=0,_=0,N,j;z<x;++z)if(N=E[z]){for(z>=_&&(_=z+1);!(j=A[_])&&++_<x;);N._next=j||null}}return u=new dn(u,a),u._enter=d,u._exit=h,u}function sN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function aN(){return new dn(this._exit||this._groups.map(vb),this._parents)}function lN(e,n,s){var a=this.enter(),o=this,c=this.exit();return typeof e=="function"?(a=e(a),a&&(a=a.selection())):a=a.append(e+""),n!=null&&(o=n(o),o&&(o=o.selection())),s==null?c.remove():s(c),a&&o?a.merge(o).order():o}function oN(e){for(var n=e.selection?e.selection():e,s=this._groups,a=n._groups,o=s.length,c=a.length,u=Math.min(o,c),d=new Array(o),h=0;h<u;++h)for(var p=s[h],v=a[h],g=p.length,y=d[h]=new Array(g),w,x=0;x<g;++x)(w=p[x]||v[x])&&(y[x]=w);for(;h<o;++h)d[h]=s[h];return new dn(d,this._parents)}function rN(){for(var e=this._groups,n=-1,s=e.length;++n<s;)for(var a=e[n],o=a.length-1,c=a[o],u;--o>=0;)(u=a[o])&&(c&&u.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(u,c),c=u);return this}function cN(e){e||(e=uN);function n(g,y){return g&&y?e(g.__data__,y.__data__):!g-!y}for(var s=this._groups,a=s.length,o=new Array(a),c=0;c<a;++c){for(var u=s[c],d=u.length,h=o[c]=new Array(d),p,v=0;v<d;++v)(p=u[v])&&(h[v]=p);h.sort(n)}return new dn(o,this._parents).order()}function uN(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function fN(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function dN(){return Array.from(this)}function hN(){for(var e=this._groups,n=0,s=e.length;n<s;++n)for(var a=e[n],o=0,c=a.length;o<c;++o){var u=a[o];if(u)return u}return null}function mN(){let e=0;for(const n of this)++e;return e}function pN(){return!this.node()}function gN(e){for(var n=this._groups,s=0,a=n.length;s<a;++s)for(var o=n[s],c=0,u=o.length,d;c<u;++c)(d=o[c])&&e.call(d,d.__data__,c,o);return this}function yN(e){return function(){this.removeAttribute(e)}}function vN(e){return function(){this.removeAttributeNS(e.space,e.local)}}function bN(e,n){return function(){this.setAttribute(e,n)}}function SN(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function wN(e,n){return function(){var s=n.apply(this,arguments);s==null?this.removeAttribute(e):this.setAttribute(e,s)}}function xN(e,n){return function(){var s=n.apply(this,arguments);s==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,s)}}function EN(e,n){var s=bu(e);if(arguments.length<2){var a=this.node();return s.local?a.getAttributeNS(s.space,s.local):a.getAttribute(s)}return this.each((n==null?s.local?vN:yN:typeof n=="function"?s.local?xN:wN:s.local?SN:bN)(s,n))}function bb(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function NN(e){return function(){this.style.removeProperty(e)}}function _N(e,n,s){return function(){this.style.setProperty(e,n,s)}}function AN(e,n,s){return function(){var a=n.apply(this,arguments);a==null?this.style.removeProperty(e):this.style.setProperty(e,a,s)}}function TN(e,n,s){return arguments.length>1?this.each((n==null?NN:typeof n=="function"?AN:_N)(e,n,s??"")):ul(this.node(),e)}function ul(e,n){return e.style.getPropertyValue(n)||bb(e).getComputedStyle(e,null).getPropertyValue(n)}function CN(e){return function(){delete this[e]}}function MN(e,n){return function(){this[e]=n}}function ON(e,n){return function(){var s=n.apply(this,arguments);s==null?delete this[e]:this[e]=s}}function kN(e,n){return arguments.length>1?this.each((n==null?CN:typeof n=="function"?ON:MN)(e,n)):this.node()[e]}function Sb(e){return e.trim().split(/^|\s+/)}function nm(e){return e.classList||new wb(e)}function wb(e){this._node=e,this._names=Sb(e.getAttribute("class")||"")}wb.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function xb(e,n){for(var s=nm(e),a=-1,o=n.length;++a<o;)s.add(n[a])}function Eb(e,n){for(var s=nm(e),a=-1,o=n.length;++a<o;)s.remove(n[a])}function zN(e){return function(){xb(this,e)}}function DN(e){return function(){Eb(this,e)}}function jN(e,n){return function(){(n.apply(this,arguments)?xb:Eb)(this,e)}}function RN(e,n){var s=Sb(e+"");if(arguments.length<2){for(var a=nm(this.node()),o=-1,c=s.length;++o<c;)if(!a.contains(s[o]))return!1;return!0}return this.each((typeof n=="function"?jN:n?zN:DN)(s,n))}function BN(){this.textContent=""}function LN(e){return function(){this.textContent=e}}function $N(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function HN(e){return arguments.length?this.each(e==null?BN:(typeof e=="function"?$N:LN)(e)):this.node().textContent}function UN(){this.innerHTML=""}function IN(e){return function(){this.innerHTML=e}}function qN(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function VN(e){return arguments.length?this.each(e==null?UN:(typeof e=="function"?qN:IN)(e)):this.node().innerHTML}function YN(){this.nextSibling&&this.parentNode.appendChild(this)}function GN(){return this.each(YN)}function XN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function KN(){return this.each(XN)}function ZN(e){var n=typeof e=="function"?e:mb(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function QN(){return null}function FN(e,n){var s=typeof e=="function"?e:mb(e),a=n==null?QN:typeof n=="function"?n:tm(n);return this.select(function(){return this.insertBefore(s.apply(this,arguments),a.apply(this,arguments)||null)})}function JN(){var e=this.parentNode;e&&e.removeChild(this)}function WN(){return this.each(JN)}function PN(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function e2(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function t2(e){return this.select(e?e2:PN)}function n2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function i2(e){return function(n){e.call(this,n,this.__data__)}}function s2(e){return e.trim().split(/^|\s+/).map(function(n){var s="",a=n.indexOf(".");return a>=0&&(s=n.slice(a+1),n=n.slice(0,a)),{type:n,name:s}})}function a2(e){return function(){var n=this.__on;if(n){for(var s=0,a=-1,o=n.length,c;s<o;++s)c=n[s],(!e.type||c.type===e.type)&&c.name===e.name?this.removeEventListener(c.type,c.listener,c.options):n[++a]=c;++a?n.length=a:delete this.__on}}}function l2(e,n,s){return function(){var a=this.__on,o,c=i2(n);if(a){for(var u=0,d=a.length;u<d;++u)if((o=a[u]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=c,o.options=s),o.value=n;return}}this.addEventListener(e.type,c,s),o={type:e.type,name:e.name,value:n,listener:c,options:s},a?a.push(o):this.__on=[o]}}function o2(e,n,s){var a=s2(e+""),o,c=a.length,u;if(arguments.length<2){var d=this.node().__on;if(d){for(var h=0,p=d.length,v;h<p;++h)for(o=0,v=d[h];o<c;++o)if((u=a[o]).type===v.type&&u.name===v.name)return v.value}return}for(d=n?l2:a2,o=0;o<c;++o)this.each(d(a[o],n,s));return this}function Nb(e,n,s){var a=bb(e),o=a.CustomEvent;typeof o=="function"?o=new o(n,s):(o=a.document.createEvent("Event"),s?(o.initEvent(n,s.bubbles,s.cancelable),o.detail=s.detail):o.initEvent(n,!1,!1)),e.dispatchEvent(o)}function r2(e,n){return function(){return Nb(this,e,n)}}function c2(e,n){return function(){return Nb(this,e,n.apply(this,arguments))}}function u2(e,n){return this.each((typeof n=="function"?c2:r2)(e,n))}function*f2(){for(var e=this._groups,n=0,s=e.length;n<s;++n)for(var a=e[n],o=0,c=a.length,u;o<c;++o)(u=a[o])&&(yield u)}var _b=[null];function dn(e,n){this._groups=e,this._parents=n}function lr(){return new dn([[document.documentElement]],_b)}function d2(){return this}dn.prototype=lr.prototype={constructor:dn,select:$E,selectAll:qE,selectChild:XE,selectChildren:FE,filter:JE,data:iN,enter:WE,exit:aN,join:lN,merge:oN,selection:d2,order:rN,sort:cN,call:fN,nodes:dN,node:hN,size:mN,empty:pN,each:gN,attr:EN,style:TN,property:kN,classed:RN,text:HN,html:VN,raise:GN,lower:KN,append:ZN,insert:FN,remove:WN,clone:t2,datum:n2,on:o2,dispatch:u2,[Symbol.iterator]:f2};function cn(e){return typeof e=="string"?new dn([[document.querySelector(e)]],[document.documentElement]):new dn([[e]],_b)}function h2(e){let n;for(;n=e.sourceEvent;)e=n;return e}function Un(e,n){if(e=h2(e),n===void 0&&(n=e.currentTarget),n){var s=n.ownerSVGElement||n;if(s.createSVGPoint){var a=s.createSVGPoint();return a.x=e.clientX,a.y=e.clientY,a=a.matrixTransform(n.getScreenCTM().inverse()),[a.x,a.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}}return[e.pageX,e.pageY]}const m2={passive:!1},Vo={capture:!0,passive:!1};function ih(e){e.stopImmediatePropagation()}function nl(e){e.preventDefault(),e.stopImmediatePropagation()}function Ab(e){var n=e.document.documentElement,s=cn(e).on("dragstart.drag",nl,Vo);"onselectstart"in n?s.on("selectstart.drag",nl,Vo):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Tb(e,n){var s=e.document.documentElement,a=cn(e).on("dragstart.drag",null);n&&(a.on("click.drag",nl,Vo),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 Oc=e=>()=>e;function Mh(e,{sourceEvent:n,subject:s,target:a,identifier:o,active:c,x:u,y:d,dx:h,dy:p,dispatch:v}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:s,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:c,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:d,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:v}})}Mh.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function p2(e){return!e.ctrlKey&&!e.button}function g2(){return this.parentNode}function y2(e,n){return n??{x:e.x,y:e.y}}function v2(){return navigator.maxTouchPoints||"ontouchstart"in this}function Cb(){var e=p2,n=g2,s=y2,a=v2,o={},c=vu("start","drag","end"),u=0,d,h,p,v,g=0;function y(N){N.on("mousedown.drag",w).filter(a).on("touchstart.drag",A).on("touchmove.drag",T,m2).on("touchend.drag touchcancel.drag",z).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(N,j){if(!(v||!e.call(this,N,j))){var D=_(this,n.call(this,N,j),N,j,"mouse");D&&(cn(N.view).on("mousemove.drag",x,Vo).on("mouseup.drag",E,Vo),Ab(N.view),ih(N),p=!1,d=N.clientX,h=N.clientY,D("start",N))}}function x(N){if(nl(N),!p){var j=N.clientX-d,D=N.clientY-h;p=j*j+D*D>g}o.mouse("drag",N)}function E(N){cn(N.view).on("mousemove.drag mouseup.drag",null),Tb(N.view,p),nl(N),o.mouse("end",N)}function A(N,j){if(e.call(this,N,j)){var D=N.changedTouches,$=n.call(this,N,j),L=D.length,I,V;for(I=0;I<L;++I)(V=_(this,$,N,j,D[I].identifier,D[I]))&&(ih(N),V("start",N,D[I]))}}function T(N){var j=N.changedTouches,D=j.length,$,L;for($=0;$<D;++$)(L=o[j[$].identifier])&&(nl(N),L("drag",N,j[$]))}function z(N){var j=N.changedTouches,D=j.length,$,L;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),$=0;$<D;++$)(L=o[j[$].identifier])&&(ih(N),L("end",N,j[$]))}function _(N,j,D,$,L,I){var V=c.copy(),G=Un(I||D,j),Z,le,H;if((H=s.call(N,new Mh("beforestart",{sourceEvent:D,target:y,identifier:L,active:u,x:G[0],y:G[1],dx:0,dy:0,dispatch:V}),$))!=null)return Z=H.x-G[0]||0,le=H.y-G[1]||0,function O(C,B,R){var K=G,ee;switch(C){case"start":o[L]=O,ee=u++;break;case"end":delete o[L],--u;case"drag":G=Un(R||B,j),ee=u;break}V.call(C,N,new Mh(C,{sourceEvent:B,subject:H,target:y,identifier:L,active:ee,x:G[0]+Z,y:G[1]+le,dx:G[0]-K[0],dy:G[1]-K[1],dispatch:V}),$)}}return y.filter=function(N){return arguments.length?(e=typeof N=="function"?N:Oc(!!N),y):e},y.container=function(N){return arguments.length?(n=typeof N=="function"?N:Oc(N),y):n},y.subject=function(N){return arguments.length?(s=typeof N=="function"?N:Oc(N),y):s},y.touchable=function(N){return arguments.length?(a=typeof N=="function"?N:Oc(!!N),y):a},y.on=function(){var N=c.on.apply(c,arguments);return N===c?y:N},y.clickDistance=function(N){return arguments.length?(g=(N=+N)*N,y):Math.sqrt(g)},y}function im(e,n,s){e.prototype=n.prototype=s,s.constructor=e}function Mb(e,n){var s=Object.create(e.prototype);for(var a in n)s[a]=n[a];return s}function or(){}var Yo=.7,su=1/Yo,il="\\s*([+-]?\\d+)\\s*",Go="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",si="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",b2=/^#([0-9a-f]{3,8})$/,S2=new RegExp(`^rgb\\(${il},${il},${il}\\)$`),w2=new RegExp(`^rgb\\(${si},${si},${si}\\)$`),x2=new RegExp(`^rgba\\(${il},${il},${il},${Go}\\)$`),E2=new RegExp(`^rgba\\(${si},${si},${si},${Go}\\)$`),N2=new RegExp(`^hsl\\(${Go},${si},${si}\\)$`),_2=new RegExp(`^hsla\\(${Go},${si},${si},${Go}\\)$`),z0={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};im(or,Xs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:D0,formatHex:D0,formatHex8:A2,formatHsl:T2,formatRgb:j0,toString:j0});function D0(){return this.rgb().formatHex()}function A2(){return this.rgb().formatHex8()}function T2(){return Ob(this).formatHsl()}function j0(){return this.rgb().formatRgb()}function Xs(e){var n,s;return e=(e+"").trim().toLowerCase(),(n=b2.exec(e))?(s=n[1].length,n=parseInt(n[1],16),s===6?R0(n):s===3?new Pt(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):s===8?kc(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):s===4?kc(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=S2.exec(e))?new Pt(n[1],n[2],n[3],1):(n=w2.exec(e))?new Pt(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=x2.exec(e))?kc(n[1],n[2],n[3],n[4]):(n=E2.exec(e))?kc(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=N2.exec(e))?$0(n[1],n[2]/100,n[3]/100,1):(n=_2.exec(e))?$0(n[1],n[2]/100,n[3]/100,n[4]):z0.hasOwnProperty(e)?R0(z0[e]):e==="transparent"?new Pt(NaN,NaN,NaN,0):null}function R0(e){return new Pt(e>>16&255,e>>8&255,e&255,1)}function kc(e,n,s,a){return a<=0&&(e=n=s=NaN),new Pt(e,n,s,a)}function C2(e){return e instanceof or||(e=Xs(e)),e?(e=e.rgb(),new Pt(e.r,e.g,e.b,e.opacity)):new Pt}function Oh(e,n,s,a){return arguments.length===1?C2(e):new Pt(e,n,s,a??1)}function Pt(e,n,s,a){this.r=+e,this.g=+n,this.b=+s,this.opacity=+a}im(Pt,Oh,Mb(or,{brighter(e){return e=e==null?su:Math.pow(su,e),new Pt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Yo:Math.pow(Yo,e),new Pt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pt(Ys(this.r),Ys(this.g),Ys(this.b),au(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:B0,formatHex:B0,formatHex8:M2,formatRgb:L0,toString:L0}));function B0(){return`#${Us(this.r)}${Us(this.g)}${Us(this.b)}`}function M2(){return`#${Us(this.r)}${Us(this.g)}${Us(this.b)}${Us((isNaN(this.opacity)?1:this.opacity)*255)}`}function L0(){const e=au(this.opacity);return`${e===1?"rgb(":"rgba("}${Ys(this.r)}, ${Ys(this.g)}, ${Ys(this.b)}${e===1?")":`, ${e})`}`}function au(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ys(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Us(e){return e=Ys(e),(e<16?"0":"")+e.toString(16)}function $0(e,n,s,a){return a<=0?e=n=s=NaN:s<=0||s>=1?e=n=NaN:n<=0&&(e=NaN),new qn(e,n,s,a)}function Ob(e){if(e instanceof qn)return new qn(e.h,e.s,e.l,e.opacity);if(e instanceof or||(e=Xs(e)),!e)return new qn;if(e instanceof qn)return e;e=e.rgb();var n=e.r/255,s=e.g/255,a=e.b/255,o=Math.min(n,s,a),c=Math.max(n,s,a),u=NaN,d=c-o,h=(c+o)/2;return d?(n===c?u=(s-a)/d+(s<a)*6:s===c?u=(a-n)/d+2:u=(n-s)/d+4,d/=h<.5?c+o:2-c-o,u*=60):d=h>0&&h<1?0:u,new qn(u,d,h,e.opacity)}function O2(e,n,s,a){return arguments.length===1?Ob(e):new qn(e,n,s,a??1)}function qn(e,n,s,a){this.h=+e,this.s=+n,this.l=+s,this.opacity=+a}im(qn,O2,Mb(or,{brighter(e){return e=e==null?su:Math.pow(su,e),new qn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Yo:Math.pow(Yo,e),new qn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,s=this.l,a=s+(s<.5?s:1-s)*n,o=2*s-a;return new Pt(sh(e>=240?e-240:e+120,o,a),sh(e,o,a),sh(e<120?e+240:e-120,o,a),this.opacity)},clamp(){return new qn(H0(this.h),zc(this.s),zc(this.l),au(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=au(this.opacity);return`${e===1?"hsl(":"hsla("}${H0(this.h)}, ${zc(this.s)*100}%, ${zc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function H0(e){return e=(e||0)%360,e<0?e+360:e}function zc(e){return Math.max(0,Math.min(1,e||0))}function sh(e,n,s){return(e<60?n+(s-n)*e/60:e<180?s:e<240?n+(s-n)*(240-e)/60:n)*255}const sm=e=>()=>e;function k2(e,n){return function(s){return e+s*n}}function z2(e,n,s){return e=Math.pow(e,s),n=Math.pow(n,s)-e,s=1/s,function(a){return Math.pow(e+a*n,s)}}function D2(e){return(e=+e)==1?kb:function(n,s){return s-n?z2(n,s,e):sm(isNaN(n)?s:n)}}function kb(e,n){var s=n-e;return s?k2(e,s):sm(isNaN(e)?n:e)}const lu=(function e(n){var s=D2(n);function a(o,c){var u=s((o=Oh(o)).r,(c=Oh(c)).r),d=s(o.g,c.g),h=s(o.b,c.b),p=kb(o.opacity,c.opacity);return function(v){return o.r=u(v),o.g=d(v),o.b=h(v),o.opacity=p(v),o+""}}return a.gamma=e,a})(1);function j2(e,n){n||(n=[]);var s=e?Math.min(n.length,e.length):0,a=n.slice(),o;return function(c){for(o=0;o<s;++o)a[o]=e[o]*(1-c)+n[o]*c;return a}}function R2(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function B2(e,n){var s=n?n.length:0,a=e?Math.min(s,e.length):0,o=new Array(a),c=new Array(s),u;for(u=0;u<a;++u)o[u]=Lo(e[u],n[u]);for(;u<s;++u)c[u]=n[u];return function(d){for(u=0;u<a;++u)c[u]=o[u](d);return c}}function L2(e,n){var s=new Date;return e=+e,n=+n,function(a){return s.setTime(e*(1-a)+n*a),s}}function ti(e,n){return e=+e,n=+n,function(s){return e*(1-s)+n*s}}function $2(e,n){var s={},a={},o;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(o in n)o in e?s[o]=Lo(e[o],n[o]):a[o]=n[o];return function(c){for(o in s)a[o]=s[o](c);return a}}var kh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ah=new RegExp(kh.source,"g");function H2(e){return function(){return e}}function U2(e){return function(n){return e(n)+""}}function zb(e,n){var s=kh.lastIndex=ah.lastIndex=0,a,o,c,u=-1,d=[],h=[];for(e=e+"",n=n+"";(a=kh.exec(e))&&(o=ah.exec(n));)(c=o.index)>s&&(c=n.slice(s,c),d[u]?d[u]+=c:d[++u]=c),(a=a[0])===(o=o[0])?d[u]?d[u]+=o:d[++u]=o:(d[++u]=null,h.push({i:u,x:ti(a,o)})),s=ah.lastIndex;return s<n.length&&(c=n.slice(s),d[u]?d[u]+=c:d[++u]=c),d.length<2?h[0]?U2(h[0].x):H2(n):(n=h.length,function(p){for(var v=0,g;v<n;++v)d[(g=h[v]).i]=g.x(p);return d.join("")})}function Lo(e,n){var s=typeof n,a;return n==null||s==="boolean"?sm(n):(s==="number"?ti:s==="string"?(a=Xs(n))?(n=a,lu):zb:n instanceof Xs?lu:n instanceof Date?L2:R2(n)?j2:Array.isArray(n)?B2:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?$2:ti)(e,n)}var U0=180/Math.PI,zh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Db(e,n,s,a,o,c){var u,d,h;return(u=Math.sqrt(e*e+n*n))&&(e/=u,n/=u),(h=e*s+n*a)&&(s-=e*h,a-=n*h),(d=Math.sqrt(s*s+a*a))&&(s/=d,a/=d,h/=d),e*a<n*s&&(e=-e,n=-n,h=-h,u=-u),{translateX:o,translateY:c,rotate:Math.atan2(n,e)*U0,skewX:Math.atan(h)*U0,scaleX:u,scaleY:d}}var Dc;function I2(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?zh:Db(n.a,n.b,n.c,n.d,n.e,n.f)}function q2(e){return e==null||(Dc||(Dc=document.createElementNS("http://www.w3.org/2000/svg","g")),Dc.setAttribute("transform",e),!(e=Dc.transform.baseVal.consolidate()))?zh:(e=e.matrix,Db(e.a,e.b,e.c,e.d,e.e,e.f))}function jb(e,n,s,a){function o(p){return p.length?p.pop()+" ":""}function c(p,v,g,y,w,x){if(p!==g||v!==y){var E=w.push("translate(",null,n,null,s);x.push({i:E-4,x:ti(p,g)},{i:E-2,x:ti(v,y)})}else(g||y)&&w.push("translate("+g+n+y+s)}function u(p,v,g,y){p!==v?(p-v>180?v+=360:v-p>180&&(p+=360),y.push({i:g.push(o(g)+"rotate(",null,a)-2,x:ti(p,v)})):v&&g.push(o(g)+"rotate("+v+a)}function d(p,v,g,y){p!==v?y.push({i:g.push(o(g)+"skewX(",null,a)-2,x:ti(p,v)}):v&&g.push(o(g)+"skewX("+v+a)}function h(p,v,g,y,w,x){if(p!==g||v!==y){var E=w.push(o(w)+"scale(",null,",",null,")");x.push({i:E-4,x:ti(p,g)},{i:E-2,x:ti(v,y)})}else(g!==1||y!==1)&&w.push(o(w)+"scale("+g+","+y+")")}return function(p,v){var g=[],y=[];return p=e(p),v=e(v),c(p.translateX,p.translateY,v.translateX,v.translateY,g,y),u(p.rotate,v.rotate,g,y),d(p.skewX,v.skewX,g,y),h(p.scaleX,p.scaleY,v.scaleX,v.scaleY,g,y),p=v=null,function(w){for(var x=-1,E=y.length,A;++x<E;)g[(A=y[x]).i]=A.x(w);return g.join("")}}}var V2=jb(I2,"px, ","px)","deg)"),Y2=jb(q2,", ",")",")"),G2=1e-12;function I0(e){return((e=Math.exp(e))+1/e)/2}function X2(e){return((e=Math.exp(e))-1/e)/2}function K2(e){return((e=Math.exp(2*e))-1)/(e+1)}const Xc=(function e(n,s,a){function o(c,u){var d=c[0],h=c[1],p=c[2],v=u[0],g=u[1],y=u[2],w=v-d,x=g-h,E=w*w+x*x,A,T;if(E<G2)T=Math.log(y/p)/n,A=function($){return[d+$*w,h+$*x,p*Math.exp(n*$*T)]};else{var z=Math.sqrt(E),_=(y*y-p*p+a*E)/(2*p*s*z),N=(y*y-p*p-a*E)/(2*y*s*z),j=Math.log(Math.sqrt(_*_+1)-_),D=Math.log(Math.sqrt(N*N+1)-N);T=(D-j)/n,A=function($){var L=$*T,I=I0(j),V=p/(s*z)*(I*K2(n*L+j)-X2(j));return[d+V*w,h+V*x,p*I/I0(n*L+j)]}}return A.duration=T*1e3*n/Math.SQRT2,A}return o.rho=function(c){var u=Math.max(.001,+c),d=u*u,h=d*d;return e(u,d,h)},o})(Math.SQRT2,2,4);var fl=0,zo=0,Mo=0,Rb=1e3,ou,Do,ru=0,Ks=0,Su=0,Xo=typeof performance=="object"&&performance.now?performance:Date,Bb=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function am(){return Ks||(Bb(Z2),Ks=Xo.now()+Su)}function Z2(){Ks=0}function cu(){this._call=this._time=this._next=null}cu.prototype=Lb.prototype={constructor:cu,restart:function(e,n,s){if(typeof e!="function")throw new TypeError("callback is not a function");s=(s==null?am():+s)+(n==null?0:+n),!this._next&&Do!==this&&(Do?Do._next=this:ou=this,Do=this),this._call=e,this._time=s,Dh()},stop:function(){this._call&&(this._call=null,this._time=1/0,Dh())}};function Lb(e,n,s){var a=new cu;return a.restart(e,n,s),a}function Q2(){am(),++fl;for(var e=ou,n;e;)(n=Ks-e._time)>=0&&e._call.call(void 0,n),e=e._next;--fl}function q0(){Ks=(ru=Xo.now())+Su,fl=zo=0;try{Q2()}finally{fl=0,J2(),Ks=0}}function F2(){var e=Xo.now(),n=e-ru;n>Rb&&(Su-=n,ru=e)}function J2(){for(var e,n=ou,s,a=1/0;n;)n._call?(a>n._time&&(a=n._time),e=n,n=n._next):(s=n._next,n._next=null,n=e?e._next=s:ou=s);Do=e,Dh(a)}function Dh(e){if(!fl){zo&&(zo=clearTimeout(zo));var n=e-Ks;n>24?(e<1/0&&(zo=setTimeout(q0,e-Xo.now()-Su)),Mo&&(Mo=clearInterval(Mo))):(Mo||(ru=Xo.now(),Mo=setInterval(F2,Rb)),fl=1,Bb(q0))}}function V0(e,n,s){var a=new cu;return n=n==null?0:+n,a.restart(o=>{a.stop(),e(o+n)},n,s),a}var W2=vu("start","end","cancel","interrupt"),P2=[],$b=0,Y0=1,jh=2,Kc=3,G0=4,Rh=5,Zc=6;function wu(e,n,s,a,o,c){var u=e.__transition;if(!u)e.__transition={};else if(s in u)return;e_(e,s,{name:n,index:a,group:o,on:W2,tween:P2,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:$b})}function lm(e,n){var s=Xn(e,n);if(s.state>$b)throw new Error("too late; already scheduled");return s}function oi(e,n){var s=Xn(e,n);if(s.state>Kc)throw new Error("too late; already running");return s}function Xn(e,n){var s=e.__transition;if(!s||!(s=s[n]))throw new Error("transition not found");return s}function e_(e,n,s){var a=e.__transition,o;a[n]=s,s.timer=Lb(c,0,s.time);function c(p){s.state=Y0,s.timer.restart(u,s.delay,s.time),s.delay<=p&&u(p-s.delay)}function u(p){var v,g,y,w;if(s.state!==Y0)return h();for(v in a)if(w=a[v],w.name===s.name){if(w.state===Kc)return V0(u);w.state===G0?(w.state=Zc,w.timer.stop(),w.on.call("interrupt",e,e.__data__,w.index,w.group),delete a[v]):+v<n&&(w.state=Zc,w.timer.stop(),w.on.call("cancel",e,e.__data__,w.index,w.group),delete a[v])}if(V0(function(){s.state===Kc&&(s.state=G0,s.timer.restart(d,s.delay,s.time),d(p))}),s.state=jh,s.on.call("start",e,e.__data__,s.index,s.group),s.state===jh){for(s.state=Kc,o=new Array(y=s.tween.length),v=0,g=-1;v<y;++v)(w=s.tween[v].value.call(e,e.__data__,s.index,s.group))&&(o[++g]=w);o.length=g+1}}function d(p){for(var v=p<s.duration?s.ease.call(null,p/s.duration):(s.timer.restart(h),s.state=Rh,1),g=-1,y=o.length;++g<y;)o[g].call(e,v);s.state===Rh&&(s.on.call("end",e,e.__data__,s.index,s.group),h())}function h(){s.state=Zc,s.timer.stop(),delete a[n];for(var p in a)return;delete e.__transition}}function Qc(e,n){var s=e.__transition,a,o,c=!0,u;if(s){n=n==null?null:n+"";for(u in s){if((a=s[u]).name!==n){c=!1;continue}o=a.state>jh&&a.state<Rh,a.state=Zc,a.timer.stop(),a.on.call(o?"interrupt":"cancel",e,e.__data__,a.index,a.group),delete s[u]}c&&delete e.__transition}}function t_(e){return this.each(function(){Qc(this,e)})}function n_(e,n){var s,a;return function(){var o=oi(this,e),c=o.tween;if(c!==s){a=s=c;for(var u=0,d=a.length;u<d;++u)if(a[u].name===n){a=a.slice(),a.splice(u,1);break}}o.tween=a}}function i_(e,n,s){var a,o;if(typeof s!="function")throw new Error;return function(){var c=oi(this,e),u=c.tween;if(u!==a){o=(a=u).slice();for(var d={name:n,value:s},h=0,p=o.length;h<p;++h)if(o[h].name===n){o[h]=d;break}h===p&&o.push(d)}c.tween=o}}function s_(e,n){var s=this._id;if(e+="",arguments.length<2){for(var a=Xn(this.node(),s).tween,o=0,c=a.length,u;o<c;++o)if((u=a[o]).name===e)return u.value;return null}return this.each((n==null?n_:i_)(s,e,n))}function om(e,n,s){var a=e._id;return e.each(function(){var o=oi(this,a);(o.value||(o.value={}))[n]=s.apply(this,arguments)}),function(o){return Xn(o,a).value[n]}}function Hb(e,n){var s;return(typeof n=="number"?ti:n instanceof Xs?lu:(s=Xs(n))?(n=s,lu):zb)(e,n)}function a_(e){return function(){this.removeAttribute(e)}}function l_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function o_(e,n,s){var a,o=s+"",c;return function(){var u=this.getAttribute(e);return u===o?null:u===a?c:c=n(a=u,s)}}function r_(e,n,s){var a,o=s+"",c;return function(){var u=this.getAttributeNS(e.space,e.local);return u===o?null:u===a?c:c=n(a=u,s)}}function c_(e,n,s){var a,o,c;return function(){var u,d=s(this),h;return d==null?void this.removeAttribute(e):(u=this.getAttribute(e),h=d+"",u===h?null:u===a&&h===o?c:(o=h,c=n(a=u,d)))}}function u_(e,n,s){var a,o,c;return function(){var u,d=s(this),h;return d==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),h=d+"",u===h?null:u===a&&h===o?c:(o=h,c=n(a=u,d)))}}function f_(e,n){var s=bu(e),a=s==="transform"?Y2:Hb;return this.attrTween(e,typeof n=="function"?(s.local?u_:c_)(s,a,om(this,"attr."+e,n)):n==null?(s.local?l_:a_)(s):(s.local?r_:o_)(s,a,n))}function d_(e,n){return function(s){this.setAttribute(e,n.call(this,s))}}function h_(e,n){return function(s){this.setAttributeNS(e.space,e.local,n.call(this,s))}}function m_(e,n){var s,a;function o(){var c=n.apply(this,arguments);return c!==a&&(s=(a=c)&&h_(e,c)),s}return o._value=n,o}function p_(e,n){var s,a;function o(){var c=n.apply(this,arguments);return c!==a&&(s=(a=c)&&d_(e,c)),s}return o._value=n,o}function g_(e,n){var s="attr."+e;if(arguments.length<2)return(s=this.tween(s))&&s._value;if(n==null)return this.tween(s,null);if(typeof n!="function")throw new Error;var a=bu(e);return this.tween(s,(a.local?m_:p_)(a,n))}function y_(e,n){return function(){lm(this,e).delay=+n.apply(this,arguments)}}function v_(e,n){return n=+n,function(){lm(this,e).delay=n}}function b_(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?y_:v_)(n,e)):Xn(this.node(),n).delay}function S_(e,n){return function(){oi(this,e).duration=+n.apply(this,arguments)}}function w_(e,n){return n=+n,function(){oi(this,e).duration=n}}function x_(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?S_:w_)(n,e)):Xn(this.node(),n).duration}function E_(e,n){if(typeof n!="function")throw new Error;return function(){oi(this,e).ease=n}}function N_(e){var n=this._id;return arguments.length?this.each(E_(n,e)):Xn(this.node(),n).ease}function __(e,n){return function(){var s=n.apply(this,arguments);if(typeof s!="function")throw new Error;oi(this,e).ease=s}}function A_(e){if(typeof e!="function")throw new Error;return this.each(__(this._id,e))}function T_(e){typeof e!="function"&&(e=gb(e));for(var n=this._groups,s=n.length,a=new Array(s),o=0;o<s;++o)for(var c=n[o],u=c.length,d=a[o]=[],h,p=0;p<u;++p)(h=c[p])&&e.call(h,h.__data__,p,c)&&d.push(h);return new Di(a,this._parents,this._name,this._id)}function C_(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,s=e._groups,a=n.length,o=s.length,c=Math.min(a,o),u=new Array(a),d=0;d<c;++d)for(var h=n[d],p=s[d],v=h.length,g=u[d]=new Array(v),y,w=0;w<v;++w)(y=h[w]||p[w])&&(g[w]=y);for(;d<a;++d)u[d]=n[d];return new Di(u,this._parents,this._name,this._id)}function M_(e){return(e+"").trim().split(/^|\s+/).every(function(n){var s=n.indexOf(".");return s>=0&&(n=n.slice(0,s)),!n||n==="start"})}function O_(e,n,s){var a,o,c=M_(n)?lm:oi;return function(){var u=c(this,e),d=u.on;d!==a&&(o=(a=d).copy()).on(n,s),u.on=o}}function k_(e,n){var s=this._id;return arguments.length<2?Xn(this.node(),s).on.on(e):this.each(O_(s,e,n))}function z_(e){return function(){var n=this.parentNode;for(var s in this.__transition)if(+s!==e)return;n&&n.removeChild(this)}}function D_(){return this.on("end.remove",z_(this._id))}function j_(e){var n=this._name,s=this._id;typeof e!="function"&&(e=tm(e));for(var a=this._groups,o=a.length,c=new Array(o),u=0;u<o;++u)for(var d=a[u],h=d.length,p=c[u]=new Array(h),v,g,y=0;y<h;++y)(v=d[y])&&(g=e.call(v,v.__data__,y,d))&&("__data__"in v&&(g.__data__=v.__data__),p[y]=g,wu(p[y],n,s,y,p,Xn(v,s)));return new Di(c,this._parents,n,s)}function R_(e){var n=this._name,s=this._id;typeof e!="function"&&(e=pb(e));for(var a=this._groups,o=a.length,c=[],u=[],d=0;d<o;++d)for(var h=a[d],p=h.length,v,g=0;g<p;++g)if(v=h[g]){for(var y=e.call(v,v.__data__,g,h),w,x=Xn(v,s),E=0,A=y.length;E<A;++E)(w=y[E])&&wu(w,n,s,E,y,x);c.push(y),u.push(v)}return new Di(c,u,n,s)}var B_=lr.prototype.constructor;function L_(){return new B_(this._groups,this._parents)}function $_(e,n){var s,a,o;return function(){var c=ul(this,e),u=(this.style.removeProperty(e),ul(this,e));return c===u?null:c===s&&u===a?o:o=n(s=c,a=u)}}function Ub(e){return function(){this.style.removeProperty(e)}}function H_(e,n,s){var a,o=s+"",c;return function(){var u=ul(this,e);return u===o?null:u===a?c:c=n(a=u,s)}}function U_(e,n,s){var a,o,c;return function(){var u=ul(this,e),d=s(this),h=d+"";return d==null&&(h=d=(this.style.removeProperty(e),ul(this,e))),u===h?null:u===a&&h===o?c:(o=h,c=n(a=u,d))}}function I_(e,n){var s,a,o,c="style."+n,u="end."+c,d;return function(){var h=oi(this,e),p=h.on,v=h.value[c]==null?d||(d=Ub(n)):void 0;(p!==s||o!==v)&&(a=(s=p).copy()).on(u,o=v),h.on=a}}function q_(e,n,s){var a=(e+="")=="transform"?V2:Hb;return n==null?this.styleTween(e,$_(e,a)).on("end.style."+e,Ub(e)):typeof n=="function"?this.styleTween(e,U_(e,a,om(this,"style."+e,n))).each(I_(this._id,e)):this.styleTween(e,H_(e,a,n),s).on("end.style."+e,null)}function V_(e,n,s){return function(a){this.style.setProperty(e,n.call(this,a),s)}}function Y_(e,n,s){var a,o;function c(){var u=n.apply(this,arguments);return u!==o&&(a=(o=u)&&V_(e,u,s)),a}return c._value=n,c}function G_(e,n,s){var a="style."+(e+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(n==null)return this.tween(a,null);if(typeof n!="function")throw new Error;return this.tween(a,Y_(e,n,s??""))}function X_(e){return function(){this.textContent=e}}function K_(e){return function(){var n=e(this);this.textContent=n??""}}function Z_(e){return this.tween("text",typeof e=="function"?K_(om(this,"text",e)):X_(e==null?"":e+""))}function Q_(e){return function(n){this.textContent=e.call(this,n)}}function F_(e){var n,s;function a(){var o=e.apply(this,arguments);return o!==s&&(n=(s=o)&&Q_(o)),n}return a._value=e,a}function J_(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,F_(e))}function W_(){for(var e=this._name,n=this._id,s=Ib(),a=this._groups,o=a.length,c=0;c<o;++c)for(var u=a[c],d=u.length,h,p=0;p<d;++p)if(h=u[p]){var v=Xn(h,n);wu(h,e,s,p,u,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new Di(a,this._parents,e,s)}function P_(){var e,n,s=this,a=s._id,o=s.size();return new Promise(function(c,u){var d={value:u},h={value:function(){--o===0&&c()}};s.each(function(){var p=oi(this,a),v=p.on;v!==e&&(n=(e=v).copy(),n._.cancel.push(d),n._.interrupt.push(d),n._.end.push(h)),p.on=n}),o===0&&c()})}var eA=0;function Di(e,n,s,a){this._groups=e,this._parents=n,this._name=s,this._id=a}function Ib(){return++eA}var Mi=lr.prototype;Di.prototype={constructor:Di,select:j_,selectAll:R_,selectChild:Mi.selectChild,selectChildren:Mi.selectChildren,filter:T_,merge:C_,selection:L_,transition:W_,call:Mi.call,nodes:Mi.nodes,node:Mi.node,size:Mi.size,empty:Mi.empty,each:Mi.each,on:k_,attr:f_,attrTween:g_,style:q_,styleTween:G_,text:Z_,textTween:J_,remove:D_,tween:s_,delay:b_,duration:x_,ease:N_,easeVarying:A_,end:P_,[Symbol.iterator]:Mi[Symbol.iterator]};function tA(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var nA={time:null,delay:0,duration:250,ease:tA};function iA(e,n){for(var s;!(s=e.__transition)||!(s=s[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return s}function sA(e){var n,s;e instanceof Di?(n=e._id,e=e._name):(n=Ib(),(s=nA).time=am(),e=e==null?null:e+"");for(var a=this._groups,o=a.length,c=0;c<o;++c)for(var u=a[c],d=u.length,h,p=0;p<d;++p)(h=u[p])&&wu(h,e,n,p,u,s||iA(h,n));return new Di(a,this._parents,e,n)}lr.prototype.interrupt=t_;lr.prototype.transition=sA;const jc=e=>()=>e;function aA(e,{sourceEvent:n,target:s,transform:a,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:o}})}function Oi(e,n,s){this.k=e,this.x=n,this.y=s}Oi.prototype={constructor:Oi,scale:function(e){return e===1?this:new Oi(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Oi(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var xu=new Oi(1,0,0);qb.prototype=Oi.prototype;function qb(e){for(;!e.__zoom;)if(!(e=e.parentNode))return xu;return e.__zoom}function lh(e){e.stopImmediatePropagation()}function Oo(e){e.preventDefault(),e.stopImmediatePropagation()}function lA(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function oA(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function X0(){return this.__zoom||xu}function rA(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function cA(){return navigator.maxTouchPoints||"ontouchstart"in this}function uA(e,n,s){var a=e.invertX(n[0][0])-s[0][0],o=e.invertX(n[1][0])-s[1][0],c=e.invertY(n[0][1])-s[0][1],u=e.invertY(n[1][1])-s[1][1];return e.translate(o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o),u>c?(c+u)/2:Math.min(0,c)||Math.max(0,u))}function Vb(){var e=lA,n=oA,s=uA,a=rA,o=cA,c=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],d=250,h=Xc,p=vu("start","zoom","end"),v,g,y,w=500,x=150,E=0,A=10;function T(H){H.property("__zoom",X0).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",V).filter(o).on("touchstart.zoom",G).on("touchmove.zoom",Z).on("touchend.zoom touchcancel.zoom",le).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}T.transform=function(H,O,C,B){var R=H.selection?H.selection():H;R.property("__zoom",X0),H!==R?j(H,O,C,B):R.interrupt().each(function(){D(this,arguments).event(B).start().zoom(null,typeof O=="function"?O.apply(this,arguments):O).end()})},T.scaleBy=function(H,O,C,B){T.scaleTo(H,function(){var R=this.__zoom.k,K=typeof O=="function"?O.apply(this,arguments):O;return R*K},C,B)},T.scaleTo=function(H,O,C,B){T.transform(H,function(){var R=n.apply(this,arguments),K=this.__zoom,ee=C==null?N(R):typeof C=="function"?C.apply(this,arguments):C,k=K.invert(ee),U=typeof O=="function"?O.apply(this,arguments):O;return s(_(z(K,U),ee,k),R,u)},C,B)},T.translateBy=function(H,O,C,B){T.transform(H,function(){return s(this.__zoom.translate(typeof O=="function"?O.apply(this,arguments):O,typeof C=="function"?C.apply(this,arguments):C),n.apply(this,arguments),u)},null,B)},T.translateTo=function(H,O,C,B,R){T.transform(H,function(){var K=n.apply(this,arguments),ee=this.__zoom,k=B==null?N(K):typeof B=="function"?B.apply(this,arguments):B;return s(xu.translate(k[0],k[1]).scale(ee.k).translate(typeof O=="function"?-O.apply(this,arguments):-O,typeof C=="function"?-C.apply(this,arguments):-C),K,u)},B,R)};function z(H,O){return O=Math.max(c[0],Math.min(c[1],O)),O===H.k?H:new Oi(O,H.x,H.y)}function _(H,O,C){var B=O[0]-C[0]*H.k,R=O[1]-C[1]*H.k;return B===H.x&&R===H.y?H:new Oi(H.k,B,R)}function N(H){return[(+H[0][0]+ +H[1][0])/2,(+H[0][1]+ +H[1][1])/2]}function j(H,O,C,B){H.on("start.zoom",function(){D(this,arguments).event(B).start()}).on("interrupt.zoom end.zoom",function(){D(this,arguments).event(B).end()}).tween("zoom",function(){var R=this,K=arguments,ee=D(R,K).event(B),k=n.apply(R,K),U=C==null?N(k):typeof C=="function"?C.apply(R,K):C,P=Math.max(k[1][0]-k[0][0],k[1][1]-k[0][1]),se=R.__zoom,fe=typeof O=="function"?O.apply(R,K):O,de=h(se.invert(U).concat(P/se.k),fe.invert(U).concat(P/fe.k));return function(ae){if(ae===1)ae=fe;else{var ne=de(ae),ce=P/ne[2];ae=new Oi(ce,U[0]-ne[0]*ce,U[1]-ne[1]*ce)}ee.zoom(null,ae)}})}function D(H,O,C){return!C&&H.__zooming||new $(H,O)}function $(H,O){this.that=H,this.args=O,this.active=0,this.sourceEvent=null,this.extent=n.apply(H,O),this.taps=0}$.prototype={event:function(H){return H&&(this.sourceEvent=H),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(H,O){return this.mouse&&H!=="mouse"&&(this.mouse[1]=O.invert(this.mouse[0])),this.touch0&&H!=="touch"&&(this.touch0[1]=O.invert(this.touch0[0])),this.touch1&&H!=="touch"&&(this.touch1[1]=O.invert(this.touch1[0])),this.that.__zoom=O,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(H){var O=cn(this.that).datum();p.call(H,this.that,new aA(H,{sourceEvent:this.sourceEvent,target:T,transform:this.that.__zoom,dispatch:p}),O)}};function L(H,...O){if(!e.apply(this,arguments))return;var C=D(this,O).event(H),B=this.__zoom,R=Math.max(c[0],Math.min(c[1],B.k*Math.pow(2,a.apply(this,arguments)))),K=Un(H);if(C.wheel)(C.mouse[0][0]!==K[0]||C.mouse[0][1]!==K[1])&&(C.mouse[1]=B.invert(C.mouse[0]=K)),clearTimeout(C.wheel);else{if(B.k===R)return;C.mouse=[K,B.invert(K)],Qc(this),C.start()}Oo(H),C.wheel=setTimeout(ee,x),C.zoom("mouse",s(_(z(B,R),C.mouse[0],C.mouse[1]),C.extent,u));function ee(){C.wheel=null,C.end()}}function I(H,...O){if(y||!e.apply(this,arguments))return;var C=H.currentTarget,B=D(this,O,!0).event(H),R=cn(H.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",P,!0),K=Un(H,C),ee=H.clientX,k=H.clientY;Ab(H.view),lh(H),B.mouse=[K,this.__zoom.invert(K)],Qc(this),B.start();function U(se){if(Oo(se),!B.moved){var fe=se.clientX-ee,de=se.clientY-k;B.moved=fe*fe+de*de>E}B.event(se).zoom("mouse",s(_(B.that.__zoom,B.mouse[0]=Un(se,C),B.mouse[1]),B.extent,u))}function P(se){R.on("mousemove.zoom mouseup.zoom",null),Tb(se.view,B.moved),Oo(se),B.event(se).end()}}function V(H,...O){if(e.apply(this,arguments)){var C=this.__zoom,B=Un(H.changedTouches?H.changedTouches[0]:H,this),R=C.invert(B),K=C.k*(H.shiftKey?.5:2),ee=s(_(z(C,K),B,R),n.apply(this,O),u);Oo(H),d>0?cn(this).transition().duration(d).call(j,ee,B,H):cn(this).call(T.transform,ee,B,H)}}function G(H,...O){if(e.apply(this,arguments)){var C=H.touches,B=C.length,R=D(this,O,H.changedTouches.length===B).event(H),K,ee,k,U;for(lh(H),ee=0;ee<B;++ee)k=C[ee],U=Un(k,this),U=[U,this.__zoom.invert(U),k.identifier],R.touch0?!R.touch1&&R.touch0[2]!==U[2]&&(R.touch1=U,R.taps=0):(R.touch0=U,K=!0,R.taps=1+!!v);v&&(v=clearTimeout(v)),K&&(R.taps<2&&(g=U[0],v=setTimeout(function(){v=null},w)),Qc(this),R.start())}}function Z(H,...O){if(this.__zooming){var C=D(this,O).event(H),B=H.changedTouches,R=B.length,K,ee,k,U;for(Oo(H),K=0;K<R;++K)ee=B[K],k=Un(ee,this),C.touch0&&C.touch0[2]===ee.identifier?C.touch0[0]=k:C.touch1&&C.touch1[2]===ee.identifier&&(C.touch1[0]=k);if(ee=C.that.__zoom,C.touch1){var P=C.touch0[0],se=C.touch0[1],fe=C.touch1[0],de=C.touch1[1],ae=(ae=fe[0]-P[0])*ae+(ae=fe[1]-P[1])*ae,ne=(ne=de[0]-se[0])*ne+(ne=de[1]-se[1])*ne;ee=z(ee,Math.sqrt(ae/ne)),k=[(P[0]+fe[0])/2,(P[1]+fe[1])/2],U=[(se[0]+de[0])/2,(se[1]+de[1])/2]}else if(C.touch0)k=C.touch0[0],U=C.touch0[1];else return;C.zoom("touch",s(_(ee,k,U),C.extent,u))}}function le(H,...O){if(this.__zooming){var C=D(this,O).event(H),B=H.changedTouches,R=B.length,K,ee;for(lh(H),y&&clearTimeout(y),y=setTimeout(function(){y=null},w),K=0;K<R;++K)ee=B[K],C.touch0&&C.touch0[2]===ee.identifier?delete C.touch0:C.touch1&&C.touch1[2]===ee.identifier&&delete C.touch1;if(C.touch1&&!C.touch0&&(C.touch0=C.touch1,delete C.touch1),C.touch0)C.touch0[1]=this.__zoom.invert(C.touch0[0]);else if(C.end(),C.taps===2&&(ee=Un(ee,this),Math.hypot(g[0]-ee[0],g[1]-ee[1])<A)){var k=cn(this).on("dblclick.zoom");k&&k.apply(this,arguments)}}}return T.wheelDelta=function(H){return arguments.length?(a=typeof H=="function"?H:jc(+H),T):a},T.filter=function(H){return arguments.length?(e=typeof H=="function"?H:jc(!!H),T):e},T.touchable=function(H){return arguments.length?(o=typeof H=="function"?H:jc(!!H),T):o},T.extent=function(H){return arguments.length?(n=typeof H=="function"?H:jc([[+H[0][0],+H[0][1]],[+H[1][0],+H[1][1]]]),T):n},T.scaleExtent=function(H){return arguments.length?(c[0]=+H[0],c[1]=+H[1],T):[c[0],c[1]]},T.translateExtent=function(H){return arguments.length?(u[0][0]=+H[0][0],u[1][0]=+H[1][0],u[0][1]=+H[0][1],u[1][1]=+H[1][1],T):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},T.constrain=function(H){return arguments.length?(s=H,T):s},T.duration=function(H){return arguments.length?(d=+H,T):d},T.interpolate=function(H){return arguments.length?(h=H,T):h},T.on=function(){var H=p.on.apply(p,arguments);return H===p?T:H},T.clickDistance=function(H){return arguments.length?(E=(H=+H)*H,T):Math.sqrt(E)},T.tapDistance=function(H){return arguments.length?(A=+H,T):A},T}const Gn={error001:(e="react")=>`Seems like you have not used zustand provider as an ancestor. Help: https://${e}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:e=>`Node type "${e}" 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:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:s,targetHandle:a})=>`Couldn't create edge for ${e} handle id: "${e==="source"?s:a}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Ko=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Yb=["Enter"," ","Escape"],Gb={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:n,y:s})=>`Moved selected node ${e}. New position, x: ${n}, 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 dl;(function(e){e.Strict="strict",e.Loose="loose"})(dl||(dl={}));var Gs;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Gs||(Gs={}));var Zo;(function(e){e.Partial="partial",e.Full="full"})(Zo||(Zo={}));const Xb={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var gs;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(gs||(gs={}));var Qo;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Qo||(Qo={}));var me;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(me||(me={}));const K0={[me.Left]:me.Right,[me.Right]:me.Left,[me.Top]:me.Bottom,[me.Bottom]:me.Top};function Kb(e){return e===null?null:e?"valid":"invalid"}const Zb=e=>"id"in e&&"source"in e&&"target"in e,fA=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),rm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),rr=(e,n=[0,0])=>{const{width:s,height:a}=ji(e),o=e.origin??n,c=s*o[0],u=a*o[1];return{x:e.position.x-c,y:e.position.y-u}},dA=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const s=e.reduce((a,o)=>{const c=typeof o=="string";let u=!n.nodeLookup&&!c?o:void 0;n.nodeLookup&&(u=c?n.nodeLookup.get(o):rm(o)?o:n.nodeLookup.get(o.id));const d=u?uu(u,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Eu(a,d)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Nu(s)},cr=(e,n={})=>{let s={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return e.forEach(o=>{(n.filter===void 0||n.filter(o))&&(s=Eu(s,uu(o)),a=!0)}),a?Nu(s):{x:0,y:0,width:0,height:0}},cm=(e,n,[s,a,o]=[0,0,1],c=!1,u=!1)=>{const d={...wl(n,[s,a,o]),width:n.width/o,height:n.height/o},h=[];for(const p of e.values()){const{measured:v,selectable:g=!0,hidden:y=!1}=p;if(u&&!g||y)continue;const w=v.width??p.width??p.initialWidth??null,x=v.height??p.height??p.initialHeight??null,E=Fo(d,ml(p)),A=(w??0)*(x??0),T=c&&E>0;(!p.internals.handleBounds||T||E>=A||p.dragging)&&h.push(p)}return h},hA=(e,n)=>{const s=new Set;return e.forEach(a=>{s.add(a.id)}),n.filter(a=>s.has(a.source)||s.has(a.target))};function mA(e,n){const s=new Map,a=n?.nodes?new Set(n.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&(n?.includeHiddenNodes||!o.hidden)&&(!a||a.has(o.id))&&s.set(o.id,o)}),s}async function pA({nodes:e,width:n,height:s,panZoom:a,minZoom:o,maxZoom:c},u){if(e.size===0)return!0;const d=mA(e,u),h=cr(d),p=fm(h,n,s,u?.minZoom??o,u?.maxZoom??c,u?.padding??.1);return await a.setViewport(p,{duration:u?.duration,ease:u?.ease,interpolate:u?.interpolate}),!0}function Qb({nodeId:e,nextPosition:n,nodeLookup:s,nodeOrigin:a=[0,0],nodeExtent:o,onError:c}){const u=s.get(e),d=u.parentId?s.get(u.parentId):void 0,{x:h,y:p}=d?d.internals.positionAbsolute:{x:0,y:0},v=u.origin??a;let g=u.extent||o;if(u.extent==="parent"&&!u.expandParent)if(!d)c?.("005",Gn.error005());else{const w=d.measured.width,x=d.measured.height;w&&x&&(g=[[h,p],[h+w,p+x]])}else d&&Qs(u.extent)&&(g=[[u.extent[0][0]+h,u.extent[0][1]+p],[u.extent[1][0]+h,u.extent[1][1]+p]]);const y=Qs(g)?Zs(n,g,u.measured):n;return(u.measured.width===void 0||u.measured.height===void 0)&&c?.("015",Gn.error015()),{position:{x:y.x-h+(u.measured.width??0)*v[0],y:y.y-p+(u.measured.height??0)*v[1]},positionAbsolute:y}}async function gA({nodesToRemove:e=[],edgesToRemove:n=[],nodes:s,edges:a,onBeforeDelete:o}){const c=new Set(e.map(y=>y.id)),u=[];for(const y of s){if(y.deletable===!1)continue;const w=c.has(y.id),x=!w&&y.parentId&&u.find(E=>E.id===y.parentId);(w||x)&&u.push(y)}const d=new Set(n.map(y=>y.id)),h=a.filter(y=>y.deletable!==!1),v=hA(u,h);for(const y of h)d.has(y.id)&&!v.find(x=>x.id===y.id)&&v.push(y);if(!o)return{edges:v,nodes:u};const g=await o({nodes:u,edges:v});return typeof g=="boolean"?g?{edges:v,nodes:u}:{edges:[],nodes:[]}:g}const hl=(e,n=0,s=1)=>Math.min(Math.max(e,n),s),Zs=(e={x:0,y:0},n,s)=>({x:hl(e.x,n[0][0],n[1][0]-(s?.width??0)),y:hl(e.y,n[0][1],n[1][1]-(s?.height??0))});function Fb(e,n,s){const{width:a,height:o}=ji(s),{x:c,y:u}=s.internals.positionAbsolute;return Zs(e,[[c,u],[c+a,u+o]],n)}const Z0=(e,n,s)=>e<n?hl(Math.abs(e-n),1,n)/n:e>s?-hl(Math.abs(e-s),1,n)/n:0,um=(e,n,s=15,a=40)=>{const o=Z0(e.x,a,n.width-a)*s,c=Z0(e.y,a,n.height-a)*s;return[o,c]},Eu=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),Bh=({x:e,y:n,width:s,height:a})=>({x:e,y:n,x2:e+s,y2:n+a}),Nu=({x:e,y:n,x2:s,y2:a})=>({x:e,y:n,width:s-e,height:a-n}),ml=(e,n=[0,0])=>{const{x:s,y:a}=rm(e)?e.internals.positionAbsolute:rr(e,n);return{x:s,y:a,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},uu=(e,n=[0,0])=>{const{x:s,y:a}=rm(e)?e.internals.positionAbsolute:rr(e,n);return{x:s,y:a,x2:s+(e.measured?.width??e.width??e.initialWidth??0),y2:a+(e.measured?.height??e.height??e.initialHeight??0)}},Jb=(e,n)=>Nu(Eu(Bh(e),Bh(n))),Fo=(e,n)=>{const s=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),a=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(s*a)},Q0=e=>Vn(e.width)&&Vn(e.height)&&Vn(e.x)&&Vn(e.y),Vn=e=>!isNaN(e)&&isFinite(e),Wb=(e,n)=>(s,a)=>{},ur=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),wl=({x:e,y:n},[s,a,o],c=!1,u=[1,1])=>{const d={x:(e-s)/o,y:(n-a)/o};return c?ur(d,u):d},pl=({x:e,y:n},[s,a,o])=>({x:e*o+s,y:n*o+a});function Ya(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const s=parseFloat(e);if(!Number.isNaN(s))return Math.floor(s)}if(typeof e=="string"&&e.endsWith("%")){const s=parseFloat(e);if(!Number.isNaN(s))return Math.floor(n*s*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function yA(e,n,s){if(typeof e=="string"||typeof e=="number"){const a=Ya(e,s),o=Ya(e,n);return{top:a,right:o,bottom:a,left:o,x:o*2,y:a*2}}if(typeof e=="object"){const a=Ya(e.top??e.y??0,s),o=Ya(e.bottom??e.y??0,s),c=Ya(e.left??e.x??0,n),u=Ya(e.right??e.x??0,n);return{top:a,right:u,bottom:o,left:c,x:c+u,y:a+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function vA(e,n,s,a,o,c){const{x:u,y:d}=pl(e,[n,s,a]),{x:h,y:p}=pl({x:e.x+e.width,y:e.y+e.height},[n,s,a]),v=o-h,g=c-p;return{left:Math.floor(u),top:Math.floor(d),right:Math.floor(v),bottom:Math.floor(g)}}const fm=(e,n,s,a,o,c)=>{const u=yA(c,n,s),d=(n-u.x)/e.width,h=(s-u.y)/e.height,p=Math.min(d,h),v=hl(p,a,o),g=e.x+e.width/2,y=e.y+e.height/2,w=n/2-g*v,x=s/2-y*v,E=vA(e,w,x,v,n,s),A={left:Math.min(E.left-u.left,0),top:Math.min(E.top-u.top,0),right:Math.min(E.right-u.right,0),bottom:Math.min(E.bottom-u.bottom,0)};return{x:w-A.left+A.right,y:x-A.top+A.bottom,zoom:v}},Jo=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Qs(e){return e!=null&&e!=="parent"}function ji(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Pb(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function e1(e,n={width:0,height:0},s,a,o){const c={...e},u=a.get(s);if(u){const d=u.origin||o;c.x+=u.internals.positionAbsolute.x-(n.width??0)*d[0],c.y+=u.internals.positionAbsolute.y-(n.height??0)*d[1]}return c}function F0(e,n){if(e.size!==n.size)return!1;for(const s of e)if(!n.has(s))return!1;return!0}function bA(){let e,n;return{promise:new Promise((a,o)=>{e=a,n=o}),resolve:e,reject:n}}function SA(e){return{...Gb,...e||{}}}function $o(e,{snapGrid:n=[0,0],snapToGrid:s=!1,transform:a,containerBounds:o}){const{x:c,y:u}=Yn(e),d=wl({x:c-(o?.left??0),y:u-(o?.top??0)},a),{x:h,y:p}=s?ur(d,n):d;return{xSnapped:h,ySnapped:p,...d}}const dm=e=>({width:e.offsetWidth,height:e.offsetHeight}),t1=e=>e?.getRootNode?.()||window?.document,wA=["INPUT","SELECT","TEXTAREA"];function n1(e){const n=e.composedPath?.()?.[0]||e.target;return n?.nodeType!==1?!1:wA.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const i1=e=>"clientX"in e,Yn=(e,n)=>{const s=i1(e),a=s?e.clientX:e.touches?.[0].clientX,o=s?e.clientY:e.touches?.[0].clientY;return{x:a-(n?.left??0),y:o-(n?.top??0)}},J0=(e,n,s,a,o)=>{const c=n.querySelectorAll(`.${e}`);return!c||!c.length?null:Array.from(c).map(u=>{const d=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:o,position:u.getAttribute("data-handlepos"),x:(d.left-s.left)/a,y:(d.top-s.top)/a,...dm(u)}})};function s1({sourceX:e,sourceY:n,targetX:s,targetY:a,sourceControlX:o,sourceControlY:c,targetControlX:u,targetControlY:d}){const h=e*.125+o*.375+u*.375+s*.125,p=n*.125+c*.375+d*.375+a*.125,v=Math.abs(h-e),g=Math.abs(p-n);return[h,p,v,g]}function Rc(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function W0({pos:e,x1:n,y1:s,x2:a,y2:o,c}){switch(e){case me.Left:return[n-Rc(n-a,c),s];case me.Right:return[n+Rc(a-n,c),s];case me.Top:return[n,s-Rc(s-o,c)];case me.Bottom:return[n,s+Rc(o-s,c)]}}function a1({sourceX:e,sourceY:n,sourcePosition:s=me.Bottom,targetX:a,targetY:o,targetPosition:c=me.Top,curvature:u=.25}){const[d,h]=W0({pos:s,x1:e,y1:n,x2:a,y2:o,c:u}),[p,v]=W0({pos:c,x1:a,y1:o,x2:e,y2:n,c:u}),[g,y,w,x]=s1({sourceX:e,sourceY:n,targetX:a,targetY:o,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:v});return[`M${e},${n} C${d},${h} ${p},${v} ${a},${o}`,g,y,w,x]}function l1({sourceX:e,sourceY:n,targetX:s,targetY:a}){const o=Math.abs(s-e)/2,c=s<e?s+o:s-o,u=Math.abs(a-n)/2,d=a<n?a+u:a-u;return[c,d,o,u]}function xA({sourceNode:e,targetNode:n,selected:s=!1,zIndex:a=0,elevateOnSelect:o=!1,zIndexMode:c="basic"}){if(c==="manual")return a;const u=o&&s?a+1e3:a,d=Math.max(e.parentId||o&&e.selected?e.internals.z:0,n.parentId||o&&n.selected?n.internals.z:0);return u+d}function EA({sourceNode:e,targetNode:n,width:s,height:a,transform:o}){const c=Eu(uu(e),uu(n));c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u={x:-o[0]/o[2],y:-o[1]/o[2],width:s/o[2],height:a/o[2]};return Fo(u,Nu(c))>0}const NA=({source:e,sourceHandle:n,target:s,targetHandle:a})=>`xy-edge__${e}${n||""}-${s}${a||""}`,_A=(e,n)=>n.some(s=>s.source===e.source&&s.target===e.target&&(s.sourceHandle===e.sourceHandle||!s.sourceHandle&&!e.sourceHandle)&&(s.targetHandle===e.targetHandle||!s.targetHandle&&!e.targetHandle)),AA=(e,n,s={})=>{if(!e.source||!e.target)return s.onError?.("006",Gn.error006()),n;const a=s.getEdgeId||NA;let o;return Zb(e)?o={...e}:o={...e,id:a(e)},_A(o,n)?n:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,n.concat(o))};function o1({sourceX:e,sourceY:n,targetX:s,targetY:a}){const[o,c,u,d]=l1({sourceX:e,sourceY:n,targetX:s,targetY:a});return[`M ${e},${n}L ${s},${a}`,o,c,u,d]}const P0={[me.Left]:{x:-1,y:0},[me.Right]:{x:1,y:0},[me.Top]:{x:0,y:-1},[me.Bottom]:{x:0,y:1}},TA=({source:e,sourcePosition:n=me.Bottom,target:s})=>n===me.Left||n===me.Right?e.x<s.x?{x:1,y:0}:{x:-1,y:0}:e.y<s.y?{x:0,y:1}:{x:0,y:-1},ev=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function CA({source:e,sourcePosition:n=me.Bottom,target:s,targetPosition:a=me.Top,center:o,offset:c,stepPosition:u}){const d=P0[n],h=P0[a],p={x:e.x+d.x*c,y:e.y+d.y*c},v={x:s.x+h.x*c,y:s.y+h.y*c},g=TA({source:p,sourcePosition:n,target:v}),y=g.x!==0?"x":"y",w=g[y];let x=[],E,A;const T={x:0,y:0},z={x:0,y:0},[,,_,N]=l1({sourceX:e.x,sourceY:e.y,targetX:s.x,targetY:s.y});if(d[y]*h[y]===-1){y==="x"?(E=o.x??p.x+(v.x-p.x)*u,A=o.y??(p.y+v.y)/2):(E=o.x??(p.x+v.x)/2,A=o.y??p.y+(v.y-p.y)*u);const L=[{x:E,y:p.y},{x:E,y:v.y}],I=[{x:p.x,y:A},{x:v.x,y:A}];d[y]===w?x=y==="x"?L:I:x=y==="x"?I:L}else{const L=[{x:p.x,y:v.y}],I=[{x:v.x,y:p.y}];if(y==="x"?x=d.x===w?I:L:x=d.y===w?L:I,n===a){const H=Math.abs(e[y]-s[y]);if(H<=c){const O=Math.min(c-1,c-H);d[y]===w?T[y]=(p[y]>e[y]?-1:1)*O:z[y]=(v[y]>s[y]?-1:1)*O}}if(n!==a){const H=y==="x"?"y":"x",O=d[y]===h[H],C=p[H]>v[H],B=p[H]<v[H];(d[y]===1&&(!O&&C||O&&B)||d[y]!==1&&(!O&&B||O&&C))&&(x=y==="x"?L:I)}const V={x:p.x+T.x,y:p.y+T.y},G={x:v.x+z.x,y:v.y+z.y},Z=Math.max(Math.abs(V.x-x[0].x),Math.abs(G.x-x[0].x)),le=Math.max(Math.abs(V.y-x[0].y),Math.abs(G.y-x[0].y));Z>=le?(E=(V.x+G.x)/2,A=x[0].y):(E=x[0].x,A=(V.y+G.y)/2)}const j={x:p.x+T.x,y:p.y+T.y},D={x:v.x+z.x,y:v.y+z.y};return[[e,...j.x!==x[0].x||j.y!==x[0].y?[j]:[],...x,...D.x!==x[x.length-1].x||D.y!==x[x.length-1].y?[D]:[],s],E,A,_,N]}function MA(e,n,s,a){const o=Math.min(ev(e,n)/2,ev(n,s)/2,a),{x:c,y:u}=n;if(e.x===c&&c===s.x||e.y===u&&u===s.y)return`L${c} ${u}`;if(e.y===u){const p=e.x<s.x?-1:1,v=e.y<s.y?1:-1;return`L ${c+o*p},${u}Q ${c},${u} ${c},${u+o*v}`}const d=e.x<s.x?1:-1,h=e.y<s.y?-1:1;return`L ${c},${u+o*h}Q ${c},${u} ${c+o*d},${u}`}function Lh({sourceX:e,sourceY:n,sourcePosition:s=me.Bottom,targetX:a,targetY:o,targetPosition:c=me.Top,borderRadius:u=5,centerX:d,centerY:h,offset:p=20,stepPosition:v=.5}){const[g,y,w,x,E]=CA({source:{x:e,y:n},sourcePosition:s,target:{x:a,y:o},targetPosition:c,center:{x:d,y:h},offset:p,stepPosition:v});let A=`M${g[0].x} ${g[0].y}`;for(let T=1;T<g.length-1;T++)A+=MA(g[T-1],g[T],g[T+1],u);return A+=`L${g[g.length-1].x} ${g[g.length-1].y}`,[A,y,w,x,E]}function tv(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function OA(e){const{sourceNode:n,targetNode:s}=e;if(!tv(n)||!tv(s))return null;const a=n.internals.handleBounds||nv(n.handles),o=s.internals.handleBounds||nv(s.handles),c=iv(a?.source??[],e.sourceHandle),u=iv(e.connectionMode===dl.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!c||!u)return e.onError?.("008",Gn.error008(c?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const d=c?.position||me.Bottom,h=u?.position||me.Top,p=Fs(n,c,d),v=Fs(s,u,h);return{sourceX:p.x,sourceY:p.y,targetX:v.x,targetY:v.y,sourcePosition:d,targetPosition:h}}function nv(e){if(!e)return null;const n=[],s=[];for(const a of e)a.width=a.width??1,a.height=a.height??1,a.type==="source"?n.push(a):a.type==="target"&&s.push(a);return{source:n,target:s}}function Fs(e,n,s=me.Left,a=!1){const o=(n?.x??0)+e.internals.positionAbsolute.x,c=(n?.y??0)+e.internals.positionAbsolute.y,{width:u,height:d}=n??ji(e);if(a)return{x:o+u/2,y:c+d/2};switch(n?.position??s){case me.Top:return{x:o+u/2,y:c};case me.Right:return{x:o+u,y:c+d/2};case me.Bottom:return{x:o+u/2,y:c+d};case me.Left:return{x:o,y:c+d/2}}}function iv(e,n){return e&&(n?e.find(s=>s.id===n):e[0])||null}function $h(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(a=>`${a}=${e[a]}`).join("&")}`:""}function kA(e,{id:n,defaultColor:s,defaultMarkerStart:a,defaultMarkerEnd:o}){const c=new Set;return e.reduce((u,d)=>([d.markerStart||a,d.markerEnd||o].forEach(h=>{if(h&&typeof h=="object"){const p=$h(h,n);c.has(p)||(u.push({id:p,color:h.color||s,...h}),c.add(p))}}),u),[]).sort((u,d)=>u.id.localeCompare(d.id))}const r1=1e3,zA=10,hm={nodeOrigin:[0,0],nodeExtent:Ko,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},DA={...hm,checkEquality:!0};function mm(e,n){const s={...e};for(const a in n)n[a]!==void 0&&(s[a]=n[a]);return s}function jA(e,n,s){const a=mm(hm,s);for(const o of e.values())if(o.parentId)gm(o,e,n,a);else{const c=rr(o,a.nodeOrigin),u=Qs(o.extent)?o.extent:a.nodeExtent,d=Zs(c,u,ji(o));o.internals.positionAbsolute=d}}function RA(e,n){if(!e.handles)return e.measured?n?.internals.handleBounds:void 0;const s=[],a=[];for(const o of e.handles){const c={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?s.push(c):o.type==="target"&&a.push(c)}return{source:s,target:a}}function pm(e){return e==="manual"}function Hh(e,n,s,a={}){const o=mm(DA,a),c={i:0},u=new Map(n),d=o?.elevateNodesOnSelect&&!pm(o.zIndexMode)?r1:0;let h=e.length>0,p=!1;n.clear(),s.clear();for(const v of e){let g=u.get(v.id);if(o.checkEquality&&v===g?.internals.userNode)n.set(v.id,g);else{const y=rr(v,o.nodeOrigin),w=Qs(v.extent)?v.extent:o.nodeExtent,x=Zs(y,w,ji(v));g={...o.defaults,...v,measured:{width:v.measured?.width,height:v.measured?.height},internals:{positionAbsolute:x,handleBounds:RA(v,g),z:c1(v,d,o.zIndexMode),userNode:v}},n.set(v.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(h=!1),v.parentId&&gm(g,n,s,a,c),p||=v.selected??!1}return{nodesInitialized:h,hasSelectedNodes:p}}function BA(e,n){if(!e.parentId)return;const s=n.get(e.parentId);s?s.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function gm(e,n,s,a,o){const{elevateNodesOnSelect:c,nodeOrigin:u,nodeExtent:d,zIndexMode:h}=mm(hm,a),p=e.parentId,v=n.get(p);if(!v){console.warn(`Parent node ${p} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}BA(e,s),o&&!v.parentId&&v.internals.rootParentIndex===void 0&&h==="auto"&&(v.internals.rootParentIndex=++o.i,v.internals.z=v.internals.z+o.i*zA),o&&v.internals.rootParentIndex!==void 0&&(o.i=v.internals.rootParentIndex);const g=c&&!pm(h)?r1:0,{x:y,y:w,z:x}=LA(e,v,u,d,g,h),{positionAbsolute:E}=e.internals,A=y!==E.x||w!==E.y;(A||x!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:A?{x:y,y:w}:E,z:x}})}function c1(e,n,s){const a=Vn(e.zIndex)?e.zIndex:0;return pm(s)?a:a+(e.selected?n:0)}function LA(e,n,s,a,o,c){const{x:u,y:d}=n.internals.positionAbsolute,h=ji(e),p=rr(e,s),v=Qs(e.extent)?Zs(p,e.extent,h):p;let g=Zs({x:u+v.x,y:d+v.y},a,h);e.extent==="parent"&&(g=Fb(g,h,n));const y=c1(e,o,c),w=n.internals.z??0;return{x:g.x,y:g.y,z:w>=y?w+1:y}}function ym(e,n,s,a=[0,0]){const o=[],c=new Map;for(const u of e){const d=n.get(u.parentId);if(!d)continue;const h=c.get(u.parentId)?.expandedRect??ml(d),p=Jb(h,u.rect);c.set(u.parentId,{expandedRect:p,parent:d})}return c.size>0&&c.forEach(({expandedRect:u,parent:d},h)=>{const p=d.internals.positionAbsolute,v=ji(d),g=d.origin??a,y=u.x<p.x?Math.round(Math.abs(p.x-u.x)):0,w=u.y<p.y?Math.round(Math.abs(p.y-u.y)):0,x=Math.max(v.width,Math.round(u.width)),E=Math.max(v.height,Math.round(u.height)),A=(x-v.width)*g[0],T=(E-v.height)*g[1];(y>0||w>0||A||T)&&(o.push({id:h,type:"position",position:{x:d.position.x-y+A,y:d.position.y-w+T}}),s.get(h)?.forEach(z=>{e.some(_=>_.id===z.id)||o.push({id:z.id,type:"position",position:{x:z.position.x+y,y:z.position.y+w}})})),(v.width<u.width||v.height<u.height||y||w)&&o.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:x+(y?g[0]*y-A:0),height:E+(w?g[1]*w-T:0)}})}),o}function $A(e,n,s,a,o,c,u){const d=a?.querySelector(".xyflow__viewport");let h=!1;if(!d)return{changes:[],updatedInternals:h};const p=[],v=window.getComputedStyle(d),{m22:g}=new window.DOMMatrixReadOnly(v.transform),y=[];for(const w of e.values()){const x=n.get(w.id);if(!x)continue;if(x.hidden){n.set(x.id,{...x,internals:{...x.internals,handleBounds:void 0}}),h=!0;continue}const E=dm(w.nodeElement),A=x.measured.width!==E.width||x.measured.height!==E.height;if(!!(E.width&&E.height&&(A||!x.internals.handleBounds||w.force))){const z=w.nodeElement.getBoundingClientRect(),_=Qs(x.extent)?x.extent:c;let{positionAbsolute:N}=x.internals;x.parentId&&x.extent==="parent"?N=Fb(N,E,n.get(x.parentId)):_&&(N=Zs(N,_,E));const j={...x,measured:E,internals:{...x.internals,positionAbsolute:N,handleBounds:{source:J0("source",w.nodeElement,z,g,x.id),target:J0("target",w.nodeElement,z,g,x.id)}}};n.set(x.id,j),x.parentId&&gm(j,n,s,{nodeOrigin:o,zIndexMode:u}),h=!0,A&&(p.push({id:x.id,type:"dimensions",dimensions:E}),x.expandParent&&x.parentId&&y.push({id:x.id,parentId:x.parentId,rect:ml(j,o)}))}}if(y.length>0){const w=ym(y,n,s,o);p.push(...w)}return{changes:p,updatedInternals:h}}async function HA({delta:e,panZoom:n,transform:s,translateExtent:a,width:o,height:c}){if(!n||!e.x&&!e.y)return!1;const u=await n.setViewportConstrained({x:s[0]+e.x,y:s[1]+e.y,zoom:s[2]},[[0,0],[o,c]],a);return!!u&&(u.x!==s[0]||u.y!==s[1]||u.k!==s[2])}function sv(e,n,s,a,o,c){let u=o;const d=a.get(u)||new Map;a.set(u,d.set(s,n)),u=`${o}-${e}`;const h=a.get(u)||new Map;if(a.set(u,h.set(s,n)),c){u=`${o}-${e}-${c}`;const p=a.get(u)||new Map;a.set(u,p.set(s,n))}}function u1(e,n,s){e.clear(),n.clear();for(const a of s){const{source:o,target:c,sourceHandle:u=null,targetHandle:d=null}=a,h={edgeId:a.id,source:o,target:c,sourceHandle:u,targetHandle:d},p=`${o}-${u}--${c}-${d}`,v=`${c}-${d}--${o}-${u}`;sv("source",h,v,e,o,u),sv("target",h,p,e,c,d),n.set(a.id,a)}}function f1(e,n){if(!e.parentId)return!1;const s=n.get(e.parentId);return s?s.selected?!0:f1(s,n):!1}function av(e,n,s){let a=e;do{if(a?.matches?.(n))return!0;if(a===s)return!1;a=a?.parentElement}while(a);return!1}function UA(e,n,s,a){const o=new Map;for(const[c,u]of e)if((u.selected||u.id===a)&&(!u.parentId||!f1(u,e))&&(u.draggable||n&&typeof u.draggable>"u")){const d=e.get(c);d&&o.set(c,{id:c,position:d.position||{x:0,y:0},distance:{x:s.x-d.internals.positionAbsolute.x,y:s.y-d.internals.positionAbsolute.y},extent:d.extent,parentId:d.parentId,origin:d.origin,expandParent:d.expandParent,internals:{positionAbsolute:d.internals.positionAbsolute||{x:0,y:0}},measured:{width:d.measured.width??0,height:d.measured.height??0}})}return o}function oh({nodeId:e,dragItems:n,nodeLookup:s,dragging:a=!0}){const o=[];for(const[u,d]of n){const h=s.get(u)?.internals.userNode;h&&o.push({...h,position:d.position,dragging:a})}if(!e)return[o[0],o];const c=s.get(e)?.internals.userNode;return[c?{...c,position:n.get(e)?.position||c.position,dragging:a}:o[0],o]}function IA({dragItems:e,snapGrid:n,x:s,y:a}){const o=e.values().next().value;if(!o)return null;const c={x:s-o.distance.x,y:a-o.distance.y},u=ur(c,n);return{x:u.x-c.x,y:u.y-c.y}}function qA({onNodeMouseDown:e,getStoreItems:n,onDragStart:s,onDrag:a,onDragStop:o}){let c={x:null,y:null},u=0,d=new Map,h=!1,p={x:0,y:0},v=null,g=!1,y=null,w=!1,x=!1,E=null;function A({noDragClassName:z,handleSelector:_,domNode:N,isSelectable:j,nodeId:D,nodeClickDistance:$=0}){y=cn(N);function L({x:Z,y:le}){const{nodeLookup:H,nodeExtent:O,snapGrid:C,snapToGrid:B,nodeOrigin:R,onNodeDrag:K,onSelectionDrag:ee,onError:k,updateNodePositions:U}=n();c={x:Z,y:le};let P=!1;const se=d.size>1,fe=se&&O?Bh(cr(d)):null,de=se&&B?IA({dragItems:d,snapGrid:C,x:Z,y:le}):null;for(const[ae,ne]of d){if(!H.has(ae))continue;let ce={x:Z-ne.distance.x,y:le-ne.distance.y};B&&(ce=de?{x:Math.round(ce.x+de.x),y:Math.round(ce.y+de.y)}:ur(ce,C));let Se=null;if(se&&O&&!ne.extent&&fe){const{positionAbsolute:pe}=ne.internals,Ee=pe.x-fe.x+O[0][0],Ce=pe.x+ne.measured.width-fe.x2+O[1][0],Ue=pe.y-fe.y+O[0][1],Pe=pe.y+ne.measured.height-fe.y2+O[1][1];Se=[[Ee,Ue],[Ce,Pe]]}const{position:we,positionAbsolute:ge}=Qb({nodeId:ae,nextPosition:ce,nodeLookup:H,nodeExtent:Se||O,nodeOrigin:R,onError:k});P=P||ne.position.x!==we.x||ne.position.y!==we.y,ne.position=we,ne.internals.positionAbsolute=ge}if(x=x||P,!!P&&(U(d,!0),E&&(a||K||!D&&ee))){const[ae,ne]=oh({nodeId:D,dragItems:d,nodeLookup:H});a?.(E,d,ae,ne),K?.(E,ae,ne),D||ee?.(E,ne)}}async function I(){if(!v)return;const{transform:Z,panBy:le,autoPanSpeed:H,autoPanOnNodeDrag:O}=n();if(!O){h=!1,cancelAnimationFrame(u);return}const[C,B]=um(p,v,H);(C!==0||B!==0)&&(c.x=(c.x??0)-C/Z[2],c.y=(c.y??0)-B/Z[2],await le({x:C,y:B})&&L(c)),u=requestAnimationFrame(I)}function V(Z){const{nodeLookup:le,multiSelectionActive:H,nodesDraggable:O,transform:C,snapGrid:B,snapToGrid:R,selectNodesOnDrag:K,onNodeDragStart:ee,onSelectionDragStart:k,unselectNodesAndEdges:U}=n();g=!0,(!K||!j)&&!H&&D&&(le.get(D)?.selected||U()),j&&K&&D&&e?.(D);const P=$o(Z.sourceEvent,{transform:C,snapGrid:B,snapToGrid:R,containerBounds:v});if(c=P,d=UA(le,O,P,D),d.size>0&&(s||ee||!D&&k)){const[se,fe]=oh({nodeId:D,dragItems:d,nodeLookup:le});s?.(Z.sourceEvent,d,se,fe),ee?.(Z.sourceEvent,se,fe),D||k?.(Z.sourceEvent,fe)}}const G=Cb().clickDistance($).on("start",Z=>{const{domNode:le,nodeDragThreshold:H,transform:O,snapGrid:C,snapToGrid:B}=n();v=le?.getBoundingClientRect()||null,w=!1,x=!1,E=Z.sourceEvent,H===0&&V(Z),c=$o(Z.sourceEvent,{transform:O,snapGrid:C,snapToGrid:B,containerBounds:v}),p=Yn(Z.sourceEvent,v)}).on("drag",Z=>{const{autoPanOnNodeDrag:le,transform:H,snapGrid:O,snapToGrid:C,nodeDragThreshold:B,nodeLookup:R}=n(),K=$o(Z.sourceEvent,{transform:H,snapGrid:O,snapToGrid:C,containerBounds:v});if(E=Z.sourceEvent,(Z.sourceEvent.type==="touchmove"&&Z.sourceEvent.touches.length>1||D&&!R.has(D))&&(w=!0),!w){if(!h&&le&&g&&(h=!0,I()),!g){const ee=Yn(Z.sourceEvent,v),k=ee.x-p.x,U=ee.y-p.y;Math.sqrt(k*k+U*U)>B&&V(Z)}(c.x!==K.xSnapped||c.y!==K.ySnapped)&&d&&g&&(p=Yn(Z.sourceEvent,v),L(K))}}).on("end",Z=>{if(!g||w){w&&d.size>0&&n().updateNodePositions(d,!1);return}if(h=!1,g=!1,cancelAnimationFrame(u),d.size>0){const{nodeLookup:le,updateNodePositions:H,onNodeDragStop:O,onSelectionDragStop:C}=n();if(x&&(H(d,!1),x=!1),o||O||!D&&C){const[B,R]=oh({nodeId:D,dragItems:d,nodeLookup:le,dragging:!1});o?.(Z.sourceEvent,d,B,R),O?.(Z.sourceEvent,B,R),D||C?.(Z.sourceEvent,R)}}}).filter(Z=>{const le=Z.target;return!Z.button&&(!z||!av(le,`.${z}`,N))&&(!_||av(le,_,N))});y.call(G)}function T(){y?.on(".drag",null)}return{update:A,destroy:T}}function VA(e,n,s){const a=[],o={x:e.x-s,y:e.y-s,width:s*2,height:s*2};for(const c of n.values())Fo(o,ml(c))>0&&a.push(c);return a}const YA=250;function GA(e,n,s,a){let o=[],c=1/0;const u=VA(e,s,n+YA);for(const d of u){const h=[...d.internals.handleBounds?.source??[],...d.internals.handleBounds?.target??[]];for(const p of h){if(a.nodeId===p.nodeId&&a.type===p.type&&a.id===p.id)continue;const{x:v,y:g}=Fs(d,p,p.position,!0),y=Math.sqrt(Math.pow(v-e.x,2)+Math.pow(g-e.y,2));y>n||(y<c?(o=[{...p,x:v,y:g}],c=y):y===c&&o.push({...p,x:v,y:g}))}}if(!o.length)return null;if(o.length>1){const d=a.type==="source"?"target":"source";return o.find(h=>h.type===d)??o[0]}return o[0]}function d1(e,n,s,a,o,c=!1){const u=a.get(e);if(!u)return null;const d=o==="strict"?u.internals.handleBounds?.[n]:[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]],h=(s?d?.find(p=>p.id===s):d?.[0])??null;return h&&c?{...h,...Fs(u,h,h.position,!0)}:h}function h1(e,n){return e||(n?.classList.contains("target")?"target":n?.classList.contains("source")?"source":null)}function XA(e,n){let s=null;return n?s=!0:e&&!n&&(s=!1),s}const m1=()=>!0;function KA(e,{connectionMode:n,connectionRadius:s,handleId:a,nodeId:o,edgeUpdaterType:c,isTarget:u,domNode:d,nodeLookup:h,lib:p,autoPanOnConnect:v,flowId:g,panBy:y,cancelConnection:w,onConnectStart:x,onConnect:E,onConnectEnd:A,isValidConnection:T=m1,onReconnectEnd:z,updateConnection:_,getTransform:N,getFromHandle:j,autoPanSpeed:D,dragThreshold:$=1,handleDomNode:L}){const I=t1(e.target);let V=0,G;const{x:Z,y:le}=Yn(e),H=h1(c,L),O=d?.getBoundingClientRect();let C=!1;if(!O||!H)return;const B=d1(o,H,a,h,n);if(!B)return;let R=Yn(e,O),K=!1,ee=null,k=!1,U=null;function P(){if(!v||!O)return;const[we,ge]=um(R,O,D);y({x:we,y:ge}),V=requestAnimationFrame(P)}const se={...B,nodeId:o,type:H,position:B.position},fe=h.get(o);let ae={inProgress:!0,isValid:null,from:Fs(fe,se,me.Left,!0),fromHandle:se,fromPosition:se.position,fromNode:fe,to:R,toHandle:null,toPosition:K0[se.position],toNode:null,pointer:R};function ne(){C=!0,_(ae),x?.(e,{nodeId:o,handleId:a,handleType:H})}$===0&&ne();function ce(we){if(!C){const{x:Pe,y:zt}=Yn(we),ot=Pe-Z,wt=zt-le;if(!(ot*ot+wt*wt>$*$))return;ne()}if(!j()||!se){Se(we);return}const ge=N();R=Yn(we,O),G=GA(wl(R,ge,!1,[1,1]),s,h,se),K||(P(),K=!0);const pe=p1(we,{handle:G,connectionMode:n,fromNodeId:o,fromHandleId:a,fromType:u?"target":"source",isValidConnection:T,doc:I,lib:p,flowId:g,nodeLookup:h});U=pe.handleDomNode,ee=pe.connection,k=XA(!!G,pe.isValid);const Ee=h.get(o),Ce=Ee?Fs(Ee,se,me.Left,!0):ae.from,Ue={...ae,from:Ce,isValid:k,to:pe.toHandle&&k?pl({x:pe.toHandle.x,y:pe.toHandle.y},ge):R,toHandle:pe.toHandle,toPosition:k&&pe.toHandle?pe.toHandle.position:K0[se.position],toNode:pe.toHandle?h.get(pe.toHandle.nodeId):null,pointer:R};_(Ue),ae=Ue}function Se(we){if(!("touches"in we&&we.touches.length>0)){if(C){(G||U)&&ee&&k&&E?.(ee);const{inProgress:ge,...pe}=ae,Ee={...pe,toPosition:ae.toHandle?ae.toPosition:null};A?.(we,Ee),c&&z?.(we,Ee)}w(),cancelAnimationFrame(V),K=!1,k=!1,ee=null,U=null,I.removeEventListener("mousemove",ce),I.removeEventListener("mouseup",Se),I.removeEventListener("touchmove",ce),I.removeEventListener("touchend",Se)}}I.addEventListener("mousemove",ce),I.addEventListener("mouseup",Se),I.addEventListener("touchmove",ce),I.addEventListener("touchend",Se)}function p1(e,{handle:n,connectionMode:s,fromNodeId:a,fromHandleId:o,fromType:c,doc:u,lib:d,flowId:h,isValidConnection:p=m1,nodeLookup:v}){const g=c==="target",y=n?u.querySelector(`.${d}-flow__handle[data-id="${h}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x:w,y:x}=Yn(e),E=u.elementFromPoint(w,x),A=E?.classList.contains(`${d}-flow__handle`)?E:y,T={handleDomNode:A,isValid:!1,connection:null,toHandle:null};if(A){const z=h1(void 0,A),_=A.getAttribute("data-nodeid"),N=A.getAttribute("data-handleid"),j=A.classList.contains("connectable"),D=A.classList.contains("connectableend");if(!_||!z)return T;const $={source:g?_:a,sourceHandle:g?N:o,target:g?a:_,targetHandle:g?o:N};T.connection=$;const I=j&&D&&(s===dl.Strict?g&&z==="source"||!g&&z==="target":_!==a||N!==o);T.isValid=I&&p($),T.toHandle=d1(_,z,N,v,s,!0)}return T}const Uh={onPointerDown:KA,isValid:p1};function ZA({domNode:e,panZoom:n,getTransform:s,getViewScale:a}){const o=cn(e);function c({translateExtent:d,width:h,height:p,zoomStep:v=1,pannable:g=!0,zoomable:y=!0,inversePan:w=!1}){const x=_=>{if(_.sourceEvent.type!=="wheel"||!n)return;const N=s(),j=_.sourceEvent.ctrlKey&&Jo()?10:1,D=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*v,$=N[2]*Math.pow(2,D*j);n.scaleTo($)};let E=[0,0];const A=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(E=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},T=_=>{const N=s();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!n)return;const j=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],D=[j[0]-E[0],j[1]-E[1]];E=j;const $=a()*Math.max(N[2],Math.log(N[2]))*(w?-1:1),L={x:N[0]-D[0]*$,y:N[1]-D[1]*$},I=[[0,0],[h,p]];n.setViewportConstrained({x:L.x,y:L.y,zoom:N[2]},I,d)},z=Vb().on("start",A).on("zoom",g?T:null).on("zoom.wheel",y?x:null);o.call(z,{})}function u(){o.on("zoom",null)}return{update:c,destroy:u,pointer:Un}}const _u=e=>({x:e.x,y:e.y,zoom:e.k}),rh=({x:e,y:n,zoom:s})=>xu.translate(e,n).scale(s),Qa=(e,n)=>e.target.closest(`.${n}`),g1=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),QA=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,ch=(e,n=0,s=QA,a=()=>{})=>{const o=typeof n=="number"&&n>0;return o||a(),o?e.transition().duration(n).ease(s).on("end",a):e},y1=e=>{const n=e.ctrlKey&&Jo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function FA({zoomPanValues:e,noWheelClassName:n,d3Selection:s,d3Zoom:a,panOnScrollMode:o,panOnScrollSpeed:c,zoomOnPinch:u,onPanZoomStart:d,onPanZoom:h,onPanZoomEnd:p}){return v=>{if(Qa(v,n))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const g=s.property("__zoom").k||1;if(v.ctrlKey&&u){const A=Un(v),T=y1(v),z=g*Math.pow(2,T);a.scaleTo(s,z,A,v);return}const y=v.deltaMode===1?20:1;let w=o===Gs.Vertical?0:v.deltaX*y,x=o===Gs.Horizontal?0:v.deltaY*y;!Jo()&&v.shiftKey&&o!==Gs.Vertical&&(w=v.deltaY*y,x=0),a.translateBy(s,-(w/g)*c,-(x/g)*c,{internal:!0});const E=_u(s.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h?.(v,E),e.panScrollTimeout=setTimeout(()=>{p?.(v,E),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,d?.(v,E))}}function JA({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:s}){return function(a,o){const c=a.type==="wheel",u=!n&&c&&!a.ctrlKey,d=Qa(a,e);if(a.ctrlKey&&c&&d&&a.preventDefault(),u||d)return null;a.preventDefault(),s.call(this,a,o)}}function WA({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:s}){return a=>{if(a.sourceEvent?.internal)return;const o=_u(a.transform);e.mouseButton=a.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,a.sourceEvent?.type==="mousedown"&&n(!0),s&&s?.(a.sourceEvent,o)}}function PA({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:s,onTransformChange:a,onPanZoom:o}){return c=>{e.usedRightMouseButton=!!(s&&g1(n,e.mouseButton??0)),c.sourceEvent?.sync||a([c.transform.x,c.transform.y,c.transform.k]),o&&!c.sourceEvent?.internal&&o?.(c.sourceEvent,_u(c.transform))}}function eT({zoomPanValues:e,panOnDrag:n,panOnScroll:s,onDraggingChange:a,onPanZoomEnd:o,onPaneContextMenu:c}){return u=>{if(!u.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,c&&g1(n,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&c(u.sourceEvent),e.usedRightMouseButton=!1,a(!1),o)){const d=_u(u.transform);e.prevViewport=d,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(u.sourceEvent,d)},s?150:0)}}}function tT({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:s,panOnDrag:a,panOnScroll:o,zoomOnDoubleClick:c,userSelectionActive:u,noWheelClassName:d,noPanClassName:h,lib:p,connectionInProgress:v}){return g=>{const y=e||n,w=s&&g.ctrlKey,x=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(Qa(g,`${p}-flow__node`)||Qa(g,`${p}-flow__edge`)))return!0;if(!a&&!y&&!o&&!c&&!s||u||v&&!x||Qa(g,d)&&x||Qa(g,h)&&(!x||o&&x&&!e)||!s&&g.ctrlKey&&x)return!1;if(!s&&g.type==="touchstart"&&g.touches?.length>1)return g.preventDefault(),!1;if(!y&&!o&&!w&&x||!a&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(a)&&!a.includes(g.button)&&g.type==="mousedown")return!1;const E=Array.isArray(a)&&a.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||x)&&E}}function nT({domNode:e,minZoom:n,maxZoom:s,translateExtent:a,viewport:o,onPanZoom:c,onPanZoomStart:u,onPanZoomEnd:d,onDraggingChange:h}){const p={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},v=e.getBoundingClientRect(),g=Vb().scaleExtent([n,s]).translateExtent(a),y=cn(e).call(g);z({x:o.x,y:o.y,zoom:hl(o.zoom,n,s)},[[0,0],[v.width,v.height]],a);const w=y.on("wheel.zoom"),x=y.on("dblclick.zoom");g.wheelDelta(y1);async function E(G,Z){return y?new Promise(le=>{g?.interpolate(Z?.interpolate==="linear"?Lo:Xc).transform(ch(y,Z?.duration,Z?.ease,()=>le(!0)),G)}):!1}function A({noWheelClassName:G,noPanClassName:Z,onPaneContextMenu:le,userSelectionActive:H,panOnScroll:O,panOnDrag:C,panOnScrollMode:B,panOnScrollSpeed:R,preventScrolling:K,zoomOnPinch:ee,zoomOnScroll:k,zoomOnDoubleClick:U,zoomActivationKeyPressed:P,lib:se,onTransformChange:fe,connectionInProgress:de,paneClickDistance:ae,selectionOnDrag:ne}){H&&!p.isZoomingOrPanning&&T();const ce=O&&!P&&!H;g.clickDistance(ne?1/0:!Vn(ae)||ae<0?0:ae);const Se=ce?FA({zoomPanValues:p,noWheelClassName:G,d3Selection:y,d3Zoom:g,panOnScrollMode:B,panOnScrollSpeed:R,zoomOnPinch:ee,onPanZoomStart:u,onPanZoom:c,onPanZoomEnd:d}):JA({noWheelClassName:G,preventScrolling:K,d3ZoomHandler:w});y.on("wheel.zoom",Se,{passive:!1});const we=WA({zoomPanValues:p,onDraggingChange:h,onPanZoomStart:u});g.on("start",we);const ge=PA({zoomPanValues:p,panOnDrag:C,onPaneContextMenu:!!le,onPanZoom:c,onTransformChange:fe});g.on("zoom",ge);const pe=eT({zoomPanValues:p,panOnDrag:C,panOnScroll:O,onPaneContextMenu:le,onPanZoomEnd:d,onDraggingChange:h});g.on("end",pe);const Ee=tT({zoomActivationKeyPressed:P,panOnDrag:C,zoomOnScroll:k,panOnScroll:O,zoomOnDoubleClick:U,zoomOnPinch:ee,userSelectionActive:H,noPanClassName:Z,noWheelClassName:G,lib:se,connectionInProgress:de});g.filter(Ee),U?y.on("dblclick.zoom",x):y.on("dblclick.zoom",null)}function T(){g.on("zoom",null)}async function z(G,Z,le){const H=rh(G),O=g?.constrain()(H,Z,le);return O&&await E(O),O}async function _(G,Z){const le=rh(G);return await E(le,Z),le}function N(G){if(y){const Z=rh(G),le=y.property("__zoom");(le.k!==G.zoom||le.x!==G.x||le.y!==G.y)&&g?.transform(y,Z,null,{sync:!0})}}function j(){const G=y?qb(y.node()):{x:0,y:0,k:1};return{x:G.x,y:G.y,zoom:G.k}}async function D(G,Z){return y?new Promise(le=>{g?.interpolate(Z?.interpolate==="linear"?Lo:Xc).scaleTo(ch(y,Z?.duration,Z?.ease,()=>le(!0)),G)}):!1}async function $(G,Z){return y?new Promise(le=>{g?.interpolate(Z?.interpolate==="linear"?Lo:Xc).scaleBy(ch(y,Z?.duration,Z?.ease,()=>le(!0)),G)}):!1}function L(G){g?.scaleExtent(G)}function I(G){g?.translateExtent(G)}function V(G){const Z=!Vn(G)||G<0?0:G;g?.clickDistance(Z)}return{update:A,destroy:T,setViewport:_,setViewportConstrained:z,getViewport:j,scaleTo:D,scaleBy:$,setScaleExtent:L,setTranslateExtent:I,syncViewport:N,setClickDistance:V}}var gl;(function(e){e.Line="line",e.Handle="handle"})(gl||(gl={}));function iT({width:e,prevWidth:n,height:s,prevHeight:a,affectsX:o,affectsY:c}){const u=e-n,d=s-a,h=[u>0?1:u<0?-1:0,d>0?1:d<0?-1:0];return u&&o&&(h[0]=h[0]*-1),d&&c&&(h[1]=h[1]*-1),h}function lv(e){const n=e.includes("right")||e.includes("left"),s=e.includes("bottom")||e.includes("top"),a=e.includes("left"),o=e.includes("top");return{isHorizontal:n,isVertical:s,affectsX:a,affectsY:o}}function ds(e,n){return Math.max(0,n-e)}function hs(e,n){return Math.max(0,e-n)}function Bc(e,n,s){return Math.max(0,n-e,e-s)}function ov(e,n){return e?!n:n}function sT(e,n,s,a,o,c,u,d){let{affectsX:h,affectsY:p}=n;const{isHorizontal:v,isVertical:g}=n,y=v&&g,{xSnapped:w,ySnapped:x}=s,{minWidth:E,maxWidth:A,minHeight:T,maxHeight:z}=a,{x:_,y:N,width:j,height:D,aspectRatio:$}=e;let L=Math.floor(v?w-e.pointerX:0),I=Math.floor(g?x-e.pointerY:0);const V=j+(h?-L:L),G=D+(p?-I:I),Z=-c[0]*j,le=-c[1]*D;let H=Bc(V,E,A),O=Bc(G,T,z);if(u){let R=0,K=0;h&&L<0?R=ds(_+L+Z,u[0][0]):!h&&L>0&&(R=hs(_+V+Z,u[1][0])),p&&I<0?K=ds(N+I+le,u[0][1]):!p&&I>0&&(K=hs(N+G+le,u[1][1])),H=Math.max(H,R),O=Math.max(O,K)}if(d){let R=0,K=0;h&&L>0?R=hs(_+L,d[0][0]):!h&&L<0&&(R=ds(_+V,d[1][0])),p&&I>0?K=hs(N+I,d[0][1]):!p&&I<0&&(K=ds(N+G,d[1][1])),H=Math.max(H,R),O=Math.max(O,K)}if(o){if(v){const R=Bc(V/$,T,z)*$;if(H=Math.max(H,R),u){let K=0;!h&&!p||h&&!p&&y?K=hs(N+le+V/$,u[1][1])*$:K=ds(N+le+(h?L:-L)/$,u[0][1])*$,H=Math.max(H,K)}if(d){let K=0;!h&&!p||h&&!p&&y?K=ds(N+V/$,d[1][1])*$:K=hs(N+(h?L:-L)/$,d[0][1])*$,H=Math.max(H,K)}}if(g){const R=Bc(G*$,E,A)/$;if(O=Math.max(O,R),u){let K=0;!h&&!p||p&&!h&&y?K=hs(_+G*$+Z,u[1][0])/$:K=ds(_+(p?I:-I)*$+Z,u[0][0])/$,O=Math.max(O,K)}if(d){let K=0;!h&&!p||p&&!h&&y?K=ds(_+G*$,d[1][0])/$:K=hs(_+(p?I:-I)*$,d[0][0])/$,O=Math.max(O,K)}}}I=I+(I<0?O:-O),L=L+(L<0?H:-H),o&&(y?V>G*$?I=(ov(h,p)?-L:L)/$:L=(ov(h,p)?-I:I)*$:v?(I=L/$,p=h):(L=I*$,h=p));const C=h?_+L:_,B=p?N+I:N;return{width:j+(h?-L:L),height:D+(p?-I:I),x:c[0]*L*(h?-1:1)+C,y:c[1]*I*(p?-1:1)+B}}const v1={width:0,height:0,x:0,y:0},aT={...v1,pointerX:0,pointerY:0,aspectRatio:1};function lT(e,n,s){const a=n.position.x+e.position.x,o=n.position.y+e.position.y,c=e.measured.width??0,u=e.measured.height??0,d=s[0]*c,h=s[1]*u;return[[a-d,o-h],[a+c-d,o+u-h]]}function oT({domNode:e,nodeId:n,getStoreItems:s,onChange:a,onEnd:o}){const c=cn(e);let u={controlDirection:lv("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function d({controlPosition:p,boundaries:v,keepAspectRatio:g,resizeDirection:y,onResizeStart:w,onResize:x,onResizeEnd:E,shouldResize:A}){let T={...v1},z={...aT};u={boundaries:v,resizeDirection:y,keepAspectRatio:g,controlDirection:lv(p)};let _,N=null,j=[],D,$,L,I=!1;const V=Cb().on("start",G=>{const{nodeLookup:Z,transform:le,snapGrid:H,snapToGrid:O,nodeOrigin:C,paneDomNode:B}=s();if(_=Z.get(n),!_)return;N=B?.getBoundingClientRect()??null;const{xSnapped:R,ySnapped:K}=$o(G.sourceEvent,{transform:le,snapGrid:H,snapToGrid:O,containerBounds:N});T={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},z={...T,pointerX:R,pointerY:K,aspectRatio:T.width/T.height},D=void 0,$=Qs(_.extent)?_.extent:void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(D=Z.get(_.parentId)),D&&_.extent==="parent"&&($=[[0,0],[D.measured.width,D.measured.height]]),j=[],L=void 0;for(const[ee,k]of Z)if(k.parentId===n&&(j.push({id:ee,position:{...k.position},extent:k.extent}),k.extent==="parent"||k.expandParent)){const U=lT(k,_,k.origin??C);L?L=[[Math.min(U[0][0],L[0][0]),Math.min(U[0][1],L[0][1])],[Math.max(U[1][0],L[1][0]),Math.max(U[1][1],L[1][1])]]:L=U}w?.(G,{...T})}).on("drag",G=>{const{transform:Z,snapGrid:le,snapToGrid:H,nodeOrigin:O}=s(),C=$o(G.sourceEvent,{transform:Z,snapGrid:le,snapToGrid:H,containerBounds:N}),B=[];if(!_)return;const{x:R,y:K,width:ee,height:k}=T,U={},P=_.origin??O,{width:se,height:fe,x:de,y:ae}=sT(z,u.controlDirection,C,u.boundaries,u.keepAspectRatio,P,$,L),ne=se!==ee,ce=fe!==k,Se=de!==R&&ne,we=ae!==K&&ce;if(!Se&&!we&&!ne&&!ce)return;if((Se||we||P[0]===1||P[1]===1)&&(U.x=Se?de:T.x,U.y=we?ae:T.y,T.x=U.x,T.y=U.y,j.length>0)){const Ce=de-R,Ue=ae-K;for(const Pe of j)Pe.position={x:Pe.position.x-Ce+P[0]*(se-ee),y:Pe.position.y-Ue+P[1]*(fe-k)},B.push(Pe)}if((ne||ce)&&(U.width=ne&&(!u.resizeDirection||u.resizeDirection==="horizontal")?se:T.width,U.height=ce&&(!u.resizeDirection||u.resizeDirection==="vertical")?fe:T.height,T.width=U.width,T.height=U.height),D&&_.expandParent){const Ce=P[0]*(U.width??0);U.x&&U.x<Ce&&(T.x=Ce,z.x=z.x-(U.x-Ce));const Ue=P[1]*(U.height??0);U.y&&U.y<Ue&&(T.y=Ue,z.y=z.y-(U.y-Ue))}const ge=iT({width:T.width,prevWidth:ee,height:T.height,prevHeight:k,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),pe={...T,direction:ge};A?.(G,pe)!==!1&&(I=!0,x?.(G,pe),a(U,B))}).on("end",G=>{I&&(E?.(G,{...T}),o?.({...T}),I=!1)});c.call(V)}function h(){c.on(".drag",null)}return{update:d,destroy:h}}var uh={exports:{}},fh={},dh={exports:{}},hh={};var rv;function rT(){if(rv)return hh;rv=1;var e=ar();function n(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var s=typeof Object.is=="function"?Object.is:n,a=e.useState,o=e.useEffect,c=e.useLayoutEffect,u=e.useDebugValue;function d(g,y){var w=y(),x=a({inst:{value:w,getSnapshot:y}}),E=x[0].inst,A=x[1];return c(function(){E.value=w,E.getSnapshot=y,h(E)&&A({inst:E})},[g,w,y]),o(function(){return h(E)&&A({inst:E}),g(function(){h(E)&&A({inst:E})})},[g]),u(w),w}function h(g){var y=g.getSnapshot;g=g.value;try{var w=y();return!s(g,w)}catch{return!0}}function p(g,y){return y()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:d;return hh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,hh}var cv;function cT(){return cv||(cv=1,dh.exports=rT()),dh.exports}var uv;function uT(){if(uv)return fh;uv=1;var e=ar(),n=cT();function s(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var a=typeof Object.is=="function"?Object.is:s,o=n.useSyncExternalStore,c=e.useRef,u=e.useEffect,d=e.useMemo,h=e.useDebugValue;return fh.useSyncExternalStoreWithSelector=function(p,v,g,y,w){var x=c(null);if(x.current===null){var E={hasValue:!1,value:null};x.current=E}else E=x.current;x=d(function(){function T(D){if(!z){if(z=!0,_=D,D=y(D),w!==void 0&&E.hasValue){var $=E.value;if(w($,D))return N=$}return N=D}if($=N,a(_,D))return $;var L=y(D);return w!==void 0&&w($,L)?(_=D,$):(_=D,N=L)}var z=!1,_,N,j=g===void 0?null:g;return[function(){return T(v())},j===null?void 0:function(){return T(j())}]},[v,g,y,w]);var A=o(p,x[0],x[1]);return u(function(){E.hasValue=!0,E.value=A},[A]),h(A),A},fh}var fv;function fT(){return fv||(fv=1,uh.exports=uT()),uh.exports}var dT=fT();const hT=db(dT),mT={},dv=e=>{let n;const s=new Set,a=(v,g)=>{const y=typeof v=="function"?v(n):v;if(!Object.is(y,n)){const w=n;n=g??(typeof y!="object"||y===null)?y:Object.assign({},n,y),s.forEach(x=>x(n,w))}},o=()=>n,h={setState:a,getState:o,getInitialState:()=>p,subscribe:v=>(s.add(v),()=>s.delete(v)),destroy:()=>{(mT?"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()}},p=n=e(a,o,h);return h},pT=e=>e?dv(e):dv,{useDebugValue:gT}=Sl,{useSyncExternalStoreWithSelector:yT}=hT,vT=e=>e;function b1(e,n=vT,s){const a=yT(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,s);return gT(a),a}const hv=(e,n)=>{const s=pT(e),a=(o,c=n)=>b1(s,o,c);return Object.assign(a,s),a},bT=(e,n)=>e?hv(e,n):hv;function nt(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[a,o]of e)if(!Object.is(o,n.get(a)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const a of e)if(!n.has(a))return!1;return!0}const s=Object.keys(e);if(s.length!==Object.keys(n).length)return!1;for(const a of s)if(!Object.prototype.hasOwnProperty.call(n,a)||!Object.is(e[a],n[a]))return!1;return!0}var ST=hb();const Au=Y.createContext(null),wT=Au.Provider,S1=Gn.error001("react");function Re(e,n){const s=Y.useContext(Au);if(s===null)throw new Error(S1);return b1(s,e,n)}function st(){const e=Y.useContext(Au);if(e===null)throw new Error(S1);return Y.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const mv={display:"none"},xT={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},w1="react-flow__node-desc",x1="react-flow__edge-desc",ET="react-flow__aria-live",NT=e=>e.ariaLiveMessage,_T=e=>e.ariaLabelConfig;function AT({rfId:e}){const n=Re(NT);return S.jsx("div",{id:`${ET}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:xT,children:n})}function TT({rfId:e,disableKeyboardA11y:n}){const s=Re(_T);return S.jsxs(S.Fragment,{children:[S.jsx("div",{id:`${w1}-${e}`,style:mv,children:n?s["node.a11yDescription.default"]:s["node.a11yDescription.keyboardDisabled"]}),S.jsx("div",{id:`${x1}-${e}`,style:mv,children:s["edge.a11yDescription.default"]}),!n&&S.jsx(AT,{rfId:e})]})}const Tu=Y.forwardRef(({position:e="top-left",children:n,className:s,style:a,...o},c)=>{const u=`${e}`.split("-");return S.jsx("div",{className:St(["react-flow__panel",s,...u]),style:a,ref:c,...o,children:n})});Tu.displayName="Panel";function CT({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:S.jsx(Tu,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:S.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const MT=e=>{const n=[],s=[];for(const[,a]of e.nodeLookup)a.selected&&n.push(a.internals.userNode);for(const[,a]of e.edgeLookup)a.selected&&s.push(a);return{selectedNodes:n,selectedEdges:s}},Lc=e=>e.id;function OT(e,n){return nt(e.selectedNodes.map(Lc),n.selectedNodes.map(Lc))&&nt(e.selectedEdges.map(Lc),n.selectedEdges.map(Lc))}function kT({onSelectionChange:e}){const n=st(),{selectedNodes:s,selectedEdges:a}=Re(MT,OT);return Y.useEffect(()=>{const o={nodes:s,edges:a};e?.(o),n.getState().onSelectionChangeHandlers.forEach(c=>c(o))},[s,a,e]),null}const zT=e=>!!e.onSelectionChangeHandlers;function DT({onSelectionChange:e}){const n=Re(zT);return e||n?S.jsx(kT,{onSelectionChange:e}):null}const E1=[0,0],jT={x:0,y:0,zoom:1},RT=["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"],pv=[...RT,"rfId"],BT=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),gv={translateExtent:Ko,nodeOrigin:E1,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function LT(e){const{setNodes:n,setEdges:s,setMinZoom:a,setMaxZoom:o,setTranslateExtent:c,setNodeExtent:u,reset:d,setDefaultNodesAndEdges:h}=Re(BT,nt),p=st();Y.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{v.current=gv,d()}),[]);const v=Y.useRef(gv);return Y.useEffect(()=>{for(const g of pv){const y=e[g],w=v.current[g];y!==w&&(typeof e[g]>"u"||(g==="nodes"?n(y):g==="edges"?s(y):g==="minZoom"?a(y):g==="maxZoom"?o(y):g==="translateExtent"?c(y):g==="nodeExtent"?u(y):g==="ariaLabelConfig"?p.setState({ariaLabelConfig:SA(y)}):g==="fitView"?p.setState({fitViewQueued:y}):g==="fitViewOptions"?p.setState({fitViewOptions:y}):p.setState({[g]:y})))}v.current=e},pv.map(g=>e[g])),null}function yv(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function $T(e){const[n,s]=Y.useState(e==="system"?null:e);return Y.useEffect(()=>{if(e!=="system"){s(e);return}const a=yv(),o=()=>s(a?.matches?"dark":"light");return o(),a?.addEventListener("change",o),()=>{a?.removeEventListener("change",o)}},[e]),n!==null?n:yv()?.matches?"dark":"light"}const vv=typeof document<"u"?document:null;function Wo(e=null,n={target:vv,actInsideInputWithModifier:!0}){const[s,a]=Y.useState(!1),o=Y.useRef(!1),c=Y.useRef(new Set([])),[u,d]=Y.useMemo(()=>{if(e!==null){const p=(Array.isArray(e)?e:[e]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
10
+ `).replace(`
11
+
12
+ `,`
13
+ +`).split(`
14
+ `)),v=p.reduce((g,y)=>g.concat(...y),[]);return[p,v]}return[[],[]]},[e]);return Y.useEffect(()=>{const h=n?.target??vv,p=n?.actInsideInputWithModifier??!0;if(e!==null){const v=w=>{if(o.current=w.ctrlKey||w.metaKey||w.shiftKey||w.altKey,(!o.current||o.current&&!p)&&n1(w))return!1;const E=Sv(w.code,d);if(c.current.add(w[E]),bv(u,c.current,!1)){const A=w.composedPath?.()?.[0]||w.target,T=A?.nodeName==="BUTTON"||A?.nodeName==="A";n.preventDefault!==!1&&(o.current||!T)&&w.preventDefault(),a(!0)}},g=w=>{const x=Sv(w.code,d);bv(u,c.current,!0)?(a(!1),c.current.clear()):c.current.delete(w[x]),w.key==="Meta"&&c.current.clear(),o.current=!1},y=()=>{c.current.clear(),a(!1)};return h?.addEventListener("keydown",v),h?.addEventListener("keyup",g),window.addEventListener("blur",y),window.addEventListener("contextmenu",y),()=>{h?.removeEventListener("keydown",v),h?.removeEventListener("keyup",g),window.removeEventListener("blur",y),window.removeEventListener("contextmenu",y)}}},[e,a]),s}function bv(e,n,s){return e.filter(a=>s||a.length===n.size).some(a=>a.every(o=>n.has(o)))}function Sv(e,n){return n.includes(e)?"code":"key"}const HT=()=>{const e=st();return Y.useMemo(()=>({zoomIn:async n=>{const{panZoom:s}=e.getState();return s?s.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:s}=e.getState();return s?s.scaleBy(1/1.2,n):!1},zoomTo:async(n,s)=>{const{panZoom:a}=e.getState();return a?a.scaleTo(n,s):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,s)=>{const{transform:[a,o,c],panZoom:u}=e.getState();return u?(await u.setViewport({x:n.x??a,y:n.y??o,zoom:n.zoom??c},s),!0):!1},getViewport:()=>{const[n,s,a]=e.getState().transform;return{x:n,y:s,zoom:a}},setCenter:async(n,s,a)=>e.getState().setCenter(n,s,a),fitBounds:async(n,s)=>{const{width:a,height:o,minZoom:c,maxZoom:u,panZoom:d}=e.getState(),h=fm(n,a,o,c,u,s?.padding??.1);return d?(await d.setViewport(h,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),!0):!1},screenToFlowPosition:(n,s={})=>{const{transform:a,snapGrid:o,snapToGrid:c,domNode:u}=e.getState();if(!u)return n;const{x:d,y:h}=u.getBoundingClientRect(),p={x:n.x-d,y:n.y-h},v=s.snapGrid??o,g=s.snapToGrid??c;return wl(p,a,g,v)},flowToScreenPosition:n=>{const{transform:s,domNode:a}=e.getState();if(!a)return n;const{x:o,y:c}=a.getBoundingClientRect(),u=pl(n,s);return{x:u.x+o,y:u.y+c}}}),[])};function N1(e,n){const s=[],a=new Map,o=[];for(const c of e)if(c.type==="add"){o.push(c);continue}else if(c.type==="remove"||c.type==="replace")a.set(c.id,[c]);else{const u=a.get(c.id);u?u.push(c):a.set(c.id,[c])}for(const c of n){const u=a.get(c.id);if(!u){s.push(c);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){s.push({...u[0].item});continue}const d={...c};for(const h of u)UT(h,d);s.push(d)}return o.length&&o.forEach(c=>{c.index!==void 0?s.splice(c.index,0,{...c.item}):s.push({...c.item})}),s}function UT(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function IT(e,n){return N1(e,n)}function qT(e,n){return N1(e,n)}function Hs(e,n){return{id:e,type:"select",selected:n}}function Fa(e,n=new Set,s=!1){const a=[];for(const[o,c]of e){const u=n.has(o);!(c.selected===void 0&&!u)&&c.selected!==u&&(s&&(c.selected=u),a.push(Hs(c.id,u)))}return a}function wv({items:e=[],lookup:n}){const s=[],a=new Map(e.map(o=>[o.id,o]));for(const[o,c]of e.entries()){const u=n.get(c.id),d=u?.internals?.userNode??u;d!==void 0&&d!==c&&s.push({id:c.id,item:c,type:"replace"}),d===void 0&&s.push({item:c,type:"add",index:o})}for(const[o]of n)a.get(o)===void 0&&s.push({id:o,type:"remove"});return s}function xv(e){return{id:e.id,type:"remove"}}const VT=Wb();function YT(e,n,s={}){return AA(e,n,{...s,onError:s.onError??VT})}const Ev=e=>fA(e),GT=e=>Zb(e);function _1(e){return Y.forwardRef(e)}const XT=typeof window<"u"?Y.useLayoutEffect:Y.useEffect;function Nv(e){const[n,s]=Y.useState(BigInt(0)),[a]=Y.useState(()=>KT(()=>s(o=>o+BigInt(1))));return XT(()=>{const o=a.get();o.length&&(e(o),a.reset())},[n]),a}function KT(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:s=>{n.push(s),e()}}}const A1=Y.createContext(null);function ZT({children:e}){const n=st(),s=Y.useCallback(d=>{const{nodes:h=[],setNodes:p,hasDefaultNodes:v,onNodesChange:g,nodeLookup:y,fitViewQueued:w,onNodesChangeMiddlewareMap:x}=n.getState();let E=h;for(const T of d)E=typeof T=="function"?T(E):T;let A=wv({items:E,lookup:y});for(const T of x.values())A=T(A);v&&p(E),A.length>0?g?.(A):w&&window.requestAnimationFrame(()=>{const{fitViewQueued:T,nodes:z,setNodes:_}=n.getState();T&&_(z)})},[]),a=Nv(s),o=Y.useCallback(d=>{const{edges:h=[],setEdges:p,hasDefaultEdges:v,onEdgesChange:g,edgeLookup:y}=n.getState();let w=h;for(const x of d)w=typeof x=="function"?x(w):x;v?p(w):g&&g(wv({items:w,lookup:y}))},[]),c=Nv(o),u=Y.useMemo(()=>({nodeQueue:a,edgeQueue:c}),[]);return S.jsx(A1.Provider,{value:u,children:e})}function QT(){const e=Y.useContext(A1);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const FT=e=>!!e.panZoom;function fr(){const e=HT(),n=st(),s=QT(),a=Re(FT),o=Y.useMemo(()=>{const c=g=>n.getState().nodeLookup.get(g),u=g=>{s.nodeQueue.push(g)},d=g=>{s.edgeQueue.push(g)},h=g=>{const{nodeLookup:y,nodeOrigin:w}=n.getState(),x=Ev(g)?g:y.get(g.id),E=x.parentId?e1(x.position,x.measured,x.parentId,y,w):x.position,A={...x,position:E,width:x.measured?.width??x.width,height:x.measured?.height??x.height};return ml(A)},p=(g,y,w={replace:!1})=>{u(x=>x.map(E=>{if(E.id===g){const A=typeof y=="function"?y(E):y;return w.replace&&Ev(A)?A:{...E,...A}}return E}))},v=(g,y,w={replace:!1})=>{d(x=>x.map(E=>{if(E.id===g){const A=typeof y=="function"?y(E):y;return w.replace&&GT(A)?A:{...E,...A}}return E}))};return{getNodes:()=>n.getState().nodes.map(g=>({...g})),getNode:g=>c(g)?.internals.userNode,getInternalNode:c,getEdges:()=>{const{edges:g=[]}=n.getState();return g.map(y=>({...y}))},getEdge:g=>n.getState().edgeLookup.get(g),setNodes:u,setEdges:d,addNodes:g=>{const y=Array.isArray(g)?g:[g];s.nodeQueue.push(w=>[...w,...y])},addEdges:g=>{const y=Array.isArray(g)?g:[g];s.edgeQueue.push(w=>[...w,...y])},toObject:()=>{const{nodes:g=[],edges:y=[],transform:w}=n.getState(),[x,E,A]=w;return{nodes:g.map(T=>({...T})),edges:y.map(T=>({...T})),viewport:{x,y:E,zoom:A}}},deleteElements:async({nodes:g=[],edges:y=[]})=>{const{nodes:w,edges:x,onNodesDelete:E,onEdgesDelete:A,triggerNodeChanges:T,triggerEdgeChanges:z,onDelete:_,onBeforeDelete:N}=n.getState(),{nodes:j,edges:D}=await gA({nodesToRemove:g,edgesToRemove:y,nodes:w,edges:x,onBeforeDelete:N}),$=D.length>0,L=j.length>0;if($){const I=D.map(xv);A?.(D),z(I)}if(L){const I=j.map(xv);E?.(j),T(I)}return(L||$)&&_?.({nodes:j,edges:D}),{deletedNodes:j,deletedEdges:D}},getIntersectingNodes:(g,y=!0,w)=>{const x=Q0(g),E=x?g:h(g),A=w!==void 0;return E?(w||n.getState().nodes).filter(T=>{const z=n.getState().nodeLookup.get(T.id);if(z&&!x&&(T.id===g.id||!z.internals.positionAbsolute))return!1;const _=ml(A?T:z),N=Fo(_,E);return y&&N>0||N>=_.width*_.height||N>=E.width*E.height}):[]},isNodeIntersecting:(g,y,w=!0)=>{const E=Q0(g)?g:h(g);if(!E)return!1;const A=Fo(E,y);return w&&A>0||A>=y.width*y.height||A>=E.width*E.height},updateNode:p,updateNodeData:(g,y,w={replace:!1})=>{p(g,x=>{const E=typeof y=="function"?y(x):y;return w.replace?{...x,data:E}:{...x,data:{...x.data,...E}}},w)},updateEdge:v,updateEdgeData:(g,y,w={replace:!1})=>{v(g,x=>{const E=typeof y=="function"?y(x):y;return w.replace?{...x,data:E}:{...x,data:{...x.data,...E}}},w)},getNodesBounds:g=>{const{nodeLookup:y,nodeOrigin:w}=n.getState();return dA(g,{nodeLookup:y,nodeOrigin:w})},getHandleConnections:({type:g,id:y,nodeId:w})=>Array.from(n.getState().connectionLookup.get(`${w}-${g}${y?`-${y}`:""}`)?.values()??[]),getNodeConnections:({type:g,handleId:y,nodeId:w})=>Array.from(n.getState().connectionLookup.get(`${w}${g?y?`-${g}-${y}`:`-${g}`:""}`)?.values()??[]),fitView:async g=>{const y=n.getState().fitViewResolver??bA();return n.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:y}),s.nodeQueue.push(w=>[...w]),y.promise}}},[]);return Y.useMemo(()=>({...o,...e,viewportInitialized:a}),[a])}const _v=e=>e.selected,JT=typeof window<"u"?window:void 0;function WT({deleteKeyCode:e,multiSelectionKeyCode:n}){const s=st(),{deleteElements:a}=fr(),o=Wo(e,{actInsideInputWithModifier:!1}),c=Wo(n,{target:JT});Y.useEffect(()=>{if(o){const{edges:u,nodes:d}=s.getState();a({nodes:d.filter(_v),edges:u.filter(_v)}),s.setState({nodesSelectionActive:!1})}},[o]),Y.useEffect(()=>{s.setState({multiSelectionActive:c})},[c])}function PT(e){const n=st();Y.useEffect(()=>{const s=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const a=dm(e.current);(a.height===0||a.width===0)&&n.getState().onError?.("004",Gn.error004()),n.setState({width:a.width||500,height:a.height||500})};if(e.current){s(),window.addEventListener("resize",s);const a=new ResizeObserver(()=>s());return a.observe(e.current),()=>{window.removeEventListener("resize",s),a&&e.current&&a.unobserve(e.current)}}},[])}const Cu={position:"absolute",width:"100%",height:"100%",top:0,left:0},eC=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function tC({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:s=!0,panOnScroll:a=!1,panOnScrollSpeed:o=.5,panOnScrollMode:c=Gs.Free,zoomOnDoubleClick:u=!0,panOnDrag:d=!0,defaultViewport:h,translateExtent:p,minZoom:v,maxZoom:g,zoomActivationKeyCode:y,preventScrolling:w=!0,children:x,noWheelClassName:E,noPanClassName:A,onViewportChange:T,isControlledViewport:z,paneClickDistance:_,selectionOnDrag:N}){const j=st(),D=Y.useRef(null),{userSelectionActive:$,lib:L,connectionInProgress:I}=Re(eC,nt),V=Wo(y),G=Y.useRef();PT(D);const Z=Y.useCallback(le=>{T?.({x:le[0],y:le[1],zoom:le[2]}),z||j.setState({transform:le})},[T,z]);return Y.useEffect(()=>{if(D.current){G.current=nT({domNode:D.current,minZoom:v,maxZoom:g,translateExtent:p,viewport:h,onDraggingChange:C=>j.setState(B=>B.paneDragging===C?B:{paneDragging:C}),onPanZoomStart:(C,B)=>{const{onViewportChangeStart:R,onMoveStart:K}=j.getState();K?.(C,B),R?.(B)},onPanZoom:(C,B)=>{const{onViewportChange:R,onMove:K}=j.getState();K?.(C,B),R?.(B)},onPanZoomEnd:(C,B)=>{const{onViewportChangeEnd:R,onMoveEnd:K}=j.getState();K?.(C,B),R?.(B)}});const{x:le,y:H,zoom:O}=G.current.getViewport();return j.setState({panZoom:G.current,transform:[le,H,O],domNode:D.current.closest(".react-flow")}),()=>{G.current?.destroy()}}},[]),Y.useEffect(()=>{G.current?.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:s,panOnScroll:a,panOnScrollSpeed:o,panOnScrollMode:c,zoomOnDoubleClick:u,panOnDrag:d,zoomActivationKeyPressed:V,preventScrolling:w,noPanClassName:A,userSelectionActive:$,noWheelClassName:E,lib:L,onTransformChange:Z,connectionInProgress:I,selectionOnDrag:N,paneClickDistance:_})},[e,n,s,a,o,c,u,d,V,w,A,$,E,L,Z,I,N,_]),S.jsx("div",{className:"react-flow__renderer",ref:D,style:Cu,children:x})}const nC=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function iC(){const{userSelectionActive:e,userSelectionRect:n}=Re(nC,nt);return e&&n?S.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const mh=(e,n)=>s=>{s.target===n.current&&e?.(s)},sC=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function aC({isSelecting:e,selectionKeyPressed:n,selectionMode:s=Zo.Full,panOnDrag:a,autoPanOnSelection:o,paneClickDistance:c,selectionOnDrag:u,onSelectionStart:d,onSelectionEnd:h,onPaneClick:p,onPaneContextMenu:v,onPaneScroll:g,onPaneMouseEnter:y,onPaneMouseMove:w,onPaneMouseLeave:x,children:E}){const A=Y.useRef(0),T=st(),{userSelectionActive:z,elementsSelectable:_,dragging:N,connectionInProgress:j,panBy:D,autoPanSpeed:$}=Re(sC,nt),L=_&&(e||z),I=Y.useRef(null),V=Y.useRef(),G=Y.useRef(new Set),Z=Y.useRef(new Set),le=Y.useRef(!1),H=Y.useRef({x:0,y:0}),O=Y.useRef(!1),C=ne=>{if(le.current||j){le.current=!1;return}p?.(ne),T.getState().resetSelectedElements(),T.setState({nodesSelectionActive:!1})},B=ne=>{if(Array.isArray(a)&&a?.includes(2)){ne.preventDefault();return}v?.(ne)},R=g?ne=>g(ne):void 0,K=ne=>{le.current&&(ne.stopPropagation(),le.current=!1)},ee=ne=>{const{domNode:ce,transform:Se}=T.getState();if(V.current=ce?.getBoundingClientRect(),!V.current)return;const we=ne.target===I.current;if(!we&&!!ne.target.closest(".nokey")||!e||!(u&&we||n)||ne.button!==0||!ne.isPrimary)return;ne.target?.setPointerCapture?.(ne.pointerId),le.current=!1;const{x:Ee,y:Ce}=Yn(ne.nativeEvent,V.current),Ue=wl({x:Ee,y:Ce},Se);T.setState({userSelectionRect:{width:0,height:0,startX:Ue.x,startY:Ue.y,x:Ee,y:Ce}}),we||(ne.stopPropagation(),ne.preventDefault())};function k(ne,ce){const{userSelectionRect:Se}=T.getState();if(!Se)return;const{transform:we,nodeLookup:ge,edgeLookup:pe,connectionLookup:Ee,triggerNodeChanges:Ce,triggerEdgeChanges:Ue,defaultEdgeOptions:Pe}=T.getState(),zt={x:Se.startX,y:Se.startY},{x:ot,y:wt}=pl(zt,we),Dt={startX:zt.x,startY:zt.y,x:ne<ot?ne:ot,y:ce<wt?ce:wt,width:Math.abs(ne-ot),height:Math.abs(ce-wt)},kn=G.current,_t=Z.current;G.current=new Set(cm(ge,Dt,we,s===Zo.Partial,!0).map(ut=>ut.id)),Z.current=new Set;const Ke=Pe?.selectable??!0;for(const ut of G.current){const Ut=Ee.get(ut);if(Ut)for(const{edgeId:Lt}of Ut.values()){const jt=pe.get(Lt);jt&&(jt.selectable??Ke)&&Z.current.add(Lt)}}if(!F0(kn,G.current)){const ut=Fa(ge,G.current,!0);Ce(ut)}if(!F0(_t,Z.current)){const ut=Fa(pe,Z.current);Ue(ut)}T.setState({userSelectionRect:Dt,userSelectionActive:!0,nodesSelectionActive:!1})}function U(){if(!o||!V.current)return;const[ne,ce]=um(H.current,V.current,$);D({x:ne,y:ce}).then(Se=>{if(!le.current||!Se){A.current=requestAnimationFrame(U);return}const{x:we,y:ge}=H.current;k(we,ge),A.current=requestAnimationFrame(U)})}const P=()=>{cancelAnimationFrame(A.current),A.current=0,O.current=!1};Y.useEffect(()=>()=>P(),[]);const se=ne=>{const{userSelectionRect:ce,transform:Se,resetSelectedElements:we}=T.getState();if(!V.current||!ce)return;const{x:ge,y:pe}=Yn(ne.nativeEvent,V.current);H.current={x:ge,y:pe};const Ee=pl({x:ce.startX,y:ce.startY},Se);if(!le.current){const Ce=n?0:c;if(Math.hypot(ge-Ee.x,pe-Ee.y)<=Ce)return;we(),d?.(ne)}le.current=!0,O.current||(U(),O.current=!0),k(ge,pe)},fe=ne=>{ne.button===0&&(ne.target?.releasePointerCapture?.(ne.pointerId),!z&&ne.target===I.current&&T.getState().userSelectionRect&&C?.(ne),T.setState({userSelectionActive:!1,userSelectionRect:null}),le.current&&(h?.(ne),T.setState({nodesSelectionActive:G.current.size>0})),P())},de=ne=>{ne.target?.releasePointerCapture?.(ne.pointerId),P()},ae=a===!0||Array.isArray(a)&&a.includes(0);return S.jsxs("div",{className:St(["react-flow__pane",{draggable:ae,dragging:N,selection:e}]),onClick:L?void 0:mh(C,I),onContextMenu:mh(B,I),onWheel:mh(R,I),onPointerEnter:L?void 0:y,onPointerMove:L?se:w,onPointerUp:L?fe:void 0,onPointerCancel:L?de:void 0,onPointerDownCapture:L?ee:void 0,onClickCapture:L?K:void 0,onPointerLeave:x,ref:I,style:Cu,children:[E,S.jsx(iC,{})]})}function Ih({id:e,store:n,unselect:s=!1,nodeRef:a}){const{addSelectedNodes:o,unselectNodesAndEdges:c,multiSelectionActive:u,nodeLookup:d,onError:h}=n.getState(),p=d.get(e);if(!p){h?.("012",Gn.error012(e));return}n.setState({nodesSelectionActive:!1}),p.selected?(s||p.selected&&u)&&(c({nodes:[p],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):o([e])}function T1({nodeRef:e,disabled:n=!1,noDragClassName:s,handleSelector:a,nodeId:o,isSelectable:c,nodeClickDistance:u}){const d=st(),[h,p]=Y.useState(!1),v=Y.useRef();return Y.useEffect(()=>{v.current=qA({getStoreItems:()=>d.getState(),onNodeMouseDown:g=>{Ih({id:g,store:d,nodeRef:e})},onDragStart:()=>{p(!0)},onDragStop:()=>{p(!1)}})},[]),Y.useEffect(()=>{if(!(n||!e.current||!v.current))return v.current.update({noDragClassName:s,handleSelector:a,domNode:e.current,isSelectable:c,nodeId:o,nodeClickDistance:u}),()=>{v.current?.destroy()}},[s,a,n,c,e,o,u]),h}const lC=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function C1(){const e=st();return Y.useCallback(s=>{const{nodeExtent:a,snapToGrid:o,snapGrid:c,nodesDraggable:u,onError:d,updateNodePositions:h,nodeLookup:p,nodeOrigin:v}=e.getState(),g=new Map,y=lC(u),w=o?c[0]:5,x=o?c[1]:5,E=s.direction.x*w*s.factor,A=s.direction.y*x*s.factor;for(const[,T]of p){if(!y(T))continue;let z={x:T.internals.positionAbsolute.x+E,y:T.internals.positionAbsolute.y+A};o&&(z=ur(z,c));const{position:_,positionAbsolute:N}=Qb({nodeId:T.id,nextPosition:z,nodeLookup:p,nodeExtent:a,nodeOrigin:v,onError:d});T.position=_,T.internals.positionAbsolute=N,g.set(T.id,T)}h(g)},[])}const vm=Y.createContext(null),oC=vm.Provider;vm.Consumer;const M1=()=>Y.useContext(vm),rC=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),cC=(e,n,s)=>a=>{const{connectionClickStartHandle:o,connectionMode:c,connection:u}=a,{fromHandle:d,toHandle:h,isValid:p}=u,v=h?.nodeId===e&&h?.id===n&&h?.type===s;return{connectingFrom:d?.nodeId===e&&d?.id===n&&d?.type===s,connectingTo:v,clickConnecting:o?.nodeId===e&&o?.id===n&&o?.type===s,isPossibleEndHandle:c===dl.Strict?d?.type!==s:e!==d?.nodeId||n!==d?.id,connectionInProcess:!!d,clickConnectionInProcess:!!o,valid:v&&p}};function uC({type:e="source",position:n=me.Top,isValidConnection:s,isConnectable:a=!0,isConnectableStart:o=!0,isConnectableEnd:c=!0,id:u,onConnect:d,children:h,className:p,onMouseDown:v,onTouchStart:g,...y},w){const x=u||null,E=e==="target",A=st(),T=M1(),{connectOnClick:z,noPanClassName:_,rfId:N}=Re(rC,nt),{connectingFrom:j,connectingTo:D,clickConnecting:$,isPossibleEndHandle:L,connectionInProcess:I,clickConnectionInProcess:V,valid:G}=Re(cC(T,x,e),nt);T||A.getState().onError?.("010",Gn.error010());const Z=O=>{const{defaultEdgeOptions:C,onConnect:B,hasDefaultEdges:R}=A.getState(),K={...C,...O};if(R){const{edges:ee,setEdges:k,onError:U}=A.getState();k(YT(K,ee,{onError:U}))}B?.(K),d?.(K)},le=O=>{if(!T)return;const C=i1(O.nativeEvent);if(o&&(C&&O.button===0||!C)){const B=A.getState();Uh.onPointerDown(O.nativeEvent,{handleDomNode:O.currentTarget,autoPanOnConnect:B.autoPanOnConnect,connectionMode:B.connectionMode,connectionRadius:B.connectionRadius,domNode:B.domNode,nodeLookup:B.nodeLookup,lib:B.lib,isTarget:E,handleId:x,nodeId:T,flowId:B.rfId,panBy:B.panBy,cancelConnection:B.cancelConnection,onConnectStart:B.onConnectStart,onConnectEnd:(...R)=>A.getState().onConnectEnd?.(...R),updateConnection:B.updateConnection,onConnect:Z,isValidConnection:s||((...R)=>A.getState().isValidConnection?.(...R)??!0),getTransform:()=>A.getState().transform,getFromHandle:()=>A.getState().connection.fromHandle,autoPanSpeed:B.autoPanSpeed,dragThreshold:B.connectionDragThreshold})}C?v?.(O):g?.(O)},H=O=>{const{onClickConnectStart:C,onClickConnectEnd:B,connectionClickStartHandle:R,connectionMode:K,isValidConnection:ee,lib:k,rfId:U,nodeLookup:P,connection:se}=A.getState();if(!T||!R&&!o)return;if(!R){C?.(O.nativeEvent,{nodeId:T,handleId:x,handleType:e}),A.setState({connectionClickStartHandle:{nodeId:T,type:e,id:x}});return}const fe=t1(O.target),de=s||ee,{connection:ae,isValid:ne}=Uh.isValid(O.nativeEvent,{handle:{nodeId:T,id:x,type:e},connectionMode:K,fromNodeId:R.nodeId,fromHandleId:R.id||null,fromType:R.type,isValidConnection:de,flowId:U,doc:fe,lib:k,nodeLookup:P});ne&&ae&&Z(ae);const ce=structuredClone(se);delete ce.inProgress,ce.toPosition=ce.toHandle?ce.toHandle.position:null,B?.(O,ce),A.setState({connectionClickStartHandle:null})};return S.jsx("div",{"data-handleid":x,"data-nodeid":T,"data-handlepos":n,"data-id":`${N}-${T}-${x}-${e}`,className:St(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",_,p,{source:!E,target:E,connectable:a,connectablestart:o,connectableend:c,clickconnecting:$,connectingfrom:j,connectingto:D,valid:G,connectionindicator:a&&(!I||L)&&(I||V?c:o)}]),onMouseDown:le,onTouchStart:le,onClick:z?H:void 0,ref:w,...y,children:h})}const Cn=Y.memo(_1(uC));function fC({data:e,isConnectable:n,sourcePosition:s=me.Bottom}){return S.jsxs(S.Fragment,{children:[e?.label,S.jsx(Cn,{type:"source",position:s,isConnectable:n})]})}function dC({data:e,isConnectable:n,targetPosition:s=me.Top,sourcePosition:a=me.Bottom}){return S.jsxs(S.Fragment,{children:[S.jsx(Cn,{type:"target",position:s,isConnectable:n}),e?.label,S.jsx(Cn,{type:"source",position:a,isConnectable:n})]})}function hC(){return null}function mC({data:e,isConnectable:n,targetPosition:s=me.Top}){return S.jsxs(S.Fragment,{children:[S.jsx(Cn,{type:"target",position:s,isConnectable:n}),e?.label]})}const fu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Av={input:fC,default:dC,output:mC,group:hC};function pC(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const gC=e=>{const{width:n,height:s,x:a,y:o}=cr(e.nodeLookup,{filter:c=>!!c.selected});return{width:Vn(n)?n:null,height:Vn(s)?s:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${a}px,${o}px)`}};function yC({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:s}){const a=st(),{width:o,height:c,transformString:u,userSelectionActive:d}=Re(gC,nt),h=C1(),p=Y.useRef(null);Y.useEffect(()=>{s||p.current?.focus({preventScroll:!0})},[s]);const v=!d&&o!==null&&c!==null;if(T1({nodeRef:p,disabled:!v}),!v)return null;const g=e?w=>{const x=a.getState().nodes.filter(E=>E.selected);e(w,x)}:void 0,y=w=>{Object.prototype.hasOwnProperty.call(fu,w.key)&&(w.preventDefault(),h({direction:fu[w.key],factor:w.shiftKey?4:1}))};return S.jsx("div",{className:St(["react-flow__nodesselection","react-flow__container",n]),style:{transform:u},children:S.jsx("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:s?void 0:-1,onKeyDown:s?void 0:y,style:{width:o,height:c}})})}const Tv=typeof window<"u"?window:void 0,vC=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function O1({children:e,onPaneClick:n,onPaneMouseEnter:s,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:c,onPaneScroll:u,paneClickDistance:d,deleteKeyCode:h,selectionKeyCode:p,selectionOnDrag:v,selectionMode:g,onSelectionStart:y,onSelectionEnd:w,multiSelectionKeyCode:x,panActivationKeyCode:E,zoomActivationKeyCode:A,elementsSelectable:T,zoomOnScroll:z,zoomOnPinch:_,panOnScroll:N,panOnScrollSpeed:j,panOnScrollMode:D,zoomOnDoubleClick:$,panOnDrag:L,autoPanOnSelection:I,defaultViewport:V,translateExtent:G,minZoom:Z,maxZoom:le,preventScrolling:H,onSelectionContextMenu:O,noWheelClassName:C,noPanClassName:B,disableKeyboardA11y:R,onViewportChange:K,isControlledViewport:ee}){const{nodesSelectionActive:k,userSelectionActive:U}=Re(vC,nt),P=Wo(p,{target:Tv}),se=Wo(E,{target:Tv}),fe=se||L,de=se||N,ae=v&&fe!==!0,ne=P||U||ae;return WT({deleteKeyCode:h,multiSelectionKeyCode:x}),S.jsx(tC,{onPaneContextMenu:c,elementsSelectable:T,zoomOnScroll:z,zoomOnPinch:_,panOnScroll:de,panOnScrollSpeed:j,panOnScrollMode:D,zoomOnDoubleClick:$,panOnDrag:!P&&fe,defaultViewport:V,translateExtent:G,minZoom:Z,maxZoom:le,zoomActivationKeyCode:A,preventScrolling:H,noWheelClassName:C,noPanClassName:B,onViewportChange:K,isControlledViewport:ee,paneClickDistance:d,selectionOnDrag:ae,children:S.jsxs(aC,{onSelectionStart:y,onSelectionEnd:w,onPaneClick:n,onPaneMouseEnter:s,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:c,onPaneScroll:u,panOnDrag:fe,autoPanOnSelection:I,isSelecting:!!ne,selectionMode:g,selectionKeyPressed:P,paneClickDistance:d,selectionOnDrag:ae,children:[e,k&&S.jsx(yC,{onSelectionContextMenu:O,noPanClassName:B,disableKeyboardA11y:R})]})})}O1.displayName="FlowRenderer";const bC=Y.memo(O1),SC=e=>n=>e?cm(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(s=>s.id):Array.from(n.nodeLookup.keys());function wC(e){return Re(Y.useCallback(SC(e),[e]),nt)}const xC=e=>e.updateNodeInternals;function EC(){const e=Re(xC),[n]=Y.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(s=>{const a=new Map;s.forEach(o=>{const c=o.target.getAttribute("data-id");a.set(c,{id:c,nodeElement:o.target,force:!0})}),e(a)}));return Y.useEffect(()=>()=>{n?.disconnect()},[n]),n}function NC({node:e,nodeType:n,hasDimensions:s,resizeObserver:a}){const o=st(),c=Y.useRef(null),u=Y.useRef(null),d=Y.useRef(e.sourcePosition),h=Y.useRef(e.targetPosition),p=Y.useRef(n),v=s&&!!e.internals.handleBounds;return Y.useEffect(()=>{c.current&&!e.hidden&&(!v||u.current!==c.current)&&(u.current&&a?.unobserve(u.current),a?.observe(c.current),u.current=c.current)},[v,e.hidden]),Y.useEffect(()=>()=>{u.current&&(a?.unobserve(u.current),u.current=null)},[]),Y.useEffect(()=>{if(c.current){const g=p.current!==n,y=d.current!==e.sourcePosition,w=h.current!==e.targetPosition;(g||y||w)&&(p.current=n,d.current=e.sourcePosition,h.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:c.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),c}function _C({id:e,onClick:n,onMouseEnter:s,onMouseMove:a,onMouseLeave:o,onContextMenu:c,onDoubleClick:u,nodesDraggable:d,elementsSelectable:h,nodesConnectable:p,nodesFocusable:v,resizeObserver:g,noDragClassName:y,noPanClassName:w,disableKeyboardA11y:x,rfId:E,nodeTypes:A,nodeClickDistance:T,onError:z}){const{node:_,internals:N,isParent:j}=Re(ne=>{const ce=ne.nodeLookup.get(e),Se=ne.parentLookup.has(e);return{node:ce,internals:ce.internals,isParent:Se}},nt);let D=_.type||"default",$=A?.[D]||Av[D];$===void 0&&(z?.("003",Gn.error003(D)),D="default",$=A?.default||Av.default);const L=!!(_.draggable||d&&typeof _.draggable>"u"),I=!!(_.selectable||h&&typeof _.selectable>"u"),V=!!(_.connectable||p&&typeof _.connectable>"u"),G=!!(_.focusable||v&&typeof _.focusable>"u"),Z=st(),le=Pb(_),H=NC({node:_,nodeType:D,hasDimensions:le,resizeObserver:g}),O=T1({nodeRef:H,disabled:_.hidden||!L,noDragClassName:y,handleSelector:_.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:T}),C=C1();if(_.hidden)return null;const B=ji(_),R=pC(_),K=I||L||n||s||a||o,ee=s?ne=>s(ne,{...N.userNode}):void 0,k=a?ne=>a(ne,{...N.userNode}):void 0,U=o?ne=>o(ne,{...N.userNode}):void 0,P=c?ne=>c(ne,{...N.userNode}):void 0,se=u?ne=>u(ne,{...N.userNode}):void 0,fe=ne=>{const{selectNodesOnDrag:ce,nodeDragThreshold:Se}=Z.getState();I&&(!ce||!L||Se>0)&&Ih({id:e,store:Z,nodeRef:H}),n&&n(ne,{...N.userNode})},de=ne=>{if(!(n1(ne.nativeEvent)||x)){if(Yb.includes(ne.key)&&I){const ce=ne.key==="Escape";Ih({id:e,store:Z,unselect:ce,nodeRef:H})}else if(L&&_.selected&&Object.prototype.hasOwnProperty.call(fu,ne.key)){ne.preventDefault();const{ariaLabelConfig:ce}=Z.getState();Z.setState({ariaLiveMessage:ce["node.a11yDescription.ariaLiveMessage"]({direction:ne.key.replace("Arrow","").toLowerCase(),x:~~N.positionAbsolute.x,y:~~N.positionAbsolute.y})}),C({direction:fu[ne.key],factor:ne.shiftKey?4:1})}}},ae=()=>{if(x||!H.current?.matches(":focus-visible"))return;const{transform:ne,width:ce,height:Se,autoPanOnNodeFocus:we,setCenter:ge}=Z.getState();if(!we)return;cm(new Map([[e,_]]),{x:0,y:0,width:ce,height:Se},ne,!0).length>0||ge(_.position.x+B.width/2,_.position.y+B.height/2,{zoom:ne[2]})};return S.jsx("div",{className:St(["react-flow__node",`react-flow__node-${D}`,{[w]:L},_.className,{selected:_.selected,selectable:I,parent:j,draggable:L,dragging:O}]),ref:H,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.positionAbsolute.y}px)`,pointerEvents:K?"all":"none",visibility:le?"visible":"hidden",..._.style,...R},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:ee,onMouseMove:k,onMouseLeave:U,onContextMenu:P,onClick:fe,onDoubleClick:se,onKeyDown:G?de:void 0,tabIndex:G?0:void 0,onFocus:G?ae:void 0,role:_.ariaRole??(G?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${w1}-${E}`,"aria-label":_.ariaLabel,..._.domAttributes,children:S.jsx(oC,{value:e,children:S.jsx($,{id:e,data:_.data,type:D,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:_.selected??!1,selectable:I,draggable:L,deletable:_.deletable??!0,isConnectable:V,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:O,dragHandle:_.dragHandle,zIndex:N.z,parentId:_.parentId,...B})})})}var AC=Y.memo(_C);const TC=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function k1(e){const{nodesDraggable:n,nodesConnectable:s,nodesFocusable:a,elementsSelectable:o,onError:c}=Re(TC,nt),u=wC(e.onlyRenderVisibleElements),d=EC();return S.jsx("div",{className:"react-flow__nodes",style:Cu,children:u.map(h=>S.jsx(AC,{id:h,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:d,nodesDraggable:n,nodesConnectable:s,nodesFocusable:a,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:c},h))})}k1.displayName="NodeRenderer";const CC=Y.memo(k1);function MC(e){return Re(Y.useCallback(s=>{if(!e)return s.edges.map(o=>o.id);const a=[];if(s.width&&s.height)for(const o of s.edges){const c=s.nodeLookup.get(o.source),u=s.nodeLookup.get(o.target);c&&u&&EA({sourceNode:c,targetNode:u,width:s.width,height:s.height,transform:s.transform})&&a.push(o.id)}return a},[e]),nt)}const OC=({color:e="none",strokeWidth:n=1})=>{const s={strokeWidth:n,...e&&{stroke:e}};return S.jsx("polyline",{className:"arrow",style:s,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},kC=({color:e="none",strokeWidth:n=1})=>{const s={strokeWidth:n,...e&&{stroke:e,fill:e}};return S.jsx("polyline",{className:"arrowclosed",style:s,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Cv={[Qo.Arrow]:OC,[Qo.ArrowClosed]:kC};function zC(e){const n=st();return Y.useMemo(()=>Object.prototype.hasOwnProperty.call(Cv,e)?Cv[e]:(n.getState().onError?.("009",Gn.error009(e)),null),[e])}const DC=({id:e,type:n,color:s,width:a=12.5,height:o=12.5,markerUnits:c="strokeWidth",strokeWidth:u,orient:d="auto-start-reverse"})=>{const h=zC(n);return h?S.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${a}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:d,refX:"0",refY:"0",children:S.jsx(h,{color:s,strokeWidth:u})}):null},z1=({defaultColor:e,rfId:n})=>{const s=Re(c=>c.edges),a=Re(c=>c.defaultEdgeOptions),o=Y.useMemo(()=>kA(s,{id:n,defaultColor:e,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[s,a,n,e]);return o.length?S.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:S.jsx("defs",{children:o.map(c=>S.jsx(DC,{id:c.id,type:c.type,color:c.color,width:c.width,height:c.height,markerUnits:c.markerUnits,strokeWidth:c.strokeWidth,orient:c.orient},c.id))})}):null};z1.displayName="MarkerDefinitions";var jC=Y.memo(z1);function D1({x:e,y:n,label:s,labelStyle:a,labelShowBg:o=!0,labelBgStyle:c,labelBgPadding:u=[2,4],labelBgBorderRadius:d=2,children:h,className:p,...v}){const[g,y]=Y.useState({x:1,y:0,width:0,height:0}),w=St(["react-flow__edge-textwrapper",p]),x=Y.useRef(null);return Y.useEffect(()=>{if(x.current){const E=x.current.getBBox();y({x:E.x,y:E.y,width:E.width,height:E.height})}},[s]),s?S.jsxs("g",{transform:`translate(${e-g.width/2} ${n-g.height/2})`,className:w,visibility:g.width?"visible":"hidden",...v,children:[o&&S.jsx("rect",{width:g.width+2*u[0],x:-u[0],y:-u[1],height:g.height+2*u[1],className:"react-flow__edge-textbg",style:c,rx:d,ry:d}),S.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:x,style:a,children:s}),h]}):null}D1.displayName="EdgeText";const RC=Y.memo(D1);function dr({path:e,labelX:n,labelY:s,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,interactionWidth:p=20,...v}){return S.jsxs(S.Fragment,{children:[S.jsx("path",{...v,d:e,fill:"none",className:St(["react-flow__edge-path",v.className])}),p?S.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}):null,a&&Vn(n)&&Vn(s)?S.jsx(RC,{x:n,y:s,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h}):null]})}function Mv({pos:e,x1:n,y1:s,x2:a,y2:o}){return e===me.Left||e===me.Right?[.5*(n+a),s]:[n,.5*(s+o)]}function j1({sourceX:e,sourceY:n,sourcePosition:s=me.Bottom,targetX:a,targetY:o,targetPosition:c=me.Top}){const[u,d]=Mv({pos:s,x1:e,y1:n,x2:a,y2:o}),[h,p]=Mv({pos:c,x1:a,y1:o,x2:e,y2:n}),[v,g,y,w]=s1({sourceX:e,sourceY:n,targetX:a,targetY:o,sourceControlX:u,sourceControlY:d,targetControlX:h,targetControlY:p});return[`M${e},${n} C${u},${d} ${h},${p} ${a},${o}`,v,g,y,w]}function R1(e){return Y.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,sourcePosition:u,targetPosition:d,label:h,labelStyle:p,labelShowBg:v,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:w,style:x,markerEnd:E,markerStart:A,interactionWidth:T})=>{const[z,_,N]=j1({sourceX:s,sourceY:a,sourcePosition:u,targetX:o,targetY:c,targetPosition:d}),j=e.isInternal?void 0:n;return S.jsx(dr,{id:j,path:z,labelX:_,labelY:N,label:h,labelStyle:p,labelShowBg:v,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:w,style:x,markerEnd:E,markerStart:A,interactionWidth:T})})}const BC=R1({isInternal:!1}),B1=R1({isInternal:!0});BC.displayName="SimpleBezierEdge";B1.displayName="SimpleBezierEdgeInternal";function L1(e){return Y.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:g,style:y,sourcePosition:w=me.Bottom,targetPosition:x=me.Top,markerEnd:E,markerStart:A,pathOptions:T,interactionWidth:z})=>{const[_,N,j]=Lh({sourceX:s,sourceY:a,sourcePosition:w,targetX:o,targetY:c,targetPosition:x,borderRadius:T?.borderRadius,offset:T?.offset,stepPosition:T?.stepPosition}),D=e.isInternal?void 0:n;return S.jsx(dr,{id:D,path:_,labelX:N,labelY:j,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:g,style:y,markerEnd:E,markerStart:A,interactionWidth:z})})}const $1=L1({isInternal:!1}),H1=L1({isInternal:!0});$1.displayName="SmoothStepEdge";H1.displayName="SmoothStepEdgeInternal";function U1(e){return Y.memo(({id:n,...s})=>{const a=e.isInternal?void 0:n;return S.jsx($1,{...s,id:a,pathOptions:Y.useMemo(()=>({borderRadius:0,offset:s.pathOptions?.offset}),[s.pathOptions?.offset])})})}const LC=U1({isInternal:!1}),I1=U1({isInternal:!0});LC.displayName="StepEdge";I1.displayName="StepEdgeInternal";function q1(e){return Y.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:g,style:y,markerEnd:w,markerStart:x,interactionWidth:E})=>{const[A,T,z]=o1({sourceX:s,sourceY:a,targetX:o,targetY:c}),_=e.isInternal?void 0:n;return S.jsx(dr,{id:_,path:A,labelX:T,labelY:z,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:g,style:y,markerEnd:w,markerStart:x,interactionWidth:E})})}const $C=q1({isInternal:!1}),V1=q1({isInternal:!0});$C.displayName="StraightEdge";V1.displayName="StraightEdgeInternal";function Y1(e){return Y.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,sourcePosition:u=me.Bottom,targetPosition:d=me.Top,label:h,labelStyle:p,labelShowBg:v,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:w,style:x,markerEnd:E,markerStart:A,pathOptions:T,interactionWidth:z})=>{const[_,N,j]=a1({sourceX:s,sourceY:a,sourcePosition:u,targetX:o,targetY:c,targetPosition:d,curvature:T?.curvature}),D=e.isInternal?void 0:n;return S.jsx(dr,{id:D,path:_,labelX:N,labelY:j,label:h,labelStyle:p,labelShowBg:v,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:w,style:x,markerEnd:E,markerStart:A,interactionWidth:z})})}const HC=Y1({isInternal:!1}),G1=Y1({isInternal:!0});HC.displayName="BezierEdge";G1.displayName="BezierEdgeInternal";const Ov={default:G1,straight:V1,step:I1,smoothstep:H1,simplebezier:B1},kv={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},UC=(e,n,s)=>s===me.Left?e-n:s===me.Right?e+n:e,IC=(e,n,s)=>s===me.Top?e-n:s===me.Bottom?e+n:e,zv="react-flow__edgeupdater";function Dv({position:e,centerX:n,centerY:s,radius:a=10,onMouseDown:o,onMouseEnter:c,onMouseOut:u,type:d}){return S.jsx("circle",{onMouseDown:o,onMouseEnter:c,onMouseOut:u,className:St([zv,`${zv}-${d}`]),cx:UC(n,a,e),cy:IC(s,a,e),r:a,stroke:"transparent",fill:"transparent"})}function qC({isReconnectable:e,reconnectRadius:n,edge:s,sourceX:a,sourceY:o,targetX:c,targetY:u,sourcePosition:d,targetPosition:h,onReconnect:p,onReconnectStart:v,onReconnectEnd:g,setReconnecting:y,setUpdateHover:w}){const x=st(),E=(N,j)=>{if(N.button!==0)return;const{autoPanOnConnect:D,domNode:$,connectionMode:L,connectionRadius:I,lib:V,onConnectStart:G,cancelConnection:Z,nodeLookup:le,rfId:H,panBy:O,updateConnection:C}=x.getState(),B=j.type==="target",R=(k,U)=>{y(!1),g?.(k,s,j.type,U)},K=k=>p?.(s,k),ee=(k,U)=>{y(!0),v?.(N,s,j.type),G?.(k,U)};Uh.onPointerDown(N.nativeEvent,{autoPanOnConnect:D,connectionMode:L,connectionRadius:I,domNode:$,handleId:j.id,nodeId:j.nodeId,nodeLookup:le,isTarget:B,edgeUpdaterType:j.type,lib:V,flowId:H,cancelConnection:Z,panBy:O,isValidConnection:(...k)=>x.getState().isValidConnection?.(...k)??!0,onConnect:K,onConnectStart:ee,onConnectEnd:(...k)=>x.getState().onConnectEnd?.(...k),onReconnectEnd:R,updateConnection:C,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:N.currentTarget})},A=N=>E(N,{nodeId:s.target,id:s.targetHandle??null,type:"target"}),T=N=>E(N,{nodeId:s.source,id:s.sourceHandle??null,type:"source"}),z=()=>w(!0),_=()=>w(!1);return S.jsxs(S.Fragment,{children:[(e===!0||e==="source")&&S.jsx(Dv,{position:d,centerX:a,centerY:o,radius:n,onMouseDown:A,onMouseEnter:z,onMouseOut:_,type:"source"}),(e===!0||e==="target")&&S.jsx(Dv,{position:h,centerX:c,centerY:u,radius:n,onMouseDown:T,onMouseEnter:z,onMouseOut:_,type:"target"})]})}function VC({id:e,edgesFocusable:n,edgesReconnectable:s,elementsSelectable:a,onClick:o,onDoubleClick:c,onContextMenu:u,onMouseEnter:d,onMouseMove:h,onMouseLeave:p,reconnectRadius:v,onReconnect:g,onReconnectStart:y,onReconnectEnd:w,rfId:x,edgeTypes:E,noPanClassName:A,onError:T,disableKeyboardA11y:z}){let _=Re(ge=>ge.edgeLookup.get(e));const N=Re(ge=>ge.defaultEdgeOptions);_=N?{...N,..._}:_;let j=_.type||"default",D=E?.[j]||Ov[j];D===void 0&&(T?.("011",Gn.error011(j)),j="default",D=E?.default||Ov.default);const $=!!(_.focusable||n&&typeof _.focusable>"u"),L=typeof g<"u"&&(_.reconnectable||s&&typeof _.reconnectable>"u"),I=!!(_.selectable||a&&typeof _.selectable>"u"),V=Y.useRef(null),[G,Z]=Y.useState(!1),[le,H]=Y.useState(!1),O=st(),{zIndex:C,sourceX:B,sourceY:R,targetX:K,targetY:ee,sourcePosition:k,targetPosition:U}=Re(Y.useCallback(ge=>{const pe=ge.nodeLookup.get(_.source),Ee=ge.nodeLookup.get(_.target);if(!pe||!Ee)return{zIndex:_.zIndex,...kv};const Ce=OA({id:e,sourceNode:pe,targetNode:Ee,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:ge.connectionMode,onError:T});return{zIndex:xA({selected:_.selected,zIndex:_.zIndex,sourceNode:pe,targetNode:Ee,elevateOnSelect:ge.elevateEdgesOnSelect,zIndexMode:ge.zIndexMode}),...Ce||kv}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),nt),P=Y.useMemo(()=>_.markerStart?`url('#${$h(_.markerStart,x)}')`:void 0,[_.markerStart,x]),se=Y.useMemo(()=>_.markerEnd?`url('#${$h(_.markerEnd,x)}')`:void 0,[_.markerEnd,x]);if(_.hidden||B===null||R===null||K===null||ee===null)return null;const fe=ge=>{const{addSelectedEdges:pe,unselectNodesAndEdges:Ee,multiSelectionActive:Ce}=O.getState();I&&(O.setState({nodesSelectionActive:!1}),_.selected&&Ce?(Ee({nodes:[],edges:[_]}),V.current?.blur()):pe([e])),o&&o(ge,_)},de=c?ge=>{c(ge,{..._})}:void 0,ae=u?ge=>{u(ge,{..._})}:void 0,ne=d?ge=>{d(ge,{..._})}:void 0,ce=h?ge=>{h(ge,{..._})}:void 0,Se=p?ge=>{p(ge,{..._})}:void 0,we=ge=>{if(!z&&Yb.includes(ge.key)&&I){const{unselectNodesAndEdges:pe,addSelectedEdges:Ee}=O.getState();ge.key==="Escape"?(V.current?.blur(),pe({edges:[_]})):Ee([e])}};return S.jsx("svg",{style:{zIndex:C},children:S.jsxs("g",{className:St(["react-flow__edge",`react-flow__edge-${j}`,_.className,A,{selected:_.selected,animated:_.animated,inactive:!I&&!o,updating:G,selectable:I}]),onClick:fe,onDoubleClick:de,onContextMenu:ae,onMouseEnter:ne,onMouseMove:ce,onMouseLeave:Se,onKeyDown:$?we:void 0,tabIndex:$?0:void 0,role:_.ariaRole??($?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":_.ariaLabel===null?void 0:_.ariaLabel||`Edge from ${_.source} to ${_.target}`,"aria-describedby":$?`${x1}-${x}`:void 0,ref:V,..._.domAttributes,children:[!le&&S.jsx(D,{id:e,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:I,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:B,sourceY:R,targetX:K,targetY:ee,sourcePosition:k,targetPosition:U,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:P,markerEnd:se,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),L&&S.jsx(qC,{edge:_,isReconnectable:L,reconnectRadius:v,onReconnect:g,onReconnectStart:y,onReconnectEnd:w,sourceX:B,sourceY:R,targetX:K,targetY:ee,sourcePosition:k,targetPosition:U,setUpdateHover:Z,setReconnecting:H})]})})}var YC=Y.memo(VC);const GC=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function X1({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:s,edgeTypes:a,noPanClassName:o,onReconnect:c,onEdgeContextMenu:u,onEdgeMouseEnter:d,onEdgeMouseMove:h,onEdgeMouseLeave:p,onEdgeClick:v,reconnectRadius:g,onEdgeDoubleClick:y,onReconnectStart:w,onReconnectEnd:x,disableKeyboardA11y:E}){const{edgesFocusable:A,edgesReconnectable:T,elementsSelectable:z,onError:_}=Re(GC,nt),N=MC(n);return S.jsxs("div",{className:"react-flow__edges",children:[S.jsx(jC,{defaultColor:e,rfId:s}),N.map(j=>S.jsx(YC,{id:j,edgesFocusable:A,edgesReconnectable:T,elementsSelectable:z,noPanClassName:o,onReconnect:c,onContextMenu:u,onMouseEnter:d,onMouseMove:h,onMouseLeave:p,onClick:v,reconnectRadius:g,onDoubleClick:y,onReconnectStart:w,onReconnectEnd:x,rfId:s,onError:_,edgeTypes:a,disableKeyboardA11y:E},j))]})}X1.displayName="EdgeRenderer";const XC=Y.memo(X1),KC=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function ZC({children:e}){const n=Re(KC);return S.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function QC(e){const n=fr(),s=Y.useRef(!1);Y.useEffect(()=>{!s.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),s.current=!0)},[e,n.viewportInitialized])}const FC=e=>e.panZoom?.syncViewport;function JC(e){const n=Re(FC),s=st();return Y.useEffect(()=>{e&&(n?.(e),s.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function WC(e){return e.connection.inProgress?{...e.connection,to:wl(e.connection.to,e.transform)}:{...e.connection}}function PC(e){return WC}function eM(e){const n=PC();return Re(n,nt)}const tM=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function nM({containerStyle:e,style:n,type:s,component:a}){const{nodesConnectable:o,width:c,height:u,isValid:d,inProgress:h}=Re(tM,nt);return!(c&&o&&h)?null:S.jsx("svg",{style:e,width:c,height:u,className:"react-flow__connectionline react-flow__container",children:S.jsx("g",{className:St(["react-flow__connection",Kb(d)]),children:S.jsx(K1,{style:n,type:s,CustomComponent:a,isValid:d})})})}const K1=({style:e,type:n=gs.Bezier,CustomComponent:s,isValid:a})=>{const{inProgress:o,from:c,fromNode:u,fromHandle:d,fromPosition:h,to:p,toNode:v,toHandle:g,toPosition:y,pointer:w}=eM();if(!o)return;if(s)return S.jsx(s,{connectionLineType:n,connectionLineStyle:e,fromNode:u,fromHandle:d,fromX:c.x,fromY:c.y,toX:p.x,toY:p.y,fromPosition:h,toPosition:y,connectionStatus:Kb(a),toNode:v,toHandle:g,pointer:w});let x="";const E={sourceX:c.x,sourceY:c.y,sourcePosition:h,targetX:p.x,targetY:p.y,targetPosition:y};switch(n){case gs.Bezier:[x]=a1(E);break;case gs.SimpleBezier:[x]=j1(E);break;case gs.Step:[x]=Lh({...E,borderRadius:0});break;case gs.SmoothStep:[x]=Lh(E);break;default:[x]=o1(E)}return S.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};K1.displayName="ConnectionLine";const iM={};function jv(e=iM){Y.useRef(e),st(),Y.useEffect(()=>{},[e])}function sM(){st(),Y.useRef(!1),Y.useEffect(()=>{},[])}function Z1({nodeTypes:e,edgeTypes:n,onInit:s,onNodeClick:a,onEdgeClick:o,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:p,onNodeContextMenu:v,onSelectionContextMenu:g,onSelectionStart:y,onSelectionEnd:w,connectionLineType:x,connectionLineStyle:E,connectionLineComponent:A,connectionLineContainerStyle:T,selectionKeyCode:z,selectionOnDrag:_,selectionMode:N,multiSelectionKeyCode:j,panActivationKeyCode:D,zoomActivationKeyCode:$,deleteKeyCode:L,onlyRenderVisibleElements:I,elementsSelectable:V,defaultViewport:G,translateExtent:Z,minZoom:le,maxZoom:H,preventScrolling:O,defaultMarkerColor:C,zoomOnScroll:B,zoomOnPinch:R,panOnScroll:K,panOnScrollSpeed:ee,panOnScrollMode:k,zoomOnDoubleClick:U,panOnDrag:P,autoPanOnSelection:se,onPaneClick:fe,onPaneMouseEnter:de,onPaneMouseMove:ae,onPaneMouseLeave:ne,onPaneScroll:ce,onPaneContextMenu:Se,paneClickDistance:we,nodeClickDistance:ge,onEdgeContextMenu:pe,onEdgeMouseEnter:Ee,onEdgeMouseMove:Ce,onEdgeMouseLeave:Ue,reconnectRadius:Pe,onReconnect:zt,onReconnectStart:ot,onReconnectEnd:wt,noDragClassName:Dt,noWheelClassName:kn,noPanClassName:_t,disableKeyboardA11y:Ke,nodeExtent:ut,rfId:Ut,viewport:Lt,onViewportChange:jt}){return jv(e),jv(n),sM(),QC(s),JC(Lt),S.jsx(bC,{onPaneClick:fe,onPaneMouseEnter:de,onPaneMouseMove:ae,onPaneMouseLeave:ne,onPaneContextMenu:Se,onPaneScroll:ce,paneClickDistance:we,deleteKeyCode:L,selectionKeyCode:z,selectionOnDrag:_,selectionMode:N,onSelectionStart:y,onSelectionEnd:w,multiSelectionKeyCode:j,panActivationKeyCode:D,zoomActivationKeyCode:$,elementsSelectable:V,zoomOnScroll:B,zoomOnPinch:R,zoomOnDoubleClick:U,panOnScroll:K,panOnScrollSpeed:ee,panOnScrollMode:k,panOnDrag:P,autoPanOnSelection:se,defaultViewport:G,translateExtent:Z,minZoom:le,maxZoom:H,onSelectionContextMenu:g,preventScrolling:O,noDragClassName:Dt,noWheelClassName:kn,noPanClassName:_t,disableKeyboardA11y:Ke,onViewportChange:jt,isControlledViewport:!!Lt,children:S.jsxs(ZC,{children:[S.jsx(XC,{edgeTypes:n,onEdgeClick:o,onEdgeDoubleClick:u,onReconnect:zt,onReconnectStart:ot,onReconnectEnd:wt,onlyRenderVisibleElements:I,onEdgeContextMenu:pe,onEdgeMouseEnter:Ee,onEdgeMouseMove:Ce,onEdgeMouseLeave:Ue,reconnectRadius:Pe,defaultMarkerColor:C,noPanClassName:_t,disableKeyboardA11y:Ke,rfId:Ut}),S.jsx(nM,{style:E,type:x,component:A,containerStyle:T}),S.jsx("div",{className:"react-flow__edgelabel-renderer"}),S.jsx(CC,{nodeTypes:e,onNodeClick:a,onNodeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:p,onNodeContextMenu:v,nodeClickDistance:ge,onlyRenderVisibleElements:I,noPanClassName:_t,noDragClassName:Dt,disableKeyboardA11y:Ke,nodeExtent:ut,rfId:Ut}),S.jsx("div",{className:"react-flow__viewport-portal"})]})})}Z1.displayName="GraphView";const aM=Y.memo(Z1),lM=Wb(),Rv=({nodes:e,edges:n,defaultNodes:s,defaultEdges:a,width:o,height:c,fitView:u,fitViewOptions:d,minZoom:h=.5,maxZoom:p=2,nodeOrigin:v,nodeExtent:g,zIndexMode:y="basic"}={})=>{const w=new Map,x=new Map,E=new Map,A=new Map,T=a??n??[],z=s??e??[],_=v??[0,0],N=g??Ko;u1(E,A,T);const{nodesInitialized:j}=Hh(z,w,x,{nodeOrigin:_,nodeExtent:N,zIndexMode:y});let D=[0,0,1];if(u&&o&&c){const $=cr(w,{filter:G=>!!((G.width||G.initialWidth)&&(G.height||G.initialHeight))}),{x:L,y:I,zoom:V}=fm($,o,c,h,p,d?.padding??.1);D=[L,I,V]}return{rfId:"1",width:o??0,height:c??0,transform:D,nodes:z,nodesInitialized:j,nodeLookup:w,parentLookup:x,edges:T,edgeLookup:A,connectionLookup:E,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:s!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:h,maxZoom:p,translateExtent:Ko,nodeExtent:N,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:dl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:u??!1,fitViewOptions:d,fitViewResolver:null,connection:{...Xb},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:lM,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Gb,zIndexMode:y,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},oM=({nodes:e,edges:n,defaultNodes:s,defaultEdges:a,width:o,height:c,fitView:u,fitViewOptions:d,minZoom:h,maxZoom:p,nodeOrigin:v,nodeExtent:g,zIndexMode:y})=>bT((w,x)=>{async function E(){const{nodeLookup:A,panZoom:T,fitViewOptions:z,fitViewResolver:_,width:N,height:j,minZoom:D,maxZoom:$}=x();T&&(await pA({nodes:A,width:N,height:j,panZoom:T,minZoom:D,maxZoom:$},z),_?.resolve(!0),w({fitViewResolver:null}))}return{...Rv({nodes:e,edges:n,width:o,height:c,fitView:u,fitViewOptions:d,minZoom:h,maxZoom:p,nodeOrigin:v,nodeExtent:g,defaultNodes:s,defaultEdges:a,zIndexMode:y}),setNodes:A=>{const{nodeLookup:T,parentLookup:z,nodeOrigin:_,elevateNodesOnSelect:N,fitViewQueued:j,zIndexMode:D,nodesSelectionActive:$}=x(),{nodesInitialized:L,hasSelectedNodes:I}=Hh(A,T,z,{nodeOrigin:_,nodeExtent:g,elevateNodesOnSelect:N,checkEquality:!0,zIndexMode:D}),V=$&&I;j&&L?(E(),w({nodes:A,nodesInitialized:L,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:V})):w({nodes:A,nodesInitialized:L,nodesSelectionActive:V})},setEdges:A=>{const{connectionLookup:T,edgeLookup:z}=x();u1(T,z,A),w({edges:A})},setDefaultNodesAndEdges:(A,T)=>{if(A){const{setNodes:z}=x();z(A),w({hasDefaultNodes:!0})}if(T){const{setEdges:z}=x();z(T),w({hasDefaultEdges:!0})}},updateNodeInternals:A=>{const{triggerNodeChanges:T,nodeLookup:z,parentLookup:_,domNode:N,nodeOrigin:j,nodeExtent:D,debug:$,fitViewQueued:L,zIndexMode:I}=x(),{changes:V,updatedInternals:G}=$A(A,z,_,N,j,D,I);G&&(jA(z,_,{nodeOrigin:j,nodeExtent:D,zIndexMode:I}),L?(E(),w({fitViewQueued:!1,fitViewOptions:void 0})):w({}),V?.length>0&&($&&console.log("React Flow: trigger node changes",V),T?.(V)))},updateNodePositions:(A,T=!1)=>{const z=[];let _=[];const{nodeLookup:N,triggerNodeChanges:j,connection:D,updateConnection:$,onNodesChangeMiddlewareMap:L}=x();for(const[I,V]of A){const G=N.get(I),Z=!!(G?.expandParent&&G?.parentId&&V?.position),le={id:I,type:"position",position:Z?{x:Math.max(0,V.position.x),y:Math.max(0,V.position.y)}:V.position,dragging:T};if(G&&D.inProgress&&D.fromNode.id===G.id){const H=Fs(G,D.fromHandle,me.Left,!0);$({...D,from:H})}Z&&G.parentId&&z.push({id:I,parentId:G.parentId,rect:{...V.internals.positionAbsolute,width:V.measured.width??0,height:V.measured.height??0}}),_.push(le)}if(z.length>0){const{parentLookup:I,nodeOrigin:V}=x(),G=ym(z,N,I,V);_.push(...G)}for(const I of L.values())_=I(_);j(_)},triggerNodeChanges:A=>{const{onNodesChange:T,setNodes:z,nodes:_,hasDefaultNodes:N,debug:j}=x();if(A?.length){if(N){const D=IT(A,_);z(D)}j&&console.log("React Flow: trigger node changes",A),T?.(A)}},triggerEdgeChanges:A=>{const{onEdgesChange:T,setEdges:z,edges:_,hasDefaultEdges:N,debug:j}=x();if(A?.length){if(N){const D=qT(A,_);z(D)}j&&console.log("React Flow: trigger edge changes",A),T?.(A)}},addSelectedNodes:A=>{const{multiSelectionActive:T,edgeLookup:z,nodeLookup:_,triggerNodeChanges:N,triggerEdgeChanges:j}=x();if(T){const D=A.map($=>Hs($,!0));N(D);return}N(Fa(_,new Set([...A]),!0)),j(Fa(z))},addSelectedEdges:A=>{const{multiSelectionActive:T,edgeLookup:z,nodeLookup:_,triggerNodeChanges:N,triggerEdgeChanges:j}=x();if(T){const D=A.map($=>Hs($,!0));j(D);return}j(Fa(z,new Set([...A]))),N(Fa(_,new Set,!0))},unselectNodesAndEdges:({nodes:A,edges:T}={})=>{const{edges:z,nodes:_,nodeLookup:N,triggerNodeChanges:j,triggerEdgeChanges:D}=x(),$=A||_,L=T||z,I=[];for(const G of $){if(!G.selected)continue;const Z=N.get(G.id);Z&&(Z.selected=!1),I.push(Hs(G.id,!1))}const V=[];for(const G of L)G.selected&&V.push(Hs(G.id,!1));j(I),D(V)},setMinZoom:A=>{const{panZoom:T,maxZoom:z}=x();T?.setScaleExtent([A,z]),w({minZoom:A})},setMaxZoom:A=>{const{panZoom:T,minZoom:z}=x();T?.setScaleExtent([z,A]),w({maxZoom:A})},setTranslateExtent:A=>{x().panZoom?.setTranslateExtent(A),w({translateExtent:A})},resetSelectedElements:()=>{const{edges:A,nodes:T,triggerNodeChanges:z,triggerEdgeChanges:_,elementsSelectable:N}=x();if(!N)return;const j=T.reduce(($,L)=>L.selected?[...$,Hs(L.id,!1)]:$,[]),D=A.reduce(($,L)=>L.selected?[...$,Hs(L.id,!1)]:$,[]);z(j),_(D)},setNodeExtent:A=>{const{nodes:T,nodeLookup:z,parentLookup:_,nodeOrigin:N,elevateNodesOnSelect:j,nodeExtent:D,zIndexMode:$}=x();A[0][0]===D[0][0]&&A[0][1]===D[0][1]&&A[1][0]===D[1][0]&&A[1][1]===D[1][1]||(Hh(T,z,_,{nodeOrigin:N,nodeExtent:A,elevateNodesOnSelect:j,checkEquality:!1,zIndexMode:$}),w({nodeExtent:A}))},panBy:A=>{const{transform:T,width:z,height:_,panZoom:N,translateExtent:j}=x();return HA({delta:A,panZoom:N,transform:T,translateExtent:j,width:z,height:_})},setCenter:async(A,T,z)=>{const{width:_,height:N,maxZoom:j,panZoom:D}=x();if(!D)return!1;const $=typeof z?.zoom<"u"?z.zoom:j;return await D.setViewport({x:_/2-A*$,y:N/2-T*$,zoom:$},{duration:z?.duration,ease:z?.ease,interpolate:z?.interpolate}),!0},cancelConnection:()=>{w({connection:{...Xb}})},updateConnection:A=>{w({connection:A})},reset:()=>w({...Rv()})}},Object.is);function Q1({initialNodes:e,initialEdges:n,defaultNodes:s,defaultEdges:a,initialWidth:o,initialHeight:c,initialMinZoom:u,initialMaxZoom:d,initialFitViewOptions:h,fitView:p,nodeOrigin:v,nodeExtent:g,zIndexMode:y,children:w}){const[x]=Y.useState(()=>oM({nodes:e,edges:n,defaultNodes:s,defaultEdges:a,width:o,height:c,fitView:p,minZoom:u,maxZoom:d,fitViewOptions:h,nodeOrigin:v,nodeExtent:g,zIndexMode:y}));return S.jsx(wT,{value:x,children:S.jsx(ZT,{children:w})})}function rM({children:e,nodes:n,edges:s,defaultNodes:a,defaultEdges:o,width:c,height:u,fitView:d,fitViewOptions:h,minZoom:p,maxZoom:v,nodeOrigin:g,nodeExtent:y,zIndexMode:w}){return Y.useContext(Au)?S.jsx(S.Fragment,{children:e}):S.jsx(Q1,{initialNodes:n,initialEdges:s,defaultNodes:a,defaultEdges:o,initialWidth:c,initialHeight:u,fitView:d,initialFitViewOptions:h,initialMinZoom:p,initialMaxZoom:v,nodeOrigin:g,nodeExtent:y,zIndexMode:w,children:e})}const cM={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function uM({nodes:e,edges:n,defaultNodes:s,defaultEdges:a,className:o,nodeTypes:c,edgeTypes:u,onNodeClick:d,onEdgeClick:h,onInit:p,onMove:v,onMoveStart:g,onMoveEnd:y,onConnect:w,onConnectStart:x,onConnectEnd:E,onClickConnectStart:A,onClickConnectEnd:T,onNodeMouseEnter:z,onNodeMouseMove:_,onNodeMouseLeave:N,onNodeContextMenu:j,onNodeDoubleClick:D,onNodeDragStart:$,onNodeDrag:L,onNodeDragStop:I,onNodesDelete:V,onEdgesDelete:G,onDelete:Z,onSelectionChange:le,onSelectionDragStart:H,onSelectionDrag:O,onSelectionDragStop:C,onSelectionContextMenu:B,onSelectionStart:R,onSelectionEnd:K,onBeforeDelete:ee,connectionMode:k,connectionLineType:U=gs.Bezier,connectionLineStyle:P,connectionLineComponent:se,connectionLineContainerStyle:fe,deleteKeyCode:de="Backspace",selectionKeyCode:ae="Shift",selectionOnDrag:ne=!1,selectionMode:ce=Zo.Full,panActivationKeyCode:Se="Space",multiSelectionKeyCode:we=Jo()?"Meta":"Control",zoomActivationKeyCode:ge=Jo()?"Meta":"Control",snapToGrid:pe,snapGrid:Ee,onlyRenderVisibleElements:Ce=!1,selectNodesOnDrag:Ue,nodesDraggable:Pe,autoPanOnNodeFocus:zt,nodesConnectable:ot,nodesFocusable:wt,nodeOrigin:Dt=E1,edgesFocusable:kn,edgesReconnectable:_t,elementsSelectable:Ke=!0,defaultViewport:ut=jT,minZoom:Ut=.5,maxZoom:Lt=2,translateExtent:jt=Ko,preventScrolling:hn=!0,nodeExtent:mn,defaultMarkerColor:Ml="#b1b1b7",zoomOnScroll:Fe=!0,zoomOnPinch:It=!0,panOnScroll:ht=!1,panOnScrollSpeed:pn=.5,panOnScrollMode:At=Gs.Free,zoomOnDoubleClick:Ol=!0,panOnDrag:mt=!0,onPaneClick:Ri,onPaneMouseEnter:Zn,onPaneMouseMove:ri,onPaneMouseLeave:Bi,onPaneScroll:qt,onPaneContextMenu:ci,paneClickDistance:Et=1,nodeClickDistance:ia=0,children:Tt,onReconnect:ui,onReconnectStart:zn,onReconnectEnd:kl,onEdgeContextMenu:gn,onEdgeDoubleClick:sa,onEdgeMouseEnter:aa,onEdgeMouseMove:ws,onEdgeMouseLeave:xs,reconnectRadius:la=10,onNodesChange:oa,onEdgesChange:yn,noDragClassName:F="nodrag",noWheelClassName:he="nowheel",noPanClassName:Ne="nopan",fitView:Ie,fitViewOptions:en,connectOnClick:Qn,attributionPosition:et,proOptions:vn,defaultEdgeOptions:zl,elevateNodesOnSelect:Li=!0,elevateEdgesOnSelect:$i=!1,disableKeyboardA11y:Hi=!1,autoPanOnConnect:Ui,autoPanOnNodeDrag:pt,autoPanOnSelection:gr=!0,autoPanSpeed:yr,connectionRadius:fi,isValidConnection:Ii,onError:Vu,style:vr,id:Dl,nodeDragThreshold:Yu,connectionDragThreshold:ra,viewport:ca,onViewportChange:Dn,width:Vt,height:br,colorMode:Gu="light",debug:jl,onScroll:Rl,ariaLabelConfig:ua,zIndexMode:Sr="basic",...Yt},Bl){const fa=Dl||"1",Ll=$T(Gu),qi=Y.useCallback($l=>{$l.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Rl?.($l)},[Rl]);return S.jsx("div",{"data-testid":"rf__wrapper",...Yt,onScroll:qi,style:{...vr,...cM},ref:Bl,className:St(["react-flow",o,Ll]),id:Dl,role:"application",children:S.jsxs(rM,{nodes:e,edges:n,width:Vt,height:br,fitView:Ie,fitViewOptions:en,minZoom:Ut,maxZoom:Lt,nodeOrigin:Dt,nodeExtent:mn,zIndexMode:Sr,children:[S.jsx(LT,{nodes:e,edges:n,defaultNodes:s,defaultEdges:a,onConnect:w,onConnectStart:x,onConnectEnd:E,onClickConnectStart:A,onClickConnectEnd:T,nodesDraggable:Pe,autoPanOnNodeFocus:zt,nodesConnectable:ot,nodesFocusable:wt,edgesFocusable:kn,edgesReconnectable:_t,elementsSelectable:Ke,elevateNodesOnSelect:Li,elevateEdgesOnSelect:$i,minZoom:Ut,maxZoom:Lt,nodeExtent:mn,onNodesChange:oa,onEdgesChange:yn,snapToGrid:pe,snapGrid:Ee,connectionMode:k,translateExtent:jt,connectOnClick:Qn,defaultEdgeOptions:zl,fitView:Ie,fitViewOptions:en,onNodesDelete:V,onEdgesDelete:G,onDelete:Z,onNodeDragStart:$,onNodeDrag:L,onNodeDragStop:I,onSelectionDrag:O,onSelectionDragStart:H,onSelectionDragStop:C,onMove:v,onMoveStart:g,onMoveEnd:y,noPanClassName:Ne,nodeOrigin:Dt,rfId:fa,autoPanOnConnect:Ui,autoPanOnNodeDrag:pt,autoPanSpeed:yr,onError:Vu,connectionRadius:fi,isValidConnection:Ii,selectNodesOnDrag:Ue,nodeDragThreshold:Yu,connectionDragThreshold:ra,onBeforeDelete:ee,debug:jl,ariaLabelConfig:ua,zIndexMode:Sr}),S.jsx(aM,{onInit:p,onNodeClick:d,onEdgeClick:h,onNodeMouseEnter:z,onNodeMouseMove:_,onNodeMouseLeave:N,onNodeContextMenu:j,onNodeDoubleClick:D,nodeTypes:c,edgeTypes:u,connectionLineType:U,connectionLineStyle:P,connectionLineComponent:se,connectionLineContainerStyle:fe,selectionKeyCode:ae,selectionOnDrag:ne,selectionMode:ce,deleteKeyCode:de,multiSelectionKeyCode:we,panActivationKeyCode:Se,zoomActivationKeyCode:ge,onlyRenderVisibleElements:Ce,defaultViewport:ut,translateExtent:jt,minZoom:Ut,maxZoom:Lt,preventScrolling:hn,zoomOnScroll:Fe,zoomOnPinch:It,zoomOnDoubleClick:Ol,panOnScroll:ht,panOnScrollSpeed:pn,panOnScrollMode:At,panOnDrag:mt,autoPanOnSelection:gr,onPaneClick:Ri,onPaneMouseEnter:Zn,onPaneMouseMove:ri,onPaneMouseLeave:Bi,onPaneScroll:qt,onPaneContextMenu:ci,paneClickDistance:Et,nodeClickDistance:ia,onSelectionContextMenu:B,onSelectionStart:R,onSelectionEnd:K,onReconnect:ui,onReconnectStart:zn,onReconnectEnd:kl,onEdgeContextMenu:gn,onEdgeDoubleClick:sa,onEdgeMouseEnter:aa,onEdgeMouseMove:ws,onEdgeMouseLeave:xs,reconnectRadius:la,defaultMarkerColor:Ml,noDragClassName:F,noWheelClassName:he,noPanClassName:Ne,rfId:fa,disableKeyboardA11y:Hi,nodeExtent:mn,viewport:ca,onViewportChange:Dn}),S.jsx(DT,{onSelectionChange:le}),Tt,S.jsx(CT,{proOptions:vn,position:et}),S.jsx(TT,{rfId:fa,disableKeyboardA11y:Hi})]})})}var fM=_1(uM);const dM=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function hM({children:e}){const n=Re(dM);return n?ST.createPortal(e,n):null}function mM({dimensions:e,lineWidth:n,variant:s,className:a}){return S.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:St(["react-flow__background-pattern",s,a])})}function pM({radius:e,className:n}){return S.jsx("circle",{cx:e,cy:e,r:e,className:St(["react-flow__background-pattern","dots",n])})}var ys;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ys||(ys={}));const gM={[ys.Dots]:1,[ys.Lines]:1,[ys.Cross]:6},yM=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function F1({id:e,variant:n=ys.Dots,gap:s=20,size:a,lineWidth:o=1,offset:c=0,color:u,bgColor:d,style:h,className:p,patternClassName:v}){const g=Y.useRef(null),{transform:y,patternId:w}=Re(yM,nt),x=a||gM[n],E=n===ys.Dots,A=n===ys.Cross,T=Array.isArray(s)?s:[s,s],z=[T[0]*y[2]||1,T[1]*y[2]||1],_=x*y[2],N=Array.isArray(c)?c:[c,c],j=A?[_,_]:z,D=[N[0]*y[2]||1+j[0]/2,N[1]*y[2]||1+j[1]/2],$=`${w}${e||""}`;return S.jsxs("svg",{className:St(["react-flow__background",p]),style:{...h,...Cu,"--xy-background-color-props":d,"--xy-background-pattern-color-props":u},ref:g,"data-testid":"rf__background",children:[S.jsx("pattern",{id:$,x:y[0]%z[0],y:y[1]%z[1],width:z[0],height:z[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${D[0]},-${D[1]})`,children:E?S.jsx(pM,{radius:_/2,className:v}):S.jsx(mM,{dimensions:j,lineWidth:o,variant:n,className:v})}),S.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${$})`})]})}F1.displayName="Background";const vM=Y.memo(F1);function bM(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:S.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function SM(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:S.jsx("path",{d:"M0 0h32v4.2H0z"})})}function wM(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:S.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 xM(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:S.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 EM(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:S.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 $c({children:e,className:n,...s}){return S.jsx("button",{type:"button",className:St(["react-flow__controls-button",n]),...s,children:e})}const NM=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function J1({style:e,showZoom:n=!0,showFitView:s=!0,showInteractive:a=!0,fitViewOptions:o,onZoomIn:c,onZoomOut:u,onFitView:d,onInteractiveChange:h,className:p,children:v,position:g="bottom-left",orientation:y="vertical","aria-label":w}){const x=st(),{isInteractive:E,minZoomReached:A,maxZoomReached:T,ariaLabelConfig:z}=Re(NM,nt),{zoomIn:_,zoomOut:N,fitView:j}=fr(),D=()=>{_(),c?.()},$=()=>{N(),u?.()},L=()=>{j(o),d?.()},I=()=>{x.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),h?.(!E)},V=y==="horizontal"?"horizontal":"vertical";return S.jsxs(Tu,{className:St(["react-flow__controls",V,p]),position:g,style:e,"data-testid":"rf__controls","aria-label":w??z["controls.ariaLabel"],children:[n&&S.jsxs(S.Fragment,{children:[S.jsx($c,{onClick:D,className:"react-flow__controls-zoomin",title:z["controls.zoomIn.ariaLabel"],"aria-label":z["controls.zoomIn.ariaLabel"],disabled:T,children:S.jsx(bM,{})}),S.jsx($c,{onClick:$,className:"react-flow__controls-zoomout",title:z["controls.zoomOut.ariaLabel"],"aria-label":z["controls.zoomOut.ariaLabel"],disabled:A,children:S.jsx(SM,{})})]}),s&&S.jsx($c,{className:"react-flow__controls-fitview",onClick:L,title:z["controls.fitView.ariaLabel"],"aria-label":z["controls.fitView.ariaLabel"],children:S.jsx(wM,{})}),a&&S.jsx($c,{className:"react-flow__controls-interactive",onClick:I,title:z["controls.interactive.ariaLabel"],"aria-label":z["controls.interactive.ariaLabel"],children:E?S.jsx(EM,{}):S.jsx(xM,{})}),v]})}J1.displayName="Controls";const _M=Y.memo(J1);function AM({id:e,x:n,y:s,width:a,height:o,style:c,color:u,strokeColor:d,strokeWidth:h,className:p,borderRadius:v,shapeRendering:g,selected:y,onClick:w}){const{background:x,backgroundColor:E}=c||{},A=u||x||E;return S.jsx("rect",{className:St(["react-flow__minimap-node",{selected:y},p]),x:n,y:s,rx:v,ry:v,width:a,height:o,style:{fill:A,stroke:d,strokeWidth:h},shapeRendering:g,onClick:w?T=>w(T,e):void 0})}const TM=Y.memo(AM),CM=e=>e.nodes.map(n=>n.id),ph=e=>e instanceof Function?e:()=>e;function MM({nodeStrokeColor:e,nodeColor:n,nodeClassName:s="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:c=TM,onClick:u}){const d=Re(CM,nt),h=ph(n),p=ph(e),v=ph(s),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return S.jsx(S.Fragment,{children:d.map(y=>S.jsx(kM,{id:y,nodeColorFunc:h,nodeStrokeColorFunc:p,nodeClassNameFunc:v,nodeBorderRadius:a,nodeStrokeWidth:o,NodeComponent:c,onClick:u,shapeRendering:g},y))})}function OM({id:e,nodeColorFunc:n,nodeStrokeColorFunc:s,nodeClassNameFunc:a,nodeBorderRadius:o,nodeStrokeWidth:c,shapeRendering:u,NodeComponent:d,onClick:h}){const{node:p,x:v,y:g,width:y,height:w}=Re(x=>{const E=x.nodeLookup.get(e);if(!E)return{node:void 0,x:0,y:0,width:0,height:0};const A=E.internals.userNode,{x:T,y:z}=E.internals.positionAbsolute,{width:_,height:N}=ji(A);return{node:A,x:T,y:z,width:_,height:N}},nt);return!p||p.hidden||!Pb(p)?null:S.jsx(d,{x:v,y:g,width:y,height:w,style:p.style,selected:!!p.selected,className:a(p),color:n(p),borderRadius:o,strokeColor:s(p),strokeWidth:c,shapeRendering:u,onClick:h,id:p.id})}const kM=Y.memo(OM);var zM=Y.memo(MM);const DM=200,jM=150,RM=e=>!e.hidden,BM=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?Jb(cr(e.nodeLookup,{filter:RM}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},LM="react-flow__minimap-desc";function W1({style:e,className:n,nodeStrokeColor:s,nodeColor:a,nodeClassName:o="",nodeBorderRadius:c=5,nodeStrokeWidth:u,nodeComponent:d,bgColor:h,maskColor:p,maskStrokeColor:v,maskStrokeWidth:g,position:y="bottom-right",onClick:w,onNodeClick:x,pannable:E=!1,zoomable:A=!1,ariaLabel:T,inversePan:z,zoomStep:_=1,offsetScale:N=5}){const j=st(),D=Y.useRef(null),{boundingRect:$,viewBB:L,rfId:I,panZoom:V,translateExtent:G,flowWidth:Z,flowHeight:le,ariaLabelConfig:H}=Re(BM,nt),O=e?.width??DM,C=e?.height??jM,B=$.width/O,R=$.height/C,K=Math.max(B,R),ee=K*O,k=K*C,U=N*K,P=$.x-(ee-$.width)/2-U,se=$.y-(k-$.height)/2-U,fe=ee+U*2,de=k+U*2,ae=`${LM}-${I}`,ne=Y.useRef(0),ce=Y.useRef();ne.current=K,Y.useEffect(()=>{if(D.current&&V)return ce.current=ZA({domNode:D.current,panZoom:V,getTransform:()=>j.getState().transform,getViewScale:()=>ne.current}),()=>{ce.current?.destroy()}},[V]),Y.useEffect(()=>{ce.current?.update({translateExtent:G,width:Z,height:le,inversePan:z,pannable:E,zoomStep:_,zoomable:A})},[E,A,z,_,G,Z,le]);const Se=w?pe=>{const[Ee,Ce]=ce.current?.pointer(pe)||[0,0];w(pe,{x:Ee,y:Ce})}:void 0,we=x?Y.useCallback((pe,Ee)=>{const Ce=j.getState().nodeLookup.get(Ee).internals.userNode;x(pe,Ce)},[]):void 0,ge=T??H["minimap.ariaLabel"];return S.jsx(Tu,{position:y,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*K: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 u=="number"?u:void 0},className:St(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:S.jsxs("svg",{width:O,height:C,viewBox:`${P} ${se} ${fe} ${de}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ae,ref:D,onClick:Se,children:[ge&&S.jsx("title",{id:ae,children:ge}),S.jsx(zM,{onClick:we,nodeColor:a,nodeStrokeColor:s,nodeBorderRadius:c,nodeClassName:o,nodeStrokeWidth:u,nodeComponent:d}),S.jsx("path",{className:"react-flow__minimap-mask",d:`M${P-U},${se-U}h${fe+U*2}v${de+U*2}h${-fe-U*2}z
15
+ M${L.x},${L.y}h${L.width}v${L.height}h${-L.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}W1.displayName="MiniMap";Y.memo(W1);const $M=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,HM={[gl.Line]:"right",[gl.Handle]:"bottom-right"};function UM({nodeId:e,position:n,variant:s=gl.Handle,className:a,style:o=void 0,children:c,color:u,minWidth:d=10,minHeight:h=10,maxWidth:p=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:y,autoScale:w=!0,shouldResize:x,onResizeStart:E,onResize:A,onResizeEnd:T}){const z=M1(),_=typeof e=="string"?e:z,N=st(),j=Y.useRef(null),D=s===gl.Handle,$=Re(Y.useCallback($M(D&&w),[D,w]),nt),L=Y.useRef(null),I=n??HM[s];Y.useEffect(()=>{if(!(!j.current||!_))return L.current||(L.current=oT({domNode:j.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:G,transform:Z,snapGrid:le,snapToGrid:H,nodeOrigin:O,domNode:C}=N.getState();return{nodeLookup:G,transform:Z,snapGrid:le,snapToGrid:H,nodeOrigin:O,paneDomNode:C}},onChange:(G,Z)=>{const{triggerNodeChanges:le,nodeLookup:H,parentLookup:O,nodeOrigin:C}=N.getState(),B=[],R={x:G.x,y:G.y},K=H.get(_);if(K&&K.expandParent&&K.parentId){const ee=K.origin??C,k=G.width??K.measured.width??0,U=G.height??K.measured.height??0,P={id:K.id,parentId:K.parentId,rect:{width:k,height:U,...e1({x:G.x??K.position.x,y:G.y??K.position.y},{width:k,height:U},K.parentId,H,ee)}},se=ym([P],H,O,C);B.push(...se),R.x=G.x?Math.max(ee[0]*k,G.x):void 0,R.y=G.y?Math.max(ee[1]*U,G.y):void 0}if(R.x!==void 0&&R.y!==void 0){const ee={id:_,type:"position",position:{...R}};B.push(ee)}if(G.width!==void 0&&G.height!==void 0){const k={id:_,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:G.width,height:G.height}};B.push(k)}for(const ee of Z){const k={...ee,type:"position"};B.push(k)}le(B)},onEnd:({width:G,height:Z})=>{const le={id:_,type:"dimensions",resizing:!1,dimensions:{width:G,height:Z}};N.getState().triggerNodeChanges([le])}})),L.current.update({controlPosition:I,boundaries:{minWidth:d,minHeight:h,maxWidth:p,maxHeight:v},keepAspectRatio:g,resizeDirection:y,onResizeStart:E,onResize:A,onResizeEnd:T,shouldResize:x}),()=>{L.current?.destroy()}},[I,d,h,p,v,g,E,A,T,x]);const V=I.split("-");return S.jsx("div",{className:St(["react-flow__resize-control","nodrag",...V,s,a]),ref:j,style:{...o,scale:$,...u&&{[D?"backgroundColor":"borderColor"]:u}},children:c})}Y.memo(UM);const gh="emviz.viewerToken";let Ga;function IM(){const e=new URLSearchParams(window.location.hash.slice(1));if(e.has("token")){const n=e.get("token")??"";Ga=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(n)?n:void 0;try{Ga?window.sessionStorage.setItem(gh,Ga):window.sessionStorage.removeItem(gh)}catch{}window.history.replaceState(window.history.state,"",window.location.pathname+window.location.search)}if(!Ga)try{Ga=window.sessionStorage.getItem(gh)??void 0}catch{}return Ga}function Ho(e,n={}){const s=new URL(e,window.location.href);if(s.origin!==window.location.origin||s.username||s.password||!s.pathname.startsWith("/api/"))throw new Error("API requests must stay on this server.");const a=new Headers(n.headers),o=IM();return o&&!a.has("X-Emviz-Token")&&a.set("X-Emviz-Token",o),fetch(s.href,{...n,headers:a,redirect:"error"})}function Bv(){const e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;const n=Array.from(e,s=>s.toString(16).padStart(2,"0")).join("");return n.slice(0,8)+"-"+n.slice(8,12)+"-"+n.slice(12,16)+"-"+n.slice(16,20)+"-"+n.slice(20)}const Lv=3,qM=new Set(["command-event","event-query"]);function P1(e){return[...new Set(e)]}function eS(e){return e?.trim()?P1(e.split(/\r?\n/).map(n=>VM(n)).filter(n=>!!n)):[]}function VM(e){const n=e.trim();return n?n.replace(/^[-*+]\s+/,"").replace(/^\d+[.)]\s+/,"").trim().match(/^`?([A-Za-z_][A-Za-z0-9_.-]*)`?(?=\s*(?::|-|=|\(|,|$))/)?.[1]:void 0}function YM(e){const n=new Map(e.nodes.map(o=>[o.id,o])),s=new Map(e.nodes.map(o=>[o.id,eS(o.fields)])),a=new Map;for(const o of e.edges){if(!qM.has(o.kind))continue;const c=n.get(o.source),u=n.get(o.target);if(!$v(c)||!$v(u))continue;const d=s.get(o.source)??[],h=s.get(o.target)??[],p=new Set(h),v=d.filter(w=>p.has(w)),g=o.kind==="event-query"?XM(c,h,v):[],y=P1([...v,...g]);a.set(o.id,{sourceFieldNames:d,targetFieldNames:h,sharedFieldNames:v,derivedFieldNames:g,visibleFieldNames:y.slice(0,Lv),remainingCount:Math.max(0,y.length-Lv),sourceMissingFields:d.length===0,targetMissingFields:h.length===0})}return a}function GM(e,n){if(!n)return;const s=[...e.entries()].filter(([,a])=>a.sharedFieldNames.includes(n)||a.derivedFieldNames.includes(n)).map(([a])=>a);return s.length>0?new Set(s):void 0}function $v(e){return e?.type==="command"||e?.type==="event"||e?.type==="query"}function XM(e,n,s){const a=Hv(e.label),o=new Set(s);return n.filter(c=>!o.has(c)&&Hv(c).includes(a))}function Hv(e){return e.replace(/^(has|is|was|were)/i,"").replace(/been/gi,"").replace(/[^A-Za-z0-9]/g,"").toLowerCase()}const ii=e=>e.id??e.name,Wt=e=>e.storyId??e.storyName;function KM(e,n){if(!n)return e;const s=new Map(e.stories.map(g=>[ii(g),g])),a=n.steps.flatMap(g=>{const y=s.get(g.storyId);return y?[y]:[]}),o=new Set(a.map(ii)),c=new Map(a.flatMap(g=>g.slices.map(y=>[y,g]))),u=e.slices.filter(g=>c.has(g.path)).map(g=>{const y=c.get(g.path);return{...g,storyName:y.name,storyId:ii(y)}}),d=g=>g.sourcePath??e.slices.find(y=>y.title===(g.sliceTitle??g.label))?.path,h=e.nodes.filter(g=>g.type!=="event"&&(g.type==="story"?o.has(g.storyId??g.label):c.has(d(g)??""))),p=new Set(h.map(g=>g.id));for(const g of e.edges)g.kind==="command-event"&&p.has(g.source)&&p.add(g.target),g.kind==="event-query"&&p.has(g.target)&&p.add(g.source);const v=e.nodes.filter(g=>p.has(g.id)).map(g=>{if(g.type==="story"||g.type==="event")return g;const y=c.get(d(g)??"");return y?{...g,storyName:y.name,storyId:ii(y)}:g});return{...e,stories:a,slices:u,nodes:v,edges:e.edges.filter(g=>p.has(g.source)&&p.has(g.target))}}function ZM(e){const n=new Map(e.steps.map(o=>[o.id,o])),s=new Map,a=new Set(n.keys());for(;a.size;){let o=!1;for(const c of a){const u=n.get(c);u.after.some(d=>n.has(d)&&!s.has(d))||(s.set(c,Math.max(0,...u.after.map(d=>(s.get(d)??-1)+1))),a.delete(c),o=!0)}if(!o){for(const c of a)s.set(c,0);break}}return new Map(e.steps.map(o=>[o.storyId,s.get(o.id)??0]))}function yh(e,n){return n?void 0:e}function fn(e){return e.id??e.path}function QM(e,n=!1){const s=new Map,a=new Map,o=new Map,c=new Map,u=new Map(e.slices.map(v=>[v.path,v])),d=new Map(e.stories.map(v=>[fn(v),v])),h=v=>{const g=v.storyId??(v.type==="story"?v.label:Wt(v)),y=e.stories.filter(x=>ii(x)===g);if(v.storyId&&y.length===1)return y[0];const w=e.stories.filter(x=>x.path===v.sourcePath);return w.length===1?w[0]:y.length===1?y[0]:void 0};for(const v of e.slices){const g=v.storyId??v.storyName,y=e.stories.filter(x=>ii(x)===g),w=y.find(x=>x.slices.includes(v.path))??(y.length===1?y[0]:void 0)??e.stories.find(x=>x.slices.includes(v.path));w&&c.set(v.path,fn(w))}const p=v=>{if(v.sourcePath&&u.has(v.sourcePath))return v.sourcePath;const g=v.sliceTitle??(v.type==="slice"?v.label:void 0);if(!g)return;const y=Wt(v),w=e.slices.filter(x=>x.title===g&&(!y||(x.storyId??x.storyName)===y));return w.length===1?w[0].path:void 0};for(const v of e.nodes){if(v.type==="story"){const E=h(v);E&&(a.set(v.id,ii(E)),o.set(v.id,fn(E)));continue}if(v.type==="event")continue;const g=p(v);g&&s.set(v.id,g);const y=g?c.get(g):void 0,w=y?d.get(y):h(v),x=w?ii(w):g?u.get(g)?.storyId??u.get(g)?.storyName:Wt(v);x&&a.set(v.id,x),w&&o.set(v.id,fn(w))}for(const v of e.nodes){if(v.type!=="event")continue;const g=e.edges.find(E=>E.kind==="command-event"&&E.target===v.id),y=g?s.get(g.source):n?void 0:p(v);y&&s.set(v.id,y);const w=g?a.get(g.source):y?u.get(y)?.storyId??u.get(y)?.storyName:void 0,x=g?o.get(g.source):y?c.get(y):void 0;w&&a.set(v.id,w),x&&o.set(v.id,x)}return{sliceByNode:s,storyByNode:a,stableStoryByNode:o,stableStoryBySlice:c}}function FM(e,n,s,a){if(n==="all")return!0;const o=a.sliceByNode.get(e.source),c=a.sliceByNode.get(e.target);if(o&&o===c)return!0;if(n==="intra-slice"||!s)return!1;if(s.type==="slice"){const u=a.sliceByNode.get(s.id);return!!(u&&(o===u||c===u))}return e.source===s.id||e.target===s.id}function JM(e,n){const s=e.graphSidecar?.model?.id,a=e.root&&e.root!=="browser-import"?["root",e.root,s??null]:s&&s!=="browser_import"?["model",s]:["sources",...new Set(e.stories.map(o=>o.path).sort())];return"emviz:collapsed-stories:v1:"+encodeURIComponent(JSON.stringify([a,n??null]))}function WM(e,n,s){try{const a=(s??window.localStorage).getItem(e);if(!a)return new Set;const o=JSON.parse(a);return!Array.isArray(o)||o.some(c=>typeof c!="string")?new Set:new Set(o.filter(c=>!n||n.has(c)))}catch{return new Set}}function PM(e,n,s){try{return(s??window.localStorage).setItem(e,JSON.stringify([...n].sort())),!0}catch{return!1}}function eO(e,n){return"browser-import:"+JSON.stringify(e&&e!=="browser_import"?["model",e]:["session",n])}const bm=Symbol.for("yaml.alias"),qh=Symbol.for("yaml.document"),vs=Symbol.for("yaml.map"),tS=Symbol.for("yaml.pair"),li=Symbol.for("yaml.scalar"),xl=Symbol.for("yaml.seq"),On=Symbol.for("yaml.node.type"),Ps=e=>!!e&&typeof e=="object"&&e[On]===bm,ea=e=>!!e&&typeof e=="object"&&e[On]===qh,El=e=>!!e&&typeof e=="object"&&e[On]===vs,it=e=>!!e&&typeof e=="object"&&e[On]===tS,Qe=e=>!!e&&typeof e=="object"&&e[On]===li,Nl=e=>!!e&&typeof e=="object"&&e[On]===xl;function at(e){if(e&&typeof e=="object")switch(e[On]){case vs:case xl:return!0}return!1}function lt(e){if(e&&typeof e=="object")switch(e[On]){case bm:case vs:case li:case xl:return!0}return!1}const nS=e=>(Qe(e)||at(e))&&!!e.anchor,Jt=Symbol("break visit"),iS=Symbol("skip children"),ai=Symbol("remove node");function ta(e,n){const s=sS(n);ea(e)?Ja(null,e.contents,s,Object.freeze([e]))===ai&&(e.contents=null):Ja(null,e,s,Object.freeze([]))}ta.BREAK=Jt;ta.SKIP=iS;ta.REMOVE=ai;function Ja(e,n,s,a){const o=aS(e,n,s,a);if(lt(o)||it(o))return lS(e,a,o),Ja(e,o,s,a);if(typeof o!="symbol"){if(at(n)){a=Object.freeze(a.concat(n));for(let c=0;c<n.items.length;++c){const u=Ja(c,n.items[c],s,a);if(typeof u=="number")c=u-1;else{if(u===Jt)return Jt;u===ai&&(n.items.splice(c,1),c-=1)}}}else if(it(n)){a=Object.freeze(a.concat(n));const c=Ja("key",n.key,s,a);if(c===Jt)return Jt;c===ai&&(n.key=null);const u=Ja("value",n.value,s,a);if(u===Jt)return Jt;u===ai&&(n.value=null)}}return o}async function Mu(e,n){const s=sS(n);ea(e)?await Wa(null,e.contents,s,Object.freeze([e]))===ai&&(e.contents=null):await Wa(null,e,s,Object.freeze([]))}Mu.BREAK=Jt;Mu.SKIP=iS;Mu.REMOVE=ai;async function Wa(e,n,s,a){const o=await aS(e,n,s,a);if(lt(o)||it(o))return lS(e,a,o),Wa(e,o,s,a);if(typeof o!="symbol"){if(at(n)){a=Object.freeze(a.concat(n));for(let c=0;c<n.items.length;++c){const u=await Wa(c,n.items[c],s,a);if(typeof u=="number")c=u-1;else{if(u===Jt)return Jt;u===ai&&(n.items.splice(c,1),c-=1)}}}else if(it(n)){a=Object.freeze(a.concat(n));const c=await Wa("key",n.key,s,a);if(c===Jt)return Jt;c===ai&&(n.key=null);const u=await Wa("value",n.value,s,a);if(u===Jt)return Jt;u===ai&&(n.value=null)}}return o}function sS(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function aS(e,n,s,a){if(typeof s=="function")return s(e,n,a);if(El(n))return s.Map?.(e,n,a);if(Nl(n))return s.Seq?.(e,n,a);if(it(n))return s.Pair?.(e,n,a);if(Qe(n))return s.Scalar?.(e,n,a);if(Ps(n))return s.Alias?.(e,n,a)}function lS(e,n,s){const a=n[n.length-1];if(at(a))a.items[e]=s;else if(it(a))e==="key"?a.key=s:a.value=s;else if(ea(a))a.contents=s;else{const o=Ps(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${o} parent`)}}const tO={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},nO=e=>e.replace(/[!,[\]{}]/g,n=>tO[n]);class Ht{constructor(n,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Ht.defaultYaml,n),this.tags=Object.assign({},Ht.defaultTags,s)}clone(){const n=new Ht(this.yaml,this.tags);return n.docStart=this.docStart,n}atDocument(){const n=new Ht(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Ht.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Ht.defaultTags);break}return n}add(n,s){this.atNextDocument&&(this.yaml={explicit:Ht.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Ht.defaultTags),this.atNextDocument=!1);const a=n.trim().split(/[ \t]+/),o=a.shift();switch(o){case"%TAG":{if(a.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),a.length<2))return!1;const[c,u]=a;return this.tags[c]=u,!0}case"%YAML":{if(this.yaml.explicit=!0,a.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;const[c]=a;if(c==="1.1"||c==="1.2")return this.yaml.version=c,!0;{const u=/^\d+\.\d+$/.test(c);return s(6,`Unsupported YAML version ${c}`,u),!1}}default:return s(0,`Unknown directive ${o}`,!0),!1}}tagName(n,s){if(n==="!")return"!";if(n[0]!=="!")return s(`Not a valid tag: ${n}`),null;if(n[1]==="<"){const u=n.slice(2,-1);return u==="!"||u==="!!"?(s(`Verbatim tags aren't resolved, so ${n} is invalid.`),null):(n[n.length-1]!==">"&&s("Verbatim tags must end with a >"),u)}const[,a,o]=n.match(/^(.*!)([^!]*)$/s);o||s(`The ${n} tag has no suffix`);const c=this.tags[a];if(c)try{return c+decodeURIComponent(o)}catch(u){return s(String(u)),null}return a==="!"?n:(s(`Could not resolve tag: ${n}`),null)}tagString(n){for(const[s,a]of Object.entries(this.tags))if(n.startsWith(a))return s+nO(n.substring(a.length));return n[0]==="!"?n:`!<${n}>`}toString(n){const s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],a=Object.entries(this.tags);let o;if(n&&a.length>0&&lt(n.contents)){const c={};ta(n.contents,(u,d)=>{lt(d)&&d.tag&&(c[d.tag]=!0)}),o=Object.keys(c)}else o=[];for(const[c,u]of a)c==="!!"&&u==="tag:yaml.org,2002:"||(!n||o.some(d=>d.startsWith(u)))&&s.push(`%TAG ${c} ${u}`);return s.join(`
16
+ `)}}Ht.defaultYaml={explicit:!1,version:"1.2"};Ht.defaultTags={"!!":"tag:yaml.org,2002:"};function oS(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(s)}return!0}function rS(e){const n=new Set;return ta(e,{Value(s,a){a.anchor&&n.add(a.anchor)}}),n}function cS(e,n){for(let s=1;;++s){const a=`${e}${s}`;if(!n.has(a))return a}}function iO(e,n){const s=[],a=new Map;let o=null;return{onAnchor:c=>{s.push(c),o??(o=rS(e));const u=cS(n,o);return o.add(u),u},setAnchors:()=>{for(const c of s){const u=a.get(c);if(typeof u=="object"&&u.anchor&&(Qe(u.node)||at(u.node)))u.node.anchor=u.anchor;else{const d=new Error("Failed to resolve repeated object (this should not happen)");throw d.source=c,d}}},sourceObjects:a}}function Pa(e,n,s,a){if(a&&typeof a=="object")if(Array.isArray(a))for(let o=0,c=a.length;o<c;++o){const u=a[o],d=Pa(e,a,String(o),u);d===void 0?delete a[o]:d!==u&&(a[o]=d)}else if(a instanceof Map)for(const o of Array.from(a.keys())){const c=a.get(o),u=Pa(e,a,o,c);u===void 0?a.delete(o):u!==c&&a.set(o,u)}else if(a instanceof Set)for(const o of Array.from(a)){const c=Pa(e,a,o,o);c===void 0?a.delete(o):c!==o&&(a.delete(o),a.add(c))}else for(const[o,c]of Object.entries(a)){const u=Pa(e,a,o,c);u===void 0?delete a[o]:u!==c&&(a[o]=u)}return e.call(n,s,a)}function Mn(e,n,s){if(Array.isArray(e))return e.map((a,o)=>Mn(a,String(o),s));if(e&&typeof e.toJSON=="function"){if(!s||!nS(e))return e.toJSON(n,s);const a={aliasCount:0,count:1,res:void 0};s.anchors.set(e,a),s.onCreate=c=>{a.res=c,delete s.onCreate};const o=e.toJSON(n,s);return s.onCreate&&s.onCreate(o),o}return typeof e=="bigint"&&!s?.keep?Number(e):e}class Sm{constructor(n){Object.defineProperty(this,On,{value:n})}clone(){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(n.range=this.range.slice()),n}toJS(n,{mapAsMap:s,maxAliasCount:a,onAnchor:o,reviver:c}={}){if(!ea(n))throw new TypeError("A document argument is required");const u={anchors:new Map,doc:n,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},d=Mn(this,"",u);if(typeof o=="function")for(const{count:h,res:p}of u.anchors.values())o(p,h);return typeof c=="function"?Pa(c,{"":d},"",d):d}}class Ou extends Sm{constructor(n){super(bm),this.source=n,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(n,s){if(s?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let a;s?.aliasResolveCache?a=s.aliasResolveCache:(a=[],ta(n,{Node:(c,u)=>{(Ps(u)||nS(u))&&a.push(u)}}),s&&(s.aliasResolveCache=a));let o;for(const c of a){if(c===this)break;c.anchor===this.source&&(o=c)}return o}toJSON(n,s){if(!s)return{source:this.source};const{anchors:a,doc:o,maxAliasCount:c}=s,u=this.resolve(o,s);if(!u){const h=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(h)}let d=a.get(u);if(d||(Mn(u,null,s),d=a.get(u)),d?.res===void 0){const h="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(h)}if(c>=0&&(d.count+=1,d.aliasCount===0&&(d.aliasCount=Fc(o,u,a)),d.count*d.aliasCount>c)){const h="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(h)}return d.res}toString(n,s,a){const o=`*${this.source}`;if(n){if(oS(this.source),n.options.verifyAliasOrder&&!n.anchors.has(this.source)){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(c)}if(n.implicitKey)return`${o} `}return o}}function Fc(e,n,s){if(Ps(n)){const a=n.resolve(e),o=s&&a&&s.get(a);return o?o.count*o.aliasCount:0}else if(at(n)){let a=0;for(const o of n.items){const c=Fc(e,o,s);c>a&&(a=c)}return a}else if(it(n)){const a=Fc(e,n.key,s),o=Fc(e,n.value,s);return Math.max(a,o)}return 1}const uS=e=>!e||typeof e!="function"&&typeof e!="object";class Ae extends Sm{constructor(n){super(li),this.value=n}toJSON(n,s){return s?.keep?this.value:Mn(this.value,n,s)}toString(){return String(this.value)}}Ae.BLOCK_FOLDED="BLOCK_FOLDED";Ae.BLOCK_LITERAL="BLOCK_LITERAL";Ae.PLAIN="PLAIN";Ae.QUOTE_DOUBLE="QUOTE_DOUBLE";Ae.QUOTE_SINGLE="QUOTE_SINGLE";const sO="tag:yaml.org,2002:";function aO(e,n,s){if(n){const a=s.filter(c=>c.tag===n),o=a.find(c=>!c.format)??a[0];if(!o)throw new Error(`Tag ${n} not found`);return o}return s.find(a=>a.identify?.(e)&&!a.format)}function Po(e,n,s){if(ea(e)&&(e=e.contents),lt(e))return e;if(it(e)){const g=s.schema[vs].createNode?.(s.schema,null,s);return g.items.push(e),g}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:a,onAnchor:o,onTagObj:c,schema:u,sourceObjects:d}=s;let h;if(a&&e&&typeof e=="object"){if(h=d.get(e),h)return h.anchor??(h.anchor=o(e)),new Ou(h.anchor);h={anchor:null,node:null},d.set(e,h)}n?.startsWith("!!")&&(n=sO+n.slice(2));let p=aO(e,n,u.tags);if(!p){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new Ae(e);return h&&(h.node=g),g}p=e instanceof Map?u[vs]:Symbol.iterator in Object(e)?u[xl]:u[vs]}c&&(c(p),delete s.onTagObj);const v=p?.createNode?p.createNode(s.schema,e,s):typeof p?.nodeClass?.from=="function"?p.nodeClass.from(s.schema,e,s):new Ae(e);return n?v.tag=n:p.default||(v.tag=p.tag),h&&(h.node=v),v}function du(e,n,s){let a=s;for(let o=n.length-1;o>=0;--o){const c=n[o];if(typeof c=="number"&&Number.isInteger(c)&&c>=0){const u=[];u[c]=a,a=u}else a=new Map([[c,a]])}return Po(a,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const jo=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class fS extends Sm{constructor(n,s){super(n),Object.defineProperty(this,"schema",{value:s,configurable:!0,enumerable:!1,writable:!0})}clone(n){const s=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return n&&(s.schema=n),s.items=s.items.map(a=>lt(a)||it(a)?a.clone(n):a),this.range&&(s.range=this.range.slice()),s}addIn(n,s){if(jo(n))this.add(s);else{const[a,...o]=n,c=this.get(a,!0);if(at(c))c.addIn(o,s);else if(c===void 0&&this.schema)this.set(a,du(this.schema,o,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${o}`)}}deleteIn(n){const[s,...a]=n;if(a.length===0)return this.delete(s);const o=this.get(s,!0);if(at(o))return o.deleteIn(a);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${a}`)}getIn(n,s){const[a,...o]=n,c=this.get(a,!0);return o.length===0?!s&&Qe(c)?c.value:c:at(c)?c.getIn(o,s):void 0}hasAllNullValues(n){return this.items.every(s=>{if(!it(s))return!1;const a=s.value;return a==null||n&&Qe(a)&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn(n){const[s,...a]=n;if(a.length===0)return this.has(s);const o=this.get(s,!0);return at(o)?o.hasIn(a):!1}setIn(n,s){const[a,...o]=n;if(o.length===0)this.set(a,s);else{const c=this.get(a,!0);if(at(c))c.setIn(o,s);else if(c===void 0&&this.schema)this.set(a,du(this.schema,o,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${o}`)}}}const lO=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ki(e,n){return/^\n+$/.test(e)?e.substring(1):n?e.replace(/^(?! *$)/gm,n):e}const Is=(e,n,s)=>e.endsWith(`
17
+ `)?ki(s,n):s.includes(`
18
+ `)?`
19
+ `+ki(s,n):(e.endsWith(" ")?"":" ")+s,dS="flow",Vh="block",Jc="quoted";function ku(e,n,s="flow",{indentAtStart:a,lineWidth:o=80,minContentWidth:c=20,onFold:u,onOverflow:d}={}){if(!o||o<0)return e;o<c&&(c=0);const h=Math.max(1+c,1+o-n.length);if(e.length<=h)return e;const p=[],v={};let g=o-n.length;typeof a=="number"&&(a>o-Math.max(2,c)?p.push(0):g=o-a);let y,w,x=!1,E=-1,A=-1,T=-1;s===Vh&&(E=Uv(e,E,n.length),E!==-1&&(g=E+h));for(let _;_=e[E+=1];){if(s===Jc&&_==="\\"){switch(A=E,e[E+1]){case"x":E+=3;break;case"u":E+=5;break;case"U":E+=9;break;default:E+=1}T=E}if(_===`
20
+ `)s===Vh&&(E=Uv(e,E,n.length)),g=E+n.length+h,y=void 0;else{if(_===" "&&w&&w!==" "&&w!==`
21
+ `&&w!==" "){const N=e[E+1];N&&N!==" "&&N!==`
22
+ `&&N!==" "&&(y=E)}if(E>=g)if(y)p.push(y),g=y+h,y=void 0;else if(s===Jc){for(;w===" "||w===" ";)w=_,_=e[E+=1],x=!0;const N=E>T+1?E-2:A-1;if(v[N])return e;p.push(N),v[N]=!0,g=N+h,y=void 0}else x=!0}w=_}if(x&&d&&d(),p.length===0)return e;u&&u();let z=e.slice(0,p[0]);for(let _=0;_<p.length;++_){const N=p[_],j=p[_+1]||e.length;N===0?z=`
23
+ ${n}${e.slice(0,j)}`:(s===Jc&&v[N]&&(z+=`${e[N]}\\`),z+=`
24
+ ${n}${e.slice(N+1,j)}`)}return z}function Uv(e,n,s){let a=n,o=n+1,c=e[o];for(;c===" "||c===" ";)if(n<o+s)c=e[++n];else{do c=e[++n];while(c&&c!==`
25
+ `);a=n,o=n+1,c=e[o]}return a}const zu=(e,n)=>({indentAtStart:n?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Du=e=>/^(%|---|\.\.\.)/m.test(e);function oO(e,n,s){if(!n||n<0)return!1;const a=n-s,o=e.length;if(o<=a)return!1;for(let c=0,u=0;c<o;++c)if(e[c]===`
26
+ `){if(c-u>a)return!0;if(u=c+1,o-u<=a)return!1}return!0}function Uo(e,n){const s=JSON.stringify(e);if(n.options.doubleQuotedAsJSON)return s;const{implicitKey:a}=n,o=n.options.doubleQuotedMinMultiLineLength,c=n.indent||(Du(e)?" ":"");let u="",d=0;for(let h=0,p=s[h];p;p=s[++h])if(p===" "&&s[h+1]==="\\"&&s[h+2]==="n"&&(u+=s.slice(d,h)+"\\ ",h+=1,d=h,p="\\"),p==="\\")switch(s[h+1]){case"u":{u+=s.slice(d,h);const v=s.substr(h+2,4);switch(v){case"0000":u+="\\0";break;case"0007":u+="\\a";break;case"000b":u+="\\v";break;case"001b":u+="\\e";break;case"0085":u+="\\N";break;case"00a0":u+="\\_";break;case"2028":u+="\\L";break;case"2029":u+="\\P";break;default:v.substr(0,2)==="00"?u+="\\x"+v.substr(2):u+=s.substr(h,6)}h+=5,d=h+1}break;case"n":if(a||s[h+2]==='"'||s.length<o)h+=1;else{for(u+=s.slice(d,h)+`
27
+
28
+ `;s[h+2]==="\\"&&s[h+3]==="n"&&s[h+4]!=='"';)u+=`
29
+ `,h+=2;u+=c,s[h+2]===" "&&(u+="\\"),h+=1,d=h+1}break;default:h+=1}return u=d?u+s.slice(d):s,a?u:ku(u,c,Jc,zu(n,!1))}function Yh(e,n){if(n.options.singleQuote===!1||n.implicitKey&&e.includes(`
30
+ `)||/[ \t]\n|\n[ \t]/.test(e))return Uo(e,n);const s=n.indent||(Du(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
31
+ ${s}`)+"'";return n.implicitKey?a:ku(a,s,dS,zu(n,!1))}function el(e,n){const{singleQuote:s}=n.options;let a;if(s===!1)a=Uo;else{const o=e.includes('"'),c=e.includes("'");o&&!c?a=Yh:c&&!o?a=Uo:a=s?Yh:Uo}return a(e,n)}let Gh;try{Gh=new RegExp(`(^|(?<!
32
+ ))
33
+ +(?!
34
+ |$)`,"g")}catch{Gh=/\n+(?!\n|$)/g}function Wc({comment:e,type:n,value:s},a,o,c){const{blockQuote:u,commentString:d,lineWidth:h}=a.options;if(!u||/\n[\t ]+$/.test(s))return el(s,a);const p=a.indent||(a.forceBlockIndent||Du(s)?" ":""),v=u==="literal"?!0:u==="folded"||n===Ae.BLOCK_FOLDED?!1:n===Ae.BLOCK_LITERAL?!0:!oO(s,h,p.length);if(!s)return v?`|
35
+ `:`>
36
+ `;let g,y;for(y=s.length;y>0;--y){const j=s[y-1];if(j!==`
37
+ `&&j!==" "&&j!==" ")break}let w=s.substring(y);const x=w.indexOf(`
38
+ `);x===-1?g="-":s===w||x!==w.length-1?(g="+",c&&c()):g="",w&&(s=s.slice(0,-w.length),w[w.length-1]===`
39
+ `&&(w=w.slice(0,-1)),w=w.replace(Gh,`$&${p}`));let E=!1,A,T=-1;for(A=0;A<s.length;++A){const j=s[A];if(j===" ")E=!0;else if(j===`
40
+ `)T=A;else break}let z=s.substring(0,T<A?T+1:A);z&&(s=s.substring(z.length),z=z.replace(/\n+/g,`$&${p}`));let N=(E?p?"2":"1":"")+g;if(e&&(N+=" "+d(e.replace(/ ?[\r\n]+/g," ")),o&&o()),!v){const j=s.replace(/\n+/g,`
41
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${p}`);let D=!1;const $=zu(a,!0);u!=="folded"&&n!==Ae.BLOCK_FOLDED&&($.onOverflow=()=>{D=!0});const L=ku(`${z}${j}${w}`,p,Vh,$);if(!D)return`>${N}
42
+ ${p}${L}`}return s=s.replace(/\n+/g,`$&${p}`),`|${N}
43
+ ${p}${z}${s}${w}`}function rO(e,n,s,a){const{type:o,value:c}=e,{actualString:u,implicitKey:d,indent:h,indentStep:p,inFlow:v}=n;if(d&&c.includes(`
44
+ `)||v&&/[[\]{},]/.test(c))return el(c,n);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return d||v||!c.includes(`
45
+ `)?el(c,n):Wc(e,n,s,a);if(!d&&!v&&o!==Ae.PLAIN&&c.includes(`
46
+ `))return Wc(e,n,s,a);if(Du(c)){if(h==="")return n.forceBlockIndent=!0,Wc(e,n,s,a);if(d&&h===p)return el(c,n)}const g=c.replace(/\n+/g,`$&
47
+ ${h}`);if(u){const y=E=>E.default&&E.tag!=="tag:yaml.org,2002:str"&&E.test?.test(g),{compat:w,tags:x}=n.doc.schema;if(x.some(y)||w?.some(y))return el(c,n)}return d?g:ku(g,h,dS,zu(n,!1))}function hr(e,n,s,a){const{implicitKey:o,inFlow:c}=n,u=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:d}=e;d!==Ae.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(u.value)&&(d=Ae.QUOTE_DOUBLE);const h=v=>{switch(v){case Ae.BLOCK_FOLDED:case Ae.BLOCK_LITERAL:return o||c?el(u.value,n):Wc(u,n,s,a);case Ae.QUOTE_DOUBLE:return Uo(u.value,n);case Ae.QUOTE_SINGLE:return Yh(u.value,n);case Ae.PLAIN:return rO(u,n,s,a);default:return null}};let p=h(d);if(p===null){const{defaultKeyType:v,defaultStringType:g}=n.options,y=o&&v||g;if(p=h(y),p===null)throw new Error(`Unsupported default string type ${y}`)}return p}function hS(e,n){const s=Object.assign({blockQuote:!0,commentString:lO,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},e.schema.toStringOptions,n);let a;switch(s.collectionStyle){case"block":a=!1;break;case"flow":a=!0;break;default:a=null}return{anchors:new Set,doc:e,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent=="number"?" ".repeat(s.indent):" ",inFlow:a,options:s}}function cO(e,n){if(n.tag){const o=e.filter(c=>c.tag===n.tag);if(o.length>0)return o.find(c=>c.format===n.format)??o[0]}let s,a;if(Qe(n)){a=n.value;let o=e.filter(c=>c.identify?.(a));if(o.length>1){const c=o.filter(u=>u.test);c.length>0&&(o=c)}s=o.find(c=>c.format===n.format)??o.find(c=>!c.format)}else a=n,s=e.find(o=>o.nodeClass&&a instanceof o.nodeClass);if(!s){const o=a?.constructor?.name??(a===null?"null":typeof a);throw new Error(`Tag not resolved for ${o} value`)}return s}function uO(e,n,{anchors:s,doc:a}){if(!a.directives)return"";const o=[],c=(Qe(e)||at(e))&&e.anchor;c&&oS(c)&&(s.add(c),o.push(`&${c}`));const u=e.tag??(n.default?null:n.tag);return u&&o.push(a.directives.tagString(u)),o.join(" ")}function yl(e,n,s,a){if(it(e))return e.toString(n,s,a);if(Ps(e)){if(n.doc.directives)return e.toString(n);if(n.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");n.resolvedAliases?n.resolvedAliases.add(e):n.resolvedAliases=new Set([e]),e=e.resolve(n.doc)}let o;const c=lt(e)?e:n.doc.createNode(e,{onTagObj:h=>o=h});o??(o=cO(n.doc.schema.tags,c));const u=uO(c,o,n);u.length>0&&(n.indentAtStart=(n.indentAtStart??0)+u.length+1);const d=typeof o.stringify=="function"?o.stringify(c,n,s,a):Qe(c)?hr(c,n,s,a):c.toString(n,s,a);return u?Qe(c)||d[0]==="{"||d[0]==="["?`${u} ${d}`:`${u}
48
+ ${n.indent}${d}`:d}function fO({key:e,value:n},s,a,o){const{allNullValues:c,doc:u,indent:d,indentStep:h,options:{commentString:p,indentSeq:v,simpleKeys:g}}=s;let y=lt(e)&&e.comment||null;if(g){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(at(e)||!lt(e)&&typeof e=="object"){const $="With simple keys, collection cannot be used as a key value";throw new Error($)}}let w=!g&&(!e||y&&n==null&&!s.inFlow||at(e)||(Qe(e)?e.type===Ae.BLOCK_FOLDED||e.type===Ae.BLOCK_LITERAL:typeof e=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!w&&(g||!c),indent:d+h});let x=!1,E=!1,A=yl(e,s,()=>x=!0,()=>E=!0);if(!w&&!s.inFlow&&A.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");w=!0}if(s.inFlow){if(c||n==null)return x&&a&&a(),A===""?"?":w?`? ${A}`:A}else if(c&&!g||n==null&&w)return A=`? ${A}`,y&&!x?A+=Is(A,s.indent,p(y)):E&&o&&o(),A;x&&(y=null),w?(y&&(A+=Is(A,s.indent,p(y))),A=`? ${A}
49
+ ${d}:`):(A=`${A}:`,y&&(A+=Is(A,s.indent,p(y))));let T,z,_;lt(n)?(T=!!n.spaceBefore,z=n.commentBefore,_=n.comment):(T=!1,z=null,_=null,n&&typeof n=="object"&&(n=u.createNode(n))),s.implicitKey=!1,!w&&!y&&Qe(n)&&(s.indentAtStart=A.length+1),E=!1,!v&&h.length>=2&&!s.inFlow&&!w&&Nl(n)&&!n.flow&&!n.tag&&!n.anchor&&(s.indent=s.indent.substring(2));let N=!1;const j=yl(n,s,()=>N=!0,()=>E=!0);let D=" ";if(y||T||z){if(D=T?`
50
+ `:"",z){const $=p(z);D+=`
51
+ ${ki($,s.indent)}`}j===""&&!s.inFlow?D===`
52
+ `&&_&&(D=`
53
+
54
+ `):D+=`
55
+ ${s.indent}`}else if(!w&&at(n)){const $=j[0],L=j.indexOf(`
56
+ `),I=L!==-1,V=s.inFlow??n.flow??n.items.length===0;if(I||!V){let G=!1;if(I&&($==="&"||$==="!")){let Z=j.indexOf(" ");$==="&"&&Z!==-1&&Z<L&&j[Z+1]==="!"&&(Z=j.indexOf(" ",Z+1)),(Z===-1||L<Z)&&(G=!0)}G||(D=`
57
+ ${s.indent}`)}}else(j===""||j[0]===`
58
+ `)&&(D="");return A+=D+j,s.inFlow?N&&a&&a():_&&!N?A+=Is(A,s.indent,p(_)):E&&o&&o(),A}function mS(e,n){(e==="debug"||e==="warn")&&console.warn(n)}const Hc="<<",zi={identify:e=>e===Hc||typeof e=="symbol"&&e.description===Hc,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ae(Symbol(Hc)),{addToJSMap:pS}),stringify:()=>Hc},dO=(e,n)=>(zi.identify(n)||Qe(n)&&(!n.type||n.type===Ae.PLAIN)&&zi.identify(n.value))&&e?.doc.schema.tags.some(s=>s.tag===zi.tag&&s.default);function pS(e,n,s){const a=gS(e,s);if(Nl(a))for(const o of a.items)vh(e,n,o);else if(Array.isArray(a))for(const o of a)vh(e,n,o);else vh(e,n,a)}function vh(e,n,s){const a=gS(e,s);if(!El(a))throw new Error("Merge sources must be maps or map aliases");const o=a.toJSON(null,e,Map);for(const[c,u]of o)n instanceof Map?n.has(c)||n.set(c,u):n instanceof Set?n.add(c):Object.prototype.hasOwnProperty.call(n,c)||Object.defineProperty(n,c,{value:u,writable:!0,enumerable:!0,configurable:!0});return n}function gS(e,n){return e&&Ps(n)?n.resolve(e.doc,e):n}function yS(e,n,{key:s,value:a}){if(lt(s)&&s.addToJSMap)s.addToJSMap(e,n,a);else if(dO(e,s))pS(e,n,a);else{const o=Mn(s,"",e);if(n instanceof Map)n.set(o,Mn(a,o,e));else if(n instanceof Set)n.add(o);else{const c=hO(s,o,e),u=Mn(a,c,e);c in n?Object.defineProperty(n,c,{value:u,writable:!0,enumerable:!0,configurable:!0}):n[c]=u}}return n}function hO(e,n,s){if(n===null)return"";if(typeof n!="object")return String(n);if(lt(e)&&s?.doc){const a=hS(s.doc,{});a.anchors=new Set;for(const c of s.anchors.keys())a.anchors.add(c.anchor);a.inFlow=!0,a.inStringifyKey=!0;const o=e.toString(a);if(!s.mapKeyWarned){let c=JSON.stringify(o);c.length>40&&(c=c.substring(0,36)+'..."'),mS(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${c}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return o}return JSON.stringify(n)}function wm(e,n,s){const a=Po(e,void 0,s),o=Po(n,void 0,s);return new Bt(a,o)}class Bt{constructor(n,s=null){Object.defineProperty(this,On,{value:tS}),this.key=n,this.value=s}clone(n){let{key:s,value:a}=this;return lt(s)&&(s=s.clone(n)),lt(a)&&(a=a.clone(n)),new Bt(s,a)}toJSON(n,s){const a=s?.mapAsMap?new Map:{};return yS(s,a,this)}toString(n,s,a){return n?.doc?fO(this,n,s,a):JSON.stringify(this)}}function vS(e,n,s){return(n.inFlow??e.flow?pO:mO)(e,n,s)}function mO({comment:e,items:n},s,{blockItemPrefix:a,flowChars:o,itemIndent:c,onChompKeep:u,onComment:d}){const{indent:h,options:{commentString:p}}=s,v=Object.assign({},s,{indent:c,type:null});let g=!1;const y=[];for(let x=0;x<n.length;++x){const E=n[x];let A=null;if(lt(E))!g&&E.spaceBefore&&y.push(""),hu(s,y,E.commentBefore,g),E.comment&&(A=E.comment);else if(it(E)){const z=lt(E.key)?E.key:null;z&&(!g&&z.spaceBefore&&y.push(""),hu(s,y,z.commentBefore,g))}g=!1;let T=yl(E,v,()=>A=null,()=>g=!0);A&&(T+=Is(T,c,p(A))),g&&A&&(g=!1),y.push(a+T)}let w;if(y.length===0)w=o.start+o.end;else{w=y[0];for(let x=1;x<y.length;++x){const E=y[x];w+=E?`
59
+ ${h}${E}`:`
60
+ `}}return e?(w+=`
61
+ `+ki(p(e),h),d&&d()):g&&u&&u(),w}function pO({items:e},n,{flowChars:s,itemIndent:a}){const{indent:o,indentStep:c,flowCollectionPadding:u,options:{commentString:d}}=n;a+=c;const h=Object.assign({},n,{indent:a,inFlow:!0,type:null});let p=!1,v=0;const g=[];for(let x=0;x<e.length;++x){const E=e[x];let A=null;if(lt(E))E.spaceBefore&&g.push(""),hu(n,g,E.commentBefore,!1),E.comment&&(A=E.comment);else if(it(E)){const z=lt(E.key)?E.key:null;z&&(z.spaceBefore&&g.push(""),hu(n,g,z.commentBefore,!1),z.comment&&(p=!0));const _=lt(E.value)?E.value:null;_?(_.comment&&(A=_.comment),_.commentBefore&&(p=!0)):E.value==null&&z?.comment&&(A=z.comment)}A&&(p=!0);let T=yl(E,h,()=>A=null);p||(p=g.length>v||T.includes(`
62
+ `)),x<e.length-1?T+=",":n.options.trailingComma&&(n.options.lineWidth>0&&(p||(p=g.reduce((z,_)=>z+_.length+2,2)+(T.length+2)>n.options.lineWidth)),p&&(T+=",")),A&&(T+=Is(T,a,d(A))),g.push(T),v=g.length}const{start:y,end:w}=s;if(g.length===0)return y+w;if(!p){const x=g.reduce((E,A)=>E+A.length+2,2);p=n.options.lineWidth>0&&x>n.options.lineWidth}if(p){let x=y;for(const E of g)x+=E?`
63
+ ${c}${o}${E}`:`
64
+ `;return`${x}
65
+ ${o}${w}`}else return`${y}${u}${g.join(" ")}${u}${w}`}function hu({indent:e,options:{commentString:n}},s,a,o){if(a&&o&&(a=a.replace(/^\n+/,"")),a){const c=ki(n(a),e);s.push(c.trimStart())}}function qs(e,n){const s=Qe(n)?n.value:n;for(const a of e)if(it(a)&&(a.key===n||a.key===s||Qe(a.key)&&a.key.value===s))return a}class un extends fS{static get tagName(){return"tag:yaml.org,2002:map"}constructor(n){super(vs,n),this.items=[]}static from(n,s,a){const{keepUndefined:o,replacer:c}=a,u=new this(n),d=(h,p)=>{if(typeof c=="function")p=c.call(s,h,p);else if(Array.isArray(c)&&!c.includes(h))return;(p!==void 0||o)&&u.items.push(wm(h,p,a))};if(s instanceof Map)for(const[h,p]of s)d(h,p);else if(s&&typeof s=="object")for(const h of Object.keys(s))d(h,s[h]);return typeof n.sortMapEntries=="function"&&u.items.sort(n.sortMapEntries),u}add(n,s){let a;it(n)?a=n:!n||typeof n!="object"||!("key"in n)?a=new Bt(n,n?.value):a=new Bt(n.key,n.value);const o=qs(this.items,a.key),c=this.schema?.sortMapEntries;if(o){if(!s)throw new Error(`Key ${a.key} already set`);Qe(o.value)&&uS(a.value)?o.value.value=a.value:o.value=a.value}else if(c){const u=this.items.findIndex(d=>c(a,d)<0);u===-1?this.items.push(a):this.items.splice(u,0,a)}else this.items.push(a)}delete(n){const s=qs(this.items,n);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(n,s){const o=qs(this.items,n)?.value;return(!s&&Qe(o)?o.value:o)??void 0}has(n){return!!qs(this.items,n)}set(n,s){this.add(new Bt(n,s),!0)}toJSON(n,s,a){const o=a?new a:s?.mapAsMap?new Map:{};s?.onCreate&&s.onCreate(o);for(const c of this.items)yS(s,o,c);return o}toString(n,s,a){if(!n)return JSON.stringify(this);for(const o of this.items)if(!it(o))throw new Error(`Map items must all be pairs; found ${JSON.stringify(o)} instead`);return!n.allNullValues&&this.hasAllNullValues(!1)&&(n=Object.assign({},n,{allNullValues:!0})),vS(this,n,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:n.indent||"",onChompKeep:a,onComment:s})}}const _l={collection:"map",default:!0,nodeClass:un,tag:"tag:yaml.org,2002:map",resolve(e,n){return El(e)||n("Expected a mapping for this tag"),e},createNode:(e,n,s)=>un.from(e,n,s)};class bs extends fS{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(n){super(xl,n),this.items=[]}add(n){this.items.push(n)}delete(n){const s=Uc(n);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(n,s){const a=Uc(n);if(typeof a!="number")return;const o=this.items[a];return!s&&Qe(o)?o.value:o}has(n){const s=Uc(n);return typeof s=="number"&&s<this.items.length}set(n,s){const a=Uc(n);if(typeof a!="number")throw new Error(`Expected a valid index, not ${n}.`);const o=this.items[a];Qe(o)&&uS(s)?o.value=s:this.items[a]=s}toJSON(n,s){const a=[];s?.onCreate&&s.onCreate(a);let o=0;for(const c of this.items)a.push(Mn(c,String(o++),s));return a}toString(n,s,a){return n?vS(this,n,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(n.indent||"")+" ",onChompKeep:a,onComment:s}):JSON.stringify(this)}static from(n,s,a){const{replacer:o}=a,c=new this(n);if(s&&Symbol.iterator in Object(s)){let u=0;for(let d of s){if(typeof o=="function"){const h=s instanceof Set?d:String(u++);d=o.call(s,h,d)}c.items.push(Po(d,void 0,a))}}return c}}function Uc(e){let n=Qe(e)?e.value:e;return n&&typeof n=="string"&&(n=Number(n)),typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}const Al={collection:"seq",default:!0,nodeClass:bs,tag:"tag:yaml.org,2002:seq",resolve(e,n){return Nl(e)||n("Expected a sequence for this tag"),e},createNode:(e,n,s)=>bs.from(e,n,s)},ju={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,n,s,a){return n=Object.assign({actualString:!0},n),hr(e,n,s,a)}},Ru={identify:e=>e==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ae(null),stringify:({source:e},n)=>typeof e=="string"&&Ru.test.test(e)?e:n.options.nullStr},xm={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Ae(e[0]==="t"||e[0]==="T"),stringify({source:e,value:n},s){if(e&&xm.test.test(e)){const a=e[0]==="t"||e[0]==="T";if(n===a)return e}return n?s.options.trueStr:s.options.falseStr}};function Kn({format:e,minFractionDigits:n,tag:s,value:a}){if(typeof a=="bigint")return String(a);const o=typeof a=="number"?a:Number(a);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let c=Object.is(a,-0)?"-0":JSON.stringify(a);if(!e&&n&&(!s||s==="tag:yaml.org,2002:float")&&/^-?\d/.test(c)&&!c.includes("e")){let u=c.indexOf(".");u<0&&(u=c.length,c+=".");let d=n-(c.length-u-1);for(;d-- >0;)c+="0"}return c}const bS={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Kn},SS={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():Kn(e)}},wS={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const n=new Ae(parseFloat(e)),s=e.indexOf(".");return s!==-1&&e[e.length-1]==="0"&&(n.minFractionDigits=e.length-s-1),n},stringify:Kn},Bu=e=>typeof e=="bigint"||Number.isInteger(e),Em=(e,n,s,{intAsBigInt:a})=>a?BigInt(e):parseInt(e.substring(n),s);function xS(e,n,s){const{value:a}=e;return Bu(a)&&a>=0?s+a.toString(n):Kn(e)}const ES={identify:e=>Bu(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,n,s)=>Em(e,2,8,s),stringify:e=>xS(e,8,"0o")},NS={identify:Bu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,n,s)=>Em(e,0,10,s),stringify:Kn},_S={identify:e=>Bu(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,n,s)=>Em(e,2,16,s),stringify:e=>xS(e,16,"0x")},gO=[_l,Al,ju,Ru,xm,ES,NS,_S,bS,SS,wS];function Iv(e){return typeof e=="bigint"||Number.isInteger(e)}const Ic=({value:e})=>JSON.stringify(e),yO=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Ic},{identify:e=>e==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ic},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Ic},{identify:Iv,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e,10),stringify:({value:e})=>Iv(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Ic}],vO={default:!0,tag:"",test:/^/,resolve(e,n){return n(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},bO=[_l,Al].concat(yO,vO),Nm={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,n){if(typeof atob=="function"){const s=atob(e.replace(/[\n\r]/g,"")),a=new Uint8Array(s.length);for(let o=0;o<s.length;++o)a[o]=s.charCodeAt(o);return a}else return n("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:n,value:s},a,o,c){if(!s)return"";const u=s;let d;if(typeof btoa=="function"){let h="";for(let p=0;p<u.length;++p)h+=String.fromCharCode(u[p]);d=btoa(h)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(n??(n=Ae.BLOCK_LITERAL),n!==Ae.QUOTE_DOUBLE){const h=Math.max(a.options.lineWidth-a.indent.length,a.options.minContentWidth),p=Math.ceil(d.length/h),v=new Array(p);for(let g=0,y=0;g<p;++g,y+=h)v[g]=d.substr(y,h);d=v.join(n===Ae.BLOCK_LITERAL?`
66
+ `:" ")}return hr({comment:e,type:n,value:d},a,o,c)}};function AS(e,n){if(Nl(e))for(let s=0;s<e.items.length;++s){let a=e.items[s];if(!it(a)){if(El(a)){a.items.length>1&&n("Each pair must have its own sequence indicator");const o=a.items[0]||new Bt(new Ae(null));if(a.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${a.commentBefore}
67
+ ${o.key.commentBefore}`:a.commentBefore),a.comment){const c=o.value??o.key;c.comment=c.comment?`${a.comment}
68
+ ${c.comment}`:a.comment}a=o}e.items[s]=it(a)?a:new Bt(a)}}else n("Expected a sequence for this tag");return e}function TS(e,n,s){const{replacer:a}=s,o=new bs(e);o.tag="tag:yaml.org,2002:pairs";let c=0;if(n&&Symbol.iterator in Object(n))for(let u of n){typeof a=="function"&&(u=a.call(n,String(c++),u));let d,h;if(Array.isArray(u))if(u.length===2)d=u[0],h=u[1];else throw new TypeError(`Expected [key, value] tuple: ${u}`);else if(u&&u instanceof Object){const p=Object.keys(u);if(p.length===1)d=p[0],h=u[d];else throw new TypeError(`Expected tuple with one key, not ${p.length} keys`)}else d=u;o.items.push(wm(d,h,s))}return o}const _m={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:AS,createNode:TS};class sl extends bs{constructor(){super(),this.add=un.prototype.add.bind(this),this.delete=un.prototype.delete.bind(this),this.get=un.prototype.get.bind(this),this.has=un.prototype.has.bind(this),this.set=un.prototype.set.bind(this),this.tag=sl.tag}toJSON(n,s){if(!s)return super.toJSON(n);const a=new Map;s?.onCreate&&s.onCreate(a);for(const o of this.items){let c,u;if(it(o)?(c=Mn(o.key,"",s),u=Mn(o.value,c,s)):c=Mn(o,"",s),a.has(c))throw new Error("Ordered maps must not include duplicate keys");a.set(c,u)}return a}static from(n,s,a){const o=TS(n,s,a),c=new this;return c.items=o.items,c}}sl.tag="tag:yaml.org,2002:omap";const Am={collection:"seq",identify:e=>e instanceof Map,nodeClass:sl,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,n){const s=AS(e,n),a=[];for(const{key:o}of s.items)Qe(o)&&(a.includes(o.value)?n(`Ordered maps must not include duplicate keys: ${o.value}`):a.push(o.value));return Object.assign(new sl,s)},createNode:(e,n,s)=>sl.from(e,n,s)};function CS({value:e,source:n},s){return n&&(e?MS:OS).test.test(n)?n:e?s.options.trueStr:s.options.falseStr}const MS={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Ae(!0),stringify:CS},OS={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Ae(!1),stringify:CS},SO={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Kn},wO={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():Kn(e)}},xO={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const n=new Ae(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(s!==-1){const a=e.substring(s+1).replace(/_/g,"");a[a.length-1]==="0"&&(n.minFractionDigits=a.length)}return n},stringify:Kn},mr=e=>typeof e=="bigint"||Number.isInteger(e);function Lu(e,n,s,{intAsBigInt:a}){const o=e[0];if((o==="-"||o==="+")&&(n+=1),e=e.substring(n).replace(/_/g,""),a){switch(s){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const u=BigInt(e);return o==="-"?BigInt(-1)*u:u}const c=parseInt(e,s);return o==="-"?-1*c:c}function Tm(e,n,s){const{value:a}=e;if(mr(a)){const o=a.toString(n);return a<0?"-"+s+o.substr(1):s+o}return Kn(e)}const EO={identify:mr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,n,s)=>Lu(e,2,2,s),stringify:e=>Tm(e,2,"0b")},NO={identify:mr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,n,s)=>Lu(e,1,8,s),stringify:e=>Tm(e,8,"0")},_O={identify:mr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,n,s)=>Lu(e,0,10,s),stringify:Kn},AO={identify:mr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,n,s)=>Lu(e,2,16,s),stringify:e=>Tm(e,16,"0x")};class al extends un{constructor(n){super(n),this.tag=al.tag}add(n){let s;it(n)?s=n:n&&typeof n=="object"&&"key"in n&&"value"in n&&n.value===null?s=new Bt(n.key,null):s=new Bt(n,null),qs(this.items,s.key)||this.items.push(s)}get(n,s){const a=qs(this.items,n);return!s&&it(a)?Qe(a.key)?a.key.value:a.key:a}set(n,s){if(typeof s!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof s}`);const a=qs(this.items,n);a&&!s?this.items.splice(this.items.indexOf(a),1):!a&&s&&this.items.push(new Bt(n))}toJSON(n,s){return super.toJSON(n,s,Set)}toString(n,s,a){if(!n)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},n,{allNullValues:!0}),s,a);throw new Error("Set items must all have null values")}static from(n,s,a){const{replacer:o}=a,c=new this(n);if(s&&Symbol.iterator in Object(s))for(let u of s)typeof o=="function"&&(u=o.call(s,u,u)),c.items.push(wm(u,null,a));return c}}al.tag="tag:yaml.org,2002:set";const Cm={collection:"map",identify:e=>e instanceof Set,nodeClass:al,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,n,s)=>al.from(e,n,s),resolve(e,n){if(El(e)){if(e.hasAllNullValues(!0))return Object.assign(new al,e);n("Set items must all have null values")}else n("Expected a mapping for this tag");return e}};function Mm(e,n){const s=e[0],a=s==="-"||s==="+"?e.substring(1):e,o=u=>n?BigInt(u):Number(u),c=a.replace(/_/g,"").split(":").reduce((u,d)=>u*o(60)+o(d),o(0));return s==="-"?o(-1)*c:c}function kS(e){let{value:n}=e,s=u=>u;if(typeof n=="bigint")s=u=>BigInt(u);else if(isNaN(n)||!isFinite(n))return Kn(e);let a="";n<0&&(a="-",n*=s(-1));const o=s(60),c=[n%o];return n<60?c.unshift(0):(n=(n-c[0])/o,c.unshift(n%o),n>=60&&(n=(n-c[0])/o,c.unshift(n))),a+c.map(u=>String(u).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const zS={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,n,{intAsBigInt:s})=>Mm(e,s),stringify:kS},DS={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Mm(e,!1),stringify:kS},$u={identify:e=>e 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(e){const n=e.match($u.test);if(!n)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,a,o,c,u,d]=n.map(Number),h=n[7]?Number((n[7]+"00").substr(1,3)):0;let p=Date.UTC(s,a-1,o,c||0,u||0,d||0,h);const v=n[8];if(v&&v!=="Z"){let g=Mm(v,!1);Math.abs(g)<30&&(g*=60),p-=6e4*g}return new Date(p)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},qv=[_l,Al,ju,Ru,MS,OS,EO,NO,_O,AO,SO,wO,xO,Nm,zi,Am,_m,Cm,zS,DS,$u],Vv=new Map([["core",gO],["failsafe",[_l,Al,ju]],["json",bO],["yaml11",qv],["yaml-1.1",qv]]),Yv={binary:Nm,bool:xm,float:wS,floatExp:SS,floatNaN:bS,floatTime:DS,int:NS,intHex:_S,intOct:ES,intTime:zS,map:_l,merge:zi,null:Ru,omap:Am,pairs:_m,seq:Al,set:Cm,timestamp:$u},TO={"tag:yaml.org,2002:binary":Nm,"tag:yaml.org,2002:merge":zi,"tag:yaml.org,2002:omap":Am,"tag:yaml.org,2002:pairs":_m,"tag:yaml.org,2002:set":Cm,"tag:yaml.org,2002:timestamp":$u};function bh(e,n,s){const a=Vv.get(n);if(a&&!e)return s&&!a.includes(zi)?a.concat(zi):a.slice();let o=a;if(!o)if(Array.isArray(e))o=[];else{const c=Array.from(Vv.keys()).filter(u=>u!=="yaml11").map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown schema "${n}"; use one of ${c} or define customTags array`)}if(Array.isArray(e))for(const c of e)o=o.concat(c);else typeof e=="function"&&(o=e(o.slice()));return s&&(o=o.concat(zi)),o.reduce((c,u)=>{const d=typeof u=="string"?Yv[u]:u;if(!d){const h=JSON.stringify(u),p=Object.keys(Yv).map(v=>JSON.stringify(v)).join(", ");throw new Error(`Unknown custom tag ${h}; use one of ${p}`)}return c.includes(d)||c.push(d),c},[])}const CO=(e,n)=>e.key<n.key?-1:e.key>n.key?1:0;class Hu{constructor({compat:n,customTags:s,merge:a,resolveKnownTags:o,schema:c,sortMapEntries:u,toStringDefaults:d}){this.compat=Array.isArray(n)?bh(n,"compat"):n?bh(null,n):null,this.name=typeof c=="string"&&c||"core",this.knownTags=o?TO:{},this.tags=bh(s,this.name,a),this.toStringOptions=d??null,Object.defineProperty(this,vs,{value:_l}),Object.defineProperty(this,li,{value:ju}),Object.defineProperty(this,xl,{value:Al}),this.sortMapEntries=typeof u=="function"?u:u===!0?CO:null}clone(){const n=Object.create(Hu.prototype,Object.getOwnPropertyDescriptors(this));return n.tags=this.tags.slice(),n}}function MO(e,n){const s=[];let a=n.directives===!0;if(n.directives!==!1&&e.directives){const h=e.directives.toString(e);h?(s.push(h),a=!0):e.directives.docStart&&(a=!0)}a&&s.push("---");const o=hS(e,n),{commentString:c}=o.options;if(e.commentBefore){s.length!==1&&s.unshift("");const h=c(e.commentBefore);s.unshift(ki(h,""))}let u=!1,d=null;if(e.contents){if(lt(e.contents)){if(e.contents.spaceBefore&&a&&s.push(""),e.contents.commentBefore){const v=c(e.contents.commentBefore);s.push(ki(v,""))}o.forceBlockIndent=!!e.comment,d=e.contents.comment}const h=d?void 0:()=>u=!0;let p=yl(e.contents,o,()=>d=null,h);d&&(p+=Is(p,"",c(d))),(p[0]==="|"||p[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${p}`:s.push(p)}else s.push(yl(e.contents,o));if(e.directives?.docEnd)if(e.comment){const h=c(e.comment);h.includes(`
69
+ `)?(s.push("..."),s.push(ki(h,""))):s.push(`... ${h}`)}else s.push("...");else{let h=e.comment;h&&u&&(h=h.replace(/^\n+/,"")),h&&((!u||d)&&s[s.length-1]!==""&&s.push(""),s.push(ki(c(h),"")))}return s.join(`
70
+ `)+`
71
+ `}class Tl{constructor(n,s,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,On,{value:qh});let o=null;typeof s=="function"||Array.isArray(s)?o=s:a===void 0&&s&&(a=s,s=void 0);const c=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},a);this.options=c;let{version:u}=c;a?._directives?(this.directives=a._directives.atDocument(),this.directives.yaml.explicit&&(u=this.directives.yaml.version)):this.directives=new Ht({version:u}),this.setSchema(u,a),this.contents=n===void 0?null:this.createNode(n,o,a)}clone(){const n=Object.create(Tl.prototype,{[On]:{value:qh}});return n.commentBefore=this.commentBefore,n.comment=this.comment,n.errors=this.errors.slice(),n.warnings=this.warnings.slice(),n.options=Object.assign({},this.options),this.directives&&(n.directives=this.directives.clone()),n.schema=this.schema.clone(),n.contents=lt(this.contents)?this.contents.clone(n.schema):this.contents,this.range&&(n.range=this.range.slice()),n}add(n){Xa(this.contents)&&this.contents.add(n)}addIn(n,s){Xa(this.contents)&&this.contents.addIn(n,s)}createAlias(n,s){if(!n.anchor){const a=rS(this);n.anchor=!s||a.has(s)?cS(s||"a",a):s}return new Ou(n.anchor)}createNode(n,s,a){let o;if(typeof s=="function")n=s.call({"":n},"",n),o=s;else if(Array.isArray(s)){const A=z=>typeof z=="number"||z instanceof String||z instanceof Number,T=s.filter(A).map(String);T.length>0&&(s=s.concat(T)),o=s}else a===void 0&&s&&(a=s,s=void 0);const{aliasDuplicateObjects:c,anchorPrefix:u,flow:d,keepUndefined:h,onTagObj:p,tag:v}=a??{},{onAnchor:g,setAnchors:y,sourceObjects:w}=iO(this,u||"a"),x={aliasDuplicateObjects:c??!0,keepUndefined:h??!1,onAnchor:g,onTagObj:p,replacer:o,schema:this.schema,sourceObjects:w},E=Po(n,v,x);return d&&at(E)&&(E.flow=!0),y(),E}createPair(n,s,a={}){const o=this.createNode(n,null,a),c=this.createNode(s,null,a);return new Bt(o,c)}delete(n){return Xa(this.contents)?this.contents.delete(n):!1}deleteIn(n){return jo(n)?this.contents==null?!1:(this.contents=null,!0):Xa(this.contents)?this.contents.deleteIn(n):!1}get(n,s){return at(this.contents)?this.contents.get(n,s):void 0}getIn(n,s){return jo(n)?!s&&Qe(this.contents)?this.contents.value:this.contents:at(this.contents)?this.contents.getIn(n,s):void 0}has(n){return at(this.contents)?this.contents.has(n):!1}hasIn(n){return jo(n)?this.contents!==void 0:at(this.contents)?this.contents.hasIn(n):!1}set(n,s){this.contents==null?this.contents=du(this.schema,[n],s):Xa(this.contents)&&this.contents.set(n,s)}setIn(n,s){jo(n)?this.contents=s:this.contents==null?this.contents=du(this.schema,Array.from(n),s):Xa(this.contents)&&this.contents.setIn(n,s)}setSchema(n,s={}){typeof n=="number"&&(n=String(n));let a;switch(n){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ht({version:"1.1"}),a={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=n:this.directives=new Ht({version:n}),a={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,a=null;break;default:{const o=JSON.stringify(n);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${o}`)}}if(s.schema instanceof Object)this.schema=s.schema;else if(a)this.schema=new Hu(Object.assign(a,s));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:n,jsonArg:s,mapAsMap:a,maxAliasCount:o,onAnchor:c,reviver:u}={}){const d={anchors:new Map,doc:this,keep:!n,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof o=="number"?o:100},h=Mn(this.contents,s??"",d);if(typeof c=="function")for(const{count:p,res:v}of d.anchors.values())c(v,p);return typeof u=="function"?Pa(u,{"":h},"",h):h}toJSON(n,s){return this.toJS({json:!0,jsonArg:n,mapAsMap:!1,onAnchor:s})}toString(n={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in n&&(!Number.isInteger(n.indent)||Number(n.indent)<=0)){const s=JSON.stringify(n.indent);throw new Error(`"indent" option must be a positive integer, not ${s}`)}return MO(this,n)}}function Xa(e){if(at(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Om extends Error{constructor(n,s,a,o){super(),this.name=n,this.code=a,this.message=o,this.pos=s}}class Vs extends Om{constructor(n,s,a){super("YAMLParseError",n,s,a)}}class jS extends Om{constructor(n,s,a){super("YAMLWarning",n,s,a)}}const mu=(e,n)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(d=>n.linePos(d));const{line:a,col:o}=s.linePos[0];s.message+=` at line ${a}, column ${o}`;let c=o-1,u=e.substring(n.lineStarts[a-1],n.lineStarts[a]).replace(/[\n\r]+$/,"");if(c>=60&&u.length>80){const d=Math.min(c-39,u.length-79);u="…"+u.substring(d),c-=d-1}if(u.length>80&&(u=u.substring(0,79)+"…"),a>1&&/^ *$/.test(u.substring(0,c))){let d=e.substring(n.lineStarts[a-2],n.lineStarts[a-1]);d.length>80&&(d=d.substring(0,79)+`…
72
+ `),u=d+u}if(/[^ ]/.test(u)){let d=1;const h=s.linePos[1];h?.line===a&&h.col>o&&(d=Math.max(1,Math.min(h.col-o,80-c)));const p=" ".repeat(c)+"^".repeat(d);s.message+=`:
73
+
74
+ ${u}
75
+ ${p}
76
+ `}};function vl(e,{flow:n,indicator:s,next:a,offset:o,onError:c,parentIndent:u,startOnNewline:d}){let h=!1,p=d,v=d,g="",y="",w=!1,x=!1,E=null,A=null,T=null,z=null,_=null,N=null,j=null;for(const L of e)switch(x&&(L.type!=="space"&&L.type!=="newline"&&L.type!=="comma"&&c(L.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x=!1),E&&(p&&L.type!=="comment"&&L.type!=="newline"&&c(E,"TAB_AS_INDENT","Tabs are not allowed as indentation"),E=null),L.type){case"space":!n&&(s!=="doc-start"||a?.type!=="flow-collection")&&L.source.includes(" ")&&(E=L),v=!0;break;case"comment":{v||c(L,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const I=L.source.substring(1)||" ";g?g+=y+I:g=I,y="",p=!1;break}case"newline":p?g?g+=L.source:(!N||s!=="seq-item-ind")&&(h=!0):y+=L.source,p=!0,w=!0,(A||T)&&(z=L),v=!0;break;case"anchor":A&&c(L,"MULTIPLE_ANCHORS","A node can have at most one anchor"),L.source.endsWith(":")&&c(L.offset+L.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),A=L,j??(j=L.offset),p=!1,v=!1,x=!0;break;case"tag":{T&&c(L,"MULTIPLE_TAGS","A node can have at most one tag"),T=L,j??(j=L.offset),p=!1,v=!1,x=!0;break}case s:(A||T)&&c(L,"BAD_PROP_ORDER",`Anchors and tags must be after the ${L.source} indicator`),N&&c(L,"UNEXPECTED_TOKEN",`Unexpected ${L.source} in ${n??"collection"}`),N=L,p=s==="seq-item-ind"||s==="explicit-key-ind",v=!1;break;case"comma":if(n){_&&c(L,"UNEXPECTED_TOKEN",`Unexpected , in ${n}`),_=L,p=!1,v=!1;break}default:c(L,"UNEXPECTED_TOKEN",`Unexpected ${L.type} token`),p=!1,v=!1}const D=e[e.length-1],$=D?D.offset+D.source.length:o;return x&&a&&a.type!=="space"&&a.type!=="newline"&&a.type!=="comma"&&(a.type!=="scalar"||a.source!=="")&&c(a.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),E&&(p&&E.indent<=u||a?.type==="block-map"||a?.type==="block-seq")&&c(E,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:N,spaceBefore:h,comment:g,hasNewline:w,anchor:A,tag:T,newlineAfterProp:z,end:$,start:j??$}}function er(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
77
+ `))return!0;if(e.end){for(const n of e.end)if(n.type==="newline")return!0}return!1;case"flow-collection":for(const n of e.items){for(const s of n.start)if(s.type==="newline")return!0;if(n.sep){for(const s of n.sep)if(s.type==="newline")return!0}if(er(n.key)||er(n.value))return!0}return!1;default:return!0}}function Xh(e,n,s){if(n?.type==="flow-collection"){const a=n.end[0];a.indent===e&&(a.source==="]"||a.source==="}")&&er(n)&&s(a,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function RS(e,n,s){const{uniqueKeys:a}=e.options;if(a===!1)return!1;const o=typeof a=="function"?a:(c,u)=>c===u||Qe(c)&&Qe(u)&&c.value===u.value;return n.some(c=>o(c.key,s))}const Gv="All mapping items must start at the same column";function OO({composeNode:e,composeEmptyNode:n},s,a,o,c){const u=c?.nodeClass??un,d=new u(s.schema);s.atRoot&&(s.atRoot=!1);let h=a.offset,p=null;for(const v of a.items){const{start:g,key:y,sep:w,value:x}=v,E=vl(g,{indicator:"explicit-key-ind",next:y??w?.[0],offset:h,onError:o,parentIndent:a.indent,startOnNewline:!0}),A=!E.found;if(A){if(y&&(y.type==="block-seq"?o(h,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==a.indent&&o(h,"BAD_INDENT",Gv)),!E.anchor&&!E.tag&&!w){p=E.end,E.comment&&(d.comment?d.comment+=`
78
+ `+E.comment:d.comment=E.comment);continue}(E.newlineAfterProp||er(y))&&o(y??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else E.found?.indent!==a.indent&&o(h,"BAD_INDENT",Gv);s.atKey=!0;const T=E.end,z=y?e(s,y,E,o):n(s,T,g,null,E,o);s.schema.compat&&Xh(a.indent,y,o),s.atKey=!1,RS(s,d.items,z)&&o(T,"DUPLICATE_KEY","Map keys must be unique");const _=vl(w??[],{indicator:"map-value-ind",next:x,offset:z.range[2],onError:o,parentIndent:a.indent,startOnNewline:!y||y.type==="block-scalar"});if(h=_.end,_.found){A&&(x?.type==="block-map"&&!_.hasNewline&&o(h,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&E.start<_.found.offset-1024&&o(z.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const N=x?e(s,x,_,o):n(s,h,w,null,_,o);s.schema.compat&&Xh(a.indent,x,o),h=N.range[2];const j=new Bt(z,N);s.options.keepSourceTokens&&(j.srcToken=v),d.items.push(j)}else{A&&o(z.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(z.comment?z.comment+=`
79
+ `+_.comment:z.comment=_.comment);const N=new Bt(z);s.options.keepSourceTokens&&(N.srcToken=v),d.items.push(N)}}return p&&p<h&&o(p,"IMPOSSIBLE","Map comment with trailing content"),d.range=[a.offset,h,p??h],d}function kO({composeNode:e,composeEmptyNode:n},s,a,o,c){const u=c?.nodeClass??bs,d=new u(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let h=a.offset,p=null;for(const{start:v,value:g}of a.items){const y=vl(v,{indicator:"seq-item-ind",next:g,offset:h,onError:o,parentIndent:a.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||g)g?.type==="block-seq"?o(y.end,"BAD_INDENT","All sequence items must start at the same column"):o(h,"MISSING_CHAR","Sequence item without - indicator");else{p=y.end,y.comment&&(d.comment=y.comment);continue}const w=g?e(s,g,y,o):n(s,y.end,v,null,y,o);s.schema.compat&&Xh(a.indent,g,o),h=w.range[2],d.items.push(w)}return d.range=[a.offset,h,p??h],d}function pr(e,n,s,a){let o="";if(e){let c=!1,u="";for(const d of e){const{source:h,type:p}=d;switch(p){case"space":c=!0;break;case"comment":{s&&!c&&a(d,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const v=h.substring(1)||" ";o?o+=u+v:o=v,u="";break}case"newline":o&&(u+=h),c=!0;break;default:a(d,"UNEXPECTED_TOKEN",`Unexpected ${p} at node end`)}n+=h.length}}return{comment:o,offset:n}}const Sh="Block collections are not allowed within flow collections",wh=e=>e&&(e.type==="block-map"||e.type==="block-seq");function zO({composeNode:e,composeEmptyNode:n},s,a,o,c){const u=a.start.source==="{",d=u?"flow map":"flow sequence",h=c?.nodeClass??(u?un:bs),p=new h(s.schema);p.flow=!0;const v=s.atRoot;v&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let g=a.offset+a.start.source.length;for(let A=0;A<a.items.length;++A){const T=a.items[A],{start:z,key:_,sep:N,value:j}=T,D=vl(z,{flow:d,indicator:"explicit-key-ind",next:_??N?.[0],offset:g,onError:o,parentIndent:a.indent,startOnNewline:!1});if(!D.found){if(!D.anchor&&!D.tag&&!N&&!j){A===0&&D.comma?o(D.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`):A<a.items.length-1&&o(D.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${d}`),D.comment&&(p.comment?p.comment+=`
80
+ `+D.comment:p.comment=D.comment),g=D.end;continue}!u&&s.options.strict&&er(_)&&o(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(A===0)D.comma&&o(D.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`);else if(D.comma||o(D.start,"MISSING_CHAR",`Missing , between ${d} items`),D.comment){let $="";e:for(const L of z)switch(L.type){case"comma":case"space":break;case"comment":$=L.source.substring(1);break e;default:break e}if($){let L=p.items[p.items.length-1];it(L)&&(L=L.value??L.key),L.comment?L.comment+=`
81
+ `+$:L.comment=$,D.comment=D.comment.substring($.length+1)}}if(!u&&!N&&!D.found){const $=j?e(s,j,D,o):n(s,D.end,N,null,D,o);p.items.push($),g=$.range[2],wh(j)&&o($.range,"BLOCK_IN_FLOW",Sh)}else{s.atKey=!0;const $=D.end,L=_?e(s,_,D,o):n(s,$,z,null,D,o);wh(_)&&o(L.range,"BLOCK_IN_FLOW",Sh),s.atKey=!1;const I=vl(N??[],{flow:d,indicator:"map-value-ind",next:j,offset:L.range[2],onError:o,parentIndent:a.indent,startOnNewline:!1});if(I.found){if(!u&&!D.found&&s.options.strict){if(N)for(const Z of N){if(Z===I.found)break;if(Z.type==="newline"){o(Z,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}D.start<I.found.offset-1024&&o(I.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else j&&("source"in j&&j.source?.[0]===":"?o(j,"MISSING_CHAR",`Missing space after : in ${d}`):o(I.start,"MISSING_CHAR",`Missing , or : between ${d} items`));const V=j?e(s,j,I,o):I.found?n(s,I.end,N,null,I,o):null;V?wh(j)&&o(V.range,"BLOCK_IN_FLOW",Sh):I.comment&&(L.comment?L.comment+=`
82
+ `+I.comment:L.comment=I.comment);const G=new Bt(L,V);if(s.options.keepSourceTokens&&(G.srcToken=T),u){const Z=p;RS(s,Z.items,L)&&o($,"DUPLICATE_KEY","Map keys must be unique"),Z.items.push(G)}else{const Z=new un(s.schema);Z.flow=!0,Z.items.push(G);const le=(V??L).range;Z.range=[L.range[0],le[1],le[2]],p.items.push(Z)}g=V?V.range[2]:I.end}}const y=u?"}":"]",[w,...x]=a.end;let E=g;if(w?.source===y)E=w.offset+w.source.length;else{const A=d[0].toUpperCase()+d.substring(1),T=v?`${A} must end with a ${y}`:`${A} in block collection must be sufficiently indented and end with a ${y}`;o(g,v?"MISSING_CHAR":"BAD_INDENT",T),w&&w.source.length!==1&&x.unshift(w)}if(x.length>0){const A=pr(x,E,s.options.strict,o);A.comment&&(p.comment?p.comment+=`
83
+ `+A.comment:p.comment=A.comment),p.range=[a.offset,E,A.offset]}else p.range=[a.offset,E,E];return p}function xh(e,n,s,a,o,c){const u=s.type==="block-map"?OO(e,n,s,a,c):s.type==="block-seq"?kO(e,n,s,a,c):zO(e,n,s,a,c),d=u.constructor;return o==="!"||o===d.tagName?(u.tag=d.tagName,u):(o&&(u.tag=o),u)}function DO(e,n,s,a,o){const c=a.tag,u=c?n.directives.tagName(c.source,y=>o(c,"TAG_RESOLVE_FAILED",y)):null;if(s.type==="block-seq"){const{anchor:y,newlineAfterProp:w}=a,x=y&&c?y.offset>c.offset?y:c:y??c;x&&(!w||w.offset<x.offset)&&o(x,"MISSING_CHAR","Missing newline after block sequence props")}const d=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!c||!u||u==="!"||u===un.tagName&&d==="map"||u===bs.tagName&&d==="seq")return xh(e,n,s,o,u);let h=n.schema.tags.find(y=>y.tag===u&&y.collection===d);if(!h){const y=n.schema.knownTags[u];if(y?.collection===d)n.schema.tags.push(Object.assign({},y,{default:!1})),h=y;else return y?o(c,"BAD_COLLECTION_TYPE",`${y.tag} used for ${d} collection, but expects ${y.collection??"scalar"}`,!0):o(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${u}`,!0),xh(e,n,s,o,u)}const p=xh(e,n,s,o,u,h),v=h.resolve?.(p,y=>o(c,"TAG_RESOLVE_FAILED",y),n.options)??p,g=lt(v)?v:new Ae(v);return g.range=p.range,g.tag=u,h?.format&&(g.format=h.format),g}function BS(e,n,s){const a=n.offset,o=jO(n,e.options.strict,s);if(!o)return{value:"",type:null,comment:"",range:[a,a,a]};const c=o.mode===">"?Ae.BLOCK_FOLDED:Ae.BLOCK_LITERAL,u=n.source?RO(n.source):[];let d=u.length;for(let E=u.length-1;E>=0;--E){const A=u[E][1];if(A===""||A==="\r")d=E;else break}if(d===0){const E=o.chomp==="+"&&u.length>0?`
84
+ `.repeat(Math.max(1,u.length-1)):"";let A=a+o.length;return n.source&&(A+=n.source.length),{value:E,type:c,comment:o.comment,range:[a,A,A]}}let h=n.indent+o.indent,p=n.offset+o.length,v=0;for(let E=0;E<d;++E){const[A,T]=u[E];if(T===""||T==="\r")o.indent===0&&A.length>h&&(h=A.length);else{A.length<h&&s(p+A.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),o.indent===0&&(h=A.length),v=E,h===0&&!e.atRoot&&s(p,"BAD_INDENT","Block scalar values in collections must be indented");break}p+=A.length+T.length+1}for(let E=u.length-1;E>=d;--E)u[E][0].length>h&&(d=E+1);let g="",y="",w=!1;for(let E=0;E<v;++E)g+=u[E][0].slice(h)+`
85
+ `;for(let E=v;E<d;++E){let[A,T]=u[E];p+=A.length+T.length+1;const z=T[T.length-1]==="\r";if(z&&(T=T.slice(0,-1)),T&&A.length<h){const N=`Block scalar lines must not be less indented than their ${o.indent?"explicit indentation indicator":"first line"}`;s(p-T.length-(z?2:1),"BAD_INDENT",N),A=""}c===Ae.BLOCK_LITERAL?(g+=y+A.slice(h)+T,y=`
86
+ `):A.length>h||T[0]===" "?(y===" "?y=`
87
+ `:!w&&y===`
88
+ `&&(y=`
89
+
90
+ `),g+=y+A.slice(h)+T,y=`
91
+ `,w=!0):T===""?y===`
92
+ `?g+=`
93
+ `:y=`
94
+ `:(g+=y+T,y=" ",w=!1)}switch(o.chomp){case"-":break;case"+":for(let E=d;E<u.length;++E)g+=`
95
+ `+u[E][0].slice(h);g[g.length-1]!==`
96
+ `&&(g+=`
97
+ `);break;default:g+=`
98
+ `}const x=a+o.length+n.source.length;return{value:g,type:c,comment:o.comment,range:[a,x,x]}}function jO({offset:e,props:n},s,a){if(n[0].type!=="block-scalar-header")return a(n[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:o}=n[0],c=o[0];let u=0,d="",h=-1;for(let y=1;y<o.length;++y){const w=o[y];if(!d&&(w==="-"||w==="+"))d=w;else{const x=Number(w);!u&&x?u=x:h===-1&&(h=e+y)}}h!==-1&&a(h,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${o}`);let p=!1,v="",g=o.length;for(let y=1;y<n.length;++y){const w=n[y];switch(w.type){case"space":p=!0;case"newline":g+=w.source.length;break;case"comment":s&&!p&&a(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),g+=w.source.length,v=w.source.substring(1);break;case"error":a(w,"UNEXPECTED_TOKEN",w.message),g+=w.source.length;break;default:{const x=`Unexpected token in block scalar header: ${w.type}`;a(w,"UNEXPECTED_TOKEN",x);const E=w.source;E&&typeof E=="string"&&(g+=E.length)}}}return{mode:c,indent:u,chomp:d,comment:v,length:g}}function RO(e){const n=e.split(/\n( *)/),s=n[0],a=s.match(/^( *)/),c=[a?.[1]?[a[1],s.slice(a[1].length)]:["",s]];for(let u=1;u<n.length;u+=2)c.push([n[u],n[u+1]]);return c}function LS(e,n,s){const{offset:a,type:o,source:c,end:u}=e;let d,h;const p=(y,w,x)=>s(a+y,w,x);switch(o){case"scalar":d=Ae.PLAIN,h=BO(c,p);break;case"single-quoted-scalar":d=Ae.QUOTE_SINGLE,h=LO(c,p);break;case"double-quoted-scalar":d=Ae.QUOTE_DOUBLE,h=$O(c,p);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[a,a+c.length,a+c.length]}}const v=a+c.length,g=pr(u,v,n,s);return{value:h,type:d,comment:g.comment,range:[a,v,g.offset]}}function BO(e,n){let s="";switch(e[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 ${e[0]}`;break}case"@":case"`":{s=`reserved character ${e[0]}`;break}}return s&&n(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`),$S(e)}function LO(e,n){return(e[e.length-1]!=="'"||e.length===1)&&n(e.length,"MISSING_CHAR","Missing closing 'quote"),$S(e.slice(1,-1)).replace(/''/g,"'")}function $S(e){let n,s;try{n=new RegExp(`(.*?)(?<![ ])[ ]*\r?
99
+ `,"sy"),s=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
100
+ `,"sy")}catch{n=/(.*?)[ \t]*\r?\n/sy,s=/[ \t]*(.*?)[ \t]*\r?\n/sy}let a=n.exec(e);if(!a)return e;let o=a[1],c=" ",u=n.lastIndex;for(s.lastIndex=u;a=s.exec(e);)a[1]===""?c===`
101
+ `?o+=c:c=`
102
+ `:(o+=c+a[1],c=" "),u=s.lastIndex;const d=/[ \t]*(.*)/sy;return d.lastIndex=u,a=d.exec(e),o+c+(a?.[1]??"")}function $O(e,n){let s="";for(let a=1;a<e.length-1;++a){const o=e[a];if(!(o==="\r"&&e[a+1]===`
103
+ `))if(o===`
104
+ `){const{fold:c,offset:u}=HO(e,a);s+=c,a=u}else if(o==="\\"){let c=e[++a];const u=UO[c];if(u)s+=u;else if(c===`
105
+ `)for(c=e[a+1];c===" "||c===" ";)c=e[++a+1];else if(c==="\r"&&e[a+1]===`
106
+ `)for(c=e[++a+1];c===" "||c===" ";)c=e[++a+1];else if(c==="x"||c==="u"||c==="U"){const d=c==="x"?2:c==="u"?4:8;s+=IO(e,a+1,d,n),a+=d}else{const d=e.substr(a-1,2);n(a-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${d}`),s+=d}}else if(o===" "||o===" "){const c=a;let u=e[a+1];for(;u===" "||u===" ";)u=e[++a+1];u!==`
107
+ `&&!(u==="\r"&&e[a+2]===`
108
+ `)&&(s+=a>c?e.slice(c,a+1):o)}else s+=o}return(e[e.length-1]!=='"'||e.length===1)&&n(e.length,"MISSING_CHAR",'Missing closing "quote'),s}function HO(e,n){let s="",a=e[n+1];for(;(a===" "||a===" "||a===`
109
+ `||a==="\r")&&!(a==="\r"&&e[n+2]!==`
110
+ `);)a===`
111
+ `&&(s+=`
112
+ `),n+=1,a=e[n+1];return s||(s=" "),{fold:s,offset:n}}const UO={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
113
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function IO(e,n,s,a){const o=e.substr(n,s),u=o.length===s&&/^[0-9a-fA-F]+$/.test(o)?parseInt(o,16):NaN;try{return String.fromCodePoint(u)}catch{const d=e.substr(n-2,s+2);return a(n-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${d}`),d}}function HS(e,n,s,a){const{value:o,type:c,comment:u,range:d}=n.type==="block-scalar"?BS(e,n,a):LS(n,e.options.strict,a),h=s?e.directives.tagName(s.source,g=>a(s,"TAG_RESOLVE_FAILED",g)):null;let p;e.options.stringKeys&&e.atKey?p=e.schema[li]:h?p=qO(e.schema,o,h,s,a):n.type==="scalar"?p=VO(e,o,n,a):p=e.schema[li];let v;try{const g=p.resolve(o,y=>a(s??n,"TAG_RESOLVE_FAILED",y),e.options);v=Qe(g)?g:new Ae(g)}catch(g){const y=g instanceof Error?g.message:String(g);a(s??n,"TAG_RESOLVE_FAILED",y),v=new Ae(o)}return v.range=d,v.source=o,c&&(v.type=c),h&&(v.tag=h),p.format&&(v.format=p.format),u&&(v.comment=u),v}function qO(e,n,s,a,o){if(s==="!")return e[li];const c=[];for(const d of e.tags)if(!d.collection&&d.tag===s)if(d.default&&d.test)c.push(d);else return d;for(const d of c)if(d.test?.test(n))return d;const u=e.knownTags[s];return u&&!u.collection?(e.tags.push(Object.assign({},u,{default:!1,test:void 0})),u):(o(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),e[li])}function VO({atKey:e,directives:n,schema:s},a,o,c){const u=s.tags.find(d=>(d.default===!0||e&&d.default==="key")&&d.test?.test(a))||s[li];if(s.compat){const d=s.compat.find(h=>h.default&&h.test?.test(a))??s[li];if(u.tag!==d.tag){const h=n.tagString(u.tag),p=n.tagString(d.tag),v=`Value may be parsed as either ${h} or ${p}`;c(o,"TAG_RESOLVE_FAILED",v,!0)}}return u}function YO(e,n,s){if(n){s??(s=n.length);for(let a=s-1;a>=0;--a){let o=n[a];switch(o.type){case"space":case"comment":case"newline":e-=o.source.length;continue}for(o=n[++a];o?.type==="space";)e+=o.source.length,o=n[++a];break}}return e}const GO={composeNode:US,composeEmptyNode:km};function US(e,n,s,a){const o=e.atKey,{spaceBefore:c,comment:u,anchor:d,tag:h}=s;let p,v=!0;switch(n.type){case"alias":p=XO(e,n,a),(d||h)&&a(n,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":p=HS(e,n,h,a),d&&(p.anchor=d.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{p=DO(GO,e,n,s,a),d&&(p.anchor=d.source.substring(1))}catch(g){const y=g instanceof Error?g.message:String(g);a(n,"RESOURCE_EXHAUSTION",y)}break;default:{const g=n.type==="error"?n.message:`Unsupported token (type: ${n.type})`;a(n,"UNEXPECTED_TOKEN",g),v=!1}}return p??(p=km(e,n.offset,void 0,null,s,a)),d&&p.anchor===""&&a(d,"BAD_ALIAS","Anchor cannot be an empty string"),o&&e.options.stringKeys&&(!Qe(p)||typeof p.value!="string"||p.tag&&p.tag!=="tag:yaml.org,2002:str")&&a(h??n,"NON_STRING_KEY","With stringKeys, all keys must be strings"),c&&(p.spaceBefore=!0),u&&(n.type==="scalar"&&n.source===""?p.comment=u:p.commentBefore=u),e.options.keepSourceTokens&&v&&(p.srcToken=n),p}function km(e,n,s,a,{spaceBefore:o,comment:c,anchor:u,tag:d,end:h},p){const v={type:"scalar",offset:YO(n,s,a),indent:-1,source:""},g=HS(e,v,d,p);return u&&(g.anchor=u.source.substring(1),g.anchor===""&&p(u,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(g.spaceBefore=!0),c&&(g.comment=c,g.range[2]=h),g}function XO({options:e},{offset:n,source:s,end:a},o){const c=new Ou(s.substring(1));c.source===""&&o(n,"BAD_ALIAS","Alias cannot be an empty string"),c.source.endsWith(":")&&o(n+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const u=n+s.length,d=pr(a,u,e.strict,o);return c.range=[n,u,d.offset],d.comment&&(c.comment=d.comment),c}function KO(e,n,{offset:s,start:a,value:o,end:c},u){const d=Object.assign({_directives:n},e),h=new Tl(void 0,d),p={atKey:!1,atRoot:!0,directives:h.directives,options:h.options,schema:h.schema},v=vl(a,{indicator:"doc-start",next:o??c?.[0],offset:s,onError:u,parentIndent:0,startOnNewline:!0});v.found&&(h.directives.docStart=!0,o&&(o.type==="block-map"||o.type==="block-seq")&&!v.hasNewline&&u(v.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),h.contents=o?US(p,o,v,u):km(p,v.end,a,null,v,u);const g=h.contents.range[2],y=pr(c,g,!1,u);return y.comment&&(h.comment=y.comment),h.range=[s,g,y.offset],h}function ko(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:n,source:s}=e;return[n,n+(typeof s=="string"?s.length:1)]}function Xv(e){let n="",s=!1,a=!1;for(let o=0;o<e.length;++o){const c=e[o];switch(c[0]){case"#":n+=(n===""?"":a?`
114
+
115
+ `:`
116
+ `)+(c.substring(1)||" "),s=!0,a=!1;break;case"%":e[o+1]?.[0]!=="#"&&(o+=1),s=!1;break;default:s||(a=!0),s=!1}}return{comment:n,afterEmptyLine:a}}class zm{constructor(n={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,a,o,c)=>{const u=ko(s);c?this.warnings.push(new jS(u,a,o)):this.errors.push(new Vs(u,a,o))},this.directives=new Ht({version:n.version||"1.2"}),this.options=n}decorate(n,s){const{comment:a,afterEmptyLine:o}=Xv(this.prelude);if(a){const c=n.contents;if(s)n.comment=n.comment?`${n.comment}
117
+ ${a}`:a;else if(o||n.directives.docStart||!c)n.commentBefore=a;else if(at(c)&&!c.flow&&c.items.length>0){let u=c.items[0];it(u)&&(u=u.key);const d=u.commentBefore;u.commentBefore=d?`${a}
118
+ ${d}`:a}else{const u=c.commentBefore;c.commentBefore=u?`${a}
119
+ ${u}`:a}}if(s){for(let c=0;c<this.errors.length;++c)n.errors.push(this.errors[c]);for(let c=0;c<this.warnings.length;++c)n.warnings.push(this.warnings[c])}else n.errors=this.errors,n.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Xv(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(n,s=!1,a=-1){for(const o of n)yield*this.next(o);yield*this.end(s,a)}*next(n){switch(n.type){case"directive":this.directives.add(n.source,(s,a,o)=>{const c=ko(n);c[0]+=s,this.onError(c,"BAD_DIRECTIVE",a,o)}),this.prelude.push(n.source),this.atDirectives=!0;break;case"document":{const s=KO(this.options,this.directives,n,this.onError);this.atDirectives&&!s.directives.docStart&&this.onError(n,"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(n.source);break;case"error":{const s=n.source?`${n.message}: ${JSON.stringify(n.source)}`:n.message,a=new Vs(ko(n),"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 Vs(ko(n),"UNEXPECTED_TOKEN",a));break}this.doc.directives.docEnd=!0;const s=pr(n.end,n.offset+n.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 Vs(ko(n),"UNEXPECTED_TOKEN",`Unsupported token ${n.type}`))}}*end(n=!1,s=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(n){const a=Object.assign({_directives:this.directives},this.options),o=new Tl(void 0,a);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),o.range=[0,s,s],this.decorate(o,!1),yield o}}}function ZO(e,n=!0,s){if(e){const a=(o,c,u)=>{const d=typeof o=="number"?o:Array.isArray(o)?o[0]:o.offset;if(s)s(d,c,u);else throw new Vs([d,d+1],c,u)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return LS(e,n,a);case"block-scalar":return BS({options:{strict:n}},e,a)}}return null}function QO(e,n){const{implicitKey:s=!1,indent:a,inFlow:o=!1,offset:c=-1,type:u="PLAIN"}=n,d=hr({type:u,value:e},{implicitKey:s,indent:a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}}),h=n.end??[{type:"newline",offset:-1,indent:a,source:`
121
+ `}];switch(d[0]){case"|":case">":{const p=d.indexOf(`
122
+ `),v=d.substring(0,p),g=d.substring(p+1)+`
123
+ `,y=[{type:"block-scalar-header",offset:c,indent:a,source:v}];return IS(y,h)||y.push({type:"newline",offset:-1,indent:a,source:`
124
+ `}),{type:"block-scalar",offset:c,indent:a,props:y,source:g}}case'"':return{type:"double-quoted-scalar",offset:c,indent:a,source:d,end:h};case"'":return{type:"single-quoted-scalar",offset:c,indent:a,source:d,end:h};default:return{type:"scalar",offset:c,indent:a,source:d,end:h}}}function FO(e,n,s={}){let{afterKey:a=!1,implicitKey:o=!1,inFlow:c=!1,type:u}=s,d="indent"in e?e.indent:null;if(a&&typeof d=="number"&&(d+=2),!u)switch(e.type){case"single-quoted-scalar":u="QUOTE_SINGLE";break;case"double-quoted-scalar":u="QUOTE_DOUBLE";break;case"block-scalar":{const p=e.props[0];if(p.type!=="block-scalar-header")throw new Error("Invalid block scalar header");u=p.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:u="PLAIN"}const h=hr({type:u,value:n},{implicitKey:o||d===null,indent:d!==null&&d>0?" ".repeat(d):"",inFlow:c,options:{blockQuote:!0,lineWidth:-1}});switch(h[0]){case"|":case">":JO(e,h);break;case'"':Eh(e,h,"double-quoted-scalar");break;case"'":Eh(e,h,"single-quoted-scalar");break;default:Eh(e,h,"scalar")}}function JO(e,n){const s=n.indexOf(`
125
+ `),a=n.substring(0,s),o=n.substring(s+1)+`
126
+ `;if(e.type==="block-scalar"){const c=e.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");c.source=a,e.source=o}else{const{offset:c}=e,u="indent"in e?e.indent:-1,d=[{type:"block-scalar-header",offset:c,indent:u,source:a}];IS(d,"end"in e?e.end:void 0)||d.push({type:"newline",offset:-1,indent:u,source:`
127
+ `});for(const h of Object.keys(e))h!=="type"&&h!=="offset"&&delete e[h];Object.assign(e,{type:"block-scalar",indent:u,props:d,source:o})}}function IS(e,n){if(n)for(const s of n)switch(s.type){case"space":case"comment":e.push(s);break;case"newline":return e.push(s),!0}return!1}function Eh(e,n,s){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=s,e.source=n;break;case"block-scalar":{const a=e.props.slice(1);let o=n.length;e.props[0].type==="block-scalar-header"&&(o-=e.props[0].source.length);for(const c of a)c.offset+=o;delete e.props,Object.assign(e,{type:s,source:n,end:a});break}case"block-map":case"block-seq":{const o={type:"newline",offset:e.offset+n.length,indent:e.indent,source:`
128
+ `};delete e.items,Object.assign(e,{type:s,source:n,end:[o]});break}default:{const a="indent"in e?e.indent:-1,o="end"in e&&Array.isArray(e.end)?e.end.filter(c=>c.type==="space"||c.type==="comment"||c.type==="newline"):[];for(const c of Object.keys(e))c!=="type"&&c!=="offset"&&delete e[c];Object.assign(e,{type:s,indent:a,source:n,end:o})}}}const WO=e=>"type"in e?pu(e):Pc(e);function pu(e){switch(e.type){case"block-scalar":{let n="";for(const s of e.props)n+=pu(s);return n+e.source}case"block-map":case"block-seq":{let n="";for(const s of e.items)n+=Pc(s);return n}case"flow-collection":{let n=e.start.source;for(const s of e.items)n+=Pc(s);for(const s of e.end)n+=s.source;return n}case"document":{let n=Pc(e);if(e.end)for(const s of e.end)n+=s.source;return n}default:{let n=e.source;if("end"in e&&e.end)for(const s of e.end)n+=s.source;return n}}}function Pc({start:e,key:n,sep:s,value:a}){let o="";for(const c of e)o+=c.source;if(n&&(o+=pu(n)),s)for(const c of s)o+=c.source;return a&&(o+=pu(a)),o}const Kh=Symbol("break visit"),PO=Symbol("skip children"),qS=Symbol("remove item");function Js(e,n){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),VS(Object.freeze([]),e,n)}Js.BREAK=Kh;Js.SKIP=PO;Js.REMOVE=qS;Js.itemAtPath=(e,n)=>{let s=e;for(const[a,o]of n){const c=s?.[a];if(c&&"items"in c)s=c.items[o];else return}return s};Js.parentCollection=(e,n)=>{const s=Js.itemAtPath(e,n.slice(0,-1)),a=n[n.length-1][0],o=s?.[a];if(o&&"items"in o)return o;throw new Error("Parent collection not found")};function VS(e,n,s){let a=s(n,e);if(typeof a=="symbol")return a;for(const o of["key","value"]){const c=n[o];if(c&&"items"in c){for(let u=0;u<c.items.length;++u){const d=VS(Object.freeze(e.concat([[o,u]])),c.items[u],s);if(typeof d=="number")u=d-1;else{if(d===Kh)return Kh;d===qS&&(c.items.splice(u,1),u-=1)}}typeof a=="function"&&o==="key"&&(a=a(n,e))}}return typeof a=="function"?a(n,e):a}const Uu="\uFEFF",Iu="",qu="",tr="",e3=e=>!!e&&"items"in e,t3=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function n3(e){switch(e){case Uu:return"<BOM>";case Iu:return"<DOC>";case qu:return"<FLOW_END>";case tr:return"<SCALAR>";default:return JSON.stringify(e)}}function YS(e){switch(e){case Uu:return"byte-order-mark";case Iu:return"doc-mode";case qu:return"flow-error-end";case tr: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(e[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 i3=Object.freeze(Object.defineProperty({__proto__:null,BOM:Uu,DOCUMENT:Iu,FLOW_END:qu,SCALAR:tr,createScalarToken:QO,isCollection:e3,isScalar:t3,prettyToken:n3,resolveAsScalar:ZO,setScalarValue:FO,stringify:WO,tokenType:YS,visit:Js},Symbol.toStringTag,{value:"Module"}));function Ln(e){switch(e){case void 0:case" ":case`
131
+ `:case"\r":case" ":return!0;default:return!1}}const Kv=new Set("0123456789ABCDEFabcdef"),s3=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),qc=new Set(",[]{}"),a3=new Set(` ,[]{}
132
+ \r `),Nh=e=>!e||a3.has(e);class GS{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(n,s=!1){if(n){if(typeof n!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+n:n,this.lineEndPos=null}this.atEnd=!s;let a=this.next??"stream";for(;a&&(s||this.hasChars(1));)a=yield*this.parseNext(a)}atLineEnd(){let n=this.pos,s=this.buffer[n];for(;s===" "||s===" ";)s=this.buffer[++n];return!s||s==="#"||s===`
133
+ `?!0:s==="\r"?this.buffer[n+1]===`
134
+ `:!1}charAt(n){return this.buffer[this.pos+n]}continueScalar(n){let s=this.buffer[n];if(this.indentNext>0){let a=0;for(;s===" ";)s=this.buffer[++a+n];if(s==="\r"){const o=this.buffer[a+n+1];if(o===`
135
+ `||!o&&!this.atEnd)return n+a+1}return s===`
136
+ `||a>=this.indentNext||!s&&!this.atEnd?n+a:-1}if(s==="-"||s==="."){const a=this.buffer.substr(n,3);if((a==="---"||a==="...")&&Ln(this.buffer[n+3]))return-1}return n}getLine(){let n=this.lineEndPos;return(typeof n!="number"||n!==-1&&n<this.pos)&&(n=this.buffer.indexOf(`
137
+ `,this.pos),this.lineEndPos=n),n===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[n-1]==="\r"&&(n-=1),this.buffer.substring(this.pos,n))}hasChars(n){return this.pos+n<=this.buffer.length}setNext(n){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=n,null}peek(n){return this.buffer.substr(this.pos,n)}*parseNext(n){switch(n){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 n=this.getLine();if(n===null)return this.setNext("stream");if(n[0]===Uu&&(yield*this.pushCount(1),n=n.substring(1)),n[0]==="%"){let s=n.length,a=n.indexOf("#");for(;a!==-1;){const c=n[a-1];if(c===" "||c===" "){s=a-1;break}else a=n.indexOf("#",a+1)}for(;;){const c=n[s-1];if(c===" "||c===" ")s-=1;else break}const o=(yield*this.pushCount(s))+(yield*this.pushSpaces(!0));return yield*this.pushCount(n.length-o),this.pushNewline(),"stream"}if(this.atLineEnd()){const s=yield*this.pushSpaces(!0);return yield*this.pushCount(n.length-s),yield*this.pushNewline(),"stream"}return yield Iu,yield*this.parseLineStart()}*parseLineStart(){const n=this.charAt(0);if(!n&&!this.atEnd)return this.setNext("line-start");if(n==="-"||n==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const s=this.peek(3);if((s==="---"||s==="...")&&Ln(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&&!Ln(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[n,s]=this.peek(2);if(!s&&!this.atEnd)return this.setNext("block-start");if((n==="-"||n==="?"||n===":")&&Ln(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 n=this.getLine();if(n===null)return this.setNext("doc");let s=yield*this.pushIndicators();switch(n[s]){case"#":yield*this.pushCount(n.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(Nh),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return s+=yield*this.parseBlockScalarHeader(),s+=yield*this.pushSpaces(!0),yield*this.pushCount(n.length-s),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let n,s,a=-1;do n=yield*this.pushNewline(),n>0?(s=yield*this.pushSpaces(!1),this.indentValue=a=s):s=0,s+=yield*this.pushSpaces(!0);while(n+s>0);const o=this.getLine();if(o===null)return this.setNext("flow");if((a!==-1&&a<this.indentNext&&o[0]!=="#"||a===0&&(o.startsWith("---")||o.startsWith("..."))&&Ln(o[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(o[0]==="]"||o[0]==="}")))return this.flowLevel=0,yield qu,yield*this.parseLineStart();let c=0;for(;o[c]===",";)c+=yield*this.pushCount(1),c+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(c+=yield*this.pushIndicators(),o[c]){case void 0:return"flow";case"#":return yield*this.pushCount(o.length-c),"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(Nh),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const u=this.charAt(1);if(this.flowKey||Ln(u)||u===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const n=this.charAt(0);let s=this.buffer.indexOf(n,this.pos+1);if(n==="'")for(;s!==-1&&this.buffer[s+1]==="'";)s=this.buffer.indexOf("'",s+2);else for(;s!==-1;){let c=0;for(;this.buffer[s-1-c]==="\\";)c+=1;if(c%2===0)break;s=this.buffer.indexOf('"',s+1)}const a=this.buffer.substring(0,s);let o=a.indexOf(`
138
+ `,this.pos);if(o!==-1){for(;o!==-1;){const c=this.continueScalar(o+1);if(c===-1)break;o=a.indexOf(`
139
+ `,c)}o!==-1&&(s=o-(a[o-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 n=this.pos;for(;;){const s=this.buffer[++n];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=>Ln(s)||s==="#")}*parseBlockScalar(){let n=this.pos-1,s=0,a;e:for(let c=this.pos;a=this.buffer[c];++c)switch(a){case" ":s+=1;break;case`
140
+ `:n=c,s=0;break;case"\r":{const u=this.buffer[c+1];if(!u&&!this.atEnd)return this.setNext("block-scalar");if(u===`
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 c=this.continueScalar(n+1);if(c===-1)break;n=this.buffer.indexOf(`
142
+ `,c)}while(n!==-1);if(n===-1){if(!this.atEnd)return this.setNext("block-scalar");n=this.buffer.length}}let o=n+1;for(a=this.buffer[o];a===" ";)a=this.buffer[++o];if(a===" "){for(;a===" "||a===" "||a==="\r"||a===`
143
+ `;)a=this.buffer[++o];n=o-1}else if(!this.blockScalarKeep)do{let c=n-1,u=this.buffer[c];u==="\r"&&(u=this.buffer[--c]);const d=c;for(;u===" ";)u=this.buffer[--c];if(u===`
144
+ `&&c>=this.pos&&c+1+s>d)n=c;else break}while(!0);return yield tr,yield*this.pushToIndex(n+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const n=this.flowLevel>0;let s=this.pos-1,a=this.pos-1,o;for(;o=this.buffer[++a];)if(o===":"){const c=this.buffer[a+1];if(Ln(c)||n&&qc.has(c))break;s=a}else if(Ln(o)){let c=this.buffer[a+1];if(o==="\r"&&(c===`
145
+ `?(a+=1,o=`
146
+ `,c=this.buffer[a+1]):s=a),c==="#"||n&&qc.has(c))break;if(o===`
147
+ `){const u=this.continueScalar(a+1);if(u===-1)break;a=Math.max(a,u-2)}}else{if(n&&qc.has(o))break;s=a}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield tr,yield*this.pushToIndex(s+1,!0),n?"flow":"doc")}*pushCount(n){return n>0?(yield this.buffer.substr(this.pos,n),this.pos+=n,n):0}*pushToIndex(n,s){const a=this.buffer.slice(this.pos,n);return a?(yield a,this.pos+=a.length,a.length):(s&&(yield""),0)}*pushIndicators(){let n=0;e:for(;;){switch(this.charAt(0)){case"!":n+=yield*this.pushTag(),n+=yield*this.pushSpaces(!0);continue e;case"&":n+=yield*this.pushUntil(Nh),n+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const s=this.flowLevel>0,a=this.charAt(1);if(Ln(a)||s&&qc.has(a)){s?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,n+=yield*this.pushCount(1),n+=yield*this.pushSpaces(!0);continue e}}}break e}return n}*pushTag(){if(this.charAt(1)==="<"){let n=this.pos+2,s=this.buffer[n];for(;!Ln(s)&&s!==">";)s=this.buffer[++n];return yield*this.pushToIndex(s===">"?n+1:n,!1)}else{let n=this.pos+1,s=this.buffer[n];for(;s;)if(s3.has(s))s=this.buffer[++n];else if(s==="%"&&Kv.has(this.buffer[n+1])&&Kv.has(this.buffer[n+2]))s=this.buffer[n+=3];else break;return yield*this.pushToIndex(n,!1)}}*pushNewline(){const n=this.buffer[this.pos];return n===`
148
+ `?yield*this.pushCount(1):n==="\r"&&this.charAt(1)===`
149
+ `?yield*this.pushCount(2):0}*pushSpaces(n){let s=this.pos-1,a;do a=this.buffer[++s];while(a===" "||n&&a===" ");const o=s-this.pos;return o>0&&(yield this.buffer.substr(this.pos,o),this.pos=s),o}*pushUntil(n){let s=this.pos,a=this.buffer[s];for(;!n(a);)a=this.buffer[++s];return yield*this.pushToIndex(s,!1)}}class XS{constructor(){this.lineStarts=[],this.addNewLine=n=>this.lineStarts.push(n),this.linePos=n=>{let s=0,a=this.lineStarts.length;for(;s<a;){const c=s+a>>1;this.lineStarts[c]<n?s=c+1:a=c}if(this.lineStarts[s]===n)return{line:s+1,col:1};if(s===0)return{line:0,col:n};const o=this.lineStarts[s-1];return{line:s,col:n-o+1}}}}function ps(e,n){for(let s=0;s<e.length;++s)if(e[s].type===n)return!0;return!1}function Zv(e){for(let n=0;n<e.length;++n)switch(e[n].type){case"space":case"comment":case"newline":break;default:return n}return-1}function KS(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Vc(e){switch(e.type){case"document":return e.start;case"block-map":{const n=e.items[e.items.length-1];return n.sep??n.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Ka(e){if(e.length===0)return[];let n=e.length;e:for(;--n>=0;)switch(e[n].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++n]?.type==="space";);return e.splice(n,e.length)}function gu(e,n){if(n.length<1e5)Array.prototype.push.apply(e,n);else for(let s=0;s<n.length;++s)e.push(n[s])}function Qv(e){if(e.start.type==="flow-seq-start")for(const n of e.items)n.sep&&!n.value&&!ps(n.start,"explicit-key-ind")&&!ps(n.sep,"map-value-ind")&&(n.key&&(n.value=n.key),delete n.key,KS(n.value)?n.value.end?gu(n.value.end,n.sep):n.value.end=n.sep:gu(n.start,n.sep),delete n.sep)}class Dm{constructor(n){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new GS,this.onNewLine=n}*parse(n,s=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const a of this.lexer.lex(n,s))yield*this.next(a);s||(yield*this.end())}*next(n){if(this.source=n,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=n.length;return}const s=YS(n);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+n.length);break;case"space":this.atNewLine&&n[0]===" "&&(this.indent+=n.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=n.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=n.length}else{const a=`Not a YAML token: ${n}`;yield*this.pop({type:"error",offset:this.offset,message:a,source:n}),this.offset+=n.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 n=this.peek(1);if(this.type==="doc-end"&&n?.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(!n)return yield*this.stream();switch(n.type){case"document":return yield*this.document(n);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(n);case"block-scalar":return yield*this.blockScalar(n);case"block-map":return yield*this.blockMap(n);case"block-seq":return yield*this.blockSequence(n);case"flow-collection":return yield*this.flowCollection(n);case"doc-end":return yield*this.documentEnd(n)}yield*this.pop()}peek(n){return this.stack[this.stack.length-n]}*pop(n){const s=n??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"&&Qv(s),a.type){case"document":a.value=s;break;case"block-scalar":a.props.push(s);break;case"block-map":{const o=a.items[a.items.length-1];if(o.value){a.items.push({start:[],key:s,sep:[]}),this.onKeyLine=!0;return}else if(o.sep)o.value=s;else{Object.assign(o,{key:s,sep:[]}),this.onKeyLine=!o.explicitKey;return}break}case"block-seq":{const o=a.items[a.items.length-1];o.value?a.items.push({start:[],value:s}):o.value=s;break}case"flow-collection":{const o=a.items[a.items.length-1];!o||o.value?a.items.push({start:[],key:s,sep:[]}):o.sep?o.value=s:Object.assign(o,{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 o=s.items[s.items.length-1];o&&!o.sep&&!o.value&&o.start.length>0&&Zv(o.start)===-1&&(s.indent===0||o.start.every(c=>c.type!=="comment"||c.indent<s.indent))&&(a.type==="document"?a.end=o.start:a.items.push({start:o.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 n={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&n.start.push(this.sourceToken),this.stack.push(n);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(n){if(n.value)return yield*this.lineEnd(n);switch(this.type){case"doc-start":{Zv(n.start)!==-1?(yield*this.pop(),yield*this.step()):n.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":n.start.push(this.sourceToken);return}const s=this.startBlockValue(n);s?this.stack.push(s):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(n){if(this.type==="map-value-ind"){const s=Vc(this.peek(2)),a=Ka(s);let o;n.end?(o=n.end,o.push(this.sourceToken),delete n.end):o=[this.sourceToken];const c={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:a,key:n,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(n)}*blockScalar(n){switch(this.type){case"space":case"comment":case"newline":n.props.push(this.sourceToken);return;case"scalar":if(n.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(n){const s=n.items[n.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):n.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)n.items.push({start:[this.sourceToken]});else if(s.sep)s.sep.push(this.sourceToken);else{if(this.atIndentedComment(s.start,n.indent)){const o=n.items[n.items.length-2]?.value?.end;if(Array.isArray(o)){gu(o,s.start),o.push(this.sourceToken),n.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=n.indent){const a=!this.onKeyLine&&this.indent===n.indent,o=a&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(o&&s.sep&&!s.value){const u=[];for(let d=0;d<s.sep.length;++d){const h=s.sep[d];switch(h.type){case"newline":u.push(d);break;case"space":break;case"comment":h.indent>n.indent&&(u.length=0);break;default:u.length=0}}u.length>=2&&(c=s.sep.splice(u[1]))}switch(this.type){case"anchor":case"tag":o||s.value?(c.push(this.sourceToken),n.items.push({start:c}),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):o||s.value?(c.push(this.sourceToken),n.items.push({start:c,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)n.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ps(s.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]});else if(KS(s.key)&&!ps(s.sep,"newline")){const u=Ka(s.start),d=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:u,key:d,sep:h}]})}else c.length>0?s.sep=s.sep.concat(c,this.sourceToken):s.sep.push(this.sourceToken);else if(ps(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const u=Ka(s.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:null,sep:[this.sourceToken]}]})}else s.sep?s.value||o?n.items.push({start:c,key:null,sep:[this.sourceToken]}):ps(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 u=this.flowScalar(this.type);o||s.value?(n.items.push({start:c,key:u,sep:[]}),this.onKeyLine=!0):s.sep?this.stack.push(u):(Object.assign(s,{key:u,sep:[]}),this.onKeyLine=!0);return}default:{const u=this.startBlockValue(n);if(u){if(u.type==="block-seq"){if(!s.explicitKey&&s.sep&&!ps(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&&n.items.push({start:c});this.stack.push(u);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(n){const s=n.items[n.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):n.items.push({start:[this.sourceToken]})}else s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)n.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(s.start,n.indent)){const o=n.items[n.items.length-2]?.value?.end;if(Array.isArray(o)){gu(o,s.start),o.push(this.sourceToken),n.items.pop();return}}s.start.push(this.sourceToken)}return;case"anchor":case"tag":if(s.value||this.indent<=n.indent)break;s.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==n.indent)break;s.value||ps(s.start,"seq-item-ind")?n.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return}if(this.indent>n.indent){const a=this.startBlockValue(n);if(a){this.stack.push(a);return}}yield*this.pop(),yield*this.step()}*flowCollection(n){const s=n.items[n.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(n.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!s||s.sep?n.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return;case"map-value-ind":!s||s.value?n.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?n.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 o=this.flowScalar(this.type);!s||s.value?n.items.push({start:[],key:o,sep:[]}):s.sep?this.stack.push(o):Object.assign(s,{key:o,sep:[]});return}case"flow-map-end":case"flow-seq-end":n.end.push(this.sourceToken);return}const a=this.startBlockValue(n);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===n.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 o=Vc(a),c=Ka(o);Qv(n);const u=n.end.splice(1,n.end.length);u.push(this.sourceToken);const d={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:c,key:n,sep:u}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=d}else yield*this.lineEnd(n)}}flowScalar(n){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:n,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(n){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=Vc(n),a=Ka(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=Vc(n),a=Ka(s);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(n,s){return this.type!=="comment"||this.indent<=s?!1:n.every(a=>a.type==="newline"||a.type==="space")}*documentEnd(n){this.type!=="doc-mode"&&(n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(n){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:n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function ZS(e){const n=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||n&&new XS||null,prettyErrors:n}}function l3(e,n={}){const{lineCounter:s,prettyErrors:a}=ZS(n),o=new Dm(s?.addNewLine),c=new zm(n),u=Array.from(c.compose(o.parse(e)));if(a&&s)for(const d of u)d.errors.forEach(mu(e,s)),d.warnings.forEach(mu(e,s));return u.length>0?u:Object.assign([],{empty:!0},c.streamInfo())}function QS(e,n={}){const{lineCounter:s,prettyErrors:a}=ZS(n),o=new Dm(s?.addNewLine),c=new zm(n);let u=null;for(const d of c.compose(o.parse(e),!0,e.length))if(!u)u=d;else if(u.options.logLevel!=="silent"){u.errors.push(new Vs(d.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return a&&s&&(u.errors.forEach(mu(e,s)),u.warnings.forEach(mu(e,s))),u}function o3(e,n,s){let a;typeof n=="function"?a=n:s===void 0&&n&&typeof n=="object"&&(s=n);const o=QS(e,s);if(!o)return null;if(o.warnings.forEach(c=>mS(o.options.logLevel,c)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:a},s))}function r3(e,n,s){let a=null;if(typeof n=="function"||Array.isArray(n)?a=n:s===void 0&&n&&(s=n),typeof s=="string"&&(s=s.length),typeof s=="number"){const o=Math.round(s);s=o<1?void 0:o>8?{indent:8}:{indent:o}}if(e===void 0){const{keepUndefined:o}=s??n??{};if(!o)return}return ea(e)&&!a?e.toString(s):new Tl(e,a,s).toString(s)}const na=Object.freeze(Object.defineProperty({__proto__:null,Alias:Ou,CST:i3,Composer:zm,Document:Tl,Lexer:GS,LineCounter:XS,Pair:Bt,Parser:Dm,Scalar:Ae,Schema:Hu,YAMLError:Om,YAMLMap:un,YAMLParseError:Vs,YAMLSeq:bs,YAMLWarning:jS,isAlias:Ps,isCollection:at,isDocument:ea,isMap:El,isNode:lt,isPair:it,isScalar:Qe,isSeq:Nl,parse:o3,parseAllDocuments:l3,parseDocument:QS,stringify:r3,visit:ta,visitAsync:Mu},Symbol.toStringTag,{value:"Module"}));function Ro(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function $n(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function c3(e,n,s){let a;try{a=na.parse(e)}catch(c){return[{check:"F1",path:n,message:`Invalid YAML: ${c instanceof Error?c.message:String(c)}`}]}if(!Ro(a))return[];const o=[];return a.kind!==void 0&&a.kind!==s&&o.push({check:"F1",path:n,message:`Expected kind "${s}", received "${String(a.kind)}".`}),a.schema_version!==void 0&&a.schema_version!==1&&o.push({check:"F1",path:n,message:`Unsupported schema_version "${String(a.schema_version)}". Supported version is 1.`}),a.kind===void 0!=(a.schema_version===void 0)&&o.push({check:"F1",path:n,message:"kind and schema_version must be supplied together."}),o}function u3(e){const n=[],s=[],a=[],o=new Set;for(const c of e){const u=y=>a.push({check:"F1",path:c.path,message:y});let d;try{d=na.parse(c.content)}catch(y){u(`Invalid feature YAML: ${y instanceof Error?y.message:String(y)}`);continue}if(!Ro(d)){u("Feature document must be a mapping.");continue}if(d.kind!=="feature"||d.schema_version!==1){u('Feature document requires kind "feature" and schema_version 1.');continue}if(!$n(d.id)){u("Feature requires a nonempty string id.");continue}if(o.has(d.id)){u(`Duplicate feature id "${d.id}".`);continue}o.add(d.id);const h=a.length;$n(d.name)||u("Feature name must be a nonempty string without surrounding whitespace.");const p=$n(d.name)?d.name:c.path,v=new Map;if(!Array.isArray(d.stories))u("Feature stories must be an array.");else for(const y of d.stories){if(!Ro(y)||!$n(y.id)){u("Each story requires a nonempty string id.");continue}if(v.has(y.id)){u(`Duplicate story id "${y.id}".`);continue}$n(y.name)||u(`Story "${y.id}" requires a nonempty name.`);const w=[];if(!Array.isArray(y.slices))u(`Story "${y.id}" slices must be an array.`);else for(const E of y.slices){if(!$n(E)||E.startsWith("/")||/^[A-Za-z]:/.test(E)||E.includes("\\")||E.split("/").includes("..")){u(`Story "${y.id}" slice references must be project-relative paths without parent traversal.`);continue}const A=E.split("/").filter(T=>T&&T!==".").join("/");if(!A){u(`Story "${y.id}" slice reference must identify a file, not the project root.`);continue}w.includes(A)?u(`Story "${y.id}" repeats slice "${A}".`):w.push(A)}const x={id:JSON.stringify([d.id,y.id]),localId:y.id,featureName:p,name:$n(y.name)?y.name:y.id,description:typeof y.description=="string"?y.description:"",path:c.path,slices:w};v.set(y.id,x),n.push(x)}if(a.length>h)continue;if(!Array.isArray(d.timelines)){u("Feature timelines must be an array.");continue}const g=new Set;for(const y of d.timelines){const w=a.length;if(!Ro(y)||!$n(y.id)){u("Each timeline requires a nonempty string id.");continue}if(g.has(y.id)){u(`Duplicate timeline id "${y.id}".`);continue}if(g.add(y.id),$n(y.name)||u(`Timeline "${y.id}" requires a nonempty name.`),!Array.isArray(y.steps)||y.steps.length===0){u(`Timeline "${y.id}" steps must be a nonempty array.`);continue}const x=[],E=new Set,A=new Set,T=new Set;for(const _ of y.steps){if(!Ro(_)||!$n(_.id)){u(`Timeline "${y.id}" requires a string id for every step.`);continue}E.has(_.id)&&u(`Timeline "${y.id}" repeats step id "${_.id}".`),E.add(_.id);const N=typeof _.story=="string"?v.get(_.story):void 0;if(!N){u(`Timeline "${y.id}" step "${_.id}" references unknown story "${String(_.story)}".`);continue}A.has(N.id)&&u(`Timeline "${y.id}" repeats story "${_.story}". Use separate timelines for alternative presentations.`),A.add(N.id);for(const D of N.slices)T.has(D)&&u(`Timeline "${y.id}" repeats slice "${D}" across stories.`),T.add(D);const j=[];if(_.after!==void 0)if(!Array.isArray(_.after)||!_.after.every($n))u(`Timeline "${y.id}" step "${_.id}" after must be an array of step ids.`);else for(const D of _.after)j.includes(D)?u(`Step "${_.id}" repeats predecessor "${D}".`):j.push(D);x.push({id:_.id,storyId:N.id,after:j})}for(const _ of x)for(const N of _.after)E.has(N)||u(`Step "${_.id}" references unknown predecessor "${N}".`);const z=new Set(x.map(_=>_.id));for(;z.size>0;){const _=x.filter(N=>z.has(N.id)&&N.after.every(j=>!z.has(j)));if(_.length===0){u(`Timeline "${y.id}" contains a layout cycle involving ${[...z].join(", ")}.`);break}for(const N of _)z.delete(N.id)}a.length===w&&s.push({id:JSON.stringify([d.id,y.id]),name:y.name,path:c.path,steps:x})}}return{stories:n,timelines:s,modelIssues:a}}const Fv=["#2563EB","#7C3AED","#0F766E","#B45309","#BE185D","#4338CA","#047857","#9F1239"];function Zh(e){let n=0;for(const s of e)n=Math.imul(n,31)+s.codePointAt(0)>>>0;return Fv[n%Fv.length]}function f3(e){if(e===void 0)return{actors:[]};if(!Array.isArray(e))return{actors:[],actorIssues:["screen.actors must be an array of actor IDs."]};const n=[],s=[];for(const a of e)typeof a!="string"||!a.trim()||a!==a.trim()?s.push("screen.actors IDs must be nonempty strings without surrounding whitespace."):n.includes(a)?s.push(`screen.actors lists "${a}" more than once.`):n.push(a);return{actors:n,...s.length?{actorIssues:s}:{}}}function d3(e,n,s){const a=new Map,o=[],c=(d,h=n)=>o.push({message:d,path:h});if(e!==void 0){let d;try{d=na.parse(e)}catch(h){c(`Invalid actor registry: ${h instanceof Error?h.message:String(h)}`)}if(!d||typeof d!="object"||Array.isArray(d)||!("actors"in d)||!d.actors||typeof d.actors!="object"||Array.isArray(d.actors))c("Actor registry must contain an actors mapping.");else for(const[h,p]of Object.entries(d.actors)){if(!h.trim()||h!==h.trim()){c("Actor IDs must be nonempty strings without surrounding whitespace.");continue}if(!p||typeof p!="object"||Array.isArray(p)){c(`Actor "${h}" must be a mapping with optional name and color.`);continue}const v=p;let g=h,y=Zh(h);v.name!==void 0&&(typeof v.name!="string"||!v.name.trim()?c(`Actor "${h}" name must be a nonempty string.`):g=v.name.trim()),v.color!==void 0&&(typeof v.color!="string"||!/^#[0-9a-f]{6}$/i.test(v.color)?c(`Actor "${h}" color must be a quoted #RRGGBB value.`):y=v.color.toUpperCase()),a.set(h,{id:h,name:g,color:y})}}const u=new Set(a.keys());for(const d of s){for(const h of d.screen.actorIssues??[])c(h,d.path);if(d.screen.type==="user")for(const h of d.screen.actors)e!==void 0&&!u.has(h)&&c(`screen.actors references undefined actor "${h}".`,d.path),a.has(h)||a.set(h,{id:h,name:h,color:Zh(h)})}return{actors:[...a.values()],actorIssues:o}}function Ss(e){return e.normalize("NFKC").replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").toLowerCase()||"unnamed"}function FS(e){return`story_${Ss(e).replaceAll("-","_")}`}function JS(e){return`slc_${Ss(e).replaceAll("-","_")}`}function WS(e){return`scr_${Ss(e).replaceAll("-","_")}`}function PS(e){return`cmd_${Ss(e).replaceAll("-","_")}`}function ew(e){return`qry_${Ss(e).replaceAll("-","_")}`}function eu(e){return`evt_${Ss(e).replaceAll("-","_")}`}function tw(e,n,s){const a=s?Ss(s):`case-${n+1}`;return`gwt_${Ss(e).replaceAll("-","_")}_${a.replaceAll("-","_")}`}function h3(e,n,s){return`${e}:${n}->${s}`}function m3(e){const n=new Map,s=(a,o)=>{const c=n.get(a)??new Set;c.add(JSON.stringify(o)),n.set(a,c)};for(const a of e.stories)s(FS(a.id??a.path),[a.id??a.path]);for(const a of e.events)s(eu(a.name),[a.name]);for(const a of e.slices)s(JS(a.path),[a.path]),s(WS(a.path),[a.path]),a.commands.forEach((o,c)=>{s(PS(o.name),ll(a.path,a.commands,c));for(const u of o.produces)s(eu(u),[u])}),a.queries.forEach((o,c)=>{s(ew(o.name),ll(a.path,a.queries,c));for(const u of o.fromEvents)s(eu(u),[u])}),a.gwt.forEach((o,c)=>{s(tw(a.path,c,o.name),ll(a.path,a.gwt,c))});return(a,o)=>n.get(a).size===1?a:`${a}~${encodeURIComponent(JSON.stringify(o))}`}function ll(e,n,s){const a=n[s].name,o=n.slice(0,s).filter(c=>c.name===a).length;return[e,a??"",String(o)]}function p3(e){const n=[],s=new Map,a=m3(e),o=d=>a(eu(d),[d]),c=new Map,u=(d,h,p,v)=>{const g=h3(d,h,p);s.set(g,{id:g,kind:d,source:h,target:p,...v===void 0?{}:{label:v}})};for(const d of e.stories){const h=a(FS(d.id??d.path),[d.id??d.path]);for(const p of new Set(d.slices))c.set(p,[...c.get(p)??[],h]);n.push({id:h,type:"story",label:d.name,storyId:d.id,sourceName:d.localId,sourcePath:d.path,description:d.description})}for(const d of e.events)n.push({id:o(d.name),type:"event",label:d.name,sourceName:d.name,sourcePath:d.sourcePath,fields:d.fields,description:d.description});for(const d of e.slices){const h=a(JS(d.path),[d.path]),p=a(WS(d.path),[d.path]),v={storyName:d.storyName,storyId:d.storyId,sliceTitle:d.title,sourcePath:d.path,raw:d.raw};n.push({...v,id:h,type:"slice",label:d.title});for(const g of c.get(d.path)??[])u("story-slice",g,h);n.push({...v,id:p,type:d.screen.type==="system"?"processor":"screen",label:d.screen.name??(d.screen.type==="system"?"Processor":"Screen"),actors:d.screen.actors,...d.screen.type==="user"?{actorDefinitions:d.screen.actors.map(g=>e.actors?.find(y=>y.id===g)).filter(g=>!!g)}:{},screenType:d.screen.type}),u("slice-screen",h,p),d.queries.forEach((g,y)=>{const w=a(ew(g.name),ll(d.path,d.queries,y));n.push({...v,id:w,type:"query",label:g.name,sourceName:g.name,fields:g.fields}),d.screen.reads.includes(g.name)&&u("query-screen",w,p);for(const x of g.fromEvents)u("event-query",o(x),w,x)}),d.commands.forEach((g,y)=>{const w=a(PS(g.name),ll(d.path,d.commands,y));n.push({...v,id:w,type:"command",label:g.name,sourceName:g.name,fields:g.fields}),d.screen.executes.includes(g.name)&&u("screen-command",p,w);for(const x of g.produces)u("command-event",w,o(x),x)}),d.gwt.forEach((g,y)=>{n.push({...v,id:a(tw(d.path,y,g.name),ll(d.path,d.gwt,y)),type:"gwt",label:g.name??`Case ${y+1}`,sourceName:g.name,description:g.description,given:g.given,when:g.when,then:g.then})})}return{nodes:n,edges:[...s.values()]}}function tl(e){const n=[];for(const s of e.replaceAll("\\","/").split("/"))!s||s==="."||(s===".."&&n.length>0&&n.at(-1)!==".."?n.pop():n.push(s));return n.join("/")}function nw(e,n=""){const s=tl(e).split("/").at(-1)??e;return n&&s.endsWith(n)?s.slice(0,-n.length):s}function nr(e){return Array.isArray(e)?e.filter(n=>typeof n=="string"):[]}function g3(e,n){const s=na.parse(n),a=s?.events&&typeof s.events=="object"?s.events:s??{};return Object.entries(a).map(([o,c])=>({name:o,fields:typeof c?.fields=="string"?c.fields:void 0,description:typeof c?.description=="string"?c.description:void 0,sourcePath:e}))}function y3(e,n){const s=na.parse(n);return{name:typeof s?.name=="string"?s.name:nw(e,".yaml"),description:typeof s?.description=="string"?s.description:"",path:e,slices:nr(s?.slices).map(tl)}}function v3(e){return Array.isArray(e)?e.filter(n=>!!n&&typeof n=="object").map(n=>({name:typeof n.name=="string"?n.name:"",fields:typeof n.fields=="string"?n.fields:void 0,notes:typeof n.notes=="string"?n.notes:void 0,produces:nr(n.produces)})):[]}function b3(e){return Array.isArray(e)?e.filter(n=>!!n&&typeof n=="object").map(n=>({name:typeof n.name=="string"?n.name:"",fields:typeof n.fields=="string"?n.fields:void 0,notes:typeof n.notes=="string"?n.notes:void 0,fromEvents:nr(n.from_events)})):[]}function S3(e){return Array.isArray(e)?e.filter(n=>!!n&&typeof n=="object").map(n=>({name:typeof n.name=="string"?n.name:void 0,description:typeof n.description=="string"?n.description:void 0,given:Array.isArray(n.given)?n.given:[],when:Array.isArray(n.when)?n.when:[],then:Array.isArray(n.then)?n.then:[]})):[]}function w3(e){return{type:e?.type==="system"?"system":"user",name:typeof e?.name=="string"?e.name:void 0,...f3(e?.actors),reads:nr(e?.reads),executes:nr(e?.executes)}}function x3(e,n,s){const a=na.parse(n);return{title:typeof a?.slice=="string"?a.slice:nw(e),path:e,storyName:s.get(e)?.name,storyId:s.get(e)?.id,screen:w3(a?.screen),commands:v3(a?.commands),queries:b3(a?.queries),gwt:S3(a?.gwt),raw:n}}function E3(e,n={}){const s=new Map(e.map(I=>[tl(I.path),I.content])),a=s.get(".event-modeling/config.yaml"),o=a?na.parse(a):null,c=o?.paths?.event_model_dir??"event-model",u=o?.paths?.features_dir??"event-model/features",d=o?.paths?.slice_extension??".slice.yaml",h=o?.paths?.events_file??`${c}/events.yaml`,p=tl(o?.paths?.actors_file??`${c}/actors.yaml`),v=o?.paths?.stories_dir??`${c}/stories`,g=s.get(h);if(g===void 0)throw new Error(`Missing events file: ${h}`);const y=g3(h,g),w=u3([...s.entries()].filter(([I])=>(u===""||I.startsWith(`${u}/`))&&I.endsWith(".feature.yaml")).sort(([I],[V])=>I<V?-1:I>V?1:0).map(([I,V])=>({path:I,content:V}))),x=[...s.entries()].filter(([I])=>I.split("/").slice(0,-1).join("/")===v&&I.endsWith(".yaml")).sort(([I],[V])=>I.localeCompare(V)).map(([I,V])=>y3(I,V));x.push(...w.stories);const E=new Map;for(const I of x)for(const V of I.slices)E.set(tl(V),I);const A=x.flatMap(I=>I.slices.map(tl)),T=[...s.keys()].filter(I=>(u===""||I.startsWith(`${u}/`))&&I.endsWith(d)),_=[...new Set([...A,...T])].sort().filter(I=>s.has(I)).map(I=>x3(I,s.get(I)??"",E)),N=d3(s.get(p),p,_),j=[{path:h,kind:"events"},...x.filter(I=>!I.id).map(I=>({path:I.path,kind:"story"})),..._.map(I=>({path:I.path,kind:"slice"})),...s.has(p)?[{path:p,kind:"actors"}]:[]],D=[...w.modelIssues,...j.flatMap(I=>c3(s.get(I.path)??"",I.path,I.kind))],$={root:n.root??"browser-import",config:{language:o?.language,paths:{eventModelDir:c,featuresDir:u,sliceExtension:d,eventsFile:h,actorsFile:p,storiesDir:v}},events:y,stories:x,timelines:w.timelines,modelIssues:D,slices:_,...N},L=p3($);return{...$,...L}}function iw(e){if(e.type!=="screen")return[];const n=new Map(e.actorDefinitions?.map(s=>[s.id,s]));return[...new Set(e.actors??[])].map(s=>n.get(s)??{id:s,name:s,color:Zh(s)})}function sw(e,n={}){const s=new Map(e.actors?.map(a=>[a.id,a]));for(const a of[...e.nodes,...Object.values(n)])for(const o of iw(a))s.has(o.id)||s.set(o.id,o);return[...s.values()]}function N3(e,n,s={}){const a=new Set(sw(e,s).map(u=>u.id)),o=n.actorIds.filter(u=>a.has(u)),c=n.includeUnassigned&&[...e.nodes,...Object.values(s)].some(u=>u.type==="screen"&&!u.actors?.length);return o.length===n.actorIds.length&&c===n.includeUnassigned?n:{actorIds:o,includeUnassigned:c}}function _3(e,n,s={}){if(n.actorIds.length===0&&!n.includeUnassigned)return{nodeIds:new Set(e.nodes.map(N=>N.id)),relatedNodeIds:new Set};const a=new Set(n.actorIds),o=new Map(e.nodes.map(N=>[N.id,N])),c=new Map;for(const N of e.nodes)N.type==="story"||N.type==="event"||N.sourcePath&&c.set(N.id,N.sourcePath);const u=e.edges.filter(N=>["slice-screen","query-screen","screen-command"].includes(N.kind)),d=()=>{let N=!0;for(;N;){N=!1;for(const j of u){const D=c.get(j.source),$=c.get(j.target);D&&!$?(c.set(j.target,D),N=!0):$&&!D&&(c.set(j.source,$),N=!0)}}};d();for(const N of e.nodes)N.type==="slice"&&!c.has(N.id)&&c.set(N.id,N.id);d();for(const N of e.nodes)(N.type==="screen"||N.type==="processor")&&!c.has(N.id)&&c.set(N.id,N.id);d();const h=N=>N?.type==="screen"&&((N.actors??[]).some(j=>a.has(j))||n.includeUnassigned&&!N.actors?.length),p=e.nodes.filter(N=>h(N)||h(s[N.id])),v=new Set(p.flatMap(N=>{const j=c.get(N.id);return j?[j]:[]})),g=new Set(p.map(N=>N.id));for(const[N,j]of c)v.has(j)&&g.add(N);const y=e.edges.filter(N=>N.kind==="command-event"||N.kind==="event-query"),w=N=>{const j=new Set;for(const D of y)N.has(D.source)&&o.get(D.target)?.type==="event"&&j.add(D.target),N.has(D.target)&&o.get(D.source)?.type==="event"&&j.add(D.source);return j},x=w(g),E=new Set,A=new Set(e.nodes.filter(N=>N.type==="processor").map(N=>c.get(N.id)));for(const N of y){const j=x.has(N.source)?N.target:x.has(N.target)?N.source:void 0,D=j?c.get(j):void 0;D&&A.has(D)&&!v.has(D)&&E.add(D)}const T=new Set;for(const[N,j]of c)E.has(j)&&T.add(N);for(const N of w(T))x.has(N)||T.add(N);const z=new Set([...g,...x,...T]),_=new Set(e.nodes.filter(N=>z.has(N.id)&&N.type!=="event").map(Wt));for(const N of e.nodes)N.type==="story"&&_.has(N.storyId??N.label)&&z.add(N.id);return{nodeIds:z,relatedNodeIds:T}}const Hn=180,ei=80,Qh=80,ni=430,ol=390,yu=130,Tn=178,Jv=92,Fh=300,Jh=170,Io=18,Wh=48,_h=30,qo=92,aw=38,A3=42,Wv=154,Pv=278,lw=408;function T3(e){return e==="slice-screen"||e==="story-slice"?"#cbd5e1":"#64748b"}function C3(e){if(e==="added")return"#15803d";if(e==="removed")return"#b91c1c";if(e==="changed")return"#b45309"}function M3(e){return e.type==="event"?{sourcePosition:me.Right,targetPosition:me.Left}:{sourcePosition:me.Bottom,targetPosition:me.Top}}function O3(e){return new Map(e.stories.map((n,s)=>[fn(n),s]))}function rl(e,n){return e===0?0:e*n+(e-1)*Io}function tu(e,n,s){const a=e.slices.find(o=>o.path===n);return e.nodes.filter(o=>o.type===s&&(o.sourcePath?o.sourcePath===n:o.sliceTitle===a?.title))}function k3(e,n,s){const a=new Set(tu(e,s,"command").map(c=>c.id));return[...new Set(e.edges.filter(c=>c.kind==="command-event"&&a.has(c.source)&&e.edges.find(u=>u.kind==="command-event"&&u.target===c.target)?.id===c.id).map(c=>c.target))].map(c=>n.get(c)).filter(c=>!!c)}function z3(e,n){return new Map(e.slices.map(s=>{const a=tu(e,s.path,"query"),o=tu(e,s.path,"command"),c=k3(e,n,s.path),u=tu(e,s.path,"gwt"),d=rl(a.length,Tn),h=rl(o.length,Tn),p=d+h+(d>0&&h>0?Wh:0),v=rl(c.length,Tn),g=u.length?Fh:0,y=Math.max(ni,p+_h*2,v+_h*2,g+_h*2),w=u.length>0?lw+Jh+36:ol;return[s.path,{width:y,height:w,queryIds:a.map(x=>x.id),commandIds:o.map(x=>x.id),eventIds:c.map(x=>x.id),gwtIds:u.map(x=>x.id)}]}))}function D3(e,n,s,a,o=new Set){const c=new Map;let u=ei;for(const d of e.stories){const h=e.slices.filter(x=>s.get(x.path)===fn(d)),p=h.reduce((x,E)=>x+(n.get(E.path)?.width??ni),0),v=o.has(fn(d)),g=v?ni:Math.max(p+Math.max(h.length-1,0)*yu,ni),y=Math.max(...h.map(x=>n.get(x.path)?.height??ol),ol),w=v?qo:qo+y+aw;c.set(fn(d),{x:Hn,y:u,width:g,height:w}),u+=w+Qh}if(a){const d=ZM(a);let h=Hn;const p=[...new Set(d.values())].sort((v,g)=>v-g);for(const v of p){let g=ei,y=0;for(const w of e.stories.filter(x=>d.get(ii(x))===v)){const x=c.get(fn(w));x.x=h,x.y=g,g+=x.height+Qh,y=Math.max(y,x.width)}h+=y+yu}}return c}function j3(e,n,s,a,o,c){const u=rl(e.length,c),d=s.x+(a-u)/2;e.forEach((h,p)=>{n.set(h,{x:d+p*(c+Io),y:s.y+o})})}function R3(e){return e==="essential"?new Set(["command-event","event-query"]):e==="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 B3(e,n,s="all"){if(!n||s==="all")return new Set(e.stories.map(ii));if(s==="story")return new Set([n]);const a=new Set([n]),o=new Set(e.nodes.filter(u=>Wt(u)===n).map(u=>u.id)),c=new Set(e.edges.filter(u=>o.has(u.source)||o.has(u.target)).flatMap(u=>[u.source,u.target]).filter(u=>e.nodes.find(d=>d.id===u)?.type==="event"));for(const u of e.edges){if(!c.has(u.source)&&!c.has(u.target))continue;const d=e.nodes.find(p=>p.id===u.source),h=e.nodes.find(p=>p.id===u.target);d&&Wt(d)&&a.add(Wt(d)),h&&Wt(h)&&a.add(Wt(h))}return a}function L3(e){return e==="event-query"?{sourceSide:"top",targetSide:"bottom"}:e==="query-screen"?{sourceSide:"top",targetSide:"bottom"}:e==="screen-command"?{sourceSide:"bottom",targetSide:"top"}:e==="command-event"?{sourceSide:"bottom",targetSide:"top"}:e==="slice-screen"?{sourceSide:"bottom",targetSide:"top"}:{sourceSide:"right",targetSide:"left"}}function $3(e,n,s,a,o,c,u){const d=L3(e),h=c??!!(n?.sliceTitle&&n.sliceTitle===s?.sliceTitle);if(e==="event-query"&&h)return{...d,route:"same-slice-read"};if(!(e==="event-query"&&!h)||!a||!o)return{...d,route:"semantic"};const v=a.x+a.width/2,g=a.y+a.height/2,y=o.x+o.width/2,w=o.y+o.height/2;return{sourceSide:(u??!!(n&&s&&Wt(n)&&Wt(n)===Wt(s)))||w>=g?"bottom":"top",targetSide:y>=v?"left":"right",route:"event-read"}}function eb(e,n,s={}){const a=e.timelines?.find(O=>O.id===s.timelineId);e=KM(e,a);const o=new Map(e.nodes.map(O=>[O.id,O]));e={...e,nodes:e.nodes.map(O=>{if(O.type!=="event")return O;const C=e.edges.find(B=>B.kind==="command-event"&&B.target===O.id);return{...O,storyName:C?o.get(C.source)?.storyName:a?void 0:O.storyName,storyId:C?o.get(C.source)?.storyId:a?void 0:O.storyId}})};const c=O3(e),u=new Map(e.nodes.map(O=>[O.id,O])),d=z3(e,u),h=QM(e,!!a),p=new Set(e.slices.map(O=>O.path)),v=new Map(e.stories.map(O=>[fn(O),new Set(O.slices.filter(C=>p.has(C))).size])),g=s.collapsedStoryIds??new Set,y=new Map;for(const O of e.nodes){const C=h.stableStoryByNode.get(O.id);O.type==="story"&&C&&y.set(C,O.id)}const w=O=>O?.sourcePath??e.slices.find(C=>C.title===(O?.sliceTitle??O?.label))?.path??"",x=D3(e,d,h.stableStoryBySlice,a,g),E=new Map,A=new Map,T=new Map,z=new Set,_=B3(e,s.focusedStory,s.scope??"all"),N=R3(s.edgeDetail??"normal"),j=_3(e,s.actorFilter??{actorIds:[],includeUnassigned:!1},s.previousNodes);if(n){z.add(n);for(const O of e.edges)O.source===n&&z.add(O.target),O.target===n&&z.add(O.source)}const D=new Map;for(const O of e.stories){const C=fn(O);D.set(C,x.get(C)?.x??Hn)}for(const O of e.stories){const C=fn(O);for(const B of new Set(O.slices)){const R=e.slices.find(k=>k.path===B);if(!R||h.stableStoryBySlice.get(R.path)!==C)continue;const K=x.get(C)??{y:ei},ee=D.get(C)??Hn;T.set(R.path,{x:ee,y:K.y+qo}),D.set(C,ee+(d.get(R.path)?.width??ni)+yu)}}for(const O of e.slices){if(T.has(O.path))continue;const C=h.stableStoryBySlice.get(O.path)??"",B=x.get(C)?.y??ei+(c.get(C)??0)*(ol+qo+aw+Qh),R=Hn;T.set(O.path,{x:R,y:B+qo})}for(const O of e.nodes){if(O.type==="story"){const C=x.get(h.stableStoryByNode.get(O.id)??"");E.set(O.id,{x:(C?.x??Hn)-20,y:C?.y??ei})}if(O.type==="slice"){const C=T.get(w(O))??{x:Hn,y:ei};E.set(O.id,C)}if(O.type==="screen"||O.type==="processor"){const C=T.get(w(O))??{x:Hn,y:ei},R=d.get(w(O))?.width??ni;E.set(O.id,{x:C.x+(R-Tn)/2,y:C.y+A3})}}for(const O of e.slices){const C=T.get(O.path)??{x:Hn,y:ei},B=d.get(O.path),R=B?.width??ni;if(!B)continue;const K=rl(B.queryIds.length,Tn),ee=rl(B.commandIds.length,Tn),k=K+ee+(K>0&&ee>0?Wh:0);let U=C.x+(R-k)/2;B.queryIds.forEach((P,se)=>{E.set(P,{x:U+se*(Tn+Io),y:C.y+Wv})}),K>0&&(U+=K+(ee>0?Wh:0)),B.commandIds.forEach((P,se)=>{E.set(P,{x:U+se*(Tn+Io),y:C.y+Wv})}),j3(B.eventIds,E,C,R,Pv,Tn);for(const P of B.gwtIds)E.set(P,{x:C.x+(R-Fh)/2,y:C.y+lw})}let $=0;for(const O of e.nodes.filter(C=>C.type==="event")){const C=e.edges.find(R=>R.kind==="command-event"&&R.target===O.id),B=C?u.get(C.source):void 0;if(!E.has(O.id)){if(a&&!B){E.set(O.id,{x:Hn-Tn-yu,y:ei+$++*(Jv+Io)});continue}const R=T.get(w(B))??{x:Hn,y:ei},K=d.get(w(B));E.set(O.id,{x:R.x+((K?.width??ni)-Tn)/2,y:R.y+Pv})}}const L=new Set,I=e.nodes.map(O=>{const C=E.get(O.id)??{x:0,y:0},B=O.type==="story"||O.type==="slice",R=h.stableStoryByNode.get(O.id),K=O.type==="story"?x.get(R??"")?.width??ni:d.get(w(O))?.width??ni,ee=O.type==="story"?x.get(R??"")?.height??ol:d.get(w(O))?.height??ol,k=B?K:O.type==="gwt"?Fh:Tn,U=B?ee:O.type==="gwt"?Jh:Jv;A.set(O.id,{x:C.x,y:C.y,width:k,height:U});const P=O.type==="gwt"?e.nodes.filter(de=>de.type==="gwt"&&(O.sourcePath?de.sourcePath===O.sourcePath:de.sliceTitle===O.sliceTitle)).filter(de=>j.nodeIds.has(de.id)&&(!Wt(de)||_.has(Wt(de)))).filter(de=>!s.diffFilter||s.diffFilter==="all"||s.diffNodeStatus?.[de.id]===s.diffFilter):void 0,se=!!(R&&g.has(R)),fe=!j.nodeIds.has(O.id)||!!(P&&P[0]?.id!==O.id)||!!(h.storyByNode.get(O.id)&&!_.has(h.storyByNode.get(O.id)))||!!(!P&&s.diffFilter&&s.diffFilter!=="all"&&s.diffNodeStatus?.[O.id]!==s.diffFilter);return fe||L.add(O.id),{id:O.id,type:B?"groupNode":"eventModelNode",position:C,initialWidth:B||O.type==="gwt"?k:void 0,initialHeight:B||O.type==="gwt"?U:void 0,selectable:!0,draggable:!1,data:{projectNode:O,storyId:R,collapsed:O.type==="story"?se:void 0,sliceCount:O.type==="story"?v.get(R??"")??0:void 0,scenarios:P,scenarioStatus:s.diffNodeStatus,selectedScenarioId:n,selected:O.id===n||!!P?.some(de=>de.id===n),connected:z.has(O.id),actorRelated:j.relatedNodeIds.has(O.id),diffStatus:s.diffNodeStatus?.[O.id]},hidden:fe||O.type!=="story"&&se,style:B?{width:K,height:ee,zIndex:O.type==="story"?-20:-10,opacity:j.relatedNodeIds.has(O.id)?.72:1}:{width:k,height:O.type==="gwt"?Jh:void 0,opacity:j.relatedNodeIds.has(O.id)?.72:1},...M3(O)}});for(const O of I)O.data.projectNode.type!=="story"||!O.data.collapsed||e.nodes.some(C=>C.type!=="story"&&L.has(C.id)&&h.stableStoryByNode.get(C.id)===O.data.storyId)&&(O.hidden=!1);const V=new Set(I.filter(O=>!O.hidden).map(O=>O.id)),G=O=>{const C=h.stableStoryByNode.get(O);return C&&g.has(C)?y.get(C)??O:O},Z=n?u.get(n):void 0,H=e.edges.filter(O=>N.has(O.kind)).filter(O=>FM(O,s.edgeVisibility??"auto",Z,h)).filter(O=>L.has(O.source)&&L.has(O.target)).filter(O=>V.has(G(O.source))&&V.has(G(O.target))).filter(O=>G(O.source)!==G(O.target)||G(O.source)===O.source&&G(O.target)===O.target).map(O=>{const C=G(O.source),B=G(O.target),R=C!==O.source||B!==O.target,K=u.get(O.source),ee=u.get(O.target),k=!!s.focusedEdgeIds?.has(O.id),U=s.diffEdgeStatus?.[O.id],P=C3(U),se=h.sliceByNode.get(O.source),fe=h.stableStoryByNode.get(O.source),{sourceSide:de,targetSide:ae,route:ne}=R?{sourceSide:"right",targetSide:"left",route:"event-read"}:$3(O.kind,K,ee,A.get(C),A.get(B),!!(se&&se===h.sliceByNode.get(O.target)),!!(fe&&fe===h.stableStoryByNode.get(O.target)));return{id:O.id,source:C,target:B,type:"eventModelEdge",sourceHandle:`${de}-source`,targetHandle:`${ae}-target`,data:{kind:O.kind,sourceNodeId:O.source,targetNodeId:O.target,proxy:R,route:ne,active:k,diffStatus:U,fieldFlow:s.edgeFieldFlows?.get(O.id),selectedFieldName:s.selectedFieldName,onSelectField:s.onSelectField},markerEnd:{type:Qo.ArrowClosed,color:k?"#111827":P??T3(O.kind)},label:s.edgeDetail==="verbose"?O.label:void 0,className:`edge ${k?"edge-active":""} ${U?`edge-diff-${U}`:""}`,hidden:!!(s.diffFilter&&s.diffFilter!=="all"&&U!==s.diffFilter),animated:k}});return{nodes:I,edges:H}}const H3=.2,U3=1.8,tb=16,I3=.0025;function q3(e,n){const s=e.deltaMode===1?tb:e.deltaMode===2?n.width:1,a=e.deltaMode===1?tb:e.deltaMode===2?n.height:1;return{x:e.deltaX*s,y:e.deltaY*a}}function ow(e,n){return{...e,x:e.x+n.x,y:e.y+n.y}}function rw(e,n,s){if(Number.isNaN(s)||e.zoom<=0)return e;const a=Math.min(U3,Math.max(H3,s)),o=a/e.zoom;return{x:n.x-(n.x-e.x)*o,y:n.y-(n.y-e.y)*o,zoom:a}}function V3(e,n,s,a){const o=q3(n,s);if(!Number.isFinite(o.x)||!Number.isFinite(o.y))return e;if(n.metaKey||n.ctrlKey){const d=Math.max(-1e3,Math.min(1e3,o.y||o.x));return rw(e,a,e.zoom*Math.exp(-d*I3))}const c=n.shiftKey?o.x||o.y:o.x,u=n.shiftKey?0:o.y;return ow(e,{x:-c,y:-u})}function ir(e){return e instanceof Element?e:null}function nu(e){return!!ir(e)?.closest('input, textarea, select, [role="textbox"], [contenteditable]:not([contenteditable="false"])')}function Ah(e){return!!ir(e)?.closest(".react-flow__controls, .react-flow__panel, [data-canvas-navigation-ignore]")}function nb(e){const n=ir(e)?.closest('button, a[href], summary, [role="button"], [role="tab"], [role="checkbox"], [role="switch"]');return nu(e)||!!(n&&!n.classList.contains("react-flow__node"))}function ib(e){return e.code==="Space"||e.key===" "||e.key==="Spacebar"}function Y3({children:e}){const n=Y.useRef(null),[s,a]=Y.useState("idle"),{getViewport:o,setViewport:c}=fr();return Y.useEffect(()=>{const u=n.current;if(!u)return;let d=!1,h=null,p=!1,v=null;const g=()=>{const V=h?.pointerId;h=null,V!==void 0&&u.hasPointerCapture(V)&&u.releasePointerCapture(V),a(d?"ready":"idle")},y=()=>{d=!1,v=null,g()},w=V=>{if(V.key==="Escape"){y();return}if(!ib(V)||V.isComposing||V.altKey||V.ctrlKey||V.metaKey||nb(V.target))return;const G=ir(V.target);G&&G!==document.body&&G!==document.documentElement&&!u.contains(G)||(V.preventDefault(),V.stopPropagation(),d=!0,h||a("ready"))},x=V=>{ib(V)&&(d&&V.preventDefault(),y())},E=V=>{(!u.contains(ir(V.target))||nb(V.target))&&y()},A=()=>{document.hidden&&y()},T=V=>{if(h||(p=!1),!(!d||h||V.button!==0||V.isPrimary===!1||V.pointerType==="touch"||nu(V.target)||Ah(V.target))){V.preventDefault(),V.stopImmediatePropagation(),h={pointerId:V.pointerId,x:V.clientX,y:V.clientY},p=!0,a("dragging");try{u.setPointerCapture(V.pointerId)}catch{}}},z=V=>{if(!h||h.pointerId!==V.pointerId)return;if(V.preventDefault(),V.stopImmediatePropagation(),(V.buttons&1)===0){g();return}const G={x:V.clientX-h.x,y:V.clientY-h.y};h.x=V.clientX,h.y=V.clientY,c(ow(o(),G))},_=V=>{!h||h.pointerId!==V.pointerId||(V.preventDefault(),V.stopImmediatePropagation(),g())},N=V=>{h?.pointerId===V.pointerId&&g()},j=V=>{!p||V.detail===0||(p=!1,V.preventDefault(),V.stopImmediatePropagation())},D=V=>{if(nu(V.target)||Ah(V.target)||(V.preventDefault(),V.stopImmediatePropagation(),v!==null))return;const G=u.getBoundingClientRect(),Z={x:V.clientX-G.left,y:V.clientY-G.top};c(V3(o(),V,G,Z))},$=V=>{nu(V.target)||Ah(V.target)||(V.preventDefault(),V.stopImmediatePropagation(),v=o().zoom)},L=V=>{if(v===null)return;V.preventDefault(),V.stopImmediatePropagation();const G=V;if(!Number.isFinite(G.scale)||!G.scale||G.scale<=0)return;const Z=u.getBoundingClientRect(),le={x:typeof G.clientX=="number"?G.clientX-Z.left:Z.width/2,y:typeof G.clientY=="number"?G.clientY-Z.top:Z.height/2};c(rw(o(),le,v*G.scale))},I=V=>{v!==null&&(V.preventDefault(),V.stopImmediatePropagation(),v=null)};return window.addEventListener("keydown",w,!0),window.addEventListener("keyup",x,!0),window.addEventListener("blur",y),window.addEventListener("focusin",E),document.addEventListener("visibilitychange",A),u.addEventListener("pointerdown",T,!0),window.addEventListener("pointermove",z,{capture:!0,passive:!1}),window.addEventListener("pointerup",_,!0),window.addEventListener("pointercancel",_,!0),u.addEventListener("lostpointercapture",N),u.addEventListener("click",j,!0),u.addEventListener("wheel",D,{capture:!0,passive:!1}),u.addEventListener("gesturestart",$,{capture:!0,passive:!1}),u.addEventListener("gesturechange",L,{capture:!0,passive:!1}),u.addEventListener("gestureend",I,{capture:!0,passive:!1}),()=>{window.removeEventListener("keydown",w,!0),window.removeEventListener("keyup",x,!0),window.removeEventListener("blur",y),window.removeEventListener("focusin",E),document.removeEventListener("visibilitychange",A),u.removeEventListener("pointerdown",T,!0),window.removeEventListener("pointermove",z,!0),window.removeEventListener("pointerup",_,!0),window.removeEventListener("pointercancel",_,!0),u.removeEventListener("lostpointercapture",N),u.removeEventListener("click",j,!0),u.removeEventListener("wheel",D,!0),u.removeEventListener("gesturestart",$,!0),u.removeEventListener("gesturechange",L,!0),u.removeEventListener("gestureend",I,!0);const V=h?.pointerId;h=null,V!==void 0&&u.hasPointerCapture(V)&&u.releasePointerCapture(V)}},[o,c]),S.jsxs("main",{ref:n,className:"canvas",tabIndex:-1,"aria-label":"Event model diagram","aria-description":"Hold Space and drag to pan. Scroll to pan, Shift scroll to pan horizontally, Command on Mac or Control on Windows and Linux with scroll to zoom. Pinch to zoom.","data-navigation-mode":s,children:[e,S.jsx("div",{className:"canvas-navigation-help","aria-hidden":"true",children:"Space + drag to pan · Scroll to pan · Shift to pan sideways · ⌘/Ctrl + scroll to zoom"})]})}function Ws(e,n){return JSON.stringify([e,n.type,n.sourcePath,n.sourceName,n.label,n.sliceTitle])}function G3(e,n,s,a,o){const c=Ws(n,s);if(o!==void 0&&e[c]?.message!==o)return e;if(a)return{...e,[c]:{sessionId:n,identity:bl(s),message:a}};const u={...e};return delete u[c],u}function bl(e){return{type:e.type,sourcePath:e.sourcePath,sourceName:e.sourceName,label:e.label,sliceTitle:e.sliceTitle}}function Ph(e,n){return e.type===n.type&&e.sourcePath===n.sourcePath&&e.sourceName===n.sourceName&&e.label===n.label&&e.sliceTitle===n.sliceTitle}function sb(e,n){const s=e.nodes.find(a=>a.id===n);return s?{identity:bl(s),nodeId:n,snapshotNodes:e.nodes}:void 0}function ms(e,n){if(!e||!n)return;if(e.nodes===n.snapshotNodes)return e.nodes.find(a=>a.id===n.nodeId&&Ph(a,n.identity));const s=e.nodes.filter(a=>Ph(a,n.identity));return s.length===1?s[0]:void 0}function X3(e,n){return e.nodes.filter(s=>Ph(s,bl(n))).length===1}function jm(e,n){if(!(!n||e?.nodeStatus[n.id]!=="changed"))return e.previousNodes?.[n.id]??e.previousGwtNodes?.[n.id]}function K3(e,n){if(!n)return e;const s=e.nodes.filter(c=>n.nodeStatus[c.id]!=="added").map(c=>{const u=jm(n,c);return u?{...u,id:c.id}:c}),a=new Set(s.map(c=>c.id)),o=e.edges.filter(c=>n.edgeStatus[c.id]!=="added").map(c=>n.previousEdges?.[c.id]?{...n.previousEdges[c.id],id:c.id,source:c.source,target:c.target}:c).filter(c=>a.has(c.source)&&a.has(c.target));return{...e,nodes:s,edges:o}}function Z3(e,n){if(!n)return e;const s=e.nodes.filter(c=>n.nodeStatus[c.id]!=="removed"),a=new Set(s.map(c=>c.id)),o=e.edges.filter(c=>n.edgeStatus[c.id]!=="removed"&&a.has(c.source)&&a.has(c.target));return{...e,nodes:s,edges:o}}function Q3(e){if(!e||typeof e!="object")return!1;const n=e;return typeof n.sessionId=="string"&&typeof n.token=="string"&&typeof n.revision=="string"&&Array.isArray(n.project?.nodes)&&Array.isArray(n.project?.edges)&&Array.isArray(n.validation?.findings)&&typeof n.stale=="boolean"&&!!n.baseline&&!!(n.feedback&&["idle","queued","working","completed","stopped"].includes(n.feedback.status)&&Array.isArray(n.feedback.history)&&typeof n.feedback.agent?.connected=="boolean")}function F3(e,n,s,a,o,c=!1){if(!e)return"Feedback is available when a project session is running.";if(!s)return"Reconnect to the project server before adding feedback.";if(e.stale||e.error)return"The model is stale. Fix the model error before adding feedback.";if(n==="turn")return"Switch to Current or Session diff to add feedback about the current model.";if(o?.nodeStatus[a.id]==="removed")return"This node was removed. Select a current node to add feedback.";if(c)return"Switch to New version to add feedback about the current node. Your draft is preserved.";if(!X3(e.project,a))return"This node is ambiguous. Give same-named nodes distinct names before adding feedback.";if(n==="session"&&!e.currentNodeIds)return"Refresh the project server before adding feedback from Session diff.";if(e.currentNodeIds&&!e.currentNodeIds[a.id])return"This node has no unique current target. Select a current node to add feedback."}const Rm=20,cl=4e3,J3=16e3,W3=128*1024;function Bm(){return{version:1,drafts:{},queue:{items:[]}}}function ab(e,n,s,a){const o=e.currentNodeIds?.[n.id]??n.id;return{id:a,sessionId:e.sessionId,projectRoot:e.project.root,nodeId:o,reference:"em://"+(e.project.graphSidecar?.model?.id??"event_model")+"/"+o,revision:e.revision,identity:bl(n),message:s.trim()}}function Cl(e){if(e.length>Rm)return"The Queue can hold up to 20 items. Send or remove an item first.";if(e.some(s=>!s.message.trim()||s.message.length>cl))return"Each queued message must contain 1 to 4000 characters.";if(e.reduce((s,a)=>s+a.message.length,0)>J3)return"The Queue can contain up to 16000 message characters.";if(e.some(s=>!sr(s)))return"A captured target exceeds the server limits. Copy the feedback before removing it.";const n={clientBatchId:"0".repeat(100),items:e.map(({id:s,nodeId:a,reference:o,revision:c,message:u})=>({id:s,nodeId:a,reference:o,revision:c,message:u}))};if(new TextEncoder().encode(JSON.stringify(n)).byteLength>W3)return"This Queue exceeds the 128 KiB request limit. Remove an item before sending."}function Lm(e,n){return!!e.submission?.body.items.some(s=>s.id===n)}function P3(e,n){if(e.items.some(o=>o.id===n.id))return e;const s=[...e.items,n],a=Cl(s);return a?{...e,error:a}:{...e,items:s,error:void 0,notice:void 0}}function ek(e,n,s){if(Lm(e,n))return e;const a=e.items.map(c=>c.id===n?{...c,message:s.trim()}:c),o=Cl(a);return o?{...e,error:o}:{...e,items:a,editing:void 0,error:void 0,notice:void 0}}function tk(e,n){return Lm(e,n)?e:{...e,items:e.items.filter(s=>s.id!==n),editing:e.editing?.id===n?void 0:e.editing,error:void 0,notice:void 0}}function cw(e,n){if(e.sessionId!==n.sessionId)return"This item belongs to a previous session. Copy it, then add feedback for a current node.";if(e.projectRoot!==n.project.root)return"This item belongs to another project. Copy it, then add feedback for the current project.";if(e.revision!==n.revision)return"The model changed after this item was added. Copy it, then review and add it again.";const s=n.project.nodes.filter(o=>Ws(n.sessionId,o)===Ws(e.sessionId,e.identity)&&n.diff?.nodeStatus[o.id]!=="removed");if(s.length!==1||(n.currentNodeIds?.[s[0].id]??s[0].id)!==e.nodeId)return"The original node is missing or ambiguous. Copy the text before removing this item.";const a="em://"+(n.project.graphSidecar?.model?.id??"event_model")+"/"+e.nodeId;if(e.reference!==a)return"The model reference changed. Review and add this feedback again."}function nk(e,n,s,a,o){if(!n||!a)return"Reconnect to the project server before sending the Queue.";if(e.submission?.sessionId!==void 0&&(e.submission.sessionId!==n.sessionId||e.submission.projectRoot!==n.project.root))return"The project changed or the server restarted before this batch could be confirmed.";if(o||e.submission?.phase==="sending")return"Waiting for the server to confirm this batch.";if(!e.submission)return e.editing?"Save or cancel the Queue edit before sending.":e.items.length?n.stale||n.error?"The model is stale. Fix the model error before sending.":s==="turn"?"Switch to Current or Session diff before sending.":n.feedback.status==="stopped"?"Resume the session before sending.":n.feedback.status==="queued"||n.feedback.status==="working"?"Wait for the current request to finish before sending.":e.items.some(c=>cw(c,n))?"Review the flagged Queue items before sending. Their captured targets have not been changed.":Cl(e.items):"Add feedback to the Queue before sending."}function ik(e,n){return e.submission?.phase==="sending"?e:e.submission?{...e,submission:{...e.submission,phase:"sending"},error:void 0}:!e.items.length||e.editing||Cl(e.items)?e:{...e,error:void 0,notice:void 0,submission:{sessionId:e.items[0].sessionId,projectRoot:e.items[0].projectRoot,phase:"sending",body:{clientBatchId:n,items:e.items.map(({id:s,nodeId:a,reference:o,revision:c,message:u})=>({id:s,nodeId:a,reference:o,revision:c,message:u}))}}}}function sk(e,n,s,a){return e.submission?.body.clientBatchId!==n?e:{...e,submission:a?{...e.submission,phase:"uncertain"}:void 0,error:s}}function uw(e,n){if(e.submission?.body.clientBatchId!==n)return e;const s=new Set(e.submission.body.items.map(a=>a.id));return{items:e.items.filter(a=>!s.has(a.id)),editing:e.editing&&!s.has(e.editing.id)?e.editing:void 0,notice:"Feedback sent as one request to your external agent."}}function ak(e,n){return!e.submission||e.submission.sessionId===n.sessionId&&e.submission.projectRoot===n.project.root?e:{...e,submission:void 0,error:"The previous send remains unconfirmed. Its Queue items are preserved for review and cannot be sent to the new session."}}function fw(e,n){if(!In(e)||typeof e.id!="string"||!e.id.trim()||typeof n.clientBatchId!="string"||e.clientBatchId!==n.clientBatchId||!Array.isArray(e.items)||!Array.isArray(n.items)||e.items.length!==n.items.length||!e.items.every(sr)||!n.items.every(sr))return!1;const s=n.items;return e.items.every((a,o)=>{const c=s[o];return a.id===c.id&&a.nodeId===c.nodeId&&a.reference===c.reference&&a.revision===c.revision&&a.message===c.message})}function lk(e,n){const s=e.submission;if(!s)return e;if(s.sessionId!==n.sessionId||s.projectRoot!==n.project.root){const c="The project changed or its server restarted. The previous send could not be confirmed. Release the previous-session batch to review its preserved items.";return e.error===c&&s.phase==="uncertain"?e:{...e,submission:{...s,phase:"uncertain"},error:c}}const o=[...n.feedback.history,...n.feedback.request?[n.feedback.request]:[]].find(c=>c.clientBatchId===s.body.clientBatchId);return o?fw(o,s.body)?uw(e,s.body.clientBatchId):{...e,submission:{...s,phase:"uncertain"},error:"The server returned different items for this batch ID. The original Queue is preserved."}:e}function In(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function dw(e){return In(e)&&typeof e.type=="string"&&["story","slice","screen","processor","command","event","query","gwt"].includes(e.type)&&typeof e.label=="string"&&["sourcePath","sourceName","sliceTitle"].every(n=>e[n]===void 0||typeof e[n]=="string")}function sr(e){return In(e)&&typeof e.id=="string"&&e.id.length>0&&e.id.length<=100&&typeof e.nodeId=="string"&&e.nodeId.length>0&&e.nodeId.length<=500&&typeof e.reference=="string"&&e.reference.length>0&&e.reference.length<=1e3&&typeof e.revision=="string"&&e.revision.length>0&&e.revision.length<=100&&typeof e.message=="string"&&!!e.message.trim()&&e.message.length<=cl}function ok(e){return In(e)&&typeof e.sessionId=="string"&&typeof e.projectRoot=="string"&&dw(e.identity)&&sr(e)}const hw="Some saved feedback could not be recovered. A previous send may already have arrived. The original saved data has been kept. Review the agent history before replacing the damaged saved copy and sending again.";function lb(){return{...Bm(),recoveryWarning:hw}}function rk(e){if(!e)return Bm();try{const n=JSON.parse(e);if(!In(n)||n.version!==1||!In(n.drafts)||!In(n.queue)||!Array.isArray(n.queue.items))return lb();const s={};for(const h of Object.values(n.drafts))!In(h)||typeof h.sessionId!="string"||!dw(h.identity)||typeof h.message!="string"||h.message.length>cl||(s[Ws(h.sessionId,h.identity)]={sessionId:h.sessionId,identity:bl(h.identity),message:h.message});const a=[];for(const h of n.queue.items)ok(h)&&(a.some(p=>p.id===h.id)||a.push({id:h.id,sessionId:h.sessionId,projectRoot:h.projectRoot,nodeId:h.nodeId,reference:h.reference,revision:h.revision,message:h.message,identity:bl(h.identity)}));const o={items:a},c=n.queue.editing;In(c)&&typeof c.id=="string"&&typeof c.message=="string"&&a.some(h=>h.id===c.id)&&(o.editing={id:c.id,message:c.message});const u=n.queue.submission;if(In(u)&&typeof u.sessionId=="string"&&typeof u.projectRoot=="string"&&In(u.body)&&typeof u.body.clientBatchId=="string"&&u.body.clientBatchId.length>0&&u.body.clientBatchId.length<=100&&Array.isArray(u.body.items)&&u.body.items.length>0&&u.body.items.length<=Rm&&u.body.items.every(sr)){const h=u.body.items.map(({id:p,nodeId:v,reference:g,revision:y,message:w})=>({id:p,nodeId:v,reference:g,revision:y,message:w}));new Set(h.map(p=>p.id)).size===h.length&&h.every(p=>a.some(v=>v.id===p.id&&v.sessionId===u.sessionId&&v.projectRoot===u.projectRoot&&v.nodeId===p.nodeId&&v.reference===p.reference&&v.revision===p.revision&&v.message===p.message))&&(o.editing=o.editing&&!h.some(p=>p.id===o.editing?.id)?o.editing:void 0,o.submission={sessionId:u.sessionId,projectRoot:u.projectRoot,phase:"uncertain",body:{clientBatchId:u.body.clientBatchId,items:h}},o.error="A previous send was not confirmed. Refresh to check its status, or retry the same batch.")}const d=Object.keys(s).length!==Object.keys(n.drafts).length||a.length!==n.queue.items.length||!!Cl(a)||u!==void 0&&!o.submission;return{version:1,drafts:s,queue:o,recoveryWarning:d?hw:void 0}}catch{return lb()}}function ck(e){return JSON.stringify({version:1,drafts:e.drafts,queue:{items:e.queue.items,editing:e.queue.editing,submission:e.queue.submission}})}class Bo extends Error{constructor(n,s){super(n),this.uncertain=s,this.name="FeedbackCommandError"}uncertain}function em(e){return e instanceof Error?e.message:String(e)}async function ob(e){const n=await e.json().catch(()=>{});return typeof n?.error=="string"?n.error:"Request failed ("+e.status+")."}function uk(e,n){const[s,a]=Y.useState(),[o,c]=Y.useState(),[u,d]=Y.useState("checking"),[h,p]=Y.useState(),[v,g]=Y.useState(!1),[y,w]=Y.useState(!1),[x,E]=Y.useState(0),A=Y.useRef(void 0),T=Y.useRef(!1),z=Y.useRef(!0),_=Y.useRef(null),N=Y.useCallback(()=>E(D=>D+1),[]);Y.useEffect(()=>(z.current=!0,()=>{z.current=!1,_.current?.abort()}),[]),Y.useEffect(()=>{if(!e)return;let D=!1,$,L;d("checking");const I=async()=>{const V=new AbortController;L=V;const G=setTimeout(()=>V.abort(),5e3);let Z=!1;try{const le=await Ho("/api/session?view="+n,{signal:V.signal,cache:"no-store"});if(le.status===404&&!A.current){Z=!0,D||d("unavailable");return}if(!le.ok)throw new Error(await ob(le));if(!le.headers.get("content-type")?.includes("application/json")&&!A.current){Z=!0,D||d("unavailable");return}const H=await le.json();if(!Q3(H))throw new Error("The project server returned an invalid session snapshot.");if(D)return;A.current&&A.current!==H.sessionId&&(g(!0),_.current?.abort(),T.current=!1),A.current=H.sessionId,a(H),c(n),d("live"),p(void 0),T.current||w(!1)}catch(le){if(D)return;d("offline"),p(V.signal.aborted?"The project server did not respond. Retrying...":em(le)),T.current||w(!1)}finally{clearTimeout(G),!D&&!Z&&($=setTimeout(()=>{I()},1e3))}};return I(),()=>{D=!0,L?.abort(),$&&clearTimeout($)}},[e,n,x]);const j=Y.useCallback(async(D,$)=>{if(!s||!e||u!=="live"||o!==n)throw new Error("Wait for the current session to reconnect.");if(T.current||y)throw new Error("A request is already in progress.");const L=new AbortController;_.current=L;const I=setTimeout(()=>L.abort(),1e4);T.current=!0,w(!0);try{const V=await Ho("/api/feedback/"+D,{method:"POST",headers:{"Content-Type":"application/json","X-Emviz-Token":s.token},body:JSON.stringify($),signal:L.signal});if(!V.ok)throw new Bo(await ob(V),V.status>=500);if(D==="batch"){const G=await V.json().catch(()=>{});if(!fw(G,$))throw new Bo("The server did not return a matching batch confirmation. Refresh to check delivery, or retry the same batch.",!0)}}catch(V){throw z.current&&w(!1),V instanceof Bo?V:new Bo("The server did not confirm the request. Refresh to check its status, or retry the same batch.",!0)}finally{clearTimeout(I),T.current=!1,z.current&&N()}},[u,e,y,N,s,o,n]);return{snapshot:s,snapshotView:o,connection:u,error:h,changedSession:v,pending:y,refresh:N,command:j}}const rb={idle:"Idle",queued:"Queued",working:"Working",completed:"Completed",stopped:"Stopped"};function fk({session:e,view:n,onView:s,node:a,diff:o,showingBefore:c,message:u,onMessageChange:d,onAdded:h,drafts:p,queue:v,onQueueChange:g,storageNeedsReview:y}){const[w,x]=Y.useState(),[E,A]=Y.useState(),T=Y.useRef(!1),z=e.snapshot,_=e.connection==="live"&&e.snapshotView===n,N=a?F3(z,n,_,a,o,c):"Select a current node to write feedback.",j=y?"Review the damaged saved feedback before sending. A previous batch may already have arrived.":nk(v,z,n,_,e.pending),D=z&&a?ab(z,a,u,"preview"):void 0,$=N??(D&&u.trim()?Cl([...v.items,D]):void 0),L=z?.feedback,I=_&&!z?.stale&&!z?.error,V=I&&L?.agent.connected,G=L?.request,Z=L?.history.filter(R=>R.id!==G?.id)??[],le=G?[...Z,G]:Z,H=R=>{x(void 0),e.command(R,{}).catch(K=>x(em(K)))},O=R=>{if(R.preventDefault(),$||!z||!a||!u.trim())return;const K=ab(z,a,u,Bv());g(ee=>P3(ee,K)),h(u)},C=async()=>{if(j||T.current)return;const R=ik(v,v.submission?.body.clientBatchId??Bv()),K=R.submission;if(K){T.current=!0,g(R);try{await e.command("batch",K.body),g(ee=>uw(ee,K.body.clientBatchId))}catch(ee){g(k=>sk(k,K.body.clientBatchId,em(ee),ee instanceof Bo&&ee.uncertain))}finally{T.current=!1}}},B=async R=>{try{await navigator.clipboard.writeText(R),A("Copied queued feedback.")}catch{A("Copy is unavailable. Select the message text and copy it manually.")}};return S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"agent-content",children:[S.jsxs("section",{className:"feedback-session","aria-label":"Feedback session",children:[S.jsxs("div",{className:"feedback-session-heading",children:[S.jsx("h2",{children:"Agent"}),S.jsx("span",{className:"feedback-state feedback-state-"+(L?.status??"idle"),role:"status",children:L?rb[L.status]:"No session"})]}),S.jsxs("p",{className:"agent-presence",children:[S.jsx("span",{"aria-hidden":"true",className:V?"presence-dot connected":"presence-dot"}),I?V?"Agent connected":"Agent disconnected":"Agent status unavailable"]}),S.jsxs("div",{className:"feedback-session-actions",children:[S.jsx("button",{type:"button",onClick:e.refresh,disabled:e.pending,children:"Refresh"}),L?L.status==="stopped"?S.jsx("button",{type:"button",onClick:()=>H("start"),disabled:!_||e.pending,children:"Resume session"}):S.jsx("button",{type:"button",onClick:()=>H("stop"),disabled:!_||e.pending,children:"Stop session"}):null]}),z?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"segmented feedback-views",role:"group","aria-label":"Model view",children:[["current","Current"],["session","Session diff"],["turn","Turn diff"]].map(([R,K])=>S.jsx("button",{type:"button","aria-pressed":n===R,onClick:()=>s(R),children:K},R))}),S.jsxs("p",{className:"feedback-baseline",children:["Baseline ",z.baseline.kind==="startup"?"startup snapshot":"Git"," · ",z.baseline.label]})]}):S.jsx("p",{className:"muted",children:"Feedback is available when a project session is running."}),e.connection==="checking"?S.jsx("p",{role:"status",children:"Refreshing the model..."}):null,e.error||z?.error||L?.error||w?S.jsx("p",{className:"feedback-error",role:"alert",children:w??e.error??z?.error??L?.error}):null,z?.stale||e.connection==="offline"?S.jsx("p",{className:"feedback-warning",children:"Showing the last available model and agent status. Feedback stays local until the project reconnects and loads valid files."}):null,e.changedSession?S.jsx("p",{className:"feedback-warning",children:"The project server restarted. The previous session history is no longer available."}):null,L?.status==="stopped"?S.jsx("p",{className:"feedback-warning",children:"The session is stopped. Stop your external editor before resuming. Stop session cannot stop an external process or undo its file writes."}):L?S.jsx("p",{className:"feedback-note",children:"Stop session cancels feedback. It cannot stop an external agent process or its file writes."}):null]}),a&&z?S.jsxs("form",{className:"feedback-composer","aria-label":"Node feedback",onSubmit:O,children:[S.jsxs("h3",{children:["Feedback for ",a.label]}),S.jsxs("p",{className:"feedback-target",children:[S.jsx("span",{children:a.type}),S.jsx("code",{children:D?.reference})]}),S.jsx("label",{htmlFor:"feedback-message",children:"Feedback message"}),S.jsx("textarea",{id:"feedback-message",value:u,maxLength:cl,rows:4,disabled:!!N,"aria-describedby":"feedback-help",placeholder:"Describe the change you want for this node.",onChange:R=>d(R.target.value)}),S.jsx("p",{className:"muted",id:"feedback-help",children:$??"Add this note to your local Queue. Send to Agent sends the whole Queue as one request."}),S.jsxs("div",{className:"feedback-composer-actions",children:[S.jsxs("small",{children:[u.length,"/",cl]}),S.jsx("button",{type:"submit",disabled:!!$||!u.trim(),children:"Add to Queue"})]})]}):S.jsx("p",{className:"agent-empty",children:"Select a current node to write feedback. Your Queue stays here as you move around the model."}),S.jsxs("section",{className:"feedback-queue","aria-label":"Feedback Queue",children:[S.jsxs("div",{className:"feedback-queue-heading",children:[S.jsx("h3",{children:"Queue"}),S.jsxs("span",{children:[v.items.length,"/",Rm," · Unsent"]})]}),v.items.length?S.jsx("ol",{children:v.items.map(R=>{const K=Lm(v,R.id),ee=z?cw(R,z):void 0,k=v.editing?.id===R.id;return S.jsxs("li",{"data-queue-id":R.id,className:ee?"feedback-queue-item needs-review":"feedback-queue-item",children:[S.jsxs("div",{className:"feedback-queue-item-heading",children:[S.jsx("strong",{children:R.identity.label}),S.jsx("small",{children:K?v.submission?.phase==="sending"?"Sending...":"Awaiting confirmation":"Unsent"})]}),S.jsx("code",{children:R.reference}),S.jsxs("p",{className:"feedback-captured",children:[R.identity.type," · Revision ",R.revision.slice(0,12)]}),ee?S.jsx("p",{className:"feedback-warning",children:ee}):null,k?S.jsxs(S.Fragment,{children:[S.jsxs("label",{className:"sr-only",htmlFor:"queue-edit-"+R.id,children:["Edit queued feedback for ",R.identity.label]}),S.jsx("textarea",{id:"queue-edit-"+R.id,value:v.editing?.message??"",maxLength:cl,rows:4,onChange:U=>g(P=>({...P,editing:{id:R.id,message:U.target.value}}))}),S.jsxs("div",{className:"feedback-queue-actions",children:[S.jsx("button",{type:"button",onClick:()=>g(U=>ek(U,R.id,U.editing?.message??R.message)),disabled:!v.editing?.message.trim(),children:"Save"}),S.jsx("button",{type:"button",onClick:()=>g(U=>({...U,editing:void 0})),children:"Cancel"})]})]}):S.jsxs(S.Fragment,{children:[S.jsx("p",{className:"feedback-message",children:R.message}),S.jsxs("div",{className:"feedback-queue-actions",children:[S.jsx("button",{type:"button","aria-label":"Edit queued feedback for "+R.identity.label,disabled:K||!!v.editing,onClick:()=>g(U=>({...U,editing:{id:R.id,message:R.message}})),children:"Edit"}),S.jsx("button",{type:"button","aria-label":"Remove queued feedback for "+R.identity.label,disabled:K,onClick:()=>g(U=>tk(U,R.id)),children:"Remove"}),S.jsx("button",{type:"button","aria-label":"Copy queued feedback for "+R.identity.label,onClick:()=>{B(R.message)},children:"Copy"})]})]})]},R.id)})}):S.jsx("p",{className:"muted",children:"No queued feedback. Add notes from the nodes you want to change, then send them together."}),E?S.jsx("p",{role:"status",children:E}):null]}),z?S.jsx(dk,{drafts:p,snapshot:z}):null,le.length?S.jsxs("details",{className:"feedback-history",children:[S.jsxs("summary",{children:["Feedback history (",le.length,")"]}),S.jsx("ol",{"aria-label":"Feedback history",children:le.map(R=>S.jsxs("li",{"data-request-id":R.id,children:[R.items?.length?S.jsx("ul",{className:"feedback-request-items",children:R.items.map(K=>S.jsxs("li",{children:[S.jsx("code",{children:K.reference}),S.jsx("p",{children:K.message})]},K.id))}):S.jsxs(S.Fragment,{children:[S.jsx("code",{children:R.reference}),S.jsx("p",{children:R.message})]}),R.reply?S.jsx("p",{className:"feedback-reply",children:R.reply}):S.jsx("p",{className:"muted",children:R.id===G?.id&&L?rb[L.status]:"No reply recorded."})]},R.id))})]}):null]}),S.jsxs("footer",{className:"feedback-send",children:[v.submission?.phase==="uncertain"?S.jsx("p",{className:"feedback-warning",children:"The send is not confirmed. These items are locked so a retry uses the same batch ID and contents. Refresh can confirm delivery without sending again."}):null,v.error?S.jsx("p",{className:"feedback-error",role:"alert",children:v.error}):null,z&&v.submission&&(v.submission.sessionId!==z.sessionId||v.submission.projectRoot!==z.project.root)?S.jsx("button",{type:"button",onClick:()=>g(R=>ak(R,z)),children:"Release previous-session batch"}):null,v.notice?S.jsx("p",{role:"status",children:v.notice}):null,j&&v.items.length>0?S.jsx("p",{className:"muted",id:"feedback-send-help",children:j}):null,S.jsx("button",{type:"button",className:"feedback-send-button",onClick:()=>{C()},disabled:!!j,"aria-describedby":j&&v.items.length?"feedback-send-help":void 0,children:v.submission?.phase==="sending"?"Sending...":v.submission?"Retry same batch":"Send to Agent"}),S.jsxs("small",{children:[v.items.length," queued ",v.items.length===1?"item":"items"," · One agent request"]})]})]})}function dk({drafts:e,snapshot:n}){const[s,a]=Y.useState();if(!e.length)return null;const o=async c=>{try{await navigator.clipboard.writeText(c.message),a("Copied draft for "+c.identity.label+".")}catch{a("Copy is unavailable. Select the draft text below and copy it manually.")}};return S.jsxs("details",{className:"feedback-history",children:[S.jsxs("summary",{children:["Unsent feedback drafts (",e.length,")"]}),S.jsxs("ol",{"aria-label":"Unsent feedback drafts",children:[e.map(c=>{const u=Ws(c.sessionId,c.identity),d=n.project.nodes.filter(p=>Ws(n.sessionId,p)===u&&n.diff?.nodeStatus[p.id]!=="removed"),h=c.sessionId!==n.sessionId?"Saved from a previous session. Copy the text before starting new feedback.":d.length===1?"Saved for the original node. Select that node to continue, or copy the text.":"The original node is no longer available or is ambiguous. Copy this draft to recover it.";return S.jsxs("li",{children:[S.jsx("strong",{children:c.identity.label}),S.jsxs("p",{className:"muted",children:[c.identity.type," · ",c.identity.sourcePath??"No source path"]}),S.jsx("p",{className:"feedback-warning",children:h}),S.jsx("p",{children:c.message}),S.jsx("button",{type:"button",onClick:()=>{o(c)},children:"Copy draft"})]},u)}),s?S.jsx("li",{role:"status",children:s}):null]})]})}function He(e,n,s,a,o){return{id:`${n}:${a??"project"}:${s}`,severity:e,check:n,message:s,path:a,nodeId:o}}function Za(e){const n=new Set,s=new Set;for(const a of e){const o=a.trim().toLowerCase();o&&(n.has(o)&&s.add(a),n.add(o))}return[...s]}const hk=new Set(["sent","built","made","paid","booked","cancelled","canceled","submitted","recorded","created","updated","deleted","placed","notified"]);function mk(e){return e.match(/[A-Z]+(?=[A-Z][a-z]|$)|[A-Z]?[a-z]+|\d+/g)??[e]}function pk(e){const n=e.toLowerCase();return hk.has(n)||/(ed|en|d)$/i.test(e)}function gk(e){return mk(e).some(pk)}function cb(e){return/(Requested|Triggered|Scheduled|Enqueued|Dispatched|Required)$/.test(e)}function yk(e){return["Selected","Shown","Viewed","Clicked","Opened","Closed","Ticked","Incremented","Reached","Displayed","Navigated"].find(n=>e.includes(n))}function vk(e){const n=new Set(e.nodes.map(c=>c.id)),s=new Map;for(const c of n)s.set(c,new Set);for(const c of e.edges)!n.has(c.source)||!n.has(c.target)||(s.get(c.source)?.add(c.target),s.get(c.target)?.add(c.source));let a=0;const o=new Set;for(const c of n){if(o.has(c))continue;a+=1;const u=[c];for(o.add(c);u.length>0;){const d=u.shift();if(d)for(const h of s.get(d)??[])o.has(h)||(o.add(h),u.push(h))}}return a}function bk(e){const n=[...(e.actorIssues??[]).map(h=>He("error","A1",h.message,h.path)),...(e.modelIssues??[]).map(h=>He("error",h.check,h.message,h.path))],s=new Set(e.events.map(h=>h.name)),a=new Set(e.slices.map(h=>h.path)),o=new Map,c=new Map;for(const h of e.stories){h.slices.length>15&&n.push(He("warning","S4",`Story "${h.name}" has ${h.slices.length} slices; consider splitting it.`,h.path));for(const p of h.slices)a.has(p)||n.push(He("error","S2",`Story "${h.name}" lists missing slice "${p}".`,h.path))}for(const h of e.events){h.fields?.trim()||n.push(He("error","C4",`Event "${h.name}" has no fields block.`,h.sourcePath)),!gk(h.name)&&!cb(h.name)&&n.push(He("warning","C3",`Event "${h.name}" does not obviously read as a past-tense domain event.`,h.sourcePath));const p=yk(h.name);p&&n.push(He("warning","D1",`Event "${h.name}" contains red-flag verb "${p}"; confirm this is persisted domain state.`,h.sourcePath))}for(const h of e.slices){const p=h.commands.map(g=>g.name),v=h.queries.map(g=>g.name);for(const g of Za(p))n.push(He("error","L9",`Command "${g}" is duplicated within slice "${h.title}".`,h.path));for(const g of Za(v))n.push(He("error","L9",`Query "${g}" is duplicated within slice "${h.title}".`,h.path));for(const g of Za(h.screen.reads))n.push(He("error","L9",`screen.reads lists "${g}" more than once.`,h.path));for(const g of Za(h.screen.executes))n.push(He("error","L9",`screen.executes lists "${g}" more than once.`,h.path));for(const g of h.screen.reads)v.includes(g)||n.push(He("error","W2",`screen.reads references missing local query "${g}".`,h.path));for(const g of h.screen.executes)p.includes(g)||n.push(He("error","W1",`screen.executes references missing local command "${g}".`,h.path));h.screen.type==="system"&&h.screen.actors.length>0&&n.push(He("error","L5",`System slice "${h.title}" must not declare screen.actors.`,h.path)),h.storyName||n.push(He("warning","M2",`Slice "${h.title}" is not listed by any story.`,h.path)),h.commands.length>0&&h.gwt.length===0&&n.push(He("warning","M1",`Command slice "${h.title}" has no GWT scenarios.`,h.path));for(const g of h.commands){g.fields?.trim()||n.push(He("warning","L6",`Command "${g.name}" has no fields block.`,h.path));for(const y of g.produces)s.has(y)||n.push(He("error","G1",`Command "${g.name}" produces unregistered event "${y}".`,h.path)),o.set(y,[...o.get(y)??[],`${h.title}.${g.name}`])}for(const g of h.queries){g.fields?.trim()||n.push(He("warning","L7",`Query "${g.name}" has no fields block.`,h.path)),g.name.includes("For")||n.push(He("warning","N1",`Query "${g.name}" should use a descriptive <Thing>For<UseCaseOrScreen> name.`,h.path));for(const y of g.fromEvents)s.has(y)||n.push(He("error","G2",`Query "${g.name}" reads unregistered event "${y}".`,h.path)),c.set(y,[...c.get(y)??[],`${h.title}.${g.name}`])}for(const g of h.gwt)for(const y of[...g.given,...g.when,...g.then])(!y.type||!["event","command","query","error"].includes(y.type))&&n.push(He("error","L8",`GWT scenario "${g.name??"Unnamed"}" has invalid item type "${y.type??""}".`,h.path)),y.name||n.push(He("error","L8",`GWT scenario "${g.name??"Unnamed"}" has an item without a name.`,h.path))}for(const h of s){const p=o.get(h)??[],v=c.get(h)??[];p.length===0&&n.push(He("error","G3",`Event "${h}" is registered but no command produces it.`)),p.length>1&&n.push(He("warning","G8",`Event "${h}" has multiple producers: ${p.join(", ")}.`)),p.length>0&&v.length===0&&n.push(He("warning",cb(h)?"G4b":"G4a",`Event "${h}" is produced but no query consumes it.`))}for(const[h,p]of c.entries())(o.get(h)??[]).length===0&&n.push(He("error","G3",`Event "${h}" is read by ${p.join(", ")} but no command produces it.`));for(const h of Za(e.slices.flatMap(p=>p.commands.map(v=>v.name))))n.push(He("warning","M5",`Command name "${h}" is used in multiple slices; command names should be globally unique.`));for(const h of Za(e.slices.flatMap(p=>p.queries.map(v=>v.name))))n.push(He("warning","G7",`Query name "${h}" is used in multiple slices; query names should be globally unique.`));const u=e.slices.filter(h=>h.commands.length>0).length;u>0&&e.events.length/u>2&&n.push(He("warning","M4",`The model has ${(e.events.length/u).toFixed(1)} events per command slice; check for UI/runtime events leaking into the model.`));const d=vk(e);return d>1&&n.push(He("info","I3",`The graph has ${d} disconnected islands.`)),{errors:n.filter(h=>h.severity==="error").length,warnings:n.filter(h=>h.severity==="warning").length,findings:n}}const mw=Sl.createContext(()=>{}),pw=Sl.createContext({open:()=>{},list:()=>{}});function $m(){return S.jsxs(S.Fragment,{children:[S.jsx(Cn,{id:"top-target",type:"target",position:me.Top,style:{left:"46%"}}),S.jsx(Cn,{id:"top-source",type:"source",position:me.Top,style:{left:"54%"}}),S.jsx(Cn,{id:"bottom-target",type:"target",position:me.Bottom,style:{left:"46%"}}),S.jsx(Cn,{id:"bottom-source",type:"source",position:me.Bottom,style:{left:"54%"}}),S.jsx(Cn,{id:"left-target",type:"target",position:me.Left,style:{top:"46%"}}),S.jsx(Cn,{id:"left-source",type:"source",position:me.Left,style:{top:"54%"}}),S.jsx(Cn,{id:"right-target",type:"target",position:me.Right,style:{top:"46%"}}),S.jsx(Cn,{id:"right-source",type:"source",position:me.Right,style:{top:"54%"}})]})}function Th({title:e,items:n}){const s=n&&n.length>0?n:[{type:"empty",name:"empty"}];return S.jsxs("div",{className:"gwt-step",children:[S.jsx("div",{className:"gwt-step-title",children:e}),S.jsx("div",{className:"gwt-step-items",children:s.map((a,o)=>S.jsxs("div",{className:`gwt-step-item gwt-step-item-${a.type??"empty"}`,children:[S.jsx("span",{children:a.type??"empty"}),S.jsxs("div",{className:"gwt-item-content",children:[S.jsx("strong",{children:a.name??"empty"}),a.fields?S.jsx("pre",{children:a.fields}):null]})]},`${o}-${a.type??"empty"}-${a.name??""}`))})]})}function Sk({nodeData:e}){const n=Sl.useContext(pw),s=e.scenarios??[];return S.jsxs("div",{className:`em-node em-node-gwt ${e.selected?"selected":""} ${e.diffStatus?`diff-node-${e.diffStatus}`:""}`,children:[S.jsx($m,{}),S.jsxs("div",{className:"node-type",children:["GWT · ",s.length," cases"]}),e.scenarioStatus?S.jsx("div",{className:"gwt-diff-counts",children:["added","removed","changed"].map(a=>`${a}: ${s.filter(o=>e.scenarioStatus?.[o.id]===a).length}`).join(" · ")}):null,S.jsx("div",{className:"gwt-summary nodrag nopan nowheel",children:s.slice(0,3).map(a=>S.jsxs("button",{type:"button","aria-current":e.selectedScenarioId===a.id?"true":void 0,onClick:o=>{o.stopPropagation(),n.open(a.id)},children:[S.jsx("span",{className:"gwt-scenario-name",children:a.label}),e.scenarioStatus?S.jsx("span",{className:"gwt-scenario-status",children:` · ${e.scenarioStatus[a.id]??"unchanged"}`}):null]},a.id))}),S.jsx("div",{className:"gwt-more nodrag nopan nowheel",children:s.length>3?S.jsxs("button",{type:"button",onClick:a=>{a.stopPropagation(),n.list(e.projectNode.id)},children:["+",s.length-3," more"]}):null})]})}function gw({node:e}){const n=iw(e);return n.length===0?null:S.jsx("div",{className:"chips actor-chips nodrag nopan nowheel","aria-label":"Actors",children:n.map(s=>S.jsxs("span",{className:"actor-chip","data-actor-id":s.id,title:s.name+" ("+s.id+")",style:{borderColor:s.color},children:[S.jsx("i",{className:"actor-swatch","aria-hidden":"true",style:{backgroundColor:s.color}}),S.jsx("span",{className:"actor-name",children:s.name})]},s.id))})}function wk({data:e}){const n=e,s=n.projectNode,a=n.diffStatus&&n.diffStatus!=="unchanged"?S.jsx("div",{className:`diff-badge diff-badge-${n.diffStatus}`,children:n.diffStatus}):null;return s.type==="gwt"?S.jsx(Sk,{nodeData:n}):S.jsxs("div",{className:`em-node em-node-${s.type} ${n.selected?"selected":""} ${n.connected?"connected":""} ${n.diffStatus?`diff-node-${n.diffStatus}`:""}`,children:[S.jsx($m,{}),a,S.jsx("div",{className:"node-type",children:s.type}),S.jsx("div",{className:"node-label",children:s.label}),S.jsx(gw,{node:s})]})}function xk({data:e}){const n=Sl.useContext(mw),s=e,a=s.projectNode;return S.jsxs("div",{className:`group-node group-${a.type} ${s.selected?"selected":""} ${s.diffStatus?`diff-node-${s.diffStatus}`:""}`,children:[s.diffStatus&&s.diffStatus!=="unchanged"?S.jsx("div",{className:`diff-badge diff-badge-${s.diffStatus}`,children:s.diffStatus}):null,a.type==="story"?S.jsx($m,{}):null,S.jsxs("div",{className:"group-title",children:[a.type==="story"&&s.storyId?S.jsxs("button",{type:"button",className:"story-toggle nodrag nopan","aria-label":`${s.collapsed?"Expand":"Collapse"} ${a.label}`,"aria-expanded":!s.collapsed,onClick:o=>{o.stopPropagation(),n(s.storyId)},children:[S.jsx("span",{"aria-hidden":"true",children:s.collapsed?"▸":"▾"})," ",a.label,S.jsxs("span",{className:"story-slice-count",children:[s.sliceCount??0," slices"]})]}):a.label,a.type==="slice"&&s.actorRelated?S.jsx("span",{className:"actor-related-badge",children:"Related"}):null]}),a.description&&!s.collapsed?S.jsx("div",{className:"group-description",children:a.description}):null]})}const Ek={eventModelNode:wk,groupNode:xk};function ub(e){return e===me.Top?{x:0,y:-1}:e===me.Right?{x:1,y:0}:e===me.Bottom?{x:0,y:1}:{x:-1,y:0}}function Nk({sourceX:e,sourceY:n,targetX:s,targetY:a,sourcePosition:o,targetPosition:c,data:u}){const d=u,h=s-e,p=a-n,v=Math.max(56,Math.min(180,Math.abs(p)*.42)),g=Math.max(70,Math.min(180,Math.abs(h)*.38)),y=Math.max(72,Math.min(180,Math.max(Math.abs(h),Math.abs(p))*.38));if(d?.route==="same-slice-read"){const E=o===me.Top?-1:1,A=c===me.Bottom?1:-1,T=Math.max(72,Math.min(150,Math.abs(p)*.65));return`M ${e},${n} C ${e},${n+E*T} ${s},${a+A*T} ${s},${a}`}if(d?.route==="event-read"){const E=ub(o),A=ub(c);return`M ${e},${n} C ${e+E.x*y},${n+E.y*y} ${s+A.x*y},${a+A.y*y} ${s},${a}`}if(o===me.Bottom||o===me.Top){const E=o===me.Top?-1:1,A=c===me.Top?-1:1;return`M ${e},${n} C ${e},${n+E*v} ${s},${a+A*v} ${s},${a}`}const w=o===me.Left?-1:1,x=c===me.Left?-1:1;return`M ${e},${n} C ${e+w*g},${n} ${s+x*g},${a} ${s},${a}`}function _k(e){const n=e.data,s=n?.diffStatus==="added"?"#15803d":n?.diffStatus==="removed"?"#b91c1c":n?.diffStatus==="changed"?"#b45309":void 0,a=n?.active?"#111827":s??"#64748b",o=n?.fieldFlow,c=!!(n?.selectedFieldName&&(o?.sharedFieldNames.includes(n.selectedFieldName)||o?.derivedFieldNames.includes(n.selectedFieldName))),u=(e.sourceX+e.targetX)/2,d=(e.sourceY+e.targetY)/2;return S.jsxs(S.Fragment,{children:[S.jsx(dr,{path:Nk(e),markerEnd:e.markerEnd,style:{...e.style,stroke:a,strokeDasharray:n?.diffStatus==="removed"?"7 5":void 0,strokeWidth:n?.diffStatus&&n.diffStatus!=="unchanged"?2.4:void 0},className:n?.active?"edge-path-active":"edge-path"}),o&&o.visibleFieldNames.length>0&&(n?.active||c)?S.jsx(hM,{children:S.jsxs("div",{className:`edge-field-label nodrag nopan ${n?.active?"active":""} ${c?"field-selected":""}`,style:{transform:`translate(-50%, -50%) translate(${u}px, ${d}px)`},children:[o.visibleFieldNames.map(h=>S.jsx("button",{type:"button",onClick:()=>n?.onSelectField?.(h),children:h},h)),o.remainingCount>0?S.jsxs("span",{children:["+",o.remainingCount]}):null]})}):null]})}const Ak={eventModelEdge:_k};function Yc({label:e,description:n,value:s,copiedKey:a,onCopy:o}){return S.jsx("button",{type:"button",className:"copy-action",onClick:()=>o(a,s),children:S.jsxs("span",{children:[S.jsx("strong",{children:e}),S.jsx("small",{children:n})]})})}function yw(e){return e==="query-screen"||e==="screen-command"||e==="command-event"||e==="event-query"}function Tk(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function Ck(e){return(e.graphSidecar?.model?.name??e.graphSidecar?.model?.id??"event-model").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"event-model"}async function fb(e){const n=await fetch(e);if(!n.ok)throw new Error(`Failed to fetch ${e}: ${n.status}`);return n.text()}async function Mk(e,n,s,a){const o=Array.from(document.querySelectorAll('script[type="module"][src]')).map(v=>new URL(v.src,window.location.href)).filter(v=>!v.pathname.includes("/@vite/")&&!v.pathname.endsWith("/@react-refresh"));if(o.length===0||o.some(v=>v.pathname.includes("/src/")||v.pathname.endsWith(".tsx")))throw new Error("Standalone export requires a built emviz app. Run the packaged CLI or `pnpm --filter @emviz/app build` and open the built app.");const c=Array.from(document.querySelectorAll('link[rel="stylesheet"][href]')).map(v=>new URL(v.href,window.location.href)),u=await Promise.all(c.map(v=>fb(v.href))),d=Array.from(document.querySelectorAll("style")).map(v=>v.textContent??"").filter(Boolean),h=await Promise.all(o.map(v=>fb(v.href))),p={project:e,report:n,diff:s,timelineId:a,exportedAt:new Date().toISOString()};return["<!doctype html>",'<html lang="en">'," <head>",' <meta charset="UTF-8" />',' <meta name="viewport" content="width=device-width, initial-scale=1.0" />',` <title>emviz - ${e.graphSidecar?.model?.name??"export"}</title>`,` <style>${[...u,...d].join(`
154
+
155
+ `)}</style>`," </head>"," <body>",' <div id="root"></div>',` <script>window.__EMVIZ_EXPORT__ = ${Tk(p)};<\/script>`,` <script type="module">${h.join(`
156
+
157
+ `)}<\/script>`," </body>","</html>"].join(`
158
+ `)}function Ok({diff:e,filter:n,onFilter:s,onSelect:a}){const o=Object.entries(e.nodeStatus).filter(([,c])=>c!=="unchanged").slice(0,80);return S.jsxs("aside",{className:"panel diff-panel",children:[S.jsx("h2",{children:"Diff"}),S.jsx("p",{children:"All stories are shown in diff views so removed items remain accessible."}),e.timelinesChanged?S.jsx("p",{role:"status",children:"Timeline layout changed. Ordering does not add event dependencies."}):null,S.jsxs("div",{className:"diff-range",children:[S.jsx("code",{children:e.base.label}),S.jsx("span",{children:"to"}),S.jsx("code",{children:e.target.label})]}),S.jsxs("div",{className:"diff-counts",children:[S.jsxs("button",{type:"button",className:n==="added"?"active added":"added",onClick:()=>s(n==="added"?"all":"added"),children:[S.jsx("strong",{children:e.summary.nodes.added}),S.jsx("span",{children:"Added"})]}),S.jsxs("button",{type:"button",className:n==="removed"?"active removed":"removed",onClick:()=>s(n==="removed"?"all":"removed"),children:[S.jsx("strong",{children:e.summary.nodes.removed}),S.jsx("span",{children:"Removed"})]}),S.jsxs("button",{type:"button",className:n==="changed"?"active changed":"changed",onClick:()=>s(n==="changed"?"all":"changed"),children:[S.jsx("strong",{children:e.summary.nodes.changed}),S.jsx("span",{children:"Changed"})]})]}),n!=="all"?S.jsx("button",{type:"button",className:"clear-diff-filter",onClick:()=>s("all"),children:"Show full graph"}):null,S.jsx("h3",{children:"Changed Nodes"}),S.jsx("div",{className:"diff-list",children:o.length===0?S.jsx("p",{className:"muted",children:"No node changes."}):o.map(([c,u])=>S.jsxs("button",{type:"button",className:`diff-list-item ${u}`,onClick:()=>a(c),children:[S.jsx("span",{children:c}),S.jsx("strong",{children:u})]},c))})]})}function kk(e,n){const s=URL.createObjectURL(new Blob([n],{type:"text/html;charset=utf-8"})),a=document.createElement("a");a.href=s,a.download=e,a.click(),URL.revokeObjectURL(s)}async function zk(e){return await Promise.all(Array.from(e).filter(s=>/\.(ya?ml|json)$/i.test(s.name)).map(async s=>({path:s.webkitRelativePath||s.name,content:await s.text()})))}function Dk(e){const n=e.find(s=>s.path===".event-modeling/graph.json"||s.path.endsWith("/.event-modeling/graph.json"));if(n)try{return JSON.parse(n.content)}catch{return}}function jk(e){return e.type==="story"?{name:e.label}:e.type==="slice"?{slice:e.label}:e.type==="screen"||e.type==="processor"?{slice:e.sliceTitle??e.label}:e.type==="command"||e.type==="query"?{slice:e.sliceTitle??"",name:e.sourceName??e.label}:{name:e.sourceName??e.label}}function Rk(e){const n=e.graphSidecar?.nodes;return n?Object.entries(n).flatMap(([s,a])=>{const o=a,c=e.nodes.filter(u=>{if(o.type==="screen"&&u.type!=="screen"&&u.type!=="processor"||o.type!=="screen"&&o.type!==u.type)return!1;const d=jk(u);return Object.entries(o.selector??{}).every(([h,p])=>d[h]===p)});return c.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}]:c.length>1?[{id:`V2:.event-modeling/graph.json:${s}`,severity:"warning",check:"V2",message:`graph.json node "${s}" selector resolves to ${c.length} nodes.`,path:".event-modeling/graph.json",nodeId:s}]:[]}):[]}function Bk({onImport:e,error:n}){return S.jsx("div",{className:"import-panel",children:S.jsxs("div",{className:"import-card",children:[S.jsx("h1",{children:"emviz"}),S.jsx("p",{children:"Import an Event Modeling project folder or select YAML/JSON files to visualize the model."}),S.jsxs("div",{className:"import-actions",children:[S.jsxs("label",{children:["Import folder",S.jsx("input",{type:"file",multiple:!0,webkitdirectory:"",directory:"",onChange:s=>s.currentTarget.files&&e(s.currentTarget.files)})]}),S.jsxs("label",{children:["Import files",S.jsx("input",{type:"file",multiple:!0,accept:".yaml,.yml,.json",onChange:s=>s.currentTarget.files&&e(s.currentTarget.files)})]})]}),n?S.jsx("p",{className:"import-error",children:n}):null]})})}function Lk({tab:e,onTab:n}){return S.jsx("div",{className:"inspector-tabs",role:"tablist","aria-label":"Inspector",children:["details","agent"].map(s=>S.jsx("button",{type:"button",id:"inspector-tab-"+s,role:"tab","aria-selected":e===s,"aria-controls":"inspector-"+s,tabIndex:e===s?0:-1,onClick:()=>n(s),onKeyDown:a=>{if(!["ArrowLeft","ArrowRight","Home","End"].includes(a.key))return;a.preventDefault();const o=a.key==="Home"?"details":a.key==="End"||s==="details"?"agent":"details";n(o),requestAnimationFrame(()=>document.getElementById("inspector-tab-"+o)?.focus())},children:s==="details"?"Details":"Agent"},s))})}function $k({project:e,selectedNode:n,diff:s,findings:a,selectedFieldName:o,onSelect:c,onSelectField:u,onClearField:d,onPreviewConnection:h,onClearPreview:p,gwtList:v,onGwtList:g,onClose:y,onFocusNode:w,tab:x,onTab:E,agentPanel:A,oldVersionId:T,onVersion:z}){const _=jm(s,n),N=n&&_&&T===n?.id?{..._,id:n.id}:n,[j,D]=Y.useState(),[$,L]=Y.useState(""),I=Y.useRef(null),V=Y.useRef(0),G=!!v;Y.useLayoutEffect(()=>{G&&I.current&&(I.current.scrollTop=V.current)},[G,x]);const Z=ae=>{ae.key!=="Escape"&&ae.stopPropagation()},le=Y.useCallback((ae,ne)=>{navigator.clipboard?.writeText(ne).then(()=>{D(ae),window.setTimeout(()=>D(ce=>ce===ae?void 0:ce),1400)})},[]),H=S.jsx(Lk,{tab:x,onTab:E});if(x==="agent")return S.jsxs("aside",{id:"inspector-agent",className:"panel panel-right agent-panel","aria-label":"Agent",onKeyDown:Z,onKeyUp:Z,children:[H,A]});if(v){const ae=$.trim().toLowerCase(),ne=v.filter(ce=>ce.label.toLowerCase().includes(ae));return S.jsxs("aside",{ref:I,id:"inspector-details",className:"panel panel-right gwt-panel","aria-label":"GWT scenarios",onKeyDown:Z,onKeyUp:Z,onScroll:ce=>{V.current=ce.currentTarget.scrollTop},children:[H,S.jsx("button",{type:"button",onClick:y,children:"Close"}),S.jsxs("h2",{children:[v[0]?.sliceTitle," · All scenarios (",v.length,")"]}),S.jsxs("div",{className:"gwt-filter",children:[S.jsx("label",{htmlFor:"gwt-name-filter",children:"Filter by scenario name"}),S.jsx("input",{id:"gwt-name-filter",type:"search",value:$,onChange:ce=>{L(ce.target.value),V.current=0,I.current&&(I.current.scrollTop=0)}}),S.jsx("button",{type:"button",disabled:!$,onClick:()=>{L(""),V.current=0,I.current&&(I.current.scrollTop=0),I.current?.querySelector("input")?.focus({preventScroll:!0})},children:"Clear filter"})]}),S.jsx("p",{role:"status",children:ne.length?`${ne.length} of ${v.length} scenarios`:"No scenarios match this name."}),S.jsx("div",{className:"gwt-all-list",children:ne.map(ce=>S.jsxs("button",{type:"button","aria-current":N?.id===ce.id?"true":void 0,onClick:()=>{V.current=I.current?.scrollTop??V.current,c(ce.id)},children:[ce.label,s?` · ${s.nodeStatus[ce.id]??"unchanged"}`:""]},ce.id))})]})}if(!N)return S.jsxs("aside",{id:"inspector-details",className:"panel panel-right","aria-label":"Node details",children:[H,S.jsx("h2",{children:"Selection"}),S.jsx("p",{className:"muted",children:"Select a node to inspect source and connections."})]});const O=!!(_&&T===n?.id)||s?.nodeStatus[N.id]==="removed",C=O?K3(e,s):Z3(e,s),B=new Map(C.nodes.map(ae=>[ae.id,ae])),R=C.edges.filter(ae=>{const ne=B.get(ae.source),ce=B.get(ae.target);return yw(ae.kind)&&ne&&ce&&ne.type!=="gwt"&&ce.type!=="gwt"}),K=R.filter(ae=>ae.target===N.id),ee=R.filter(ae=>ae.source===N.id),k=eS(N.fields),P=`em://${e.graphSidecar?.model?.id??"event_model"}/${N.id}`,se=N.raw??N.fields??N.description??N.label,fe=[`Reference: ${P}`,`Node: ${N.label} (${N.type})`,`Source: ${N.sourcePath??"unknown"}`,"","Incoming:",...K.length===0?["- none"]:K.map(ae=>`- ${B.get(ae.source)?.label??ae.source} -> ${N.label}`),"","Outgoing:",...ee.length===0?["- none"]:ee.map(ae=>`- ${N.label} -> ${B.get(ae.target)?.label??ae.target}`),"","Source excerpt:",se].join(`
159
+ `),de=`Please update this event model node.
160
+
161
+ Reference:
162
+ ${P}
163
+
164
+ Source path:
165
+ ${N.sourcePath??"unknown"}
166
+
167
+ Current context:
168
+ ${se}
169
+
170
+ Goal:
171
+ `;return S.jsxs("aside",{id:"inspector-details",className:`panel panel-right ${N.type==="gwt"?"gwt-panel":""}`,"aria-label":"Node details",onKeyDown:Z,onKeyUp:Z,children:[H,N.type==="gwt"?S.jsxs("div",{className:"gwt-panel-actions",children:[S.jsx("button",{type:"button",onClick:()=>g(N.id),children:"All scenarios"}),S.jsx("button",{type:"button",onClick:y,children:"Close"})]}):null,S.jsxs("div",{className:"panel-heading",children:[S.jsx("h2",{children:N.label}),S.jsx("button",{type:"button",className:"icon-button",onClick:()=>w(N.id),"aria-label":"Focus selected node",title:"Focus selected node",children:S.jsx("span",{className:"target-icon","aria-hidden":"true"})})]}),s&&n?S.jsxs("p",{children:[s.nodeStatus[n.id]," · ",O?"Old version":"New version"]}):null,_?S.jsxs("div",{className:"gwt-panel-actions",role:"group","aria-label":"Node version",children:[S.jsx("button",{type:"button","aria-pressed":T!==n?.id,onClick:()=>z(void 0),children:"New version"}),S.jsx("button",{type:"button","aria-pressed":T===n?.id,onClick:()=>z(n?.id),children:"Old version"})]}):null,N.type==="gwt"?S.jsxs("section",{"aria-label":"Scenario details",children:[N.description?S.jsx("p",{children:N.description}):null,S.jsx(Th,{title:"Given",items:N.given}),S.jsx(Th,{title:"When",items:N.when}),S.jsx(Th,{title:"Then",items:N.then}),S.jsx("p",{className:"muted",children:"YAML below is the source slice, not an individual scenario excerpt."})]}):null,S.jsxs("div",{className:"meta-row",children:[S.jsx("span",{children:"Type"}),S.jsx("strong",{children:N.type})]}),S.jsx(gw,{node:N}),S.jsxs("div",{className:"meta-row",children:[S.jsx("span",{children:"Reference"}),S.jsx("code",{children:P})]}),N.sourcePath?S.jsxs("div",{className:"meta-row",children:[S.jsx("span",{children:"Source"}),S.jsx("code",{children:N.sourcePath})]}):null,S.jsxs("details",{className:"copy-section",children:[S.jsxs("summary",{children:[S.jsx("span",{children:"Copy for LLM"}),j?S.jsxs("strong",{className:"copy-feedback","aria-live":"polite",children:["Copied ",j]}):null]}),S.jsxs("div",{className:"copy-actions",children:[S.jsx(Yc,{label:"Reference",description:"Stable em:// node handle",value:P,copiedKey:"reference",onCopy:le}),S.jsx(Yc,{label:"YAML",description:N.type==="gwt"?"Source YAML for the whole slice":"Source excerpt for this node",value:se,copiedKey:"YAML",onCopy:le}),S.jsx(Yc,{label:"Context",description:"Reference plus incoming/outgoing links",value:fe,copiedKey:"context",onCopy:le}),S.jsx(Yc,{label:"Edit prompt",description:"Prompt scaffold for asking an LLM to edit",value:de,copiedKey:"prompt",onCopy:le})]})]}),S.jsx("h3",{children:"Connections"}),S.jsxs("div",{className:"connection-list",children:[S.jsx("strong",{children:"Incoming"}),K.length===0?S.jsx("p",{className:"muted",children:"None"}):K.map(ae=>S.jsx("button",{type:"button",className:"connection-button",onClick:()=>c(ae.source),onMouseEnter:()=>h(ae.id),onMouseLeave:p,onFocus:()=>h(ae.id),onBlur:p,children:S.jsx("span",{children:B.get(ae.source)?.label??ae.source})},ae.id)),S.jsx("strong",{children:"Outgoing"}),ee.length===0?S.jsx("p",{className:"muted",children:"None"}):ee.map(ae=>S.jsx("button",{type:"button",className:"connection-button",onClick:()=>c(ae.target),onMouseEnter:()=>h(ae.id),onMouseLeave:p,onFocus:()=>h(ae.id),onBlur:p,children:S.jsx("span",{children:B.get(ae.target)?.label??ae.target})},ae.id))]}),N.type==="command"||N.type==="event"||N.type==="query"?S.jsxs(S.Fragment,{children:[S.jsx("h3",{children:"Fields"}),S.jsxs("div",{className:"field-panel",children:[k.length===0?S.jsx("p",{className:"field-empty",children:"No fields documented."}):S.jsx("div",{className:"field-list",children:k.map(ae=>S.jsx("button",{type:"button",className:o===ae?"selected":"",onClick:()=>u(ae),children:ae},ae))}),o?S.jsx("button",{type:"button",className:"clear-field",onClick:d,children:"Clear field focus"}):null]})]}):null,S.jsx("h3",{children:"Findings"}),a.length===0?S.jsx("p",{className:"muted",children:"No findings for this node."}):a.map(ae=>S.jsxs("div",{className:`finding finding-${ae.severity}`,children:[S.jsx("strong",{children:ae.check}),S.jsx("span",{children:ae.message})]},ae.id)),S.jsx("h3",{children:N.type==="gwt"?"Source slice YAML":"Source"}),S.jsx("pre",{children:se})]})}function Hk({report:e,onSelect:n,open:s,onOpen:a,onClose:o}){const c=e?.errors??0,u=e?.warnings??0,d=c+u;return S.jsxs(S.Fragment,{children:[S.jsxs("button",{type:"button",className:`validation-fab ${c>0?"has-errors":u>0?"has-warnings":""}`,onClick:a,"aria-expanded":s,"aria-controls":"validation-panel",title:"Open validation",children:[S.jsx("span",{"aria-hidden":"true",children:"!"}),d>0?S.jsx("strong",{"aria-label":`${d} validation findings`,children:d}):null]}),s?S.jsxs("aside",{className:"panel validation-drawer",id:"validation-panel",children:[S.jsxs("div",{className:"panel-heading",children:[S.jsx("h2",{children:"Validation"}),S.jsx("button",{type:"button",className:"panel-close",onClick:o,"aria-label":"Close validation",children:"Close"})]}),e?S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"status-row",children:[S.jsxs("span",{className:"status error",children:[e.errors," errors"]}),S.jsxs("span",{className:"status warning",children:[e.warnings," warnings"]})]}),S.jsx("div",{className:"findings-list",children:e.findings.length===0?S.jsx("p",{className:"muted",children:"No validation findings."}):e.findings.map(h=>S.jsxs("div",{className:`finding finding-${h.severity}`,children:[S.jsxs("div",{className:"finding-header",children:[S.jsx("strong",{children:h.check}),h.nodeId?S.jsx("button",{type:"button",onClick:()=>n(h.nodeId),children:"Focus"}):null]}),S.jsx("span",{children:h.message}),h.path?S.jsx("code",{children:h.path}):null]},h.id))})]}):S.jsx("p",{className:"muted",children:"Loading validation..."})]}):null]})}function Uk(){const[e,n]=Y.useState(),[s,a]=Y.useState(),[o,c]=Y.useState(),[u,d]=Y.useState(()=>window.__EMVIZ_EXPORT__?.timelineId),[h,p]=Y.useState("auto"),[v,g]=Y.useState(()=>new Map),y=e?JM(e,yh(u,!!o)):"",w=Y.useMemo(()=>y?WM(y):new Set,[y]),x=v.get(y)??w,E=Y.useCallback(F=>{y&&(g(he=>new Map(he).set(y,F)),PM(y,F))},[y]),A=Y.useCallback(F=>{const he=new Set(x);he.has(F)?he.delete(F):he.add(F),E(he)},[E,x]),[T,z]=Y.useState("all"),[_,N]=Y.useState({actorIds:[],includeUnassigned:!1}),j=Y.useRef(void 0),[D,$]=Y.useState("loading"),[L,I]=Y.useState("remote"),[V,G]=Y.useState(),[Z,le]=Y.useState(!1),[H,O]=Y.useState("idle"),[C,B]=Y.useState(),[R,K]=Y.useState(()=>{try{return rk(sessionStorage.getItem("emviz:feedback-workspace:v1"))}catch{return Bm()}}),{drafts:ee,queue:k}=R,[U,P]=Y.useState(),[se,fe]=Y.useState("details"),[de,ae]=Y.useState(),ne=Y.useCallback(F=>{K(he=>{const Ne=typeof F=="function"?F(he.queue):F;return Ne===he.queue?he:{...he,queue:Ne}})},[]);Y.useEffect(()=>{if(R.recoveryWarning){P(R.recoveryWarning);return}try{sessionStorage.setItem("emviz:feedback-workspace:v1",ck(R)),P(void 0)}catch{P("Browser storage is unavailable. Your drafts and Queue are kept in this tab, but reloading the page may lose them.")}},[R]);const[ce,Se]=Y.useState(),[we,ge]=Y.useState(),pe=ms(e,ce)?.id,Ee=ms(e,we)?.id,Ce=Y.useRef(null),[Ue,Pe]=Y.useState([]),[zt,ot]=Y.useState([]),[wt,Dt]=Y.useState(""),[kn,_t]=Y.useState(),[Ke,ut]=Y.useState(),[Ut,Lt]=Y.useState(!1),{setCenter:jt,fitView:hn}=fr(),[mn,Ml]=Y.useState("current"),Fe=uk(!window.__EMVIZ_EXPORT__&&L==="remote"&&D!=="import",mn);Y.useEffect(()=>{Fe.snapshot&&ne(F=>lk(F,Fe.snapshot))},[Fe.snapshot,ne]);const It=Y.useRef(void 0),ht=Fe.snapshot?JSON.stringify([Fe.snapshot.sessionId,Fe.snapshot.revision,mn,Fe.snapshot.feedback.request?.id,Fe.snapshot.feedback.status]):void 0,pn={...Fe,connection:L!=="remote"||window.__EMVIZ_EXPORT__?"unavailable":Fe.connection==="live"&&ht&&It.current?.key!==ht?"checking":Fe.connection};Y.useEffect(()=>{if(window.__EMVIZ_EXPORT__?.project){n(window.__EMVIZ_EXPORT__.project),a(window.__EMVIZ_EXPORT__.report),c(window.__EMVIZ_EXPORT__.diff),$("ready"),window.setTimeout(()=>{hn({padding:.18,duration:300})},50);return}if(L==="local"||Fe.connection!=="unavailable")return;let F=!1;return Promise.all([Ho("/api/model").then(he=>he.json()),Ho("/api/validation").then(he=>he.ok?he.json():void 0).catch(()=>{}),Ho("/api/diff").then(he=>he.ok?he.json():void 0).catch(()=>{})]).then(([he,Ne,Ie])=>{if(!F){if(!he||!Array.isArray(he.nodes)||!Array.isArray(he.edges))throw new Error("No project server is available.");n(he),a(Ne),c(Ie),$("ready"),window.setTimeout(()=>{hn({padding:.18,duration:300})},50)}}).catch(()=>{F||$("import")}),()=>{F=!0}},[hn,Fe.connection,L]),Y.useEffect(()=>{const F=Fe.snapshot;if(!F||Fe.snapshotView!==mn)return;const he=ht;if(It.current?.key===he)return;const Ne=!It.current;It.current&&It.current.sessionId!==F.sessionId&&(Se(void 0),ge(void 0),N({actorIds:[],includeUnassigned:!1}),Pe([]),ot([]),ut(void 0)),It.current={key:he,sessionId:F.sessionId},n(F.project),a(F.validation),c(F.diff),$("ready"),_t(void 0),Ne&&window.setTimeout(()=>{hn({padding:.18,duration:300})},50)},[hn,Fe.snapshot,Fe.snapshotView,ht,mn]);const At=Y.useMemo(()=>e?sw(e,o?.previousNodes):[],[e,o?.previousNodes]),Ol=!!(e?.nodes.some(F=>F.type==="screen"&&!F.actors?.length)||Object.values(o?.previousNodes??{}).some(F=>F.type==="screen"&&!F.actors?.length));Y.useEffect(()=>{if(!e)return;const F=j.current!==e.root;j.current=e.root,N(he=>F?{actorIds:[],includeUnassigned:!1}:N3(e,he,o?.previousNodes))},[e,o?.previousNodes]),Y.useEffect(()=>{e&&(ce&&!ms(e,ce)&&Se(void 0),we&&!ms(e,we)&&ge(void 0),Pe(F=>F.filter(he=>ms(e,he))),ot(F=>F.filter(he=>ms(e,he))))},[e,ce,we]);const mt=Y.useMemo(()=>e?.nodes.find(F=>F.id===pe),[e,pe]),Ri=Fe.snapshot?.sessionId,Zn=Ri&&mt?Ws(Ri,mt):void 0;Y.useEffect(()=>ae(void 0),[Zn]);const ri=(F,he)=>{!Ri||!mt||K(Ne=>({...Ne,drafts:G3(Ne.drafts,Ri,mt,F,he)}))},Bi=Y.useMemo(()=>s?.findings.filter(F=>F.nodeId===pe)??[],[s,pe]),qt=Y.useMemo(()=>e?YM(e):new Map,[e]),ci=Y.useMemo(()=>{if(kn)return new Set([kn]);const F=GM(qt,Ke);if(F)return F;if(!e||!pe)return;const he=new Set;for(const Ne of e.edges)yw(Ne.kind)&&(Ne.source===pe||Ne.target===pe)&&he.add(Ne.id);return he},[qt,kn,e,Ke,pe]),Et=Y.useMemo(()=>e?eb(e,pe,{timelineId:yh(u,!!o),edgeVisibility:h,collapsedStoryIds:x,focusedEdgeIds:ci,edgeFieldFlows:qt,selectedFieldName:Ke,onSelectField:ut,diffNodeStatus:o?.nodeStatus,diffEdgeStatus:o?.edgeStatus,diffFilter:T,actorFilter:_,previousNodes:o?.previousNodes}):{nodes:[],edges:[]},[u,h,x,_,o?.previousNodes,o?.edgeStatus,o?.nodeStatus,T,qt,ci,e,Ke,pe]);Y.useEffect(()=>{u&&e&&!e.timelines?.some(F=>F.id===u)&&d(void 0)},[e,u]),Y.useEffect(()=>{if(!u||o)return;const F=new Set(Et.nodes.map(he=>he.id));pe&&!F.has(pe)&&Se(void 0),Ee&&!F.has(Ee)&&ge(void 0)},[Et.nodes,u,pe,Ee,o]);const ia=Y.useMemo(()=>{if(!e||wt.trim().length<2)return[];const F=wt.trim().toLowerCase(),he=new Set(Et.nodes.map(Ne=>Ne.id));return e.nodes.filter(Ne=>he.has(Ne.id)&&`${Ne.label} ${Ne.type} ${Ne.sourcePath??""}`.toLowerCase().includes(F)).slice(0,8)},[e,wt,Et.nodes]),Tt=Y.useCallback((F,he=!0,Ne=!1)=>{let Ie=Et.nodes.find(et=>et.id===F);const en=!!(!Ie&&u&&e?.nodes.some(et=>et.id===F));en&&e&&(d(void 0),Ie=eb(e).nodes.find(et=>et.id===F)),_t(void 0),he&&pe&&pe!==F&&(ce&&Pe(et=>[...et,ce]),ot([]));const Qn=Ie?.data.projectNode.type==="gwt";if(Qn&&!Ce.current){const et=document.activeElement;Ce.current=et?.closest(".search-results")?document.querySelector(".search-box input"):et instanceof HTMLElement?et:null}if(Qn||(Ce.current=null),ge(void 0),e&&Se(sb(e,F)),Ie&&Ne){Ie.hidden&&Ie.data.storyId&&(Ie=Et.nodes.find(vn=>vn.data.collapsed&&vn.data.storyId===Ie.data.storyId)??Ie);const et={x:Ie.position.x+(Ie.initialWidth??178)/2,y:Ie.position.y+(Ie.initialHeight??92)/2};en?window.setTimeout(()=>{jt(et.x,et.y,{zoom:1.2,duration:350})},50):jt(et.x,et.y,{zoom:1.2,duration:350})}},[Et.nodes,e,ce,pe,jt,u]),ui=Y.useCallback(()=>{Se(void 0),_t(void 0),ut(void 0),ge(void 0);const F=Ce.current;Ce.current=null,F&&requestAnimationFrame(()=>{F?.isConnected?F.focus({preventScroll:!0}):document.querySelector(".canvas")?.focus({preventScroll:!0})})},[]),zn=Y.useCallback(F=>{Ce.current||(Ce.current=document.activeElement instanceof HTMLElement?document.activeElement:null),e&&ge(sb(e,F))},[e]),kl=Y.useMemo(()=>({open:Tt,list:zn}),[Tt,zn]),gn=e?.nodes.find(F=>F.id===Ee),sa=gn?e?.nodes.filter(F=>F.type==="gwt"&&(gn.sourcePath?F.sourcePath===gn.sourcePath:F.sliceTitle===gn.sliceTitle)).filter(F=>!o||T==="all"||o.nodeStatus[F.id]===T):void 0;Y.useEffect(()=>{(Ee||mt?.type==="gwt")&&((Ee?document.querySelector(".gwt-all-list button[aria-current]"):null)??document.querySelector('.gwt-panel button:not([role="tab"])'))?.focus({preventScroll:!0})},[Ee,mt?.id,mt?.type]);const aa=Y.useCallback(F=>{e?.edges.find(Ne=>Ne.id===F)&&_t(F)},[e?.edges]),ws=Y.useCallback(()=>{_t(void 0)},[]),xs=Y.useCallback(()=>{e&&(O("exporting"),B(void 0),le(!1),Mk(e,s,o,u).then(F=>{kk(`${Ck(e)}.emviz.html`,F)}).catch(F=>{B(F instanceof Error?F.message:String(F))}).finally(()=>O("idle")))},[o,e,s,u]);Y.useEffect(()=>{const F=he=>{he.key==="Escape"&&(le(!1),ui())};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[ui]);const la=Y.useCallback(()=>{const F=Ue.at(-1);if(!F)return;Pe(Ne=>Ne.slice(0,-1)),ce&&ot(Ne=>[...Ne,ce]);const he=ms(e,F);he&&Tt(he.id,!1)},[Ue,Tt,e,ce]),oa=Y.useCallback(()=>{const F=zt.at(-1);if(!F)return;ot(Ne=>Ne.slice(0,-1)),ce&&Pe(Ne=>[...Ne,ce]);const he=ms(e,F);he&&Tt(he.id,!1)},[Tt,zt,e,ce]),yn=Y.useCallback(F=>{zk(F).then(he=>{const Ne=Dk(he),Ie=E3(he,{root:eO(Ne?.model?.id,crypto.getRandomValues(new Uint32Array(4)).join("-"))}),en=Ie;en.graphSidecar=Ne??{model:{id:"browser_import",name:"Browser Import"}},d(void 0),I("local"),n(en);const Qn=bk(Ie),et=Rk(en);a({errors:Qn.errors,warnings:Qn.warnings+et.filter(vn=>vn.severity==="warning").length,findings:[...Qn.findings,...et]}),c(void 0),ge(void 0),z("all"),N({actorIds:[],includeUnassigned:!1}),Se(void 0),_t(void 0),ut(void 0),Pe([]),ot([]),$("ready"),G(void 0),window.setTimeout(()=>{hn({padding:.18,duration:300})},50)}).catch(he=>{G(he instanceof Error?he.message:String(he)),$("import")})},[hn]);return D==="import"?S.jsx(Bk,{onImport:yn,error:V}):e?S.jsxs("div",{className:`app-shell ${o?"diff-mode":""}`,children:[S.jsxs("header",{className:"toolbar",children:[S.jsxs("div",{className:"model-summary",children:[S.jsx("strong",{children:"emviz"}),S.jsxs("span",{children:[e.stories.length," stories"]}),S.jsxs("span",{children:[e.slices.length," slices"]}),S.jsxs("span",{children:[e.nodes.filter(F=>F.type==="event").length," events"]})]}),e.timelines?.length?S.jsxs("label",{className:"timeline-picker",children:[S.jsx("span",{children:"Timeline"}),S.jsxs("select",{"aria-label":"Timeline",disabled:!!o,title:o?"Diff shows all stories, including removed items.":void 0,value:yh(u,!!o)??"",onChange:F=>{d(F.target.value||void 0),Se(void 0),ge(void 0),Pe([]),ot([]),_t(void 0),ut(void 0),window.setTimeout(()=>{hn({padding:.18,duration:300})},50)},children:[S.jsx("option",{value:"",children:"All stories"}),e.timelines?.map(F=>S.jsxs("option",{value:F.id,children:[F.name," · ",F.path]},F.id))]})]}):null,S.jsxs("label",{className:"edge-visibility-picker",children:[S.jsx("span",{children:"Edges"}),S.jsxs("select",{"aria-label":"Edge visibility",value:h,onChange:F=>p(F.target.value),children:[S.jsx("option",{value:"auto",children:"Auto"}),S.jsx("option",{value:"intra-slice",children:"Intra-slice only"}),S.jsx("option",{value:"all",children:"All"})]})]}),S.jsxs("div",{className:"segmented story-controls","aria-label":"Story visibility",children:[S.jsx("button",{type:"button",onClick:()=>E(new Set),children:"Expand all stories"}),S.jsx("button",{type:"button",onClick:()=>E(new Set(e.stories.map(fn))),children:"Collapse all stories"})]}),S.jsxs("div",{className:"segmented toolbar-history","aria-label":"Selection history",children:[S.jsx("button",{type:"button",disabled:Ue.length===0,onClick:la,"aria-label":"Back",title:"Back",children:"←"}),S.jsx("button",{type:"button",disabled:zt.length===0,onClick:oa,"aria-label":"Forward",title:"Forward",children:"→"})]}),S.jsxs("div",{className:"search-box",children:[S.jsx("input",{"aria-label":"Search event model",value:wt,onChange:F=>Dt(F.target.value),placeholder:"Search nodes by name or type..."}),ia.length>0?S.jsx("div",{className:"search-results",children:ia.map(F=>S.jsxs("button",{type:"button",onClick:()=>{Tt(F.id),Dt("")},children:[S.jsx("span",{children:F.label}),S.jsx("small",{children:F.type})]},F.id))}):null]}),S.jsxs("details",{className:"actor-filter",onKeyDown:F=>{F.key==="Escape"&&(F.preventDefault(),F.stopPropagation(),F.currentTarget.open=!1,F.currentTarget.querySelector("summary")?.focus())},children:[S.jsxs("summary",{children:["Actors · ",_.actorIds.length+Number(_.includeUnassigned)||"All"]}),S.jsxs("div",{className:"actor-filter-popover",children:[S.jsx("p",{children:"Match any selected actor. Related system steps stay visible."}),S.jsxs("div",{className:"actor-filter-options",role:"group","aria-label":"Filter by actor",children:[At.map(F=>S.jsxs("label",{children:[S.jsx("input",{type:"checkbox","aria-label":F.name===F.id?F.name:F.name+" ("+F.id+")",checked:_.actorIds.includes(F.id),onChange:he=>{const Ne=he.target.checked;N(Ie=>({...Ie,actorIds:Ne?[...Ie.actorIds,F.id]:Ie.actorIds.filter(en=>en!==F.id)}))}}),S.jsx("i",{className:"actor-swatch","aria-hidden":"true",style:{backgroundColor:F.color}}),S.jsxs("span",{children:[F.name,F.name!==F.id?S.jsx("small",{children:F.id}):null]})]},F.id)),Ol?S.jsxs("label",{children:[S.jsx("input",{type:"checkbox","aria-label":"Unassigned screens",checked:_.includeUnassigned,onChange:F=>{const he=F.target.checked;N(Ne=>({...Ne,includeUnassigned:he}))}}),S.jsx("span",{children:"Unassigned screens"})]}):null]}),S.jsx("button",{type:"button",disabled:_.actorIds.length===0&&!_.includeUnassigned,onClick:()=>N({actorIds:[],includeUnassigned:!1}),children:"Clear actors"})]})]}),S.jsxs("div",{className:"toolbar-menu",children:[S.jsx("button",{type:"button",className:"menu-trigger",onClick:()=>le(F=>!F),"aria-haspopup":"menu","aria-expanded":Z,"aria-label":"Open menu",title:"Open menu",children:"..."}),Z?S.jsx("div",{className:"menu-popover",role:"menu",children:S.jsx("button",{type:"button",role:"menuitem",onClick:xs,disabled:H==="exporting",children:H==="exporting"?"Exporting...":"Export"})}):null]}),C?S.jsx("div",{className:"toolbar-error",role:"alert",children:C}):null]}),S.jsxs("div",{className:"workspace",children:[S.jsx(Hk,{report:s,onSelect:Tt,open:Ut,onOpen:()=>Lt(!0),onClose:()=>Lt(!1)}),o?S.jsx(Ok,{diff:o,filter:T,onFilter:z,onSelect:Tt}):null,S.jsx($k,{diff:o,tab:se,onTab:fe,oldVersionId:de,onVersion:ae,agentPanel:S.jsxs(S.Fragment,{children:[U?S.jsxs("div",{className:"feedback-storage-warning",children:[S.jsx("p",{className:"feedback-warning",role:"alert",children:U}),R.recoveryWarning?S.jsx("button",{type:"button",onClick:()=>K(F=>({...F,recoveryWarning:void 0})),children:"Replace damaged saved feedback"}):null]}):null,S.jsx(fk,{session:pn,drafts:Object.values(ee),view:mn,onView:F=>{Ml(F),z("all")},node:mt,diff:o,showingBefore:!!(jm(o,mt)&&de===mt?.id)||!!(mt&&o?.nodeStatus[mt.id]==="removed"),message:Zn?ee[Zn]?.message??"":"",onMessageChange:ri,onAdded:F=>ri("",F),queue:k,onQueueChange:ne,storageNeedsReview:!!R.recoveryWarning})]}),gwtList:sa,onGwtList:zn,onClose:ui,onFocusNode:F=>Tt(F,!0,!0),project:e,selectedNode:mt,findings:Bi,selectedFieldName:Ke,onSelect:Tt,onSelectField:ut,onClearField:()=>ut(void 0),onPreviewConnection:aa,onClearPreview:ws},(gn??mt)?.type==="gwt"?`gwt:${(gn??mt)?.sourcePath??(gn??mt)?.sliceTitle}`:"selection"),S.jsxs(Y3,{children:[(_.actorIds.length>0||_.includeUnassigned)&&!Et.nodes.some(F=>!F.hidden&&(F.data.projectNode.type!=="story"&&F.data.projectNode.type!=="slice"||F.data.collapsed&&(F.data.sliceCount??0)>0))?S.jsx("div",{className:"actor-empty",role:"status",children:"No screens match the selected actors and current filters."}):null,S.jsx(mw.Provider,{value:A,children:S.jsx(pw.Provider,{value:kl,children:S.jsxs(fM,{nodes:Et.nodes,edges:Et.edges,nodeTypes:Ek,edgeTypes:Ak,onNodeClick:(F,he)=>Tt(he.id),fitView:!0,minZoom:.2,maxZoom:1.8,nodesDraggable:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomActivationKeyCode:null,panActivationKeyCode:null,zoomOnDoubleClick:!1,autoPanOnNodeFocus:!1,colorMode:"light",children:[S.jsx(vM,{gap:18,size:1}),S.jsx(_M,{})]})})})]})]})]}):S.jsx("div",{className:"loading",children:S.jsx("div",{children:Fe.error?S.jsxs(S.Fragment,{children:[S.jsx("p",{role:"alert",children:Fe.error}),S.jsx("button",{type:"button",onClick:Fe.refresh,children:"Retry connection"})]}):"Loading event model..."})})}function Ik(){return S.jsx(Q1,{children:S.jsx(Uk,{})})}kE.createRoot(document.getElementById("root")).render(S.jsx(Sl.StrictMode,{children:S.jsx(Ik,{})}));