ima2-gen 1.0.7 → 1.0.8
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 +1 -1
- package/config.js +2 -2
- package/lib/assetLifecycle.js +5 -3
- package/lib/historyList.js +1 -0
- package/lib/nodeStore.js +7 -6
- package/lib/oauthProxy.js +43 -3
- package/lib/storageMigration.js +41 -0
- package/package.json +1 -1
- package/routes/nodes.js +79 -11
- package/routes/sessions.js +9 -1
- package/server.js +2 -0
- package/ui/dist/assets/{index-Jcs5Q1sj.css → index-CBrmEeD7.css} +1 -1
- package/ui/dist/assets/index-DRST1V_0.js +22 -0
- package/ui/dist/assets/index-DRST1V_0.js.map +1 -0
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/index-D1MUxZaB.js +0 -16
- package/ui/dist/assets/index-D1MUxZaB.js.map +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
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"]'))s(r);new MutationObserver(r=>{for(const c of r)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function o(r){const c={};return r.integrity&&(c.integrity=r.integrity),r.referrerPolicy&&(c.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?c.credentials="include":r.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(r){if(r.ep)return;r.ep=!0;const c=o(r);fetch(r.href,c)}})();function My(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var of={exports:{}},no={};var Qm;function RS(){if(Qm)return no;Qm=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function o(s,r,c){var d=null;if(c!==void 0&&(d=""+c),r.key!==void 0&&(d=""+r.key),"key"in r){c={};for(var g in r)g!=="key"&&(c[g]=r[g])}else c=r;return r=c.ref,{$$typeof:n,type:s,key:d,ref:r!==void 0?r:null,props:c}}return no.Fragment=l,no.jsx=o,no.jsxs=o,no}var Km;function OS(){return Km||(Km=1,of.exports=RS()),of.exports}var b=OS(),sf={exports:{}},be={};var Fm;function jS(){if(Fm)return be;Fm=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),c=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"),p=Symbol.iterator;function x(C){return C===null||typeof C!="object"?null:(C=p&&C[p]||C["@@iterator"],typeof C=="function"?C:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,N={};function T(C,B,ee){this.props=C,this.context=B,this.refs=N,this.updater=ee||_}T.prototype.isReactComponent={},T.prototype.setState=function(C,B){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,C,B,"setState")},T.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function U(){}U.prototype=T.prototype;function w(C,B,ee){this.props=C,this.context=B,this.refs=N,this.updater=ee||_}var D=w.prototype=new U;D.constructor=w,M(D,T.prototype),D.isPureReactComponent=!0;var G=Array.isArray;function R(){}var L={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function $(C,B,ee){var ae=ee.ref;return{$$typeof:n,type:C,key:B,ref:ae!==void 0?ae:null,props:ee}}function V(C,B){return $(C.type,B,C.props)}function Y(C){return typeof C=="object"&&C!==null&&C.$$typeof===n}function P(C){var B={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(ee){return B[ee]})}var te=/\/+/g;function z(C,B){return typeof C=="object"&&C!==null&&C.key!=null?P(""+C.key):B.toString(36)}function k(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(R,R):(C.status="pending",C.then(function(B){C.status==="pending"&&(C.status="fulfilled",C.value=B)},function(B){C.status==="pending"&&(C.status="rejected",C.reason=B)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function A(C,B,ee,ae,ue){var fe=typeof C;(fe==="undefined"||fe==="boolean")&&(C=null);var ce=!1;if(C===null)ce=!0;else switch(fe){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(C.$$typeof){case n:case l:ce=!0;break;case v:return ce=C._init,A(ce(C._payload),B,ee,ae,ue)}}if(ce)return ue=ue(C),ce=ae===""?"."+z(C,0):ae,G(ue)?(ee="",ce!=null&&(ee=ce.replace(te,"$&/")+"/"),A(ue,B,ee,"",function(Ee){return Ee})):ue!=null&&(Y(ue)&&(ue=V(ue,ee+(ue.key==null||C&&C.key===ue.key?"":(""+ue.key).replace(te,"$&/")+"/")+ce)),B.push(ue)),1;ce=0;var re=ae===""?".":ae+":";if(G(C))for(var de=0;de<C.length;de++)ae=C[de],fe=re+z(ae,de),ce+=A(ae,B,ee,fe,ue);else if(de=x(C),typeof de=="function")for(C=de.call(C),de=0;!(ae=C.next()).done;)ae=ae.value,fe=re+z(ae,de++),ce+=A(ae,B,ee,fe,ue);else if(fe==="object"){if(typeof C.then=="function")return A(k(C),B,ee,ae,ue);throw B=String(C),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return ce}function j(C,B,ee){if(C==null)return C;var ae=[],ue=0;return A(C,ae,"","",function(fe){return B.call(ee,fe,ue++)}),ae}function I(C){if(C._status===-1){var B=C._result;B=B(),B.then(function(ee){(C._status===0||C._status===-1)&&(C._status=1,C._result=ee)},function(ee){(C._status===0||C._status===-1)&&(C._status=2,C._result=ee)}),C._status===-1&&(C._status=0,C._result=B)}if(C._status===1)return C._result.default;throw C._result}var Q=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},ne={map:j,forEach:function(C,B,ee){j(C,function(){B.apply(this,arguments)},ee)},count:function(C){var B=0;return j(C,function(){B++}),B},toArray:function(C){return j(C,function(B){return B})||[]},only:function(C){if(!Y(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return be.Activity=y,be.Children=ne,be.Component=T,be.Fragment=o,be.Profiler=r,be.PureComponent=w,be.StrictMode=s,be.Suspense=m,be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,be.__COMPILER_RUNTIME={__proto__:null,c:function(C){return L.H.useMemoCache(C)}},be.cache=function(C){return function(){return C.apply(null,arguments)}},be.cacheSignal=function(){return null},be.cloneElement=function(C,B,ee){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var ae=M({},C.props),ue=C.key;if(B!=null)for(fe in B.key!==void 0&&(ue=""+B.key),B)!H.call(B,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&B.ref===void 0||(ae[fe]=B[fe]);var fe=arguments.length-2;if(fe===1)ae.children=ee;else if(1<fe){for(var ce=Array(fe),re=0;re<fe;re++)ce[re]=arguments[re+2];ae.children=ce}return $(C.type,ue,ae)},be.createContext=function(C){return C={$$typeof:d,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:c,_context:C},C},be.createElement=function(C,B,ee){var ae,ue={},fe=null;if(B!=null)for(ae in B.key!==void 0&&(fe=""+B.key),B)H.call(B,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ue[ae]=B[ae]);var ce=arguments.length-2;if(ce===1)ue.children=ee;else if(1<ce){for(var re=Array(ce),de=0;de<ce;de++)re[de]=arguments[de+2];ue.children=re}if(C&&C.defaultProps)for(ae in ce=C.defaultProps,ce)ue[ae]===void 0&&(ue[ae]=ce[ae]);return $(C,fe,ue)},be.createRef=function(){return{current:null}},be.forwardRef=function(C){return{$$typeof:g,render:C}},be.isValidElement=Y,be.lazy=function(C){return{$$typeof:v,_payload:{_status:-1,_result:C},_init:I}},be.memo=function(C,B){return{$$typeof:h,type:C,compare:B===void 0?null:B}},be.startTransition=function(C){var B=L.T,ee={};L.T=ee;try{var ae=C(),ue=L.S;ue!==null&&ue(ee,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(R,Q)}catch(fe){Q(fe)}finally{B!==null&&ee.types!==null&&(B.types=ee.types),L.T=B}},be.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},be.use=function(C){return L.H.use(C)},be.useActionState=function(C,B,ee){return L.H.useActionState(C,B,ee)},be.useCallback=function(C,B){return L.H.useCallback(C,B)},be.useContext=function(C){return L.H.useContext(C)},be.useDebugValue=function(){},be.useDeferredValue=function(C,B){return L.H.useDeferredValue(C,B)},be.useEffect=function(C,B){return L.H.useEffect(C,B)},be.useEffectEvent=function(C){return L.H.useEffectEvent(C)},be.useId=function(){return L.H.useId()},be.useImperativeHandle=function(C,B,ee){return L.H.useImperativeHandle(C,B,ee)},be.useInsertionEffect=function(C,B){return L.H.useInsertionEffect(C,B)},be.useLayoutEffect=function(C,B){return L.H.useLayoutEffect(C,B)},be.useMemo=function(C,B){return L.H.useMemo(C,B)},be.useOptimistic=function(C,B){return L.H.useOptimistic(C,B)},be.useReducer=function(C,B,ee){return L.H.useReducer(C,B,ee)},be.useRef=function(C){return L.H.useRef(C)},be.useState=function(C){return L.H.useState(C)},be.useSyncExternalStore=function(C,B,ee){return L.H.useSyncExternalStore(C,B,ee)},be.useTransition=function(){return L.H.useTransition()},be.version="19.2.5",be}var Jm;function _o(){return Jm||(Jm=1,sf.exports=jS()),sf.exports}var Z=_o();const so=My(Z);var rf={exports:{}},ao={},uf={exports:{}},cf={};var Pm;function HS(){return Pm||(Pm=1,(function(n){function l(A,j){var I=A.length;A.push(j);e:for(;0<I;){var Q=I-1>>>1,ne=A[Q];if(0<r(ne,j))A[Q]=j,A[I]=ne,I=Q;else break e}}function o(A){return A.length===0?null:A[0]}function s(A){if(A.length===0)return null;var j=A[0],I=A.pop();if(I!==j){A[0]=I;e:for(var Q=0,ne=A.length,C=ne>>>1;Q<C;){var B=2*(Q+1)-1,ee=A[B],ae=B+1,ue=A[ae];if(0>r(ee,I))ae<ne&&0>r(ue,ee)?(A[Q]=ue,A[ae]=I,Q=ae):(A[Q]=ee,A[B]=I,Q=B);else if(ae<ne&&0>r(ue,I))A[Q]=ue,A[ae]=I,Q=ae;else break e}}return j}function r(A,j){var I=A.sortIndex-j.sortIndex;return I!==0?I:A.id-j.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var d=Date,g=d.now();n.unstable_now=function(){return d.now()-g}}var m=[],h=[],v=1,y=null,p=3,x=!1,_=!1,M=!1,N=!1,T=typeof setTimeout=="function"?setTimeout:null,U=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function D(A){for(var j=o(h);j!==null;){if(j.callback===null)s(h);else if(j.startTime<=A)s(h),j.sortIndex=j.expirationTime,l(m,j);else break;j=o(h)}}function G(A){if(M=!1,D(A),!_)if(o(m)!==null)_=!0,R||(R=!0,P());else{var j=o(h);j!==null&&k(G,j.startTime-A)}}var R=!1,L=-1,H=5,$=-1;function V(){return N?!0:!(n.unstable_now()-$<H)}function Y(){if(N=!1,R){var A=n.unstable_now();$=A;var j=!0;try{e:{_=!1,M&&(M=!1,U(L),L=-1),x=!0;var I=p;try{t:{for(D(A),y=o(m);y!==null&&!(y.expirationTime>A&&V());){var Q=y.callback;if(typeof Q=="function"){y.callback=null,p=y.priorityLevel;var ne=Q(y.expirationTime<=A);if(A=n.unstable_now(),typeof ne=="function"){y.callback=ne,D(A),j=!0;break t}y===o(m)&&s(m),D(A)}else s(m);y=o(m)}if(y!==null)j=!0;else{var C=o(h);C!==null&&k(G,C.startTime-A),j=!1}}break e}finally{y=null,p=I,x=!1}j=void 0}}finally{j?P():R=!1}}}var P;if(typeof w=="function")P=function(){w(Y)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,z=te.port2;te.port1.onmessage=Y,P=function(){z.postMessage(null)}}else P=function(){T(Y,0)};function k(A,j){L=T(function(){A(n.unstable_now())},j)}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(A){A.callback=null},n.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<A?Math.floor(1e3/A):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_next=function(A){switch(p){case 1:case 2:case 3:var j=3;break;default:j=p}var I=p;p=j;try{return A()}finally{p=I}},n.unstable_requestPaint=function(){N=!0},n.unstable_runWithPriority=function(A,j){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var I=p;p=A;try{return j()}finally{p=I}},n.unstable_scheduleCallback=function(A,j,I){var Q=n.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?Q+I:Q):I=Q,A){case 1:var ne=-1;break;case 2:ne=250;break;case 5:ne=1073741823;break;case 4:ne=1e4;break;default:ne=5e3}return ne=I+ne,A={id:v++,callback:j,priorityLevel:A,startTime:I,expirationTime:ne,sortIndex:-1},I>Q?(A.sortIndex=I,l(h,A),o(m)===null&&A===o(h)&&(M?(U(L),L=-1):M=!0,k(G,I-Q))):(A.sortIndex=ne,l(m,A),_||x||(_=!0,R||(R=!0,P()))),A},n.unstable_shouldYield=V,n.unstable_wrapCallback=function(A){var j=p;return function(){var I=p;p=j;try{return A.apply(this,arguments)}finally{p=I}}}})(cf)),cf}var Wm;function US(){return Wm||(Wm=1,uf.exports=HS()),uf.exports}var ff={exports:{}},yt={};var ep;function LS(){if(ep)return yt;ep=1;var n=_o();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 s={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 c(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 yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,yt.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 c(m,h,null,v)},yt.flushSync=function(m){var h=d.T,v=s.p;try{if(d.T=null,s.p=2,m)return m()}finally{d.T=h,s.p=v,s.d.f()}},yt.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,s.d.C(m,h))},yt.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},yt.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var v=h.as,y=g(v,h.crossOrigin),p=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;v==="style"?s.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:p,fetchPriority:x}):v==="script"&&s.d.X(m,{crossOrigin:y,integrity:p,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},yt.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);s.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&&s.d.M(m)},yt.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);s.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})}},yt.preloadModule=function(m,h){if(typeof m=="string")if(h){var v=g(h.as,h.crossOrigin);s.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 s.d.m(m)},yt.requestFormReset=function(m){s.d.r(m)},yt.unstable_batchedUpdates=function(m,h){return m(h)},yt.useFormState=function(m,h,v){return d.H.useFormState(m,h,v)},yt.useFormStatus=function(){return d.H.useHostTransitionStatus()},yt.version="19.2.5",yt}var tp;function zy(){if(tp)return ff.exports;tp=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(),ff.exports=LS(),ff.exports}var np;function BS(){if(np)return ao;np=1;var n=US(),l=_o(),o=zy();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function d(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(c(e)!==e)throw Error(s(188))}function h(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(s(188));return t!==e?null:e}for(var a=e,i=t;;){var u=a.return;if(u===null)break;var f=u.alternate;if(f===null){if(i=u.return,i!==null){a=i;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===a)return m(u),e;if(f===i)return m(u),t;f=f.sibling}throw Error(s(188))}if(a.return!==i.return)a=u,i=f;else{for(var S=!1,E=u.child;E;){if(E===a){S=!0,a=u,i=f;break}if(E===i){S=!0,i=u,a=f;break}E=E.sibling}if(!S){for(E=f.child;E;){if(E===a){S=!0,a=f,i=u;break}if(E===i){S=!0,i=f,a=u;break}E=E.sibling}if(!S)throw Error(s(189))}}if(a.alternate!==i)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,p=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),w=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function P(e){return e===null||typeof e!="object"?null:(e=Y&&e[Y]||e["@@iterator"],typeof e=="function"?e:null)}var te=Symbol.for("react.client.reference");function z(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case M:return"Fragment";case T:return"Profiler";case N:return"StrictMode";case G:return"Suspense";case R:return"SuspenseList";case $:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case _:return"Portal";case w:return e.displayName||"Context";case U:return(e._context.displayName||"Context")+".Consumer";case D:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case L:return t=e.displayName||null,t!==null?t:z(e.type)||"Memo";case H:t=e._payload,e=e._init;try{return z(e(t))}catch{}}return null}var k=Array.isArray,A=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},Q=[],ne=-1;function C(e){return{current:e}}function B(e){0>ne||(e.current=Q[ne],Q[ne]=null,ne--)}function ee(e,t){ne++,Q[ne]=e.current,e.current=t}var ae=C(null),ue=C(null),fe=C(null),ce=C(null);function re(e,t){switch(ee(fe,t),ee(ue,e),ee(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ym(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ym(t),e=vm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(ae),ee(ae,e)}function de(){B(ae),B(ue),B(fe)}function Ee(e){e.memoizedState!==null&&ee(ce,e);var t=ae.current,a=vm(t,e.type);t!==a&&(ee(ue,e),ee(ae,a))}function xe(e){ue.current===e&&(B(ae),B(ue)),ce.current===e&&(B(ce),Pi._currentValue=I)}var ye,Se;function Ce(e){if(ye===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);ye=t&&t[1]||"",Se=-1<a.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+ye+e+Se}var qe=!1;function Ue(e,t){if(!e||qe)return"";qe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(W){var J=W}Reflect.construct(e,[],se)}else{try{se.call()}catch(W){J=W}e.call(se.prototype)}}else{try{throw Error()}catch(W){J=W}(se=e())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(W){if(W&&J&&typeof W.stack=="string")return[W.stack,J.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=i.DetermineComponentFrameRoot(),S=f[0],E=f[1];if(S&&E){var O=S.split(`
|
|
4
|
+
`),F=E.split(`
|
|
5
|
+
`);for(u=i=0;i<O.length&&!O[i].includes("DetermineComponentFrameRoot");)i++;for(;u<F.length&&!F[u].includes("DetermineComponentFrameRoot");)u++;if(i===O.length||u===F.length)for(i=O.length-1,u=F.length-1;1<=i&&0<=u&&O[i]!==F[u];)u--;for(;1<=i&&0<=u;i--,u--)if(O[i]!==F[u]){if(i!==1||u!==1)do if(i--,u--,0>u||O[i]!==F[u]){var le=`
|
|
6
|
+
`+O[i].replace(" at new "," at ");return e.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",e.displayName)),le}while(1<=i&&0<=u);break}}}finally{qe=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Ce(a):""}function rt(e,t){switch(e.tag){case 26:case 27:case 5:return Ce(e.type);case 16:return Ce("Lazy");case 13:return e.child!==t&&t!==null?Ce("Suspense Fallback"):Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return Ue(e.type,!1);case 11:return Ue(e.type.render,!1);case 1:return Ue(e.type,!0);case 31:return Ce("Activity");default:return""}}function Qt(e){try{var t="",a=null;do t+=rt(e,a),a=e,e=e.return;while(e);return t}catch(i){return`
|
|
7
|
+
Error generating stack: `+i.message+`
|
|
8
|
+
`+i.stack}}var zt=Object.prototype.hasOwnProperty,Kt=n.unstable_scheduleCallback,yn=n.unstable_cancelCallback,Na=n.unstable_shouldYield,Aa=n.unstable_requestPaint,ft=n.unstable_now,il=n.unstable_getCurrentPriorityLevel,vn=n.unstable_ImmediatePriority,Xn=n.unstable_UserBlockingPriority,Ta=n.unstable_NormalPriority,Yr=n.unstable_LowPriority,ol=n.unstable_IdlePriority,kr=n.log,Vr=n.unstable_setDisableYieldValue,Ca=null,vt=null;function on(e){if(typeof kr=="function"&&Vr(e),vt&&typeof vt.setStrictMode=="function")try{vt.setStrictMode(Ca,e)}catch{}}var St=Math.clz32?Math.clz32:$r,Xr=Math.log,Zr=Math.LN2;function $r(e){return e>>>=0,e===0?32:31-(Xr(e)/Zr|0)|0}var sl=256,rl=262144,ul=4194304;function Sn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function cl(e,t,a){var i=e.pendingLanes;if(i===0)return 0;var u=0,f=e.suspendedLanes,S=e.pingedLanes;e=e.warmLanes;var E=i&134217727;return E!==0?(i=E&~f,i!==0?u=Sn(i):(S&=E,S!==0?u=Sn(S):a||(a=E&~e,a!==0&&(u=Sn(a))))):(E=i&~f,E!==0?u=Sn(E):S!==0?u=Sn(S):a||(a=i&~e,a!==0&&(u=Sn(a)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,a=t&-t,f>=a||f===32&&(a&4194048)!==0)?t:u}function Ma(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Qr(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Do(){var e=ul;return ul<<=1,(ul&62914560)===0&&(ul=4194304),e}function ui(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function za(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Kr(e,t,a,i,u,f){var S=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var E=e.entanglements,O=e.expirationTimes,F=e.hiddenUpdates;for(a=S&~a;0<a;){var le=31-St(a),se=1<<le;E[le]=0,O[le]=-1;var J=F[le];if(J!==null)for(F[le]=null,le=0;le<J.length;le++){var W=J[le];W!==null&&(W.lane&=-536870913)}a&=~se}i!==0&&Ro(e,i,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(S&~t))}function Ro(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-St(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|a&261930}function Oo(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var i=31-St(a),u=1<<i;u&t|e[i]&t&&(e[i]|=t),a&=~u}}function jo(e,t){var a=t&-t;return a=(a&42)!==0?1:ci(a),(a&(e.suspendedLanes|t))!==0?0:a}function ci(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function fi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ho(){var e=j.p;return e!==0?e:(e=window.event,e===void 0?32:Gm(e.type))}function Uo(e,t){var a=j.p;try{return j.p=e,t()}finally{j.p=a}}var sn=Math.random().toString(36).slice(2),ot="__reactFiber$"+sn,pt="__reactProps$"+sn,bn="__reactContainer$"+sn,fl="__reactEvents$"+sn,Lo="__reactListeners$"+sn,Fr="__reactHandles$"+sn,Bo="__reactResources$"+sn,Da="__reactMarker$"+sn;function di(e){delete e[ot],delete e[pt],delete e[fl],delete e[Lo],delete e[Fr]}function Zn(e){var t=e[ot];if(t)return t;for(var a=e.parentNode;a;){if(t=a[bn]||a[ot]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Nm(e);e!==null;){if(a=e[ot])return a;e=Nm(e)}return t}e=a,a=e.parentNode}return null}function $n(e){if(e=e[ot]||e[bn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Qn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function Kn(e){var t=e[Bo];return t||(t=e[Bo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function et(e){e[Da]=!0}var qo=new Set,Io={};function xn(e,t){Fn(e,t),Fn(e+"Capture",t)}function Fn(e,t){for(Io[e]=t,e=0;e<t.length;e++)qo.add(t[e])}var Jr=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]*$"),hi={},Go={};function Pr(e){return zt.call(Go,e)?!0:zt.call(hi,e)?!1:Jr.test(e)?Go[e]=!0:(hi[e]=!0,!1)}function dl(e,t,a){if(Pr(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function hl(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Ft(e,t,a,i){if(i===null)e.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+i)}}function xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Yo(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Wr(e,t,a){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var u=i.get,f=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(S){a=""+S,f.call(this,S)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return a},setValue:function(S){a=""+S},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function gl(e){if(!e._valueTracker){var t=Yo(e)?"checked":"value";e._valueTracker=Wr(e,t,""+e[t])}}function ko(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),i="";return e&&(i=Yo(e)?e.checked?"true":"false":e.value),e=i,e!==a?(t.setValue(e),!0):!1}function Ra(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var eu=/[\n"\\]/g;function wt(e){return e.replace(eu,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Oa(e,t,a,i,u,f,S,E){e.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.type=S:e.removeAttribute("type"),t!=null?S==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+xt(t)):e.value!==""+xt(t)&&(e.value=""+xt(t)):S!=="submit"&&S!=="reset"||e.removeAttribute("value"),t!=null?gi(e,S,xt(t)):a!=null?gi(e,S,xt(a)):i!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?e.name=""+xt(E):e.removeAttribute("name")}function Vo(e,t,a,i,u,f,S,E){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||a!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){gl(e);return}a=a!=null?""+xt(a):"",t=t!=null?""+xt(t):a,E||t===e.value||(e.value=t),e.defaultValue=t}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=E?e.checked:!!i,e.defaultChecked=!!i,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(e.name=S),gl(e)}function gi(e,t,a){t==="number"&&Ra(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function wn(e,t,a,i){if(e=e.options,t){t={};for(var u=0;u<a.length;u++)t["$"+a[u]]=!0;for(a=0;a<e.length;a++)u=t.hasOwnProperty("$"+e[a].value),e[a].selected!==u&&(e[a].selected=u),u&&i&&(e[a].defaultSelected=!0)}else{for(a=""+xt(a),t=null,u=0;u<e.length;u++){if(e[u].value===a){e[u].selected=!0,i&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function dd(e,t,a){if(t!=null&&(t=""+xt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+xt(a):""}function hd(e,t,a,i){if(t==null){if(i!=null){if(a!=null)throw Error(s(92));if(k(i)){if(1<i.length)throw Error(s(93));i=i[0]}a=i}a==null&&(a=""),t=a}a=xt(t),e.defaultValue=a,i=e.textContent,i===a&&i!==""&&i!==null&&(e.value=i),gl(e)}function ml(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Tv=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 gd(e,t,a){var i=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,a):typeof a!="number"||a===0||Tv.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function md(e,t,a){if(t!=null&&typeof t!="object")throw Error(s(62));if(e=e.style,a!=null){for(var i in a)!a.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var u in t)i=t[u],t.hasOwnProperty(u)&&a[u]!==i&&gd(e,u,i)}else for(var f in t)t.hasOwnProperty(f)&&gd(e,f,t[f])}function tu(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Cv=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"]]),Mv=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Xo(e){return Mv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function En(){}var nu=null;function au(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pl=null,yl=null;function pd(e){var t=$n(e);if(t&&(e=t.stateNode)){var a=e[pt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Oa(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+wt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var i=a[t];if(i!==e&&i.form===e.form){var u=i[pt]||null;if(!u)throw Error(s(90));Oa(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<a.length;t++)i=a[t],i.form===e.form&&ko(i)}break e;case"textarea":dd(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&wn(e,!!a.multiple,t,!1)}}}var lu=!1;function yd(e,t,a){if(lu)return e(t,a);lu=!0;try{var i=e(t);return i}finally{if(lu=!1,(pl!==null||yl!==null)&&(Rs(),pl&&(t=pl,e=yl,yl=pl=null,pd(t),e)))for(t=0;t<e.length;t++)pd(e[t])}}function mi(e,t){var a=e.stateNode;if(a===null)return null;var i=a[pt]||null;if(i===null)return null;a=i[t];e:switch(t){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)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(s(231,t,typeof a));return a}var _n=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),iu=!1;if(_n)try{var pi={};Object.defineProperty(pi,"passive",{get:function(){iu=!0}}),window.addEventListener("test",pi,pi),window.removeEventListener("test",pi,pi)}catch{iu=!1}var Jn=null,ou=null,Zo=null;function vd(){if(Zo)return Zo;var e,t=ou,a=t.length,i,u="value"in Jn?Jn.value:Jn.textContent,f=u.length;for(e=0;e<a&&t[e]===u[e];e++);var S=a-e;for(i=1;i<=S&&t[a-i]===u[f-i];i++);return Zo=u.slice(e,1<i?1-i:void 0)}function $o(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Qo(){return!0}function Sd(){return!1}function Et(e){function t(a,i,u,f,S){this._reactName=a,this._targetInst=u,this.type=i,this.nativeEvent=f,this.target=S,this.currentTarget=null;for(var E in e)e.hasOwnProperty(E)&&(a=e[E],this[E]=a?a(f):f[E]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Qo:Sd,this.isPropagationStopped=Sd,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Qo)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Qo)},persist:function(){},isPersistent:Qo}),t}var ja={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ko=Et(ja),yi=y({},ja,{view:0,detail:0}),zv=Et(yi),su,ru,vi,Fo=y({},yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==vi&&(vi&&e.type==="mousemove"?(su=e.screenX-vi.screenX,ru=e.screenY-vi.screenY):ru=su=0,vi=e),su)},movementY:function(e){return"movementY"in e?e.movementY:ru}}),bd=Et(Fo),Dv=y({},Fo,{dataTransfer:0}),Rv=Et(Dv),Ov=y({},yi,{relatedTarget:0}),uu=Et(Ov),jv=y({},ja,{animationName:0,elapsedTime:0,pseudoElement:0}),Hv=Et(jv),Uv=y({},ja,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Lv=Et(Uv),Bv=y({},ja,{data:0}),xd=Et(Bv),qv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Iv={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"},Gv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Gv[e])?!!t[e]:!1}function cu(){return Yv}var kv=y({},yi,{key:function(e){if(e.key){var t=qv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$o(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Iv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cu,charCode:function(e){return e.type==="keypress"?$o(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$o(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Vv=Et(kv),Xv=y({},Fo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wd=Et(Xv),Zv=y({},yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cu}),$v=Et(Zv),Qv=y({},ja,{propertyName:0,elapsedTime:0,pseudoElement:0}),Kv=Et(Qv),Fv=y({},Fo,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Jv=Et(Fv),Pv=y({},ja,{newState:0,oldState:0}),Wv=Et(Pv),e1=[9,13,27,32],fu=_n&&"CompositionEvent"in window,Si=null;_n&&"documentMode"in document&&(Si=document.documentMode);var t1=_n&&"TextEvent"in window&&!Si,Ed=_n&&(!fu||Si&&8<Si&&11>=Si),_d=" ",Nd=!1;function Ad(e,t){switch(e){case"keyup":return e1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Td(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vl=!1;function n1(e,t){switch(e){case"compositionend":return Td(t);case"keypress":return t.which!==32?null:(Nd=!0,_d);case"textInput":return e=t.data,e===_d&&Nd?null:e;default:return null}}function a1(e,t){if(vl)return e==="compositionend"||!fu&&Ad(e,t)?(e=vd(),Zo=ou=Jn=null,vl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ed&&t.locale!=="ko"?null:t.data;default:return null}}var l1={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 Cd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!l1[e.type]:t==="textarea"}function Md(e,t,a,i){pl?yl?yl.push(i):yl=[i]:pl=i,t=qs(t,"onChange"),0<t.length&&(a=new Ko("onChange","change",null,a,i),e.push({event:a,listeners:t}))}var bi=null,xi=null;function i1(e){fm(e,0)}function Jo(e){var t=Qn(e);if(ko(t))return e}function zd(e,t){if(e==="change")return t}var Dd=!1;if(_n){var du;if(_n){var hu="oninput"in document;if(!hu){var Rd=document.createElement("div");Rd.setAttribute("oninput","return;"),hu=typeof Rd.oninput=="function"}du=hu}else du=!1;Dd=du&&(!document.documentMode||9<document.documentMode)}function Od(){bi&&(bi.detachEvent("onpropertychange",jd),xi=bi=null)}function jd(e){if(e.propertyName==="value"&&Jo(xi)){var t=[];Md(t,xi,e,au(e)),yd(i1,t)}}function o1(e,t,a){e==="focusin"?(Od(),bi=t,xi=a,bi.attachEvent("onpropertychange",jd)):e==="focusout"&&Od()}function s1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Jo(xi)}function r1(e,t){if(e==="click")return Jo(t)}function u1(e,t){if(e==="input"||e==="change")return Jo(t)}function c1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dt=typeof Object.is=="function"?Object.is:c1;function wi(e,t){if(Dt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(i=0;i<a.length;i++){var u=a[i];if(!zt.call(t,u)||!Dt(e[u],t[u]))return!1}return!0}function Hd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ud(e,t){var a=Hd(e);e=0;for(var i;a;){if(a.nodeType===3){if(i=e+a.textContent.length,e<=t&&i>=t)return{node:a,offset:t-e};e=i}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Hd(a)}}function Ld(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ld(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Bd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ra(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Ra(e.document)}return t}function gu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var f1=_n&&"documentMode"in document&&11>=document.documentMode,Sl=null,mu=null,Ei=null,pu=!1;function qd(e,t,a){var i=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;pu||Sl==null||Sl!==Ra(i)||(i=Sl,"selectionStart"in i&&gu(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}),Ei&&wi(Ei,i)||(Ei=i,i=qs(mu,"onSelect"),0<i.length&&(t=new Ko("onSelect","select",null,t,a),e.push({event:t,listeners:i}),t.target=Sl)))}function Ha(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var bl={animationend:Ha("Animation","AnimationEnd"),animationiteration:Ha("Animation","AnimationIteration"),animationstart:Ha("Animation","AnimationStart"),transitionrun:Ha("Transition","TransitionRun"),transitionstart:Ha("Transition","TransitionStart"),transitioncancel:Ha("Transition","TransitionCancel"),transitionend:Ha("Transition","TransitionEnd")},yu={},Id={};_n&&(Id=document.createElement("div").style,"AnimationEvent"in window||(delete bl.animationend.animation,delete bl.animationiteration.animation,delete bl.animationstart.animation),"TransitionEvent"in window||delete bl.transitionend.transition);function Ua(e){if(yu[e])return yu[e];if(!bl[e])return e;var t=bl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Id)return yu[e]=t[a];return e}var Gd=Ua("animationend"),Yd=Ua("animationiteration"),kd=Ua("animationstart"),d1=Ua("transitionrun"),h1=Ua("transitionstart"),g1=Ua("transitioncancel"),Vd=Ua("transitionend"),Xd=new Map,vu="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(" ");vu.push("scrollEnd");function Jt(e,t){Xd.set(e,t),xn(t,[e])}var Po=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},It=[],xl=0,Su=0;function Wo(){for(var e=xl,t=Su=xl=0;t<e;){var a=It[t];It[t++]=null;var i=It[t];It[t++]=null;var u=It[t];It[t++]=null;var f=It[t];if(It[t++]=null,i!==null&&u!==null){var S=i.pending;S===null?u.next=u:(u.next=S.next,S.next=u),i.pending=u}f!==0&&Zd(a,u,f)}}function es(e,t,a,i){It[xl++]=e,It[xl++]=t,It[xl++]=a,It[xl++]=i,Su|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function bu(e,t,a,i){return es(e,t,a,i),ts(e)}function La(e,t){return es(e,null,null,t),ts(e)}function Zd(e,t,a){e.lanes|=a;var i=e.alternate;i!==null&&(i.lanes|=a);for(var u=!1,f=e.return;f!==null;)f.childLanes|=a,i=f.alternate,i!==null&&(i.childLanes|=a),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&t!==null&&(u=31-St(a),e=f.hiddenUpdates,i=e[u],i===null?e[u]=[t]:i.push(t),t.lane=a|536870912),f):null}function ts(e){if(50<Xi)throw Xi=0,Mc=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var wl={};function m1(e,t,a,i){this.tag=e,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=t,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 Rt(e,t,a,i){return new m1(e,t,a,i)}function xu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Nn(e,t){var a=e.alternate;return a===null?(a=Rt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function $d(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ns(e,t,a,i,u,f){var S=0;if(i=e,typeof e=="function")xu(e)&&(S=1);else if(typeof e=="string")S=bS(e,a,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case $:return e=Rt(31,a,t,u),e.elementType=$,e.lanes=f,e;case M:return Ba(a.children,u,f,t);case N:S=8,u|=24;break;case T:return e=Rt(12,a,t,u|2),e.elementType=T,e.lanes=f,e;case G:return e=Rt(13,a,t,u),e.elementType=G,e.lanes=f,e;case R:return e=Rt(19,a,t,u),e.elementType=R,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case w:S=10;break e;case U:S=9;break e;case D:S=11;break e;case L:S=14;break e;case H:S=16,i=null;break e}S=29,a=Error(s(130,e===null?"null":typeof e,"")),i=null}return t=Rt(S,a,t,u),t.elementType=e,t.type=i,t.lanes=f,t}function Ba(e,t,a,i){return e=Rt(7,e,i,t),e.lanes=a,e}function wu(e,t,a){return e=Rt(6,e,null,t),e.lanes=a,e}function Qd(e){var t=Rt(18,null,null,0);return t.stateNode=e,t}function Eu(e,t,a){return t=Rt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Kd=new WeakMap;function Gt(e,t){if(typeof e=="object"&&e!==null){var a=Kd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Qt(t)},Kd.set(e,t),t)}return{value:e,source:t,stack:Qt(t)}}var El=[],_l=0,as=null,_i=0,Yt=[],kt=0,Pn=null,rn=1,un="";function An(e,t){El[_l++]=_i,El[_l++]=as,as=e,_i=t}function Fd(e,t,a){Yt[kt++]=rn,Yt[kt++]=un,Yt[kt++]=Pn,Pn=e;var i=rn;e=un;var u=32-St(i)-1;i&=~(1<<u),a+=1;var f=32-St(t)+u;if(30<f){var S=u-u%5;f=(i&(1<<S)-1).toString(32),i>>=S,u-=S,rn=1<<32-St(t)+u|a<<u|i,un=f+e}else rn=1<<f|a<<u|i,un=e}function _u(e){e.return!==null&&(An(e,1),Fd(e,1,0))}function Nu(e){for(;e===as;)as=El[--_l],El[_l]=null,_i=El[--_l],El[_l]=null;for(;e===Pn;)Pn=Yt[--kt],Yt[kt]=null,un=Yt[--kt],Yt[kt]=null,rn=Yt[--kt],Yt[kt]=null}function Jd(e,t){Yt[kt++]=rn,Yt[kt++]=un,Yt[kt++]=Pn,rn=t.id,un=t.overflow,Pn=e}var dt=null,Ve=null,De=!1,Wn=null,Vt=!1,Au=Error(s(519));function ea(e){var t=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ni(Gt(t,e)),Au}function Pd(e){var t=e.stateNode,a=e.type,i=e.memoizedProps;switch(t[ot]=e,t[pt]=i,a){case"dialog":Te("cancel",t),Te("close",t);break;case"iframe":case"object":case"embed":Te("load",t);break;case"video":case"audio":for(a=0;a<$i.length;a++)Te($i[a],t);break;case"source":Te("error",t);break;case"img":case"image":case"link":Te("error",t),Te("load",t);break;case"details":Te("toggle",t);break;case"input":Te("invalid",t),Vo(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Te("invalid",t);break;case"textarea":Te("invalid",t),hd(t,i.value,i.defaultValue,i.children)}a=i.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||i.suppressHydrationWarning===!0||mm(t.textContent,a)?(i.popover!=null&&(Te("beforetoggle",t),Te("toggle",t)),i.onScroll!=null&&Te("scroll",t),i.onScrollEnd!=null&&Te("scrollend",t),i.onClick!=null&&(t.onclick=En),t=!0):t=!1,t||ea(e,!0)}function Wd(e){for(dt=e.return;dt;)switch(dt.tag){case 5:case 31:case 13:Vt=!1;return;case 27:case 3:Vt=!0;return;default:dt=dt.return}}function Nl(e){if(e!==dt)return!1;if(!De)return Wd(e),De=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Vc(e.type,e.memoizedProps)),a=!a),a&&Ve&&ea(e),Wd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Ve=_m(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Ve=_m(e)}else t===27?(t=Ve,ga(e.type)?(e=Kc,Kc=null,Ve=e):Ve=t):Ve=dt?Zt(e.stateNode.nextSibling):null;return!0}function qa(){Ve=dt=null,De=!1}function Tu(){var e=Wn;return e!==null&&(Tt===null?Tt=e:Tt.push.apply(Tt,e),Wn=null),e}function Ni(e){Wn===null?Wn=[e]:Wn.push(e)}var Cu=C(null),Ia=null,Tn=null;function ta(e,t,a){ee(Cu,t._currentValue),t._currentValue=a}function Cn(e){e._currentValue=Cu.current,B(Cu)}function Mu(e,t,a){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===a)break;e=e.return}}function zu(e,t,a,i){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var S=u.child;f=f.firstContext;e:for(;f!==null;){var E=f;f=u;for(var O=0;O<t.length;O++)if(E.context===t[O]){f.lanes|=a,E=f.alternate,E!==null&&(E.lanes|=a),Mu(f.return,a,e),i||(S=null);break e}f=E.next}}else if(u.tag===18){if(S=u.return,S===null)throw Error(s(341));S.lanes|=a,f=S.alternate,f!==null&&(f.lanes|=a),Mu(S,a,e),S=null}else S=u.child;if(S!==null)S.return=u;else for(S=u;S!==null;){if(S===e){S=null;break}if(u=S.sibling,u!==null){u.return=S.return,S=u;break}S=S.return}u=S}}function Al(e,t,a,i){e=null;for(var u=t,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var S=u.alternate;if(S===null)throw Error(s(387));if(S=S.memoizedProps,S!==null){var E=u.type;Dt(u.pendingProps.value,S.value)||(e!==null?e.push(E):e=[E])}}else if(u===ce.current){if(S=u.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Pi):e=[Pi])}u=u.return}e!==null&&zu(t,e,a,i),t.flags|=262144}function ls(e){for(e=e.firstContext;e!==null;){if(!Dt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ga(e){Ia=e,Tn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ht(e){return eh(Ia,e)}function is(e,t){return Ia===null&&Ga(e),eh(e,t)}function eh(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Tn===null){if(e===null)throw Error(s(308));Tn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Tn=Tn.next=t;return a}var p1=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},y1=n.unstable_scheduleCallback,v1=n.unstable_NormalPriority,tt={$$typeof:w,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Du(){return{controller:new p1,data:new Map,refCount:0}}function Ai(e){e.refCount--,e.refCount===0&&y1(v1,function(){e.controller.abort()})}var Ti=null,Ru=0,Tl=0,Cl=null;function S1(e,t){if(Ti===null){var a=Ti=[];Ru=0,Tl=Hc(),Cl={status:"pending",value:void 0,then:function(i){a.push(i)}}}return Ru++,t.then(th,th),t}function th(){if(--Ru===0&&Ti!==null){Cl!==null&&(Cl.status="fulfilled");var e=Ti;Ti=null,Tl=0,Cl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function b1(e,t){var a=[],i={status:"pending",value:null,reason:null,then:function(u){a.push(u)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var u=0;u<a.length;u++)(0,a[u])(t)},function(u){for(i.status="rejected",i.reason=u,u=0;u<a.length;u++)(0,a[u])(void 0)}),i}var nh=A.S;A.S=function(e,t){qg=ft(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&S1(e,t),nh!==null&&nh(e,t)};var Ya=C(null);function Ou(){var e=Ya.current;return e!==null?e:ke.pooledCache}function os(e,t){t===null?ee(Ya,Ya.current):ee(Ya,t.pool)}function ah(){var e=Ou();return e===null?null:{parent:tt._currentValue,pool:e}}var Ml=Error(s(460)),ju=Error(s(474)),ss=Error(s(542)),rs={then:function(){}};function lh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ih(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(En,En),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,sh(e),e;default:if(typeof t.status=="string")t.then(En,En);else{if(e=ke,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=i}},function(i){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,sh(e),e}throw Va=t,Ml}}function ka(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Va=a,Ml):a}}var Va=null;function oh(){if(Va===null)throw Error(s(459));var e=Va;return Va=null,e}function sh(e){if(e===Ml||e===ss)throw Error(s(483))}var zl=null,Ci=0;function us(e){var t=Ci;return Ci+=1,zl===null&&(zl=[]),ih(zl,e,t)}function Mi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function cs(e,t){throw t.$$typeof===p?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function rh(e){function t(X,q){if(e){var K=X.deletions;K===null?(X.deletions=[q],X.flags|=16):K.push(q)}}function a(X,q){if(!e)return null;for(;q!==null;)t(X,q),q=q.sibling;return null}function i(X){for(var q=new Map;X!==null;)X.key!==null?q.set(X.key,X):q.set(X.index,X),X=X.sibling;return q}function u(X,q){return X=Nn(X,q),X.index=0,X.sibling=null,X}function f(X,q,K){return X.index=K,e?(K=X.alternate,K!==null?(K=K.index,K<q?(X.flags|=67108866,q):K):(X.flags|=67108866,q)):(X.flags|=1048576,q)}function S(X){return e&&X.alternate===null&&(X.flags|=67108866),X}function E(X,q,K,ie){return q===null||q.tag!==6?(q=wu(K,X.mode,ie),q.return=X,q):(q=u(q,K),q.return=X,q)}function O(X,q,K,ie){var pe=K.type;return pe===M?le(X,q,K.props.children,ie,K.key):q!==null&&(q.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===H&&ka(pe)===q.type)?(q=u(q,K.props),Mi(q,K),q.return=X,q):(q=ns(K.type,K.key,K.props,null,X.mode,ie),Mi(q,K),q.return=X,q)}function F(X,q,K,ie){return q===null||q.tag!==4||q.stateNode.containerInfo!==K.containerInfo||q.stateNode.implementation!==K.implementation?(q=Eu(K,X.mode,ie),q.return=X,q):(q=u(q,K.children||[]),q.return=X,q)}function le(X,q,K,ie,pe){return q===null||q.tag!==7?(q=Ba(K,X.mode,ie,pe),q.return=X,q):(q=u(q,K),q.return=X,q)}function se(X,q,K){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=wu(""+q,X.mode,K),q.return=X,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case x:return K=ns(q.type,q.key,q.props,null,X.mode,K),Mi(K,q),K.return=X,K;case _:return q=Eu(q,X.mode,K),q.return=X,q;case H:return q=ka(q),se(X,q,K)}if(k(q)||P(q))return q=Ba(q,X.mode,K,null),q.return=X,q;if(typeof q.then=="function")return se(X,us(q),K);if(q.$$typeof===w)return se(X,is(X,q),K);cs(X,q)}return null}function J(X,q,K,ie){var pe=q!==null?q.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return pe!==null?null:E(X,q,""+K,ie);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case x:return K.key===pe?O(X,q,K,ie):null;case _:return K.key===pe?F(X,q,K,ie):null;case H:return K=ka(K),J(X,q,K,ie)}if(k(K)||P(K))return pe!==null?null:le(X,q,K,ie,null);if(typeof K.then=="function")return J(X,q,us(K),ie);if(K.$$typeof===w)return J(X,q,is(X,K),ie);cs(X,K)}return null}function W(X,q,K,ie,pe){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return X=X.get(K)||null,E(q,X,""+ie,pe);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:return X=X.get(ie.key===null?K:ie.key)||null,O(q,X,ie,pe);case _:return X=X.get(ie.key===null?K:ie.key)||null,F(q,X,ie,pe);case H:return ie=ka(ie),W(X,q,K,ie,pe)}if(k(ie)||P(ie))return X=X.get(K)||null,le(q,X,ie,pe,null);if(typeof ie.then=="function")return W(X,q,K,us(ie),pe);if(ie.$$typeof===w)return W(X,q,K,is(q,ie),pe);cs(q,ie)}return null}function he(X,q,K,ie){for(var pe=null,Oe=null,ge=q,_e=q=0,ze=null;ge!==null&&_e<K.length;_e++){ge.index>_e?(ze=ge,ge=null):ze=ge.sibling;var je=J(X,ge,K[_e],ie);if(je===null){ge===null&&(ge=ze);break}e&&ge&&je.alternate===null&&t(X,ge),q=f(je,q,_e),Oe===null?pe=je:Oe.sibling=je,Oe=je,ge=ze}if(_e===K.length)return a(X,ge),De&&An(X,_e),pe;if(ge===null){for(;_e<K.length;_e++)ge=se(X,K[_e],ie),ge!==null&&(q=f(ge,q,_e),Oe===null?pe=ge:Oe.sibling=ge,Oe=ge);return De&&An(X,_e),pe}for(ge=i(ge);_e<K.length;_e++)ze=W(ge,X,_e,K[_e],ie),ze!==null&&(e&&ze.alternate!==null&&ge.delete(ze.key===null?_e:ze.key),q=f(ze,q,_e),Oe===null?pe=ze:Oe.sibling=ze,Oe=ze);return e&&ge.forEach(function(Sa){return t(X,Sa)}),De&&An(X,_e),pe}function ve(X,q,K,ie){if(K==null)throw Error(s(151));for(var pe=null,Oe=null,ge=q,_e=q=0,ze=null,je=K.next();ge!==null&&!je.done;_e++,je=K.next()){ge.index>_e?(ze=ge,ge=null):ze=ge.sibling;var Sa=J(X,ge,je.value,ie);if(Sa===null){ge===null&&(ge=ze);break}e&&ge&&Sa.alternate===null&&t(X,ge),q=f(Sa,q,_e),Oe===null?pe=Sa:Oe.sibling=Sa,Oe=Sa,ge=ze}if(je.done)return a(X,ge),De&&An(X,_e),pe;if(ge===null){for(;!je.done;_e++,je=K.next())je=se(X,je.value,ie),je!==null&&(q=f(je,q,_e),Oe===null?pe=je:Oe.sibling=je,Oe=je);return De&&An(X,_e),pe}for(ge=i(ge);!je.done;_e++,je=K.next())je=W(ge,X,_e,je.value,ie),je!==null&&(e&&je.alternate!==null&&ge.delete(je.key===null?_e:je.key),q=f(je,q,_e),Oe===null?pe=je:Oe.sibling=je,Oe=je);return e&&ge.forEach(function(DS){return t(X,DS)}),De&&An(X,_e),pe}function Ye(X,q,K,ie){if(typeof K=="object"&&K!==null&&K.type===M&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case x:e:{for(var pe=K.key;q!==null;){if(q.key===pe){if(pe=K.type,pe===M){if(q.tag===7){a(X,q.sibling),ie=u(q,K.props.children),ie.return=X,X=ie;break e}}else if(q.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===H&&ka(pe)===q.type){a(X,q.sibling),ie=u(q,K.props),Mi(ie,K),ie.return=X,X=ie;break e}a(X,q);break}else t(X,q);q=q.sibling}K.type===M?(ie=Ba(K.props.children,X.mode,ie,K.key),ie.return=X,X=ie):(ie=ns(K.type,K.key,K.props,null,X.mode,ie),Mi(ie,K),ie.return=X,X=ie)}return S(X);case _:e:{for(pe=K.key;q!==null;){if(q.key===pe)if(q.tag===4&&q.stateNode.containerInfo===K.containerInfo&&q.stateNode.implementation===K.implementation){a(X,q.sibling),ie=u(q,K.children||[]),ie.return=X,X=ie;break e}else{a(X,q);break}else t(X,q);q=q.sibling}ie=Eu(K,X.mode,ie),ie.return=X,X=ie}return S(X);case H:return K=ka(K),Ye(X,q,K,ie)}if(k(K))return he(X,q,K,ie);if(P(K)){if(pe=P(K),typeof pe!="function")throw Error(s(150));return K=pe.call(K),ve(X,q,K,ie)}if(typeof K.then=="function")return Ye(X,q,us(K),ie);if(K.$$typeof===w)return Ye(X,q,is(X,K),ie);cs(X,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,q!==null&&q.tag===6?(a(X,q.sibling),ie=u(q,K),ie.return=X,X=ie):(a(X,q),ie=wu(K,X.mode,ie),ie.return=X,X=ie),S(X)):a(X,q)}return function(X,q,K,ie){try{Ci=0;var pe=Ye(X,q,K,ie);return zl=null,pe}catch(ge){if(ge===Ml||ge===ss)throw ge;var Oe=Rt(29,ge,null,X.mode);return Oe.lanes=ie,Oe.return=X,Oe}}}var Xa=rh(!0),uh=rh(!1),na=!1;function Hu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Uu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function aa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function la(e,t,a){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(He&2)!==0){var u=i.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),i.pending=t,t=ts(e),Zd(e,null,a),t}return es(e,i,t,a),ts(e)}function zi(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,a|=i,t.lanes=a,Oo(e,a)}}function Lu(e,t){var a=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,a===i)){var u=null,f=null;if(a=a.firstBaseUpdate,a!==null){do{var S={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};f===null?u=f=S:f=f.next=S,a=a.next}while(a!==null);f===null?u=f=t:f=f.next=t}else u=f=t;a={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:i.shared,callbacks:i.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Bu=!1;function Di(){if(Bu){var e=Cl;if(e!==null)throw e}}function Ri(e,t,a,i){Bu=!1;var u=e.updateQueue;na=!1;var f=u.firstBaseUpdate,S=u.lastBaseUpdate,E=u.shared.pending;if(E!==null){u.shared.pending=null;var O=E,F=O.next;O.next=null,S===null?f=F:S.next=F,S=O;var le=e.alternate;le!==null&&(le=le.updateQueue,E=le.lastBaseUpdate,E!==S&&(E===null?le.firstBaseUpdate=F:E.next=F,le.lastBaseUpdate=O))}if(f!==null){var se=u.baseState;S=0,le=F=O=null,E=f;do{var J=E.lane&-536870913,W=J!==E.lane;if(W?(Me&J)===J:(i&J)===J){J!==0&&J===Tl&&(Bu=!0),le!==null&&(le=le.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var he=e,ve=E;J=t;var Ye=a;switch(ve.tag){case 1:if(he=ve.payload,typeof he=="function"){se=he.call(Ye,se,J);break e}se=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=ve.payload,J=typeof he=="function"?he.call(Ye,se,J):he,J==null)break e;se=y({},se,J);break e;case 2:na=!0}}J=E.callback,J!==null&&(e.flags|=64,W&&(e.flags|=8192),W=u.callbacks,W===null?u.callbacks=[J]:W.push(J))}else W={lane:J,tag:E.tag,payload:E.payload,callback:E.callback,next:null},le===null?(F=le=W,O=se):le=le.next=W,S|=J;if(E=E.next,E===null){if(E=u.shared.pending,E===null)break;W=E,E=W.next,W.next=null,u.lastBaseUpdate=W,u.shared.pending=null}}while(!0);le===null&&(O=se),u.baseState=O,u.firstBaseUpdate=F,u.lastBaseUpdate=le,f===null&&(u.shared.lanes=0),ua|=S,e.lanes=S,e.memoizedState=se}}function ch(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function fh(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)ch(a[e],t)}var Dl=C(null),fs=C(0);function dh(e,t){e=Ln,ee(fs,e),ee(Dl,t),Ln=e|t.baseLanes}function qu(){ee(fs,Ln),ee(Dl,Dl.current)}function Iu(){Ln=fs.current,B(Dl),B(fs)}var Ot=C(null),Xt=null;function ia(e){var t=e.alternate;ee(Pe,Pe.current&1),ee(Ot,e),Xt===null&&(t===null||Dl.current!==null||t.memoizedState!==null)&&(Xt=e)}function Gu(e){ee(Pe,Pe.current),ee(Ot,e),Xt===null&&(Xt=e)}function hh(e){e.tag===22?(ee(Pe,Pe.current),ee(Ot,e),Xt===null&&(Xt=e)):oa()}function oa(){ee(Pe,Pe.current),ee(Ot,Ot.current)}function jt(e){B(Ot),Xt===e&&(Xt=null),B(Pe)}var Pe=C(0);function ds(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||$c(a)||Qc(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Mn=0,we=null,Ie=null,nt=null,hs=!1,Rl=!1,Za=!1,gs=0,Oi=0,Ol=null,x1=0;function Fe(){throw Error(s(321))}function Yu(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Dt(e[a],t[a]))return!1;return!0}function ku(e,t,a,i,u,f){return Mn=f,we=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?Fh:lc,Za=!1,f=a(i,u),Za=!1,Rl&&(f=mh(t,a,i,u)),gh(e),f}function gh(e){A.H=Ui;var t=Ie!==null&&Ie.next!==null;if(Mn=0,nt=Ie=we=null,hs=!1,Oi=0,Ol=null,t)throw Error(s(300));e===null||at||(e=e.dependencies,e!==null&&ls(e)&&(at=!0))}function mh(e,t,a,i){we=e;var u=0;do{if(Rl&&(Ol=null),Oi=0,Rl=!1,25<=u)throw Error(s(301));if(u+=1,nt=Ie=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}A.H=Jh,f=t(a,i)}while(Rl);return f}function w1(){var e=A.H,t=e.useState()[0];return t=typeof t.then=="function"?ji(t):t,e=e.useState()[0],(Ie!==null?Ie.memoizedState:null)!==e&&(we.flags|=1024),t}function Vu(){var e=gs!==0;return gs=0,e}function Xu(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Zu(e){if(hs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}hs=!1}Mn=0,nt=Ie=we=null,Rl=!1,Oi=gs=0,Ol=null}function bt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nt===null?we.memoizedState=nt=e:nt=nt.next=e,nt}function We(){if(Ie===null){var e=we.alternate;e=e!==null?e.memoizedState:null}else e=Ie.next;var t=nt===null?we.memoizedState:nt.next;if(t!==null)nt=t,Ie=e;else{if(e===null)throw we.alternate===null?Error(s(467)):Error(s(310));Ie=e,e={memoizedState:Ie.memoizedState,baseState:Ie.baseState,baseQueue:Ie.baseQueue,queue:Ie.queue,next:null},nt===null?we.memoizedState=nt=e:nt=nt.next=e}return nt}function ms(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ji(e){var t=Oi;return Oi+=1,Ol===null&&(Ol=[]),e=ih(Ol,e,t),t=we,(nt===null?t.memoizedState:nt.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?Fh:lc),e}function ps(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ji(e);if(e.$$typeof===w)return ht(e)}throw Error(s(438,String(e)))}function $u(e){var t=null,a=we.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var i=we.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=ms(),we.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),i=0;i<e;i++)a[i]=V;return t.index++,a}function zn(e,t){return typeof t=="function"?t(e):t}function ys(e){var t=We();return Qu(t,Ie,e)}function Qu(e,t,a){var i=e.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=a;var u=e.baseQueue,f=i.pending;if(f!==null){if(u!==null){var S=u.next;u.next=f.next,f.next=S}t.baseQueue=u=f,i.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var E=S=null,O=null,F=t,le=!1;do{var se=F.lane&-536870913;if(se!==F.lane?(Me&se)===se:(Mn&se)===se){var J=F.revertLane;if(J===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),se===Tl&&(le=!0);else if((Mn&J)===J){F=F.next,J===Tl&&(le=!0);continue}else se={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},O===null?(E=O=se,S=f):O=O.next=se,we.lanes|=J,ua|=J;se=F.action,Za&&a(f,se),f=F.hasEagerState?F.eagerState:a(f,se)}else J={lane:se,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},O===null?(E=O=J,S=f):O=O.next=J,we.lanes|=se,ua|=se;F=F.next}while(F!==null&&F!==t);if(O===null?S=f:O.next=E,!Dt(f,e.memoizedState)&&(at=!0,le&&(a=Cl,a!==null)))throw a;e.memoizedState=f,e.baseState=S,e.baseQueue=O,i.lastRenderedState=f}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Ku(e){var t=We(),a=t.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=e;var i=a.dispatch,u=a.pending,f=t.memoizedState;if(u!==null){a.pending=null;var S=u=u.next;do f=e(f,S.action),S=S.next;while(S!==u);Dt(f,t.memoizedState)||(at=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),a.lastRenderedState=f}return[f,i]}function ph(e,t,a){var i=we,u=We(),f=De;if(f){if(a===void 0)throw Error(s(407));a=a()}else a=t();var S=!Dt((Ie||u).memoizedState,a);if(S&&(u.memoizedState=a,at=!0),u=u.queue,Pu(Sh.bind(null,i,u,e),[e]),u.getSnapshot!==t||S||nt!==null&&nt.memoizedState.tag&1){if(i.flags|=2048,jl(9,{destroy:void 0},vh.bind(null,i,u,a,t),null),ke===null)throw Error(s(349));f||(Mn&127)!==0||yh(i,t,a)}return a}function yh(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=we.updateQueue,t===null?(t=ms(),we.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function vh(e,t,a,i){t.value=a,t.getSnapshot=i,bh(t)&&xh(e)}function Sh(e,t,a){return a(function(){bh(t)&&xh(e)})}function bh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Dt(e,a)}catch{return!0}}function xh(e){var t=La(e,2);t!==null&&Ct(t,e,2)}function Fu(e){var t=bt();if(typeof e=="function"){var a=e;if(e=a(),Za){on(!0);try{a()}finally{on(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:e},t}function wh(e,t,a,i){return e.baseState=a,Qu(e,Ie,typeof i=="function"?i:zn)}function E1(e,t,a,i,u){if(bs(e))throw Error(s(485));if(e=t.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){f.listeners.push(S)}};A.T!==null?a(!0):f.isTransition=!1,i(f),a=t.pending,a===null?(f.next=t.pending=f,Eh(t,f)):(f.next=a.next,t.pending=a.next=f)}}function Eh(e,t){var a=t.action,i=t.payload,u=e.state;if(t.isTransition){var f=A.T,S={};A.T=S;try{var E=a(u,i),O=A.S;O!==null&&O(S,E),_h(e,t,E)}catch(F){Ju(e,t,F)}finally{f!==null&&S.types!==null&&(f.types=S.types),A.T=f}}else try{f=a(u,i),_h(e,t,f)}catch(F){Ju(e,t,F)}}function _h(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(i){Nh(e,t,i)},function(i){return Ju(e,t,i)}):Nh(e,t,a)}function Nh(e,t,a){t.status="fulfilled",t.value=a,Ah(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Eh(e,a)))}function Ju(e,t,a){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=a,Ah(t),t=t.next;while(t!==i)}e.action=null}function Ah(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Th(e,t){return t}function Ch(e,t){if(De){var a=ke.formState;if(a!==null){e:{var i=we;if(De){if(Ve){t:{for(var u=Ve,f=Vt;u.nodeType!==8;){if(!f){u=null;break t}if(u=Zt(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){Ve=Zt(u.nextSibling),i=u.data==="F!";break e}}ea(i)}i=!1}i&&(t=a[0])}}return a=bt(),a.memoizedState=a.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Th,lastRenderedState:t},a.queue=i,a=$h.bind(null,we,i),i.dispatch=a,i=Fu(!1),f=ac.bind(null,we,!1,i.queue),i=bt(),u={state:t,dispatch:null,action:e,pending:null},i.queue=u,a=E1.bind(null,we,u,f,a),u.dispatch=a,i.memoizedState=e,[t,a,!1]}function Mh(e){var t=We();return zh(t,Ie,e)}function zh(e,t,a){if(t=Qu(e,t,Th)[0],e=ys(zn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=ji(t)}catch(S){throw S===Ml?ss:S}else i=t;t=We();var u=t.queue,f=u.dispatch;return a!==t.memoizedState&&(we.flags|=2048,jl(9,{destroy:void 0},_1.bind(null,u,a),null)),[i,f,e]}function _1(e,t){e.action=t}function Dh(e){var t=We(),a=Ie;if(a!==null)return zh(t,a,e);We(),t=t.memoizedState,a=We();var i=a.queue.dispatch;return a.memoizedState=e,[t,i,!1]}function jl(e,t,a,i){return e={tag:e,create:a,deps:i,inst:t,next:null},t=we.updateQueue,t===null&&(t=ms(),we.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(i=a.next,a.next=e,e.next=i,t.lastEffect=e),e}function Rh(){return We().memoizedState}function vs(e,t,a,i){var u=bt();we.flags|=e,u.memoizedState=jl(1|t,{destroy:void 0},a,i===void 0?null:i)}function Ss(e,t,a,i){var u=We();i=i===void 0?null:i;var f=u.memoizedState.inst;Ie!==null&&i!==null&&Yu(i,Ie.memoizedState.deps)?u.memoizedState=jl(t,f,a,i):(we.flags|=e,u.memoizedState=jl(1|t,f,a,i))}function Oh(e,t){vs(8390656,8,e,t)}function Pu(e,t){Ss(2048,8,e,t)}function N1(e){we.flags|=4;var t=we.updateQueue;if(t===null)t=ms(),we.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function jh(e){var t=We().memoizedState;return N1({ref:t,nextImpl:e}),function(){if((He&2)!==0)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function Hh(e,t){return Ss(4,2,e,t)}function Uh(e,t){return Ss(4,4,e,t)}function Lh(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Bh(e,t,a){a=a!=null?a.concat([e]):null,Ss(4,4,Lh.bind(null,t,e),a)}function Wu(){}function qh(e,t){var a=We();t=t===void 0?null:t;var i=a.memoizedState;return t!==null&&Yu(t,i[1])?i[0]:(a.memoizedState=[e,t],e)}function Ih(e,t){var a=We();t=t===void 0?null:t;var i=a.memoizedState;if(t!==null&&Yu(t,i[1]))return i[0];if(i=e(),Za){on(!0);try{e()}finally{on(!1)}}return a.memoizedState=[i,t],i}function ec(e,t,a){return a===void 0||(Mn&1073741824)!==0&&(Me&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Gg(),we.lanes|=e,ua|=e,a)}function Gh(e,t,a,i){return Dt(a,t)?a:Dl.current!==null?(e=ec(e,a,i),Dt(e,t)||(at=!0),e):(Mn&42)===0||(Mn&1073741824)!==0&&(Me&261930)===0?(at=!0,e.memoizedState=a):(e=Gg(),we.lanes|=e,ua|=e,t)}function Yh(e,t,a,i,u){var f=j.p;j.p=f!==0&&8>f?f:8;var S=A.T,E={};A.T=E,ac(e,!1,t,a);try{var O=u(),F=A.S;if(F!==null&&F(E,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var le=b1(O,i);Hi(e,t,le,Lt(e))}else Hi(e,t,i,Lt(e))}catch(se){Hi(e,t,{then:function(){},status:"rejected",reason:se},Lt())}finally{j.p=f,S!==null&&E.types!==null&&(S.types=E.types),A.T=S}}function A1(){}function tc(e,t,a,i){if(e.tag!==5)throw Error(s(476));var u=kh(e).queue;Yh(e,u,t,I,a===null?A1:function(){return Vh(e),a(i)})}function kh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:I},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Vh(e){var t=kh(e);t.next===null&&(t=e.alternate.memoizedState),Hi(e,t.next.queue,{},Lt())}function nc(){return ht(Pi)}function Xh(){return We().memoizedState}function Zh(){return We().memoizedState}function T1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Lt();e=aa(a);var i=la(t,e,a);i!==null&&(Ct(i,t,a),zi(i,t,a)),t={cache:Du()},e.payload=t;return}t=t.return}}function C1(e,t,a){var i=Lt();a={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},bs(e)?Qh(t,a):(a=bu(e,t,a,i),a!==null&&(Ct(a,e,i),Kh(a,t,i)))}function $h(e,t,a){var i=Lt();Hi(e,t,a,i)}function Hi(e,t,a,i){var u={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(bs(e))Qh(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var S=t.lastRenderedState,E=f(S,a);if(u.hasEagerState=!0,u.eagerState=E,Dt(E,S))return es(e,t,u,0),ke===null&&Wo(),!1}catch{}if(a=bu(e,t,u,i),a!==null)return Ct(a,e,i),Kh(a,t,i),!0}return!1}function ac(e,t,a,i){if(i={lane:2,revertLane:Hc(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},bs(e)){if(t)throw Error(s(479))}else t=bu(e,a,i,2),t!==null&&Ct(t,e,2)}function bs(e){var t=e.alternate;return e===we||t!==null&&t===we}function Qh(e,t){Rl=hs=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Kh(e,t,a){if((a&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,a|=i,t.lanes=a,Oo(e,a)}}var Ui={readContext:ht,use:ps,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useLayoutEffect:Fe,useInsertionEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useSyncExternalStore:Fe,useId:Fe,useHostTransitionStatus:Fe,useFormState:Fe,useActionState:Fe,useOptimistic:Fe,useMemoCache:Fe,useCacheRefresh:Fe};Ui.useEffectEvent=Fe;var Fh={readContext:ht,use:ps,useCallback:function(e,t){return bt().memoizedState=[e,t===void 0?null:t],e},useContext:ht,useEffect:Oh,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,vs(4194308,4,Lh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return vs(4194308,4,e,t)},useInsertionEffect:function(e,t){vs(4,2,e,t)},useMemo:function(e,t){var a=bt();t=t===void 0?null:t;var i=e();if(Za){on(!0);try{e()}finally{on(!1)}}return a.memoizedState=[i,t],i},useReducer:function(e,t,a){var i=bt();if(a!==void 0){var u=a(t);if(Za){on(!0);try{a(t)}finally{on(!1)}}}else u=t;return i.memoizedState=i.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},i.queue=e,e=e.dispatch=C1.bind(null,we,e),[i.memoizedState,e]},useRef:function(e){var t=bt();return e={current:e},t.memoizedState=e},useState:function(e){e=Fu(e);var t=e.queue,a=$h.bind(null,we,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Wu,useDeferredValue:function(e,t){var a=bt();return ec(a,e,t)},useTransition:function(){var e=Fu(!1);return e=Yh.bind(null,we,e.queue,!0,!1),bt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var i=we,u=bt();if(De){if(a===void 0)throw Error(s(407));a=a()}else{if(a=t(),ke===null)throw Error(s(349));(Me&127)!==0||yh(i,t,a)}u.memoizedState=a;var f={value:a,getSnapshot:t};return u.queue=f,Oh(Sh.bind(null,i,f,e),[e]),i.flags|=2048,jl(9,{destroy:void 0},vh.bind(null,i,f,a,t),null),a},useId:function(){var e=bt(),t=ke.identifierPrefix;if(De){var a=un,i=rn;a=(i&~(1<<32-St(i)-1)).toString(32)+a,t="_"+t+"R_"+a,a=gs++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=x1++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:nc,useFormState:Ch,useActionState:Ch,useOptimistic:function(e){var t=bt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=ac.bind(null,we,!0,a),a.dispatch=t,[e,t]},useMemoCache:$u,useCacheRefresh:function(){return bt().memoizedState=T1.bind(null,we)},useEffectEvent:function(e){var t=bt(),a={impl:e};return t.memoizedState=a,function(){if((He&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},lc={readContext:ht,use:ps,useCallback:qh,useContext:ht,useEffect:Pu,useImperativeHandle:Bh,useInsertionEffect:Hh,useLayoutEffect:Uh,useMemo:Ih,useReducer:ys,useRef:Rh,useState:function(){return ys(zn)},useDebugValue:Wu,useDeferredValue:function(e,t){var a=We();return Gh(a,Ie.memoizedState,e,t)},useTransition:function(){var e=ys(zn)[0],t=We().memoizedState;return[typeof e=="boolean"?e:ji(e),t]},useSyncExternalStore:ph,useId:Xh,useHostTransitionStatus:nc,useFormState:Mh,useActionState:Mh,useOptimistic:function(e,t){var a=We();return wh(a,Ie,e,t)},useMemoCache:$u,useCacheRefresh:Zh};lc.useEffectEvent=jh;var Jh={readContext:ht,use:ps,useCallback:qh,useContext:ht,useEffect:Pu,useImperativeHandle:Bh,useInsertionEffect:Hh,useLayoutEffect:Uh,useMemo:Ih,useReducer:Ku,useRef:Rh,useState:function(){return Ku(zn)},useDebugValue:Wu,useDeferredValue:function(e,t){var a=We();return Ie===null?ec(a,e,t):Gh(a,Ie.memoizedState,e,t)},useTransition:function(){var e=Ku(zn)[0],t=We().memoizedState;return[typeof e=="boolean"?e:ji(e),t]},useSyncExternalStore:ph,useId:Xh,useHostTransitionStatus:nc,useFormState:Dh,useActionState:Dh,useOptimistic:function(e,t){var a=We();return Ie!==null?wh(a,Ie,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:$u,useCacheRefresh:Zh};Jh.useEffectEvent=jh;function ic(e,t,a,i){t=e.memoizedState,a=a(i,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var oc={enqueueSetState:function(e,t,a){e=e._reactInternals;var i=Lt(),u=aa(i);u.payload=t,a!=null&&(u.callback=a),t=la(e,u,i),t!==null&&(Ct(t,e,i),zi(t,e,i))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var i=Lt(),u=aa(i);u.tag=1,u.payload=t,a!=null&&(u.callback=a),t=la(e,u,i),t!==null&&(Ct(t,e,i),zi(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Lt(),i=aa(a);i.tag=2,t!=null&&(i.callback=t),t=la(e,i,a),t!==null&&(Ct(t,e,a),zi(t,e,a))}};function Ph(e,t,a,i,u,f,S){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,S):t.prototype&&t.prototype.isPureReactComponent?!wi(a,i)||!wi(u,f):!0}function Wh(e,t,a,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,i),t.state!==e&&oc.enqueueReplaceState(t,t.state,null)}function $a(e,t){var a=t;if("ref"in t){a={};for(var i in t)i!=="ref"&&(a[i]=t[i])}if(e=e.defaultProps){a===t&&(a=y({},a));for(var u in e)a[u]===void 0&&(a[u]=e[u])}return a}function eg(e){Po(e)}function tg(e){console.error(e)}function ng(e){Po(e)}function xs(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function ag(e,t,a){try{var i=e.onCaughtError;i(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function sc(e,t,a){return a=aa(a),a.tag=3,a.payload={element:null},a.callback=function(){xs(e,t)},a}function lg(e){return e=aa(e),e.tag=3,e}function ig(e,t,a,i){var u=a.type.getDerivedStateFromError;if(typeof u=="function"){var f=i.value;e.payload=function(){return u(f)},e.callback=function(){ag(t,a,i)}}var S=a.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(e.callback=function(){ag(t,a,i),typeof u!="function"&&(ca===null?ca=new Set([this]):ca.add(this));var E=i.stack;this.componentDidCatch(i.value,{componentStack:E!==null?E:""})})}function M1(e,t,a,i,u){if(a.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=a.alternate,t!==null&&Al(t,a,u,!0),a=Ot.current,a!==null){switch(a.tag){case 31:case 13:return Xt===null?Os():a.alternate===null&&Je===0&&(Je=3),a.flags&=-257,a.flags|=65536,a.lanes=u,i===rs?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([i]):t.add(i),Rc(e,i,u)),!1;case 22:return a.flags|=65536,i===rs?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([i]):a.add(i)),Rc(e,i,u)),!1}throw Error(s(435,a.tag))}return Rc(e,i,u),Os(),!1}if(De)return t=Ot.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,i!==Au&&(e=Error(s(422),{cause:i}),Ni(Gt(e,a)))):(i!==Au&&(t=Error(s(423),{cause:i}),Ni(Gt(t,a))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=Gt(i,a),u=sc(e.stateNode,i,u),Lu(e,u),Je!==4&&(Je=2)),!1;var f=Error(s(520),{cause:i});if(f=Gt(f,a),Vi===null?Vi=[f]:Vi.push(f),Je!==4&&(Je=2),t===null)return!0;i=Gt(i,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=u&-u,a.lanes|=e,e=sc(a.stateNode,i,e),Lu(a,e),!1;case 1:if(t=a.type,f=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(ca===null||!ca.has(f))))return a.flags|=65536,u&=-u,a.lanes|=u,u=lg(u),ig(u,e,a,i),Lu(a,u),!1}a=a.return}while(a!==null);return!1}var rc=Error(s(461)),at=!1;function gt(e,t,a,i){t.child=e===null?uh(t,null,a,i):Xa(t,e.child,a,i)}function og(e,t,a,i,u){a=a.render;var f=t.ref;if("ref"in i){var S={};for(var E in i)E!=="ref"&&(S[E]=i[E])}else S=i;return Ga(t),i=ku(e,t,a,S,f,u),E=Vu(),e!==null&&!at?(Xu(e,t,u),Dn(e,t,u)):(De&&E&&_u(t),t.flags|=1,gt(e,t,i,u),t.child)}function sg(e,t,a,i,u){if(e===null){var f=a.type;return typeof f=="function"&&!xu(f)&&f.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=f,rg(e,t,f,i,u)):(e=ns(a.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!pc(e,u)){var S=f.memoizedProps;if(a=a.compare,a=a!==null?a:wi,a(S,i)&&e.ref===t.ref)return Dn(e,t,u)}return t.flags|=1,e=Nn(f,i),e.ref=t.ref,e.return=t,t.child=e}function rg(e,t,a,i,u){if(e!==null){var f=e.memoizedProps;if(wi(f,i)&&e.ref===t.ref)if(at=!1,t.pendingProps=i=f,pc(e,u))(e.flags&131072)!==0&&(at=!0);else return t.lanes=e.lanes,Dn(e,t,u)}return uc(e,t,a,i,u)}function ug(e,t,a,i){var u=i.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|a:a,e!==null){for(i=t.child=e.child,u=0;i!==null;)u=u|i.lanes|i.childLanes,i=i.sibling;i=u&~f}else i=0,t.child=null;return cg(e,t,f,a,i)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&os(t,f!==null?f.cachePool:null),f!==null?dh(t,f):qu(),hh(t);else return i=t.lanes=536870912,cg(e,t,f!==null?f.baseLanes|a:a,a,i)}else f!==null?(os(t,f.cachePool),dh(t,f),oa(),t.memoizedState=null):(e!==null&&os(t,null),qu(),oa());return gt(e,t,u,a),t.child}function Li(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cg(e,t,a,i,u){var f=Ou();return f=f===null?null:{parent:tt._currentValue,pool:f},t.memoizedState={baseLanes:a,cachePool:f},e!==null&&os(t,null),qu(),hh(t),e!==null&&Al(e,t,i,!0),t.childLanes=u,null}function ws(e,t){return t=_s({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function fg(e,t,a){return Xa(t,e.child,null,a),e=ws(t,t.pendingProps),e.flags|=2,jt(t),t.memoizedState=null,e}function z1(e,t,a){var i=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(De){if(i.mode==="hidden")return e=ws(t,i),t.lanes=536870912,Li(null,e);if(Gu(t),(e=Ve)?(e=Em(e,Vt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Pn!==null?{id:rn,overflow:un}:null,retryLane:536870912,hydrationErrors:null},a=Qd(e),a.return=t,t.child=a,dt=t,Ve=null)):e=null,e===null)throw ea(t);return t.lanes=536870912,null}return ws(t,i)}var f=e.memoizedState;if(f!==null){var S=f.dehydrated;if(Gu(t),u)if(t.flags&256)t.flags&=-257,t=fg(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558));else if(at||Al(e,t,a,!1),u=(a&e.childLanes)!==0,at||u){if(i=ke,i!==null&&(S=jo(i,a),S!==0&&S!==f.retryLane))throw f.retryLane=S,La(e,S),Ct(i,e,S),rc;Os(),t=fg(e,t,a)}else e=f.treeContext,Ve=Zt(S.nextSibling),dt=t,De=!0,Wn=null,Vt=!1,e!==null&&Jd(t,e),t=ws(t,i),t.flags|=4096;return t}return e=Nn(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Es(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function uc(e,t,a,i,u){return Ga(t),a=ku(e,t,a,i,void 0,u),i=Vu(),e!==null&&!at?(Xu(e,t,u),Dn(e,t,u)):(De&&i&&_u(t),t.flags|=1,gt(e,t,a,u),t.child)}function dg(e,t,a,i,u,f){return Ga(t),t.updateQueue=null,a=mh(t,i,a,u),gh(e),i=Vu(),e!==null&&!at?(Xu(e,t,f),Dn(e,t,f)):(De&&i&&_u(t),t.flags|=1,gt(e,t,a,f),t.child)}function hg(e,t,a,i,u){if(Ga(t),t.stateNode===null){var f=wl,S=a.contextType;typeof S=="object"&&S!==null&&(f=ht(S)),f=new a(i,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=oc,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=i,f.state=t.memoizedState,f.refs={},Hu(t),S=a.contextType,f.context=typeof S=="object"&&S!==null?ht(S):wl,f.state=t.memoizedState,S=a.getDerivedStateFromProps,typeof S=="function"&&(ic(t,a,S,i),f.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(S=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),S!==f.state&&oc.enqueueReplaceState(f,f.state,null),Ri(t,i,f,u),Di(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){f=t.stateNode;var E=t.memoizedProps,O=$a(a,E);f.props=O;var F=f.context,le=a.contextType;S=wl,typeof le=="object"&&le!==null&&(S=ht(le));var se=a.getDerivedStateFromProps;le=typeof se=="function"||typeof f.getSnapshotBeforeUpdate=="function",E=t.pendingProps!==E,le||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(E||F!==S)&&Wh(t,f,i,S),na=!1;var J=t.memoizedState;f.state=J,Ri(t,i,f,u),Di(),F=t.memoizedState,E||J!==F||na?(typeof se=="function"&&(ic(t,a,se,i),F=t.memoizedState),(O=na||Ph(t,a,O,i,J,F,S))?(le||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=F),f.props=i,f.state=F,f.context=S,i=O):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,Uu(e,t),S=t.memoizedProps,le=$a(a,S),f.props=le,se=t.pendingProps,J=f.context,F=a.contextType,O=wl,typeof F=="object"&&F!==null&&(O=ht(F)),E=a.getDerivedStateFromProps,(F=typeof E=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S!==se||J!==O)&&Wh(t,f,i,O),na=!1,J=t.memoizedState,f.state=J,Ri(t,i,f,u),Di();var W=t.memoizedState;S!==se||J!==W||na||e!==null&&e.dependencies!==null&&ls(e.dependencies)?(typeof E=="function"&&(ic(t,a,E,i),W=t.memoizedState),(le=na||Ph(t,a,le,i,J,W,O)||e!==null&&e.dependencies!==null&&ls(e.dependencies))?(F||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,W,O),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,W,O)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||S===e.memoizedProps&&J===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&J===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=W),f.props=i,f.state=W,f.context=O,i=le):(typeof f.componentDidUpdate!="function"||S===e.memoizedProps&&J===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&J===e.memoizedState||(t.flags|=1024),i=!1)}return f=i,Es(e,t),i=(t.flags&128)!==0,f||i?(f=t.stateNode,a=i&&typeof a.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&i?(t.child=Xa(t,e.child,null,u),t.child=Xa(t,null,a,u)):gt(e,t,a,u),t.memoizedState=f.state,e=t.child):e=Dn(e,t,u),e}function gg(e,t,a,i){return qa(),t.flags|=256,gt(e,t,a,i),t.child}var cc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function fc(e){return{baseLanes:e,cachePool:ah()}}function dc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Ut),e}function mg(e,t,a){var i=t.pendingProps,u=!1,f=(t.flags&128)!==0,S;if((S=f)||(S=e!==null&&e.memoizedState===null?!1:(Pe.current&2)!==0),S&&(u=!0,t.flags&=-129),S=(t.flags&32)!==0,t.flags&=-33,e===null){if(De){if(u?ia(t):oa(),(e=Ve)?(e=Em(e,Vt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Pn!==null?{id:rn,overflow:un}:null,retryLane:536870912,hydrationErrors:null},a=Qd(e),a.return=t,t.child=a,dt=t,Ve=null)):e=null,e===null)throw ea(t);return Qc(e)?t.lanes=32:t.lanes=536870912,null}var E=i.children;return i=i.fallback,u?(oa(),u=t.mode,E=_s({mode:"hidden",children:E},u),i=Ba(i,u,a,null),E.return=t,i.return=t,E.sibling=i,t.child=E,i=t.child,i.memoizedState=fc(a),i.childLanes=dc(e,S,a),t.memoizedState=cc,Li(null,i)):(ia(t),hc(t,E))}var O=e.memoizedState;if(O!==null&&(E=O.dehydrated,E!==null)){if(f)t.flags&256?(ia(t),t.flags&=-257,t=gc(e,t,a)):t.memoizedState!==null?(oa(),t.child=e.child,t.flags|=128,t=null):(oa(),E=i.fallback,u=t.mode,i=_s({mode:"visible",children:i.children},u),E=Ba(E,u,a,null),E.flags|=2,i.return=t,E.return=t,i.sibling=E,t.child=i,Xa(t,e.child,null,a),i=t.child,i.memoizedState=fc(a),i.childLanes=dc(e,S,a),t.memoizedState=cc,t=Li(null,i));else if(ia(t),Qc(E)){if(S=E.nextSibling&&E.nextSibling.dataset,S)var F=S.dgst;S=F,i=Error(s(419)),i.stack="",i.digest=S,Ni({value:i,source:null,stack:null}),t=gc(e,t,a)}else if(at||Al(e,t,a,!1),S=(a&e.childLanes)!==0,at||S){if(S=ke,S!==null&&(i=jo(S,a),i!==0&&i!==O.retryLane))throw O.retryLane=i,La(e,i),Ct(S,e,i),rc;$c(E)||Os(),t=gc(e,t,a)}else $c(E)?(t.flags|=192,t.child=e.child,t=null):(e=O.treeContext,Ve=Zt(E.nextSibling),dt=t,De=!0,Wn=null,Vt=!1,e!==null&&Jd(t,e),t=hc(t,i.children),t.flags|=4096);return t}return u?(oa(),E=i.fallback,u=t.mode,O=e.child,F=O.sibling,i=Nn(O,{mode:"hidden",children:i.children}),i.subtreeFlags=O.subtreeFlags&65011712,F!==null?E=Nn(F,E):(E=Ba(E,u,a,null),E.flags|=2),E.return=t,i.return=t,i.sibling=E,t.child=i,Li(null,i),i=t.child,E=e.child.memoizedState,E===null?E=fc(a):(u=E.cachePool,u!==null?(O=tt._currentValue,u=u.parent!==O?{parent:O,pool:O}:u):u=ah(),E={baseLanes:E.baseLanes|a,cachePool:u}),i.memoizedState=E,i.childLanes=dc(e,S,a),t.memoizedState=cc,Li(e.child,i)):(ia(t),a=e.child,e=a.sibling,a=Nn(a,{mode:"visible",children:i.children}),a.return=t,a.sibling=null,e!==null&&(S=t.deletions,S===null?(t.deletions=[e],t.flags|=16):S.push(e)),t.child=a,t.memoizedState=null,a)}function hc(e,t){return t=_s({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function _s(e,t){return e=Rt(22,e,null,t),e.lanes=0,e}function gc(e,t,a){return Xa(t,e.child,null,a),e=hc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function pg(e,t,a){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Mu(e.return,t,a)}function mc(e,t,a,i,u,f){var S=e.memoizedState;S===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:a,tailMode:u,treeForkCount:f}:(S.isBackwards=t,S.rendering=null,S.renderingStartTime=0,S.last=i,S.tail=a,S.tailMode=u,S.treeForkCount=f)}function yg(e,t,a){var i=t.pendingProps,u=i.revealOrder,f=i.tail;i=i.children;var S=Pe.current,E=(S&2)!==0;if(E?(S=S&1|2,t.flags|=128):S&=1,ee(Pe,S),gt(e,t,i,a),i=De?_i:0,!E&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&pg(e,a,t);else if(e.tag===19)pg(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(a=t.child,u=null;a!==null;)e=a.alternate,e!==null&&ds(e)===null&&(u=a),a=a.sibling;a=u,a===null?(u=t.child,t.child=null):(u=a.sibling,a.sibling=null),mc(t,!1,u,a,f,i);break;case"backwards":case"unstable_legacy-backwards":for(a=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&ds(e)===null){t.child=u;break}e=u.sibling,u.sibling=a,a=u,u=e}mc(t,!0,a,null,f,i);break;case"together":mc(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function Dn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),ua|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Al(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,a=Nn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Nn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function pc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ls(e)))}function D1(e,t,a){switch(t.tag){case 3:re(t,t.stateNode.containerInfo),ta(t,tt,e.memoizedState.cache),qa();break;case 27:case 5:Ee(t);break;case 4:re(t,t.stateNode.containerInfo);break;case 10:ta(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Gu(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(ia(t),t.flags|=128,null):(a&t.child.childLanes)!==0?mg(e,t,a):(ia(t),e=Dn(e,t,a),e!==null?e.sibling:null);ia(t);break;case 19:var u=(e.flags&128)!==0;if(i=(a&t.childLanes)!==0,i||(Al(e,t,a,!1),i=(a&t.childLanes)!==0),u){if(i)return yg(e,t,a);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ee(Pe,Pe.current),i)break;return null;case 22:return t.lanes=0,ug(e,t,a,t.pendingProps);case 24:ta(t,tt,e.memoizedState.cache)}return Dn(e,t,a)}function vg(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)at=!0;else{if(!pc(e,a)&&(t.flags&128)===0)return at=!1,D1(e,t,a);at=(e.flags&131072)!==0}else at=!1,De&&(t.flags&1048576)!==0&&Fd(t,_i,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=ka(t.elementType),t.type=e,typeof e=="function")xu(e)?(i=$a(e,i),t.tag=1,t=hg(null,t,e,i,a)):(t.tag=0,t=uc(null,t,e,i,a));else{if(e!=null){var u=e.$$typeof;if(u===D){t.tag=11,t=og(null,t,e,i,a);break e}else if(u===L){t.tag=14,t=sg(null,t,e,i,a);break e}}throw t=z(e)||e,Error(s(306,t,""))}}return t;case 0:return uc(e,t,t.type,t.pendingProps,a);case 1:return i=t.type,u=$a(i,t.pendingProps),hg(e,t,i,u,a);case 3:e:{if(re(t,t.stateNode.containerInfo),e===null)throw Error(s(387));i=t.pendingProps;var f=t.memoizedState;u=f.element,Uu(e,t),Ri(t,i,null,a);var S=t.memoizedState;if(i=S.cache,ta(t,tt,i),i!==f.cache&&zu(t,[tt],a,!0),Di(),i=S.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:S.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=gg(e,t,i,a);break e}else if(i!==u){u=Gt(Error(s(424)),t),Ni(u),t=gg(e,t,i,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ve=Zt(e.firstChild),dt=t,De=!0,Wn=null,Vt=!0,a=uh(t,null,i,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(qa(),i===u){t=Dn(e,t,a);break e}gt(e,t,i,a)}t=t.child}return t;case 26:return Es(e,t),e===null?(a=Mm(t.type,null,t.pendingProps,null))?t.memoizedState=a:De||(a=t.type,e=t.pendingProps,i=Is(fe.current).createElement(a),i[ot]=t,i[pt]=e,mt(i,a,e),et(i),t.stateNode=i):t.memoizedState=Mm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ee(t),e===null&&De&&(i=t.stateNode=Am(t.type,t.pendingProps,fe.current),dt=t,Vt=!0,u=Ve,ga(t.type)?(Kc=u,Ve=Zt(i.firstChild)):Ve=u),gt(e,t,t.pendingProps.children,a),Es(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&De&&((u=i=Ve)&&(i=sS(i,t.type,t.pendingProps,Vt),i!==null?(t.stateNode=i,dt=t,Ve=Zt(i.firstChild),Vt=!1,u=!0):u=!1),u||ea(t)),Ee(t),u=t.type,f=t.pendingProps,S=e!==null?e.memoizedProps:null,i=f.children,Vc(u,f)?i=null:S!==null&&Vc(u,S)&&(t.flags|=32),t.memoizedState!==null&&(u=ku(e,t,w1,null,null,a),Pi._currentValue=u),Es(e,t),gt(e,t,i,a),t.child;case 6:return e===null&&De&&((e=a=Ve)&&(a=rS(a,t.pendingProps,Vt),a!==null?(t.stateNode=a,dt=t,Ve=null,e=!0):e=!1),e||ea(t)),null;case 13:return mg(e,t,a);case 4:return re(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Xa(t,null,i,a):gt(e,t,i,a),t.child;case 11:return og(e,t,t.type,t.pendingProps,a);case 7:return gt(e,t,t.pendingProps,a),t.child;case 8:return gt(e,t,t.pendingProps.children,a),t.child;case 12:return gt(e,t,t.pendingProps.children,a),t.child;case 10:return i=t.pendingProps,ta(t,t.type,i.value),gt(e,t,i.children,a),t.child;case 9:return u=t.type._context,i=t.pendingProps.children,Ga(t),u=ht(u),i=i(u),t.flags|=1,gt(e,t,i,a),t.child;case 14:return sg(e,t,t.type,t.pendingProps,a);case 15:return rg(e,t,t.type,t.pendingProps,a);case 19:return yg(e,t,a);case 31:return z1(e,t,a);case 22:return ug(e,t,a,t.pendingProps);case 24:return Ga(t),i=ht(tt),e===null?(u=Ou(),u===null&&(u=ke,f=Du(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=a),u=f),t.memoizedState={parent:i,cache:u},Hu(t),ta(t,tt,u)):((e.lanes&a)!==0&&(Uu(e,t),Ri(t,null,null,a),Di()),u=e.memoizedState,f=t.memoizedState,u.parent!==i?(u={parent:i,cache:i},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),ta(t,tt,i)):(i=f.cache,ta(t,tt,i),i!==u.cache&&zu(t,[tt],a,!0))),gt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function Rn(e){e.flags|=4}function yc(e,t,a,i,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(Xg())e.flags|=8192;else throw Va=rs,ju}else e.flags&=-16777217}function Sg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!jm(t))if(Xg())e.flags|=8192;else throw Va=rs,ju}function Ns(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Do():536870912,e.lanes|=t,Bl|=t)}function Bi(e,t){if(!De)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Xe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,i=0;if(t)for(var u=e.child;u!==null;)a|=u.lanes|u.childLanes,i|=u.subtreeFlags&65011712,i|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)a|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=a,t}function R1(e,t,a){var i=t.pendingProps;switch(Nu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(t),null;case 1:return Xe(t),null;case 3:return a=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Cn(tt),de(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Nl(t)?Rn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Tu())),Xe(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(Rn(t),f!==null?(Xe(t),Sg(t,f)):(Xe(t),yc(t,u,null,i,a))):f?f!==e.memoizedState?(Rn(t),Xe(t),Sg(t,f)):(Xe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Rn(t),Xe(t),yc(t,u,e,i,a)),null;case 27:if(xe(t),a=fe.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Rn(t);else{if(!i){if(t.stateNode===null)throw Error(s(166));return Xe(t),null}e=ae.current,Nl(t)?Pd(t):(e=Am(u,i,a),t.stateNode=e,Rn(t))}return Xe(t),null;case 5:if(xe(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Rn(t);else{if(!i){if(t.stateNode===null)throw Error(s(166));return Xe(t),null}if(f=ae.current,Nl(t))Pd(t);else{var S=Is(fe.current);switch(f){case 1:f=S.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=S.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=S.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=S.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=S.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof i.is=="string"?S.createElement("select",{is:i.is}):S.createElement("select"),i.multiple?f.multiple=!0:i.size&&(f.size=i.size);break;default:f=typeof i.is=="string"?S.createElement(u,{is:i.is}):S.createElement(u)}}f[ot]=t,f[pt]=i;e:for(S=t.child;S!==null;){if(S.tag===5||S.tag===6)f.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===t)break e;for(;S.sibling===null;){if(S.return===null||S.return===t)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}t.stateNode=f;e:switch(mt(f,u,i),u){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Rn(t)}}return Xe(t),yc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Rn(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(s(166));if(e=fe.current,Nl(t)){if(e=t.stateNode,a=t.memoizedProps,i=null,u=dt,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[ot]=t,e=!!(e.nodeValue===a||i!==null&&i.suppressHydrationWarning===!0||mm(e.nodeValue,a)),e||ea(t,!0)}else e=Is(e).createTextNode(i),e[ot]=t,t.stateNode=e}return Xe(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(i=Nl(t),a!==null){if(e===null){if(!i)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[ot]=t}else qa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Xe(t),e=!1}else a=Tu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(jt(t),t):(jt(t),null);if((t.flags&128)!==0)throw Error(s(558))}return Xe(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Nl(t),i!==null&&i.dehydrated!==null){if(e===null){if(!u)throw Error(s(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(s(317));u[ot]=t}else qa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Xe(t),u=!1}else u=Tu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(jt(t),t):(jt(t),null)}return jt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=i!==null,e=e!==null&&e.memoizedState!==null,a&&(i=t.child,u=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(u=i.alternate.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==u&&(i.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Ns(t,t.updateQueue),Xe(t),null);case 4:return de(),e===null&&qc(t.stateNode.containerInfo),Xe(t),null;case 10:return Cn(t.type),Xe(t),null;case 19:if(B(Pe),i=t.memoizedState,i===null)return Xe(t),null;if(u=(t.flags&128)!==0,f=i.rendering,f===null)if(u)Bi(i,!1);else{if(Je!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=ds(e),f!==null){for(t.flags|=128,Bi(i,!1),e=f.updateQueue,t.updateQueue=e,Ns(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)$d(a,e),a=a.sibling;return ee(Pe,Pe.current&1|2),De&&An(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&ft()>zs&&(t.flags|=128,u=!0,Bi(i,!1),t.lanes=4194304)}else{if(!u)if(e=ds(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Ns(t,e),Bi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!De)return Xe(t),null}else 2*ft()-i.renderingStartTime>zs&&a!==536870912&&(t.flags|=128,u=!0,Bi(i,!1),t.lanes=4194304);i.isBackwards?(f.sibling=t.child,t.child=f):(e=i.last,e!==null?e.sibling=f:t.child=f,i.last=f)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=ft(),e.sibling=null,a=Pe.current,ee(Pe,u?a&1|2:a&1),De&&An(t,i.treeForkCount),e):(Xe(t),null);case 22:case 23:return jt(t),Iu(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(a&536870912)!==0&&(t.flags&128)===0&&(Xe(t),t.subtreeFlags&6&&(t.flags|=8192)):Xe(t),a=t.updateQueue,a!==null&&Ns(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==a&&(t.flags|=2048),e!==null&&B(Ya),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Cn(tt),Xe(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function O1(e,t){switch(Nu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Cn(tt),de(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xe(t),null;case 31:if(t.memoizedState!==null){if(jt(t),t.alternate===null)throw Error(s(340));qa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(jt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));qa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(Pe),null;case 4:return de(),null;case 10:return Cn(t.type),null;case 22:case 23:return jt(t),Iu(),e!==null&&B(Ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Cn(tt),null;case 25:return null;default:return null}}function bg(e,t){switch(Nu(t),t.tag){case 3:Cn(tt),de();break;case 26:case 27:case 5:xe(t);break;case 4:de();break;case 31:t.memoizedState!==null&&jt(t);break;case 13:jt(t);break;case 19:B(Pe);break;case 10:Cn(t.type);break;case 22:case 23:jt(t),Iu(),e!==null&&B(Ya);break;case 24:Cn(tt)}}function qi(e,t){try{var a=t.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var u=i.next;a=u;do{if((a.tag&e)===e){i=void 0;var f=a.create,S=a.inst;i=f(),S.destroy=i}a=a.next}while(a!==u)}}catch(E){Be(t,t.return,E)}}function sa(e,t,a){try{var i=t.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var f=u.next;i=f;do{if((i.tag&e)===e){var S=i.inst,E=S.destroy;if(E!==void 0){S.destroy=void 0,u=t;var O=a,F=E;try{F()}catch(le){Be(u,O,le)}}}i=i.next}while(i!==f)}}catch(le){Be(t,t.return,le)}}function xg(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{fh(t,a)}catch(i){Be(e,e.return,i)}}}function wg(e,t,a){a.props=$a(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(i){Be(e,t,i)}}function Ii(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof a=="function"?e.refCleanup=a(i):a.current=i}}catch(u){Be(e,t,u)}}function cn(e,t){var a=e.ref,i=e.refCleanup;if(a!==null)if(typeof i=="function")try{i()}catch(u){Be(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){Be(e,t,u)}else a.current=null}function Eg(e){var t=e.type,a=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&i.focus();break e;case"img":a.src?i.src=a.src:a.srcSet&&(i.srcset=a.srcSet)}}catch(u){Be(e,e.return,u)}}function vc(e,t,a){try{var i=e.stateNode;tS(i,e.type,a,t),i[pt]=t}catch(u){Be(e,e.return,u)}}function _g(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ga(e.type)||e.tag===4}function Sc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_g(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ga(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function bc(e,t,a){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=En));else if(i!==4&&(i===27&&ga(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(bc(e,t,a),e=e.sibling;e!==null;)bc(e,t,a),e=e.sibling}function As(e,t,a){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(i!==4&&(i===27&&ga(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(As(e,t,a),e=e.sibling;e!==null;)As(e,t,a),e=e.sibling}function Ng(e){var t=e.stateNode,a=e.memoizedProps;try{for(var i=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);mt(t,i,a),t[ot]=e,t[pt]=a}catch(f){Be(e,e.return,f)}}var On=!1,lt=!1,xc=!1,Ag=typeof WeakSet=="function"?WeakSet:Set,ut=null;function j1(e,t){if(e=e.containerInfo,Yc=$s,e=Bd(e),gu(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var i=a.getSelection&&a.getSelection();if(i&&i.rangeCount!==0){a=i.anchorNode;var u=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{a.nodeType,f.nodeType}catch{a=null;break e}var S=0,E=-1,O=-1,F=0,le=0,se=e,J=null;t:for(;;){for(var W;se!==a||u!==0&&se.nodeType!==3||(E=S+u),se!==f||i!==0&&se.nodeType!==3||(O=S+i),se.nodeType===3&&(S+=se.nodeValue.length),(W=se.firstChild)!==null;)J=se,se=W;for(;;){if(se===e)break t;if(J===a&&++F===u&&(E=S),J===f&&++le===i&&(O=S),(W=se.nextSibling)!==null)break;se=J,J=se.parentNode}se=W}a=E===-1||O===-1?null:{start:E,end:O}}else a=null}a=a||{start:0,end:0}}else a=null;for(kc={focusedElem:e,selectionRange:a},$s=!1,ut=t;ut!==null;)if(t=ut,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ut=e;else for(;ut!==null;){switch(t=ut,f=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)u=e[a],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,a=t,u=f.memoizedProps,f=f.memoizedState,i=a.stateNode;try{var he=$a(a.type,u);e=i.getSnapshotBeforeUpdate(he,f),i.__reactInternalSnapshotBeforeUpdate=e}catch(ve){Be(a,a.return,ve)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Zc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Zc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=t.sibling,e!==null){e.return=t.return,ut=e;break}ut=t.return}}function Tg(e,t,a){var i=a.flags;switch(a.tag){case 0:case 11:case 15:Hn(e,a),i&4&&qi(5,a);break;case 1:if(Hn(e,a),i&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(S){Be(a,a.return,S)}else{var u=$a(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(S){Be(a,a.return,S)}}i&64&&xg(a),i&512&&Ii(a,a.return);break;case 3:if(Hn(e,a),i&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{fh(e,t)}catch(S){Be(a,a.return,S)}}break;case 27:t===null&&i&4&&Ng(a);case 26:case 5:Hn(e,a),t===null&&i&4&&Eg(a),i&512&&Ii(a,a.return);break;case 12:Hn(e,a);break;case 31:Hn(e,a),i&4&&zg(e,a);break;case 13:Hn(e,a),i&4&&Dg(e,a),i&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=k1.bind(null,a),uS(e,a))));break;case 22:if(i=a.memoizedState!==null||On,!i){t=t!==null&&t.memoizedState!==null||lt,u=On;var f=lt;On=i,(lt=t)&&!f?Un(e,a,(a.subtreeFlags&8772)!==0):Hn(e,a),On=u,lt=f}break;case 30:break;default:Hn(e,a)}}function Cg(e){var t=e.alternate;t!==null&&(e.alternate=null,Cg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&di(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ze=null,_t=!1;function jn(e,t,a){for(a=a.child;a!==null;)Mg(e,t,a),a=a.sibling}function Mg(e,t,a){if(vt&&typeof vt.onCommitFiberUnmount=="function")try{vt.onCommitFiberUnmount(Ca,a)}catch{}switch(a.tag){case 26:lt||cn(a,t),jn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:lt||cn(a,t);var i=Ze,u=_t;ga(a.type)&&(Ze=a.stateNode,_t=!1),jn(e,t,a),Ki(a.stateNode),Ze=i,_t=u;break;case 5:lt||cn(a,t);case 6:if(i=Ze,u=_t,Ze=null,jn(e,t,a),Ze=i,_t=u,Ze!==null)if(_t)try{(Ze.nodeType===9?Ze.body:Ze.nodeName==="HTML"?Ze.ownerDocument.body:Ze).removeChild(a.stateNode)}catch(f){Be(a,t,f)}else try{Ze.removeChild(a.stateNode)}catch(f){Be(a,t,f)}break;case 18:Ze!==null&&(_t?(e=Ze,xm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Zl(e)):xm(Ze,a.stateNode));break;case 4:i=Ze,u=_t,Ze=a.stateNode.containerInfo,_t=!0,jn(e,t,a),Ze=i,_t=u;break;case 0:case 11:case 14:case 15:sa(2,a,t),lt||sa(4,a,t),jn(e,t,a);break;case 1:lt||(cn(a,t),i=a.stateNode,typeof i.componentWillUnmount=="function"&&wg(a,t,i)),jn(e,t,a);break;case 21:jn(e,t,a);break;case 22:lt=(i=lt)||a.memoizedState!==null,jn(e,t,a),lt=i;break;default:jn(e,t,a)}}function zg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Zl(e)}catch(a){Be(t,t.return,a)}}}function Dg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Zl(e)}catch(a){Be(t,t.return,a)}}function H1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ag),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ag),t;default:throw Error(s(435,e.tag))}}function Ts(e,t){var a=H1(e);t.forEach(function(i){if(!a.has(i)){a.add(i);var u=V1.bind(null,e,i);i.then(u,u)}})}function Nt(e,t){var a=t.deletions;if(a!==null)for(var i=0;i<a.length;i++){var u=a[i],f=e,S=t,E=S;e:for(;E!==null;){switch(E.tag){case 27:if(ga(E.type)){Ze=E.stateNode,_t=!1;break e}break;case 5:Ze=E.stateNode,_t=!1;break e;case 3:case 4:Ze=E.stateNode.containerInfo,_t=!0;break e}E=E.return}if(Ze===null)throw Error(s(160));Mg(f,S,u),Ze=null,_t=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Rg(t,e),t=t.sibling}var Pt=null;function Rg(e,t){var a=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Nt(t,e),At(e),i&4&&(sa(3,e,e.return),qi(3,e),sa(5,e,e.return));break;case 1:Nt(t,e),At(e),i&512&&(lt||a===null||cn(a,a.return)),i&64&&On&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?i:a.concat(i))));break;case 26:var u=Pt;if(Nt(t,e),At(e),i&512&&(lt||a===null||cn(a,a.return)),i&4){var f=a!==null?a.memoizedState:null;if(i=e.memoizedState,a===null)if(i===null)if(e.stateNode===null){e:{i=e.type,a=e.memoizedProps,u=u.ownerDocument||u;t:switch(i){case"title":f=u.getElementsByTagName("title")[0],(!f||f[Da]||f[ot]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(i),u.head.insertBefore(f,u.querySelector("head > title"))),mt(f,i,a),f[ot]=e,et(f),i=f;break e;case"link":var S=Rm("link","href",u).get(i+(a.href||""));if(S){for(var E=0;E<S.length;E++)if(f=S[E],f.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&f.getAttribute("rel")===(a.rel==null?null:a.rel)&&f.getAttribute("title")===(a.title==null?null:a.title)&&f.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){S.splice(E,1);break t}}f=u.createElement(i),mt(f,i,a),u.head.appendChild(f);break;case"meta":if(S=Rm("meta","content",u).get(i+(a.content||""))){for(E=0;E<S.length;E++)if(f=S[E],f.getAttribute("content")===(a.content==null?null:""+a.content)&&f.getAttribute("name")===(a.name==null?null:a.name)&&f.getAttribute("property")===(a.property==null?null:a.property)&&f.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&f.getAttribute("charset")===(a.charSet==null?null:a.charSet)){S.splice(E,1);break t}}f=u.createElement(i),mt(f,i,a),u.head.appendChild(f);break;default:throw Error(s(468,i))}f[ot]=e,et(f),i=f}e.stateNode=i}else Om(u,e.type,e.stateNode);else e.stateNode=Dm(u,i,e.memoizedProps);else f!==i?(f===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):f.count--,i===null?Om(u,e.type,e.stateNode):Dm(u,i,e.memoizedProps)):i===null&&e.stateNode!==null&&vc(e,e.memoizedProps,a.memoizedProps)}break;case 27:Nt(t,e),At(e),i&512&&(lt||a===null||cn(a,a.return)),a!==null&&i&4&&vc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Nt(t,e),At(e),i&512&&(lt||a===null||cn(a,a.return)),e.flags&32){u=e.stateNode;try{ml(u,"")}catch(he){Be(e,e.return,he)}}i&4&&e.stateNode!=null&&(u=e.memoizedProps,vc(e,u,a!==null?a.memoizedProps:u)),i&1024&&(xc=!0);break;case 6:if(Nt(t,e),At(e),i&4){if(e.stateNode===null)throw Error(s(162));i=e.memoizedProps,a=e.stateNode;try{a.nodeValue=i}catch(he){Be(e,e.return,he)}}break;case 3:if(ks=null,u=Pt,Pt=Gs(t.containerInfo),Nt(t,e),Pt=u,At(e),i&4&&a!==null&&a.memoizedState.isDehydrated)try{Zl(t.containerInfo)}catch(he){Be(e,e.return,he)}xc&&(xc=!1,Og(e));break;case 4:i=Pt,Pt=Gs(e.stateNode.containerInfo),Nt(t,e),At(e),Pt=i;break;case 12:Nt(t,e),At(e);break;case 31:Nt(t,e),At(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Ts(e,i)));break;case 13:Nt(t,e),At(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ms=ft()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Ts(e,i)));break;case 22:u=e.memoizedState!==null;var O=a!==null&&a.memoizedState!==null,F=On,le=lt;if(On=F||u,lt=le||O,Nt(t,e),lt=le,On=F,At(e),i&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(a===null||O||On||lt||Qa(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){O=a=t;try{if(f=O.stateNode,u)S=f.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{E=O.stateNode;var se=O.memoizedProps.style,J=se!=null&&se.hasOwnProperty("display")?se.display:null;E.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(he){Be(O,O.return,he)}}}else if(t.tag===6){if(a===null){O=t;try{O.stateNode.nodeValue=u?"":O.memoizedProps}catch(he){Be(O,O.return,he)}}}else if(t.tag===18){if(a===null){O=t;try{var W=O.stateNode;u?wm(W,!0):wm(O.stateNode,!1)}catch(he){Be(O,O.return,he)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(a=i.retryQueue,a!==null&&(i.retryQueue=null,Ts(e,a))));break;case 19:Nt(t,e),At(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Ts(e,i)));break;case 30:break;case 21:break;default:Nt(t,e),At(e)}}function At(e){var t=e.flags;if(t&2){try{for(var a,i=e.return;i!==null;){if(_g(i)){a=i;break}i=i.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var u=a.stateNode,f=Sc(e);As(e,f,u);break;case 5:var S=a.stateNode;a.flags&32&&(ml(S,""),a.flags&=-33);var E=Sc(e);As(e,E,S);break;case 3:case 4:var O=a.stateNode.containerInfo,F=Sc(e);bc(e,F,O);break;default:throw Error(s(161))}}catch(le){Be(e,e.return,le)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Og(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Og(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Hn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Tg(e,t.alternate,t),t=t.sibling}function Qa(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:sa(4,t,t.return),Qa(t);break;case 1:cn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&wg(t,t.return,a),Qa(t);break;case 27:Ki(t.stateNode);case 26:case 5:cn(t,t.return),Qa(t);break;case 22:t.memoizedState===null&&Qa(t);break;case 30:Qa(t);break;default:Qa(t)}e=e.sibling}}function Un(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,u=e,f=t,S=f.flags;switch(f.tag){case 0:case 11:case 15:Un(u,f,a),qi(4,f);break;case 1:if(Un(u,f,a),i=f,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(F){Be(i,i.return,F)}if(i=f,u=i.updateQueue,u!==null){var E=i.stateNode;try{var O=u.shared.hiddenCallbacks;if(O!==null)for(u.shared.hiddenCallbacks=null,u=0;u<O.length;u++)ch(O[u],E)}catch(F){Be(i,i.return,F)}}a&&S&64&&xg(f),Ii(f,f.return);break;case 27:Ng(f);case 26:case 5:Un(u,f,a),a&&i===null&&S&4&&Eg(f),Ii(f,f.return);break;case 12:Un(u,f,a);break;case 31:Un(u,f,a),a&&S&4&&zg(u,f);break;case 13:Un(u,f,a),a&&S&4&&Dg(u,f);break;case 22:f.memoizedState===null&&Un(u,f,a),Ii(f,f.return);break;case 30:break;default:Un(u,f,a)}t=t.sibling}}function wc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Ai(a))}function Ec(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ai(e))}function Wt(e,t,a,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)jg(e,t,a,i),t=t.sibling}function jg(e,t,a,i){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Wt(e,t,a,i),u&2048&&qi(9,t);break;case 1:Wt(e,t,a,i);break;case 3:Wt(e,t,a,i),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ai(e)));break;case 12:if(u&2048){Wt(e,t,a,i),e=t.stateNode;try{var f=t.memoizedProps,S=f.id,E=f.onPostCommit;typeof E=="function"&&E(S,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(O){Be(t,t.return,O)}}else Wt(e,t,a,i);break;case 31:Wt(e,t,a,i);break;case 13:Wt(e,t,a,i);break;case 23:break;case 22:f=t.stateNode,S=t.alternate,t.memoizedState!==null?f._visibility&2?Wt(e,t,a,i):Gi(e,t):f._visibility&2?Wt(e,t,a,i):(f._visibility|=2,Hl(e,t,a,i,(t.subtreeFlags&10256)!==0||!1)),u&2048&&wc(S,t);break;case 24:Wt(e,t,a,i),u&2048&&Ec(t.alternate,t);break;default:Wt(e,t,a,i)}}function Hl(e,t,a,i,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,S=t,E=a,O=i,F=S.flags;switch(S.tag){case 0:case 11:case 15:Hl(f,S,E,O,u),qi(8,S);break;case 23:break;case 22:var le=S.stateNode;S.memoizedState!==null?le._visibility&2?Hl(f,S,E,O,u):Gi(f,S):(le._visibility|=2,Hl(f,S,E,O,u)),u&&F&2048&&wc(S.alternate,S);break;case 24:Hl(f,S,E,O,u),u&&F&2048&&Ec(S.alternate,S);break;default:Hl(f,S,E,O,u)}t=t.sibling}}function Gi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,i=t,u=i.flags;switch(i.tag){case 22:Gi(a,i),u&2048&&wc(i.alternate,i);break;case 24:Gi(a,i),u&2048&&Ec(i.alternate,i);break;default:Gi(a,i)}t=t.sibling}}var Yi=8192;function Ul(e,t,a){if(e.subtreeFlags&Yi)for(e=e.child;e!==null;)Hg(e,t,a),e=e.sibling}function Hg(e,t,a){switch(e.tag){case 26:Ul(e,t,a),e.flags&Yi&&e.memoizedState!==null&&xS(a,Pt,e.memoizedState,e.memoizedProps);break;case 5:Ul(e,t,a);break;case 3:case 4:var i=Pt;Pt=Gs(e.stateNode.containerInfo),Ul(e,t,a),Pt=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Yi,Yi=16777216,Ul(e,t,a),Yi=i):Ul(e,t,a));break;default:Ul(e,t,a)}}function Ug(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ki(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var i=t[a];ut=i,Bg(i,e)}Ug(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Lg(e),e=e.sibling}function Lg(e){switch(e.tag){case 0:case 11:case 15:ki(e),e.flags&2048&&sa(9,e,e.return);break;case 3:ki(e);break;case 12:ki(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Cs(e)):ki(e);break;default:ki(e)}}function Cs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var i=t[a];ut=i,Bg(i,e)}Ug(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:sa(8,t,t.return),Cs(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Cs(t));break;default:Cs(t)}e=e.sibling}}function Bg(e,t){for(;ut!==null;){var a=ut;switch(a.tag){case 0:case 11:case 15:sa(8,a,t);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:Ai(a.memoizedState.cache)}if(i=a.child,i!==null)i.return=a,ut=i;else e:for(a=e;ut!==null;){i=ut;var u=i.sibling,f=i.return;if(Cg(i),i===a){ut=null;break e}if(u!==null){u.return=f,ut=u;break e}ut=f}}}var U1={getCacheForType:function(e){var t=ht(tt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return ht(tt).controller.signal}},L1=typeof WeakMap=="function"?WeakMap:Map,He=0,ke=null,Ae=null,Me=0,Le=0,Ht=null,ra=!1,Ll=!1,_c=!1,Ln=0,Je=0,ua=0,Ka=0,Nc=0,Ut=0,Bl=0,Vi=null,Tt=null,Ac=!1,Ms=0,qg=0,zs=1/0,Ds=null,ca=null,st=0,fa=null,ql=null,Bn=0,Tc=0,Cc=null,Ig=null,Xi=0,Mc=null;function Lt(){return(He&2)!==0&&Me!==0?Me&-Me:A.T!==null?Hc():Ho()}function Gg(){if(Ut===0)if((Me&536870912)===0||De){var e=rl;rl<<=1,(rl&3932160)===0&&(rl=262144),Ut=e}else Ut=536870912;return e=Ot.current,e!==null&&(e.flags|=32),Ut}function Ct(e,t,a){(e===ke&&(Le===2||Le===9)||e.cancelPendingCommit!==null)&&(Il(e,0),da(e,Me,Ut,!1)),za(e,a),((He&2)===0||e!==ke)&&(e===ke&&((He&2)===0&&(Ka|=a),Je===4&&da(e,Me,Ut,!1)),fn(e))}function Yg(e,t,a){if((He&6)!==0)throw Error(s(327));var i=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Ma(e,t),u=i?I1(e,t):Dc(e,t,!0),f=i;do{if(u===0){Ll&&!i&&da(e,t,0,!1);break}else{if(a=e.current.alternate,f&&!B1(a)){u=Dc(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var S=0;else S=e.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){t=S;e:{var E=e;u=Vi;var O=E.current.memoizedState.isDehydrated;if(O&&(Il(E,S).flags|=256),S=Dc(E,S,!1),S!==2){if(_c&&!O){E.errorRecoveryDisabledLanes|=f,Ka|=f,u=4;break e}f=Tt,Tt=u,f!==null&&(Tt===null?Tt=f:Tt.push.apply(Tt,f))}u=S}if(f=!1,u!==2)continue}}if(u===1){Il(e,0),da(e,t,0,!0);break}e:{switch(i=e,f=u,f){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t)break;case 6:da(i,t,Ut,!ra);break e;case 2:Tt=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(u=Ms+300-ft(),10<u)){if(da(i,t,Ut,!ra),cl(i,0,!0)!==0)break e;Bn=t,i.timeoutHandle=Sm(kg.bind(null,i,a,Tt,Ds,Ac,t,Ut,Ka,Bl,ra,f,"Throttled",-0,0),u);break e}kg(i,a,Tt,Ds,Ac,t,Ut,Ka,Bl,ra,f,null,-0,0)}}break}while(!0);fn(e)}function kg(e,t,a,i,u,f,S,E,O,F,le,se,J,W){if(e.timeoutHandle=-1,se=t.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:En},Hg(t,f,se);var he=(f&62914560)===f?Ms-ft():(f&4194048)===f?qg-ft():0;if(he=wS(se,he),he!==null){Bn=f,e.cancelPendingCommit=he(Jg.bind(null,e,t,f,a,i,u,S,E,O,le,se,null,J,W)),da(e,f,S,!F);return}}Jg(e,t,f,a,i,u,S,E,O)}function B1(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var i=0;i<a.length;i++){var u=a[i],f=u.getSnapshot;u=u.value;try{if(!Dt(f(),u))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function da(e,t,a,i){t&=~Nc,t&=~Ka,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var u=t;0<u;){var f=31-St(u),S=1<<f;i[f]=-1,u&=~S}a!==0&&Ro(e,a,t)}function Rs(){return(He&6)===0?(Zi(0),!1):!0}function zc(){if(Ae!==null){if(Le===0)var e=Ae.return;else e=Ae,Tn=Ia=null,Zu(e),zl=null,Ci=0,e=Ae;for(;e!==null;)bg(e.alternate,e),e=e.return;Ae=null}}function Il(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,lS(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Bn=0,zc(),ke=e,Ae=a=Nn(e.current,null),Me=t,Le=0,Ht=null,ra=!1,Ll=Ma(e,t),_c=!1,Bl=Ut=Nc=Ka=ua=Je=0,Tt=Vi=null,Ac=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var u=31-St(i),f=1<<u;t|=e[u],i&=~f}return Ln=t,Wo(),a}function Vg(e,t){we=null,A.H=Ui,t===Ml||t===ss?(t=oh(),Le=3):t===ju?(t=oh(),Le=4):Le=t===rc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ht=t,Ae===null&&(Je=1,xs(e,Gt(t,e.current)))}function Xg(){var e=Ot.current;return e===null?!0:(Me&4194048)===Me?Xt===null:(Me&62914560)===Me||(Me&536870912)!==0?e===Xt:!1}function Zg(){var e=A.H;return A.H=Ui,e===null?Ui:e}function $g(){var e=A.A;return A.A=U1,e}function Os(){Je=4,ra||(Me&4194048)!==Me&&Ot.current!==null||(Ll=!0),(ua&134217727)===0&&(Ka&134217727)===0||ke===null||da(ke,Me,Ut,!1)}function Dc(e,t,a){var i=He;He|=2;var u=Zg(),f=$g();(ke!==e||Me!==t)&&(Ds=null,Il(e,t)),t=!1;var S=Je;e:do try{if(Le!==0&&Ae!==null){var E=Ae,O=Ht;switch(Le){case 8:zc(),S=6;break e;case 3:case 2:case 9:case 6:Ot.current===null&&(t=!0);var F=Le;if(Le=0,Ht=null,Gl(e,E,O,F),a&&Ll){S=0;break e}break;default:F=Le,Le=0,Ht=null,Gl(e,E,O,F)}}q1(),S=Je;break}catch(le){Vg(e,le)}while(!0);return t&&e.shellSuspendCounter++,Tn=Ia=null,He=i,A.H=u,A.A=f,Ae===null&&(ke=null,Me=0,Wo()),S}function q1(){for(;Ae!==null;)Qg(Ae)}function I1(e,t){var a=He;He|=2;var i=Zg(),u=$g();ke!==e||Me!==t?(Ds=null,zs=ft()+500,Il(e,t)):Ll=Ma(e,t);e:do try{if(Le!==0&&Ae!==null){t=Ae;var f=Ht;t:switch(Le){case 1:Le=0,Ht=null,Gl(e,t,f,1);break;case 2:case 9:if(lh(f)){Le=0,Ht=null,Kg(t);break}t=function(){Le!==2&&Le!==9||ke!==e||(Le=7),fn(e)},f.then(t,t);break e;case 3:Le=7;break e;case 4:Le=5;break e;case 7:lh(f)?(Le=0,Ht=null,Kg(t)):(Le=0,Ht=null,Gl(e,t,f,7));break;case 5:var S=null;switch(Ae.tag){case 26:S=Ae.memoizedState;case 5:case 27:var E=Ae;if(S?jm(S):E.stateNode.complete){Le=0,Ht=null;var O=E.sibling;if(O!==null)Ae=O;else{var F=E.return;F!==null?(Ae=F,js(F)):Ae=null}break t}}Le=0,Ht=null,Gl(e,t,f,5);break;case 6:Le=0,Ht=null,Gl(e,t,f,6);break;case 8:zc(),Je=6;break e;default:throw Error(s(462))}}G1();break}catch(le){Vg(e,le)}while(!0);return Tn=Ia=null,A.H=i,A.A=u,He=a,Ae!==null?0:(ke=null,Me=0,Wo(),Je)}function G1(){for(;Ae!==null&&!Na();)Qg(Ae)}function Qg(e){var t=vg(e.alternate,e,Ln);e.memoizedProps=e.pendingProps,t===null?js(e):Ae=t}function Kg(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=dg(a,t,t.pendingProps,t.type,void 0,Me);break;case 11:t=dg(a,t,t.pendingProps,t.type.render,t.ref,Me);break;case 5:Zu(t);default:bg(a,t),t=Ae=$d(t,Ln),t=vg(a,t,Ln)}e.memoizedProps=e.pendingProps,t===null?js(e):Ae=t}function Gl(e,t,a,i){Tn=Ia=null,Zu(t),zl=null,Ci=0;var u=t.return;try{if(M1(e,u,t,a,Me)){Je=1,xs(e,Gt(a,e.current)),Ae=null;return}}catch(f){if(u!==null)throw Ae=u,f;Je=1,xs(e,Gt(a,e.current)),Ae=null;return}t.flags&32768?(De||i===1?e=!0:Ll||(Me&536870912)!==0?e=!1:(ra=e=!0,(i===2||i===9||i===3||i===6)&&(i=Ot.current,i!==null&&i.tag===13&&(i.flags|=16384))),Fg(t,e)):js(t)}function js(e){var t=e;do{if((t.flags&32768)!==0){Fg(t,ra);return}e=t.return;var a=R1(t.alternate,t,Ln);if(a!==null){Ae=a;return}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);Je===0&&(Je=5)}function Fg(e,t){do{var a=O1(e.alternate,e);if(a!==null){a.flags&=32767,Ae=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ae=e;return}Ae=e=a}while(e!==null);Je=6,Ae=null}function Jg(e,t,a,i,u,f,S,E,O){e.cancelPendingCommit=null;do Hs();while(st!==0);if((He&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));if(f=t.lanes|t.childLanes,f|=Su,Kr(e,a,f,S,E,O),e===ke&&(Ae=ke=null,Me=0),ql=t,fa=e,Bn=a,Tc=f,Cc=u,Ig=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,X1(Ta,function(){return nm(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=A.T,A.T=null,u=j.p,j.p=2,S=He,He|=4;try{j1(e,t,a)}finally{He=S,j.p=u,A.T=i}}st=1,Pg(),Wg(),em()}}function Pg(){if(st===1){st=0;var e=fa,t=ql,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=A.T,A.T=null;var i=j.p;j.p=2;var u=He;He|=4;try{Rg(t,e);var f=kc,S=Bd(e.containerInfo),E=f.focusedElem,O=f.selectionRange;if(S!==E&&E&&E.ownerDocument&&Ld(E.ownerDocument.documentElement,E)){if(O!==null&&gu(E)){var F=O.start,le=O.end;if(le===void 0&&(le=F),"selectionStart"in E)E.selectionStart=F,E.selectionEnd=Math.min(le,E.value.length);else{var se=E.ownerDocument||document,J=se&&se.defaultView||window;if(J.getSelection){var W=J.getSelection(),he=E.textContent.length,ve=Math.min(O.start,he),Ye=O.end===void 0?ve:Math.min(O.end,he);!W.extend&&ve>Ye&&(S=Ye,Ye=ve,ve=S);var X=Ud(E,ve),q=Ud(E,Ye);if(X&&q&&(W.rangeCount!==1||W.anchorNode!==X.node||W.anchorOffset!==X.offset||W.focusNode!==q.node||W.focusOffset!==q.offset)){var K=se.createRange();K.setStart(X.node,X.offset),W.removeAllRanges(),ve>Ye?(W.addRange(K),W.extend(q.node,q.offset)):(K.setEnd(q.node,q.offset),W.addRange(K))}}}}for(se=[],W=E;W=W.parentNode;)W.nodeType===1&&se.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<se.length;E++){var ie=se[E];ie.element.scrollLeft=ie.left,ie.element.scrollTop=ie.top}}$s=!!Yc,kc=Yc=null}finally{He=u,j.p=i,A.T=a}}e.current=t,st=2}}function Wg(){if(st===2){st=0;var e=fa,t=ql,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=A.T,A.T=null;var i=j.p;j.p=2;var u=He;He|=4;try{Tg(e,t.alternate,t)}finally{He=u,j.p=i,A.T=a}}st=3}}function em(){if(st===4||st===3){st=0,Aa();var e=fa,t=ql,a=Bn,i=Ig;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?st=5:(st=0,ql=fa=null,tm(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(ca=null),fi(a),t=t.stateNode,vt&&typeof vt.onCommitFiberRoot=="function")try{vt.onCommitFiberRoot(Ca,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=A.T,u=j.p,j.p=2,A.T=null;try{for(var f=e.onRecoverableError,S=0;S<i.length;S++){var E=i[S];f(E.value,{componentStack:E.stack})}}finally{A.T=t,j.p=u}}(Bn&3)!==0&&Hs(),fn(e),u=e.pendingLanes,(a&261930)!==0&&(u&42)!==0?e===Mc?Xi++:(Xi=0,Mc=e):Xi=0,Zi(0)}}function tm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ai(t)))}function Hs(){return Pg(),Wg(),em(),nm()}function nm(){if(st!==5)return!1;var e=fa,t=Tc;Tc=0;var a=fi(Bn),i=A.T,u=j.p;try{j.p=32>a?32:a,A.T=null,a=Cc,Cc=null;var f=fa,S=Bn;if(st=0,ql=fa=null,Bn=0,(He&6)!==0)throw Error(s(331));var E=He;if(He|=4,Lg(f.current),jg(f,f.current,S,a),He=E,Zi(0,!1),vt&&typeof vt.onPostCommitFiberRoot=="function")try{vt.onPostCommitFiberRoot(Ca,f)}catch{}return!0}finally{j.p=u,A.T=i,tm(e,t)}}function am(e,t,a){t=Gt(a,t),t=sc(e.stateNode,t,2),e=la(e,t,2),e!==null&&(za(e,2),fn(e))}function Be(e,t,a){if(e.tag===3)am(e,e,a);else for(;t!==null;){if(t.tag===3){am(t,e,a);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(ca===null||!ca.has(i))){e=Gt(a,e),a=lg(2),i=la(t,a,2),i!==null&&(ig(a,i,t,e),za(i,2),fn(i));break}}t=t.return}}function Rc(e,t,a){var i=e.pingCache;if(i===null){i=e.pingCache=new L1;var u=new Set;i.set(t,u)}else u=i.get(t),u===void 0&&(u=new Set,i.set(t,u));u.has(a)||(_c=!0,u.add(a),e=Y1.bind(null,e,t,a),t.then(e,e))}function Y1(e,t,a){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,ke===e&&(Me&a)===a&&(Je===4||Je===3&&(Me&62914560)===Me&&300>ft()-Ms?(He&2)===0&&Il(e,0):Nc|=a,Bl===Me&&(Bl=0)),fn(e)}function lm(e,t){t===0&&(t=Do()),e=La(e,t),e!==null&&(za(e,t),fn(e))}function k1(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),lm(e,a)}function V1(e,t){var a=0;switch(e.tag){case 31:case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(a=u.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(s(314))}i!==null&&i.delete(t),lm(e,a)}function X1(e,t){return Kt(e,t)}var Us=null,Yl=null,Oc=!1,Ls=!1,jc=!1,ha=0;function fn(e){e!==Yl&&e.next===null&&(Yl===null?Us=Yl=e:Yl=Yl.next=e),Ls=!0,Oc||(Oc=!0,$1())}function Zi(e,t){if(!jc&&Ls){jc=!0;do for(var a=!1,i=Us;i!==null;){if(e!==0){var u=i.pendingLanes;if(u===0)var f=0;else{var S=i.suspendedLanes,E=i.pingedLanes;f=(1<<31-St(42|e)+1)-1,f&=u&~(S&~E),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(a=!0,rm(i,f))}else f=Me,f=cl(i,i===ke?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||Ma(i,f)||(a=!0,rm(i,f));i=i.next}while(a);jc=!1}}function Z1(){im()}function im(){Ls=Oc=!1;var e=0;ha!==0&&aS()&&(e=ha);for(var t=ft(),a=null,i=Us;i!==null;){var u=i.next,f=om(i,t);f===0?(i.next=null,a===null?Us=u:a.next=u,u===null&&(Yl=a)):(a=i,(e!==0||(f&3)!==0)&&(Ls=!0)),i=u}st!==0&&st!==5||Zi(e),ha!==0&&(ha=0)}function om(e,t){for(var a=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var S=31-St(f),E=1<<S,O=u[S];O===-1?((E&a)===0||(E&i)!==0)&&(u[S]=Qr(E,t)):O<=t&&(e.expiredLanes|=E),f&=~E}if(t=ke,a=Me,a=cl(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,a===0||e===t&&(Le===2||Le===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&yn(i),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Ma(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(i!==null&&yn(i),fi(a)){case 2:case 8:a=Xn;break;case 32:a=Ta;break;case 268435456:a=ol;break;default:a=Ta}return i=sm.bind(null,e),a=Kt(a,i),e.callbackPriority=t,e.callbackNode=a,t}return i!==null&&i!==null&&yn(i),e.callbackPriority=2,e.callbackNode=null,2}function sm(e,t){if(st!==0&&st!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Hs()&&e.callbackNode!==a)return null;var i=Me;return i=cl(e,e===ke?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Yg(e,i,t),om(e,ft()),e.callbackNode!=null&&e.callbackNode===a?sm.bind(null,e):null)}function rm(e,t){if(Hs())return null;Yg(e,t,!0)}function $1(){iS(function(){(He&6)!==0?Kt(vn,Z1):im()})}function Hc(){if(ha===0){var e=Tl;e===0&&(e=sl,sl<<=1,(sl&261888)===0&&(sl=256)),ha=e}return ha}function um(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Xo(""+e)}function cm(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Q1(e,t,a,i,u){if(t==="submit"&&a&&a.stateNode===u){var f=um((u[pt]||null).action),S=i.submitter;S&&(t=(t=S[pt]||null)?um(t.formAction):S.getAttribute("formAction"),t!==null&&(f=t,S=null));var E=new Ko("action","action",null,i,u);e.push({event:E,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(ha!==0){var O=S?cm(u,S):new FormData(u);tc(a,{pending:!0,data:O,method:u.method,action:f},null,O)}}else typeof f=="function"&&(E.preventDefault(),O=S?cm(u,S):new FormData(u),tc(a,{pending:!0,data:O,method:u.method,action:f},f,O))},currentTarget:u}]})}}for(var Uc=0;Uc<vu.length;Uc++){var Lc=vu[Uc],K1=Lc.toLowerCase(),F1=Lc[0].toUpperCase()+Lc.slice(1);Jt(K1,"on"+F1)}Jt(Gd,"onAnimationEnd"),Jt(Yd,"onAnimationIteration"),Jt(kd,"onAnimationStart"),Jt("dblclick","onDoubleClick"),Jt("focusin","onFocus"),Jt("focusout","onBlur"),Jt(d1,"onTransitionRun"),Jt(h1,"onTransitionStart"),Jt(g1,"onTransitionCancel"),Jt(Vd,"onTransitionEnd"),Fn("onMouseEnter",["mouseout","mouseover"]),Fn("onMouseLeave",["mouseout","mouseover"]),Fn("onPointerEnter",["pointerout","pointerover"]),Fn("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 $i="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(" "),J1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($i));function fm(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var i=e[a],u=i.event;i=i.listeners;e:{var f=void 0;if(t)for(var S=i.length-1;0<=S;S--){var E=i[S],O=E.instance,F=E.currentTarget;if(E=E.listener,O!==f&&u.isPropagationStopped())break e;f=E,u.currentTarget=F;try{f(u)}catch(le){Po(le)}u.currentTarget=null,f=O}else for(S=0;S<i.length;S++){if(E=i[S],O=E.instance,F=E.currentTarget,E=E.listener,O!==f&&u.isPropagationStopped())break e;f=E,u.currentTarget=F;try{f(u)}catch(le){Po(le)}u.currentTarget=null,f=O}}}}function Te(e,t){var a=t[fl];a===void 0&&(a=t[fl]=new Set);var i=e+"__bubble";a.has(i)||(dm(t,e,2,!1),a.add(i))}function Bc(e,t,a){var i=0;t&&(i|=4),dm(a,e,i,t)}var Bs="_reactListening"+Math.random().toString(36).slice(2);function qc(e){if(!e[Bs]){e[Bs]=!0,qo.forEach(function(a){a!=="selectionchange"&&(J1.has(a)||Bc(a,!1,e),Bc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Bs]||(t[Bs]=!0,Bc("selectionchange",!1,t))}}function dm(e,t,a,i){switch(Gm(t)){case 2:var u=NS;break;case 8:u=AS;break;default:u=ef}a=u.bind(null,t,a,e),u=void 0,!iu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),i?u!==void 0?e.addEventListener(t,a,{capture:!0,passive:u}):e.addEventListener(t,a,!0):u!==void 0?e.addEventListener(t,a,{passive:u}):e.addEventListener(t,a,!1)}function Ic(e,t,a,i,u){var f=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var S=i.tag;if(S===3||S===4){var E=i.stateNode.containerInfo;if(E===u)break;if(S===4)for(S=i.return;S!==null;){var O=S.tag;if((O===3||O===4)&&S.stateNode.containerInfo===u)return;S=S.return}for(;E!==null;){if(S=Zn(E),S===null)return;if(O=S.tag,O===5||O===6||O===26||O===27){i=f=S;continue e}E=E.parentNode}}i=i.return}yd(function(){var F=f,le=au(a),se=[];e:{var J=Xd.get(e);if(J!==void 0){var W=Ko,he=e;switch(e){case"keypress":if($o(a)===0)break e;case"keydown":case"keyup":W=Vv;break;case"focusin":he="focus",W=uu;break;case"focusout":he="blur",W=uu;break;case"beforeblur":case"afterblur":W=uu;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":W=bd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":W=Rv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=$v;break;case Gd:case Yd:case kd:W=Hv;break;case Vd:W=Kv;break;case"scroll":case"scrollend":W=zv;break;case"wheel":W=Jv;break;case"copy":case"cut":case"paste":W=Lv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":W=wd;break;case"toggle":case"beforetoggle":W=Wv}var ve=(t&4)!==0,Ye=!ve&&(e==="scroll"||e==="scrollend"),X=ve?J!==null?J+"Capture":null:J;ve=[];for(var q=F,K;q!==null;){var ie=q;if(K=ie.stateNode,ie=ie.tag,ie!==5&&ie!==26&&ie!==27||K===null||X===null||(ie=mi(q,X),ie!=null&&ve.push(Qi(q,ie,K))),Ye)break;q=q.return}0<ve.length&&(J=new W(J,he,null,a,le),se.push({event:J,listeners:ve}))}}if((t&7)===0){e:{if(J=e==="mouseover"||e==="pointerover",W=e==="mouseout"||e==="pointerout",J&&a!==nu&&(he=a.relatedTarget||a.fromElement)&&(Zn(he)||he[bn]))break e;if((W||J)&&(J=le.window===le?le:(J=le.ownerDocument)?J.defaultView||J.parentWindow:window,W?(he=a.relatedTarget||a.toElement,W=F,he=he?Zn(he):null,he!==null&&(Ye=c(he),ve=he.tag,he!==Ye||ve!==5&&ve!==27&&ve!==6)&&(he=null)):(W=null,he=F),W!==he)){if(ve=bd,ie="onMouseLeave",X="onMouseEnter",q="mouse",(e==="pointerout"||e==="pointerover")&&(ve=wd,ie="onPointerLeave",X="onPointerEnter",q="pointer"),Ye=W==null?J:Qn(W),K=he==null?J:Qn(he),J=new ve(ie,q+"leave",W,a,le),J.target=Ye,J.relatedTarget=K,ie=null,Zn(le)===F&&(ve=new ve(X,q+"enter",he,a,le),ve.target=K,ve.relatedTarget=Ye,ie=ve),Ye=ie,W&&he)t:{for(ve=P1,X=W,q=he,K=0,ie=X;ie;ie=ve(ie))K++;ie=0;for(var pe=q;pe;pe=ve(pe))ie++;for(;0<K-ie;)X=ve(X),K--;for(;0<ie-K;)q=ve(q),ie--;for(;K--;){if(X===q||q!==null&&X===q.alternate){ve=X;break t}X=ve(X),q=ve(q)}ve=null}else ve=null;W!==null&&hm(se,J,W,ve,!1),he!==null&&Ye!==null&&hm(se,Ye,he,ve,!0)}}e:{if(J=F?Qn(F):window,W=J.nodeName&&J.nodeName.toLowerCase(),W==="select"||W==="input"&&J.type==="file")var Oe=zd;else if(Cd(J))if(Dd)Oe=u1;else{Oe=s1;var ge=o1}else W=J.nodeName,!W||W.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?F&&tu(F.elementType)&&(Oe=zd):Oe=r1;if(Oe&&(Oe=Oe(e,F))){Md(se,Oe,a,le);break e}ge&&ge(e,J,F),e==="focusout"&&F&&J.type==="number"&&F.memoizedProps.value!=null&&gi(J,"number",J.value)}switch(ge=F?Qn(F):window,e){case"focusin":(Cd(ge)||ge.contentEditable==="true")&&(Sl=ge,mu=F,Ei=null);break;case"focusout":Ei=mu=Sl=null;break;case"mousedown":pu=!0;break;case"contextmenu":case"mouseup":case"dragend":pu=!1,qd(se,a,le);break;case"selectionchange":if(f1)break;case"keydown":case"keyup":qd(se,a,le)}var _e;if(fu)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else vl?Ad(e,a)&&(ze="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(ze="onCompositionStart");ze&&(Ed&&a.locale!=="ko"&&(vl||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&vl&&(_e=vd()):(Jn=le,ou="value"in Jn?Jn.value:Jn.textContent,vl=!0)),ge=qs(F,ze),0<ge.length&&(ze=new xd(ze,e,null,a,le),se.push({event:ze,listeners:ge}),_e?ze.data=_e:(_e=Td(a),_e!==null&&(ze.data=_e)))),(_e=t1?n1(e,a):a1(e,a))&&(ze=qs(F,"onBeforeInput"),0<ze.length&&(ge=new xd("onBeforeInput","beforeinput",null,a,le),se.push({event:ge,listeners:ze}),ge.data=_e)),Q1(se,e,F,a,le)}fm(se,t)})}function Qi(e,t,a){return{instance:e,listener:t,currentTarget:a}}function qs(e,t){for(var a=t+"Capture",i=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=mi(e,a),u!=null&&i.unshift(Qi(e,u,f)),u=mi(e,t),u!=null&&i.push(Qi(e,u,f))),e.tag===3)return i;e=e.return}return[]}function P1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function hm(e,t,a,i,u){for(var f=t._reactName,S=[];a!==null&&a!==i;){var E=a,O=E.alternate,F=E.stateNode;if(E=E.tag,O!==null&&O===i)break;E!==5&&E!==26&&E!==27||F===null||(O=F,u?(F=mi(a,f),F!=null&&S.unshift(Qi(a,F,O))):u||(F=mi(a,f),F!=null&&S.push(Qi(a,F,O)))),a=a.return}S.length!==0&&e.push({event:t,listeners:S})}var W1=/\r\n?/g,eS=/\u0000|\uFFFD/g;function gm(e){return(typeof e=="string"?e:""+e).replace(W1,`
|
|
9
|
+
`).replace(eS,"")}function mm(e,t){return t=gm(t),gm(e)===t}function Ge(e,t,a,i,u,f){switch(a){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||ml(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&ml(e,""+i);break;case"className":hl(e,"class",i);break;case"tabIndex":hl(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":hl(e,a,i);break;case"style":md(e,i,f);break;case"data":if(t!=="object"){hl(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(a);break}i=Xo(""+i),e.setAttribute(a,i);break;case"action":case"formAction":if(typeof i=="function"){e.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 f=="function"&&(a==="formAction"?(t!=="input"&&Ge(e,t,"name",u.name,u,null),Ge(e,t,"formEncType",u.formEncType,u,null),Ge(e,t,"formMethod",u.formMethod,u,null),Ge(e,t,"formTarget",u.formTarget,u,null)):(Ge(e,t,"encType",u.encType,u,null),Ge(e,t,"method",u.method,u,null),Ge(e,t,"target",u.target,u,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(a);break}i=Xo(""+i),e.setAttribute(a,i);break;case"onClick":i!=null&&(e.onclick=En);break;case"onScroll":i!=null&&Te("scroll",e);break;case"onScrollEnd":i!=null&&Te("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(a=i.__html,a!=null){if(u.children!=null)throw Error(s(60));e.innerHTML=a}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.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"){e.removeAttribute("xlink:href");break}a=Xo(""+i),e.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"?e.setAttribute(a,""+i):e.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"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":i===!0?e.setAttribute(a,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(a,i):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(a,i):e.removeAttribute(a);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(a):e.setAttribute(a,i);break;case"popover":Te("beforetoggle",e),Te("toggle",e),dl(e,"popover",i);break;case"xlinkActuate":Ft(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Ft(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Ft(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Ft(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Ft(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Ft(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Ft(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Ft(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Ft(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":dl(e,"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=Cv.get(a)||a,dl(e,a,i))}}function Gc(e,t,a,i,u,f){switch(a){case"style":md(e,i,f);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(a=i.__html,a!=null){if(u.children!=null)throw Error(s(60));e.innerHTML=a}}break;case"children":typeof i=="string"?ml(e,i):(typeof i=="number"||typeof i=="bigint")&&ml(e,""+i);break;case"onScroll":i!=null&&Te("scroll",e);break;case"onScrollEnd":i!=null&&Te("scrollend",e);break;case"onClick":i!=null&&(e.onclick=En);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Io.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(u=a.endsWith("Capture"),t=a.slice(2,u?a.length-7:void 0),f=e[pt]||null,f=f!=null?f[a]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof i=="function")){typeof f!="function"&&f!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,i,u);break e}a in e?e[a]=i:i===!0?e.setAttribute(a,""):dl(e,a,i)}}}function mt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Te("error",e),Te("load",e);var i=!1,u=!1,f;for(f in a)if(a.hasOwnProperty(f)){var S=a[f];if(S!=null)switch(f){case"src":i=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Ge(e,t,f,S,a,null)}}u&&Ge(e,t,"srcSet",a.srcSet,a,null),i&&Ge(e,t,"src",a.src,a,null);return;case"input":Te("invalid",e);var E=f=S=u=null,O=null,F=null;for(i in a)if(a.hasOwnProperty(i)){var le=a[i];if(le!=null)switch(i){case"name":u=le;break;case"type":S=le;break;case"checked":O=le;break;case"defaultChecked":F=le;break;case"value":f=le;break;case"defaultValue":E=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(s(137,t));break;default:Ge(e,t,i,le,a,null)}}Vo(e,f,E,O,F,S,u,!1);return;case"select":Te("invalid",e),i=S=f=null;for(u in a)if(a.hasOwnProperty(u)&&(E=a[u],E!=null))switch(u){case"value":f=E;break;case"defaultValue":S=E;break;case"multiple":i=E;default:Ge(e,t,u,E,a,null)}t=f,a=S,e.multiple=!!i,t!=null?wn(e,!!i,t,!1):a!=null&&wn(e,!!i,a,!0);return;case"textarea":Te("invalid",e),f=u=i=null;for(S in a)if(a.hasOwnProperty(S)&&(E=a[S],E!=null))switch(S){case"value":i=E;break;case"defaultValue":u=E;break;case"children":f=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(s(91));break;default:Ge(e,t,S,E,a,null)}hd(e,i,u,f);return;case"option":for(O in a)a.hasOwnProperty(O)&&(i=a[O],i!=null)&&(O==="selected"?e.selected=i&&typeof i!="function"&&typeof i!="symbol":Ge(e,t,O,i,a,null));return;case"dialog":Te("beforetoggle",e),Te("toggle",e),Te("cancel",e),Te("close",e);break;case"iframe":case"object":Te("load",e);break;case"video":case"audio":for(i=0;i<$i.length;i++)Te($i[i],e);break;case"image":Te("error",e),Te("load",e);break;case"details":Te("toggle",e);break;case"embed":case"source":case"link":Te("error",e),Te("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in a)if(a.hasOwnProperty(F)&&(i=a[F],i!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Ge(e,t,F,i,a,null)}return;default:if(tu(t)){for(le in a)a.hasOwnProperty(le)&&(i=a[le],i!==void 0&&Gc(e,t,le,i,a,void 0));return}}for(E in a)a.hasOwnProperty(E)&&(i=a[E],i!=null&&Ge(e,t,E,i,a,null))}function tS(e,t,a,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,S=null,E=null,O=null,F=null,le=null;for(W in a){var se=a[W];if(a.hasOwnProperty(W)&&se!=null)switch(W){case"checked":break;case"value":break;case"defaultValue":O=se;default:i.hasOwnProperty(W)||Ge(e,t,W,null,i,se)}}for(var J in i){var W=i[J];if(se=a[J],i.hasOwnProperty(J)&&(W!=null||se!=null))switch(J){case"type":f=W;break;case"name":u=W;break;case"checked":F=W;break;case"defaultChecked":le=W;break;case"value":S=W;break;case"defaultValue":E=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(s(137,t));break;default:W!==se&&Ge(e,t,J,W,i,se)}}Oa(e,S,E,O,F,le,f,u);return;case"select":W=S=E=J=null;for(f in a)if(O=a[f],a.hasOwnProperty(f)&&O!=null)switch(f){case"value":break;case"multiple":W=O;default:i.hasOwnProperty(f)||Ge(e,t,f,null,i,O)}for(u in i)if(f=i[u],O=a[u],i.hasOwnProperty(u)&&(f!=null||O!=null))switch(u){case"value":J=f;break;case"defaultValue":E=f;break;case"multiple":S=f;default:f!==O&&Ge(e,t,u,f,i,O)}t=E,a=S,i=W,J!=null?wn(e,!!a,J,!1):!!i!=!!a&&(t!=null?wn(e,!!a,t,!0):wn(e,!!a,a?[]:"",!1));return;case"textarea":W=J=null;for(E in a)if(u=a[E],a.hasOwnProperty(E)&&u!=null&&!i.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:Ge(e,t,E,null,i,u)}for(S in i)if(u=i[S],f=a[S],i.hasOwnProperty(S)&&(u!=null||f!=null))switch(S){case"value":J=u;break;case"defaultValue":W=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(s(91));break;default:u!==f&&Ge(e,t,S,u,i,f)}dd(e,J,W);return;case"option":for(var he in a)J=a[he],a.hasOwnProperty(he)&&J!=null&&!i.hasOwnProperty(he)&&(he==="selected"?e.selected=!1:Ge(e,t,he,null,i,J));for(O in i)J=i[O],W=a[O],i.hasOwnProperty(O)&&J!==W&&(J!=null||W!=null)&&(O==="selected"?e.selected=J&&typeof J!="function"&&typeof J!="symbol":Ge(e,t,O,J,i,W));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ve in a)J=a[ve],a.hasOwnProperty(ve)&&J!=null&&!i.hasOwnProperty(ve)&&Ge(e,t,ve,null,i,J);for(F in i)if(J=i[F],W=a[F],i.hasOwnProperty(F)&&J!==W&&(J!=null||W!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(s(137,t));break;default:Ge(e,t,F,J,i,W)}return;default:if(tu(t)){for(var Ye in a)J=a[Ye],a.hasOwnProperty(Ye)&&J!==void 0&&!i.hasOwnProperty(Ye)&&Gc(e,t,Ye,void 0,i,J);for(le in i)J=i[le],W=a[le],!i.hasOwnProperty(le)||J===W||J===void 0&&W===void 0||Gc(e,t,le,J,i,W);return}}for(var X in a)J=a[X],a.hasOwnProperty(X)&&J!=null&&!i.hasOwnProperty(X)&&Ge(e,t,X,null,i,J);for(se in i)J=i[se],W=a[se],!i.hasOwnProperty(se)||J===W||J==null&&W==null||Ge(e,t,se,J,i,W)}function pm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function nS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),i=0;i<a.length;i++){var u=a[i],f=u.transferSize,S=u.initiatorType,E=u.duration;if(f&&E&&pm(S)){for(S=0,E=u.responseEnd,i+=1;i<a.length;i++){var O=a[i],F=O.startTime;if(F>E)break;var le=O.transferSize,se=O.initiatorType;le&&pm(se)&&(O=O.responseEnd,S+=le*(O<E?1:(E-F)/(O-F)))}if(--i,t+=8*(f+S)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Yc=null,kc=null;function Is(e){return e.nodeType===9?e:e.ownerDocument}function ym(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function vm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Vc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Xc=null;function aS(){var e=window.event;return e&&e.type==="popstate"?e===Xc?!1:(Xc=e,!0):(Xc=null,!1)}var Sm=typeof setTimeout=="function"?setTimeout:void 0,lS=typeof clearTimeout=="function"?clearTimeout:void 0,bm=typeof Promise=="function"?Promise:void 0,iS=typeof queueMicrotask=="function"?queueMicrotask:typeof bm<"u"?function(e){return bm.resolve(null).then(e).catch(oS)}:Sm;function oS(e){setTimeout(function(){throw e})}function ga(e){return e==="head"}function xm(e,t){var a=t,i=0;do{var u=a.nextSibling;if(e.removeChild(a),u&&u.nodeType===8)if(a=u.data,a==="/$"||a==="/&"){if(i===0){e.removeChild(u),Zl(t);return}i--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")i++;else if(a==="html")Ki(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Ki(a);for(var f=a.firstChild;f;){var S=f.nextSibling,E=f.nodeName;f[Da]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&f.rel.toLowerCase()==="stylesheet"||a.removeChild(f),f=S}}else a==="body"&&Ki(e.ownerDocument.body);a=u}while(a);Zl(t)}function wm(e,t){var a=e;e=0;do{var i=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),i&&i.nodeType===8)if(a=i.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=i}while(a)}function Zc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Zc(a),di(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function sS(e,t,a,i){for(;e.nodeType===1;){var u=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Da])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=Zt(e.nextSibling),e===null)break}return null}function rS(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Zt(e.nextSibling),e===null))return null;return e}function Em(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Zt(e.nextSibling),e===null))return null;return e}function $c(e){return e.data==="$?"||e.data==="$~"}function Qc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function uS(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var i=function(){t(),a.removeEventListener("DOMContentLoaded",i)};a.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function Zt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Kc=null;function _m(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Zt(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Nm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Am(e,t,a){switch(t=Is(a),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function Ki(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);di(e)}var $t=new Map,Tm=new Set;function Gs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var qn=j.d;j.d={f:cS,r:fS,D:dS,C:hS,L:gS,m:mS,X:yS,S:pS,M:vS};function cS(){var e=qn.f(),t=Rs();return e||t}function fS(e){var t=$n(e);t!==null&&t.tag===5&&t.type==="form"?Vh(t):qn.r(e)}var kl=typeof document>"u"?null:document;function Cm(e,t,a){var i=kl;if(i&&typeof t=="string"&&t){var u=wt(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),Tm.has(u)||(Tm.add(u),e={rel:e,crossOrigin:a,href:t},i.querySelector(u)===null&&(t=i.createElement("link"),mt(t,"link",e),et(t),i.head.appendChild(t)))}}function dS(e){qn.D(e),Cm("dns-prefetch",e,null)}function hS(e,t){qn.C(e,t),Cm("preconnect",e,t)}function gS(e,t,a){qn.L(e,t,a);var i=kl;if(i&&e&&t){var u='link[rel="preload"][as="'+wt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+wt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+wt(a.imageSizes)+'"]')):u+='[href="'+wt(e)+'"]';var f=u;switch(t){case"style":f=Vl(e);break;case"script":f=Xl(e)}$t.has(f)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),$t.set(f,e),i.querySelector(u)!==null||t==="style"&&i.querySelector(Fi(f))||t==="script"&&i.querySelector(Ji(f))||(t=i.createElement("link"),mt(t,"link",e),et(t),i.head.appendChild(t)))}}function mS(e,t){qn.m(e,t);var a=kl;if(a&&e){var i=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+wt(i)+'"][href="'+wt(e)+'"]',f=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Xl(e)}if(!$t.has(f)&&(e=y({rel:"modulepreload",href:e},t),$t.set(f,e),a.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ji(f)))return}i=a.createElement("link"),mt(i,"link",e),et(i),a.head.appendChild(i)}}}function pS(e,t,a){qn.S(e,t,a);var i=kl;if(i&&e){var u=Kn(i).hoistableStyles,f=Vl(e);t=t||"default";var S=u.get(f);if(!S){var E={loading:0,preload:null};if(S=i.querySelector(Fi(f)))E.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=$t.get(f))&&Fc(e,a);var O=S=i.createElement("link");et(O),mt(O,"link",e),O._p=new Promise(function(F,le){O.onload=F,O.onerror=le}),O.addEventListener("load",function(){E.loading|=1}),O.addEventListener("error",function(){E.loading|=2}),E.loading|=4,Ys(S,t,i)}S={type:"stylesheet",instance:S,count:1,state:E},u.set(f,S)}}}function yS(e,t){qn.X(e,t);var a=kl;if(a&&e){var i=Kn(a).hoistableScripts,u=Xl(e),f=i.get(u);f||(f=a.querySelector(Ji(u)),f||(e=y({src:e,async:!0},t),(t=$t.get(u))&&Jc(e,t),f=a.createElement("script"),et(f),mt(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function vS(e,t){qn.M(e,t);var a=kl;if(a&&e){var i=Kn(a).hoistableScripts,u=Xl(e),f=i.get(u);f||(f=a.querySelector(Ji(u)),f||(e=y({src:e,async:!0,type:"module"},t),(t=$t.get(u))&&Jc(e,t),f=a.createElement("script"),et(f),mt(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function Mm(e,t,a,i){var u=(u=fe.current)?Gs(u):null;if(!u)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Vl(a.href),a=Kn(u).hoistableStyles,i=a.get(t),i||(i={type:"style",instance:null,count:0,state:null},a.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Vl(a.href);var f=Kn(u).hoistableStyles,S=f.get(e);if(S||(u=u.ownerDocument||u,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,S),(f=u.querySelector(Fi(e)))&&!f._p&&(S.instance=f,S.state.loading=5),$t.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},$t.set(e,a),f||SS(u,e,a,S.state))),t&&i===null)throw Error(s(528,""));return S}if(t&&i!==null)throw Error(s(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Xl(a),a=Kn(u).hoistableScripts,i=a.get(t),i||(i={type:"script",instance:null,count:0,state:null},a.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Vl(e){return'href="'+wt(e)+'"'}function Fi(e){return'link[rel="stylesheet"]['+e+"]"}function zm(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function SS(e,t,a,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),mt(t,"link",a),et(t),e.head.appendChild(t))}function Xl(e){return'[src="'+wt(e)+'"]'}function Ji(e){return"script[async]"+e}function Dm(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+wt(a.href)+'"]');if(i)return t.instance=i,et(i),i;var u=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),et(i),mt(i,"style",u),Ys(i,a.precedence,e),t.instance=i;case"stylesheet":u=Vl(a.href);var f=e.querySelector(Fi(u));if(f)return t.state.loading|=4,t.instance=f,et(f),f;i=zm(a),(u=$t.get(u))&&Fc(i,u),f=(e.ownerDocument||e).createElement("link"),et(f);var S=f;return S._p=new Promise(function(E,O){S.onload=E,S.onerror=O}),mt(f,"link",i),t.state.loading|=4,Ys(f,a.precedence,e),t.instance=f;case"script":return f=Xl(a.src),(u=e.querySelector(Ji(f)))?(t.instance=u,et(u),u):(i=a,(u=$t.get(f))&&(i=y({},a),Jc(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),et(u),mt(u,"link",i),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Ys(i,a.precedence,e));return t.instance}function Ys(e,t,a){for(var i=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=i.length?i[i.length-1]:null,f=u,S=0;S<i.length;S++){var E=i[S];if(E.dataset.precedence===t)f=E;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Fc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Jc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ks=null;function Rm(e,t,a){if(ks===null){var i=new Map,u=ks=new Map;u.set(a,i)}else u=ks,i=u.get(a),i||(i=new Map,u.set(a,i));if(i.has(e))return i;for(i.set(e,null),a=a.getElementsByTagName(e),u=0;u<a.length;u++){var f=a[u];if(!(f[Da]||f[ot]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var S=f.getAttribute(t)||"";S=e+S;var E=i.get(S);E?E.push(f):i.set(S,[f])}}return i}function Om(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function bS(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function jm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function xS(e,t,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 u=Vl(i.href),f=t.querySelector(Fi(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Vs.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=f,et(f);return}f=t.ownerDocument||t,i=zm(i),(u=$t.get(u))&&Fc(i,u),f=f.createElement("link"),et(f);var S=f;S._p=new Promise(function(E,O){S.onload=E,S.onerror=O}),mt(f,"link",i),a.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Vs.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Pc=0;function wS(e,t){return e.stylesheets&&e.count===0&&Zs(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var i=setTimeout(function(){if(e.stylesheets&&Zs(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Pc===0&&(Pc=62500*nS());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Zs(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Pc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function Vs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xs=null;function Zs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xs=new Map,t.forEach(ES,e),Xs=null,Vs.call(e))}function ES(e,t){if(!(t.state.loading&4)){var a=Xs.get(e);if(a)var i=a.get(null);else{a=new Map,Xs.set(e,a);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var S=u[f];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(a.set(S.dataset.precedence,S),i=S)}i&&a.set(null,i)}u=t.instance,S=u.getAttribute("data-precedence"),f=a.get(S)||i,f===i&&a.set(null,u),a.set(S,u),this.count++,i=Vs.bind(this),u.addEventListener("load",i),u.addEventListener("error",i),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Pi={$$typeof:w,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function _S(e,t,a,i,u,f,S,E,O){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ui(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ui(0),this.hiddenUpdates=ui(null),this.identifierPrefix=i,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function Hm(e,t,a,i,u,f,S,E,O,F,le,se){return e=new _S(e,t,a,S,O,F,le,se,E),t=1,f===!0&&(t|=24),f=Rt(3,null,null,t),e.current=f,f.stateNode=e,t=Du(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:i,isDehydrated:a,cache:t},Hu(f),e}function Um(e){return e?(e=wl,e):wl}function Lm(e,t,a,i,u,f){u=Um(u),i.context===null?i.context=u:i.pendingContext=u,i=aa(t),i.payload={element:a},f=f===void 0?null:f,f!==null&&(i.callback=f),a=la(e,i,t),a!==null&&(Ct(a,e,t),zi(a,e,t))}function Bm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Wc(e,t){Bm(e,t),(e=e.alternate)&&Bm(e,t)}function qm(e){if(e.tag===13||e.tag===31){var t=La(e,67108864);t!==null&&Ct(t,e,67108864),Wc(e,67108864)}}function Im(e){if(e.tag===13||e.tag===31){var t=Lt();t=ci(t);var a=La(e,t);a!==null&&Ct(a,e,t),Wc(e,t)}}var $s=!0;function NS(e,t,a,i){var u=A.T;A.T=null;var f=j.p;try{j.p=2,ef(e,t,a,i)}finally{j.p=f,A.T=u}}function AS(e,t,a,i){var u=A.T;A.T=null;var f=j.p;try{j.p=8,ef(e,t,a,i)}finally{j.p=f,A.T=u}}function ef(e,t,a,i){if($s){var u=tf(i);if(u===null)Ic(e,t,i,Qs,a),Ym(e,i);else if(CS(u,e,t,a,i))i.stopPropagation();else if(Ym(e,i),t&4&&-1<TS.indexOf(e)){for(;u!==null;){var f=$n(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var S=Sn(f.pendingLanes);if(S!==0){var E=f;for(E.pendingLanes|=2,E.entangledLanes|=2;S;){var O=1<<31-St(S);E.entanglements[1]|=O,S&=~O}fn(f),(He&6)===0&&(zs=ft()+500,Zi(0))}}break;case 31:case 13:E=La(f,2),E!==null&&Ct(E,f,2),Rs(),Wc(f,2)}if(f=tf(i),f===null&&Ic(e,t,i,Qs,a),f===u)break;u=f}u!==null&&i.stopPropagation()}else Ic(e,t,i,null,a)}}function tf(e){return e=au(e),nf(e)}var Qs=null;function nf(e){if(Qs=null,e=Zn(e),e!==null){var t=c(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=d(t),e!==null)return e;e=null}else if(a===31){if(e=g(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Qs=e,null}function Gm(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(il()){case vn:return 2;case Xn:return 8;case Ta:case Yr:return 32;case ol:return 268435456;default:return 32}default:return 32}}var af=!1,ma=null,pa=null,ya=null,Wi=new Map,eo=new Map,va=[],TS="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 Ym(e,t){switch(e){case"focusin":case"focusout":ma=null;break;case"dragenter":case"dragleave":pa=null;break;case"mouseover":case"mouseout":ya=null;break;case"pointerover":case"pointerout":Wi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":eo.delete(t.pointerId)}}function to(e,t,a,i,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:a,eventSystemFlags:i,nativeEvent:f,targetContainers:[u]},t!==null&&(t=$n(t),t!==null&&qm(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function CS(e,t,a,i,u){switch(t){case"focusin":return ma=to(ma,e,t,a,i,u),!0;case"dragenter":return pa=to(pa,e,t,a,i,u),!0;case"mouseover":return ya=to(ya,e,t,a,i,u),!0;case"pointerover":var f=u.pointerId;return Wi.set(f,to(Wi.get(f)||null,e,t,a,i,u)),!0;case"gotpointercapture":return f=u.pointerId,eo.set(f,to(eo.get(f)||null,e,t,a,i,u)),!0}return!1}function km(e){var t=Zn(e.target);if(t!==null){var a=c(t);if(a!==null){if(t=a.tag,t===13){if(t=d(a),t!==null){e.blockedOn=t,Uo(e.priority,function(){Im(a)});return}}else if(t===31){if(t=g(a),t!==null){e.blockedOn=t,Uo(e.priority,function(){Im(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ks(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=tf(e.nativeEvent);if(a===null){a=e.nativeEvent;var i=new a.constructor(a.type,a);nu=i,a.target.dispatchEvent(i),nu=null}else return t=$n(a),t!==null&&qm(t),e.blockedOn=a,!1;t.shift()}return!0}function Vm(e,t,a){Ks(e)&&a.delete(t)}function MS(){af=!1,ma!==null&&Ks(ma)&&(ma=null),pa!==null&&Ks(pa)&&(pa=null),ya!==null&&Ks(ya)&&(ya=null),Wi.forEach(Vm),eo.forEach(Vm)}function Fs(e,t){e.blockedOn===t&&(e.blockedOn=null,af||(af=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,MS)))}var Js=null;function Xm(e){Js!==e&&(Js=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Js===e&&(Js=null);for(var t=0;t<e.length;t+=3){var a=e[t],i=e[t+1],u=e[t+2];if(typeof i!="function"){if(nf(i||a)===null)continue;break}var f=$n(a);f!==null&&(e.splice(t,3),t-=3,tc(f,{pending:!0,data:u,method:a.method,action:i},i,u))}}))}function Zl(e){function t(O){return Fs(O,e)}ma!==null&&Fs(ma,e),pa!==null&&Fs(pa,e),ya!==null&&Fs(ya,e),Wi.forEach(t),eo.forEach(t);for(var a=0;a<va.length;a++){var i=va[a];i.blockedOn===e&&(i.blockedOn=null)}for(;0<va.length&&(a=va[0],a.blockedOn===null);)km(a),a.blockedOn===null&&va.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(i=0;i<a.length;i+=3){var u=a[i],f=a[i+1],S=u[pt]||null;if(typeof f=="function")S||Xm(a);else if(S){var E=null;if(f&&f.hasAttribute("formAction")){if(u=f,S=f[pt]||null)E=S.formAction;else if(nf(u)!==null)continue}else E=S.action;typeof E=="function"?a[i+1]=E:(a.splice(i,3),i-=3),Xm(a)}}}function Zm(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(S){return u=S})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),i||setTimeout(a,20)}function a(){if(!i&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function lf(e){this._internalRoot=e}Ps.prototype.render=lf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var a=t.current,i=Lt();Lm(a,i,e,t,null,null)},Ps.prototype.unmount=lf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Lm(e.current,2,null,e,null,null),Rs(),t[bn]=null}};function Ps(e){this._internalRoot=e}Ps.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ho();e={blockedOn:null,target:e,priority:t};for(var a=0;a<va.length&&t!==0&&t<va[a].priority;a++);va.splice(a,0,e),a===0&&km(e)}};var $m=l.version;if($m!=="19.2.5")throw Error(s(527,$m,"19.2.5"));j.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=h(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var zS={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ws=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ws.isDisabled&&Ws.supportsFiber)try{Ca=Ws.inject(zS),vt=Ws}catch{}}return ao.createRoot=function(e,t){if(!r(e))throw Error(s(299));var a=!1,i="",u=eg,f=tg,S=ng;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(S=t.onRecoverableError)),t=Hm(e,1,!1,null,null,a,i,null,u,f,S,Zm),e[bn]=t.current,qc(e),new lf(t)},ao.hydrateRoot=function(e,t,a){if(!r(e))throw Error(s(299));var i=!1,u="",f=eg,S=tg,E=ng,O=null;return a!=null&&(a.unstable_strictMode===!0&&(i=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(f=a.onUncaughtError),a.onCaughtError!==void 0&&(S=a.onCaughtError),a.onRecoverableError!==void 0&&(E=a.onRecoverableError),a.formState!==void 0&&(O=a.formState)),t=Hm(e,1,!0,t,a??null,i,u,O,f,S,E,Zm),t.context=Um(null),a=t.current,i=Lt(),i=ci(i),u=aa(i),u.callback=null,la(a,u,i),a=i,t.current.lanes=a,za(t,a),fn(t),e[bn]=t.current,qc(e),new Ps(t)},ao.version="19.2.5",ao}var ap;function qS(){if(ap)return rf.exports;ap=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(),rf.exports=BS(),rf.exports}var IS=qS();const lp=n=>{let l;const o=new Set,s=(h,v)=>{const y=typeof h=="function"?h(l):h;if(!Object.is(y,l)){const p=l;l=v??(typeof y!="object"||y===null)?y:Object.assign({},l,y),o.forEach(x=>x(l,p))}},r=()=>l,g={setState:s,getState:r,getInitialState:()=>m,subscribe:h=>(o.add(h),()=>o.delete(h))},m=l=n(s,r,g);return g},GS=(n=>n?lp(n):lp),YS=n=>n;function kS(n,l=YS){const o=so.useSyncExternalStore(n.subscribe,so.useCallback(()=>l(n.getState()),[n,l]),so.useCallback(()=>l(n.getInitialState()),[n,l]));return so.useDebugValue(o),o}const ip=n=>{const l=GS(n),o=s=>kS(l,s);return Object.assign(o,l),o},VS=(n=>n?ip(n):ip);function op(n){return Array.isArray(n.images)}async function ct(n,l){const o=await fetch(n,l),s=await o.json().catch(()=>({}));if(!o.ok){const r=s.error,c=s.code,d=typeof r=="string"?r:r?.message??`Request failed: ${o.status}`,g=new Error(d);throw g.status=o.status,typeof r!="string"&&r?.code?g.code=r.code:c&&(g.code=c),typeof s.currentVersion=="number"&&(g.currentVersion=s.currentVersion),g}return s}function df(n){const l=new URLSearchParams;n?.kind&&l.set("kind",n.kind),n?.sessionId&&l.set("sessionId",n.sessionId),n?.includeTerminal&&l.set("includeTerminal","1");const o=l.size>0?`?${l.toString()}`:"";return ct(`/api/inflight${o}`)}async function sp(n){await fetch(`/api/inflight/${encodeURIComponent(n)}`,{method:"DELETE"}).catch(()=>{})}function XS(){return ct("/api/oauth/status")}function ZS(){return ct("/api/billing")}function $S(n){return ct("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}function Of(n={}){const l=new URLSearchParams;return l.set("limit",String(n.limit??50)),n.since!=null&&l.set("since",String(n.since)),n.cursor&&(l.set("before",String(n.cursor.before)),l.set("beforeFilename",n.cursor.beforeFilename)),n.sessionId&&l.set("sessionId",n.sessionId),ct(`/api/history?${l.toString()}`)}function QS(n={}){const l=new URLSearchParams;return l.set("groupBy","session"),l.set("limit",String(n.limit??200)),n.cursor&&(l.set("before",String(n.cursor.before)),l.set("beforeFilename",n.cursor.beforeFilename)),ct(`/api/history?${l.toString()}`)}function KS(n){return ct(`/api/history/${encodeURIComponent(n)}`,{method:"DELETE"})}function FS(n,l){return ct(`/api/history/${encodeURIComponent(n)}/restore`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({trashId:l})})}function JS(n){let l="message";const o=[];for(const r of n.split(`
|
|
10
|
+
`))r.startsWith("event:")&&(l=r.slice(6).trim()),r.startsWith("data:")&&o.push(r.slice(5).trimStart());if(o.length===0)return null;const s=o.join(`
|
|
11
|
+
`);return!s||s==="[DONE]"?null:{event:l,data:JSON.parse(s)}}async function PS(n,l={}){const o=await fetch("/api/node/generate",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(n)});if(!(o.headers.get("content-type")??"").includes("text/event-stream")){const m=await o.json().catch(()=>({}));if(!o.ok){const h=m,v=h?.error?.message??`Request failed: ${o.status}`,y=new Error(v);throw y.code=h?.error?.code,y}return m}if(!o.ok||!o.body)throw new Error(`Request failed: ${o.status}`);const r=o.body.getReader(),c=new TextDecoder;let d="",g=null;for(;;){const{done:m,value:h}=await r.read();if(m)break;d+=c.decode(h,{stream:!0});let v=d.indexOf(`
|
|
12
|
+
|
|
13
|
+
`);for(;v!==-1;){const y=d.slice(0,v);d=d.slice(v+2);const p=JS(y);if(p){if(p.event==="partial")l.onPartial?.(p.data);else if(p.event==="phase")l.onPhase?.(p.data);else if(p.event==="done")g=p.data;else if(p.event==="error"){const x=p.data,_=x?.error?.message??"Node generation failed",M=new Error(_);throw M.code=x?.error?.code,M}}v=d.indexOf(`
|
|
14
|
+
|
|
15
|
+
`)}}if(!g)throw new Error("Node stream ended without a final image");return g}function WS(){return ct("/api/sessions")}function eb(n){return ct("/api/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:n})})}function Dy(n){return ct(`/api/sessions/${encodeURIComponent(n)}`)}function tb(n,l){return ct(`/api/sessions/${encodeURIComponent(n)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:l})})}function nb(n){return ct(`/api/sessions/${encodeURIComponent(n)}`,{method:"DELETE"})}function ab(n,l,o,s){return ct(`/api/sessions/${encodeURIComponent(n)}/graph`,{method:"PUT",headers:{"Content-Type":"application/json","If-Match":String(l)},body:JSON.stringify({nodes:o,edges:s})})}function lb(n){return ct(`/api/sessions/${encodeURIComponent(n)}/style-sheet`)}function ib(n,l,o){return ct(`/api/sessions/${encodeURIComponent(n)}/style-sheet`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({styleSheet:l,enabled:o})})}function ob(n,l){return ct(`/api/sessions/${encodeURIComponent(n)}/style-sheet/enabled`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:l})})}function sb(n,l,o){return ct(`/api/sessions/${encodeURIComponent(n)}/style-sheet/extract`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:l,referenceDataUrl:o})})}function rb(n,l=256){return new Promise(o=>{const s=new Image;s.onload=()=>{const r=Math.min(1,l/Math.max(s.width,s.height)),c=document.createElement("canvas");c.width=s.width*r,c.height=s.height*r;const d=c.getContext("2d");if(!d)return o(n);d.drawImage(s,0,0,c.width,c.height),o(c.toDataURL("image/jpeg",.6))},s.onerror=()=>o(n),s.src=n})}const ub={maxB64Bytes:6e6,preserveTransparency:!1,maxEdge:4096,qualityLadder:[.85,.7,.55]},rp=16777216;function cb(n,l,o){let s=n,r=l;if(s<=0||r<=0)return{w:1,h:1};const c=Math.max(s,r);if(c>o){const d=o/c;s=Math.round(s*d),r=Math.round(r*d)}if(s*r>rp){const d=Math.sqrt(rp/(s*r));s=Math.max(1,Math.floor(s*d)),r=Math.max(1,Math.floor(r*d))}return{w:s,h:r}}function hf(n){return new Promise((l,o)=>{const s=new FileReader;s.onload=()=>{typeof s.result=="string"?l(s.result):o(new Error("FileReader returned non-string"))},s.onerror=()=>o(s.error??new Error("FileReader failed")),s.readAsDataURL(n)})}function up(n,l,o){return new Promise((s,r)=>{n.toBlob(c=>c?s(c):r(new Error("canvas.toBlob returned null")),l,o)})}function gf(n){const l=n.indexOf(",");return l<0?n.length:n.length-l-1}async function cp(n,l={}){const o={...ub,...l},s=await hf(n);if(gf(s)<=o.maxB64Bytes)return s;let r;try{r=await createImageBitmap(n)}catch(c){throw new Error("이미지 디코드 실패. JPEG/PNG로 변환 후 다시 시도해 주세요.",{cause:c})}try{const{w:c,h:d}=cb(r.width,r.height,o.maxEdge),g=document.createElement("canvas");g.width=c,g.height=d;const m=g.getContext("2d");if(!m)throw new Error("canvas 2d context unavailable");if(m.drawImage(r,0,0,c,d),o.preserveTransparency){const h=await up(g,"image/png"),v=await hf(h);if(gf(v)>o.maxB64Bytes)throw new Error("이미지 압축 실패. JPEG/PNG로 미리 변환 후 다시 시도해 주세요.");return v}for(const h of o.qualityLadder){const v=await up(g,"image/jpeg",h),y=await hf(v);if(gf(y)<=o.maxB64Bytes)return y}throw new Error("이미지 압축 실패. JPEG/PNG로 미리 변환 후 다시 시도해 주세요.")}finally{r.close?.()}}function er(n){const l=(n.type||"").toLowerCase();if(l.includes("heic")||l.includes("heif"))return!0;const o=(n.name||"").toLowerCase();return o.endsWith(".heic")||o.endsWith(".heif")}function fp(n){return(n.type||"").toLowerCase()==="image/png"}const fb={ok:"확인",cancel:"취소",delete:"삭제",close:"닫기"},db={localStorageFull:"로컬 저장소가 가득 차서 최근 상태가 저장되지 않을 수 있습니다.",refLimitExceeded:"참조 이미지는 최대 5장까지 추가할 수 있습니다. 초과한 이미지는 제외되었습니다.",refTooLarge:"이미지가 너무 큽니다. JPEG/PNG로 미리 변환하거나 해상도를 낮춰 다시 시도해 주세요.",refNotBase64:"이미지 파일이 손상되었거나 지원하지 않는 형식입니다.",refEmpty:"빈 이미지 파일입니다. 다른 파일을 선택해 주세요.",refHeicUnsupported:"HEIC/HEIF는 지원하지 않습니다. JPEG 또는 PNG로 변환 후 다시 시도해 주세요.",noCurrentImageForRef:"참조로 사용할 현재 이미지가 없습니다.",refSlotFull:"참조 이미지 슬롯이 가득 찼습니다. 최대 5장까지 가능합니다.",currentImageLoadFailed:"현재 이미지를 불러오지 못했습니다.",addedCurrentAsRef:"현재 이미지를 참조에 추가했습니다.",sessionLoadFailed:"세션을 불러오지 못했습니다.",sessionCreateFailed:"세션을 만들지 못했습니다.",sessionRenameFailed:"세션 이름을 바꾸지 못했습니다.",sessionDeleteFailed:"세션을 삭제하지 못했습니다.",promptRequired:"프롬프트를 입력하세요.",nodeCreated:"노드 {id} 생성 완료 ({elapsed}초)",nodeCreateFailed:"노드 생성에 실패했습니다.",generatedBatch:"{count}장을 {elapsed}초 만에 생성했습니다.",generatedSingle:"{elapsed}초 만에 생성했습니다.",generateFailed:"생성에 실패했습니다.",sessionReloadedElsewhere:"다른 탭에서 세션이 변경되어 최신 그래프를 다시 불러왔습니다.",promptCopied:"프롬프트를 복사했습니다",imageCopied:"클립보드에 복사했습니다",copyFailed:"복사에 실패했습니다",noPromptToFork:"가져올 프롬프트가 없습니다",forkStarted:"이 이미지의 프롬프트를 가져왔습니다. 수정 후 다시 생성하세요"},hb={queued:"대기 중",streaming:"생성 중",decoding:"마무리 중"},gb={title:"크기",width:"가로",height:"세로",hint:"한 변 최소 1024, 최대 3824, 16의 배수, 비율은 최대 3:1",autoLabel:"자동",autoSub:"모델 추천",customLabel:"직접 입력",customSub:"자유 설정"},mb={title:"품질",lowLabel:"낮음",lowSub:"빠름",mediumLabel:"중간",mediumSub:"균형",highLabel:"높음",highSub:"최상"},pb={title:"모더레이션",autoLabel:"자동",autoSub:"표준 필터",lowLabel:"낮음",lowSub:"완화 필터",explain:"자동은 표준 안전 필터를 사용합니다. 낮음은 제한을 조금 완화해 경계선 프롬프트가 더 통과할 수 있습니다."},yb={title:"포맷"},vb={title:"개수"},Sb={button:"생성",buttonLoading:"생성 중 ({n})"},bb={label:"API 상태",checking:"확인 중...",offline:"오프라인",remaining:"${remaining} 남음",thisMonth:"이번 달 ${amount}",oauthFree:"OAuth 무료 사용 가능",apiDisabled:"API 키 비활성화됨 (OAuth 전용)",oauthMode:"OAuth 모드"},xb={openGalleryAria:"갤러리 열기",openGalleryTitle:"전체 갤러리 열기"},wb={closeSettings:"설정 닫기",detailSettings:"세부 설정",toggleShow:"세부 설정 보기",toggleHide:"세부 설정 숨기기",open:"열기",close:"닫기"},Eb={label:"프롬프트",refCount:"참조 {count}/{max}",refChipTitle:"참조 이미지 {n}",refChipAlt:"참조 이미지 {n}",refRemoveAria:"참조 이미지 {n} 제거",placeholder:"원하는 이미지를 설명하고, 드래그 앤 드롭이나 붙여넣기로 참조 이미지를 추가할 수 있어요...",placeholderWithRefs:"첨부한 이미지로 무엇을 만들지 설명해 주세요...",attach:"첨부",attachTitle:"참조 이미지 첨부",useCurrent:"현재 결과 사용",useCurrentTitle:"현재 결과를 참조로 사용",style:"스타일",styleTitle:"스타일 일관성 설정 열기",directMode:"Direct",directModeTitle:"프롬프트를 원문 그대로 전달 (Direct 모드)",hint:"Ctrl + Enter로 생성",dropHere:"놓아서 참조 이미지로 추가 ({max}장까지)"},_b={resultAlt:"생성 결과",tokens:"{n} 토큰"},Nb={today:"오늘",yesterday:"어제",thisWeek:"이번 주",earlier:"이전",imageAltFallback:"생성 이미지",deleteTitle:"삭제 (10초 내 복구 가능)",deleteAria:"이미지 삭제",ariaLabel:"이미지 갤러리",title:"갤러리",total:"총 {n}장",totalFiltered:" / 전체 {n}장",sortByAria:"정렬 기준",sortByDate:"날짜",sortBySession:"세션",searchPlaceholder:"프롬프트나 파일명을 검색",searchDisabledPlaceholder:"세션 보기에서는 검색이 비활성화됩니다",closeAria:"갤러리 닫기",closeTitle:"닫기 (Esc)",sessionLabel:"세션 {name}",standalone:"독립 이미지",emptySessions:"아직 저장된 세션이 없습니다.",emptyAll:"아직 생성된 이미지가 없습니다. 먼저 하나 만들어보세요.",noResults:"검색 결과가 없습니다.",deleted:"삭제됨: {filename}",undo:"되돌리기",secondsSuffix:"{n}초"},Ab={empty:"비어 있음",pending:"생성 중",reconciling:"동기화 중",reconcilingPhase:"동기화 중 · {phase}",ready:"완료 · {elapsed}s",readyWithSearch:"완료 · {elapsed}s · 검색 {searches}",stale:"오래된 상태",staleWithError:"오래된 상태: {error}",assetMissing:"에셋 누락",assetMissingWithError:"에셋 누락: {error}",error:"오류: {error}",errorUnknown:"알 수 없음",nodeImageAlt:"노드 이미지",partialImageAlt:"노드 중간 이미지 미리보기",noAsset:"에셋 없음",stateStale:"상태 오래됨",noImage:"이미지 없음",editPromptPlaceholder:"수정 프롬프트...",promptPlaceholder:"프롬프트...",regenerate:"다시 생성",generate:"생성",addChild:"자식 추가",duplicateBranch:"브랜치 복제",duplicateBranchTitle:"새 브랜치 루트로 복제",deleteTitle:"삭제",attachRef:"첨부",attachRefTitle:"노드 참조 이미지 첨부",refAlt:"노드 참조 이미지 {n}",removeRef:"참조 이미지 {n} 제거",dropRefs:"이미지를 여기에 놓기",nodeRefsUnsupportedForEdit:"추가 참조 이미지는 현재 루트 노드에서만 지원합니다.",classicRefsParkedTitle:"클래식 참조 이미지가 보관 중입니다",classicRefsParkedBody:"이 이미지는 클래식 작성창용이라 노드 모드 생성에는 사용되지 않습니다.",clearParkedRefs:"보관된 참조 비우기",styleSheetActive:"세션 스타일 시트 적용 중"},Tb={authTitle:"인증 방식",apiLabel:"API 키",oauthNotReady:"OAuth 프록시가 아직 준비되지 않았습니다.",codexLoginRequired:"Codex 로그인이 필요합니다.",codexLoginHint:"터미널에서 `codex login`을 실행한 뒤 이 페이지를 새로고침하세요.",oauthStarting:"OAuth 프록시가 시작 중입니다. 몇 초 후 다시 시도하세요.",serverUnreachable:"서버에 연결할 수 없습니다. 백엔드가 실행 중인지 확인하세요.",apiInvalid:"API 키가 없거나 유효하지 않습니다. 서버의 .env 파일에서 OPENAI_API_KEY를 확인하세요.",availableTitle:"{name} 사용 가능",availableAria:"{name}: 사용 가능",unavailableAria:"{name}: 사용 불가",availableSr:"(사용 가능)",unavailableSr:"(사용 불가)"},Cb={free:"무료",approx:"약 ${amount}",label:"예상 비용"},Mb={download:"다운로드",copyImage:"이미지 복사",copyPrompt:"프롬프트 복사",continueHere:"여기서 이어서",continueHereTitle:"이 이미지의 프롬프트를 가져와 이어서 작업"},zb={switchTitle:"세션 전환",loading:"불러오는 중...",newSession:"새 세션",newSessionTitle:"새 세션",renameTitle:"이름 변경",renamePrompt:"세션 이름",deleteTitle:"삭제",deleteConfirm:'"{title}" 세션을 삭제할까요? 이 작업은 되돌릴 수 없습니다.',empty:"아직 세션이 없습니다",firstGraph:"첫 번째 그래프",untitled:"제목 없는 세션",assetAbortedError:"생성이 정상적으로 끝나지 않았습니다. 이 노드에서 다시 시도하세요."},Db={ariaLabel:"UI 모드",classic:"기본",node:"노드"},Rb={appName:"이미지 생성기",nodeModeHint:"노드 모드에서는 노드를 눌러 프롬프트를 수정한 뒤 생성하세요. 오른쪽 패널의 설정 (품질/크기)은 새로 만드는 모든 결과에 적용됩니다."},Ob={openAria:"설정 열기",openTitle:"설정",closeAria:"설정 닫기",closeTitle:"캔버스로 돌아가기",navAria:"설정 섹션",contentAria:"설정 내용",jumpTo:"{section} 섹션으로 이동",eyebrow:"작업공간 설정",title:"설정",subtitle:"계정, 화면, 앞으로 늘어날 작업공간 옵션을 이곳에 모아 생성 흐름은 가볍게 유지합니다.",sections:{account:{title:"계정",hint:"OAuth 상태"},appearance:{title:"화면",hint:"라이트/다크"},language:{title:"언어",hint:"UI 문구"},future:{title:"예정",hint:"확장 공간"}},account:{primaryEyebrow:"현재 공급자",oauthTitle:"OAuth 사용 중",oauthBody:"현재 생성은 Codex OAuth 세션으로 실행됩니다. 이 빌드에서는 API-Key 생성 모드가 비활성화되어 있습니다.",apiSourceEnv:"OPENAI_API_KEY 감지됨",apiSourceConfig:"config.json API 키 감지됨",apiTitle:"Configured but disabled",apiBody:"env/config에서 API 키를 찾았지만, 지금 ima2-gen은 OAuth 전용으로 동작합니다. 이 상태 표시를 숨기고 싶을 때만 키를 제거하세요.",apiDisabled:"비활성화",apiUnknown:"상태 불명"},appearance:{themeTitle:"테마",themeBody:"이 기기에서 작업공간을 어떤 톤으로 볼지 선택합니다."},language:{title:"언어",body:"생성 프롬프트와 무관하게 인터페이스 언어만 바꿉니다."},future:{title:"나중을 위한 자리",body:"OAuth 복구 도구나 작업공간 옵션이 실제로 필요해지면 이곳에 추가합니다."}},jb={loading:"세션 불러오는 중...",addFirst:"+ 첫 노드 추가",addRootTitle:"루트 노드 추가",hint:"핸들을 빈 공간으로 드래그하면 새 브랜치가 생깁니다. Delete 또는 Backspace로 삭제할 수 있습니다."},Hb={title:"{provider} 사용 불가",ariaLabel:"{provider} 사용 불가"},Ub={label:"언어",ko:"한국어",en:"English"},Lb={label:"테마",system:"시스템",dark:"다크",light:"라이트"},Bb={toggle:"스타일 일관성 적용",extract:"프롬프트에서 추출",extracting:"추출 중…",edit:"편집",save:"저장",cancel:"취소",emptyHint:"아직 스타일 시트가 없어요. 현재 프롬프트에서 추출해서 룩을 고정하세요.",noPrompt:"먼저 프롬프트를 입력하세요",extracted:"스타일 시트가 추출됐어요",editorTitle:"스타일 시트 편집",saved:"스타일 시트를 저장했어요",errNoKey:"스타일 시트 추출에는 OpenAI API 키가 필요해요. setup에서 연결해주세요.",errBadOutput:"모델이 사용 가능한 시트를 못 만들었어요 — 프롬프트를 더 구체적으로 적어주세요.",placeholderMedium:"예: 유화, 시네마틱 사진",placeholderComposition:"예: 중앙 인물, 와이드 풍경",placeholderMood:"예: 시네마틱, 몽환적",placeholderSubject:"예: 빨간 재킷 입은 젊은 여성",placeholderPalette:"#0a0a0a, #f97316, 따뜻한 앰버",placeholderNegative:"blur, 워터마크, 텍스트",fields:{medium:"매체",composition:"구도",mood:"분위기",subject:"피사체 디테일",palette:"팔레트 (쉼표로 구분된 hex 또는 이름)",negative:"네거티브 (쉼표로 구분)"}},qb={close:"닫기",details:"자세한 원본 오류 보기",unknown:{title:"알 수 없는 오류가 발생했어요",body:"잠시 후 다시 시도해 주세요. 문제가 계속되면 원본 오류 메시지를 복사해 제보해 주세요."},moderationRefused:{title:"프롬프트가 모더레이션에 걸렸어요",body:"표현 수위를 낮추거나 다른 문구로 바꿔 보세요. 레퍼런스 이미지의 선정적/폭력적 요소도 영향을 줄 수 있어요.",cta:"프롬프트 수정"},upstream5xx:{title:"OpenAI 서버가 혼잡합니다",body:"잠시 후 다시 시도하면 대부분 해결돼요. 상태 페이지(status.openai.com)도 확인해 보세요.",cta:"다시 시도"},authChatgptExpired:{title:"Codex ChatGPT 로그인이 만료됐어요",body:"터미널에서 `npx @openai/codex login`을 다시 실행한 뒤 앱을 새로고침해 주세요.",cta:"새로고침"},authApiKeyInvalid:{title:"API 키 인증 실패",body:"키가 잘못됐거나 한도/조직 권한 문제예요. 본 앱은 API-Key 모드가 비활성화되어 있어 OAuth(ChatGPT 로그인)로 전환하는 편이 좋아요.",cta:"확인"},networkFailed:{title:"네트워크 연결 실패",body:"OpenAI/로컬 OAuth 프록시에 연결하지 못했어요. VPN/방화벽이나 `status.openai.com`을 확인해 주세요.",cta:"새로고침"},oauthUnavailable:{title:"OAuth 프록시를 사용할 수 없어요",body:"로컬 OAuth 프록시가 실행 중이 아니에요. `ima2 serve`를 재시작한 뒤 다시 시도해 주세요.",cta:"새로고침"},apikeyDisabled:{title:"API-Key 모드가 비활성화되어 있어요",body:"본 앱은 OAuth(ChatGPT 로그인) 전용으로 동작합니다. 공급자를 OAuth로 전환해 주세요.",cta:"확인"}},Ib={common:fb,toast:db,inflight:hb,size:gb,quality:mb,moderation:pb,format:yb,count:vb,generate:Sb,billing:bb,history:xb,panel:wb,prompt:Eb,canvas:_b,gallery:Nb,node:Ab,provider:Tb,cost:Cb,result:Mb,session:zb,uiMode:Db,sidebar:Rb,settings:Ob,nodeCanvas:jb,apiDisabled:Hb,language:Ub,theme:Lb,styleSheet:Bb,errorCard:qb},Gb={ok:"OK",cancel:"Cancel",delete:"Delete",close:"Close"},Yb={localStorageFull:"Local storage is full — recent state may not persist.",refLimitExceeded:"References are capped at 5. Extra images were dropped.",refTooLarge:"Image is too large. Convert to JPEG/PNG or lower the resolution and try again.",refNotBase64:"Image file is corrupted or uses an unsupported encoding.",refEmpty:"Empty image file. Please pick a different file.",refHeicUnsupported:"HEIC/HEIF is not supported. Convert to JPEG or PNG and try again.",noCurrentImageForRef:"No current image to use as reference.",refSlotFull:"Reference slots are full (max 5).",currentImageLoadFailed:"Failed to load current image.",addedCurrentAsRef:"Added current image as a reference.",sessionLoadFailed:"Failed to load session.",sessionCreateFailed:"Failed to create session.",sessionRenameFailed:"Failed to rename session.",sessionDeleteFailed:"Failed to delete session.",promptRequired:"Enter a prompt.",nodeCreated:"Node {id} created ({elapsed}s)",nodeCreateFailed:"Node generation failed.",generatedBatch:"Generated {count} images in {elapsed}s.",generatedSingle:"Generated in {elapsed}s.",generateFailed:"Generation failed.",sessionReloadedElsewhere:"Session was changed in another tab — reloaded the latest graph.",promptCopied:"Prompt copied",imageCopied:"Copied to clipboard",copyFailed:"Copy failed",noPromptToFork:"No prompt to fork",forkStarted:"Prompt imported. Edit and generate again."},kb={queued:"Queued",streaming:"Generating",decoding:"Finalizing"},Vb={title:"Size",width:"Width",height:"Height",hint:"Each side 1024–3824, multiple of 16, ratio up to 3:1",autoLabel:"Auto",autoSub:"Model pick",customLabel:"Custom",customSub:"Free form"},Xb={title:"Quality",lowLabel:"Low",lowSub:"Fast",mediumLabel:"Medium",mediumSub:"Balanced",highLabel:"High",highSub:"Best"},Zb={title:"Moderation",autoLabel:"Auto",autoSub:"Standard filter",lowLabel:"Low",lowSub:"Relaxed filter",explain:"Auto uses the standard safety filter. Low relaxes limits so borderline prompts may pass through."},$b={title:"Format"},Qb={title:"Count"},Kb={button:"Generate",buttonLoading:"Generating ({n})"},Fb={label:"API Status",checking:"Checking...",offline:"Offline",remaining:"${remaining} remaining",thisMonth:"${amount} this month",oauthFree:"OAuth · free via codex",apiDisabled:"API key disabled (OAuth only)",oauthMode:"OAuth mode"},Jb={openGalleryAria:"Open gallery",openGalleryTitle:"Open full gallery"},Pb={closeSettings:"Close settings",detailSettings:"Settings",toggleShow:"Show settings",toggleHide:"Hide settings",open:"Open",close:"Close"},Wb={label:"Prompt",refCount:"Refs {count}/{max}",refChipTitle:"Reference {n}",refChipAlt:"Reference {n}",refRemoveAria:"Remove reference {n}",placeholder:"Describe the image you want. Drag & drop or paste to attach reference images...",placeholderWithRefs:"Describe what to do with the attached images...",attach:"Attach",attachTitle:"Attach reference images",useCurrent:"Use current",useCurrentTitle:"Use current result as a reference",style:"Style",styleTitle:"Open style consistency settings",directMode:"Direct",directModeTitle:"Pass prompt through verbatim (Direct mode)",hint:"Ctrl + Enter to generate",dropHere:"Drop to attach as reference (up to {max})"},ex={resultAlt:"result",tokens:"{n} tokens"},tx={today:"Today",yesterday:"Yesterday",thisWeek:"This week",earlier:"Earlier",imageAltFallback:"Generated image",deleteTitle:"Delete (10s undo)",deleteAria:"Delete image",ariaLabel:"Image gallery",title:"Gallery",total:"{n} total",totalFiltered:" / {n} total",sortByAria:"Sort by",sortByDate:"Date",sortBySession:"Session",searchPlaceholder:"Search prompts or filenames",searchDisabledPlaceholder:"Search is disabled in session view",closeAria:"Close gallery",closeTitle:"Close (Esc)",sessionLabel:"Session {name}",standalone:"Standalone images",emptySessions:"No sessions saved yet.",emptyAll:"No images yet. Create one first.",noResults:"No results.",deleted:"Deleted: {filename}",undo:"Undo",secondsSuffix:"{n}s"},nx={empty:"Empty",pending:"Generating",reconciling:"Syncing",reconcilingPhase:"Syncing · {phase}",ready:"Done · {elapsed}s",readyWithSearch:"Done · {elapsed}s · searched {searches}",stale:"Stale",staleWithError:"Stale: {error}",assetMissing:"Asset missing",assetMissingWithError:"Asset missing: {error}",error:"Error: {error}",errorUnknown:"unknown",nodeImageAlt:"Node image",partialImageAlt:"Partial node image preview",noAsset:"No asset",stateStale:"State stale",noImage:"No image",editPromptPlaceholder:"Edit prompt...",promptPlaceholder:"Prompt...",regenerate:"Regenerate",generate:"Generate",addChild:"Add child",duplicateBranch:"Duplicate branch",duplicateBranchTitle:"Duplicate as a new branch root",deleteTitle:"Delete",attachRef:"Attach",attachRefTitle:"Attach node reference images",refAlt:"Node reference {n}",removeRef:"Remove reference {n}",dropRefs:"Drop images here",nodeRefsUnsupportedForEdit:"Extra references are only supported on root nodes for now.",classicRefsParkedTitle:"Classic references are parked",classicRefsParkedBody:"These images belong to the classic composer and are inactive in node mode.",clearParkedRefs:"Clear parked references",styleSheetActive:"Session style sheet active"},ax={authTitle:"Authentication",apiLabel:"API Key",oauthNotReady:"OAuth proxy is not ready yet.",codexLoginRequired:"Codex login required.",codexLoginHint:"Run `codex login` in your terminal, then refresh this page.",oauthStarting:"OAuth proxy is starting. Try again in a few seconds.",serverUnreachable:"Cannot reach the server. Make sure the backend is running.",apiInvalid:"API key is missing or invalid. Check OPENAI_API_KEY in the server's .env.",availableTitle:"{name} available",availableAria:"{name}: available",unavailableAria:"{name}: unavailable",availableSr:"(available)",unavailableSr:"(unavailable)"},lx={free:"free",approx:"~${amount}",label:"Est. cost"},ix={download:"Download",copyImage:"Copy image",copyPrompt:"Copy prompt",continueHere:"Continue here",continueHereTitle:"Import this image's prompt and keep working"},ox={switchTitle:"Switch session",loading:"Loading...",newSession:"New session",newSessionTitle:"New session",renameTitle:"Rename",renamePrompt:"Session name",deleteTitle:"Delete",deleteConfirm:'Delete session "{title}"? This cannot be undone.',empty:"No sessions yet",firstGraph:"My first graph",untitled:"Untitled session",assetAbortedError:"Generation did not finish cleanly. Retry from this node."},sx={ariaLabel:"UI mode",classic:"Classic",node:"Node"},rx={appName:"Image Generator",nodeModeHint:"In node mode, click a node to edit its prompt and generate. Settings on the right panel (quality/size) apply to every new result."},ux={openAria:"Open settings",openTitle:"Settings",closeAria:"Close settings",closeTitle:"Return to canvas",navAria:"Settings sections",contentAria:"Settings content",jumpTo:"Jump to {section}",eyebrow:"Workspace settings",title:"Settings",subtitle:"Account, display, and future workspace controls live here so the generator stays focused.",sections:{account:{title:"Account",hint:"OAuth status"},appearance:{title:"Appearance",hint:"Light and dark"},language:{title:"Language",hint:"Interface copy"},future:{title:"Future",hint:"Reserved"}},account:{primaryEyebrow:"Active provider",oauthTitle:"OAuth is active",oauthBody:"Generation currently runs through your Codex OAuth session. API-key generation remains disabled in this build.",apiSourceEnv:"OPENAI_API_KEY detected",apiSourceConfig:"config.json API key detected",apiTitle:"Configured but disabled",apiBody:"ima2-gen found an API key in env/config, but the app is OAuth-only right now. Remove the key only if you do not want this status shown.",apiDisabled:"Disabled",apiUnknown:"Status unknown"},appearance:{themeTitle:"Theme",themeBody:"Choose how the workspace should look on this device."},language:{title:"Language",body:"Switch the UI language without changing generated content."},future:{title:"Reserved for later",body:"Future provider repair and workspace controls will appear here when they become useful."}},cx={loading:"Loading session...",addFirst:"+ Add first node",addRootTitle:"Add root node",hint:"Drag a handle into empty space to branch. Press Delete or Backspace to remove."},fx={title:"{provider} unavailable",ariaLabel:"{provider} unavailable"},dx={label:"Language",ko:"한국어",en:"English"},hx={label:"Theme",system:"System",dark:"Dark",light:"Light"},gx={toggle:"Apply style consistency",extract:"Extract from prompt",extracting:"Extracting…",edit:"Edit",save:"Save",cancel:"Cancel",emptyHint:"No style sheet yet. Extract from the current prompt to lock in a look.",noPrompt:"Enter a prompt first",extracted:"Style sheet extracted",editorTitle:"Edit style sheet",saved:"Style sheet saved",errNoKey:"Style-sheet extraction needs an OpenAI API key. Connect one via setup.",errBadOutput:"Model returned an unusable sheet — try a more specific prompt.",placeholderMedium:"e.g. oil painting, cinematic photo",placeholderComposition:"e.g. centered portrait, wide landscape",placeholderMood:"e.g. cinematic, dreamlike",placeholderSubject:"e.g. young woman in red jacket",placeholderPalette:"#0a0a0a, #f97316, warm amber",placeholderNegative:"blur, watermark, text",fields:{medium:"Medium",composition:"Composition",mood:"Mood",subject:"Subject details",palette:"Palette (comma-separated hex or names)",negative:"Negative (comma-separated)"}},mx={close:"Close",details:"Show raw error details",unknown:{title:"An unexpected error occurred",body:"Please try again shortly. If it persists, copy the raw error message below and report it."},moderationRefused:{title:"Prompt blocked by moderation",body:"Soften the wording or rephrase. Sensitive/violent content in reference images can also trigger this.",cta:"Edit prompt"},upstream5xx:{title:"OpenAI is currently busy",body:"Retrying usually resolves this. Check status.openai.com if it persists.",cta:"Retry"},authChatgptExpired:{title:"Codex ChatGPT session expired",body:"Run `npx @openai/codex login` in your terminal, then reload this app.",cta:"Reload"},authApiKeyInvalid:{title:"API key authentication failed",body:"The key is invalid, revoked, out of quota, or tied to the wrong org. This app runs in OAuth mode, so switch to ChatGPT login.",cta:"OK"},networkFailed:{title:"Network connection failed",body:"Could not reach OpenAI or the local OAuth proxy. Check VPN/firewall and status.openai.com.",cta:"Reload"},oauthUnavailable:{title:"OAuth proxy unavailable",body:"The local OAuth proxy is not running. Restart `ima2 serve` and try again.",cta:"Reload"},apikeyDisabled:{title:"API-key mode is disabled",body:"This app is OAuth-only (ChatGPT login). Switch the provider to OAuth.",cta:"OK"}},px={common:Gb,toast:Yb,inflight:kb,size:Vb,quality:Xb,moderation:Zb,format:$b,count:Qb,generate:Kb,billing:Fb,history:Jb,panel:Pb,prompt:Wb,canvas:ex,gallery:tx,node:nx,provider:ax,cost:lx,result:ix,session:ox,uiMode:sx,sidebar:rx,settings:ux,nodeCanvas:cx,apiDisabled:fx,language:dx,theme:hx,styleSheet:gx,errorCard:mx},dp={ko:Ib,en:px};function hp(n,l){return l.split(".").reduce((o,s)=>{if(o!=null)return o[s]},n)}function yx(n,l){return n.replace(/\{(\w+)\}/g,(o,s)=>s in l?String(l[s]):`{${s}}`)}function Ne(n,l){const o=oe.getState().locale;return Ry(o,n,l)}function Ry(n,l,o){const s=hp(dp[n],l),r=typeof s=="string"?s:hp(dp.en,l),c=typeof r=="string"?r:l;return o?yx(c,o):c}function Qe(){const n=oe(l=>l.locale);return{locale:n,t:(l,o)=>Ry(n,l,o)}}const vx=["ko","en"];function Sx(){try{const n=localStorage.getItem("ima2.locale");if(n==="ko"||n==="en")return n}catch{}return typeof navigator<"u"&&(navigator.language||"").toLowerCase().startsWith("ko")?"ko":"en"}function bx(n){try{localStorage.setItem("ima2.locale",n)}catch{}}function gp(n){return Math.round(n/16)*16}const xx=[{value:"1024x1024",label:"1024×1024",sub:"1:1"},{value:"1536x1024",label:"1536×1024",sub:"3:2"},{value:"1024x1536",label:"1024×1536",sub:"2:3"}],wx=[{value:"1360x1024",label:"1360×1024",sub:"4:3"},{value:"1024x1360",label:"1024×1360",sub:"3:4"},{value:"1824x1024",label:"1824×1024",sub:"16:9"}],Ex=[{value:"1024x1824",label:"1024×1824",sub:"9:16"},{value:"2048x2048",label:"2048×2048",sub:"2K 1:1"},{value:"2048x1152",label:"2048×1152",sub:"2K 16:9"}],_x=[{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"}];function Nx(){return[{value:"auto",label:Ne("size.autoLabel"),sub:Ne("size.autoSub")},{value:"custom",label:Ne("size.customLabel"),sub:Ne("size.customSub")}]}const $l=()=>"nc_"+Math.random().toString(36).slice(2,10);function mp(n,l){return{x:n*360,y:l*320}}const fo={REF_TOO_LARGE:{surface:"toast",toastKey:"toast.refTooLarge"},REF_NOT_BASE64:{surface:"toast",toastKey:"toast.refNotBase64"},REF_EMPTY:{surface:"toast",toastKey:"toast.refEmpty"},REF_TOO_MANY:{surface:"toast",toastKey:"toast.refLimitExceeded"},MODERATION_REFUSED:{surface:"card",cardKey:"errorCard.moderationRefused",cta:"dismiss"},SAFETY_REFUSAL:{surface:"card",cardKey:"errorCard.moderationRefused",cta:"dismiss"},UPSTREAM_5XX:{surface:"card",cardKey:"errorCard.upstream5xx",cta:"retry"},AUTH_CHATGPT_EXPIRED:{surface:"card",cardKey:"errorCard.authChatgptExpired",cta:"reauth"},AUTH_API_KEY_INVALID:{surface:"card",cardKey:"errorCard.authApiKeyInvalid",cta:"dismiss"},NETWORK_FAILED:{surface:"card",cardKey:"errorCard.networkFailed",cta:"reload"},OAUTH_UNAVAILABLE:{surface:"card",cardKey:"errorCard.oauthUnavailable",cta:"reload"},INVALID_MODERATION:{surface:"toast",toastKey:"toast.generateFailed"},APIKEY_DISABLED:{surface:"card",cardKey:"errorCard.apikeyDisabled",cta:"dismiss"},DB_ERROR:{surface:"toast",toastKey:"toast.generateFailed"},UNKNOWN:{surface:"toast",toastKey:"toast.generateFailed"}};function Ax(n){const l=(n||"").toLowerCase();return l?l.includes("content generation refused")||l.includes("moderation_blocked")||l.includes("moderation refused")?"MODERATION_REFUSED":l.includes("token is expired")||l.includes("sign in again")||l.includes("access token")&&l.includes("expired")||l.includes("token")&&l.includes("expired")&&!l.includes("api key")?"AUTH_CHATGPT_EXPIRED":l.includes("incorrect api key")||l.includes("invalid authentication")||l.includes("exceeded your current quota")||l.includes("incorrect organization")?"AUTH_API_KEY_INVALID":l.includes("failed to fetch")||l.includes("econnrefused")||l.includes("econnreset")||l.includes("enotfound")||l.includes("etimedout")||l.includes("network error")?"NETWORK_FAILED":l.includes("oauth")&&(l.includes("not running")||l.includes("unavailable"))?"OAUTH_UNAVAILABLE":l.includes("an error occurred while processing")||/\b5\d\d\b/.test(l)?"UPSTREAM_5XX":"UNKNOWN":"UNKNOWN"}function Tx(n){const l=n,o=typeof l?.message=="string"?l.message:String(n??""),s=typeof l?.code=="string"?l.code:"",r=s&&s in fo?s:Ax(o),c=fo[r]??fo.UNKNOWN;return{code:r,spec:c,message:o}}function pp(n,l){const{code:o,spec:s,message:r}=Tx(n);if(s.surface==="card")l.showErrorCard(o,{fallbackMessage:r});else{const c=s.toastKey?Ne(s.toastKey):r||Ne("toast.generateFailed");l.showToast(c,!0)}return{code:o,message:r}}function Cx(){try{const n=localStorage.getItem("ima2.rightPanelOpen");return n===null?!0:JSON.parse(n)===!0}catch{return!0}}function Mx(){try{const n=localStorage.getItem("ima2.uiMode");if(n==="node"||n==="classic")return n}catch{}return"classic"}function mf(){try{const n=localStorage.getItem("ima2:theme");if(n==="system"||n==="dark"||n==="light")return n}catch{}return"system"}function tr(n){return n==="dark"||n==="light"?n:typeof window>"u"||typeof window.matchMedia!="function"?"dark":window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}const Oy=18e4;function pf(){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(s=>s&&typeof s.id=="string"&&typeof s.prompt=="string"&&typeof s.startedAt=="number"&&o-s.startedAt<Oy).map(s=>({id:s.id,prompt:s.prompt,startedAt:s.startedAt,phase:typeof s.phase=="string"?s.phase:void 0,sessionId:typeof s.sessionId=="string"?s.sessionId:null,clientNodeId:typeof s.clientNodeId=="string"?s.clientNodeId:null,kind:s.kind==="classic"||s.kind==="node"?s.kind:void 0}))}catch{return[]}}function Fa(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{oe.getState().showToast(Ne("toast.localStorageFull"),!0)}catch{}}}}function yp(){try{const n=localStorage.getItem("ima2.selectedFilename");return typeof n=="string"&&n.length>0?n:null}catch{return null}}function ro(n){try{n?localStorage.setItem("ima2.selectedFilename",n):localStorage.removeItem("ima2.selectedFilename")}catch{}}function zx(){try{const n=localStorage.getItem("ima2.activeSessionId");return typeof n=="string"&&n.length>0?n:null}catch{return null}}function yf(n){try{n?localStorage.setItem("ima2.activeSessionId",n):localStorage.removeItem("ima2.activeSessionId")}catch{}}const Fl=500,ba=5;function vp(n){return n==="classic"||n==="edit"||n==="generate"?n:null}function Sp(n){return n.replace(/^data:[^;]+;base64,/,"")}function jy(n){const l=n.nodes.map(s=>{const r=s.data??{},c=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=c??d,m={clientId:s.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,recoveryRequestId:r.recoveryRequestId??null,pendingPhase:r.pendingPhase??null,pendingStartedAt:typeof r.pendingStartedAt=="number"?r.pendingStartedAt:null,partialImageUrl:null,error:r.error,elapsed:r.elapsed,webSearchCalls:r.webSearchCalls};return{id:s.id,type:"imageNode",position:{x:s.x,y:s.y},data:m}}),o=n.edges.map(s=>({id:s.id,source:s.source,target:s.target}));return{graphNodes:l,graphEdges:o,graphVersion:n.graphVersion}}const oe=VS((n,l)=>({provider:"oauth",quality:"medium",sizePreset:"1024x1024",customW:1920,customH:1088,format:"png",moderation:"low",count:1,promptMode:"auto",prompt:"",referenceImages:[],addReferences:async o=>{const s=ba-l().referenceImages.length,r=o.slice(0,Math.max(0,s)),c=r.filter(er),d=r.filter(v=>!er(v)),m=(await Promise.all(d.map(async v=>{try{return await cp(v,{preserveTransparency:fp(v)})}catch(y){return console.warn("[addReferences] compress failed",y),null}}))).filter(v=>!!v);n(v=>({referenceImages:[...v.referenceImages,...m].slice(0,ba)})),c.length>0&&l().showToast(Ne("toast.refHeicUnsupported"),!0),d.length-m.length>0&&l().showToast(Ne("toast.refTooLarge"),!0),o.length>s&&l().showToast(Ne("toast.refLimitExceeded"),!0)},addReferenceDataUrl:o=>{n(s=>s.referenceImages.length>=ba?s:{referenceImages:[...s.referenceImages,o]})},removeReference:o=>{n(s=>({referenceImages:s.referenceImages.filter((r,c)=>c!==o)}))},clearReferences:()=>n({referenceImages:[]}),useCurrentAsReference:async()=>{const o=l().currentImage;if(!o){l().showToast(Ne("toast.noCurrentImageForRef"),!0);return}if(l().referenceImages.length>=ba){l().showToast(Ne("toast.refSlotFull"),!0);return}let s=o.image;if(!s.startsWith("data:"))try{const c=await(await fetch(s)).blob();s=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(c)})}catch{l().showToast(Ne("toast.currentImageLoadFailed"),!0);return}n(r=>({referenceImages:[...r.referenceImages,s].slice(0,ba)})),l().showToast(Ne("toast.addedCurrentAsRef"))},activeGenerations:pf().length,inFlight:pf(),startInFlightPolling:()=>{if(typeof window>"u")return;const o=window;if(o.__ima2InflightTimer)return;const s=async()=>{if(l().inFlight.length===0){o.__ima2InflightTimer&&(clearInterval(o.__ima2InflightTimer),o.__ima2InflightTimer=void 0);return}try{const c=l().uiMode==="node"?"node":"classic",d=c==="node"?l().activeSessionId??void 0:void 0,{jobs:g}=await df({kind:c,sessionId:d}),m=new Map(g.map(x=>[x.requestId,x.phase]));let h=!1;const v=Date.now(),y=5e3,p=[];for(const x of l().inFlight){if(!((x.kind??"classic")===c&&(c!=="node"||(x.sessionId??null)===(d??null)))){p.push(x);continue}if(!m.has(x.id)&&v-x.startedAt>y){h=!0;continue}const N=m.get(x.id);N&&N!==x.phase?(h=!0,p.push({...x,phase:N})):p.push(x)}h&&(Fa(p),n({inFlight:p,activeGenerations:p.length}))}catch{}try{const c=l().history.reduce((p,x)=>x.createdAt&&x.createdAt>p?x.createdAt:p,0),{items:d}=await Of({limit:Fl,since:c}),g=d.map(p=>({image:p.url,url:p.url,filename:p.filename,thumb:p.url,prompt:p.prompt??void 0,size:p.size??void 0,quality:p.quality??void 0,format:p.format,createdAt:p.createdAt,sessionId:p.sessionId??null,nodeId:p.nodeId??null,clientNodeId:p.clientNodeId??null,requestId:p.requestId??null,kind:vp(p.kind),refsCount:p.refsCount??0})),m=l().history,h=g.filter(p=>!m.some(x=>x.filename===p.filename));h.length>0&&n(p=>{const x=p.currentImage??h[0];return!p.currentImage&&h[0]?.filename&&ro(h[0].filename),{history:[...h,...p.history].slice(0,Fl),currentImage:x}});const v=Date.now(),y=l().inFlight.filter(p=>v-p.startedAt<Oy);y.length!==l().inFlight.length&&(Fa(y),n({inFlight:y,activeGenerations:y.length}))}catch{}};o.__ima2InflightTimer=window.setInterval(s,1500)},reconcileInflight:async()=>{try{const o=l().uiMode==="node"?"node":"classic",s=o==="node"?l().activeSessionId??void 0:void 0,{jobs:r}=await df({kind:o,sessionId:s}),c=new Set(r.map(v=>v.requestId)),d=Date.now(),m=l().inFlight.filter(v=>c.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});Fa(m),n({inFlight:m,activeGenerations:m.length}),m.length>0&&l().startInFlightPolling()}catch{}},syncFromStorage:()=>{const o=pf(),s=yp();n(r=>({inFlight:o,activeGenerations:o.length,currentImage:s&&r.currentImage?.filename!==s?r.history.find(c=>c.filename===s)??r.currentImage:r.currentImage})),o.length>0&&l().startInFlightPolling()},currentImage:null,history:[],toast:null,errorCard:null,rightPanelOpen:Cx(),toggleRightPanel:()=>n(o=>{const s=!o.rightPanelOpen;try{localStorage.setItem("ima2.rightPanelOpen",JSON.stringify(s))}catch{}return{rightPanelOpen:s}}),galleryOpen:!1,openGallery:()=>n({galleryOpen:!0}),closeGallery:()=>n({galleryOpen:!1}),settingsOpen:!1,activeSettingsSection:"account",openSettings:(o="account")=>n({settingsOpen:!0,activeSettingsSection:o}),closeSettings:()=>n({settingsOpen:!1}),toggleSettings:()=>n(o=>({settingsOpen:!o.settingsOpen,activeSettingsSection:o.settingsOpen?o.activeSettingsSection:"account"})),setActiveSettingsSection:o=>n({activeSettingsSection:o}),uiMode:Mx(),setUIMode:o=>{try{localStorage.setItem("ima2.uiMode",o)}catch{}n({uiMode:o})},theme:mf(),resolvedTheme:tr(mf()),setTheme:o=>{try{localStorage.setItem("ima2:theme",o)}catch{}n({theme:o,resolvedTheme:tr(o)})},syncThemeFromStorage:()=>{const o=mf();n({theme:o,resolvedTheme:tr(o)})},refreshResolvedTheme:()=>{n(o=>({resolvedTheme:tr(o.theme)}))},locale:Sx(),setLocale:o=>{bx(o),n({locale:o})},graphNodes:[],graphEdges:[],setGraphNodes:o=>{n({graphNodes:o}),l().scheduleGraphSave()},setGraphEdges:o=>{n({graphEdges:o}),l().scheduleGraphSave()},sessions:[],activeSessionId:null,activeSessionGraphVersion:null,sessionLoading:!1,styleSheet:null,styleSheetEnabled:!1,styleSheetExtracting:!1,async loadStyleSheet(){const o=l().activeSessionId;if(!o){n({styleSheet:null,styleSheetEnabled:!1});return}try{const s=await lb(o);if(l().activeSessionId!==o)return;n({styleSheet:s.styleSheet,styleSheetEnabled:!!s.enabled})}catch(s){console.warn("[styleSheet] load failed:",s)}},async saveStyleSheet(o,s){const r=l().activeSessionId;if(r)try{if(await ib(r,o,s),l().activeSessionId!==r)return;n({styleSheet:o,...typeof s=="boolean"?{styleSheetEnabled:s}:{}}),l().showToast(Ne("styleSheet.saved"))}catch(c){console.warn("[styleSheet] save failed:",c),l().showToast(c.message,!0)}},async toggleStyleSheetEnabled(){const o=l().activeSessionId;if(!o)return;const s=!l().styleSheetEnabled;try{if(await ob(o,s),l().activeSessionId!==o)return;n({styleSheetEnabled:s})}catch(r){console.warn("[styleSheet] toggle failed:",r),l().showToast(r.message,!0)}},async extractStyleSheet(){const o=l().activeSessionId;if(!o)return;const s=l().prompt.trim();if(!s){l().showToast(Ne("styleSheet.noPrompt"),!0);return}const r=l().referenceImages[0];n({styleSheetExtracting:!0});try{const{styleSheet:c}=await sb(o,s,r);if(l().activeSessionId!==o){n({styleSheetExtracting:!1});return}n({styleSheet:c,styleSheetEnabled:!0,styleSheetExtracting:!1}),l().showToast(Ne("styleSheet.extracted"))}catch(c){n({styleSheetExtracting:!1}),console.warn("[styleSheet] extract failed:",c);const d=c.code,g=d==="STYLE_SHEET_NO_KEY"?Ne("styleSheet.errNoKey"):d==="STYLE_SHEET_EMPTY"||d==="STYLE_SHEET_PARSE"||d==="STYLE_SHEET_SHAPE"?Ne("styleSheet.errBadOutput"):c.message;l().showToast(g,!0)}},async loadSessions(){try{const{sessions:o}=await WS();if(n({sessions:o}),!l().activeSessionId){const r=zx(),c=r?o.some(d=>d.id===r):!1;r&&c?await l().switchSession(r):await l().createAndSwitchSession(Ne("session.firstGraph"))}}catch(o){console.warn("[sessions] load failed:",o)}},async switchSession(o){n({sessionLoading:!0}),await l().flushGraphSave();try{const{session:s}=await Dy(o),{graphNodes:r,graphEdges:c,graphVersion:d}=jy(s);n({activeSessionId:o,activeSessionGraphVersion:d,graphNodes:r,graphEdges:c,sessionLoading:!1}),yf(o),await l().reconcileGraphPending().catch(()=>{}),l().loadStyleSheet().catch(()=>{})}catch(s){console.warn("[sessions] switch failed:",s),n({sessionLoading:!1}),l().showToast(Ne("toast.sessionLoadFailed"),!0)}},async reconcileGraphPending(){const o=l().activeSessionId;if(!o)return;if(l().graphNodes.filter(r=>r.data?.pendingRequestId&&(r.data.status==="pending"||r.data.status==="reconciling")).length>0){let r=[];try{r=(await df({kind:"node",sessionId:o})).jobs}catch{r=[]}const c=new Map(r.map(h=>[h.requestId,h.phase])),d=Date.now(),g=1e4,m=l().graphNodes.map(h=>{const v=h.data?.pendingRequestId;if(!v||h.data.status!=="pending"&&h.data.status!=="reconciling")return h;if(c.has(v)){const x=c.get(v)??null;return{...h,data:{...h.data,status:"reconciling",pendingPhase:x}}}const y=h.data.pendingStartedAt??0;if(y&&d-y<g)return{...h,data:{...h.data,status:"reconciling"}};const p=!!h.data.imageUrl||!!h.data.serverNodeId;return{...h,data:{...h.data,pendingRequestId:null,pendingPhase:null,pendingStartedAt:null,partialImageUrl:null,status:p?"ready":"stale",error:p?void 0:Ne("session.assetAbortedError")}}});n({graphNodes:m})}await Uy(l,n).catch(()=>{})},async createAndSwitchSession(o){o==null&&(o=Ne("session.untitled"));try{const{session:s}=await eb(o);n({sessions:[s,...l().sessions],activeSessionId:s.id,activeSessionGraphVersion:s.graphVersion,graphNodes:[],graphEdges:[]}),yf(s.id)}catch(s){console.warn("[sessions] create failed:",s),l().showToast(Ne("toast.sessionCreateFailed"),!0)}},async renameCurrentSession(o){const s=l().activeSessionId;if(s)try{await tb(s,o),n({sessions:l().sessions.map(r=>r.id===s?{...r,title:o,updatedAt:Date.now()}:r)})}catch{l().showToast(Ne("toast.sessionRenameFailed"),!0)}},async deleteSessionById(o){try{await nb(o);const s=l().sessions.filter(r=>r.id!==o);n({sessions:s}),l().activeSessionId===o&&(n({activeSessionId:null,activeSessionGraphVersion:null,graphNodes:[],graphEdges:[]}),yf(null),s.length>0?await l().switchSession(s[0].id):await l().createAndSwitchSession(Ne("session.firstGraph")))}catch{l().showToast(Ne("toast.sessionDeleteFailed"),!0)}},scheduleGraphSave(){By(l,n)},async flushGraphSave(){await Ox(l,n)},addRootNode:()=>{const o=$l(),s=0,r=l().graphNodes.filter(d=>!d.data.parentServerNodeId).length,c={id:o,type:"imageNode",position:mp(s,r),data:{clientId:o,serverNodeId:null,parentServerNodeId:null,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};return n({graphNodes:[...l().graphNodes,c]}),l().scheduleGraphSave(),o},addChildNode:o=>{const s=l().graphNodes.find(m=>m.id===o);if(!s)return o;const r=$l(),c=l().graphEdges.filter(m=>m.source===o).length,d={id:r,type:"imageNode",position:{x:s.position.x+360,y:s.position.y+c*320},data:{clientId:r,serverNodeId:null,parentServerNodeId:s.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 s=l().graphNodes.find(y=>y.id===o);if(!s)return o;const r=l().graphEdges.find(y=>y.target===o);if(!r){const y=$l(),p=0,x=l().graphNodes.filter(M=>!M.data.parentServerNodeId).length,_={id:y,type:"imageNode",position:mp(p,x),data:{clientId:y,serverNodeId:null,parentServerNodeId:null,prompt:s.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};return n({graphNodes:[...l().graphNodes,_]}),l().scheduleGraphSave(),y}const c=r.source,d=l().graphNodes.find(y=>y.id===c);if(!d)return o;const g=$l(),m=l().graphEdges.filter(y=>y.source===c).length,h={id:g,type:"imageNode",position:{x:d.position.x+360,y:d.position.y+m*320},data:{clientId:g,serverNodeId:null,parentServerNodeId:s.data.parentServerNodeId,prompt:s.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},v={id:`${c}->${g}`,source:c,target:g};return n({graphNodes:[...l().graphNodes,h],graphEdges:[...l().graphEdges,v]}),l().scheduleGraphSave(),g},updateNodePrompt:(o,s)=>{n({graphNodes:l().graphNodes.map(r=>r.id===o?{...r,data:{...r.data,prompt:s}}:r)}),l().scheduleGraphSave()},addNodeReferences:async(o,s)=>{const r=l().graphNodes.find(x=>x.id===o);if(!r)return;if(r.data.parentServerNodeId){l().showToast(Ne("node.nodeRefsUnsupportedForEdit"),!0);return}const c=r.data.referenceImages??[],d=ba-c.length;if(d<=0){l().showToast(Ne("toast.refLimitExceeded"),!0);return}const g=s.slice(0,Math.max(0,d)),m=g.filter(er),h=g.filter(x=>!er(x)),y=(await Promise.all(h.map(async x=>{try{return await cp(x,{preserveTransparency:fp(x)})}catch(_){return console.warn("[addNodeReferences] compress failed",_),null}}))).filter(x=>!!x);y.length>0&&n({graphNodes:l().graphNodes.map(x=>x.id===o?{...x,data:{...x.data,referenceImages:[...x.data.referenceImages??[],...y].slice(0,ba)}}:x)}),m.length>0&&l().showToast(Ne("toast.refHeicUnsupported"),!0),h.length-y.length>0&&l().showToast(Ne("toast.refTooLarge"),!0),s.length>d&&l().showToast(Ne("toast.refLimitExceeded"),!0)},addNodeReferenceDataUrl:(o,s)=>{const r=l().graphNodes.find(c=>c.id===o);if(r){if(r.data.parentServerNodeId){l().showToast(Ne("node.nodeRefsUnsupportedForEdit"),!0);return}n({graphNodes:l().graphNodes.map(c=>{if(c.id!==o)return c;const d=c.data.referenceImages??[];return d.length>=ba?c:{...c,data:{...c.data,referenceImages:[...d,s]}}})})}},removeNodeReference:(o,s)=>{n({graphNodes:l().graphNodes.map(r=>r.id===o?{...r,data:{...r.data,referenceImages:(r.data.referenceImages??[]).filter((c,d)=>d!==s)}}:r)})},clearNodeReferences:o=>{n({graphNodes:l().graphNodes.map(s=>s.id===o?{...s,data:{...s.data,referenceImages:void 0}}:s)})},duplicateBranchRoot:o=>{const s=l().graphNodes.find(d=>d.id===o);if(!s)return o;const r=$l();l().graphNodes.filter(d=>!d.data.parentServerNodeId).length;const c={id:r,type:"imageNode",position:{x:s.position.x+420,y:s.position.y+40},data:{clientId:r,serverNodeId:null,parentServerNodeId:null,prompt:s.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};if(n({graphNodes:[...l().graphNodes,c]}),l().scheduleGraphSave(),s.data.imageUrl){const d=s.data.imageUrl;(async()=>{try{const m=await(await fetch(d)).blob(),h=await new Promise((v,y)=>{const p=new FileReader;p.onload=()=>typeof p.result=="string"?v(p.result):y(new Error("read failed")),p.onerror=()=>y(p.error??new Error("read failed")),p.readAsDataURL(m)});n({graphNodes:l().graphNodes.map(v=>v.id===r?{...v,data:{...v.data,referenceImages:[h]}}:v)})}catch{}})()}return r},async generateNode(o){const r=l().graphNodes.find(T=>T.id===o)?.data.status==="ready"?l().addSiblingNode(o):o,c=l().graphNodes.find(T=>T.id===r);if(!c)return;const{prompt:d,parentServerNodeId:g}=c.data;if(!d.trim()){l().showToast(Ne("toast.promptRequired"),!0);return}const m=c.data.referenceImages??[];if(g&&m.length>0){l().showToast(Ne("node.nodeRefsUnsupportedForEdit"),!0);return}const h=l(),v=h.getResolvedSize(),y=h.activeSessionId,p=Date.now(),x=Math.random().toString(36).slice(2,6),_=`fn_${r}_${p}_${x}`,M=[...h.inFlight,{id:_,prompt:d,startedAt:p,kind:"node",sessionId:y,clientNodeId:r}];Fa(M),n({graphNodes:l().graphNodes.map(T=>T.id===r?{...T,data:{...T.data,status:"pending",pendingRequestId:_,recoveryRequestId:_,pendingPhase:"queued",pendingStartedAt:p,partialImageUrl:null,error:void 0}}:T),activeGenerations:h.activeGenerations+1,inFlight:M}),l().startInFlightPolling();let N=!0;try{const T=await PS({parentNodeId:g,prompt:d,quality:h.quality,size:v,format:h.format,moderation:h.moderation,requestId:_,sessionId:y,clientNodeId:r,...m.length&&!g?{references:m.map(Sp)}:{}},{onPartial:U=>{l().activeSessionId===y&&n({graphNodes:l().graphNodes.map(w=>w.id===r?{...w,data:{...w.data,status:"pending",partialImageUrl:U.image,pendingPhase:"partial"}}:w)})},onPhase:U=>{l().activeSessionId===y&&U.phase&&n({graphNodes:l().graphNodes.map(w=>w.id===r?{...w,data:{...w.data,pendingPhase:U.phase??w.data.pendingPhase}}:w)})}});l().activeSessionId===y&&(n({graphNodes:l().graphNodes.map(U=>{if(U.id!==r)return U;const w={...U.data};return delete w.referenceImages,delete w.partialImageUrl,{...U,data:{...w,serverNodeId:T.nodeId,imageUrl:T.url,status:"ready",pendingRequestId:null,recoveryRequestId:null,pendingPhase:null,pendingStartedAt:null,elapsed:T.elapsed,webSearchCalls:T.webSearchCalls}}})}),N=!0,l().showToast(Ne("toast.nodeCreated",{id:T.nodeId.slice(0,8),elapsed:T.elapsed})))}catch(T){const U=T instanceof Error?T.message:Ne("toast.nodeCreateFailed");l().activeSessionId===y&&(n({graphNodes:l().graphNodes.map(w=>w.id===r?{...w,data:{...w.data,status:"error",pendingRequestId:null,pendingPhase:null,pendingStartedAt:null,partialImageUrl:null,error:U}}:w)}),N=!0,pp(T,l()))}finally{const T=l().inFlight.filter(U=>U.id!==_);Fa(T),n({activeGenerations:Math.max(0,l().activeGenerations-1),inFlight:T}),l().activeSessionId===y&&N&&l().scheduleGraphSave()}},deleteNode:o=>{const r=l().graphNodes.find(c=>c.id===o)?.data?.pendingRequestId;r&&sp(r),n({graphNodes:l().graphNodes.filter(c=>c.id!==o),graphEdges:l().graphEdges.filter(c=>c.source!==o&&c.target!==o)}),l().scheduleGraphSave()},deleteNodes:o=>{const s=new Set(o);for(const r of l().graphNodes)s.has(r.id)&&r.data?.pendingRequestId&&sp(r.data.pendingRequestId);n({graphNodes:l().graphNodes.filter(r=>!s.has(r.id)),graphEdges:l().graphEdges.filter(r=>!s.has(r.source)&&!s.has(r.target))}),l().scheduleGraphSave()},addChildNodeAt:(o,s)=>{const r=l().graphNodes.find(m=>m.id===o);if(!r)return o;const c=$l(),d={id:c,type:"imageNode",position:s,data:{clientId:c,serverNodeId:null,parentServerNodeId:r.data.serverNodeId,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},g={id:`${o}->${c}`,source:o,target:c};return n({graphNodes:[...l().graphNodes,d],graphEdges:[...l().graphEdges,g]}),l().scheduleGraphSave(),c},connectNodes:(o,s)=>{if(o===s||l().graphEdges.find(d=>d.source===o&&d.target===s))return;const c=l().graphNodes.find(d=>d.id===o);c&&(n({graphNodes:l().graphNodes.map(d=>d.id===s?{...d,data:{...d.data,parentServerNodeId:c.data.serverNodeId}}:d),graphEdges:[...l().graphEdges,{id:`${o}->${s}`,source:o,target:s}]}),l().scheduleGraphSave())},setProvider:o=>n({provider:o}),setQuality:o=>n({quality:o}),setSizePreset:o=>n({sizePreset:o}),setCustomSize:(o,s)=>n({customW:gp(o),customH:gp(s)}),setFormat:o=>n({format:o}),setModeration:o=>n({moderation:o}),setCount:o=>n({count:o}),setPromptMode:o=>n({promptMode:o}),setPrompt:o=>n({prompt:o}),selectHistory:o=>{ro(o.filename??null),n({currentImage:o})},removeFromHistory:o=>{const s=l(),r=s.history.filter(d=>d.filename!==o),c=s.currentImage&&s.currentImage.filename===o?null:s.currentImage;n({history:r,currentImage:c}),c===null&&ro(null)},addHistoryItem:o=>{const s=l();if(s.history.some(d=>o.filename&&d.filename===o.filename))return;const c={...o,createdAt:o.createdAt||Date.now()};n({history:[c,...s.history].slice(0,Fl)})},getResolvedSize:()=>{const{sizePreset:o,customW:s,customH:r}=l();return o==="custom"?`${s}x${r}`:o},async generate(){const o=l(),s=o.prompt.trim();if(!s)return;const r=o.getResolvedSize(),c=`f_${Date.now()}_${Math.random().toString(36).slice(2,7)}`,d=Date.now(),g=[...o.inFlight,{id:c,prompt:s,startedAt:d}];Fa(g),n({activeGenerations:o.activeGenerations+1,inFlight:g}),l().startInFlightPolling();try{const m={prompt:s,quality:o.quality,size:r,format:o.format,moderation:o.moderation,provider:o.provider,n:o.count,requestId:c,mode:o.promptMode,...o.referenceImages.length?{references:o.referenceImages.map(Sp)}:{}},h=await $S(m);if(op(h)&&h.images.length>1){for(const v of h.images){const y={image:v.image,filename:v.filename,prompt:s,elapsed:h.elapsed,provider:h.provider,usage:h.usage,quality:h.quality??o.quality,size:h.size??r};await bp(y,n,l)}l().showToast(Ne("toast.generatedBatch",{count:h.images.length,elapsed:h.elapsed}))}else{let v;if(op(h)){const y=h.images[0];v={image:y.image,filename:y.filename,prompt:s,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:s,elapsed:h.elapsed,provider:h.provider,usage:h.usage,quality:h.quality??o.quality,size:h.size??r};await bp(v,n,l),l().showToast(Ne("toast.generatedSingle",{elapsed:h.elapsed}))}}catch(m){pp(m,l())}finally{const m=l().inFlight.filter(h=>h.id!==c);Fa(m),n({activeGenerations:Math.max(0,l().activeGenerations-1),inFlight:m})}},hydrateHistory(){(async()=>{try{const s=(await Of({limit:Fl})).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,sessionId:r.sessionId??null,nodeId:r.nodeId??null,clientNodeId:r.clientNodeId??null,requestId:r.requestId??null,kind:vp(r.kind),refsCount:r.refsCount??0}));if(s.length>0){const r=yp(),c=r?s.find(d=>d.filename===r):null;n({history:s,currentImage:c??s[0]}),c||ro(s[0]?.filename??null)}}catch(o){console.warn("[history] load failed:",o)}})()},showToast(o,s=!1){n({toast:{message:o,error:s,id:Date.now()+Math.random()}})},showErrorCard(o,s){n({errorCard:{code:o,fallbackMessage:s?.fallbackMessage,id:Date.now()+Math.random()}})},dismissErrorCard(){n({errorCard:null})}})),Dx=800;let hn=null,yr=null;function Hy(n){const l={...n};return delete l.referenceImages,delete l.partialImageUrl,n.status==="pending"||n.status==="reconciling"?{...l,status:"empty",pendingRequestId:null,recoveryRequestId:n.pendingRequestId??n.recoveryRequestId??null,pendingPhase:null,pendingStartedAt:null,error:void 0}:l}async function Uy(n,l){const o=n().activeSessionId;if(!o||n().graphNodes.filter(g=>!g.data.imageUrl&&!g.data.serverNodeId).length===0)return;let r=[];try{r=(await Of({sessionId:o,limit:Fl})).items}catch{return}let c=!1;const d=n().graphNodes.map(g=>{if(g.data.imageUrl||g.data.serverNodeId)return g;const m=g.data.pendingStartedAt??0,h=g.data.pendingRequestId??g.data.recoveryRequestId??null,y=(h?r.find(p=>(p.sessionId??null)===o&&(p.requestId??null)===h):null)??r.find(p=>(p.sessionId??null)===o&&(p.clientNodeId??null)===g.id&&(!m||(p.createdAt??0)>=m));return y?(c=!0,{...g,data:{...g.data,status:"ready",imageUrl:y.url,serverNodeId:y.nodeId??g.data.serverNodeId,pendingRequestId:null,recoveryRequestId:null,pendingPhase:null,pendingStartedAt:null,partialImageUrl:null,error:void 0}}):g});c&&(l({graphNodes:d}),By(n,l))}async function Rx(n,l){const o=n().activeSessionId;if(!o)return;const{session:s}=await Dy(o),{graphNodes:r,graphEdges:c,graphVersion:d}=jy(s);l({graphNodes:r,graphEdges:c,activeSessionGraphVersion:d}),n().showToast(Ne("toast.sessionReloadedElsewhere"),!0),await Uy(n,l).catch(()=>{})}function Ly(n,l){const o=n().activeSessionId,s=n().activeSessionGraphVersion;if(!o||s==null)return Promise.resolve();const{graphNodes:r,graphEdges:c}=n(),d=r.map(m=>({id:m.id,x:m.position.x,y:m.position.y,data:Hy(m.data)})),g=c.map(m=>({id:m.id,source:m.source,target:m.target,data:{}}));return ab(o,s,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 By(n,l){const o=n();o.activeSessionId&&(o.sessionLoading||(hn&&clearTimeout(hn),hn=setTimeout(()=>{hn=null,yr=Ly(n,l).finally(()=>{yr=null})},Dx)))}async function Ox(n,l){hn?(clearTimeout(hn),hn=null,await Ly(n,l)):yr&&await yr}function jx(n){const l=n();if(!l.activeSessionId||l.activeSessionGraphVersion==null)return;hn&&(clearTimeout(hn),hn=null);const o=l.graphNodes.map(d=>({id:d.id,x:d.position.x,y:d.position.y,data:Hy(d.data)})),s=l.graphEdges.map(d=>({id:d.id,source:d.source,target:d.target,data:{}})),r=`/api/sessions/${encodeURIComponent(l.activeSessionId)}/graph`,c=JSON.stringify({nodes:o,edges:s});try{fetch(r,{method:"PUT",headers:{"Content-Type":"application/json","If-Match":String(l.activeSessionGraphVersion)},body:c,keepalive:!0})}catch{}}async function bp(n,l,o){const s=await rb(n.image).catch(()=>n.image),r=n.filename?`/generated/${n.filename}`:n.image,c={...n,thumb:s,url:r,createdAt:n.createdAt||Date.now()},d=[c,...o().history].slice(0,Fl);ro(c.filename??null),l({history:d,currentImage:c})}function Hx(){const{t:n}=Qe(),l=oe(s=>s.uiMode),o=oe(s=>s.setUIMode);return b.jsxs("div",{className:"ui-mode-switch",role:"tablist","aria-label":n("uiMode.ariaLabel"),children:[b.jsx("button",{type:"button",role:"tab","aria-selected":l==="classic",className:`ui-mode-switch__tab${l==="classic"?" active":""}`,onClick:()=>o("classic"),children:n("uiMode.classic")}),b.jsx("button",{type:"button",role:"tab","aria-selected":l==="node",className:`ui-mode-switch__tab${l==="node"?" active":""}`,onClick:()=>o("node"),children:n("uiMode.node")})]})}const xp={palette:[],composition:"",mood:"",medium:"",subject_details:"",negative:[]};function qy({open:n,onClose:l}){const{t:o}=Qe(),s=oe(R=>R.styleSheet),r=oe(R=>R.styleSheetEnabled),c=oe(R=>R.styleSheetExtracting),d=oe(R=>R.activeSessionId),g=oe(R=>R.toggleStyleSheetEnabled),m=oe(R=>R.extractStyleSheet),h=oe(R=>R.saveStyleSheet),[v,y]=Z.useState(!1),[p,x]=Z.useState(s??xp),[_,M]=Z.useState(!1),[N,T]=Z.useState(!1);if(Z.useEffect(()=>{n?x(s??xp):(y(!1),M(!1))},[n,s]),Z.useEffect(()=>{if(!n)return;const R=L=>{L.key==="Escape"&&!_&&l()};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[n,_,l]),!n||!d)return null;const U=!!s&&(s.composition||s.mood||s.medium||s.subject_details||s.palette.length>0),w=async()=>{if(!_){M(!0);try{await h(p,r),y(!1)}finally{M(!1)}}},D=async()=>{if(!N){T(!0);try{await g()}finally{T(!1)}}},G=R=>x(L=>({...L,...R}));return b.jsx("div",{className:"style-sheet-editor__backdrop",onClick:_?void 0:l,role:"presentation",children:b.jsxs("div",{className:"style-sheet-editor",role:"dialog","aria-modal":"true","aria-label":o("styleSheet.editorTitle"),onClick:R=>R.stopPropagation(),children:[b.jsxs("div",{className:"style-sheet-panel__header",children:[b.jsx("h3",{style:{margin:0,fontSize:16},children:o("styleSheet.editorTitle")}),b.jsxs("label",{className:"style-sheet-panel__toggle",style:{marginLeft:"auto"},children:[b.jsx("input",{type:"checkbox",checked:r,disabled:!U||N,onChange:()=>{D()}}),b.jsx("span",{children:o("styleSheet.toggle")})]})]}),!v&&b.jsxs(b.Fragment,{children:[U?b.jsxs("div",{className:"style-sheet-panel__summary",children:[s.medium&&b.jsxs("div",{children:[b.jsxs("b",{children:[o("styleSheet.fields.medium"),":"]})," ",s.medium]}),s.palette.length>0&&b.jsx("div",{className:"style-sheet-panel__chips",children:s.palette.slice(0,6).map((R,L)=>b.jsx("span",{className:"style-sheet-panel__chip",title:R,children:R},L))}),s.mood&&b.jsxs("div",{className:"style-sheet-panel__muted",children:[o("styleSheet.fields.mood"),": ",s.mood]})]}):b.jsx("div",{className:"style-sheet-panel__muted",children:o("styleSheet.emptyHint")}),b.jsxs("div",{className:"style-sheet-panel__actions",children:[b.jsx("button",{type:"button",className:"btn btn--secondary btn--sm",onClick:()=>{m()},disabled:c,children:o(c?"styleSheet.extracting":"styleSheet.extract")}),b.jsx("button",{type:"button",className:"btn btn--ghost btn--sm",onClick:()=>y(!0),disabled:c,children:o("styleSheet.edit")}),b.jsx("button",{type:"button",className:"btn btn--ghost btn--sm",style:{marginLeft:"auto"},onClick:l,children:o("styleSheet.cancel")})]})]}),v&&b.jsxs(b.Fragment,{children:[b.jsxs("label",{children:[o("styleSheet.fields.medium"),b.jsx("input",{value:p.medium,onChange:R=>G({medium:R.target.value}),placeholder:o("styleSheet.placeholderMedium")})]}),b.jsxs("label",{children:[o("styleSheet.fields.composition"),b.jsx("textarea",{rows:2,value:p.composition,onChange:R=>G({composition:R.target.value}),placeholder:o("styleSheet.placeholderComposition")})]}),b.jsxs("label",{children:[o("styleSheet.fields.mood"),b.jsx("input",{value:p.mood,onChange:R=>G({mood:R.target.value}),placeholder:o("styleSheet.placeholderMood")})]}),b.jsxs("label",{children:[o("styleSheet.fields.subject"),b.jsx("textarea",{rows:2,value:p.subject_details,onChange:R=>G({subject_details:R.target.value}),placeholder:o("styleSheet.placeholderSubject")})]}),b.jsxs("label",{children:[o("styleSheet.fields.palette"),b.jsx("input",{value:p.palette.join(", "),onChange:R=>G({palette:R.target.value.split(",").map(L=>L.trim()).filter(Boolean).slice(0,6)}),placeholder:o("styleSheet.placeholderPalette")})]}),b.jsxs("label",{children:[o("styleSheet.fields.negative"),b.jsx("input",{value:p.negative.join(", "),onChange:R=>G({negative:R.target.value.split(",").map(L=>L.trim()).filter(Boolean).slice(0,4)}),placeholder:o("styleSheet.placeholderNegative")})]}),b.jsxs("div",{className:"style-sheet-editor__actions",children:[b.jsx("button",{type:"button",className:"btn btn--ghost",onClick:()=>y(!1),disabled:_,children:o("styleSheet.cancel")}),b.jsx("button",{type:"button",className:"btn btn--primary",onClick:()=>{w()},disabled:_,children:o(_?"styleSheet.extracting":"styleSheet.save")})]})]})]})})}const Ql=5;function Ux(){const n=oe(H=>H.prompt),l=oe(H=>H.setPrompt),o=oe(H=>H.generate),{t:s}=Qe(),r=oe(H=>H.referenceImages),c=oe(H=>H.addReferences),d=oe(H=>H.removeReference),g=oe(H=>H.useCurrentAsReference),m=oe(H=>H.currentImage),h=Z.useRef(null),[v,y]=Z.useState(!1),[p,x]=Z.useState(!1),_=oe(H=>H.activeSessionId),M=oe(H=>H.styleSheetEnabled),N=oe(H=>H.promptMode),T=oe(H=>H.setPromptMode),U=r.length<Ql,w=H=>{H.preventDefault(),y(!1);const $=Array.from(H.dataTransfer.files).filter(V=>V.type.startsWith("image/"));$.length>0&&c($)},D=H=>{H.preventDefault(),v||y(!0)},G=H=>{H.currentTarget.contains(H.relatedTarget)||y(!1)},R=H=>{if(!H)return[];const $=[];for(const V of Array.from(H)){if(V.kind!=="file"||!V.type.startsWith("image/"))continue;const Y=V.getAsFile();Y&&$.push(Y)}return $},L=H=>{if(!U)return;const $=R(H.clipboardData?.items??null);if($.length===0)return;H.preventDefault();const V=Ql-r.length;c($.slice(0,V))};return Z.useEffect(()=>{const H=$=>{const V=$.target,Y=V?.tagName;if(Y==="INPUT"||Y==="TEXTAREA"||V?.isContentEditable)return;const P=R($.clipboardData?.items??null);if(P.length===0||r.length>=Ql)return;$.preventDefault();const te=Ql-r.length;c(P.slice(0,te))};return window.addEventListener("paste",H),()=>window.removeEventListener("paste",H)},[r.length,c]),b.jsxs("div",{className:`composer${v?" composer--drag":""}`,onDrop:w,onDragOver:D,onDragLeave:G,onPaste:L,children:[b.jsxs("div",{className:"composer__header",children:[b.jsx("span",{className:"section-title composer__label",children:s("prompt.label")}),r.length>0&&b.jsx("span",{className:"composer__count",children:s("prompt.refCount",{count:r.length,max:Ql})})]}),r.length>0&&b.jsx("div",{className:"composer__chips",children:r.map((H,$)=>b.jsxs("div",{className:"composer__chip",title:s("prompt.refChipTitle",{n:$+1}),children:[b.jsx("img",{src:H,alt:s("prompt.refChipAlt",{n:$+1})}),b.jsx("button",{type:"button",className:"composer__chip-remove",onClick:()=>d($),"aria-label":s("prompt.refRemoveAria",{n:$+1}),children:"×"})]},$))}),b.jsx("textarea",{className:"prompt-area composer__textarea",value:n,placeholder:r.length>0?s("prompt.placeholderWithRefs"):s("prompt.placeholder"),onChange:H=>l(H.target.value),onKeyDown:H=>{H.key==="Enter"&&(H.metaKey||H.ctrlKey)&&(H.preventDefault(),o())}}),b.jsxs("div",{className:"composer__toolbar",children:[b.jsxs("button",{type:"button",className:"composer__tool",onClick:()=>U&&h.current?.click(),disabled:!U,title:s("prompt.attachTitle"),"aria-label":s("prompt.attachTitle"),children:[b.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:b.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"})}),b.jsx("span",{children:s("prompt.attach")})]}),b.jsxs("button",{type:"button",className:"composer__tool",onClick:()=>{g()},disabled:!m||!U,title:s("prompt.useCurrentTitle"),children:[b.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:[b.jsx("polyline",{points:"23 4 23 10 17 10"}),b.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]}),b.jsx("span",{children:s("prompt.useCurrent")})]}),_&&b.jsxs("button",{type:"button",className:`composer__tool${M?" composer__tool--on":""}`,onClick:()=>x(!0),title:s("prompt.styleTitle"),"aria-label":s("prompt.styleTitle"),"aria-pressed":M,children:[b.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:[b.jsx("circle",{cx:"12",cy:"12",r:"9"}),b.jsx("circle",{cx:"8",cy:"10",r:"1",fill:"currentColor"}),b.jsx("circle",{cx:"12",cy:"8",r:"1",fill:"currentColor"}),b.jsx("circle",{cx:"16",cy:"10",r:"1",fill:"currentColor"}),b.jsx("path",{d:"M14 14c2 0 3 1 3 3 0 1-1 2-2 2-2 0-3-2-5-2"})]}),b.jsx("span",{children:s("prompt.style")})]}),b.jsxs("button",{type:"button",className:`composer__tool${N==="direct"?" composer__tool--on":""}`,onClick:()=>T(N==="direct"?"auto":"direct"),title:s("prompt.directModeTitle"),"aria-label":s("prompt.directModeTitle"),"aria-pressed":N==="direct",children:[b.jsx("span",{"aria-hidden":"true",style:{fontWeight:700,fontSize:11},children:"1:1"}),b.jsx("span",{children:s("prompt.directMode")})]}),b.jsx("span",{className:"composer__hint",children:s("prompt.hint")})]}),v&&b.jsx("div",{className:"composer__dropzone","aria-hidden":"true",children:s("prompt.dropHere",{max:Ql})}),b.jsx("input",{ref:h,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:H=>{const $=Array.from(H.target.files??[]);$.length>0&&c($),H.target.value=""}}),b.jsx(qy,{open:p,onClose:()=>x(!1)})]})}function Lx(){const n=oe(c=>c.activeGenerations),l=oe(c=>c.generate),{t:o}=Qe(),s=n>0,r=s?o("generate.buttonLoading",{n}):o("generate.button");return b.jsx("button",{type:"button",className:`generate-btn${s?" loading":""}`,onClick:()=>{l()},children:r})}function Bx(n,l=28){const o=n.trim().replace(/\s+/g," ");return o.length>l?`${o.slice(0,l)}...`:o}function wp(){const n=oe(s=>s.inFlight),{t:l}=Qe(),o={queued:l("inflight.queued"),streaming:l("inflight.streaming"),decoding:l("inflight.decoding")};return n.length===0?null:b.jsx("ul",{className:"in-flight-list",children:n.map(s=>{const r=s.phase?o[s.phase]??s.phase:l("inflight.queued");return b.jsxs("li",{className:"in-flight-item","data-phase":s.phase??"queued",children:[b.jsx("span",{className:"in-flight-prompt",children:Bx(s.prompt)}),b.jsx("span",{className:"in-flight-phase",children:r}),b.jsx("span",{className:"in-flight-spinner","aria-hidden":"true"})]},s.id)})})}function qx(){const n=oe(c=>c.history),l=oe(c=>c.currentImage),o=oe(c=>c.selectHistory),s=oe(c=>c.openGallery),{t:r}=Qe();return b.jsxs("div",{className:"history-strip",children:[b.jsx("button",{type:"button",className:"history-thumb history-thumb--add",onClick:s,"aria-label":r("history.openGalleryAria"),title:r("history.openGalleryTitle"),children:b.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[b.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),b.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),b.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),b.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]})}),n.map((c,d)=>{const g=c.filename?l?.filename===c.filename:l?.image===c.image;return b.jsx("img",{src:c.thumb||c.url||c.image,alt:"",className:`history-thumb${g?" active":""}`,onClick:()=>o(c)},c.filename??`${d}-${c.image}`)})]})}function Ix(){const{t:n}=Qe(),l=oe(p=>p.sessions),o=oe(p=>p.activeSessionId),s=oe(p=>p.switchSession),r=oe(p=>p.createAndSwitchSession),c=oe(p=>p.renameCurrentSession),d=oe(p=>p.deleteSessionById),[g,m]=Z.useState(!1),h=l.find(p=>p.id===o),v=()=>{const p=window.prompt(n("session.renamePrompt"),h?.title??n("session.newSession"));p&&p.trim()&&c(p.trim())},y=(p,x)=>{window.confirm(n("session.deleteConfirm",{title:x}))&&d(p)};return b.jsxs("div",{className:"session-picker",children:[b.jsxs("div",{className:"session-picker-row",children:[b.jsxs("button",{type:"button",className:"session-current",onClick:()=>m(p=>!p),title:n("session.switchTitle"),children:[b.jsx("span",{className:"session-title",children:h?.title??n("session.loading")}),b.jsx("span",{className:"session-caret",children:g?"▴":"▾"})]}),b.jsx("button",{type:"button",className:"session-btn",onClick:()=>{r(n("session.newSession"))},title:n("session.newSessionTitle"),children:"+"}),b.jsx("button",{type:"button",className:"session-btn",onClick:v,title:n("session.renameTitle"),disabled:!h,children:"✎"})]}),g&&b.jsxs("ul",{className:"session-list",children:[l.map(p=>b.jsxs("li",{className:p.id===o?"is-active":"",children:[b.jsxs("button",{type:"button",className:"session-item",onClick:()=>{m(!1),s(p.id)},children:[b.jsx("span",{className:"session-item-title",children:p.title}),b.jsx("span",{className:"session-item-count",children:p.nodeCount})]}),b.jsx("button",{type:"button",className:"session-del",onClick:()=>y(p.id,p.title),title:n("session.deleteTitle"),children:"×"})]},p.id)),l.length===0&&b.jsx("li",{className:"session-empty",children:n("session.empty")})]})]})}function Gx(){const{t:n}=Qe(),l=oe(c=>c.activeSessionId),o=oe(c=>c.styleSheetEnabled),[s,r]=Z.useState(!1);return l?b.jsxs(b.Fragment,{children:[b.jsx("button",{type:"button",className:`btn btn--secondary btn--sm${o?" is-on":""}`,onClick:()=>r(!0),"aria-pressed":o,title:n("prompt.styleTitle"),children:n("prompt.style")}),b.jsx(qy,{open:s,onClose:()=>r(!1)})]}):null}function Yx(){const{t:n}=Qe(),l=oe(s=>s.settingsOpen),o=oe(s=>s.toggleSettings);return b.jsx("button",{type:"button",className:`settings-button${l?" is-active":""}`,onClick:o,"aria-label":n("settings.openAria"),"aria-pressed":l,title:n("settings.openTitle"),children:b.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[b.jsx("path",{d:"M12 8.2a3.8 3.8 0 1 0 0 7.6 3.8 3.8 0 0 0 0-7.6Zm0 5.7a1.9 1.9 0 1 1 0-3.8 1.9 1.9 0 0 1 0 3.8Z"}),b.jsx("path",{d:"m20.3 13.4.1-1.4-.1-1.4-2.2-.5a6.9 6.9 0 0 0-.6-1.3l1.2-1.9a9.6 9.6 0 0 0-2-2l-1.9 1.2c-.4-.2-.9-.4-1.3-.6L13 3.3a9.5 9.5 0 0 0-2.8 0l-.5 2.2c-.5.2-.9.3-1.3.6L6.5 4.9a9.6 9.6 0 0 0-2 2l1.2 1.9c-.2.4-.4.9-.6 1.3l-2.2.5a9.5 9.5 0 0 0 0 2.8l2.2.5c.2.5.3.9.6 1.3l-1.2 1.9a9.6 9.6 0 0 0 2 2l1.9-1.2c.4.2.9.4 1.3.6l.5 2.2a9.5 9.5 0 0 0 2.8 0l.5-2.2c.5-.2.9-.3 1.3-.6l1.9 1.2a9.6 9.6 0 0 0 2-2l-1.2-1.9c.2-.4.4-.9.6-1.3l2.2-.5Z"})]})})}function kx(){const{t:n}=Qe(),l=oe(d=>d.uiMode),o=oe(d=>d.referenceImages),s=oe(d=>d.clearReferences),r=oe(d=>d.styleSheetEnabled),c=l;return b.jsxs("aside",{className:"sidebar",children:[b.jsxs("div",{className:"sidebar__scroll",children:[b.jsxs("div",{className:"logo",children:[b.jsx("div",{className:"logo-mark","aria-hidden":"true"}),b.jsxs("div",{className:"logo-copy",children:[b.jsx("div",{className:"logo-title",children:"ima2-gen"}),b.jsx("div",{className:"logo-subtitle",children:"gpt-image-2 studio"})]}),b.jsx(Yx,{})]}),b.jsx(Hx,{}),c==="classic"?b.jsxs(b.Fragment,{children:[b.jsx(Ux,{}),b.jsx(Lx,{}),b.jsx(wp,{})]}):b.jsxs(b.Fragment,{children:[b.jsx(Ix,{}),b.jsx(Gx,{}),o.length>0?b.jsxs("div",{className:"node-mode-ref-warning",role:"status",children:[b.jsx("strong",{children:n("node.classicRefsParkedTitle")}),b.jsx("span",{children:n("node.classicRefsParkedBody")}),b.jsx("button",{type:"button",onClick:s,children:n("node.clearParkedRefs")})]}):null,r?b.jsx("div",{className:"node-mode-style-badge",role:"status",children:n("node.styleSheetActive")}):null,b.jsx("div",{className:"sidebar__node-hint",children:n("sidebar.nodeModeHint")}),b.jsx(wp,{})]})]}),b.jsx(qx,{})]})}function Vx(){const{t:n}=Qe(),l=oe(m=>m.currentImage),o=oe(m=>m.showToast),s=oe(m=>m.setPrompt);if(!l)return null;const r=()=>{const m=document.createElement("a");m.href=l.image,m.download=l.filename||"generated.png",m.click()},c=async()=>{try{const h=await(await fetch(l.image)).blob();await navigator.clipboard.write([new ClipboardItem({[h.type]:h})]),o(n("toast.imageCopied"))}catch{o(n("toast.copyFailed"),!0)}},d=()=>{l.prompt&&(navigator.clipboard.writeText(l.prompt),o(n("toast.promptCopied")))},g=async()=>{if(!l.prompt){o(n("toast.noPromptToFork"),!0);return}s(l.prompt);try{await oe.getState().useCurrentAsReference()}catch{}const m=document.querySelector('textarea[name="prompt"], textarea#prompt, .sidebar textarea');m&&(m.focus(),m.setSelectionRange(m.value.length,m.value.length)),o(n("toast.forkStarted"))};return b.jsxs("div",{className:"result-actions",children:[b.jsx("button",{type:"button",className:"action-btn",onClick:r,children:n("result.download")}),b.jsx("button",{type:"button",className:"action-btn",onClick:c,children:n("result.copyImage")}),b.jsx("button",{type:"button",className:"action-btn",onClick:d,children:n("result.copyPrompt")}),b.jsx("button",{type:"button",className:"action-btn action-btn--primary",onClick:g,title:n("result.continueHereTitle"),children:n("result.continueHere")})]})}function Xx(){const n=oe(h=>h.currentImage),l=oe(h=>h.activeGenerations),o=oe(h=>h.quality),s=oe(h=>h.getResolvedSize),r=oe(h=>h.showToast),{t:c}=Qe(),d=()=>{n?.prompt&&(navigator.clipboard.writeText(n.prompt),r(c("toast.promptCopied")))},g=n?.quality??o,m=n?.size??s();return b.jsxs("main",{className:"canvas",children:[b.jsx("div",{className:`progress-bar${l>0?" active":""}`}),n?b.jsxs("div",{className:"result-container visible",children:[b.jsx("img",{className:"result-img",src:n.url??n.image,alt:c("canvas.resultAlt")},n.filename??n.url??n.image),n.prompt?b.jsx("div",{className:"result-prompt",onClick:d,children:n.prompt}):null,b.jsx("div",{className:"result-meta",children:[n.elapsed!=null?`${n.elapsed}s`:null,n.usage?c("canvas.tokens",{n:n.usage.total_tokens??"?"}):null,g,m,n.provider??null].filter(h=>!!h).join(" · ")}),b.jsx(Vx,{})]}):null]})}function it(n){if(typeof n=="string"||typeof n=="number")return""+n;let l="";if(Array.isArray(n))for(let o=0,s;o<n.length;o++)(s=it(n[o]))!==""&&(l+=(l&&" ")+s);else for(let o in n)n[o]&&(l+=(l&&" ")+o);return l}var Zx={value:()=>{}};function Mr(){for(var n=0,l=arguments.length,o={},s;n<l;++n){if(!(s=arguments[n]+"")||s in o||/[\s.]/.test(s))throw new Error("illegal type: "+s);o[s]=[]}return new dr(o)}function dr(n){this._=n}function $x(n,l){return n.trim().split(/^|\s+/).map(function(o){var s="",r=o.indexOf(".");if(r>=0&&(s=o.slice(r+1),o=o.slice(0,r)),o&&!l.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:s}})}dr.prototype=Mr.prototype={constructor:dr,on:function(n,l){var o=this._,s=$x(n+"",o),r,c=-1,d=s.length;if(arguments.length<2){for(;++c<d;)if((r=(n=s[c]).type)&&(r=Qx(o[r],n.name)))return r;return}if(l!=null&&typeof l!="function")throw new Error("invalid callback: "+l);for(;++c<d;)if(r=(n=s[c]).type)o[r]=Ep(o[r],n.name,l);else if(l==null)for(r in o)o[r]=Ep(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 dr(n)},call:function(n,l){if((r=arguments.length-2)>0)for(var o=new Array(r),s=0,r,c;s<r;++s)o[s]=arguments[s+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(c=this._[n],s=0,r=c.length;s<r;++s)c[s].value.apply(l,o)},apply:function(n,l,o){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var s=this._[n],r=0,c=s.length;r<c;++r)s[r].value.apply(l,o)}};function Qx(n,l){for(var o=0,s=n.length,r;o<s;++o)if((r=n[o]).name===l)return r.value}function Ep(n,l,o){for(var s=0,r=n.length;s<r;++s)if(n[s].name===l){n[s]=Zx,n=n.slice(0,s).concat(n.slice(s+1));break}return o!=null&&n.push({name:l,value:o}),n}var jf="http://www.w3.org/1999/xhtml";const _p={svg:"http://www.w3.org/2000/svg",xhtml:jf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function zr(n){var l=n+="",o=l.indexOf(":");return o>=0&&(l=n.slice(0,o))!=="xmlns"&&(n=n.slice(o+1)),_p.hasOwnProperty(l)?{space:_p[l],local:n}:n}function Kx(n){return function(){var l=this.ownerDocument,o=this.namespaceURI;return o===jf&&l.documentElement.namespaceURI===jf?l.createElement(n):l.createElementNS(o,n)}}function Fx(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function Iy(n){var l=zr(n);return(l.local?Fx:Kx)(l)}function Jx(){}function Kf(n){return n==null?Jx:function(){return this.querySelector(n)}}function Px(n){typeof n!="function"&&(n=Kf(n));for(var l=this._groups,o=l.length,s=new Array(o),r=0;r<o;++r)for(var c=l[r],d=c.length,g=s[r]=new Array(d),m,h,v=0;v<d;++v)(m=c[v])&&(h=n.call(m,m.__data__,v,c))&&("__data__"in m&&(h.__data__=m.__data__),g[v]=h);return new qt(s,this._parents)}function Wx(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function e2(){return[]}function Gy(n){return n==null?e2:function(){return this.querySelectorAll(n)}}function t2(n){return function(){return Wx(n.apply(this,arguments))}}function n2(n){typeof n=="function"?n=t2(n):n=Gy(n);for(var l=this._groups,o=l.length,s=[],r=[],c=0;c<o;++c)for(var d=l[c],g=d.length,m,h=0;h<g;++h)(m=d[h])&&(s.push(n.call(m,m.__data__,h,d)),r.push(m));return new qt(s,r)}function Yy(n){return function(){return this.matches(n)}}function ky(n){return function(l){return l.matches(n)}}var a2=Array.prototype.find;function l2(n){return function(){return a2.call(this.children,n)}}function i2(){return this.firstElementChild}function o2(n){return this.select(n==null?i2:l2(typeof n=="function"?n:ky(n)))}var s2=Array.prototype.filter;function r2(){return Array.from(this.children)}function u2(n){return function(){return s2.call(this.children,n)}}function c2(n){return this.selectAll(n==null?r2:u2(typeof n=="function"?n:ky(n)))}function f2(n){typeof n!="function"&&(n=Yy(n));for(var l=this._groups,o=l.length,s=new Array(o),r=0;r<o;++r)for(var c=l[r],d=c.length,g=s[r]=[],m,h=0;h<d;++h)(m=c[h])&&n.call(m,m.__data__,h,c)&&g.push(m);return new qt(s,this._parents)}function Vy(n){return new Array(n.length)}function d2(){return new qt(this._enter||this._groups.map(Vy),this._parents)}function vr(n,l){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=l}vr.prototype={constructor:vr,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 h2(n){return function(){return n}}function g2(n,l,o,s,r,c){for(var d=0,g,m=l.length,h=c.length;d<h;++d)(g=l[d])?(g.__data__=c[d],s[d]=g):o[d]=new vr(n,c[d]);for(;d<m;++d)(g=l[d])&&(r[d]=g)}function m2(n,l,o,s,r,c,d){var g,m,h=new Map,v=l.length,y=c.length,p=new Array(v),x;for(g=0;g<v;++g)(m=l[g])&&(p[g]=x=d.call(m,m.__data__,g,l)+"",h.has(x)?r[g]=m:h.set(x,m));for(g=0;g<y;++g)x=d.call(n,c[g],g,c)+"",(m=h.get(x))?(s[g]=m,m.__data__=c[g],h.delete(x)):o[g]=new vr(n,c[g]);for(g=0;g<v;++g)(m=l[g])&&h.get(p[g])===m&&(r[g]=m)}function p2(n){return n.__data__}function y2(n,l){if(!arguments.length)return Array.from(this,p2);var o=l?m2:g2,s=this._parents,r=this._groups;typeof n!="function"&&(n=h2(n));for(var c=r.length,d=new Array(c),g=new Array(c),m=new Array(c),h=0;h<c;++h){var v=s[h],y=r[h],p=y.length,x=v2(n.call(v,v&&v.__data__,h,s)),_=x.length,M=g[h]=new Array(_),N=d[h]=new Array(_),T=m[h]=new Array(p);o(v,y,M,N,T,x,l);for(var U=0,w=0,D,G;U<_;++U)if(D=M[U]){for(U>=w&&(w=U+1);!(G=N[w])&&++w<_;);D._next=G||null}}return d=new qt(d,s),d._enter=g,d._exit=m,d}function v2(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function S2(){return new qt(this._exit||this._groups.map(Vy),this._parents)}function b2(n,l,o){var s=this.enter(),r=this,c=this.exit();return typeof n=="function"?(s=n(s),s&&(s=s.selection())):s=s.append(n+""),l!=null&&(r=l(r),r&&(r=r.selection())),o==null?c.remove():o(c),s&&r?s.merge(r).order():r}function x2(n){for(var l=n.selection?n.selection():n,o=this._groups,s=l._groups,r=o.length,c=s.length,d=Math.min(r,c),g=new Array(r),m=0;m<d;++m)for(var h=o[m],v=s[m],y=h.length,p=g[m]=new Array(y),x,_=0;_<y;++_)(x=h[_]||v[_])&&(p[_]=x);for(;m<r;++m)g[m]=o[m];return new qt(g,this._parents)}function w2(){for(var n=this._groups,l=-1,o=n.length;++l<o;)for(var s=n[l],r=s.length-1,c=s[r],d;--r>=0;)(d=s[r])&&(c&&d.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(d,c),c=d);return this}function E2(n){n||(n=_2);function l(y,p){return y&&p?n(y.__data__,p.__data__):!y-!p}for(var o=this._groups,s=o.length,r=new Array(s),c=0;c<s;++c){for(var d=o[c],g=d.length,m=r[c]=new Array(g),h,v=0;v<g;++v)(h=d[v])&&(m[v]=h);m.sort(l)}return new qt(r,this._parents).order()}function _2(n,l){return n<l?-1:n>l?1:n>=l?0:NaN}function N2(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function A2(){return Array.from(this)}function T2(){for(var n=this._groups,l=0,o=n.length;l<o;++l)for(var s=n[l],r=0,c=s.length;r<c;++r){var d=s[r];if(d)return d}return null}function C2(){let n=0;for(const l of this)++n;return n}function M2(){return!this.node()}function z2(n){for(var l=this._groups,o=0,s=l.length;o<s;++o)for(var r=l[o],c=0,d=r.length,g;c<d;++c)(g=r[c])&&n.call(g,g.__data__,c,r);return this}function D2(n){return function(){this.removeAttribute(n)}}function R2(n){return function(){this.removeAttributeNS(n.space,n.local)}}function O2(n,l){return function(){this.setAttribute(n,l)}}function j2(n,l){return function(){this.setAttributeNS(n.space,n.local,l)}}function H2(n,l){return function(){var o=l.apply(this,arguments);o==null?this.removeAttribute(n):this.setAttribute(n,o)}}function U2(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 L2(n,l){var o=zr(n);if(arguments.length<2){var s=this.node();return o.local?s.getAttributeNS(o.space,o.local):s.getAttribute(o)}return this.each((l==null?o.local?R2:D2:typeof l=="function"?o.local?U2:H2:o.local?j2:O2)(o,l))}function Xy(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function B2(n){return function(){this.style.removeProperty(n)}}function q2(n,l,o){return function(){this.style.setProperty(n,l,o)}}function I2(n,l,o){return function(){var s=l.apply(this,arguments);s==null?this.style.removeProperty(n):this.style.setProperty(n,s,o)}}function G2(n,l,o){return arguments.length>1?this.each((l==null?B2:typeof l=="function"?I2:q2)(n,l,o??"")):ti(this.node(),n)}function ti(n,l){return n.style.getPropertyValue(l)||Xy(n).getComputedStyle(n,null).getPropertyValue(l)}function Y2(n){return function(){delete this[n]}}function k2(n,l){return function(){this[n]=l}}function V2(n,l){return function(){var o=l.apply(this,arguments);o==null?delete this[n]:this[n]=o}}function X2(n,l){return arguments.length>1?this.each((l==null?Y2:typeof l=="function"?V2:k2)(n,l)):this.node()[n]}function Zy(n){return n.trim().split(/^|\s+/)}function Ff(n){return n.classList||new $y(n)}function $y(n){this._node=n,this._names=Zy(n.getAttribute("class")||"")}$y.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 Qy(n,l){for(var o=Ff(n),s=-1,r=l.length;++s<r;)o.add(l[s])}function Ky(n,l){for(var o=Ff(n),s=-1,r=l.length;++s<r;)o.remove(l[s])}function Z2(n){return function(){Qy(this,n)}}function $2(n){return function(){Ky(this,n)}}function Q2(n,l){return function(){(l.apply(this,arguments)?Qy:Ky)(this,n)}}function K2(n,l){var o=Zy(n+"");if(arguments.length<2){for(var s=Ff(this.node()),r=-1,c=o.length;++r<c;)if(!s.contains(o[r]))return!1;return!0}return this.each((typeof l=="function"?Q2:l?Z2:$2)(o,l))}function F2(){this.textContent=""}function J2(n){return function(){this.textContent=n}}function P2(n){return function(){var l=n.apply(this,arguments);this.textContent=l??""}}function W2(n){return arguments.length?this.each(n==null?F2:(typeof n=="function"?P2:J2)(n)):this.node().textContent}function ew(){this.innerHTML=""}function tw(n){return function(){this.innerHTML=n}}function nw(n){return function(){var l=n.apply(this,arguments);this.innerHTML=l??""}}function aw(n){return arguments.length?this.each(n==null?ew:(typeof n=="function"?nw:tw)(n)):this.node().innerHTML}function lw(){this.nextSibling&&this.parentNode.appendChild(this)}function iw(){return this.each(lw)}function ow(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function sw(){return this.each(ow)}function rw(n){var l=typeof n=="function"?n:Iy(n);return this.select(function(){return this.appendChild(l.apply(this,arguments))})}function uw(){return null}function cw(n,l){var o=typeof n=="function"?n:Iy(n),s=l==null?uw:typeof l=="function"?l:Kf(l);return this.select(function(){return this.insertBefore(o.apply(this,arguments),s.apply(this,arguments)||null)})}function fw(){var n=this.parentNode;n&&n.removeChild(this)}function dw(){return this.each(fw)}function hw(){var n=this.cloneNode(!1),l=this.parentNode;return l?l.insertBefore(n,this.nextSibling):n}function gw(){var n=this.cloneNode(!0),l=this.parentNode;return l?l.insertBefore(n,this.nextSibling):n}function mw(n){return this.select(n?gw:hw)}function pw(n){return arguments.length?this.property("__data__",n):this.node().__data__}function yw(n){return function(l){n.call(this,l,this.__data__)}}function vw(n){return n.trim().split(/^|\s+/).map(function(l){var o="",s=l.indexOf(".");return s>=0&&(o=l.slice(s+1),l=l.slice(0,s)),{type:l,name:o}})}function Sw(n){return function(){var l=this.__on;if(l){for(var o=0,s=-1,r=l.length,c;o<r;++o)c=l[o],(!n.type||c.type===n.type)&&c.name===n.name?this.removeEventListener(c.type,c.listener,c.options):l[++s]=c;++s?l.length=s:delete this.__on}}}function bw(n,l,o){return function(){var s=this.__on,r,c=yw(l);if(s){for(var d=0,g=s.length;d<g;++d)if((r=s[d]).type===n.type&&r.name===n.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=c,r.options=o),r.value=l;return}}this.addEventListener(n.type,c,o),r={type:n.type,name:n.name,value:l,listener:c,options:o},s?s.push(r):this.__on=[r]}}function xw(n,l,o){var s=vw(n+""),r,c=s.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<c;++r)if((d=s[r]).type===v.type&&d.name===v.name)return v.value}return}for(g=l?bw:Sw,r=0;r<c;++r)this.each(g(s[r],l,o));return this}function Fy(n,l,o){var s=Xy(n),r=s.CustomEvent;typeof r=="function"?r=new r(l,o):(r=s.document.createEvent("Event"),o?(r.initEvent(l,o.bubbles,o.cancelable),r.detail=o.detail):r.initEvent(l,!1,!1)),n.dispatchEvent(r)}function ww(n,l){return function(){return Fy(this,n,l)}}function Ew(n,l){return function(){return Fy(this,n,l.apply(this,arguments))}}function _w(n,l){return this.each((typeof l=="function"?Ew:ww)(n,l))}function*Nw(){for(var n=this._groups,l=0,o=n.length;l<o;++l)for(var s=n[l],r=0,c=s.length,d;r<c;++r)(d=s[r])&&(yield d)}var Jy=[null];function qt(n,l){this._groups=n,this._parents=l}function No(){return new qt([[document.documentElement]],Jy)}function Aw(){return this}qt.prototype=No.prototype={constructor:qt,select:Px,selectAll:n2,selectChild:o2,selectChildren:c2,filter:f2,data:y2,enter:d2,exit:S2,join:b2,merge:x2,selection:Aw,order:w2,sort:E2,call:N2,nodes:A2,node:T2,size:C2,empty:M2,each:z2,attr:L2,style:G2,property:X2,classed:K2,text:W2,html:aw,raise:iw,lower:sw,append:rw,insert:cw,remove:dw,clone:mw,datum:pw,on:xw,dispatch:_w,[Symbol.iterator]:Nw};function Bt(n){return typeof n=="string"?new qt([[document.querySelector(n)]],[document.documentElement]):new qt([[n]],Jy)}function Tw(n){let l;for(;l=n.sourceEvent;)n=l;return n}function en(n,l){if(n=Tw(n),l===void 0&&(l=n.currentTarget),l){var o=l.ownerSVGElement||l;if(o.createSVGPoint){var s=o.createSVGPoint();return s.x=n.clientX,s.y=n.clientY,s=s.matrixTransform(l.getScreenCTM().inverse()),[s.x,s.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 Cw={passive:!1},mo={capture:!0,passive:!1};function vf(n){n.stopImmediatePropagation()}function Wl(n){n.preventDefault(),n.stopImmediatePropagation()}function Py(n){var l=n.document.documentElement,o=Bt(n).on("dragstart.drag",Wl,mo);"onselectstart"in l?o.on("selectstart.drag",Wl,mo):(l.__noselect=l.style.MozUserSelect,l.style.MozUserSelect="none")}function Wy(n,l){var o=n.document.documentElement,s=Bt(n).on("dragstart.drag",null);l&&(s.on("click.drag",Wl,mo),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in o?s.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}const nr=n=>()=>n;function Hf(n,{sourceEvent:l,subject:o,target:s,identifier:r,active:c,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:s,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:c,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}})}Hf.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function Mw(n){return!n.ctrlKey&&!n.button}function zw(){return this.parentNode}function Dw(n,l){return l??{x:n.x,y:n.y}}function Rw(){return navigator.maxTouchPoints||"ontouchstart"in this}function e0(){var n=Mw,l=zw,o=Dw,s=Rw,r={},c=Mr("start","drag","end"),d=0,g,m,h,v,y=0;function p(D){D.on("mousedown.drag",x).filter(s).on("touchstart.drag",N).on("touchmove.drag",T,Cw).on("touchend.drag touchcancel.drag",U).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(D,G){if(!(v||!n.call(this,D,G))){var R=w(this,l.call(this,D,G),D,G,"mouse");R&&(Bt(D.view).on("mousemove.drag",_,mo).on("mouseup.drag",M,mo),Py(D.view),vf(D),h=!1,g=D.clientX,m=D.clientY,R("start",D))}}function _(D){if(Wl(D),!h){var G=D.clientX-g,R=D.clientY-m;h=G*G+R*R>y}r.mouse("drag",D)}function M(D){Bt(D.view).on("mousemove.drag mouseup.drag",null),Wy(D.view,h),Wl(D),r.mouse("end",D)}function N(D,G){if(n.call(this,D,G)){var R=D.changedTouches,L=l.call(this,D,G),H=R.length,$,V;for($=0;$<H;++$)(V=w(this,L,D,G,R[$].identifier,R[$]))&&(vf(D),V("start",D,R[$]))}}function T(D){var G=D.changedTouches,R=G.length,L,H;for(L=0;L<R;++L)(H=r[G[L].identifier])&&(Wl(D),H("drag",D,G[L]))}function U(D){var G=D.changedTouches,R=G.length,L,H;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),L=0;L<R;++L)(H=r[G[L].identifier])&&(vf(D),H("end",D,G[L]))}function w(D,G,R,L,H,$){var V=c.copy(),Y=en($||R,G),P,te,z;if((z=o.call(D,new Hf("beforestart",{sourceEvent:R,target:p,identifier:H,active:d,x:Y[0],y:Y[1],dx:0,dy:0,dispatch:V}),L))!=null)return P=z.x-Y[0]||0,te=z.y-Y[1]||0,function k(A,j,I){var Q=Y,ne;switch(A){case"start":r[H]=k,ne=d++;break;case"end":delete r[H],--d;case"drag":Y=en(I||j,G),ne=d;break}V.call(A,D,new Hf(A,{sourceEvent:j,subject:z,target:p,identifier:H,active:ne,x:Y[0]+P,y:Y[1]+te,dx:Y[0]-Q[0],dy:Y[1]-Q[1],dispatch:V}),L)}}return p.filter=function(D){return arguments.length?(n=typeof D=="function"?D:nr(!!D),p):n},p.container=function(D){return arguments.length?(l=typeof D=="function"?D:nr(D),p):l},p.subject=function(D){return arguments.length?(o=typeof D=="function"?D:nr(D),p):o},p.touchable=function(D){return arguments.length?(s=typeof D=="function"?D:nr(!!D),p):s},p.on=function(){var D=c.on.apply(c,arguments);return D===c?p:D},p.clickDistance=function(D){return arguments.length?(y=(D=+D)*D,p):Math.sqrt(y)},p}function Jf(n,l,o){n.prototype=l.prototype=o,o.constructor=n}function t0(n,l){var o=Object.create(n.prototype);for(var s in l)o[s]=l[s];return o}function Ao(){}var po=.7,Sr=1/po,ei="\\s*([+-]?\\d+)\\s*",yo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",gn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ow=/^#([0-9a-f]{3,8})$/,jw=new RegExp(`^rgb\\(${ei},${ei},${ei}\\)$`),Hw=new RegExp(`^rgb\\(${gn},${gn},${gn}\\)$`),Uw=new RegExp(`^rgba\\(${ei},${ei},${ei},${yo}\\)$`),Lw=new RegExp(`^rgba\\(${gn},${gn},${gn},${yo}\\)$`),Bw=new RegExp(`^hsl\\(${yo},${gn},${gn}\\)$`),qw=new RegExp(`^hsla\\(${yo},${gn},${gn},${yo}\\)$`),Np={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};Jf(Ao,tl,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:Ap,formatHex:Ap,formatHex8:Iw,formatHsl:Gw,formatRgb:Tp,toString:Tp});function Ap(){return this.rgb().formatHex()}function Iw(){return this.rgb().formatHex8()}function Gw(){return n0(this).formatHsl()}function Tp(){return this.rgb().formatRgb()}function tl(n){var l,o;return n=(n+"").trim().toLowerCase(),(l=Ow.exec(n))?(o=l[1].length,l=parseInt(l[1],16),o===6?Cp(l):o===3?new Mt(l>>8&15|l>>4&240,l>>4&15|l&240,(l&15)<<4|l&15,1):o===8?ar(l>>24&255,l>>16&255,l>>8&255,(l&255)/255):o===4?ar(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=jw.exec(n))?new Mt(l[1],l[2],l[3],1):(l=Hw.exec(n))?new Mt(l[1]*255/100,l[2]*255/100,l[3]*255/100,1):(l=Uw.exec(n))?ar(l[1],l[2],l[3],l[4]):(l=Lw.exec(n))?ar(l[1]*255/100,l[2]*255/100,l[3]*255/100,l[4]):(l=Bw.exec(n))?Dp(l[1],l[2]/100,l[3]/100,1):(l=qw.exec(n))?Dp(l[1],l[2]/100,l[3]/100,l[4]):Np.hasOwnProperty(n)?Cp(Np[n]):n==="transparent"?new Mt(NaN,NaN,NaN,0):null}function Cp(n){return new Mt(n>>16&255,n>>8&255,n&255,1)}function ar(n,l,o,s){return s<=0&&(n=l=o=NaN),new Mt(n,l,o,s)}function Yw(n){return n instanceof Ao||(n=tl(n)),n?(n=n.rgb(),new Mt(n.r,n.g,n.b,n.opacity)):new Mt}function Uf(n,l,o,s){return arguments.length===1?Yw(n):new Mt(n,l,o,s??1)}function Mt(n,l,o,s){this.r=+n,this.g=+l,this.b=+o,this.opacity=+s}Jf(Mt,Uf,t0(Ao,{brighter(n){return n=n==null?Sr:Math.pow(Sr,n),new Mt(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?po:Math.pow(po,n),new Mt(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Mt(Wa(this.r),Wa(this.g),Wa(this.b),br(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:Mp,formatHex:Mp,formatHex8:kw,formatRgb:zp,toString:zp}));function Mp(){return`#${Pa(this.r)}${Pa(this.g)}${Pa(this.b)}`}function kw(){return`#${Pa(this.r)}${Pa(this.g)}${Pa(this.b)}${Pa((isNaN(this.opacity)?1:this.opacity)*255)}`}function zp(){const n=br(this.opacity);return`${n===1?"rgb(":"rgba("}${Wa(this.r)}, ${Wa(this.g)}, ${Wa(this.b)}${n===1?")":`, ${n})`}`}function br(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Wa(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function Pa(n){return n=Wa(n),(n<16?"0":"")+n.toString(16)}function Dp(n,l,o,s){return s<=0?n=l=o=NaN:o<=0||o>=1?n=l=NaN:l<=0&&(n=NaN),new tn(n,l,o,s)}function n0(n){if(n instanceof tn)return new tn(n.h,n.s,n.l,n.opacity);if(n instanceof Ao||(n=tl(n)),!n)return new tn;if(n instanceof tn)return n;n=n.rgb();var l=n.r/255,o=n.g/255,s=n.b/255,r=Math.min(l,o,s),c=Math.max(l,o,s),d=NaN,g=c-r,m=(c+r)/2;return g?(l===c?d=(o-s)/g+(o<s)*6:o===c?d=(s-l)/g+2:d=(l-o)/g+4,g/=m<.5?c+r:2-c-r,d*=60):g=m>0&&m<1?0:d,new tn(d,g,m,n.opacity)}function Vw(n,l,o,s){return arguments.length===1?n0(n):new tn(n,l,o,s??1)}function tn(n,l,o,s){this.h=+n,this.s=+l,this.l=+o,this.opacity=+s}Jf(tn,Vw,t0(Ao,{brighter(n){return n=n==null?Sr:Math.pow(Sr,n),new tn(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?po:Math.pow(po,n),new tn(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,s=o+(o<.5?o:1-o)*l,r=2*o-s;return new Mt(Sf(n>=240?n-240:n+120,r,s),Sf(n,r,s),Sf(n<120?n+240:n-120,r,s),this.opacity)},clamp(){return new tn(Rp(this.h),lr(this.s),lr(this.l),br(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=br(this.opacity);return`${n===1?"hsl(":"hsla("}${Rp(this.h)}, ${lr(this.s)*100}%, ${lr(this.l)*100}%${n===1?")":`, ${n})`}`}}));function Rp(n){return n=(n||0)%360,n<0?n+360:n}function lr(n){return Math.max(0,Math.min(1,n||0))}function Sf(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 Pf=n=>()=>n;function Xw(n,l){return function(o){return n+o*l}}function Zw(n,l,o){return n=Math.pow(n,o),l=Math.pow(l,o)-n,o=1/o,function(s){return Math.pow(n+s*l,o)}}function $w(n){return(n=+n)==1?a0:function(l,o){return o-l?Zw(l,o,n):Pf(isNaN(l)?o:l)}}function a0(n,l){var o=l-n;return o?Xw(n,o):Pf(isNaN(n)?l:n)}const xr=(function n(l){var o=$w(l);function s(r,c){var d=o((r=Uf(r)).r,(c=Uf(c)).r),g=o(r.g,c.g),m=o(r.b,c.b),h=a0(r.opacity,c.opacity);return function(v){return r.r=d(v),r.g=g(v),r.b=m(v),r.opacity=h(v),r+""}}return s.gamma=n,s})(1);function Qw(n,l){l||(l=[]);var o=n?Math.min(l.length,n.length):0,s=l.slice(),r;return function(c){for(r=0;r<o;++r)s[r]=n[r]*(1-c)+l[r]*c;return s}}function Kw(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Fw(n,l){var o=l?l.length:0,s=n?Math.min(o,n.length):0,r=new Array(s),c=new Array(o),d;for(d=0;d<s;++d)r[d]=ho(n[d],l[d]);for(;d<o;++d)c[d]=l[d];return function(g){for(d=0;d<s;++d)c[d]=r[d](g);return c}}function Jw(n,l){var o=new Date;return n=+n,l=+l,function(s){return o.setTime(n*(1-s)+l*s),o}}function dn(n,l){return n=+n,l=+l,function(o){return n*(1-o)+l*o}}function Pw(n,l){var o={},s={},r;(n===null||typeof n!="object")&&(n={}),(l===null||typeof l!="object")&&(l={});for(r in l)r in n?o[r]=ho(n[r],l[r]):s[r]=l[r];return function(c){for(r in o)s[r]=o[r](c);return s}}var Lf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bf=new RegExp(Lf.source,"g");function Ww(n){return function(){return n}}function eE(n){return function(l){return n(l)+""}}function l0(n,l){var o=Lf.lastIndex=bf.lastIndex=0,s,r,c,d=-1,g=[],m=[];for(n=n+"",l=l+"";(s=Lf.exec(n))&&(r=bf.exec(l));)(c=r.index)>o&&(c=l.slice(o,c),g[d]?g[d]+=c:g[++d]=c),(s=s[0])===(r=r[0])?g[d]?g[d]+=r:g[++d]=r:(g[++d]=null,m.push({i:d,x:dn(s,r)})),o=bf.lastIndex;return o<l.length&&(c=l.slice(o),g[d]?g[d]+=c:g[++d]=c),g.length<2?m[0]?eE(m[0].x):Ww(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 ho(n,l){var o=typeof l,s;return l==null||o==="boolean"?Pf(l):(o==="number"?dn:o==="string"?(s=tl(l))?(l=s,xr):l0:l instanceof tl?xr:l instanceof Date?Jw:Kw(l)?Qw:Array.isArray(l)?Fw:typeof l.valueOf!="function"&&typeof l.toString!="function"||isNaN(l)?Pw:dn)(n,l)}var Op=180/Math.PI,Bf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function i0(n,l,o,s,r,c){var d,g,m;return(d=Math.sqrt(n*n+l*l))&&(n/=d,l/=d),(m=n*o+l*s)&&(o-=n*m,s-=l*m),(g=Math.sqrt(o*o+s*s))&&(o/=g,s/=g,m/=g),n*s<l*o&&(n=-n,l=-l,m=-m,d=-d),{translateX:r,translateY:c,rotate:Math.atan2(l,n)*Op,skewX:Math.atan(m)*Op,scaleX:d,scaleY:g}}var ir;function tE(n){const l=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return l.isIdentity?Bf:i0(l.a,l.b,l.c,l.d,l.e,l.f)}function nE(n){return n==null||(ir||(ir=document.createElementNS("http://www.w3.org/2000/svg","g")),ir.setAttribute("transform",n),!(n=ir.transform.baseVal.consolidate()))?Bf:(n=n.matrix,i0(n.a,n.b,n.c,n.d,n.e,n.f))}function o0(n,l,o,s){function r(h){return h.length?h.pop()+" ":""}function c(h,v,y,p,x,_){if(h!==y||v!==p){var M=x.push("translate(",null,l,null,o);_.push({i:M-4,x:dn(h,y)},{i:M-2,x:dn(v,p)})}else(y||p)&&x.push("translate("+y+l+p+o)}function d(h,v,y,p){h!==v?(h-v>180?v+=360:v-h>180&&(h+=360),p.push({i:y.push(r(y)+"rotate(",null,s)-2,x:dn(h,v)})):v&&y.push(r(y)+"rotate("+v+s)}function g(h,v,y,p){h!==v?p.push({i:y.push(r(y)+"skewX(",null,s)-2,x:dn(h,v)}):v&&y.push(r(y)+"skewX("+v+s)}function m(h,v,y,p,x,_){if(h!==y||v!==p){var M=x.push(r(x)+"scale(",null,",",null,")");_.push({i:M-4,x:dn(h,y)},{i:M-2,x:dn(v,p)})}else(y!==1||p!==1)&&x.push(r(x)+"scale("+y+","+p+")")}return function(h,v){var y=[],p=[];return h=n(h),v=n(v),c(h.translateX,h.translateY,v.translateX,v.translateY,y,p),d(h.rotate,v.rotate,y,p),g(h.skewX,v.skewX,y,p),m(h.scaleX,h.scaleY,v.scaleX,v.scaleY,y,p),h=v=null,function(x){for(var _=-1,M=p.length,N;++_<M;)y[(N=p[_]).i]=N.x(x);return y.join("")}}}var aE=o0(tE,"px, ","px)","deg)"),lE=o0(nE,", ",")",")"),iE=1e-12;function jp(n){return((n=Math.exp(n))+1/n)/2}function oE(n){return((n=Math.exp(n))-1/n)/2}function sE(n){return((n=Math.exp(2*n))-1)/(n+1)}const hr=(function n(l,o,s){function r(c,d){var g=c[0],m=c[1],h=c[2],v=d[0],y=d[1],p=d[2],x=v-g,_=y-m,M=x*x+_*_,N,T;if(M<iE)T=Math.log(p/h)/l,N=function(L){return[g+L*x,m+L*_,h*Math.exp(l*L*T)]};else{var U=Math.sqrt(M),w=(p*p-h*h+s*M)/(2*h*o*U),D=(p*p-h*h-s*M)/(2*p*o*U),G=Math.log(Math.sqrt(w*w+1)-w),R=Math.log(Math.sqrt(D*D+1)-D);T=(R-G)/l,N=function(L){var H=L*T,$=jp(G),V=h/(o*U)*($*sE(l*H+G)-oE(G));return[g+V*x,m+V*_,h*$/jp(l*H+G)]}}return N.duration=T*1e3*l/Math.SQRT2,N}return r.rho=function(c){var d=Math.max(.001,+c),g=d*d,m=g*g;return n(d,g,m)},r})(Math.SQRT2,2,4);var ni=0,uo=0,lo=0,s0=1e3,wr,co,Er=0,nl=0,Dr=0,vo=typeof performance=="object"&&performance.now?performance:Date,r0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function Wf(){return nl||(r0(rE),nl=vo.now()+Dr)}function rE(){nl=0}function _r(){this._call=this._time=this._next=null}_r.prototype=u0.prototype={constructor:_r,restart:function(n,l,o){if(typeof n!="function")throw new TypeError("callback is not a function");o=(o==null?Wf():+o)+(l==null?0:+l),!this._next&&co!==this&&(co?co._next=this:wr=this,co=this),this._call=n,this._time=o,qf()},stop:function(){this._call&&(this._call=null,this._time=1/0,qf())}};function u0(n,l,o){var s=new _r;return s.restart(n,l,o),s}function uE(){Wf(),++ni;for(var n=wr,l;n;)(l=nl-n._time)>=0&&n._call.call(void 0,l),n=n._next;--ni}function Hp(){nl=(Er=vo.now())+Dr,ni=uo=0;try{uE()}finally{ni=0,fE(),nl=0}}function cE(){var n=vo.now(),l=n-Er;l>s0&&(Dr-=l,Er=n)}function fE(){for(var n,l=wr,o,s=1/0;l;)l._call?(s>l._time&&(s=l._time),n=l,l=l._next):(o=l._next,l._next=null,l=n?n._next=o:wr=o);co=n,qf(s)}function qf(n){if(!ni){uo&&(uo=clearTimeout(uo));var l=n-nl;l>24?(n<1/0&&(uo=setTimeout(Hp,n-vo.now()-Dr)),lo&&(lo=clearInterval(lo))):(lo||(Er=vo.now(),lo=setInterval(cE,s0)),ni=1,r0(Hp))}}function Up(n,l,o){var s=new _r;return l=l==null?0:+l,s.restart(r=>{s.stop(),n(r+l)},l,o),s}var dE=Mr("start","end","cancel","interrupt"),hE=[],c0=0,Lp=1,If=2,gr=3,Bp=4,Gf=5,mr=6;function Rr(n,l,o,s,r,c){var d=n.__transition;if(!d)n.__transition={};else if(o in d)return;gE(n,o,{name:l,index:s,group:r,on:dE,tween:hE,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:c0})}function ed(n,l){var o=ln(n,l);if(o.state>c0)throw new Error("too late; already scheduled");return o}function pn(n,l){var o=ln(n,l);if(o.state>gr)throw new Error("too late; already running");return o}function ln(n,l){var o=n.__transition;if(!o||!(o=o[l]))throw new Error("transition not found");return o}function gE(n,l,o){var s=n.__transition,r;s[l]=o,o.timer=u0(c,0,o.time);function c(h){o.state=Lp,o.timer.restart(d,o.delay,o.time),o.delay<=h&&d(h-o.delay)}function d(h){var v,y,p,x;if(o.state!==Lp)return m();for(v in s)if(x=s[v],x.name===o.name){if(x.state===gr)return Up(d);x.state===Bp?(x.state=mr,x.timer.stop(),x.on.call("interrupt",n,n.__data__,x.index,x.group),delete s[v]):+v<l&&(x.state=mr,x.timer.stop(),x.on.call("cancel",n,n.__data__,x.index,x.group),delete s[v])}if(Up(function(){o.state===gr&&(o.state=Bp,o.timer.restart(g,o.delay,o.time),g(h))}),o.state=If,o.on.call("start",n,n.__data__,o.index,o.group),o.state===If){for(o.state=gr,r=new Array(p=o.tween.length),v=0,y=-1;v<p;++v)(x=o.tween[v].value.call(n,n.__data__,o.index,o.group))&&(r[++y]=x);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=Gf,1),y=-1,p=r.length;++y<p;)r[y].call(n,v);o.state===Gf&&(o.on.call("end",n,n.__data__,o.index,o.group),m())}function m(){o.state=mr,o.timer.stop(),delete s[l];for(var h in s)return;delete n.__transition}}function pr(n,l){var o=n.__transition,s,r,c=!0,d;if(o){l=l==null?null:l+"";for(d in o){if((s=o[d]).name!==l){c=!1;continue}r=s.state>If&&s.state<Gf,s.state=mr,s.timer.stop(),s.on.call(r?"interrupt":"cancel",n,n.__data__,s.index,s.group),delete o[d]}c&&delete n.__transition}}function mE(n){return this.each(function(){pr(this,n)})}function pE(n,l){var o,s;return function(){var r=pn(this,n),c=r.tween;if(c!==o){s=o=c;for(var d=0,g=s.length;d<g;++d)if(s[d].name===l){s=s.slice(),s.splice(d,1);break}}r.tween=s}}function yE(n,l,o){var s,r;if(typeof o!="function")throw new Error;return function(){var c=pn(this,n),d=c.tween;if(d!==s){r=(s=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)}c.tween=r}}function vE(n,l){var o=this._id;if(n+="",arguments.length<2){for(var s=ln(this.node(),o).tween,r=0,c=s.length,d;r<c;++r)if((d=s[r]).name===n)return d.value;return null}return this.each((l==null?pE:yE)(o,n,l))}function td(n,l,o){var s=n._id;return n.each(function(){var r=pn(this,s);(r.value||(r.value={}))[l]=o.apply(this,arguments)}),function(r){return ln(r,s).value[l]}}function f0(n,l){var o;return(typeof l=="number"?dn:l instanceof tl?xr:(o=tl(l))?(l=o,xr):l0)(n,l)}function SE(n){return function(){this.removeAttribute(n)}}function bE(n){return function(){this.removeAttributeNS(n.space,n.local)}}function xE(n,l,o){var s,r=o+"",c;return function(){var d=this.getAttribute(n);return d===r?null:d===s?c:c=l(s=d,o)}}function wE(n,l,o){var s,r=o+"",c;return function(){var d=this.getAttributeNS(n.space,n.local);return d===r?null:d===s?c:c=l(s=d,o)}}function EE(n,l,o){var s,r,c;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===s&&m===r?c:(r=m,c=l(s=d,g)))}}function _E(n,l,o){var s,r,c;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===s&&m===r?c:(r=m,c=l(s=d,g)))}}function NE(n,l){var o=zr(n),s=o==="transform"?lE:f0;return this.attrTween(n,typeof l=="function"?(o.local?_E:EE)(o,s,td(this,"attr."+n,l)):l==null?(o.local?bE:SE)(o):(o.local?wE:xE)(o,s,l))}function AE(n,l){return function(o){this.setAttribute(n,l.call(this,o))}}function TE(n,l){return function(o){this.setAttributeNS(n.space,n.local,l.call(this,o))}}function CE(n,l){var o,s;function r(){var c=l.apply(this,arguments);return c!==s&&(o=(s=c)&&TE(n,c)),o}return r._value=l,r}function ME(n,l){var o,s;function r(){var c=l.apply(this,arguments);return c!==s&&(o=(s=c)&&AE(n,c)),o}return r._value=l,r}function zE(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 s=zr(n);return this.tween(o,(s.local?CE:ME)(s,l))}function DE(n,l){return function(){ed(this,n).delay=+l.apply(this,arguments)}}function RE(n,l){return l=+l,function(){ed(this,n).delay=l}}function OE(n){var l=this._id;return arguments.length?this.each((typeof n=="function"?DE:RE)(l,n)):ln(this.node(),l).delay}function jE(n,l){return function(){pn(this,n).duration=+l.apply(this,arguments)}}function HE(n,l){return l=+l,function(){pn(this,n).duration=l}}function UE(n){var l=this._id;return arguments.length?this.each((typeof n=="function"?jE:HE)(l,n)):ln(this.node(),l).duration}function LE(n,l){if(typeof l!="function")throw new Error;return function(){pn(this,n).ease=l}}function BE(n){var l=this._id;return arguments.length?this.each(LE(l,n)):ln(this.node(),l).ease}function qE(n,l){return function(){var o=l.apply(this,arguments);if(typeof o!="function")throw new Error;pn(this,n).ease=o}}function IE(n){if(typeof n!="function")throw new Error;return this.each(qE(this._id,n))}function GE(n){typeof n!="function"&&(n=Yy(n));for(var l=this._groups,o=l.length,s=new Array(o),r=0;r<o;++r)for(var c=l[r],d=c.length,g=s[r]=[],m,h=0;h<d;++h)(m=c[h])&&n.call(m,m.__data__,h,c)&&g.push(m);return new kn(s,this._parents,this._name,this._id)}function YE(n){if(n._id!==this._id)throw new Error;for(var l=this._groups,o=n._groups,s=l.length,r=o.length,c=Math.min(s,r),d=new Array(s),g=0;g<c;++g)for(var m=l[g],h=o[g],v=m.length,y=d[g]=new Array(v),p,x=0;x<v;++x)(p=m[x]||h[x])&&(y[x]=p);for(;g<s;++g)d[g]=l[g];return new kn(d,this._parents,this._name,this._id)}function kE(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 VE(n,l,o){var s,r,c=kE(l)?ed:pn;return function(){var d=c(this,n),g=d.on;g!==s&&(r=(s=g).copy()).on(l,o),d.on=r}}function XE(n,l){var o=this._id;return arguments.length<2?ln(this.node(),o).on.on(n):this.each(VE(o,n,l))}function ZE(n){return function(){var l=this.parentNode;for(var o in this.__transition)if(+o!==n)return;l&&l.removeChild(this)}}function $E(){return this.on("end.remove",ZE(this._id))}function QE(n){var l=this._name,o=this._id;typeof n!="function"&&(n=Kf(n));for(var s=this._groups,r=s.length,c=new Array(r),d=0;d<r;++d)for(var g=s[d],m=g.length,h=c[d]=new Array(m),v,y,p=0;p<m;++p)(v=g[p])&&(y=n.call(v,v.__data__,p,g))&&("__data__"in v&&(y.__data__=v.__data__),h[p]=y,Rr(h[p],l,o,p,h,ln(v,o)));return new kn(c,this._parents,l,o)}function KE(n){var l=this._name,o=this._id;typeof n!="function"&&(n=Gy(n));for(var s=this._groups,r=s.length,c=[],d=[],g=0;g<r;++g)for(var m=s[g],h=m.length,v,y=0;y<h;++y)if(v=m[y]){for(var p=n.call(v,v.__data__,y,m),x,_=ln(v,o),M=0,N=p.length;M<N;++M)(x=p[M])&&Rr(x,l,o,M,p,_);c.push(p),d.push(v)}return new kn(c,d,l,o)}var FE=No.prototype.constructor;function JE(){return new FE(this._groups,this._parents)}function PE(n,l){var o,s,r;return function(){var c=ti(this,n),d=(this.style.removeProperty(n),ti(this,n));return c===d?null:c===o&&d===s?r:r=l(o=c,s=d)}}function d0(n){return function(){this.style.removeProperty(n)}}function WE(n,l,o){var s,r=o+"",c;return function(){var d=ti(this,n);return d===r?null:d===s?c:c=l(s=d,o)}}function e_(n,l,o){var s,r,c;return function(){var d=ti(this,n),g=o(this),m=g+"";return g==null&&(m=g=(this.style.removeProperty(n),ti(this,n))),d===m?null:d===s&&m===r?c:(r=m,c=l(s=d,g))}}function t_(n,l){var o,s,r,c="style."+l,d="end."+c,g;return function(){var m=pn(this,n),h=m.on,v=m.value[c]==null?g||(g=d0(l)):void 0;(h!==o||r!==v)&&(s=(o=h).copy()).on(d,r=v),m.on=s}}function n_(n,l,o){var s=(n+="")=="transform"?aE:f0;return l==null?this.styleTween(n,PE(n,s)).on("end.style."+n,d0(n)):typeof l=="function"?this.styleTween(n,e_(n,s,td(this,"style."+n,l))).each(t_(this._id,n)):this.styleTween(n,WE(n,s,l),o).on("end.style."+n,null)}function a_(n,l,o){return function(s){this.style.setProperty(n,l.call(this,s),o)}}function l_(n,l,o){var s,r;function c(){var d=l.apply(this,arguments);return d!==r&&(s=(r=d)&&a_(n,d,o)),s}return c._value=l,c}function i_(n,l,o){var s="style."+(n+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(l==null)return this.tween(s,null);if(typeof l!="function")throw new Error;return this.tween(s,l_(n,l,o??""))}function o_(n){return function(){this.textContent=n}}function s_(n){return function(){var l=n(this);this.textContent=l??""}}function r_(n){return this.tween("text",typeof n=="function"?s_(td(this,"text",n)):o_(n==null?"":n+""))}function u_(n){return function(l){this.textContent=n.call(this,l)}}function c_(n){var l,o;function s(){var r=n.apply(this,arguments);return r!==o&&(l=(o=r)&&u_(r)),l}return s._value=n,s}function f_(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,c_(n))}function d_(){for(var n=this._name,l=this._id,o=h0(),s=this._groups,r=s.length,c=0;c<r;++c)for(var d=s[c],g=d.length,m,h=0;h<g;++h)if(m=d[h]){var v=ln(m,l);Rr(m,n,o,h,d,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new kn(s,this._parents,n,o)}function h_(){var n,l,o=this,s=o._id,r=o.size();return new Promise(function(c,d){var g={value:d},m={value:function(){--r===0&&c()}};o.each(function(){var h=pn(this,s),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&&c()})}var g_=0;function kn(n,l,o,s){this._groups=n,this._parents=l,this._name=o,this._id=s}function h0(){return++g_}var In=No.prototype;kn.prototype={constructor:kn,select:QE,selectAll:KE,selectChild:In.selectChild,selectChildren:In.selectChildren,filter:GE,merge:YE,selection:JE,transition:d_,call:In.call,nodes:In.nodes,node:In.node,size:In.size,empty:In.empty,each:In.each,on:XE,attr:NE,attrTween:zE,style:n_,styleTween:i_,text:r_,textTween:f_,remove:$E,tween:vE,delay:OE,duration:UE,ease:BE,easeVarying:IE,end:h_,[Symbol.iterator]:In[Symbol.iterator]};function m_(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var p_={time:null,delay:0,duration:250,ease:m_};function y_(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 v_(n){var l,o;n instanceof kn?(l=n._id,n=n._name):(l=h0(),(o=p_).time=Wf(),n=n==null?null:n+"");for(var s=this._groups,r=s.length,c=0;c<r;++c)for(var d=s[c],g=d.length,m,h=0;h<g;++h)(m=d[h])&&Rr(m,n,l,h,d,o||y_(m,l));return new kn(s,this._parents,n,l)}No.prototype.interrupt=mE;No.prototype.transition=v_;const or=n=>()=>n;function S_(n,{sourceEvent:l,target:o,transform:s,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:s,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 Or=new Yn(1,0,0);g0.prototype=Yn.prototype;function g0(n){for(;!n.__zoom;)if(!(n=n.parentNode))return Or;return n.__zoom}function xf(n){n.stopImmediatePropagation()}function io(n){n.preventDefault(),n.stopImmediatePropagation()}function b_(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function x_(){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 qp(){return this.__zoom||Or}function w_(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function E_(){return navigator.maxTouchPoints||"ontouchstart"in this}function __(n,l,o){var s=n.invertX(l[0][0])-o[0][0],r=n.invertX(l[1][0])-o[1][0],c=n.invertY(l[0][1])-o[0][1],d=n.invertY(l[1][1])-o[1][1];return n.translate(r>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),d>c?(c+d)/2:Math.min(0,c)||Math.max(0,d))}function m0(){var n=b_,l=x_,o=__,s=w_,r=E_,c=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],g=250,m=hr,h=Mr("start","zoom","end"),v,y,p,x=500,_=150,M=0,N=10;function T(z){z.property("__zoom",qp).on("wheel.zoom",H,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",V).filter(r).on("touchstart.zoom",Y).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",te).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}T.transform=function(z,k,A,j){var I=z.selection?z.selection():z;I.property("__zoom",qp),z!==I?G(z,k,A,j):I.interrupt().each(function(){R(this,arguments).event(j).start().zoom(null,typeof k=="function"?k.apply(this,arguments):k).end()})},T.scaleBy=function(z,k,A,j){T.scaleTo(z,function(){var I=this.__zoom.k,Q=typeof k=="function"?k.apply(this,arguments):k;return I*Q},A,j)},T.scaleTo=function(z,k,A,j){T.transform(z,function(){var I=l.apply(this,arguments),Q=this.__zoom,ne=A==null?D(I):typeof A=="function"?A.apply(this,arguments):A,C=Q.invert(ne),B=typeof k=="function"?k.apply(this,arguments):k;return o(w(U(Q,B),ne,C),I,d)},A,j)},T.translateBy=function(z,k,A,j){T.transform(z,function(){return o(this.__zoom.translate(typeof k=="function"?k.apply(this,arguments):k,typeof A=="function"?A.apply(this,arguments):A),l.apply(this,arguments),d)},null,j)},T.translateTo=function(z,k,A,j,I){T.transform(z,function(){var Q=l.apply(this,arguments),ne=this.__zoom,C=j==null?D(Q):typeof j=="function"?j.apply(this,arguments):j;return o(Or.translate(C[0],C[1]).scale(ne.k).translate(typeof k=="function"?-k.apply(this,arguments):-k,typeof A=="function"?-A.apply(this,arguments):-A),Q,d)},j,I)};function U(z,k){return k=Math.max(c[0],Math.min(c[1],k)),k===z.k?z:new Yn(k,z.x,z.y)}function w(z,k,A){var j=k[0]-A[0]*z.k,I=k[1]-A[1]*z.k;return j===z.x&&I===z.y?z:new Yn(z.k,j,I)}function D(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function G(z,k,A,j){z.on("start.zoom",function(){R(this,arguments).event(j).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(j).end()}).tween("zoom",function(){var I=this,Q=arguments,ne=R(I,Q).event(j),C=l.apply(I,Q),B=A==null?D(C):typeof A=="function"?A.apply(I,Q):A,ee=Math.max(C[1][0]-C[0][0],C[1][1]-C[0][1]),ae=I.__zoom,ue=typeof k=="function"?k.apply(I,Q):k,fe=m(ae.invert(B).concat(ee/ae.k),ue.invert(B).concat(ee/ue.k));return function(ce){if(ce===1)ce=ue;else{var re=fe(ce),de=ee/re[2];ce=new Yn(de,B[0]-re[0]*de,B[1]-re[1]*de)}ne.zoom(null,ce)}})}function R(z,k,A){return!A&&z.__zooming||new L(z,k)}function L(z,k){this.that=z,this.args=k,this.active=0,this.sourceEvent=null,this.extent=l.apply(z,k),this.taps=0}L.prototype={event:function(z){return z&&(this.sourceEvent=z),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(z,k){return this.mouse&&z!=="mouse"&&(this.mouse[1]=k.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=k.invert(this.touch0[0])),this.touch1&&z!=="touch"&&(this.touch1[1]=k.invert(this.touch1[0])),this.that.__zoom=k,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(z){var k=Bt(this.that).datum();h.call(z,this.that,new S_(z,{sourceEvent:this.sourceEvent,target:T,transform:this.that.__zoom,dispatch:h}),k)}};function H(z,...k){if(!n.apply(this,arguments))return;var A=R(this,k).event(z),j=this.__zoom,I=Math.max(c[0],Math.min(c[1],j.k*Math.pow(2,s.apply(this,arguments)))),Q=en(z);if(A.wheel)(A.mouse[0][0]!==Q[0]||A.mouse[0][1]!==Q[1])&&(A.mouse[1]=j.invert(A.mouse[0]=Q)),clearTimeout(A.wheel);else{if(j.k===I)return;A.mouse=[Q,j.invert(Q)],pr(this),A.start()}io(z),A.wheel=setTimeout(ne,_),A.zoom("mouse",o(w(U(j,I),A.mouse[0],A.mouse[1]),A.extent,d));function ne(){A.wheel=null,A.end()}}function $(z,...k){if(p||!n.apply(this,arguments))return;var A=z.currentTarget,j=R(this,k,!0).event(z),I=Bt(z.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",ee,!0),Q=en(z,A),ne=z.clientX,C=z.clientY;Py(z.view),xf(z),j.mouse=[Q,this.__zoom.invert(Q)],pr(this),j.start();function B(ae){if(io(ae),!j.moved){var ue=ae.clientX-ne,fe=ae.clientY-C;j.moved=ue*ue+fe*fe>M}j.event(ae).zoom("mouse",o(w(j.that.__zoom,j.mouse[0]=en(ae,A),j.mouse[1]),j.extent,d))}function ee(ae){I.on("mousemove.zoom mouseup.zoom",null),Wy(ae.view,j.moved),io(ae),j.event(ae).end()}}function V(z,...k){if(n.apply(this,arguments)){var A=this.__zoom,j=en(z.changedTouches?z.changedTouches[0]:z,this),I=A.invert(j),Q=A.k*(z.shiftKey?.5:2),ne=o(w(U(A,Q),j,I),l.apply(this,k),d);io(z),g>0?Bt(this).transition().duration(g).call(G,ne,j,z):Bt(this).call(T.transform,ne,j,z)}}function Y(z,...k){if(n.apply(this,arguments)){var A=z.touches,j=A.length,I=R(this,k,z.changedTouches.length===j).event(z),Q,ne,C,B;for(xf(z),ne=0;ne<j;++ne)C=A[ne],B=en(C,this),B=[B,this.__zoom.invert(B),C.identifier],I.touch0?!I.touch1&&I.touch0[2]!==B[2]&&(I.touch1=B,I.taps=0):(I.touch0=B,Q=!0,I.taps=1+!!v);v&&(v=clearTimeout(v)),Q&&(I.taps<2&&(y=B[0],v=setTimeout(function(){v=null},x)),pr(this),I.start())}}function P(z,...k){if(this.__zooming){var A=R(this,k).event(z),j=z.changedTouches,I=j.length,Q,ne,C,B;for(io(z),Q=0;Q<I;++Q)ne=j[Q],C=en(ne,this),A.touch0&&A.touch0[2]===ne.identifier?A.touch0[0]=C:A.touch1&&A.touch1[2]===ne.identifier&&(A.touch1[0]=C);if(ne=A.that.__zoom,A.touch1){var ee=A.touch0[0],ae=A.touch0[1],ue=A.touch1[0],fe=A.touch1[1],ce=(ce=ue[0]-ee[0])*ce+(ce=ue[1]-ee[1])*ce,re=(re=fe[0]-ae[0])*re+(re=fe[1]-ae[1])*re;ne=U(ne,Math.sqrt(ce/re)),C=[(ee[0]+ue[0])/2,(ee[1]+ue[1])/2],B=[(ae[0]+fe[0])/2,(ae[1]+fe[1])/2]}else if(A.touch0)C=A.touch0[0],B=A.touch0[1];else return;A.zoom("touch",o(w(ne,C,B),A.extent,d))}}function te(z,...k){if(this.__zooming){var A=R(this,k).event(z),j=z.changedTouches,I=j.length,Q,ne;for(xf(z),p&&clearTimeout(p),p=setTimeout(function(){p=null},x),Q=0;Q<I;++Q)ne=j[Q],A.touch0&&A.touch0[2]===ne.identifier?delete A.touch0:A.touch1&&A.touch1[2]===ne.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(ne=en(ne,this),Math.hypot(y[0]-ne[0],y[1]-ne[1])<N)){var C=Bt(this).on("dblclick.zoom");C&&C.apply(this,arguments)}}}return T.wheelDelta=function(z){return arguments.length?(s=typeof z=="function"?z:or(+z),T):s},T.filter=function(z){return arguments.length?(n=typeof z=="function"?z:or(!!z),T):n},T.touchable=function(z){return arguments.length?(r=typeof z=="function"?z:or(!!z),T):r},T.extent=function(z){return arguments.length?(l=typeof z=="function"?z:or([[+z[0][0],+z[0][1]],[+z[1][0],+z[1][1]]]),T):l},T.scaleExtent=function(z){return arguments.length?(c[0]=+z[0],c[1]=+z[1],T):[c[0],c[1]]},T.translateExtent=function(z){return arguments.length?(d[0][0]=+z[0][0],d[1][0]=+z[1][0],d[0][1]=+z[0][1],d[1][1]=+z[1][1],T):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},T.constrain=function(z){return arguments.length?(o=z,T):o},T.duration=function(z){return arguments.length?(g=+z,T):g},T.interpolate=function(z){return arguments.length?(m=z,T):m},T.on=function(){var z=h.on.apply(h,arguments);return z===h?T:z},T.clickDistance=function(z){return arguments.length?(M=(z=+z)*z,T):Math.sqrt(M)},T.tapDistance=function(z){return arguments.length?(N=+z,T):N},T}const mn={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:s})=>`Couldn't create edge for ${n} handle id: "${n==="source"?o:s}", 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."},So=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],p0=["Enter"," ","Escape"],y0={"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 ai;(function(n){n.Strict="strict",n.Loose="loose"})(ai||(ai={}));var el;(function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"})(el||(el={}));var bo;(function(n){n.Partial="partial",n.Full="full"})(bo||(bo={}));const v0={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ea;(function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"})(Ea||(Ea={}));var Nr;(function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"})(Nr||(Nr={}));var me;(function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"})(me||(me={}));const Ip={[me.Left]:me.Right,[me.Right]:me.Left,[me.Top]:me.Bottom,[me.Bottom]:me.Top};function S0(n){return n===null?null:n?"valid":"invalid"}const b0=n=>"id"in n&&"source"in n&&"target"in n,N_=n=>"id"in n&&"position"in n&&!("source"in n)&&!("target"in n),nd=n=>"id"in n&&"internals"in n&&!("source"in n)&&!("target"in n),To=(n,l=[0,0])=>{const{width:o,height:s}=Vn(n),r=n.origin??l,c=o*r[0],d=s*r[1];return{x:n.position.x-c,y:n.position.y-d}},A_=(n,l={nodeOrigin:[0,0]})=>{if(n.length===0)return{x:0,y:0,width:0,height:0};const o=n.reduce((s,r)=>{const c=typeof r=="string";let d=!l.nodeLookup&&!c?r:void 0;l.nodeLookup&&(d=c?l.nodeLookup.get(r):nd(r)?r:l.nodeLookup.get(r.id));const g=d?Ar(d,l.nodeOrigin):{x:0,y:0,x2:0,y2:0};return jr(s,g)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Hr(o)},Co=(n,l={})=>{let o={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return n.forEach(r=>{(l.filter===void 0||l.filter(r))&&(o=jr(o,Ar(r)),s=!0)}),s?Hr(o):{x:0,y:0,width:0,height:0}},ad=(n,l,[o,s,r]=[0,0,1],c=!1,d=!1)=>{const g={...zo(l,[o,s,r]),width:l.width/r,height:l.height/r},m=[];for(const h of n.values()){const{measured:v,selectable:y=!0,hidden:p=!1}=h;if(d&&!y||p)continue;const x=v.width??h.width??h.initialWidth??null,_=v.height??h.height??h.initialHeight??null,M=xo(g,ii(h)),N=(x??0)*(_??0),T=c&&M>0;(!h.internals.handleBounds||T||M>=N||h.dragging)&&m.push(h)}return m},T_=(n,l)=>{const o=new Set;return n.forEach(s=>{o.add(s.id)}),l.filter(s=>o.has(s.source)||o.has(s.target))};function C_(n,l){const o=new Map,s=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)&&(!s||s.has(r.id))&&o.set(r.id,r)}),o}async function M_({nodes:n,width:l,height:o,panZoom:s,minZoom:r,maxZoom:c},d){if(n.size===0)return Promise.resolve(!0);const g=C_(n,d),m=Co(g),h=ld(m,l,o,d?.minZoom??r,d?.maxZoom??c,d?.padding??.1);return await s.setViewport(h,{duration:d?.duration,ease:d?.ease,interpolate:d?.interpolate}),Promise.resolve(!0)}function x0({nodeId:n,nextPosition:l,nodeLookup:o,nodeOrigin:s=[0,0],nodeExtent:r,onError:c}){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??s;let y=d.extent||r;if(d.extent==="parent"&&!d.expandParent)if(!g)c?.("005",mn.error005());else{const x=g.measured.width,_=g.measured.height;x&&_&&(y=[[m,h],[m+x,h+_]])}else g&&oi(d.extent)&&(y=[[d.extent[0][0]+m,d.extent[0][1]+h],[d.extent[1][0]+m,d.extent[1][1]+h]]);const p=oi(y)?al(l,y,d.measured):l;return(d.measured.width===void 0||d.measured.height===void 0)&&c?.("015",mn.error015()),{position:{x:p.x-m+(d.measured.width??0)*v[0],y:p.y-h+(d.measured.height??0)*v[1]},positionAbsolute:p}}async function z_({nodesToRemove:n=[],edgesToRemove:l=[],nodes:o,edges:s,onBeforeDelete:r}){const c=new Set(n.map(p=>p.id)),d=[];for(const p of o){if(p.deletable===!1)continue;const x=c.has(p.id),_=!x&&p.parentId&&d.find(M=>M.id===p.parentId);(x||_)&&d.push(p)}const g=new Set(l.map(p=>p.id)),m=s.filter(p=>p.deletable!==!1),v=T_(d,m);for(const p of m)g.has(p.id)&&!v.find(_=>_.id===p.id)&&v.push(p);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 li=(n,l=0,o=1)=>Math.min(Math.max(n,l),o),al=(n={x:0,y:0},l,o)=>({x:li(n.x,l[0][0],l[1][0]-(o?.width??0)),y:li(n.y,l[0][1],l[1][1]-(o?.height??0))});function w0(n,l,o){const{width:s,height:r}=Vn(o),{x:c,y:d}=o.internals.positionAbsolute;return al(n,[[c,d],[c+s,d+r]],l)}const Gp=(n,l,o)=>n<l?li(Math.abs(n-l),1,l)/l:n>o?-li(Math.abs(n-o),1,l)/l:0,E0=(n,l,o=15,s=40)=>{const r=Gp(n.x,s,l.width-s)*o,c=Gp(n.y,s,l.height-s)*o;return[r,c]},jr=(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)}),Yf=({x:n,y:l,width:o,height:s})=>({x:n,y:l,x2:n+o,y2:l+s}),Hr=({x:n,y:l,x2:o,y2:s})=>({x:n,y:l,width:o-n,height:s-l}),ii=(n,l=[0,0])=>{const{x:o,y:s}=nd(n)?n.internals.positionAbsolute:To(n,l);return{x:o,y:s,width:n.measured?.width??n.width??n.initialWidth??0,height:n.measured?.height??n.height??n.initialHeight??0}},Ar=(n,l=[0,0])=>{const{x:o,y:s}=nd(n)?n.internals.positionAbsolute:To(n,l);return{x:o,y:s,x2:o+(n.measured?.width??n.width??n.initialWidth??0),y2:s+(n.measured?.height??n.height??n.initialHeight??0)}},_0=(n,l)=>Hr(jr(Yf(n),Yf(l))),xo=(n,l)=>{const o=Math.max(0,Math.min(n.x+n.width,l.x+l.width)-Math.max(n.x,l.x)),s=Math.max(0,Math.min(n.y+n.height,l.y+l.height)-Math.max(n.y,l.y));return Math.ceil(o*s)},Yp=n=>nn(n.width)&&nn(n.height)&&nn(n.x)&&nn(n.y),nn=n=>!isNaN(n)&&isFinite(n),D_=(n,l)=>{},Mo=(n,l=[1,1])=>({x:l[0]*Math.round(n.x/l[0]),y:l[1]*Math.round(n.y/l[1])}),zo=({x:n,y:l},[o,s,r],c=!1,d=[1,1])=>{const g={x:(n-o)/r,y:(l-s)/r};return c?Mo(g,d):g},Tr=({x:n,y:l},[o,s,r])=>({x:n*r+o,y:l*r+s});function Kl(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 R_(n,l,o){if(typeof n=="string"||typeof n=="number"){const s=Kl(n,o),r=Kl(n,l);return{top:s,right:r,bottom:s,left:r,x:r*2,y:s*2}}if(typeof n=="object"){const s=Kl(n.top??n.y??0,o),r=Kl(n.bottom??n.y??0,o),c=Kl(n.left??n.x??0,l),d=Kl(n.right??n.x??0,l);return{top:s,right:d,bottom:r,left:c,x:c+d,y:s+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function O_(n,l,o,s,r,c){const{x:d,y:g}=Tr(n,[l,o,s]),{x:m,y:h}=Tr({x:n.x+n.width,y:n.y+n.height},[l,o,s]),v=r-m,y=c-h;return{left:Math.floor(d),top:Math.floor(g),right:Math.floor(v),bottom:Math.floor(y)}}const ld=(n,l,o,s,r,c)=>{const d=R_(c,l,o),g=(l-d.x)/n.width,m=(o-d.y)/n.height,h=Math.min(g,m),v=li(h,s,r),y=n.x+n.width/2,p=n.y+n.height/2,x=l/2-y*v,_=o/2-p*v,M=O_(n,x,_,v,l,o),N={left:Math.min(M.left-d.left,0),top:Math.min(M.top-d.top,0),right:Math.min(M.right-d.right,0),bottom:Math.min(M.bottom-d.bottom,0)};return{x:x-N.left+N.right,y:_-N.top+N.bottom,zoom:v}},wo=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function oi(n){return n!=null&&n!=="parent"}function Vn(n){return{width:n.measured?.width??n.width??n.initialWidth??0,height:n.measured?.height??n.height??n.initialHeight??0}}function N0(n){return(n.measured?.width??n.width??n.initialWidth)!==void 0&&(n.measured?.height??n.height??n.initialHeight)!==void 0}function A0(n,l={width:0,height:0},o,s,r){const c={...n},d=s.get(o);if(d){const g=d.origin||r;c.x+=d.internals.positionAbsolute.x-(l.width??0)*g[0],c.y+=d.internals.positionAbsolute.y-(l.height??0)*g[1]}return c}function kp(n,l){if(n.size!==l.size)return!1;for(const o of n)if(!l.has(o))return!1;return!0}function j_(){let n,l;return{promise:new Promise((s,r)=>{n=s,l=r}),resolve:n,reject:l}}function H_(n){return{...y0,...n||{}}}function go(n,{snapGrid:l=[0,0],snapToGrid:o=!1,transform:s,containerBounds:r}){const{x:c,y:d}=an(n),g=zo({x:c-(r?.left??0),y:d-(r?.top??0)},s),{x:m,y:h}=o?Mo(g,l):g;return{xSnapped:m,ySnapped:h,...g}}const id=n=>({width:n.offsetWidth,height:n.offsetHeight}),T0=n=>n?.getRootNode?.()||window?.document,U_=["INPUT","SELECT","TEXTAREA"];function C0(n){const l=n.composedPath?.()?.[0]||n.target;return l?.nodeType!==1?!1:U_.includes(l.nodeName)||l.hasAttribute("contenteditable")||!!l.closest(".nokey")}const M0=n=>"clientX"in n,an=(n,l)=>{const o=M0(n),s=o?n.clientX:n.touches?.[0].clientX,r=o?n.clientY:n.touches?.[0].clientY;return{x:s-(l?.left??0),y:r-(l?.top??0)}},Vp=(n,l,o,s,r)=>{const c=l.querySelectorAll(`.${n}`);return!c||!c.length?null:Array.from(c).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)/s,y:(g.top-o.top)/s,...id(d)}})};function z0({sourceX:n,sourceY:l,targetX:o,targetY:s,sourceControlX:r,sourceControlY:c,targetControlX:d,targetControlY:g}){const m=n*.125+r*.375+d*.375+o*.125,h=l*.125+c*.375+g*.375+s*.125,v=Math.abs(m-n),y=Math.abs(h-l);return[m,h,v,y]}function sr(n,l){return n>=0?.5*n:l*25*Math.sqrt(-n)}function Xp({pos:n,x1:l,y1:o,x2:s,y2:r,c}){switch(n){case me.Left:return[l-sr(l-s,c),o];case me.Right:return[l+sr(s-l,c),o];case me.Top:return[l,o-sr(o-r,c)];case me.Bottom:return[l,o+sr(r-o,c)]}}function D0({sourceX:n,sourceY:l,sourcePosition:o=me.Bottom,targetX:s,targetY:r,targetPosition:c=me.Top,curvature:d=.25}){const[g,m]=Xp({pos:o,x1:n,y1:l,x2:s,y2:r,c:d}),[h,v]=Xp({pos:c,x1:s,y1:r,x2:n,y2:l,c:d}),[y,p,x,_]=z0({sourceX:n,sourceY:l,targetX:s,targetY:r,sourceControlX:g,sourceControlY:m,targetControlX:h,targetControlY:v});return[`M${n},${l} C${g},${m} ${h},${v} ${s},${r}`,y,p,x,_]}function R0({sourceX:n,sourceY:l,targetX:o,targetY:s}){const r=Math.abs(o-n)/2,c=o<n?o+r:o-r,d=Math.abs(s-l)/2,g=s<l?s+d:s-d;return[c,g,r,d]}function L_({sourceNode:n,targetNode:l,selected:o=!1,zIndex:s=0,elevateOnSelect:r=!1,zIndexMode:c="basic"}){if(c==="manual")return s;const d=r&&o?s+1e3:s,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 B_({sourceNode:n,targetNode:l,width:o,height:s,transform:r}){const c=jr(Ar(n),Ar(l));c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const d={x:-r[0]/r[2],y:-r[1]/r[2],width:o/r[2],height:s/r[2]};return xo(d,Hr(c))>0}const q_=({source:n,sourceHandle:l,target:o,targetHandle:s})=>`xy-edge__${n}${l||""}-${o}${s||""}`,I_=(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)),G_=(n,l,o={})=>{if(!n.source||!n.target)return l;const s=o.getEdgeId||q_;let r;return b0(n)?r={...n}:r={...n,id:s(n)},I_(r,l)?l:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,l.concat(r))};function O0({sourceX:n,sourceY:l,targetX:o,targetY:s}){const[r,c,d,g]=R0({sourceX:n,sourceY:l,targetX:o,targetY:s});return[`M ${n},${l}L ${o},${s}`,r,c,d,g]}const Zp={[me.Left]:{x:-1,y:0},[me.Right]:{x:1,y:0},[me.Top]:{x:0,y:-1},[me.Bottom]:{x:0,y:1}},Y_=({source:n,sourcePosition:l=me.Bottom,target:o})=>l===me.Left||l===me.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},$p=(n,l)=>Math.sqrt(Math.pow(l.x-n.x,2)+Math.pow(l.y-n.y,2));function k_({source:n,sourcePosition:l=me.Bottom,target:o,targetPosition:s=me.Top,center:r,offset:c,stepPosition:d}){const g=Zp[l],m=Zp[s],h={x:n.x+g.x*c,y:n.y+g.y*c},v={x:o.x+m.x*c,y:o.y+m.y*c},y=Y_({source:h,sourcePosition:l,target:v}),p=y.x!==0?"x":"y",x=y[p];let _=[],M,N;const T={x:0,y:0},U={x:0,y:0},[,,w,D]=R0({sourceX:n.x,sourceY:n.y,targetX:o.x,targetY:o.y});if(g[p]*m[p]===-1){p==="x"?(M=r.x??h.x+(v.x-h.x)*d,N=r.y??(h.y+v.y)/2):(M=r.x??(h.x+v.x)/2,N=r.y??h.y+(v.y-h.y)*d);const H=[{x:M,y:h.y},{x:M,y:v.y}],$=[{x:h.x,y:N},{x:v.x,y:N}];g[p]===x?_=p==="x"?H:$:_=p==="x"?$:H}else{const H=[{x:h.x,y:v.y}],$=[{x:v.x,y:h.y}];if(p==="x"?_=g.x===x?$:H:_=g.y===x?H:$,l===s){const z=Math.abs(n[p]-o[p]);if(z<=c){const k=Math.min(c-1,c-z);g[p]===x?T[p]=(h[p]>n[p]?-1:1)*k:U[p]=(v[p]>o[p]?-1:1)*k}}if(l!==s){const z=p==="x"?"y":"x",k=g[p]===m[z],A=h[z]>v[z],j=h[z]<v[z];(g[p]===1&&(!k&&A||k&&j)||g[p]!==1&&(!k&&j||k&&A))&&(_=p==="x"?H:$)}const V={x:h.x+T.x,y:h.y+T.y},Y={x:v.x+U.x,y:v.y+U.y},P=Math.max(Math.abs(V.x-_[0].x),Math.abs(Y.x-_[0].x)),te=Math.max(Math.abs(V.y-_[0].y),Math.abs(Y.y-_[0].y));P>=te?(M=(V.x+Y.x)/2,N=_[0].y):(M=_[0].x,N=(V.y+Y.y)/2)}const G={x:h.x+T.x,y:h.y+T.y},R={x:v.x+U.x,y:v.y+U.y};return[[n,...G.x!==_[0].x||G.y!==_[0].y?[G]:[],..._,...R.x!==_[_.length-1].x||R.y!==_[_.length-1].y?[R]:[],o],M,N,w,D]}function V_(n,l,o,s){const r=Math.min($p(n,l)/2,$p(l,o)/2,s),{x:c,y:d}=l;if(n.x===c&&c===o.x||n.y===d&&d===o.y)return`L${c} ${d}`;if(n.y===d){const h=n.x<o.x?-1:1,v=n.y<o.y?1:-1;return`L ${c+r*h},${d}Q ${c},${d} ${c},${d+r*v}`}const g=n.x<o.x?1:-1,m=n.y<o.y?-1:1;return`L ${c},${d+r*m}Q ${c},${d} ${c+r*g},${d}`}function kf({sourceX:n,sourceY:l,sourcePosition:o=me.Bottom,targetX:s,targetY:r,targetPosition:c=me.Top,borderRadius:d=5,centerX:g,centerY:m,offset:h=20,stepPosition:v=.5}){const[y,p,x,_,M]=k_({source:{x:n,y:l},sourcePosition:o,target:{x:s,y:r},targetPosition:c,center:{x:g,y:m},offset:h,stepPosition:v});let N=`M${y[0].x} ${y[0].y}`;for(let T=1;T<y.length-1;T++)N+=V_(y[T-1],y[T],y[T+1],d);return N+=`L${y[y.length-1].x} ${y[y.length-1].y}`,[N,p,x,_,M]}function Qp(n){return n&&!!(n.internals.handleBounds||n.handles?.length)&&!!(n.measured.width||n.width||n.initialWidth)}function X_(n){const{sourceNode:l,targetNode:o}=n;if(!Qp(l)||!Qp(o))return null;const s=l.internals.handleBounds||Kp(l.handles),r=o.internals.handleBounds||Kp(o.handles),c=Fp(s?.source??[],n.sourceHandle),d=Fp(n.connectionMode===ai.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),n.targetHandle);if(!c||!d)return n.onError?.("008",mn.error008(c?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;const g=c?.position||me.Bottom,m=d?.position||me.Top,h=ll(l,c,g),v=ll(o,d,m);return{sourceX:h.x,sourceY:h.y,targetX:v.x,targetY:v.y,sourcePosition:g,targetPosition:m}}function Kp(n){if(!n)return null;const l=[],o=[];for(const s of n)s.width=s.width??1,s.height=s.height??1,s.type==="source"?l.push(s):s.type==="target"&&o.push(s);return{source:l,target:o}}function ll(n,l,o=me.Left,s=!1){const r=(l?.x??0)+n.internals.positionAbsolute.x,c=(l?.y??0)+n.internals.positionAbsolute.y,{width:d,height:g}=l??Vn(n);if(s)return{x:r+d/2,y:c+g/2};switch(l?.position??o){case me.Top:return{x:r+d/2,y:c};case me.Right:return{x:r+d,y:c+g/2};case me.Bottom:return{x:r+d/2,y:c+g};case me.Left:return{x:r,y:c+g/2}}}function Fp(n,l){return n&&(l?n.find(o=>o.id===l):n[0])||null}function Vf(n,l){return n?typeof n=="string"?n:`${l?`${l}__`:""}${Object.keys(n).sort().map(s=>`${s}=${n[s]}`).join("&")}`:""}function Z_(n,{id:l,defaultColor:o,defaultMarkerStart:s,defaultMarkerEnd:r}){const c=new Set;return n.reduce((d,g)=>([g.markerStart||s,g.markerEnd||r].forEach(m=>{if(m&&typeof m=="object"){const h=Vf(m,l);c.has(h)||(d.push({id:h,color:m.color||o,...m}),c.add(h))}}),d),[]).sort((d,g)=>d.id.localeCompare(g.id))}const j0=1e3,$_=10,od={nodeOrigin:[0,0],nodeExtent:So,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Q_={...od,checkEquality:!0};function sd(n,l){const o={...n};for(const s in l)l[s]!==void 0&&(o[s]=l[s]);return o}function K_(n,l,o){const s=sd(od,o);for(const r of n.values())if(r.parentId)ud(r,n,l,s);else{const c=To(r,s.nodeOrigin),d=oi(r.extent)?r.extent:s.nodeExtent,g=al(c,d,Vn(r));r.internals.positionAbsolute=g}}function F_(n,l){if(!n.handles)return n.measured?l?.internals.handleBounds:void 0;const o=[],s=[];for(const r of n.handles){const c={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(c):r.type==="target"&&s.push(c)}return{source:o,target:s}}function rd(n){return n==="manual"}function Xf(n,l,o,s={}){const r=sd(Q_,s),c={i:0},d=new Map(l),g=r?.elevateNodesOnSelect&&!rd(r.zIndexMode)?j0: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 p=To(v,r.nodeOrigin),x=oi(v.extent)?v.extent:r.nodeExtent,_=al(p,x,Vn(v));y={...r.defaults,...v,measured:{width:v.measured?.width,height:v.measured?.height},internals:{positionAbsolute:_,handleBounds:F_(v,y),z:H0(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&&ud(y,l,o,s,c),h||=v.selected??!1}return{nodesInitialized:m,hasSelectedNodes:h}}function J_(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 ud(n,l,o,s,r){const{elevateNodesOnSelect:c,nodeOrigin:d,nodeExtent:g,zIndexMode:m}=sd(od,s),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}J_(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*$_),r&&v.internals.rootParentIndex!==void 0&&(r.i=v.internals.rootParentIndex);const y=c&&!rd(m)?j0:0,{x:p,y:x,z:_}=P_(n,v,d,g,y,m),{positionAbsolute:M}=n.internals,N=p!==M.x||x!==M.y;(N||_!==n.internals.z)&&l.set(n.id,{...n,internals:{...n.internals,positionAbsolute:N?{x:p,y:x}:M,z:_}})}function H0(n,l,o){const s=nn(n.zIndex)?n.zIndex:0;return rd(o)?s:s+(n.selected?l:0)}function P_(n,l,o,s,r,c){const{x:d,y:g}=l.internals.positionAbsolute,m=Vn(n),h=To(n,o),v=oi(n.extent)?al(h,n.extent,m):h;let y=al({x:d+v.x,y:g+v.y},s,m);n.extent==="parent"&&(y=w0(y,m,l));const p=H0(n,r,c),x=l.internals.z??0;return{x:y.x,y:y.y,z:x>=p?x+1:p}}function cd(n,l,o,s=[0,0]){const r=[],c=new Map;for(const d of n){const g=l.get(d.parentId);if(!g)continue;const m=c.get(d.parentId)?.expandedRect??ii(g),h=_0(m,d.rect);c.set(d.parentId,{expandedRect:h,parent:g})}return c.size>0&&c.forEach(({expandedRect:d,parent:g},m)=>{const h=g.internals.positionAbsolute,v=Vn(g),y=g.origin??s,p=d.x<h.x?Math.round(Math.abs(h.x-d.x)):0,x=d.y<h.y?Math.round(Math.abs(h.y-d.y)):0,_=Math.max(v.width,Math.round(d.width)),M=Math.max(v.height,Math.round(d.height)),N=(_-v.width)*y[0],T=(M-v.height)*y[1];(p>0||x>0||N||T)&&(r.push({id:m,type:"position",position:{x:g.position.x-p+N,y:g.position.y-x+T}}),o.get(m)?.forEach(U=>{n.some(w=>w.id===U.id)||r.push({id:U.id,type:"position",position:{x:U.position.x+p,y:U.position.y+x}})})),(v.width<d.width||v.height<d.height||p||x)&&r.push({id:m,type:"dimensions",setAttributes:!0,dimensions:{width:_+(p?y[0]*p-N:0),height:M+(x?y[1]*x-T:0)}})}),r}function W_(n,l,o,s,r,c,d){const g=s?.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),p=[];for(const x of n.values()){const _=l.get(x.id);if(!_)continue;if(_.hidden){l.set(_.id,{..._,internals:{..._.internals,handleBounds:void 0}}),m=!0;continue}const M=id(x.nodeElement),N=_.measured.width!==M.width||_.measured.height!==M.height;if(!!(M.width&&M.height&&(N||!_.internals.handleBounds||x.force))){const U=x.nodeElement.getBoundingClientRect(),w=oi(_.extent)?_.extent:c;let{positionAbsolute:D}=_.internals;_.parentId&&_.extent==="parent"?D=w0(D,M,l.get(_.parentId)):w&&(D=al(D,w,M));const G={..._,measured:M,internals:{..._.internals,positionAbsolute:D,handleBounds:{source:Vp("source",x.nodeElement,U,y,_.id),target:Vp("target",x.nodeElement,U,y,_.id)}}};l.set(_.id,G),_.parentId&&ud(G,l,o,{nodeOrigin:r,zIndexMode:d}),m=!0,N&&(h.push({id:_.id,type:"dimensions",dimensions:M}),_.expandParent&&_.parentId&&p.push({id:_.id,parentId:_.parentId,rect:ii(G,r)}))}}if(p.length>0){const x=cd(p,l,o,r);h.push(...x)}return{changes:h,updatedInternals:m}}async function eN({delta:n,panZoom:l,transform:o,translateExtent:s,width:r,height:c}){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,c]],s),g=!!d&&(d.x!==o[0]||d.y!==o[1]||d.k!==o[2]);return Promise.resolve(g)}function Jp(n,l,o,s,r,c){let d=r;const g=s.get(d)||new Map;s.set(d,g.set(o,l)),d=`${r}-${n}`;const m=s.get(d)||new Map;if(s.set(d,m.set(o,l)),c){d=`${r}-${n}-${c}`;const h=s.get(d)||new Map;s.set(d,h.set(o,l))}}function U0(n,l,o){n.clear(),l.clear();for(const s of o){const{source:r,target:c,sourceHandle:d=null,targetHandle:g=null}=s,m={edgeId:s.id,source:r,target:c,sourceHandle:d,targetHandle:g},h=`${r}-${d}--${c}-${g}`,v=`${c}-${g}--${r}-${d}`;Jp("source",m,v,n,r,d),Jp("target",m,h,n,c,g),l.set(s.id,s)}}function L0(n,l){if(!n.parentId)return!1;const o=l.get(n.parentId);return o?o.selected?!0:L0(o,l):!1}function Pp(n,l,o){let s=n;do{if(s?.matches?.(l))return!0;if(s===o)return!1;s=s?.parentElement}while(s);return!1}function tN(n,l,o,s){const r=new Map;for(const[c,d]of n)if((d.selected||d.id===s)&&(!d.parentId||!L0(d,n))&&(d.draggable||l&&typeof d.draggable>"u")){const g=n.get(c);g&&r.set(c,{id:c,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 wf({nodeId:n,dragItems:l,nodeLookup:o,dragging:s=!0}){const r=[];for(const[d,g]of l){const m=o.get(d)?.internals.userNode;m&&r.push({...m,position:g.position,dragging:s})}if(!n)return[r[0],r];const c=o.get(n)?.internals.userNode;return[c?{...c,position:l.get(n)?.position||c.position,dragging:s}:r[0],r]}function nN({dragItems:n,snapGrid:l,x:o,y:s}){const r=n.values().next().value;if(!r)return null;const c={x:o-r.distance.x,y:s-r.distance.y},d=Mo(c,l);return{x:d.x-c.x,y:d.y-c.y}}function aN({onNodeMouseDown:n,getStoreItems:l,onDragStart:o,onDrag:s,onDragStop:r}){let c={x:null,y:null},d=0,g=new Map,m=!1,h={x:0,y:0},v=null,y=!1,p=null,x=!1,_=!1,M=null;function N({noDragClassName:U,handleSelector:w,domNode:D,isSelectable:G,nodeId:R,nodeClickDistance:L=0}){p=Bt(D);function H({x:P,y:te}){const{nodeLookup:z,nodeExtent:k,snapGrid:A,snapToGrid:j,nodeOrigin:I,onNodeDrag:Q,onSelectionDrag:ne,onError:C,updateNodePositions:B}=l();c={x:P,y:te};let ee=!1;const ae=g.size>1,ue=ae&&k?Yf(Co(g)):null,fe=ae&&j?nN({dragItems:g,snapGrid:A,x:P,y:te}):null;for(const[ce,re]of g){if(!z.has(ce))continue;let de={x:P-re.distance.x,y:te-re.distance.y};j&&(de=fe?{x:Math.round(de.x+fe.x),y:Math.round(de.y+fe.y)}:Mo(de,A));let Ee=null;if(ae&&k&&!re.extent&&ue){const{positionAbsolute:Se}=re.internals,Ce=Se.x-ue.x+k[0][0],qe=Se.x+re.measured.width-ue.x2+k[1][0],Ue=Se.y-ue.y+k[0][1],rt=Se.y+re.measured.height-ue.y2+k[1][1];Ee=[[Ce,Ue],[qe,rt]]}const{position:xe,positionAbsolute:ye}=x0({nodeId:ce,nextPosition:de,nodeLookup:z,nodeExtent:Ee||k,nodeOrigin:I,onError:C});ee=ee||re.position.x!==xe.x||re.position.y!==xe.y,re.position=xe,re.internals.positionAbsolute=ye}if(_=_||ee,!!ee&&(B(g,!0),M&&(s||Q||!R&&ne))){const[ce,re]=wf({nodeId:R,dragItems:g,nodeLookup:z});s?.(M,g,ce,re),Q?.(M,ce,re),R||ne?.(M,re)}}async function $(){if(!v)return;const{transform:P,panBy:te,autoPanSpeed:z,autoPanOnNodeDrag:k}=l();if(!k){m=!1,cancelAnimationFrame(d);return}const[A,j]=E0(h,v,z);(A!==0||j!==0)&&(c.x=(c.x??0)-A/P[2],c.y=(c.y??0)-j/P[2],await te({x:A,y:j})&&H(c)),d=requestAnimationFrame($)}function V(P){const{nodeLookup:te,multiSelectionActive:z,nodesDraggable:k,transform:A,snapGrid:j,snapToGrid:I,selectNodesOnDrag:Q,onNodeDragStart:ne,onSelectionDragStart:C,unselectNodesAndEdges:B}=l();y=!0,(!Q||!G)&&!z&&R&&(te.get(R)?.selected||B()),G&&Q&&R&&n?.(R);const ee=go(P.sourceEvent,{transform:A,snapGrid:j,snapToGrid:I,containerBounds:v});if(c=ee,g=tN(te,k,ee,R),g.size>0&&(o||ne||!R&&C)){const[ae,ue]=wf({nodeId:R,dragItems:g,nodeLookup:te});o?.(P.sourceEvent,g,ae,ue),ne?.(P.sourceEvent,ae,ue),R||C?.(P.sourceEvent,ue)}}const Y=e0().clickDistance(L).on("start",P=>{const{domNode:te,nodeDragThreshold:z,transform:k,snapGrid:A,snapToGrid:j}=l();v=te?.getBoundingClientRect()||null,x=!1,_=!1,M=P.sourceEvent,z===0&&V(P),c=go(P.sourceEvent,{transform:k,snapGrid:A,snapToGrid:j,containerBounds:v}),h=an(P.sourceEvent,v)}).on("drag",P=>{const{autoPanOnNodeDrag:te,transform:z,snapGrid:k,snapToGrid:A,nodeDragThreshold:j,nodeLookup:I}=l(),Q=go(P.sourceEvent,{transform:z,snapGrid:k,snapToGrid:A,containerBounds:v});if(M=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||R&&!I.has(R))&&(x=!0),!x){if(!m&&te&&y&&(m=!0,$()),!y){const ne=an(P.sourceEvent,v),C=ne.x-h.x,B=ne.y-h.y;Math.sqrt(C*C+B*B)>j&&V(P)}(c.x!==Q.xSnapped||c.y!==Q.ySnapped)&&g&&y&&(h=an(P.sourceEvent,v),H(Q))}}).on("end",P=>{if(!(!y||x)&&(m=!1,y=!1,cancelAnimationFrame(d),g.size>0)){const{nodeLookup:te,updateNodePositions:z,onNodeDragStop:k,onSelectionDragStop:A}=l();if(_&&(z(g,!1),_=!1),r||k||!R&&A){const[j,I]=wf({nodeId:R,dragItems:g,nodeLookup:te,dragging:!1});r?.(P.sourceEvent,g,j,I),k?.(P.sourceEvent,j,I),R||A?.(P.sourceEvent,I)}}}).filter(P=>{const te=P.target;return!P.button&&(!U||!Pp(te,`.${U}`,D))&&(!w||Pp(te,w,D))});p.call(Y)}function T(){p?.on(".drag",null)}return{update:N,destroy:T}}function lN(n,l,o){const s=[],r={x:n.x-o,y:n.y-o,width:o*2,height:o*2};for(const c of l.values())xo(r,ii(c))>0&&s.push(c);return s}const iN=250;function oN(n,l,o,s){let r=[],c=1/0;const d=lN(n,o,l+iN);for(const g of d){const m=[...g.internals.handleBounds?.source??[],...g.internals.handleBounds?.target??[]];for(const h of m){if(s.nodeId===h.nodeId&&s.type===h.type&&s.id===h.id)continue;const{x:v,y}=ll(g,h,h.position,!0),p=Math.sqrt(Math.pow(v-n.x,2)+Math.pow(y-n.y,2));p>l||(p<c?(r=[{...h,x:v,y}],c=p):p===c&&r.push({...h,x:v,y}))}}if(!r.length)return null;if(r.length>1){const g=s.type==="source"?"target":"source";return r.find(m=>m.type===g)??r[0]}return r[0]}function B0(n,l,o,s,r,c=!1){const d=s.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&&c?{...m,...ll(d,m,m.position,!0)}:m}function q0(n,l){return n||(l?.classList.contains("target")?"target":l?.classList.contains("source")?"source":null)}function sN(n,l){let o=null;return l?o=!0:n&&!l&&(o=!1),o}const I0=()=>!0;function rN(n,{connectionMode:l,connectionRadius:o,handleId:s,nodeId:r,edgeUpdaterType:c,isTarget:d,domNode:g,nodeLookup:m,lib:h,autoPanOnConnect:v,flowId:y,panBy:p,cancelConnection:x,onConnectStart:_,onConnect:M,onConnectEnd:N,isValidConnection:T=I0,onReconnectEnd:U,updateConnection:w,getTransform:D,getFromHandle:G,autoPanSpeed:R,dragThreshold:L=1,handleDomNode:H}){const $=T0(n.target);let V=0,Y;const{x:P,y:te}=an(n),z=q0(c,H),k=g?.getBoundingClientRect();let A=!1;if(!k||!z)return;const j=B0(r,z,s,m,l);if(!j)return;let I=an(n,k),Q=!1,ne=null,C=!1,B=null;function ee(){if(!v||!k)return;const[xe,ye]=E0(I,k,R);p({x:xe,y:ye}),V=requestAnimationFrame(ee)}const ae={...j,nodeId:r,type:z,position:j.position},ue=m.get(r);let ce={inProgress:!0,isValid:null,from:ll(ue,ae,me.Left,!0),fromHandle:ae,fromPosition:ae.position,fromNode:ue,to:I,toHandle:null,toPosition:Ip[ae.position],toNode:null,pointer:I};function re(){A=!0,w(ce),_?.(n,{nodeId:r,handleId:s,handleType:z})}L===0&&re();function de(xe){if(!A){const{x:rt,y:Qt}=an(xe),zt=rt-P,Kt=Qt-te;if(!(zt*zt+Kt*Kt>L*L))return;re()}if(!G()||!ae){Ee(xe);return}const ye=D();I=an(xe,k),Y=oN(zo(I,ye,!1,[1,1]),o,m,ae),Q||(ee(),Q=!0);const Se=G0(xe,{handle:Y,connectionMode:l,fromNodeId:r,fromHandleId:s,fromType:d?"target":"source",isValidConnection:T,doc:$,lib:h,flowId:y,nodeLookup:m});B=Se.handleDomNode,ne=Se.connection,C=sN(!!Y,Se.isValid);const Ce=m.get(r),qe=Ce?ll(Ce,ae,me.Left,!0):ce.from,Ue={...ce,from:qe,isValid:C,to:Se.toHandle&&C?Tr({x:Se.toHandle.x,y:Se.toHandle.y},ye):I,toHandle:Se.toHandle,toPosition:C&&Se.toHandle?Se.toHandle.position:Ip[ae.position],toNode:Se.toHandle?m.get(Se.toHandle.nodeId):null,pointer:I};w(Ue),ce=Ue}function Ee(xe){if(!("touches"in xe&&xe.touches.length>0)){if(A){(Y||B)&&ne&&C&&M?.(ne);const{inProgress:ye,...Se}=ce,Ce={...Se,toPosition:ce.toHandle?ce.toPosition:null};N?.(xe,Ce),c&&U?.(xe,Ce)}x(),cancelAnimationFrame(V),Q=!1,C=!1,ne=null,B=null,$.removeEventListener("mousemove",de),$.removeEventListener("mouseup",Ee),$.removeEventListener("touchmove",de),$.removeEventListener("touchend",Ee)}}$.addEventListener("mousemove",de),$.addEventListener("mouseup",Ee),$.addEventListener("touchmove",de),$.addEventListener("touchend",Ee)}function G0(n,{handle:l,connectionMode:o,fromNodeId:s,fromHandleId:r,fromType:c,doc:d,lib:g,flowId:m,isValidConnection:h=I0,nodeLookup:v}){const y=c==="target",p=l?d.querySelector(`.${g}-flow__handle[data-id="${m}-${l?.nodeId}-${l?.id}-${l?.type}"]`):null,{x,y:_}=an(n),M=d.elementFromPoint(x,_),N=M?.classList.contains(`${g}-flow__handle`)?M:p,T={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const U=q0(void 0,N),w=N.getAttribute("data-nodeid"),D=N.getAttribute("data-handleid"),G=N.classList.contains("connectable"),R=N.classList.contains("connectableend");if(!w||!U)return T;const L={source:y?w:s,sourceHandle:y?D:r,target:y?s:w,targetHandle:y?r:D};T.connection=L;const $=G&&R&&(o===ai.Strict?y&&U==="source"||!y&&U==="target":w!==s||D!==r);T.isValid=$&&h(L),T.toHandle=B0(w,U,D,v,o,!0)}return T}const Zf={onPointerDown:rN,isValid:G0};function uN({domNode:n,panZoom:l,getTransform:o,getViewScale:s}){const r=Bt(n);function c({translateExtent:g,width:m,height:h,zoomStep:v=1,pannable:y=!0,zoomable:p=!0,inversePan:x=!1}){const _=w=>{if(w.sourceEvent.type!=="wheel"||!l)return;const D=o(),G=w.sourceEvent.ctrlKey&&wo()?10:1,R=-w.sourceEvent.deltaY*(w.sourceEvent.deltaMode===1?.05:w.sourceEvent.deltaMode?1:.002)*v,L=D[2]*Math.pow(2,R*G);l.scaleTo(L)};let M=[0,0];const N=w=>{(w.sourceEvent.type==="mousedown"||w.sourceEvent.type==="touchstart")&&(M=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY])},T=w=>{const D=o();if(w.sourceEvent.type!=="mousemove"&&w.sourceEvent.type!=="touchmove"||!l)return;const G=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY],R=[G[0]-M[0],G[1]-M[1]];M=G;const L=s()*Math.max(D[2],Math.log(D[2]))*(x?-1:1),H={x:D[0]-R[0]*L,y:D[1]-R[1]*L},$=[[0,0],[m,h]];l.setViewportConstrained({x:H.x,y:H.y,zoom:D[2]},$,g)},U=m0().on("start",N).on("zoom",y?T:null).on("zoom.wheel",p?_:null);r.call(U,{})}function d(){r.on("zoom",null)}return{update:c,destroy:d,pointer:en}}const Ur=n=>({x:n.x,y:n.y,zoom:n.k}),Ef=({x:n,y:l,zoom:o})=>Or.translate(n,l).scale(o),Jl=(n,l)=>n.target.closest(`.${l}`),Y0=(n,l)=>l===2&&Array.isArray(n)&&n.includes(2),cN=n=>((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2,_f=(n,l=0,o=cN,s=()=>{})=>{const r=typeof l=="number"&&l>0;return r||s(),r?n.transition().duration(l).ease(o).on("end",s):n},k0=n=>{const l=n.ctrlKey&&wo()?10:1;return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*l};function fN({zoomPanValues:n,noWheelClassName:l,d3Selection:o,d3Zoom:s,panOnScrollMode:r,panOnScrollSpeed:c,zoomOnPinch:d,onPanZoomStart:g,onPanZoom:m,onPanZoomEnd:h}){return v=>{if(Jl(v,l))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const y=o.property("__zoom").k||1;if(v.ctrlKey&&d){const N=en(v),T=k0(v),U=y*Math.pow(2,T);s.scaleTo(o,U,N,v);return}const p=v.deltaMode===1?20:1;let x=r===el.Vertical?0:v.deltaX*p,_=r===el.Horizontal?0:v.deltaY*p;!wo()&&v.shiftKey&&r!==el.Vertical&&(x=v.deltaY*p,_=0),s.translateBy(o,-(x/y)*c,-(_/y)*c,{internal:!0});const M=Ur(o.property("__zoom"));clearTimeout(n.panScrollTimeout),n.isPanScrolling?(m?.(v,M),n.panScrollTimeout=setTimeout(()=>{h?.(v,M),n.isPanScrolling=!1},150)):(n.isPanScrolling=!0,g?.(v,M))}}function dN({noWheelClassName:n,preventScrolling:l,d3ZoomHandler:o}){return function(s,r){const c=s.type==="wheel",d=!l&&c&&!s.ctrlKey,g=Jl(s,n);if(s.ctrlKey&&c&&g&&s.preventDefault(),d||g)return null;s.preventDefault(),o.call(this,s,r)}}function hN({zoomPanValues:n,onDraggingChange:l,onPanZoomStart:o}){return s=>{if(s.sourceEvent?.internal)return;const r=Ur(s.transform);n.mouseButton=s.sourceEvent?.button||0,n.isZoomingOrPanning=!0,n.prevViewport=r,s.sourceEvent?.type==="mousedown"&&l(!0),o&&o?.(s.sourceEvent,r)}}function gN({zoomPanValues:n,panOnDrag:l,onPaneContextMenu:o,onTransformChange:s,onPanZoom:r}){return c=>{n.usedRightMouseButton=!!(o&&Y0(l,n.mouseButton??0)),c.sourceEvent?.sync||s([c.transform.x,c.transform.y,c.transform.k]),r&&!c.sourceEvent?.internal&&r?.(c.sourceEvent,Ur(c.transform))}}function mN({zoomPanValues:n,panOnDrag:l,panOnScroll:o,onDraggingChange:s,onPanZoomEnd:r,onPaneContextMenu:c}){return d=>{if(!d.sourceEvent?.internal&&(n.isZoomingOrPanning=!1,c&&Y0(l,n.mouseButton??0)&&!n.usedRightMouseButton&&d.sourceEvent&&c(d.sourceEvent),n.usedRightMouseButton=!1,s(!1),r)){const g=Ur(d.transform);n.prevViewport=g,clearTimeout(n.timerId),n.timerId=setTimeout(()=>{r?.(d.sourceEvent,g)},o?150:0)}}}function pN({zoomActivationKeyPressed:n,zoomOnScroll:l,zoomOnPinch:o,panOnDrag:s,panOnScroll:r,zoomOnDoubleClick:c,userSelectionActive:d,noWheelClassName:g,noPanClassName:m,lib:h,connectionInProgress:v}){return y=>{const p=n||l,x=o&&y.ctrlKey,_=y.type==="wheel";if(y.button===1&&y.type==="mousedown"&&(Jl(y,`${h}-flow__node`)||Jl(y,`${h}-flow__edge`)))return!0;if(!s&&!p&&!r&&!c&&!o||d||v&&!_||Jl(y,g)&&_||Jl(y,m)&&(!_||r&&_&&!n)||!o&&y.ctrlKey&&_)return!1;if(!o&&y.type==="touchstart"&&y.touches?.length>1)return y.preventDefault(),!1;if(!p&&!r&&!x&&_||!s&&(y.type==="mousedown"||y.type==="touchstart")||Array.isArray(s)&&!s.includes(y.button)&&y.type==="mousedown")return!1;const M=Array.isArray(s)&&s.includes(y.button)||!y.button||y.button<=1;return(!y.ctrlKey||_)&&M}}function yN({domNode:n,minZoom:l,maxZoom:o,translateExtent:s,viewport:r,onPanZoom:c,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=m0().scaleExtent([l,o]).translateExtent(s),p=Bt(n).call(y);U({x:r.x,y:r.y,zoom:li(r.zoom,l,o)},[[0,0],[v.width,v.height]],s);const x=p.on("wheel.zoom"),_=p.on("dblclick.zoom");y.wheelDelta(k0);function M(Y,P){return p?new Promise(te=>{y?.interpolate(P?.interpolate==="linear"?ho:hr).transform(_f(p,P?.duration,P?.ease,()=>te(!0)),Y)}):Promise.resolve(!1)}function N({noWheelClassName:Y,noPanClassName:P,onPaneContextMenu:te,userSelectionActive:z,panOnScroll:k,panOnDrag:A,panOnScrollMode:j,panOnScrollSpeed:I,preventScrolling:Q,zoomOnPinch:ne,zoomOnScroll:C,zoomOnDoubleClick:B,zoomActivationKeyPressed:ee,lib:ae,onTransformChange:ue,connectionInProgress:fe,paneClickDistance:ce,selectionOnDrag:re}){z&&!h.isZoomingOrPanning&&T();const de=k&&!ee&&!z;y.clickDistance(re?1/0:!nn(ce)||ce<0?0:ce);const Ee=de?fN({zoomPanValues:h,noWheelClassName:Y,d3Selection:p,d3Zoom:y,panOnScrollMode:j,panOnScrollSpeed:I,zoomOnPinch:ne,onPanZoomStart:d,onPanZoom:c,onPanZoomEnd:g}):dN({noWheelClassName:Y,preventScrolling:Q,d3ZoomHandler:x});if(p.on("wheel.zoom",Ee,{passive:!1}),!z){const ye=hN({zoomPanValues:h,onDraggingChange:m,onPanZoomStart:d});y.on("start",ye);const Se=gN({zoomPanValues:h,panOnDrag:A,onPaneContextMenu:!!te,onPanZoom:c,onTransformChange:ue});y.on("zoom",Se);const Ce=mN({zoomPanValues:h,panOnDrag:A,panOnScroll:k,onPaneContextMenu:te,onPanZoomEnd:g,onDraggingChange:m});y.on("end",Ce)}const xe=pN({zoomActivationKeyPressed:ee,panOnDrag:A,zoomOnScroll:C,panOnScroll:k,zoomOnDoubleClick:B,zoomOnPinch:ne,userSelectionActive:z,noPanClassName:P,noWheelClassName:Y,lib:ae,connectionInProgress:fe});y.filter(xe),B?p.on("dblclick.zoom",_):p.on("dblclick.zoom",null)}function T(){y.on("zoom",null)}async function U(Y,P,te){const z=Ef(Y),k=y?.constrain()(z,P,te);return k&&await M(k),new Promise(A=>A(k))}async function w(Y,P){const te=Ef(Y);return await M(te,P),new Promise(z=>z(te))}function D(Y){if(p){const P=Ef(Y),te=p.property("__zoom");(te.k!==Y.zoom||te.x!==Y.x||te.y!==Y.y)&&y?.transform(p,P,null,{sync:!0})}}function G(){const Y=p?g0(p.node()):{x:0,y:0,k:1};return{x:Y.x,y:Y.y,zoom:Y.k}}function R(Y,P){return p?new Promise(te=>{y?.interpolate(P?.interpolate==="linear"?ho:hr).scaleTo(_f(p,P?.duration,P?.ease,()=>te(!0)),Y)}):Promise.resolve(!1)}function L(Y,P){return p?new Promise(te=>{y?.interpolate(P?.interpolate==="linear"?ho:hr).scaleBy(_f(p,P?.duration,P?.ease,()=>te(!0)),Y)}):Promise.resolve(!1)}function H(Y){y?.scaleExtent(Y)}function $(Y){y?.translateExtent(Y)}function V(Y){const P=!nn(Y)||Y<0?0:Y;y?.clickDistance(P)}return{update:N,destroy:T,setViewport:w,setViewportConstrained:U,getViewport:G,scaleTo:R,scaleBy:L,setScaleExtent:H,setTranslateExtent:$,syncViewport:D,setClickDistance:V}}var si;(function(n){n.Line="line",n.Handle="handle"})(si||(si={}));function vN({width:n,prevWidth:l,height:o,prevHeight:s,affectsX:r,affectsY:c}){const d=n-l,g=o-s,m=[d>0?1:d<0?-1:0,g>0?1:g<0?-1:0];return d&&r&&(m[0]=m[0]*-1),g&&c&&(m[1]=m[1]*-1),m}function Wp(n){const l=n.includes("right")||n.includes("left"),o=n.includes("bottom")||n.includes("top"),s=n.includes("left"),r=n.includes("top");return{isHorizontal:l,isVertical:o,affectsX:s,affectsY:r}}function xa(n,l){return Math.max(0,l-n)}function wa(n,l){return Math.max(0,n-l)}function rr(n,l,o){return Math.max(0,l-n,n-o)}function ey(n,l){return n?!l:l}function SN(n,l,o,s,r,c,d,g){let{affectsX:m,affectsY:h}=l;const{isHorizontal:v,isVertical:y}=l,p=v&&y,{xSnapped:x,ySnapped:_}=o,{minWidth:M,maxWidth:N,minHeight:T,maxHeight:U}=s,{x:w,y:D,width:G,height:R,aspectRatio:L}=n;let H=Math.floor(v?x-n.pointerX:0),$=Math.floor(y?_-n.pointerY:0);const V=G+(m?-H:H),Y=R+(h?-$:$),P=-c[0]*G,te=-c[1]*R;let z=rr(V,M,N),k=rr(Y,T,U);if(d){let I=0,Q=0;m&&H<0?I=xa(w+H+P,d[0][0]):!m&&H>0&&(I=wa(w+V+P,d[1][0])),h&&$<0?Q=xa(D+$+te,d[0][1]):!h&&$>0&&(Q=wa(D+Y+te,d[1][1])),z=Math.max(z,I),k=Math.max(k,Q)}if(g){let I=0,Q=0;m&&H>0?I=wa(w+H,g[0][0]):!m&&H<0&&(I=xa(w+V,g[1][0])),h&&$>0?Q=wa(D+$,g[0][1]):!h&&$<0&&(Q=xa(D+Y,g[1][1])),z=Math.max(z,I),k=Math.max(k,Q)}if(r){if(v){const I=rr(V/L,T,U)*L;if(z=Math.max(z,I),d){let Q=0;!m&&!h||m&&!h&&p?Q=wa(D+te+V/L,d[1][1])*L:Q=xa(D+te+(m?H:-H)/L,d[0][1])*L,z=Math.max(z,Q)}if(g){let Q=0;!m&&!h||m&&!h&&p?Q=xa(D+V/L,g[1][1])*L:Q=wa(D+(m?H:-H)/L,g[0][1])*L,z=Math.max(z,Q)}}if(y){const I=rr(Y*L,M,N)/L;if(k=Math.max(k,I),d){let Q=0;!m&&!h||h&&!m&&p?Q=wa(w+Y*L+P,d[1][0])/L:Q=xa(w+(h?$:-$)*L+P,d[0][0])/L,k=Math.max(k,Q)}if(g){let Q=0;!m&&!h||h&&!m&&p?Q=xa(w+Y*L,g[1][0])/L:Q=wa(w+(h?$:-$)*L,g[0][0])/L,k=Math.max(k,Q)}}}$=$+($<0?k:-k),H=H+(H<0?z:-z),r&&(p?V>Y*L?$=(ey(m,h)?-H:H)/L:H=(ey(m,h)?-$:$)*L:v?($=H/L,h=m):(H=$*L,m=h));const A=m?w+H:w,j=h?D+$:D;return{width:G+(m?-H:H),height:R+(h?-$:$),x:c[0]*H*(m?-1:1)+A,y:c[1]*$*(h?-1:1)+j}}const V0={width:0,height:0,x:0,y:0},bN={...V0,pointerX:0,pointerY:0,aspectRatio:1};function xN(n){return[[0,0],[n.measured.width,n.measured.height]]}function wN(n,l,o){const s=l.position.x+n.position.x,r=l.position.y+n.position.y,c=n.measured.width??0,d=n.measured.height??0,g=o[0]*c,m=o[1]*d;return[[s-g,r-m],[s+c-g,r+d-m]]}function EN({domNode:n,nodeId:l,getStoreItems:o,onChange:s,onEnd:r}){const c=Bt(n);let d={controlDirection:Wp("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:p,onResizeStart:x,onResize:_,onResizeEnd:M,shouldResize:N}){let T={...V0},U={...bN};d={boundaries:v,resizeDirection:p,keepAspectRatio:y,controlDirection:Wp(h)};let w,D=null,G=[],R,L,H,$=!1;const V=e0().on("start",Y=>{const{nodeLookup:P,transform:te,snapGrid:z,snapToGrid:k,nodeOrigin:A,paneDomNode:j}=o();if(w=P.get(l),!w)return;D=j?.getBoundingClientRect()??null;const{xSnapped:I,ySnapped:Q}=go(Y.sourceEvent,{transform:te,snapGrid:z,snapToGrid:k,containerBounds:D});T={width:w.measured.width??0,height:w.measured.height??0,x:w.position.x??0,y:w.position.y??0},U={...T,pointerX:I,pointerY:Q,aspectRatio:T.width/T.height},R=void 0,w.parentId&&(w.extent==="parent"||w.expandParent)&&(R=P.get(w.parentId),L=R&&w.extent==="parent"?xN(R):void 0),G=[],H=void 0;for(const[ne,C]of P)if(C.parentId===l&&(G.push({id:ne,position:{...C.position},extent:C.extent}),C.extent==="parent"||C.expandParent)){const B=wN(C,w,C.origin??A);H?H=[[Math.min(B[0][0],H[0][0]),Math.min(B[0][1],H[0][1])],[Math.max(B[1][0],H[1][0]),Math.max(B[1][1],H[1][1])]]:H=B}x?.(Y,{...T})}).on("drag",Y=>{const{transform:P,snapGrid:te,snapToGrid:z,nodeOrigin:k}=o(),A=go(Y.sourceEvent,{transform:P,snapGrid:te,snapToGrid:z,containerBounds:D}),j=[];if(!w)return;const{x:I,y:Q,width:ne,height:C}=T,B={},ee=w.origin??k,{width:ae,height:ue,x:fe,y:ce}=SN(U,d.controlDirection,A,d.boundaries,d.keepAspectRatio,ee,L,H),re=ae!==ne,de=ue!==C,Ee=fe!==I&&re,xe=ce!==Q&&de;if(!Ee&&!xe&&!re&&!de)return;if((Ee||xe||ee[0]===1||ee[1]===1)&&(B.x=Ee?fe:T.x,B.y=xe?ce:T.y,T.x=B.x,T.y=B.y,G.length>0)){const qe=fe-I,Ue=ce-Q;for(const rt of G)rt.position={x:rt.position.x-qe+ee[0]*(ae-ne),y:rt.position.y-Ue+ee[1]*(ue-C)},j.push(rt)}if((re||de)&&(B.width=re&&(!d.resizeDirection||d.resizeDirection==="horizontal")?ae:T.width,B.height=de&&(!d.resizeDirection||d.resizeDirection==="vertical")?ue:T.height,T.width=B.width,T.height=B.height),R&&w.expandParent){const qe=ee[0]*(B.width??0);B.x&&B.x<qe&&(T.x=qe,U.x=U.x-(B.x-qe));const Ue=ee[1]*(B.height??0);B.y&&B.y<Ue&&(T.y=Ue,U.y=U.y-(B.y-Ue))}const ye=vN({width:T.width,prevWidth:ne,height:T.height,prevHeight:C,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),Se={...T,direction:ye};N?.(Y,Se)!==!1&&($=!0,_?.(Y,Se),s(B,j))}).on("end",Y=>{$&&(M?.(Y,{...T}),r?.({...T}),$=!1)});c.call(V)}function m(){c.on(".drag",null)}return{update:g,destroy:m}}var Nf={exports:{}},Af={},Tf={exports:{}},Cf={};var ty;function _N(){if(ty)return Cf;ty=1;var n=_o();function l(y,p){return y===p&&(y!==0||1/y===1/p)||y!==y&&p!==p}var o=typeof Object.is=="function"?Object.is:l,s=n.useState,r=n.useEffect,c=n.useLayoutEffect,d=n.useDebugValue;function g(y,p){var x=p(),_=s({inst:{value:x,getSnapshot:p}}),M=_[0].inst,N=_[1];return c(function(){M.value=x,M.getSnapshot=p,m(M)&&N({inst:M})},[y,x,p]),r(function(){return m(M)&&N({inst:M}),y(function(){m(M)&&N({inst:M})})},[y]),d(x),x}function m(y){var p=y.getSnapshot;y=y.value;try{var x=p();return!o(y,x)}catch{return!0}}function h(y,p){return p()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:g;return Cf.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:v,Cf}var ny;function NN(){return ny||(ny=1,Tf.exports=_N()),Tf.exports}var ay;function AN(){if(ay)return Af;ay=1;var n=_o(),l=NN();function o(h,v){return h===v&&(h!==0||1/h===1/v)||h!==h&&v!==v}var s=typeof Object.is=="function"?Object.is:o,r=l.useSyncExternalStore,c=n.useRef,d=n.useEffect,g=n.useMemo,m=n.useDebugValue;return Af.useSyncExternalStoreWithSelector=function(h,v,y,p,x){var _=c(null);if(_.current===null){var M={hasValue:!1,value:null};_.current=M}else M=_.current;_=g(function(){function T(R){if(!U){if(U=!0,w=R,R=p(R),x!==void 0&&M.hasValue){var L=M.value;if(x(L,R))return D=L}return D=R}if(L=D,s(w,R))return L;var H=p(R);return x!==void 0&&x(L,H)?(w=R,L):(w=R,D=H)}var U=!1,w,D,G=y===void 0?null:y;return[function(){return T(v())},G===null?void 0:function(){return T(G())}]},[v,y,p,x]);var N=r(h,_[0],_[1]);return d(function(){M.hasValue=!0,M.value=N},[N]),m(N),N},Af}var ly;function TN(){return ly||(ly=1,Nf.exports=AN()),Nf.exports}var CN=TN();const MN=My(CN),zN={},iy=n=>{let l;const o=new Set,s=(v,y)=>{const p=typeof v=="function"?v(l):v;if(!Object.is(p,l)){const x=l;l=y??(typeof p!="object"||p===null)?p:Object.assign({},l,p),o.forEach(_=>_(l,x))}},r=()=>l,m={setState:s,getState:r,getInitialState:()=>h,subscribe:v=>(o.add(v),()=>o.delete(v)),destroy:()=>{(zN?"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(s,r,m);return m},DN=n=>n?iy(n):iy,{useDebugValue:RN}=so,{useSyncExternalStoreWithSelector:ON}=MN,jN=n=>n;function X0(n,l=jN,o){const s=ON(n.subscribe,n.getState,n.getServerState||n.getInitialState,l,o);return RN(s),s}const oy=(n,l)=>{const o=DN(n),s=(r,c=l)=>X0(o,r,c);return Object.assign(s,o),s},HN=(n,l)=>n?oy(n,l):oy;function $e(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[s,r]of n)if(!Object.is(r,l.get(s)))return!1;return!0}if(n instanceof Set&&l instanceof Set){if(n.size!==l.size)return!1;for(const s of n)if(!l.has(s))return!1;return!0}const o=Object.keys(n);if(o.length!==Object.keys(l).length)return!1;for(const s of o)if(!Object.prototype.hasOwnProperty.call(l,s)||!Object.is(n[s],l[s]))return!1;return!0}zy();const Lr=Z.createContext(null),UN=Lr.Provider,Z0=mn.error001();function Re(n,l){const o=Z.useContext(Lr);if(o===null)throw new Error(Z0);return X0(o,n,l)}function Ke(){const n=Z.useContext(Lr);if(n===null)throw new Error(Z0);return Z.useMemo(()=>({getState:n.getState,setState:n.setState,subscribe:n.subscribe}),[n])}const sy={display:"none"},LN={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},$0="react-flow__node-desc",Q0="react-flow__edge-desc",BN="react-flow__aria-live",qN=n=>n.ariaLiveMessage,IN=n=>n.ariaLabelConfig;function GN({rfId:n}){const l=Re(qN);return b.jsx("div",{id:`${BN}-${n}`,"aria-live":"assertive","aria-atomic":"true",style:LN,children:l})}function YN({rfId:n,disableKeyboardA11y:l}){const o=Re(IN);return b.jsxs(b.Fragment,{children:[b.jsx("div",{id:`${$0}-${n}`,style:sy,children:l?o["node.a11yDescription.default"]:o["node.a11yDescription.keyboardDisabled"]}),b.jsx("div",{id:`${Q0}-${n}`,style:sy,children:o["edge.a11yDescription.default"]}),!l&&b.jsx(GN,{rfId:n})]})}const Br=Z.forwardRef(({position:n="top-left",children:l,className:o,style:s,...r},c)=>{const d=`${n}`.split("-");return b.jsx("div",{className:it(["react-flow__panel",o,...d]),style:s,ref:c,...r,children:l})});Br.displayName="Panel";function kN({proOptions:n,position:l="bottom-right"}){return n?.hideAttribution?null:b.jsx(Br,{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:b.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const VN=n=>{const l=[],o=[];for(const[,s]of n.nodeLookup)s.selected&&l.push(s.internals.userNode);for(const[,s]of n.edgeLookup)s.selected&&o.push(s);return{selectedNodes:l,selectedEdges:o}},ur=n=>n.id;function XN(n,l){return $e(n.selectedNodes.map(ur),l.selectedNodes.map(ur))&&$e(n.selectedEdges.map(ur),l.selectedEdges.map(ur))}function ZN({onSelectionChange:n}){const l=Ke(),{selectedNodes:o,selectedEdges:s}=Re(VN,XN);return Z.useEffect(()=>{const r={nodes:o,edges:s};n?.(r),l.getState().onSelectionChangeHandlers.forEach(c=>c(r))},[o,s,n]),null}const $N=n=>!!n.onSelectionChangeHandlers;function QN({onSelectionChange:n}){const l=Re($N);return n||l?b.jsx(ZN,{onSelectionChange:n}):null}const $f=typeof window<"u"?Z.useLayoutEffect:Z.useEffect,K0=[0,0],KN={x:0,y:0,zoom:1},FN=["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"],ry=[...FN,"rfId"],JN=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}),uy={translateExtent:So,nodeOrigin:K0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function PN(n){const{setNodes:l,setEdges:o,setMinZoom:s,setMaxZoom:r,setTranslateExtent:c,setNodeExtent:d,reset:g,setDefaultNodesAndEdges:m}=Re(JN,$e),h=Ke();$f(()=>(m(n.defaultNodes,n.defaultEdges),()=>{v.current=uy,g()}),[]);const v=Z.useRef(uy);return $f(()=>{for(const y of ry){const p=n[y],x=v.current[y];p!==x&&(typeof n[y]>"u"||(y==="nodes"?l(p):y==="edges"?o(p):y==="minZoom"?s(p):y==="maxZoom"?r(p):y==="translateExtent"?c(p):y==="nodeExtent"?d(p):y==="ariaLabelConfig"?h.setState({ariaLabelConfig:H_(p)}):y==="fitView"?h.setState({fitViewQueued:p}):y==="fitViewOptions"?h.setState({fitViewOptions:p}):h.setState({[y]:p})))}v.current=n},ry.map(y=>n[y])),null}function cy(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function WN(n){const[l,o]=Z.useState(n==="system"?null:n);return Z.useEffect(()=>{if(n!=="system"){o(n);return}const s=cy(),r=()=>o(s?.matches?"dark":"light");return r(),s?.addEventListener("change",r),()=>{s?.removeEventListener("change",r)}},[n]),l!==null?l:cy()?.matches?"dark":"light"}const fy=typeof document<"u"?document:null;function Eo(n=null,l={target:fy,actInsideInputWithModifier:!0}){const[o,s]=Z.useState(!1),r=Z.useRef(!1),c=Z.useRef(new Set([])),[d,g]=Z.useMemo(()=>{if(n!==null){const h=(Array.isArray(n)?n:[n]).filter(y=>typeof y=="string").map(y=>y.replace("+",`
|
|
16
|
+
`).replace(`
|
|
17
|
+
|
|
18
|
+
`,`
|
|
19
|
+
+`).split(`
|
|
20
|
+
`)),v=h.reduce((y,p)=>y.concat(...p),[]);return[h,v]}return[[],[]]},[n]);return Z.useEffect(()=>{const m=l?.target??fy,h=l?.actInsideInputWithModifier??!0;if(n!==null){const v=x=>{if(r.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!r.current||r.current&&!h)&&C0(x))return!1;const M=hy(x.code,g);if(c.current.add(x[M]),dy(d,c.current,!1)){const N=x.composedPath?.()?.[0]||x.target,T=N?.nodeName==="BUTTON"||N?.nodeName==="A";l.preventDefault!==!1&&(r.current||!T)&&x.preventDefault(),s(!0)}},y=x=>{const _=hy(x.code,g);dy(d,c.current,!0)?(s(!1),c.current.clear()):c.current.delete(x[_]),x.key==="Meta"&&c.current.clear(),r.current=!1},p=()=>{c.current.clear(),s(!1)};return m?.addEventListener("keydown",v),m?.addEventListener("keyup",y),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{m?.removeEventListener("keydown",v),m?.removeEventListener("keyup",y),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[n,s]),o}function dy(n,l,o){return n.filter(s=>o||s.length===l.size).some(s=>s.every(r=>l.has(r)))}function hy(n,l){return l.includes(n)?"code":"key"}const eA=()=>{const n=Ke();return Z.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:s}=n.getState();return s?s.scaleTo(l,o):Promise.resolve(!1)},getZoom:()=>n.getState().transform[2],setViewport:async(l,o)=>{const{transform:[s,r,c],panZoom:d}=n.getState();return d?(await d.setViewport({x:l.x??s,y:l.y??r,zoom:l.zoom??c},o),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[l,o,s]=n.getState().transform;return{x:l,y:o,zoom:s}},setCenter:async(l,o,s)=>n.getState().setCenter(l,o,s),fitBounds:async(l,o)=>{const{width:s,height:r,minZoom:c,maxZoom:d,panZoom:g}=n.getState(),m=ld(l,s,r,c,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:s,snapGrid:r,snapToGrid:c,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??c;return zo(h,s,y,v)},flowToScreenPosition:l=>{const{transform:o,domNode:s}=n.getState();if(!s)return l;const{x:r,y:c}=s.getBoundingClientRect(),d=Tr(l,o);return{x:d.x+r,y:d.y+c}}}),[])};function F0(n,l){const o=[],s=new Map,r=[];for(const c of n)if(c.type==="add"){r.push(c);continue}else if(c.type==="remove"||c.type==="replace")s.set(c.id,[c]);else{const d=s.get(c.id);d?d.push(c):s.set(c.id,[c])}for(const c of l){const d=s.get(c.id);if(!d){o.push(c);continue}if(d[0].type==="remove")continue;if(d[0].type==="replace"){o.push({...d[0].item});continue}const g={...c};for(const m of d)tA(m,g);o.push(g)}return r.length&&r.forEach(c=>{c.index!==void 0?o.splice(c.index,0,{...c.item}):o.push({...c.item})}),o}function tA(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 J0(n,l){return F0(n,l)}function P0(n,l){return F0(n,l)}function Ja(n,l){return{id:n,type:"select",selected:l}}function Pl(n,l=new Set,o=!1){const s=[];for(const[r,c]of n){const d=l.has(r);!(c.selected===void 0&&!d)&&c.selected!==d&&(o&&(c.selected=d),s.push(Ja(c.id,d)))}return s}function gy({items:n=[],lookup:l}){const o=[],s=new Map(n.map(r=>[r.id,r]));for(const[r,c]of n.entries()){const d=l.get(c.id),g=d?.internals?.userNode??d;g!==void 0&&g!==c&&o.push({id:c.id,item:c,type:"replace"}),g===void 0&&o.push({item:c,type:"add",index:r})}for(const[r]of l)s.get(r)===void 0&&o.push({id:r,type:"remove"});return o}function my(n){return{id:n.id,type:"remove"}}const py=n=>N_(n),nA=n=>b0(n);function W0(n){return Z.forwardRef(n)}function yy(n){const[l,o]=Z.useState(BigInt(0)),[s]=Z.useState(()=>aA(()=>o(r=>r+BigInt(1))));return $f(()=>{const r=s.get();r.length&&(n(r),s.reset())},[l]),s}function aA(n){let l=[];return{get:()=>l,reset:()=>{l=[]},push:o=>{l.push(o),n()}}}const ev=Z.createContext(null);function lA({children:n}){const l=Ke(),o=Z.useCallback(g=>{const{nodes:m=[],setNodes:h,hasDefaultNodes:v,onNodesChange:y,nodeLookup:p,fitViewQueued:x,onNodesChangeMiddlewareMap:_}=l.getState();let M=m;for(const T of g)M=typeof T=="function"?T(M):T;let N=gy({items:M,lookup:p});for(const T of _.values())N=T(N);v&&h(M),N.length>0?y?.(N):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:T,nodes:U,setNodes:w}=l.getState();T&&w(U)})},[]),s=yy(o),r=Z.useCallback(g=>{const{edges:m=[],setEdges:h,hasDefaultEdges:v,onEdgesChange:y,edgeLookup:p}=l.getState();let x=m;for(const _ of g)x=typeof _=="function"?_(x):_;v?h(x):y&&y(gy({items:x,lookup:p}))},[]),c=yy(r),d=Z.useMemo(()=>({nodeQueue:s,edgeQueue:c}),[]);return b.jsx(ev.Provider,{value:d,children:n})}function iA(){const n=Z.useContext(ev);if(!n)throw new Error("useBatchContext must be used within a BatchProvider");return n}const oA=n=>!!n.panZoom;function qr(){const n=eA(),l=Ke(),o=iA(),s=Re(oA),r=Z.useMemo(()=>{const c=y=>l.getState().nodeLookup.get(y),d=y=>{o.nodeQueue.push(y)},g=y=>{o.edgeQueue.push(y)},m=y=>{const{nodeLookup:p,nodeOrigin:x}=l.getState(),_=py(y)?y:p.get(y.id),M=_.parentId?A0(_.position,_.measured,_.parentId,p,x):_.position,N={..._,position:M,width:_.measured?.width??_.width,height:_.measured?.height??_.height};return ii(N)},h=(y,p,x={replace:!1})=>{d(_=>_.map(M=>{if(M.id===y){const N=typeof p=="function"?p(M):p;return x.replace&&py(N)?N:{...M,...N}}return M}))},v=(y,p,x={replace:!1})=>{g(_=>_.map(M=>{if(M.id===y){const N=typeof p=="function"?p(M):p;return x.replace&&nA(N)?N:{...M,...N}}return M}))};return{getNodes:()=>l.getState().nodes.map(y=>({...y})),getNode:y=>c(y)?.internals.userNode,getInternalNode:c,getEdges:()=>{const{edges:y=[]}=l.getState();return y.map(p=>({...p}))},getEdge:y=>l.getState().edgeLookup.get(y),setNodes:d,setEdges:g,addNodes:y=>{const p=Array.isArray(y)?y:[y];o.nodeQueue.push(x=>[...x,...p])},addEdges:y=>{const p=Array.isArray(y)?y:[y];o.edgeQueue.push(x=>[...x,...p])},toObject:()=>{const{nodes:y=[],edges:p=[],transform:x}=l.getState(),[_,M,N]=x;return{nodes:y.map(T=>({...T})),edges:p.map(T=>({...T})),viewport:{x:_,y:M,zoom:N}}},deleteElements:async({nodes:y=[],edges:p=[]})=>{const{nodes:x,edges:_,onNodesDelete:M,onEdgesDelete:N,triggerNodeChanges:T,triggerEdgeChanges:U,onDelete:w,onBeforeDelete:D}=l.getState(),{nodes:G,edges:R}=await z_({nodesToRemove:y,edgesToRemove:p,nodes:x,edges:_,onBeforeDelete:D}),L=R.length>0,H=G.length>0;if(L){const $=R.map(my);N?.(R),U($)}if(H){const $=G.map(my);M?.(G),T($)}return(H||L)&&w?.({nodes:G,edges:R}),{deletedNodes:G,deletedEdges:R}},getIntersectingNodes:(y,p=!0,x)=>{const _=Yp(y),M=_?y:m(y),N=x!==void 0;return M?(x||l.getState().nodes).filter(T=>{const U=l.getState().nodeLookup.get(T.id);if(U&&!_&&(T.id===y.id||!U.internals.positionAbsolute))return!1;const w=ii(N?T:U),D=xo(w,M);return p&&D>0||D>=w.width*w.height||D>=M.width*M.height}):[]},isNodeIntersecting:(y,p,x=!0)=>{const M=Yp(y)?y:m(y);if(!M)return!1;const N=xo(M,p);return x&&N>0||N>=p.width*p.height||N>=M.width*M.height},updateNode:h,updateNodeData:(y,p,x={replace:!1})=>{h(y,_=>{const M=typeof p=="function"?p(_):p;return x.replace?{..._,data:M}:{..._,data:{..._.data,...M}}},x)},updateEdge:v,updateEdgeData:(y,p,x={replace:!1})=>{v(y,_=>{const M=typeof p=="function"?p(_):p;return x.replace?{..._,data:M}:{..._,data:{..._.data,...M}}},x)},getNodesBounds:y=>{const{nodeLookup:p,nodeOrigin:x}=l.getState();return A_(y,{nodeLookup:p,nodeOrigin:x})},getHandleConnections:({type:y,id:p,nodeId:x})=>Array.from(l.getState().connectionLookup.get(`${x}-${y}${p?`-${p}`:""}`)?.values()??[]),getNodeConnections:({type:y,handleId:p,nodeId:x})=>Array.from(l.getState().connectionLookup.get(`${x}${y?p?`-${y}-${p}`:`-${y}`:""}`)?.values()??[]),fitView:async y=>{const p=l.getState().fitViewResolver??j_();return l.setState({fitViewQueued:!0,fitViewOptions:y,fitViewResolver:p}),o.nodeQueue.push(x=>[...x]),p.promise}}},[]);return Z.useMemo(()=>({...r,...n,viewportInitialized:s}),[s])}const vy=n=>n.selected,sA=typeof window<"u"?window:void 0;function rA({deleteKeyCode:n,multiSelectionKeyCode:l}){const o=Ke(),{deleteElements:s}=qr(),r=Eo(n,{actInsideInputWithModifier:!1}),c=Eo(l,{target:sA});Z.useEffect(()=>{if(r){const{edges:d,nodes:g}=o.getState();s({nodes:g.filter(vy),edges:d.filter(vy)}),o.setState({nodesSelectionActive:!1})}},[r]),Z.useEffect(()=>{o.setState({multiSelectionActive:c})},[c])}function uA(n){const l=Ke();Z.useEffect(()=>{const o=()=>{if(!n.current||!(n.current.checkVisibility?.()??!0))return!1;const s=id(n.current);(s.height===0||s.width===0)&&l.getState().onError?.("004",mn.error004()),l.setState({width:s.width||500,height:s.height||500})};if(n.current){o(),window.addEventListener("resize",o);const s=new ResizeObserver(()=>o());return s.observe(n.current),()=>{window.removeEventListener("resize",o),s&&n.current&&s.unobserve(n.current)}}},[])}const Ir={position:"absolute",width:"100%",height:"100%",top:0,left:0},cA=n=>({userSelectionActive:n.userSelectionActive,lib:n.lib,connectionInProgress:n.connection.inProgress});function fA({onPaneContextMenu:n,zoomOnScroll:l=!0,zoomOnPinch:o=!0,panOnScroll:s=!1,panOnScrollSpeed:r=.5,panOnScrollMode:c=el.Free,zoomOnDoubleClick:d=!0,panOnDrag:g=!0,defaultViewport:m,translateExtent:h,minZoom:v,maxZoom:y,zoomActivationKeyCode:p,preventScrolling:x=!0,children:_,noWheelClassName:M,noPanClassName:N,onViewportChange:T,isControlledViewport:U,paneClickDistance:w,selectionOnDrag:D}){const G=Ke(),R=Z.useRef(null),{userSelectionActive:L,lib:H,connectionInProgress:$}=Re(cA,$e),V=Eo(p),Y=Z.useRef();uA(R);const P=Z.useCallback(te=>{T?.({x:te[0],y:te[1],zoom:te[2]}),U||G.setState({transform:te})},[T,U]);return Z.useEffect(()=>{if(R.current){Y.current=yN({domNode:R.current,minZoom:v,maxZoom:y,translateExtent:h,viewport:m,onDraggingChange:A=>G.setState(j=>j.paneDragging===A?j:{paneDragging:A}),onPanZoomStart:(A,j)=>{const{onViewportChangeStart:I,onMoveStart:Q}=G.getState();Q?.(A,j),I?.(j)},onPanZoom:(A,j)=>{const{onViewportChange:I,onMove:Q}=G.getState();Q?.(A,j),I?.(j)},onPanZoomEnd:(A,j)=>{const{onViewportChangeEnd:I,onMoveEnd:Q}=G.getState();Q?.(A,j),I?.(j)}});const{x:te,y:z,zoom:k}=Y.current.getViewport();return G.setState({panZoom:Y.current,transform:[te,z,k],domNode:R.current.closest(".react-flow")}),()=>{Y.current?.destroy()}}},[]),Z.useEffect(()=>{Y.current?.update({onPaneContextMenu:n,zoomOnScroll:l,zoomOnPinch:o,panOnScroll:s,panOnScrollSpeed:r,panOnScrollMode:c,zoomOnDoubleClick:d,panOnDrag:g,zoomActivationKeyPressed:V,preventScrolling:x,noPanClassName:N,userSelectionActive:L,noWheelClassName:M,lib:H,onTransformChange:P,connectionInProgress:$,selectionOnDrag:D,paneClickDistance:w})},[n,l,o,s,r,c,d,g,V,x,N,L,M,H,P,$,D,w]),b.jsx("div",{className:"react-flow__renderer",ref:R,style:Ir,children:_})}const dA=n=>({userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect});function hA(){const{userSelectionActive:n,userSelectionRect:l}=Re(dA,$e);return n&&l?b.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 Mf=(n,l)=>o=>{o.target===l.current&&n?.(o)},gA=n=>({userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,connectionInProgress:n.connection.inProgress,dragging:n.paneDragging});function mA({isSelecting:n,selectionKeyPressed:l,selectionMode:o=bo.Full,panOnDrag:s,paneClickDistance:r,selectionOnDrag:c,onSelectionStart:d,onSelectionEnd:g,onPaneClick:m,onPaneContextMenu:h,onPaneScroll:v,onPaneMouseEnter:y,onPaneMouseMove:p,onPaneMouseLeave:x,children:_}){const M=Ke(),{userSelectionActive:N,elementsSelectable:T,dragging:U,connectionInProgress:w}=Re(gA,$e),D=T&&(n||N),G=Z.useRef(null),R=Z.useRef(),L=Z.useRef(new Set),H=Z.useRef(new Set),$=Z.useRef(!1),V=I=>{if($.current||w){$.current=!1;return}m?.(I),M.getState().resetSelectedElements(),M.setState({nodesSelectionActive:!1})},Y=I=>{if(Array.isArray(s)&&s?.includes(2)){I.preventDefault();return}h?.(I)},P=v?I=>v(I):void 0,te=I=>{$.current&&(I.stopPropagation(),$.current=!1)},z=I=>{const{domNode:Q}=M.getState();if(R.current=Q?.getBoundingClientRect(),!R.current)return;const ne=I.target===G.current;if(!ne&&!!I.target.closest(".nokey")||!n||!(c&&ne||l)||I.button!==0||!I.isPrimary)return;I.target?.setPointerCapture?.(I.pointerId),$.current=!1;const{x:ee,y:ae}=an(I.nativeEvent,R.current);M.setState({userSelectionRect:{width:0,height:0,startX:ee,startY:ae,x:ee,y:ae}}),ne||(I.stopPropagation(),I.preventDefault())},k=I=>{const{userSelectionRect:Q,transform:ne,nodeLookup:C,edgeLookup:B,connectionLookup:ee,triggerNodeChanges:ae,triggerEdgeChanges:ue,defaultEdgeOptions:fe,resetSelectedElements:ce}=M.getState();if(!R.current||!Q)return;const{x:re,y:de}=an(I.nativeEvent,R.current),{startX:Ee,startY:xe}=Q;if(!$.current){const Ue=l?0:r;if(Math.hypot(re-Ee,de-xe)<=Ue)return;ce(),d?.(I)}$.current=!0;const ye={startX:Ee,startY:xe,x:re<Ee?re:Ee,y:de<xe?de:xe,width:Math.abs(re-Ee),height:Math.abs(de-xe)},Se=L.current,Ce=H.current;L.current=new Set(ad(C,ye,ne,o===bo.Partial,!0).map(Ue=>Ue.id)),H.current=new Set;const qe=fe?.selectable??!0;for(const Ue of L.current){const rt=ee.get(Ue);if(rt)for(const{edgeId:Qt}of rt.values()){const zt=B.get(Qt);zt&&(zt.selectable??qe)&&H.current.add(Qt)}}if(!kp(Se,L.current)){const Ue=Pl(C,L.current,!0);ae(Ue)}if(!kp(Ce,H.current)){const Ue=Pl(B,H.current);ue(Ue)}M.setState({userSelectionRect:ye,userSelectionActive:!0,nodesSelectionActive:!1})},A=I=>{I.button===0&&(I.target?.releasePointerCapture?.(I.pointerId),!N&&I.target===G.current&&M.getState().userSelectionRect&&V?.(I),M.setState({userSelectionActive:!1,userSelectionRect:null}),$.current&&(g?.(I),M.setState({nodesSelectionActive:L.current.size>0})))},j=s===!0||Array.isArray(s)&&s.includes(0);return b.jsxs("div",{className:it(["react-flow__pane",{draggable:j,dragging:U,selection:n}]),onClick:D?void 0:Mf(V,G),onContextMenu:Mf(Y,G),onWheel:Mf(P,G),onPointerEnter:D?void 0:y,onPointerMove:D?k:p,onPointerUp:D?A:void 0,onPointerDownCapture:D?z:void 0,onClickCapture:D?te:void 0,onPointerLeave:x,ref:G,style:Ir,children:[_,b.jsx(hA,{})]})}function Qf({id:n,store:l,unselect:o=!1,nodeRef:s}){const{addSelectedNodes:r,unselectNodesAndEdges:c,multiSelectionActive:d,nodeLookup:g,onError:m}=l.getState(),h=g.get(n);if(!h){m?.("012",mn.error012(n));return}l.setState({nodesSelectionActive:!1}),h.selected?(o||h.selected&&d)&&(c({nodes:[h],edges:[]}),requestAnimationFrame(()=>s?.current?.blur())):r([n])}function tv({nodeRef:n,disabled:l=!1,noDragClassName:o,handleSelector:s,nodeId:r,isSelectable:c,nodeClickDistance:d}){const g=Ke(),[m,h]=Z.useState(!1),v=Z.useRef();return Z.useEffect(()=>{v.current=aN({getStoreItems:()=>g.getState(),onNodeMouseDown:y=>{Qf({id:y,store:g,nodeRef:n})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),Z.useEffect(()=>{if(!(l||!n.current||!v.current))return v.current.update({noDragClassName:o,handleSelector:s,domNode:n.current,isSelectable:c,nodeId:r,nodeClickDistance:d}),()=>{v.current?.destroy()}},[o,s,l,c,n,r,d]),m}const pA=n=>l=>l.selected&&(l.draggable||n&&typeof l.draggable>"u");function nv(){const n=Ke();return Z.useCallback(o=>{const{nodeExtent:s,snapToGrid:r,snapGrid:c,nodesDraggable:d,onError:g,updateNodePositions:m,nodeLookup:h,nodeOrigin:v}=n.getState(),y=new Map,p=pA(d),x=r?c[0]:5,_=r?c[1]:5,M=o.direction.x*x*o.factor,N=o.direction.y*_*o.factor;for(const[,T]of h){if(!p(T))continue;let U={x:T.internals.positionAbsolute.x+M,y:T.internals.positionAbsolute.y+N};r&&(U=Mo(U,c));const{position:w,positionAbsolute:D}=x0({nodeId:T.id,nextPosition:U,nodeLookup:h,nodeExtent:s,nodeOrigin:v,onError:g});T.position=w,T.internals.positionAbsolute=D,y.set(T.id,T)}m(y)},[])}const fd=Z.createContext(null),yA=fd.Provider;fd.Consumer;const av=()=>Z.useContext(fd),vA=n=>({connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}),SA=(n,l,o)=>s=>{const{connectionClickStartHandle:r,connectionMode:c,connection:d}=s,{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:c===ai.Strict?g?.type!==o:n!==g?.nodeId||l!==g?.id,connectionInProcess:!!g,clickConnectionInProcess:!!r,valid:v&&h}};function bA({type:n="source",position:l=me.Top,isValidConnection:o,isConnectable:s=!0,isConnectableStart:r=!0,isConnectableEnd:c=!0,id:d,onConnect:g,children:m,className:h,onMouseDown:v,onTouchStart:y,...p},x){const _=d||null,M=n==="target",N=Ke(),T=av(),{connectOnClick:U,noPanClassName:w,rfId:D}=Re(vA,$e),{connectingFrom:G,connectingTo:R,clickConnecting:L,isPossibleEndHandle:H,connectionInProcess:$,clickConnectionInProcess:V,valid:Y}=Re(SA(T,_,n),$e);T||N.getState().onError?.("010",mn.error010());const P=k=>{const{defaultEdgeOptions:A,onConnect:j,hasDefaultEdges:I}=N.getState(),Q={...A,...k};if(I){const{edges:ne,setEdges:C}=N.getState();C(G_(Q,ne))}j?.(Q),g?.(Q)},te=k=>{if(!T)return;const A=M0(k.nativeEvent);if(r&&(A&&k.button===0||!A)){const j=N.getState();Zf.onPointerDown(k.nativeEvent,{handleDomNode:k.currentTarget,autoPanOnConnect:j.autoPanOnConnect,connectionMode:j.connectionMode,connectionRadius:j.connectionRadius,domNode:j.domNode,nodeLookup:j.nodeLookup,lib:j.lib,isTarget:M,handleId:_,nodeId:T,flowId:j.rfId,panBy:j.panBy,cancelConnection:j.cancelConnection,onConnectStart:j.onConnectStart,onConnectEnd:(...I)=>N.getState().onConnectEnd?.(...I),updateConnection:j.updateConnection,onConnect:P,isValidConnection:o||((...I)=>N.getState().isValidConnection?.(...I)??!0),getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:j.autoPanSpeed,dragThreshold:j.connectionDragThreshold})}A?v?.(k):y?.(k)},z=k=>{const{onClickConnectStart:A,onClickConnectEnd:j,connectionClickStartHandle:I,connectionMode:Q,isValidConnection:ne,lib:C,rfId:B,nodeLookup:ee,connection:ae}=N.getState();if(!T||!I&&!r)return;if(!I){A?.(k.nativeEvent,{nodeId:T,handleId:_,handleType:n}),N.setState({connectionClickStartHandle:{nodeId:T,type:n,id:_}});return}const ue=T0(k.target),fe=o||ne,{connection:ce,isValid:re}=Zf.isValid(k.nativeEvent,{handle:{nodeId:T,id:_,type:n},connectionMode:Q,fromNodeId:I.nodeId,fromHandleId:I.id||null,fromType:I.type,isValidConnection:fe,flowId:B,doc:ue,lib:C,nodeLookup:ee});re&&ce&&P(ce);const de=structuredClone(ae);delete de.inProgress,de.toPosition=de.toHandle?de.toHandle.position:null,j?.(k,de),N.setState({connectionClickStartHandle:null})};return b.jsx("div",{"data-handleid":_,"data-nodeid":T,"data-handlepos":l,"data-id":`${D}-${T}-${_}-${n}`,className:it(["react-flow__handle",`react-flow__handle-${l}`,"nodrag",w,h,{source:!M,target:M,connectable:s,connectablestart:r,connectableend:c,clickconnecting:L,connectingfrom:G,connectingto:R,valid:Y,connectionindicator:s&&(!$||H)&&($||V?c:r)}]),onMouseDown:te,onTouchStart:te,onClick:U?z:void 0,ref:x,...p,children:m})}const ri=Z.memo(W0(bA));function xA({data:n,isConnectable:l,sourcePosition:o=me.Bottom}){return b.jsxs(b.Fragment,{children:[n?.label,b.jsx(ri,{type:"source",position:o,isConnectable:l})]})}function wA({data:n,isConnectable:l,targetPosition:o=me.Top,sourcePosition:s=me.Bottom}){return b.jsxs(b.Fragment,{children:[b.jsx(ri,{type:"target",position:o,isConnectable:l}),n?.label,b.jsx(ri,{type:"source",position:s,isConnectable:l})]})}function EA(){return null}function _A({data:n,isConnectable:l,targetPosition:o=me.Top}){return b.jsxs(b.Fragment,{children:[b.jsx(ri,{type:"target",position:o,isConnectable:l}),n?.label]})}const Cr={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Sy={input:xA,default:wA,output:_A,group:EA};function NA(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 AA=n=>{const{width:l,height:o,x:s,y:r}=Co(n.nodeLookup,{filter:c=>!!c.selected});return{width:nn(l)?l:null,height:nn(o)?o:null,userSelectionActive:n.userSelectionActive,transformString:`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]}) translate(${s}px,${r}px)`}};function TA({onSelectionContextMenu:n,noPanClassName:l,disableKeyboardA11y:o}){const s=Ke(),{width:r,height:c,transformString:d,userSelectionActive:g}=Re(AA,$e),m=nv(),h=Z.useRef(null);Z.useEffect(()=>{o||h.current?.focus({preventScroll:!0})},[o]);const v=!g&&r!==null&&c!==null;if(tv({nodeRef:h,disabled:!v}),!v)return null;const y=n?x=>{const _=s.getState().nodes.filter(M=>M.selected);n(x,_)}:void 0,p=x=>{Object.prototype.hasOwnProperty.call(Cr,x.key)&&(x.preventDefault(),m({direction:Cr[x.key],factor:x.shiftKey?4:1}))};return b.jsx("div",{className:it(["react-flow__nodesselection","react-flow__container",l]),style:{transform:d},children:b.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:y,tabIndex:o?void 0:-1,onKeyDown:o?void 0:p,style:{width:r,height:c}})})}const by=typeof window<"u"?window:void 0,CA=n=>({nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive});function lv({children:n,onPaneClick:l,onPaneMouseEnter:o,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:c,onPaneScroll:d,paneClickDistance:g,deleteKeyCode:m,selectionKeyCode:h,selectionOnDrag:v,selectionMode:y,onSelectionStart:p,onSelectionEnd:x,multiSelectionKeyCode:_,panActivationKeyCode:M,zoomActivationKeyCode:N,elementsSelectable:T,zoomOnScroll:U,zoomOnPinch:w,panOnScroll:D,panOnScrollSpeed:G,panOnScrollMode:R,zoomOnDoubleClick:L,panOnDrag:H,defaultViewport:$,translateExtent:V,minZoom:Y,maxZoom:P,preventScrolling:te,onSelectionContextMenu:z,noWheelClassName:k,noPanClassName:A,disableKeyboardA11y:j,onViewportChange:I,isControlledViewport:Q}){const{nodesSelectionActive:ne,userSelectionActive:C}=Re(CA,$e),B=Eo(h,{target:by}),ee=Eo(M,{target:by}),ae=ee||H,ue=ee||D,fe=v&&ae!==!0,ce=B||C||fe;return rA({deleteKeyCode:m,multiSelectionKeyCode:_}),b.jsx(fA,{onPaneContextMenu:c,elementsSelectable:T,zoomOnScroll:U,zoomOnPinch:w,panOnScroll:ue,panOnScrollSpeed:G,panOnScrollMode:R,zoomOnDoubleClick:L,panOnDrag:!B&&ae,defaultViewport:$,translateExtent:V,minZoom:Y,maxZoom:P,zoomActivationKeyCode:N,preventScrolling:te,noWheelClassName:k,noPanClassName:A,onViewportChange:I,isControlledViewport:Q,paneClickDistance:g,selectionOnDrag:fe,children:b.jsxs(mA,{onSelectionStart:p,onSelectionEnd:x,onPaneClick:l,onPaneMouseEnter:o,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:c,onPaneScroll:d,panOnDrag:ae,isSelecting:!!ce,selectionMode:y,selectionKeyPressed:B,paneClickDistance:g,selectionOnDrag:fe,children:[n,ne&&b.jsx(TA,{onSelectionContextMenu:z,noPanClassName:A,disableKeyboardA11y:j})]})})}lv.displayName="FlowRenderer";const MA=Z.memo(lv),zA=n=>l=>n?ad(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 DA(n){return Re(Z.useCallback(zA(n),[n]),$e)}const RA=n=>n.updateNodeInternals;function OA(){const n=Re(RA),[l]=Z.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(o=>{const s=new Map;o.forEach(r=>{const c=r.target.getAttribute("data-id");s.set(c,{id:c,nodeElement:r.target,force:!0})}),n(s)}));return Z.useEffect(()=>()=>{l?.disconnect()},[l]),l}function jA({node:n,nodeType:l,hasDimensions:o,resizeObserver:s}){const r=Ke(),c=Z.useRef(null),d=Z.useRef(null),g=Z.useRef(n.sourcePosition),m=Z.useRef(n.targetPosition),h=Z.useRef(l),v=o&&!!n.internals.handleBounds;return Z.useEffect(()=>{c.current&&!n.hidden&&(!v||d.current!==c.current)&&(d.current&&s?.unobserve(d.current),s?.observe(c.current),d.current=c.current)},[v,n.hidden]),Z.useEffect(()=>()=>{d.current&&(s?.unobserve(d.current),d.current=null)},[]),Z.useEffect(()=>{if(c.current){const y=h.current!==l,p=g.current!==n.sourcePosition,x=m.current!==n.targetPosition;(y||p||x)&&(h.current=l,g.current=n.sourcePosition,m.current=n.targetPosition,r.getState().updateNodeInternals(new Map([[n.id,{id:n.id,nodeElement:c.current,force:!0}]])))}},[n.id,l,n.sourcePosition,n.targetPosition]),c}function HA({id:n,onClick:l,onMouseEnter:o,onMouseMove:s,onMouseLeave:r,onContextMenu:c,onDoubleClick:d,nodesDraggable:g,elementsSelectable:m,nodesConnectable:h,nodesFocusable:v,resizeObserver:y,noDragClassName:p,noPanClassName:x,disableKeyboardA11y:_,rfId:M,nodeTypes:N,nodeClickDistance:T,onError:U}){const{node:w,internals:D,isParent:G}=Re(re=>{const de=re.nodeLookup.get(n),Ee=re.parentLookup.has(n);return{node:de,internals:de.internals,isParent:Ee}},$e);let R=w.type||"default",L=N?.[R]||Sy[R];L===void 0&&(U?.("003",mn.error003(R)),R="default",L=N?.default||Sy.default);const H=!!(w.draggable||g&&typeof w.draggable>"u"),$=!!(w.selectable||m&&typeof w.selectable>"u"),V=!!(w.connectable||h&&typeof w.connectable>"u"),Y=!!(w.focusable||v&&typeof w.focusable>"u"),P=Ke(),te=N0(w),z=jA({node:w,nodeType:R,hasDimensions:te,resizeObserver:y}),k=tv({nodeRef:z,disabled:w.hidden||!H,noDragClassName:p,handleSelector:w.dragHandle,nodeId:n,isSelectable:$,nodeClickDistance:T}),A=nv();if(w.hidden)return null;const j=Vn(w),I=NA(w),Q=$||H||l||o||s||r,ne=o?re=>o(re,{...D.userNode}):void 0,C=s?re=>s(re,{...D.userNode}):void 0,B=r?re=>r(re,{...D.userNode}):void 0,ee=c?re=>c(re,{...D.userNode}):void 0,ae=d?re=>d(re,{...D.userNode}):void 0,ue=re=>{const{selectNodesOnDrag:de,nodeDragThreshold:Ee}=P.getState();$&&(!de||!H||Ee>0)&&Qf({id:n,store:P,nodeRef:z}),l&&l(re,{...D.userNode})},fe=re=>{if(!(C0(re.nativeEvent)||_)){if(p0.includes(re.key)&&$){const de=re.key==="Escape";Qf({id:n,store:P,unselect:de,nodeRef:z})}else if(H&&w.selected&&Object.prototype.hasOwnProperty.call(Cr,re.key)){re.preventDefault();const{ariaLabelConfig:de}=P.getState();P.setState({ariaLiveMessage:de["node.a11yDescription.ariaLiveMessage"]({direction:re.key.replace("Arrow","").toLowerCase(),x:~~D.positionAbsolute.x,y:~~D.positionAbsolute.y})}),A({direction:Cr[re.key],factor:re.shiftKey?4:1})}}},ce=()=>{if(_||!z.current?.matches(":focus-visible"))return;const{transform:re,width:de,height:Ee,autoPanOnNodeFocus:xe,setCenter:ye}=P.getState();if(!xe)return;ad(new Map([[n,w]]),{x:0,y:0,width:de,height:Ee},re,!0).length>0||ye(w.position.x+j.width/2,w.position.y+j.height/2,{zoom:re[2]})};return b.jsx("div",{className:it(["react-flow__node",`react-flow__node-${R}`,{[x]:H},w.className,{selected:w.selected,selectable:$,parent:G,draggable:H,dragging:k}]),ref:z,style:{zIndex:D.z,transform:`translate(${D.positionAbsolute.x}px,${D.positionAbsolute.y}px)`,pointerEvents:Q?"all":"none",visibility:te?"visible":"hidden",...w.style,...I},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:ne,onMouseMove:C,onMouseLeave:B,onContextMenu:ee,onClick:ue,onDoubleClick:ae,onKeyDown:Y?fe:void 0,tabIndex:Y?0:void 0,onFocus:Y?ce:void 0,role:w.ariaRole??(Y?"group":void 0),"aria-roledescription":"node","aria-describedby":_?void 0:`${$0}-${M}`,"aria-label":w.ariaLabel,...w.domAttributes,children:b.jsx(yA,{value:n,children:b.jsx(L,{id:n,data:w.data,type:R,positionAbsoluteX:D.positionAbsolute.x,positionAbsoluteY:D.positionAbsolute.y,selected:w.selected??!1,selectable:$,draggable:H,deletable:w.deletable??!0,isConnectable:V,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:k,dragHandle:w.dragHandle,zIndex:D.z,parentId:w.parentId,...j})})})}var UA=Z.memo(HA);const LA=n=>({nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError});function iv(n){const{nodesDraggable:l,nodesConnectable:o,nodesFocusable:s,elementsSelectable:r,onError:c}=Re(LA,$e),d=DA(n.onlyRenderVisibleElements),g=OA();return b.jsx("div",{className:"react-flow__nodes",style:Ir,children:d.map(m=>b.jsx(UA,{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:s,elementsSelectable:r,nodeClickDistance:n.nodeClickDistance,onError:c},m))})}iv.displayName="NodeRenderer";const BA=Z.memo(iv);function qA(n){return Re(Z.useCallback(o=>{if(!n)return o.edges.map(r=>r.id);const s=[];if(o.width&&o.height)for(const r of o.edges){const c=o.nodeLookup.get(r.source),d=o.nodeLookup.get(r.target);c&&d&&B_({sourceNode:c,targetNode:d,width:o.width,height:o.height,transform:o.transform})&&s.push(r.id)}return s},[n]),$e)}const IA=({color:n="none",strokeWidth:l=1})=>{const o={strokeWidth:l,...n&&{stroke:n}};return b.jsx("polyline",{className:"arrow",style:o,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},GA=({color:n="none",strokeWidth:l=1})=>{const o={strokeWidth:l,...n&&{stroke:n,fill:n}};return b.jsx("polyline",{className:"arrowclosed",style:o,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},xy={[Nr.Arrow]:IA,[Nr.ArrowClosed]:GA};function YA(n){const l=Ke();return Z.useMemo(()=>Object.prototype.hasOwnProperty.call(xy,n)?xy[n]:(l.getState().onError?.("009",mn.error009(n)),null),[n])}const kA=({id:n,type:l,color:o,width:s=12.5,height:r=12.5,markerUnits:c="strokeWidth",strokeWidth:d,orient:g="auto-start-reverse"})=>{const m=YA(l);return m?b.jsx("marker",{className:"react-flow__arrowhead",id:n,markerWidth:`${s}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:g,refX:"0",refY:"0",children:b.jsx(m,{color:o,strokeWidth:d})}):null},ov=({defaultColor:n,rfId:l})=>{const o=Re(c=>c.edges),s=Re(c=>c.defaultEdgeOptions),r=Z.useMemo(()=>Z_(o,{id:l,defaultColor:n,defaultMarkerStart:s?.markerStart,defaultMarkerEnd:s?.markerEnd}),[o,s,l,n]);return r.length?b.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:b.jsx("defs",{children:r.map(c=>b.jsx(kA,{id:c.id,type:c.type,color:c.color,width:c.width,height:c.height,markerUnits:c.markerUnits,strokeWidth:c.strokeWidth,orient:c.orient},c.id))})}):null};ov.displayName="MarkerDefinitions";var VA=Z.memo(ov);function sv({x:n,y:l,label:o,labelStyle:s,labelShowBg:r=!0,labelBgStyle:c,labelBgPadding:d=[2,4],labelBgBorderRadius:g=2,children:m,className:h,...v}){const[y,p]=Z.useState({x:1,y:0,width:0,height:0}),x=it(["react-flow__edge-textwrapper",h]),_=Z.useRef(null);return Z.useEffect(()=>{if(_.current){const M=_.current.getBBox();p({x:M.x,y:M.y,width:M.width,height:M.height})}},[o]),o?b.jsxs("g",{transform:`translate(${n-y.width/2} ${l-y.height/2})`,className:x,visibility:y.width?"visible":"hidden",...v,children:[r&&b.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:c,rx:g,ry:g}),b.jsx("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:_,style:s,children:o}),m]}):null}sv.displayName="EdgeText";const XA=Z.memo(sv);function Gr({path:n,labelX:l,labelY:o,label:s,labelStyle:r,labelShowBg:c,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,interactionWidth:h=20,...v}){return b.jsxs(b.Fragment,{children:[b.jsx("path",{...v,d:n,fill:"none",className:it(["react-flow__edge-path",v.className])}),h?b.jsx("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,s&&nn(l)&&nn(o)?b.jsx(XA,{x:l,y:o,label:s,labelStyle:r,labelShowBg:c,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m}):null]})}function wy({pos:n,x1:l,y1:o,x2:s,y2:r}){return n===me.Left||n===me.Right?[.5*(l+s),o]:[l,.5*(o+r)]}function rv({sourceX:n,sourceY:l,sourcePosition:o=me.Bottom,targetX:s,targetY:r,targetPosition:c=me.Top}){const[d,g]=wy({pos:o,x1:n,y1:l,x2:s,y2:r}),[m,h]=wy({pos:c,x1:s,y1:r,x2:n,y2:l}),[v,y,p,x]=z0({sourceX:n,sourceY:l,targetX:s,targetY:r,sourceControlX:d,sourceControlY:g,targetControlX:m,targetControlY:h});return[`M${n},${l} C${d},${g} ${m},${h} ${s},${r}`,v,y,p,x]}function uv(n){return Z.memo(({id:l,sourceX:o,sourceY:s,targetX:r,targetY:c,sourcePosition:d,targetPosition:g,label:m,labelStyle:h,labelShowBg:v,labelBgStyle:y,labelBgPadding:p,labelBgBorderRadius:x,style:_,markerEnd:M,markerStart:N,interactionWidth:T})=>{const[U,w,D]=rv({sourceX:o,sourceY:s,sourcePosition:d,targetX:r,targetY:c,targetPosition:g}),G=n.isInternal?void 0:l;return b.jsx(Gr,{id:G,path:U,labelX:w,labelY:D,label:m,labelStyle:h,labelShowBg:v,labelBgStyle:y,labelBgPadding:p,labelBgBorderRadius:x,style:_,markerEnd:M,markerStart:N,interactionWidth:T})})}const ZA=uv({isInternal:!1}),cv=uv({isInternal:!0});ZA.displayName="SimpleBezierEdge";cv.displayName="SimpleBezierEdgeInternal";function fv(n){return Z.memo(({id:l,sourceX:o,sourceY:s,targetX:r,targetY:c,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:y,style:p,sourcePosition:x=me.Bottom,targetPosition:_=me.Top,markerEnd:M,markerStart:N,pathOptions:T,interactionWidth:U})=>{const[w,D,G]=kf({sourceX:o,sourceY:s,sourcePosition:x,targetX:r,targetY:c,targetPosition:_,borderRadius:T?.borderRadius,offset:T?.offset,stepPosition:T?.stepPosition}),R=n.isInternal?void 0:l;return b.jsx(Gr,{id:R,path:w,labelX:D,labelY:G,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:y,style:p,markerEnd:M,markerStart:N,interactionWidth:U})})}const dv=fv({isInternal:!1}),hv=fv({isInternal:!0});dv.displayName="SmoothStepEdge";hv.displayName="SmoothStepEdgeInternal";function gv(n){return Z.memo(({id:l,...o})=>{const s=n.isInternal?void 0:l;return b.jsx(dv,{...o,id:s,pathOptions:Z.useMemo(()=>({borderRadius:0,offset:o.pathOptions?.offset}),[o.pathOptions?.offset])})})}const $A=gv({isInternal:!1}),mv=gv({isInternal:!0});$A.displayName="StepEdge";mv.displayName="StepEdgeInternal";function pv(n){return Z.memo(({id:l,sourceX:o,sourceY:s,targetX:r,targetY:c,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:y,style:p,markerEnd:x,markerStart:_,interactionWidth:M})=>{const[N,T,U]=O0({sourceX:o,sourceY:s,targetX:r,targetY:c}),w=n.isInternal?void 0:l;return b.jsx(Gr,{id:w,path:N,labelX:T,labelY:U,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:y,style:p,markerEnd:x,markerStart:_,interactionWidth:M})})}const QA=pv({isInternal:!1}),yv=pv({isInternal:!0});QA.displayName="StraightEdge";yv.displayName="StraightEdgeInternal";function vv(n){return Z.memo(({id:l,sourceX:o,sourceY:s,targetX:r,targetY:c,sourcePosition:d=me.Bottom,targetPosition:g=me.Top,label:m,labelStyle:h,labelShowBg:v,labelBgStyle:y,labelBgPadding:p,labelBgBorderRadius:x,style:_,markerEnd:M,markerStart:N,pathOptions:T,interactionWidth:U})=>{const[w,D,G]=D0({sourceX:o,sourceY:s,sourcePosition:d,targetX:r,targetY:c,targetPosition:g,curvature:T?.curvature}),R=n.isInternal?void 0:l;return b.jsx(Gr,{id:R,path:w,labelX:D,labelY:G,label:m,labelStyle:h,labelShowBg:v,labelBgStyle:y,labelBgPadding:p,labelBgBorderRadius:x,style:_,markerEnd:M,markerStart:N,interactionWidth:U})})}const KA=vv({isInternal:!1}),Sv=vv({isInternal:!0});KA.displayName="BezierEdge";Sv.displayName="BezierEdgeInternal";const Ey={default:Sv,straight:yv,step:mv,smoothstep:hv,simplebezier:cv},_y={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},FA=(n,l,o)=>o===me.Left?n-l:o===me.Right?n+l:n,JA=(n,l,o)=>o===me.Top?n-l:o===me.Bottom?n+l:n,Ny="react-flow__edgeupdater";function Ay({position:n,centerX:l,centerY:o,radius:s=10,onMouseDown:r,onMouseEnter:c,onMouseOut:d,type:g}){return b.jsx("circle",{onMouseDown:r,onMouseEnter:c,onMouseOut:d,className:it([Ny,`${Ny}-${g}`]),cx:FA(l,s,n),cy:JA(o,s,n),r:s,stroke:"transparent",fill:"transparent"})}function PA({isReconnectable:n,reconnectRadius:l,edge:o,sourceX:s,sourceY:r,targetX:c,targetY:d,sourcePosition:g,targetPosition:m,onReconnect:h,onReconnectStart:v,onReconnectEnd:y,setReconnecting:p,setUpdateHover:x}){const _=Ke(),M=(D,G)=>{if(D.button!==0)return;const{autoPanOnConnect:R,domNode:L,connectionMode:H,connectionRadius:$,lib:V,onConnectStart:Y,cancelConnection:P,nodeLookup:te,rfId:z,panBy:k,updateConnection:A}=_.getState(),j=G.type==="target",I=(C,B)=>{p(!1),y?.(C,o,G.type,B)},Q=C=>h?.(o,C),ne=(C,B)=>{p(!0),v?.(D,o,G.type),Y?.(C,B)};Zf.onPointerDown(D.nativeEvent,{autoPanOnConnect:R,connectionMode:H,connectionRadius:$,domNode:L,handleId:G.id,nodeId:G.nodeId,nodeLookup:te,isTarget:j,edgeUpdaterType:G.type,lib:V,flowId:z,cancelConnection:P,panBy:k,isValidConnection:(...C)=>_.getState().isValidConnection?.(...C)??!0,onConnect:Q,onConnectStart:ne,onConnectEnd:(...C)=>_.getState().onConnectEnd?.(...C),onReconnectEnd:I,updateConnection:A,getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,dragThreshold:_.getState().connectionDragThreshold,handleDomNode:D.currentTarget})},N=D=>M(D,{nodeId:o.target,id:o.targetHandle??null,type:"target"}),T=D=>M(D,{nodeId:o.source,id:o.sourceHandle??null,type:"source"}),U=()=>x(!0),w=()=>x(!1);return b.jsxs(b.Fragment,{children:[(n===!0||n==="source")&&b.jsx(Ay,{position:g,centerX:s,centerY:r,radius:l,onMouseDown:N,onMouseEnter:U,onMouseOut:w,type:"source"}),(n===!0||n==="target")&&b.jsx(Ay,{position:m,centerX:c,centerY:d,radius:l,onMouseDown:T,onMouseEnter:U,onMouseOut:w,type:"target"})]})}function WA({id:n,edgesFocusable:l,edgesReconnectable:o,elementsSelectable:s,onClick:r,onDoubleClick:c,onContextMenu:d,onMouseEnter:g,onMouseMove:m,onMouseLeave:h,reconnectRadius:v,onReconnect:y,onReconnectStart:p,onReconnectEnd:x,rfId:_,edgeTypes:M,noPanClassName:N,onError:T,disableKeyboardA11y:U}){let w=Re(ye=>ye.edgeLookup.get(n));const D=Re(ye=>ye.defaultEdgeOptions);w=D?{...D,...w}:w;let G=w.type||"default",R=M?.[G]||Ey[G];R===void 0&&(T?.("011",mn.error011(G)),G="default",R=M?.default||Ey.default);const L=!!(w.focusable||l&&typeof w.focusable>"u"),H=typeof y<"u"&&(w.reconnectable||o&&typeof w.reconnectable>"u"),$=!!(w.selectable||s&&typeof w.selectable>"u"),V=Z.useRef(null),[Y,P]=Z.useState(!1),[te,z]=Z.useState(!1),k=Ke(),{zIndex:A,sourceX:j,sourceY:I,targetX:Q,targetY:ne,sourcePosition:C,targetPosition:B}=Re(Z.useCallback(ye=>{const Se=ye.nodeLookup.get(w.source),Ce=ye.nodeLookup.get(w.target);if(!Se||!Ce)return{zIndex:w.zIndex,..._y};const qe=X_({id:n,sourceNode:Se,targetNode:Ce,sourceHandle:w.sourceHandle||null,targetHandle:w.targetHandle||null,connectionMode:ye.connectionMode,onError:T});return{zIndex:L_({selected:w.selected,zIndex:w.zIndex,sourceNode:Se,targetNode:Ce,elevateOnSelect:ye.elevateEdgesOnSelect,zIndexMode:ye.zIndexMode}),...qe||_y}},[w.source,w.target,w.sourceHandle,w.targetHandle,w.selected,w.zIndex]),$e),ee=Z.useMemo(()=>w.markerStart?`url('#${Vf(w.markerStart,_)}')`:void 0,[w.markerStart,_]),ae=Z.useMemo(()=>w.markerEnd?`url('#${Vf(w.markerEnd,_)}')`:void 0,[w.markerEnd,_]);if(w.hidden||j===null||I===null||Q===null||ne===null)return null;const ue=ye=>{const{addSelectedEdges:Se,unselectNodesAndEdges:Ce,multiSelectionActive:qe}=k.getState();$&&(k.setState({nodesSelectionActive:!1}),w.selected&&qe?(Ce({nodes:[],edges:[w]}),V.current?.blur()):Se([n])),r&&r(ye,w)},fe=c?ye=>{c(ye,{...w})}:void 0,ce=d?ye=>{d(ye,{...w})}:void 0,re=g?ye=>{g(ye,{...w})}:void 0,de=m?ye=>{m(ye,{...w})}:void 0,Ee=h?ye=>{h(ye,{...w})}:void 0,xe=ye=>{if(!U&&p0.includes(ye.key)&&$){const{unselectNodesAndEdges:Se,addSelectedEdges:Ce}=k.getState();ye.key==="Escape"?(V.current?.blur(),Se({edges:[w]})):Ce([n])}};return b.jsx("svg",{style:{zIndex:A},children:b.jsxs("g",{className:it(["react-flow__edge",`react-flow__edge-${G}`,w.className,N,{selected:w.selected,animated:w.animated,inactive:!$&&!r,updating:Y,selectable:$}]),onClick:ue,onDoubleClick:fe,onContextMenu:ce,onMouseEnter:re,onMouseMove:de,onMouseLeave:Ee,onKeyDown:L?xe:void 0,tabIndex:L?0:void 0,role:w.ariaRole??(L?"group":"img"),"aria-roledescription":"edge","data-id":n,"data-testid":`rf__edge-${n}`,"aria-label":w.ariaLabel===null?void 0:w.ariaLabel||`Edge from ${w.source} to ${w.target}`,"aria-describedby":L?`${Q0}-${_}`:void 0,ref:V,...w.domAttributes,children:[!te&&b.jsx(R,{id:n,source:w.source,target:w.target,type:w.type,selected:w.selected,animated:w.animated,selectable:$,deletable:w.deletable??!0,label:w.label,labelStyle:w.labelStyle,labelShowBg:w.labelShowBg,labelBgStyle:w.labelBgStyle,labelBgPadding:w.labelBgPadding,labelBgBorderRadius:w.labelBgBorderRadius,sourceX:j,sourceY:I,targetX:Q,targetY:ne,sourcePosition:C,targetPosition:B,data:w.data,style:w.style,sourceHandleId:w.sourceHandle,targetHandleId:w.targetHandle,markerStart:ee,markerEnd:ae,pathOptions:"pathOptions"in w?w.pathOptions:void 0,interactionWidth:w.interactionWidth}),H&&b.jsx(PA,{edge:w,isReconnectable:H,reconnectRadius:v,onReconnect:y,onReconnectStart:p,onReconnectEnd:x,sourceX:j,sourceY:I,targetX:Q,targetY:ne,sourcePosition:C,targetPosition:B,setUpdateHover:P,setReconnecting:z})]})})}var eT=Z.memo(WA);const tT=n=>({edgesFocusable:n.edgesFocusable,edgesReconnectable:n.edgesReconnectable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError});function bv({defaultMarkerColor:n,onlyRenderVisibleElements:l,rfId:o,edgeTypes:s,noPanClassName:r,onReconnect:c,onEdgeContextMenu:d,onEdgeMouseEnter:g,onEdgeMouseMove:m,onEdgeMouseLeave:h,onEdgeClick:v,reconnectRadius:y,onEdgeDoubleClick:p,onReconnectStart:x,onReconnectEnd:_,disableKeyboardA11y:M}){const{edgesFocusable:N,edgesReconnectable:T,elementsSelectable:U,onError:w}=Re(tT,$e),D=qA(l);return b.jsxs("div",{className:"react-flow__edges",children:[b.jsx(VA,{defaultColor:n,rfId:o}),D.map(G=>b.jsx(eT,{id:G,edgesFocusable:N,edgesReconnectable:T,elementsSelectable:U,noPanClassName:r,onReconnect:c,onContextMenu:d,onMouseEnter:g,onMouseMove:m,onMouseLeave:h,onClick:v,reconnectRadius:y,onDoubleClick:p,onReconnectStart:x,onReconnectEnd:_,rfId:o,onError:w,edgeTypes:s,disableKeyboardA11y:M},G))]})}bv.displayName="EdgeRenderer";const nT=Z.memo(bv),aT=n=>`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`;function lT({children:n}){const l=Re(aT);return b.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:l},children:n})}function iT(n){const l=qr(),o=Z.useRef(!1);Z.useEffect(()=>{!o.current&&l.viewportInitialized&&n&&(setTimeout(()=>n(l),1),o.current=!0)},[n,l.viewportInitialized])}const oT=n=>n.panZoom?.syncViewport;function sT(n){const l=Re(oT),o=Ke();return Z.useEffect(()=>{n&&(l?.(n),o.setState({transform:[n.x,n.y,n.zoom]}))},[n,l]),null}function rT(n){return n.connection.inProgress?{...n.connection,to:zo(n.connection.to,n.transform)}:{...n.connection}}function uT(n){return rT}function cT(n){const l=uT();return Re(l,$e)}const fT=n=>({nodesConnectable:n.nodesConnectable,isValid:n.connection.isValid,inProgress:n.connection.inProgress,width:n.width,height:n.height});function dT({containerStyle:n,style:l,type:o,component:s}){const{nodesConnectable:r,width:c,height:d,isValid:g,inProgress:m}=Re(fT,$e);return!(c&&r&&m)?null:b.jsx("svg",{style:n,width:c,height:d,className:"react-flow__connectionline react-flow__container",children:b.jsx("g",{className:it(["react-flow__connection",S0(g)]),children:b.jsx(xv,{style:l,type:o,CustomComponent:s,isValid:g})})})}const xv=({style:n,type:l=Ea.Bezier,CustomComponent:o,isValid:s})=>{const{inProgress:r,from:c,fromNode:d,fromHandle:g,fromPosition:m,to:h,toNode:v,toHandle:y,toPosition:p,pointer:x}=cT();if(!r)return;if(o)return b.jsx(o,{connectionLineType:l,connectionLineStyle:n,fromNode:d,fromHandle:g,fromX:c.x,fromY:c.y,toX:h.x,toY:h.y,fromPosition:m,toPosition:p,connectionStatus:S0(s),toNode:v,toHandle:y,pointer:x});let _="";const M={sourceX:c.x,sourceY:c.y,sourcePosition:m,targetX:h.x,targetY:h.y,targetPosition:p};switch(l){case Ea.Bezier:[_]=D0(M);break;case Ea.SimpleBezier:[_]=rv(M);break;case Ea.Step:[_]=kf({...M,borderRadius:0});break;case Ea.SmoothStep:[_]=kf(M);break;default:[_]=O0(M)}return b.jsx("path",{d:_,fill:"none",className:"react-flow__connection-path",style:n})};xv.displayName="ConnectionLine";const hT={};function Ty(n=hT){Z.useRef(n),Ke(),Z.useEffect(()=>{},[n])}function gT(){Ke(),Z.useRef(!1),Z.useEffect(()=>{},[])}function wv({nodeTypes:n,edgeTypes:l,onInit:o,onNodeClick:s,onEdgeClick:r,onNodeDoubleClick:c,onEdgeDoubleClick:d,onNodeMouseEnter:g,onNodeMouseMove:m,onNodeMouseLeave:h,onNodeContextMenu:v,onSelectionContextMenu:y,onSelectionStart:p,onSelectionEnd:x,connectionLineType:_,connectionLineStyle:M,connectionLineComponent:N,connectionLineContainerStyle:T,selectionKeyCode:U,selectionOnDrag:w,selectionMode:D,multiSelectionKeyCode:G,panActivationKeyCode:R,zoomActivationKeyCode:L,deleteKeyCode:H,onlyRenderVisibleElements:$,elementsSelectable:V,defaultViewport:Y,translateExtent:P,minZoom:te,maxZoom:z,preventScrolling:k,defaultMarkerColor:A,zoomOnScroll:j,zoomOnPinch:I,panOnScroll:Q,panOnScrollSpeed:ne,panOnScrollMode:C,zoomOnDoubleClick:B,panOnDrag:ee,onPaneClick:ae,onPaneMouseEnter:ue,onPaneMouseMove:fe,onPaneMouseLeave:ce,onPaneScroll:re,onPaneContextMenu:de,paneClickDistance:Ee,nodeClickDistance:xe,onEdgeContextMenu:ye,onEdgeMouseEnter:Se,onEdgeMouseMove:Ce,onEdgeMouseLeave:qe,reconnectRadius:Ue,onReconnect:rt,onReconnectStart:Qt,onReconnectEnd:zt,noDragClassName:Kt,noWheelClassName:yn,noPanClassName:Na,disableKeyboardA11y:Aa,nodeExtent:ft,rfId:il,viewport:vn,onViewportChange:Xn}){return Ty(n),Ty(l),gT(),iT(o),sT(vn),b.jsx(MA,{onPaneClick:ae,onPaneMouseEnter:ue,onPaneMouseMove:fe,onPaneMouseLeave:ce,onPaneContextMenu:de,onPaneScroll:re,paneClickDistance:Ee,deleteKeyCode:H,selectionKeyCode:U,selectionOnDrag:w,selectionMode:D,onSelectionStart:p,onSelectionEnd:x,multiSelectionKeyCode:G,panActivationKeyCode:R,zoomActivationKeyCode:L,elementsSelectable:V,zoomOnScroll:j,zoomOnPinch:I,zoomOnDoubleClick:B,panOnScroll:Q,panOnScrollSpeed:ne,panOnScrollMode:C,panOnDrag:ee,defaultViewport:Y,translateExtent:P,minZoom:te,maxZoom:z,onSelectionContextMenu:y,preventScrolling:k,noDragClassName:Kt,noWheelClassName:yn,noPanClassName:Na,disableKeyboardA11y:Aa,onViewportChange:Xn,isControlledViewport:!!vn,children:b.jsxs(lT,{children:[b.jsx(nT,{edgeTypes:l,onEdgeClick:r,onEdgeDoubleClick:d,onReconnect:rt,onReconnectStart:Qt,onReconnectEnd:zt,onlyRenderVisibleElements:$,onEdgeContextMenu:ye,onEdgeMouseEnter:Se,onEdgeMouseMove:Ce,onEdgeMouseLeave:qe,reconnectRadius:Ue,defaultMarkerColor:A,noPanClassName:Na,disableKeyboardA11y:Aa,rfId:il}),b.jsx(dT,{style:M,type:_,component:N,containerStyle:T}),b.jsx("div",{className:"react-flow__edgelabel-renderer"}),b.jsx(BA,{nodeTypes:n,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:g,onNodeMouseMove:m,onNodeMouseLeave:h,onNodeContextMenu:v,nodeClickDistance:xe,onlyRenderVisibleElements:$,noPanClassName:Na,noDragClassName:Kt,disableKeyboardA11y:Aa,nodeExtent:ft,rfId:il}),b.jsx("div",{className:"react-flow__viewport-portal"})]})})}wv.displayName="GraphView";const mT=Z.memo(wv),Cy=({nodes:n,edges:l,defaultNodes:o,defaultEdges:s,width:r,height:c,fitView:d,fitViewOptions:g,minZoom:m=.5,maxZoom:h=2,nodeOrigin:v,nodeExtent:y,zIndexMode:p="basic"}={})=>{const x=new Map,_=new Map,M=new Map,N=new Map,T=s??l??[],U=o??n??[],w=v??[0,0],D=y??So;U0(M,N,T);const{nodesInitialized:G}=Xf(U,x,_,{nodeOrigin:w,nodeExtent:D,zIndexMode:p});let R=[0,0,1];if(d&&r&&c){const L=Co(x,{filter:Y=>!!((Y.width||Y.initialWidth)&&(Y.height||Y.initialHeight))}),{x:H,y:$,zoom:V}=ld(L,r,c,m,h,g?.padding??.1);R=[H,$,V]}return{rfId:"1",width:r??0,height:c??0,transform:R,nodes:U,nodesInitialized:G,nodeLookup:x,parentLookup:_,edges:T,edgeLookup:N,connectionLookup:M,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:o!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:m,maxZoom:h,translateExtent:So,nodeExtent:D,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ai.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:w,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:{...v0},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:D_,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:y0,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},pT=({nodes:n,edges:l,defaultNodes:o,defaultEdges:s,width:r,height:c,fitView:d,fitViewOptions:g,minZoom:m,maxZoom:h,nodeOrigin:v,nodeExtent:y,zIndexMode:p})=>HN((x,_)=>{async function M(){const{nodeLookup:N,panZoom:T,fitViewOptions:U,fitViewResolver:w,width:D,height:G,minZoom:R,maxZoom:L}=_();T&&(await M_({nodes:N,width:D,height:G,panZoom:T,minZoom:R,maxZoom:L},U),w?.resolve(!0),x({fitViewResolver:null}))}return{...Cy({nodes:n,edges:l,width:r,height:c,fitView:d,fitViewOptions:g,minZoom:m,maxZoom:h,nodeOrigin:v,nodeExtent:y,defaultNodes:o,defaultEdges:s,zIndexMode:p}),setNodes:N=>{const{nodeLookup:T,parentLookup:U,nodeOrigin:w,elevateNodesOnSelect:D,fitViewQueued:G,zIndexMode:R,nodesSelectionActive:L}=_(),{nodesInitialized:H,hasSelectedNodes:$}=Xf(N,T,U,{nodeOrigin:w,nodeExtent:y,elevateNodesOnSelect:D,checkEquality:!0,zIndexMode:R}),V=L&&$;G&&H?(M(),x({nodes:N,nodesInitialized:H,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:V})):x({nodes:N,nodesInitialized:H,nodesSelectionActive:V})},setEdges:N=>{const{connectionLookup:T,edgeLookup:U}=_();U0(T,U,N),x({edges:N})},setDefaultNodesAndEdges:(N,T)=>{if(N){const{setNodes:U}=_();U(N),x({hasDefaultNodes:!0})}if(T){const{setEdges:U}=_();U(T),x({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:T,nodeLookup:U,parentLookup:w,domNode:D,nodeOrigin:G,nodeExtent:R,debug:L,fitViewQueued:H,zIndexMode:$}=_(),{changes:V,updatedInternals:Y}=W_(N,U,w,D,G,R,$);Y&&(K_(U,w,{nodeOrigin:G,nodeExtent:R,zIndexMode:$}),H?(M(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),V?.length>0&&(L&&console.log("React Flow: trigger node changes",V),T?.(V)))},updateNodePositions:(N,T=!1)=>{const U=[];let w=[];const{nodeLookup:D,triggerNodeChanges:G,connection:R,updateConnection:L,onNodesChangeMiddlewareMap:H}=_();for(const[$,V]of N){const Y=D.get($),P=!!(Y?.expandParent&&Y?.parentId&&V?.position),te={id:$,type:"position",position:P?{x:Math.max(0,V.position.x),y:Math.max(0,V.position.y)}:V.position,dragging:T};if(Y&&R.inProgress&&R.fromNode.id===Y.id){const z=ll(Y,R.fromHandle,me.Left,!0);L({...R,from:z})}P&&Y.parentId&&U.push({id:$,parentId:Y.parentId,rect:{...V.internals.positionAbsolute,width:V.measured.width??0,height:V.measured.height??0}}),w.push(te)}if(U.length>0){const{parentLookup:$,nodeOrigin:V}=_(),Y=cd(U,D,$,V);w.push(...Y)}for(const $ of H.values())w=$(w);G(w)},triggerNodeChanges:N=>{const{onNodesChange:T,setNodes:U,nodes:w,hasDefaultNodes:D,debug:G}=_();if(N?.length){if(D){const R=J0(N,w);U(R)}G&&console.log("React Flow: trigger node changes",N),T?.(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:T,setEdges:U,edges:w,hasDefaultEdges:D,debug:G}=_();if(N?.length){if(D){const R=P0(N,w);U(R)}G&&console.log("React Flow: trigger edge changes",N),T?.(N)}},addSelectedNodes:N=>{const{multiSelectionActive:T,edgeLookup:U,nodeLookup:w,triggerNodeChanges:D,triggerEdgeChanges:G}=_();if(T){const R=N.map(L=>Ja(L,!0));D(R);return}D(Pl(w,new Set([...N]),!0)),G(Pl(U))},addSelectedEdges:N=>{const{multiSelectionActive:T,edgeLookup:U,nodeLookup:w,triggerNodeChanges:D,triggerEdgeChanges:G}=_();if(T){const R=N.map(L=>Ja(L,!0));G(R);return}G(Pl(U,new Set([...N]))),D(Pl(w,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:T}={})=>{const{edges:U,nodes:w,nodeLookup:D,triggerNodeChanges:G,triggerEdgeChanges:R}=_(),L=N||w,H=T||U,$=[];for(const Y of L){if(!Y.selected)continue;const P=D.get(Y.id);P&&(P.selected=!1),$.push(Ja(Y.id,!1))}const V=[];for(const Y of H)Y.selected&&V.push(Ja(Y.id,!1));G($),R(V)},setMinZoom:N=>{const{panZoom:T,maxZoom:U}=_();T?.setScaleExtent([N,U]),x({minZoom:N})},setMaxZoom:N=>{const{panZoom:T,minZoom:U}=_();T?.setScaleExtent([U,N]),x({maxZoom:N})},setTranslateExtent:N=>{_().panZoom?.setTranslateExtent(N),x({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:T,triggerNodeChanges:U,triggerEdgeChanges:w,elementsSelectable:D}=_();if(!D)return;const G=T.reduce((L,H)=>H.selected?[...L,Ja(H.id,!1)]:L,[]),R=N.reduce((L,H)=>H.selected?[...L,Ja(H.id,!1)]:L,[]);U(G),w(R)},setNodeExtent:N=>{const{nodes:T,nodeLookup:U,parentLookup:w,nodeOrigin:D,elevateNodesOnSelect:G,nodeExtent:R,zIndexMode:L}=_();N[0][0]===R[0][0]&&N[0][1]===R[0][1]&&N[1][0]===R[1][0]&&N[1][1]===R[1][1]||(Xf(T,U,w,{nodeOrigin:D,nodeExtent:N,elevateNodesOnSelect:G,checkEquality:!1,zIndexMode:L}),x({nodeExtent:N}))},panBy:N=>{const{transform:T,width:U,height:w,panZoom:D,translateExtent:G}=_();return eN({delta:N,panZoom:D,transform:T,translateExtent:G,width:U,height:w})},setCenter:async(N,T,U)=>{const{width:w,height:D,maxZoom:G,panZoom:R}=_();if(!R)return Promise.resolve(!1);const L=typeof U?.zoom<"u"?U.zoom:G;return await R.setViewport({x:w/2-N*L,y:D/2-T*L,zoom:L},{duration:U?.duration,ease:U?.ease,interpolate:U?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{x({connection:{...v0}})},updateConnection:N=>{x({connection:N})},reset:()=>x({...Cy()})}},Object.is);function Ev({initialNodes:n,initialEdges:l,defaultNodes:o,defaultEdges:s,initialWidth:r,initialHeight:c,initialMinZoom:d,initialMaxZoom:g,initialFitViewOptions:m,fitView:h,nodeOrigin:v,nodeExtent:y,zIndexMode:p,children:x}){const[_]=Z.useState(()=>pT({nodes:n,edges:l,defaultNodes:o,defaultEdges:s,width:r,height:c,fitView:h,minZoom:d,maxZoom:g,fitViewOptions:m,nodeOrigin:v,nodeExtent:y,zIndexMode:p}));return b.jsx(UN,{value:_,children:b.jsx(lA,{children:x})})}function yT({children:n,nodes:l,edges:o,defaultNodes:s,defaultEdges:r,width:c,height:d,fitView:g,fitViewOptions:m,minZoom:h,maxZoom:v,nodeOrigin:y,nodeExtent:p,zIndexMode:x}){return Z.useContext(Lr)?b.jsx(b.Fragment,{children:n}):b.jsx(Ev,{initialNodes:l,initialEdges:o,defaultNodes:s,defaultEdges:r,initialWidth:c,initialHeight:d,fitView:g,initialFitViewOptions:m,initialMinZoom:h,initialMaxZoom:v,nodeOrigin:y,nodeExtent:p,zIndexMode:x,children:n})}const vT={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function ST({nodes:n,edges:l,defaultNodes:o,defaultEdges:s,className:r,nodeTypes:c,edgeTypes:d,onNodeClick:g,onEdgeClick:m,onInit:h,onMove:v,onMoveStart:y,onMoveEnd:p,onConnect:x,onConnectStart:_,onConnectEnd:M,onClickConnectStart:N,onClickConnectEnd:T,onNodeMouseEnter:U,onNodeMouseMove:w,onNodeMouseLeave:D,onNodeContextMenu:G,onNodeDoubleClick:R,onNodeDragStart:L,onNodeDrag:H,onNodeDragStop:$,onNodesDelete:V,onEdgesDelete:Y,onDelete:P,onSelectionChange:te,onSelectionDragStart:z,onSelectionDrag:k,onSelectionDragStop:A,onSelectionContextMenu:j,onSelectionStart:I,onSelectionEnd:Q,onBeforeDelete:ne,connectionMode:C,connectionLineType:B=Ea.Bezier,connectionLineStyle:ee,connectionLineComponent:ae,connectionLineContainerStyle:ue,deleteKeyCode:fe="Backspace",selectionKeyCode:ce="Shift",selectionOnDrag:re=!1,selectionMode:de=bo.Full,panActivationKeyCode:Ee="Space",multiSelectionKeyCode:xe=wo()?"Meta":"Control",zoomActivationKeyCode:ye=wo()?"Meta":"Control",snapToGrid:Se,snapGrid:Ce,onlyRenderVisibleElements:qe=!1,selectNodesOnDrag:Ue,nodesDraggable:rt,autoPanOnNodeFocus:Qt,nodesConnectable:zt,nodesFocusable:Kt,nodeOrigin:yn=K0,edgesFocusable:Na,edgesReconnectable:Aa,elementsSelectable:ft=!0,defaultViewport:il=KN,minZoom:vn=.5,maxZoom:Xn=2,translateExtent:Ta=So,preventScrolling:Yr=!0,nodeExtent:ol,defaultMarkerColor:kr="#b1b1b7",zoomOnScroll:Vr=!0,zoomOnPinch:Ca=!0,panOnScroll:vt=!1,panOnScrollSpeed:on=.5,panOnScrollMode:St=el.Free,zoomOnDoubleClick:Xr=!0,panOnDrag:Zr=!0,onPaneClick:$r,onPaneMouseEnter:sl,onPaneMouseMove:rl,onPaneMouseLeave:ul,onPaneScroll:Sn,onPaneContextMenu:cl,paneClickDistance:Ma=1,nodeClickDistance:Qr=0,children:Do,onReconnect:ui,onReconnectStart:za,onReconnectEnd:Kr,onEdgeContextMenu:Ro,onEdgeDoubleClick:Oo,onEdgeMouseEnter:jo,onEdgeMouseMove:ci,onEdgeMouseLeave:fi,reconnectRadius:Ho=10,onNodesChange:Uo,onEdgesChange:sn,noDragClassName:ot="nodrag",noWheelClassName:pt="nowheel",noPanClassName:bn="nopan",fitView:fl,fitViewOptions:Lo,connectOnClick:Fr,attributionPosition:Bo,proOptions:Da,defaultEdgeOptions:di,elevateNodesOnSelect:Zn=!0,elevateEdgesOnSelect:$n=!1,disableKeyboardA11y:Qn=!1,autoPanOnConnect:Kn,autoPanOnNodeDrag:et,autoPanSpeed:qo,connectionRadius:Io,isValidConnection:xn,onError:Fn,style:Jr,id:hi,nodeDragThreshold:Go,connectionDragThreshold:Pr,viewport:dl,onViewportChange:hl,width:Ft,height:xt,colorMode:Yo="light",debug:Wr,onScroll:gl,ariaLabelConfig:ko,zIndexMode:Ra="basic",...eu},wt){const Oa=hi||"1",Vo=WN(Yo),gi=Z.useCallback(wn=>{wn.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),gl?.(wn)},[gl]);return b.jsx("div",{"data-testid":"rf__wrapper",...eu,onScroll:gi,style:{...Jr,...vT},ref:wt,className:it(["react-flow",r,Vo]),id:hi,role:"application",children:b.jsxs(yT,{nodes:n,edges:l,width:Ft,height:xt,fitView:fl,fitViewOptions:Lo,minZoom:vn,maxZoom:Xn,nodeOrigin:yn,nodeExtent:ol,zIndexMode:Ra,children:[b.jsx(PN,{nodes:n,edges:l,defaultNodes:o,defaultEdges:s,onConnect:x,onConnectStart:_,onConnectEnd:M,onClickConnectStart:N,onClickConnectEnd:T,nodesDraggable:rt,autoPanOnNodeFocus:Qt,nodesConnectable:zt,nodesFocusable:Kt,edgesFocusable:Na,edgesReconnectable:Aa,elementsSelectable:ft,elevateNodesOnSelect:Zn,elevateEdgesOnSelect:$n,minZoom:vn,maxZoom:Xn,nodeExtent:ol,onNodesChange:Uo,onEdgesChange:sn,snapToGrid:Se,snapGrid:Ce,connectionMode:C,translateExtent:Ta,connectOnClick:Fr,defaultEdgeOptions:di,fitView:fl,fitViewOptions:Lo,onNodesDelete:V,onEdgesDelete:Y,onDelete:P,onNodeDragStart:L,onNodeDrag:H,onNodeDragStop:$,onSelectionDrag:k,onSelectionDragStart:z,onSelectionDragStop:A,onMove:v,onMoveStart:y,onMoveEnd:p,noPanClassName:bn,nodeOrigin:yn,rfId:Oa,autoPanOnConnect:Kn,autoPanOnNodeDrag:et,autoPanSpeed:qo,onError:Fn,connectionRadius:Io,isValidConnection:xn,selectNodesOnDrag:Ue,nodeDragThreshold:Go,connectionDragThreshold:Pr,onBeforeDelete:ne,debug:Wr,ariaLabelConfig:ko,zIndexMode:Ra}),b.jsx(mT,{onInit:h,onNodeClick:g,onEdgeClick:m,onNodeMouseEnter:U,onNodeMouseMove:w,onNodeMouseLeave:D,onNodeContextMenu:G,onNodeDoubleClick:R,nodeTypes:c,edgeTypes:d,connectionLineType:B,connectionLineStyle:ee,connectionLineComponent:ae,connectionLineContainerStyle:ue,selectionKeyCode:ce,selectionOnDrag:re,selectionMode:de,deleteKeyCode:fe,multiSelectionKeyCode:xe,panActivationKeyCode:Ee,zoomActivationKeyCode:ye,onlyRenderVisibleElements:qe,defaultViewport:il,translateExtent:Ta,minZoom:vn,maxZoom:Xn,preventScrolling:Yr,zoomOnScroll:Vr,zoomOnPinch:Ca,zoomOnDoubleClick:Xr,panOnScroll:vt,panOnScrollSpeed:on,panOnScrollMode:St,panOnDrag:Zr,onPaneClick:$r,onPaneMouseEnter:sl,onPaneMouseMove:rl,onPaneMouseLeave:ul,onPaneScroll:Sn,onPaneContextMenu:cl,paneClickDistance:Ma,nodeClickDistance:Qr,onSelectionContextMenu:j,onSelectionStart:I,onSelectionEnd:Q,onReconnect:ui,onReconnectStart:za,onReconnectEnd:Kr,onEdgeContextMenu:Ro,onEdgeDoubleClick:Oo,onEdgeMouseEnter:jo,onEdgeMouseMove:ci,onEdgeMouseLeave:fi,reconnectRadius:Ho,defaultMarkerColor:kr,noDragClassName:ot,noWheelClassName:pt,noPanClassName:bn,rfId:Oa,disableKeyboardA11y:Qn,nodeExtent:ol,viewport:dl,onViewportChange:hl}),b.jsx(QN,{onSelectionChange:te}),Do,b.jsx(kN,{proOptions:Da,position:Bo}),b.jsx(YN,{rfId:Oa,disableKeyboardA11y:Qn})]})})}var bT=W0(ST);function xT({dimensions:n,lineWidth:l,variant:o,className:s}){return b.jsx("path",{strokeWidth:l,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`,className:it(["react-flow__background-pattern",o,s])})}function wT({radius:n,className:l}){return b.jsx("circle",{cx:n,cy:n,r:n,className:it(["react-flow__background-pattern","dots",l])})}var _a;(function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"})(_a||(_a={}));const ET={[_a.Dots]:1,[_a.Lines]:1,[_a.Cross]:6},_T=n=>({transform:n.transform,patternId:`pattern-${n.rfId}`});function _v({id:n,variant:l=_a.Dots,gap:o=20,size:s,lineWidth:r=1,offset:c=0,color:d,bgColor:g,style:m,className:h,patternClassName:v}){const y=Z.useRef(null),{transform:p,patternId:x}=Re(_T,$e),_=s||ET[l],M=l===_a.Dots,N=l===_a.Cross,T=Array.isArray(o)?o:[o,o],U=[T[0]*p[2]||1,T[1]*p[2]||1],w=_*p[2],D=Array.isArray(c)?c:[c,c],G=N?[w,w]:U,R=[D[0]*p[2]||1+G[0]/2,D[1]*p[2]||1+G[1]/2],L=`${x}${n||""}`;return b.jsxs("svg",{className:it(["react-flow__background",h]),style:{...m,...Ir,"--xy-background-color-props":g,"--xy-background-pattern-color-props":d},ref:y,"data-testid":"rf__background",children:[b.jsx("pattern",{id:L,x:p[0]%U[0],y:p[1]%U[1],width:U[0],height:U[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${R[0]},-${R[1]})`,children:M?b.jsx(wT,{radius:w/2,className:v}):b.jsx(xT,{dimensions:G,lineWidth:r,variant:l,className:v})}),b.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${L})`})]})}_v.displayName="Background";const NT=Z.memo(_v);function AT(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:b.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function TT(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:b.jsx("path",{d:"M0 0h32v4.2H0z"})})}function CT(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:b.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function MT(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function zT(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function cr({children:n,className:l,...o}){return b.jsx("button",{type:"button",className:it(["react-flow__controls-button",l]),...o,children:n})}const DT=n=>({isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom,ariaLabelConfig:n.ariaLabelConfig});function Nv({style:n,showZoom:l=!0,showFitView:o=!0,showInteractive:s=!0,fitViewOptions:r,onZoomIn:c,onZoomOut:d,onFitView:g,onInteractiveChange:m,className:h,children:v,position:y="bottom-left",orientation:p="vertical","aria-label":x}){const _=Ke(),{isInteractive:M,minZoomReached:N,maxZoomReached:T,ariaLabelConfig:U}=Re(DT,$e),{zoomIn:w,zoomOut:D,fitView:G}=qr(),R=()=>{w(),c?.()},L=()=>{D(),d?.()},H=()=>{G(r),g?.()},$=()=>{_.setState({nodesDraggable:!M,nodesConnectable:!M,elementsSelectable:!M}),m?.(!M)},V=p==="horizontal"?"horizontal":"vertical";return b.jsxs(Br,{className:it(["react-flow__controls",V,h]),position:y,style:n,"data-testid":"rf__controls","aria-label":x??U["controls.ariaLabel"],children:[l&&b.jsxs(b.Fragment,{children:[b.jsx(cr,{onClick:R,className:"react-flow__controls-zoomin",title:U["controls.zoomIn.ariaLabel"],"aria-label":U["controls.zoomIn.ariaLabel"],disabled:T,children:b.jsx(AT,{})}),b.jsx(cr,{onClick:L,className:"react-flow__controls-zoomout",title:U["controls.zoomOut.ariaLabel"],"aria-label":U["controls.zoomOut.ariaLabel"],disabled:N,children:b.jsx(TT,{})})]}),o&&b.jsx(cr,{className:"react-flow__controls-fitview",onClick:H,title:U["controls.fitView.ariaLabel"],"aria-label":U["controls.fitView.ariaLabel"],children:b.jsx(CT,{})}),s&&b.jsx(cr,{className:"react-flow__controls-interactive",onClick:$,title:U["controls.interactive.ariaLabel"],"aria-label":U["controls.interactive.ariaLabel"],children:M?b.jsx(zT,{}):b.jsx(MT,{})}),v]})}Nv.displayName="Controls";const RT=Z.memo(Nv);function OT({id:n,x:l,y:o,width:s,height:r,style:c,color:d,strokeColor:g,strokeWidth:m,className:h,borderRadius:v,shapeRendering:y,selected:p,onClick:x}){const{background:_,backgroundColor:M}=c||{},N=d||_||M;return b.jsx("rect",{className:it(["react-flow__minimap-node",{selected:p},h]),x:l,y:o,rx:v,ry:v,width:s,height:r,style:{fill:N,stroke:g,strokeWidth:m},shapeRendering:y,onClick:x?T=>x(T,n):void 0})}const jT=Z.memo(OT),HT=n=>n.nodes.map(l=>l.id),zf=n=>n instanceof Function?n:()=>n;function UT({nodeStrokeColor:n,nodeColor:l,nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:r,nodeComponent:c=jT,onClick:d}){const g=Re(HT,$e),m=zf(l),h=zf(n),v=zf(o),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return b.jsx(b.Fragment,{children:g.map(p=>b.jsx(BT,{id:p,nodeColorFunc:m,nodeStrokeColorFunc:h,nodeClassNameFunc:v,nodeBorderRadius:s,nodeStrokeWidth:r,NodeComponent:c,onClick:d,shapeRendering:y},p))})}function LT({id:n,nodeColorFunc:l,nodeStrokeColorFunc:o,nodeClassNameFunc:s,nodeBorderRadius:r,nodeStrokeWidth:c,shapeRendering:d,NodeComponent:g,onClick:m}){const{node:h,x:v,y,width:p,height:x}=Re(_=>{const M=_.nodeLookup.get(n);if(!M)return{node:void 0,x:0,y:0,width:0,height:0};const N=M.internals.userNode,{x:T,y:U}=M.internals.positionAbsolute,{width:w,height:D}=Vn(N);return{node:N,x:T,y:U,width:w,height:D}},$e);return!h||h.hidden||!N0(h)?null:b.jsx(g,{x:v,y,width:p,height:x,style:h.style,selected:!!h.selected,className:s(h),color:l(h),borderRadius:r,strokeColor:o(h),strokeWidth:c,shapeRendering:d,onClick:m,id:h.id})}const BT=Z.memo(LT);var qT=Z.memo(UT);const IT=200,GT=150,YT=n=>!n.hidden,kT=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?_0(Co(n.nodeLookup,{filter:YT}),l):l,rfId:n.rfId,panZoom:n.panZoom,translateExtent:n.translateExtent,flowWidth:n.width,flowHeight:n.height,ariaLabelConfig:n.ariaLabelConfig}},VT="react-flow__minimap-desc";function Av({style:n,className:l,nodeStrokeColor:o,nodeColor:s,nodeClassName:r="",nodeBorderRadius:c=5,nodeStrokeWidth:d,nodeComponent:g,bgColor:m,maskColor:h,maskStrokeColor:v,maskStrokeWidth:y,position:p="bottom-right",onClick:x,onNodeClick:_,pannable:M=!1,zoomable:N=!1,ariaLabel:T,inversePan:U,zoomStep:w=1,offsetScale:D=5}){const G=Ke(),R=Z.useRef(null),{boundingRect:L,viewBB:H,rfId:$,panZoom:V,translateExtent:Y,flowWidth:P,flowHeight:te,ariaLabelConfig:z}=Re(kT,$e),k=n?.width??IT,A=n?.height??GT,j=L.width/k,I=L.height/A,Q=Math.max(j,I),ne=Q*k,C=Q*A,B=D*Q,ee=L.x-(ne-L.width)/2-B,ae=L.y-(C-L.height)/2-B,ue=ne+B*2,fe=C+B*2,ce=`${VT}-${$}`,re=Z.useRef(0),de=Z.useRef();re.current=Q,Z.useEffect(()=>{if(R.current&&V)return de.current=uN({domNode:R.current,panZoom:V,getTransform:()=>G.getState().transform,getViewScale:()=>re.current}),()=>{de.current?.destroy()}},[V]),Z.useEffect(()=>{de.current?.update({translateExtent:Y,width:P,height:te,inversePan:U,pannable:M,zoomStep:w,zoomable:N})},[M,N,U,w,Y,P,te]);const Ee=x?Se=>{const[Ce,qe]=de.current?.pointer(Se)||[0,0];x(Se,{x:Ce,y:qe})}:void 0,xe=_?Z.useCallback((Se,Ce)=>{const qe=G.getState().nodeLookup.get(Ce).internals.userNode;_(Se,qe)},[]):void 0,ye=T??z["minimap.ariaLabel"];return b.jsx(Br,{position:p,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*Q:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s: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:it(["react-flow__minimap",l]),"data-testid":"rf__minimap",children:b.jsxs("svg",{width:k,height:A,viewBox:`${ee} ${ae} ${ue} ${fe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ce,ref:R,onClick:Ee,children:[ye&&b.jsx("title",{id:ce,children:ye}),b.jsx(qT,{onClick:xe,nodeColor:s,nodeStrokeColor:o,nodeBorderRadius:c,nodeClassName:r,nodeStrokeWidth:d,nodeComponent:g}),b.jsx("path",{className:"react-flow__minimap-mask",d:`M${ee-B},${ae-B}h${ue+B*2}v${fe+B*2}h${-ue-B*2}z
|
|
21
|
+
M${H.x},${H.y}h${H.width}v${H.height}h${-H.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Av.displayName="MiniMap";const XT=Z.memo(Av),ZT=n=>l=>n?`${Math.max(1/l.transform[2],1)}`:void 0,$T={[si.Line]:"right",[si.Handle]:"bottom-right"};function QT({nodeId:n,position:l,variant:o=si.Handle,className:s,style:r=void 0,children:c,color:d,minWidth:g=10,minHeight:m=10,maxWidth:h=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:y=!1,resizeDirection:p,autoScale:x=!0,shouldResize:_,onResizeStart:M,onResize:N,onResizeEnd:T}){const U=av(),w=typeof n=="string"?n:U,D=Ke(),G=Z.useRef(null),R=o===si.Handle,L=Re(Z.useCallback(ZT(R&&x),[R,x]),$e),H=Z.useRef(null),$=l??$T[o];Z.useEffect(()=>{if(!(!G.current||!w))return H.current||(H.current=EN({domNode:G.current,nodeId:w,getStoreItems:()=>{const{nodeLookup:Y,transform:P,snapGrid:te,snapToGrid:z,nodeOrigin:k,domNode:A}=D.getState();return{nodeLookup:Y,transform:P,snapGrid:te,snapToGrid:z,nodeOrigin:k,paneDomNode:A}},onChange:(Y,P)=>{const{triggerNodeChanges:te,nodeLookup:z,parentLookup:k,nodeOrigin:A}=D.getState(),j=[],I={x:Y.x,y:Y.y},Q=z.get(w);if(Q&&Q.expandParent&&Q.parentId){const ne=Q.origin??A,C=Y.width??Q.measured.width??0,B=Y.height??Q.measured.height??0,ee={id:Q.id,parentId:Q.parentId,rect:{width:C,height:B,...A0({x:Y.x??Q.position.x,y:Y.y??Q.position.y},{width:C,height:B},Q.parentId,z,ne)}},ae=cd([ee],z,k,A);j.push(...ae),I.x=Y.x?Math.max(ne[0]*C,Y.x):void 0,I.y=Y.y?Math.max(ne[1]*B,Y.y):void 0}if(I.x!==void 0&&I.y!==void 0){const ne={id:w,type:"position",position:{...I}};j.push(ne)}if(Y.width!==void 0&&Y.height!==void 0){const C={id:w,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:Y.width,height:Y.height}};j.push(C)}for(const ne of P){const C={...ne,type:"position"};j.push(C)}te(j)},onEnd:({width:Y,height:P})=>{const te={id:w,type:"dimensions",resizing:!1,dimensions:{width:Y,height:P}};D.getState().triggerNodeChanges([te])}})),H.current.update({controlPosition:$,boundaries:{minWidth:g,minHeight:m,maxWidth:h,maxHeight:v},keepAspectRatio:y,resizeDirection:p,onResizeStart:M,onResize:N,onResizeEnd:T,shouldResize:_}),()=>{H.current?.destroy()}},[$,g,m,h,v,y,M,N,T,_]);const V=$.split("-");return b.jsx("div",{className:it(["react-flow__resize-control","nodrag",...V,o,s]),ref:G,style:{...r,scale:L,...d&&{[R?"backgroundColor":"borderColor"]:d}},children:c})}Z.memo(QT);const Df=5;function KT({id:n,data:l,selected:o}){const{t:s}=Qe(),r=l,c=oe(z=>z.updateNodePrompt),d=oe(z=>z.addNodeReferences),g=oe(z=>z.removeNodeReference),m=oe(z=>z.generateNode),h=oe(z=>z.addChildNode),v=oe(z=>z.duplicateBranchRoot),y=oe(z=>z.deleteNode),p=Z.useRef(null),[x,_]=Z.useState(!1),M=r.referenceImages??[],N=r.status==="pending"||r.status==="reconciling",T=!r.parentServerNodeId&&!N&&M.length<Df,U=Z.useCallback(z=>c(n,z.target.value),[n,c]),w=Z.useCallback(()=>{m(n)},[n,m]),D=Z.useCallback(()=>{r.status==="ready"&&h(n)},[n,r.status,h]),G=Z.useCallback(()=>{v(n)},[n,v]),R=Z.useCallback(()=>y(n),[n,y]),L=z=>{if(!z)return[];const k=[];for(const A of Array.from(z)){if(A.kind!=="file"||!A.type.startsWith("image/"))continue;const j=A.getAsFile();j&&k.push(j)}return k},H=z=>{if(z.preventDefault(),z.stopPropagation(),_(!1),!T)return;const k=Array.from(z.dataTransfer.files).filter(A=>A.type.startsWith("image/"));k.length>0&&d(n,k)},$=z=>{z.preventDefault(),z.stopPropagation(),T&&!x&&_(!0)},V=z=>{z.currentTarget.contains(z.relatedTarget)||_(!1)},Y=z=>{const k=L(z.clipboardData?.items??null);if(k.length===0||(z.preventDefault(),z.stopPropagation(),!T))return;const A=Df-M.length;d(n,k.slice(0,A))},te=(()=>{switch(r.status){case"empty":return s("node.empty");case"pending":return s("node.pending");case"reconciling":return r.pendingPhase?s("node.reconcilingPhase",{phase:r.pendingPhase}):s("node.reconciling");case"ready":return r.webSearchCalls?s("node.readyWithSearch",{elapsed:r.elapsed??"?",searches:r.webSearchCalls}):s("node.ready",{elapsed:r.elapsed??"?"});case"stale":return r.error?s("node.staleWithError",{error:r.error}):s("node.stale");case"asset-missing":return r.error?s("node.assetMissingWithError",{error:r.error}):s("node.assetMissing");case"error":return s("node.error",{error:r.error??s("node.errorUnknown")});default:return""}})();return b.jsxs("div",{className:`image-node image-node--${r.status}${o?" image-node--selected":""}`,children:[r.parentServerNodeId?b.jsx(ri,{type:"target",position:me.Left,className:"image-node__handle"}):null,b.jsx("div",{className:"image-node__preview",children:r.imageUrl&&r.status!=="asset-missing"?b.jsx("img",{src:r.imageUrl,alt:s("node.nodeImageAlt")}):N&&r.partialImageUrl?b.jsx("img",{className:"image-node__partial",src:r.partialImageUrl,alt:s("node.partialImageAlt")}):N?b.jsx("div",{className:"image-node__skeleton"}):r.status==="asset-missing"?b.jsx("div",{className:"image-node__placeholder",children:s("node.noAsset")}):r.status==="stale"?b.jsx("div",{className:"image-node__placeholder",children:s("node.stateStale")}):b.jsx("div",{className:"image-node__placeholder",children:s("node.noImage")})}),b.jsxs("div",{className:`image-node__composer nodrag${x?" is-dragging":""}`,onDrop:H,onDragOver:$,onDragLeave:V,onPaste:Y,children:[M.length>0?b.jsx("div",{className:"image-node__refs",children:M.map((z,k)=>b.jsxs("div",{className:"image-node__ref-chip",title:s("node.refAlt",{n:k+1}),children:[b.jsx("img",{src:z,alt:s("node.refAlt",{n:k+1})}),b.jsx("button",{type:"button",className:"image-node__ref-remove",onClick:()=>g(n,k),disabled:N,"aria-label":s("node.removeRef",{n:k+1}),children:"×"})]},k))}):null,b.jsx("textarea",{className:"image-node__prompt",value:r.prompt,onChange:U,onKeyDown:z=>z.stopPropagation(),placeholder:r.parentServerNodeId?s("node.editPromptPlaceholder"):s("node.promptPlaceholder"),rows:2,disabled:N}),b.jsxs("div",{className:"image-node__composer-bar",children:[b.jsx("button",{type:"button",className:"image-node__attach",onClick:()=>T&&p.current?.click(),disabled:!T,title:r.parentServerNodeId?s("node.nodeRefsUnsupportedForEdit"):s("node.attachRefTitle"),children:s("node.attachRef")}),x?b.jsx("span",{className:"image-node__drop-hint",children:s("node.dropRefs")}):M.length>0?b.jsxs("span",{className:"image-node__ref-count",children:[M.length,"/",Df]}):null]}),b.jsx("input",{ref:p,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:z=>{const k=Array.from(z.target.files??[]);k.length>0&&d(n,k),z.target.value=""}})]}),b.jsxs("div",{className:"image-node__footer",children:[b.jsx("span",{className:"image-node__status",children:te}),b.jsxs("div",{className:"image-node__actions nodrag",children:[b.jsx("button",{type:"button",onClick:w,disabled:N,children:r.status==="ready"?s("node.regenerate"):s("node.generate")}),r.status==="ready"?b.jsxs(b.Fragment,{children:[b.jsx("button",{type:"button",onClick:D,children:s("node.addChild")}),b.jsx("button",{type:"button",onClick:G,title:s("node.duplicateBranchTitle"),children:s("node.duplicateBranch")})]}):null,b.jsx("button",{type:"button",onClick:R,className:"image-node__del",title:s("node.deleteTitle"),children:"×"})]})]}),b.jsx(ri,{type:"source",position:me.Right,className:"image-node__handle image-node__handle--source"})]})}const FT=Z.memo(KT);function JT(){const{t:n}=Qe(),l=oe(w=>w.graphNodes),o=oe(w=>w.graphEdges),s=oe(w=>w.setGraphNodes),r=oe(w=>w.setGraphEdges),c=oe(w=>w.addRootNode),d=oe(w=>w.addChildNodeAt),g=oe(w=>w.connectNodes),m=oe(w=>w.deleteNodes),h=oe(w=>w.sessionLoading),v=oe(w=>w.resolvedTheme),{screenToFlowPosition:y}=qr(),p=Z.useRef(null),x=Z.useMemo(()=>({imageNode:FT}),[]),_=Z.useCallback(w=>s(J0(w,l)),[l,s]),M=Z.useCallback(w=>r(P0(w,o)),[o,r]),N=Z.useCallback(w=>{w.source&&w.target&&g(w.source,w.target)},[g]),T=Z.useCallback((w,D)=>{if(D.isValid)return;const G=D.fromNode?.id;if(!G)return;const R="touches"in w?w.changedTouches[0].clientX:w.clientX,L="touches"in w?w.changedTouches[0].clientY:w.clientY,H=y({x:R,y:L});d(G,H)},[d,y]),U=Z.useCallback(w=>m(w.map(D=>D.id)),[m]);return b.jsxs("main",{className:"node-canvas",ref:p,children:[h&&b.jsx("div",{className:"node-canvas__loading",children:n("nodeCanvas.loading")}),l.length===0?b.jsx("button",{type:"button",className:"node-canvas__plus",onClick:()=>c(),children:n("nodeCanvas.addFirst")}):b.jsxs(b.Fragment,{children:[b.jsxs(bT,{nodes:l,edges:o,onNodesChange:_,onEdgesChange:M,onConnect:N,onConnectEnd:T,onNodesDelete:U,nodeTypes:x,fitView:!0,deleteKeyCode:["Delete","Backspace"],proOptions:{hideAttribution:!0},children:[b.jsx(NT,{gap:24,color:v==="light"?"#d9dee6":"#2a2a2a"}),b.jsx(RT,{className:"node-canvas__controls"}),b.jsx(XT,{pannable:!0,zoomable:!0,maskColor:v==="light"?"rgba(246, 247, 251, 0.72)":"rgba(10, 10, 10, 0.7)",nodeColor:v==="light"?"#1f2430":"#f0f0f0",nodeStrokeColor:v==="light"?"#ffffff":"#1a1a1a",style:{background:v==="light"?"#ffffff":"#141414",border:`1px solid ${v==="light"?"#d9dee6":"#2a2a2a"}`}})]}),b.jsx("button",{type:"button",className:"node-canvas__add-root",onClick:()=>c(),title:n("nodeCanvas.addRootTitle"),children:"+"}),b.jsx("div",{className:"node-canvas__hint",children:n("nodeCanvas.hint")})]})]})}function PT(){return b.jsx(Ev,{children:b.jsx(JT,{})})}function Gn({title:n,help:l,items:o,value:s,onChange:r}){return b.jsxs("div",{className:"option-group",children:[n?b.jsx("div",{className:"section-title",children:n}):null,b.jsx("div",{className:"option-row",children:o.map(c=>b.jsxs("button",{className:`option-btn${c.value===s?" active":""}`,style:c.color?{color:c.color}:void 0,disabled:c.disabled,onClick:()=>r(c.value),type:"button",children:[c.label,c.sub?b.jsxs(b.Fragment,{children:[b.jsx("br",{}),b.jsx("span",{className:"option-sub",children:c.sub})]}):null]},c.value))}),l?b.jsx("p",{className:"option-help",children:l}):null]})}function oo(n){return n.map(l=>({value:l.value,label:l.label,sub:l.sub}))}function WT(){const n=oe(g=>g.sizePreset),l=oe(g=>g.setSizePreset),o=oe(g=>g.customW),s=oe(g=>g.customH),r=oe(g=>g.setCustomSize),{t:c}=Qe(),d=n==="custom";return b.jsxs("div",{className:"option-group",children:[b.jsx("div",{className:"section-title",children:c("size.title")}),b.jsx(Gn,{title:"",items:oo(xx),value:n,onChange:l}),b.jsx(Gn,{title:"",items:oo(wx),value:n,onChange:l}),b.jsx(Gn,{title:"",items:oo(Ex),value:n,onChange:l}),b.jsx(Gn,{title:"",items:oo(_x),value:n,onChange:l}),b.jsx(Gn,{title:"",items:oo(Nx()),value:n,onChange:l}),d?b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"option-row",children:[b.jsx("input",{type:"number",className:"custom-size-input",min:1024,max:3824,step:16,value:o,onChange:g=>r(parseInt(g.target.value)||1024,s),placeholder:c("size.width")}),b.jsx("span",{style:{color:"var(--text-dim)",alignSelf:"center",fontFamily:"var(--mono)",fontSize:12},children:"x"}),b.jsx("input",{type:"number",className:"custom-size-input",min:1024,max:3824,step:16,value:s,onChange:g=>r(o,parseInt(g.target.value)||1024),placeholder:c("size.height")})]}),b.jsx("div",{className:"size-hint",children:c("size.hint")})]}):null]})}const eC={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 tC(n,l){return eC[n]?.[l]??0}function nC(){const{t:n}=Qe(),l=oe(h=>h.provider),o=oe(h=>h.quality),r=oe(h=>h.getResolvedSize)(),c=l==="oauth",d=tC(o,r),g=c?n("cost.free"):n("cost.approx",{amount:d.toFixed(3)}),m=c?"var(--green)":void 0;return b.jsxs("div",{className:"cost-estimate",children:[b.jsx("span",{children:n("cost.label")}),b.jsx("span",{className:"price",style:m?{color:m}:void 0,children:g})]})}const aC=[{value:"png",label:"PNG"},{value:"jpeg",label:"JPEG"},{value:"webp",label:"WebP"}],lC=[{value:"1",label:"1"},{value:"2",label:"2"},{value:"4",label:"4"}];function iC(){const n=oe(N=>N.rightPanelOpen),l=oe(N=>N.toggleRightPanel),{t:o}=Qe(),[s,r]=Z.useState(typeof window<"u"?window.matchMedia("(max-width: 800px)").matches:!1);Z.useEffect(()=>{if(typeof window>"u")return;const N=window.matchMedia("(max-width: 800px)"),T=()=>r(N.matches);return N.addEventListener("change",T),()=>N.removeEventListener("change",T)},[]);const c=s?n:!0,d=oe(N=>N.quality),g=oe(N=>N.setQuality),m=oe(N=>N.format),h=oe(N=>N.setFormat),v=oe(N=>N.moderation),y=oe(N=>N.setModeration),p=oe(N=>N.count),x=oe(N=>N.setCount),_=[{value:"low",label:o("quality.lowLabel"),sub:o("quality.lowSub")},{value:"medium",label:o("quality.mediumLabel"),sub:o("quality.mediumSub")},{value:"high",label:o("quality.highLabel"),sub:o("quality.highSub")}],M=[{value:"auto",label:o("moderation.autoLabel"),sub:o("moderation.autoSub")},{value:"low",label:o("moderation.lowLabel"),sub:o("moderation.lowSub"),color:"var(--amber)"}];return b.jsxs(b.Fragment,{children:[s&&n?b.jsx("div",{className:"right-panel-backdrop",role:"button","aria-label":o("panel.closeSettings"),onClick:l}):null,b.jsxs("aside",{className:`right-panel${n?"":" collapsed"}${s&&c?" drawer-open":""}`,"aria-label":o("panel.detailSettings"),children:[b.jsx("button",{type:"button",className:"right-panel-toggle","aria-expanded":n,"aria-controls":"right-panel-body",onClick:l,title:o(n?"panel.toggleHide":"panel.toggleShow"),children:s?o(n?"panel.close":"panel.open"):n?">":"<"}),b.jsxs("div",{id:"right-panel-body",className:"right-panel-body",hidden:!n,children:[b.jsx("div",{className:"section-title",children:o("panel.detailSettings")}),b.jsx(Gn,{title:o("quality.title"),items:_,value:d,onChange:g}),b.jsx(WT,{}),b.jsx(Gn,{title:o("format.title"),items:aC,value:m,onChange:h}),b.jsx(Gn,{title:o("moderation.title"),items:M,value:v,onChange:y}),b.jsx("p",{className:"option-help",children:o("moderation.explain")}),b.jsx(Gn,{title:o("count.title"),items:lC,value:String(p),onChange:N=>x(Number(N))}),b.jsx(nC,{})]})]})]})}function oC(){const[n,l]=Z.useState(null),[o,s]=Z.useState(!1);return Z.useEffect(()=>{let r=!1;return ZS().then(c=>{r||l(c)}).catch(()=>{r||s(!0)}),()=>{r=!0}},[]),{data:n,error:o}}function sC(){const[n,l]=Z.useState(null);return Z.useEffect(()=>{let o=!1,s=null;const r=async()=>{try{const c=await XS();if(o)return;l(c),c.status==="starting"&&(s=setTimeout(r,3e3))}catch{o||l(null)}};return r(),()=>{o=!0,s&&clearTimeout(s)}},[]),n}function rC(n){return n==="ready"?"Ready":n==="auth_required"?"Login required":n==="starting"?"Starting":n==="offline"?"Offline":"Checking"}function uC(){const{t:n}=Qe(),l=sC(),{data:o,error:s}=oC(),r=o?.apiKeySource==="env"||o?.apiKeySource==="config"||o?.apiKeyValid===!0,c=l?.status==="ready",d=o?.apiKeySource==="config"?n("settings.account.apiSourceConfig"):n("settings.account.apiSourceEnv");return b.jsxs(b.Fragment,{children:[b.jsxs("article",{className:"settings-row",children:[b.jsxs("div",{className:"settings-row__copy",children:[b.jsx("p",{className:"settings-eyebrow",children:n("settings.account.primaryEyebrow")}),b.jsx("h4",{children:n("settings.account.oauthTitle")}),b.jsx("p",{children:n("settings.account.oauthBody")})]}),b.jsxs("div",{className:`settings-status${c?" is-ok":""}`,children:[b.jsx("span",{"aria-hidden":"true"}),rC(l?.status)]})]}),r?b.jsxs("article",{className:"settings-row",children:[b.jsxs("div",{className:"settings-row__copy",children:[b.jsx("p",{className:"settings-eyebrow",children:d}),b.jsx("h4",{children:n("settings.account.apiTitle")}),b.jsx("p",{children:n("settings.account.apiBody")})]}),b.jsxs("div",{className:"settings-status is-muted",children:[b.jsx("span",{"aria-hidden":"true"}),n(s?"settings.account.apiUnknown":"settings.account.apiDisabled")]})]}):null]})}const cC={ko:"KO",en:"EN"};function fC(){const{t:n,locale:l}=Qe(),o=oe(s=>s.setLocale);return b.jsx("div",{className:"lang-toggle",role:"group","aria-label":n("language.label"),children:vx.map(s=>b.jsx("button",{type:"button",className:`lang-toggle__btn ${l===s?"is-active":""}`,onClick:()=>o(s),"aria-pressed":l===s,title:n(`language.${s}`),children:b.jsx("span",{className:"lang-toggle__label",children:cC[s]})},s))})}const dC=["system","dark","light"];function hC(){const{t:n}=Qe(),l=oe(s=>s.theme),o=oe(s=>s.setTheme);return b.jsx("div",{className:"theme-toggle",role:"group","aria-label":n("theme.label"),children:dC.map(s=>b.jsx("button",{type:"button",className:`theme-toggle__btn ${l===s?"is-active":""}`,onClick:()=>o(s),"aria-pressed":l===s,title:n(`theme.${s}`),children:n(`theme.${s}`)},s))})}const Rf=["account","appearance","language","future"];function fr({id:n,setRef:l,children:o}){const{t:s}=Qe();return b.jsxs("section",{id:n,ref:r=>l(n,r),className:"settings-section","aria-labelledby":`settings-section-${n}`,children:[b.jsx("header",{className:"settings-section__header",children:b.jsxs("div",{children:[b.jsx("h3",{id:`settings-section-${n}`,children:s(`settings.sections.${n}.title`)}),b.jsx("p",{children:s(`settings.sections.${n}.hint`)})]})}),b.jsx("div",{className:"settings-section__body",children:o})]})}function gC(){const{t:n}=Qe(),l=oe(v=>v.activeSettingsSection),o=oe(v=>v.setActiveSettingsSection),s=oe(v=>v.closeSettings),r=Z.useRef(null),c=Z.useRef(null),d=Z.useRef(!1),g=Z.useRef({account:null,appearance:null,language:null,future:null}),m=(v,y)=>{g.current[v]=y},h=v=>{o(v),d.current=!0,g.current[v]?.scrollIntoView({behavior:"auto",block:"start"}),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{d.current=!1,c.current=null},120)};return Z.useEffect(()=>{const v=y=>{y.key==="Escape"&&s()};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[s]),Z.useEffect(()=>{const v=r.current;if(!v||typeof IntersectionObserver!="function")return;const y=new IntersectionObserver(p=>{if(d.current)return;const _=p.filter(M=>M.isIntersecting).sort((M,N)=>N.intersectionRatio-M.intersectionRatio)[0]?.target.id;_&&Rf.includes(_)&&o(_)},{root:v,threshold:[.35,.6]});for(const p of Rf){const x=g.current[p];x&&y.observe(x)}return()=>y.disconnect()},[o]),Z.useEffect(()=>()=>{c.current!==null&&window.clearTimeout(c.current)},[]),b.jsx("main",{ref:r,className:"settings-workspace","aria-labelledby":"settings-title",children:b.jsxs("div",{className:"settings-shell",children:[b.jsxs("header",{className:"settings-header",children:[b.jsxs("div",{children:[b.jsx("p",{className:"settings-eyebrow",children:n("settings.eyebrow")}),b.jsx("h2",{id:"settings-title",children:n("settings.title")}),b.jsx("p",{children:n("settings.subtitle")})]}),b.jsx("button",{type:"button",className:"settings-close",onClick:s,"aria-label":n("settings.closeAria"),title:n("settings.closeTitle"),children:"X"})]}),b.jsxs("div",{className:"settings-layout",children:[b.jsx("nav",{className:"settings-nav","aria-label":n("settings.navAria"),children:Rf.map(v=>b.jsxs("button",{type:"button",className:`settings-nav__item${l===v?" is-active":""}`,onClick:()=>h(v),"aria-label":n("settings.jumpTo",{section:n(`settings.sections.${v}.title`)}),children:[b.jsx("span",{children:n(`settings.sections.${v}.title`)}),b.jsx("small",{children:n(`settings.sections.${v}.hint`)})]},v))}),b.jsxs("section",{className:"settings-content","aria-label":n("settings.contentAria"),children:[b.jsx(fr,{id:"account",setRef:m,children:b.jsx(uC,{})}),b.jsx(fr,{id:"appearance",setRef:m,children:b.jsxs("article",{className:"settings-row",children:[b.jsxs("div",{className:"settings-row__copy",children:[b.jsx("h4",{children:n("settings.appearance.themeTitle")}),b.jsx("p",{children:n("settings.appearance.themeBody")})]}),b.jsx("div",{className:"settings-row__control",children:b.jsx(hC,{})})]})}),b.jsx(fr,{id:"language",setRef:m,children:b.jsxs("article",{className:"settings-row",children:[b.jsxs("div",{className:"settings-row__copy",children:[b.jsx("h4",{children:n("settings.language.title")}),b.jsx("p",{children:n("settings.language.body")})]}),b.jsx("div",{className:"settings-row__control",children:b.jsx(fC,{})})]})}),b.jsx(fr,{id:"future",setRef:m,children:b.jsxs("article",{className:"settings-note",children:[b.jsx("h4",{children:n("settings.future.title")}),b.jsx("p",{children:n("settings.future.body")})]})})]})]})]})})}function mC(){const n=oe(r=>r.toast),[l,o]=Z.useState(!1);if(Z.useEffect(()=>{if(!n)return;o(!0);const r=setTimeout(()=>o(!1),3e3);return()=>clearTimeout(r)},[n]),!n)return null;const s=["toast",l?"visible":"",n.error?"error":""].filter(Boolean).join(" ");return b.jsx("div",{className:s,children:n.message})}function pC(){const{t:n}=Qe(),l=oe(y=>y.errorCard),o=oe(y=>y.dismissErrorCard);if(!l)return null;const s=fo[l.code]??fo.UNKNOWN,r=`${s.cardKey??"errorCard.unknown"}.title`,c=`${s.cardKey??"errorCard.unknown"}.body`,d=s.cta?`${s.cardKey??"errorCard.unknown"}.cta`:null,g=n(r),m=n(c),h=d?n(d):null,v=()=>{if(s.cta==="reload"){window.location.reload();return}else o()};return b.jsx("div",{className:"error-card-backdrop",role:"alertdialog","aria-labelledby":"error-card-title",children:b.jsxs("div",{className:"error-card",children:[b.jsx("div",{className:"error-card__icon","aria-hidden":"true",children:b.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[b.jsx("circle",{cx:"12",cy:"12",r:"10"}),b.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),b.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),b.jsxs("div",{className:"error-card__content",children:[b.jsx("h3",{id:"error-card-title",className:"error-card__title",children:g}),b.jsx("p",{className:"error-card__body",children:m}),l.fallbackMessage&&b.jsxs("details",{className:"error-card__details",children:[b.jsx("summary",{children:n("errorCard.details")}),b.jsx("pre",{children:l.fallbackMessage})]}),b.jsxs("div",{className:"error-card__actions",children:[b.jsx("button",{type:"button",className:"btn btn--ghost",onClick:o,children:n("errorCard.close")}),h&&b.jsx("button",{type:"button",className:"btn btn--primary",onClick:v,children:h})]})]})]})})}function yC(n){if(!n)return"earlier";const l=new Date(n);if(Number.isNaN(l.getTime()))return"earlier";const s=Math.floor((new Date().getTime()-l.getTime())/864e5);return s===0?"today":s===1?"yesterday":s<7?"thisWeek":l.toLocaleDateString("ko-KR",{year:"numeric",month:"short",day:"numeric"})}function vC(){const{t:n}=Qe(),l=oe(V=>V.galleryOpen),o=oe(V=>V.closeGallery),s=oe(V=>V.history),r=oe(V=>V.selectHistory),c=oe(V=>V.currentImage),d=oe(V=>V.removeFromHistory),g=oe(V=>V.addHistoryItem),[m,h]=Z.useState(""),[v,y]=Z.useState("date"),[p,x]=Z.useState([]),[_,M]=Z.useState([]),[N,T]=Z.useState(null);Z.useEffect(()=>{if(!l)return;const V=Y=>{Y.key==="Escape"&&o()};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[l,o]),Z.useEffect(()=>{l||(h(""),T(null))},[l]),Z.useEffect(()=>{if(!l||v!=="session")return;let V=!1;return(async()=>{try{const Y=await QS({limit:500});if(V)return;const P=te=>{const z=te.kind,k=z==="classic"||z==="edit"||z==="generate"?z:null;return{image:te.url,url:te.url,filename:te.filename,prompt:te.prompt??void 0,size:te.size??void 0,quality:te.quality??void 0,provider:te.provider,createdAt:te.createdAt,sessionId:te.sessionId??null,nodeId:te.nodeId??null,clientNodeId:te.clientNodeId??null,kind:k}};x(Y.sessions.map(te=>({sessionId:te.sessionId,title:te.title??null,label:te.label??null,displayLabel:te.title||te.label||te.sessionId.slice(0,8),items:te.items.map(P)}))),M(Y.loose.map(P))}catch{}})(),()=>{V=!0}},[l,v]);const U=Z.useMemo(()=>{const V=m.trim().toLowerCase().normalize("NFC");return V?s.filter(Y=>(Y.prompt??"").toLowerCase().normalize("NFC").includes(V)||(Y.filename??"").toLowerCase().normalize("NFC").includes(V)):s},[s,m]),w=Z.useMemo(()=>{const V=new Map;for(const Y of U){const P=yC(Y.createdAt);V.has(P)||V.set(P,[]),V.get(P).push(Y)}return Array.from(V.entries())},[U]);Z.useEffect(()=>{if(!N)return;const V=setInterval(()=>{T(Y=>!Y||Date.now()>=Y.expiresAt?null:{...Y})},500);return()=>clearInterval(V)},[N]);async function D(V,Y){if(Y.stopPropagation(),!!V.filename)try{const P=await KS(V.filename);d(V.filename),T({filename:V.filename,trashId:P.trashId,item:V,expiresAt:Date.now()+9500})}catch(P){console.error("[gallery] delete failed",P)}}async function G(){if(N)try{await FS(N.filename,N.trashId),g(N.item)}catch(V){console.error("[gallery] restore failed",V)}finally{T(null)}}if(!l)return null;const R=V=>V==="earlier"||V==="today"||V==="yesterday"||V==="thisWeek"?n(`gallery.${V}`):V,L=(V,Y,P)=>{const te=c?.image===V.image;return b.jsxs("div",{className:`gallery__tile-wrap${te?" gallery__tile-wrap--active":""}`,children:[b.jsxs("button",{type:"button",className:`gallery__tile${te?" gallery__tile--active":""}`,onClick:()=>{r(V),o()},title:V.prompt??"",children:[b.jsx("img",{src:V.thumb||V.image,alt:V.prompt??n("gallery.imageAltFallback"),loading:"lazy",decoding:"async"}),V.prompt&&b.jsx("div",{className:"gallery__caption",children:b.jsx("span",{className:"gallery__caption-text",children:V.prompt})})]}),V.filename&&b.jsx("button",{type:"button",className:"gallery__delete",onClick:z=>D(V,z),title:n("gallery.deleteTitle"),"aria-label":n("gallery.deleteAria"),children:"×"})]},`${Y}-${P}-${V.filename??P}`)},H=v==="session",$=H?p.reduce((V,Y)=>V+Y.items.length,0)+_.length:U.length;return b.jsx("div",{className:"gallery-backdrop",onClick:o,role:"presentation",children:b.jsxs("div",{className:"gallery",role:"dialog","aria-modal":"true","aria-label":n("gallery.ariaLabel"),onClick:V=>V.stopPropagation(),children:[b.jsxs("div",{className:"gallery__header",children:[b.jsxs("div",{className:"gallery__title-row",children:[b.jsx("div",{className:"gallery__title",children:n("gallery.title")}),b.jsxs("div",{className:"gallery__meta",children:[n("gallery.total",{n:$}),m?n("gallery.totalFiltered",{n:s.length}):""]}),b.jsxs("div",{className:"gallery__group-toggle",role:"tablist","aria-label":n("gallery.sortByAria"),children:[b.jsx("button",{type:"button",role:"tab","aria-selected":v==="date",className:v==="date"?"active":"",onClick:()=>y("date"),children:n("gallery.sortByDate")}),b.jsx("button",{type:"button",role:"tab","aria-selected":v==="session",className:v==="session"?"active":"",onClick:()=>y("session"),children:n("gallery.sortBySession")})]})]}),b.jsx("input",{type:"text",className:"gallery__search",placeholder:n(H?"gallery.searchDisabledPlaceholder":"gallery.searchPlaceholder"),value:m,onChange:V=>h(V.target.value),autoFocus:!0,disabled:H}),b.jsx("button",{type:"button",className:"gallery__close",onClick:o,"aria-label":n("gallery.closeAria"),title:n("gallery.closeTitle"),children:"×"})]}),b.jsx("div",{className:"gallery__scroll",children:H?b.jsxs(b.Fragment,{children:[p.map(V=>b.jsxs("section",{className:"gallery__group",children:[b.jsxs("header",{className:"gallery__group-header",children:[b.jsx("span",{className:"gallery__group-label",title:V.sessionId,children:V.title?V.displayLabel:n("gallery.sessionLabel",{name:V.displayLabel})}),b.jsx("span",{className:"gallery__group-count",children:V.items.length})]}),b.jsx("div",{className:"gallery__grid",children:V.items.map((Y,P)=>L(Y,V.sessionId,P))})]},V.sessionId)),_.length>0&&b.jsxs("section",{className:"gallery__group",children:[b.jsxs("header",{className:"gallery__group-header",children:[b.jsx("span",{className:"gallery__group-label",children:n("gallery.standalone")}),b.jsx("span",{className:"gallery__group-count",children:_.length})]}),b.jsx("div",{className:"gallery__grid",children:_.map((V,Y)=>L(V,"loose",Y))})]}),p.length===0&&_.length===0&&b.jsx("div",{className:"gallery__empty",children:n("gallery.emptySessions")})]}):U.length===0?b.jsx("div",{className:"gallery__empty",children:s.length===0?n("gallery.emptyAll"):n("gallery.noResults")}):w.map(([V,Y])=>b.jsxs("section",{className:"gallery__group",children:[b.jsxs("header",{className:"gallery__group-header",children:[b.jsx("span",{className:"gallery__group-label",children:R(V)}),b.jsx("span",{className:"gallery__group-count",children:Y.length})]}),b.jsx("div",{className:"gallery__grid",children:Y.map((P,te)=>L(P,V,te))})]},V))}),N&&b.jsxs("div",{className:"gallery__undo",children:[b.jsx("span",{children:n("gallery.deleted",{filename:N.filename})}),b.jsx("button",{type:"button",onClick:G,children:n("gallery.undo")}),b.jsx("span",{className:"gallery__undo-timer",children:n("gallery.secondsSuffix",{n:Math.max(0,Math.ceil((N.expiresAt-Date.now())/1e3))})})]})]})})}function SC(){const n=oe(p=>p.hydrateHistory),l=oe(p=>p.loadSessions),o=oe(p=>p.startInFlightPolling),s=oe(p=>p.reconcileInflight),r=oe(p=>p.syncFromStorage),c=oe(p=>p.theme),d=oe(p=>p.resolvedTheme),g=oe(p=>p.settingsOpen),m=oe(p=>p.syncThemeFromStorage),h=oe(p=>p.refreshResolvedTheme),y=oe(p=>p.uiMode);return Z.useEffect(()=>{n(),l(),s(),o()},[n,l,s,o]),Z.useEffect(()=>{const p=x=>{x.key&&(x.key==="ima2.inFlight"||x.key==="ima2.selectedFilename"?r():x.key==="ima2:theme"&&m())};return window.addEventListener("storage",p),()=>window.removeEventListener("storage",p)},[r,m]),Z.useEffect(()=>{document.documentElement.dataset.theme=d,document.documentElement.style.colorScheme=d},[d]),Z.useEffect(()=>{if(c!=="system")return;const p=window.matchMedia("(prefers-color-scheme: light)");return p.addEventListener("change",h),()=>p.removeEventListener("change",h)},[h,c]),Z.useEffect(()=>{const p=()=>{jx(oe.getState)};return window.addEventListener("beforeunload",p),document.addEventListener("visibilitychange",p),()=>{window.removeEventListener("beforeunload",p),document.removeEventListener("visibilitychange",p)}},[]),b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:`app${g?" app--settings-open":""}`,"data-theme":d,children:[b.jsx(kx,{}),g?b.jsx(gC,{}):y==="classic"?b.jsx(Xx,{}):b.jsx(PT,{}),b.jsx(iC,{})]}),b.jsx(mC,{}),b.jsx(pC,{}),b.jsx(vC,{})]})}IS.createRoot(document.getElementById("root")).render(b.jsx(Z.StrictMode,{children:b.jsx(SC,{})}));
|
|
22
|
+
//# sourceMappingURL=index-DRST1V_0.js.map
|