ima2-gen 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +211 -40
- package/assets/screenshot.png +0 -0
- package/bin/commands/edit.js +70 -0
- package/bin/commands/gen.js +136 -0
- package/bin/commands/ls.js +49 -0
- package/bin/commands/ping.js +28 -0
- package/bin/commands/ps.js +46 -0
- package/bin/commands/show.js +57 -0
- package/bin/ima2.js +206 -12
- package/bin/lib/args.js +73 -0
- package/bin/lib/client.js +97 -0
- package/bin/lib/files.js +39 -0
- package/bin/lib/output.js +48 -0
- package/package.json +11 -4
- package/server.js +639 -83
- package/ui/dist/assets/index-CGvmo0q2.js +16 -0
- package/ui/dist/assets/index-CGvmo0q2.js.map +1 -0
- package/ui/dist/assets/index-Dr1O_KZg.css +1 -0
- package/ui/dist/index.html +24 -0
- package/public/index.html +0 -1008
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))u(r);new MutationObserver(r=>{for(const f of r)if(f.type==="childList")for(const d of f.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&u(d)}).observe(document,{childList:!0,subtree:!0});function o(r){const f={};return r.integrity&&(f.integrity=r.integrity),r.referrerPolicy&&(f.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?f.credentials="include":r.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function u(r){if(r.ep)return;r.ep=!0;const f=o(r);fetch(r.href,f)}})();function op(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Jc={exports:{}},Ji={};var Hm;function nx(){if(Hm)return Ji;Hm=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function o(u,r,f){var d=null;if(f!==void 0&&(d=""+f),r.key!==void 0&&(d=""+r.key),"key"in r){f={};for(var g in r)g!=="key"&&(f[g]=r[g])}else f=r;return r=f.ref,{$$typeof:n,type:u,key:d,ref:r!==void 0?r:null,props:f}}return Ji.Fragment=l,Ji.jsx=o,Ji.jsxs=o,Ji}var jm;function ax(){return jm||(jm=1,Jc.exports=nx()),Jc.exports}var w=ax(),Fc={exports:{}},St={};var Um;function lx(){if(Um)return St;Um=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),d=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),x=Symbol.iterator;function S(M){return M===null||typeof M!="object"?null:(M=x&&M[x]||M["@@iterator"],typeof M=="function"?M:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,T={};function z(M,H,W){this.props=M,this.context=H,this.refs=T,this.updater=W||_}z.prototype.isReactComponent={},z.prototype.setState=function(M,H){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,H,"setState")},z.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function L(){}L.prototype=z.prototype;function E(M,H,W){this.props=M,this.context=H,this.refs=T,this.updater=W||_}var C=E.prototype=new L;C.constructor=E,A(C,z.prototype),C.isPureReactComponent=!0;var V=Array.isArray;function B(){}var q={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function I(M,H,W){var et=W.ref;return{$$typeof:n,type:M,key:H,ref:et!==void 0?et:null,props:W}}function ot(M,H){return I(M.type,H,M.props)}function $(M){return typeof M=="object"&&M!==null&&M.$$typeof===n}function P(M){var H={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(W){return H[W]})}var it=/\/+/g;function D(M,H){return typeof M=="object"&&M!==null&&M.key!=null?P(""+M.key):H.toString(36)}function G(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(B,B):(M.status="pending",M.then(function(H){M.status==="pending"&&(M.status="fulfilled",M.value=H)},function(H){M.status==="pending"&&(M.status="rejected",M.reason=H)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function N(M,H,W,et,st){var ct=typeof M;(ct==="undefined"||ct==="boolean")&&(M=null);var rt=!1;if(M===null)rt=!0;else switch(ct){case"bigint":case"string":case"number":rt=!0;break;case"object":switch(M.$$typeof){case n:case l:rt=!0;break;case v:return rt=M._init,N(rt(M._payload),H,W,et,st)}}if(rt)return st=st(M),rt=et===""?"."+D(M,0):et,V(st)?(W="",rt!=null&&(W=rt.replace(it,"$&/")+"/"),N(st,H,W,"",function(Et){return Et})):st!=null&&($(st)&&(st=ot(st,W+(st.key==null||M&&M.key===st.key?"":(""+st.key).replace(it,"$&/")+"/")+rt)),H.push(st)),1;rt=0;var ut=et===""?".":et+":";if(V(M))for(var ft=0;ft<M.length;ft++)et=M[ft],ct=ut+D(et,ft),rt+=N(et,H,W,ct,st);else if(ft=S(M),typeof ft=="function")for(M=ft.call(M),ft=0;!(et=M.next()).done;)et=et.value,ct=ut+D(et,ft++),rt+=N(et,H,W,ct,st);else if(ct==="object"){if(typeof M.then=="function")return N(G(M),H,W,et,st);throw H=String(M),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return rt}function R(M,H,W){if(M==null)return M;var et=[],st=0;return N(M,et,"","",function(ct){return H.call(W,ct,st++)}),et}function U(M){if(M._status===-1){var H=M._result;H=H(),H.then(function(W){(M._status===0||M._status===-1)&&(M._status=1,M._result=W)},function(W){(M._status===0||M._status===-1)&&(M._status=2,M._result=W)}),M._status===-1&&(M._status=0,M._result=H)}if(M._status===1)return M._result.default;throw M._result}var X=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},tt={map:R,forEach:function(M,H,W){R(M,function(){H.apply(this,arguments)},W)},count:function(M){var H=0;return R(M,function(){H++}),H},toArray:function(M){return R(M,function(H){return H})||[]},only:function(M){if(!$(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return St.Activity=y,St.Children=tt,St.Component=z,St.Fragment=o,St.Profiler=r,St.PureComponent=E,St.StrictMode=u,St.Suspense=m,St.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=q,St.__COMPILER_RUNTIME={__proto__:null,c:function(M){return q.H.useMemoCache(M)}},St.cache=function(M){return function(){return M.apply(null,arguments)}},St.cacheSignal=function(){return null},St.cloneElement=function(M,H,W){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var et=A({},M.props),st=M.key;if(H!=null)for(ct in H.key!==void 0&&(st=""+H.key),H)!k.call(H,ct)||ct==="key"||ct==="__self"||ct==="__source"||ct==="ref"&&H.ref===void 0||(et[ct]=H[ct]);var ct=arguments.length-2;if(ct===1)et.children=W;else if(1<ct){for(var rt=Array(ct),ut=0;ut<ct;ut++)rt[ut]=arguments[ut+2];et.children=rt}return I(M.type,st,et)},St.createContext=function(M){return M={$$typeof:d,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:f,_context:M},M},St.createElement=function(M,H,W){var et,st={},ct=null;if(H!=null)for(et in H.key!==void 0&&(ct=""+H.key),H)k.call(H,et)&&et!=="key"&&et!=="__self"&&et!=="__source"&&(st[et]=H[et]);var rt=arguments.length-2;if(rt===1)st.children=W;else if(1<rt){for(var ut=Array(rt),ft=0;ft<rt;ft++)ut[ft]=arguments[ft+2];st.children=ut}if(M&&M.defaultProps)for(et in rt=M.defaultProps,rt)st[et]===void 0&&(st[et]=rt[et]);return I(M,ct,st)},St.createRef=function(){return{current:null}},St.forwardRef=function(M){return{$$typeof:g,render:M}},St.isValidElement=$,St.lazy=function(M){return{$$typeof:v,_payload:{_status:-1,_result:M},_init:U}},St.memo=function(M,H){return{$$typeof:h,type:M,compare:H===void 0?null:H}},St.startTransition=function(M){var H=q.T,W={};q.T=W;try{var et=M(),st=q.S;st!==null&&st(W,et),typeof et=="object"&&et!==null&&typeof et.then=="function"&&et.then(B,X)}catch(ct){X(ct)}finally{H!==null&&W.types!==null&&(H.types=W.types),q.T=H}},St.unstable_useCacheRefresh=function(){return q.H.useCacheRefresh()},St.use=function(M){return q.H.use(M)},St.useActionState=function(M,H,W){return q.H.useActionState(M,H,W)},St.useCallback=function(M,H){return q.H.useCallback(M,H)},St.useContext=function(M){return q.H.useContext(M)},St.useDebugValue=function(){},St.useDeferredValue=function(M,H){return q.H.useDeferredValue(M,H)},St.useEffect=function(M,H){return q.H.useEffect(M,H)},St.useEffectEvent=function(M){return q.H.useEffectEvent(M)},St.useId=function(){return q.H.useId()},St.useImperativeHandle=function(M,H,W){return q.H.useImperativeHandle(M,H,W)},St.useInsertionEffect=function(M,H){return q.H.useInsertionEffect(M,H)},St.useLayoutEffect=function(M,H){return q.H.useLayoutEffect(M,H)},St.useMemo=function(M,H){return q.H.useMemo(M,H)},St.useOptimistic=function(M,H){return q.H.useOptimistic(M,H)},St.useReducer=function(M,H,W){return q.H.useReducer(M,H,W)},St.useRef=function(M){return q.H.useRef(M)},St.useState=function(M){return q.H.useState(M)},St.useSyncExternalStore=function(M,H,W){return q.H.useSyncExternalStore(M,H,W)},St.useTransition=function(){return q.H.useTransition()},St.version="19.2.5",St}var Bm;function yo(){return Bm||(Bm=1,Fc.exports=lx()),Fc.exports}var J=yo();const no=op(J);var Wc={exports:{}},Fi={},Pc={exports:{}},tf={};var qm;function ix(){return qm||(qm=1,(function(n){function l(N,R){var U=N.length;N.push(R);t:for(;0<U;){var X=U-1>>>1,tt=N[X];if(0<r(tt,R))N[X]=R,N[U]=tt,U=X;else break t}}function o(N){return N.length===0?null:N[0]}function u(N){if(N.length===0)return null;var R=N[0],U=N.pop();if(U!==R){N[0]=U;t:for(var X=0,tt=N.length,M=tt>>>1;X<M;){var H=2*(X+1)-1,W=N[H],et=H+1,st=N[et];if(0>r(W,U))et<tt&&0>r(st,W)?(N[X]=st,N[et]=U,X=et):(N[X]=W,N[H]=U,X=H);else if(et<tt&&0>r(st,U))N[X]=st,N[et]=U,X=et;else break t}}return R}function r(N,R){var U=N.sortIndex-R.sortIndex;return U!==0?U:N.id-R.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var d=Date,g=d.now();n.unstable_now=function(){return d.now()-g}}var m=[],h=[],v=1,y=null,x=3,S=!1,_=!1,A=!1,T=!1,z=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function C(N){for(var R=o(h);R!==null;){if(R.callback===null)u(h);else if(R.startTime<=N)u(h),R.sortIndex=R.expirationTime,l(m,R);else break;R=o(h)}}function V(N){if(A=!1,C(N),!_)if(o(m)!==null)_=!0,B||(B=!0,P());else{var R=o(h);R!==null&&G(V,R.startTime-N)}}var B=!1,q=-1,k=5,I=-1;function ot(){return T?!0:!(n.unstable_now()-I<k)}function $(){if(T=!1,B){var N=n.unstable_now();I=N;var R=!0;try{t:{_=!1,A&&(A=!1,L(q),q=-1),S=!0;var U=x;try{e:{for(C(N),y=o(m);y!==null&&!(y.expirationTime>N&&ot());){var X=y.callback;if(typeof X=="function"){y.callback=null,x=y.priorityLevel;var tt=X(y.expirationTime<=N);if(N=n.unstable_now(),typeof tt=="function"){y.callback=tt,C(N),R=!0;break e}y===o(m)&&u(m),C(N)}else u(m);y=o(m)}if(y!==null)R=!0;else{var M=o(h);M!==null&&G(V,M.startTime-N),R=!1}}break t}finally{y=null,x=U,S=!1}R=void 0}}finally{R?P():B=!1}}}var P;if(typeof E=="function")P=function(){E($)};else if(typeof MessageChannel<"u"){var it=new MessageChannel,D=it.port2;it.port1.onmessage=$,P=function(){D.postMessage(null)}}else P=function(){z($,0)};function G(N,R){q=z(function(){N(n.unstable_now())},R)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(N){N.callback=null},n.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<N?Math.floor(1e3/N):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_next=function(N){switch(x){case 1:case 2:case 3:var R=3;break;default:R=x}var U=x;x=R;try{return N()}finally{x=U}},n.unstable_requestPaint=function(){T=!0},n.unstable_runWithPriority=function(N,R){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var U=x;x=N;try{return R()}finally{x=U}},n.unstable_scheduleCallback=function(N,R,U){var X=n.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?X+U:X):U=X,N){case 1:var tt=-1;break;case 2:tt=250;break;case 5:tt=1073741823;break;case 4:tt=1e4;break;default:tt=5e3}return tt=U+tt,N={id:v++,callback:R,priorityLevel:N,startTime:U,expirationTime:tt,sortIndex:-1},U>X?(N.sortIndex=U,l(h,N),o(m)===null&&N===o(h)&&(A?(L(q),q=-1):A=!0,G(V,U-X))):(N.sortIndex=tt,l(m,N),_||S||(_=!0,B||(B=!0,P()))),N},n.unstable_shouldYield=ot,n.unstable_wrapCallback=function(N){var R=x;return function(){var U=x;x=R;try{return N.apply(this,arguments)}finally{x=U}}}})(tf)),tf}var Lm;function ox(){return Lm||(Lm=1,Pc.exports=ix()),Pc.exports}var ef={exports:{}},ge={};var Ym;function ux(){if(Ym)return ge;Ym=1;var n=yo();function l(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)h+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var u={d:{f:o,r:function(){throw Error(l(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},r=Symbol.for("react.portal");function f(m,h,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:y==null?null:""+y,children:m,containerInfo:h,implementation:v}}var d=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return ge.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,ge.createPortal=function(m,h){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(l(299));return f(m,h,null,v)},ge.flushSync=function(m){var h=d.T,v=u.p;try{if(d.T=null,u.p=2,m)return m()}finally{d.T=h,u.p=v,u.d.f()}},ge.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,u.d.C(m,h))},ge.prefetchDNS=function(m){typeof m=="string"&&u.d.D(m)},ge.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var v=h.as,y=g(v,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,S=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;v==="style"?u.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:x,fetchPriority:S}):v==="script"&&u.d.X(m,{crossOrigin:y,integrity:x,fetchPriority:S,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},ge.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var v=g(h.as,h.crossOrigin);u.d.M(m,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&u.d.M(m)},ge.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var v=h.as,y=g(v,h.crossOrigin);u.d.L(m,v,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},ge.preloadModule=function(m,h){if(typeof m=="string")if(h){var v=g(h.as,h.crossOrigin);u.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else u.d.m(m)},ge.requestFormReset=function(m){u.d.r(m)},ge.unstable_batchedUpdates=function(m,h){return m(h)},ge.useFormState=function(m,h,v){return d.H.useFormState(m,h,v)},ge.useFormStatus=function(){return d.H.useHostTransitionStatus()},ge.version="19.2.5",ge}var Vm;function up(){if(Vm)return ef.exports;Vm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),ef.exports=ux(),ef.exports}var Gm;function sx(){if(Gm)return Fi;Gm=1;var n=ox(),l=yo(),o=up();function u(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)e+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function f(t){var e=t,a=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(a=e.return),t=e.return;while(t)}return e.tag===3?a:null}function d(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function g(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function m(t){if(f(t)!==t)throw Error(u(188))}function h(t){var e=t.alternate;if(!e){if(e=f(t),e===null)throw Error(u(188));return e!==t?null:t}for(var a=t,i=e;;){var s=a.return;if(s===null)break;var c=s.alternate;if(c===null){if(i=s.return,i!==null){a=i;continue}break}if(s.child===c.child){for(c=s.child;c;){if(c===a)return m(s),t;if(c===i)return m(s),e;c=c.sibling}throw Error(u(188))}if(a.return!==i.return)a=s,i=c;else{for(var p=!1,b=s.child;b;){if(b===a){p=!0,a=s,i=c;break}if(b===i){p=!0,i=s,a=c;break}b=b.sibling}if(!p){for(b=c.child;b;){if(b===a){p=!0,a=c,i=s;break}if(b===i){p=!0,i=c,a=s;break}b=b.sibling}if(!p)throw Error(u(189))}}if(a.alternate!==i)throw Error(u(190))}if(a.tag!==3)throw Error(u(188));return a.stateNode.current===a?t:e}function v(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=v(t),e!==null)return e;t=t.sibling}return null}var y=Object.assign,x=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),E=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),ot=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function P(t){return t===null||typeof t!="object"?null:(t=$&&t[$]||t["@@iterator"],typeof t=="function"?t:null)}var it=Symbol.for("react.client.reference");function D(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===it?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case A:return"Fragment";case z:return"Profiler";case T:return"StrictMode";case V:return"Suspense";case B:return"SuspenseList";case I:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case _:return"Portal";case E:return t.displayName||"Context";case L:return(t._context.displayName||"Context")+".Consumer";case C:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case q:return e=t.displayName||null,e!==null?e:D(t.type)||"Memo";case k:e=t._payload,t=t._init;try{return D(t(e))}catch{}}return null}var G=Array.isArray,N=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},X=[],tt=-1;function M(t){return{current:t}}function H(t){0>tt||(t.current=X[tt],X[tt]=null,tt--)}function W(t,e){tt++,X[tt]=t.current,t.current=e}var et=M(null),st=M(null),ct=M(null),rt=M(null);function ut(t,e){switch(W(ct,e),W(st,t),W(et,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?am(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=am(e),t=lm(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}H(et),W(et,t)}function ft(){H(et),H(st),H(ct)}function Et(t){t.memoizedState!==null&&W(rt,t);var e=et.current,a=lm(e,t.type);e!==a&&(W(st,t),W(et,a))}function bt(t){st.current===t&&(H(et),H(st)),rt.current===t&&(H(rt),$i._currentValue=U)}var yt,xt;function At(t){if(yt===void 0)try{throw Error()}catch(a){var e=a.stack.trim().match(/\n( *(at )?)/);yt=e&&e[1]||"",xt=-1<a.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+yt+t+xt}var qt=!1;function jt(t,e){if(!t||qt)return"";qt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var lt=function(){throw Error()};if(Object.defineProperty(lt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(lt,[])}catch(F){var K=F}Reflect.construct(t,[],lt)}else{try{lt.call()}catch(F){K=F}t.call(lt.prototype)}}else{try{throw Error()}catch(F){K=F}(lt=t())&&typeof lt.catch=="function"&<.catch(function(){})}}catch(F){if(F&&K&&typeof F.stack=="string")return[F.stack,K.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=i.DetermineComponentFrameRoot(),p=c[0],b=c[1];if(p&&b){var O=p.split(`
|
|
4
|
+
`),Q=b.split(`
|
|
5
|
+
`);for(s=i=0;i<O.length&&!O[i].includes("DetermineComponentFrameRoot");)i++;for(;s<Q.length&&!Q[s].includes("DetermineComponentFrameRoot");)s++;if(i===O.length||s===Q.length)for(i=O.length-1,s=Q.length-1;1<=i&&0<=s&&O[i]!==Q[s];)s--;for(;1<=i&&0<=s;i--,s--)if(O[i]!==Q[s]){if(i!==1||s!==1)do if(i--,s--,0>s||O[i]!==Q[s]){var nt=`
|
|
6
|
+
`+O[i].replace(" at new "," at ");return t.displayName&&nt.includes("<anonymous>")&&(nt=nt.replace("<anonymous>",t.displayName)),nt}while(1<=i&&0<=s);break}}}finally{qt=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?At(a):""}function oe(t,e){switch(t.tag){case 26:case 27:case 5:return At(t.type);case 16:return At("Lazy");case 13:return t.child!==e&&e!==null?At("Suspense Fallback"):At("Suspense");case 19:return At("SuspenseList");case 0:case 15:return jt(t.type,!1);case 11:return jt(t.type.render,!1);case 1:return jt(t.type,!0);case 31:return At("Activity");default:return""}}function Qe(t){try{var e="",a=null;do e+=oe(t,a),a=t,t=t.return;while(t);return e}catch(i){return`
|
|
7
|
+
Error generating stack: `+i.message+`
|
|
8
|
+
`+i.stack}}var Ae=Object.prototype.hasOwnProperty,$e=n.unstable_scheduleCallback,mn=n.unstable_cancelCallback,_a=n.unstable_shouldYield,Ea=n.unstable_requestPaint,se=n.unstable_now,nl=n.unstable_getCurrentPriorityLevel,pn=n.unstable_ImmediatePriority,Xn=n.unstable_UserBlockingPriority,wa=n.unstable_NormalPriority,Rs=n.unstable_LowPriority,al=n.unstable_IdlePriority,Hs=n.log,js=n.unstable_setDisableYieldValue,Na=null,me=null;function an(t){if(typeof Hs=="function"&&js(t),me&&typeof me.setStrictMode=="function")try{me.setStrictMode(Na,t)}catch{}}var pe=Math.clz32?Math.clz32:qs,Us=Math.log,Bs=Math.LN2;function qs(t){return t>>>=0,t===0?32:31-(Us(t)/Bs|0)|0}var ll=256,il=262144,ol=4194304;function yn(t){var e=t&42;if(e!==0)return e;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 ul(t,e,a){var i=t.pendingLanes;if(i===0)return 0;var s=0,c=t.suspendedLanes,p=t.pingedLanes;t=t.warmLanes;var b=i&134217727;return b!==0?(i=b&~c,i!==0?s=yn(i):(p&=b,p!==0?s=yn(p):a||(a=b&~t,a!==0&&(s=yn(a))))):(b=i&~c,b!==0?s=yn(b):p!==0?s=yn(p):a||(a=i&~t,a!==0&&(s=yn(a)))),s===0?0:e!==0&&e!==s&&(e&c)===0&&(c=s&-s,a=e&-e,c>=a||c===32&&(a&4194048)!==0)?e:s}function Ma(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function Ls(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+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 e+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 wo(){var t=ol;return ol<<=1,(ol&62914560)===0&&(ol=4194304),t}function ai(t){for(var e=[],a=0;31>a;a++)e.push(t);return e}function Aa(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ys(t,e,a,i,s,c){var p=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var b=t.entanglements,O=t.expirationTimes,Q=t.hiddenUpdates;for(a=p&~a;0<a;){var nt=31-pe(a),lt=1<<nt;b[nt]=0,O[nt]=-1;var K=Q[nt];if(K!==null)for(Q[nt]=null,nt=0;nt<K.length;nt++){var F=K[nt];F!==null&&(F.lane&=-536870913)}a&=~lt}i!==0&&No(t,i,0),c!==0&&s===0&&t.tag!==0&&(t.suspendedLanes|=c&~(p&~e))}function No(t,e,a){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-pe(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|a&261930}function Mo(t,e){var a=t.entangledLanes|=e;for(t=t.entanglements;a;){var i=31-pe(a),s=1<<i;s&e|t[i]&e&&(t[i]|=e),a&=~s}}function Ao(t,e){var a=e&-e;return a=(a&42)!==0?1:li(a),(a&(t.suspendedLanes|e))!==0?0:a}function li(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 ii(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function zo(){var t=R.p;return t!==0?t:(t=window.event,t===void 0?32:Am(t.type))}function To(t,e){var a=R.p;try{return R.p=t,e()}finally{R.p=a}}var ln=Math.random().toString(36).slice(2),le="__reactFiber$"+ln,he="__reactProps$"+ln,vn="__reactContainer$"+ln,sl="__reactEvents$"+ln,Co="__reactListeners$"+ln,Vs="__reactHandles$"+ln,Do="__reactResources$"+ln,za="__reactMarker$"+ln;function oi(t){delete t[le],delete t[he],delete t[sl],delete t[Co],delete t[Vs]}function Zn(t){var e=t[le];if(e)return e;for(var a=t.parentNode;a;){if(e=a[vn]||a[le]){if(a=e.alternate,e.child!==null||a!==null&&a.child!==null)for(t=fm(t);t!==null;){if(a=t[le])return a;t=fm(t)}return e}t=a,a=t.parentNode}return null}function Qn(t){if(t=t[le]||t[vn]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function $n(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(u(33))}function kn(t){var e=t[Do];return e||(e=t[Do]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function Wt(t){t[za]=!0}var Oo=new Set,Ro={};function xn(t,e){Kn(t,e),Kn(t+"Capture",e)}function Kn(t,e){for(Ro[t]=e,t=0;t<e.length;t++)Oo.add(e[t])}var Gs=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]*$"),ui={},Ho={};function Xs(t){return Ae.call(Ho,t)?!0:Ae.call(ui,t)?!1:Gs.test(t)?Ho[t]=!0:(ui[t]=!0,!1)}function rl(t,e,a){if(Xs(e))if(a===null)t.removeAttribute(e);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+a)}}function cl(t,e,a){if(a===null)t.removeAttribute(e);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+a)}}function ke(t,e,a,i){if(i===null)t.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(e,a,""+i)}}function ve(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function jo(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Zs(t,e,a){var i=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var s=i.get,c=i.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(p){a=""+p,c.call(this,p)}}),Object.defineProperty(t,e,{enumerable:i.enumerable}),{getValue:function(){return a},setValue:function(p){a=""+p},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function fl(t){if(!t._valueTracker){var e=jo(t)?"checked":"value";t._valueTracker=Zs(t,e,""+t[e])}}function Uo(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var a=e.getValue(),i="";return t&&(i=jo(t)?t.checked?"true":"false":t.value),t=i,t!==a?(e.setValue(t),!0):!1}function Ta(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 Qs=/[\n"\\]/g;function xe(t){return t.replace(Qs,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Ca(t,e,a,i,s,c,p,b){t.name="",p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?t.type=p:t.removeAttribute("type"),e!=null?p==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+ve(e)):t.value!==""+ve(e)&&(t.value=""+ve(e)):p!=="submit"&&p!=="reset"||t.removeAttribute("value"),e!=null?si(t,p,ve(e)):a!=null?si(t,p,ve(a)):i!=null&&t.removeAttribute("value"),s==null&&c!=null&&(t.defaultChecked=!!c),s!=null&&(t.checked=s&&typeof s!="function"&&typeof s!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?t.name=""+ve(b):t.removeAttribute("name")}function Bo(t,e,a,i,s,c,p,b){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(t.type=c),e!=null||a!=null){if(!(c!=="submit"&&c!=="reset"||e!=null)){fl(t);return}a=a!=null?""+ve(a):"",e=e!=null?""+ve(e):a,b||e===t.value||(t.value=e),t.defaultValue=e}i=i??s,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=b?t.checked:!!i,t.defaultChecked=!!i,p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(t.name=p),fl(t)}function si(t,e,a){e==="number"&&Ta(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Sn(t,e,a,i){if(t=t.options,e){e={};for(var s=0;s<a.length;s++)e["$"+a[s]]=!0;for(a=0;a<t.length;a++)s=e.hasOwnProperty("$"+t[a].value),t[a].selected!==s&&(t[a].selected=s),s&&i&&(t[a].defaultSelected=!0)}else{for(a=""+ve(a),e=null,s=0;s<t.length;s++){if(t[s].value===a){t[s].selected=!0,i&&(t[s].defaultSelected=!0);return}e!==null||t[s].disabled||(e=t[s])}e!==null&&(e.selected=!0)}}function Wf(t,e,a){if(e!=null&&(e=""+ve(e),e!==t.value&&(t.value=e),a==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=a!=null?""+ve(a):""}function Pf(t,e,a,i){if(e==null){if(i!=null){if(a!=null)throw Error(u(92));if(G(i)){if(1<i.length)throw Error(u(93));i=i[0]}a=i}a==null&&(a=""),e=a}a=ve(e),t.defaultValue=a,i=t.textContent,i===a&&i!==""&&i!==null&&(t.value=i),fl(t)}function dl(t,e){if(e){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=e;return}}t.textContent=e}var Fy=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 td(t,e,a){var i=e.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,a):typeof a!="number"||a===0||Fy.has(e)?e==="float"?t.cssFloat=a:t[e]=(""+a).trim():t[e]=a+"px"}function ed(t,e,a){if(e!=null&&typeof e!="object")throw Error(u(62));if(t=t.style,a!=null){for(var i in a)!a.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var s in e)i=e[s],e.hasOwnProperty(s)&&a[s]!==i&&td(t,s,i)}else for(var c in e)e.hasOwnProperty(c)&&td(t,c,e[c])}function $s(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 Wy=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"]]),Py=/^[\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 qo(t){return Py.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function bn(){}var ks=null;function Ks(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var hl=null,gl=null;function nd(t){var e=Qn(t);if(e&&(t=e.stateNode)){var a=t[he]||null;t:switch(t=e.stateNode,e.type){case"input":if(Ca(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),e=a.name,a.type==="radio"&&e!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+xe(""+e)+'"][type="radio"]'),e=0;e<a.length;e++){var i=a[e];if(i!==t&&i.form===t.form){var s=i[he]||null;if(!s)throw Error(u(90));Ca(i,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(e=0;e<a.length;e++)i=a[e],i.form===t.form&&Uo(i)}break t;case"textarea":Wf(t,a.value,a.defaultValue);break t;case"select":e=a.value,e!=null&&Sn(t,!!a.multiple,e,!1)}}}var Is=!1;function ad(t,e,a){if(Is)return t(e,a);Is=!0;try{var i=t(e);return i}finally{if(Is=!1,(hl!==null||gl!==null)&&(Nu(),hl&&(e=hl,t=gl,gl=hl=null,nd(e),t)))for(e=0;e<t.length;e++)nd(t[e])}}function ri(t,e){var a=t.stateNode;if(a===null)return null;var i=a[he]||null;if(i===null)return null;a=i[e];t:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break t;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(u(231,e,typeof a));return a}var _n=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Js=!1;if(_n)try{var ci={};Object.defineProperty(ci,"passive",{get:function(){Js=!0}}),window.addEventListener("test",ci,ci),window.removeEventListener("test",ci,ci)}catch{Js=!1}var In=null,Fs=null,Lo=null;function ld(){if(Lo)return Lo;var t,e=Fs,a=e.length,i,s="value"in In?In.value:In.textContent,c=s.length;for(t=0;t<a&&e[t]===s[t];t++);var p=a-t;for(i=1;i<=p&&e[a-i]===s[c-i];i++);return Lo=s.slice(t,1<i?1-i:void 0)}function Yo(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Vo(){return!0}function id(){return!1}function Se(t){function e(a,i,s,c,p){this._reactName=a,this._targetInst=s,this.type=i,this.nativeEvent=c,this.target=p,this.currentTarget=null;for(var b in t)t.hasOwnProperty(b)&&(a=t[b],this[b]=a?a(c):c[b]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Vo:id,this.isPropagationStopped=id,this}return y(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Vo)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Vo)},persist:function(){},isPersistent:Vo}),e}var Da={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Go=Se(Da),fi=y({},Da,{view:0,detail:0}),tv=Se(fi),Ws,Ps,di,Xo=y({},fi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:er,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!==di&&(di&&t.type==="mousemove"?(Ws=t.screenX-di.screenX,Ps=t.screenY-di.screenY):Ps=Ws=0,di=t),Ws)},movementY:function(t){return"movementY"in t?t.movementY:Ps}}),od=Se(Xo),ev=y({},Xo,{dataTransfer:0}),nv=Se(ev),av=y({},fi,{relatedTarget:0}),tr=Se(av),lv=y({},Da,{animationName:0,elapsedTime:0,pseudoElement:0}),iv=Se(lv),ov=y({},Da,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),uv=Se(ov),sv=y({},Da,{data:0}),ud=Se(sv),rv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cv={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"},fv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dv(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=fv[t])?!!e[t]:!1}function er(){return dv}var hv=y({},fi,{key:function(t){if(t.key){var e=rv[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Yo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?cv[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:er,charCode:function(t){return t.type==="keypress"?Yo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Yo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),gv=Se(hv),mv=y({},Xo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sd=Se(mv),pv=y({},fi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:er}),yv=Se(pv),vv=y({},Da,{propertyName:0,elapsedTime:0,pseudoElement:0}),xv=Se(vv),Sv=y({},Xo,{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}),bv=Se(Sv),_v=y({},Da,{newState:0,oldState:0}),Ev=Se(_v),wv=[9,13,27,32],nr=_n&&"CompositionEvent"in window,hi=null;_n&&"documentMode"in document&&(hi=document.documentMode);var Nv=_n&&"TextEvent"in window&&!hi,rd=_n&&(!nr||hi&&8<hi&&11>=hi),cd=" ",fd=!1;function dd(t,e){switch(t){case"keyup":return wv.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hd(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ml=!1;function Mv(t,e){switch(t){case"compositionend":return hd(e);case"keypress":return e.which!==32?null:(fd=!0,cd);case"textInput":return t=e.data,t===cd&&fd?null:t;default:return null}}function Av(t,e){if(ml)return t==="compositionend"||!nr&&dd(t,e)?(t=ld(),Lo=Fs=In=null,ml=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return rd&&e.locale!=="ko"?null:e.data;default:return null}}var zv={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 gd(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!zv[t.type]:e==="textarea"}function md(t,e,a,i){hl?gl?gl.push(i):gl=[i]:hl=i,e=Ou(e,"onChange"),0<e.length&&(a=new Go("onChange","change",null,a,i),t.push({event:a,listeners:e}))}var gi=null,mi=null;function Tv(t){Fg(t,0)}function Zo(t){var e=$n(t);if(Uo(e))return t}function pd(t,e){if(t==="change")return e}var yd=!1;if(_n){var ar;if(_n){var lr="oninput"in document;if(!lr){var vd=document.createElement("div");vd.setAttribute("oninput","return;"),lr=typeof vd.oninput=="function"}ar=lr}else ar=!1;yd=ar&&(!document.documentMode||9<document.documentMode)}function xd(){gi&&(gi.detachEvent("onpropertychange",Sd),mi=gi=null)}function Sd(t){if(t.propertyName==="value"&&Zo(mi)){var e=[];md(e,mi,t,Ks(t)),ad(Tv,e)}}function Cv(t,e,a){t==="focusin"?(xd(),gi=e,mi=a,gi.attachEvent("onpropertychange",Sd)):t==="focusout"&&xd()}function Dv(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Zo(mi)}function Ov(t,e){if(t==="click")return Zo(e)}function Rv(t,e){if(t==="input"||t==="change")return Zo(e)}function Hv(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ze=typeof Object.is=="function"?Object.is:Hv;function pi(t,e){if(ze(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var a=Object.keys(t),i=Object.keys(e);if(a.length!==i.length)return!1;for(i=0;i<a.length;i++){var s=a[i];if(!Ae.call(e,s)||!ze(t[s],e[s]))return!1}return!0}function bd(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function _d(t,e){var a=bd(t);t=0;for(var i;a;){if(a.nodeType===3){if(i=t+a.textContent.length,t<=e&&i>=e)return{node:a,offset:e-t};t=i}t:{for(;a;){if(a.nextSibling){a=a.nextSibling;break t}a=a.parentNode}a=void 0}a=bd(a)}}function Ed(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Ed(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function wd(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ta(t.document);e instanceof t.HTMLIFrameElement;){try{var a=typeof e.contentWindow.location.href=="string"}catch{a=!1}if(a)t=e.contentWindow;else break;e=Ta(t.document)}return e}function ir(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var jv=_n&&"documentMode"in document&&11>=document.documentMode,pl=null,or=null,yi=null,ur=!1;function Nd(t,e,a){var i=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ur||pl==null||pl!==Ta(i)||(i=pl,"selectionStart"in i&&ir(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),yi&&pi(yi,i)||(yi=i,i=Ou(or,"onSelect"),0<i.length&&(e=new Go("onSelect","select",null,e,a),t.push({event:e,listeners:i}),e.target=pl)))}function Oa(t,e){var a={};return a[t.toLowerCase()]=e.toLowerCase(),a["Webkit"+t]="webkit"+e,a["Moz"+t]="moz"+e,a}var yl={animationend:Oa("Animation","AnimationEnd"),animationiteration:Oa("Animation","AnimationIteration"),animationstart:Oa("Animation","AnimationStart"),transitionrun:Oa("Transition","TransitionRun"),transitionstart:Oa("Transition","TransitionStart"),transitioncancel:Oa("Transition","TransitionCancel"),transitionend:Oa("Transition","TransitionEnd")},sr={},Md={};_n&&(Md=document.createElement("div").style,"AnimationEvent"in window||(delete yl.animationend.animation,delete yl.animationiteration.animation,delete yl.animationstart.animation),"TransitionEvent"in window||delete yl.transitionend.transition);function Ra(t){if(sr[t])return sr[t];if(!yl[t])return t;var e=yl[t],a;for(a in e)if(e.hasOwnProperty(a)&&a in Md)return sr[t]=e[a];return t}var Ad=Ra("animationend"),zd=Ra("animationiteration"),Td=Ra("animationstart"),Uv=Ra("transitionrun"),Bv=Ra("transitionstart"),qv=Ra("transitioncancel"),Cd=Ra("transitionend"),Dd=new Map,rr="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(" ");rr.push("scrollEnd");function Ke(t,e){Dd.set(t,e),xn(e,[t])}var Qo=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=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(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Be=[],vl=0,cr=0;function $o(){for(var t=vl,e=cr=vl=0;e<t;){var a=Be[e];Be[e++]=null;var i=Be[e];Be[e++]=null;var s=Be[e];Be[e++]=null;var c=Be[e];if(Be[e++]=null,i!==null&&s!==null){var p=i.pending;p===null?s.next=s:(s.next=p.next,p.next=s),i.pending=s}c!==0&&Od(a,s,c)}}function ko(t,e,a,i){Be[vl++]=t,Be[vl++]=e,Be[vl++]=a,Be[vl++]=i,cr|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function fr(t,e,a,i){return ko(t,e,a,i),Ko(t)}function Ha(t,e){return ko(t,null,null,e),Ko(t)}function Od(t,e,a){t.lanes|=a;var i=t.alternate;i!==null&&(i.lanes|=a);for(var s=!1,c=t.return;c!==null;)c.childLanes|=a,i=c.alternate,i!==null&&(i.childLanes|=a),c.tag===22&&(t=c.stateNode,t===null||t._visibility&1||(s=!0)),t=c,c=c.return;return t.tag===3?(c=t.stateNode,s&&e!==null&&(s=31-pe(a),t=c.hiddenUpdates,i=t[s],i===null?t[s]=[e]:i.push(e),e.lane=a|536870912),c):null}function Ko(t){if(50<Li)throw Li=0,Sc=null,Error(u(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var xl={};function Lv(t,e,a,i){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Te(t,e,a,i){return new Lv(t,e,a,i)}function dr(t){return t=t.prototype,!(!t||!t.isReactComponent)}function En(t,e){var a=t.alternate;return a===null?(a=Te(t.tag,e,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=e,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,e=t.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function Rd(t,e){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,e=a.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Io(t,e,a,i,s,c){var p=0;if(i=t,typeof t=="function")dr(t)&&(p=1);else if(typeof t=="string")p=Z1(t,a,et.current)?26:t==="html"||t==="head"||t==="body"?27:5;else t:switch(t){case I:return t=Te(31,a,e,s),t.elementType=I,t.lanes=c,t;case A:return ja(a.children,s,c,e);case T:p=8,s|=24;break;case z:return t=Te(12,a,e,s|2),t.elementType=z,t.lanes=c,t;case V:return t=Te(13,a,e,s),t.elementType=V,t.lanes=c,t;case B:return t=Te(19,a,e,s),t.elementType=B,t.lanes=c,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case E:p=10;break t;case L:p=9;break t;case C:p=11;break t;case q:p=14;break t;case k:p=16,i=null;break t}p=29,a=Error(u(130,t===null?"null":typeof t,"")),i=null}return e=Te(p,a,e,s),e.elementType=t,e.type=i,e.lanes=c,e}function ja(t,e,a,i){return t=Te(7,t,i,e),t.lanes=a,t}function hr(t,e,a){return t=Te(6,t,null,e),t.lanes=a,t}function Hd(t){var e=Te(18,null,null,0);return e.stateNode=t,e}function gr(t,e,a){return e=Te(4,t.children!==null?t.children:[],t.key,e),e.lanes=a,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var jd=new WeakMap;function qe(t,e){if(typeof t=="object"&&t!==null){var a=jd.get(t);return a!==void 0?a:(e={value:t,source:e,stack:Qe(e)},jd.set(t,e),e)}return{value:t,source:e,stack:Qe(e)}}var Sl=[],bl=0,Jo=null,vi=0,Le=[],Ye=0,Jn=null,on=1,un="";function wn(t,e){Sl[bl++]=vi,Sl[bl++]=Jo,Jo=t,vi=e}function Ud(t,e,a){Le[Ye++]=on,Le[Ye++]=un,Le[Ye++]=Jn,Jn=t;var i=on;t=un;var s=32-pe(i)-1;i&=~(1<<s),a+=1;var c=32-pe(e)+s;if(30<c){var p=s-s%5;c=(i&(1<<p)-1).toString(32),i>>=p,s-=p,on=1<<32-pe(e)+s|a<<s|i,un=c+t}else on=1<<c|a<<s|i,un=t}function mr(t){t.return!==null&&(wn(t,1),Ud(t,1,0))}function pr(t){for(;t===Jo;)Jo=Sl[--bl],Sl[bl]=null,vi=Sl[--bl],Sl[bl]=null;for(;t===Jn;)Jn=Le[--Ye],Le[Ye]=null,un=Le[--Ye],Le[Ye]=null,on=Le[--Ye],Le[Ye]=null}function Bd(t,e){Le[Ye++]=on,Le[Ye++]=un,Le[Ye++]=Jn,on=e.id,un=e.overflow,Jn=t}var re=null,Xt=null,Ct=!1,Fn=null,Ve=!1,yr=Error(u(519));function Wn(t){var e=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xi(qe(e,t)),yr}function qd(t){var e=t.stateNode,a=t.type,i=t.memoizedProps;switch(e[le]=t,e[he]=i,a){case"dialog":Mt("cancel",e),Mt("close",e);break;case"iframe":case"object":case"embed":Mt("load",e);break;case"video":case"audio":for(a=0;a<Vi.length;a++)Mt(Vi[a],e);break;case"source":Mt("error",e);break;case"img":case"image":case"link":Mt("error",e),Mt("load",e);break;case"details":Mt("toggle",e);break;case"input":Mt("invalid",e),Bo(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Mt("invalid",e);break;case"textarea":Mt("invalid",e),Pf(e,i.value,i.defaultValue,i.children)}a=i.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||e.textContent===""+a||i.suppressHydrationWarning===!0||em(e.textContent,a)?(i.popover!=null&&(Mt("beforetoggle",e),Mt("toggle",e)),i.onScroll!=null&&Mt("scroll",e),i.onScrollEnd!=null&&Mt("scrollend",e),i.onClick!=null&&(e.onclick=bn),e=!0):e=!1,e||Wn(t,!0)}function Ld(t){for(re=t.return;re;)switch(re.tag){case 5:case 31:case 13:Ve=!1;return;case 27:case 3:Ve=!0;return;default:re=re.return}}function _l(t){if(t!==re)return!1;if(!Ct)return Ld(t),Ct=!0,!1;var e=t.tag,a;if((a=e!==3&&e!==27)&&((a=e===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||jc(t.type,t.memoizedProps)),a=!a),a&&Xt&&Wn(t),Ld(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(u(317));Xt=cm(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(u(317));Xt=cm(t)}else e===27?(e=Xt,da(t.type)?(t=Yc,Yc=null,Xt=t):Xt=e):Xt=re?Xe(t.stateNode.nextSibling):null;return!0}function Ua(){Xt=re=null,Ct=!1}function vr(){var t=Fn;return t!==null&&(we===null?we=t:we.push.apply(we,t),Fn=null),t}function xi(t){Fn===null?Fn=[t]:Fn.push(t)}var xr=M(null),Ba=null,Nn=null;function Pn(t,e,a){W(xr,e._currentValue),e._currentValue=a}function Mn(t){t._currentValue=xr.current,H(xr)}function Sr(t,e,a){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===a)break;t=t.return}}function br(t,e,a,i){var s=t.child;for(s!==null&&(s.return=t);s!==null;){var c=s.dependencies;if(c!==null){var p=s.child;c=c.firstContext;t:for(;c!==null;){var b=c;c=s;for(var O=0;O<e.length;O++)if(b.context===e[O]){c.lanes|=a,b=c.alternate,b!==null&&(b.lanes|=a),Sr(c.return,a,t),i||(p=null);break t}c=b.next}}else if(s.tag===18){if(p=s.return,p===null)throw Error(u(341));p.lanes|=a,c=p.alternate,c!==null&&(c.lanes|=a),Sr(p,a,t),p=null}else p=s.child;if(p!==null)p.return=s;else for(p=s;p!==null;){if(p===t){p=null;break}if(s=p.sibling,s!==null){s.return=p.return,p=s;break}p=p.return}s=p}}function El(t,e,a,i){t=null;for(var s=e,c=!1;s!==null;){if(!c){if((s.flags&524288)!==0)c=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var p=s.alternate;if(p===null)throw Error(u(387));if(p=p.memoizedProps,p!==null){var b=s.type;ze(s.pendingProps.value,p.value)||(t!==null?t.push(b):t=[b])}}else if(s===rt.current){if(p=s.alternate,p===null)throw Error(u(387));p.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(t!==null?t.push($i):t=[$i])}s=s.return}t!==null&&br(e,t,a,i),e.flags|=262144}function Fo(t){for(t=t.firstContext;t!==null;){if(!ze(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function qa(t){Ba=t,Nn=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function ce(t){return Yd(Ba,t)}function Wo(t,e){return Ba===null&&qa(t),Yd(t,e)}function Yd(t,e){var a=e._currentValue;if(e={context:e,memoizedValue:a,next:null},Nn===null){if(t===null)throw Error(u(308));Nn=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Nn=Nn.next=e;return a}var Yv=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(a,i){t.push(i)}};this.abort=function(){e.aborted=!0,t.forEach(function(a){return a()})}},Vv=n.unstable_scheduleCallback,Gv=n.unstable_NormalPriority,Pt={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _r(){return{controller:new Yv,data:new Map,refCount:0}}function Si(t){t.refCount--,t.refCount===0&&Vv(Gv,function(){t.controller.abort()})}var bi=null,Er=0,wl=0,Nl=null;function Xv(t,e){if(bi===null){var a=bi=[];Er=0,wl=Mc(),Nl={status:"pending",value:void 0,then:function(i){a.push(i)}}}return Er++,e.then(Vd,Vd),e}function Vd(){if(--Er===0&&bi!==null){Nl!==null&&(Nl.status="fulfilled");var t=bi;bi=null,wl=0,Nl=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function Zv(t,e){var a=[],i={status:"pending",value:null,reason:null,then:function(s){a.push(s)}};return t.then(function(){i.status="fulfilled",i.value=e;for(var s=0;s<a.length;s++)(0,a[s])(e)},function(s){for(i.status="rejected",i.reason=s,s=0;s<a.length;s++)(0,a[s])(void 0)}),i}var Gd=N.S;N.S=function(t,e){Ng=se(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&Xv(t,e),Gd!==null&&Gd(t,e)};var La=M(null);function wr(){var t=La.current;return t!==null?t:Gt.pooledCache}function Po(t,e){e===null?W(La,La.current):W(La,e.pool)}function Xd(){var t=wr();return t===null?null:{parent:Pt._currentValue,pool:t}}var Ml=Error(u(460)),Nr=Error(u(474)),tu=Error(u(542)),eu={then:function(){}};function Zd(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Qd(t,e,a){switch(a=t[a],a===void 0?t.push(e):a!==e&&(e.then(bn,bn),e=a),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,kd(t),t;default:if(typeof e.status=="string")e.then(bn,bn);else{if(t=Gt,t!==null&&100<t.shellSuspendCounter)throw Error(u(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var s=e;s.status="fulfilled",s.value=i}},function(i){if(e.status==="pending"){var s=e;s.status="rejected",s.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,kd(t),t}throw Va=e,Ml}}function Ya(t){try{var e=t._init;return e(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Va=a,Ml):a}}var Va=null;function $d(){if(Va===null)throw Error(u(459));var t=Va;return Va=null,t}function kd(t){if(t===Ml||t===tu)throw Error(u(483))}var Al=null,_i=0;function nu(t){var e=_i;return _i+=1,Al===null&&(Al=[]),Qd(Al,t,e)}function Ei(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function au(t,e){throw e.$$typeof===x?Error(u(525)):(t=Object.prototype.toString.call(e),Error(u(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function Kd(t){function e(Y,j){if(t){var Z=Y.deletions;Z===null?(Y.deletions=[j],Y.flags|=16):Z.push(j)}}function a(Y,j){if(!t)return null;for(;j!==null;)e(Y,j),j=j.sibling;return null}function i(Y){for(var j=new Map;Y!==null;)Y.key!==null?j.set(Y.key,Y):j.set(Y.index,Y),Y=Y.sibling;return j}function s(Y,j){return Y=En(Y,j),Y.index=0,Y.sibling=null,Y}function c(Y,j,Z){return Y.index=Z,t?(Z=Y.alternate,Z!==null?(Z=Z.index,Z<j?(Y.flags|=67108866,j):Z):(Y.flags|=67108866,j)):(Y.flags|=1048576,j)}function p(Y){return t&&Y.alternate===null&&(Y.flags|=67108866),Y}function b(Y,j,Z,at){return j===null||j.tag!==6?(j=hr(Z,Y.mode,at),j.return=Y,j):(j=s(j,Z),j.return=Y,j)}function O(Y,j,Z,at){var pt=Z.type;return pt===A?nt(Y,j,Z.props.children,at,Z.key):j!==null&&(j.elementType===pt||typeof pt=="object"&&pt!==null&&pt.$$typeof===k&&Ya(pt)===j.type)?(j=s(j,Z.props),Ei(j,Z),j.return=Y,j):(j=Io(Z.type,Z.key,Z.props,null,Y.mode,at),Ei(j,Z),j.return=Y,j)}function Q(Y,j,Z,at){return j===null||j.tag!==4||j.stateNode.containerInfo!==Z.containerInfo||j.stateNode.implementation!==Z.implementation?(j=gr(Z,Y.mode,at),j.return=Y,j):(j=s(j,Z.children||[]),j.return=Y,j)}function nt(Y,j,Z,at,pt){return j===null||j.tag!==7?(j=ja(Z,Y.mode,at,pt),j.return=Y,j):(j=s(j,Z),j.return=Y,j)}function lt(Y,j,Z){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return j=hr(""+j,Y.mode,Z),j.return=Y,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case S:return Z=Io(j.type,j.key,j.props,null,Y.mode,Z),Ei(Z,j),Z.return=Y,Z;case _:return j=gr(j,Y.mode,Z),j.return=Y,j;case k:return j=Ya(j),lt(Y,j,Z)}if(G(j)||P(j))return j=ja(j,Y.mode,Z,null),j.return=Y,j;if(typeof j.then=="function")return lt(Y,nu(j),Z);if(j.$$typeof===E)return lt(Y,Wo(Y,j),Z);au(Y,j)}return null}function K(Y,j,Z,at){var pt=j!==null?j.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return pt!==null?null:b(Y,j,""+Z,at);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case S:return Z.key===pt?O(Y,j,Z,at):null;case _:return Z.key===pt?Q(Y,j,Z,at):null;case k:return Z=Ya(Z),K(Y,j,Z,at)}if(G(Z)||P(Z))return pt!==null?null:nt(Y,j,Z,at,null);if(typeof Z.then=="function")return K(Y,j,nu(Z),at);if(Z.$$typeof===E)return K(Y,j,Wo(Y,Z),at);au(Y,Z)}return null}function F(Y,j,Z,at,pt){if(typeof at=="string"&&at!==""||typeof at=="number"||typeof at=="bigint")return Y=Y.get(Z)||null,b(j,Y,""+at,pt);if(typeof at=="object"&&at!==null){switch(at.$$typeof){case S:return Y=Y.get(at.key===null?Z:at.key)||null,O(j,Y,at,pt);case _:return Y=Y.get(at.key===null?Z:at.key)||null,Q(j,Y,at,pt);case k:return at=Ya(at),F(Y,j,Z,at,pt)}if(G(at)||P(at))return Y=Y.get(Z)||null,nt(j,Y,at,pt,null);if(typeof at.then=="function")return F(Y,j,Z,nu(at),pt);if(at.$$typeof===E)return F(Y,j,Z,Wo(j,at),pt);au(j,at)}return null}function dt(Y,j,Z,at){for(var pt=null,Ot=null,gt=j,wt=j=0,Tt=null;gt!==null&&wt<Z.length;wt++){gt.index>wt?(Tt=gt,gt=null):Tt=gt.sibling;var Rt=K(Y,gt,Z[wt],at);if(Rt===null){gt===null&&(gt=Tt);break}t&>&&Rt.alternate===null&&e(Y,gt),j=c(Rt,j,wt),Ot===null?pt=Rt:Ot.sibling=Rt,Ot=Rt,gt=Tt}if(wt===Z.length)return a(Y,gt),Ct&&wn(Y,wt),pt;if(gt===null){for(;wt<Z.length;wt++)gt=lt(Y,Z[wt],at),gt!==null&&(j=c(gt,j,wt),Ot===null?pt=gt:Ot.sibling=gt,Ot=gt);return Ct&&wn(Y,wt),pt}for(gt=i(gt);wt<Z.length;wt++)Tt=F(gt,Y,wt,Z[wt],at),Tt!==null&&(t&&Tt.alternate!==null&>.delete(Tt.key===null?wt:Tt.key),j=c(Tt,j,wt),Ot===null?pt=Tt:Ot.sibling=Tt,Ot=Tt);return t&>.forEach(function(ya){return e(Y,ya)}),Ct&&wn(Y,wt),pt}function vt(Y,j,Z,at){if(Z==null)throw Error(u(151));for(var pt=null,Ot=null,gt=j,wt=j=0,Tt=null,Rt=Z.next();gt!==null&&!Rt.done;wt++,Rt=Z.next()){gt.index>wt?(Tt=gt,gt=null):Tt=gt.sibling;var ya=K(Y,gt,Rt.value,at);if(ya===null){gt===null&&(gt=Tt);break}t&>&&ya.alternate===null&&e(Y,gt),j=c(ya,j,wt),Ot===null?pt=ya:Ot.sibling=ya,Ot=ya,gt=Tt}if(Rt.done)return a(Y,gt),Ct&&wn(Y,wt),pt;if(gt===null){for(;!Rt.done;wt++,Rt=Z.next())Rt=lt(Y,Rt.value,at),Rt!==null&&(j=c(Rt,j,wt),Ot===null?pt=Rt:Ot.sibling=Rt,Ot=Rt);return Ct&&wn(Y,wt),pt}for(gt=i(gt);!Rt.done;wt++,Rt=Z.next())Rt=F(gt,Y,wt,Rt.value,at),Rt!==null&&(t&&Rt.alternate!==null&>.delete(Rt.key===null?wt:Rt.key),j=c(Rt,j,wt),Ot===null?pt=Rt:Ot.sibling=Rt,Ot=Rt);return t&>.forEach(function(ex){return e(Y,ex)}),Ct&&wn(Y,wt),pt}function Vt(Y,j,Z,at){if(typeof Z=="object"&&Z!==null&&Z.type===A&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case S:t:{for(var pt=Z.key;j!==null;){if(j.key===pt){if(pt=Z.type,pt===A){if(j.tag===7){a(Y,j.sibling),at=s(j,Z.props.children),at.return=Y,Y=at;break t}}else if(j.elementType===pt||typeof pt=="object"&&pt!==null&&pt.$$typeof===k&&Ya(pt)===j.type){a(Y,j.sibling),at=s(j,Z.props),Ei(at,Z),at.return=Y,Y=at;break t}a(Y,j);break}else e(Y,j);j=j.sibling}Z.type===A?(at=ja(Z.props.children,Y.mode,at,Z.key),at.return=Y,Y=at):(at=Io(Z.type,Z.key,Z.props,null,Y.mode,at),Ei(at,Z),at.return=Y,Y=at)}return p(Y);case _:t:{for(pt=Z.key;j!==null;){if(j.key===pt)if(j.tag===4&&j.stateNode.containerInfo===Z.containerInfo&&j.stateNode.implementation===Z.implementation){a(Y,j.sibling),at=s(j,Z.children||[]),at.return=Y,Y=at;break t}else{a(Y,j);break}else e(Y,j);j=j.sibling}at=gr(Z,Y.mode,at),at.return=Y,Y=at}return p(Y);case k:return Z=Ya(Z),Vt(Y,j,Z,at)}if(G(Z))return dt(Y,j,Z,at);if(P(Z)){if(pt=P(Z),typeof pt!="function")throw Error(u(150));return Z=pt.call(Z),vt(Y,j,Z,at)}if(typeof Z.then=="function")return Vt(Y,j,nu(Z),at);if(Z.$$typeof===E)return Vt(Y,j,Wo(Y,Z),at);au(Y,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,j!==null&&j.tag===6?(a(Y,j.sibling),at=s(j,Z),at.return=Y,Y=at):(a(Y,j),at=hr(Z,Y.mode,at),at.return=Y,Y=at),p(Y)):a(Y,j)}return function(Y,j,Z,at){try{_i=0;var pt=Vt(Y,j,Z,at);return Al=null,pt}catch(gt){if(gt===Ml||gt===tu)throw gt;var Ot=Te(29,gt,null,Y.mode);return Ot.lanes=at,Ot.return=Y,Ot}}}var Ga=Kd(!0),Id=Kd(!1),ta=!1;function Mr(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ar(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ea(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function na(t,e,a){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(Ht&2)!==0){var s=i.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),i.pending=e,e=Ko(t),Od(t,null,a),e}return ko(t,i,e,a),Ko(t)}function wi(t,e,a){if(e=e.updateQueue,e!==null&&(e=e.shared,(a&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,a|=i,e.lanes=a,Mo(t,a)}}function zr(t,e){var a=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,a===i)){var s=null,c=null;if(a=a.firstBaseUpdate,a!==null){do{var p={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};c===null?s=c=p:c=c.next=p,a=a.next}while(a!==null);c===null?s=c=e:c=c.next=e}else s=c=e;a={baseState:i.baseState,firstBaseUpdate:s,lastBaseUpdate:c,shared:i.shared,callbacks:i.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=e:t.next=e,a.lastBaseUpdate=e}var Tr=!1;function Ni(){if(Tr){var t=Nl;if(t!==null)throw t}}function Mi(t,e,a,i){Tr=!1;var s=t.updateQueue;ta=!1;var c=s.firstBaseUpdate,p=s.lastBaseUpdate,b=s.shared.pending;if(b!==null){s.shared.pending=null;var O=b,Q=O.next;O.next=null,p===null?c=Q:p.next=Q,p=O;var nt=t.alternate;nt!==null&&(nt=nt.updateQueue,b=nt.lastBaseUpdate,b!==p&&(b===null?nt.firstBaseUpdate=Q:b.next=Q,nt.lastBaseUpdate=O))}if(c!==null){var lt=s.baseState;p=0,nt=Q=O=null,b=c;do{var K=b.lane&-536870913,F=K!==b.lane;if(F?(zt&K)===K:(i&K)===K){K!==0&&K===wl&&(Tr=!0),nt!==null&&(nt=nt.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});t:{var dt=t,vt=b;K=e;var Vt=a;switch(vt.tag){case 1:if(dt=vt.payload,typeof dt=="function"){lt=dt.call(Vt,lt,K);break t}lt=dt;break t;case 3:dt.flags=dt.flags&-65537|128;case 0:if(dt=vt.payload,K=typeof dt=="function"?dt.call(Vt,lt,K):dt,K==null)break t;lt=y({},lt,K);break t;case 2:ta=!0}}K=b.callback,K!==null&&(t.flags|=64,F&&(t.flags|=8192),F=s.callbacks,F===null?s.callbacks=[K]:F.push(K))}else F={lane:K,tag:b.tag,payload:b.payload,callback:b.callback,next:null},nt===null?(Q=nt=F,O=lt):nt=nt.next=F,p|=K;if(b=b.next,b===null){if(b=s.shared.pending,b===null)break;F=b,b=F.next,F.next=null,s.lastBaseUpdate=F,s.shared.pending=null}}while(!0);nt===null&&(O=lt),s.baseState=O,s.firstBaseUpdate=Q,s.lastBaseUpdate=nt,c===null&&(s.shared.lanes=0),ua|=p,t.lanes=p,t.memoizedState=lt}}function Jd(t,e){if(typeof t!="function")throw Error(u(191,t));t.call(e)}function Fd(t,e){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)Jd(a[t],e)}var zl=M(null),lu=M(0);function Wd(t,e){t=jn,W(lu,t),W(zl,e),jn=t|e.baseLanes}function Cr(){W(lu,jn),W(zl,zl.current)}function Dr(){jn=lu.current,H(zl),H(lu)}var Ce=M(null),Ge=null;function aa(t){var e=t.alternate;W(Jt,Jt.current&1),W(Ce,t),Ge===null&&(e===null||zl.current!==null||e.memoizedState!==null)&&(Ge=t)}function Or(t){W(Jt,Jt.current),W(Ce,t),Ge===null&&(Ge=t)}function Pd(t){t.tag===22?(W(Jt,Jt.current),W(Ce,t),Ge===null&&(Ge=t)):la()}function la(){W(Jt,Jt.current),W(Ce,Ce.current)}function De(t){H(Ce),Ge===t&&(Ge=null),H(Jt)}var Jt=M(0);function iu(t){for(var e=t;e!==null;){if(e.tag===13){var a=e.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||qc(a)||Lc(a)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var An=0,_t=null,Lt=null,te=null,ou=!1,Tl=!1,Xa=!1,uu=0,Ai=0,Cl=null,Qv=0;function Kt(){throw Error(u(321))}function Rr(t,e){if(e===null)return!1;for(var a=0;a<e.length&&a<t.length;a++)if(!ze(t[a],e[a]))return!1;return!0}function Hr(t,e,a,i,s,c){return An=c,_t=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,N.H=t===null||t.memoizedState===null?Uh:Ir,Xa=!1,c=a(i,s),Xa=!1,Tl&&(c=eh(e,a,i,s)),th(t),c}function th(t){N.H=Ci;var e=Lt!==null&&Lt.next!==null;if(An=0,te=Lt=_t=null,ou=!1,Ai=0,Cl=null,e)throw Error(u(300));t===null||ee||(t=t.dependencies,t!==null&&Fo(t)&&(ee=!0))}function eh(t,e,a,i){_t=t;var s=0;do{if(Tl&&(Cl=null),Ai=0,Tl=!1,25<=s)throw Error(u(301));if(s+=1,te=Lt=null,t.updateQueue!=null){var c=t.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}N.H=Bh,c=e(a,i)}while(Tl);return c}function $v(){var t=N.H,e=t.useState()[0];return e=typeof e.then=="function"?zi(e):e,t=t.useState()[0],(Lt!==null?Lt.memoizedState:null)!==t&&(_t.flags|=1024),e}function jr(){var t=uu!==0;return uu=0,t}function Ur(t,e,a){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a}function Br(t){if(ou){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}ou=!1}An=0,te=Lt=_t=null,Tl=!1,Ai=uu=0,Cl=null}function ye(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return te===null?_t.memoizedState=te=t:te=te.next=t,te}function Ft(){if(Lt===null){var t=_t.alternate;t=t!==null?t.memoizedState:null}else t=Lt.next;var e=te===null?_t.memoizedState:te.next;if(e!==null)te=e,Lt=t;else{if(t===null)throw _t.alternate===null?Error(u(467)):Error(u(310));Lt=t,t={memoizedState:Lt.memoizedState,baseState:Lt.baseState,baseQueue:Lt.baseQueue,queue:Lt.queue,next:null},te===null?_t.memoizedState=te=t:te=te.next=t}return te}function su(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zi(t){var e=Ai;return Ai+=1,Cl===null&&(Cl=[]),t=Qd(Cl,t,e),e=_t,(te===null?e.memoizedState:te.next)===null&&(e=e.alternate,N.H=e===null||e.memoizedState===null?Uh:Ir),t}function ru(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return zi(t);if(t.$$typeof===E)return ce(t)}throw Error(u(438,String(t)))}function qr(t){var e=null,a=_t.updateQueue;if(a!==null&&(e=a.memoCache),e==null){var i=_t.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(s){return s.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),a===null&&(a=su(),_t.updateQueue=a),a.memoCache=e,a=e.data[e.index],a===void 0)for(a=e.data[e.index]=Array(t),i=0;i<t;i++)a[i]=ot;return e.index++,a}function zn(t,e){return typeof e=="function"?e(t):e}function cu(t){var e=Ft();return Lr(e,Lt,t)}function Lr(t,e,a){var i=t.queue;if(i===null)throw Error(u(311));i.lastRenderedReducer=a;var s=t.baseQueue,c=i.pending;if(c!==null){if(s!==null){var p=s.next;s.next=c.next,c.next=p}e.baseQueue=s=c,i.pending=null}if(c=t.baseState,s===null)t.memoizedState=c;else{e=s.next;var b=p=null,O=null,Q=e,nt=!1;do{var lt=Q.lane&-536870913;if(lt!==Q.lane?(zt<)===lt:(An<)===lt){var K=Q.revertLane;if(K===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),lt===wl&&(nt=!0);else if((An&K)===K){Q=Q.next,K===wl&&(nt=!0);continue}else lt={lane:0,revertLane:Q.revertLane,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},O===null?(b=O=lt,p=c):O=O.next=lt,_t.lanes|=K,ua|=K;lt=Q.action,Xa&&a(c,lt),c=Q.hasEagerState?Q.eagerState:a(c,lt)}else K={lane:lt,revertLane:Q.revertLane,gesture:Q.gesture,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},O===null?(b=O=K,p=c):O=O.next=K,_t.lanes|=lt,ua|=lt;Q=Q.next}while(Q!==null&&Q!==e);if(O===null?p=c:O.next=b,!ze(c,t.memoizedState)&&(ee=!0,nt&&(a=Nl,a!==null)))throw a;t.memoizedState=c,t.baseState=p,t.baseQueue=O,i.lastRenderedState=c}return s===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Yr(t){var e=Ft(),a=e.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=t;var i=a.dispatch,s=a.pending,c=e.memoizedState;if(s!==null){a.pending=null;var p=s=s.next;do c=t(c,p.action),p=p.next;while(p!==s);ze(c,e.memoizedState)||(ee=!0),e.memoizedState=c,e.baseQueue===null&&(e.baseState=c),a.lastRenderedState=c}return[c,i]}function nh(t,e,a){var i=_t,s=Ft(),c=Ct;if(c){if(a===void 0)throw Error(u(407));a=a()}else a=e();var p=!ze((Lt||s).memoizedState,a);if(p&&(s.memoizedState=a,ee=!0),s=s.queue,Xr(ih.bind(null,i,s,t),[t]),s.getSnapshot!==e||p||te!==null&&te.memoizedState.tag&1){if(i.flags|=2048,Dl(9,{destroy:void 0},lh.bind(null,i,s,a,e),null),Gt===null)throw Error(u(349));c||(An&127)!==0||ah(i,e,a)}return a}function ah(t,e,a){t.flags|=16384,t={getSnapshot:e,value:a},e=_t.updateQueue,e===null?(e=su(),_t.updateQueue=e,e.stores=[t]):(a=e.stores,a===null?e.stores=[t]:a.push(t))}function lh(t,e,a,i){e.value=a,e.getSnapshot=i,oh(e)&&uh(t)}function ih(t,e,a){return a(function(){oh(e)&&uh(t)})}function oh(t){var e=t.getSnapshot;t=t.value;try{var a=e();return!ze(t,a)}catch{return!0}}function uh(t){var e=Ha(t,2);e!==null&&Ne(e,t,2)}function Vr(t){var e=ye();if(typeof t=="function"){var a=t;if(t=a(),Xa){an(!0);try{a()}finally{an(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:t},e}function sh(t,e,a,i){return t.baseState=a,Lr(t,Lt,typeof i=="function"?i:zn)}function kv(t,e,a,i,s){if(hu(t))throw Error(u(485));if(t=e.action,t!==null){var c={payload:s,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(p){c.listeners.push(p)}};N.T!==null?a(!0):c.isTransition=!1,i(c),a=e.pending,a===null?(c.next=e.pending=c,rh(e,c)):(c.next=a.next,e.pending=a.next=c)}}function rh(t,e){var a=e.action,i=e.payload,s=t.state;if(e.isTransition){var c=N.T,p={};N.T=p;try{var b=a(s,i),O=N.S;O!==null&&O(p,b),ch(t,e,b)}catch(Q){Gr(t,e,Q)}finally{c!==null&&p.types!==null&&(c.types=p.types),N.T=c}}else try{c=a(s,i),ch(t,e,c)}catch(Q){Gr(t,e,Q)}}function ch(t,e,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(i){fh(t,e,i)},function(i){return Gr(t,e,i)}):fh(t,e,a)}function fh(t,e,a){e.status="fulfilled",e.value=a,dh(e),t.state=a,e=t.pending,e!==null&&(a=e.next,a===e?t.pending=null:(a=a.next,e.next=a,rh(t,a)))}function Gr(t,e,a){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=a,dh(e),e=e.next;while(e!==i)}t.action=null}function dh(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function hh(t,e){return e}function gh(t,e){if(Ct){var a=Gt.formState;if(a!==null){t:{var i=_t;if(Ct){if(Xt){e:{for(var s=Xt,c=Ve;s.nodeType!==8;){if(!c){s=null;break e}if(s=Xe(s.nextSibling),s===null){s=null;break e}}c=s.data,s=c==="F!"||c==="F"?s:null}if(s){Xt=Xe(s.nextSibling),i=s.data==="F!";break t}}Wn(i)}i=!1}i&&(e=a[0])}}return a=ye(),a.memoizedState=a.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hh,lastRenderedState:e},a.queue=i,a=Rh.bind(null,_t,i),i.dispatch=a,i=Vr(!1),c=Kr.bind(null,_t,!1,i.queue),i=ye(),s={state:e,dispatch:null,action:t,pending:null},i.queue=s,a=kv.bind(null,_t,s,c,a),s.dispatch=a,i.memoizedState=t,[e,a,!1]}function mh(t){var e=Ft();return ph(e,Lt,t)}function ph(t,e,a){if(e=Lr(t,e,hh)[0],t=cu(zn)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=zi(e)}catch(p){throw p===Ml?tu:p}else i=e;e=Ft();var s=e.queue,c=s.dispatch;return a!==e.memoizedState&&(_t.flags|=2048,Dl(9,{destroy:void 0},Kv.bind(null,s,a),null)),[i,c,t]}function Kv(t,e){t.action=e}function yh(t){var e=Ft(),a=Lt;if(a!==null)return ph(e,a,t);Ft(),e=e.memoizedState,a=Ft();var i=a.queue.dispatch;return a.memoizedState=t,[e,i,!1]}function Dl(t,e,a,i){return t={tag:t,create:a,deps:i,inst:e,next:null},e=_t.updateQueue,e===null&&(e=su(),_t.updateQueue=e),a=e.lastEffect,a===null?e.lastEffect=t.next=t:(i=a.next,a.next=t,t.next=i,e.lastEffect=t),t}function vh(){return Ft().memoizedState}function fu(t,e,a,i){var s=ye();_t.flags|=t,s.memoizedState=Dl(1|e,{destroy:void 0},a,i===void 0?null:i)}function du(t,e,a,i){var s=Ft();i=i===void 0?null:i;var c=s.memoizedState.inst;Lt!==null&&i!==null&&Rr(i,Lt.memoizedState.deps)?s.memoizedState=Dl(e,c,a,i):(_t.flags|=t,s.memoizedState=Dl(1|e,c,a,i))}function xh(t,e){fu(8390656,8,t,e)}function Xr(t,e){du(2048,8,t,e)}function Iv(t){_t.flags|=4;var e=_t.updateQueue;if(e===null)e=su(),_t.updateQueue=e,e.events=[t];else{var a=e.events;a===null?e.events=[t]:a.push(t)}}function Sh(t){var e=Ft().memoizedState;return Iv({ref:e,nextImpl:t}),function(){if((Ht&2)!==0)throw Error(u(440));return e.impl.apply(void 0,arguments)}}function bh(t,e){return du(4,2,t,e)}function _h(t,e){return du(4,4,t,e)}function Eh(t,e){if(typeof e=="function"){t=t();var a=e(t);return function(){typeof a=="function"?a():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function wh(t,e,a){a=a!=null?a.concat([t]):null,du(4,4,Eh.bind(null,e,t),a)}function Zr(){}function Nh(t,e){var a=Ft();e=e===void 0?null:e;var i=a.memoizedState;return e!==null&&Rr(e,i[1])?i[0]:(a.memoizedState=[t,e],t)}function Mh(t,e){var a=Ft();e=e===void 0?null:e;var i=a.memoizedState;if(e!==null&&Rr(e,i[1]))return i[0];if(i=t(),Xa){an(!0);try{t()}finally{an(!1)}}return a.memoizedState=[i,e],i}function Qr(t,e,a){return a===void 0||(An&1073741824)!==0&&(zt&261930)===0?t.memoizedState=e:(t.memoizedState=a,t=Ag(),_t.lanes|=t,ua|=t,a)}function Ah(t,e,a,i){return ze(a,e)?a:zl.current!==null?(t=Qr(t,a,i),ze(t,e)||(ee=!0),t):(An&42)===0||(An&1073741824)!==0&&(zt&261930)===0?(ee=!0,t.memoizedState=a):(t=Ag(),_t.lanes|=t,ua|=t,e)}function zh(t,e,a,i,s){var c=R.p;R.p=c!==0&&8>c?c:8;var p=N.T,b={};N.T=b,Kr(t,!1,e,a);try{var O=s(),Q=N.S;if(Q!==null&&Q(b,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var nt=Zv(O,i);Ti(t,e,nt,He(t))}else Ti(t,e,i,He(t))}catch(lt){Ti(t,e,{then:function(){},status:"rejected",reason:lt},He())}finally{R.p=c,p!==null&&b.types!==null&&(p.types=b.types),N.T=p}}function Jv(){}function $r(t,e,a,i){if(t.tag!==5)throw Error(u(476));var s=Th(t).queue;zh(t,s,e,U,a===null?Jv:function(){return Ch(t),a(i)})}function Th(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:U},next:null};var a={};return e.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:a},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Ch(t){var e=Th(t);e.next===null&&(e=t.alternate.memoizedState),Ti(t,e.next.queue,{},He())}function kr(){return ce($i)}function Dh(){return Ft().memoizedState}function Oh(){return Ft().memoizedState}function Fv(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var a=He();t=ea(a);var i=na(e,t,a);i!==null&&(Ne(i,e,a),wi(i,e,a)),e={cache:_r()},t.payload=e;return}e=e.return}}function Wv(t,e,a){var i=He();a={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},hu(t)?Hh(e,a):(a=fr(t,e,a,i),a!==null&&(Ne(a,t,i),jh(a,e,i)))}function Rh(t,e,a){var i=He();Ti(t,e,a,i)}function Ti(t,e,a,i){var s={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(hu(t))Hh(e,s);else{var c=t.alternate;if(t.lanes===0&&(c===null||c.lanes===0)&&(c=e.lastRenderedReducer,c!==null))try{var p=e.lastRenderedState,b=c(p,a);if(s.hasEagerState=!0,s.eagerState=b,ze(b,p))return ko(t,e,s,0),Gt===null&&$o(),!1}catch{}if(a=fr(t,e,s,i),a!==null)return Ne(a,t,i),jh(a,e,i),!0}return!1}function Kr(t,e,a,i){if(i={lane:2,revertLane:Mc(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},hu(t)){if(e)throw Error(u(479))}else e=fr(t,a,i,2),e!==null&&Ne(e,t,2)}function hu(t){var e=t.alternate;return t===_t||e!==null&&e===_t}function Hh(t,e){Tl=ou=!0;var a=t.pending;a===null?e.next=e:(e.next=a.next,a.next=e),t.pending=e}function jh(t,e,a){if((a&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,a|=i,e.lanes=a,Mo(t,a)}}var Ci={readContext:ce,use:ru,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useLayoutEffect:Kt,useInsertionEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useSyncExternalStore:Kt,useId:Kt,useHostTransitionStatus:Kt,useFormState:Kt,useActionState:Kt,useOptimistic:Kt,useMemoCache:Kt,useCacheRefresh:Kt};Ci.useEffectEvent=Kt;var Uh={readContext:ce,use:ru,useCallback:function(t,e){return ye().memoizedState=[t,e===void 0?null:e],t},useContext:ce,useEffect:xh,useImperativeHandle:function(t,e,a){a=a!=null?a.concat([t]):null,fu(4194308,4,Eh.bind(null,e,t),a)},useLayoutEffect:function(t,e){return fu(4194308,4,t,e)},useInsertionEffect:function(t,e){fu(4,2,t,e)},useMemo:function(t,e){var a=ye();e=e===void 0?null:e;var i=t();if(Xa){an(!0);try{t()}finally{an(!1)}}return a.memoizedState=[i,e],i},useReducer:function(t,e,a){var i=ye();if(a!==void 0){var s=a(e);if(Xa){an(!0);try{a(e)}finally{an(!1)}}}else s=e;return i.memoizedState=i.baseState=s,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:s},i.queue=t,t=t.dispatch=Wv.bind(null,_t,t),[i.memoizedState,t]},useRef:function(t){var e=ye();return t={current:t},e.memoizedState=t},useState:function(t){t=Vr(t);var e=t.queue,a=Rh.bind(null,_t,e);return e.dispatch=a,[t.memoizedState,a]},useDebugValue:Zr,useDeferredValue:function(t,e){var a=ye();return Qr(a,t,e)},useTransition:function(){var t=Vr(!1);return t=zh.bind(null,_t,t.queue,!0,!1),ye().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,a){var i=_t,s=ye();if(Ct){if(a===void 0)throw Error(u(407));a=a()}else{if(a=e(),Gt===null)throw Error(u(349));(zt&127)!==0||ah(i,e,a)}s.memoizedState=a;var c={value:a,getSnapshot:e};return s.queue=c,xh(ih.bind(null,i,c,t),[t]),i.flags|=2048,Dl(9,{destroy:void 0},lh.bind(null,i,c,a,e),null),a},useId:function(){var t=ye(),e=Gt.identifierPrefix;if(Ct){var a=un,i=on;a=(i&~(1<<32-pe(i)-1)).toString(32)+a,e="_"+e+"R_"+a,a=uu++,0<a&&(e+="H"+a.toString(32)),e+="_"}else a=Qv++,e="_"+e+"r_"+a.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:kr,useFormState:gh,useActionState:gh,useOptimistic:function(t){var e=ye();e.memoizedState=e.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=a,e=Kr.bind(null,_t,!0,a),a.dispatch=e,[t,e]},useMemoCache:qr,useCacheRefresh:function(){return ye().memoizedState=Fv.bind(null,_t)},useEffectEvent:function(t){var e=ye(),a={impl:t};return e.memoizedState=a,function(){if((Ht&2)!==0)throw Error(u(440));return a.impl.apply(void 0,arguments)}}},Ir={readContext:ce,use:ru,useCallback:Nh,useContext:ce,useEffect:Xr,useImperativeHandle:wh,useInsertionEffect:bh,useLayoutEffect:_h,useMemo:Mh,useReducer:cu,useRef:vh,useState:function(){return cu(zn)},useDebugValue:Zr,useDeferredValue:function(t,e){var a=Ft();return Ah(a,Lt.memoizedState,t,e)},useTransition:function(){var t=cu(zn)[0],e=Ft().memoizedState;return[typeof t=="boolean"?t:zi(t),e]},useSyncExternalStore:nh,useId:Dh,useHostTransitionStatus:kr,useFormState:mh,useActionState:mh,useOptimistic:function(t,e){var a=Ft();return sh(a,Lt,t,e)},useMemoCache:qr,useCacheRefresh:Oh};Ir.useEffectEvent=Sh;var Bh={readContext:ce,use:ru,useCallback:Nh,useContext:ce,useEffect:Xr,useImperativeHandle:wh,useInsertionEffect:bh,useLayoutEffect:_h,useMemo:Mh,useReducer:Yr,useRef:vh,useState:function(){return Yr(zn)},useDebugValue:Zr,useDeferredValue:function(t,e){var a=Ft();return Lt===null?Qr(a,t,e):Ah(a,Lt.memoizedState,t,e)},useTransition:function(){var t=Yr(zn)[0],e=Ft().memoizedState;return[typeof t=="boolean"?t:zi(t),e]},useSyncExternalStore:nh,useId:Dh,useHostTransitionStatus:kr,useFormState:yh,useActionState:yh,useOptimistic:function(t,e){var a=Ft();return Lt!==null?sh(a,Lt,t,e):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:qr,useCacheRefresh:Oh};Bh.useEffectEvent=Sh;function Jr(t,e,a,i){e=t.memoizedState,a=a(i,e),a=a==null?e:y({},e,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var Fr={enqueueSetState:function(t,e,a){t=t._reactInternals;var i=He(),s=ea(i);s.payload=e,a!=null&&(s.callback=a),e=na(t,s,i),e!==null&&(Ne(e,t,i),wi(e,t,i))},enqueueReplaceState:function(t,e,a){t=t._reactInternals;var i=He(),s=ea(i);s.tag=1,s.payload=e,a!=null&&(s.callback=a),e=na(t,s,i),e!==null&&(Ne(e,t,i),wi(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var a=He(),i=ea(a);i.tag=2,e!=null&&(i.callback=e),e=na(t,i,a),e!==null&&(Ne(e,t,a),wi(e,t,a))}};function qh(t,e,a,i,s,c,p){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,c,p):e.prototype&&e.prototype.isPureReactComponent?!pi(a,i)||!pi(s,c):!0}function Lh(t,e,a,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(a,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(a,i),e.state!==t&&Fr.enqueueReplaceState(e,e.state,null)}function Za(t,e){var a=e;if("ref"in e){a={};for(var i in e)i!=="ref"&&(a[i]=e[i])}if(t=t.defaultProps){a===e&&(a=y({},a));for(var s in t)a[s]===void 0&&(a[s]=t[s])}return a}function Yh(t){Qo(t)}function Vh(t){console.error(t)}function Gh(t){Qo(t)}function gu(t,e){try{var a=t.onUncaughtError;a(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function Xh(t,e,a){try{var i=t.onCaughtError;i(a.value,{componentStack:a.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function Wr(t,e,a){return a=ea(a),a.tag=3,a.payload={element:null},a.callback=function(){gu(t,e)},a}function Zh(t){return t=ea(t),t.tag=3,t}function Qh(t,e,a,i){var s=a.type.getDerivedStateFromError;if(typeof s=="function"){var c=i.value;t.payload=function(){return s(c)},t.callback=function(){Xh(e,a,i)}}var p=a.stateNode;p!==null&&typeof p.componentDidCatch=="function"&&(t.callback=function(){Xh(e,a,i),typeof s!="function"&&(sa===null?sa=new Set([this]):sa.add(this));var b=i.stack;this.componentDidCatch(i.value,{componentStack:b!==null?b:""})})}function Pv(t,e,a,i,s){if(a.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=a.alternate,e!==null&&El(e,a,s,!0),a=Ce.current,a!==null){switch(a.tag){case 31:case 13:return Ge===null?Mu():a.alternate===null&&It===0&&(It=3),a.flags&=-257,a.flags|=65536,a.lanes=s,i===eu?a.flags|=16384:(e=a.updateQueue,e===null?a.updateQueue=new Set([i]):e.add(i),Ec(t,i,s)),!1;case 22:return a.flags|=65536,i===eu?a.flags|=16384:(e=a.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},a.updateQueue=e):(a=e.retryQueue,a===null?e.retryQueue=new Set([i]):a.add(i)),Ec(t,i,s)),!1}throw Error(u(435,a.tag))}return Ec(t,i,s),Mu(),!1}if(Ct)return e=Ce.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=s,i!==yr&&(t=Error(u(422),{cause:i}),xi(qe(t,a)))):(i!==yr&&(e=Error(u(423),{cause:i}),xi(qe(e,a))),t=t.current.alternate,t.flags|=65536,s&=-s,t.lanes|=s,i=qe(i,a),s=Wr(t.stateNode,i,s),zr(t,s),It!==4&&(It=2)),!1;var c=Error(u(520),{cause:i});if(c=qe(c,a),qi===null?qi=[c]:qi.push(c),It!==4&&(It=2),e===null)return!0;i=qe(i,a),a=e;do{switch(a.tag){case 3:return a.flags|=65536,t=s&-s,a.lanes|=t,t=Wr(a.stateNode,i,t),zr(a,t),!1;case 1:if(e=a.type,c=a.stateNode,(a.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(sa===null||!sa.has(c))))return a.flags|=65536,s&=-s,a.lanes|=s,s=Zh(s),Qh(s,t,a,i),zr(a,s),!1}a=a.return}while(a!==null);return!1}var Pr=Error(u(461)),ee=!1;function fe(t,e,a,i){e.child=t===null?Id(e,null,a,i):Ga(e,t.child,a,i)}function $h(t,e,a,i,s){a=a.render;var c=e.ref;if("ref"in i){var p={};for(var b in i)b!=="ref"&&(p[b]=i[b])}else p=i;return qa(e),i=Hr(t,e,a,p,c,s),b=jr(),t!==null&&!ee?(Ur(t,e,s),Tn(t,e,s)):(Ct&&b&&mr(e),e.flags|=1,fe(t,e,i,s),e.child)}function kh(t,e,a,i,s){if(t===null){var c=a.type;return typeof c=="function"&&!dr(c)&&c.defaultProps===void 0&&a.compare===null?(e.tag=15,e.type=c,Kh(t,e,c,i,s)):(t=Io(a.type,null,i,e,e.mode,s),t.ref=e.ref,t.return=e,e.child=t)}if(c=t.child,!uc(t,s)){var p=c.memoizedProps;if(a=a.compare,a=a!==null?a:pi,a(p,i)&&t.ref===e.ref)return Tn(t,e,s)}return e.flags|=1,t=En(c,i),t.ref=e.ref,t.return=e,e.child=t}function Kh(t,e,a,i,s){if(t!==null){var c=t.memoizedProps;if(pi(c,i)&&t.ref===e.ref)if(ee=!1,e.pendingProps=i=c,uc(t,s))(t.flags&131072)!==0&&(ee=!0);else return e.lanes=t.lanes,Tn(t,e,s)}return tc(t,e,a,i,s)}function Ih(t,e,a,i){var s=i.children,c=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((e.flags&128)!==0){if(c=c!==null?c.baseLanes|a:a,t!==null){for(i=e.child=t.child,s=0;i!==null;)s=s|i.lanes|i.childLanes,i=i.sibling;i=s&~c}else i=0,e.child=null;return Jh(t,e,c,a,i)}if((a&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Po(e,c!==null?c.cachePool:null),c!==null?Wd(e,c):Cr(),Pd(e);else return i=e.lanes=536870912,Jh(t,e,c!==null?c.baseLanes|a:a,a,i)}else c!==null?(Po(e,c.cachePool),Wd(e,c),la(),e.memoizedState=null):(t!==null&&Po(e,null),Cr(),la());return fe(t,e,s,a),e.child}function Di(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function Jh(t,e,a,i,s){var c=wr();return c=c===null?null:{parent:Pt._currentValue,pool:c},e.memoizedState={baseLanes:a,cachePool:c},t!==null&&Po(e,null),Cr(),Pd(e),t!==null&&El(t,e,i,!0),e.childLanes=s,null}function mu(t,e){return e=yu({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function Fh(t,e,a){return Ga(e,t.child,null,a),t=mu(e,e.pendingProps),t.flags|=2,De(e),e.memoizedState=null,t}function t1(t,e,a){var i=e.pendingProps,s=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(Ct){if(i.mode==="hidden")return t=mu(e,i),e.lanes=536870912,Di(null,t);if(Or(e),(t=Xt)?(t=rm(t,Ve),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Jn!==null?{id:on,overflow:un}:null,retryLane:536870912,hydrationErrors:null},a=Hd(t),a.return=e,e.child=a,re=e,Xt=null)):t=null,t===null)throw Wn(e);return e.lanes=536870912,null}return mu(e,i)}var c=t.memoizedState;if(c!==null){var p=c.dehydrated;if(Or(e),s)if(e.flags&256)e.flags&=-257,e=Fh(t,e,a);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(u(558));else if(ee||El(t,e,a,!1),s=(a&t.childLanes)!==0,ee||s){if(i=Gt,i!==null&&(p=Ao(i,a),p!==0&&p!==c.retryLane))throw c.retryLane=p,Ha(t,p),Ne(i,t,p),Pr;Mu(),e=Fh(t,e,a)}else t=c.treeContext,Xt=Xe(p.nextSibling),re=e,Ct=!0,Fn=null,Ve=!1,t!==null&&Bd(e,t),e=mu(e,i),e.flags|=4096;return e}return t=En(t.child,{mode:i.mode,children:i.children}),t.ref=e.ref,e.child=t,t.return=e,t}function pu(t,e){var a=e.ref;if(a===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(u(284));(t===null||t.ref!==a)&&(e.flags|=4194816)}}function tc(t,e,a,i,s){return qa(e),a=Hr(t,e,a,i,void 0,s),i=jr(),t!==null&&!ee?(Ur(t,e,s),Tn(t,e,s)):(Ct&&i&&mr(e),e.flags|=1,fe(t,e,a,s),e.child)}function Wh(t,e,a,i,s,c){return qa(e),e.updateQueue=null,a=eh(e,i,a,s),th(t),i=jr(),t!==null&&!ee?(Ur(t,e,c),Tn(t,e,c)):(Ct&&i&&mr(e),e.flags|=1,fe(t,e,a,c),e.child)}function Ph(t,e,a,i,s){if(qa(e),e.stateNode===null){var c=xl,p=a.contextType;typeof p=="object"&&p!==null&&(c=ce(p)),c=new a(i,c),e.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Fr,e.stateNode=c,c._reactInternals=e,c=e.stateNode,c.props=i,c.state=e.memoizedState,c.refs={},Mr(e),p=a.contextType,c.context=typeof p=="object"&&p!==null?ce(p):xl,c.state=e.memoizedState,p=a.getDerivedStateFromProps,typeof p=="function"&&(Jr(e,a,p,i),c.state=e.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(p=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),p!==c.state&&Fr.enqueueReplaceState(c,c.state,null),Mi(e,i,c,s),Ni(),c.state=e.memoizedState),typeof c.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(t===null){c=e.stateNode;var b=e.memoizedProps,O=Za(a,b);c.props=O;var Q=c.context,nt=a.contextType;p=xl,typeof nt=="object"&&nt!==null&&(p=ce(nt));var lt=a.getDerivedStateFromProps;nt=typeof lt=="function"||typeof c.getSnapshotBeforeUpdate=="function",b=e.pendingProps!==b,nt||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(b||Q!==p)&&Lh(e,c,i,p),ta=!1;var K=e.memoizedState;c.state=K,Mi(e,i,c,s),Ni(),Q=e.memoizedState,b||K!==Q||ta?(typeof lt=="function"&&(Jr(e,a,lt,i),Q=e.memoizedState),(O=ta||qh(e,a,O,i,K,Q,p))?(nt||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(e.flags|=4194308)):(typeof c.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=Q),c.props=i,c.state=Q,c.context=p,i=O):(typeof c.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{c=e.stateNode,Ar(t,e),p=e.memoizedProps,nt=Za(a,p),c.props=nt,lt=e.pendingProps,K=c.context,Q=a.contextType,O=xl,typeof Q=="object"&&Q!==null&&(O=ce(Q)),b=a.getDerivedStateFromProps,(Q=typeof b=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(p!==lt||K!==O)&&Lh(e,c,i,O),ta=!1,K=e.memoizedState,c.state=K,Mi(e,i,c,s),Ni();var F=e.memoizedState;p!==lt||K!==F||ta||t!==null&&t.dependencies!==null&&Fo(t.dependencies)?(typeof b=="function"&&(Jr(e,a,b,i),F=e.memoizedState),(nt=ta||qh(e,a,nt,i,K,F,O)||t!==null&&t.dependencies!==null&&Fo(t.dependencies))?(Q||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(i,F,O),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(i,F,O)),typeof c.componentDidUpdate=="function"&&(e.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof c.componentDidUpdate!="function"||p===t.memoizedProps&&K===t.memoizedState||(e.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||p===t.memoizedProps&&K===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=F),c.props=i,c.state=F,c.context=O,i=nt):(typeof c.componentDidUpdate!="function"||p===t.memoizedProps&&K===t.memoizedState||(e.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||p===t.memoizedProps&&K===t.memoizedState||(e.flags|=1024),i=!1)}return c=i,pu(t,e),i=(e.flags&128)!==0,c||i?(c=e.stateNode,a=i&&typeof a.getDerivedStateFromError!="function"?null:c.render(),e.flags|=1,t!==null&&i?(e.child=Ga(e,t.child,null,s),e.child=Ga(e,null,a,s)):fe(t,e,a,s),e.memoizedState=c.state,t=e.child):t=Tn(t,e,s),t}function tg(t,e,a,i){return Ua(),e.flags|=256,fe(t,e,a,i),e.child}var ec={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function nc(t){return{baseLanes:t,cachePool:Xd()}}function ac(t,e,a){return t=t!==null?t.childLanes&~a:0,e&&(t|=Re),t}function eg(t,e,a){var i=e.pendingProps,s=!1,c=(e.flags&128)!==0,p;if((p=c)||(p=t!==null&&t.memoizedState===null?!1:(Jt.current&2)!==0),p&&(s=!0,e.flags&=-129),p=(e.flags&32)!==0,e.flags&=-33,t===null){if(Ct){if(s?aa(e):la(),(t=Xt)?(t=rm(t,Ve),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Jn!==null?{id:on,overflow:un}:null,retryLane:536870912,hydrationErrors:null},a=Hd(t),a.return=e,e.child=a,re=e,Xt=null)):t=null,t===null)throw Wn(e);return Lc(t)?e.lanes=32:e.lanes=536870912,null}var b=i.children;return i=i.fallback,s?(la(),s=e.mode,b=yu({mode:"hidden",children:b},s),i=ja(i,s,a,null),b.return=e,i.return=e,b.sibling=i,e.child=b,i=e.child,i.memoizedState=nc(a),i.childLanes=ac(t,p,a),e.memoizedState=ec,Di(null,i)):(aa(e),lc(e,b))}var O=t.memoizedState;if(O!==null&&(b=O.dehydrated,b!==null)){if(c)e.flags&256?(aa(e),e.flags&=-257,e=ic(t,e,a)):e.memoizedState!==null?(la(),e.child=t.child,e.flags|=128,e=null):(la(),b=i.fallback,s=e.mode,i=yu({mode:"visible",children:i.children},s),b=ja(b,s,a,null),b.flags|=2,i.return=e,b.return=e,i.sibling=b,e.child=i,Ga(e,t.child,null,a),i=e.child,i.memoizedState=nc(a),i.childLanes=ac(t,p,a),e.memoizedState=ec,e=Di(null,i));else if(aa(e),Lc(b)){if(p=b.nextSibling&&b.nextSibling.dataset,p)var Q=p.dgst;p=Q,i=Error(u(419)),i.stack="",i.digest=p,xi({value:i,source:null,stack:null}),e=ic(t,e,a)}else if(ee||El(t,e,a,!1),p=(a&t.childLanes)!==0,ee||p){if(p=Gt,p!==null&&(i=Ao(p,a),i!==0&&i!==O.retryLane))throw O.retryLane=i,Ha(t,i),Ne(p,t,i),Pr;qc(b)||Mu(),e=ic(t,e,a)}else qc(b)?(e.flags|=192,e.child=t.child,e=null):(t=O.treeContext,Xt=Xe(b.nextSibling),re=e,Ct=!0,Fn=null,Ve=!1,t!==null&&Bd(e,t),e=lc(e,i.children),e.flags|=4096);return e}return s?(la(),b=i.fallback,s=e.mode,O=t.child,Q=O.sibling,i=En(O,{mode:"hidden",children:i.children}),i.subtreeFlags=O.subtreeFlags&65011712,Q!==null?b=En(Q,b):(b=ja(b,s,a,null),b.flags|=2),b.return=e,i.return=e,i.sibling=b,e.child=i,Di(null,i),i=e.child,b=t.child.memoizedState,b===null?b=nc(a):(s=b.cachePool,s!==null?(O=Pt._currentValue,s=s.parent!==O?{parent:O,pool:O}:s):s=Xd(),b={baseLanes:b.baseLanes|a,cachePool:s}),i.memoizedState=b,i.childLanes=ac(t,p,a),e.memoizedState=ec,Di(t.child,i)):(aa(e),a=t.child,t=a.sibling,a=En(a,{mode:"visible",children:i.children}),a.return=e,a.sibling=null,t!==null&&(p=e.deletions,p===null?(e.deletions=[t],e.flags|=16):p.push(t)),e.child=a,e.memoizedState=null,a)}function lc(t,e){return e=yu({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function yu(t,e){return t=Te(22,t,null,e),t.lanes=0,t}function ic(t,e,a){return Ga(e,t.child,null,a),t=lc(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function ng(t,e,a){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),Sr(t.return,e,a)}function oc(t,e,a,i,s,c){var p=t.memoizedState;p===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:a,tailMode:s,treeForkCount:c}:(p.isBackwards=e,p.rendering=null,p.renderingStartTime=0,p.last=i,p.tail=a,p.tailMode=s,p.treeForkCount=c)}function ag(t,e,a){var i=e.pendingProps,s=i.revealOrder,c=i.tail;i=i.children;var p=Jt.current,b=(p&2)!==0;if(b?(p=p&1|2,e.flags|=128):p&=1,W(Jt,p),fe(t,e,i,a),i=Ct?vi:0,!b&&t!==null&&(t.flags&128)!==0)t:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ng(t,a,e);else if(t.tag===19)ng(t,a,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;t.sibling===null;){if(t.return===null||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(s){case"forwards":for(a=e.child,s=null;a!==null;)t=a.alternate,t!==null&&iu(t)===null&&(s=a),a=a.sibling;a=s,a===null?(s=e.child,e.child=null):(s=a.sibling,a.sibling=null),oc(e,!1,s,a,c,i);break;case"backwards":case"unstable_legacy-backwards":for(a=null,s=e.child,e.child=null;s!==null;){if(t=s.alternate,t!==null&&iu(t)===null){e.child=s;break}t=s.sibling,s.sibling=a,a=s,s=t}oc(e,!0,a,null,c,i);break;case"together":oc(e,!1,null,null,void 0,i);break;default:e.memoizedState=null}return e.child}function Tn(t,e,a){if(t!==null&&(e.dependencies=t.dependencies),ua|=e.lanes,(a&e.childLanes)===0)if(t!==null){if(El(t,e,a,!1),(a&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(u(153));if(e.child!==null){for(t=e.child,a=En(t,t.pendingProps),e.child=a,a.return=e;t.sibling!==null;)t=t.sibling,a=a.sibling=En(t,t.pendingProps),a.return=e;a.sibling=null}return e.child}function uc(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&Fo(t)))}function e1(t,e,a){switch(e.tag){case 3:ut(e,e.stateNode.containerInfo),Pn(e,Pt,t.memoizedState.cache),Ua();break;case 27:case 5:Et(e);break;case 4:ut(e,e.stateNode.containerInfo);break;case 10:Pn(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,Or(e),null;break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(aa(e),e.flags|=128,null):(a&e.child.childLanes)!==0?eg(t,e,a):(aa(e),t=Tn(t,e,a),t!==null?t.sibling:null);aa(e);break;case 19:var s=(t.flags&128)!==0;if(i=(a&e.childLanes)!==0,i||(El(t,e,a,!1),i=(a&e.childLanes)!==0),s){if(i)return ag(t,e,a);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),W(Jt,Jt.current),i)break;return null;case 22:return e.lanes=0,Ih(t,e,a,e.pendingProps);case 24:Pn(e,Pt,t.memoizedState.cache)}return Tn(t,e,a)}function lg(t,e,a){if(t!==null)if(t.memoizedProps!==e.pendingProps)ee=!0;else{if(!uc(t,a)&&(e.flags&128)===0)return ee=!1,e1(t,e,a);ee=(t.flags&131072)!==0}else ee=!1,Ct&&(e.flags&1048576)!==0&&Ud(e,vi,e.index);switch(e.lanes=0,e.tag){case 16:t:{var i=e.pendingProps;if(t=Ya(e.elementType),e.type=t,typeof t=="function")dr(t)?(i=Za(t,i),e.tag=1,e=Ph(null,e,t,i,a)):(e.tag=0,e=tc(null,e,t,i,a));else{if(t!=null){var s=t.$$typeof;if(s===C){e.tag=11,e=$h(null,e,t,i,a);break t}else if(s===q){e.tag=14,e=kh(null,e,t,i,a);break t}}throw e=D(t)||t,Error(u(306,e,""))}}return e;case 0:return tc(t,e,e.type,e.pendingProps,a);case 1:return i=e.type,s=Za(i,e.pendingProps),Ph(t,e,i,s,a);case 3:t:{if(ut(e,e.stateNode.containerInfo),t===null)throw Error(u(387));i=e.pendingProps;var c=e.memoizedState;s=c.element,Ar(t,e),Mi(e,i,null,a);var p=e.memoizedState;if(i=p.cache,Pn(e,Pt,i),i!==c.cache&&br(e,[Pt],a,!0),Ni(),i=p.element,c.isDehydrated)if(c={element:i,isDehydrated:!1,cache:p.cache},e.updateQueue.baseState=c,e.memoizedState=c,e.flags&256){e=tg(t,e,i,a);break t}else if(i!==s){s=qe(Error(u(424)),e),xi(s),e=tg(t,e,i,a);break t}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Xt=Xe(t.firstChild),re=e,Ct=!0,Fn=null,Ve=!0,a=Id(e,null,i,a),e.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Ua(),i===s){e=Tn(t,e,a);break t}fe(t,e,i,a)}e=e.child}return e;case 26:return pu(t,e),t===null?(a=mm(e.type,null,e.pendingProps,null))?e.memoizedState=a:Ct||(a=e.type,t=e.pendingProps,i=Ru(ct.current).createElement(a),i[le]=e,i[he]=t,de(i,a,t),Wt(i),e.stateNode=i):e.memoizedState=mm(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Et(e),t===null&&Ct&&(i=e.stateNode=dm(e.type,e.pendingProps,ct.current),re=e,Ve=!0,s=Xt,da(e.type)?(Yc=s,Xt=Xe(i.firstChild)):Xt=s),fe(t,e,e.pendingProps.children,a),pu(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&Ct&&((s=i=Xt)&&(i=D1(i,e.type,e.pendingProps,Ve),i!==null?(e.stateNode=i,re=e,Xt=Xe(i.firstChild),Ve=!1,s=!0):s=!1),s||Wn(e)),Et(e),s=e.type,c=e.pendingProps,p=t!==null?t.memoizedProps:null,i=c.children,jc(s,c)?i=null:p!==null&&jc(s,p)&&(e.flags|=32),e.memoizedState!==null&&(s=Hr(t,e,$v,null,null,a),$i._currentValue=s),pu(t,e),fe(t,e,i,a),e.child;case 6:return t===null&&Ct&&((t=a=Xt)&&(a=O1(a,e.pendingProps,Ve),a!==null?(e.stateNode=a,re=e,Xt=null,t=!0):t=!1),t||Wn(e)),null;case 13:return eg(t,e,a);case 4:return ut(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=Ga(e,null,i,a):fe(t,e,i,a),e.child;case 11:return $h(t,e,e.type,e.pendingProps,a);case 7:return fe(t,e,e.pendingProps,a),e.child;case 8:return fe(t,e,e.pendingProps.children,a),e.child;case 12:return fe(t,e,e.pendingProps.children,a),e.child;case 10:return i=e.pendingProps,Pn(e,e.type,i.value),fe(t,e,i.children,a),e.child;case 9:return s=e.type._context,i=e.pendingProps.children,qa(e),s=ce(s),i=i(s),e.flags|=1,fe(t,e,i,a),e.child;case 14:return kh(t,e,e.type,e.pendingProps,a);case 15:return Kh(t,e,e.type,e.pendingProps,a);case 19:return ag(t,e,a);case 31:return t1(t,e,a);case 22:return Ih(t,e,a,e.pendingProps);case 24:return qa(e),i=ce(Pt),t===null?(s=wr(),s===null&&(s=Gt,c=_r(),s.pooledCache=c,c.refCount++,c!==null&&(s.pooledCacheLanes|=a),s=c),e.memoizedState={parent:i,cache:s},Mr(e),Pn(e,Pt,s)):((t.lanes&a)!==0&&(Ar(t,e),Mi(e,null,null,a),Ni()),s=t.memoizedState,c=e.memoizedState,s.parent!==i?(s={parent:i,cache:i},e.memoizedState=s,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=s),Pn(e,Pt,i)):(i=c.cache,Pn(e,Pt,i),i!==s.cache&&br(e,[Pt],a,!0))),fe(t,e,e.pendingProps.children,a),e.child;case 29:throw e.pendingProps}throw Error(u(156,e.tag))}function Cn(t){t.flags|=4}function sc(t,e,a,i,s){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(s&335544128)===s)if(t.stateNode.complete)t.flags|=8192;else if(Dg())t.flags|=8192;else throw Va=eu,Nr}else t.flags&=-16777217}function ig(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Sm(e))if(Dg())t.flags|=8192;else throw Va=eu,Nr}function vu(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?wo():536870912,t.lanes|=e,jl|=e)}function Oi(t,e){if(!Ct)switch(t.tailMode){case"hidden":e=t.tail;for(var a=null;e!==null;)e.alternate!==null&&(a=e),e=e.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Zt(t){var e=t.alternate!==null&&t.alternate.child===t.child,a=0,i=0;if(e)for(var s=t.child;s!==null;)a|=s.lanes|s.childLanes,i|=s.subtreeFlags&65011712,i|=s.flags&65011712,s.return=t,s=s.sibling;else for(s=t.child;s!==null;)a|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=t,s=s.sibling;return t.subtreeFlags|=i,t.childLanes=a,e}function n1(t,e,a){var i=e.pendingProps;switch(pr(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zt(e),null;case 1:return Zt(e),null;case 3:return a=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),Mn(Pt),ft(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(_l(e)?Cn(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,vr())),Zt(e),null;case 26:var s=e.type,c=e.memoizedState;return t===null?(Cn(e),c!==null?(Zt(e),ig(e,c)):(Zt(e),sc(e,s,null,i,a))):c?c!==t.memoizedState?(Cn(e),Zt(e),ig(e,c)):(Zt(e),e.flags&=-16777217):(t=t.memoizedProps,t!==i&&Cn(e),Zt(e),sc(e,s,t,i,a)),null;case 27:if(bt(e),a=ct.current,s=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&Cn(e);else{if(!i){if(e.stateNode===null)throw Error(u(166));return Zt(e),null}t=et.current,_l(e)?qd(e):(t=dm(s,i,a),e.stateNode=t,Cn(e))}return Zt(e),null;case 5:if(bt(e),s=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&Cn(e);else{if(!i){if(e.stateNode===null)throw Error(u(166));return Zt(e),null}if(c=et.current,_l(e))qd(e);else{var p=Ru(ct.current);switch(c){case 1:c=p.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:c=p.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":c=p.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":c=p.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":c=p.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof i.is=="string"?p.createElement("select",{is:i.is}):p.createElement("select"),i.multiple?c.multiple=!0:i.size&&(c.size=i.size);break;default:c=typeof i.is=="string"?p.createElement(s,{is:i.is}):p.createElement(s)}}c[le]=e,c[he]=i;t:for(p=e.child;p!==null;){if(p.tag===5||p.tag===6)c.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break t;for(;p.sibling===null;){if(p.return===null||p.return===e)break t;p=p.return}p.sibling.return=p.return,p=p.sibling}e.stateNode=c;t:switch(de(c,s,i),s){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break t;case"img":i=!0;break t;default:i=!1}i&&Cn(e)}}return Zt(e),sc(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,a),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&Cn(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(u(166));if(t=ct.current,_l(e)){if(t=e.stateNode,a=e.memoizedProps,i=null,s=re,s!==null)switch(s.tag){case 27:case 5:i=s.memoizedProps}t[le]=e,t=!!(t.nodeValue===a||i!==null&&i.suppressHydrationWarning===!0||em(t.nodeValue,a)),t||Wn(e,!0)}else t=Ru(t).createTextNode(i),t[le]=e,e.stateNode=t}return Zt(e),null;case 31:if(a=e.memoizedState,t===null||t.memoizedState!==null){if(i=_l(e),a!==null){if(t===null){if(!i)throw Error(u(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(u(557));t[le]=e}else Ua(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Zt(e),t=!1}else a=vr(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return e.flags&256?(De(e),e):(De(e),null);if((e.flags&128)!==0)throw Error(u(558))}return Zt(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(s=_l(e),i!==null&&i.dehydrated!==null){if(t===null){if(!s)throw Error(u(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(u(317));s[le]=e}else Ua(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Zt(e),s=!1}else s=vr(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),s=!0;if(!s)return e.flags&256?(De(e),e):(De(e),null)}return De(e),(e.flags&128)!==0?(e.lanes=a,e):(a=i!==null,t=t!==null&&t.memoizedState!==null,a&&(i=e.child,s=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(s=i.alternate.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==s&&(i.flags|=2048)),a!==t&&a&&(e.child.flags|=8192),vu(e,e.updateQueue),Zt(e),null);case 4:return ft(),t===null&&Cc(e.stateNode.containerInfo),Zt(e),null;case 10:return Mn(e.type),Zt(e),null;case 19:if(H(Jt),i=e.memoizedState,i===null)return Zt(e),null;if(s=(e.flags&128)!==0,c=i.rendering,c===null)if(s)Oi(i,!1);else{if(It!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(c=iu(t),c!==null){for(e.flags|=128,Oi(i,!1),t=c.updateQueue,e.updateQueue=t,vu(e,t),e.subtreeFlags=0,t=a,a=e.child;a!==null;)Rd(a,t),a=a.sibling;return W(Jt,Jt.current&1|2),Ct&&wn(e,i.treeForkCount),e.child}t=t.sibling}i.tail!==null&&se()>Eu&&(e.flags|=128,s=!0,Oi(i,!1),e.lanes=4194304)}else{if(!s)if(t=iu(c),t!==null){if(e.flags|=128,s=!0,t=t.updateQueue,e.updateQueue=t,vu(e,t),Oi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!c.alternate&&!Ct)return Zt(e),null}else 2*se()-i.renderingStartTime>Eu&&a!==536870912&&(e.flags|=128,s=!0,Oi(i,!1),e.lanes=4194304);i.isBackwards?(c.sibling=e.child,e.child=c):(t=i.last,t!==null?t.sibling=c:e.child=c,i.last=c)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=se(),t.sibling=null,a=Jt.current,W(Jt,s?a&1|2:a&1),Ct&&wn(e,i.treeForkCount),t):(Zt(e),null);case 22:case 23:return De(e),Dr(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(a&536870912)!==0&&(e.flags&128)===0&&(Zt(e),e.subtreeFlags&6&&(e.flags|=8192)):Zt(e),a=e.updateQueue,a!==null&&vu(e,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==a&&(e.flags|=2048),t!==null&&H(La),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),e.memoizedState.cache!==a&&(e.flags|=2048),Mn(Pt),Zt(e),null;case 25:return null;case 30:return null}throw Error(u(156,e.tag))}function a1(t,e){switch(pr(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Mn(Pt),ft(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return bt(e),null;case 31:if(e.memoizedState!==null){if(De(e),e.alternate===null)throw Error(u(340));Ua()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(De(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(u(340));Ua()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return H(Jt),null;case 4:return ft(),null;case 10:return Mn(e.type),null;case 22:case 23:return De(e),Dr(),t!==null&&H(La),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Mn(Pt),null;case 25:return null;default:return null}}function og(t,e){switch(pr(e),e.tag){case 3:Mn(Pt),ft();break;case 26:case 27:case 5:bt(e);break;case 4:ft();break;case 31:e.memoizedState!==null&&De(e);break;case 13:De(e);break;case 19:H(Jt);break;case 10:Mn(e.type);break;case 22:case 23:De(e),Dr(),t!==null&&H(La);break;case 24:Mn(Pt)}}function Ri(t,e){try{var a=e.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var s=i.next;a=s;do{if((a.tag&t)===t){i=void 0;var c=a.create,p=a.inst;i=c(),p.destroy=i}a=a.next}while(a!==s)}}catch(b){Bt(e,e.return,b)}}function ia(t,e,a){try{var i=e.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var c=s.next;i=c;do{if((i.tag&t)===t){var p=i.inst,b=p.destroy;if(b!==void 0){p.destroy=void 0,s=e;var O=a,Q=b;try{Q()}catch(nt){Bt(s,O,nt)}}}i=i.next}while(i!==c)}}catch(nt){Bt(e,e.return,nt)}}function ug(t){var e=t.updateQueue;if(e!==null){var a=t.stateNode;try{Fd(e,a)}catch(i){Bt(t,t.return,i)}}}function sg(t,e,a){a.props=Za(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(i){Bt(t,e,i)}}function Hi(t,e){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof a=="function"?t.refCleanup=a(i):a.current=i}}catch(s){Bt(t,e,s)}}function sn(t,e){var a=t.ref,i=t.refCleanup;if(a!==null)if(typeof i=="function")try{i()}catch(s){Bt(t,e,s)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(s){Bt(t,e,s)}else a.current=null}function rg(t){var e=t.type,a=t.memoizedProps,i=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":a.autoFocus&&i.focus();break t;case"img":a.src?i.src=a.src:a.srcSet&&(i.srcset=a.srcSet)}}catch(s){Bt(t,t.return,s)}}function rc(t,e,a){try{var i=t.stateNode;N1(i,t.type,a,e),i[he]=e}catch(s){Bt(t,t.return,s)}}function cg(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&da(t.type)||t.tag===4}function cc(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||cg(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&&da(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function fc(t,e,a){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,e):(e=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,e.appendChild(t),a=a._reactRootContainer,a!=null||e.onclick!==null||(e.onclick=bn));else if(i!==4&&(i===27&&da(t.type)&&(a=t.stateNode,e=null),t=t.child,t!==null))for(fc(t,e,a),t=t.sibling;t!==null;)fc(t,e,a),t=t.sibling}function xu(t,e,a){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?a.insertBefore(t,e):a.appendChild(t);else if(i!==4&&(i===27&&da(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(xu(t,e,a),t=t.sibling;t!==null;)xu(t,e,a),t=t.sibling}function fg(t){var e=t.stateNode,a=t.memoizedProps;try{for(var i=t.type,s=e.attributes;s.length;)e.removeAttributeNode(s[0]);de(e,i,a),e[le]=t,e[he]=a}catch(c){Bt(t,t.return,c)}}var Dn=!1,ne=!1,dc=!1,dg=typeof WeakSet=="function"?WeakSet:Set,ue=null;function l1(t,e){if(t=t.containerInfo,Rc=Yu,t=wd(t),ir(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else t:{a=(a=t.ownerDocument)&&a.defaultView||window;var i=a.getSelection&&a.getSelection();if(i&&i.rangeCount!==0){a=i.anchorNode;var s=i.anchorOffset,c=i.focusNode;i=i.focusOffset;try{a.nodeType,c.nodeType}catch{a=null;break t}var p=0,b=-1,O=-1,Q=0,nt=0,lt=t,K=null;e:for(;;){for(var F;lt!==a||s!==0&<.nodeType!==3||(b=p+s),lt!==c||i!==0&<.nodeType!==3||(O=p+i),lt.nodeType===3&&(p+=lt.nodeValue.length),(F=lt.firstChild)!==null;)K=lt,lt=F;for(;;){if(lt===t)break e;if(K===a&&++Q===s&&(b=p),K===c&&++nt===i&&(O=p),(F=lt.nextSibling)!==null)break;lt=K,K=lt.parentNode}lt=F}a=b===-1||O===-1?null:{start:b,end:O}}else a=null}a=a||{start:0,end:0}}else a=null;for(Hc={focusedElem:t,selectionRange:a},Yu=!1,ue=e;ue!==null;)if(e=ue,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ue=t;else for(;ue!==null;){switch(e=ue,c=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)s=t[a],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&c!==null){t=void 0,a=e,s=c.memoizedProps,c=c.memoizedState,i=a.stateNode;try{var dt=Za(a.type,s);t=i.getSnapshotBeforeUpdate(dt,c),i.__reactInternalSnapshotBeforeUpdate=t}catch(vt){Bt(a,a.return,vt)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,a=t.nodeType,a===9)Bc(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Bc(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(u(163))}if(t=e.sibling,t!==null){t.return=e.return,ue=t;break}ue=e.return}}function hg(t,e,a){var i=a.flags;switch(a.tag){case 0:case 11:case 15:Rn(t,a),i&4&&Ri(5,a);break;case 1:if(Rn(t,a),i&4)if(t=a.stateNode,e===null)try{t.componentDidMount()}catch(p){Bt(a,a.return,p)}else{var s=Za(a.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(s,e,t.__reactInternalSnapshotBeforeUpdate)}catch(p){Bt(a,a.return,p)}}i&64&&ug(a),i&512&&Hi(a,a.return);break;case 3:if(Rn(t,a),i&64&&(t=a.updateQueue,t!==null)){if(e=null,a.child!==null)switch(a.child.tag){case 27:case 5:e=a.child.stateNode;break;case 1:e=a.child.stateNode}try{Fd(t,e)}catch(p){Bt(a,a.return,p)}}break;case 27:e===null&&i&4&&fg(a);case 26:case 5:Rn(t,a),e===null&&i&4&&rg(a),i&512&&Hi(a,a.return);break;case 12:Rn(t,a);break;case 31:Rn(t,a),i&4&&pg(t,a);break;case 13:Rn(t,a),i&4&&yg(t,a),i&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=h1.bind(null,a),R1(t,a))));break;case 22:if(i=a.memoizedState!==null||Dn,!i){e=e!==null&&e.memoizedState!==null||ne,s=Dn;var c=ne;Dn=i,(ne=e)&&!c?Hn(t,a,(a.subtreeFlags&8772)!==0):Rn(t,a),Dn=s,ne=c}break;case 30:break;default:Rn(t,a)}}function gg(t){var e=t.alternate;e!==null&&(t.alternate=null,gg(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&oi(e)),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 Qt=null,be=!1;function On(t,e,a){for(a=a.child;a!==null;)mg(t,e,a),a=a.sibling}function mg(t,e,a){if(me&&typeof me.onCommitFiberUnmount=="function")try{me.onCommitFiberUnmount(Na,a)}catch{}switch(a.tag){case 26:ne||sn(a,e),On(t,e,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ne||sn(a,e);var i=Qt,s=be;da(a.type)&&(Qt=a.stateNode,be=!1),On(t,e,a),Xi(a.stateNode),Qt=i,be=s;break;case 5:ne||sn(a,e);case 6:if(i=Qt,s=be,Qt=null,On(t,e,a),Qt=i,be=s,Qt!==null)if(be)try{(Qt.nodeType===9?Qt.body:Qt.nodeName==="HTML"?Qt.ownerDocument.body:Qt).removeChild(a.stateNode)}catch(c){Bt(a,e,c)}else try{Qt.removeChild(a.stateNode)}catch(c){Bt(a,e,c)}break;case 18:Qt!==null&&(be?(t=Qt,um(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),Xl(t)):um(Qt,a.stateNode));break;case 4:i=Qt,s=be,Qt=a.stateNode.containerInfo,be=!0,On(t,e,a),Qt=i,be=s;break;case 0:case 11:case 14:case 15:ia(2,a,e),ne||ia(4,a,e),On(t,e,a);break;case 1:ne||(sn(a,e),i=a.stateNode,typeof i.componentWillUnmount=="function"&&sg(a,e,i)),On(t,e,a);break;case 21:On(t,e,a);break;case 22:ne=(i=ne)||a.memoizedState!==null,On(t,e,a),ne=i;break;default:On(t,e,a)}}function pg(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Xl(t)}catch(a){Bt(e,e.return,a)}}}function yg(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Xl(t)}catch(a){Bt(e,e.return,a)}}function i1(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new dg),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new dg),e;default:throw Error(u(435,t.tag))}}function Su(t,e){var a=i1(t);e.forEach(function(i){if(!a.has(i)){a.add(i);var s=g1.bind(null,t,i);i.then(s,s)}})}function _e(t,e){var a=e.deletions;if(a!==null)for(var i=0;i<a.length;i++){var s=a[i],c=t,p=e,b=p;t:for(;b!==null;){switch(b.tag){case 27:if(da(b.type)){Qt=b.stateNode,be=!1;break t}break;case 5:Qt=b.stateNode,be=!1;break t;case 3:case 4:Qt=b.stateNode.containerInfo,be=!0;break t}b=b.return}if(Qt===null)throw Error(u(160));mg(c,p,s),Qt=null,be=!1,c=s.alternate,c!==null&&(c.return=null),s.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)vg(e,t),e=e.sibling}var Ie=null;function vg(t,e){var a=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:_e(e,t),Ee(t),i&4&&(ia(3,t,t.return),Ri(3,t),ia(5,t,t.return));break;case 1:_e(e,t),Ee(t),i&512&&(ne||a===null||sn(a,a.return)),i&64&&Dn&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?i:a.concat(i))));break;case 26:var s=Ie;if(_e(e,t),Ee(t),i&512&&(ne||a===null||sn(a,a.return)),i&4){var c=a!==null?a.memoizedState:null;if(i=t.memoizedState,a===null)if(i===null)if(t.stateNode===null){t:{i=t.type,a=t.memoizedProps,s=s.ownerDocument||s;e:switch(i){case"title":c=s.getElementsByTagName("title")[0],(!c||c[za]||c[le]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=s.createElement(i),s.head.insertBefore(c,s.querySelector("head > title"))),de(c,i,a),c[le]=t,Wt(c),i=c;break t;case"link":var p=vm("link","href",s).get(i+(a.href||""));if(p){for(var b=0;b<p.length;b++)if(c=p[b],c.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&c.getAttribute("rel")===(a.rel==null?null:a.rel)&&c.getAttribute("title")===(a.title==null?null:a.title)&&c.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){p.splice(b,1);break e}}c=s.createElement(i),de(c,i,a),s.head.appendChild(c);break;case"meta":if(p=vm("meta","content",s).get(i+(a.content||""))){for(b=0;b<p.length;b++)if(c=p[b],c.getAttribute("content")===(a.content==null?null:""+a.content)&&c.getAttribute("name")===(a.name==null?null:a.name)&&c.getAttribute("property")===(a.property==null?null:a.property)&&c.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&c.getAttribute("charset")===(a.charSet==null?null:a.charSet)){p.splice(b,1);break e}}c=s.createElement(i),de(c,i,a),s.head.appendChild(c);break;default:throw Error(u(468,i))}c[le]=t,Wt(c),i=c}t.stateNode=i}else xm(s,t.type,t.stateNode);else t.stateNode=ym(s,i,t.memoizedProps);else c!==i?(c===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):c.count--,i===null?xm(s,t.type,t.stateNode):ym(s,i,t.memoizedProps)):i===null&&t.stateNode!==null&&rc(t,t.memoizedProps,a.memoizedProps)}break;case 27:_e(e,t),Ee(t),i&512&&(ne||a===null||sn(a,a.return)),a!==null&&i&4&&rc(t,t.memoizedProps,a.memoizedProps);break;case 5:if(_e(e,t),Ee(t),i&512&&(ne||a===null||sn(a,a.return)),t.flags&32){s=t.stateNode;try{dl(s,"")}catch(dt){Bt(t,t.return,dt)}}i&4&&t.stateNode!=null&&(s=t.memoizedProps,rc(t,s,a!==null?a.memoizedProps:s)),i&1024&&(dc=!0);break;case 6:if(_e(e,t),Ee(t),i&4){if(t.stateNode===null)throw Error(u(162));i=t.memoizedProps,a=t.stateNode;try{a.nodeValue=i}catch(dt){Bt(t,t.return,dt)}}break;case 3:if(Uu=null,s=Ie,Ie=Hu(e.containerInfo),_e(e,t),Ie=s,Ee(t),i&4&&a!==null&&a.memoizedState.isDehydrated)try{Xl(e.containerInfo)}catch(dt){Bt(t,t.return,dt)}dc&&(dc=!1,xg(t));break;case 4:i=Ie,Ie=Hu(t.stateNode.containerInfo),_e(e,t),Ee(t),Ie=i;break;case 12:_e(e,t),Ee(t);break;case 31:_e(e,t),Ee(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Su(t,i)));break;case 13:_e(e,t),Ee(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(_u=se()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Su(t,i)));break;case 22:s=t.memoizedState!==null;var O=a!==null&&a.memoizedState!==null,Q=Dn,nt=ne;if(Dn=Q||s,ne=nt||O,_e(e,t),ne=nt,Dn=Q,Ee(t),i&8192)t:for(e=t.stateNode,e._visibility=s?e._visibility&-2:e._visibility|1,s&&(a===null||O||Dn||ne||Qa(t)),a=null,e=t;;){if(e.tag===5||e.tag===26){if(a===null){O=a=e;try{if(c=O.stateNode,s)p=c.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none";else{b=O.stateNode;var lt=O.memoizedProps.style,K=lt!=null&<.hasOwnProperty("display")?lt.display:null;b.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(dt){Bt(O,O.return,dt)}}}else if(e.tag===6){if(a===null){O=e;try{O.stateNode.nodeValue=s?"":O.memoizedProps}catch(dt){Bt(O,O.return,dt)}}}else if(e.tag===18){if(a===null){O=e;try{var F=O.stateNode;s?sm(F,!0):sm(O.stateNode,!1)}catch(dt){Bt(O,O.return,dt)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;e.sibling===null;){if(e.return===null||e.return===t)break t;a===e&&(a=null),e=e.return}a===e&&(a=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=t.updateQueue,i!==null&&(a=i.retryQueue,a!==null&&(i.retryQueue=null,Su(t,a))));break;case 19:_e(e,t),Ee(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Su(t,i)));break;case 30:break;case 21:break;default:_e(e,t),Ee(t)}}function Ee(t){var e=t.flags;if(e&2){try{for(var a,i=t.return;i!==null;){if(cg(i)){a=i;break}i=i.return}if(a==null)throw Error(u(160));switch(a.tag){case 27:var s=a.stateNode,c=cc(t);xu(t,c,s);break;case 5:var p=a.stateNode;a.flags&32&&(dl(p,""),a.flags&=-33);var b=cc(t);xu(t,b,p);break;case 3:case 4:var O=a.stateNode.containerInfo,Q=cc(t);fc(t,Q,O);break;default:throw Error(u(161))}}catch(nt){Bt(t,t.return,nt)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function xg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;xg(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function Rn(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)hg(t,e.alternate,e),e=e.sibling}function Qa(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:ia(4,e,e.return),Qa(e);break;case 1:sn(e,e.return);var a=e.stateNode;typeof a.componentWillUnmount=="function"&&sg(e,e.return,a),Qa(e);break;case 27:Xi(e.stateNode);case 26:case 5:sn(e,e.return),Qa(e);break;case 22:e.memoizedState===null&&Qa(e);break;case 30:Qa(e);break;default:Qa(e)}t=t.sibling}}function Hn(t,e,a){for(a=a&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,s=t,c=e,p=c.flags;switch(c.tag){case 0:case 11:case 15:Hn(s,c,a),Ri(4,c);break;case 1:if(Hn(s,c,a),i=c,s=i.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(Q){Bt(i,i.return,Q)}if(i=c,s=i.updateQueue,s!==null){var b=i.stateNode;try{var O=s.shared.hiddenCallbacks;if(O!==null)for(s.shared.hiddenCallbacks=null,s=0;s<O.length;s++)Jd(O[s],b)}catch(Q){Bt(i,i.return,Q)}}a&&p&64&&ug(c),Hi(c,c.return);break;case 27:fg(c);case 26:case 5:Hn(s,c,a),a&&i===null&&p&4&&rg(c),Hi(c,c.return);break;case 12:Hn(s,c,a);break;case 31:Hn(s,c,a),a&&p&4&&pg(s,c);break;case 13:Hn(s,c,a),a&&p&4&&yg(s,c);break;case 22:c.memoizedState===null&&Hn(s,c,a),Hi(c,c.return);break;case 30:break;default:Hn(s,c,a)}e=e.sibling}}function hc(t,e){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&Si(a))}function gc(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Si(t))}function Je(t,e,a,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Sg(t,e,a,i),e=e.sibling}function Sg(t,e,a,i){var s=e.flags;switch(e.tag){case 0:case 11:case 15:Je(t,e,a,i),s&2048&&Ri(9,e);break;case 1:Je(t,e,a,i);break;case 3:Je(t,e,a,i),s&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Si(t)));break;case 12:if(s&2048){Je(t,e,a,i),t=e.stateNode;try{var c=e.memoizedProps,p=c.id,b=c.onPostCommit;typeof b=="function"&&b(p,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(O){Bt(e,e.return,O)}}else Je(t,e,a,i);break;case 31:Je(t,e,a,i);break;case 13:Je(t,e,a,i);break;case 23:break;case 22:c=e.stateNode,p=e.alternate,e.memoizedState!==null?c._visibility&2?Je(t,e,a,i):ji(t,e):c._visibility&2?Je(t,e,a,i):(c._visibility|=2,Ol(t,e,a,i,(e.subtreeFlags&10256)!==0||!1)),s&2048&&hc(p,e);break;case 24:Je(t,e,a,i),s&2048&&gc(e.alternate,e);break;default:Je(t,e,a,i)}}function Ol(t,e,a,i,s){for(s=s&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var c=t,p=e,b=a,O=i,Q=p.flags;switch(p.tag){case 0:case 11:case 15:Ol(c,p,b,O,s),Ri(8,p);break;case 23:break;case 22:var nt=p.stateNode;p.memoizedState!==null?nt._visibility&2?Ol(c,p,b,O,s):ji(c,p):(nt._visibility|=2,Ol(c,p,b,O,s)),s&&Q&2048&&hc(p.alternate,p);break;case 24:Ol(c,p,b,O,s),s&&Q&2048&&gc(p.alternate,p);break;default:Ol(c,p,b,O,s)}e=e.sibling}}function ji(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var a=t,i=e,s=i.flags;switch(i.tag){case 22:ji(a,i),s&2048&&hc(i.alternate,i);break;case 24:ji(a,i),s&2048&&gc(i.alternate,i);break;default:ji(a,i)}e=e.sibling}}var Ui=8192;function Rl(t,e,a){if(t.subtreeFlags&Ui)for(t=t.child;t!==null;)bg(t,e,a),t=t.sibling}function bg(t,e,a){switch(t.tag){case 26:Rl(t,e,a),t.flags&Ui&&t.memoizedState!==null&&Q1(a,Ie,t.memoizedState,t.memoizedProps);break;case 5:Rl(t,e,a);break;case 3:case 4:var i=Ie;Ie=Hu(t.stateNode.containerInfo),Rl(t,e,a),Ie=i;break;case 22:t.memoizedState===null&&(i=t.alternate,i!==null&&i.memoizedState!==null?(i=Ui,Ui=16777216,Rl(t,e,a),Ui=i):Rl(t,e,a));break;default:Rl(t,e,a)}}function _g(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function Bi(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var a=0;a<e.length;a++){var i=e[a];ue=i,wg(i,t)}_g(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Eg(t),t=t.sibling}function Eg(t){switch(t.tag){case 0:case 11:case 15:Bi(t),t.flags&2048&&ia(9,t,t.return);break;case 3:Bi(t);break;case 12:Bi(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,bu(t)):Bi(t);break;default:Bi(t)}}function bu(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var a=0;a<e.length;a++){var i=e[a];ue=i,wg(i,t)}_g(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:ia(8,e,e.return),bu(e);break;case 22:a=e.stateNode,a._visibility&2&&(a._visibility&=-3,bu(e));break;default:bu(e)}t=t.sibling}}function wg(t,e){for(;ue!==null;){var a=ue;switch(a.tag){case 0:case 11:case 15:ia(8,a,e);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var i=a.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Si(a.memoizedState.cache)}if(i=a.child,i!==null)i.return=a,ue=i;else t:for(a=t;ue!==null;){i=ue;var s=i.sibling,c=i.return;if(gg(i),i===a){ue=null;break t}if(s!==null){s.return=c,ue=s;break t}ue=c}}}var o1={getCacheForType:function(t){var e=ce(Pt),a=e.data.get(t);return a===void 0&&(a=t(),e.data.set(t,a)),a},cacheSignal:function(){return ce(Pt).controller.signal}},u1=typeof WeakMap=="function"?WeakMap:Map,Ht=0,Gt=null,Nt=null,zt=0,Ut=0,Oe=null,oa=!1,Hl=!1,mc=!1,jn=0,It=0,ua=0,$a=0,pc=0,Re=0,jl=0,qi=null,we=null,yc=!1,_u=0,Ng=0,Eu=1/0,wu=null,sa=null,ie=0,ra=null,Ul=null,Un=0,vc=0,xc=null,Mg=null,Li=0,Sc=null;function He(){return(Ht&2)!==0&&zt!==0?zt&-zt:N.T!==null?Mc():zo()}function Ag(){if(Re===0)if((zt&536870912)===0||Ct){var t=il;il<<=1,(il&3932160)===0&&(il=262144),Re=t}else Re=536870912;return t=Ce.current,t!==null&&(t.flags|=32),Re}function Ne(t,e,a){(t===Gt&&(Ut===2||Ut===9)||t.cancelPendingCommit!==null)&&(Bl(t,0),ca(t,zt,Re,!1)),Aa(t,a),((Ht&2)===0||t!==Gt)&&(t===Gt&&((Ht&2)===0&&($a|=a),It===4&&ca(t,zt,Re,!1)),rn(t))}function zg(t,e,a){if((Ht&6)!==0)throw Error(u(327));var i=!a&&(e&127)===0&&(e&t.expiredLanes)===0||Ma(t,e),s=i?c1(t,e):_c(t,e,!0),c=i;do{if(s===0){Hl&&!i&&ca(t,e,0,!1);break}else{if(a=t.current.alternate,c&&!s1(a)){s=_c(t,e,!1),c=!1;continue}if(s===2){if(c=e,t.errorRecoveryDisabledLanes&c)var p=0;else p=t.pendingLanes&-536870913,p=p!==0?p:p&536870912?536870912:0;if(p!==0){e=p;t:{var b=t;s=qi;var O=b.current.memoizedState.isDehydrated;if(O&&(Bl(b,p).flags|=256),p=_c(b,p,!1),p!==2){if(mc&&!O){b.errorRecoveryDisabledLanes|=c,$a|=c,s=4;break t}c=we,we=s,c!==null&&(we===null?we=c:we.push.apply(we,c))}s=p}if(c=!1,s!==2)continue}}if(s===1){Bl(t,0),ca(t,e,0,!0);break}t:{switch(i=t,c=s,c){case 0:case 1:throw Error(u(345));case 4:if((e&4194048)!==e)break;case 6:ca(i,e,Re,!oa);break t;case 2:we=null;break;case 3:case 5:break;default:throw Error(u(329))}if((e&62914560)===e&&(s=_u+300-se(),10<s)){if(ca(i,e,Re,!oa),ul(i,0,!0)!==0)break t;Un=e,i.timeoutHandle=im(Tg.bind(null,i,a,we,wu,yc,e,Re,$a,jl,oa,c,"Throttled",-0,0),s);break t}Tg(i,a,we,wu,yc,e,Re,$a,jl,oa,c,null,-0,0)}}break}while(!0);rn(t)}function Tg(t,e,a,i,s,c,p,b,O,Q,nt,lt,K,F){if(t.timeoutHandle=-1,lt=e.subtreeFlags,lt&8192||(lt&16785408)===16785408){lt={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:bn},bg(e,c,lt);var dt=(c&62914560)===c?_u-se():(c&4194048)===c?Ng-se():0;if(dt=$1(lt,dt),dt!==null){Un=c,t.cancelPendingCommit=dt(Bg.bind(null,t,e,c,a,i,s,p,b,O,nt,lt,null,K,F)),ca(t,c,p,!Q);return}}Bg(t,e,c,a,i,s,p,b,O)}function s1(t){for(var e=t;;){var a=e.tag;if((a===0||a===11||a===15)&&e.flags&16384&&(a=e.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var i=0;i<a.length;i++){var s=a[i],c=s.getSnapshot;s=s.value;try{if(!ze(c(),s))return!1}catch{return!1}}if(a=e.child,e.subtreeFlags&16384&&a!==null)a.return=e,e=a;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function ca(t,e,a,i){e&=~pc,e&=~$a,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var s=e;0<s;){var c=31-pe(s),p=1<<c;i[c]=-1,s&=~p}a!==0&&No(t,a,e)}function Nu(){return(Ht&6)===0?(Yi(0),!1):!0}function bc(){if(Nt!==null){if(Ut===0)var t=Nt.return;else t=Nt,Nn=Ba=null,Br(t),Al=null,_i=0,t=Nt;for(;t!==null;)og(t.alternate,t),t=t.return;Nt=null}}function Bl(t,e){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,z1(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Un=0,bc(),Gt=t,Nt=a=En(t.current,null),zt=e,Ut=0,Oe=null,oa=!1,Hl=Ma(t,e),mc=!1,jl=Re=pc=$a=ua=It=0,we=qi=null,yc=!1,(e&8)!==0&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var s=31-pe(i),c=1<<s;e|=t[s],i&=~c}return jn=e,$o(),a}function Cg(t,e){_t=null,N.H=Ci,e===Ml||e===tu?(e=$d(),Ut=3):e===Nr?(e=$d(),Ut=4):Ut=e===Pr?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,Oe=e,Nt===null&&(It=1,gu(t,qe(e,t.current)))}function Dg(){var t=Ce.current;return t===null?!0:(zt&4194048)===zt?Ge===null:(zt&62914560)===zt||(zt&536870912)!==0?t===Ge:!1}function Og(){var t=N.H;return N.H=Ci,t===null?Ci:t}function Rg(){var t=N.A;return N.A=o1,t}function Mu(){It=4,oa||(zt&4194048)!==zt&&Ce.current!==null||(Hl=!0),(ua&134217727)===0&&($a&134217727)===0||Gt===null||ca(Gt,zt,Re,!1)}function _c(t,e,a){var i=Ht;Ht|=2;var s=Og(),c=Rg();(Gt!==t||zt!==e)&&(wu=null,Bl(t,e)),e=!1;var p=It;t:do try{if(Ut!==0&&Nt!==null){var b=Nt,O=Oe;switch(Ut){case 8:bc(),p=6;break t;case 3:case 2:case 9:case 6:Ce.current===null&&(e=!0);var Q=Ut;if(Ut=0,Oe=null,ql(t,b,O,Q),a&&Hl){p=0;break t}break;default:Q=Ut,Ut=0,Oe=null,ql(t,b,O,Q)}}r1(),p=It;break}catch(nt){Cg(t,nt)}while(!0);return e&&t.shellSuspendCounter++,Nn=Ba=null,Ht=i,N.H=s,N.A=c,Nt===null&&(Gt=null,zt=0,$o()),p}function r1(){for(;Nt!==null;)Hg(Nt)}function c1(t,e){var a=Ht;Ht|=2;var i=Og(),s=Rg();Gt!==t||zt!==e?(wu=null,Eu=se()+500,Bl(t,e)):Hl=Ma(t,e);t:do try{if(Ut!==0&&Nt!==null){e=Nt;var c=Oe;e:switch(Ut){case 1:Ut=0,Oe=null,ql(t,e,c,1);break;case 2:case 9:if(Zd(c)){Ut=0,Oe=null,jg(e);break}e=function(){Ut!==2&&Ut!==9||Gt!==t||(Ut=7),rn(t)},c.then(e,e);break t;case 3:Ut=7;break t;case 4:Ut=5;break t;case 7:Zd(c)?(Ut=0,Oe=null,jg(e)):(Ut=0,Oe=null,ql(t,e,c,7));break;case 5:var p=null;switch(Nt.tag){case 26:p=Nt.memoizedState;case 5:case 27:var b=Nt;if(p?Sm(p):b.stateNode.complete){Ut=0,Oe=null;var O=b.sibling;if(O!==null)Nt=O;else{var Q=b.return;Q!==null?(Nt=Q,Au(Q)):Nt=null}break e}}Ut=0,Oe=null,ql(t,e,c,5);break;case 6:Ut=0,Oe=null,ql(t,e,c,6);break;case 8:bc(),It=6;break t;default:throw Error(u(462))}}f1();break}catch(nt){Cg(t,nt)}while(!0);return Nn=Ba=null,N.H=i,N.A=s,Ht=a,Nt!==null?0:(Gt=null,zt=0,$o(),It)}function f1(){for(;Nt!==null&&!_a();)Hg(Nt)}function Hg(t){var e=lg(t.alternate,t,jn);t.memoizedProps=t.pendingProps,e===null?Au(t):Nt=e}function jg(t){var e=t,a=e.alternate;switch(e.tag){case 15:case 0:e=Wh(a,e,e.pendingProps,e.type,void 0,zt);break;case 11:e=Wh(a,e,e.pendingProps,e.type.render,e.ref,zt);break;case 5:Br(e);default:og(a,e),e=Nt=Rd(e,jn),e=lg(a,e,jn)}t.memoizedProps=t.pendingProps,e===null?Au(t):Nt=e}function ql(t,e,a,i){Nn=Ba=null,Br(e),Al=null,_i=0;var s=e.return;try{if(Pv(t,s,e,a,zt)){It=1,gu(t,qe(a,t.current)),Nt=null;return}}catch(c){if(s!==null)throw Nt=s,c;It=1,gu(t,qe(a,t.current)),Nt=null;return}e.flags&32768?(Ct||i===1?t=!0:Hl||(zt&536870912)!==0?t=!1:(oa=t=!0,(i===2||i===9||i===3||i===6)&&(i=Ce.current,i!==null&&i.tag===13&&(i.flags|=16384))),Ug(e,t)):Au(e)}function Au(t){var e=t;do{if((e.flags&32768)!==0){Ug(e,oa);return}t=e.return;var a=n1(e.alternate,e,jn);if(a!==null){Nt=a;return}if(e=e.sibling,e!==null){Nt=e;return}Nt=e=t}while(e!==null);It===0&&(It=5)}function Ug(t,e){do{var a=a1(t.alternate,t);if(a!==null){a.flags&=32767,Nt=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!e&&(t=t.sibling,t!==null)){Nt=t;return}Nt=t=a}while(t!==null);It=6,Nt=null}function Bg(t,e,a,i,s,c,p,b,O){t.cancelPendingCommit=null;do zu();while(ie!==0);if((Ht&6)!==0)throw Error(u(327));if(e!==null){if(e===t.current)throw Error(u(177));if(c=e.lanes|e.childLanes,c|=cr,Ys(t,a,c,p,b,O),t===Gt&&(Nt=Gt=null,zt=0),Ul=e,ra=t,Un=a,vc=c,xc=s,Mg=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,m1(wa,function(){return Gg(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=N.T,N.T=null,s=R.p,R.p=2,p=Ht,Ht|=4;try{l1(t,e,a)}finally{Ht=p,R.p=s,N.T=i}}ie=1,qg(),Lg(),Yg()}}function qg(){if(ie===1){ie=0;var t=ra,e=Ul,a=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||a){a=N.T,N.T=null;var i=R.p;R.p=2;var s=Ht;Ht|=4;try{vg(e,t);var c=Hc,p=wd(t.containerInfo),b=c.focusedElem,O=c.selectionRange;if(p!==b&&b&&b.ownerDocument&&Ed(b.ownerDocument.documentElement,b)){if(O!==null&&ir(b)){var Q=O.start,nt=O.end;if(nt===void 0&&(nt=Q),"selectionStart"in b)b.selectionStart=Q,b.selectionEnd=Math.min(nt,b.value.length);else{var lt=b.ownerDocument||document,K=lt&<.defaultView||window;if(K.getSelection){var F=K.getSelection(),dt=b.textContent.length,vt=Math.min(O.start,dt),Vt=O.end===void 0?vt:Math.min(O.end,dt);!F.extend&&vt>Vt&&(p=Vt,Vt=vt,vt=p);var Y=_d(b,vt),j=_d(b,Vt);if(Y&&j&&(F.rangeCount!==1||F.anchorNode!==Y.node||F.anchorOffset!==Y.offset||F.focusNode!==j.node||F.focusOffset!==j.offset)){var Z=lt.createRange();Z.setStart(Y.node,Y.offset),F.removeAllRanges(),vt>Vt?(F.addRange(Z),F.extend(j.node,j.offset)):(Z.setEnd(j.node,j.offset),F.addRange(Z))}}}}for(lt=[],F=b;F=F.parentNode;)F.nodeType===1&<.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<lt.length;b++){var at=lt[b];at.element.scrollLeft=at.left,at.element.scrollTop=at.top}}Yu=!!Rc,Hc=Rc=null}finally{Ht=s,R.p=i,N.T=a}}t.current=e,ie=2}}function Lg(){if(ie===2){ie=0;var t=ra,e=Ul,a=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||a){a=N.T,N.T=null;var i=R.p;R.p=2;var s=Ht;Ht|=4;try{hg(t,e.alternate,e)}finally{Ht=s,R.p=i,N.T=a}}ie=3}}function Yg(){if(ie===4||ie===3){ie=0,Ea();var t=ra,e=Ul,a=Un,i=Mg;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?ie=5:(ie=0,Ul=ra=null,Vg(t,t.pendingLanes));var s=t.pendingLanes;if(s===0&&(sa=null),ii(a),e=e.stateNode,me&&typeof me.onCommitFiberRoot=="function")try{me.onCommitFiberRoot(Na,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=N.T,s=R.p,R.p=2,N.T=null;try{for(var c=t.onRecoverableError,p=0;p<i.length;p++){var b=i[p];c(b.value,{componentStack:b.stack})}}finally{N.T=e,R.p=s}}(Un&3)!==0&&zu(),rn(t),s=t.pendingLanes,(a&261930)!==0&&(s&42)!==0?t===Sc?Li++:(Li=0,Sc=t):Li=0,Yi(0)}}function Vg(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Si(e)))}function zu(){return qg(),Lg(),Yg(),Gg()}function Gg(){if(ie!==5)return!1;var t=ra,e=vc;vc=0;var a=ii(Un),i=N.T,s=R.p;try{R.p=32>a?32:a,N.T=null,a=xc,xc=null;var c=ra,p=Un;if(ie=0,Ul=ra=null,Un=0,(Ht&6)!==0)throw Error(u(331));var b=Ht;if(Ht|=4,Eg(c.current),Sg(c,c.current,p,a),Ht=b,Yi(0,!1),me&&typeof me.onPostCommitFiberRoot=="function")try{me.onPostCommitFiberRoot(Na,c)}catch{}return!0}finally{R.p=s,N.T=i,Vg(t,e)}}function Xg(t,e,a){e=qe(a,e),e=Wr(t.stateNode,e,2),t=na(t,e,2),t!==null&&(Aa(t,2),rn(t))}function Bt(t,e,a){if(t.tag===3)Xg(t,t,a);else for(;e!==null;){if(e.tag===3){Xg(e,t,a);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(sa===null||!sa.has(i))){t=qe(a,t),a=Zh(2),i=na(e,a,2),i!==null&&(Qh(a,i,e,t),Aa(i,2),rn(i));break}}e=e.return}}function Ec(t,e,a){var i=t.pingCache;if(i===null){i=t.pingCache=new u1;var s=new Set;i.set(e,s)}else s=i.get(e),s===void 0&&(s=new Set,i.set(e,s));s.has(a)||(mc=!0,s.add(a),t=d1.bind(null,t,e,a),e.then(t,t))}function d1(t,e,a){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Gt===t&&(zt&a)===a&&(It===4||It===3&&(zt&62914560)===zt&&300>se()-_u?(Ht&2)===0&&Bl(t,0):pc|=a,jl===zt&&(jl=0)),rn(t)}function Zg(t,e){e===0&&(e=wo()),t=Ha(t,e),t!==null&&(Aa(t,e),rn(t))}function h1(t){var e=t.memoizedState,a=0;e!==null&&(a=e.retryLane),Zg(t,a)}function g1(t,e){var a=0;switch(t.tag){case 31:case 13:var i=t.stateNode,s=t.memoizedState;s!==null&&(a=s.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(u(314))}i!==null&&i.delete(e),Zg(t,a)}function m1(t,e){return $e(t,e)}var Tu=null,Ll=null,wc=!1,Cu=!1,Nc=!1,fa=0;function rn(t){t!==Ll&&t.next===null&&(Ll===null?Tu=Ll=t:Ll=Ll.next=t),Cu=!0,wc||(wc=!0,y1())}function Yi(t,e){if(!Nc&&Cu){Nc=!0;do for(var a=!1,i=Tu;i!==null;){if(t!==0){var s=i.pendingLanes;if(s===0)var c=0;else{var p=i.suspendedLanes,b=i.pingedLanes;c=(1<<31-pe(42|t)+1)-1,c&=s&~(p&~b),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(a=!0,Kg(i,c))}else c=zt,c=ul(i,i===Gt?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(c&3)===0||Ma(i,c)||(a=!0,Kg(i,c));i=i.next}while(a);Nc=!1}}function p1(){Qg()}function Qg(){Cu=wc=!1;var t=0;fa!==0&&A1()&&(t=fa);for(var e=se(),a=null,i=Tu;i!==null;){var s=i.next,c=$g(i,e);c===0?(i.next=null,a===null?Tu=s:a.next=s,s===null&&(Ll=a)):(a=i,(t!==0||(c&3)!==0)&&(Cu=!0)),i=s}ie!==0&&ie!==5||Yi(t),fa!==0&&(fa=0)}function $g(t,e){for(var a=t.suspendedLanes,i=t.pingedLanes,s=t.expirationTimes,c=t.pendingLanes&-62914561;0<c;){var p=31-pe(c),b=1<<p,O=s[p];O===-1?((b&a)===0||(b&i)!==0)&&(s[p]=Ls(b,e)):O<=e&&(t.expiredLanes|=b),c&=~b}if(e=Gt,a=zt,a=ul(t,t===e?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,a===0||t===e&&(Ut===2||Ut===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&mn(i),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Ma(t,a)){if(e=a&-a,e===t.callbackPriority)return e;switch(i!==null&&mn(i),ii(a)){case 2:case 8:a=Xn;break;case 32:a=wa;break;case 268435456:a=al;break;default:a=wa}return i=kg.bind(null,t),a=$e(a,i),t.callbackPriority=e,t.callbackNode=a,e}return i!==null&&i!==null&&mn(i),t.callbackPriority=2,t.callbackNode=null,2}function kg(t,e){if(ie!==0&&ie!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(zu()&&t.callbackNode!==a)return null;var i=zt;return i=ul(t,t===Gt?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(zg(t,i,e),$g(t,se()),t.callbackNode!=null&&t.callbackNode===a?kg.bind(null,t):null)}function Kg(t,e){if(zu())return null;zg(t,e,!0)}function y1(){T1(function(){(Ht&6)!==0?$e(pn,p1):Qg()})}function Mc(){if(fa===0){var t=wl;t===0&&(t=ll,ll<<=1,(ll&261888)===0&&(ll=256)),fa=t}return fa}function Ig(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:qo(""+t)}function Jg(t,e){var a=e.ownerDocument.createElement("input");return a.name=e.name,a.value=e.value,t.id&&a.setAttribute("form",t.id),e.parentNode.insertBefore(a,e),t=new FormData(t),a.parentNode.removeChild(a),t}function v1(t,e,a,i,s){if(e==="submit"&&a&&a.stateNode===s){var c=Ig((s[he]||null).action),p=i.submitter;p&&(e=(e=p[he]||null)?Ig(e.formAction):p.getAttribute("formAction"),e!==null&&(c=e,p=null));var b=new Go("action","action",null,i,s);t.push({event:b,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(fa!==0){var O=p?Jg(s,p):new FormData(s);$r(a,{pending:!0,data:O,method:s.method,action:c},null,O)}}else typeof c=="function"&&(b.preventDefault(),O=p?Jg(s,p):new FormData(s),$r(a,{pending:!0,data:O,method:s.method,action:c},c,O))},currentTarget:s}]})}}for(var Ac=0;Ac<rr.length;Ac++){var zc=rr[Ac],x1=zc.toLowerCase(),S1=zc[0].toUpperCase()+zc.slice(1);Ke(x1,"on"+S1)}Ke(Ad,"onAnimationEnd"),Ke(zd,"onAnimationIteration"),Ke(Td,"onAnimationStart"),Ke("dblclick","onDoubleClick"),Ke("focusin","onFocus"),Ke("focusout","onBlur"),Ke(Uv,"onTransitionRun"),Ke(Bv,"onTransitionStart"),Ke(qv,"onTransitionCancel"),Ke(Cd,"onTransitionEnd"),Kn("onMouseEnter",["mouseout","mouseover"]),Kn("onMouseLeave",["mouseout","mouseover"]),Kn("onPointerEnter",["pointerout","pointerover"]),Kn("onPointerLeave",["pointerout","pointerover"]),xn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xn("onBeforeInput",["compositionend","keypress","textInput","paste"]),xn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vi="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(" "),b1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Vi));function Fg(t,e){e=(e&4)!==0;for(var a=0;a<t.length;a++){var i=t[a],s=i.event;i=i.listeners;t:{var c=void 0;if(e)for(var p=i.length-1;0<=p;p--){var b=i[p],O=b.instance,Q=b.currentTarget;if(b=b.listener,O!==c&&s.isPropagationStopped())break t;c=b,s.currentTarget=Q;try{c(s)}catch(nt){Qo(nt)}s.currentTarget=null,c=O}else for(p=0;p<i.length;p++){if(b=i[p],O=b.instance,Q=b.currentTarget,b=b.listener,O!==c&&s.isPropagationStopped())break t;c=b,s.currentTarget=Q;try{c(s)}catch(nt){Qo(nt)}s.currentTarget=null,c=O}}}}function Mt(t,e){var a=e[sl];a===void 0&&(a=e[sl]=new Set);var i=t+"__bubble";a.has(i)||(Wg(e,t,2,!1),a.add(i))}function Tc(t,e,a){var i=0;e&&(i|=4),Wg(a,t,i,e)}var Du="_reactListening"+Math.random().toString(36).slice(2);function Cc(t){if(!t[Du]){t[Du]=!0,Oo.forEach(function(a){a!=="selectionchange"&&(b1.has(a)||Tc(a,!1,t),Tc(a,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Du]||(e[Du]=!0,Tc("selectionchange",!1,e))}}function Wg(t,e,a,i){switch(Am(e)){case 2:var s=I1;break;case 8:s=J1;break;default:s=Qc}a=s.bind(null,e,a,t),s=void 0,!Js||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(s=!0),i?s!==void 0?t.addEventListener(e,a,{capture:!0,passive:s}):t.addEventListener(e,a,!0):s!==void 0?t.addEventListener(e,a,{passive:s}):t.addEventListener(e,a,!1)}function Dc(t,e,a,i,s){var c=i;if((e&1)===0&&(e&2)===0&&i!==null)t:for(;;){if(i===null)return;var p=i.tag;if(p===3||p===4){var b=i.stateNode.containerInfo;if(b===s)break;if(p===4)for(p=i.return;p!==null;){var O=p.tag;if((O===3||O===4)&&p.stateNode.containerInfo===s)return;p=p.return}for(;b!==null;){if(p=Zn(b),p===null)return;if(O=p.tag,O===5||O===6||O===26||O===27){i=c=p;continue t}b=b.parentNode}}i=i.return}ad(function(){var Q=c,nt=Ks(a),lt=[];t:{var K=Dd.get(t);if(K!==void 0){var F=Go,dt=t;switch(t){case"keypress":if(Yo(a)===0)break t;case"keydown":case"keyup":F=gv;break;case"focusin":dt="focus",F=tr;break;case"focusout":dt="blur",F=tr;break;case"beforeblur":case"afterblur":F=tr;break;case"click":if(a.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":F=od;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":F=nv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":F=yv;break;case Ad:case zd:case Td:F=iv;break;case Cd:F=xv;break;case"scroll":case"scrollend":F=tv;break;case"wheel":F=bv;break;case"copy":case"cut":case"paste":F=uv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":F=sd;break;case"toggle":case"beforetoggle":F=Ev}var vt=(e&4)!==0,Vt=!vt&&(t==="scroll"||t==="scrollend"),Y=vt?K!==null?K+"Capture":null:K;vt=[];for(var j=Q,Z;j!==null;){var at=j;if(Z=at.stateNode,at=at.tag,at!==5&&at!==26&&at!==27||Z===null||Y===null||(at=ri(j,Y),at!=null&&vt.push(Gi(j,at,Z))),Vt)break;j=j.return}0<vt.length&&(K=new F(K,dt,null,a,nt),lt.push({event:K,listeners:vt}))}}if((e&7)===0){t:{if(K=t==="mouseover"||t==="pointerover",F=t==="mouseout"||t==="pointerout",K&&a!==ks&&(dt=a.relatedTarget||a.fromElement)&&(Zn(dt)||dt[vn]))break t;if((F||K)&&(K=nt.window===nt?nt:(K=nt.ownerDocument)?K.defaultView||K.parentWindow:window,F?(dt=a.relatedTarget||a.toElement,F=Q,dt=dt?Zn(dt):null,dt!==null&&(Vt=f(dt),vt=dt.tag,dt!==Vt||vt!==5&&vt!==27&&vt!==6)&&(dt=null)):(F=null,dt=Q),F!==dt)){if(vt=od,at="onMouseLeave",Y="onMouseEnter",j="mouse",(t==="pointerout"||t==="pointerover")&&(vt=sd,at="onPointerLeave",Y="onPointerEnter",j="pointer"),Vt=F==null?K:$n(F),Z=dt==null?K:$n(dt),K=new vt(at,j+"leave",F,a,nt),K.target=Vt,K.relatedTarget=Z,at=null,Zn(nt)===Q&&(vt=new vt(Y,j+"enter",dt,a,nt),vt.target=Z,vt.relatedTarget=Vt,at=vt),Vt=at,F&&dt)e:{for(vt=_1,Y=F,j=dt,Z=0,at=Y;at;at=vt(at))Z++;at=0;for(var pt=j;pt;pt=vt(pt))at++;for(;0<Z-at;)Y=vt(Y),Z--;for(;0<at-Z;)j=vt(j),at--;for(;Z--;){if(Y===j||j!==null&&Y===j.alternate){vt=Y;break e}Y=vt(Y),j=vt(j)}vt=null}else vt=null;F!==null&&Pg(lt,K,F,vt,!1),dt!==null&&Vt!==null&&Pg(lt,Vt,dt,vt,!0)}}t:{if(K=Q?$n(Q):window,F=K.nodeName&&K.nodeName.toLowerCase(),F==="select"||F==="input"&&K.type==="file")var Ot=pd;else if(gd(K))if(yd)Ot=Rv;else{Ot=Dv;var gt=Cv}else F=K.nodeName,!F||F.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?Q&&$s(Q.elementType)&&(Ot=pd):Ot=Ov;if(Ot&&(Ot=Ot(t,Q))){md(lt,Ot,a,nt);break t}gt&>(t,K,Q),t==="focusout"&&Q&&K.type==="number"&&Q.memoizedProps.value!=null&&si(K,"number",K.value)}switch(gt=Q?$n(Q):window,t){case"focusin":(gd(gt)||gt.contentEditable==="true")&&(pl=gt,or=Q,yi=null);break;case"focusout":yi=or=pl=null;break;case"mousedown":ur=!0;break;case"contextmenu":case"mouseup":case"dragend":ur=!1,Nd(lt,a,nt);break;case"selectionchange":if(jv)break;case"keydown":case"keyup":Nd(lt,a,nt)}var wt;if(nr)t:{switch(t){case"compositionstart":var Tt="onCompositionStart";break t;case"compositionend":Tt="onCompositionEnd";break t;case"compositionupdate":Tt="onCompositionUpdate";break t}Tt=void 0}else ml?dd(t,a)&&(Tt="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(Tt="onCompositionStart");Tt&&(rd&&a.locale!=="ko"&&(ml||Tt!=="onCompositionStart"?Tt==="onCompositionEnd"&&ml&&(wt=ld()):(In=nt,Fs="value"in In?In.value:In.textContent,ml=!0)),gt=Ou(Q,Tt),0<gt.length&&(Tt=new ud(Tt,t,null,a,nt),lt.push({event:Tt,listeners:gt}),wt?Tt.data=wt:(wt=hd(a),wt!==null&&(Tt.data=wt)))),(wt=Nv?Mv(t,a):Av(t,a))&&(Tt=Ou(Q,"onBeforeInput"),0<Tt.length&&(gt=new ud("onBeforeInput","beforeinput",null,a,nt),lt.push({event:gt,listeners:Tt}),gt.data=wt)),v1(lt,t,Q,a,nt)}Fg(lt,e)})}function Gi(t,e,a){return{instance:t,listener:e,currentTarget:a}}function Ou(t,e){for(var a=e+"Capture",i=[];t!==null;){var s=t,c=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||c===null||(s=ri(t,a),s!=null&&i.unshift(Gi(t,s,c)),s=ri(t,e),s!=null&&i.push(Gi(t,s,c))),t.tag===3)return i;t=t.return}return[]}function _1(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Pg(t,e,a,i,s){for(var c=e._reactName,p=[];a!==null&&a!==i;){var b=a,O=b.alternate,Q=b.stateNode;if(b=b.tag,O!==null&&O===i)break;b!==5&&b!==26&&b!==27||Q===null||(O=Q,s?(Q=ri(a,c),Q!=null&&p.unshift(Gi(a,Q,O))):s||(Q=ri(a,c),Q!=null&&p.push(Gi(a,Q,O)))),a=a.return}p.length!==0&&t.push({event:e,listeners:p})}var E1=/\r\n?/g,w1=/\u0000|\uFFFD/g;function tm(t){return(typeof t=="string"?t:""+t).replace(E1,`
|
|
9
|
+
`).replace(w1,"")}function em(t,e){return e=tm(e),tm(t)===e}function Yt(t,e,a,i,s,c){switch(a){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||dl(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&dl(t,""+i);break;case"className":cl(t,"class",i);break;case"tabIndex":cl(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":cl(t,a,i);break;case"style":ed(t,i,c);break;case"data":if(e!=="object"){cl(t,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||a!=="href")){t.removeAttribute(a);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(a);break}i=qo(""+i),t.setAttribute(a,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(a==="formAction"?(e!=="input"&&Yt(t,e,"name",s.name,s,null),Yt(t,e,"formEncType",s.formEncType,s,null),Yt(t,e,"formMethod",s.formMethod,s,null),Yt(t,e,"formTarget",s.formTarget,s,null)):(Yt(t,e,"encType",s.encType,s,null),Yt(t,e,"method",s.method,s,null),Yt(t,e,"target",s.target,s,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(a);break}i=qo(""+i),t.setAttribute(a,i);break;case"onClick":i!=null&&(t.onclick=bn);break;case"onScroll":i!=null&&Mt("scroll",t);break;case"onScrollEnd":i!=null&&Mt("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(u(61));if(a=i.__html,a!=null){if(s.children!=null)throw Error(u(60));t.innerHTML=a}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}a=qo(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(a,""+i):t.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":i===!0?t.setAttribute(a,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(a,i):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(a,i):t.removeAttribute(a);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(a):t.setAttribute(a,i);break;case"popover":Mt("beforetoggle",t),Mt("toggle",t),rl(t,"popover",i);break;case"xlinkActuate":ke(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":ke(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":ke(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":ke(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":ke(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":ke(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":ke(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":ke(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":ke(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":rl(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Wy.get(a)||a,rl(t,a,i))}}function Oc(t,e,a,i,s,c){switch(a){case"style":ed(t,i,c);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(u(61));if(a=i.__html,a!=null){if(s.children!=null)throw Error(u(60));t.innerHTML=a}}break;case"children":typeof i=="string"?dl(t,i):(typeof i=="number"||typeof i=="bigint")&&dl(t,""+i);break;case"onScroll":i!=null&&Mt("scroll",t);break;case"onScrollEnd":i!=null&&Mt("scrollend",t);break;case"onClick":i!=null&&(t.onclick=bn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ro.hasOwnProperty(a))t:{if(a[0]==="o"&&a[1]==="n"&&(s=a.endsWith("Capture"),e=a.slice(2,s?a.length-7:void 0),c=t[he]||null,c=c!=null?c[a]:null,typeof c=="function"&&t.removeEventListener(e,c,s),typeof i=="function")){typeof c!="function"&&c!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(e,i,s);break t}a in t?t[a]=i:i===!0?t.setAttribute(a,""):rl(t,a,i)}}}function de(t,e,a){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Mt("error",t),Mt("load",t);var i=!1,s=!1,c;for(c in a)if(a.hasOwnProperty(c)){var p=a[c];if(p!=null)switch(c){case"src":i=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,e));default:Yt(t,e,c,p,a,null)}}s&&Yt(t,e,"srcSet",a.srcSet,a,null),i&&Yt(t,e,"src",a.src,a,null);return;case"input":Mt("invalid",t);var b=c=p=s=null,O=null,Q=null;for(i in a)if(a.hasOwnProperty(i)){var nt=a[i];if(nt!=null)switch(i){case"name":s=nt;break;case"type":p=nt;break;case"checked":O=nt;break;case"defaultChecked":Q=nt;break;case"value":c=nt;break;case"defaultValue":b=nt;break;case"children":case"dangerouslySetInnerHTML":if(nt!=null)throw Error(u(137,e));break;default:Yt(t,e,i,nt,a,null)}}Bo(t,c,b,O,Q,p,s,!1);return;case"select":Mt("invalid",t),i=p=c=null;for(s in a)if(a.hasOwnProperty(s)&&(b=a[s],b!=null))switch(s){case"value":c=b;break;case"defaultValue":p=b;break;case"multiple":i=b;default:Yt(t,e,s,b,a,null)}e=c,a=p,t.multiple=!!i,e!=null?Sn(t,!!i,e,!1):a!=null&&Sn(t,!!i,a,!0);return;case"textarea":Mt("invalid",t),c=s=i=null;for(p in a)if(a.hasOwnProperty(p)&&(b=a[p],b!=null))switch(p){case"value":i=b;break;case"defaultValue":s=b;break;case"children":c=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(u(91));break;default:Yt(t,e,p,b,a,null)}Pf(t,i,s,c);return;case"option":for(O in a)a.hasOwnProperty(O)&&(i=a[O],i!=null)&&(O==="selected"?t.selected=i&&typeof i!="function"&&typeof i!="symbol":Yt(t,e,O,i,a,null));return;case"dialog":Mt("beforetoggle",t),Mt("toggle",t),Mt("cancel",t),Mt("close",t);break;case"iframe":case"object":Mt("load",t);break;case"video":case"audio":for(i=0;i<Vi.length;i++)Mt(Vi[i],t);break;case"image":Mt("error",t),Mt("load",t);break;case"details":Mt("toggle",t);break;case"embed":case"source":case"link":Mt("error",t),Mt("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(Q in a)if(a.hasOwnProperty(Q)&&(i=a[Q],i!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,e));default:Yt(t,e,Q,i,a,null)}return;default:if($s(e)){for(nt in a)a.hasOwnProperty(nt)&&(i=a[nt],i!==void 0&&Oc(t,e,nt,i,a,void 0));return}}for(b in a)a.hasOwnProperty(b)&&(i=a[b],i!=null&&Yt(t,e,b,i,a,null))}function N1(t,e,a,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,c=null,p=null,b=null,O=null,Q=null,nt=null;for(F in a){var lt=a[F];if(a.hasOwnProperty(F)&<!=null)switch(F){case"checked":break;case"value":break;case"defaultValue":O=lt;default:i.hasOwnProperty(F)||Yt(t,e,F,null,i,lt)}}for(var K in i){var F=i[K];if(lt=a[K],i.hasOwnProperty(K)&&(F!=null||lt!=null))switch(K){case"type":c=F;break;case"name":s=F;break;case"checked":Q=F;break;case"defaultChecked":nt=F;break;case"value":p=F;break;case"defaultValue":b=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(u(137,e));break;default:F!==lt&&Yt(t,e,K,F,i,lt)}}Ca(t,p,b,O,Q,nt,c,s);return;case"select":F=p=b=K=null;for(c in a)if(O=a[c],a.hasOwnProperty(c)&&O!=null)switch(c){case"value":break;case"multiple":F=O;default:i.hasOwnProperty(c)||Yt(t,e,c,null,i,O)}for(s in i)if(c=i[s],O=a[s],i.hasOwnProperty(s)&&(c!=null||O!=null))switch(s){case"value":K=c;break;case"defaultValue":b=c;break;case"multiple":p=c;default:c!==O&&Yt(t,e,s,c,i,O)}e=b,a=p,i=F,K!=null?Sn(t,!!a,K,!1):!!i!=!!a&&(e!=null?Sn(t,!!a,e,!0):Sn(t,!!a,a?[]:"",!1));return;case"textarea":F=K=null;for(b in a)if(s=a[b],a.hasOwnProperty(b)&&s!=null&&!i.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:Yt(t,e,b,null,i,s)}for(p in i)if(s=i[p],c=a[p],i.hasOwnProperty(p)&&(s!=null||c!=null))switch(p){case"value":K=s;break;case"defaultValue":F=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(u(91));break;default:s!==c&&Yt(t,e,p,s,i,c)}Wf(t,K,F);return;case"option":for(var dt in a)K=a[dt],a.hasOwnProperty(dt)&&K!=null&&!i.hasOwnProperty(dt)&&(dt==="selected"?t.selected=!1:Yt(t,e,dt,null,i,K));for(O in i)K=i[O],F=a[O],i.hasOwnProperty(O)&&K!==F&&(K!=null||F!=null)&&(O==="selected"?t.selected=K&&typeof K!="function"&&typeof K!="symbol":Yt(t,e,O,K,i,F));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 vt in a)K=a[vt],a.hasOwnProperty(vt)&&K!=null&&!i.hasOwnProperty(vt)&&Yt(t,e,vt,null,i,K);for(Q in i)if(K=i[Q],F=a[Q],i.hasOwnProperty(Q)&&K!==F&&(K!=null||F!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(u(137,e));break;default:Yt(t,e,Q,K,i,F)}return;default:if($s(e)){for(var Vt in a)K=a[Vt],a.hasOwnProperty(Vt)&&K!==void 0&&!i.hasOwnProperty(Vt)&&Oc(t,e,Vt,void 0,i,K);for(nt in i)K=i[nt],F=a[nt],!i.hasOwnProperty(nt)||K===F||K===void 0&&F===void 0||Oc(t,e,nt,K,i,F);return}}for(var Y in a)K=a[Y],a.hasOwnProperty(Y)&&K!=null&&!i.hasOwnProperty(Y)&&Yt(t,e,Y,null,i,K);for(lt in i)K=i[lt],F=a[lt],!i.hasOwnProperty(lt)||K===F||K==null&&F==null||Yt(t,e,lt,K,i,F)}function nm(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function M1(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,a=performance.getEntriesByType("resource"),i=0;i<a.length;i++){var s=a[i],c=s.transferSize,p=s.initiatorType,b=s.duration;if(c&&b&&nm(p)){for(p=0,b=s.responseEnd,i+=1;i<a.length;i++){var O=a[i],Q=O.startTime;if(Q>b)break;var nt=O.transferSize,lt=O.initiatorType;nt&&nm(lt)&&(O=O.responseEnd,p+=nt*(O<b?1:(b-Q)/(O-Q)))}if(--i,e+=8*(c+p)/(s.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Rc=null,Hc=null;function Ru(t){return t.nodeType===9?t:t.ownerDocument}function am(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 lm(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function jc(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Uc=null;function A1(){var t=window.event;return t&&t.type==="popstate"?t===Uc?!1:(Uc=t,!0):(Uc=null,!1)}var im=typeof setTimeout=="function"?setTimeout:void 0,z1=typeof clearTimeout=="function"?clearTimeout:void 0,om=typeof Promise=="function"?Promise:void 0,T1=typeof queueMicrotask=="function"?queueMicrotask:typeof om<"u"?function(t){return om.resolve(null).then(t).catch(C1)}:im;function C1(t){setTimeout(function(){throw t})}function da(t){return t==="head"}function um(t,e){var a=e,i=0;do{var s=a.nextSibling;if(t.removeChild(a),s&&s.nodeType===8)if(a=s.data,a==="/$"||a==="/&"){if(i===0){t.removeChild(s),Xl(e);return}i--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")i++;else if(a==="html")Xi(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Xi(a);for(var c=a.firstChild;c;){var p=c.nextSibling,b=c.nodeName;c[za]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&c.rel.toLowerCase()==="stylesheet"||a.removeChild(c),c=p}}else a==="body"&&Xi(t.ownerDocument.body);a=s}while(a);Xl(e)}function sm(t,e){var a=t;t=0;do{var i=a.nextSibling;if(a.nodeType===1?e?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(e?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),i&&i.nodeType===8)if(a=i.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=i}while(a)}function Bc(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var a=e;switch(e=e.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Bc(a),oi(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function D1(t,e,a,i){for(;t.nodeType===1;){var s=a;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[za])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(c=t.getAttribute("rel"),c==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(c!==s.rel||t.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||t.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||t.getAttribute("title")!==(s.title==null?null:s.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(c=t.getAttribute("src"),(c!==(s.src==null?null:s.src)||t.getAttribute("type")!==(s.type==null?null:s.type)||t.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&c&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var c=s.name==null?null:""+s.name;if(s.type==="hidden"&&t.getAttribute("name")===c)return t}else return t;if(t=Xe(t.nextSibling),t===null)break}return null}function O1(t,e,a){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Xe(t.nextSibling),t===null))return null;return t}function rm(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=Xe(t.nextSibling),t===null))return null;return t}function qc(t){return t.data==="$?"||t.data==="$~"}function Lc(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function R1(t,e){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||a.readyState!=="loading")e();else{var i=function(){e(),a.removeEventListener("DOMContentLoaded",i)};a.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function Xe(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return t}var Yc=null;function cm(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(e===0)return Xe(t.nextSibling);e--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||e++}t=t.nextSibling}return null}function fm(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(e===0)return t;e--}else a!=="/$"&&a!=="/&"||e++}t=t.previousSibling}return null}function dm(t,e,a){switch(e=Ru(a),t){case"html":if(t=e.documentElement,!t)throw Error(u(452));return t;case"head":if(t=e.head,!t)throw Error(u(453));return t;case"body":if(t=e.body,!t)throw Error(u(454));return t;default:throw Error(u(451))}}function Xi(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);oi(t)}var Ze=new Map,hm=new Set;function Hu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Bn=R.d;R.d={f:H1,r:j1,D:U1,C:B1,L:q1,m:L1,X:V1,S:Y1,M:G1};function H1(){var t=Bn.f(),e=Nu();return t||e}function j1(t){var e=Qn(t);e!==null&&e.tag===5&&e.type==="form"?Ch(e):Bn.r(t)}var Yl=typeof document>"u"?null:document;function gm(t,e,a){var i=Yl;if(i&&typeof e=="string"&&e){var s=xe(e);s='link[rel="'+t+'"][href="'+s+'"]',typeof a=="string"&&(s+='[crossorigin="'+a+'"]'),hm.has(s)||(hm.add(s),t={rel:t,crossOrigin:a,href:e},i.querySelector(s)===null&&(e=i.createElement("link"),de(e,"link",t),Wt(e),i.head.appendChild(e)))}}function U1(t){Bn.D(t),gm("dns-prefetch",t,null)}function B1(t,e){Bn.C(t,e),gm("preconnect",t,e)}function q1(t,e,a){Bn.L(t,e,a);var i=Yl;if(i&&t&&e){var s='link[rel="preload"][as="'+xe(e)+'"]';e==="image"&&a&&a.imageSrcSet?(s+='[imagesrcset="'+xe(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(s+='[imagesizes="'+xe(a.imageSizes)+'"]')):s+='[href="'+xe(t)+'"]';var c=s;switch(e){case"style":c=Vl(t);break;case"script":c=Gl(t)}Ze.has(c)||(t=y({rel:"preload",href:e==="image"&&a&&a.imageSrcSet?void 0:t,as:e},a),Ze.set(c,t),i.querySelector(s)!==null||e==="style"&&i.querySelector(Zi(c))||e==="script"&&i.querySelector(Qi(c))||(e=i.createElement("link"),de(e,"link",t),Wt(e),i.head.appendChild(e)))}}function L1(t,e){Bn.m(t,e);var a=Yl;if(a&&t){var i=e&&typeof e.as=="string"?e.as:"script",s='link[rel="modulepreload"][as="'+xe(i)+'"][href="'+xe(t)+'"]',c=s;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Gl(t)}if(!Ze.has(c)&&(t=y({rel:"modulepreload",href:t},e),Ze.set(c,t),a.querySelector(s)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Qi(c)))return}i=a.createElement("link"),de(i,"link",t),Wt(i),a.head.appendChild(i)}}}function Y1(t,e,a){Bn.S(t,e,a);var i=Yl;if(i&&t){var s=kn(i).hoistableStyles,c=Vl(t);e=e||"default";var p=s.get(c);if(!p){var b={loading:0,preload:null};if(p=i.querySelector(Zi(c)))b.loading=5;else{t=y({rel:"stylesheet",href:t,"data-precedence":e},a),(a=Ze.get(c))&&Vc(t,a);var O=p=i.createElement("link");Wt(O),de(O,"link",t),O._p=new Promise(function(Q,nt){O.onload=Q,O.onerror=nt}),O.addEventListener("load",function(){b.loading|=1}),O.addEventListener("error",function(){b.loading|=2}),b.loading|=4,ju(p,e,i)}p={type:"stylesheet",instance:p,count:1,state:b},s.set(c,p)}}}function V1(t,e){Bn.X(t,e);var a=Yl;if(a&&t){var i=kn(a).hoistableScripts,s=Gl(t),c=i.get(s);c||(c=a.querySelector(Qi(s)),c||(t=y({src:t,async:!0},e),(e=Ze.get(s))&&Gc(t,e),c=a.createElement("script"),Wt(c),de(c,"link",t),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(s,c))}}function G1(t,e){Bn.M(t,e);var a=Yl;if(a&&t){var i=kn(a).hoistableScripts,s=Gl(t),c=i.get(s);c||(c=a.querySelector(Qi(s)),c||(t=y({src:t,async:!0,type:"module"},e),(e=Ze.get(s))&&Gc(t,e),c=a.createElement("script"),Wt(c),de(c,"link",t),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(s,c))}}function mm(t,e,a,i){var s=(s=ct.current)?Hu(s):null;if(!s)throw Error(u(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(e=Vl(a.href),a=kn(s).hoistableStyles,i=a.get(e),i||(i={type:"style",instance:null,count:0,state:null},a.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=Vl(a.href);var c=kn(s).hoistableStyles,p=c.get(t);if(p||(s=s.ownerDocument||s,p={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(t,p),(c=s.querySelector(Zi(t)))&&!c._p&&(p.instance=c,p.state.loading=5),Ze.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ze.set(t,a),c||X1(s,t,a,p.state))),e&&i===null)throw Error(u(528,""));return p}if(e&&i!==null)throw Error(u(529,""));return null;case"script":return e=a.async,a=a.src,typeof a=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Gl(a),a=kn(s).hoistableScripts,i=a.get(e),i||(i={type:"script",instance:null,count:0,state:null},a.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,t))}}function Vl(t){return'href="'+xe(t)+'"'}function Zi(t){return'link[rel="stylesheet"]['+t+"]"}function pm(t){return y({},t,{"data-precedence":t.precedence,precedence:null})}function X1(t,e,a,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),de(e,"link",a),Wt(e),t.head.appendChild(e))}function Gl(t){return'[src="'+xe(t)+'"]'}function Qi(t){return"script[async]"+t}function ym(t,e,a){if(e.count++,e.instance===null)switch(e.type){case"style":var i=t.querySelector('style[data-href~="'+xe(a.href)+'"]');if(i)return e.instance=i,Wt(i),i;var s=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),Wt(i),de(i,"style",s),ju(i,a.precedence,t),e.instance=i;case"stylesheet":s=Vl(a.href);var c=t.querySelector(Zi(s));if(c)return e.state.loading|=4,e.instance=c,Wt(c),c;i=pm(a),(s=Ze.get(s))&&Vc(i,s),c=(t.ownerDocument||t).createElement("link"),Wt(c);var p=c;return p._p=new Promise(function(b,O){p.onload=b,p.onerror=O}),de(c,"link",i),e.state.loading|=4,ju(c,a.precedence,t),e.instance=c;case"script":return c=Gl(a.src),(s=t.querySelector(Qi(c)))?(e.instance=s,Wt(s),s):(i=a,(s=Ze.get(c))&&(i=y({},a),Gc(i,s)),t=t.ownerDocument||t,s=t.createElement("script"),Wt(s),de(s,"link",i),t.head.appendChild(s),e.instance=s);case"void":return null;default:throw Error(u(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,ju(i,a.precedence,t));return e.instance}function ju(t,e,a){for(var i=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=i.length?i[i.length-1]:null,c=s,p=0;p<i.length;p++){var b=i[p];if(b.dataset.precedence===e)c=b;else if(c!==s)break}c?c.parentNode.insertBefore(t,c.nextSibling):(e=a.nodeType===9?a.head:a,e.insertBefore(t,e.firstChild))}function Vc(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function Gc(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Uu=null;function vm(t,e,a){if(Uu===null){var i=new Map,s=Uu=new Map;s.set(a,i)}else s=Uu,i=s.get(a),i||(i=new Map,s.set(a,i));if(i.has(t))return i;for(i.set(t,null),a=a.getElementsByTagName(t),s=0;s<a.length;s++){var c=a[s];if(!(c[za]||c[le]||t==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var p=c.getAttribute(e)||"";p=t+p;var b=i.get(p);b?b.push(c):i.set(p,[c])}}return i}function xm(t,e,a){t=t.ownerDocument||t,t.head.insertBefore(a,e==="title"?t.querySelector("head > title"):null)}function Z1(t,e,a){if(a===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Sm(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Q1(t,e,a,i){if(a.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var s=Vl(i.href),c=e.querySelector(Zi(s));if(c){e=c._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Bu.bind(t),e.then(t,t)),a.state.loading|=4,a.instance=c,Wt(c);return}c=e.ownerDocument||e,i=pm(i),(s=Ze.get(s))&&Vc(i,s),c=c.createElement("link"),Wt(c);var p=c;p._p=new Promise(function(b,O){p.onload=b,p.onerror=O}),de(c,"link",i),a.instance=c}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,e),(e=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=Bu.bind(t),e.addEventListener("load",a),e.addEventListener("error",a))}}var Xc=0;function $1(t,e){return t.stylesheets&&t.count===0&&Lu(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var i=setTimeout(function(){if(t.stylesheets&&Lu(t,t.stylesheets),t.unsuspend){var c=t.unsuspend;t.unsuspend=null,c()}},6e4+e);0<t.imgBytes&&Xc===0&&(Xc=62500*M1());var s=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Lu(t,t.stylesheets),t.unsuspend)){var c=t.unsuspend;t.unsuspend=null,c()}},(t.imgBytes>Xc?50:800)+e);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(i),clearTimeout(s)}}:null}function Bu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Lu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var qu=null;function Lu(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,qu=new Map,e.forEach(k1,t),qu=null,Bu.call(t))}function k1(t,e){if(!(e.state.loading&4)){var a=qu.get(t);if(a)var i=a.get(null);else{a=new Map,qu.set(t,a);for(var s=t.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<s.length;c++){var p=s[c];(p.nodeName==="LINK"||p.getAttribute("media")!=="not all")&&(a.set(p.dataset.precedence,p),i=p)}i&&a.set(null,i)}s=e.instance,p=s.getAttribute("data-precedence"),c=a.get(p)||i,c===i&&a.set(null,s),a.set(p,s),this.count++,i=Bu.bind(this),s.addEventListener("load",i),s.addEventListener("error",i),c?c.parentNode.insertBefore(s,c.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(s,t.firstChild)),e.state.loading|=4}}var $i={$$typeof:E,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function K1(t,e,a,i,s,c,p,b,O){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=ai(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ai(0),this.hiddenUpdates=ai(null),this.identifierPrefix=i,this.onUncaughtError=s,this.onCaughtError=c,this.onRecoverableError=p,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function bm(t,e,a,i,s,c,p,b,O,Q,nt,lt){return t=new K1(t,e,a,p,O,Q,nt,lt,b),e=1,c===!0&&(e|=24),c=Te(3,null,null,e),t.current=c,c.stateNode=t,e=_r(),e.refCount++,t.pooledCache=e,e.refCount++,c.memoizedState={element:i,isDehydrated:a,cache:e},Mr(c),t}function _m(t){return t?(t=xl,t):xl}function Em(t,e,a,i,s,c){s=_m(s),i.context===null?i.context=s:i.pendingContext=s,i=ea(e),i.payload={element:a},c=c===void 0?null:c,c!==null&&(i.callback=c),a=na(t,i,e),a!==null&&(Ne(a,t,e),wi(a,t,e))}function wm(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<e?a:e}}function Zc(t,e){wm(t,e),(t=t.alternate)&&wm(t,e)}function Nm(t){if(t.tag===13||t.tag===31){var e=Ha(t,67108864);e!==null&&Ne(e,t,67108864),Zc(t,67108864)}}function Mm(t){if(t.tag===13||t.tag===31){var e=He();e=li(e);var a=Ha(t,e);a!==null&&Ne(a,t,e),Zc(t,e)}}var Yu=!0;function I1(t,e,a,i){var s=N.T;N.T=null;var c=R.p;try{R.p=2,Qc(t,e,a,i)}finally{R.p=c,N.T=s}}function J1(t,e,a,i){var s=N.T;N.T=null;var c=R.p;try{R.p=8,Qc(t,e,a,i)}finally{R.p=c,N.T=s}}function Qc(t,e,a,i){if(Yu){var s=$c(i);if(s===null)Dc(t,e,i,Vu,a),zm(t,i);else if(W1(s,t,e,a,i))i.stopPropagation();else if(zm(t,i),e&4&&-1<F1.indexOf(t)){for(;s!==null;){var c=Qn(s);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var p=yn(c.pendingLanes);if(p!==0){var b=c;for(b.pendingLanes|=2,b.entangledLanes|=2;p;){var O=1<<31-pe(p);b.entanglements[1]|=O,p&=~O}rn(c),(Ht&6)===0&&(Eu=se()+500,Yi(0))}}break;case 31:case 13:b=Ha(c,2),b!==null&&Ne(b,c,2),Nu(),Zc(c,2)}if(c=$c(i),c===null&&Dc(t,e,i,Vu,a),c===s)break;s=c}s!==null&&i.stopPropagation()}else Dc(t,e,i,null,a)}}function $c(t){return t=Ks(t),kc(t)}var Vu=null;function kc(t){if(Vu=null,t=Zn(t),t!==null){var e=f(t);if(e===null)t=null;else{var a=e.tag;if(a===13){if(t=d(e),t!==null)return t;t=null}else if(a===31){if(t=g(e),t!==null)return t;t=null}else if(a===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return Vu=t,null}function Am(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(nl()){case pn:return 2;case Xn:return 8;case wa:case Rs:return 32;case al:return 268435456;default:return 32}default:return 32}}var Kc=!1,ha=null,ga=null,ma=null,ki=new Map,Ki=new Map,pa=[],F1="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 zm(t,e){switch(t){case"focusin":case"focusout":ha=null;break;case"dragenter":case"dragleave":ga=null;break;case"mouseover":case"mouseout":ma=null;break;case"pointerover":case"pointerout":ki.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ki.delete(e.pointerId)}}function Ii(t,e,a,i,s,c){return t===null||t.nativeEvent!==c?(t={blockedOn:e,domEventName:a,eventSystemFlags:i,nativeEvent:c,targetContainers:[s]},e!==null&&(e=Qn(e),e!==null&&Nm(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,s!==null&&e.indexOf(s)===-1&&e.push(s),t)}function W1(t,e,a,i,s){switch(e){case"focusin":return ha=Ii(ha,t,e,a,i,s),!0;case"dragenter":return ga=Ii(ga,t,e,a,i,s),!0;case"mouseover":return ma=Ii(ma,t,e,a,i,s),!0;case"pointerover":var c=s.pointerId;return ki.set(c,Ii(ki.get(c)||null,t,e,a,i,s)),!0;case"gotpointercapture":return c=s.pointerId,Ki.set(c,Ii(Ki.get(c)||null,t,e,a,i,s)),!0}return!1}function Tm(t){var e=Zn(t.target);if(e!==null){var a=f(e);if(a!==null){if(e=a.tag,e===13){if(e=d(a),e!==null){t.blockedOn=e,To(t.priority,function(){Mm(a)});return}}else if(e===31){if(e=g(a),e!==null){t.blockedOn=e,To(t.priority,function(){Mm(a)});return}}else if(e===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Gu(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var a=$c(t.nativeEvent);if(a===null){a=t.nativeEvent;var i=new a.constructor(a.type,a);ks=i,a.target.dispatchEvent(i),ks=null}else return e=Qn(a),e!==null&&Nm(e),t.blockedOn=a,!1;e.shift()}return!0}function Cm(t,e,a){Gu(t)&&a.delete(e)}function P1(){Kc=!1,ha!==null&&Gu(ha)&&(ha=null),ga!==null&&Gu(ga)&&(ga=null),ma!==null&&Gu(ma)&&(ma=null),ki.forEach(Cm),Ki.forEach(Cm)}function Xu(t,e){t.blockedOn===e&&(t.blockedOn=null,Kc||(Kc=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,P1)))}var Zu=null;function Dm(t){Zu!==t&&(Zu=t,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Zu===t&&(Zu=null);for(var e=0;e<t.length;e+=3){var a=t[e],i=t[e+1],s=t[e+2];if(typeof i!="function"){if(kc(i||a)===null)continue;break}var c=Qn(a);c!==null&&(t.splice(e,3),e-=3,$r(c,{pending:!0,data:s,method:a.method,action:i},i,s))}}))}function Xl(t){function e(O){return Xu(O,t)}ha!==null&&Xu(ha,t),ga!==null&&Xu(ga,t),ma!==null&&Xu(ma,t),ki.forEach(e),Ki.forEach(e);for(var a=0;a<pa.length;a++){var i=pa[a];i.blockedOn===t&&(i.blockedOn=null)}for(;0<pa.length&&(a=pa[0],a.blockedOn===null);)Tm(a),a.blockedOn===null&&pa.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(i=0;i<a.length;i+=3){var s=a[i],c=a[i+1],p=s[he]||null;if(typeof c=="function")p||Dm(a);else if(p){var b=null;if(c&&c.hasAttribute("formAction")){if(s=c,p=c[he]||null)b=p.formAction;else if(kc(s)!==null)continue}else b=p.action;typeof b=="function"?a[i+1]=b:(a.splice(i,3),i-=3),Dm(a)}}}function Om(){function t(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(p){return s=p})},focusReset:"manual",scroll:"manual"})}function e(){s!==null&&(s(),s=null),i||setTimeout(a,20)}function a(){if(!i&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,s=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(a,100),function(){i=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),s!==null&&(s(),s=null)}}}function Ic(t){this._internalRoot=t}Qu.prototype.render=Ic.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(u(409));var a=e.current,i=He();Em(a,i,t,e,null,null)},Qu.prototype.unmount=Ic.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Em(t.current,2,null,t,null,null),Nu(),e[vn]=null}};function Qu(t){this._internalRoot=t}Qu.prototype.unstable_scheduleHydration=function(t){if(t){var e=zo();t={blockedOn:null,target:t,priority:e};for(var a=0;a<pa.length&&e!==0&&e<pa[a].priority;a++);pa.splice(a,0,t),a===0&&Tm(t)}};var Rm=l.version;if(Rm!=="19.2.5")throw Error(u(527,Rm,"19.2.5"));R.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(u(188)):(t=Object.keys(t).join(","),Error(u(268,t)));return t=h(e),t=t!==null?v(t):null,t=t===null?null:t.stateNode,t};var tx={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:N,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$u.isDisabled&&$u.supportsFiber)try{Na=$u.inject(tx),me=$u}catch{}}return Fi.createRoot=function(t,e){if(!r(t))throw Error(u(299));var a=!1,i="",s=Yh,c=Vh,p=Gh;return e!=null&&(e.unstable_strictMode===!0&&(a=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(s=e.onUncaughtError),e.onCaughtError!==void 0&&(c=e.onCaughtError),e.onRecoverableError!==void 0&&(p=e.onRecoverableError)),e=bm(t,1,!1,null,null,a,i,null,s,c,p,Om),t[vn]=e.current,Cc(t),new Ic(e)},Fi.hydrateRoot=function(t,e,a){if(!r(t))throw Error(u(299));var i=!1,s="",c=Yh,p=Vh,b=Gh,O=null;return a!=null&&(a.unstable_strictMode===!0&&(i=!0),a.identifierPrefix!==void 0&&(s=a.identifierPrefix),a.onUncaughtError!==void 0&&(c=a.onUncaughtError),a.onCaughtError!==void 0&&(p=a.onCaughtError),a.onRecoverableError!==void 0&&(b=a.onRecoverableError),a.formState!==void 0&&(O=a.formState)),e=bm(t,1,!0,e,a??null,i,s,O,c,p,b,Om),e.context=_m(null),a=e.current,i=He(),i=li(i),s=ea(i),s.callback=null,na(a,s,i),a=i,e.current.lanes=a,Aa(e,a),rn(e),t[vn]=e.current,Cc(t),new Qu(e)},Fi.version="19.2.5",Fi}var Xm;function rx(){if(Xm)return Wc.exports;Xm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Wc.exports=sx(),Wc.exports}var cx=rx();const Zm=n=>{let l;const o=new Set,u=(h,v)=>{const y=typeof h=="function"?h(l):h;if(!Object.is(y,l)){const x=l;l=v??(typeof y!="object"||y===null)?y:Object.assign({},l,y),o.forEach(S=>S(l,x))}},r=()=>l,g={setState:u,getState:r,getInitialState:()=>m,subscribe:h=>(o.add(h),()=>o.delete(h))},m=l=n(u,r,g);return g},fx=(n=>n?Zm(n):Zm),dx=n=>n;function hx(n,l=dx){const o=no.useSyncExternalStore(n.subscribe,no.useCallback(()=>l(n.getState()),[n,l]),no.useCallback(()=>l(n.getInitialState()),[n,l]));return no.useDebugValue(o),o}const Qm=n=>{const l=fx(n),o=u=>hx(l,u);return Object.assign(o,l),o},gx=(n=>n?Qm(n):Qm);function $m(n){return Array.isArray(n.images)}async function en(n,l){const o=await fetch(n,l),u=await o.json().catch(()=>({}));if(!o.ok){const r=u.error,f=typeof r=="string"?r:r?.message??`Request failed: ${o.status}`,d=new Error(f);throw d.status=o.status,typeof r!="string"&&r?.code&&(d.code=r.code),typeof u.currentVersion=="number"&&(d.currentVersion=u.currentVersion),d}return u}function nf(n){const l=new URLSearchParams;n?.kind&&l.set("kind",n.kind),n?.sessionId&&l.set("sessionId",n.sessionId);const o=l.size>0?`?${l.toString()}`:"";return en(`/api/inflight${o}`)}async function km(n){await fetch(`/api/inflight/${encodeURIComponent(n)}`,{method:"DELETE"}).catch(()=>{})}function mx(){return en("/api/oauth/status")}function px(){return en("/api/billing")}function yx(n){return en("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}function Km(n=50){return en(`/api/history?limit=${n}`)}async function vx(n){const l=await fetch("/api/node/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),o=await l.json().catch(()=>({}));if(!l.ok){const u=o,r=u?.error?.message??`Request failed: ${l.status}`,f=new Error(r);throw f.code=u?.error?.code,f}return o}function xx(){return en("/api/sessions")}function Sx(n){return en("/api/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:n})})}function sp(n){return en(`/api/sessions/${encodeURIComponent(n)}`)}function bx(n,l){return en(`/api/sessions/${encodeURIComponent(n)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:l})})}function _x(n){return en(`/api/sessions/${encodeURIComponent(n)}`,{method:"DELETE"})}function Ex(n,l,o,u){return en(`/api/sessions/${encodeURIComponent(n)}/graph`,{method:"PUT",headers:{"Content-Type":"application/json","If-Match":String(l)},body:JSON.stringify({nodes:o,edges:u})})}function wx(n,l=256){return new Promise(o=>{const u=new Image;u.onload=()=>{const r=Math.min(1,l/Math.max(u.width,u.height)),f=document.createElement("canvas");f.width=u.width*r,f.height=u.height*r;const d=f.getContext("2d");if(!d)return o(n);d.drawImage(u,0,0,f.width,f.height),o(f.toDataURL("image/jpeg",.6))},u.onerror=()=>o(n),u.src=n})}function Im(n){return Math.round(n/16)*16}const Nx=[{value:"1024x1024",label:"1024²",sub:"1:1"},{value:"1536x1024",label:"1536×1024",sub:"3:2"},{value:"1024x1536",label:"1024×1536",sub:"2:3"}],Mx=[{value:"1360x1024",label:"1360×1024",sub:"4:3"},{value:"1024x1360",label:"1024×1360",sub:"3:4"},{value:"1824x1024",label:"1824×1024",sub:"16:9"}],Ax=[{value:"1024x1824",label:"1024×1824",sub:"9:16"},{value:"2048x2048",label:"2048²",sub:"2K 1:1"},{value:"2048x1152",label:"2048×1152",sub:"2K 16:9"}],zx=[{value:"1152x2048",label:"1152×2048",sub:"2K 9:16"},{value:"3824x2160",label:"3824×2160",sub:"4K 16:9"},{value:"2160x3824",label:"2160×3824",sub:"4K 9:16"}],Tx=[{value:"auto",label:"auto",sub:"model"},{value:"custom",label:"Custom",sub:"free"}],Wi=()=>"nc_"+Math.random().toString(36).slice(2,10);function Jm(n,l){return{x:n*360,y:l*320}}function Cx(){try{const n=localStorage.getItem("ima2.rightPanelOpen");return n===null?!0:JSON.parse(n)===!0}catch{return!0}}function Dx(){try{const n=localStorage.getItem("ima2.uiMode");if(n==="node"||n==="classic")return n}catch{}return"classic"}const rp=18e4;function af(){try{const n=localStorage.getItem("ima2.inFlight");if(!n)return[];const l=JSON.parse(n);if(!Array.isArray(l))return[];const o=Date.now();return l.filter(u=>u&&typeof u.id=="string"&&typeof u.prompt=="string"&&typeof u.startedAt=="number"&&o-u.startedAt<rp).map(u=>({id:u.id,prompt:u.prompt,startedAt:u.startedAt}))}catch{return[]}}function ka(n){try{localStorage.setItem("ima2.inFlight",JSON.stringify(n))}catch(l){const o=window;if(!o.__ima2QuotaWarned){o.__ima2QuotaWarned=!0,console.warn("[ima2] localStorage write failed:",l);try{ht.getState().showToast("Local storage full — recent state may not persist",!0)}catch{}}}}function Fm(){try{const n=localStorage.getItem("ima2.selectedFilename");return typeof n=="string"&&n.length>0?n:null}catch{return null}}function ns(n){try{n?localStorage.setItem("ima2.selectedFilename",n):localStorage.removeItem("ima2.selectedFilename")}catch{}}const as=200;function cp(n){const l=n.nodes.map(u=>{const r=u.data??{},f=typeof r.imageUrl=="string"&&r.imageUrl.length>0?r.imageUrl:null,d=typeof r.serverNodeId=="string"&&r.serverNodeId.length>0?`/generated/${r.serverNodeId}.png`:null,g=f??d,m={clientId:u.id,serverNodeId:r.serverNodeId??null,parentServerNodeId:r.parentServerNodeId??null,prompt:typeof r.prompt=="string"?r.prompt:"",imageUrl:g,status:r.status??(g?"ready":"empty"),pendingRequestId:r.pendingRequestId??null,pendingPhase:r.pendingPhase??null,error:r.error,elapsed:r.elapsed,webSearchCalls:r.webSearchCalls};return{id:u.id,type:"imageNode",position:{x:u.x,y:u.y},data:m}}),o=n.edges.map(u=>({id:u.id,source:u.source,target:u.target}));return{graphNodes:l,graphEdges:o,graphVersion:n.graphVersion}}const ht=gx((n,l)=>({provider:"oauth",quality:"low",sizePreset:"1024x1024",customW:1920,customH:1088,format:"png",moderation:"low",count:1,prompt:"",referenceImages:[],addReferences:async o=>{const u=5-l().referenceImages.length,r=o.slice(0,Math.max(0,u)),d=(await Promise.all(r.map(g=>new Promise(m=>{const h=new FileReader;h.onload=()=>m(typeof h.result=="string"?h.result:null),h.onerror=()=>m(null),h.readAsDataURL(g)})))).filter(g=>!!g);n(g=>({referenceImages:[...g.referenceImages,...d].slice(0,5)})),o.length>u&&l().showToast("Maximum 5 references; extras ignored",!0)},addReferenceDataUrl:o=>{n(u=>u.referenceImages.length>=5?u:{referenceImages:[...u.referenceImages,o]})},removeReference:o=>{n(u=>({referenceImages:u.referenceImages.filter((r,f)=>f!==o)}))},clearReferences:()=>n({referenceImages:[]}),useCurrentAsReference:async()=>{const o=l().currentImage;if(!o){l().showToast("No current image to use",!0);return}if(l().referenceImages.length>=5){l().showToast("Reference slots are full (max 5)",!0);return}let u=o.image;if(!u.startsWith("data:"))try{const f=await(await fetch(u)).blob();u=await new Promise((d,g)=>{const m=new FileReader;m.onload=()=>typeof m.result=="string"?d(m.result):g(new Error("read failed")),m.onerror=()=>g(m.error??new Error("read failed")),m.readAsDataURL(f)})}catch{l().showToast("Could not fetch current image",!0);return}n(r=>({referenceImages:[...r.referenceImages,u]})),l().showToast("Added current image as reference")},activeGenerations:af().length,inFlight:af(),startInFlightPolling:()=>{if(typeof window>"u")return;const o=window;if(o.__ima2InflightTimer)return;const u=async()=>{if(l().inFlight.length===0){o.__ima2InflightTimer&&(clearInterval(o.__ima2InflightTimer),o.__ima2InflightTimer=void 0);return}try{const f=l().uiMode==="node"?"node":"classic",d=f==="node"?l().activeSessionId??void 0:void 0,{jobs:g}=await nf({kind:f,sessionId:d}),m=new Map(g.map(S=>[S.requestId,S.phase]));let h=!1;const v=Date.now(),y=5e3,x=[];for(const S of l().inFlight){if(!m.has(S.id)&&v-S.startedAt>y){h=!0;continue}const _=m.get(S.id);_&&_!==S.phase?(h=!0,x.push({...S,phase:_})):x.push(S)}h&&(ka(x),n({inFlight:x,activeGenerations:x.length}))}catch{}try{const{items:f}=await Km(as),d=f.map(y=>({image:y.url,filename:y.filename,thumb:y.url,prompt:y.prompt??void 0,size:y.size??void 0,quality:y.quality??void 0,format:y.format,createdAt:y.createdAt})),g=l().history,m=d.filter(y=>!g.some(x=>x.filename===y.filename));m.length>0&&n(y=>{const x=y.currentImage??m[0];return!y.currentImage&&m[0]?.filename&&ns(m[0].filename),{history:[...m,...y.history].slice(0,as),currentImage:x}});const h=Date.now(),v=l().inFlight.filter(y=>h-y.startedAt<rp);v.length!==l().inFlight.length&&(ka(v),n({inFlight:v,activeGenerations:v.length}))}catch{}};o.__ima2InflightTimer=window.setInterval(u,1500)},reconcileInflight:async()=>{try{const o=l().uiMode==="node"?"node":"classic",u=o==="node"?l().activeSessionId??void 0:void 0,{jobs:r}=await nf({kind:o,sessionId:u}),f=new Set(r.map(v=>v.requestId)),d=Date.now(),m=l().inFlight.filter(v=>f.has(v.id)||d-v.startedAt<1e4),h=new Set(m.map(v=>v.id));for(const v of r)h.has(v.requestId)||m.push({id:v.requestId,prompt:v.prompt||"",startedAt:v.startedAt});ka(m),n({inFlight:m,activeGenerations:m.length}),m.length>0&&l().startInFlightPolling()}catch{}},syncFromStorage:()=>{const o=af(),u=Fm();n(r=>({inFlight:o,activeGenerations:o.length,currentImage:u&&r.currentImage?.filename!==u?r.history.find(f=>f.filename===u)??r.currentImage:r.currentImage})),o.length>0&&l().startInFlightPolling()},currentImage:null,history:[],toast:null,rightPanelOpen:Cx(),toggleRightPanel:()=>n(o=>{const u=!o.rightPanelOpen;try{localStorage.setItem("ima2.rightPanelOpen",JSON.stringify(u))}catch{}return{rightPanelOpen:u}}),galleryOpen:!1,openGallery:()=>n({galleryOpen:!0}),closeGallery:()=>n({galleryOpen:!1}),uiMode:Dx(),setUIMode:o=>{try{localStorage.setItem("ima2.uiMode",o)}catch{}n({uiMode:o})},graphNodes:[],graphEdges:[],setGraphNodes:o=>{n({graphNodes:o}),l().scheduleGraphSave()},setGraphEdges:o=>{n({graphEdges:o}),l().scheduleGraphSave()},sessions:[],activeSessionId:null,activeSessionGraphVersion:null,sessionLoading:!1,async loadSessions(){try{const{sessions:o}=await xx();n({sessions:o});const u=l().activeSessionId;!u&&o.length>0?await l().switchSession(o[0].id):!u&&o.length===0&&await l().createAndSwitchSession("My first graph")}catch(o){console.warn("[sessions] load failed:",o)}},async switchSession(o){n({sessionLoading:!0}),await l().flushGraphSave();try{const{session:u}=await sp(o),{graphNodes:r,graphEdges:f,graphVersion:d}=cp(u);n({activeSessionId:o,activeSessionGraphVersion:d,graphNodes:r,graphEdges:f,sessionLoading:!1}),l().reconcileGraphPending()}catch(u){console.warn("[sessions] switch failed:",u),n({sessionLoading:!1}),l().showToast("Session load failed",!0)}},async reconcileGraphPending(){const o=l().activeSessionId;if(!o||l().graphNodes.filter(g=>g.data?.pendingRequestId&&(g.data.status==="pending"||g.data.status==="reconciling")).length===0)return;let r=[];try{r=(await nf({kind:"node",sessionId:o})).jobs}catch{return}const f=new Map(r.map(g=>[g.requestId,g.phase])),d=l().graphNodes.map(g=>{const m=g.data?.pendingRequestId;if(!m||g.data.status!=="pending"&&g.data.status!=="reconciling")return g;if(f.has(m)){const v=f.get(m)??null;return{...g,data:{...g.data,status:"reconciling",pendingPhase:v}}}const h=!!g.data.imageUrl||!!g.data.serverNodeId;return{...g,data:{...g.data,pendingRequestId:null,pendingPhase:null,status:h?"ready":"stale",error:h?void 0:"Generation did not complete. Retry from this node."}}});n({graphNodes:d})},async createAndSwitchSession(o="Untitled"){try{const{session:u}=await Sx(o);n({sessions:[u,...l().sessions],activeSessionId:u.id,activeSessionGraphVersion:u.graphVersion,graphNodes:[],graphEdges:[]})}catch(u){console.warn("[sessions] create failed:",u),l().showToast("Create session failed",!0)}},async renameCurrentSession(o){const u=l().activeSessionId;if(u)try{await bx(u,o),n({sessions:l().sessions.map(r=>r.id===u?{...r,title:o,updatedAt:Date.now()}:r)})}catch{l().showToast("Rename failed",!0)}},async deleteSessionById(o){try{await _x(o);const u=l().sessions.filter(r=>r.id!==o);n({sessions:u}),l().activeSessionId===o&&(n({activeSessionId:null,activeSessionGraphVersion:null,graphNodes:[],graphEdges:[]}),u.length>0?await l().switchSession(u[0].id):await l().createAndSwitchSession("My first graph"))}catch{l().showToast("Delete failed",!0)}},scheduleGraphSave(){Hx(l,n)},async flushGraphSave(){await jx(l,n)},addRootNode:()=>{const o=Wi(),u=0,r=l().graphNodes.filter(d=>!d.data.parentServerNodeId).length,f={id:o,type:"imageNode",position:Jm(u,r),data:{clientId:o,serverNodeId:null,parentServerNodeId:null,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};return n({graphNodes:[...l().graphNodes,f]}),l().scheduleGraphSave(),o},addChildNode:o=>{const u=l().graphNodes.find(m=>m.id===o);if(!u)return o;const r=Wi(),f=l().graphEdges.filter(m=>m.source===o).length,d={id:r,type:"imageNode",position:{x:u.position.x+360,y:u.position.y+f*320},data:{clientId:r,serverNodeId:null,parentServerNodeId:u.data.serverNodeId,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},g={id:`${o}->${r}`,source:o,target:r};return n({graphNodes:[...l().graphNodes,d],graphEdges:[...l().graphEdges,g]}),l().scheduleGraphSave(),r},addSiblingNode:o=>{const u=l().graphNodes.find(y=>y.id===o);if(!u)return o;const r=l().graphEdges.find(y=>y.target===o);if(!r){const y=Wi(),x=0,S=l().graphNodes.filter(A=>!A.data.parentServerNodeId).length,_={id:y,type:"imageNode",position:Jm(x,S),data:{clientId:y,serverNodeId:null,parentServerNodeId:null,prompt:u.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};return n({graphNodes:[...l().graphNodes,_]}),l().scheduleGraphSave(),y}const f=r.source,d=l().graphNodes.find(y=>y.id===f);if(!d)return o;const g=Wi(),m=l().graphEdges.filter(y=>y.source===f).length,h={id:g,type:"imageNode",position:{x:d.position.x+360,y:d.position.y+m*320},data:{clientId:g,serverNodeId:null,parentServerNodeId:u.data.parentServerNodeId,prompt:u.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},v={id:`${f}->${g}`,source:f,target:g};return n({graphNodes:[...l().graphNodes,h],graphEdges:[...l().graphEdges,v]}),l().scheduleGraphSave(),g},updateNodePrompt:(o,u)=>{n({graphNodes:l().graphNodes.map(r=>r.id===o?{...r,data:{...r.data,prompt:u}}:r)}),l().scheduleGraphSave()},async generateNode(o){const r=l().graphNodes.find(S=>S.id===o)?.data.status==="ready"?l().addSiblingNode(o):o,f=l().graphNodes.find(S=>S.id===r);if(!f)return;const{prompt:d,parentServerNodeId:g}=f.data;if(!d.trim()){l().showToast("Prompt required",!0);return}const m=l(),h=m.getResolvedSize(),v=`fn_${r}`,y=Date.now(),x=[...m.inFlight,{id:v,prompt:d,startedAt:y}];ka(x),n({graphNodes:l().graphNodes.map(S=>S.id===r?{...S,data:{...S.data,status:"pending",pendingRequestId:v,pendingPhase:"queued",error:void 0}}:S),activeGenerations:m.activeGenerations+1,inFlight:x}),l().startInFlightPolling();try{const S=await vx({parentNodeId:g,prompt:d,quality:m.quality,size:h,format:m.format,requestId:v,...m.referenceImages.length&&!g?{references:m.referenceImages.map(_=>_.replace(/^data:[^;]+;base64,/,""))}:{}});n({graphNodes:l().graphNodes.map(_=>_.id===r?{..._,data:{..._.data,serverNodeId:S.nodeId,imageUrl:S.url,status:"ready",pendingRequestId:null,pendingPhase:null,elapsed:S.elapsed,webSearchCalls:S.webSearchCalls}}:_)}),l().showToast(`Node ${S.nodeId.slice(0,8)}… in ${S.elapsed}s`)}catch(S){const _=S instanceof Error?S.message:"Node generation failed";n({graphNodes:l().graphNodes.map(A=>A.id===r?{...A,data:{...A.data,status:"error",pendingRequestId:null,pendingPhase:null,error:_}}:A)}),l().showToast(_,!0)}finally{const S=l().inFlight.filter(_=>_.id!==v);ka(S),n({activeGenerations:Math.max(0,l().activeGenerations-1),inFlight:S}),l().scheduleGraphSave()}},deleteNode:o=>{const r=l().graphNodes.find(f=>f.id===o)?.data?.pendingRequestId;r&&km(r),n({graphNodes:l().graphNodes.filter(f=>f.id!==o),graphEdges:l().graphEdges.filter(f=>f.source!==o&&f.target!==o)}),l().scheduleGraphSave()},deleteNodes:o=>{const u=new Set(o);for(const r of l().graphNodes)u.has(r.id)&&r.data?.pendingRequestId&&km(r.data.pendingRequestId);n({graphNodes:l().graphNodes.filter(r=>!u.has(r.id)),graphEdges:l().graphEdges.filter(r=>!u.has(r.source)&&!u.has(r.target))}),l().scheduleGraphSave()},addChildNodeAt:(o,u)=>{const r=l().graphNodes.find(m=>m.id===o);if(!r)return o;const f=Wi(),d={id:f,type:"imageNode",position:u,data:{clientId:f,serverNodeId:null,parentServerNodeId:r.data.serverNodeId,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},g={id:`${o}->${f}`,source:o,target:f};return n({graphNodes:[...l().graphNodes,d],graphEdges:[...l().graphEdges,g]}),l().scheduleGraphSave(),f},connectNodes:(o,u)=>{if(o===u||l().graphEdges.find(d=>d.source===o&&d.target===u))return;const f=l().graphNodes.find(d=>d.id===o);f&&(n({graphNodes:l().graphNodes.map(d=>d.id===u?{...d,data:{...d.data,parentServerNodeId:f.data.serverNodeId}}:d),graphEdges:[...l().graphEdges,{id:`${o}->${u}`,source:o,target:u}]}),l().scheduleGraphSave())},setProvider:o=>n({provider:o}),setQuality:o=>n({quality:o}),setSizePreset:o=>n({sizePreset:o}),setCustomSize:(o,u)=>n({customW:Im(o),customH:Im(u)}),setFormat:o=>n({format:o}),setModeration:o=>n({moderation:o}),setCount:o=>n({count:o}),setPrompt:o=>n({prompt:o}),selectHistory:o=>{ns(o.filename??null),n({currentImage:o})},getResolvedSize:()=>{const{sizePreset:o,customW:u,customH:r}=l();return o==="custom"?`${u}x${r}`:o},async generate(){const o=l(),u=o.prompt.trim();if(!u)return;const r=o.getResolvedSize(),f=`f_${Date.now()}_${Math.random().toString(36).slice(2,7)}`,d=Date.now(),g=[...o.inFlight,{id:f,prompt:u,startedAt:d}];ka(g),n({activeGenerations:o.activeGenerations+1,inFlight:g}),l().startInFlightPolling();try{const m={prompt:u,quality:o.quality,size:r,format:o.format,moderation:o.moderation,provider:o.provider,n:o.count,requestId:f,...o.referenceImages.length?{references:o.referenceImages.map(v=>v.replace(/^data:[^;]+;base64,/,""))}:{}},h=await yx(m);if($m(h)&&h.images.length>1){for(const v of h.images){const y={image:v.image,filename:v.filename,prompt:u,elapsed:h.elapsed,provider:h.provider,usage:h.usage,quality:h.quality??o.quality,size:h.size??r};await Wm(y,n,l)}l().showToast(`${h.images.length} images in ${h.elapsed}s`)}else{let v;if($m(h)){const y=h.images[0];v={image:y.image,filename:y.filename,prompt:u,elapsed:h.elapsed,provider:h.provider,usage:h.usage,quality:h.quality??o.quality,size:h.size??r}}else v={image:h.image,filename:h.filename,prompt:u,elapsed:h.elapsed,provider:h.provider,usage:h.usage,quality:h.quality??o.quality,size:h.size??r};await Wm(v,n,l),l().showToast(`Generated in ${h.elapsed}s`)}}catch(m){const h=m instanceof Error?m.message:"Generation failed";l().showToast(h,!0)}finally{const m=l().inFlight.filter(h=>h.id!==f);ka(m),n({activeGenerations:Math.max(0,l().activeGenerations-1),inFlight:m})}},hydrateHistory(){(async()=>{try{const u=(await Km(as)).items.map(r=>({image:r.url,url:r.url,filename:r.filename,prompt:r.prompt||void 0,provider:r.provider,quality:r.quality||void 0,size:r.size||void 0,usage:r.usage??void 0,thumb:r.url,createdAt:r.createdAt}));if(u.length>0){const r=Fm(),f=r?u.find(d=>d.filename===r):null;n({history:u,currentImage:f??u[0]}),f||ns(u[0]?.filename??null)}}catch(o){console.warn("[history] load failed:",o)}})()},showToast(o,u=!1){n({toast:{message:o,error:u,id:Date.now()+Math.random()}})}})),Ox=800;let fn=null,rs=null;async function Rx(n,l){const o=n().activeSessionId;if(!o)return;const{session:u}=await sp(o),{graphNodes:r,graphEdges:f,graphVersion:d}=cp(u);l({graphNodes:r,graphEdges:f,activeSessionGraphVersion:d}),n().showToast("Session changed in another tab — reloaded latest graph",!0)}function fp(n,l){const o=n().activeSessionId,u=n().activeSessionGraphVersion;if(!o||u==null)return Promise.resolve();const{graphNodes:r,graphEdges:f}=n(),d=r.map(m=>({id:m.id,x:m.position.x,y:m.position.y,data:m.data})),g=f.map(m=>({id:m.id,source:m.source,target:m.target,data:{}}));return Ex(o,u,d,g).then(m=>{l({activeSessionGraphVersion:m.graphVersion})}).catch(async m=>{if(m.status===409){await Rx(n,l);return}console.warn("[sessions] save failed:",m)})}function Hx(n,l){const o=n();o.activeSessionId&&(o.sessionLoading||(fn&&clearTimeout(fn),fn=setTimeout(()=>{fn=null,rs=fp(n,l).finally(()=>{rs=null})},Ox)))}async function jx(n,l){fn?(clearTimeout(fn),fn=null,await fp(n,l)):rs&&await rs}function Ux(n){const l=n();if(!l.activeSessionId||l.activeSessionGraphVersion==null)return;fn&&(clearTimeout(fn),fn=null);const o=l.graphNodes.map(d=>({id:d.id,x:d.position.x,y:d.position.y,data:d.data})),u=l.graphEdges.map(d=>({id:d.id,source:d.source,target:d.target,data:{}})),r=`/api/sessions/${encodeURIComponent(l.activeSessionId)}/graph`,f=JSON.stringify({nodes:o,edges:u});try{fetch(r,{method:"PUT",headers:{"Content-Type":"application/json","If-Match":String(l.activeSessionGraphVersion)},body:f,keepalive:!0})}catch{}}async function Wm(n,l,o){const u=await wx(n.image).catch(()=>n.image),r=n.filename?`/generated/${n.filename}`:n.image,f={...n,thumb:u,url:r,createdAt:n.createdAt||Date.now()},d=[f,...o().history].slice(0,as);ns(f.filename??null),l({history:d,currentImage:f})}function Bx(){const[n,l]=J.useState(null);return J.useEffect(()=>{let o=!1,u=null;const r=async()=>{try{const f=await mx();if(o)return;l(f),f.status==="starting"&&(u=setTimeout(r,3e3))}catch{o||l(null)}};return r(),()=>{o=!0,u&&clearTimeout(u)}},[]),n}function dp(){const[n,l]=J.useState(null),[o,u]=J.useState(!1);return J.useEffect(()=>{let r=!1;return px().then(f=>{r||l(f)}).catch(()=>{r||u(!0)}),()=>{r=!0}},[]),{data:n,error:o}}function qx({open:n,providerLabel:l,reason:o,hint:u,onClose:r}){return J.useEffect(()=>{if(!n)return;const f=d=>{d.key==="Escape"&&r()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n,r]),n?w.jsx("div",{className:"modal-backdrop",onClick:r,role:"presentation",children:w.jsxs("div",{className:"modal",role:"dialog","aria-modal":"true","aria-label":`${l} unavailable`,onClick:f=>f.stopPropagation(),children:[w.jsxs("div",{className:"modal__title",children:[l," unavailable"]}),w.jsxs("div",{className:"modal__body",children:[w.jsx("p",{children:o}),u?w.jsx("p",{className:"modal__hint",children:u}):null]}),w.jsx("div",{className:"modal__actions",children:w.jsx("button",{type:"button",className:"modal__btn",onClick:r,children:"OK"})})]})}):null}function Lx(){const n=Bx(),{data:l}=dp(),o=n?.status==="ready";let u="OAuth proxy not ready yet.",r;n?.status==="auth_required"?(u="Codex login required.",r="Run `codex login` in a terminal, then reload this page."):n?.status==="starting"?u="OAuth proxy is starting. Wait a few seconds and try again.":n||(u="Cannot reach the server. Check that the backend is running.");const f=l?.apiKeyValid===!0;return{oauth:{ok:o,reason:u,hint:r},api:{ok:f,reason:f?"":"API key is not configured or invalid. Set OPENAI_API_KEY in the server .env file."}}}const Pm=[{value:"oauth",label:"OAuth"},{value:"api",label:"API Key"}];function Yx(){const n=ht(g=>g.provider),l=ht(g=>g.setProvider),o=Lx(),[u,r]=J.useState(null),f=g=>{o[g].ok?l(g):r(g)},d=u?{label:Pm.find(g=>g.value===u).label,...o[u]}:null;return w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"section-title",children:"Provider"}),w.jsx("div",{className:"provider-row",children:Pm.map(g=>{const m=n===g.value,h=o[g.value].ok;return w.jsxs("button",{type:"button",className:`provider-pill${m?" selected":""}`,onClick:()=>f(g.value),title:h?`${g.label} ready`:o[g.value].reason,"aria-label":`${g.label}: ${h?"ready":"unavailable"}`,"aria-pressed":m,children:[w.jsx("span",{className:`status-dot ${h?"status-dot--ok":"status-dot--bad"}`,"aria-hidden":"true"}),w.jsx("span",{children:g.label}),w.jsx("span",{className:"sr-only",children:h?"(ready)":"(unavailable)"})]},g.value)})}),w.jsx(qx,{open:!!d,providerLabel:d?.label??"",reason:d?.reason??"",hint:d?.hint,onClose:()=>r(null)})]})}function Vx(){return ht(n=>n.uiMode),ht(n=>n.setUIMode),null}const lf=5;function Gx(){const n=ht(A=>A.prompt),l=ht(A=>A.setPrompt),o=ht(A=>A.generate),u=ht(A=>A.referenceImages),r=ht(A=>A.addReferences),f=ht(A=>A.removeReference),d=ht(A=>A.useCurrentAsReference),g=ht(A=>A.currentImage),m=J.useRef(null),[h,v]=J.useState(!1),y=u.length<lf,x=A=>{A.preventDefault(),v(!1);const T=Array.from(A.dataTransfer.files).filter(z=>z.type.startsWith("image/"));T.length>0&&r(T)},S=A=>{A.preventDefault(),h||v(!0)},_=A=>{A.currentTarget.contains(A.relatedTarget)||v(!1)};return w.jsxs("div",{className:`composer${h?" composer--drag":""}`,onDrop:x,onDragOver:S,onDragLeave:_,children:[w.jsxs("div",{className:"composer__header",children:[w.jsx("span",{className:"section-title composer__label",children:"Prompt"}),u.length>0&&w.jsxs("span",{className:"composer__count",children:[u.length,"/",lf," refs"]})]}),u.length>0&&w.jsx("div",{className:"composer__chips",children:u.map((A,T)=>w.jsxs("div",{className:"composer__chip",title:`Reference ${T+1}`,children:[w.jsx("img",{src:A,alt:`reference ${T+1}`}),w.jsx("button",{type:"button",className:"composer__chip-remove",onClick:()=>f(T),"aria-label":`Remove reference ${T+1}`,children:"✕"})]},T))}),w.jsx("textarea",{className:"prompt-area composer__textarea",value:n,placeholder:u.length>0?"Describe what to do with the attached image(s)…":"Describe the image, or drag & drop images to attach as context…",onChange:A=>l(A.target.value),onKeyDown:A=>{A.key==="Enter"&&(A.metaKey||A.ctrlKey)&&(A.preventDefault(),o())}}),w.jsxs("div",{className:"composer__toolbar",children:[w.jsxs("button",{type:"button",className:"composer__tool",onClick:()=>y&&m.current?.click(),disabled:!y,title:"Attach reference image","aria-label":"Attach reference image",children:[w.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:w.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})}),w.jsx("span",{children:"Attach"})]}),w.jsxs("button",{type:"button",className:"composer__tool",onClick:()=>{d()},disabled:!g||!y,title:"Use current result as reference",children:[w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[w.jsx("polyline",{points:"23 4 23 10 17 10"}),w.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]}),w.jsx("span",{children:"Use current"})]}),w.jsx("span",{className:"composer__hint",children:"⌘/Ctrl + Enter to generate"})]}),h&&w.jsxs("div",{className:"composer__dropzone","aria-hidden":"true",children:["Drop to attach as reference (max ",lf,")"]}),w.jsx("input",{ref:m,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:A=>{const T=Array.from(A.target.files??[]);T.length>0&&r(T),A.target.value=""}})]})}function Xx(){const n=ht(r=>r.activeGenerations),l=ht(r=>r.generate),o=n>0,u=o?`Generate (${n})`:"Generate";return w.jsx("button",{type:"button",className:`generate-btn${o?" loading":""}`,onClick:()=>{l()},children:u})}function Zx(n,l=28){const o=n.trim().replace(/\s+/g," ");return o.length>l?o.slice(0,l)+"…":o}const Qx={queued:"queued",streaming:"streaming",decoding:"finalizing"};function $x(){const n=ht(l=>l.inFlight);return n.length===0?null:w.jsx("ul",{className:"in-flight-list",children:n.map(l=>{const o=l.phase?Qx[l.phase]??l.phase:"queued";return w.jsxs("li",{className:"in-flight-item","data-phase":l.phase??"queued",children:[w.jsx("span",{className:"in-flight-prompt",children:Zx(l.prompt)}),w.jsx("span",{className:"in-flight-phase",children:o}),w.jsx("span",{className:"in-flight-spinner","aria-hidden":"true"})]},l.id)})})}function kx(){const n=ht(r=>r.history),l=ht(r=>r.currentImage),o=ht(r=>r.selectHistory),u=ht(r=>r.openGallery);return w.jsxs("div",{className:"history-strip",children:[w.jsx("button",{type:"button",className:"history-thumb history-thumb--add",onClick:u,"aria-label":"Open gallery",title:"Open full gallery",children:w.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),w.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),w.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),w.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]})}),n.map((r,f)=>{const d=l?.image===r.image;return w.jsx("img",{src:r.thumb||r.image,alt:"",className:`history-thumb${d?" active":""}`,onClick:()=>o(r)},`${f}-${r.filename??f}`)})]})}function Kx(){return ht(n=>n.uiMode),w.jsxs("aside",{className:"sidebar",children:[w.jsxs("div",{className:"sidebar__scroll",children:[w.jsxs("div",{className:"logo",children:[w.jsx("div",{className:"logo-dot"}),"Image Gen",w.jsx("span",{className:"logo-badge",children:"gpt-image-2"})]}),w.jsx(Vx,{}),w.jsxs(w.Fragment,{children:[w.jsx(Yx,{}),w.jsx(Gx,{}),w.jsx(Xx,{}),w.jsx($x,{})]})]}),w.jsx(kx,{})]})}function Ix(){const n=ht(f=>f.currentImage),l=ht(f=>f.showToast);if(!n)return null;const o=()=>{const f=document.createElement("a");f.href=n.image,f.download=n.filename||"generated.png",f.click()},u=async()=>{try{const d=await(await fetch(n.image)).blob();await navigator.clipboard.write([new ClipboardItem({[d.type]:d})]),l("Copied to clipboard")}catch{l("Copy failed",!0)}},r=()=>{n.prompt&&(navigator.clipboard.writeText(n.prompt),l("Prompt copied"))};return w.jsxs("div",{className:"result-actions",children:[w.jsx("button",{type:"button",className:"action-btn",onClick:o,children:"Download"}),w.jsx("button",{type:"button",className:"action-btn",onClick:u,children:"Copy to clipboard"}),w.jsx("button",{type:"button",className:"action-btn",onClick:r,children:"Copy prompt"})]})}function Jx(){const n=ht(m=>m.currentImage),l=ht(m=>m.activeGenerations),o=ht(m=>m.quality),u=ht(m=>m.getResolvedSize),r=ht(m=>m.showToast),f=()=>{n?.prompt&&(navigator.clipboard.writeText(n.prompt),r("Prompt copied"))},d=n?.quality??o,g=n?.size??u();return w.jsxs("main",{className:"canvas",children:[w.jsx("div",{className:`progress-bar${l>0?" active":""}`}),n?w.jsxs("div",{className:"result-container visible",children:[w.jsx("img",{className:"result-img",src:n.url??n.image,alt:"result"}),n.prompt?w.jsx("div",{className:"result-prompt",onClick:f,children:n.prompt}):null,w.jsx("div",{className:"result-meta",children:[n.elapsed!=null?`${n.elapsed}s`:null,n.usage?`${n.usage.total_tokens??"?"} tokens`:null,d,g,n.provider??null].filter(m=>!!m).join(" · ")}),w.jsx(Ix,{})]}):null]})}function ae(n){if(typeof n=="string"||typeof n=="number")return""+n;let l="";if(Array.isArray(n))for(let o=0,u;o<n.length;o++)(u=ae(n[o]))!==""&&(l+=(l&&" ")+u);else for(let o in n)n[o]&&(l+=(l&&" ")+o);return l}var Fx={value:()=>{}};function bs(){for(var n=0,l=arguments.length,o={},u;n<l;++n){if(!(u=arguments[n]+"")||u in o||/[\s.]/.test(u))throw new Error("illegal type: "+u);o[u]=[]}return new ls(o)}function ls(n){this._=n}function Wx(n,l){return n.trim().split(/^|\s+/).map(function(o){var u="",r=o.indexOf(".");if(r>=0&&(u=o.slice(r+1),o=o.slice(0,r)),o&&!l.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:u}})}ls.prototype=bs.prototype={constructor:ls,on:function(n,l){var o=this._,u=Wx(n+"",o),r,f=-1,d=u.length;if(arguments.length<2){for(;++f<d;)if((r=(n=u[f]).type)&&(r=Px(o[r],n.name)))return r;return}if(l!=null&&typeof l!="function")throw new Error("invalid callback: "+l);for(;++f<d;)if(r=(n=u[f]).type)o[r]=t0(o[r],n.name,l);else if(l==null)for(r in o)o[r]=t0(o[r],n.name,null);return this},copy:function(){var n={},l=this._;for(var o in l)n[o]=l[o].slice();return new ls(n)},call:function(n,l){if((r=arguments.length-2)>0)for(var o=new Array(r),u=0,r,f;u<r;++u)o[u]=arguments[u+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(f=this._[n],u=0,r=f.length;u<r;++u)f[u].value.apply(l,o)},apply:function(n,l,o){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var u=this._[n],r=0,f=u.length;r<f;++r)u[r].value.apply(l,o)}};function Px(n,l){for(var o=0,u=n.length,r;o<u;++o)if((r=n[o]).name===l)return r.value}function t0(n,l,o){for(var u=0,r=n.length;u<r;++u)if(n[u].name===l){n[u]=Fx,n=n.slice(0,u).concat(n.slice(u+1));break}return o!=null&&n.push({name:l,value:o}),n}var xf="http://www.w3.org/1999/xhtml";const e0={svg:"http://www.w3.org/2000/svg",xhtml:xf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _s(n){var l=n+="",o=l.indexOf(":");return o>=0&&(l=n.slice(0,o))!=="xmlns"&&(n=n.slice(o+1)),e0.hasOwnProperty(l)?{space:e0[l],local:n}:n}function tS(n){return function(){var l=this.ownerDocument,o=this.namespaceURI;return o===xf&&l.documentElement.namespaceURI===xf?l.createElement(n):l.createElementNS(o,n)}}function eS(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function hp(n){var l=_s(n);return(l.local?eS:tS)(l)}function nS(){}function Hf(n){return n==null?nS:function(){return this.querySelector(n)}}function aS(n){typeof n!="function"&&(n=Hf(n));for(var l=this._groups,o=l.length,u=new Array(o),r=0;r<o;++r)for(var f=l[r],d=f.length,g=u[r]=new Array(d),m,h,v=0;v<d;++v)(m=f[v])&&(h=n.call(m,m.__data__,v,f))&&("__data__"in m&&(h.__data__=m.__data__),g[v]=h);return new Ue(u,this._parents)}function lS(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function iS(){return[]}function gp(n){return n==null?iS:function(){return this.querySelectorAll(n)}}function oS(n){return function(){return lS(n.apply(this,arguments))}}function uS(n){typeof n=="function"?n=oS(n):n=gp(n);for(var l=this._groups,o=l.length,u=[],r=[],f=0;f<o;++f)for(var d=l[f],g=d.length,m,h=0;h<g;++h)(m=d[h])&&(u.push(n.call(m,m.__data__,h,d)),r.push(m));return new Ue(u,r)}function mp(n){return function(){return this.matches(n)}}function pp(n){return function(l){return l.matches(n)}}var sS=Array.prototype.find;function rS(n){return function(){return sS.call(this.children,n)}}function cS(){return this.firstElementChild}function fS(n){return this.select(n==null?cS:rS(typeof n=="function"?n:pp(n)))}var dS=Array.prototype.filter;function hS(){return Array.from(this.children)}function gS(n){return function(){return dS.call(this.children,n)}}function mS(n){return this.selectAll(n==null?hS:gS(typeof n=="function"?n:pp(n)))}function pS(n){typeof n!="function"&&(n=mp(n));for(var l=this._groups,o=l.length,u=new Array(o),r=0;r<o;++r)for(var f=l[r],d=f.length,g=u[r]=[],m,h=0;h<d;++h)(m=f[h])&&n.call(m,m.__data__,h,f)&&g.push(m);return new Ue(u,this._parents)}function yp(n){return new Array(n.length)}function yS(){return new Ue(this._enter||this._groups.map(yp),this._parents)}function cs(n,l){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=l}cs.prototype={constructor:cs,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,l){return this._parent.insertBefore(n,l)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}};function vS(n){return function(){return n}}function xS(n,l,o,u,r,f){for(var d=0,g,m=l.length,h=f.length;d<h;++d)(g=l[d])?(g.__data__=f[d],u[d]=g):o[d]=new cs(n,f[d]);for(;d<m;++d)(g=l[d])&&(r[d]=g)}function SS(n,l,o,u,r,f,d){var g,m,h=new Map,v=l.length,y=f.length,x=new Array(v),S;for(g=0;g<v;++g)(m=l[g])&&(x[g]=S=d.call(m,m.__data__,g,l)+"",h.has(S)?r[g]=m:h.set(S,m));for(g=0;g<y;++g)S=d.call(n,f[g],g,f)+"",(m=h.get(S))?(u[g]=m,m.__data__=f[g],h.delete(S)):o[g]=new cs(n,f[g]);for(g=0;g<v;++g)(m=l[g])&&h.get(x[g])===m&&(r[g]=m)}function bS(n){return n.__data__}function _S(n,l){if(!arguments.length)return Array.from(this,bS);var o=l?SS:xS,u=this._parents,r=this._groups;typeof n!="function"&&(n=vS(n));for(var f=r.length,d=new Array(f),g=new Array(f),m=new Array(f),h=0;h<f;++h){var v=u[h],y=r[h],x=y.length,S=ES(n.call(v,v&&v.__data__,h,u)),_=S.length,A=g[h]=new Array(_),T=d[h]=new Array(_),z=m[h]=new Array(x);o(v,y,A,T,z,S,l);for(var L=0,E=0,C,V;L<_;++L)if(C=A[L]){for(L>=E&&(E=L+1);!(V=T[E])&&++E<_;);C._next=V||null}}return d=new Ue(d,u),d._enter=g,d._exit=m,d}function ES(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function wS(){return new Ue(this._exit||this._groups.map(yp),this._parents)}function NS(n,l,o){var u=this.enter(),r=this,f=this.exit();return typeof n=="function"?(u=n(u),u&&(u=u.selection())):u=u.append(n+""),l!=null&&(r=l(r),r&&(r=r.selection())),o==null?f.remove():o(f),u&&r?u.merge(r).order():r}function MS(n){for(var l=n.selection?n.selection():n,o=this._groups,u=l._groups,r=o.length,f=u.length,d=Math.min(r,f),g=new Array(r),m=0;m<d;++m)for(var h=o[m],v=u[m],y=h.length,x=g[m]=new Array(y),S,_=0;_<y;++_)(S=h[_]||v[_])&&(x[_]=S);for(;m<r;++m)g[m]=o[m];return new Ue(g,this._parents)}function AS(){for(var n=this._groups,l=-1,o=n.length;++l<o;)for(var u=n[l],r=u.length-1,f=u[r],d;--r>=0;)(d=u[r])&&(f&&d.compareDocumentPosition(f)^4&&f.parentNode.insertBefore(d,f),f=d);return this}function zS(n){n||(n=TS);function l(y,x){return y&&x?n(y.__data__,x.__data__):!y-!x}for(var o=this._groups,u=o.length,r=new Array(u),f=0;f<u;++f){for(var d=o[f],g=d.length,m=r[f]=new Array(g),h,v=0;v<g;++v)(h=d[v])&&(m[v]=h);m.sort(l)}return new Ue(r,this._parents).order()}function TS(n,l){return n<l?-1:n>l?1:n>=l?0:NaN}function CS(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function DS(){return Array.from(this)}function OS(){for(var n=this._groups,l=0,o=n.length;l<o;++l)for(var u=n[l],r=0,f=u.length;r<f;++r){var d=u[r];if(d)return d}return null}function RS(){let n=0;for(const l of this)++n;return n}function HS(){return!this.node()}function jS(n){for(var l=this._groups,o=0,u=l.length;o<u;++o)for(var r=l[o],f=0,d=r.length,g;f<d;++f)(g=r[f])&&n.call(g,g.__data__,f,r);return this}function US(n){return function(){this.removeAttribute(n)}}function BS(n){return function(){this.removeAttributeNS(n.space,n.local)}}function qS(n,l){return function(){this.setAttribute(n,l)}}function LS(n,l){return function(){this.setAttributeNS(n.space,n.local,l)}}function YS(n,l){return function(){var o=l.apply(this,arguments);o==null?this.removeAttribute(n):this.setAttribute(n,o)}}function VS(n,l){return function(){var o=l.apply(this,arguments);o==null?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,o)}}function GS(n,l){var o=_s(n);if(arguments.length<2){var u=this.node();return o.local?u.getAttributeNS(o.space,o.local):u.getAttribute(o)}return this.each((l==null?o.local?BS:US:typeof l=="function"?o.local?VS:YS:o.local?LS:qS)(o,l))}function vp(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function XS(n){return function(){this.style.removeProperty(n)}}function ZS(n,l,o){return function(){this.style.setProperty(n,l,o)}}function QS(n,l,o){return function(){var u=l.apply(this,arguments);u==null?this.style.removeProperty(n):this.style.setProperty(n,u,o)}}function $S(n,l,o){return arguments.length>1?this.each((l==null?XS:typeof l=="function"?QS:ZS)(n,l,o??"")):Il(this.node(),n)}function Il(n,l){return n.style.getPropertyValue(l)||vp(n).getComputedStyle(n,null).getPropertyValue(l)}function kS(n){return function(){delete this[n]}}function KS(n,l){return function(){this[n]=l}}function IS(n,l){return function(){var o=l.apply(this,arguments);o==null?delete this[n]:this[n]=o}}function JS(n,l){return arguments.length>1?this.each((l==null?kS:typeof l=="function"?IS:KS)(n,l)):this.node()[n]}function xp(n){return n.trim().split(/^|\s+/)}function jf(n){return n.classList||new Sp(n)}function Sp(n){this._node=n,this._names=xp(n.getAttribute("class")||"")}Sp.prototype={add:function(n){var l=this._names.indexOf(n);l<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var l=this._names.indexOf(n);l>=0&&(this._names.splice(l,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function bp(n,l){for(var o=jf(n),u=-1,r=l.length;++u<r;)o.add(l[u])}function _p(n,l){for(var o=jf(n),u=-1,r=l.length;++u<r;)o.remove(l[u])}function FS(n){return function(){bp(this,n)}}function WS(n){return function(){_p(this,n)}}function PS(n,l){return function(){(l.apply(this,arguments)?bp:_p)(this,n)}}function tb(n,l){var o=xp(n+"");if(arguments.length<2){for(var u=jf(this.node()),r=-1,f=o.length;++r<f;)if(!u.contains(o[r]))return!1;return!0}return this.each((typeof l=="function"?PS:l?FS:WS)(o,l))}function eb(){this.textContent=""}function nb(n){return function(){this.textContent=n}}function ab(n){return function(){var l=n.apply(this,arguments);this.textContent=l??""}}function lb(n){return arguments.length?this.each(n==null?eb:(typeof n=="function"?ab:nb)(n)):this.node().textContent}function ib(){this.innerHTML=""}function ob(n){return function(){this.innerHTML=n}}function ub(n){return function(){var l=n.apply(this,arguments);this.innerHTML=l??""}}function sb(n){return arguments.length?this.each(n==null?ib:(typeof n=="function"?ub:ob)(n)):this.node().innerHTML}function rb(){this.nextSibling&&this.parentNode.appendChild(this)}function cb(){return this.each(rb)}function fb(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function db(){return this.each(fb)}function hb(n){var l=typeof n=="function"?n:hp(n);return this.select(function(){return this.appendChild(l.apply(this,arguments))})}function gb(){return null}function mb(n,l){var o=typeof n=="function"?n:hp(n),u=l==null?gb:typeof l=="function"?l:Hf(l);return this.select(function(){return this.insertBefore(o.apply(this,arguments),u.apply(this,arguments)||null)})}function pb(){var n=this.parentNode;n&&n.removeChild(this)}function yb(){return this.each(pb)}function vb(){var n=this.cloneNode(!1),l=this.parentNode;return l?l.insertBefore(n,this.nextSibling):n}function xb(){var n=this.cloneNode(!0),l=this.parentNode;return l?l.insertBefore(n,this.nextSibling):n}function Sb(n){return this.select(n?xb:vb)}function bb(n){return arguments.length?this.property("__data__",n):this.node().__data__}function _b(n){return function(l){n.call(this,l,this.__data__)}}function Eb(n){return n.trim().split(/^|\s+/).map(function(l){var o="",u=l.indexOf(".");return u>=0&&(o=l.slice(u+1),l=l.slice(0,u)),{type:l,name:o}})}function wb(n){return function(){var l=this.__on;if(l){for(var o=0,u=-1,r=l.length,f;o<r;++o)f=l[o],(!n.type||f.type===n.type)&&f.name===n.name?this.removeEventListener(f.type,f.listener,f.options):l[++u]=f;++u?l.length=u:delete this.__on}}}function Nb(n,l,o){return function(){var u=this.__on,r,f=_b(l);if(u){for(var d=0,g=u.length;d<g;++d)if((r=u[d]).type===n.type&&r.name===n.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=f,r.options=o),r.value=l;return}}this.addEventListener(n.type,f,o),r={type:n.type,name:n.name,value:l,listener:f,options:o},u?u.push(r):this.__on=[r]}}function Mb(n,l,o){var u=Eb(n+""),r,f=u.length,d;if(arguments.length<2){var g=this.node().__on;if(g){for(var m=0,h=g.length,v;m<h;++m)for(r=0,v=g[m];r<f;++r)if((d=u[r]).type===v.type&&d.name===v.name)return v.value}return}for(g=l?Nb:wb,r=0;r<f;++r)this.each(g(u[r],l,o));return this}function Ep(n,l,o){var u=vp(n),r=u.CustomEvent;typeof r=="function"?r=new r(l,o):(r=u.document.createEvent("Event"),o?(r.initEvent(l,o.bubbles,o.cancelable),r.detail=o.detail):r.initEvent(l,!1,!1)),n.dispatchEvent(r)}function Ab(n,l){return function(){return Ep(this,n,l)}}function zb(n,l){return function(){return Ep(this,n,l.apply(this,arguments))}}function Tb(n,l){return this.each((typeof l=="function"?zb:Ab)(n,l))}function*Cb(){for(var n=this._groups,l=0,o=n.length;l<o;++l)for(var u=n[l],r=0,f=u.length,d;r<f;++r)(d=u[r])&&(yield d)}var wp=[null];function Ue(n,l){this._groups=n,this._parents=l}function vo(){return new Ue([[document.documentElement]],wp)}function Db(){return this}Ue.prototype=vo.prototype={constructor:Ue,select:aS,selectAll:uS,selectChild:fS,selectChildren:mS,filter:pS,data:_S,enter:yS,exit:wS,join:NS,merge:MS,selection:Db,order:AS,sort:zS,call:CS,nodes:DS,node:OS,size:RS,empty:HS,each:jS,attr:GS,style:$S,property:JS,classed:tb,text:lb,html:sb,raise:cb,lower:db,append:hb,insert:mb,remove:yb,clone:Sb,datum:bb,on:Mb,dispatch:Tb,[Symbol.iterator]:Cb};function je(n){return typeof n=="string"?new Ue([[document.querySelector(n)]],[document.documentElement]):new Ue([[n]],wp)}function Ob(n){let l;for(;l=n.sourceEvent;)n=l;return n}function Fe(n,l){if(n=Ob(n),l===void 0&&(l=n.currentTarget),l){var o=l.ownerSVGElement||l;if(o.createSVGPoint){var u=o.createSVGPoint();return u.x=n.clientX,u.y=n.clientY,u=u.matrixTransform(l.getScreenCTM().inverse()),[u.x,u.y]}if(l.getBoundingClientRect){var r=l.getBoundingClientRect();return[n.clientX-r.left-l.clientLeft,n.clientY-r.top-l.clientTop]}}return[n.pageX,n.pageY]}const Rb={passive:!1},uo={capture:!0,passive:!1};function of(n){n.stopImmediatePropagation()}function kl(n){n.preventDefault(),n.stopImmediatePropagation()}function Np(n){var l=n.document.documentElement,o=je(n).on("dragstart.drag",kl,uo);"onselectstart"in l?o.on("selectstart.drag",kl,uo):(l.__noselect=l.style.MozUserSelect,l.style.MozUserSelect="none")}function Mp(n,l){var o=n.document.documentElement,u=je(n).on("dragstart.drag",null);l&&(u.on("click.drag",kl,uo),setTimeout(function(){u.on("click.drag",null)},0)),"onselectstart"in o?u.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}const ku=n=>()=>n;function Sf(n,{sourceEvent:l,subject:o,target:u,identifier:r,active:f,x:d,y:g,dx:m,dy:h,dispatch:v}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:l,enumerable:!0,configurable:!0},subject:{value:o,enumerable:!0,configurable:!0},target:{value:u,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:f,enumerable:!0,configurable:!0},x:{value:d,enumerable:!0,configurable:!0},y:{value:g,enumerable:!0,configurable:!0},dx:{value:m,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:v}})}Sf.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function Hb(n){return!n.ctrlKey&&!n.button}function jb(){return this.parentNode}function Ub(n,l){return l??{x:n.x,y:n.y}}function Bb(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ap(){var n=Hb,l=jb,o=Ub,u=Bb,r={},f=bs("start","drag","end"),d=0,g,m,h,v,y=0;function x(C){C.on("mousedown.drag",S).filter(u).on("touchstart.drag",T).on("touchmove.drag",z,Rb).on("touchend.drag touchcancel.drag",L).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function S(C,V){if(!(v||!n.call(this,C,V))){var B=E(this,l.call(this,C,V),C,V,"mouse");B&&(je(C.view).on("mousemove.drag",_,uo).on("mouseup.drag",A,uo),Np(C.view),of(C),h=!1,g=C.clientX,m=C.clientY,B("start",C))}}function _(C){if(kl(C),!h){var V=C.clientX-g,B=C.clientY-m;h=V*V+B*B>y}r.mouse("drag",C)}function A(C){je(C.view).on("mousemove.drag mouseup.drag",null),Mp(C.view,h),kl(C),r.mouse("end",C)}function T(C,V){if(n.call(this,C,V)){var B=C.changedTouches,q=l.call(this,C,V),k=B.length,I,ot;for(I=0;I<k;++I)(ot=E(this,q,C,V,B[I].identifier,B[I]))&&(of(C),ot("start",C,B[I]))}}function z(C){var V=C.changedTouches,B=V.length,q,k;for(q=0;q<B;++q)(k=r[V[q].identifier])&&(kl(C),k("drag",C,V[q]))}function L(C){var V=C.changedTouches,B=V.length,q,k;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),q=0;q<B;++q)(k=r[V[q].identifier])&&(of(C),k("end",C,V[q]))}function E(C,V,B,q,k,I){var ot=f.copy(),$=Fe(I||B,V),P,it,D;if((D=o.call(C,new Sf("beforestart",{sourceEvent:B,target:x,identifier:k,active:d,x:$[0],y:$[1],dx:0,dy:0,dispatch:ot}),q))!=null)return P=D.x-$[0]||0,it=D.y-$[1]||0,function G(N,R,U){var X=$,tt;switch(N){case"start":r[k]=G,tt=d++;break;case"end":delete r[k],--d;case"drag":$=Fe(U||R,V),tt=d;break}ot.call(N,C,new Sf(N,{sourceEvent:R,subject:D,target:x,identifier:k,active:tt,x:$[0]+P,y:$[1]+it,dx:$[0]-X[0],dy:$[1]-X[1],dispatch:ot}),q)}}return x.filter=function(C){return arguments.length?(n=typeof C=="function"?C:ku(!!C),x):n},x.container=function(C){return arguments.length?(l=typeof C=="function"?C:ku(C),x):l},x.subject=function(C){return arguments.length?(o=typeof C=="function"?C:ku(C),x):o},x.touchable=function(C){return arguments.length?(u=typeof C=="function"?C:ku(!!C),x):u},x.on=function(){var C=f.on.apply(f,arguments);return C===f?x:C},x.clickDistance=function(C){return arguments.length?(y=(C=+C)*C,x):Math.sqrt(y)},x}function Uf(n,l,o){n.prototype=l.prototype=o,o.constructor=n}function zp(n,l){var o=Object.create(n.prototype);for(var u in l)o[u]=l[u];return o}function xo(){}var so=.7,fs=1/so,Kl="\\s*([+-]?\\d+)\\s*",ro="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",dn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qb=/^#([0-9a-f]{3,8})$/,Lb=new RegExp(`^rgb\\(${Kl},${Kl},${Kl}\\)$`),Yb=new RegExp(`^rgb\\(${dn},${dn},${dn}\\)$`),Vb=new RegExp(`^rgba\\(${Kl},${Kl},${Kl},${ro}\\)$`),Gb=new RegExp(`^rgba\\(${dn},${dn},${dn},${ro}\\)$`),Xb=new RegExp(`^hsl\\(${ro},${dn},${dn}\\)$`),Zb=new RegExp(`^hsla\\(${ro},${dn},${dn},${ro}\\)$`),n0={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Uf(xo,Wa,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:a0,formatHex:a0,formatHex8:Qb,formatHsl:$b,formatRgb:l0,toString:l0});function a0(){return this.rgb().formatHex()}function Qb(){return this.rgb().formatHex8()}function $b(){return Tp(this).formatHsl()}function l0(){return this.rgb().formatRgb()}function Wa(n){var l,o;return n=(n+"").trim().toLowerCase(),(l=qb.exec(n))?(o=l[1].length,l=parseInt(l[1],16),o===6?i0(l):o===3?new Me(l>>8&15|l>>4&240,l>>4&15|l&240,(l&15)<<4|l&15,1):o===8?Ku(l>>24&255,l>>16&255,l>>8&255,(l&255)/255):o===4?Ku(l>>12&15|l>>8&240,l>>8&15|l>>4&240,l>>4&15|l&240,((l&15)<<4|l&15)/255):null):(l=Lb.exec(n))?new Me(l[1],l[2],l[3],1):(l=Yb.exec(n))?new Me(l[1]*255/100,l[2]*255/100,l[3]*255/100,1):(l=Vb.exec(n))?Ku(l[1],l[2],l[3],l[4]):(l=Gb.exec(n))?Ku(l[1]*255/100,l[2]*255/100,l[3]*255/100,l[4]):(l=Xb.exec(n))?s0(l[1],l[2]/100,l[3]/100,1):(l=Zb.exec(n))?s0(l[1],l[2]/100,l[3]/100,l[4]):n0.hasOwnProperty(n)?i0(n0[n]):n==="transparent"?new Me(NaN,NaN,NaN,0):null}function i0(n){return new Me(n>>16&255,n>>8&255,n&255,1)}function Ku(n,l,o,u){return u<=0&&(n=l=o=NaN),new Me(n,l,o,u)}function kb(n){return n instanceof xo||(n=Wa(n)),n?(n=n.rgb(),new Me(n.r,n.g,n.b,n.opacity)):new Me}function bf(n,l,o,u){return arguments.length===1?kb(n):new Me(n,l,o,u??1)}function Me(n,l,o,u){this.r=+n,this.g=+l,this.b=+o,this.opacity=+u}Uf(Me,bf,zp(xo,{brighter(n){return n=n==null?fs:Math.pow(fs,n),new Me(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?so:Math.pow(so,n),new Me(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Me(Ja(this.r),Ja(this.g),Ja(this.b),ds(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:o0,formatHex:o0,formatHex8:Kb,formatRgb:u0,toString:u0}));function o0(){return`#${Ia(this.r)}${Ia(this.g)}${Ia(this.b)}`}function Kb(){return`#${Ia(this.r)}${Ia(this.g)}${Ia(this.b)}${Ia((isNaN(this.opacity)?1:this.opacity)*255)}`}function u0(){const n=ds(this.opacity);return`${n===1?"rgb(":"rgba("}${Ja(this.r)}, ${Ja(this.g)}, ${Ja(this.b)}${n===1?")":`, ${n})`}`}function ds(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Ja(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function Ia(n){return n=Ja(n),(n<16?"0":"")+n.toString(16)}function s0(n,l,o,u){return u<=0?n=l=o=NaN:o<=0||o>=1?n=l=NaN:l<=0&&(n=NaN),new We(n,l,o,u)}function Tp(n){if(n instanceof We)return new We(n.h,n.s,n.l,n.opacity);if(n instanceof xo||(n=Wa(n)),!n)return new We;if(n instanceof We)return n;n=n.rgb();var l=n.r/255,o=n.g/255,u=n.b/255,r=Math.min(l,o,u),f=Math.max(l,o,u),d=NaN,g=f-r,m=(f+r)/2;return g?(l===f?d=(o-u)/g+(o<u)*6:o===f?d=(u-l)/g+2:d=(l-o)/g+4,g/=m<.5?f+r:2-f-r,d*=60):g=m>0&&m<1?0:d,new We(d,g,m,n.opacity)}function Ib(n,l,o,u){return arguments.length===1?Tp(n):new We(n,l,o,u??1)}function We(n,l,o,u){this.h=+n,this.s=+l,this.l=+o,this.opacity=+u}Uf(We,Ib,zp(xo,{brighter(n){return n=n==null?fs:Math.pow(fs,n),new We(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?so:Math.pow(so,n),new We(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,l=isNaN(n)||isNaN(this.s)?0:this.s,o=this.l,u=o+(o<.5?o:1-o)*l,r=2*o-u;return new Me(uf(n>=240?n-240:n+120,r,u),uf(n,r,u),uf(n<120?n+240:n-120,r,u),this.opacity)},clamp(){return new We(r0(this.h),Iu(this.s),Iu(this.l),ds(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 n=ds(this.opacity);return`${n===1?"hsl(":"hsla("}${r0(this.h)}, ${Iu(this.s)*100}%, ${Iu(this.l)*100}%${n===1?")":`, ${n})`}`}}));function r0(n){return n=(n||0)%360,n<0?n+360:n}function Iu(n){return Math.max(0,Math.min(1,n||0))}function uf(n,l,o){return(n<60?l+(o-l)*n/60:n<180?o:n<240?l+(o-l)*(240-n)/60:l)*255}const Bf=n=>()=>n;function Jb(n,l){return function(o){return n+o*l}}function Fb(n,l,o){return n=Math.pow(n,o),l=Math.pow(l,o)-n,o=1/o,function(u){return Math.pow(n+u*l,o)}}function Wb(n){return(n=+n)==1?Cp:function(l,o){return o-l?Fb(l,o,n):Bf(isNaN(l)?o:l)}}function Cp(n,l){var o=l-n;return o?Jb(n,o):Bf(isNaN(n)?l:n)}const hs=(function n(l){var o=Wb(l);function u(r,f){var d=o((r=bf(r)).r,(f=bf(f)).r),g=o(r.g,f.g),m=o(r.b,f.b),h=Cp(r.opacity,f.opacity);return function(v){return r.r=d(v),r.g=g(v),r.b=m(v),r.opacity=h(v),r+""}}return u.gamma=n,u})(1);function Pb(n,l){l||(l=[]);var o=n?Math.min(l.length,n.length):0,u=l.slice(),r;return function(f){for(r=0;r<o;++r)u[r]=n[r]*(1-f)+l[r]*f;return u}}function t2(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function e2(n,l){var o=l?l.length:0,u=n?Math.min(o,n.length):0,r=new Array(u),f=new Array(o),d;for(d=0;d<u;++d)r[d]=io(n[d],l[d]);for(;d<o;++d)f[d]=l[d];return function(g){for(d=0;d<u;++d)f[d]=r[d](g);return f}}function n2(n,l){var o=new Date;return n=+n,l=+l,function(u){return o.setTime(n*(1-u)+l*u),o}}function cn(n,l){return n=+n,l=+l,function(o){return n*(1-o)+l*o}}function a2(n,l){var o={},u={},r;(n===null||typeof n!="object")&&(n={}),(l===null||typeof l!="object")&&(l={});for(r in l)r in n?o[r]=io(n[r],l[r]):u[r]=l[r];return function(f){for(r in o)u[r]=o[r](f);return u}}var _f=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sf=new RegExp(_f.source,"g");function l2(n){return function(){return n}}function i2(n){return function(l){return n(l)+""}}function Dp(n,l){var o=_f.lastIndex=sf.lastIndex=0,u,r,f,d=-1,g=[],m=[];for(n=n+"",l=l+"";(u=_f.exec(n))&&(r=sf.exec(l));)(f=r.index)>o&&(f=l.slice(o,f),g[d]?g[d]+=f:g[++d]=f),(u=u[0])===(r=r[0])?g[d]?g[d]+=r:g[++d]=r:(g[++d]=null,m.push({i:d,x:cn(u,r)})),o=sf.lastIndex;return o<l.length&&(f=l.slice(o),g[d]?g[d]+=f:g[++d]=f),g.length<2?m[0]?i2(m[0].x):l2(l):(l=m.length,function(h){for(var v=0,y;v<l;++v)g[(y=m[v]).i]=y.x(h);return g.join("")})}function io(n,l){var o=typeof l,u;return l==null||o==="boolean"?Bf(l):(o==="number"?cn:o==="string"?(u=Wa(l))?(l=u,hs):Dp:l instanceof Wa?hs:l instanceof Date?n2:t2(l)?Pb:Array.isArray(l)?e2:typeof l.valueOf!="function"&&typeof l.toString!="function"||isNaN(l)?a2:cn)(n,l)}var c0=180/Math.PI,Ef={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Op(n,l,o,u,r,f){var d,g,m;return(d=Math.sqrt(n*n+l*l))&&(n/=d,l/=d),(m=n*o+l*u)&&(o-=n*m,u-=l*m),(g=Math.sqrt(o*o+u*u))&&(o/=g,u/=g,m/=g),n*u<l*o&&(n=-n,l=-l,m=-m,d=-d),{translateX:r,translateY:f,rotate:Math.atan2(l,n)*c0,skewX:Math.atan(m)*c0,scaleX:d,scaleY:g}}var Ju;function o2(n){const l=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return l.isIdentity?Ef:Op(l.a,l.b,l.c,l.d,l.e,l.f)}function u2(n){return n==null||(Ju||(Ju=document.createElementNS("http://www.w3.org/2000/svg","g")),Ju.setAttribute("transform",n),!(n=Ju.transform.baseVal.consolidate()))?Ef:(n=n.matrix,Op(n.a,n.b,n.c,n.d,n.e,n.f))}function Rp(n,l,o,u){function r(h){return h.length?h.pop()+" ":""}function f(h,v,y,x,S,_){if(h!==y||v!==x){var A=S.push("translate(",null,l,null,o);_.push({i:A-4,x:cn(h,y)},{i:A-2,x:cn(v,x)})}else(y||x)&&S.push("translate("+y+l+x+o)}function d(h,v,y,x){h!==v?(h-v>180?v+=360:v-h>180&&(h+=360),x.push({i:y.push(r(y)+"rotate(",null,u)-2,x:cn(h,v)})):v&&y.push(r(y)+"rotate("+v+u)}function g(h,v,y,x){h!==v?x.push({i:y.push(r(y)+"skewX(",null,u)-2,x:cn(h,v)}):v&&y.push(r(y)+"skewX("+v+u)}function m(h,v,y,x,S,_){if(h!==y||v!==x){var A=S.push(r(S)+"scale(",null,",",null,")");_.push({i:A-4,x:cn(h,y)},{i:A-2,x:cn(v,x)})}else(y!==1||x!==1)&&S.push(r(S)+"scale("+y+","+x+")")}return function(h,v){var y=[],x=[];return h=n(h),v=n(v),f(h.translateX,h.translateY,v.translateX,v.translateY,y,x),d(h.rotate,v.rotate,y,x),g(h.skewX,v.skewX,y,x),m(h.scaleX,h.scaleY,v.scaleX,v.scaleY,y,x),h=v=null,function(S){for(var _=-1,A=x.length,T;++_<A;)y[(T=x[_]).i]=T.x(S);return y.join("")}}}var s2=Rp(o2,"px, ","px)","deg)"),r2=Rp(u2,", ",")",")"),c2=1e-12;function f0(n){return((n=Math.exp(n))+1/n)/2}function f2(n){return((n=Math.exp(n))-1/n)/2}function d2(n){return((n=Math.exp(2*n))-1)/(n+1)}const is=(function n(l,o,u){function r(f,d){var g=f[0],m=f[1],h=f[2],v=d[0],y=d[1],x=d[2],S=v-g,_=y-m,A=S*S+_*_,T,z;if(A<c2)z=Math.log(x/h)/l,T=function(q){return[g+q*S,m+q*_,h*Math.exp(l*q*z)]};else{var L=Math.sqrt(A),E=(x*x-h*h+u*A)/(2*h*o*L),C=(x*x-h*h-u*A)/(2*x*o*L),V=Math.log(Math.sqrt(E*E+1)-E),B=Math.log(Math.sqrt(C*C+1)-C);z=(B-V)/l,T=function(q){var k=q*z,I=f0(V),ot=h/(o*L)*(I*d2(l*k+V)-f2(V));return[g+ot*S,m+ot*_,h*I/f0(l*k+V)]}}return T.duration=z*1e3*l/Math.SQRT2,T}return r.rho=function(f){var d=Math.max(.001,+f),g=d*d,m=g*g;return n(d,g,m)},r})(Math.SQRT2,2,4);var Jl=0,ao=0,Pi=0,Hp=1e3,gs,lo,ms=0,Pa=0,Es=0,co=typeof performance=="object"&&performance.now?performance:Date,jp=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function qf(){return Pa||(jp(h2),Pa=co.now()+Es)}function h2(){Pa=0}function ps(){this._call=this._time=this._next=null}ps.prototype=Up.prototype={constructor:ps,restart:function(n,l,o){if(typeof n!="function")throw new TypeError("callback is not a function");o=(o==null?qf():+o)+(l==null?0:+l),!this._next&&lo!==this&&(lo?lo._next=this:gs=this,lo=this),this._call=n,this._time=o,wf()},stop:function(){this._call&&(this._call=null,this._time=1/0,wf())}};function Up(n,l,o){var u=new ps;return u.restart(n,l,o),u}function g2(){qf(),++Jl;for(var n=gs,l;n;)(l=Pa-n._time)>=0&&n._call.call(void 0,l),n=n._next;--Jl}function d0(){Pa=(ms=co.now())+Es,Jl=ao=0;try{g2()}finally{Jl=0,p2(),Pa=0}}function m2(){var n=co.now(),l=n-ms;l>Hp&&(Es-=l,ms=n)}function p2(){for(var n,l=gs,o,u=1/0;l;)l._call?(u>l._time&&(u=l._time),n=l,l=l._next):(o=l._next,l._next=null,l=n?n._next=o:gs=o);lo=n,wf(u)}function wf(n){if(!Jl){ao&&(ao=clearTimeout(ao));var l=n-Pa;l>24?(n<1/0&&(ao=setTimeout(d0,n-co.now()-Es)),Pi&&(Pi=clearInterval(Pi))):(Pi||(ms=co.now(),Pi=setInterval(m2,Hp)),Jl=1,jp(d0))}}function h0(n,l,o){var u=new ps;return l=l==null?0:+l,u.restart(r=>{u.stop(),n(r+l)},l,o),u}var y2=bs("start","end","cancel","interrupt"),v2=[],Bp=0,g0=1,Nf=2,os=3,m0=4,Mf=5,us=6;function ws(n,l,o,u,r,f){var d=n.__transition;if(!d)n.__transition={};else if(o in d)return;x2(n,o,{name:l,index:u,group:r,on:y2,tween:v2,time:f.time,delay:f.delay,duration:f.duration,ease:f.ease,timer:null,state:Bp})}function Lf(n,l){var o=nn(n,l);if(o.state>Bp)throw new Error("too late; already scheduled");return o}function gn(n,l){var o=nn(n,l);if(o.state>os)throw new Error("too late; already running");return o}function nn(n,l){var o=n.__transition;if(!o||!(o=o[l]))throw new Error("transition not found");return o}function x2(n,l,o){var u=n.__transition,r;u[l]=o,o.timer=Up(f,0,o.time);function f(h){o.state=g0,o.timer.restart(d,o.delay,o.time),o.delay<=h&&d(h-o.delay)}function d(h){var v,y,x,S;if(o.state!==g0)return m();for(v in u)if(S=u[v],S.name===o.name){if(S.state===os)return h0(d);S.state===m0?(S.state=us,S.timer.stop(),S.on.call("interrupt",n,n.__data__,S.index,S.group),delete u[v]):+v<l&&(S.state=us,S.timer.stop(),S.on.call("cancel",n,n.__data__,S.index,S.group),delete u[v])}if(h0(function(){o.state===os&&(o.state=m0,o.timer.restart(g,o.delay,o.time),g(h))}),o.state=Nf,o.on.call("start",n,n.__data__,o.index,o.group),o.state===Nf){for(o.state=os,r=new Array(x=o.tween.length),v=0,y=-1;v<x;++v)(S=o.tween[v].value.call(n,n.__data__,o.index,o.group))&&(r[++y]=S);r.length=y+1}}function g(h){for(var v=h<o.duration?o.ease.call(null,h/o.duration):(o.timer.restart(m),o.state=Mf,1),y=-1,x=r.length;++y<x;)r[y].call(n,v);o.state===Mf&&(o.on.call("end",n,n.__data__,o.index,o.group),m())}function m(){o.state=us,o.timer.stop(),delete u[l];for(var h in u)return;delete n.__transition}}function ss(n,l){var o=n.__transition,u,r,f=!0,d;if(o){l=l==null?null:l+"";for(d in o){if((u=o[d]).name!==l){f=!1;continue}r=u.state>Nf&&u.state<Mf,u.state=us,u.timer.stop(),u.on.call(r?"interrupt":"cancel",n,n.__data__,u.index,u.group),delete o[d]}f&&delete n.__transition}}function S2(n){return this.each(function(){ss(this,n)})}function b2(n,l){var o,u;return function(){var r=gn(this,n),f=r.tween;if(f!==o){u=o=f;for(var d=0,g=u.length;d<g;++d)if(u[d].name===l){u=u.slice(),u.splice(d,1);break}}r.tween=u}}function _2(n,l,o){var u,r;if(typeof o!="function")throw new Error;return function(){var f=gn(this,n),d=f.tween;if(d!==u){r=(u=d).slice();for(var g={name:l,value:o},m=0,h=r.length;m<h;++m)if(r[m].name===l){r[m]=g;break}m===h&&r.push(g)}f.tween=r}}function E2(n,l){var o=this._id;if(n+="",arguments.length<2){for(var u=nn(this.node(),o).tween,r=0,f=u.length,d;r<f;++r)if((d=u[r]).name===n)return d.value;return null}return this.each((l==null?b2:_2)(o,n,l))}function Yf(n,l,o){var u=n._id;return n.each(function(){var r=gn(this,u);(r.value||(r.value={}))[l]=o.apply(this,arguments)}),function(r){return nn(r,u).value[l]}}function qp(n,l){var o;return(typeof l=="number"?cn:l instanceof Wa?hs:(o=Wa(l))?(l=o,hs):Dp)(n,l)}function w2(n){return function(){this.removeAttribute(n)}}function N2(n){return function(){this.removeAttributeNS(n.space,n.local)}}function M2(n,l,o){var u,r=o+"",f;return function(){var d=this.getAttribute(n);return d===r?null:d===u?f:f=l(u=d,o)}}function A2(n,l,o){var u,r=o+"",f;return function(){var d=this.getAttributeNS(n.space,n.local);return d===r?null:d===u?f:f=l(u=d,o)}}function z2(n,l,o){var u,r,f;return function(){var d,g=o(this),m;return g==null?void this.removeAttribute(n):(d=this.getAttribute(n),m=g+"",d===m?null:d===u&&m===r?f:(r=m,f=l(u=d,g)))}}function T2(n,l,o){var u,r,f;return function(){var d,g=o(this),m;return g==null?void this.removeAttributeNS(n.space,n.local):(d=this.getAttributeNS(n.space,n.local),m=g+"",d===m?null:d===u&&m===r?f:(r=m,f=l(u=d,g)))}}function C2(n,l){var o=_s(n),u=o==="transform"?r2:qp;return this.attrTween(n,typeof l=="function"?(o.local?T2:z2)(o,u,Yf(this,"attr."+n,l)):l==null?(o.local?N2:w2)(o):(o.local?A2:M2)(o,u,l))}function D2(n,l){return function(o){this.setAttribute(n,l.call(this,o))}}function O2(n,l){return function(o){this.setAttributeNS(n.space,n.local,l.call(this,o))}}function R2(n,l){var o,u;function r(){var f=l.apply(this,arguments);return f!==u&&(o=(u=f)&&O2(n,f)),o}return r._value=l,r}function H2(n,l){var o,u;function r(){var f=l.apply(this,arguments);return f!==u&&(o=(u=f)&&D2(n,f)),o}return r._value=l,r}function j2(n,l){var o="attr."+n;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(l==null)return this.tween(o,null);if(typeof l!="function")throw new Error;var u=_s(n);return this.tween(o,(u.local?R2:H2)(u,l))}function U2(n,l){return function(){Lf(this,n).delay=+l.apply(this,arguments)}}function B2(n,l){return l=+l,function(){Lf(this,n).delay=l}}function q2(n){var l=this._id;return arguments.length?this.each((typeof n=="function"?U2:B2)(l,n)):nn(this.node(),l).delay}function L2(n,l){return function(){gn(this,n).duration=+l.apply(this,arguments)}}function Y2(n,l){return l=+l,function(){gn(this,n).duration=l}}function V2(n){var l=this._id;return arguments.length?this.each((typeof n=="function"?L2:Y2)(l,n)):nn(this.node(),l).duration}function G2(n,l){if(typeof l!="function")throw new Error;return function(){gn(this,n).ease=l}}function X2(n){var l=this._id;return arguments.length?this.each(G2(l,n)):nn(this.node(),l).ease}function Z2(n,l){return function(){var o=l.apply(this,arguments);if(typeof o!="function")throw new Error;gn(this,n).ease=o}}function Q2(n){if(typeof n!="function")throw new Error;return this.each(Z2(this._id,n))}function $2(n){typeof n!="function"&&(n=mp(n));for(var l=this._groups,o=l.length,u=new Array(o),r=0;r<o;++r)for(var f=l[r],d=f.length,g=u[r]=[],m,h=0;h<d;++h)(m=f[h])&&n.call(m,m.__data__,h,f)&&g.push(m);return new Vn(u,this._parents,this._name,this._id)}function k2(n){if(n._id!==this._id)throw new Error;for(var l=this._groups,o=n._groups,u=l.length,r=o.length,f=Math.min(u,r),d=new Array(u),g=0;g<f;++g)for(var m=l[g],h=o[g],v=m.length,y=d[g]=new Array(v),x,S=0;S<v;++S)(x=m[S]||h[S])&&(y[S]=x);for(;g<u;++g)d[g]=l[g];return new Vn(d,this._parents,this._name,this._id)}function K2(n){return(n+"").trim().split(/^|\s+/).every(function(l){var o=l.indexOf(".");return o>=0&&(l=l.slice(0,o)),!l||l==="start"})}function I2(n,l,o){var u,r,f=K2(l)?Lf:gn;return function(){var d=f(this,n),g=d.on;g!==u&&(r=(u=g).copy()).on(l,o),d.on=r}}function J2(n,l){var o=this._id;return arguments.length<2?nn(this.node(),o).on.on(n):this.each(I2(o,n,l))}function F2(n){return function(){var l=this.parentNode;for(var o in this.__transition)if(+o!==n)return;l&&l.removeChild(this)}}function W2(){return this.on("end.remove",F2(this._id))}function P2(n){var l=this._name,o=this._id;typeof n!="function"&&(n=Hf(n));for(var u=this._groups,r=u.length,f=new Array(r),d=0;d<r;++d)for(var g=u[d],m=g.length,h=f[d]=new Array(m),v,y,x=0;x<m;++x)(v=g[x])&&(y=n.call(v,v.__data__,x,g))&&("__data__"in v&&(y.__data__=v.__data__),h[x]=y,ws(h[x],l,o,x,h,nn(v,o)));return new Vn(f,this._parents,l,o)}function t_(n){var l=this._name,o=this._id;typeof n!="function"&&(n=gp(n));for(var u=this._groups,r=u.length,f=[],d=[],g=0;g<r;++g)for(var m=u[g],h=m.length,v,y=0;y<h;++y)if(v=m[y]){for(var x=n.call(v,v.__data__,y,m),S,_=nn(v,o),A=0,T=x.length;A<T;++A)(S=x[A])&&ws(S,l,o,A,x,_);f.push(x),d.push(v)}return new Vn(f,d,l,o)}var e_=vo.prototype.constructor;function n_(){return new e_(this._groups,this._parents)}function a_(n,l){var o,u,r;return function(){var f=Il(this,n),d=(this.style.removeProperty(n),Il(this,n));return f===d?null:f===o&&d===u?r:r=l(o=f,u=d)}}function Lp(n){return function(){this.style.removeProperty(n)}}function l_(n,l,o){var u,r=o+"",f;return function(){var d=Il(this,n);return d===r?null:d===u?f:f=l(u=d,o)}}function i_(n,l,o){var u,r,f;return function(){var d=Il(this,n),g=o(this),m=g+"";return g==null&&(m=g=(this.style.removeProperty(n),Il(this,n))),d===m?null:d===u&&m===r?f:(r=m,f=l(u=d,g))}}function o_(n,l){var o,u,r,f="style."+l,d="end."+f,g;return function(){var m=gn(this,n),h=m.on,v=m.value[f]==null?g||(g=Lp(l)):void 0;(h!==o||r!==v)&&(u=(o=h).copy()).on(d,r=v),m.on=u}}function u_(n,l,o){var u=(n+="")=="transform"?s2:qp;return l==null?this.styleTween(n,a_(n,u)).on("end.style."+n,Lp(n)):typeof l=="function"?this.styleTween(n,i_(n,u,Yf(this,"style."+n,l))).each(o_(this._id,n)):this.styleTween(n,l_(n,u,l),o).on("end.style."+n,null)}function s_(n,l,o){return function(u){this.style.setProperty(n,l.call(this,u),o)}}function r_(n,l,o){var u,r;function f(){var d=l.apply(this,arguments);return d!==r&&(u=(r=d)&&s_(n,d,o)),u}return f._value=l,f}function c_(n,l,o){var u="style."+(n+="");if(arguments.length<2)return(u=this.tween(u))&&u._value;if(l==null)return this.tween(u,null);if(typeof l!="function")throw new Error;return this.tween(u,r_(n,l,o??""))}function f_(n){return function(){this.textContent=n}}function d_(n){return function(){var l=n(this);this.textContent=l??""}}function h_(n){return this.tween("text",typeof n=="function"?d_(Yf(this,"text",n)):f_(n==null?"":n+""))}function g_(n){return function(l){this.textContent=n.call(this,l)}}function m_(n){var l,o;function u(){var r=n.apply(this,arguments);return r!==o&&(l=(o=r)&&g_(r)),l}return u._value=n,u}function p_(n){var l="text";if(arguments.length<1)return(l=this.tween(l))&&l._value;if(n==null)return this.tween(l,null);if(typeof n!="function")throw new Error;return this.tween(l,m_(n))}function y_(){for(var n=this._name,l=this._id,o=Yp(),u=this._groups,r=u.length,f=0;f<r;++f)for(var d=u[f],g=d.length,m,h=0;h<g;++h)if(m=d[h]){var v=nn(m,l);ws(m,n,o,h,d,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new Vn(u,this._parents,n,o)}function v_(){var n,l,o=this,u=o._id,r=o.size();return new Promise(function(f,d){var g={value:d},m={value:function(){--r===0&&f()}};o.each(function(){var h=gn(this,u),v=h.on;v!==n&&(l=(n=v).copy(),l._.cancel.push(g),l._.interrupt.push(g),l._.end.push(m)),h.on=l}),r===0&&f()})}var x_=0;function Vn(n,l,o,u){this._groups=n,this._parents=l,this._name=o,this._id=u}function Yp(){return++x_}var qn=vo.prototype;Vn.prototype={constructor:Vn,select:P2,selectAll:t_,selectChild:qn.selectChild,selectChildren:qn.selectChildren,filter:$2,merge:k2,selection:n_,transition:y_,call:qn.call,nodes:qn.nodes,node:qn.node,size:qn.size,empty:qn.empty,each:qn.each,on:J2,attr:C2,attrTween:j2,style:u_,styleTween:c_,text:h_,textTween:p_,remove:W2,tween:E2,delay:q2,duration:V2,ease:X2,easeVarying:Q2,end:v_,[Symbol.iterator]:qn[Symbol.iterator]};function S_(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var b_={time:null,delay:0,duration:250,ease:S_};function __(n,l){for(var o;!(o=n.__transition)||!(o=o[l]);)if(!(n=n.parentNode))throw new Error(`transition ${l} not found`);return o}function E_(n){var l,o;n instanceof Vn?(l=n._id,n=n._name):(l=Yp(),(o=b_).time=qf(),n=n==null?null:n+"");for(var u=this._groups,r=u.length,f=0;f<r;++f)for(var d=u[f],g=d.length,m,h=0;h<g;++h)(m=d[h])&&ws(m,n,l,h,d,o||__(m,l));return new Vn(u,this._parents,n,l)}vo.prototype.interrupt=S2;vo.prototype.transition=E_;const Fu=n=>()=>n;function w_(n,{sourceEvent:l,target:o,transform:u,dispatch:r}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:l,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:u,enumerable:!0,configurable:!0},_:{value:r}})}function Yn(n,l,o){this.k=n,this.x=l,this.y=o}Yn.prototype={constructor:Yn,scale:function(n){return n===1?this:new Yn(this.k*n,this.x,this.y)},translate:function(n,l){return n===0&l===0?this:new Yn(this.k,this.x+this.k*n,this.y+this.k*l)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ns=new Yn(1,0,0);Vp.prototype=Yn.prototype;function Vp(n){for(;!n.__zoom;)if(!(n=n.parentNode))return Ns;return n.__zoom}function rf(n){n.stopImmediatePropagation()}function to(n){n.preventDefault(),n.stopImmediatePropagation()}function N_(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function M_(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n,n.hasAttribute("viewBox")?(n=n.viewBox.baseVal,[[n.x,n.y],[n.x+n.width,n.y+n.height]]):[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]):[[0,0],[n.clientWidth,n.clientHeight]]}function p0(){return this.__zoom||Ns}function A_(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function z_(){return navigator.maxTouchPoints||"ontouchstart"in this}function T_(n,l,o){var u=n.invertX(l[0][0])-o[0][0],r=n.invertX(l[1][0])-o[1][0],f=n.invertY(l[0][1])-o[0][1],d=n.invertY(l[1][1])-o[1][1];return n.translate(r>u?(u+r)/2:Math.min(0,u)||Math.max(0,r),d>f?(f+d)/2:Math.min(0,f)||Math.max(0,d))}function Gp(){var n=N_,l=M_,o=T_,u=A_,r=z_,f=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],g=250,m=is,h=bs("start","zoom","end"),v,y,x,S=500,_=150,A=0,T=10;function z(D){D.property("__zoom",p0).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",ot).filter(r).on("touchstart.zoom",$).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",it).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}z.transform=function(D,G,N,R){var U=D.selection?D.selection():D;U.property("__zoom",p0),D!==U?V(D,G,N,R):U.interrupt().each(function(){B(this,arguments).event(R).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},z.scaleBy=function(D,G,N,R){z.scaleTo(D,function(){var U=this.__zoom.k,X=typeof G=="function"?G.apply(this,arguments):G;return U*X},N,R)},z.scaleTo=function(D,G,N,R){z.transform(D,function(){var U=l.apply(this,arguments),X=this.__zoom,tt=N==null?C(U):typeof N=="function"?N.apply(this,arguments):N,M=X.invert(tt),H=typeof G=="function"?G.apply(this,arguments):G;return o(E(L(X,H),tt,M),U,d)},N,R)},z.translateBy=function(D,G,N,R){z.transform(D,function(){return o(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof N=="function"?N.apply(this,arguments):N),l.apply(this,arguments),d)},null,R)},z.translateTo=function(D,G,N,R,U){z.transform(D,function(){var X=l.apply(this,arguments),tt=this.__zoom,M=R==null?C(X):typeof R=="function"?R.apply(this,arguments):R;return o(Ns.translate(M[0],M[1]).scale(tt.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof N=="function"?-N.apply(this,arguments):-N),X,d)},R,U)};function L(D,G){return G=Math.max(f[0],Math.min(f[1],G)),G===D.k?D:new Yn(G,D.x,D.y)}function E(D,G,N){var R=G[0]-N[0]*D.k,U=G[1]-N[1]*D.k;return R===D.x&&U===D.y?D:new Yn(D.k,R,U)}function C(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function V(D,G,N,R){D.on("start.zoom",function(){B(this,arguments).event(R).start()}).on("interrupt.zoom end.zoom",function(){B(this,arguments).event(R).end()}).tween("zoom",function(){var U=this,X=arguments,tt=B(U,X).event(R),M=l.apply(U,X),H=N==null?C(M):typeof N=="function"?N.apply(U,X):N,W=Math.max(M[1][0]-M[0][0],M[1][1]-M[0][1]),et=U.__zoom,st=typeof G=="function"?G.apply(U,X):G,ct=m(et.invert(H).concat(W/et.k),st.invert(H).concat(W/st.k));return function(rt){if(rt===1)rt=st;else{var ut=ct(rt),ft=W/ut[2];rt=new Yn(ft,H[0]-ut[0]*ft,H[1]-ut[1]*ft)}tt.zoom(null,rt)}})}function B(D,G,N){return!N&&D.__zooming||new q(D,G)}function q(D,G){this.that=D,this.args=G,this.active=0,this.sourceEvent=null,this.extent=l.apply(D,G),this.taps=0}q.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,G){return this.mouse&&D!=="mouse"&&(this.mouse[1]=G.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=G.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=G.invert(this.touch1[0])),this.that.__zoom=G,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var G=je(this.that).datum();h.call(D,this.that,new w_(D,{sourceEvent:this.sourceEvent,target:z,transform:this.that.__zoom,dispatch:h}),G)}};function k(D,...G){if(!n.apply(this,arguments))return;var N=B(this,G).event(D),R=this.__zoom,U=Math.max(f[0],Math.min(f[1],R.k*Math.pow(2,u.apply(this,arguments)))),X=Fe(D);if(N.wheel)(N.mouse[0][0]!==X[0]||N.mouse[0][1]!==X[1])&&(N.mouse[1]=R.invert(N.mouse[0]=X)),clearTimeout(N.wheel);else{if(R.k===U)return;N.mouse=[X,R.invert(X)],ss(this),N.start()}to(D),N.wheel=setTimeout(tt,_),N.zoom("mouse",o(E(L(R,U),N.mouse[0],N.mouse[1]),N.extent,d));function tt(){N.wheel=null,N.end()}}function I(D,...G){if(x||!n.apply(this,arguments))return;var N=D.currentTarget,R=B(this,G,!0).event(D),U=je(D.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",W,!0),X=Fe(D,N),tt=D.clientX,M=D.clientY;Np(D.view),rf(D),R.mouse=[X,this.__zoom.invert(X)],ss(this),R.start();function H(et){if(to(et),!R.moved){var st=et.clientX-tt,ct=et.clientY-M;R.moved=st*st+ct*ct>A}R.event(et).zoom("mouse",o(E(R.that.__zoom,R.mouse[0]=Fe(et,N),R.mouse[1]),R.extent,d))}function W(et){U.on("mousemove.zoom mouseup.zoom",null),Mp(et.view,R.moved),to(et),R.event(et).end()}}function ot(D,...G){if(n.apply(this,arguments)){var N=this.__zoom,R=Fe(D.changedTouches?D.changedTouches[0]:D,this),U=N.invert(R),X=N.k*(D.shiftKey?.5:2),tt=o(E(L(N,X),R,U),l.apply(this,G),d);to(D),g>0?je(this).transition().duration(g).call(V,tt,R,D):je(this).call(z.transform,tt,R,D)}}function $(D,...G){if(n.apply(this,arguments)){var N=D.touches,R=N.length,U=B(this,G,D.changedTouches.length===R).event(D),X,tt,M,H;for(rf(D),tt=0;tt<R;++tt)M=N[tt],H=Fe(M,this),H=[H,this.__zoom.invert(H),M.identifier],U.touch0?!U.touch1&&U.touch0[2]!==H[2]&&(U.touch1=H,U.taps=0):(U.touch0=H,X=!0,U.taps=1+!!v);v&&(v=clearTimeout(v)),X&&(U.taps<2&&(y=H[0],v=setTimeout(function(){v=null},S)),ss(this),U.start())}}function P(D,...G){if(this.__zooming){var N=B(this,G).event(D),R=D.changedTouches,U=R.length,X,tt,M,H;for(to(D),X=0;X<U;++X)tt=R[X],M=Fe(tt,this),N.touch0&&N.touch0[2]===tt.identifier?N.touch0[0]=M:N.touch1&&N.touch1[2]===tt.identifier&&(N.touch1[0]=M);if(tt=N.that.__zoom,N.touch1){var W=N.touch0[0],et=N.touch0[1],st=N.touch1[0],ct=N.touch1[1],rt=(rt=st[0]-W[0])*rt+(rt=st[1]-W[1])*rt,ut=(ut=ct[0]-et[0])*ut+(ut=ct[1]-et[1])*ut;tt=L(tt,Math.sqrt(rt/ut)),M=[(W[0]+st[0])/2,(W[1]+st[1])/2],H=[(et[0]+ct[0])/2,(et[1]+ct[1])/2]}else if(N.touch0)M=N.touch0[0],H=N.touch0[1];else return;N.zoom("touch",o(E(tt,M,H),N.extent,d))}}function it(D,...G){if(this.__zooming){var N=B(this,G).event(D),R=D.changedTouches,U=R.length,X,tt;for(rf(D),x&&clearTimeout(x),x=setTimeout(function(){x=null},S),X=0;X<U;++X)tt=R[X],N.touch0&&N.touch0[2]===tt.identifier?delete N.touch0:N.touch1&&N.touch1[2]===tt.identifier&&delete N.touch1;if(N.touch1&&!N.touch0&&(N.touch0=N.touch1,delete N.touch1),N.touch0)N.touch0[1]=this.__zoom.invert(N.touch0[0]);else if(N.end(),N.taps===2&&(tt=Fe(tt,this),Math.hypot(y[0]-tt[0],y[1]-tt[1])<T)){var M=je(this).on("dblclick.zoom");M&&M.apply(this,arguments)}}}return z.wheelDelta=function(D){return arguments.length?(u=typeof D=="function"?D:Fu(+D),z):u},z.filter=function(D){return arguments.length?(n=typeof D=="function"?D:Fu(!!D),z):n},z.touchable=function(D){return arguments.length?(r=typeof D=="function"?D:Fu(!!D),z):r},z.extent=function(D){return arguments.length?(l=typeof D=="function"?D:Fu([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),z):l},z.scaleExtent=function(D){return arguments.length?(f[0]=+D[0],f[1]=+D[1],z):[f[0],f[1]]},z.translateExtent=function(D){return arguments.length?(d[0][0]=+D[0][0],d[1][0]=+D[1][0],d[0][1]=+D[0][1],d[1][1]=+D[1][1],z):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},z.constrain=function(D){return arguments.length?(o=D,z):o},z.duration=function(D){return arguments.length?(g=+D,z):g},z.interpolate=function(D){return arguments.length?(m=D,z):m},z.on=function(){var D=h.on.apply(h,arguments);return D===h?z:D},z.clickDistance=function(D){return arguments.length?(A=(D=+D)*D,z):Math.sqrt(A)},z.tapDistance=function(D){return arguments.length?(T=+D,z):T},z}const hn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:n=>`Node type "${n}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:n=>`The old edge with id=${n} does not exist.`,error009:n=>`Marker type "${n}" doesn't exist.`,error008:(n,{id:l,sourceHandle:o,targetHandle:u})=>`Couldn't create edge for ${n} handle id: "${n==="source"?o:u}", edge id: ${l}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:n=>`Edge type "${n}" not found. Using fallback type "default".`,error012:n=>`Node with id "${n}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(n="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${n}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},fo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Xp=["Enter"," ","Escape"],Zp={"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:n,x:l,y:o})=>`Moved selected node ${n}. New position, x: ${l}, y: ${o}`,"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 Fl;(function(n){n.Strict="strict",n.Loose="loose"})(Fl||(Fl={}));var Fa;(function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"})(Fa||(Fa={}));var ho;(function(n){n.Partial="partial",n.Full="full"})(ho||(ho={}));const Qp={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Sa;(function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"})(Sa||(Sa={}));var ys;(function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"})(ys||(ys={}));var mt;(function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"})(mt||(mt={}));const y0={[mt.Left]:mt.Right,[mt.Right]:mt.Left,[mt.Top]:mt.Bottom,[mt.Bottom]:mt.Top};function $p(n){return n===null?null:n?"valid":"invalid"}const kp=n=>"id"in n&&"source"in n&&"target"in n,C_=n=>"id"in n&&"position"in n&&!("source"in n)&&!("target"in n),Vf=n=>"id"in n&&"internals"in n&&!("source"in n)&&!("target"in n),So=(n,l=[0,0])=>{const{width:o,height:u}=Gn(n),r=n.origin??l,f=o*r[0],d=u*r[1];return{x:n.position.x-f,y:n.position.y-d}},D_=(n,l={nodeOrigin:[0,0]})=>{if(n.length===0)return{x:0,y:0,width:0,height:0};const o=n.reduce((u,r)=>{const f=typeof r=="string";let d=!l.nodeLookup&&!f?r:void 0;l.nodeLookup&&(d=f?l.nodeLookup.get(r):Vf(r)?r:l.nodeLookup.get(r.id));const g=d?vs(d,l.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ms(u,g)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return As(o)},bo=(n,l={})=>{let o={x:1/0,y:1/0,x2:-1/0,y2:-1/0},u=!1;return n.forEach(r=>{(l.filter===void 0||l.filter(r))&&(o=Ms(o,vs(r)),u=!0)}),u?As(o):{x:0,y:0,width:0,height:0}},Gf=(n,l,[o,u,r]=[0,0,1],f=!1,d=!1)=>{const g={...Eo(l,[o,u,r]),width:l.width/r,height:l.height/r},m=[];for(const h of n.values()){const{measured:v,selectable:y=!0,hidden:x=!1}=h;if(d&&!y||x)continue;const S=v.width??h.width??h.initialWidth??null,_=v.height??h.height??h.initialHeight??null,A=go(g,Pl(h)),T=(S??0)*(_??0),z=f&&A>0;(!h.internals.handleBounds||z||A>=T||h.dragging)&&m.push(h)}return m},O_=(n,l)=>{const o=new Set;return n.forEach(u=>{o.add(u.id)}),l.filter(u=>o.has(u.source)||o.has(u.target))};function R_(n,l){const o=new Map,u=l?.nodes?new Set(l.nodes.map(r=>r.id)):null;return n.forEach(r=>{r.measured.width&&r.measured.height&&(l?.includeHiddenNodes||!r.hidden)&&(!u||u.has(r.id))&&o.set(r.id,r)}),o}async function H_({nodes:n,width:l,height:o,panZoom:u,minZoom:r,maxZoom:f},d){if(n.size===0)return Promise.resolve(!0);const g=R_(n,d),m=bo(g),h=Xf(m,l,o,d?.minZoom??r,d?.maxZoom??f,d?.padding??.1);return await u.setViewport(h,{duration:d?.duration,ease:d?.ease,interpolate:d?.interpolate}),Promise.resolve(!0)}function Kp({nodeId:n,nextPosition:l,nodeLookup:o,nodeOrigin:u=[0,0],nodeExtent:r,onError:f}){const d=o.get(n),g=d.parentId?o.get(d.parentId):void 0,{x:m,y:h}=g?g.internals.positionAbsolute:{x:0,y:0},v=d.origin??u;let y=d.extent||r;if(d.extent==="parent"&&!d.expandParent)if(!g)f?.("005",hn.error005());else{const S=g.measured.width,_=g.measured.height;S&&_&&(y=[[m,h],[m+S,h+_]])}else g&&ti(d.extent)&&(y=[[d.extent[0][0]+m,d.extent[0][1]+h],[d.extent[1][0]+m,d.extent[1][1]+h]]);const x=ti(y)?tl(l,y,d.measured):l;return(d.measured.width===void 0||d.measured.height===void 0)&&f?.("015",hn.error015()),{position:{x:x.x-m+(d.measured.width??0)*v[0],y:x.y-h+(d.measured.height??0)*v[1]},positionAbsolute:x}}async function j_({nodesToRemove:n=[],edgesToRemove:l=[],nodes:o,edges:u,onBeforeDelete:r}){const f=new Set(n.map(x=>x.id)),d=[];for(const x of o){if(x.deletable===!1)continue;const S=f.has(x.id),_=!S&&x.parentId&&d.find(A=>A.id===x.parentId);(S||_)&&d.push(x)}const g=new Set(l.map(x=>x.id)),m=u.filter(x=>x.deletable!==!1),v=O_(d,m);for(const x of m)g.has(x.id)&&!v.find(_=>_.id===x.id)&&v.push(x);if(!r)return{edges:v,nodes:d};const y=await r({nodes:d,edges:v});return typeof y=="boolean"?y?{edges:v,nodes:d}:{edges:[],nodes:[]}:y}const Wl=(n,l=0,o=1)=>Math.min(Math.max(n,l),o),tl=(n={x:0,y:0},l,o)=>({x:Wl(n.x,l[0][0],l[1][0]-(o?.width??0)),y:Wl(n.y,l[0][1],l[1][1]-(o?.height??0))});function Ip(n,l,o){const{width:u,height:r}=Gn(o),{x:f,y:d}=o.internals.positionAbsolute;return tl(n,[[f,d],[f+u,d+r]],l)}const v0=(n,l,o)=>n<l?Wl(Math.abs(n-l),1,l)/l:n>o?-Wl(Math.abs(n-o),1,l)/l:0,Jp=(n,l,o=15,u=40)=>{const r=v0(n.x,u,l.width-u)*o,f=v0(n.y,u,l.height-u)*o;return[r,f]},Ms=(n,l)=>({x:Math.min(n.x,l.x),y:Math.min(n.y,l.y),x2:Math.max(n.x2,l.x2),y2:Math.max(n.y2,l.y2)}),Af=({x:n,y:l,width:o,height:u})=>({x:n,y:l,x2:n+o,y2:l+u}),As=({x:n,y:l,x2:o,y2:u})=>({x:n,y:l,width:o-n,height:u-l}),Pl=(n,l=[0,0])=>{const{x:o,y:u}=Vf(n)?n.internals.positionAbsolute:So(n,l);return{x:o,y:u,width:n.measured?.width??n.width??n.initialWidth??0,height:n.measured?.height??n.height??n.initialHeight??0}},vs=(n,l=[0,0])=>{const{x:o,y:u}=Vf(n)?n.internals.positionAbsolute:So(n,l);return{x:o,y:u,x2:o+(n.measured?.width??n.width??n.initialWidth??0),y2:u+(n.measured?.height??n.height??n.initialHeight??0)}},Fp=(n,l)=>As(Ms(Af(n),Af(l))),go=(n,l)=>{const o=Math.max(0,Math.min(n.x+n.width,l.x+l.width)-Math.max(n.x,l.x)),u=Math.max(0,Math.min(n.y+n.height,l.y+l.height)-Math.max(n.y,l.y));return Math.ceil(o*u)},x0=n=>Pe(n.width)&&Pe(n.height)&&Pe(n.x)&&Pe(n.y),Pe=n=>!isNaN(n)&&isFinite(n),U_=(n,l)=>{},_o=(n,l=[1,1])=>({x:l[0]*Math.round(n.x/l[0]),y:l[1]*Math.round(n.y/l[1])}),Eo=({x:n,y:l},[o,u,r],f=!1,d=[1,1])=>{const g={x:(n-o)/r,y:(l-u)/r};return f?_o(g,d):g},xs=({x:n,y:l},[o,u,r])=>({x:n*r+o,y:l*r+u});function Zl(n,l){if(typeof n=="number")return Math.floor((l-l/(1+n))*.5);if(typeof n=="string"&&n.endsWith("px")){const o=parseFloat(n);if(!Number.isNaN(o))return Math.floor(o)}if(typeof n=="string"&&n.endsWith("%")){const o=parseFloat(n);if(!Number.isNaN(o))return Math.floor(l*o*.01)}return console.error(`[React Flow] The padding value "${n}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function B_(n,l,o){if(typeof n=="string"||typeof n=="number"){const u=Zl(n,o),r=Zl(n,l);return{top:u,right:r,bottom:u,left:r,x:r*2,y:u*2}}if(typeof n=="object"){const u=Zl(n.top??n.y??0,o),r=Zl(n.bottom??n.y??0,o),f=Zl(n.left??n.x??0,l),d=Zl(n.right??n.x??0,l);return{top:u,right:d,bottom:r,left:f,x:f+d,y:u+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function q_(n,l,o,u,r,f){const{x:d,y:g}=xs(n,[l,o,u]),{x:m,y:h}=xs({x:n.x+n.width,y:n.y+n.height},[l,o,u]),v=r-m,y=f-h;return{left:Math.floor(d),top:Math.floor(g),right:Math.floor(v),bottom:Math.floor(y)}}const Xf=(n,l,o,u,r,f)=>{const d=B_(f,l,o),g=(l-d.x)/n.width,m=(o-d.y)/n.height,h=Math.min(g,m),v=Wl(h,u,r),y=n.x+n.width/2,x=n.y+n.height/2,S=l/2-y*v,_=o/2-x*v,A=q_(n,S,_,v,l,o),T={left:Math.min(A.left-d.left,0),top:Math.min(A.top-d.top,0),right:Math.min(A.right-d.right,0),bottom:Math.min(A.bottom-d.bottom,0)};return{x:S-T.left+T.right,y:_-T.top+T.bottom,zoom:v}},mo=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function ti(n){return n!=null&&n!=="parent"}function Gn(n){return{width:n.measured?.width??n.width??n.initialWidth??0,height:n.measured?.height??n.height??n.initialHeight??0}}function Wp(n){return(n.measured?.width??n.width??n.initialWidth)!==void 0&&(n.measured?.height??n.height??n.initialHeight)!==void 0}function Pp(n,l={width:0,height:0},o,u,r){const f={...n},d=u.get(o);if(d){const g=d.origin||r;f.x+=d.internals.positionAbsolute.x-(l.width??0)*g[0],f.y+=d.internals.positionAbsolute.y-(l.height??0)*g[1]}return f}function S0(n,l){if(n.size!==l.size)return!1;for(const o of n)if(!l.has(o))return!1;return!0}function L_(){let n,l;return{promise:new Promise((u,r)=>{n=u,l=r}),resolve:n,reject:l}}function Y_(n){return{...Zp,...n||{}}}function oo(n,{snapGrid:l=[0,0],snapToGrid:o=!1,transform:u,containerBounds:r}){const{x:f,y:d}=tn(n),g=Eo({x:f-(r?.left??0),y:d-(r?.top??0)},u),{x:m,y:h}=o?_o(g,l):g;return{xSnapped:m,ySnapped:h,...g}}const Zf=n=>({width:n.offsetWidth,height:n.offsetHeight}),ty=n=>n?.getRootNode?.()||window?.document,V_=["INPUT","SELECT","TEXTAREA"];function ey(n){const l=n.composedPath?.()?.[0]||n.target;return l?.nodeType!==1?!1:V_.includes(l.nodeName)||l.hasAttribute("contenteditable")||!!l.closest(".nokey")}const ny=n=>"clientX"in n,tn=(n,l)=>{const o=ny(n),u=o?n.clientX:n.touches?.[0].clientX,r=o?n.clientY:n.touches?.[0].clientY;return{x:u-(l?.left??0),y:r-(l?.top??0)}},b0=(n,l,o,u,r)=>{const f=l.querySelectorAll(`.${n}`);return!f||!f.length?null:Array.from(f).map(d=>{const g=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:n,nodeId:r,position:d.getAttribute("data-handlepos"),x:(g.left-o.left)/u,y:(g.top-o.top)/u,...Zf(d)}})};function ay({sourceX:n,sourceY:l,targetX:o,targetY:u,sourceControlX:r,sourceControlY:f,targetControlX:d,targetControlY:g}){const m=n*.125+r*.375+d*.375+o*.125,h=l*.125+f*.375+g*.375+u*.125,v=Math.abs(m-n),y=Math.abs(h-l);return[m,h,v,y]}function Wu(n,l){return n>=0?.5*n:l*25*Math.sqrt(-n)}function _0({pos:n,x1:l,y1:o,x2:u,y2:r,c:f}){switch(n){case mt.Left:return[l-Wu(l-u,f),o];case mt.Right:return[l+Wu(u-l,f),o];case mt.Top:return[l,o-Wu(o-r,f)];case mt.Bottom:return[l,o+Wu(r-o,f)]}}function ly({sourceX:n,sourceY:l,sourcePosition:o=mt.Bottom,targetX:u,targetY:r,targetPosition:f=mt.Top,curvature:d=.25}){const[g,m]=_0({pos:o,x1:n,y1:l,x2:u,y2:r,c:d}),[h,v]=_0({pos:f,x1:u,y1:r,x2:n,y2:l,c:d}),[y,x,S,_]=ay({sourceX:n,sourceY:l,targetX:u,targetY:r,sourceControlX:g,sourceControlY:m,targetControlX:h,targetControlY:v});return[`M${n},${l} C${g},${m} ${h},${v} ${u},${r}`,y,x,S,_]}function iy({sourceX:n,sourceY:l,targetX:o,targetY:u}){const r=Math.abs(o-n)/2,f=o<n?o+r:o-r,d=Math.abs(u-l)/2,g=u<l?u+d:u-d;return[f,g,r,d]}function G_({sourceNode:n,targetNode:l,selected:o=!1,zIndex:u=0,elevateOnSelect:r=!1,zIndexMode:f="basic"}){if(f==="manual")return u;const d=r&&o?u+1e3:u,g=Math.max(n.parentId||r&&n.selected?n.internals.z:0,l.parentId||r&&l.selected?l.internals.z:0);return d+g}function X_({sourceNode:n,targetNode:l,width:o,height:u,transform:r}){const f=Ms(vs(n),vs(l));f.x===f.x2&&(f.x2+=1),f.y===f.y2&&(f.y2+=1);const d={x:-r[0]/r[2],y:-r[1]/r[2],width:o/r[2],height:u/r[2]};return go(d,As(f))>0}const Z_=({source:n,sourceHandle:l,target:o,targetHandle:u})=>`xy-edge__${n}${l||""}-${o}${u||""}`,Q_=(n,l)=>l.some(o=>o.source===n.source&&o.target===n.target&&(o.sourceHandle===n.sourceHandle||!o.sourceHandle&&!n.sourceHandle)&&(o.targetHandle===n.targetHandle||!o.targetHandle&&!n.targetHandle)),$_=(n,l,o={})=>{if(!n.source||!n.target)return l;const u=o.getEdgeId||Z_;let r;return kp(n)?r={...n}:r={...n,id:u(n)},Q_(r,l)?l:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,l.concat(r))};function oy({sourceX:n,sourceY:l,targetX:o,targetY:u}){const[r,f,d,g]=iy({sourceX:n,sourceY:l,targetX:o,targetY:u});return[`M ${n},${l}L ${o},${u}`,r,f,d,g]}const E0={[mt.Left]:{x:-1,y:0},[mt.Right]:{x:1,y:0},[mt.Top]:{x:0,y:-1},[mt.Bottom]:{x:0,y:1}},k_=({source:n,sourcePosition:l=mt.Bottom,target:o})=>l===mt.Left||l===mt.Right?n.x<o.x?{x:1,y:0}:{x:-1,y:0}:n.y<o.y?{x:0,y:1}:{x:0,y:-1},w0=(n,l)=>Math.sqrt(Math.pow(l.x-n.x,2)+Math.pow(l.y-n.y,2));function K_({source:n,sourcePosition:l=mt.Bottom,target:o,targetPosition:u=mt.Top,center:r,offset:f,stepPosition:d}){const g=E0[l],m=E0[u],h={x:n.x+g.x*f,y:n.y+g.y*f},v={x:o.x+m.x*f,y:o.y+m.y*f},y=k_({source:h,sourcePosition:l,target:v}),x=y.x!==0?"x":"y",S=y[x];let _=[],A,T;const z={x:0,y:0},L={x:0,y:0},[,,E,C]=iy({sourceX:n.x,sourceY:n.y,targetX:o.x,targetY:o.y});if(g[x]*m[x]===-1){x==="x"?(A=r.x??h.x+(v.x-h.x)*d,T=r.y??(h.y+v.y)/2):(A=r.x??(h.x+v.x)/2,T=r.y??h.y+(v.y-h.y)*d);const k=[{x:A,y:h.y},{x:A,y:v.y}],I=[{x:h.x,y:T},{x:v.x,y:T}];g[x]===S?_=x==="x"?k:I:_=x==="x"?I:k}else{const k=[{x:h.x,y:v.y}],I=[{x:v.x,y:h.y}];if(x==="x"?_=g.x===S?I:k:_=g.y===S?k:I,l===u){const D=Math.abs(n[x]-o[x]);if(D<=f){const G=Math.min(f-1,f-D);g[x]===S?z[x]=(h[x]>n[x]?-1:1)*G:L[x]=(v[x]>o[x]?-1:1)*G}}if(l!==u){const D=x==="x"?"y":"x",G=g[x]===m[D],N=h[D]>v[D],R=h[D]<v[D];(g[x]===1&&(!G&&N||G&&R)||g[x]!==1&&(!G&&R||G&&N))&&(_=x==="x"?k:I)}const ot={x:h.x+z.x,y:h.y+z.y},$={x:v.x+L.x,y:v.y+L.y},P=Math.max(Math.abs(ot.x-_[0].x),Math.abs($.x-_[0].x)),it=Math.max(Math.abs(ot.y-_[0].y),Math.abs($.y-_[0].y));P>=it?(A=(ot.x+$.x)/2,T=_[0].y):(A=_[0].x,T=(ot.y+$.y)/2)}const V={x:h.x+z.x,y:h.y+z.y},B={x:v.x+L.x,y:v.y+L.y};return[[n,...V.x!==_[0].x||V.y!==_[0].y?[V]:[],..._,...B.x!==_[_.length-1].x||B.y!==_[_.length-1].y?[B]:[],o],A,T,E,C]}function I_(n,l,o,u){const r=Math.min(w0(n,l)/2,w0(l,o)/2,u),{x:f,y:d}=l;if(n.x===f&&f===o.x||n.y===d&&d===o.y)return`L${f} ${d}`;if(n.y===d){const h=n.x<o.x?-1:1,v=n.y<o.y?1:-1;return`L ${f+r*h},${d}Q ${f},${d} ${f},${d+r*v}`}const g=n.x<o.x?1:-1,m=n.y<o.y?-1:1;return`L ${f},${d+r*m}Q ${f},${d} ${f+r*g},${d}`}function zf({sourceX:n,sourceY:l,sourcePosition:o=mt.Bottom,targetX:u,targetY:r,targetPosition:f=mt.Top,borderRadius:d=5,centerX:g,centerY:m,offset:h=20,stepPosition:v=.5}){const[y,x,S,_,A]=K_({source:{x:n,y:l},sourcePosition:o,target:{x:u,y:r},targetPosition:f,center:{x:g,y:m},offset:h,stepPosition:v});let T=`M${y[0].x} ${y[0].y}`;for(let z=1;z<y.length-1;z++)T+=I_(y[z-1],y[z],y[z+1],d);return T+=`L${y[y.length-1].x} ${y[y.length-1].y}`,[T,x,S,_,A]}function N0(n){return n&&!!(n.internals.handleBounds||n.handles?.length)&&!!(n.measured.width||n.width||n.initialWidth)}function J_(n){const{sourceNode:l,targetNode:o}=n;if(!N0(l)||!N0(o))return null;const u=l.internals.handleBounds||M0(l.handles),r=o.internals.handleBounds||M0(o.handles),f=A0(u?.source??[],n.sourceHandle),d=A0(n.connectionMode===Fl.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),n.targetHandle);if(!f||!d)return n.onError?.("008",hn.error008(f?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;const g=f?.position||mt.Bottom,m=d?.position||mt.Top,h=el(l,f,g),v=el(o,d,m);return{sourceX:h.x,sourceY:h.y,targetX:v.x,targetY:v.y,sourcePosition:g,targetPosition:m}}function M0(n){if(!n)return null;const l=[],o=[];for(const u of n)u.width=u.width??1,u.height=u.height??1,u.type==="source"?l.push(u):u.type==="target"&&o.push(u);return{source:l,target:o}}function el(n,l,o=mt.Left,u=!1){const r=(l?.x??0)+n.internals.positionAbsolute.x,f=(l?.y??0)+n.internals.positionAbsolute.y,{width:d,height:g}=l??Gn(n);if(u)return{x:r+d/2,y:f+g/2};switch(l?.position??o){case mt.Top:return{x:r+d/2,y:f};case mt.Right:return{x:r+d,y:f+g/2};case mt.Bottom:return{x:r+d/2,y:f+g};case mt.Left:return{x:r,y:f+g/2}}}function A0(n,l){return n&&(l?n.find(o=>o.id===l):n[0])||null}function Tf(n,l){return n?typeof n=="string"?n:`${l?`${l}__`:""}${Object.keys(n).sort().map(u=>`${u}=${n[u]}`).join("&")}`:""}function F_(n,{id:l,defaultColor:o,defaultMarkerStart:u,defaultMarkerEnd:r}){const f=new Set;return n.reduce((d,g)=>([g.markerStart||u,g.markerEnd||r].forEach(m=>{if(m&&typeof m=="object"){const h=Tf(m,l);f.has(h)||(d.push({id:h,color:m.color||o,...m}),f.add(h))}}),d),[]).sort((d,g)=>d.id.localeCompare(g.id))}const uy=1e3,W_=10,Qf={nodeOrigin:[0,0],nodeExtent:fo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},P_={...Qf,checkEquality:!0};function $f(n,l){const o={...n};for(const u in l)l[u]!==void 0&&(o[u]=l[u]);return o}function tE(n,l,o){const u=$f(Qf,o);for(const r of n.values())if(r.parentId)Kf(r,n,l,u);else{const f=So(r,u.nodeOrigin),d=ti(r.extent)?r.extent:u.nodeExtent,g=tl(f,d,Gn(r));r.internals.positionAbsolute=g}}function eE(n,l){if(!n.handles)return n.measured?l?.internals.handleBounds:void 0;const o=[],u=[];for(const r of n.handles){const f={id:r.id,width:r.width??1,height:r.height??1,nodeId:n.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?o.push(f):r.type==="target"&&u.push(f)}return{source:o,target:u}}function kf(n){return n==="manual"}function Cf(n,l,o,u={}){const r=$f(P_,u),f={i:0},d=new Map(l),g=r?.elevateNodesOnSelect&&!kf(r.zIndexMode)?uy:0;let m=n.length>0,h=!1;l.clear(),o.clear();for(const v of n){let y=d.get(v.id);if(r.checkEquality&&v===y?.internals.userNode)l.set(v.id,y);else{const x=So(v,r.nodeOrigin),S=ti(v.extent)?v.extent:r.nodeExtent,_=tl(x,S,Gn(v));y={...r.defaults,...v,measured:{width:v.measured?.width,height:v.measured?.height},internals:{positionAbsolute:_,handleBounds:eE(v,y),z:sy(v,g,r.zIndexMode),userNode:v}},l.set(v.id,y)}(y.measured===void 0||y.measured.width===void 0||y.measured.height===void 0)&&!y.hidden&&(m=!1),v.parentId&&Kf(y,l,o,u,f),h||=v.selected??!1}return{nodesInitialized:m,hasSelectedNodes:h}}function nE(n,l){if(!n.parentId)return;const o=l.get(n.parentId);o?o.set(n.id,n):l.set(n.parentId,new Map([[n.id,n]]))}function Kf(n,l,o,u,r){const{elevateNodesOnSelect:f,nodeOrigin:d,nodeExtent:g,zIndexMode:m}=$f(Qf,u),h=n.parentId,v=l.get(h);if(!v){console.warn(`Parent node ${h} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}nE(n,o),r&&!v.parentId&&v.internals.rootParentIndex===void 0&&m==="auto"&&(v.internals.rootParentIndex=++r.i,v.internals.z=v.internals.z+r.i*W_),r&&v.internals.rootParentIndex!==void 0&&(r.i=v.internals.rootParentIndex);const y=f&&!kf(m)?uy:0,{x,y:S,z:_}=aE(n,v,d,g,y,m),{positionAbsolute:A}=n.internals,T=x!==A.x||S!==A.y;(T||_!==n.internals.z)&&l.set(n.id,{...n,internals:{...n.internals,positionAbsolute:T?{x,y:S}:A,z:_}})}function sy(n,l,o){const u=Pe(n.zIndex)?n.zIndex:0;return kf(o)?u:u+(n.selected?l:0)}function aE(n,l,o,u,r,f){const{x:d,y:g}=l.internals.positionAbsolute,m=Gn(n),h=So(n,o),v=ti(n.extent)?tl(h,n.extent,m):h;let y=tl({x:d+v.x,y:g+v.y},u,m);n.extent==="parent"&&(y=Ip(y,m,l));const x=sy(n,r,f),S=l.internals.z??0;return{x:y.x,y:y.y,z:S>=x?S+1:x}}function If(n,l,o,u=[0,0]){const r=[],f=new Map;for(const d of n){const g=l.get(d.parentId);if(!g)continue;const m=f.get(d.parentId)?.expandedRect??Pl(g),h=Fp(m,d.rect);f.set(d.parentId,{expandedRect:h,parent:g})}return f.size>0&&f.forEach(({expandedRect:d,parent:g},m)=>{const h=g.internals.positionAbsolute,v=Gn(g),y=g.origin??u,x=d.x<h.x?Math.round(Math.abs(h.x-d.x)):0,S=d.y<h.y?Math.round(Math.abs(h.y-d.y)):0,_=Math.max(v.width,Math.round(d.width)),A=Math.max(v.height,Math.round(d.height)),T=(_-v.width)*y[0],z=(A-v.height)*y[1];(x>0||S>0||T||z)&&(r.push({id:m,type:"position",position:{x:g.position.x-x+T,y:g.position.y-S+z}}),o.get(m)?.forEach(L=>{n.some(E=>E.id===L.id)||r.push({id:L.id,type:"position",position:{x:L.position.x+x,y:L.position.y+S}})})),(v.width<d.width||v.height<d.height||x||S)&&r.push({id:m,type:"dimensions",setAttributes:!0,dimensions:{width:_+(x?y[0]*x-T:0),height:A+(S?y[1]*S-z:0)}})}),r}function lE(n,l,o,u,r,f,d){const g=u?.querySelector(".xyflow__viewport");let m=!1;if(!g)return{changes:[],updatedInternals:m};const h=[],v=window.getComputedStyle(g),{m22:y}=new window.DOMMatrixReadOnly(v.transform),x=[];for(const S of n.values()){const _=l.get(S.id);if(!_)continue;if(_.hidden){l.set(_.id,{..._,internals:{..._.internals,handleBounds:void 0}}),m=!0;continue}const A=Zf(S.nodeElement),T=_.measured.width!==A.width||_.measured.height!==A.height;if(!!(A.width&&A.height&&(T||!_.internals.handleBounds||S.force))){const L=S.nodeElement.getBoundingClientRect(),E=ti(_.extent)?_.extent:f;let{positionAbsolute:C}=_.internals;_.parentId&&_.extent==="parent"?C=Ip(C,A,l.get(_.parentId)):E&&(C=tl(C,E,A));const V={..._,measured:A,internals:{..._.internals,positionAbsolute:C,handleBounds:{source:b0("source",S.nodeElement,L,y,_.id),target:b0("target",S.nodeElement,L,y,_.id)}}};l.set(_.id,V),_.parentId&&Kf(V,l,o,{nodeOrigin:r,zIndexMode:d}),m=!0,T&&(h.push({id:_.id,type:"dimensions",dimensions:A}),_.expandParent&&_.parentId&&x.push({id:_.id,parentId:_.parentId,rect:Pl(V,r)}))}}if(x.length>0){const S=If(x,l,o,r);h.push(...S)}return{changes:h,updatedInternals:m}}async function iE({delta:n,panZoom:l,transform:o,translateExtent:u,width:r,height:f}){if(!l||!n.x&&!n.y)return Promise.resolve(!1);const d=await l.setViewportConstrained({x:o[0]+n.x,y:o[1]+n.y,zoom:o[2]},[[0,0],[r,f]],u),g=!!d&&(d.x!==o[0]||d.y!==o[1]||d.k!==o[2]);return Promise.resolve(g)}function z0(n,l,o,u,r,f){let d=r;const g=u.get(d)||new Map;u.set(d,g.set(o,l)),d=`${r}-${n}`;const m=u.get(d)||new Map;if(u.set(d,m.set(o,l)),f){d=`${r}-${n}-${f}`;const h=u.get(d)||new Map;u.set(d,h.set(o,l))}}function ry(n,l,o){n.clear(),l.clear();for(const u of o){const{source:r,target:f,sourceHandle:d=null,targetHandle:g=null}=u,m={edgeId:u.id,source:r,target:f,sourceHandle:d,targetHandle:g},h=`${r}-${d}--${f}-${g}`,v=`${f}-${g}--${r}-${d}`;z0("source",m,v,n,r,d),z0("target",m,h,n,f,g),l.set(u.id,u)}}function cy(n,l){if(!n.parentId)return!1;const o=l.get(n.parentId);return o?o.selected?!0:cy(o,l):!1}function T0(n,l,o){let u=n;do{if(u?.matches?.(l))return!0;if(u===o)return!1;u=u?.parentElement}while(u);return!1}function oE(n,l,o,u){const r=new Map;for(const[f,d]of n)if((d.selected||d.id===u)&&(!d.parentId||!cy(d,n))&&(d.draggable||l&&typeof d.draggable>"u")){const g=n.get(f);g&&r.set(f,{id:f,position:g.position||{x:0,y:0},distance:{x:o.x-g.internals.positionAbsolute.x,y:o.y-g.internals.positionAbsolute.y},extent:g.extent,parentId:g.parentId,origin:g.origin,expandParent:g.expandParent,internals:{positionAbsolute:g.internals.positionAbsolute||{x:0,y:0}},measured:{width:g.measured.width??0,height:g.measured.height??0}})}return r}function cf({nodeId:n,dragItems:l,nodeLookup:o,dragging:u=!0}){const r=[];for(const[d,g]of l){const m=o.get(d)?.internals.userNode;m&&r.push({...m,position:g.position,dragging:u})}if(!n)return[r[0],r];const f=o.get(n)?.internals.userNode;return[f?{...f,position:l.get(n)?.position||f.position,dragging:u}:r[0],r]}function uE({dragItems:n,snapGrid:l,x:o,y:u}){const r=n.values().next().value;if(!r)return null;const f={x:o-r.distance.x,y:u-r.distance.y},d=_o(f,l);return{x:d.x-f.x,y:d.y-f.y}}function sE({onNodeMouseDown:n,getStoreItems:l,onDragStart:o,onDrag:u,onDragStop:r}){let f={x:null,y:null},d=0,g=new Map,m=!1,h={x:0,y:0},v=null,y=!1,x=null,S=!1,_=!1,A=null;function T({noDragClassName:L,handleSelector:E,domNode:C,isSelectable:V,nodeId:B,nodeClickDistance:q=0}){x=je(C);function k({x:P,y:it}){const{nodeLookup:D,nodeExtent:G,snapGrid:N,snapToGrid:R,nodeOrigin:U,onNodeDrag:X,onSelectionDrag:tt,onError:M,updateNodePositions:H}=l();f={x:P,y:it};let W=!1;const et=g.size>1,st=et&&G?Af(bo(g)):null,ct=et&&R?uE({dragItems:g,snapGrid:N,x:P,y:it}):null;for(const[rt,ut]of g){if(!D.has(rt))continue;let ft={x:P-ut.distance.x,y:it-ut.distance.y};R&&(ft=ct?{x:Math.round(ft.x+ct.x),y:Math.round(ft.y+ct.y)}:_o(ft,N));let Et=null;if(et&&G&&!ut.extent&&st){const{positionAbsolute:xt}=ut.internals,At=xt.x-st.x+G[0][0],qt=xt.x+ut.measured.width-st.x2+G[1][0],jt=xt.y-st.y+G[0][1],oe=xt.y+ut.measured.height-st.y2+G[1][1];Et=[[At,jt],[qt,oe]]}const{position:bt,positionAbsolute:yt}=Kp({nodeId:rt,nextPosition:ft,nodeLookup:D,nodeExtent:Et||G,nodeOrigin:U,onError:M});W=W||ut.position.x!==bt.x||ut.position.y!==bt.y,ut.position=bt,ut.internals.positionAbsolute=yt}if(_=_||W,!!W&&(H(g,!0),A&&(u||X||!B&&tt))){const[rt,ut]=cf({nodeId:B,dragItems:g,nodeLookup:D});u?.(A,g,rt,ut),X?.(A,rt,ut),B||tt?.(A,ut)}}async function I(){if(!v)return;const{transform:P,panBy:it,autoPanSpeed:D,autoPanOnNodeDrag:G}=l();if(!G){m=!1,cancelAnimationFrame(d);return}const[N,R]=Jp(h,v,D);(N!==0||R!==0)&&(f.x=(f.x??0)-N/P[2],f.y=(f.y??0)-R/P[2],await it({x:N,y:R})&&k(f)),d=requestAnimationFrame(I)}function ot(P){const{nodeLookup:it,multiSelectionActive:D,nodesDraggable:G,transform:N,snapGrid:R,snapToGrid:U,selectNodesOnDrag:X,onNodeDragStart:tt,onSelectionDragStart:M,unselectNodesAndEdges:H}=l();y=!0,(!X||!V)&&!D&&B&&(it.get(B)?.selected||H()),V&&X&&B&&n?.(B);const W=oo(P.sourceEvent,{transform:N,snapGrid:R,snapToGrid:U,containerBounds:v});if(f=W,g=oE(it,G,W,B),g.size>0&&(o||tt||!B&&M)){const[et,st]=cf({nodeId:B,dragItems:g,nodeLookup:it});o?.(P.sourceEvent,g,et,st),tt?.(P.sourceEvent,et,st),B||M?.(P.sourceEvent,st)}}const $=Ap().clickDistance(q).on("start",P=>{const{domNode:it,nodeDragThreshold:D,transform:G,snapGrid:N,snapToGrid:R}=l();v=it?.getBoundingClientRect()||null,S=!1,_=!1,A=P.sourceEvent,D===0&&ot(P),f=oo(P.sourceEvent,{transform:G,snapGrid:N,snapToGrid:R,containerBounds:v}),h=tn(P.sourceEvent,v)}).on("drag",P=>{const{autoPanOnNodeDrag:it,transform:D,snapGrid:G,snapToGrid:N,nodeDragThreshold:R,nodeLookup:U}=l(),X=oo(P.sourceEvent,{transform:D,snapGrid:G,snapToGrid:N,containerBounds:v});if(A=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||B&&!U.has(B))&&(S=!0),!S){if(!m&&it&&y&&(m=!0,I()),!y){const tt=tn(P.sourceEvent,v),M=tt.x-h.x,H=tt.y-h.y;Math.sqrt(M*M+H*H)>R&&ot(P)}(f.x!==X.xSnapped||f.y!==X.ySnapped)&&g&&y&&(h=tn(P.sourceEvent,v),k(X))}}).on("end",P=>{if(!(!y||S)&&(m=!1,y=!1,cancelAnimationFrame(d),g.size>0)){const{nodeLookup:it,updateNodePositions:D,onNodeDragStop:G,onSelectionDragStop:N}=l();if(_&&(D(g,!1),_=!1),r||G||!B&&N){const[R,U]=cf({nodeId:B,dragItems:g,nodeLookup:it,dragging:!1});r?.(P.sourceEvent,g,R,U),G?.(P.sourceEvent,R,U),B||N?.(P.sourceEvent,U)}}}).filter(P=>{const it=P.target;return!P.button&&(!L||!T0(it,`.${L}`,C))&&(!E||T0(it,E,C))});x.call($)}function z(){x?.on(".drag",null)}return{update:T,destroy:z}}function rE(n,l,o){const u=[],r={x:n.x-o,y:n.y-o,width:o*2,height:o*2};for(const f of l.values())go(r,Pl(f))>0&&u.push(f);return u}const cE=250;function fE(n,l,o,u){let r=[],f=1/0;const d=rE(n,o,l+cE);for(const g of d){const m=[...g.internals.handleBounds?.source??[],...g.internals.handleBounds?.target??[]];for(const h of m){if(u.nodeId===h.nodeId&&u.type===h.type&&u.id===h.id)continue;const{x:v,y}=el(g,h,h.position,!0),x=Math.sqrt(Math.pow(v-n.x,2)+Math.pow(y-n.y,2));x>l||(x<f?(r=[{...h,x:v,y}],f=x):x===f&&r.push({...h,x:v,y}))}}if(!r.length)return null;if(r.length>1){const g=u.type==="source"?"target":"source";return r.find(m=>m.type===g)??r[0]}return r[0]}function fy(n,l,o,u,r,f=!1){const d=u.get(n);if(!d)return null;const g=r==="strict"?d.internals.handleBounds?.[l]:[...d.internals.handleBounds?.source??[],...d.internals.handleBounds?.target??[]],m=(o?g?.find(h=>h.id===o):g?.[0])??null;return m&&f?{...m,...el(d,m,m.position,!0)}:m}function dy(n,l){return n||(l?.classList.contains("target")?"target":l?.classList.contains("source")?"source":null)}function dE(n,l){let o=null;return l?o=!0:n&&!l&&(o=!1),o}const hy=()=>!0;function hE(n,{connectionMode:l,connectionRadius:o,handleId:u,nodeId:r,edgeUpdaterType:f,isTarget:d,domNode:g,nodeLookup:m,lib:h,autoPanOnConnect:v,flowId:y,panBy:x,cancelConnection:S,onConnectStart:_,onConnect:A,onConnectEnd:T,isValidConnection:z=hy,onReconnectEnd:L,updateConnection:E,getTransform:C,getFromHandle:V,autoPanSpeed:B,dragThreshold:q=1,handleDomNode:k}){const I=ty(n.target);let ot=0,$;const{x:P,y:it}=tn(n),D=dy(f,k),G=g?.getBoundingClientRect();let N=!1;if(!G||!D)return;const R=fy(r,D,u,m,l);if(!R)return;let U=tn(n,G),X=!1,tt=null,M=!1,H=null;function W(){if(!v||!G)return;const[bt,yt]=Jp(U,G,B);x({x:bt,y:yt}),ot=requestAnimationFrame(W)}const et={...R,nodeId:r,type:D,position:R.position},st=m.get(r);let rt={inProgress:!0,isValid:null,from:el(st,et,mt.Left,!0),fromHandle:et,fromPosition:et.position,fromNode:st,to:U,toHandle:null,toPosition:y0[et.position],toNode:null,pointer:U};function ut(){N=!0,E(rt),_?.(n,{nodeId:r,handleId:u,handleType:D})}q===0&&ut();function ft(bt){if(!N){const{x:oe,y:Qe}=tn(bt),Ae=oe-P,$e=Qe-it;if(!(Ae*Ae+$e*$e>q*q))return;ut()}if(!V()||!et){Et(bt);return}const yt=C();U=tn(bt,G),$=fE(Eo(U,yt,!1,[1,1]),o,m,et),X||(W(),X=!0);const xt=gy(bt,{handle:$,connectionMode:l,fromNodeId:r,fromHandleId:u,fromType:d?"target":"source",isValidConnection:z,doc:I,lib:h,flowId:y,nodeLookup:m});H=xt.handleDomNode,tt=xt.connection,M=dE(!!$,xt.isValid);const At=m.get(r),qt=At?el(At,et,mt.Left,!0):rt.from,jt={...rt,from:qt,isValid:M,to:xt.toHandle&&M?xs({x:xt.toHandle.x,y:xt.toHandle.y},yt):U,toHandle:xt.toHandle,toPosition:M&&xt.toHandle?xt.toHandle.position:y0[et.position],toNode:xt.toHandle?m.get(xt.toHandle.nodeId):null,pointer:U};E(jt),rt=jt}function Et(bt){if(!("touches"in bt&&bt.touches.length>0)){if(N){($||H)&&tt&&M&&A?.(tt);const{inProgress:yt,...xt}=rt,At={...xt,toPosition:rt.toHandle?rt.toPosition:null};T?.(bt,At),f&&L?.(bt,At)}S(),cancelAnimationFrame(ot),X=!1,M=!1,tt=null,H=null,I.removeEventListener("mousemove",ft),I.removeEventListener("mouseup",Et),I.removeEventListener("touchmove",ft),I.removeEventListener("touchend",Et)}}I.addEventListener("mousemove",ft),I.addEventListener("mouseup",Et),I.addEventListener("touchmove",ft),I.addEventListener("touchend",Et)}function gy(n,{handle:l,connectionMode:o,fromNodeId:u,fromHandleId:r,fromType:f,doc:d,lib:g,flowId:m,isValidConnection:h=hy,nodeLookup:v}){const y=f==="target",x=l?d.querySelector(`.${g}-flow__handle[data-id="${m}-${l?.nodeId}-${l?.id}-${l?.type}"]`):null,{x:S,y:_}=tn(n),A=d.elementFromPoint(S,_),T=A?.classList.contains(`${g}-flow__handle`)?A:x,z={handleDomNode:T,isValid:!1,connection:null,toHandle:null};if(T){const L=dy(void 0,T),E=T.getAttribute("data-nodeid"),C=T.getAttribute("data-handleid"),V=T.classList.contains("connectable"),B=T.classList.contains("connectableend");if(!E||!L)return z;const q={source:y?E:u,sourceHandle:y?C:r,target:y?u:E,targetHandle:y?r:C};z.connection=q;const I=V&&B&&(o===Fl.Strict?y&&L==="source"||!y&&L==="target":E!==u||C!==r);z.isValid=I&&h(q),z.toHandle=fy(E,L,C,v,o,!0)}return z}const Df={onPointerDown:hE,isValid:gy};function gE({domNode:n,panZoom:l,getTransform:o,getViewScale:u}){const r=je(n);function f({translateExtent:g,width:m,height:h,zoomStep:v=1,pannable:y=!0,zoomable:x=!0,inversePan:S=!1}){const _=E=>{if(E.sourceEvent.type!=="wheel"||!l)return;const C=o(),V=E.sourceEvent.ctrlKey&&mo()?10:1,B=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*v,q=C[2]*Math.pow(2,B*V);l.scaleTo(q)};let A=[0,0];const T=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(A=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},z=E=>{const C=o();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!l)return;const V=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],B=[V[0]-A[0],V[1]-A[1]];A=V;const q=u()*Math.max(C[2],Math.log(C[2]))*(S?-1:1),k={x:C[0]-B[0]*q,y:C[1]-B[1]*q},I=[[0,0],[m,h]];l.setViewportConstrained({x:k.x,y:k.y,zoom:C[2]},I,g)},L=Gp().on("start",T).on("zoom",y?z:null).on("zoom.wheel",x?_:null);r.call(L,{})}function d(){r.on("zoom",null)}return{update:f,destroy:d,pointer:Fe}}const zs=n=>({x:n.x,y:n.y,zoom:n.k}),ff=({x:n,y:l,zoom:o})=>Ns.translate(n,l).scale(o),Ql=(n,l)=>n.target.closest(`.${l}`),my=(n,l)=>l===2&&Array.isArray(n)&&n.includes(2),mE=n=>((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2,df=(n,l=0,o=mE,u=()=>{})=>{const r=typeof l=="number"&&l>0;return r||u(),r?n.transition().duration(l).ease(o).on("end",u):n},py=n=>{const l=n.ctrlKey&&mo()?10:1;return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*l};function pE({zoomPanValues:n,noWheelClassName:l,d3Selection:o,d3Zoom:u,panOnScrollMode:r,panOnScrollSpeed:f,zoomOnPinch:d,onPanZoomStart:g,onPanZoom:m,onPanZoomEnd:h}){return v=>{if(Ql(v,l))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const y=o.property("__zoom").k||1;if(v.ctrlKey&&d){const T=Fe(v),z=py(v),L=y*Math.pow(2,z);u.scaleTo(o,L,T,v);return}const x=v.deltaMode===1?20:1;let S=r===Fa.Vertical?0:v.deltaX*x,_=r===Fa.Horizontal?0:v.deltaY*x;!mo()&&v.shiftKey&&r!==Fa.Vertical&&(S=v.deltaY*x,_=0),u.translateBy(o,-(S/y)*f,-(_/y)*f,{internal:!0});const A=zs(o.property("__zoom"));clearTimeout(n.panScrollTimeout),n.isPanScrolling?(m?.(v,A),n.panScrollTimeout=setTimeout(()=>{h?.(v,A),n.isPanScrolling=!1},150)):(n.isPanScrolling=!0,g?.(v,A))}}function yE({noWheelClassName:n,preventScrolling:l,d3ZoomHandler:o}){return function(u,r){const f=u.type==="wheel",d=!l&&f&&!u.ctrlKey,g=Ql(u,n);if(u.ctrlKey&&f&&g&&u.preventDefault(),d||g)return null;u.preventDefault(),o.call(this,u,r)}}function vE({zoomPanValues:n,onDraggingChange:l,onPanZoomStart:o}){return u=>{if(u.sourceEvent?.internal)return;const r=zs(u.transform);n.mouseButton=u.sourceEvent?.button||0,n.isZoomingOrPanning=!0,n.prevViewport=r,u.sourceEvent?.type==="mousedown"&&l(!0),o&&o?.(u.sourceEvent,r)}}function xE({zoomPanValues:n,panOnDrag:l,onPaneContextMenu:o,onTransformChange:u,onPanZoom:r}){return f=>{n.usedRightMouseButton=!!(o&&my(l,n.mouseButton??0)),f.sourceEvent?.sync||u([f.transform.x,f.transform.y,f.transform.k]),r&&!f.sourceEvent?.internal&&r?.(f.sourceEvent,zs(f.transform))}}function SE({zoomPanValues:n,panOnDrag:l,panOnScroll:o,onDraggingChange:u,onPanZoomEnd:r,onPaneContextMenu:f}){return d=>{if(!d.sourceEvent?.internal&&(n.isZoomingOrPanning=!1,f&&my(l,n.mouseButton??0)&&!n.usedRightMouseButton&&d.sourceEvent&&f(d.sourceEvent),n.usedRightMouseButton=!1,u(!1),r)){const g=zs(d.transform);n.prevViewport=g,clearTimeout(n.timerId),n.timerId=setTimeout(()=>{r?.(d.sourceEvent,g)},o?150:0)}}}function bE({zoomActivationKeyPressed:n,zoomOnScroll:l,zoomOnPinch:o,panOnDrag:u,panOnScroll:r,zoomOnDoubleClick:f,userSelectionActive:d,noWheelClassName:g,noPanClassName:m,lib:h,connectionInProgress:v}){return y=>{const x=n||l,S=o&&y.ctrlKey,_=y.type==="wheel";if(y.button===1&&y.type==="mousedown"&&(Ql(y,`${h}-flow__node`)||Ql(y,`${h}-flow__edge`)))return!0;if(!u&&!x&&!r&&!f&&!o||d||v&&!_||Ql(y,g)&&_||Ql(y,m)&&(!_||r&&_&&!n)||!o&&y.ctrlKey&&_)return!1;if(!o&&y.type==="touchstart"&&y.touches?.length>1)return y.preventDefault(),!1;if(!x&&!r&&!S&&_||!u&&(y.type==="mousedown"||y.type==="touchstart")||Array.isArray(u)&&!u.includes(y.button)&&y.type==="mousedown")return!1;const A=Array.isArray(u)&&u.includes(y.button)||!y.button||y.button<=1;return(!y.ctrlKey||_)&&A}}function _E({domNode:n,minZoom:l,maxZoom:o,translateExtent:u,viewport:r,onPanZoom:f,onPanZoomStart:d,onPanZoomEnd:g,onDraggingChange:m}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},v=n.getBoundingClientRect(),y=Gp().scaleExtent([l,o]).translateExtent(u),x=je(n).call(y);L({x:r.x,y:r.y,zoom:Wl(r.zoom,l,o)},[[0,0],[v.width,v.height]],u);const S=x.on("wheel.zoom"),_=x.on("dblclick.zoom");y.wheelDelta(py);function A($,P){return x?new Promise(it=>{y?.interpolate(P?.interpolate==="linear"?io:is).transform(df(x,P?.duration,P?.ease,()=>it(!0)),$)}):Promise.resolve(!1)}function T({noWheelClassName:$,noPanClassName:P,onPaneContextMenu:it,userSelectionActive:D,panOnScroll:G,panOnDrag:N,panOnScrollMode:R,panOnScrollSpeed:U,preventScrolling:X,zoomOnPinch:tt,zoomOnScroll:M,zoomOnDoubleClick:H,zoomActivationKeyPressed:W,lib:et,onTransformChange:st,connectionInProgress:ct,paneClickDistance:rt,selectionOnDrag:ut}){D&&!h.isZoomingOrPanning&&z();const ft=G&&!W&&!D;y.clickDistance(ut?1/0:!Pe(rt)||rt<0?0:rt);const Et=ft?pE({zoomPanValues:h,noWheelClassName:$,d3Selection:x,d3Zoom:y,panOnScrollMode:R,panOnScrollSpeed:U,zoomOnPinch:tt,onPanZoomStart:d,onPanZoom:f,onPanZoomEnd:g}):yE({noWheelClassName:$,preventScrolling:X,d3ZoomHandler:S});if(x.on("wheel.zoom",Et,{passive:!1}),!D){const yt=vE({zoomPanValues:h,onDraggingChange:m,onPanZoomStart:d});y.on("start",yt);const xt=xE({zoomPanValues:h,panOnDrag:N,onPaneContextMenu:!!it,onPanZoom:f,onTransformChange:st});y.on("zoom",xt);const At=SE({zoomPanValues:h,panOnDrag:N,panOnScroll:G,onPaneContextMenu:it,onPanZoomEnd:g,onDraggingChange:m});y.on("end",At)}const bt=bE({zoomActivationKeyPressed:W,panOnDrag:N,zoomOnScroll:M,panOnScroll:G,zoomOnDoubleClick:H,zoomOnPinch:tt,userSelectionActive:D,noPanClassName:P,noWheelClassName:$,lib:et,connectionInProgress:ct});y.filter(bt),H?x.on("dblclick.zoom",_):x.on("dblclick.zoom",null)}function z(){y.on("zoom",null)}async function L($,P,it){const D=ff($),G=y?.constrain()(D,P,it);return G&&await A(G),new Promise(N=>N(G))}async function E($,P){const it=ff($);return await A(it,P),new Promise(D=>D(it))}function C($){if(x){const P=ff($),it=x.property("__zoom");(it.k!==$.zoom||it.x!==$.x||it.y!==$.y)&&y?.transform(x,P,null,{sync:!0})}}function V(){const $=x?Vp(x.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}function B($,P){return x?new Promise(it=>{y?.interpolate(P?.interpolate==="linear"?io:is).scaleTo(df(x,P?.duration,P?.ease,()=>it(!0)),$)}):Promise.resolve(!1)}function q($,P){return x?new Promise(it=>{y?.interpolate(P?.interpolate==="linear"?io:is).scaleBy(df(x,P?.duration,P?.ease,()=>it(!0)),$)}):Promise.resolve(!1)}function k($){y?.scaleExtent($)}function I($){y?.translateExtent($)}function ot($){const P=!Pe($)||$<0?0:$;y?.clickDistance(P)}return{update:T,destroy:z,setViewport:E,setViewportConstrained:L,getViewport:V,scaleTo:B,scaleBy:q,setScaleExtent:k,setTranslateExtent:I,syncViewport:C,setClickDistance:ot}}var ei;(function(n){n.Line="line",n.Handle="handle"})(ei||(ei={}));function EE({width:n,prevWidth:l,height:o,prevHeight:u,affectsX:r,affectsY:f}){const d=n-l,g=o-u,m=[d>0?1:d<0?-1:0,g>0?1:g<0?-1:0];return d&&r&&(m[0]=m[0]*-1),g&&f&&(m[1]=m[1]*-1),m}function C0(n){const l=n.includes("right")||n.includes("left"),o=n.includes("bottom")||n.includes("top"),u=n.includes("left"),r=n.includes("top");return{isHorizontal:l,isVertical:o,affectsX:u,affectsY:r}}function va(n,l){return Math.max(0,l-n)}function xa(n,l){return Math.max(0,n-l)}function Pu(n,l,o){return Math.max(0,l-n,n-o)}function D0(n,l){return n?!l:l}function wE(n,l,o,u,r,f,d,g){let{affectsX:m,affectsY:h}=l;const{isHorizontal:v,isVertical:y}=l,x=v&&y,{xSnapped:S,ySnapped:_}=o,{minWidth:A,maxWidth:T,minHeight:z,maxHeight:L}=u,{x:E,y:C,width:V,height:B,aspectRatio:q}=n;let k=Math.floor(v?S-n.pointerX:0),I=Math.floor(y?_-n.pointerY:0);const ot=V+(m?-k:k),$=B+(h?-I:I),P=-f[0]*V,it=-f[1]*B;let D=Pu(ot,A,T),G=Pu($,z,L);if(d){let U=0,X=0;m&&k<0?U=va(E+k+P,d[0][0]):!m&&k>0&&(U=xa(E+ot+P,d[1][0])),h&&I<0?X=va(C+I+it,d[0][1]):!h&&I>0&&(X=xa(C+$+it,d[1][1])),D=Math.max(D,U),G=Math.max(G,X)}if(g){let U=0,X=0;m&&k>0?U=xa(E+k,g[0][0]):!m&&k<0&&(U=va(E+ot,g[1][0])),h&&I>0?X=xa(C+I,g[0][1]):!h&&I<0&&(X=va(C+$,g[1][1])),D=Math.max(D,U),G=Math.max(G,X)}if(r){if(v){const U=Pu(ot/q,z,L)*q;if(D=Math.max(D,U),d){let X=0;!m&&!h||m&&!h&&x?X=xa(C+it+ot/q,d[1][1])*q:X=va(C+it+(m?k:-k)/q,d[0][1])*q,D=Math.max(D,X)}if(g){let X=0;!m&&!h||m&&!h&&x?X=va(C+ot/q,g[1][1])*q:X=xa(C+(m?k:-k)/q,g[0][1])*q,D=Math.max(D,X)}}if(y){const U=Pu($*q,A,T)/q;if(G=Math.max(G,U),d){let X=0;!m&&!h||h&&!m&&x?X=xa(E+$*q+P,d[1][0])/q:X=va(E+(h?I:-I)*q+P,d[0][0])/q,G=Math.max(G,X)}if(g){let X=0;!m&&!h||h&&!m&&x?X=va(E+$*q,g[1][0])/q:X=xa(E+(h?I:-I)*q,g[0][0])/q,G=Math.max(G,X)}}}I=I+(I<0?G:-G),k=k+(k<0?D:-D),r&&(x?ot>$*q?I=(D0(m,h)?-k:k)/q:k=(D0(m,h)?-I:I)*q:v?(I=k/q,h=m):(k=I*q,m=h));const N=m?E+k:E,R=h?C+I:C;return{width:V+(m?-k:k),height:B+(h?-I:I),x:f[0]*k*(m?-1:1)+N,y:f[1]*I*(h?-1:1)+R}}const yy={width:0,height:0,x:0,y:0},NE={...yy,pointerX:0,pointerY:0,aspectRatio:1};function ME(n){return[[0,0],[n.measured.width,n.measured.height]]}function AE(n,l,o){const u=l.position.x+n.position.x,r=l.position.y+n.position.y,f=n.measured.width??0,d=n.measured.height??0,g=o[0]*f,m=o[1]*d;return[[u-g,r-m],[u+f-g,r+d-m]]}function zE({domNode:n,nodeId:l,getStoreItems:o,onChange:u,onEnd:r}){const f=je(n);let d={controlDirection:C0("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function g({controlPosition:h,boundaries:v,keepAspectRatio:y,resizeDirection:x,onResizeStart:S,onResize:_,onResizeEnd:A,shouldResize:T}){let z={...yy},L={...NE};d={boundaries:v,resizeDirection:x,keepAspectRatio:y,controlDirection:C0(h)};let E,C=null,V=[],B,q,k,I=!1;const ot=Ap().on("start",$=>{const{nodeLookup:P,transform:it,snapGrid:D,snapToGrid:G,nodeOrigin:N,paneDomNode:R}=o();if(E=P.get(l),!E)return;C=R?.getBoundingClientRect()??null;const{xSnapped:U,ySnapped:X}=oo($.sourceEvent,{transform:it,snapGrid:D,snapToGrid:G,containerBounds:C});z={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},L={...z,pointerX:U,pointerY:X,aspectRatio:z.width/z.height},B=void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(B=P.get(E.parentId),q=B&&E.extent==="parent"?ME(B):void 0),V=[],k=void 0;for(const[tt,M]of P)if(M.parentId===l&&(V.push({id:tt,position:{...M.position},extent:M.extent}),M.extent==="parent"||M.expandParent)){const H=AE(M,E,M.origin??N);k?k=[[Math.min(H[0][0],k[0][0]),Math.min(H[0][1],k[0][1])],[Math.max(H[1][0],k[1][0]),Math.max(H[1][1],k[1][1])]]:k=H}S?.($,{...z})}).on("drag",$=>{const{transform:P,snapGrid:it,snapToGrid:D,nodeOrigin:G}=o(),N=oo($.sourceEvent,{transform:P,snapGrid:it,snapToGrid:D,containerBounds:C}),R=[];if(!E)return;const{x:U,y:X,width:tt,height:M}=z,H={},W=E.origin??G,{width:et,height:st,x:ct,y:rt}=wE(L,d.controlDirection,N,d.boundaries,d.keepAspectRatio,W,q,k),ut=et!==tt,ft=st!==M,Et=ct!==U&&ut,bt=rt!==X&&ft;if(!Et&&!bt&&!ut&&!ft)return;if((Et||bt||W[0]===1||W[1]===1)&&(H.x=Et?ct:z.x,H.y=bt?rt:z.y,z.x=H.x,z.y=H.y,V.length>0)){const qt=ct-U,jt=rt-X;for(const oe of V)oe.position={x:oe.position.x-qt+W[0]*(et-tt),y:oe.position.y-jt+W[1]*(st-M)},R.push(oe)}if((ut||ft)&&(H.width=ut&&(!d.resizeDirection||d.resizeDirection==="horizontal")?et:z.width,H.height=ft&&(!d.resizeDirection||d.resizeDirection==="vertical")?st:z.height,z.width=H.width,z.height=H.height),B&&E.expandParent){const qt=W[0]*(H.width??0);H.x&&H.x<qt&&(z.x=qt,L.x=L.x-(H.x-qt));const jt=W[1]*(H.height??0);H.y&&H.y<jt&&(z.y=jt,L.y=L.y-(H.y-jt))}const yt=EE({width:z.width,prevWidth:tt,height:z.height,prevHeight:M,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),xt={...z,direction:yt};T?.($,xt)!==!1&&(I=!0,_?.($,xt),u(H,R))}).on("end",$=>{I&&(A?.($,{...z}),r?.({...z}),I=!1)});f.call(ot)}function m(){f.on(".drag",null)}return{update:g,destroy:m}}var hf={exports:{}},gf={},mf={exports:{}},pf={};var O0;function TE(){if(O0)return pf;O0=1;var n=yo();function l(y,x){return y===x&&(y!==0||1/y===1/x)||y!==y&&x!==x}var o=typeof Object.is=="function"?Object.is:l,u=n.useState,r=n.useEffect,f=n.useLayoutEffect,d=n.useDebugValue;function g(y,x){var S=x(),_=u({inst:{value:S,getSnapshot:x}}),A=_[0].inst,T=_[1];return f(function(){A.value=S,A.getSnapshot=x,m(A)&&T({inst:A})},[y,S,x]),r(function(){return m(A)&&T({inst:A}),y(function(){m(A)&&T({inst:A})})},[y]),d(S),S}function m(y){var x=y.getSnapshot;y=y.value;try{var S=x();return!o(y,S)}catch{return!0}}function h(y,x){return x()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:g;return pf.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:v,pf}var R0;function CE(){return R0||(R0=1,mf.exports=TE()),mf.exports}var H0;function DE(){if(H0)return gf;H0=1;var n=yo(),l=CE();function o(h,v){return h===v&&(h!==0||1/h===1/v)||h!==h&&v!==v}var u=typeof Object.is=="function"?Object.is:o,r=l.useSyncExternalStore,f=n.useRef,d=n.useEffect,g=n.useMemo,m=n.useDebugValue;return gf.useSyncExternalStoreWithSelector=function(h,v,y,x,S){var _=f(null);if(_.current===null){var A={hasValue:!1,value:null};_.current=A}else A=_.current;_=g(function(){function z(B){if(!L){if(L=!0,E=B,B=x(B),S!==void 0&&A.hasValue){var q=A.value;if(S(q,B))return C=q}return C=B}if(q=C,u(E,B))return q;var k=x(B);return S!==void 0&&S(q,k)?(E=B,q):(E=B,C=k)}var L=!1,E,C,V=y===void 0?null:y;return[function(){return z(v())},V===null?void 0:function(){return z(V())}]},[v,y,x,S]);var T=r(h,_[0],_[1]);return d(function(){A.hasValue=!0,A.value=T},[T]),m(T),T},gf}var j0;function OE(){return j0||(j0=1,hf.exports=DE()),hf.exports}var RE=OE();const HE=op(RE),jE={},U0=n=>{let l;const o=new Set,u=(v,y)=>{const x=typeof v=="function"?v(l):v;if(!Object.is(x,l)){const S=l;l=y??(typeof x!="object"||x===null)?x:Object.assign({},l,x),o.forEach(_=>_(l,S))}},r=()=>l,m={setState:u,getState:r,getInitialState:()=>h,subscribe:v=>(o.add(v),()=>o.delete(v)),destroy:()=>{(jE?"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."),o.clear()}},h=l=n(u,r,m);return m},UE=n=>n?U0(n):U0,{useDebugValue:BE}=no,{useSyncExternalStoreWithSelector:qE}=HE,LE=n=>n;function vy(n,l=LE,o){const u=qE(n.subscribe,n.getState,n.getServerState||n.getInitialState,l,o);return BE(u),u}const B0=(n,l)=>{const o=UE(n),u=(r,f=l)=>vy(o,r,f);return Object.assign(u,o),u},YE=(n,l)=>n?B0(n,l):B0;function $t(n,l){if(Object.is(n,l))return!0;if(typeof n!="object"||n===null||typeof l!="object"||l===null)return!1;if(n instanceof Map&&l instanceof Map){if(n.size!==l.size)return!1;for(const[u,r]of n)if(!Object.is(r,l.get(u)))return!1;return!0}if(n instanceof Set&&l instanceof Set){if(n.size!==l.size)return!1;for(const u of n)if(!l.has(u))return!1;return!0}const o=Object.keys(n);if(o.length!==Object.keys(l).length)return!1;for(const u of o)if(!Object.prototype.hasOwnProperty.call(l,u)||!Object.is(n[u],l[u]))return!1;return!0}up();const Ts=J.createContext(null),VE=Ts.Provider,xy=hn.error001();function Dt(n,l){const o=J.useContext(Ts);if(o===null)throw new Error(xy);return vy(o,n,l)}function kt(){const n=J.useContext(Ts);if(n===null)throw new Error(xy);return J.useMemo(()=>({getState:n.getState,setState:n.setState,subscribe:n.subscribe}),[n])}const q0={display:"none"},GE={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Sy="react-flow__node-desc",by="react-flow__edge-desc",XE="react-flow__aria-live",ZE=n=>n.ariaLiveMessage,QE=n=>n.ariaLabelConfig;function $E({rfId:n}){const l=Dt(ZE);return w.jsx("div",{id:`${XE}-${n}`,"aria-live":"assertive","aria-atomic":"true",style:GE,children:l})}function kE({rfId:n,disableKeyboardA11y:l}){const o=Dt(QE);return w.jsxs(w.Fragment,{children:[w.jsx("div",{id:`${Sy}-${n}`,style:q0,children:l?o["node.a11yDescription.default"]:o["node.a11yDescription.keyboardDisabled"]}),w.jsx("div",{id:`${by}-${n}`,style:q0,children:o["edge.a11yDescription.default"]}),!l&&w.jsx($E,{rfId:n})]})}const Cs=J.forwardRef(({position:n="top-left",children:l,className:o,style:u,...r},f)=>{const d=`${n}`.split("-");return w.jsx("div",{className:ae(["react-flow__panel",o,...d]),style:u,ref:f,...r,children:l})});Cs.displayName="Panel";function KE({proOptions:n,position:l="bottom-right"}){return n?.hideAttribution?null:w.jsx(Cs,{position:l,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:w.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const IE=n=>{const l=[],o=[];for(const[,u]of n.nodeLookup)u.selected&&l.push(u.internals.userNode);for(const[,u]of n.edgeLookup)u.selected&&o.push(u);return{selectedNodes:l,selectedEdges:o}},ts=n=>n.id;function JE(n,l){return $t(n.selectedNodes.map(ts),l.selectedNodes.map(ts))&&$t(n.selectedEdges.map(ts),l.selectedEdges.map(ts))}function FE({onSelectionChange:n}){const l=kt(),{selectedNodes:o,selectedEdges:u}=Dt(IE,JE);return J.useEffect(()=>{const r={nodes:o,edges:u};n?.(r),l.getState().onSelectionChangeHandlers.forEach(f=>f(r))},[o,u,n]),null}const WE=n=>!!n.onSelectionChangeHandlers;function PE({onSelectionChange:n}){const l=Dt(WE);return n||l?w.jsx(FE,{onSelectionChange:n}):null}const Of=typeof window<"u"?J.useLayoutEffect:J.useEffect,_y=[0,0],tw={x:0,y:0,zoom:1},ew=["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"],L0=[...ew,"rfId"],nw=n=>({setNodes:n.setNodes,setEdges:n.setEdges,setMinZoom:n.setMinZoom,setMaxZoom:n.setMaxZoom,setTranslateExtent:n.setTranslateExtent,setNodeExtent:n.setNodeExtent,reset:n.reset,setDefaultNodesAndEdges:n.setDefaultNodesAndEdges}),Y0={translateExtent:fo,nodeOrigin:_y,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function aw(n){const{setNodes:l,setEdges:o,setMinZoom:u,setMaxZoom:r,setTranslateExtent:f,setNodeExtent:d,reset:g,setDefaultNodesAndEdges:m}=Dt(nw,$t),h=kt();Of(()=>(m(n.defaultNodes,n.defaultEdges),()=>{v.current=Y0,g()}),[]);const v=J.useRef(Y0);return Of(()=>{for(const y of L0){const x=n[y],S=v.current[y];x!==S&&(typeof n[y]>"u"||(y==="nodes"?l(x):y==="edges"?o(x):y==="minZoom"?u(x):y==="maxZoom"?r(x):y==="translateExtent"?f(x):y==="nodeExtent"?d(x):y==="ariaLabelConfig"?h.setState({ariaLabelConfig:Y_(x)}):y==="fitView"?h.setState({fitViewQueued:x}):y==="fitViewOptions"?h.setState({fitViewOptions:x}):h.setState({[y]:x})))}v.current=n},L0.map(y=>n[y])),null}function V0(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function lw(n){const[l,o]=J.useState(n==="system"?null:n);return J.useEffect(()=>{if(n!=="system"){o(n);return}const u=V0(),r=()=>o(u?.matches?"dark":"light");return r(),u?.addEventListener("change",r),()=>{u?.removeEventListener("change",r)}},[n]),l!==null?l:V0()?.matches?"dark":"light"}const G0=typeof document<"u"?document:null;function po(n=null,l={target:G0,actInsideInputWithModifier:!0}){const[o,u]=J.useState(!1),r=J.useRef(!1),f=J.useRef(new Set([])),[d,g]=J.useMemo(()=>{if(n!==null){const h=(Array.isArray(n)?n:[n]).filter(y=>typeof y=="string").map(y=>y.replace("+",`
|
|
10
|
+
`).replace(`
|
|
11
|
+
|
|
12
|
+
`,`
|
|
13
|
+
+`).split(`
|
|
14
|
+
`)),v=h.reduce((y,x)=>y.concat(...x),[]);return[h,v]}return[[],[]]},[n]);return J.useEffect(()=>{const m=l?.target??G0,h=l?.actInsideInputWithModifier??!0;if(n!==null){const v=S=>{if(r.current=S.ctrlKey||S.metaKey||S.shiftKey||S.altKey,(!r.current||r.current&&!h)&&ey(S))return!1;const A=Z0(S.code,g);if(f.current.add(S[A]),X0(d,f.current,!1)){const T=S.composedPath?.()?.[0]||S.target,z=T?.nodeName==="BUTTON"||T?.nodeName==="A";l.preventDefault!==!1&&(r.current||!z)&&S.preventDefault(),u(!0)}},y=S=>{const _=Z0(S.code,g);X0(d,f.current,!0)?(u(!1),f.current.clear()):f.current.delete(S[_]),S.key==="Meta"&&f.current.clear(),r.current=!1},x=()=>{f.current.clear(),u(!1)};return m?.addEventListener("keydown",v),m?.addEventListener("keyup",y),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{m?.removeEventListener("keydown",v),m?.removeEventListener("keyup",y),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[n,u]),o}function X0(n,l,o){return n.filter(u=>o||u.length===l.size).some(u=>u.every(r=>l.has(r)))}function Z0(n,l){return l.includes(n)?"code":"key"}const iw=()=>{const n=kt();return J.useMemo(()=>({zoomIn:l=>{const{panZoom:o}=n.getState();return o?o.scaleBy(1.2,l):Promise.resolve(!1)},zoomOut:l=>{const{panZoom:o}=n.getState();return o?o.scaleBy(1/1.2,l):Promise.resolve(!1)},zoomTo:(l,o)=>{const{panZoom:u}=n.getState();return u?u.scaleTo(l,o):Promise.resolve(!1)},getZoom:()=>n.getState().transform[2],setViewport:async(l,o)=>{const{transform:[u,r,f],panZoom:d}=n.getState();return d?(await d.setViewport({x:l.x??u,y:l.y??r,zoom:l.zoom??f},o),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[l,o,u]=n.getState().transform;return{x:l,y:o,zoom:u}},setCenter:async(l,o,u)=>n.getState().setCenter(l,o,u),fitBounds:async(l,o)=>{const{width:u,height:r,minZoom:f,maxZoom:d,panZoom:g}=n.getState(),m=Xf(l,u,r,f,d,o?.padding??.1);return g?(await g.setViewport(m,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(l,o={})=>{const{transform:u,snapGrid:r,snapToGrid:f,domNode:d}=n.getState();if(!d)return l;const{x:g,y:m}=d.getBoundingClientRect(),h={x:l.x-g,y:l.y-m},v=o.snapGrid??r,y=o.snapToGrid??f;return Eo(h,u,y,v)},flowToScreenPosition:l=>{const{transform:o,domNode:u}=n.getState();if(!u)return l;const{x:r,y:f}=u.getBoundingClientRect(),d=xs(l,o);return{x:d.x+r,y:d.y+f}}}),[])};function Ey(n,l){const o=[],u=new Map,r=[];for(const f of n)if(f.type==="add"){r.push(f);continue}else if(f.type==="remove"||f.type==="replace")u.set(f.id,[f]);else{const d=u.get(f.id);d?d.push(f):u.set(f.id,[f])}for(const f of l){const d=u.get(f.id);if(!d){o.push(f);continue}if(d[0].type==="remove")continue;if(d[0].type==="replace"){o.push({...d[0].item});continue}const g={...f};for(const m of d)ow(m,g);o.push(g)}return r.length&&r.forEach(f=>{f.index!==void 0?o.splice(f.index,0,{...f.item}):o.push({...f.item})}),o}function ow(n,l){switch(n.type){case"select":{l.selected=n.selected;break}case"position":{typeof n.position<"u"&&(l.position=n.position),typeof n.dragging<"u"&&(l.dragging=n.dragging);break}case"dimensions":{typeof n.dimensions<"u"&&(l.measured={...n.dimensions},n.setAttributes&&((n.setAttributes===!0||n.setAttributes==="width")&&(l.width=n.dimensions.width),(n.setAttributes===!0||n.setAttributes==="height")&&(l.height=n.dimensions.height))),typeof n.resizing=="boolean"&&(l.resizing=n.resizing);break}}}function uw(n,l){return Ey(n,l)}function sw(n,l){return Ey(n,l)}function Ka(n,l){return{id:n,type:"select",selected:l}}function $l(n,l=new Set,o=!1){const u=[];for(const[r,f]of n){const d=l.has(r);!(f.selected===void 0&&!d)&&f.selected!==d&&(o&&(f.selected=d),u.push(Ka(f.id,d)))}return u}function Q0({items:n=[],lookup:l}){const o=[],u=new Map(n.map(r=>[r.id,r]));for(const[r,f]of n.entries()){const d=l.get(f.id),g=d?.internals?.userNode??d;g!==void 0&&g!==f&&o.push({id:f.id,item:f,type:"replace"}),g===void 0&&o.push({item:f,type:"add",index:r})}for(const[r]of l)u.get(r)===void 0&&o.push({id:r,type:"remove"});return o}function $0(n){return{id:n.id,type:"remove"}}const k0=n=>C_(n),rw=n=>kp(n);function wy(n){return J.forwardRef(n)}function K0(n){const[l,o]=J.useState(BigInt(0)),[u]=J.useState(()=>cw(()=>o(r=>r+BigInt(1))));return Of(()=>{const r=u.get();r.length&&(n(r),u.reset())},[l]),u}function cw(n){let l=[];return{get:()=>l,reset:()=>{l=[]},push:o=>{l.push(o),n()}}}const Ny=J.createContext(null);function fw({children:n}){const l=kt(),o=J.useCallback(g=>{const{nodes:m=[],setNodes:h,hasDefaultNodes:v,onNodesChange:y,nodeLookup:x,fitViewQueued:S,onNodesChangeMiddlewareMap:_}=l.getState();let A=m;for(const z of g)A=typeof z=="function"?z(A):z;let T=Q0({items:A,lookup:x});for(const z of _.values())T=z(T);v&&h(A),T.length>0?y?.(T):S&&window.requestAnimationFrame(()=>{const{fitViewQueued:z,nodes:L,setNodes:E}=l.getState();z&&E(L)})},[]),u=K0(o),r=J.useCallback(g=>{const{edges:m=[],setEdges:h,hasDefaultEdges:v,onEdgesChange:y,edgeLookup:x}=l.getState();let S=m;for(const _ of g)S=typeof _=="function"?_(S):_;v?h(S):y&&y(Q0({items:S,lookup:x}))},[]),f=K0(r),d=J.useMemo(()=>({nodeQueue:u,edgeQueue:f}),[]);return w.jsx(Ny.Provider,{value:d,children:n})}function dw(){const n=J.useContext(Ny);if(!n)throw new Error("useBatchContext must be used within a BatchProvider");return n}const hw=n=>!!n.panZoom;function Jf(){const n=iw(),l=kt(),o=dw(),u=Dt(hw),r=J.useMemo(()=>{const f=y=>l.getState().nodeLookup.get(y),d=y=>{o.nodeQueue.push(y)},g=y=>{o.edgeQueue.push(y)},m=y=>{const{nodeLookup:x,nodeOrigin:S}=l.getState(),_=k0(y)?y:x.get(y.id),A=_.parentId?Pp(_.position,_.measured,_.parentId,x,S):_.position,T={..._,position:A,width:_.measured?.width??_.width,height:_.measured?.height??_.height};return Pl(T)},h=(y,x,S={replace:!1})=>{d(_=>_.map(A=>{if(A.id===y){const T=typeof x=="function"?x(A):x;return S.replace&&k0(T)?T:{...A,...T}}return A}))},v=(y,x,S={replace:!1})=>{g(_=>_.map(A=>{if(A.id===y){const T=typeof x=="function"?x(A):x;return S.replace&&rw(T)?T:{...A,...T}}return A}))};return{getNodes:()=>l.getState().nodes.map(y=>({...y})),getNode:y=>f(y)?.internals.userNode,getInternalNode:f,getEdges:()=>{const{edges:y=[]}=l.getState();return y.map(x=>({...x}))},getEdge:y=>l.getState().edgeLookup.get(y),setNodes:d,setEdges:g,addNodes:y=>{const x=Array.isArray(y)?y:[y];o.nodeQueue.push(S=>[...S,...x])},addEdges:y=>{const x=Array.isArray(y)?y:[y];o.edgeQueue.push(S=>[...S,...x])},toObject:()=>{const{nodes:y=[],edges:x=[],transform:S}=l.getState(),[_,A,T]=S;return{nodes:y.map(z=>({...z})),edges:x.map(z=>({...z})),viewport:{x:_,y:A,zoom:T}}},deleteElements:async({nodes:y=[],edges:x=[]})=>{const{nodes:S,edges:_,onNodesDelete:A,onEdgesDelete:T,triggerNodeChanges:z,triggerEdgeChanges:L,onDelete:E,onBeforeDelete:C}=l.getState(),{nodes:V,edges:B}=await j_({nodesToRemove:y,edgesToRemove:x,nodes:S,edges:_,onBeforeDelete:C}),q=B.length>0,k=V.length>0;if(q){const I=B.map($0);T?.(B),L(I)}if(k){const I=V.map($0);A?.(V),z(I)}return(k||q)&&E?.({nodes:V,edges:B}),{deletedNodes:V,deletedEdges:B}},getIntersectingNodes:(y,x=!0,S)=>{const _=x0(y),A=_?y:m(y),T=S!==void 0;return A?(S||l.getState().nodes).filter(z=>{const L=l.getState().nodeLookup.get(z.id);if(L&&!_&&(z.id===y.id||!L.internals.positionAbsolute))return!1;const E=Pl(T?z:L),C=go(E,A);return x&&C>0||C>=E.width*E.height||C>=A.width*A.height}):[]},isNodeIntersecting:(y,x,S=!0)=>{const A=x0(y)?y:m(y);if(!A)return!1;const T=go(A,x);return S&&T>0||T>=x.width*x.height||T>=A.width*A.height},updateNode:h,updateNodeData:(y,x,S={replace:!1})=>{h(y,_=>{const A=typeof x=="function"?x(_):x;return S.replace?{..._,data:A}:{..._,data:{..._.data,...A}}},S)},updateEdge:v,updateEdgeData:(y,x,S={replace:!1})=>{v(y,_=>{const A=typeof x=="function"?x(_):x;return S.replace?{..._,data:A}:{..._,data:{..._.data,...A}}},S)},getNodesBounds:y=>{const{nodeLookup:x,nodeOrigin:S}=l.getState();return D_(y,{nodeLookup:x,nodeOrigin:S})},getHandleConnections:({type:y,id:x,nodeId:S})=>Array.from(l.getState().connectionLookup.get(`${S}-${y}${x?`-${x}`:""}`)?.values()??[]),getNodeConnections:({type:y,handleId:x,nodeId:S})=>Array.from(l.getState().connectionLookup.get(`${S}${y?x?`-${y}-${x}`:`-${y}`:""}`)?.values()??[]),fitView:async y=>{const x=l.getState().fitViewResolver??L_();return l.setState({fitViewQueued:!0,fitViewOptions:y,fitViewResolver:x}),o.nodeQueue.push(S=>[...S]),x.promise}}},[]);return J.useMemo(()=>({...r,...n,viewportInitialized:u}),[u])}const I0=n=>n.selected,gw=typeof window<"u"?window:void 0;function mw({deleteKeyCode:n,multiSelectionKeyCode:l}){const o=kt(),{deleteElements:u}=Jf(),r=po(n,{actInsideInputWithModifier:!1}),f=po(l,{target:gw});J.useEffect(()=>{if(r){const{edges:d,nodes:g}=o.getState();u({nodes:g.filter(I0),edges:d.filter(I0)}),o.setState({nodesSelectionActive:!1})}},[r]),J.useEffect(()=>{o.setState({multiSelectionActive:f})},[f])}function pw(n){const l=kt();J.useEffect(()=>{const o=()=>{if(!n.current||!(n.current.checkVisibility?.()??!0))return!1;const u=Zf(n.current);(u.height===0||u.width===0)&&l.getState().onError?.("004",hn.error004()),l.setState({width:u.width||500,height:u.height||500})};if(n.current){o(),window.addEventListener("resize",o);const u=new ResizeObserver(()=>o());return u.observe(n.current),()=>{window.removeEventListener("resize",o),u&&n.current&&u.unobserve(n.current)}}},[])}const Ds={position:"absolute",width:"100%",height:"100%",top:0,left:0},yw=n=>({userSelectionActive:n.userSelectionActive,lib:n.lib,connectionInProgress:n.connection.inProgress});function vw({onPaneContextMenu:n,zoomOnScroll:l=!0,zoomOnPinch:o=!0,panOnScroll:u=!1,panOnScrollSpeed:r=.5,panOnScrollMode:f=Fa.Free,zoomOnDoubleClick:d=!0,panOnDrag:g=!0,defaultViewport:m,translateExtent:h,minZoom:v,maxZoom:y,zoomActivationKeyCode:x,preventScrolling:S=!0,children:_,noWheelClassName:A,noPanClassName:T,onViewportChange:z,isControlledViewport:L,paneClickDistance:E,selectionOnDrag:C}){const V=kt(),B=J.useRef(null),{userSelectionActive:q,lib:k,connectionInProgress:I}=Dt(yw,$t),ot=po(x),$=J.useRef();pw(B);const P=J.useCallback(it=>{z?.({x:it[0],y:it[1],zoom:it[2]}),L||V.setState({transform:it})},[z,L]);return J.useEffect(()=>{if(B.current){$.current=_E({domNode:B.current,minZoom:v,maxZoom:y,translateExtent:h,viewport:m,onDraggingChange:N=>V.setState(R=>R.paneDragging===N?R:{paneDragging:N}),onPanZoomStart:(N,R)=>{const{onViewportChangeStart:U,onMoveStart:X}=V.getState();X?.(N,R),U?.(R)},onPanZoom:(N,R)=>{const{onViewportChange:U,onMove:X}=V.getState();X?.(N,R),U?.(R)},onPanZoomEnd:(N,R)=>{const{onViewportChangeEnd:U,onMoveEnd:X}=V.getState();X?.(N,R),U?.(R)}});const{x:it,y:D,zoom:G}=$.current.getViewport();return V.setState({panZoom:$.current,transform:[it,D,G],domNode:B.current.closest(".react-flow")}),()=>{$.current?.destroy()}}},[]),J.useEffect(()=>{$.current?.update({onPaneContextMenu:n,zoomOnScroll:l,zoomOnPinch:o,panOnScroll:u,panOnScrollSpeed:r,panOnScrollMode:f,zoomOnDoubleClick:d,panOnDrag:g,zoomActivationKeyPressed:ot,preventScrolling:S,noPanClassName:T,userSelectionActive:q,noWheelClassName:A,lib:k,onTransformChange:P,connectionInProgress:I,selectionOnDrag:C,paneClickDistance:E})},[n,l,o,u,r,f,d,g,ot,S,T,q,A,k,P,I,C,E]),w.jsx("div",{className:"react-flow__renderer",ref:B,style:Ds,children:_})}const xw=n=>({userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect});function Sw(){const{userSelectionActive:n,userSelectionRect:l}=Dt(xw,$t);return n&&l?w.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:l.width,height:l.height,transform:`translate(${l.x}px, ${l.y}px)`}}):null}const yf=(n,l)=>o=>{o.target===l.current&&n?.(o)},bw=n=>({userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,connectionInProgress:n.connection.inProgress,dragging:n.paneDragging});function _w({isSelecting:n,selectionKeyPressed:l,selectionMode:o=ho.Full,panOnDrag:u,paneClickDistance:r,selectionOnDrag:f,onSelectionStart:d,onSelectionEnd:g,onPaneClick:m,onPaneContextMenu:h,onPaneScroll:v,onPaneMouseEnter:y,onPaneMouseMove:x,onPaneMouseLeave:S,children:_}){const A=kt(),{userSelectionActive:T,elementsSelectable:z,dragging:L,connectionInProgress:E}=Dt(bw,$t),C=z&&(n||T),V=J.useRef(null),B=J.useRef(),q=J.useRef(new Set),k=J.useRef(new Set),I=J.useRef(!1),ot=U=>{if(I.current||E){I.current=!1;return}m?.(U),A.getState().resetSelectedElements(),A.setState({nodesSelectionActive:!1})},$=U=>{if(Array.isArray(u)&&u?.includes(2)){U.preventDefault();return}h?.(U)},P=v?U=>v(U):void 0,it=U=>{I.current&&(U.stopPropagation(),I.current=!1)},D=U=>{const{domNode:X}=A.getState();if(B.current=X?.getBoundingClientRect(),!B.current)return;const tt=U.target===V.current;if(!tt&&!!U.target.closest(".nokey")||!n||!(f&&tt||l)||U.button!==0||!U.isPrimary)return;U.target?.setPointerCapture?.(U.pointerId),I.current=!1;const{x:W,y:et}=tn(U.nativeEvent,B.current);A.setState({userSelectionRect:{width:0,height:0,startX:W,startY:et,x:W,y:et}}),tt||(U.stopPropagation(),U.preventDefault())},G=U=>{const{userSelectionRect:X,transform:tt,nodeLookup:M,edgeLookup:H,connectionLookup:W,triggerNodeChanges:et,triggerEdgeChanges:st,defaultEdgeOptions:ct,resetSelectedElements:rt}=A.getState();if(!B.current||!X)return;const{x:ut,y:ft}=tn(U.nativeEvent,B.current),{startX:Et,startY:bt}=X;if(!I.current){const jt=l?0:r;if(Math.hypot(ut-Et,ft-bt)<=jt)return;rt(),d?.(U)}I.current=!0;const yt={startX:Et,startY:bt,x:ut<Et?ut:Et,y:ft<bt?ft:bt,width:Math.abs(ut-Et),height:Math.abs(ft-bt)},xt=q.current,At=k.current;q.current=new Set(Gf(M,yt,tt,o===ho.Partial,!0).map(jt=>jt.id)),k.current=new Set;const qt=ct?.selectable??!0;for(const jt of q.current){const oe=W.get(jt);if(oe)for(const{edgeId:Qe}of oe.values()){const Ae=H.get(Qe);Ae&&(Ae.selectable??qt)&&k.current.add(Qe)}}if(!S0(xt,q.current)){const jt=$l(M,q.current,!0);et(jt)}if(!S0(At,k.current)){const jt=$l(H,k.current);st(jt)}A.setState({userSelectionRect:yt,userSelectionActive:!0,nodesSelectionActive:!1})},N=U=>{U.button===0&&(U.target?.releasePointerCapture?.(U.pointerId),!T&&U.target===V.current&&A.getState().userSelectionRect&&ot?.(U),A.setState({userSelectionActive:!1,userSelectionRect:null}),I.current&&(g?.(U),A.setState({nodesSelectionActive:q.current.size>0})))},R=u===!0||Array.isArray(u)&&u.includes(0);return w.jsxs("div",{className:ae(["react-flow__pane",{draggable:R,dragging:L,selection:n}]),onClick:C?void 0:yf(ot,V),onContextMenu:yf($,V),onWheel:yf(P,V),onPointerEnter:C?void 0:y,onPointerMove:C?G:x,onPointerUp:C?N:void 0,onPointerDownCapture:C?D:void 0,onClickCapture:C?it:void 0,onPointerLeave:S,ref:V,style:Ds,children:[_,w.jsx(Sw,{})]})}function Rf({id:n,store:l,unselect:o=!1,nodeRef:u}){const{addSelectedNodes:r,unselectNodesAndEdges:f,multiSelectionActive:d,nodeLookup:g,onError:m}=l.getState(),h=g.get(n);if(!h){m?.("012",hn.error012(n));return}l.setState({nodesSelectionActive:!1}),h.selected?(o||h.selected&&d)&&(f({nodes:[h],edges:[]}),requestAnimationFrame(()=>u?.current?.blur())):r([n])}function My({nodeRef:n,disabled:l=!1,noDragClassName:o,handleSelector:u,nodeId:r,isSelectable:f,nodeClickDistance:d}){const g=kt(),[m,h]=J.useState(!1),v=J.useRef();return J.useEffect(()=>{v.current=sE({getStoreItems:()=>g.getState(),onNodeMouseDown:y=>{Rf({id:y,store:g,nodeRef:n})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),J.useEffect(()=>{if(!(l||!n.current||!v.current))return v.current.update({noDragClassName:o,handleSelector:u,domNode:n.current,isSelectable:f,nodeId:r,nodeClickDistance:d}),()=>{v.current?.destroy()}},[o,u,l,f,n,r,d]),m}const Ew=n=>l=>l.selected&&(l.draggable||n&&typeof l.draggable>"u");function Ay(){const n=kt();return J.useCallback(o=>{const{nodeExtent:u,snapToGrid:r,snapGrid:f,nodesDraggable:d,onError:g,updateNodePositions:m,nodeLookup:h,nodeOrigin:v}=n.getState(),y=new Map,x=Ew(d),S=r?f[0]:5,_=r?f[1]:5,A=o.direction.x*S*o.factor,T=o.direction.y*_*o.factor;for(const[,z]of h){if(!x(z))continue;let L={x:z.internals.positionAbsolute.x+A,y:z.internals.positionAbsolute.y+T};r&&(L=_o(L,f));const{position:E,positionAbsolute:C}=Kp({nodeId:z.id,nextPosition:L,nodeLookup:h,nodeExtent:u,nodeOrigin:v,onError:g});z.position=E,z.internals.positionAbsolute=C,y.set(z.id,z)}m(y)},[])}const Ff=J.createContext(null),ww=Ff.Provider;Ff.Consumer;const zy=()=>J.useContext(Ff),Nw=n=>({connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}),Mw=(n,l,o)=>u=>{const{connectionClickStartHandle:r,connectionMode:f,connection:d}=u,{fromHandle:g,toHandle:m,isValid:h}=d,v=m?.nodeId===n&&m?.id===l&&m?.type===o;return{connectingFrom:g?.nodeId===n&&g?.id===l&&g?.type===o,connectingTo:v,clickConnecting:r?.nodeId===n&&r?.id===l&&r?.type===o,isPossibleEndHandle:f===Fl.Strict?g?.type!==o:n!==g?.nodeId||l!==g?.id,connectionInProcess:!!g,clickConnectionInProcess:!!r,valid:v&&h}};function Aw({type:n="source",position:l=mt.Top,isValidConnection:o,isConnectable:u=!0,isConnectableStart:r=!0,isConnectableEnd:f=!0,id:d,onConnect:g,children:m,className:h,onMouseDown:v,onTouchStart:y,...x},S){const _=d||null,A=n==="target",T=kt(),z=zy(),{connectOnClick:L,noPanClassName:E,rfId:C}=Dt(Nw,$t),{connectingFrom:V,connectingTo:B,clickConnecting:q,isPossibleEndHandle:k,connectionInProcess:I,clickConnectionInProcess:ot,valid:$}=Dt(Mw(z,_,n),$t);z||T.getState().onError?.("010",hn.error010());const P=G=>{const{defaultEdgeOptions:N,onConnect:R,hasDefaultEdges:U}=T.getState(),X={...N,...G};if(U){const{edges:tt,setEdges:M}=T.getState();M($_(X,tt))}R?.(X),g?.(X)},it=G=>{if(!z)return;const N=ny(G.nativeEvent);if(r&&(N&&G.button===0||!N)){const R=T.getState();Df.onPointerDown(G.nativeEvent,{handleDomNode:G.currentTarget,autoPanOnConnect:R.autoPanOnConnect,connectionMode:R.connectionMode,connectionRadius:R.connectionRadius,domNode:R.domNode,nodeLookup:R.nodeLookup,lib:R.lib,isTarget:A,handleId:_,nodeId:z,flowId:R.rfId,panBy:R.panBy,cancelConnection:R.cancelConnection,onConnectStart:R.onConnectStart,onConnectEnd:(...U)=>T.getState().onConnectEnd?.(...U),updateConnection:R.updateConnection,onConnect:P,isValidConnection:o||((...U)=>T.getState().isValidConnection?.(...U)??!0),getTransform:()=>T.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:R.autoPanSpeed,dragThreshold:R.connectionDragThreshold})}N?v?.(G):y?.(G)},D=G=>{const{onClickConnectStart:N,onClickConnectEnd:R,connectionClickStartHandle:U,connectionMode:X,isValidConnection:tt,lib:M,rfId:H,nodeLookup:W,connection:et}=T.getState();if(!z||!U&&!r)return;if(!U){N?.(G.nativeEvent,{nodeId:z,handleId:_,handleType:n}),T.setState({connectionClickStartHandle:{nodeId:z,type:n,id:_}});return}const st=ty(G.target),ct=o||tt,{connection:rt,isValid:ut}=Df.isValid(G.nativeEvent,{handle:{nodeId:z,id:_,type:n},connectionMode:X,fromNodeId:U.nodeId,fromHandleId:U.id||null,fromType:U.type,isValidConnection:ct,flowId:H,doc:st,lib:M,nodeLookup:W});ut&&rt&&P(rt);const ft=structuredClone(et);delete ft.inProgress,ft.toPosition=ft.toHandle?ft.toHandle.position:null,R?.(G,ft),T.setState({connectionClickStartHandle:null})};return w.jsx("div",{"data-handleid":_,"data-nodeid":z,"data-handlepos":l,"data-id":`${C}-${z}-${_}-${n}`,className:ae(["react-flow__handle",`react-flow__handle-${l}`,"nodrag",E,h,{source:!A,target:A,connectable:u,connectablestart:r,connectableend:f,clickconnecting:q,connectingfrom:V,connectingto:B,valid:$,connectionindicator:u&&(!I||k)&&(I||ot?f:r)}]),onMouseDown:it,onTouchStart:it,onClick:L?D:void 0,ref:S,...x,children:m})}const ni=J.memo(wy(Aw));function zw({data:n,isConnectable:l,sourcePosition:o=mt.Bottom}){return w.jsxs(w.Fragment,{children:[n?.label,w.jsx(ni,{type:"source",position:o,isConnectable:l})]})}function Tw({data:n,isConnectable:l,targetPosition:o=mt.Top,sourcePosition:u=mt.Bottom}){return w.jsxs(w.Fragment,{children:[w.jsx(ni,{type:"target",position:o,isConnectable:l}),n?.label,w.jsx(ni,{type:"source",position:u,isConnectable:l})]})}function Cw(){return null}function Dw({data:n,isConnectable:l,targetPosition:o=mt.Top}){return w.jsxs(w.Fragment,{children:[w.jsx(ni,{type:"target",position:o,isConnectable:l}),n?.label]})}const Ss={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},J0={input:zw,default:Tw,output:Dw,group:Cw};function Ow(n){return n.internals.handleBounds===void 0?{width:n.width??n.initialWidth??n.style?.width,height:n.height??n.initialHeight??n.style?.height}:{width:n.width??n.style?.width,height:n.height??n.style?.height}}const Rw=n=>{const{width:l,height:o,x:u,y:r}=bo(n.nodeLookup,{filter:f=>!!f.selected});return{width:Pe(l)?l:null,height:Pe(o)?o:null,userSelectionActive:n.userSelectionActive,transformString:`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]}) translate(${u}px,${r}px)`}};function Hw({onSelectionContextMenu:n,noPanClassName:l,disableKeyboardA11y:o}){const u=kt(),{width:r,height:f,transformString:d,userSelectionActive:g}=Dt(Rw,$t),m=Ay(),h=J.useRef(null);J.useEffect(()=>{o||h.current?.focus({preventScroll:!0})},[o]);const v=!g&&r!==null&&f!==null;if(My({nodeRef:h,disabled:!v}),!v)return null;const y=n?S=>{const _=u.getState().nodes.filter(A=>A.selected);n(S,_)}:void 0,x=S=>{Object.prototype.hasOwnProperty.call(Ss,S.key)&&(S.preventDefault(),m({direction:Ss[S.key],factor:S.shiftKey?4:1}))};return w.jsx("div",{className:ae(["react-flow__nodesselection","react-flow__container",l]),style:{transform:d},children:w.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:y,tabIndex:o?void 0:-1,onKeyDown:o?void 0:x,style:{width:r,height:f}})})}const F0=typeof window<"u"?window:void 0,jw=n=>({nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive});function Ty({children:n,onPaneClick:l,onPaneMouseEnter:o,onPaneMouseMove:u,onPaneMouseLeave:r,onPaneContextMenu:f,onPaneScroll:d,paneClickDistance:g,deleteKeyCode:m,selectionKeyCode:h,selectionOnDrag:v,selectionMode:y,onSelectionStart:x,onSelectionEnd:S,multiSelectionKeyCode:_,panActivationKeyCode:A,zoomActivationKeyCode:T,elementsSelectable:z,zoomOnScroll:L,zoomOnPinch:E,panOnScroll:C,panOnScrollSpeed:V,panOnScrollMode:B,zoomOnDoubleClick:q,panOnDrag:k,defaultViewport:I,translateExtent:ot,minZoom:$,maxZoom:P,preventScrolling:it,onSelectionContextMenu:D,noWheelClassName:G,noPanClassName:N,disableKeyboardA11y:R,onViewportChange:U,isControlledViewport:X}){const{nodesSelectionActive:tt,userSelectionActive:M}=Dt(jw,$t),H=po(h,{target:F0}),W=po(A,{target:F0}),et=W||k,st=W||C,ct=v&&et!==!0,rt=H||M||ct;return mw({deleteKeyCode:m,multiSelectionKeyCode:_}),w.jsx(vw,{onPaneContextMenu:f,elementsSelectable:z,zoomOnScroll:L,zoomOnPinch:E,panOnScroll:st,panOnScrollSpeed:V,panOnScrollMode:B,zoomOnDoubleClick:q,panOnDrag:!H&&et,defaultViewport:I,translateExtent:ot,minZoom:$,maxZoom:P,zoomActivationKeyCode:T,preventScrolling:it,noWheelClassName:G,noPanClassName:N,onViewportChange:U,isControlledViewport:X,paneClickDistance:g,selectionOnDrag:ct,children:w.jsxs(_w,{onSelectionStart:x,onSelectionEnd:S,onPaneClick:l,onPaneMouseEnter:o,onPaneMouseMove:u,onPaneMouseLeave:r,onPaneContextMenu:f,onPaneScroll:d,panOnDrag:et,isSelecting:!!rt,selectionMode:y,selectionKeyPressed:H,paneClickDistance:g,selectionOnDrag:ct,children:[n,tt&&w.jsx(Hw,{onSelectionContextMenu:D,noPanClassName:N,disableKeyboardA11y:R})]})})}Ty.displayName="FlowRenderer";const Uw=J.memo(Ty),Bw=n=>l=>n?Gf(l.nodeLookup,{x:0,y:0,width:l.width,height:l.height},l.transform,!0).map(o=>o.id):Array.from(l.nodeLookup.keys());function qw(n){return Dt(J.useCallback(Bw(n),[n]),$t)}const Lw=n=>n.updateNodeInternals;function Yw(){const n=Dt(Lw),[l]=J.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(o=>{const u=new Map;o.forEach(r=>{const f=r.target.getAttribute("data-id");u.set(f,{id:f,nodeElement:r.target,force:!0})}),n(u)}));return J.useEffect(()=>()=>{l?.disconnect()},[l]),l}function Vw({node:n,nodeType:l,hasDimensions:o,resizeObserver:u}){const r=kt(),f=J.useRef(null),d=J.useRef(null),g=J.useRef(n.sourcePosition),m=J.useRef(n.targetPosition),h=J.useRef(l),v=o&&!!n.internals.handleBounds;return J.useEffect(()=>{f.current&&!n.hidden&&(!v||d.current!==f.current)&&(d.current&&u?.unobserve(d.current),u?.observe(f.current),d.current=f.current)},[v,n.hidden]),J.useEffect(()=>()=>{d.current&&(u?.unobserve(d.current),d.current=null)},[]),J.useEffect(()=>{if(f.current){const y=h.current!==l,x=g.current!==n.sourcePosition,S=m.current!==n.targetPosition;(y||x||S)&&(h.current=l,g.current=n.sourcePosition,m.current=n.targetPosition,r.getState().updateNodeInternals(new Map([[n.id,{id:n.id,nodeElement:f.current,force:!0}]])))}},[n.id,l,n.sourcePosition,n.targetPosition]),f}function Gw({id:n,onClick:l,onMouseEnter:o,onMouseMove:u,onMouseLeave:r,onContextMenu:f,onDoubleClick:d,nodesDraggable:g,elementsSelectable:m,nodesConnectable:h,nodesFocusable:v,resizeObserver:y,noDragClassName:x,noPanClassName:S,disableKeyboardA11y:_,rfId:A,nodeTypes:T,nodeClickDistance:z,onError:L}){const{node:E,internals:C,isParent:V}=Dt(ut=>{const ft=ut.nodeLookup.get(n),Et=ut.parentLookup.has(n);return{node:ft,internals:ft.internals,isParent:Et}},$t);let B=E.type||"default",q=T?.[B]||J0[B];q===void 0&&(L?.("003",hn.error003(B)),B="default",q=T?.default||J0.default);const k=!!(E.draggable||g&&typeof E.draggable>"u"),I=!!(E.selectable||m&&typeof E.selectable>"u"),ot=!!(E.connectable||h&&typeof E.connectable>"u"),$=!!(E.focusable||v&&typeof E.focusable>"u"),P=kt(),it=Wp(E),D=Vw({node:E,nodeType:B,hasDimensions:it,resizeObserver:y}),G=My({nodeRef:D,disabled:E.hidden||!k,noDragClassName:x,handleSelector:E.dragHandle,nodeId:n,isSelectable:I,nodeClickDistance:z}),N=Ay();if(E.hidden)return null;const R=Gn(E),U=Ow(E),X=I||k||l||o||u||r,tt=o?ut=>o(ut,{...C.userNode}):void 0,M=u?ut=>u(ut,{...C.userNode}):void 0,H=r?ut=>r(ut,{...C.userNode}):void 0,W=f?ut=>f(ut,{...C.userNode}):void 0,et=d?ut=>d(ut,{...C.userNode}):void 0,st=ut=>{const{selectNodesOnDrag:ft,nodeDragThreshold:Et}=P.getState();I&&(!ft||!k||Et>0)&&Rf({id:n,store:P,nodeRef:D}),l&&l(ut,{...C.userNode})},ct=ut=>{if(!(ey(ut.nativeEvent)||_)){if(Xp.includes(ut.key)&&I){const ft=ut.key==="Escape";Rf({id:n,store:P,unselect:ft,nodeRef:D})}else if(k&&E.selected&&Object.prototype.hasOwnProperty.call(Ss,ut.key)){ut.preventDefault();const{ariaLabelConfig:ft}=P.getState();P.setState({ariaLiveMessage:ft["node.a11yDescription.ariaLiveMessage"]({direction:ut.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),N({direction:Ss[ut.key],factor:ut.shiftKey?4:1})}}},rt=()=>{if(_||!D.current?.matches(":focus-visible"))return;const{transform:ut,width:ft,height:Et,autoPanOnNodeFocus:bt,setCenter:yt}=P.getState();if(!bt)return;Gf(new Map([[n,E]]),{x:0,y:0,width:ft,height:Et},ut,!0).length>0||yt(E.position.x+R.width/2,E.position.y+R.height/2,{zoom:ut[2]})};return w.jsx("div",{className:ae(["react-flow__node",`react-flow__node-${B}`,{[S]:k},E.className,{selected:E.selected,selectable:I,parent:V,draggable:k,dragging:G}]),ref:D,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:X?"all":"none",visibility:it?"visible":"hidden",...E.style,...U},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:tt,onMouseMove:M,onMouseLeave:H,onContextMenu:W,onClick:st,onDoubleClick:et,onKeyDown:$?ct:void 0,tabIndex:$?0:void 0,onFocus:$?rt:void 0,role:E.ariaRole??($?"group":void 0),"aria-roledescription":"node","aria-describedby":_?void 0:`${Sy}-${A}`,"aria-label":E.ariaLabel,...E.domAttributes,children:w.jsx(ww,{value:n,children:w.jsx(q,{id:n,data:E.data,type:B,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:E.selected??!1,selectable:I,draggable:k,deletable:E.deletable??!0,isConnectable:ot,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:G,dragHandle:E.dragHandle,zIndex:C.z,parentId:E.parentId,...R})})})}var Xw=J.memo(Gw);const Zw=n=>({nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError});function Cy(n){const{nodesDraggable:l,nodesConnectable:o,nodesFocusable:u,elementsSelectable:r,onError:f}=Dt(Zw,$t),d=qw(n.onlyRenderVisibleElements),g=Yw();return w.jsx("div",{className:"react-flow__nodes",style:Ds,children:d.map(m=>w.jsx(Xw,{id:m,nodeTypes:n.nodeTypes,nodeExtent:n.nodeExtent,onClick:n.onNodeClick,onMouseEnter:n.onNodeMouseEnter,onMouseMove:n.onNodeMouseMove,onMouseLeave:n.onNodeMouseLeave,onContextMenu:n.onNodeContextMenu,onDoubleClick:n.onNodeDoubleClick,noDragClassName:n.noDragClassName,noPanClassName:n.noPanClassName,rfId:n.rfId,disableKeyboardA11y:n.disableKeyboardA11y,resizeObserver:g,nodesDraggable:l,nodesConnectable:o,nodesFocusable:u,elementsSelectable:r,nodeClickDistance:n.nodeClickDistance,onError:f},m))})}Cy.displayName="NodeRenderer";const Qw=J.memo(Cy);function $w(n){return Dt(J.useCallback(o=>{if(!n)return o.edges.map(r=>r.id);const u=[];if(o.width&&o.height)for(const r of o.edges){const f=o.nodeLookup.get(r.source),d=o.nodeLookup.get(r.target);f&&d&&X_({sourceNode:f,targetNode:d,width:o.width,height:o.height,transform:o.transform})&&u.push(r.id)}return u},[n]),$t)}const kw=({color:n="none",strokeWidth:l=1})=>{const o={strokeWidth:l,...n&&{stroke:n}};return w.jsx("polyline",{className:"arrow",style:o,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Kw=({color:n="none",strokeWidth:l=1})=>{const o={strokeWidth:l,...n&&{stroke:n,fill:n}};return w.jsx("polyline",{className:"arrowclosed",style:o,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},W0={[ys.Arrow]:kw,[ys.ArrowClosed]:Kw};function Iw(n){const l=kt();return J.useMemo(()=>Object.prototype.hasOwnProperty.call(W0,n)?W0[n]:(l.getState().onError?.("009",hn.error009(n)),null),[n])}const Jw=({id:n,type:l,color:o,width:u=12.5,height:r=12.5,markerUnits:f="strokeWidth",strokeWidth:d,orient:g="auto-start-reverse"})=>{const m=Iw(l);return m?w.jsx("marker",{className:"react-flow__arrowhead",id:n,markerWidth:`${u}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:f,orient:g,refX:"0",refY:"0",children:w.jsx(m,{color:o,strokeWidth:d})}):null},Dy=({defaultColor:n,rfId:l})=>{const o=Dt(f=>f.edges),u=Dt(f=>f.defaultEdgeOptions),r=J.useMemo(()=>F_(o,{id:l,defaultColor:n,defaultMarkerStart:u?.markerStart,defaultMarkerEnd:u?.markerEnd}),[o,u,l,n]);return r.length?w.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:w.jsx("defs",{children:r.map(f=>w.jsx(Jw,{id:f.id,type:f.type,color:f.color,width:f.width,height:f.height,markerUnits:f.markerUnits,strokeWidth:f.strokeWidth,orient:f.orient},f.id))})}):null};Dy.displayName="MarkerDefinitions";var Fw=J.memo(Dy);function Oy({x:n,y:l,label:o,labelStyle:u,labelShowBg:r=!0,labelBgStyle:f,labelBgPadding:d=[2,4],labelBgBorderRadius:g=2,children:m,className:h,...v}){const[y,x]=J.useState({x:1,y:0,width:0,height:0}),S=ae(["react-flow__edge-textwrapper",h]),_=J.useRef(null);return J.useEffect(()=>{if(_.current){const A=_.current.getBBox();x({x:A.x,y:A.y,width:A.width,height:A.height})}},[o]),o?w.jsxs("g",{transform:`translate(${n-y.width/2} ${l-y.height/2})`,className:S,visibility:y.width?"visible":"hidden",...v,children:[r&&w.jsx("rect",{width:y.width+2*d[0],x:-d[0],y:-d[1],height:y.height+2*d[1],className:"react-flow__edge-textbg",style:f,rx:g,ry:g}),w.jsx("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:_,style:u,children:o}),m]}):null}Oy.displayName="EdgeText";const Ww=J.memo(Oy);function Os({path:n,labelX:l,labelY:o,label:u,labelStyle:r,labelShowBg:f,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,interactionWidth:h=20,...v}){return w.jsxs(w.Fragment,{children:[w.jsx("path",{...v,d:n,fill:"none",className:ae(["react-flow__edge-path",v.className])}),h?w.jsx("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,u&&Pe(l)&&Pe(o)?w.jsx(Ww,{x:l,y:o,label:u,labelStyle:r,labelShowBg:f,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m}):null]})}function P0({pos:n,x1:l,y1:o,x2:u,y2:r}){return n===mt.Left||n===mt.Right?[.5*(l+u),o]:[l,.5*(o+r)]}function Ry({sourceX:n,sourceY:l,sourcePosition:o=mt.Bottom,targetX:u,targetY:r,targetPosition:f=mt.Top}){const[d,g]=P0({pos:o,x1:n,y1:l,x2:u,y2:r}),[m,h]=P0({pos:f,x1:u,y1:r,x2:n,y2:l}),[v,y,x,S]=ay({sourceX:n,sourceY:l,targetX:u,targetY:r,sourceControlX:d,sourceControlY:g,targetControlX:m,targetControlY:h});return[`M${n},${l} C${d},${g} ${m},${h} ${u},${r}`,v,y,x,S]}function Hy(n){return J.memo(({id:l,sourceX:o,sourceY:u,targetX:r,targetY:f,sourcePosition:d,targetPosition:g,label:m,labelStyle:h,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:S,style:_,markerEnd:A,markerStart:T,interactionWidth:z})=>{const[L,E,C]=Ry({sourceX:o,sourceY:u,sourcePosition:d,targetX:r,targetY:f,targetPosition:g}),V=n.isInternal?void 0:l;return w.jsx(Os,{id:V,path:L,labelX:E,labelY:C,label:m,labelStyle:h,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:S,style:_,markerEnd:A,markerStart:T,interactionWidth:z})})}const Pw=Hy({isInternal:!1}),jy=Hy({isInternal:!0});Pw.displayName="SimpleBezierEdge";jy.displayName="SimpleBezierEdgeInternal";function Uy(n){return J.memo(({id:l,sourceX:o,sourceY:u,targetX:r,targetY:f,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:y,style:x,sourcePosition:S=mt.Bottom,targetPosition:_=mt.Top,markerEnd:A,markerStart:T,pathOptions:z,interactionWidth:L})=>{const[E,C,V]=zf({sourceX:o,sourceY:u,sourcePosition:S,targetX:r,targetY:f,targetPosition:_,borderRadius:z?.borderRadius,offset:z?.offset,stepPosition:z?.stepPosition}),B=n.isInternal?void 0:l;return w.jsx(Os,{id:B,path:E,labelX:C,labelY:V,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:A,markerStart:T,interactionWidth:L})})}const By=Uy({isInternal:!1}),qy=Uy({isInternal:!0});By.displayName="SmoothStepEdge";qy.displayName="SmoothStepEdgeInternal";function Ly(n){return J.memo(({id:l,...o})=>{const u=n.isInternal?void 0:l;return w.jsx(By,{...o,id:u,pathOptions:J.useMemo(()=>({borderRadius:0,offset:o.pathOptions?.offset}),[o.pathOptions?.offset])})})}const tN=Ly({isInternal:!1}),Yy=Ly({isInternal:!0});tN.displayName="StepEdge";Yy.displayName="StepEdgeInternal";function Vy(n){return J.memo(({id:l,sourceX:o,sourceY:u,targetX:r,targetY:f,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:S,markerStart:_,interactionWidth:A})=>{const[T,z,L]=oy({sourceX:o,sourceY:u,targetX:r,targetY:f}),E=n.isInternal?void 0:l;return w.jsx(Os,{id:E,path:T,labelX:z,labelY:L,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:S,markerStart:_,interactionWidth:A})})}const eN=Vy({isInternal:!1}),Gy=Vy({isInternal:!0});eN.displayName="StraightEdge";Gy.displayName="StraightEdgeInternal";function Xy(n){return J.memo(({id:l,sourceX:o,sourceY:u,targetX:r,targetY:f,sourcePosition:d=mt.Bottom,targetPosition:g=mt.Top,label:m,labelStyle:h,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:S,style:_,markerEnd:A,markerStart:T,pathOptions:z,interactionWidth:L})=>{const[E,C,V]=ly({sourceX:o,sourceY:u,sourcePosition:d,targetX:r,targetY:f,targetPosition:g,curvature:z?.curvature}),B=n.isInternal?void 0:l;return w.jsx(Os,{id:B,path:E,labelX:C,labelY:V,label:m,labelStyle:h,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:S,style:_,markerEnd:A,markerStart:T,interactionWidth:L})})}const nN=Xy({isInternal:!1}),Zy=Xy({isInternal:!0});nN.displayName="BezierEdge";Zy.displayName="BezierEdgeInternal";const tp={default:Zy,straight:Gy,step:Yy,smoothstep:qy,simplebezier:jy},ep={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},aN=(n,l,o)=>o===mt.Left?n-l:o===mt.Right?n+l:n,lN=(n,l,o)=>o===mt.Top?n-l:o===mt.Bottom?n+l:n,np="react-flow__edgeupdater";function ap({position:n,centerX:l,centerY:o,radius:u=10,onMouseDown:r,onMouseEnter:f,onMouseOut:d,type:g}){return w.jsx("circle",{onMouseDown:r,onMouseEnter:f,onMouseOut:d,className:ae([np,`${np}-${g}`]),cx:aN(l,u,n),cy:lN(o,u,n),r:u,stroke:"transparent",fill:"transparent"})}function iN({isReconnectable:n,reconnectRadius:l,edge:o,sourceX:u,sourceY:r,targetX:f,targetY:d,sourcePosition:g,targetPosition:m,onReconnect:h,onReconnectStart:v,onReconnectEnd:y,setReconnecting:x,setUpdateHover:S}){const _=kt(),A=(C,V)=>{if(C.button!==0)return;const{autoPanOnConnect:B,domNode:q,connectionMode:k,connectionRadius:I,lib:ot,onConnectStart:$,cancelConnection:P,nodeLookup:it,rfId:D,panBy:G,updateConnection:N}=_.getState(),R=V.type==="target",U=(M,H)=>{x(!1),y?.(M,o,V.type,H)},X=M=>h?.(o,M),tt=(M,H)=>{x(!0),v?.(C,o,V.type),$?.(M,H)};Df.onPointerDown(C.nativeEvent,{autoPanOnConnect:B,connectionMode:k,connectionRadius:I,domNode:q,handleId:V.id,nodeId:V.nodeId,nodeLookup:it,isTarget:R,edgeUpdaterType:V.type,lib:ot,flowId:D,cancelConnection:P,panBy:G,isValidConnection:(...M)=>_.getState().isValidConnection?.(...M)??!0,onConnect:X,onConnectStart:tt,onConnectEnd:(...M)=>_.getState().onConnectEnd?.(...M),onReconnectEnd:U,updateConnection:N,getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,dragThreshold:_.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},T=C=>A(C,{nodeId:o.target,id:o.targetHandle??null,type:"target"}),z=C=>A(C,{nodeId:o.source,id:o.sourceHandle??null,type:"source"}),L=()=>S(!0),E=()=>S(!1);return w.jsxs(w.Fragment,{children:[(n===!0||n==="source")&&w.jsx(ap,{position:g,centerX:u,centerY:r,radius:l,onMouseDown:T,onMouseEnter:L,onMouseOut:E,type:"source"}),(n===!0||n==="target")&&w.jsx(ap,{position:m,centerX:f,centerY:d,radius:l,onMouseDown:z,onMouseEnter:L,onMouseOut:E,type:"target"})]})}function oN({id:n,edgesFocusable:l,edgesReconnectable:o,elementsSelectable:u,onClick:r,onDoubleClick:f,onContextMenu:d,onMouseEnter:g,onMouseMove:m,onMouseLeave:h,reconnectRadius:v,onReconnect:y,onReconnectStart:x,onReconnectEnd:S,rfId:_,edgeTypes:A,noPanClassName:T,onError:z,disableKeyboardA11y:L}){let E=Dt(yt=>yt.edgeLookup.get(n));const C=Dt(yt=>yt.defaultEdgeOptions);E=C?{...C,...E}:E;let V=E.type||"default",B=A?.[V]||tp[V];B===void 0&&(z?.("011",hn.error011(V)),V="default",B=A?.default||tp.default);const q=!!(E.focusable||l&&typeof E.focusable>"u"),k=typeof y<"u"&&(E.reconnectable||o&&typeof E.reconnectable>"u"),I=!!(E.selectable||u&&typeof E.selectable>"u"),ot=J.useRef(null),[$,P]=J.useState(!1),[it,D]=J.useState(!1),G=kt(),{zIndex:N,sourceX:R,sourceY:U,targetX:X,targetY:tt,sourcePosition:M,targetPosition:H}=Dt(J.useCallback(yt=>{const xt=yt.nodeLookup.get(E.source),At=yt.nodeLookup.get(E.target);if(!xt||!At)return{zIndex:E.zIndex,...ep};const qt=J_({id:n,sourceNode:xt,targetNode:At,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:yt.connectionMode,onError:z});return{zIndex:G_({selected:E.selected,zIndex:E.zIndex,sourceNode:xt,targetNode:At,elevateOnSelect:yt.elevateEdgesOnSelect,zIndexMode:yt.zIndexMode}),...qt||ep}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),$t),W=J.useMemo(()=>E.markerStart?`url('#${Tf(E.markerStart,_)}')`:void 0,[E.markerStart,_]),et=J.useMemo(()=>E.markerEnd?`url('#${Tf(E.markerEnd,_)}')`:void 0,[E.markerEnd,_]);if(E.hidden||R===null||U===null||X===null||tt===null)return null;const st=yt=>{const{addSelectedEdges:xt,unselectNodesAndEdges:At,multiSelectionActive:qt}=G.getState();I&&(G.setState({nodesSelectionActive:!1}),E.selected&&qt?(At({nodes:[],edges:[E]}),ot.current?.blur()):xt([n])),r&&r(yt,E)},ct=f?yt=>{f(yt,{...E})}:void 0,rt=d?yt=>{d(yt,{...E})}:void 0,ut=g?yt=>{g(yt,{...E})}:void 0,ft=m?yt=>{m(yt,{...E})}:void 0,Et=h?yt=>{h(yt,{...E})}:void 0,bt=yt=>{if(!L&&Xp.includes(yt.key)&&I){const{unselectNodesAndEdges:xt,addSelectedEdges:At}=G.getState();yt.key==="Escape"?(ot.current?.blur(),xt({edges:[E]})):At([n])}};return w.jsx("svg",{style:{zIndex:N},children:w.jsxs("g",{className:ae(["react-flow__edge",`react-flow__edge-${V}`,E.className,T,{selected:E.selected,animated:E.animated,inactive:!I&&!r,updating:$,selectable:I}]),onClick:st,onDoubleClick:ct,onContextMenu:rt,onMouseEnter:ut,onMouseMove:ft,onMouseLeave:Et,onKeyDown:q?bt:void 0,tabIndex:q?0:void 0,role:E.ariaRole??(q?"group":"img"),"aria-roledescription":"edge","data-id":n,"data-testid":`rf__edge-${n}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":q?`${by}-${_}`:void 0,ref:ot,...E.domAttributes,children:[!it&&w.jsx(B,{id:n,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:I,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:R,sourceY:U,targetX:X,targetY:tt,sourcePosition:M,targetPosition:H,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:W,markerEnd:et,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),k&&w.jsx(iN,{edge:E,isReconnectable:k,reconnectRadius:v,onReconnect:y,onReconnectStart:x,onReconnectEnd:S,sourceX:R,sourceY:U,targetX:X,targetY:tt,sourcePosition:M,targetPosition:H,setUpdateHover:P,setReconnecting:D})]})})}var uN=J.memo(oN);const sN=n=>({edgesFocusable:n.edgesFocusable,edgesReconnectable:n.edgesReconnectable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError});function Qy({defaultMarkerColor:n,onlyRenderVisibleElements:l,rfId:o,edgeTypes:u,noPanClassName:r,onReconnect:f,onEdgeContextMenu:d,onEdgeMouseEnter:g,onEdgeMouseMove:m,onEdgeMouseLeave:h,onEdgeClick:v,reconnectRadius:y,onEdgeDoubleClick:x,onReconnectStart:S,onReconnectEnd:_,disableKeyboardA11y:A}){const{edgesFocusable:T,edgesReconnectable:z,elementsSelectable:L,onError:E}=Dt(sN,$t),C=$w(l);return w.jsxs("div",{className:"react-flow__edges",children:[w.jsx(Fw,{defaultColor:n,rfId:o}),C.map(V=>w.jsx(uN,{id:V,edgesFocusable:T,edgesReconnectable:z,elementsSelectable:L,noPanClassName:r,onReconnect:f,onContextMenu:d,onMouseEnter:g,onMouseMove:m,onMouseLeave:h,onClick:v,reconnectRadius:y,onDoubleClick:x,onReconnectStart:S,onReconnectEnd:_,rfId:o,onError:E,edgeTypes:u,disableKeyboardA11y:A},V))]})}Qy.displayName="EdgeRenderer";const rN=J.memo(Qy),cN=n=>`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`;function fN({children:n}){const l=Dt(cN);return w.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:l},children:n})}function dN(n){const l=Jf(),o=J.useRef(!1);J.useEffect(()=>{!o.current&&l.viewportInitialized&&n&&(setTimeout(()=>n(l),1),o.current=!0)},[n,l.viewportInitialized])}const hN=n=>n.panZoom?.syncViewport;function gN(n){const l=Dt(hN),o=kt();return J.useEffect(()=>{n&&(l?.(n),o.setState({transform:[n.x,n.y,n.zoom]}))},[n,l]),null}function mN(n){return n.connection.inProgress?{...n.connection,to:Eo(n.connection.to,n.transform)}:{...n.connection}}function pN(n){return mN}function yN(n){const l=pN();return Dt(l,$t)}const vN=n=>({nodesConnectable:n.nodesConnectable,isValid:n.connection.isValid,inProgress:n.connection.inProgress,width:n.width,height:n.height});function xN({containerStyle:n,style:l,type:o,component:u}){const{nodesConnectable:r,width:f,height:d,isValid:g,inProgress:m}=Dt(vN,$t);return!(f&&r&&m)?null:w.jsx("svg",{style:n,width:f,height:d,className:"react-flow__connectionline react-flow__container",children:w.jsx("g",{className:ae(["react-flow__connection",$p(g)]),children:w.jsx($y,{style:l,type:o,CustomComponent:u,isValid:g})})})}const $y=({style:n,type:l=Sa.Bezier,CustomComponent:o,isValid:u})=>{const{inProgress:r,from:f,fromNode:d,fromHandle:g,fromPosition:m,to:h,toNode:v,toHandle:y,toPosition:x,pointer:S}=yN();if(!r)return;if(o)return w.jsx(o,{connectionLineType:l,connectionLineStyle:n,fromNode:d,fromHandle:g,fromX:f.x,fromY:f.y,toX:h.x,toY:h.y,fromPosition:m,toPosition:x,connectionStatus:$p(u),toNode:v,toHandle:y,pointer:S});let _="";const A={sourceX:f.x,sourceY:f.y,sourcePosition:m,targetX:h.x,targetY:h.y,targetPosition:x};switch(l){case Sa.Bezier:[_]=ly(A);break;case Sa.SimpleBezier:[_]=Ry(A);break;case Sa.Step:[_]=zf({...A,borderRadius:0});break;case Sa.SmoothStep:[_]=zf(A);break;default:[_]=oy(A)}return w.jsx("path",{d:_,fill:"none",className:"react-flow__connection-path",style:n})};$y.displayName="ConnectionLine";const SN={};function lp(n=SN){J.useRef(n),kt(),J.useEffect(()=>{},[n])}function bN(){kt(),J.useRef(!1),J.useEffect(()=>{},[])}function ky({nodeTypes:n,edgeTypes:l,onInit:o,onNodeClick:u,onEdgeClick:r,onNodeDoubleClick:f,onEdgeDoubleClick:d,onNodeMouseEnter:g,onNodeMouseMove:m,onNodeMouseLeave:h,onNodeContextMenu:v,onSelectionContextMenu:y,onSelectionStart:x,onSelectionEnd:S,connectionLineType:_,connectionLineStyle:A,connectionLineComponent:T,connectionLineContainerStyle:z,selectionKeyCode:L,selectionOnDrag:E,selectionMode:C,multiSelectionKeyCode:V,panActivationKeyCode:B,zoomActivationKeyCode:q,deleteKeyCode:k,onlyRenderVisibleElements:I,elementsSelectable:ot,defaultViewport:$,translateExtent:P,minZoom:it,maxZoom:D,preventScrolling:G,defaultMarkerColor:N,zoomOnScroll:R,zoomOnPinch:U,panOnScroll:X,panOnScrollSpeed:tt,panOnScrollMode:M,zoomOnDoubleClick:H,panOnDrag:W,onPaneClick:et,onPaneMouseEnter:st,onPaneMouseMove:ct,onPaneMouseLeave:rt,onPaneScroll:ut,onPaneContextMenu:ft,paneClickDistance:Et,nodeClickDistance:bt,onEdgeContextMenu:yt,onEdgeMouseEnter:xt,onEdgeMouseMove:At,onEdgeMouseLeave:qt,reconnectRadius:jt,onReconnect:oe,onReconnectStart:Qe,onReconnectEnd:Ae,noDragClassName:$e,noWheelClassName:mn,noPanClassName:_a,disableKeyboardA11y:Ea,nodeExtent:se,rfId:nl,viewport:pn,onViewportChange:Xn}){return lp(n),lp(l),bN(),dN(o),gN(pn),w.jsx(Uw,{onPaneClick:et,onPaneMouseEnter:st,onPaneMouseMove:ct,onPaneMouseLeave:rt,onPaneContextMenu:ft,onPaneScroll:ut,paneClickDistance:Et,deleteKeyCode:k,selectionKeyCode:L,selectionOnDrag:E,selectionMode:C,onSelectionStart:x,onSelectionEnd:S,multiSelectionKeyCode:V,panActivationKeyCode:B,zoomActivationKeyCode:q,elementsSelectable:ot,zoomOnScroll:R,zoomOnPinch:U,zoomOnDoubleClick:H,panOnScroll:X,panOnScrollSpeed:tt,panOnScrollMode:M,panOnDrag:W,defaultViewport:$,translateExtent:P,minZoom:it,maxZoom:D,onSelectionContextMenu:y,preventScrolling:G,noDragClassName:$e,noWheelClassName:mn,noPanClassName:_a,disableKeyboardA11y:Ea,onViewportChange:Xn,isControlledViewport:!!pn,children:w.jsxs(fN,{children:[w.jsx(rN,{edgeTypes:l,onEdgeClick:r,onEdgeDoubleClick:d,onReconnect:oe,onReconnectStart:Qe,onReconnectEnd:Ae,onlyRenderVisibleElements:I,onEdgeContextMenu:yt,onEdgeMouseEnter:xt,onEdgeMouseMove:At,onEdgeMouseLeave:qt,reconnectRadius:jt,defaultMarkerColor:N,noPanClassName:_a,disableKeyboardA11y:Ea,rfId:nl}),w.jsx(xN,{style:A,type:_,component:T,containerStyle:z}),w.jsx("div",{className:"react-flow__edgelabel-renderer"}),w.jsx(Qw,{nodeTypes:n,onNodeClick:u,onNodeDoubleClick:f,onNodeMouseEnter:g,onNodeMouseMove:m,onNodeMouseLeave:h,onNodeContextMenu:v,nodeClickDistance:bt,onlyRenderVisibleElements:I,noPanClassName:_a,noDragClassName:$e,disableKeyboardA11y:Ea,nodeExtent:se,rfId:nl}),w.jsx("div",{className:"react-flow__viewport-portal"})]})})}ky.displayName="GraphView";const _N=J.memo(ky),ip=({nodes:n,edges:l,defaultNodes:o,defaultEdges:u,width:r,height:f,fitView:d,fitViewOptions:g,minZoom:m=.5,maxZoom:h=2,nodeOrigin:v,nodeExtent:y,zIndexMode:x="basic"}={})=>{const S=new Map,_=new Map,A=new Map,T=new Map,z=u??l??[],L=o??n??[],E=v??[0,0],C=y??fo;ry(A,T,z);const{nodesInitialized:V}=Cf(L,S,_,{nodeOrigin:E,nodeExtent:C,zIndexMode:x});let B=[0,0,1];if(d&&r&&f){const q=bo(S,{filter:$=>!!(($.width||$.initialWidth)&&($.height||$.initialHeight))}),{x:k,y:I,zoom:ot}=Xf(q,r,f,m,h,g?.padding??.1);B=[k,I,ot]}return{rfId:"1",width:r??0,height:f??0,transform:B,nodes:L,nodesInitialized:V,nodeLookup:S,parentLookup:_,edges:z,edgeLookup:T,connectionLookup:A,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:o!==void 0,hasDefaultEdges:u!==void 0,panZoom:null,minZoom:m,maxZoom:h,translateExtent:fo,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Fl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:d??!1,fitViewOptions:g,fitViewResolver:null,connection:{...Qp},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:U_,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Zp,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},EN=({nodes:n,edges:l,defaultNodes:o,defaultEdges:u,width:r,height:f,fitView:d,fitViewOptions:g,minZoom:m,maxZoom:h,nodeOrigin:v,nodeExtent:y,zIndexMode:x})=>YE((S,_)=>{async function A(){const{nodeLookup:T,panZoom:z,fitViewOptions:L,fitViewResolver:E,width:C,height:V,minZoom:B,maxZoom:q}=_();z&&(await H_({nodes:T,width:C,height:V,panZoom:z,minZoom:B,maxZoom:q},L),E?.resolve(!0),S({fitViewResolver:null}))}return{...ip({nodes:n,edges:l,width:r,height:f,fitView:d,fitViewOptions:g,minZoom:m,maxZoom:h,nodeOrigin:v,nodeExtent:y,defaultNodes:o,defaultEdges:u,zIndexMode:x}),setNodes:T=>{const{nodeLookup:z,parentLookup:L,nodeOrigin:E,elevateNodesOnSelect:C,fitViewQueued:V,zIndexMode:B,nodesSelectionActive:q}=_(),{nodesInitialized:k,hasSelectedNodes:I}=Cf(T,z,L,{nodeOrigin:E,nodeExtent:y,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:B}),ot=q&&I;V&&k?(A(),S({nodes:T,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:ot})):S({nodes:T,nodesInitialized:k,nodesSelectionActive:ot})},setEdges:T=>{const{connectionLookup:z,edgeLookup:L}=_();ry(z,L,T),S({edges:T})},setDefaultNodesAndEdges:(T,z)=>{if(T){const{setNodes:L}=_();L(T),S({hasDefaultNodes:!0})}if(z){const{setEdges:L}=_();L(z),S({hasDefaultEdges:!0})}},updateNodeInternals:T=>{const{triggerNodeChanges:z,nodeLookup:L,parentLookup:E,domNode:C,nodeOrigin:V,nodeExtent:B,debug:q,fitViewQueued:k,zIndexMode:I}=_(),{changes:ot,updatedInternals:$}=lE(T,L,E,C,V,B,I);$&&(tE(L,E,{nodeOrigin:V,nodeExtent:B,zIndexMode:I}),k?(A(),S({fitViewQueued:!1,fitViewOptions:void 0})):S({}),ot?.length>0&&(q&&console.log("React Flow: trigger node changes",ot),z?.(ot)))},updateNodePositions:(T,z=!1)=>{const L=[];let E=[];const{nodeLookup:C,triggerNodeChanges:V,connection:B,updateConnection:q,onNodesChangeMiddlewareMap:k}=_();for(const[I,ot]of T){const $=C.get(I),P=!!($?.expandParent&&$?.parentId&&ot?.position),it={id:I,type:"position",position:P?{x:Math.max(0,ot.position.x),y:Math.max(0,ot.position.y)}:ot.position,dragging:z};if($&&B.inProgress&&B.fromNode.id===$.id){const D=el($,B.fromHandle,mt.Left,!0);q({...B,from:D})}P&&$.parentId&&L.push({id:I,parentId:$.parentId,rect:{...ot.internals.positionAbsolute,width:ot.measured.width??0,height:ot.measured.height??0}}),E.push(it)}if(L.length>0){const{parentLookup:I,nodeOrigin:ot}=_(),$=If(L,C,I,ot);E.push(...$)}for(const I of k.values())E=I(E);V(E)},triggerNodeChanges:T=>{const{onNodesChange:z,setNodes:L,nodes:E,hasDefaultNodes:C,debug:V}=_();if(T?.length){if(C){const B=uw(T,E);L(B)}V&&console.log("React Flow: trigger node changes",T),z?.(T)}},triggerEdgeChanges:T=>{const{onEdgesChange:z,setEdges:L,edges:E,hasDefaultEdges:C,debug:V}=_();if(T?.length){if(C){const B=sw(T,E);L(B)}V&&console.log("React Flow: trigger edge changes",T),z?.(T)}},addSelectedNodes:T=>{const{multiSelectionActive:z,edgeLookup:L,nodeLookup:E,triggerNodeChanges:C,triggerEdgeChanges:V}=_();if(z){const B=T.map(q=>Ka(q,!0));C(B);return}C($l(E,new Set([...T]),!0)),V($l(L))},addSelectedEdges:T=>{const{multiSelectionActive:z,edgeLookup:L,nodeLookup:E,triggerNodeChanges:C,triggerEdgeChanges:V}=_();if(z){const B=T.map(q=>Ka(q,!0));V(B);return}V($l(L,new Set([...T]))),C($l(E,new Set,!0))},unselectNodesAndEdges:({nodes:T,edges:z}={})=>{const{edges:L,nodes:E,nodeLookup:C,triggerNodeChanges:V,triggerEdgeChanges:B}=_(),q=T||E,k=z||L,I=[];for(const $ of q){if(!$.selected)continue;const P=C.get($.id);P&&(P.selected=!1),I.push(Ka($.id,!1))}const ot=[];for(const $ of k)$.selected&&ot.push(Ka($.id,!1));V(I),B(ot)},setMinZoom:T=>{const{panZoom:z,maxZoom:L}=_();z?.setScaleExtent([T,L]),S({minZoom:T})},setMaxZoom:T=>{const{panZoom:z,minZoom:L}=_();z?.setScaleExtent([L,T]),S({maxZoom:T})},setTranslateExtent:T=>{_().panZoom?.setTranslateExtent(T),S({translateExtent:T})},resetSelectedElements:()=>{const{edges:T,nodes:z,triggerNodeChanges:L,triggerEdgeChanges:E,elementsSelectable:C}=_();if(!C)return;const V=z.reduce((q,k)=>k.selected?[...q,Ka(k.id,!1)]:q,[]),B=T.reduce((q,k)=>k.selected?[...q,Ka(k.id,!1)]:q,[]);L(V),E(B)},setNodeExtent:T=>{const{nodes:z,nodeLookup:L,parentLookup:E,nodeOrigin:C,elevateNodesOnSelect:V,nodeExtent:B,zIndexMode:q}=_();T[0][0]===B[0][0]&&T[0][1]===B[0][1]&&T[1][0]===B[1][0]&&T[1][1]===B[1][1]||(Cf(z,L,E,{nodeOrigin:C,nodeExtent:T,elevateNodesOnSelect:V,checkEquality:!1,zIndexMode:q}),S({nodeExtent:T}))},panBy:T=>{const{transform:z,width:L,height:E,panZoom:C,translateExtent:V}=_();return iE({delta:T,panZoom:C,transform:z,translateExtent:V,width:L,height:E})},setCenter:async(T,z,L)=>{const{width:E,height:C,maxZoom:V,panZoom:B}=_();if(!B)return Promise.resolve(!1);const q=typeof L?.zoom<"u"?L.zoom:V;return await B.setViewport({x:E/2-T*q,y:C/2-z*q,zoom:q},{duration:L?.duration,ease:L?.ease,interpolate:L?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{S({connection:{...Qp}})},updateConnection:T=>{S({connection:T})},reset:()=>S({...ip()})}},Object.is);function wN({initialNodes:n,initialEdges:l,defaultNodes:o,defaultEdges:u,initialWidth:r,initialHeight:f,initialMinZoom:d,initialMaxZoom:g,initialFitViewOptions:m,fitView:h,nodeOrigin:v,nodeExtent:y,zIndexMode:x,children:S}){const[_]=J.useState(()=>EN({nodes:n,edges:l,defaultNodes:o,defaultEdges:u,width:r,height:f,fitView:h,minZoom:d,maxZoom:g,fitViewOptions:m,nodeOrigin:v,nodeExtent:y,zIndexMode:x}));return w.jsx(VE,{value:_,children:w.jsx(fw,{children:S})})}function NN({children:n,nodes:l,edges:o,defaultNodes:u,defaultEdges:r,width:f,height:d,fitView:g,fitViewOptions:m,minZoom:h,maxZoom:v,nodeOrigin:y,nodeExtent:x,zIndexMode:S}){return J.useContext(Ts)?w.jsx(w.Fragment,{children:n}):w.jsx(wN,{initialNodes:l,initialEdges:o,defaultNodes:u,defaultEdges:r,initialWidth:f,initialHeight:d,fitView:g,initialFitViewOptions:m,initialMinZoom:h,initialMaxZoom:v,nodeOrigin:y,nodeExtent:x,zIndexMode:S,children:n})}const MN={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function AN({nodes:n,edges:l,defaultNodes:o,defaultEdges:u,className:r,nodeTypes:f,edgeTypes:d,onNodeClick:g,onEdgeClick:m,onInit:h,onMove:v,onMoveStart:y,onMoveEnd:x,onConnect:S,onConnectStart:_,onConnectEnd:A,onClickConnectStart:T,onClickConnectEnd:z,onNodeMouseEnter:L,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:V,onNodeDoubleClick:B,onNodeDragStart:q,onNodeDrag:k,onNodeDragStop:I,onNodesDelete:ot,onEdgesDelete:$,onDelete:P,onSelectionChange:it,onSelectionDragStart:D,onSelectionDrag:G,onSelectionDragStop:N,onSelectionContextMenu:R,onSelectionStart:U,onSelectionEnd:X,onBeforeDelete:tt,connectionMode:M,connectionLineType:H=Sa.Bezier,connectionLineStyle:W,connectionLineComponent:et,connectionLineContainerStyle:st,deleteKeyCode:ct="Backspace",selectionKeyCode:rt="Shift",selectionOnDrag:ut=!1,selectionMode:ft=ho.Full,panActivationKeyCode:Et="Space",multiSelectionKeyCode:bt=mo()?"Meta":"Control",zoomActivationKeyCode:yt=mo()?"Meta":"Control",snapToGrid:xt,snapGrid:At,onlyRenderVisibleElements:qt=!1,selectNodesOnDrag:jt,nodesDraggable:oe,autoPanOnNodeFocus:Qe,nodesConnectable:Ae,nodesFocusable:$e,nodeOrigin:mn=_y,edgesFocusable:_a,edgesReconnectable:Ea,elementsSelectable:se=!0,defaultViewport:nl=tw,minZoom:pn=.5,maxZoom:Xn=2,translateExtent:wa=fo,preventScrolling:Rs=!0,nodeExtent:al,defaultMarkerColor:Hs="#b1b1b7",zoomOnScroll:js=!0,zoomOnPinch:Na=!0,panOnScroll:me=!1,panOnScrollSpeed:an=.5,panOnScrollMode:pe=Fa.Free,zoomOnDoubleClick:Us=!0,panOnDrag:Bs=!0,onPaneClick:qs,onPaneMouseEnter:ll,onPaneMouseMove:il,onPaneMouseLeave:ol,onPaneScroll:yn,onPaneContextMenu:ul,paneClickDistance:Ma=1,nodeClickDistance:Ls=0,children:wo,onReconnect:ai,onReconnectStart:Aa,onReconnectEnd:Ys,onEdgeContextMenu:No,onEdgeDoubleClick:Mo,onEdgeMouseEnter:Ao,onEdgeMouseMove:li,onEdgeMouseLeave:ii,reconnectRadius:zo=10,onNodesChange:To,onEdgesChange:ln,noDragClassName:le="nodrag",noWheelClassName:he="nowheel",noPanClassName:vn="nopan",fitView:sl,fitViewOptions:Co,connectOnClick:Vs,attributionPosition:Do,proOptions:za,defaultEdgeOptions:oi,elevateNodesOnSelect:Zn=!0,elevateEdgesOnSelect:Qn=!1,disableKeyboardA11y:$n=!1,autoPanOnConnect:kn,autoPanOnNodeDrag:Wt,autoPanSpeed:Oo,connectionRadius:Ro,isValidConnection:xn,onError:Kn,style:Gs,id:ui,nodeDragThreshold:Ho,connectionDragThreshold:Xs,viewport:rl,onViewportChange:cl,width:ke,height:ve,colorMode:jo="light",debug:Zs,onScroll:fl,ariaLabelConfig:Uo,zIndexMode:Ta="basic",...Qs},xe){const Ca=ui||"1",Bo=lw(jo),si=J.useCallback(Sn=>{Sn.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),fl?.(Sn)},[fl]);return w.jsx("div",{"data-testid":"rf__wrapper",...Qs,onScroll:si,style:{...Gs,...MN},ref:xe,className:ae(["react-flow",r,Bo]),id:ui,role:"application",children:w.jsxs(NN,{nodes:n,edges:l,width:ke,height:ve,fitView:sl,fitViewOptions:Co,minZoom:pn,maxZoom:Xn,nodeOrigin:mn,nodeExtent:al,zIndexMode:Ta,children:[w.jsx(aw,{nodes:n,edges:l,defaultNodes:o,defaultEdges:u,onConnect:S,onConnectStart:_,onConnectEnd:A,onClickConnectStart:T,onClickConnectEnd:z,nodesDraggable:oe,autoPanOnNodeFocus:Qe,nodesConnectable:Ae,nodesFocusable:$e,edgesFocusable:_a,edgesReconnectable:Ea,elementsSelectable:se,elevateNodesOnSelect:Zn,elevateEdgesOnSelect:Qn,minZoom:pn,maxZoom:Xn,nodeExtent:al,onNodesChange:To,onEdgesChange:ln,snapToGrid:xt,snapGrid:At,connectionMode:M,translateExtent:wa,connectOnClick:Vs,defaultEdgeOptions:oi,fitView:sl,fitViewOptions:Co,onNodesDelete:ot,onEdgesDelete:$,onDelete:P,onNodeDragStart:q,onNodeDrag:k,onNodeDragStop:I,onSelectionDrag:G,onSelectionDragStart:D,onSelectionDragStop:N,onMove:v,onMoveStart:y,onMoveEnd:x,noPanClassName:vn,nodeOrigin:mn,rfId:Ca,autoPanOnConnect:kn,autoPanOnNodeDrag:Wt,autoPanSpeed:Oo,onError:Kn,connectionRadius:Ro,isValidConnection:xn,selectNodesOnDrag:jt,nodeDragThreshold:Ho,connectionDragThreshold:Xs,onBeforeDelete:tt,debug:Zs,ariaLabelConfig:Uo,zIndexMode:Ta}),w.jsx(_N,{onInit:h,onNodeClick:g,onEdgeClick:m,onNodeMouseEnter:L,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:V,onNodeDoubleClick:B,nodeTypes:f,edgeTypes:d,connectionLineType:H,connectionLineStyle:W,connectionLineComponent:et,connectionLineContainerStyle:st,selectionKeyCode:rt,selectionOnDrag:ut,selectionMode:ft,deleteKeyCode:ct,multiSelectionKeyCode:bt,panActivationKeyCode:Et,zoomActivationKeyCode:yt,onlyRenderVisibleElements:qt,defaultViewport:nl,translateExtent:wa,minZoom:pn,maxZoom:Xn,preventScrolling:Rs,zoomOnScroll:js,zoomOnPinch:Na,zoomOnDoubleClick:Us,panOnScroll:me,panOnScrollSpeed:an,panOnScrollMode:pe,panOnDrag:Bs,onPaneClick:qs,onPaneMouseEnter:ll,onPaneMouseMove:il,onPaneMouseLeave:ol,onPaneScroll:yn,onPaneContextMenu:ul,paneClickDistance:Ma,nodeClickDistance:Ls,onSelectionContextMenu:R,onSelectionStart:U,onSelectionEnd:X,onReconnect:ai,onReconnectStart:Aa,onReconnectEnd:Ys,onEdgeContextMenu:No,onEdgeDoubleClick:Mo,onEdgeMouseEnter:Ao,onEdgeMouseMove:li,onEdgeMouseLeave:ii,reconnectRadius:zo,defaultMarkerColor:Hs,noDragClassName:le,noWheelClassName:he,noPanClassName:vn,rfId:Ca,disableKeyboardA11y:$n,nodeExtent:al,viewport:rl,onViewportChange:cl}),w.jsx(PE,{onSelectionChange:it}),wo,w.jsx(KE,{proOptions:za,position:Do}),w.jsx(kE,{rfId:Ca,disableKeyboardA11y:$n})]})})}wy(AN);function zN({dimensions:n,lineWidth:l,variant:o,className:u}){return w.jsx("path",{strokeWidth:l,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`,className:ae(["react-flow__background-pattern",o,u])})}function TN({radius:n,className:l}){return w.jsx("circle",{cx:n,cy:n,r:n,className:ae(["react-flow__background-pattern","dots",l])})}var ba;(function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"})(ba||(ba={}));const CN={[ba.Dots]:1,[ba.Lines]:1,[ba.Cross]:6},DN=n=>({transform:n.transform,patternId:`pattern-${n.rfId}`});function Ky({id:n,variant:l=ba.Dots,gap:o=20,size:u,lineWidth:r=1,offset:f=0,color:d,bgColor:g,style:m,className:h,patternClassName:v}){const y=J.useRef(null),{transform:x,patternId:S}=Dt(DN,$t),_=u||CN[l],A=l===ba.Dots,T=l===ba.Cross,z=Array.isArray(o)?o:[o,o],L=[z[0]*x[2]||1,z[1]*x[2]||1],E=_*x[2],C=Array.isArray(f)?f:[f,f],V=T?[E,E]:L,B=[C[0]*x[2]||1+V[0]/2,C[1]*x[2]||1+V[1]/2],q=`${S}${n||""}`;return w.jsxs("svg",{className:ae(["react-flow__background",h]),style:{...m,...Ds,"--xy-background-color-props":g,"--xy-background-pattern-color-props":d},ref:y,"data-testid":"rf__background",children:[w.jsx("pattern",{id:q,x:x[0]%L[0],y:x[1]%L[1],width:L[0],height:L[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${B[0]},-${B[1]})`,children:A?w.jsx(TN,{radius:E/2,className:v}):w.jsx(zN,{dimensions:V,lineWidth:r,variant:l,className:v})}),w.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${q})`})]})}Ky.displayName="Background";J.memo(Ky);function ON(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:w.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function RN(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:w.jsx("path",{d:"M0 0h32v4.2H0z"})})}function HN(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:w.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 jN(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:w.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 UN(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:w.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 es({children:n,className:l,...o}){return w.jsx("button",{type:"button",className:ae(["react-flow__controls-button",l]),...o,children:n})}const BN=n=>({isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom,ariaLabelConfig:n.ariaLabelConfig});function Iy({style:n,showZoom:l=!0,showFitView:o=!0,showInteractive:u=!0,fitViewOptions:r,onZoomIn:f,onZoomOut:d,onFitView:g,onInteractiveChange:m,className:h,children:v,position:y="bottom-left",orientation:x="vertical","aria-label":S}){const _=kt(),{isInteractive:A,minZoomReached:T,maxZoomReached:z,ariaLabelConfig:L}=Dt(BN,$t),{zoomIn:E,zoomOut:C,fitView:V}=Jf(),B=()=>{E(),f?.()},q=()=>{C(),d?.()},k=()=>{V(r),g?.()},I=()=>{_.setState({nodesDraggable:!A,nodesConnectable:!A,elementsSelectable:!A}),m?.(!A)},ot=x==="horizontal"?"horizontal":"vertical";return w.jsxs(Cs,{className:ae(["react-flow__controls",ot,h]),position:y,style:n,"data-testid":"rf__controls","aria-label":S??L["controls.ariaLabel"],children:[l&&w.jsxs(w.Fragment,{children:[w.jsx(es,{onClick:B,className:"react-flow__controls-zoomin",title:L["controls.zoomIn.ariaLabel"],"aria-label":L["controls.zoomIn.ariaLabel"],disabled:z,children:w.jsx(ON,{})}),w.jsx(es,{onClick:q,className:"react-flow__controls-zoomout",title:L["controls.zoomOut.ariaLabel"],"aria-label":L["controls.zoomOut.ariaLabel"],disabled:T,children:w.jsx(RN,{})})]}),o&&w.jsx(es,{className:"react-flow__controls-fitview",onClick:k,title:L["controls.fitView.ariaLabel"],"aria-label":L["controls.fitView.ariaLabel"],children:w.jsx(HN,{})}),u&&w.jsx(es,{className:"react-flow__controls-interactive",onClick:I,title:L["controls.interactive.ariaLabel"],"aria-label":L["controls.interactive.ariaLabel"],children:A?w.jsx(UN,{}):w.jsx(jN,{})}),v]})}Iy.displayName="Controls";J.memo(Iy);function qN({id:n,x:l,y:o,width:u,height:r,style:f,color:d,strokeColor:g,strokeWidth:m,className:h,borderRadius:v,shapeRendering:y,selected:x,onClick:S}){const{background:_,backgroundColor:A}=f||{},T=d||_||A;return w.jsx("rect",{className:ae(["react-flow__minimap-node",{selected:x},h]),x:l,y:o,rx:v,ry:v,width:u,height:r,style:{fill:T,stroke:g,strokeWidth:m},shapeRendering:y,onClick:S?z=>S(z,n):void 0})}const LN=J.memo(qN),YN=n=>n.nodes.map(l=>l.id),vf=n=>n instanceof Function?n:()=>n;function VN({nodeStrokeColor:n,nodeColor:l,nodeClassName:o="",nodeBorderRadius:u=5,nodeStrokeWidth:r,nodeComponent:f=LN,onClick:d}){const g=Dt(YN,$t),m=vf(l),h=vf(n),v=vf(o),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return w.jsx(w.Fragment,{children:g.map(x=>w.jsx(XN,{id:x,nodeColorFunc:m,nodeStrokeColorFunc:h,nodeClassNameFunc:v,nodeBorderRadius:u,nodeStrokeWidth:r,NodeComponent:f,onClick:d,shapeRendering:y},x))})}function GN({id:n,nodeColorFunc:l,nodeStrokeColorFunc:o,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:f,shapeRendering:d,NodeComponent:g,onClick:m}){const{node:h,x:v,y,width:x,height:S}=Dt(_=>{const A=_.nodeLookup.get(n);if(!A)return{node:void 0,x:0,y:0,width:0,height:0};const T=A.internals.userNode,{x:z,y:L}=A.internals.positionAbsolute,{width:E,height:C}=Gn(T);return{node:T,x:z,y:L,width:E,height:C}},$t);return!h||h.hidden||!Wp(h)?null:w.jsx(g,{x:v,y,width:x,height:S,style:h.style,selected:!!h.selected,className:u(h),color:l(h),borderRadius:r,strokeColor:o(h),strokeWidth:f,shapeRendering:d,onClick:m,id:h.id})}const XN=J.memo(GN);var ZN=J.memo(VN);const QN=200,$N=150,kN=n=>!n.hidden,KN=n=>{const l={x:-n.transform[0]/n.transform[2],y:-n.transform[1]/n.transform[2],width:n.width/n.transform[2],height:n.height/n.transform[2]};return{viewBB:l,boundingRect:n.nodeLookup.size>0?Fp(bo(n.nodeLookup,{filter:kN}),l):l,rfId:n.rfId,panZoom:n.panZoom,translateExtent:n.translateExtent,flowWidth:n.width,flowHeight:n.height,ariaLabelConfig:n.ariaLabelConfig}},IN="react-flow__minimap-desc";function Jy({style:n,className:l,nodeStrokeColor:o,nodeColor:u,nodeClassName:r="",nodeBorderRadius:f=5,nodeStrokeWidth:d,nodeComponent:g,bgColor:m,maskColor:h,maskStrokeColor:v,maskStrokeWidth:y,position:x="bottom-right",onClick:S,onNodeClick:_,pannable:A=!1,zoomable:T=!1,ariaLabel:z,inversePan:L,zoomStep:E=1,offsetScale:C=5}){const V=kt(),B=J.useRef(null),{boundingRect:q,viewBB:k,rfId:I,panZoom:ot,translateExtent:$,flowWidth:P,flowHeight:it,ariaLabelConfig:D}=Dt(KN,$t),G=n?.width??QN,N=n?.height??$N,R=q.width/G,U=q.height/N,X=Math.max(R,U),tt=X*G,M=X*N,H=C*X,W=q.x-(tt-q.width)/2-H,et=q.y-(M-q.height)/2-H,st=tt+H*2,ct=M+H*2,rt=`${IN}-${I}`,ut=J.useRef(0),ft=J.useRef();ut.current=X,J.useEffect(()=>{if(B.current&&ot)return ft.current=gE({domNode:B.current,panZoom:ot,getTransform:()=>V.getState().transform,getViewScale:()=>ut.current}),()=>{ft.current?.destroy()}},[ot]),J.useEffect(()=>{ft.current?.update({translateExtent:$,width:P,height:it,inversePan:L,pannable:A,zoomStep:E,zoomable:T})},[A,T,L,E,$,P,it]);const Et=S?xt=>{const[At,qt]=ft.current?.pointer(xt)||[0,0];S(xt,{x:At,y:qt})}:void 0,bt=_?J.useCallback((xt,At)=>{const qt=V.getState().nodeLookup.get(At).internals.userNode;_(xt,qt)},[]):void 0,yt=z??D["minimap.ariaLabel"];return w.jsx(Cs,{position:x,style:{...n,"--xy-minimap-background-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-stroke-width-props":typeof y=="number"?y*X:void 0,"--xy-minimap-node-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-node-stroke-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-width-props":typeof d=="number"?d:void 0},className:ae(["react-flow__minimap",l]),"data-testid":"rf__minimap",children:w.jsxs("svg",{width:G,height:N,viewBox:`${W} ${et} ${st} ${ct}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":rt,ref:B,onClick:Et,children:[yt&&w.jsx("title",{id:rt,children:yt}),w.jsx(ZN,{onClick:bt,nodeColor:u,nodeStrokeColor:o,nodeBorderRadius:f,nodeClassName:r,nodeStrokeWidth:d,nodeComponent:g}),w.jsx("path",{className:"react-flow__minimap-mask",d:`M${W-H},${et-H}h${st+H*2}v${ct+H*2}h${-st-H*2}z
|
|
15
|
+
M${k.x},${k.y}h${k.width}v${k.height}h${-k.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Jy.displayName="MiniMap";J.memo(Jy);const JN=n=>l=>n?`${Math.max(1/l.transform[2],1)}`:void 0,FN={[ei.Line]:"right",[ei.Handle]:"bottom-right"};function WN({nodeId:n,position:l,variant:o=ei.Handle,className:u,style:r=void 0,children:f,color:d,minWidth:g=10,minHeight:m=10,maxWidth:h=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:y=!1,resizeDirection:x,autoScale:S=!0,shouldResize:_,onResizeStart:A,onResize:T,onResizeEnd:z}){const L=zy(),E=typeof n=="string"?n:L,C=kt(),V=J.useRef(null),B=o===ei.Handle,q=Dt(J.useCallback(JN(B&&S),[B,S]),$t),k=J.useRef(null),I=l??FN[o];J.useEffect(()=>{if(!(!V.current||!E))return k.current||(k.current=zE({domNode:V.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:$,transform:P,snapGrid:it,snapToGrid:D,nodeOrigin:G,domNode:N}=C.getState();return{nodeLookup:$,transform:P,snapGrid:it,snapToGrid:D,nodeOrigin:G,paneDomNode:N}},onChange:($,P)=>{const{triggerNodeChanges:it,nodeLookup:D,parentLookup:G,nodeOrigin:N}=C.getState(),R=[],U={x:$.x,y:$.y},X=D.get(E);if(X&&X.expandParent&&X.parentId){const tt=X.origin??N,M=$.width??X.measured.width??0,H=$.height??X.measured.height??0,W={id:X.id,parentId:X.parentId,rect:{width:M,height:H,...Pp({x:$.x??X.position.x,y:$.y??X.position.y},{width:M,height:H},X.parentId,D,tt)}},et=If([W],D,G,N);R.push(...et),U.x=$.x?Math.max(tt[0]*M,$.x):void 0,U.y=$.y?Math.max(tt[1]*H,$.y):void 0}if(U.x!==void 0&&U.y!==void 0){const tt={id:E,type:"position",position:{...U}};R.push(tt)}if($.width!==void 0&&$.height!==void 0){const M={id:E,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:$.width,height:$.height}};R.push(M)}for(const tt of P){const M={...tt,type:"position"};R.push(M)}it(R)},onEnd:({width:$,height:P})=>{const it={id:E,type:"dimensions",resizing:!1,dimensions:{width:$,height:P}};C.getState().triggerNodeChanges([it])}})),k.current.update({controlPosition:I,boundaries:{minWidth:g,minHeight:m,maxWidth:h,maxHeight:v},keepAspectRatio:y,resizeDirection:x,onResizeStart:A,onResize:T,onResizeEnd:z,shouldResize:_}),()=>{k.current?.destroy()}},[I,g,m,h,v,y,A,T,z,_]);const ot=I.split("-");return w.jsx("div",{className:ae(["react-flow__resize-control","nodrag",...ot,o,u]),ref:V,style:{...r,scale:q,...d&&{[B?"backgroundColor":"borderColor"]:d}},children:f})}J.memo(WN);function PN({id:n,data:l,selected:o}){const u=l,r=ht(_=>_.updateNodePrompt),f=ht(_=>_.generateNode),d=ht(_=>_.addChildNode),g=ht(_=>_.deleteNode),m=J.useCallback(_=>r(n,_.target.value),[n,r]),h=J.useCallback(()=>{f(n)},[n,f]),v=J.useCallback(()=>{u.status==="ready"&&d(n)},[n,u.status,d]),y=J.useCallback(()=>g(n),[n,g]),x=u.status==="pending"||u.status==="reconciling",S={empty:"empty",pending:"generating…",reconciling:`reconciling…${u.pendingPhase?` · ${u.pendingPhase}`:""}`,ready:`ready · ${u.elapsed??"?"}s${u.webSearchCalls?` · ws×${u.webSearchCalls}`:""}`,stale:`stale${u.error?`: ${u.error}`:""}`,"asset-missing":`asset missing${u.error?`: ${u.error}`:""}`,error:`error: ${u.error??"unknown"}`}[u.status];return w.jsxs("div",{className:`image-node image-node--${u.status}${o?" image-node--selected":""}`,children:[u.parentServerNodeId?w.jsx(ni,{type:"target",position:mt.Left,className:"image-node__handle"}):null,w.jsx("div",{className:"image-node__preview",children:u.imageUrl&&u.status!=="asset-missing"?w.jsx("img",{src:u.imageUrl,alt:"node"}):x?w.jsx("div",{className:"image-node__skeleton",children:"⏳"}):u.status==="asset-missing"?w.jsx("div",{className:"image-node__placeholder",children:"missing asset"}):u.status==="stale"?w.jsx("div",{className:"image-node__placeholder",children:"stale"}):w.jsx("div",{className:"image-node__placeholder",children:"no image"})}),w.jsx("textarea",{className:"image-node__prompt nodrag",value:u.prompt,onChange:m,onKeyDown:_=>_.stopPropagation(),placeholder:u.parentServerNodeId?"Edit prompt…":"Prompt…",rows:2,disabled:x}),w.jsxs("div",{className:"image-node__footer",children:[w.jsx("span",{className:"image-node__status",children:S}),w.jsxs("div",{className:"image-node__actions nodrag",children:[w.jsx("button",{type:"button",onClick:h,disabled:x,children:u.status==="ready"?"Regenerate":"Generate"}),u.status==="ready"?w.jsx("button",{type:"button",onClick:v,children:"+ Child"}):null,w.jsx("button",{type:"button",onClick:y,className:"image-node__del",title:"Delete",children:"✕"})]})]}),w.jsx(ni,{type:"source",position:mt.Right,className:"image-node__handle image-node__handle--source"})]})}J.memo(PN);function t3(){const{data:n,error:l}=dp();let o="checking...",u="var(--text-dim)";if(l||!n)l&&(o="offline",u="var(--red)");else if(n.credits){const r=n.credits.total_granted??0,f=n.credits.total_used??0,d=r-f;o=`$${d.toFixed(2)} remaining`,u=d>5?"var(--green)":d>1?"var(--amber)":"var(--red)"}else n.costs?.data?.length?(o=`$${(n.costs.data.reduce((f,d)=>f+d.results.reduce((g,m)=>g+(m.amount?.value??0),0),0)/100).toFixed(2)} this month`,u="var(--accent)"):n.oauth?(o="OAuth · free via codex",u="var(--green)"):n.apiKeyValid?(o="API key disabled (OAuth only)",u="var(--text-dim)"):(o="OAuth mode",u="var(--text-dim)");return w.jsxs("div",{className:"billing-bar",children:[w.jsx("div",{className:"label",children:"API Status"}),w.jsx("div",{className:"value",style:{color:u},children:o})]})}function Ln({title:n,items:l,value:o,onChange:u}){return w.jsxs("div",{className:"option-group",children:[n?w.jsx("div",{className:"section-title",children:n}):null,w.jsx("div",{className:"option-row",children:l.map(r=>w.jsxs("button",{className:`option-btn${r.value===o?" active":""}`,style:r.color?{color:r.color}:void 0,onClick:()=>u(r.value),type:"button",children:[r.label,r.sub?w.jsxs(w.Fragment,{children:[w.jsx("br",{}),w.jsx("span",{className:"option-sub",children:r.sub})]}):null]},r.value))})]})}function eo(n){return n.map(l=>({value:l.value,label:l.label,sub:l.sub}))}function e3(){const n=ht(d=>d.sizePreset),l=ht(d=>d.setSizePreset),o=ht(d=>d.customW),u=ht(d=>d.customH),r=ht(d=>d.setCustomSize),f=n==="custom";return w.jsxs("div",{className:"option-group",children:[w.jsx("div",{className:"section-title",children:"Size"}),w.jsx(Ln,{title:"",items:eo(Nx),value:n,onChange:l}),w.jsx(Ln,{title:"",items:eo(Mx),value:n,onChange:l}),w.jsx(Ln,{title:"",items:eo(Ax),value:n,onChange:l}),w.jsx(Ln,{title:"",items:eo(zx),value:n,onChange:l}),w.jsx(Ln,{title:"",items:eo(Tx),value:n,onChange:l}),f?w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"option-row",children:[w.jsx("input",{type:"number",className:"custom-size-input",min:1024,max:3824,step:16,value:o,onChange:d=>r(parseInt(d.target.value)||1024,u),placeholder:"W"}),w.jsx("span",{style:{color:"var(--text-dim)",alignSelf:"center",fontFamily:"var(--mono)",fontSize:12},children:"x"}),w.jsx("input",{type:"number",className:"custom-size-input",min:1024,max:3824,step:16,value:u,onChange:d=>r(o,parseInt(d.target.value)||1024),placeholder:"H"})]}),w.jsx("div",{className:"size-hint",children:"Min 1024 per side, max 3824, multiples of 16, ratio ≤ 3:1"})]}):null]})}const n3={low:{"1024x1024":.006,"1024x1536":.005,"1536x1024":.005,"1024x1360":.005,"1360x1024":.005,"1024x1824":.006,"1824x1024":.006,"2048x2048":.012,"2048x1152":.009,"1152x2048":.009,"3824x2160":.023,"2160x3824":.023,auto:.006},medium:{"1024x1024":.053,"1024x1536":.041,"1536x1024":.041,"1024x1360":.041,"1360x1024":.041,"1024x1824":.05,"1824x1024":.05,"2048x2048":.106,"2048x1152":.08,"1152x2048":.08,"3824x2160":.2,"2160x3824":.2,auto:.053},high:{"1024x1024":.211,"1024x1536":.165,"1536x1024":.165,"1024x1360":.165,"1360x1024":.165,"1024x1824":.2,"1824x1024":.2,"2048x2048":.422,"2048x1152":.32,"1152x2048":.32,"3824x2160":.8,"2160x3824":.8,auto:.211}};function a3(n,l){return n3[n]?.[l]??0}function l3(){const n=ht(m=>m.provider),l=ht(m=>m.quality),u=ht(m=>m.getResolvedSize)(),r=n==="oauth",f=a3(l,u),d=r?"free":`~$${f.toFixed(3)}`,g=r?"var(--green)":void 0;return w.jsxs("div",{className:"cost-estimate",children:[w.jsx("span",{children:"Est. cost"}),w.jsx("span",{className:"price",style:g?{color:g}:void 0,children:d})]})}const i3=[{value:"low",label:"Low",sub:"fast"},{value:"medium",label:"Medium",sub:"balanced"},{value:"high",label:"High",sub:"best"}],o3=[{value:"png",label:"PNG"},{value:"jpeg",label:"JPEG"},{value:"webp",label:"WebP"}],u3=[{value:"low",label:"Low",sub:"less restrictive",color:"var(--amber)"},{value:"auto",label:"Auto",sub:"standard"}],s3=[{value:"1",label:"1"},{value:"2",label:"2"},{value:"4",label:"4"}];function r3(){const n=ht(S=>S.rightPanelOpen),l=ht(S=>S.toggleRightPanel),[o,u]=J.useState(typeof window<"u"?window.matchMedia("(max-width: 800px)").matches:!1);J.useEffect(()=>{if(typeof window>"u")return;const S=window.matchMedia("(max-width: 800px)"),_=()=>u(S.matches);return S.addEventListener("change",_),()=>S.removeEventListener("change",_)},[]);const r=o?n:!0,f=ht(S=>S.quality),d=ht(S=>S.setQuality),g=ht(S=>S.format),m=ht(S=>S.setFormat),h=ht(S=>S.moderation),v=ht(S=>S.setModeration),y=ht(S=>S.count),x=ht(S=>S.setCount);return w.jsxs(w.Fragment,{children:[o&&n?w.jsx("div",{className:"right-panel-backdrop",role:"button","aria-label":"Close settings",onClick:l}):null,w.jsxs("aside",{className:`right-panel${n?"":" collapsed"}${o&&r?" drawer-open":""}`,"aria-label":"Detail settings",children:[w.jsx("button",{type:"button",className:"right-panel-toggle","aria-expanded":n,"aria-controls":"right-panel-body",onClick:l,title:n?"Hide details":"Show details",children:o?n?"✕":"☰":n?"▶":"◀"}),w.jsxs("div",{id:"right-panel-body",className:"right-panel-body",hidden:!n,children:[w.jsx(t3,{}),w.jsx("div",{className:"section-title",children:"Details"}),w.jsx(Ln,{title:"Quality",items:i3,value:f,onChange:d}),w.jsx(e3,{}),w.jsx(Ln,{title:"Format",items:o3,value:g,onChange:m}),w.jsx(Ln,{title:"Moderation",items:u3,value:h,onChange:v}),w.jsx(Ln,{title:"Count",items:s3,value:String(y),onChange:S=>x(Number(S))}),w.jsx(l3,{})]})]})]})}function c3(){const n=ht(r=>r.toast),[l,o]=J.useState(!1);if(J.useEffect(()=>{if(!n)return;o(!0);const r=setTimeout(()=>o(!1),3e3);return()=>clearTimeout(r)},[n]),!n)return null;const u=["toast",l?"visible":"",n.error?"error":""].filter(Boolean).join(" ");return w.jsx("div",{className:u,children:n.message})}function f3(n){if(!n)return"Older";const l=new Date(n);if(Number.isNaN(l.getTime()))return"Older";const u=Math.floor((new Date().getTime()-l.getTime())/864e5);return u===0?"Today":u===1?"Yesterday":u<7?"This week":l.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function d3(){const n=ht(h=>h.galleryOpen),l=ht(h=>h.closeGallery),o=ht(h=>h.history),u=ht(h=>h.selectHistory),r=ht(h=>h.currentImage),[f,d]=J.useState("");J.useEffect(()=>{if(!n)return;const h=v=>{v.key==="Escape"&&l()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n,l]),J.useEffect(()=>{n||d("")},[n]);const g=J.useMemo(()=>{const h=f.trim().toLowerCase().normalize("NFC");return h?o.filter(v=>(v.prompt??"").toLowerCase().normalize("NFC").includes(h)||(v.filename??"").toLowerCase().normalize("NFC").includes(h)):o},[o,f]),m=J.useMemo(()=>{const h=new Map;for(const v of g){const y=f3(v.createdAt);h.has(y)||h.set(y,[]),h.get(y).push(v)}return Array.from(h.entries())},[g]);return n?w.jsx("div",{className:"gallery-backdrop",onClick:l,role:"presentation",children:w.jsxs("div",{className:"gallery",role:"dialog","aria-modal":"true","aria-label":"Image gallery",onClick:h=>h.stopPropagation(),children:[w.jsxs("div",{className:"gallery__header",children:[w.jsxs("div",{className:"gallery__title-row",children:[w.jsx("div",{className:"gallery__title",children:"Gallery"}),w.jsxs("div",{className:"gallery__meta",children:[g.length,f?` / ${o.length}`:""," images"]})]}),w.jsx("input",{type:"text",className:"gallery__search",placeholder:"Search prompt or filename…",value:f,onChange:h=>d(h.target.value),autoFocus:!0}),w.jsx("button",{type:"button",className:"gallery__close",onClick:l,"aria-label":"Close gallery",title:"Close (Esc)",children:"✕"})]}),w.jsx("div",{className:"gallery__scroll",children:g.length===0?w.jsx("div",{className:"gallery__empty",children:o.length===0?"No images yet. Generate something!":"No matches for that query."}):m.map(([h,v])=>w.jsxs("section",{className:"gallery__group",children:[w.jsxs("header",{className:"gallery__group-header",children:[w.jsx("span",{className:"gallery__group-label",children:h}),w.jsx("span",{className:"gallery__group-count",children:v.length})]}),w.jsx("div",{className:"gallery__grid",children:v.map((y,x)=>{const S=r?.image===y.image;return w.jsxs("button",{type:"button",className:`gallery__tile${S?" gallery__tile--active":""}`,onClick:()=>{u(y),l()},title:y.prompt??"",children:[w.jsx("img",{src:y.thumb||y.image,alt:y.prompt??"",loading:"lazy",decoding:"async"}),y.prompt&&w.jsx("div",{className:"gallery__caption",children:w.jsx("span",{className:"gallery__caption-text",children:y.prompt})})]},`${h}-${x}-${y.filename??x}`)})})]},h))})]})}):null}function h3(){const n=ht(f=>f.hydrateHistory),l=ht(f=>f.loadSessions),o=ht(f=>f.startInFlightPolling),u=ht(f=>f.reconcileInflight),r=ht(f=>f.syncFromStorage);return ht(f=>f.uiMode),J.useEffect(()=>{n(),l(),u(),o()},[n,l,u,o]),J.useEffect(()=>{const f=d=>{d.key&&(d.key==="ima2.inFlight"||d.key==="ima2.selectedFilename")&&r()};return window.addEventListener("storage",f),()=>window.removeEventListener("storage",f)},[r]),J.useEffect(()=>{const f=()=>{Ux(ht.getState)};return window.addEventListener("beforeunload",f),document.addEventListener("visibilitychange",f),()=>{window.removeEventListener("beforeunload",f),document.removeEventListener("visibilitychange",f)}},[]),w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"app",children:[w.jsx(Kx,{}),w.jsx(Jx,{}),w.jsx(r3,{})]}),w.jsx(c3,{}),w.jsx(d3,{})]})}cx.createRoot(document.getElementById("root")).render(w.jsx(J.StrictMode,{children:w.jsx(h3,{})}));
|
|
16
|
+
//# sourceMappingURL=index-CGvmo0q2.js.map
|