(function(){const S=document.createElement("link").relList;if(S&&S.supports&&S.supports("modulepreload"))return;for(const O of document.querySelectorAll('link[rel="modulepreload"]'))s(O);new MutationObserver(O=>{for(const D of O)if(D.type==="childList")for(const T of D.addedNodes)T.tagName==="LINK"&&T.rel==="modulepreload"&&s(T)}).observe(document,{childList:!0,subtree:!0});function z(O){const D={};return O.integrity&&(D.integrity=O.integrity),O.referrerPolicy&&(D.referrerPolicy=O.referrerPolicy),O.crossOrigin==="use-credentials"?D.credentials="include":O.crossOrigin==="anonymous"?D.credentials="omit":D.credentials="same-origin",D}function s(O){if(O.ep)return;O.ep=!0;const D=z(O);fetch(O.href,D)}})();var gf={exports:{}},Dn={};var Nr;function sy(){if(Nr)return Dn;Nr=1;var o=Symbol.for("react.transitional.element"),S=Symbol.for("react.fragment");function z(s,O,D){var T=null;if(D!==void 0&&(T=""+D),O.key!==void 0&&(T=""+O.key),"key"in O){D={};for(var w in O)w!=="key"&&(D[w]=O[w])}else D=O;return O=D.ref,{$$typeof:o,type:s,key:T,ref:O!==void 0?O:null,props:D}}return Dn.Fragment=S,Dn.jsx=z,Dn.jsxs=z,Dn}var Ar;function oy(){return Ar||(Ar=1,gf.exports=sy()),gf.exports}var c=oy(),Sf={exports:{}},I={};var _r;function dy(){if(_r)return I;_r=1;var o=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),T=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),U=Symbol.iterator;function ll(h){return h===null||typeof h!="object"?null:(h=U&&h[U]||h["@@iterator"],typeof h=="function"?h:null)}var W={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vl=Object.assign,Yl={};function gl(h,A,q){this.props=h,this.context=A,this.refs=Yl,this.updater=q||W}gl.prototype.isReactComponent={},gl.prototype.setState=function(h,A){if(typeof h!="object"&&typeof h!="function"&&h!=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,h,A,"setState")},gl.prototype.forceUpdate=function(h){this.updater.enqueueForceUpdate(this,h,"forceUpdate")};function _l(){}_l.prototype=gl.prototype;function dl(h,A,q){this.props=h,this.context=A,this.refs=Yl,this.updater=q||W}var el=dl.prototype=new _l;el.constructor=dl,vl(el,gl.prototype),el.isPureReactComponent=!0;var Sl=Array.isArray;function Nl(){}var C={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function B(h,A,q){var Y=q.ref;return{$$typeof:o,type:h,key:A,ref:Y!==void 0?Y:null,props:q}}function $(h,A){return B(h.type,A,h.props)}function sl(h){return typeof h=="object"&&h!==null&&h.$$typeof===o}function jl(h){var A={"=":"=0",":":"=2"};return"$"+h.replace(/[=:]/g,function(q){return A[q]})}var at=/\/+/g;function tt(h,A){return typeof h=="object"&&h!==null&&h.key!=null?jl(""+h.key):A.toString(36)}function Cl(h){switch(h.status){case"fulfilled":return h.value;case"rejected":throw h.reason;default:switch(typeof h.status=="string"?h.then(Nl,Nl):(h.status="pending",h.then(function(A){h.status==="pending"&&(h.status="fulfilled",h.value=A)},function(A){h.status==="pending"&&(h.status="rejected",h.reason=A)})),h.status){case"fulfilled":return h.value;case"rejected":throw h.reason}}throw h}function j(h,A,q,Y,F){var al=typeof h;(al==="undefined"||al==="boolean")&&(h=null);var rl=!1;if(h===null)rl=!0;else switch(al){case"bigint":case"string":case"number":rl=!0;break;case"object":switch(h.$$typeof){case o:case S:rl=!0;break;case V:return rl=h._init,j(rl(h._payload),A,q,Y,F)}}if(rl)return F=F(h),rl=Y===""?"."+tt(h,0):Y,Sl(F)?(q="",rl!=null&&(q=rl.replace(at,"$&/")+"/"),j(F,A,q,"",function(k){return k})):F!=null&&(sl(F)&&(F=$(F,q+(F.key==null||h&&h.key===F.key?"":(""+F.key).replace(at,"$&/")+"/")+rl)),A.push(F)),1;rl=0;var Kl=Y===""?".":Y+":";if(Sl(h))for(var Ul=0;Ul>>1,nl=j[K];if(0>>1;KO(q,M))YO(F,q)?(j[K]=F,j[Y]=M,K=Y):(j[K]=q,j[A]=M,K=A);else if(YO(F,M))j[K]=F,j[Y]=M,K=Y;else break l}}return R}function O(j,R){var M=j.sortIndex-R.sortIndex;return M!==0?M:j.id-R.id}if(o.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var D=performance;o.unstable_now=function(){return D.now()}}else{var T=Date,w=T.now();o.unstable_now=function(){return T.now()-w}}var H=[],b=[],V=1,E=null,U=3,ll=!1,W=!1,vl=!1,Yl=!1,gl=typeof setTimeout=="function"?setTimeout:null,_l=typeof clearTimeout=="function"?clearTimeout:null,dl=typeof setImmediate<"u"?setImmediate:null;function el(j){for(var R=z(b);R!==null;){if(R.callback===null)s(b);else if(R.startTime<=j)s(b),R.sortIndex=R.expirationTime,S(H,R);else break;R=z(b)}}function Sl(j){if(vl=!1,el(j),!W)if(z(H)!==null)W=!0,Nl||(Nl=!0,jl());else{var R=z(b);R!==null&&Cl(Sl,R.startTime-j)}}var Nl=!1,C=-1,Z=5,B=-1;function $(){return Yl?!0:!(o.unstable_now()-Bj&&$());){var K=E.callback;if(typeof K=="function"){E.callback=null,U=E.priorityLevel;var nl=K(E.expirationTime<=j);if(j=o.unstable_now(),typeof nl=="function"){E.callback=nl,el(j),R=!0;break t}E===z(H)&&s(H),el(j)}else s(H);E=z(H)}if(E!==null)R=!0;else{var h=z(b);h!==null&&Cl(Sl,h.startTime-j),R=!1}}break l}finally{E=null,U=M,ll=!1}R=void 0}}finally{R?jl():Nl=!1}}}var jl;if(typeof dl=="function")jl=function(){dl(sl)};else if(typeof MessageChannel<"u"){var at=new MessageChannel,tt=at.port2;at.port1.onmessage=sl,jl=function(){tt.postMessage(null)}}else jl=function(){gl(sl,0)};function Cl(j,R){C=gl(function(){j(o.unstable_now())},R)}o.unstable_IdlePriority=5,o.unstable_ImmediatePriority=1,o.unstable_LowPriority=4,o.unstable_NormalPriority=3,o.unstable_Profiling=null,o.unstable_UserBlockingPriority=2,o.unstable_cancelCallback=function(j){j.callback=null},o.unstable_forceFrameRate=function(j){0>j||125K?(j.sortIndex=M,S(b,j),z(H)===null&&j===z(b)&&(vl?(_l(C),C=-1):vl=!0,Cl(Sl,M-K))):(j.sortIndex=nl,S(H,j),W||ll||(W=!0,Nl||(Nl=!0,jl()))),j},o.unstable_shouldYield=$,o.unstable_wrapCallback=function(j){var R=U;return function(){var M=U;U=R;try{return j.apply(this,arguments)}finally{U=M}}}})(jf)),jf}var Dr;function hy(){return Dr||(Dr=1,pf.exports=ry()),pf.exports}var xf={exports:{}},lt={};var Cr;function my(){if(Cr)return lt;Cr=1;var o=Tf();function S(H){var b="https://react.dev/errors/"+H;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(S){console.error(S)}}return o(),xf.exports=my(),xf.exports}var Hr;function vy(){if(Hr)return Cn;Hr=1;var o=hy(),S=Tf(),z=yy();function s(l){var t="https://react.dev/errors/"+l;if(1nl||(l.current=K[nl],K[nl]=null,nl--)}function q(l,t){nl++,K[nl]=l.current,l.current=t}var Y=h(null),F=h(null),al=h(null),rl=h(null);function Kl(l,t){switch(q(al,t),q(F,l),q(Y,null),t.nodeType){case 9:case 11:l=(l=t.documentElement)&&(l=l.namespaceURI)?$d(l):0;break;default:if(l=t.tagName,t=t.namespaceURI)t=$d(t),l=Wd(t,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}A(Y),q(Y,l)}function Ul(){A(Y),A(F),A(al)}function k(l){l.memoizedState!==null&&q(rl,l);var t=Y.current,e=Wd(t,l.type);t!==e&&(q(F,l),q(Y,e))}function Jl(l){F.current===l&&(A(Y),A(F)),rl.current===l&&(A(rl),An._currentValue=M)}var ce,Ie;function Ue(l){if(ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ce=t&&t[1]||"",Ie=-1)":-1n||d[a]!==v[n]){var x=` `+d[a].replace(" at new "," at ");return l.displayName&&x.includes("")&&(x=x.replace("",l.displayName)),x}while(1<=a&&0<=n);break}}}finally{Pu=!1,Error.prepareStackTrace=e}return(e=l?l.displayName||l.name:"")?Ue(e):""}function Xr(l,t){switch(l.tag){case 26:case 27:case 5:return Ue(l.type);case 16:return Ue("Lazy");case 13:return l.child!==t&&t!==null?Ue("Suspense Fallback"):Ue("Suspense");case 19:return Ue("SuspenseList");case 0:case 15:return li(l.type,!1);case 11:return li(l.type.render,!1);case 1:return li(l.type,!0);case 31:return Ue("Activity");default:return""}}function Ef(l){try{var t="",e=null;do t+=Xr(l,e),e=l,l=l.return;while(l);return t}catch(a){return` Error generating stack: `+a.message+` `+a.stack}}var ti=Object.prototype.hasOwnProperty,ei=o.unstable_scheduleCallback,ai=o.unstable_cancelCallback,Qr=o.unstable_shouldYield,Zr=o.unstable_requestPaint,mt=o.unstable_now,Lr=o.unstable_getCurrentPriorityLevel,Nf=o.unstable_ImmediatePriority,Af=o.unstable_UserBlockingPriority,Hn=o.unstable_NormalPriority,Vr=o.unstable_LowPriority,_f=o.unstable_IdlePriority,Kr=o.log,Jr=o.unstable_setDisableYieldValue,Ya=null,yt=null;function fe(l){if(typeof Kr=="function"&&Jr(l),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(Ya,l)}catch{}}var vt=Math.clz32?Math.clz32:$r,wr=Math.log,kr=Math.LN2;function $r(l){return l>>>=0,l===0?32:31-(wr(l)/kr|0)|0}var Rn=256,qn=262144,Bn=4194304;function He(l){var t=l&42;if(t!==0)return t;switch(l&-l){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 l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function Yn(l,t,e){var a=l.pendingLanes;if(a===0)return 0;var n=0,u=l.suspendedLanes,i=l.pingedLanes;l=l.warmLanes;var f=a&134217727;return f!==0?(a=f&~u,a!==0?n=He(a):(i&=f,i!==0?n=He(i):e||(e=f&~l,e!==0&&(n=He(e))))):(f=a&~u,f!==0?n=He(f):i!==0?n=He(i):e||(e=a&~l,e!==0&&(n=He(e)))),n===0?0:t!==0&&t!==n&&(t&u)===0&&(u=n&-n,e=t&-t,u>=e||u===32&&(e&4194048)!==0)?t:n}function Ga(l,t){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&t)===0}function Wr(l,t){switch(l){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 Of(){var l=Bn;return Bn<<=1,(Bn&62914560)===0&&(Bn=4194304),l}function ni(l){for(var t=[],e=0;31>e;e++)t.push(l);return t}function Xa(l,t){l.pendingLanes|=t,t!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function Fr(l,t,e,a,n,u){var i=l.pendingLanes;l.pendingLanes=e,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=e,l.entangledLanes&=e,l.errorRecoveryDisabledLanes&=e,l.shellSuspendCounter=0;var f=l.entanglements,d=l.expirationTimes,v=l.hiddenUpdates;for(e=i&~e;0"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var ah=/[\n"\\]/g;function Et(l){return l.replace(ah,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function oi(l,t,e,a,n,u,i,f){l.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?l.type=i:l.removeAttribute("type"),t!=null?i==="number"?(t===0&&l.value===""||l.value!=t)&&(l.value=""+Tt(t)):l.value!==""+Tt(t)&&(l.value=""+Tt(t)):i!=="submit"&&i!=="reset"||l.removeAttribute("value"),t!=null?di(l,i,Tt(t)):e!=null?di(l,i,Tt(e)):a!=null&&l.removeAttribute("value"),n==null&&u!=null&&(l.defaultChecked=!!u),n!=null&&(l.checked=n&&typeof n!="function"&&typeof n!="symbol"),f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?l.name=""+Tt(f):l.removeAttribute("name")}function Zf(l,t,e,a,n,u,i,f){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(l.type=u),t!=null||e!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){si(l);return}e=e!=null?""+Tt(e):"",t=t!=null?""+Tt(t):e,f||t===l.value||(l.value=t),l.defaultValue=t}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,l.checked=f?l.checked:!!a,l.defaultChecked=!!a,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(l.name=i),si(l)}function di(l,t,e){t==="number"&&Qn(l.ownerDocument)===l||l.defaultValue===""+e||(l.defaultValue=""+e)}function na(l,t,e,a){if(l=l.options,t){t={};for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vi=!1;if(Vt)try{var Va={};Object.defineProperty(Va,"passive",{get:function(){vi=!0}}),window.addEventListener("test",Va,Va),window.removeEventListener("test",Va,Va)}catch{vi=!1}var oe=null,gi=null,Ln=null;function $f(){if(Ln)return Ln;var l,t=gi,e=t.length,a,n="value"in oe?oe.value:oe.textContent,u=n.length;for(l=0;l=wa),ts=" ",es=!1;function as(l,t){switch(l){case"keyup":return Dh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ns(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var fa=!1;function Uh(l,t){switch(l){case"compositionend":return ns(t);case"keypress":return t.which!==32?null:(es=!0,ts);case"textInput":return l=t.data,l===ts&&es?null:l;default:return null}}function Hh(l,t){if(fa)return l==="compositionend"||!xi&&as(l,t)?(l=$f(),Ln=gi=oe=null,fa=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:e,offset:t-l};l=a}l:{for(;e;){if(e.nextSibling){e=e.nextSibling;break l}e=e.parentNode}e=void 0}e=rs(e)}}function ms(l,t){return l&&t?l===t?!0:l&&l.nodeType===3?!1:t&&t.nodeType===3?ms(l,t.parentNode):"contains"in l?l.contains(t):l.compareDocumentPosition?!!(l.compareDocumentPosition(t)&16):!1:!1}function ys(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var t=Qn(l.document);t instanceof l.HTMLIFrameElement;){try{var e=typeof t.contentWindow.location.href=="string"}catch{e=!1}if(e)l=t.contentWindow;else break;t=Qn(l.document)}return t}function Ei(l){var t=l&&l.nodeName&&l.nodeName.toLowerCase();return t&&(t==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||t==="textarea"||l.contentEditable==="true")}var Zh=Vt&&"documentMode"in document&&11>=document.documentMode,sa=null,Ni=null,Fa=null,Ai=!1;function vs(l,t,e){var a=e.window===e?e.document:e.nodeType===9?e:e.ownerDocument;Ai||sa==null||sa!==Qn(a)||(a=sa,"selectionStart"in a&&Ei(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Fa&&Wa(Fa,a)||(Fa=a,a=qu(Ni,"onSelect"),0>=i,n-=i,Yt=1<<32-vt(t)+n|e<tl?(fl=X,X=null):fl=X.sibling;var ml=g(m,X,y[tl],N);if(ml===null){X===null&&(X=fl);break}l&&X&&ml.alternate===null&&t(m,X),r=u(ml,r,tl),hl===null?L=ml:hl.sibling=ml,hl=ml,X=fl}if(tl===y.length)return e(m,X),ol&&Jt(m,tl),L;if(X===null){for(;tltl?(fl=X,X=null):fl=X.sibling;var Ce=g(m,X,ml.value,N);if(Ce===null){X===null&&(X=fl);break}l&&X&&Ce.alternate===null&&t(m,X),r=u(Ce,r,tl),hl===null?L=Ce:hl.sibling=Ce,hl=Ce,X=fl}if(ml.done)return e(m,X),ol&&Jt(m,tl),L;if(X===null){for(;!ml.done;tl++,ml=y.next())ml=_(m,ml.value,N),ml!==null&&(r=u(ml,r,tl),hl===null?L=ml:hl.sibling=ml,hl=ml);return ol&&Jt(m,tl),L}for(X=a(X);!ml.done;tl++,ml=y.next())ml=p(X,m,tl,ml.value,N),ml!==null&&(l&&ml.alternate!==null&&X.delete(ml.key===null?tl:ml.key),r=u(ml,r,tl),hl===null?L=ml:hl.sibling=ml,hl=ml);return l&&X.forEach(function(fy){return t(m,fy)}),ol&&Jt(m,tl),L}function Tl(m,r,y,N){if(typeof y=="object"&&y!==null&&y.type===vl&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case ll:l:{for(var L=y.key;r!==null;){if(r.key===L){if(L=y.type,L===vl){if(r.tag===7){e(m,r.sibling),N=n(r,y.props.children),N.return=m,m=N;break l}}else if(r.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Z&&Ke(L)===r.type){e(m,r.sibling),N=n(r,y.props),an(N,y),N.return=m,m=N;break l}e(m,r);break}else t(m,r);r=r.sibling}y.type===vl?(N=Xe(y.props.children,m.mode,N,y.key),N.return=m,m=N):(N=Pn(y.type,y.key,y.props,null,m.mode,N),an(N,y),N.return=m,m=N)}return i(m);case W:l:{for(L=y.key;r!==null;){if(r.key===L)if(r.tag===4&&r.stateNode.containerInfo===y.containerInfo&&r.stateNode.implementation===y.implementation){e(m,r.sibling),N=n(r,y.children||[]),N.return=m,m=N;break l}else{e(m,r);break}else t(m,r);r=r.sibling}N=Hi(y,m.mode,N),N.return=m,m=N}return i(m);case Z:return y=Ke(y),Tl(m,r,y,N)}if(Cl(y))return G(m,r,y,N);if(jl(y)){if(L=jl(y),typeof L!="function")throw Error(s(150));return y=L.call(y),J(m,r,y,N)}if(typeof y.then=="function")return Tl(m,r,iu(y),N);if(y.$$typeof===dl)return Tl(m,r,eu(m,y),N);cu(m,y)}return typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint"?(y=""+y,r!==null&&r.tag===6?(e(m,r.sibling),N=n(r,y),N.return=m,m=N):(e(m,r),N=Ui(y,m.mode,N),N.return=m,m=N),i(m)):e(m,r)}return function(m,r,y,N){try{en=0;var L=Tl(m,r,y,N);return pa=null,L}catch(X){if(X===ba||X===nu)throw X;var hl=St(29,X,null,m.mode);return hl.lanes=N,hl.return=m,hl}}}var we=Gs(!0),Xs=Gs(!1),ye=!1;function Ji(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wi(l,t){l=l.updateQueue,t.updateQueue===l&&(t.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function ve(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function ge(l,t,e){var a=l.updateQueue;if(a===null)return null;if(a=a.shared,(yl&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=In(l),zs(l,null,e),t}return Fn(l,a,t,e),In(l)}function nn(l,t,e){if(t=t.updateQueue,t!==null&&(t=t.shared,(e&4194048)!==0)){var a=t.lanes;a&=l.pendingLanes,e|=a,t.lanes=e,Df(l,e)}}function ki(l,t){var e=l.updateQueue,a=l.alternate;if(a!==null&&(a=a.updateQueue,e===a)){var n=null,u=null;if(e=e.firstBaseUpdate,e!==null){do{var i={lane:e.lane,tag:e.tag,payload:e.payload,callback:null,next:null};u===null?n=u=i:u=u.next=i,e=e.next}while(e!==null);u===null?n=u=t:u=u.next=t}else n=u=t;e={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},l.updateQueue=e;return}l=e.lastBaseUpdate,l===null?e.firstBaseUpdate=t:l.next=t,e.lastBaseUpdate=t}var $i=!1;function un(){if($i){var l=Sa;if(l!==null)throw l}}function cn(l,t,e,a){$i=!1;var n=l.updateQueue;ye=!1;var u=n.firstBaseUpdate,i=n.lastBaseUpdate,f=n.shared.pending;if(f!==null){n.shared.pending=null;var d=f,v=d.next;d.next=null,i===null?u=v:i.next=v,i=d;var x=l.alternate;x!==null&&(x=x.updateQueue,f=x.lastBaseUpdate,f!==i&&(f===null?x.firstBaseUpdate=v:f.next=v,x.lastBaseUpdate=d))}if(u!==null){var _=n.baseState;i=0,x=v=d=null,f=u;do{var g=f.lane&-536870913,p=g!==f.lane;if(p?(cl&g)===g:(a&g)===g){g!==0&&g===ga&&($i=!0),x!==null&&(x=x.next={lane:0,tag:f.tag,payload:f.payload,callback:null,next:null});l:{var G=l,J=f;g=t;var Tl=e;switch(J.tag){case 1:if(G=J.payload,typeof G=="function"){_=G.call(Tl,_,g);break l}_=G;break l;case 3:G.flags=G.flags&-65537|128;case 0:if(G=J.payload,g=typeof G=="function"?G.call(Tl,_,g):G,g==null)break l;_=E({},_,g);break l;case 2:ye=!0}}g=f.callback,g!==null&&(l.flags|=64,p&&(l.flags|=8192),p=n.callbacks,p===null?n.callbacks=[g]:p.push(g))}else p={lane:g,tag:f.tag,payload:f.payload,callback:f.callback,next:null},x===null?(v=x=p,d=_):x=x.next=p,i|=g;if(f=f.next,f===null){if(f=n.shared.pending,f===null)break;p=f,f=p.next,p.next=null,n.lastBaseUpdate=p,n.shared.pending=null}}while(!0);x===null&&(d=_),n.baseState=d,n.firstBaseUpdate=v,n.lastBaseUpdate=x,u===null&&(n.shared.lanes=0),xe|=i,l.lanes=i,l.memoizedState=_}}function Qs(l,t){if(typeof l!="function")throw Error(s(191,l));l.call(t)}function Zs(l,t){var e=l.callbacks;if(e!==null)for(l.callbacks=null,l=0;lu?u:8;var i=j.T,f={};j.T=f,mc(l,!1,t,e);try{var d=n(),v=j.S;if(v!==null&&v(f,d),d!==null&&typeof d=="object"&&typeof d.then=="function"){var x=Fh(d,a);on(l,t,x,zt(l))}else on(l,t,a,zt(l))}catch(_){on(l,t,{then:function(){},status:"rejected",reason:_},zt())}finally{R.p=u,i!==null&&f.types!==null&&(i.types=f.types),j.T=i}}function am(){}function rc(l,t,e,a){if(l.tag!==5)throw Error(s(476));var n=jo(l).queue;po(l,n,t,M,e===null?am:function(){return xo(l),e(a)})}function jo(l){var t=l.memoizedState;if(t!==null)return t;t={memoizedState:M,baseState:M,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wt,lastRenderedState:M},next:null};var e={};return t.next={memoizedState:e,baseState:e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wt,lastRenderedState:e},next:null},l.memoizedState=t,l=l.alternate,l!==null&&(l.memoizedState=t),t}function xo(l){var t=jo(l);t.next===null&&(t=l.alternate.memoizedState),on(l,t.next.queue,{},zt())}function hc(){return Fl(An)}function zo(){return Bl().memoizedState}function To(){return Bl().memoizedState}function nm(l){for(var t=l.return;t!==null;){switch(t.tag){case 24:case 3:var e=zt();l=ve(e);var a=ge(t,l,e);a!==null&&(ot(a,t,e),nn(a,t,e)),t={cache:Zi()},l.payload=t;return}t=t.return}}function um(l,t,e){var a=zt();e={lane:a,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},gu(l)?No(t,e):(e=Di(l,t,e,a),e!==null&&(ot(e,l,a),Ao(e,t,a)))}function Eo(l,t,e){var a=zt();on(l,t,e,a)}function on(l,t,e,a){var n={lane:a,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null};if(gu(l))No(t,n);else{var u=l.alternate;if(l.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var i=t.lastRenderedState,f=u(i,e);if(n.hasEagerState=!0,n.eagerState=f,gt(f,i))return Fn(l,t,n,0),El===null&&Wn(),!1}catch{}if(e=Di(l,t,n,a),e!==null)return ot(e,l,a),Ao(e,t,a),!0}return!1}function mc(l,t,e,a){if(a={lane:2,revertLane:Jc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},gu(l)){if(t)throw Error(s(479))}else t=Di(l,e,a,2),t!==null&&ot(t,l,2)}function gu(l){var t=l.alternate;return l===P||t!==null&&t===P}function No(l,t){xa=ou=!0;var e=l.pending;e===null?t.next=t:(t.next=e.next,e.next=t),l.pending=t}function Ao(l,t,e){if((e&4194048)!==0){var a=t.lanes;a&=l.pendingLanes,e|=a,t.lanes=e,Df(l,e)}}var dn={readContext:Fl,use:hu,useCallback:Hl,useContext:Hl,useEffect:Hl,useImperativeHandle:Hl,useLayoutEffect:Hl,useInsertionEffect:Hl,useMemo:Hl,useReducer:Hl,useRef:Hl,useState:Hl,useDebugValue:Hl,useDeferredValue:Hl,useTransition:Hl,useSyncExternalStore:Hl,useId:Hl,useHostTransitionStatus:Hl,useFormState:Hl,useActionState:Hl,useOptimistic:Hl,useMemoCache:Hl,useCacheRefresh:Hl};dn.useEffectEvent=Hl;var _o={readContext:Fl,use:hu,useCallback:function(l,t){return et().memoizedState=[l,t===void 0?null:t],l},useContext:Fl,useEffect:oo,useImperativeHandle:function(l,t,e){e=e!=null?e.concat([l]):null,yu(4194308,4,yo.bind(null,t,l),e)},useLayoutEffect:function(l,t){return yu(4194308,4,l,t)},useInsertionEffect:function(l,t){yu(4,2,l,t)},useMemo:function(l,t){var e=et();t=t===void 0?null:t;var a=l();if(ke){fe(!0);try{l()}finally{fe(!1)}}return e.memoizedState=[a,t],a},useReducer:function(l,t,e){var a=et();if(e!==void 0){var n=e(t);if(ke){fe(!0);try{e(t)}finally{fe(!1)}}}else n=t;return a.memoizedState=a.baseState=n,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:n},a.queue=l,l=l.dispatch=um.bind(null,P,l),[a.memoizedState,l]},useRef:function(l){var t=et();return l={current:l},t.memoizedState=l},useState:function(l){l=cc(l);var t=l.queue,e=Eo.bind(null,P,t);return t.dispatch=e,[l.memoizedState,e]},useDebugValue:oc,useDeferredValue:function(l,t){var e=et();return dc(e,l,t)},useTransition:function(){var l=cc(!1);return l=po.bind(null,P,l.queue,!0,!1),et().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,t,e){var a=P,n=et();if(ol){if(e===void 0)throw Error(s(407));e=e()}else{if(e=t(),El===null)throw Error(s(349));(cl&127)!==0||ks(a,t,e)}n.memoizedState=e;var u={value:e,getSnapshot:t};return n.queue=u,oo(Ws.bind(null,a,u,l),[l]),a.flags|=2048,Ta(9,{destroy:void 0},$s.bind(null,a,u,e,t),null),e},useId:function(){var l=et(),t=El.identifierPrefix;if(ol){var e=Gt,a=Yt;e=(a&~(1<<32-vt(a)-1)).toString(32)+e,t="_"+t+"R_"+e,e=du++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?i.createElement("select",{is:a.is}):i.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?i.createElement(n,{is:a.is}):i.createElement(n)}}u[$l]=t,u[nt]=a;l:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)u.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break l;for(;i.sibling===null;){if(i.return===null||i.return===t)break l;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=u;l:switch(Pl(u,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break l;case"img":a=!0;break l;default:a=!1}a&&It(t)}}return Ml(t),_c(t,t.type,l===null?null:l.memoizedProps,t.pendingProps,e),null;case 6:if(l&&t.stateNode!=null)l.memoizedProps!==a&&It(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(s(166));if(l=al.current,ya(t)){if(l=t.stateNode,e=t.memoizedProps,a=null,n=Wl,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}l[$l]=t,l=!!(l.nodeValue===e||a!==null&&a.suppressHydrationWarning===!0||wd(l.nodeValue,e)),l||he(t,!0)}else l=Bu(l).createTextNode(a),l[$l]=t,t.stateNode=l}return Ml(t),null;case 31:if(e=t.memoizedState,l===null||l.memoizedState!==null){if(a=ya(t),e!==null){if(l===null){if(!a)throw Error(s(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(s(557));l[$l]=t}else Qe(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ml(t),l=!1}else e=Yi(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=e),l=!0;if(!l)return t.flags&256?(pt(t),t):(pt(t),null);if((t.flags&128)!==0)throw Error(s(558))}return Ml(t),null;case 13:if(a=t.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(n=ya(t),a!==null&&a.dehydrated!==null){if(l===null){if(!n)throw Error(s(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));n[$l]=t}else Qe(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ml(t),n=!1}else n=Yi(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(pt(t),t):(pt(t),null)}return pt(t),(t.flags&128)!==0?(t.lanes=e,t):(e=a!==null,l=l!==null&&l.memoizedState!==null,e&&(a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==n&&(a.flags|=2048)),e!==l&&e&&(t.child.flags|=8192),xu(t,t.updateQueue),Ml(t),null);case 4:return Ul(),l===null&&Wc(t.stateNode.containerInfo),Ml(t),null;case 10:return kt(t.type),Ml(t),null;case 19:if(A(ql),a=t.memoizedState,a===null)return Ml(t),null;if(n=(t.flags&128)!==0,u=a.rendering,u===null)if(n)hn(a,!1);else{if(Rl!==0||l!==null&&(l.flags&128)!==0)for(l=t.child;l!==null;){if(u=su(l),u!==null){for(t.flags|=128,hn(a,!1),l=u.updateQueue,t.updateQueue=l,xu(t,l),t.subtreeFlags=0,l=e,e=t.child;e!==null;)Ts(e,l),e=e.sibling;return q(ql,ql.current&1|2),ol&&Jt(t,a.treeForkCount),t.child}l=l.sibling}a.tail!==null&&mt()>Au&&(t.flags|=128,n=!0,hn(a,!1),t.lanes=4194304)}else{if(!n)if(l=su(u),l!==null){if(t.flags|=128,n=!0,l=l.updateQueue,t.updateQueue=l,xu(t,l),hn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!ol)return Ml(t),null}else 2*mt()-a.renderingStartTime>Au&&e!==536870912&&(t.flags|=128,n=!0,hn(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(l=a.last,l!==null?l.sibling=u:t.child=u,a.last=u)}return a.tail!==null?(l=a.tail,a.rendering=l,a.tail=l.sibling,a.renderingStartTime=mt(),l.sibling=null,e=ql.current,q(ql,n?e&1|2:e&1),ol&&Jt(t,a.treeForkCount),l):(Ml(t),null);case 22:case 23:return pt(t),Fi(),a=t.memoizedState!==null,l!==null?l.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(e&536870912)!==0&&(t.flags&128)===0&&(Ml(t),t.subtreeFlags&6&&(t.flags|=8192)):Ml(t),e=t.updateQueue,e!==null&&xu(t,e.retryQueue),e=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(e=l.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==e&&(t.flags|=2048),l!==null&&A(Ve),null;case 24:return e=null,l!==null&&(e=l.memoizedState.cache),t.memoizedState.cache!==e&&(t.flags|=2048),kt(Gl),Ml(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function om(l,t){switch(qi(t),t.tag){case 1:return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 3:return kt(Gl),Ul(),l=t.flags,(l&65536)!==0&&(l&128)===0?(t.flags=l&-65537|128,t):null;case 26:case 27:case 5:return Jl(t),null;case 31:if(t.memoizedState!==null){if(pt(t),t.alternate===null)throw Error(s(340));Qe()}return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 13:if(pt(t),l=t.memoizedState,l!==null&&l.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Qe()}return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 19:return A(ql),null;case 4:return Ul(),null;case 10:return kt(t.type),null;case 22:case 23:return pt(t),Fi(),l!==null&&A(Ve),l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 24:return kt(Gl),null;case 25:return null;default:return null}}function Io(l,t){switch(qi(t),t.tag){case 3:kt(Gl),Ul();break;case 26:case 27:case 5:Jl(t);break;case 4:Ul();break;case 31:t.memoizedState!==null&&pt(t);break;case 13:pt(t);break;case 19:A(ql);break;case 10:kt(t.type);break;case 22:case 23:pt(t),Fi(),l!==null&&A(Ve);break;case 24:kt(Gl)}}function mn(l,t){try{var e=t.updateQueue,a=e!==null?e.lastEffect:null;if(a!==null){var n=a.next;e=n;do{if((e.tag&l)===l){a=void 0;var u=e.create,i=e.inst;a=u(),i.destroy=a}e=e.next}while(e!==n)}}catch(f){pl(t,t.return,f)}}function pe(l,t,e){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var u=n.next;a=u;do{if((a.tag&l)===l){var i=a.inst,f=i.destroy;if(f!==void 0){i.destroy=void 0,n=t;var d=e,v=f;try{v()}catch(x){pl(n,d,x)}}}a=a.next}while(a!==u)}}catch(x){pl(t,t.return,x)}}function Po(l){var t=l.updateQueue;if(t!==null){var e=l.stateNode;try{Zs(t,e)}catch(a){pl(l,l.return,a)}}}function ld(l,t,e){e.props=$e(l.type,l.memoizedProps),e.state=l.memoizedState;try{e.componentWillUnmount()}catch(a){pl(l,t,a)}}function yn(l,t){try{var e=l.ref;if(e!==null){switch(l.tag){case 26:case 27:case 5:var a=l.stateNode;break;case 30:a=l.stateNode;break;default:a=l.stateNode}typeof e=="function"?l.refCleanup=e(a):e.current=a}}catch(n){pl(l,t,n)}}function Xt(l,t){var e=l.ref,a=l.refCleanup;if(e!==null)if(typeof a=="function")try{a()}catch(n){pl(l,t,n)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof e=="function")try{e(null)}catch(n){pl(l,t,n)}else e.current=null}function td(l){var t=l.type,e=l.memoizedProps,a=l.stateNode;try{l:switch(t){case"button":case"input":case"select":case"textarea":e.autoFocus&&a.focus();break l;case"img":e.src?a.src=e.src:e.srcSet&&(a.srcset=e.srcSet)}}catch(n){pl(l,l.return,n)}}function Oc(l,t,e){try{var a=l.stateNode;Cm(a,l.type,e,t),a[nt]=t}catch(n){pl(l,l.return,n)}}function ed(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&Ae(l.type)||l.tag===4}function Mc(l){l:for(;;){for(;l.sibling===null;){if(l.return===null||ed(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&Ae(l.type)||l.flags&2||l.child===null||l.tag===4)continue l;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Dc(l,t,e){var a=l.tag;if(a===5||a===6)l=l.stateNode,t?(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e).insertBefore(l,t):(t=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,t.appendChild(l),e=e._reactRootContainer,e!=null||t.onclick!==null||(t.onclick=Lt));else if(a!==4&&(a===27&&Ae(l.type)&&(e=l.stateNode,t=null),l=l.child,l!==null))for(Dc(l,t,e),l=l.sibling;l!==null;)Dc(l,t,e),l=l.sibling}function zu(l,t,e){var a=l.tag;if(a===5||a===6)l=l.stateNode,t?e.insertBefore(l,t):e.appendChild(l);else if(a!==4&&(a===27&&Ae(l.type)&&(e=l.stateNode),l=l.child,l!==null))for(zu(l,t,e),l=l.sibling;l!==null;)zu(l,t,e),l=l.sibling}function ad(l){var t=l.stateNode,e=l.memoizedProps;try{for(var a=l.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Pl(t,a,e),t[$l]=l,t[nt]=e}catch(u){pl(l,l.return,u)}}var Pt=!1,Zl=!1,Cc=!1,nd=typeof WeakSet=="function"?WeakSet:Set,kl=null;function dm(l,t){if(l=l.containerInfo,Pc=Vu,l=ys(l),Ei(l)){if("selectionStart"in l)var e={start:l.selectionStart,end:l.selectionEnd};else l:{e=(e=l.ownerDocument)&&e.defaultView||window;var a=e.getSelection&&e.getSelection();if(a&&a.rangeCount!==0){e=a.anchorNode;var n=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{e.nodeType,u.nodeType}catch{e=null;break l}var i=0,f=-1,d=-1,v=0,x=0,_=l,g=null;t:for(;;){for(var p;_!==e||n!==0&&_.nodeType!==3||(f=i+n),_!==u||a!==0&&_.nodeType!==3||(d=i+a),_.nodeType===3&&(i+=_.nodeValue.length),(p=_.firstChild)!==null;)g=_,_=p;for(;;){if(_===l)break t;if(g===e&&++v===n&&(f=i),g===u&&++x===a&&(d=i),(p=_.nextSibling)!==null)break;_=g,g=_.parentNode}_=p}e=f===-1||d===-1?null:{start:f,end:d}}else e=null}e=e||{start:0,end:0}}else e=null;for(lf={focusedElem:l,selectionRange:e},Vu=!1,kl=t;kl!==null;)if(t=kl,l=t.child,(t.subtreeFlags&1028)!==0&&l!==null)l.return=t,kl=l;else for(;kl!==null;){switch(t=kl,u=t.alternate,l=t.flags,t.tag){case 0:if((l&4)!==0&&(l=t.updateQueue,l=l!==null?l.events:null,l!==null))for(e=0;e title"))),Pl(u,a,e),u[$l]=l,wl(u),a=u;break l;case"link":var i=or("link","href",n).get(a+(e.href||""));if(i){for(var f=0;fTl&&(i=Tl,Tl=J,J=i);var m=hs(f,J),r=hs(f,Tl);if(m&&r&&(p.rangeCount!==1||p.anchorNode!==m.node||p.anchorOffset!==m.offset||p.focusNode!==r.node||p.focusOffset!==r.offset)){var y=_.createRange();y.setStart(m.node,m.offset),p.removeAllRanges(),J>Tl?(p.addRange(y),p.extend(r.node,r.offset)):(y.setEnd(r.node,r.offset),p.addRange(y))}}}}for(_=[],p=f;p=p.parentNode;)p.nodeType===1&&_.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<_.length;f++){var N=_[f];N.element.scrollLeft=N.left,N.element.scrollTop=N.top}}Vu=!!Pc,lf=Pc=null}finally{yl=n,R.p=a,j.T=e}}l.current=t,Vl=2}}function Dd(){if(Vl===2){Vl=0;var l=Te,t=Oa,e=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||e){e=j.T,j.T=null;var a=R.p;R.p=2;var n=yl;yl|=4;try{ud(l,t.alternate,t)}finally{yl=n,R.p=a,j.T=e}}Vl=3}}function Cd(){if(Vl===4||Vl===3){Vl=0,Zr();var l=Te,t=Oa,e=ne,a=Sd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Vl=5:(Vl=0,Oa=Te=null,Ud(l,l.pendingLanes));var n=l.pendingLanes;if(n===0&&(ze=null),ii(e),t=t.stateNode,yt&&typeof yt.onCommitFiberRoot=="function")try{yt.onCommitFiberRoot(Ya,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=j.T,n=R.p,R.p=2,j.T=null;try{for(var u=l.onRecoverableError,i=0;ie?32:e,j.T=null,e=Gc,Gc=null;var u=Te,i=ne;if(Vl=0,Oa=Te=null,ne=0,(yl&6)!==0)throw Error(s(331));var f=yl;if(yl|=4,yd(u.current),rd(u,u.current,i,e),yl=f,jn(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(Ya,u)}catch{}return!0}finally{R.p=n,j.T=a,Ud(l,t)}}function Rd(l,t,e){t=At(e,t),t=Sc(l.stateNode,t,2),l=ge(l,t,2),l!==null&&(Xa(l,2),Qt(l))}function pl(l,t,e){if(l.tag===3)Rd(l,l,e);else for(;t!==null;){if(t.tag===3){Rd(t,l,e);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(ze===null||!ze.has(a))){l=At(e,l),e=qo(2),a=ge(t,e,2),a!==null&&(Bo(e,a,t,l),Xa(a,2),Qt(a));break}}t=t.return}}function Lc(l,t,e){var a=l.pingCache;if(a===null){a=l.pingCache=new mm;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(e)||(Rc=!0,n.add(e),l=bm.bind(null,l,t,e),t.then(l,l))}function bm(l,t,e){var a=l.pingCache;a!==null&&a.delete(t),l.pingedLanes|=l.suspendedLanes&e,l.warmLanes&=~e,El===l&&(cl&e)===e&&(Rl===4||Rl===3&&(cl&62914560)===cl&&300>mt()-Nu?(yl&2)===0&&Ma(l,0):qc|=e,_a===cl&&(_a=0)),Qt(l)}function qd(l,t){t===0&&(t=Of()),l=Ge(l,t),l!==null&&(Xa(l,t),Qt(l))}function pm(l){var t=l.memoizedState,e=0;t!==null&&(e=t.retryLane),qd(l,e)}function jm(l,t){var e=0;switch(l.tag){case 31:case 13:var a=l.stateNode,n=l.memoizedState;n!==null&&(e=n.retryLane);break;case 19:a=l.stateNode;break;case 22:a=l.stateNode._retryCache;break;default:throw Error(s(314))}a!==null&&a.delete(t),qd(l,e)}function xm(l,t){return ei(l,t)}var Uu=null,Ca=null,Vc=!1,Hu=!1,Kc=!1,Ne=0;function Qt(l){l!==Ca&&l.next===null&&(Ca===null?Uu=Ca=l:Ca=Ca.next=l),Hu=!0,Vc||(Vc=!0,Tm())}function jn(l,t){if(!Kc&&Hu){Kc=!0;do for(var e=!1,a=Uu;a!==null;){if(l!==0){var n=a.pendingLanes;if(n===0)var u=0;else{var i=a.suspendedLanes,f=a.pingedLanes;u=(1<<31-vt(42|l)+1)-1,u&=n&~(i&~f),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(e=!0,Xd(a,u))}else u=cl,u=Yn(a,a===El?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||Ga(a,u)||(e=!0,Xd(a,u));a=a.next}while(e);Kc=!1}}function zm(){Bd()}function Bd(){Hu=Vc=!1;var l=0;Ne!==0&&Hm()&&(l=Ne);for(var t=mt(),e=null,a=Uu;a!==null;){var n=a.next,u=Yd(a,t);u===0?(a.next=null,e===null?Uu=n:e.next=n,n===null&&(Ca=e)):(e=a,(l!==0||(u&3)!==0)&&(Hu=!0)),a=n}Vl!==0&&Vl!==5||jn(l),Ne!==0&&(Ne=0)}function Yd(l,t){for(var e=l.suspendedLanes,a=l.pingedLanes,n=l.expirationTimes,u=l.pendingLanes&-62914561;0f)break;var x=d.transferSize,_=d.initiatorType;x&&kd(_)&&(d=d.responseEnd,i+=x*(d"u"?null:document;function ir(l,t,e){var a=Ua;if(a&&typeof t=="string"&&t){var n=Et(t);n='link[rel="'+l+'"][href="'+n+'"]',typeof e=="string"&&(n+='[crossorigin="'+e+'"]'),ur.has(n)||(ur.add(n),l={rel:l,crossOrigin:e,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),Pl(t,"link",l),wl(t),a.head.appendChild(t)))}}function Lm(l){ue.D(l),ir("dns-prefetch",l,null)}function Vm(l,t){ue.C(l,t),ir("preconnect",l,t)}function Km(l,t,e){ue.L(l,t,e);var a=Ua;if(a&&l&&t){var n='link[rel="preload"][as="'+Et(t)+'"]';t==="image"&&e&&e.imageSrcSet?(n+='[imagesrcset="'+Et(e.imageSrcSet)+'"]',typeof e.imageSizes=="string"&&(n+='[imagesizes="'+Et(e.imageSizes)+'"]')):n+='[href="'+Et(l)+'"]';var u=n;switch(t){case"style":u=Ha(l);break;case"script":u=Ra(l)}Ut.has(u)||(l=E({rel:"preload",href:t==="image"&&e&&e.imageSrcSet?void 0:l,as:t},e),Ut.set(u,l),a.querySelector(n)!==null||t==="style"&&a.querySelector(En(u))||t==="script"&&a.querySelector(Nn(u))||(t=a.createElement("link"),Pl(t,"link",l),wl(t),a.head.appendChild(t)))}}function Jm(l,t){ue.m(l,t);var e=Ua;if(e&&l){var a=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+Et(a)+'"][href="'+Et(l)+'"]',u=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Ra(l)}if(!Ut.has(u)&&(l=E({rel:"modulepreload",href:l},t),Ut.set(u,l),e.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(e.querySelector(Nn(u)))return}a=e.createElement("link"),Pl(a,"link",l),wl(a),e.head.appendChild(a)}}}function wm(l,t,e){ue.S(l,t,e);var a=Ua;if(a&&l){var n=ea(a).hoistableStyles,u=Ha(l);t=t||"default";var i=n.get(u);if(!i){var f={loading:0,preload:null};if(i=a.querySelector(En(u)))f.loading=5;else{l=E({rel:"stylesheet",href:l,"data-precedence":t},e),(e=Ut.get(u))&&ff(l,e);var d=i=a.createElement("link");wl(d),Pl(d,"link",l),d._p=new Promise(function(v,x){d.onload=v,d.onerror=x}),d.addEventListener("load",function(){f.loading|=1}),d.addEventListener("error",function(){f.loading|=2}),f.loading|=4,Gu(i,t,a)}i={type:"stylesheet",instance:i,count:1,state:f},n.set(u,i)}}}function km(l,t){ue.X(l,t);var e=Ua;if(e&&l){var a=ea(e).hoistableScripts,n=Ra(l),u=a.get(n);u||(u=e.querySelector(Nn(n)),u||(l=E({src:l,async:!0},t),(t=Ut.get(n))&&sf(l,t),u=e.createElement("script"),wl(u),Pl(u,"link",l),e.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function $m(l,t){ue.M(l,t);var e=Ua;if(e&&l){var a=ea(e).hoistableScripts,n=Ra(l),u=a.get(n);u||(u=e.querySelector(Nn(n)),u||(l=E({src:l,async:!0,type:"module"},t),(t=Ut.get(n))&&sf(l,t),u=e.createElement("script"),wl(u),Pl(u,"link",l),e.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function cr(l,t,e,a){var n=(n=al.current)?Yu(n):null;if(!n)throw Error(s(446));switch(l){case"meta":case"title":return null;case"style":return typeof e.precedence=="string"&&typeof e.href=="string"?(t=Ha(e.href),e=ea(n).hoistableStyles,a=e.get(t),a||(a={type:"style",instance:null,count:0,state:null},e.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(e.rel==="stylesheet"&&typeof e.href=="string"&&typeof e.precedence=="string"){l=Ha(e.href);var u=ea(n).hoistableStyles,i=u.get(l);if(i||(n=n.ownerDocument||n,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(l,i),(u=n.querySelector(En(l)))&&!u._p&&(i.instance=u,i.state.loading=5),Ut.has(l)||(e={rel:"preload",as:"style",href:e.href,crossOrigin:e.crossOrigin,integrity:e.integrity,media:e.media,hrefLang:e.hrefLang,referrerPolicy:e.referrerPolicy},Ut.set(l,e),u||Wm(n,l,e,i.state))),t&&a===null)throw Error(s(528,""));return i}if(t&&a!==null)throw Error(s(529,""));return null;case"script":return t=e.async,e=e.src,typeof e=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ra(e),e=ea(n).hoistableScripts,a=e.get(t),a||(a={type:"script",instance:null,count:0,state:null},e.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,l))}}function Ha(l){return'href="'+Et(l)+'"'}function En(l){return'link[rel="stylesheet"]['+l+"]"}function fr(l){return E({},l,{"data-precedence":l.precedence,precedence:null})}function Wm(l,t,e,a){l.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=l.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),Pl(t,"link",e),wl(t),l.head.appendChild(t))}function Ra(l){return'[src="'+Et(l)+'"]'}function Nn(l){return"script[async]"+l}function sr(l,t,e){if(t.count++,t.instance===null)switch(t.type){case"style":var a=l.querySelector('style[data-href~="'+Et(e.href)+'"]');if(a)return t.instance=a,wl(a),a;var n=E({},e,{"data-href":e.href,"data-precedence":e.precedence,href:null,precedence:null});return a=(l.ownerDocument||l).createElement("style"),wl(a),Pl(a,"style",n),Gu(a,e.precedence,l),t.instance=a;case"stylesheet":n=Ha(e.href);var u=l.querySelector(En(n));if(u)return t.state.loading|=4,t.instance=u,wl(u),u;a=fr(e),(n=Ut.get(n))&&ff(a,n),u=(l.ownerDocument||l).createElement("link"),wl(u);var i=u;return i._p=new Promise(function(f,d){i.onload=f,i.onerror=d}),Pl(u,"link",a),t.state.loading|=4,Gu(u,e.precedence,l),t.instance=u;case"script":return u=Ra(e.src),(n=l.querySelector(Nn(u)))?(t.instance=n,wl(n),n):(a=e,(n=Ut.get(u))&&(a=E({},e),sf(a,n)),l=l.ownerDocument||l,n=l.createElement("script"),wl(n),Pl(n,"link",a),l.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Gu(a,e.precedence,l));return t.instance}function Gu(l,t,e){for(var a=e.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,u=n,i=0;i title"):null)}function Fm(l,t,e){if(e===1||t.itemProp!=null)return!1;switch(l){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"?(l=t.disabled,typeof t.precedence=="string"&&l==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 rr(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function Im(l,t,e,a){if(e.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var n=Ha(a.href),u=t.querySelector(En(n));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(l.count++,l=Qu.bind(l),t.then(l,l)),e.state.loading|=4,e.instance=u,wl(u);return}u=t.ownerDocument||t,a=fr(a),(n=Ut.get(n))&&ff(a,n),u=u.createElement("link"),wl(u);var i=u;i._p=new Promise(function(f,d){i.onload=f,i.onerror=d}),Pl(u,"link",a),e.instance=u}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(e,t),(t=e.state.preload)&&(e.state.loading&3)===0&&(l.count++,e=Qu.bind(l),t.addEventListener("load",e),t.addEventListener("error",e))}}var of=0;function Pm(l,t){return l.stylesheets&&l.count===0&&Lu(l,l.stylesheets),0of?50:800)+t);return l.unsuspend=e,function(){l.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function Qu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Lu(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var Zu=null;function Lu(l,t){l.stylesheets=null,l.unsuspend!==null&&(l.count++,Zu=new Map,t.forEach(ly,l),Zu=null,Qu.call(l))}function ly(l,t){if(!(t.state.loading&4)){var e=Zu.get(l);if(e)var a=e.get(null);else{e=new Map,Zu.set(l,e);for(var n=l.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(S){console.error(S)}}return o(),bf.exports=vy(),bf.exports}var Sy=gy();function by(){const o=new URLSearchParams(location.search).get("token");if(o){sessionStorage.setItem("dm.token",o);const S=location.pathname+location.hash;return history.replaceState(null,"",S),o}return sessionStorage.getItem("dm.token")??""}const Ba=by();class Fu extends Error{status;body;constructor(S,z,s={}){super(z),this.status=S,this.body=s}get needsTrust(){return this.body.needsTrust===!0}}async function dt(o,S){const z={...S?.headers};Ba&&(z["X-Auth-Token"]=Ba),S?.body&&(z["Content-Type"]="application/json");const s=await fetch(o,{...S,headers:z});if(s.status===204)return;const O=await s.text();let D={};if(O)try{D=JSON.parse(O)}catch{if(!s.ok)throw new Fu(s.status,O.slice(0,400))}if(!s.ok){const T=typeof D.error=="string"?D.error:`request failed (${s.status})`;throw new Fu(s.status,T,D)}return D}const Ht=(o,S)=>dt(o,{method:"POST",body:S===void 0?void 0:JSON.stringify(S)}),Al={health:()=>dt("/api/health"),source:()=>dt("/api/source"),volumeSizes:()=>dt("/api/source/sizes"),sources:()=>dt("/api/sources"),saveSource:o=>Ht("/api/sources",o),deleteSource:o=>dt(`/api/sources/${o}`,{method:"DELETE"}),selectSource:o=>Ht(`/api/sources/${o}/select`),probeSource:o=>Ht(`/api/sources/${o}/probe`),trustSource:(o,S)=>Ht(`/api/sources/${o}/trust`,{fingerprint:S}),connections:()=>dt("/api/connections"),saveConnection:o=>Ht("/api/connections",o),deleteConnection:o=>dt(`/api/connections/${o}`,{method:"DELETE"}),probe:o=>Ht(`/api/connections/${o}/probe`),trust:(o,S)=>Ht(`/api/connections/${o}/trust`,{fingerprint:S}),testConnection:o=>Ht(`/api/connections/${o}/test`),targetInventory:o=>dt(`/api/connections/${o}/inventory`),preview:o=>Ht("/api/plan/preview",o),migrateSSH:(o,S)=>Ht("/api/migrate/ssh",{connectionId:o,plan:S}),buildPackage:(o,S)=>Ht("/api/migrate/package",{plan:o,format:S}),jobs:()=>dt("/api/jobs"),job:o=>dt(`/api/jobs/${o}`),cancelJob:o=>Ht(`/api/jobs/${o}/cancel`),deleteJob:o=>dt(`/api/jobs/${o}`,{method:"DELETE"}),packages:()=>dt("/api/packages"),deletePackage:o=>dt(`/api/packages/${encodeURIComponent(o)}`,{method:"DELETE"}),downloadUrl:o=>`/api/packages/${encodeURIComponent(o)}/download`+(Ba?`?token=${encodeURIComponent(Ba)}`:""),jobEvents:o=>new EventSource(`/api/jobs/${o}/events`+(Ba?`?token=${encodeURIComponent(Ba)}`:""))};function ie(o){if(o==null||o<0)return"–";if(o===0)return"0 B";const S=["B","KiB","MiB","GiB","TiB","PiB"];let z=o,s=0;for(;z>=1024&&sS(D.target.checked)}),c.jsx("span",{children:z})]})}function Ll({label:o,children:S}){return c.jsxs("label",{className:"field",children:[c.jsx("span",{children:o}),S]})}function Iu({title:o,onClose:S,children:z,footer:s,wide:O}){return Q.useEffect(()=>{const D=T=>{T.key==="Escape"&&S()};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[S]),c.jsx("div",{className:"modal-backdrop",onMouseDown:D=>D.target===D.currentTarget&&S(),children:c.jsxs("div",{className:"modal",style:O?{width:"min(1000px, 100%)"}:void 0,children:[c.jsxs("header",{children:[o,c.jsx("span",{className:"spacer"}),c.jsx("button",{className:"btn ghost tiny",onClick:S,children:"close"})]}),c.jsx("div",{className:"content",children:z}),s&&c.jsx("footer",{children:s})]})})}function ht({kind:o,children:S}){return c.jsx("div",{className:`notice ${o==="info"?"":o}`,children:S})}function zf({done:o,total:S,state:z}){const s=S>0?Math.min(100,o/S*100):z==="succeeded"?100:0,O=z==="succeeded"?"done":z==="failed"?"failed":"";return c.jsx("div",{className:`progress ${O}`,children:c.jsx("div",{style:{width:`${s}%`}})})}function Br(o,S){return o.kind==="tmpfs"?0:o.sizeBytes>=0?o.sizeBytes:o.name&&S[o.name]!==void 0?S[o.name]:-1}function py({source:o,sel:S,setSel:z,targetInv:s,loading:O,sizes:D}){const[T,w]=Q.useState(""),[H,b]=Q.useState(new Set),[V,E]=Q.useState(!1),U=o?.inventory.containers??[],ll=Q.useMemo(()=>new Set((s?.containers??[]).map(C=>C.name)),[s]),W=Q.useMemo(()=>{const C=T.trim().toLowerCase();return U.filter(Z=>V&&Z.state!=="running"?!1:C?Z.name.toLowerCase().includes(C)||Z.image.toLowerCase().includes(C)||(Z.composeProject??"").toLowerCase().includes(C)||(Z.mounts??[]).some(B=>B.destination.toLowerCase().includes(C)||(B.name??"").toLowerCase().includes(C)):!0)},[U,T,V]),vl=Q.useMemo(()=>{const C=new Map;for(const Z of W){const B=Z.composeProject||"",$=C.get(B);$?$.push(Z):C.set(B,[Z])}return[...C.entries()].sort((Z,B)=>Z[0]===""?1:B[0]===""?-1:Z[0].localeCompare(B[0]))},[W]);function Yl(C,Z){z(B=>({...B,[C]:{...B[C],...Z}}))}function gl(C,Z){z(B=>{const $={...B};for(const sl of C)$[sl]&&($[sl]={...$[sl],include:Z});return $})}function _l(C){z(Z=>{const B={...Z};for(const $ of U){const sl=B[$.id];sl?.include&&(B[$.id]=C(sl,$))}return B})}function dl(C,Z){_l((B,$)=>{const sl={...B.mounts};for(const jl of $.mounts??[])jl.kind!=="tmpfs"&&Z.includes(jl.kind)&&(sl[jl.destination]={...sl[jl.destination],action:C});return{...B,mounts:sl}})}const el=W.map(C=>C.id),Sl=W.filter(C=>S[C.id]?.include).length,Nl=Object.values(S).some(C=>C.include);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"toolbar",children:[c.jsx("input",{className:"search",type:"text",placeholder:"filter by name, image, mount…",value:T,onChange:C=>w(C.target.value)}),c.jsx("button",{className:"btn tiny",onClick:()=>gl(el,!0),children:"select all"}),c.jsx("button",{className:"btn tiny",onClick:()=>gl(el,!1),children:"clear"}),c.jsx("button",{className:"btn tiny",onClick:()=>gl(W.filter(C=>C.state==="running").map(C=>C.id),!0),children:"select running"}),c.jsx(rt,{checked:V,onChange:E,label:c.jsx("span",{className:"small muted",children:"running only"})}),c.jsx("span",{className:"spacer"}),c.jsxs("span",{className:"small faint nowrap",children:["apply to ",Sl?`${Sl} selected`:"selection",":"]}),c.jsx("button",{className:"btn tiny",disabled:!Nl,onClick:()=>dl("copy",["volume","anonymous","bind"]),children:"copy all data"}),c.jsx("button",{className:"btn tiny",disabled:!Nl,onClick:()=>dl("skip",["bind"]),children:"skip binds"}),c.jsx("button",{className:"btn tiny",disabled:!Nl,onClick:()=>dl("structure",["volume","anonymous","bind"]),children:"structure only"}),c.jsxs("select",{className:"btn tiny",style:{width:"auto"},disabled:!Nl,value:"",onChange:C=>{const Z=C.target.value;if(Z){if(Z==="start"&&_l(B=>({...B,startAfter:!0})),Z==="nostart"&&_l(B=>({...B,startAfter:!1})),Z==="live"&&_l(B=>({...B,stopSourceDuringCopy:!1})),Z==="quiesce"&&_l(B=>({...B,stopSourceDuringCopy:!0})),Z==="keepsource"&&_l(B=>({...B,stopSourceAfter:!1})),Z==="stopsource"&&_l(B=>({...B,stopSourceAfter:!0})),Z.startsWith("img:")){const B=Z.slice(4);_l($=>({...$,migrateImage:B!=="skip",imageMode:B}))}C.target.value=""}},children:[c.jsx("option",{value:"",children:"more…"}),c.jsx("option",{value:"start",children:"start after migration"}),c.jsx("option",{value:"nostart",children:"leave stopped on target"}),c.jsx("option",{value:"quiesce",children:"stop source while copying"}),c.jsx("option",{value:"live",children:"copy while running (hot)"}),c.jsx("option",{value:"stopsource",children:"stop source after migration"}),c.jsx("option",{value:"keepsource",children:"leave source running"}),c.jsx("option",{value:"img:auto",children:"image: auto"}),c.jsx("option",{value:"img:pull",children:"image: pull on target"}),c.jsx("option",{value:"img:stream",children:"image: transfer layers"}),c.jsx("option",{value:"img:skip",children:"image: already on target"})]})]}),O&&U.length===0&&c.jsx("div",{className:"empty",children:"reading the source daemon…"}),!O&&U.length===0&&c.jsx("div",{className:"empty",children:"no containers on this host"}),!O&&U.length>0&&W.length===0&&c.jsx("div",{className:"empty",children:"nothing matches the filter"}),c.jsx("div",{className:"clist",children:vl.map(([C,Z])=>c.jsxs("div",{children:[vl.length>1&&c.jsxs("div",{className:"group-head",children:[c.jsx(rt,{checked:Z.every(B=>S[B.id]?.include),onChange:B=>gl(Z.map($=>$.id),B),label:C?`compose: ${C}`:"standalone"}),c.jsx("span",{className:"line"}),c.jsx("span",{children:Z.length})]}),Z.map(B=>c.jsx(jy,{c:B,s:S[B.id],onChange:$=>Yl(B.id,$),expanded:H.has(B.id),toggleExpanded:()=>b($=>{const sl=new Set($);return sl.has(B.id)?sl.delete(B.id):sl.add(B.id),sl}),conflicts:ll.has(S[B.id]?.nameOverride||B.name),sizes:D},B.id))]},C||"__none"))})]})}function jy({c:o,s:S,onChange:z,expanded:s,toggleExpanded:O,conflicts:D,sizes:T}){if(!S)return null;const H=(o.mounts??[]).filter(E=>E.kind!=="tmpfs"),b=H.filter(E=>(S.mounts[E.destination]?.action??"copy")==="copy"),V=b.reduce((E,U)=>{const ll=Br(U,T);return E+(ll>0?ll:0)},0);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`crow${S.include?" selected":""}`,children:[c.jsx(rt,{checked:S.include,onChange:E=>z({include:E}),label:""}),c.jsx("button",{className:"expander",onClick:O,title:"per-item options",children:s?"▾":"▸"}),c.jsxs("div",{style:{minWidth:0},children:[c.jsx("div",{className:"name truncate",title:o.name,children:o.name}),c.jsxs("div",{className:"sub row",style:{gap:6},children:[c.jsx(Un,{state:o.state}),o.composeService&&c.jsxs("span",{className:"faint",children:["· ",o.composeService]}),D&&c.jsx("span",{className:"badge",style:{borderColor:"#5c4520",color:"#e0b556"},children:"on target"})]})]}),c.jsx("div",{className:"image truncate",title:o.image,children:o.image}),c.jsxs("div",{className:"tags",children:[H.map(E=>c.jsx("span",{className:`badge ${E.kind==="bind"?"bind":E.kind==="anonymous"?"anon":"vol"}`,title:`${E.kind} → ${E.destination}${E.readOnly?" (read-only)":""}`,style:{opacity:(S.mounts[E.destination]?.action??"copy")==="skip"?.35:1},children:E.kind==="bind"?(E.source??"").split("/").pop()||"/":E.kind==="anonymous"?"anon":E.name},E.destination)),(o.endpoints??[]).filter(E=>!["bridge","host","none"].includes(E.network)).map(E=>c.jsx("span",{className:"badge net",title:`network ${E.network}`,children:E.network},E.network)),(o.ports??[]).slice(0,3).map((E,U)=>c.jsxs("span",{className:"badge port",children:[E.hostPort,":",E.containerPort.split("/")[0]]},U)),(o.ports??[]).length>3&&c.jsxs("span",{className:"badge port",children:["+",(o.ports??[]).length-3]})]}),c.jsxs("div",{className:"small faint nowrap",style:{textAlign:"right"},children:[b.length>0?`${b.length} to copy`:"no data",V>0&&c.jsxs(c.Fragment,{children:[" · ",ie(V)]})]})]}),s&&c.jsx(xy,{c:o,s:S,onChange:z,sizes:T})]})}function xy({c:o,s:S,onChange:z,sizes:s}){const O=o.mounts??[];function D(T,w){z({mounts:{...S.mounts,[T]:{...S.mounts[T],...w}}})}return c.jsxs("div",{className:"detail",children:[(o.warnings??[]).map((T,w)=>c.jsx("div",{className:"notice warn",children:T},w)),c.jsxs("div",{className:"grid2",children:[c.jsx(Ll,{label:"name on target",children:c.jsx("input",{type:"text",placeholder:o.name,value:S.nameOverride??"",onChange:T=>z({nameOverride:T.target.value})})}),c.jsx(Ll,{label:"image",children:c.jsxs("select",{value:S.migrateImage?S.imageMode:"skip",onChange:T=>{const w=T.target.value;z({migrateImage:w!=="skip",imageMode:w})},children:[c.jsx("option",{value:"auto",children:"auto — reuse, pull, or transfer"}),c.jsx("option",{value:"pull",children:"pull on the target"}),c.jsx("option",{value:"stream",children:"transfer the layers"}),c.jsx("option",{value:"skip",children:"already on the target"})]})}),c.jsxs("div",{className:"stack",style:{gap:6},children:[c.jsx(rt,{checked:S.migrateNetworks,onChange:T=>z({migrateNetworks:T}),label:"recreate networks and reattach"}),c.jsx(rt,{checked:S.keepStaticIps,onChange:T=>z({keepStaticIps:T}),disabled:!S.migrateNetworks,label:"keep static IP addresses",title:"Only works when the target networks use the same subnets"}),c.jsx(rt,{checked:S.migratePorts,onChange:T=>z({migratePorts:T}),label:"publish the same host ports"})]}),c.jsxs("div",{className:"stack",style:{gap:6},children:[c.jsx(rt,{checked:S.startAfter,onChange:T=>z({startAfter:T}),label:"start on the target"}),c.jsx(rt,{checked:S.stopSourceDuringCopy,onChange:T=>z({stopSourceDuringCopy:T}),label:"stop the source while copying",title:"Recommended: databases and other writers produce inconsistent copies while running"}),c.jsx(rt,{checked:S.stopSourceAfter,onChange:T=>z({stopSourceAfter:T}),label:"leave the source stopped afterwards"})]})]}),O.length===0?c.jsx("div",{className:"small faint",children:"this container has no mounts"}):c.jsxs("table",{className:"mount-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{style:{width:74},children:"kind"}),c.jsx("th",{children:"in the container"}),c.jsx("th",{children:"on the source"}),c.jsx("th",{style:{width:130},children:"action"}),c.jsx("th",{children:"on the target"}),c.jsx("th",{style:{width:70,textAlign:"right"},children:"size"})]})}),c.jsx("tbody",{children:O.map(T=>{const w=S.mounts[T.destination]??{action:"copy"},H=T.kind==="tmpfs";return c.jsxs("tr",{children:[c.jsx("td",{children:c.jsx("span",{className:`badge ${T.kind==="bind"?"bind":T.kind==="anonymous"?"anon":T.kind==="tmpfs"?"tmpfs":"vol"}`,children:T.kind})}),c.jsxs("td",{className:"mono truncate",title:T.destination,children:[T.destination,T.readOnly&&c.jsx("span",{className:"faint",children:" :ro"})]}),c.jsx("td",{className:"mono truncate faint",title:T.source||T.name,children:T.kind==="bind"?T.source:T.kind==="anonymous"?"(generated)":T.name}),c.jsx("td",{children:c.jsxs("select",{value:w.action,disabled:H,onChange:b=>D(T.destination,{action:b.target.value}),children:[c.jsx("option",{value:"copy",children:"copy data"}),c.jsx("option",{value:"structure",children:"create empty"}),c.jsx("option",{value:"skip",children:"do not mount"})]})}),c.jsxs("td",{children:[T.kind==="bind"&&w.action!=="skip"&&c.jsx("input",{type:"text",placeholder:T.source,value:w.targetSource??"",onChange:b=>D(T.destination,{targetSource:b.target.value})}),T.kind==="volume"&&w.action!=="skip"&&c.jsx("input",{type:"text",placeholder:T.name,value:w.targetName??"",onChange:b=>D(T.destination,{targetName:b.target.value})}),T.kind==="anonymous"&&c.jsx("span",{className:"small faint",children:"a fresh volume is created"}),H&&c.jsx("span",{className:"small faint",children:"in memory, nothing to copy"})]}),c.jsx("td",{className:"small faint nowrap",style:{textAlign:"right"},children:H?"–":ie(Br(T,s))})]},T.destination)})})]})]})}function Yr({value:o,set:S,where:z}){return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"row",style:{gap:12},children:[c.jsx(Ll,{label:"host",children:c.jsx("input",{type:"text",value:o.host??"",onChange:s=>S("host",s.target.value)})}),c.jsx("div",{style:{width:90},children:c.jsx(Ll,{label:"port",children:c.jsx("input",{type:"number",value:o.port??22,onChange:s=>S("port",Number(s.target.value))})})})]}),c.jsxs("div",{className:"row",style:{gap:12},children:[c.jsx(Ll,{label:"user",children:c.jsx("input",{type:"text",value:o.user??"",onChange:s=>S("user",s.target.value)})}),c.jsx(Ll,{label:"authentication",children:c.jsxs("select",{value:o.auth??"password",onChange:s=>S("auth",s.target.value),children:[c.jsx("option",{value:"password",children:"password"}),c.jsx("option",{value:"key",children:"private key"}),c.jsx("option",{value:"agent",children:"ssh agent"})]})})]}),o.auth==="password"&&c.jsx(Ll,{label:"password",children:c.jsx("input",{type:"password",value:o.password??"",onChange:s=>S("password",s.target.value)})}),o.auth==="key"&&c.jsxs(c.Fragment,{children:[c.jsx(Ll,{label:"private key path on this machine (leave empty to paste the key below)",children:c.jsx("input",{type:"text",placeholder:"/root/.ssh/id_ed25519",value:o.privateKeyPath??"",onChange:s=>S("privateKeyPath",s.target.value)})}),c.jsx(Ll,{label:"or paste the private key",children:c.jsx("textarea",{rows:5,value:o.privateKey??"",onChange:s=>S("privateKey",s.target.value),placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"})}),c.jsx(Ll,{label:"passphrase (if the key is encrypted)",children:c.jsx("input",{type:"password",value:o.passphrase??"",onChange:s=>S("passphrase",s.target.value)})})]}),o.auth==="agent"&&c.jsxs("div",{className:"small muted",children:["Uses the agent at ",c.jsx("span",{className:"mono",children:"$SSH_AUTH_SOCK"})," of the process running dockmv."]}),c.jsx(rt,{checked:o.sudo??!1,onChange:s=>S("sudo",s),label:`run docker through sudo -n on the ${z}`,title:"Needed when the login user is not in the docker group. sudo must not ask for a password."}),c.jsx(Ll,{label:`docker command on the ${z} (optional)`,children:c.jsx("input",{type:"text",placeholder:"docker",value:o.dockerCmd??"",onChange:s=>S("dockerCmd",s.target.value)})}),c.jsx(rt,{checked:o.saveSecrets??!1,onChange:s=>S("saveSecrets",s),label:"remember the password / key on disk"}),o.saveSecrets?c.jsx(ht,{kind:"warn",children:"Credentials are stored in plain text in dockmv's data directory, readable only by this user. Leave this off to keep them in memory for this session only."}):c.jsx("div",{className:"small faint",children:"Credentials stay in memory and are lost when dockmv restarts."})]})}function Gr({info:o,onClose:S,onTrust:z}){return c.jsx(Iu,{title:"SSH host key",onClose:S,footer:c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"btn",onClick:S,children:"cancel"}),c.jsx("button",{className:"btn primary",onClick:z,children:o.changed?"replace the stored key and trust":"trust this host"})]}),children:c.jsxs("div",{className:"stack",children:[o.changed&&c.jsxs(ht,{kind:"err",children:["The key presented by this host is ",c.jsx("b",{children:"different"})," from the one recorded earlier. This happens after a reinstall — but it is also what a machine-in-the-middle looks like. Only continue if you know why it changed."]}),o.trusted&&!o.changed&&c.jsx(ht,{kind:"ok",children:"This host key is already trusted."}),c.jsxs("div",{className:"small muted",children:["Compare this with the output of ",c.jsxs("span",{className:"mono",children:["ssh-keyscan -t ",o.keyType," ",o.host]})," ","run on the host itself, or with ",c.jsx("span",{className:"mono",children:"ssh-keygen -lf /etc/ssh/ssh_host_*_key.pub"}),"."]}),c.jsxs("div",{className:"fingerprint",children:[o.keyType,c.jsx("br",{}),o.fingerprint]})]})})}function zy({sources:o,selected:S,status:z,selectSource:s,reload:O,onError:D}){const[T,w]=Q.useState(null),[H,b]=Q.useState(null),[V,E]=Q.useState(""),[U,ll]=Q.useState(""),W=o.find(el=>el.id===S),vl=!W||W.kind==="local",Yl=W?.kind==="ssh";async function gl(el,Sl,Nl){E(el);try{await Nl()}catch(C){C instanceof Fu&&C.needsTrust?(ll(Sl),await _l(Sl)):D(C instanceof Error?C.message:String(C))}finally{E("")}}async function _l(el){try{b(await Al.probeSource(el))}catch(Sl){D(Sl instanceof Error?Sl.message:String(Sl))}}async function dl(){const el=U||S;H&&await gl("trust",el,async()=>{await Al.trustSource(el,H.fingerprint),b(null),await s(el)})}return c.jsxs("div",{className:"section",children:[c.jsx("h3",{children:"source host"}),c.jsxs("div",{className:"stack",children:[c.jsxs("div",{className:"row",children:[c.jsx("select",{value:S,disabled:!!V,onChange:el=>{const Sl=el.target.value;gl("select",Sl,()=>s(Sl))},children:o.map(el=>c.jsx("option",{value:el.id,children:Ty(el)},el.id))}),c.jsx("button",{className:"btn tiny",onClick:()=>w({kind:"ssh",ssh:{port:22,auth:"password",saveSecrets:!1,sudo:!1}}),children:"new"})]}),c.jsxs("div",{className:"row wrap",style:{gap:6},children:[c.jsx("button",{className:"btn tiny",disabled:!!V,onClick:()=>{gl("select",S,()=>s(S))},children:V==="select"?"connecting…":"reconnect"}),!vl&&c.jsx("button",{className:"btn tiny",onClick:()=>w(W),children:"edit"}),Yl&&c.jsx("button",{className:"btn tiny",onClick:()=>{ll(S),_l(S)},children:"host key"}),!vl&&c.jsx("button",{className:"btn tiny danger",onClick:()=>{!W||!confirm(`Delete source "${W.name}"?`)||gl("del",W.id,async()=>{await Al.deleteSource(W.id),await O(),S===W.id&&await s("local")})},children:"delete"})]}),z?.error&&c.jsx(ht,{kind:"err",children:z.error}),z&&!z.error&&c.jsxs("dl",{className:"kv",children:[c.jsx("dt",{children:"reached by"}),c.jsx("dd",{className:"mono",children:z.endpoint}),z.dockerVersion&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:"docker"}),c.jsx("dd",{children:z.dockerVersion})]})]}),Yl&&c.jsx("div",{className:"small faint",children:"Data is streamed through dockmv: source → this host → target. A local source moves it in one hop."})]}),T&&c.jsx(Ey,{initial:T,onClose:()=>w(null),onSaved:async el=>{w(null),await O(),await gl("select",el.id,()=>s(el.id))},onError:D}),H&&c.jsx(Gr,{info:H,onClose:()=>b(null),onTrust:dl})]})}function Ty(o){switch(o.kind){case"local":return`${o.name} (local docker)`;case"docker":return`${o.name} (${o.dockerHost})`;default:return`${o.name} (ssh ${o.ssh?.user}@${o.ssh?.host})`}}function Ey({initial:o,onClose:S,onSaved:z,onError:s}){const[O,D]=Q.useState(o),[T,w]=Q.useState(!1),H=O.kind??"ssh",b=O.ssh??{};function V(U,ll){D(W=>({...W,ssh:{...W.ssh,[U]:ll}}))}const E=H==="ssh"?!!b.host&&!!b.user:!!O.dockerHost;return c.jsx(Iu,{title:o.id?`Edit ${o.name}`:"New source host",onClose:S,footer:c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"btn",onClick:S,children:"cancel"}),c.jsx("button",{className:"btn primary",disabled:T||!E,onClick:async()=>{w(!0);try{await z(await Al.saveSource(Ny(O,H)))}catch(U){s(U instanceof Error?U.message:String(U))}finally{w(!1)}},children:T?"saving…":"save"})]}),children:c.jsxs("div",{className:"stack",style:{gap:12},children:[c.jsxs("div",{className:"row",style:{gap:12},children:[c.jsx(Ll,{label:"label",children:c.jsx("input",{type:"text",value:O.name??"",onChange:U=>D(ll=>({...ll,name:U.target.value}))})}),c.jsx(Ll,{label:"reached by",children:c.jsxs("select",{value:H,onChange:U=>D(ll=>({...ll,kind:U.target.value})),children:[c.jsx("option",{value:"ssh",children:"ssh — remote host, driven through its docker CLI"}),c.jsx("option",{value:"docker",children:"docker address — a daemon this host can reach"})]})})]}),H==="docker"?c.jsxs(c.Fragment,{children:[c.jsx(Ll,{label:"docker address",children:c.jsx("input",{type:"text",placeholder:"tcp://10.0.0.5:2375",value:O.dockerHost??"",onChange:U=>D(ll=>({...ll,dockerHost:U.target.value}))})}),c.jsxs("div",{className:"small muted",children:["Any address the docker CLI accepts: ",c.jsx("span",{className:"mono",children:"tcp://host:2375"}),", or another socket with"," ",c.jsx("span",{className:"mono",children:"unix:///path/docker.sock"}),". A TLS-protected daemon uses the certificates from"," ",c.jsx("span",{className:"mono",children:"DOCKER_CERT_PATH"})," in dockmv's own environment."]}),c.jsxs(ht,{kind:"warn",children:["A plain ",c.jsx("span",{className:"mono",children:"tcp://"})," daemon is unauthenticated: anyone who can reach that port is root on that host. Prefer an ssh source unless the port is already protected."]})]}):c.jsxs(c.Fragment,{children:[c.jsx(Yr,{value:b,set:V,where:"source host"}),c.jsxs("div",{className:"small muted",children:["Needs ",c.jsx("span",{className:"mono",children:"sshd"})," and a docker CLI of 18.09 or newer on that host — the API is tunnelled through ",c.jsx("span",{className:"mono",children:"docker system dial-stdio"}),". Nothing is installed."]})]})]})})}function Ny(o,S){const z={id:o.id,name:o.name,kind:S};if(S==="docker")return z.dockerHost=o.dockerHost,z;const s=o.ssh??{};return z.ssh={host:s.host??"",port:s.port??22,user:s.user??"",auth:s.auth??"password",password:s.password,privateKey:s.privateKey,privateKeyPath:s.privateKeyPath,passphrase:s.passphrase,sudo:s.sudo??!1,dockerCmd:s.dockerCmd,saveSecrets:s.saveSecrets??!1},z}function Ay({source:o,plan:S,includedCount:z,options:s,setOptions:O,connections:D,activeConn:T,setActiveConn:w,reloadConnections:H,targetInv:b,connectTarget:V,onJobStarted:E,onError:U}){const[ll,W]=Q.useState(null),[vl,Yl]=Q.useState(null),[gl,_l]=Q.useState(null),[dl,el]=Q.useState(""),[Sl,Nl]=Q.useState(""),[C,Z]=Q.useState("tar"),B=D.find(M=>M.id===T),$=b?.preflight,sl=!!$?.serverVersion;async function jl(M,K){el(M);try{await K()}catch(nl){nl instanceof Fu&&nl.needsTrust?await tt():U(nl instanceof Error?nl.message:String(nl))}finally{el("")}}const at=Q.useCallback(()=>{T&&jl("test",()=>V(T))},[T]);Q.useEffect(()=>{at()},[at]);async function tt(){if(T)try{Yl(await Al.probe(T))}catch(M){U(M instanceof Error?M.message:String(M))}}async function Cl(){!T||!vl||await jl("trust",async()=>{await Al.trust(T,vl.fingerprint),Yl(null),await V(T)})}const j=z>0&&sl&&!dl,R=z>0&&!dl;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"section",children:[c.jsx("h3",{children:"target host"}),c.jsxs("div",{className:"stack",children:[c.jsxs("div",{className:"row",children:[c.jsxs("select",{value:T,onChange:M=>w(M.target.value),children:[c.jsx("option",{value:"",children:"— no target selected —"}),D.map(M=>c.jsxs("option",{value:M.id,children:[M.name," (",M.user,"@",M.host,")"]},M.id))]}),c.jsx("button",{className:"btn tiny",onClick:()=>W({port:22,auth:"password",saveSecrets:!1,sudo:!1}),children:"new"})]}),B&&c.jsxs("div",{className:"row wrap",style:{gap:6},children:[c.jsx("button",{className:"btn tiny",disabled:!!dl,onClick:at,children:dl==="test"?"connecting…":"connect"}),c.jsx("button",{className:"btn tiny",onClick:()=>W(B),children:"edit"}),c.jsx("button",{className:"btn tiny",onClick:tt,children:"host key"}),c.jsx("button",{className:"btn tiny danger",onClick:()=>{confirm(`Delete connection "${B.name}"?`)&&jl("del",async()=>{await Al.deleteConnection(B.id),H()})},children:"delete"})]}),B&&!b&&c.jsx("div",{className:"small faint",children:"not connected yet"}),$&&c.jsxs(c.Fragment,{children:[($.problems??[]).map((M,K)=>c.jsx(ht,{kind:"warn",children:M},K)),sl&&c.jsxs("dl",{className:"kv",children:[c.jsx("dt",{children:"host"}),c.jsx("dd",{children:b?.host||B?.host}),c.jsx("dt",{children:"docker"}),c.jsxs("dd",{children:[$.serverVersion," · ",$.os,"/",$.arch]}),c.jsx("dt",{children:"free space"}),c.jsxs("dd",{children:[ie($.diskFreeBytes)," on ",$.dockerRoot]}),c.jsx("dt",{children:"existing"}),c.jsxs("dd",{children:[(b?.containers??[]).length," containers ·"," ",(b?.volumes??[]).length," volumes"]}),c.jsx("dt",{children:"gzip"}),c.jsx("dd",{children:$.hasGzip?"yes":"missing"})]})]})]})]}),c.jsxs("div",{className:"section",children:[c.jsx("h3",{children:"options"}),c.jsxs("div",{className:"stack",children:[c.jsx(Ll,{label:"if the name already exists on the target",children:c.jsxs("select",{value:s.conflict,onChange:M=>O(K=>({...K,conflict:M.target.value})),children:[c.jsx("option",{value:"fail",children:"stop with an error"}),c.jsx("option",{value:"skip",children:"skip that container"}),c.jsx("option",{value:"rename",children:"create it under a new name"}),c.jsx("option",{value:"replace",children:"remove the target's container first"})]})}),s.conflict==="rename"&&c.jsx(Ll,{label:"suffix",children:c.jsx("input",{type:"text",value:s.renameSuffix??"",onChange:M=>O(K=>({...K,renameSuffix:M.target.value}))})}),s.conflict==="replace"&&c.jsx(ht,{kind:"warn",children:"Existing containers and volumes with the same name are deleted on the target before the copy."}),c.jsx(rt,{checked:s.compress,onChange:M=>O(K=>({...K,compress:M})),label:"compress transfers (gzip)"}),c.jsx(rt,{checked:s.verifyAfter,onChange:M=>O(K=>({...K,verifyAfter:M})),label:"verify each container after migrating"}),c.jsx(rt,{checked:s.dryRun,onChange:M=>O(K=>({...K,dryRun:M})),label:"dry run — show every command, change nothing"}),c.jsx(Ll,{label:`containers at a time: ${s.parallelism}`,children:c.jsx("input",{type:"range",min:1,max:6,value:s.parallelism,onChange:M=>O(K=>({...K,parallelism:Number(M.target.value)})),style:{width:"100%"}})})]})]}),c.jsxs("div",{className:"section",children:[c.jsx("h3",{children:"migrate over ssh"}),c.jsxs("div",{className:"stack",children:[c.jsx("button",{className:"btn primary",disabled:!j,onClick:()=>jl("ssh",async()=>{const M=await Al.migrateSSH(T,S);E(M)}),children:dl==="ssh"?"starting…":`migrate ${z} container${z===1?"":"s"} to target`}),c.jsx("button",{className:"btn",disabled:z===0||!!dl,onClick:()=>jl("preview",async()=>{_l(await Al.preview(S))}),children:"preview the commands"}),z===0&&c.jsx("div",{className:"small faint",children:"select at least one container"}),z>0&&!sl&&c.jsx("div",{className:"small faint",children:"connect to a target first"})]})]}),c.jsxs("div",{className:"section",children:[c.jsx("h3",{children:"migration package"}),c.jsxs("div",{className:"stack",children:[c.jsxs("div",{className:"small muted",children:["Builds a self-contained folder with the data, the images and an ",c.jsx("span",{className:"mono",children:"install.sh"})," to run on the target. No network between the hosts required."]}),c.jsx(Ll,{label:"package name",children:c.jsx("input",{type:"text",placeholder:"auto (timestamped)",value:Sl,onChange:M=>Nl(M.target.value)})}),c.jsx(Ll,{label:"format",children:c.jsxs("select",{value:C,onChange:M=>Z(M.target.value),children:[c.jsx("option",{value:"tar",children:"single .tar file (downloadable)"}),c.jsx("option",{value:"dir",children:"directory on this host"})]})}),c.jsx("button",{className:"btn",disabled:!R,onClick:()=>jl("pkg",async()=>{const M=await Al.buildPackage({...S,packageName:Sl},C);E(M)}),children:dl==="pkg"?"starting…":"build package"})]})]}),o?.inventory.warnings?.length?c.jsxs("div",{className:"section",children:[c.jsx("h3",{children:"source warnings"}),c.jsx("div",{className:"stack",children:o.inventory.warnings.map((M,K)=>c.jsx(ht,{kind:"warn",children:M},K))})]}):null,ll&&c.jsx(_y,{initial:ll,onClose:()=>W(null),onSaved:M=>{W(null),H(),w(M.id)},onError:U}),vl&&c.jsx(Gr,{info:vl,onClose:()=>Yl(null),onTrust:Cl}),gl&&c.jsx(Oy,{data:gl,onClose:()=>_l(null)})]})}function _y({initial:o,onClose:S,onSaved:z,onError:s}){const[O,D]=Q.useState(o),[T,w]=Q.useState(!1);function H(b,V){D(E=>({...E,[b]:V}))}return c.jsx(Iu,{title:o.id?`Edit ${o.name}`:"New target host",onClose:S,footer:c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"btn",onClick:S,children:"cancel"}),c.jsx("button",{className:"btn primary",disabled:T||!O.host||!O.user,onClick:async()=>{w(!0);try{z(await Al.saveConnection(O))}catch(b){s(b instanceof Error?b.message:String(b))}finally{w(!1)}},children:T?"saving…":"save"})]}),children:c.jsxs("div",{className:"stack",style:{gap:12},children:[c.jsx(Ll,{label:"label",children:c.jsx("input",{type:"text",value:O.name??"",onChange:b=>H("name",b.target.value)})}),c.jsx(Yr,{value:O,set:H,where:"target"})]})})}function Oy({data:o,onClose:S}){const z=o.items.reduce((s,O)=>s+O.totalBytes,0);return c.jsx(Iu,{title:"What this migration will run",wide:!0,onClose:S,footer:c.jsx("button",{className:"btn",onClick:S,children:"close"}),children:c.jsxs("div",{className:"stack",style:{gap:16},children:[c.jsxs("div",{className:"small muted",children:[o.items.length," container(s)",z>0&&c.jsxs(c.Fragment,{children:[" · about ",ie(z)," of known volume data"]}),". These are the commands that run on the target; data is streamed into ",c.jsx("span",{className:"mono",children:"docker cp"})," rather than written to a file."]}),(o.networkCommands??[]).length>0&&c.jsxs("div",{children:[c.jsx("h3",{style:{margin:"0 0 6px",fontSize:12},children:"shared networks"}),c.jsx("pre",{className:"cmdblock",children:(o.networkCommands??[]).join(` `)})]}),o.items.map(s=>c.jsxs("div",{children:[c.jsxs("h3",{style:{margin:"0 0 6px",fontSize:12},children:[s.name,s.targetName!==s.name&&c.jsxs("span",{className:"faint",children:[" → ",s.targetName]})]}),(s.warnings??[]).map((O,D)=>c.jsx(ht,{kind:"warn",children:O},`w${D}`)),(s.notes??[]).map((O,D)=>c.jsxs("div",{className:"small faint",children:["· ",O]},`n${D}`)),c.jsx("pre",{className:"cmdblock",children:(s.commands??[]).join(` `)})]},s.containerId))]})})}function My({jobs:o,activeJob:S,setActiveJob:z,reload:s,reloadPackages:O}){const D=S||o[0]?.id||"";return o.length===0?c.jsx("div",{className:"empty",children:"no migrations yet — select containers and start one"}):c.jsxs("div",{style:{display:"flex",minHeight:0,height:"100%"},children:[c.jsx("div",{className:"joblist",style:{width:320,flex:"0 0 320px",overflow:"auto"},children:o.map(T=>c.jsxs("div",{className:`jobcard${T.id===D?" active":""}`,onClick:()=>z(T.id),children:[c.jsxs("div",{className:"row",children:[c.jsx(Un,{state:T.state}),c.jsx("span",{className:"spacer"}),c.jsx("span",{className:"small faint",children:T.kind==="ssh"?"ssh":"package"})]}),c.jsx("div",{className:"truncate",style:{marginTop:2},children:T.title}),c.jsxs("div",{className:"small faint",children:[new Date(T.createdAt).toLocaleTimeString()," · ",qr(T.startedAt,T.endedAt),T.dryRun&&" · dry run"]}),c.jsx("div",{style:{marginTop:6},children:c.jsx(zf,{done:T.bytesDone,total:T.bytesTotal,state:T.state})})]},T.id))}),c.jsx("div",{style:{flex:1,minWidth:0,overflow:"auto",borderLeft:"1px solid var(--border)"},children:D&&c.jsx(Dy,{id:D,reload:s,reloadPackages:O})})]})}function Dy({id:o,reload:S,reloadPackages:z}){const[s,O]=Q.useState(null),[D,T]=Q.useState(!0),w=Q.useRef(null),H=Q.useRef(!0);Q.useEffect(()=>{O(null);let E=!1;Al.job(o).then(ll=>!E&&O(ll)).catch(()=>{});const U=Al.jobEvents(o);return U.onmessage=ll=>{try{O(JSON.parse(ll.data))}catch{}},U.addEventListener("done",()=>{U.close(),S(),z()}),U.onerror=()=>U.close(),()=>{E=!0,U.close()}},[o,S,z]);const b=Q.useMemo(()=>(s?.log??[]).filter(E=>D||E.level!=="cmd"),[s,D]);if(Q.useEffect(()=>{const E=w.current;E&&H.current&&(E.scrollTop=E.scrollHeight)},[b]),!s)return c.jsx("div",{className:"empty",children:"loading…"});const V=s.state==="running"||s.state==="pending";return c.jsxs("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:14},children:[c.jsxs("div",{className:"row",children:[c.jsx(Un,{state:s.state}),c.jsx("b",{children:s.title}),s.dryRun&&c.jsx("span",{className:"badge",children:"dry run"}),c.jsx("span",{className:"spacer"}),c.jsxs("span",{className:"small faint",children:[ie(s.bytesDone),s.bytesTotal>0&&c.jsxs(c.Fragment,{children:[" of ",ie(s.bytesTotal)]})," · ",qr(s.startedAt,s.endedAt)]}),V?c.jsx("button",{className:"btn tiny danger",onClick:()=>Al.cancelJob(s.id).then(S),children:"cancel"}):c.jsx("button",{className:"btn tiny ghost",onClick:()=>Al.deleteJob(s.id).then(S),children:"remove"})]}),c.jsx(zf,{done:s.bytesDone,total:s.bytesTotal,state:s.state}),s.error&&c.jsx(ht,{kind:"err",children:s.error}),s.state==="succeeded"&&s.artifact&&c.jsxs(ht,{kind:"ok",children:["Package ready at ",c.jsx("span",{className:"mono",children:s.artifact})," (",ie(s.artifactBytes??0),")."," ","Open the Packages tab to download it."]}),s.items.map(E=>c.jsxs("div",{style:{border:"1px solid var(--border)",borderRadius:6,padding:"8px 10px"},children:[c.jsxs("div",{className:"row",children:[c.jsx(Un,{state:E.state}),c.jsx("b",{children:E.name}),c.jsx("span",{className:"spacer"}),c.jsxs("span",{className:"small faint",children:[E.steps.filter(U=>U.state==="succeeded").length,"/",E.steps.length," steps"]})]}),E.error&&c.jsx("div",{className:"small",style:{color:"var(--err)"},children:E.error}),(E.warnings??[]).map((U,ll)=>c.jsxs("div",{className:"small",style:{color:"var(--warn)"},children:["! ",U]},ll)),c.jsx("div",{className:"steps",children:E.steps.map(U=>c.jsxs("div",{className:`step ${U.state}`,children:[c.jsx(Un,{state:U.state,label:""}),c.jsx("span",{className:"label truncate",title:U.error||U.label,children:U.label}),c.jsx("span",{children:U.bytesTotal>0||U.bytesDone>0?c.jsx(zf,{done:U.bytesDone,total:U.bytesTotal,state:U.state}):null}),c.jsx("span",{className:"faint nowrap",style:{textAlign:"right"},children:U.bytesDone>0?ie(U.bytesDone):U.state==="skipped"?"skipped":""})]},U.id))})]},E.id)),c.jsxs("div",{className:"row",children:[c.jsx("h3",{style:{margin:0,fontSize:12},children:"log"}),c.jsx("span",{className:"spacer"}),c.jsxs("label",{className:"check small",children:[c.jsx("input",{type:"checkbox",checked:D,onChange:E=>T(E.target.checked)}),c.jsx("span",{children:"show commands"})]})]}),c.jsxs("div",{className:"log",ref:w,onScroll:E=>{const U=E.currentTarget;H.current=U.scrollHeight-U.scrollTop-U.clientHeight<24},children:[b.map(E=>c.jsxs("div",{className:`l-${E.level}`,children:[c.jsxs("span",{className:"ts",children:[new Date(E.at).toLocaleTimeString()," "]}),E.message]},E.seq)),b.length===0&&c.jsx("span",{className:"faint",children:"nothing logged yet"})]})]})}function Cy({packages:o,reload:S}){return o.length===0?c.jsx("div",{className:"empty",children:"no packages built yet"}):c.jsxs("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12},children:[c.jsxs(ht,{kind:"info",children:["Copy a package to the target host, then run ",c.jsx("span",{className:"mono",children:"./install.sh --dry-run"})," to review it and"," ",c.jsx("span",{className:"mono",children:"./install.sh"})," to restore. The target needs only bash, gzip and docker."]}),c.jsxs("table",{className:"mount-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"name"}),c.jsx("th",{style:{width:110},children:"kind"}),c.jsx("th",{style:{width:110,textAlign:"right"},children:"size"}),c.jsx("th",{style:{width:170},children:"built"}),c.jsx("th",{style:{width:190}})]})}),c.jsx("tbody",{children:o.map(z=>c.jsxs("tr",{children:[c.jsx("td",{className:"mono truncate",title:z.path,children:z.name}),c.jsx("td",{children:c.jsx("span",{className:"badge",children:z.isDir?"directory":"tar"})}),c.jsx("td",{className:"nowrap",style:{textAlign:"right"},children:ie(z.bytes)}),c.jsx("td",{className:"small faint",children:new Date(z.createdAt).toLocaleString()}),c.jsx("td",{children:c.jsxs("div",{className:"row",style:{justifyContent:"flex-end",gap:6},children:[z.isDir?c.jsx("span",{className:"small faint",title:z.path,children:"copy it from disk"}):c.jsx("a",{className:"btn tiny",href:Al.downloadUrl(z.name),download:!0,children:"download"}),c.jsx("button",{className:"btn tiny danger",onClick:()=>{confirm(`Delete package "${z.name}"? This cannot be undone.`)&&Al.deletePackage(z.name).then(S)},children:"delete"})]})})]},z.name))})]})]})}function Uy(){const[o,S]=Q.useState(null),[z,s]=Q.useState(null),[O,D]=Q.useState({}),[T,w]=Q.useState({conflict:"fail",renameSuffix:"-migrated",compress:!0,compressLevel:1,dryRun:!1,parallelism:1,verifyAfter:!0}),[H,b]=Q.useState({}),[V,E]=Q.useState([]),[U,ll]=Q.useState("local"),[W,vl]=Q.useState(null),[Yl,gl]=Q.useState([]),[_l,dl]=Q.useState(""),[el,Sl]=Q.useState(null),[Nl,C]=Q.useState([]),[Z,B]=Q.useState([]),[$,sl]=Q.useState("containers"),[jl,at]=Q.useState(""),[tt,Cl]=Q.useState(""),[j,R]=Q.useState(!0),M=Q.useCallback(async()=>{R(!0);try{const k=await Al.source();s(k),D(Jl=>{const ce={};for(const Ie of k.inventory.containers)ce[Ie.id]=Jl[Ie.id]??k.defaults[Ie.id];return ce}),Cl(""),Al.volumeSizes().then(Jl=>b(Jl.volumes??{})).catch(()=>{})}catch(k){Cl(k instanceof Error?k.message:String(k))}finally{R(!1)}},[]),K=Q.useCallback(async()=>{try{const k=await Al.health();S(k),k.source&&vl(k.source)}catch{}},[]),nl=Q.useCallback(async()=>{try{const k=await Al.sources();E(k.sources),ll(k.selected),k.current&&vl(k.current)}catch(k){Cl(k instanceof Error?k.message:String(k))}},[]),h=Q.useCallback(async k=>{const Jl=await Al.selectSource(k);ll(k),vl(Jl),D({}),b({}),Cl(""),await M(),await K()},[M,K]),A=Q.useCallback(async()=>{try{const k=await Al.connections();gl(k),dl(Jl=>Jl&&k.some(ce=>ce.id===Jl)?Jl:k[0]?.id??"")}catch(k){Cl(k instanceof Error?k.message:String(k))}},[]),q=Q.useCallback(async()=>{try{C(await Al.jobs())}catch{}},[]),Y=Q.useCallback(async()=>{try{B(await Al.packages())}catch{}},[]);Q.useEffect(()=>{K(),nl(),M(),A(),q(),Y()},[K,nl,M,A,q,Y]),Q.useEffect(()=>{const k=setInterval(q,4e3);return()=>clearInterval(k)},[q]);const F=Q.useCallback(async k=>{if(Sl(null),!k)return;const Jl=await Al.targetInventory(k);Sl(Jl),Cl("")},[]),al=Q.useMemo(()=>Object.values(O).filter(k=>k.include),[O]),rl=Q.useMemo(()=>({items:Object.values(O),options:T}),[O,T]),Kl=Nl.filter(k=>k.state==="running"||k.state==="pending").length,Ul=Q.useCallback(k=>{C(Jl=>[k,...Jl]),at(k.id),sl("jobs")},[]);return c.jsxs("div",{className:"app",children:[c.jsxs("header",{className:"topbar",children:[c.jsxs("div",{className:"brand",children:[c.jsx("img",{src:"/logo-icon.png",alt:"",className:"brand-logo"}),"DockMV"]}),c.jsxs("nav",{className:"tabs",children:[c.jsxs("button",{className:`tab${$==="containers"?" active":""}`,onClick:()=>sl("containers"),children:["Containers",c.jsxs("span",{className:"count",children:[al.length,"/",z?.inventory.containers.length??0]})]}),c.jsxs("button",{className:`tab${$==="jobs"?" active":""}`,onClick:()=>sl("jobs"),children:["Jobs",Kl>0&&c.jsxs("span",{className:"count",children:[Kl," running"]})]}),c.jsxs("button",{className:`tab${$==="packages"?" active":""}`,onClick:()=>sl("packages"),children:["Packages",Z.length>0&&c.jsx("span",{className:"count",children:Z.length})]})]}),c.jsxs("div",{className:"topbar-right",children:[o&&c.jsxs("span",{className:"hostinfo",children:["source ",c.jsx("b",{children:z?.inventory.host||W?.name||o.dockerHost}),W?.kind==="ssh"&&c.jsx(c.Fragment,{children:" · over ssh"}),W?.kind==="docker"&&c.jsxs(c.Fragment,{children:[" · ",W.endpoint]}),o.dockerVersion&&c.jsxs(c.Fragment,{children:[" · docker ",o.dockerVersion]})]}),c.jsx("button",{className:"btn tiny",onClick:M,disabled:j,children:j?"loading…":"refresh"})]})]}),tt&&c.jsx("div",{style:{padding:"10px 16px"},children:c.jsxs(ht,{kind:"err",children:[tt,c.jsx("button",{className:"btn tiny ghost",style:{marginLeft:8},onClick:()=>Cl(""),children:"dismiss"})]})}),o&&!o.ok&&c.jsx("div",{style:{padding:"10px 16px"},children:c.jsxs(ht,{kind:"err",children:["Cannot reach the source ",c.jsx("b",{children:o.source?.name??"docker daemon"}),o.dockerHost&&c.jsxs(c.Fragment,{children:[" at ",c.jsx("span",{className:"mono",children:o.dockerHost})]}),o.dockerError&&c.jsxs(c.Fragment,{children:[" — ",o.dockerError]}),c.jsx("div",{className:"small",children:"Pick another source in the panel on the right."})]})}),c.jsxs("div",{className:"body",children:[c.jsxs("main",{className:"main",children:[$==="containers"&&c.jsx(py,{source:z,sel:O,setSel:D,targetInv:el,loading:j,sizes:H}),$==="jobs"&&c.jsx(My,{jobs:Nl,activeJob:jl,setActiveJob:at,reload:q,reloadPackages:Y}),$==="packages"&&c.jsx(Cy,{packages:Z,reload:Y})]}),$==="containers"&&c.jsxs("aside",{className:"sidebar",children:[c.jsx(zy,{sources:V,selected:U,status:W,selectSource:h,reload:nl,onError:Cl}),c.jsx(Ay,{source:z,plan:rl,includedCount:al.length,options:T,setOptions:w,connections:Yl,activeConn:_l,setActiveConn:dl,reloadConnections:A,targetInv:el,connectTarget:F,onJobStarted:Ul,onError:Cl})]})]})]})}Sy.createRoot(document.getElementById("root")).render(c.jsx(Q.StrictMode,{children:c.jsx(Uy,{})}));