@mmmbuto/nexuscrew 0.8.52-rc.24 → 0.8.52-rc.25
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/frontend/dist/assets/{index-DMOAtI3p.js → index-BVVqvj0C.js} +2 -2
- package/frontend/dist/index.html +1 -1
- package/frontend/dist/version.json +1 -1
- package/lib/cells/scope.js +20 -3
- package/lib/fleet/catalogs/alibaba-token-plan-qwen3.8.json +3 -3
- package/lib/fleet/managed.js +38 -15
- package/package.json +1 -1
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
`+g[P].replace(" at new "," at ");return i.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",i.displayName)),J}while(1<=P&&0<=V);break}}}finally{X=!1,Error.prepareStackTrace=l}return(i=i?i.displayName||i.name:"")?K(i):""}function ce(i){switch(i.tag){case 5:return K(i.type);case 16:return K("Lazy");case 13:return K("Suspense");case 19:return K("SuspenseList");case 0:case 2:case 15:return i=se(i.type,!1),i;case 11:return i=se(i.type.render,!1),i;case 1:return i=se(i.type,!0),i;default:return""}}function fe(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case z:return"Fragment";case Y:return"Portal";case G:return"Profiler";case Z:return"StrictMode";case j:return"Suspense";case T:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case B:return(i.displayName||"Context")+".Consumer";case Q:return(i._context.displayName||"Context")+".Provider";case I:var r=i.render;return i=i.displayName,i||(i=r.displayName||r.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case L:return r=i.displayName||null,r!==null?r:fe(i.type)||"Memo";case $:r=i._payload,i=i._init;try{return fe(i(r))}catch{}}return null}function we(i){var r=i.type;switch(i.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=r.render,i=i.displayName||i.name||"",r.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(r);case 8:return r===Z?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function me(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function be(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function $e(i){var r=be(i)?"checked":"value",l=Object.getOwnPropertyDescriptor(i.constructor.prototype,r),d=""+i[r];if(!i.hasOwnProperty(r)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var g=l.get,_=l.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return g.call(this)},set:function(P){d=""+P,_.call(this,P)}}),Object.defineProperty(i,r,{enumerable:l.enumerable}),{getValue:function(){return d},setValue:function(P){d=""+P},stopTracking:function(){i._valueTracker=null,delete i[r]}}}}function dt(i){i._valueTracker||(i._valueTracker=$e(i))}function Ye(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var l=r.getValue(),d="";return i&&(d=be(i)?i.checked?"true":"false":i.value),i=d,i!==l?(r.setValue(i),!0):!1}function De(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function Pt(i,r){var l=r.checked;return D({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??i._wrapperState.initialChecked})}function Jt(i,r){var l=r.defaultValue==null?"":r.defaultValue,d=r.checked!=null?r.checked:r.defaultChecked;l=me(r.value!=null?r.value:l),i._wrapperState={initialChecked:d,initialValue:l,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function Me(i,r){r=r.checked,r!=null&&F(i,"checked",r,!1)}function Et(i,r){Me(i,r);var l=me(r.value),d=r.type;if(l!=null)d==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+l):i.value!==""+l&&(i.value=""+l);else if(d==="submit"||d==="reset"){i.removeAttribute("value");return}r.hasOwnProperty("value")?bt(i,r.type,l):r.hasOwnProperty("defaultValue")&&bt(i,r.type,me(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(i.defaultChecked=!!r.defaultChecked)}function gt(i,r,l){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var d=r.type;if(!(d!=="submit"&&d!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+i._wrapperState.initialValue,l||r===i.value||(i.value=r),i.defaultValue=r}l=i.name,l!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,l!==""&&(i.name=l)}function bt(i,r,l){(r!=="number"||De(i.ownerDocument)!==i)&&(l==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+l&&(i.defaultValue=""+l))}var ht=Array.isArray;function rt(i,r,l,d){if(i=i.options,r){r={};for(var g=0;g<l.length;g++)r["$"+l[g]]=!0;for(l=0;l<i.length;l++)g=r.hasOwnProperty("$"+i[l].value),i[l].selected!==g&&(i[l].selected=g),g&&d&&(i[l].defaultSelected=!0)}else{for(l=""+me(l),r=null,g=0;g<i.length;g++){if(i[g].value===l){i[g].selected=!0,d&&(i[g].defaultSelected=!0);return}r!==null||i[g].disabled||(r=i[g])}r!==null&&(r.selected=!0)}}function at(i,r){if(r.dangerouslySetInnerHTML!=null)throw Error(n(91));return D({},r,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function ie(i,r){var l=r.value;if(l==null){if(l=r.children,r=r.defaultValue,l!=null){if(r!=null)throw Error(n(92));if(ht(l)){if(1<l.length)throw Error(n(93));l=l[0]}r=l}r==null&&(r=""),l=r}i._wrapperState={initialValue:me(l)}}function xe(i,r){var l=me(r.value),d=me(r.defaultValue);l!=null&&(l=""+l,l!==i.value&&(i.value=l),r.defaultValue==null&&i.defaultValue!==l&&(i.defaultValue=l)),d!=null&&(i.defaultValue=""+d)}function Ie(i){var r=i.textContent;r===i._wrapperState.initialValue&&r!==""&&r!==null&&(i.value=r)}function Be(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ue(i,r){return i==null||i==="http://www.w3.org/1999/xhtml"?Be(r):i==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var oe,H=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(r,l,d,g){MSApp.execUnsafeLocalFunction(function(){return i(r,l,d,g)})}:i})(function(i,r){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=r;else{for(oe=oe||document.createElement("div"),oe.innerHTML="<svg>"+r.valueOf().toString()+"</svg>",r=oe.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;r.firstChild;)i.appendChild(r.firstChild)}});function te(i,r){if(r){var l=i.firstChild;if(l&&l===i.lastChild&&l.nodeType===3){l.nodeValue=r;return}}i.textContent=r}var U={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},le=["Webkit","ms","Moz","O"];Object.keys(U).forEach(function(i){le.forEach(function(r){r=r+i.charAt(0).toUpperCase()+i.substring(1),U[r]=U[i]})});function de(i,r,l){return r==null||typeof r=="boolean"||r===""?"":l||typeof r!="number"||r===0||U.hasOwnProperty(i)&&U[i]?(""+r).trim():r+"px"}function ge(i,r){i=i.style;for(var l in r)if(r.hasOwnProperty(l)){var d=l.indexOf("--")===0,g=de(l,r[l],d);l==="float"&&(l="cssFloat"),d?i.setProperty(l,g):i[l]=g}}var Le=D({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _e(i,r){if(r){if(Le[i]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(n(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(n(61))}if(r.style!=null&&typeof r.style!="object")throw Error(n(62))}}function Ee(i,r){if(i.indexOf("-")===-1)return typeof r.is=="string";switch(i){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 tt=null;function ot(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Qe=null,Mt=null,ct=null;function Ze(i){if(i=mo(i)){if(typeof Qe!="function")throw Error(n(280));var r=i.stateNode;r&&(r=ja(r),Qe(i.stateNode,i.type,r))}}function Zt(i){Mt?ct?ct.push(i):ct=[i]:Mt=i}function ni(){if(Mt){var i=Mt,r=ct;if(ct=Mt=null,Ze(i),r)for(i=0;i<r.length;i++)Ze(r[i])}}function Wn(i,r){return i(r)}function ui(){}var he=!1;function je(i,r,l){if(he)return i(r,l);he=!0;try{return Wn(i,r,l)}finally{he=!1,(Mt!==null||ct!==null)&&(ui(),ni())}}function Ke(i,r){var l=i.stateNode;if(l===null)return null;var d=ja(l);if(d===null)return null;l=d[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(i=i.type,d=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!d;break e;default:i=!1}if(i)return null;if(l&&typeof l!="function")throw Error(n(231,r,typeof l));return l}var ft=!1;if(h)try{var vt={};Object.defineProperty(vt,"passive",{get:function(){ft=!0}}),window.addEventListener("test",vt,vt),window.removeEventListener("test",vt,vt)}catch{ft=!1}function bs(i,r,l,d,g,_,P,V,J){var ae=Array.prototype.slice.call(arguments,3);try{r.apply(l,ae)}catch(Se){this.onError(Se)}}var Ui=!1,Ss=null,xs=!1,di=null,Kn={onError:function(i){Ui=!0,Ss=i}};function Kr(i,r,l,d,g,_,P,V,J){Ui=!1,Ss=null,bs.apply(Kn,arguments)}function la(i,r,l,d,g,_,P,V,J){if(Kr.apply(this,arguments),Ui){if(Ui){var ae=Ss;Ui=!1,Ss=null}else throw Error(n(198));xs||(xs=!0,di=ae)}}function zt(i){var r=i,l=i;if(i.alternate)for(;r.return;)r=r.return;else{i=r;do r=i,(r.flags&4098)!==0&&(l=r.return),i=r.return;while(i)}return r.tag===3?l:null}function qr(i){if(i.tag===13){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function ks(i){if(zt(i)!==i)throw Error(n(188))}function Cs(i){var r=i.alternate;if(!r){if(r=zt(i),r===null)throw Error(n(188));return r!==i?null:i}for(var l=i,d=r;;){var g=l.return;if(g===null)break;var _=g.alternate;if(_===null){if(d=g.return,d!==null){l=d;continue}break}if(g.child===_.child){for(_=g.child;_;){if(_===l)return ks(g),i;if(_===d)return ks(g),r;_=_.sibling}throw Error(n(188))}if(l.return!==d.return)l=g,d=_;else{for(var P=!1,V=g.child;V;){if(V===l){P=!0,l=g,d=_;break}if(V===d){P=!0,d=g,l=_;break}V=V.sibling}if(!P){for(V=_.child;V;){if(V===l){P=!0,l=_,d=g;break}if(V===d){P=!0,d=_,l=g;break}V=V.sibling}if(!P)throw Error(n(189))}}if(l.alternate!==d)throw Error(n(190))}if(l.tag!==3)throw Error(n(188));return l.stateNode.current===l?i:r}function Es(i){return i=Cs(i),i!==null?Vr(i):null}function Vr(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var r=Vr(i);if(r!==null)return r;i=i.sibling}return null}var Ns=t.unstable_scheduleCallback,Yr=t.unstable_cancelCallback,tr=t.unstable_shouldYield,ca=t.unstable_requestPaint,Nt=t.unstable_now,pe=t.unstable_getCurrentPriorityLevel,He=t.unstable_ImmediatePriority,Ve=t.unstable_UserBlockingPriority,qe=t.unstable_NormalPriority,_t=t.unstable_LowPriority,St=t.unstable_IdlePriority,Ut=null,en=null;function dc(i){if(en&&typeof en.onCommitFiberRoot=="function")try{en.onCommitFiberRoot(Ut,i,void 0,(i.current.flags&128)===128)}catch{}}var Nn=Math.clz32?Math.clz32:Sb,Gr=Math.log,bb=Math.LN2;function Sb(i){return i>>>=0,i===0?32:31-(Gr(i)/bb|0)|0}var ua=64,da=4194304;function Xr(i){switch(i&-i){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:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function ha(i,r){var l=i.pendingLanes;if(l===0)return 0;var d=0,g=i.suspendedLanes,_=i.pingedLanes,P=l&268435455;if(P!==0){var V=P&~g;V!==0?d=Xr(V):(_&=P,_!==0&&(d=Xr(_)))}else P=l&~g,P!==0?d=Xr(P):_!==0&&(d=Xr(_));if(d===0)return 0;if(r!==0&&r!==d&&(r&g)===0&&(g=d&-d,_=r&-r,g>=_||g===16&&(_&4194240)!==0))return r;if((d&4)!==0&&(d|=l&16),r=i.entangledLanes,r!==0)for(i=i.entanglements,r&=d;0<r;)l=31-Nn(r),g=1<<l,d|=i[l],r&=~g;return d}function xb(i,r){switch(i){case 1:case 2:case 4:return r+250;case 8:case 16:case 32:case 64: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 r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function kb(i,r){for(var l=i.suspendedLanes,d=i.pingedLanes,g=i.expirationTimes,_=i.pendingLanes;0<_;){var P=31-Nn(_),V=1<<P,J=g[P];J===-1?((V&l)===0||(V&d)!==0)&&(g[P]=xb(V,r)):J<=r&&(i.expiredLanes|=V),_&=~V}}function hc(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function $f(){var i=ua;return ua<<=1,(ua&4194240)===0&&(ua=64),i}function fc(i){for(var r=[],l=0;31>l;l++)r.push(i);return r}function Qr(i,r,l){i.pendingLanes|=r,r!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,r=31-Nn(r),i[r]=l}function Cb(i,r){var l=i.pendingLanes&~r;i.pendingLanes=r,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=r,i.mutableReadLanes&=r,i.entangledLanes&=r,r=i.entanglements;var d=i.eventTimes;for(i=i.expirationTimes;0<l;){var g=31-Nn(l),_=1<<g;r[g]=0,d[g]=-1,i[g]=-1,l&=~_}}function pc(i,r){var l=i.entangledLanes|=r;for(i=i.entanglements;l;){var d=31-Nn(l),g=1<<d;g&r|i[d]&r&&(i[d]|=r),l&=~g}}var pt=0;function Hf(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var Uf,mc,Wf,Kf,qf,gc=!1,fa=[],Wi=null,Ki=null,qi=null,Jr=new Map,Zr=new Map,Vi=[],Eb="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 submit".split(" ");function Vf(i,r){switch(i){case"focusin":case"focusout":Wi=null;break;case"dragenter":case"dragleave":Ki=null;break;case"mouseover":case"mouseout":qi=null;break;case"pointerover":case"pointerout":Jr.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zr.delete(r.pointerId)}}function eo(i,r,l,d,g,_){return i===null||i.nativeEvent!==_?(i={blockedOn:r,domEventName:l,eventSystemFlags:d,nativeEvent:_,targetContainers:[g]},r!==null&&(r=mo(r),r!==null&&mc(r)),i):(i.eventSystemFlags|=d,r=i.targetContainers,g!==null&&r.indexOf(g)===-1&&r.push(g),i)}function Nb(i,r,l,d,g){switch(r){case"focusin":return Wi=eo(Wi,i,r,l,d,g),!0;case"dragenter":return Ki=eo(Ki,i,r,l,d,g),!0;case"mouseover":return qi=eo(qi,i,r,l,d,g),!0;case"pointerover":var _=g.pointerId;return Jr.set(_,eo(Jr.get(_)||null,i,r,l,d,g)),!0;case"gotpointercapture":return _=g.pointerId,Zr.set(_,eo(Zr.get(_)||null,i,r,l,d,g)),!0}return!1}function Yf(i){var r=js(i.target);if(r!==null){var l=zt(r);if(l!==null){if(r=l.tag,r===13){if(r=qr(l),r!==null){i.blockedOn=r,qf(i.priority,function(){Wf(l)});return}}else if(r===3&&l.stateNode.current.memoizedState.isDehydrated){i.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}i.blockedOn=null}function pa(i){if(i.blockedOn!==null)return!1;for(var r=i.targetContainers;0<r.length;){var l=_c(i.domEventName,i.eventSystemFlags,r[0],i.nativeEvent);if(l===null){l=i.nativeEvent;var d=new l.constructor(l.type,l);tt=d,l.target.dispatchEvent(d),tt=null}else return r=mo(l),r!==null&&mc(r),i.blockedOn=l,!1;r.shift()}return!0}function Gf(i,r,l){pa(i)&&l.delete(r)}function jb(){gc=!1,Wi!==null&&pa(Wi)&&(Wi=null),Ki!==null&&pa(Ki)&&(Ki=null),qi!==null&&pa(qi)&&(qi=null),Jr.forEach(Gf),Zr.forEach(Gf)}function to(i,r){i.blockedOn===r&&(i.blockedOn=null,gc||(gc=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jb)))}function no(i){function r(g){return to(g,i)}if(0<fa.length){to(fa[0],i);for(var l=1;l<fa.length;l++){var d=fa[l];d.blockedOn===i&&(d.blockedOn=null)}}for(Wi!==null&&to(Wi,i),Ki!==null&&to(Ki,i),qi!==null&&to(qi,i),Jr.forEach(r),Zr.forEach(r),l=0;l<Vi.length;l++)d=Vi[l],d.blockedOn===i&&(d.blockedOn=null);for(;0<Vi.length&&(l=Vi[0],l.blockedOn===null);)Yf(l),l.blockedOn===null&&Vi.shift()}var nr=O.ReactCurrentBatchConfig,ma=!0;function Rb(i,r,l,d){var g=pt,_=nr.transition;nr.transition=null;try{pt=1,vc(i,r,l,d)}finally{pt=g,nr.transition=_}}function Pb(i,r,l,d){var g=pt,_=nr.transition;nr.transition=null;try{pt=4,vc(i,r,l,d)}finally{pt=g,nr.transition=_}}function vc(i,r,l,d){if(ma){var g=_c(i,r,l,d);if(g===null)Mc(i,r,d,ga,l),Vf(i,d);else if(Nb(g,i,r,l,d))d.stopPropagation();else if(Vf(i,d),r&4&&-1<Eb.indexOf(i)){for(;g!==null;){var _=mo(g);if(_!==null&&Uf(_),_=_c(i,r,l,d),_===null&&Mc(i,r,d,ga,l),_===g)break;g=_}g!==null&&d.stopPropagation()}else Mc(i,r,d,null,l)}}var ga=null;function _c(i,r,l,d){if(ga=null,i=ot(d),i=js(i),i!==null)if(r=zt(i),r===null)i=null;else if(l=r.tag,l===13){if(i=qr(r),i!==null)return i;i=null}else if(l===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null);return ga=i,null}function Xf(i){switch(i){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(pe()){case He:return 1;case Ve:return 4;case qe:case _t:return 16;case St:return 536870912;default:return 16}default:return 16}}var Yi=null,yc=null,va=null;function Qf(){if(va)return va;var i,r=yc,l=r.length,d,g="value"in Yi?Yi.value:Yi.textContent,_=g.length;for(i=0;i<l&&r[i]===g[i];i++);var P=l-i;for(d=1;d<=P&&r[l-d]===g[_-d];d++);return va=g.slice(i,1<d?1-d:void 0)}function _a(i){var r=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&r===13&&(i=13)):i=r,i===10&&(i=13),32<=i||i===13?i:0}function ya(){return!0}function Jf(){return!1}function Mn(i){function r(l,d,g,_,P){this._reactName=l,this._targetInst=g,this.type=d,this.nativeEvent=_,this.target=P,this.currentTarget=null;for(var V in i)i.hasOwnProperty(V)&&(l=i[V],this[V]=l?l(_):_[V]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?ya:Jf,this.isPropagationStopped=Jf,this}return D(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=ya)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=ya)},persist:function(){},isPersistent:ya}),r}var ir={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wc=Mn(ir),io=D({},ir,{view:0,detail:0}),Lb=Mn(io),bc,Sc,so,wa=D({},io,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kc,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==so&&(so&&i.type==="mousemove"?(bc=i.screenX-so.screenX,Sc=i.screenY-so.screenY):Sc=bc=0,so=i),bc)},movementY:function(i){return"movementY"in i?i.movementY:Sc}}),Zf=Mn(wa),Ab=D({},wa,{dataTransfer:0}),Tb=Mn(Ab),Db=D({},io,{relatedTarget:0}),xc=Mn(Db),Mb=D({},ir,{animationName:0,elapsedTime:0,pseudoElement:0}),Ib=Mn(Mb),Ob=D({},ir,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),Bb=Mn(Ob),zb=D({},ir,{data:0}),ep=Mn(zb),Fb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$b={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"},Hb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ub(i){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(i):(i=Hb[i])?!!r[i]:!1}function kc(){return Ub}var Wb=D({},io,{key:function(i){if(i.key){var r=Fb[i.key]||i.key;if(r!=="Unidentified")return r}return i.type==="keypress"?(i=_a(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?$b[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kc,charCode:function(i){return i.type==="keypress"?_a(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?_a(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Kb=Mn(Wb),qb=D({},wa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tp=Mn(qb),Vb=D({},io,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kc}),Yb=Mn(Vb),Gb=D({},ir,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xb=Mn(Gb),Qb=D({},wa,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),Jb=Mn(Qb),Zb=[9,13,27,32],Cc=h&&"CompositionEvent"in window,ro=null;h&&"documentMode"in document&&(ro=document.documentMode);var eS=h&&"TextEvent"in window&&!ro,np=h&&(!Cc||ro&&8<ro&&11>=ro),ip=" ",sp=!1;function rp(i,r){switch(i){case"keyup":return Zb.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function op(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var sr=!1;function tS(i,r){switch(i){case"compositionend":return op(r);case"keypress":return r.which!==32?null:(sp=!0,ip);case"textInput":return i=r.data,i===ip&&sp?null:i;default:return null}}function nS(i,r){if(sr)return i==="compositionend"||!Cc&&rp(i,r)?(i=Qf(),va=yc=Yi=null,sr=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return np&&r.locale!=="ko"?null:r.data;default:return null}}var iS={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 ap(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r==="input"?!!iS[i.type]:r==="textarea"}function lp(i,r,l,d){Zt(d),r=Ca(r,"onChange"),0<r.length&&(l=new wc("onChange","change",null,l,d),i.push({event:l,listeners:r}))}var oo=null,ao=null;function sS(i){Ep(i,0)}function ba(i){var r=cr(i);if(Ye(r))return i}function rS(i,r){if(i==="change")return r}var cp=!1;if(h){var Ec;if(h){var Nc="oninput"in document;if(!Nc){var up=document.createElement("div");up.setAttribute("oninput","return;"),Nc=typeof up.oninput=="function"}Ec=Nc}else Ec=!1;cp=Ec&&(!document.documentMode||9<document.documentMode)}function dp(){oo&&(oo.detachEvent("onpropertychange",hp),ao=oo=null)}function hp(i){if(i.propertyName==="value"&&ba(ao)){var r=[];lp(r,ao,i,ot(i)),je(sS,r)}}function oS(i,r,l){i==="focusin"?(dp(),oo=r,ao=l,oo.attachEvent("onpropertychange",hp)):i==="focusout"&&dp()}function aS(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return ba(ao)}function lS(i,r){if(i==="click")return ba(r)}function cS(i,r){if(i==="input"||i==="change")return ba(r)}function uS(i,r){return i===r&&(i!==0||1/i===1/r)||i!==i&&r!==r}var ii=typeof Object.is=="function"?Object.is:uS;function lo(i,r){if(ii(i,r))return!0;if(typeof i!="object"||i===null||typeof r!="object"||r===null)return!1;var l=Object.keys(i),d=Object.keys(r);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var g=l[d];if(!p.call(r,g)||!ii(i[g],r[g]))return!1}return!0}function fp(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function pp(i,r){var l=fp(i);i=0;for(var d;l;){if(l.nodeType===3){if(d=i+l.textContent.length,i<=r&&d>=r)return{node:l,offset:r-i};i=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=fp(l)}}function mp(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?mp(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function gp(){for(var i=window,r=De();r instanceof i.HTMLIFrameElement;){try{var l=typeof r.contentWindow.location.href=="string"}catch{l=!1}if(l)i=r.contentWindow;else break;r=De(i.document)}return r}function jc(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r&&(r==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||r==="textarea"||i.contentEditable==="true")}function dS(i){var r=gp(),l=i.focusedElem,d=i.selectionRange;if(r!==l&&l&&l.ownerDocument&&mp(l.ownerDocument.documentElement,l)){if(d!==null&&jc(l)){if(r=d.start,i=d.end,i===void 0&&(i=r),"selectionStart"in l)l.selectionStart=r,l.selectionEnd=Math.min(i,l.value.length);else if(i=(r=l.ownerDocument||document)&&r.defaultView||window,i.getSelection){i=i.getSelection();var g=l.textContent.length,_=Math.min(d.start,g);d=d.end===void 0?_:Math.min(d.end,g),!i.extend&&_>d&&(g=d,d=_,_=g),g=pp(l,_);var P=pp(l,d);g&&P&&(i.rangeCount!==1||i.anchorNode!==g.node||i.anchorOffset!==g.offset||i.focusNode!==P.node||i.focusOffset!==P.offset)&&(r=r.createRange(),r.setStart(g.node,g.offset),i.removeAllRanges(),_>d?(i.addRange(r),i.extend(P.node,P.offset)):(r.setEnd(P.node,P.offset),i.addRange(r)))}}for(r=[],i=l;i=i.parentNode;)i.nodeType===1&&r.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<r.length;l++)i=r[l],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var hS=h&&"documentMode"in document&&11>=document.documentMode,rr=null,Rc=null,co=null,Pc=!1;function vp(i,r,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Pc||rr==null||rr!==De(d)||(d=rr,"selectionStart"in d&&jc(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),co&&lo(co,d)||(co=d,d=Ca(Rc,"onSelect"),0<d.length&&(r=new wc("onSelect","select",null,r,l),i.push({event:r,listeners:d}),r.target=rr)))}function Sa(i,r){var l={};return l[i.toLowerCase()]=r.toLowerCase(),l["Webkit"+i]="webkit"+r,l["Moz"+i]="moz"+r,l}var or={animationend:Sa("Animation","AnimationEnd"),animationiteration:Sa("Animation","AnimationIteration"),animationstart:Sa("Animation","AnimationStart"),transitionend:Sa("Transition","TransitionEnd")},Lc={},_p={};h&&(_p=document.createElement("div").style,"AnimationEvent"in window||(delete or.animationend.animation,delete or.animationiteration.animation,delete or.animationstart.animation),"TransitionEvent"in window||delete or.transitionend.transition);function xa(i){if(Lc[i])return Lc[i];if(!or[i])return i;var r=or[i],l;for(l in r)if(r.hasOwnProperty(l)&&l in _p)return Lc[i]=r[l];return i}var yp=xa("animationend"),wp=xa("animationiteration"),bp=xa("animationstart"),Sp=xa("transitionend"),xp=new Map,kp="abort auxClick 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(" ");function Gi(i,r){xp.set(i,r),a(r,[i])}for(var Ac=0;Ac<kp.length;Ac++){var Tc=kp[Ac],fS=Tc.toLowerCase(),pS=Tc[0].toUpperCase()+Tc.slice(1);Gi(fS,"on"+pS)}Gi(yp,"onAnimationEnd"),Gi(wp,"onAnimationIteration"),Gi(bp,"onAnimationStart"),Gi("dblclick","onDoubleClick"),Gi("focusin","onFocus"),Gi("focusout","onBlur"),Gi(Sp,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var uo="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(" "),mS=new Set("cancel close invalid load scroll toggle".split(" ").concat(uo));function Cp(i,r,l){var d=i.type||"unknown-event";i.currentTarget=l,la(d,r,void 0,i),i.currentTarget=null}function Ep(i,r){r=(r&4)!==0;for(var l=0;l<i.length;l++){var d=i[l],g=d.event;d=d.listeners;e:{var _=void 0;if(r)for(var P=d.length-1;0<=P;P--){var V=d[P],J=V.instance,ae=V.currentTarget;if(V=V.listener,J!==_&&g.isPropagationStopped())break e;Cp(g,V,ae),_=J}else for(P=0;P<d.length;P++){if(V=d[P],J=V.instance,ae=V.currentTarget,V=V.listener,J!==_&&g.isPropagationStopped())break e;Cp(g,V,ae),_=J}}}if(xs)throw i=di,xs=!1,di=null,i}function xt(i,r){var l=r[$c];l===void 0&&(l=r[$c]=new Set);var d=i+"__bubble";l.has(d)||(Np(r,i,2,!1),l.add(d))}function Dc(i,r,l){var d=0;r&&(d|=4),Np(l,i,d,r)}var ka="_reactListening"+Math.random().toString(36).slice(2);function ho(i){if(!i[ka]){i[ka]=!0,s.forEach(function(l){l!=="selectionchange"&&(mS.has(l)||Dc(l,!1,i),Dc(l,!0,i))});var r=i.nodeType===9?i:i.ownerDocument;r===null||r[ka]||(r[ka]=!0,Dc("selectionchange",!1,r))}}function Np(i,r,l,d){switch(Xf(r)){case 1:var g=Rb;break;case 4:g=Pb;break;default:g=vc}l=g.bind(null,r,l,i),g=void 0,!ft||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(g=!0),d?g!==void 0?i.addEventListener(r,l,{capture:!0,passive:g}):i.addEventListener(r,l,!0):g!==void 0?i.addEventListener(r,l,{passive:g}):i.addEventListener(r,l,!1)}function Mc(i,r,l,d,g){var _=d;if((r&1)===0&&(r&2)===0&&d!==null)e:for(;;){if(d===null)return;var P=d.tag;if(P===3||P===4){var V=d.stateNode.containerInfo;if(V===g||V.nodeType===8&&V.parentNode===g)break;if(P===4)for(P=d.return;P!==null;){var J=P.tag;if((J===3||J===4)&&(J=P.stateNode.containerInfo,J===g||J.nodeType===8&&J.parentNode===g))return;P=P.return}for(;V!==null;){if(P=js(V),P===null)return;if(J=P.tag,J===5||J===6){d=_=P;continue e}V=V.parentNode}}d=d.return}je(function(){var ae=_,Se=ot(l),ke=[];e:{var ye=xp.get(i);if(ye!==void 0){var Pe=wc,Oe=i;switch(i){case"keypress":if(_a(l)===0)break e;case"keydown":case"keyup":Pe=Kb;break;case"focusin":Oe="focus",Pe=xc;break;case"focusout":Oe="blur",Pe=xc;break;case"beforeblur":case"afterblur":Pe=xc;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Pe=Zf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Pe=Tb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Pe=Yb;break;case yp:case wp:case bp:Pe=Ib;break;case Sp:Pe=Xb;break;case"scroll":Pe=Lb;break;case"wheel":Pe=Jb;break;case"copy":case"cut":case"paste":Pe=Bb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Pe=tp}var ze=(r&4)!==0,Ft=!ze&&i==="scroll",ne=ze?ye!==null?ye+"Capture":null:ye;ze=[];for(var ee=ae,re;ee!==null;){re=ee;var Ce=re.stateNode;if(re.tag===5&&Ce!==null&&(re=Ce,ne!==null&&(Ce=Ke(ee,ne),Ce!=null&&ze.push(fo(ee,Ce,re)))),Ft)break;ee=ee.return}0<ze.length&&(ye=new Pe(ye,Oe,null,l,Se),ke.push({event:ye,listeners:ze}))}}if((r&7)===0){e:{if(ye=i==="mouseover"||i==="pointerover",Pe=i==="mouseout"||i==="pointerout",ye&&l!==tt&&(Oe=l.relatedTarget||l.fromElement)&&(js(Oe)||Oe[ji]))break e;if((Pe||ye)&&(ye=Se.window===Se?Se:(ye=Se.ownerDocument)?ye.defaultView||ye.parentWindow:window,Pe?(Oe=l.relatedTarget||l.toElement,Pe=ae,Oe=Oe?js(Oe):null,Oe!==null&&(Ft=zt(Oe),Oe!==Ft||Oe.tag!==5&&Oe.tag!==6)&&(Oe=null)):(Pe=null,Oe=ae),Pe!==Oe)){if(ze=Zf,Ce="onMouseLeave",ne="onMouseEnter",ee="mouse",(i==="pointerout"||i==="pointerover")&&(ze=tp,Ce="onPointerLeave",ne="onPointerEnter",ee="pointer"),Ft=Pe==null?ye:cr(Pe),re=Oe==null?ye:cr(Oe),ye=new ze(Ce,ee+"leave",Pe,l,Se),ye.target=Ft,ye.relatedTarget=re,Ce=null,js(Se)===ae&&(ze=new ze(ne,ee+"enter",Oe,l,Se),ze.target=re,ze.relatedTarget=Ft,Ce=ze),Ft=Ce,Pe&&Oe)t:{for(ze=Pe,ne=Oe,ee=0,re=ze;re;re=ar(re))ee++;for(re=0,Ce=ne;Ce;Ce=ar(Ce))re++;for(;0<ee-re;)ze=ar(ze),ee--;for(;0<re-ee;)ne=ar(ne),re--;for(;ee--;){if(ze===ne||ne!==null&&ze===ne.alternate)break t;ze=ar(ze),ne=ar(ne)}ze=null}else ze=null;Pe!==null&&jp(ke,ye,Pe,ze,!1),Oe!==null&&Ft!==null&&jp(ke,Ft,Oe,ze,!0)}}e:{if(ye=ae?cr(ae):window,Pe=ye.nodeName&&ye.nodeName.toLowerCase(),Pe==="select"||Pe==="input"&&ye.type==="file")var Fe=rS;else if(ap(ye))if(cp)Fe=cS;else{Fe=aS;var Ue=oS}else(Pe=ye.nodeName)&&Pe.toLowerCase()==="input"&&(ye.type==="checkbox"||ye.type==="radio")&&(Fe=lS);if(Fe&&(Fe=Fe(i,ae))){lp(ke,Fe,l,Se);break e}Ue&&Ue(i,ye,ae),i==="focusout"&&(Ue=ye._wrapperState)&&Ue.controlled&&ye.type==="number"&&bt(ye,"number",ye.value)}switch(Ue=ae?cr(ae):window,i){case"focusin":(ap(Ue)||Ue.contentEditable==="true")&&(rr=Ue,Rc=ae,co=null);break;case"focusout":co=Rc=rr=null;break;case"mousedown":Pc=!0;break;case"contextmenu":case"mouseup":case"dragend":Pc=!1,vp(ke,l,Se);break;case"selectionchange":if(hS)break;case"keydown":case"keyup":vp(ke,l,Se)}var We;if(Cc)e:{switch(i){case"compositionstart":var Ge="onCompositionStart";break e;case"compositionend":Ge="onCompositionEnd";break e;case"compositionupdate":Ge="onCompositionUpdate";break e}Ge=void 0}else sr?rp(i,l)&&(Ge="onCompositionEnd"):i==="keydown"&&l.keyCode===229&&(Ge="onCompositionStart");Ge&&(np&&l.locale!=="ko"&&(sr||Ge!=="onCompositionStart"?Ge==="onCompositionEnd"&&sr&&(We=Qf()):(Yi=Se,yc="value"in Yi?Yi.value:Yi.textContent,sr=!0)),Ue=Ca(ae,Ge),0<Ue.length&&(Ge=new ep(Ge,i,null,l,Se),ke.push({event:Ge,listeners:Ue}),We?Ge.data=We:(We=op(l),We!==null&&(Ge.data=We)))),(We=eS?tS(i,l):nS(i,l))&&(ae=Ca(ae,"onBeforeInput"),0<ae.length&&(Se=new ep("onBeforeInput","beforeinput",null,l,Se),ke.push({event:Se,listeners:ae}),Se.data=We))}Ep(ke,r)})}function fo(i,r,l){return{instance:i,listener:r,currentTarget:l}}function Ca(i,r){for(var l=r+"Capture",d=[];i!==null;){var g=i,_=g.stateNode;g.tag===5&&_!==null&&(g=_,_=Ke(i,l),_!=null&&d.unshift(fo(i,_,g)),_=Ke(i,r),_!=null&&d.push(fo(i,_,g))),i=i.return}return d}function ar(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function jp(i,r,l,d,g){for(var _=r._reactName,P=[];l!==null&&l!==d;){var V=l,J=V.alternate,ae=V.stateNode;if(J!==null&&J===d)break;V.tag===5&&ae!==null&&(V=ae,g?(J=Ke(l,_),J!=null&&P.unshift(fo(l,J,V))):g||(J=Ke(l,_),J!=null&&P.push(fo(l,J,V)))),l=l.return}P.length!==0&&i.push({event:r,listeners:P})}var gS=/\r\n?/g,vS=/\u0000|\uFFFD/g;function Rp(i){return(typeof i=="string"?i:""+i).replace(gS,`
|
|
38
38
|
`).replace(vS,"")}function Ea(i,r,l){if(r=Rp(r),Rp(i)!==r&&l)throw Error(n(425))}function Na(){}var Ic=null,Oc=null;function Bc(i,r){return i==="textarea"||i==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var zc=typeof setTimeout=="function"?setTimeout:void 0,_S=typeof clearTimeout=="function"?clearTimeout:void 0,Pp=typeof Promise=="function"?Promise:void 0,yS=typeof queueMicrotask=="function"?queueMicrotask:typeof Pp<"u"?function(i){return Pp.resolve(null).then(i).catch(wS)}:zc;function wS(i){setTimeout(function(){throw i})}function Fc(i,r){var l=r,d=0;do{var g=l.nextSibling;if(i.removeChild(l),g&&g.nodeType===8)if(l=g.data,l==="/$"){if(d===0){i.removeChild(g),no(r);return}d--}else l!=="$"&&l!=="$?"&&l!=="$!"||d++;l=g}while(l);no(r)}function Xi(i){for(;i!=null;i=i.nextSibling){var r=i.nodeType;if(r===1||r===3)break;if(r===8){if(r=i.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return i}function Lp(i){i=i.previousSibling;for(var r=0;i;){if(i.nodeType===8){var l=i.data;if(l==="$"||l==="$!"||l==="$?"){if(r===0)return i;r--}else l==="/$"&&r++}i=i.previousSibling}return null}var lr=Math.random().toString(36).slice(2),hi="__reactFiber$"+lr,po="__reactProps$"+lr,ji="__reactContainer$"+lr,$c="__reactEvents$"+lr,bS="__reactListeners$"+lr,SS="__reactHandles$"+lr;function js(i){var r=i[hi];if(r)return r;for(var l=i.parentNode;l;){if(r=l[ji]||l[hi]){if(l=r.alternate,r.child!==null||l!==null&&l.child!==null)for(i=Lp(i);i!==null;){if(l=i[hi])return l;i=Lp(i)}return r}i=l,l=i.parentNode}return null}function mo(i){return i=i[hi]||i[ji],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function cr(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function ja(i){return i[po]||null}var Hc=[],ur=-1;function Qi(i){return{current:i}}function kt(i){0>ur||(i.current=Hc[ur],Hc[ur]=null,ur--)}function yt(i,r){ur++,Hc[ur]=i.current,i.current=r}var Ji={},gn=Qi(Ji),jn=Qi(!1),Rs=Ji;function dr(i,r){var l=i.type.contextTypes;if(!l)return Ji;var d=i.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===r)return d.__reactInternalMemoizedMaskedChildContext;var g={},_;for(_ in l)g[_]=r[_];return d&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=r,i.__reactInternalMemoizedMaskedChildContext=g),g}function Rn(i){return i=i.childContextTypes,i!=null}function Ra(){kt(jn),kt(gn)}function Ap(i,r,l){if(gn.current!==Ji)throw Error(n(168));yt(gn,r),yt(jn,l)}function Tp(i,r,l){var d=i.stateNode;if(r=r.childContextTypes,typeof d.getChildContext!="function")return l;d=d.getChildContext();for(var g in d)if(!(g in r))throw Error(n(108,we(i)||"Unknown",g));return D({},l,d)}function Pa(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Ji,Rs=gn.current,yt(gn,i),yt(jn,jn.current),!0}function Dp(i,r,l){var d=i.stateNode;if(!d)throw Error(n(169));l?(i=Tp(i,r,Rs),d.__reactInternalMemoizedMergedChildContext=i,kt(jn),kt(gn),yt(gn,i)):kt(jn),yt(jn,l)}var Ri=null,La=!1,Uc=!1;function Mp(i){Ri===null?Ri=[i]:Ri.push(i)}function xS(i){La=!0,Mp(i)}function Zi(){if(!Uc&&Ri!==null){Uc=!0;var i=0,r=pt;try{var l=Ri;for(pt=1;i<l.length;i++){var d=l[i];do d=d(!0);while(d!==null)}Ri=null,La=!1}catch(g){throw Ri!==null&&(Ri=Ri.slice(i+1)),Ns(He,Zi),g}finally{pt=r,Uc=!1}}return null}var hr=[],fr=0,Aa=null,Ta=0,qn=[],Vn=0,Ps=null,Pi=1,Li="";function Ls(i,r){hr[fr++]=Ta,hr[fr++]=Aa,Aa=i,Ta=r}function Ip(i,r,l){qn[Vn++]=Pi,qn[Vn++]=Li,qn[Vn++]=Ps,Ps=i;var d=Pi;i=Li;var g=32-Nn(d)-1;d&=~(1<<g),l+=1;var _=32-Nn(r)+g;if(30<_){var P=g-g%5;_=(d&(1<<P)-1).toString(32),d>>=P,g-=P,Pi=1<<32-Nn(r)+g|l<<g|d,Li=_+i}else Pi=1<<_|l<<g|d,Li=i}function Wc(i){i.return!==null&&(Ls(i,1),Ip(i,1,0))}function Kc(i){for(;i===Aa;)Aa=hr[--fr],hr[fr]=null,Ta=hr[--fr],hr[fr]=null;for(;i===Ps;)Ps=qn[--Vn],qn[Vn]=null,Li=qn[--Vn],qn[Vn]=null,Pi=qn[--Vn],qn[Vn]=null}var In=null,On=null,jt=!1,si=null;function Op(i,r){var l=Qn(5,null,null,0);l.elementType="DELETED",l.stateNode=r,l.return=i,r=i.deletions,r===null?(i.deletions=[l],i.flags|=16):r.push(l)}function Bp(i,r){switch(i.tag){case 5:var l=i.type;return r=r.nodeType!==1||l.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(i.stateNode=r,In=i,On=Xi(r.firstChild),!0):!1;case 6:return r=i.pendingProps===""||r.nodeType!==3?null:r,r!==null?(i.stateNode=r,In=i,On=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(l=Ps!==null?{id:Pi,overflow:Li}:null,i.memoizedState={dehydrated:r,treeContext:l,retryLane:1073741824},l=Qn(18,null,null,0),l.stateNode=r,l.return=i,i.child=l,In=i,On=null,!0):!1;default:return!1}}function qc(i){return(i.mode&1)!==0&&(i.flags&128)===0}function Vc(i){if(jt){var r=On;if(r){var l=r;if(!Bp(i,r)){if(qc(i))throw Error(n(418));r=Xi(l.nextSibling);var d=In;r&&Bp(i,r)?Op(d,l):(i.flags=i.flags&-4097|2,jt=!1,In=i)}}else{if(qc(i))throw Error(n(418));i.flags=i.flags&-4097|2,jt=!1,In=i}}}function zp(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;In=i}function Da(i){if(i!==In)return!1;if(!jt)return zp(i),jt=!0,!1;var r;if((r=i.tag!==3)&&!(r=i.tag!==5)&&(r=i.type,r=r!=="head"&&r!=="body"&&!Bc(i.type,i.memoizedProps)),r&&(r=On)){if(qc(i))throw Fp(),Error(n(418));for(;r;)Op(i,r),r=Xi(r.nextSibling)}if(zp(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,r=0;i;){if(i.nodeType===8){var l=i.data;if(l==="/$"){if(r===0){On=Xi(i.nextSibling);break e}r--}else l!=="$"&&l!=="$!"&&l!=="$?"||r++}i=i.nextSibling}On=null}}else On=In?Xi(i.stateNode.nextSibling):null;return!0}function Fp(){for(var i=On;i;)i=Xi(i.nextSibling)}function pr(){On=In=null,jt=!1}function Yc(i){si===null?si=[i]:si.push(i)}var kS=O.ReactCurrentBatchConfig;function go(i,r,l){if(i=l.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(l._owner){if(l=l._owner,l){if(l.tag!==1)throw Error(n(309));var d=l.stateNode}if(!d)throw Error(n(147,i));var g=d,_=""+i;return r!==null&&r.ref!==null&&typeof r.ref=="function"&&r.ref._stringRef===_?r.ref:(r=function(P){var V=g.refs;P===null?delete V[_]:V[_]=P},r._stringRef=_,r)}if(typeof i!="string")throw Error(n(284));if(!l._owner)throw Error(n(290,i))}return i}function Ma(i,r){throw i=Object.prototype.toString.call(r),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":i))}function $p(i){var r=i._init;return r(i._payload)}function Hp(i){function r(ne,ee){if(i){var re=ne.deletions;re===null?(ne.deletions=[ee],ne.flags|=16):re.push(ee)}}function l(ne,ee){if(!i)return null;for(;ee!==null;)r(ne,ee),ee=ee.sibling;return null}function d(ne,ee){for(ne=new Map;ee!==null;)ee.key!==null?ne.set(ee.key,ee):ne.set(ee.index,ee),ee=ee.sibling;return ne}function g(ne,ee){return ne=as(ne,ee),ne.index=0,ne.sibling=null,ne}function _(ne,ee,re){return ne.index=re,i?(re=ne.alternate,re!==null?(re=re.index,re<ee?(ne.flags|=2,ee):re):(ne.flags|=2,ee)):(ne.flags|=1048576,ee)}function P(ne){return i&&ne.alternate===null&&(ne.flags|=2),ne}function V(ne,ee,re,Ce){return ee===null||ee.tag!==6?(ee=zu(re,ne.mode,Ce),ee.return=ne,ee):(ee=g(ee,re),ee.return=ne,ee)}function J(ne,ee,re,Ce){var Fe=re.type;return Fe===z?Se(ne,ee,re.props.children,Ce,re.key):ee!==null&&(ee.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===$&&$p(Fe)===ee.type)?(Ce=g(ee,re.props),Ce.ref=go(ne,ee,re),Ce.return=ne,Ce):(Ce=rl(re.type,re.key,re.props,null,ne.mode,Ce),Ce.ref=go(ne,ee,re),Ce.return=ne,Ce)}function ae(ne,ee,re,Ce){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==re.containerInfo||ee.stateNode.implementation!==re.implementation?(ee=Fu(re,ne.mode,Ce),ee.return=ne,ee):(ee=g(ee,re.children||[]),ee.return=ne,ee)}function Se(ne,ee,re,Ce,Fe){return ee===null||ee.tag!==7?(ee=zs(re,ne.mode,Ce,Fe),ee.return=ne,ee):(ee=g(ee,re),ee.return=ne,ee)}function ke(ne,ee,re){if(typeof ee=="string"&&ee!==""||typeof ee=="number")return ee=zu(""+ee,ne.mode,re),ee.return=ne,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case q:return re=rl(ee.type,ee.key,ee.props,null,ne.mode,re),re.ref=go(ne,null,ee),re.return=ne,re;case Y:return ee=Fu(ee,ne.mode,re),ee.return=ne,ee;case $:var Ce=ee._init;return ke(ne,Ce(ee._payload),re)}if(ht(ee)||M(ee))return ee=zs(ee,ne.mode,re,null),ee.return=ne,ee;Ma(ne,ee)}return null}function ye(ne,ee,re,Ce){var Fe=ee!==null?ee.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return Fe!==null?null:V(ne,ee,""+re,Ce);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case q:return re.key===Fe?J(ne,ee,re,Ce):null;case Y:return re.key===Fe?ae(ne,ee,re,Ce):null;case $:return Fe=re._init,ye(ne,ee,Fe(re._payload),Ce)}if(ht(re)||M(re))return Fe!==null?null:Se(ne,ee,re,Ce,null);Ma(ne,re)}return null}function Pe(ne,ee,re,Ce,Fe){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number")return ne=ne.get(re)||null,V(ee,ne,""+Ce,Fe);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case q:return ne=ne.get(Ce.key===null?re:Ce.key)||null,J(ee,ne,Ce,Fe);case Y:return ne=ne.get(Ce.key===null?re:Ce.key)||null,ae(ee,ne,Ce,Fe);case $:var Ue=Ce._init;return Pe(ne,ee,re,Ue(Ce._payload),Fe)}if(ht(Ce)||M(Ce))return ne=ne.get(re)||null,Se(ee,ne,Ce,Fe,null);Ma(ee,Ce)}return null}function Oe(ne,ee,re,Ce){for(var Fe=null,Ue=null,We=ee,Ge=ee=0,sn=null;We!==null&&Ge<re.length;Ge++){We.index>Ge?(sn=We,We=null):sn=We.sibling;var ut=ye(ne,We,re[Ge],Ce);if(ut===null){We===null&&(We=sn);break}i&&We&&ut.alternate===null&&r(ne,We),ee=_(ut,ee,Ge),Ue===null?Fe=ut:Ue.sibling=ut,Ue=ut,We=sn}if(Ge===re.length)return l(ne,We),jt&&Ls(ne,Ge),Fe;if(We===null){for(;Ge<re.length;Ge++)We=ke(ne,re[Ge],Ce),We!==null&&(ee=_(We,ee,Ge),Ue===null?Fe=We:Ue.sibling=We,Ue=We);return jt&&Ls(ne,Ge),Fe}for(We=d(ne,We);Ge<re.length;Ge++)sn=Pe(We,ne,Ge,re[Ge],Ce),sn!==null&&(i&&sn.alternate!==null&&We.delete(sn.key===null?Ge:sn.key),ee=_(sn,ee,Ge),Ue===null?Fe=sn:Ue.sibling=sn,Ue=sn);return i&&We.forEach(function(ls){return r(ne,ls)}),jt&&Ls(ne,Ge),Fe}function ze(ne,ee,re,Ce){var Fe=M(re);if(typeof Fe!="function")throw Error(n(150));if(re=Fe.call(re),re==null)throw Error(n(151));for(var Ue=Fe=null,We=ee,Ge=ee=0,sn=null,ut=re.next();We!==null&&!ut.done;Ge++,ut=re.next()){We.index>Ge?(sn=We,We=null):sn=We.sibling;var ls=ye(ne,We,ut.value,Ce);if(ls===null){We===null&&(We=sn);break}i&&We&&ls.alternate===null&&r(ne,We),ee=_(ls,ee,Ge),Ue===null?Fe=ls:Ue.sibling=ls,Ue=ls,We=sn}if(ut.done)return l(ne,We),jt&&Ls(ne,Ge),Fe;if(We===null){for(;!ut.done;Ge++,ut=re.next())ut=ke(ne,ut.value,Ce),ut!==null&&(ee=_(ut,ee,Ge),Ue===null?Fe=ut:Ue.sibling=ut,Ue=ut);return jt&&Ls(ne,Ge),Fe}for(We=d(ne,We);!ut.done;Ge++,ut=re.next())ut=Pe(We,ne,Ge,ut.value,Ce),ut!==null&&(i&&ut.alternate!==null&&We.delete(ut.key===null?Ge:ut.key),ee=_(ut,ee,Ge),Ue===null?Fe=ut:Ue.sibling=ut,Ue=ut);return i&&We.forEach(function(i0){return r(ne,i0)}),jt&&Ls(ne,Ge),Fe}function Ft(ne,ee,re,Ce){if(typeof re=="object"&&re!==null&&re.type===z&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case q:e:{for(var Fe=re.key,Ue=ee;Ue!==null;){if(Ue.key===Fe){if(Fe=re.type,Fe===z){if(Ue.tag===7){l(ne,Ue.sibling),ee=g(Ue,re.props.children),ee.return=ne,ne=ee;break e}}else if(Ue.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===$&&$p(Fe)===Ue.type){l(ne,Ue.sibling),ee=g(Ue,re.props),ee.ref=go(ne,Ue,re),ee.return=ne,ne=ee;break e}l(ne,Ue);break}else r(ne,Ue);Ue=Ue.sibling}re.type===z?(ee=zs(re.props.children,ne.mode,Ce,re.key),ee.return=ne,ne=ee):(Ce=rl(re.type,re.key,re.props,null,ne.mode,Ce),Ce.ref=go(ne,ee,re),Ce.return=ne,ne=Ce)}return P(ne);case Y:e:{for(Ue=re.key;ee!==null;){if(ee.key===Ue)if(ee.tag===4&&ee.stateNode.containerInfo===re.containerInfo&&ee.stateNode.implementation===re.implementation){l(ne,ee.sibling),ee=g(ee,re.children||[]),ee.return=ne,ne=ee;break e}else{l(ne,ee);break}else r(ne,ee);ee=ee.sibling}ee=Fu(re,ne.mode,Ce),ee.return=ne,ne=ee}return P(ne);case $:return Ue=re._init,Ft(ne,ee,Ue(re._payload),Ce)}if(ht(re))return Oe(ne,ee,re,Ce);if(M(re))return ze(ne,ee,re,Ce);Ma(ne,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,ee!==null&&ee.tag===6?(l(ne,ee.sibling),ee=g(ee,re),ee.return=ne,ne=ee):(l(ne,ee),ee=zu(re,ne.mode,Ce),ee.return=ne,ne=ee),P(ne)):l(ne,ee)}return Ft}var mr=Hp(!0),Up=Hp(!1),Ia=Qi(null),Oa=null,gr=null,Gc=null;function Xc(){Gc=gr=Oa=null}function Qc(i){var r=Ia.current;kt(Ia),i._currentValue=r}function Jc(i,r,l){for(;i!==null;){var d=i.alternate;if((i.childLanes&r)!==r?(i.childLanes|=r,d!==null&&(d.childLanes|=r)):d!==null&&(d.childLanes&r)!==r&&(d.childLanes|=r),i===l)break;i=i.return}}function vr(i,r){Oa=i,Gc=gr=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&r)!==0&&(Pn=!0),i.firstContext=null)}function Yn(i){var r=i._currentValue;if(Gc!==i)if(i={context:i,memoizedValue:r,next:null},gr===null){if(Oa===null)throw Error(n(308));gr=i,Oa.dependencies={lanes:0,firstContext:i}}else gr=gr.next=i;return r}var As=null;function Zc(i){As===null?As=[i]:As.push(i)}function Wp(i,r,l,d){var g=r.interleaved;return g===null?(l.next=l,Zc(r)):(l.next=g.next,g.next=l),r.interleaved=l,Ai(i,d)}function Ai(i,r){i.lanes|=r;var l=i.alternate;for(l!==null&&(l.lanes|=r),l=i,i=i.return;i!==null;)i.childLanes|=r,l=i.alternate,l!==null&&(l.childLanes|=r),l=i,i=i.return;return l.tag===3?l.stateNode:null}var es=!1;function eu(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Kp(i,r){i=i.updateQueue,r.updateQueue===i&&(r.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Ti(i,r){return{eventTime:i,lane:r,tag:0,payload:null,callback:null,next:null}}function ts(i,r,l){var d=i.updateQueue;if(d===null)return null;if(d=d.shared,(lt&2)!==0){var g=d.pending;return g===null?r.next=r:(r.next=g.next,g.next=r),d.pending=r,Ai(i,l)}return g=d.interleaved,g===null?(r.next=r,Zc(d)):(r.next=g.next,g.next=r),d.interleaved=r,Ai(i,l)}function Ba(i,r,l){if(r=r.updateQueue,r!==null&&(r=r.shared,(l&4194240)!==0)){var d=r.lanes;d&=i.pendingLanes,l|=d,r.lanes=l,pc(i,l)}}function qp(i,r){var l=i.updateQueue,d=i.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var g=null,_=null;if(l=l.firstBaseUpdate,l!==null){do{var P={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};_===null?g=_=P:_=_.next=P,l=l.next}while(l!==null);_===null?g=_=r:_=_.next=r}else g=_=r;l={baseState:d.baseState,firstBaseUpdate:g,lastBaseUpdate:_,shared:d.shared,effects:d.effects},i.updateQueue=l;return}i=l.lastBaseUpdate,i===null?l.firstBaseUpdate=r:i.next=r,l.lastBaseUpdate=r}function za(i,r,l,d){var g=i.updateQueue;es=!1;var _=g.firstBaseUpdate,P=g.lastBaseUpdate,V=g.shared.pending;if(V!==null){g.shared.pending=null;var J=V,ae=J.next;J.next=null,P===null?_=ae:P.next=ae,P=J;var Se=i.alternate;Se!==null&&(Se=Se.updateQueue,V=Se.lastBaseUpdate,V!==P&&(V===null?Se.firstBaseUpdate=ae:V.next=ae,Se.lastBaseUpdate=J))}if(_!==null){var ke=g.baseState;P=0,Se=ae=J=null,V=_;do{var ye=V.lane,Pe=V.eventTime;if((d&ye)===ye){Se!==null&&(Se=Se.next={eventTime:Pe,lane:0,tag:V.tag,payload:V.payload,callback:V.callback,next:null});e:{var Oe=i,ze=V;switch(ye=r,Pe=l,ze.tag){case 1:if(Oe=ze.payload,typeof Oe=="function"){ke=Oe.call(Pe,ke,ye);break e}ke=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=ze.payload,ye=typeof Oe=="function"?Oe.call(Pe,ke,ye):Oe,ye==null)break e;ke=D({},ke,ye);break e;case 2:es=!0}}V.callback!==null&&V.lane!==0&&(i.flags|=64,ye=g.effects,ye===null?g.effects=[V]:ye.push(V))}else Pe={eventTime:Pe,lane:ye,tag:V.tag,payload:V.payload,callback:V.callback,next:null},Se===null?(ae=Se=Pe,J=ke):Se=Se.next=Pe,P|=ye;if(V=V.next,V===null){if(V=g.shared.pending,V===null)break;ye=V,V=ye.next,ye.next=null,g.lastBaseUpdate=ye,g.shared.pending=null}}while(!0);if(Se===null&&(J=ke),g.baseState=J,g.firstBaseUpdate=ae,g.lastBaseUpdate=Se,r=g.shared.interleaved,r!==null){g=r;do P|=g.lane,g=g.next;while(g!==r)}else _===null&&(g.shared.lanes=0);Ms|=P,i.lanes=P,i.memoizedState=ke}}function Vp(i,r,l){if(i=r.effects,r.effects=null,i!==null)for(r=0;r<i.length;r++){var d=i[r],g=d.callback;if(g!==null){if(d.callback=null,d=l,typeof g!="function")throw Error(n(191,g));g.call(d)}}}var vo={},fi=Qi(vo),_o=Qi(vo),yo=Qi(vo);function Ts(i){if(i===vo)throw Error(n(174));return i}function tu(i,r){switch(yt(yo,r),yt(_o,i),yt(fi,vo),i=r.nodeType,i){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:ue(null,"");break;default:i=i===8?r.parentNode:r,r=i.namespaceURI||null,i=i.tagName,r=ue(r,i)}kt(fi),yt(fi,r)}function _r(){kt(fi),kt(_o),kt(yo)}function Yp(i){Ts(yo.current);var r=Ts(fi.current),l=ue(r,i.type);r!==l&&(yt(_o,i),yt(fi,l))}function nu(i){_o.current===i&&(kt(fi),kt(_o))}var Lt=Qi(0);function Fa(i){for(var r=i;r!==null;){if(r.tag===13){var l=r.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var iu=[];function su(){for(var i=0;i<iu.length;i++)iu[i]._workInProgressVersionPrimary=null;iu.length=0}var $a=O.ReactCurrentDispatcher,ru=O.ReactCurrentBatchConfig,Ds=0,At=null,Vt=null,tn=null,Ha=!1,wo=!1,bo=0,CS=0;function vn(){throw Error(n(321))}function ou(i,r){if(r===null)return!1;for(var l=0;l<r.length&&l<i.length;l++)if(!ii(i[l],r[l]))return!1;return!0}function au(i,r,l,d,g,_){if(Ds=_,At=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,$a.current=i===null||i.memoizedState===null?RS:PS,i=l(d,g),wo){_=0;do{if(wo=!1,bo=0,25<=_)throw Error(n(301));_+=1,tn=Vt=null,r.updateQueue=null,$a.current=LS,i=l(d,g)}while(wo)}if($a.current=Ka,r=Vt!==null&&Vt.next!==null,Ds=0,tn=Vt=At=null,Ha=!1,r)throw Error(n(300));return i}function lu(){var i=bo!==0;return bo=0,i}function pi(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tn===null?At.memoizedState=tn=i:tn=tn.next=i,tn}function Gn(){if(Vt===null){var i=At.alternate;i=i!==null?i.memoizedState:null}else i=Vt.next;var r=tn===null?At.memoizedState:tn.next;if(r!==null)tn=r,Vt=i;else{if(i===null)throw Error(n(310));Vt=i,i={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},tn===null?At.memoizedState=tn=i:tn=tn.next=i}return tn}function So(i,r){return typeof r=="function"?r(i):r}function cu(i){var r=Gn(),l=r.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=i;var d=Vt,g=d.baseQueue,_=l.pending;if(_!==null){if(g!==null){var P=g.next;g.next=_.next,_.next=P}d.baseQueue=g=_,l.pending=null}if(g!==null){_=g.next,d=d.baseState;var V=P=null,J=null,ae=_;do{var Se=ae.lane;if((Ds&Se)===Se)J!==null&&(J=J.next={lane:0,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),d=ae.hasEagerState?ae.eagerState:i(d,ae.action);else{var ke={lane:Se,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null};J===null?(V=J=ke,P=d):J=J.next=ke,At.lanes|=Se,Ms|=Se}ae=ae.next}while(ae!==null&&ae!==_);J===null?P=d:J.next=V,ii(d,r.memoizedState)||(Pn=!0),r.memoizedState=d,r.baseState=P,r.baseQueue=J,l.lastRenderedState=d}if(i=l.interleaved,i!==null){g=i;do _=g.lane,At.lanes|=_,Ms|=_,g=g.next;while(g!==i)}else g===null&&(l.lanes=0);return[r.memoizedState,l.dispatch]}function uu(i){var r=Gn(),l=r.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=i;var d=l.dispatch,g=l.pending,_=r.memoizedState;if(g!==null){l.pending=null;var P=g=g.next;do _=i(_,P.action),P=P.next;while(P!==g);ii(_,r.memoizedState)||(Pn=!0),r.memoizedState=_,r.baseQueue===null&&(r.baseState=_),l.lastRenderedState=_}return[_,d]}function Gp(){}function Xp(i,r){var l=At,d=Gn(),g=r(),_=!ii(d.memoizedState,g);if(_&&(d.memoizedState=g,Pn=!0),d=d.queue,du(Zp.bind(null,l,d,i),[i]),d.getSnapshot!==r||_||tn!==null&&tn.memoizedState.tag&1){if(l.flags|=2048,xo(9,Jp.bind(null,l,d,g,r),void 0,null),nn===null)throw Error(n(349));(Ds&30)!==0||Qp(l,r,g)}return g}function Qp(i,r,l){i.flags|=16384,i={getSnapshot:r,value:l},r=At.updateQueue,r===null?(r={lastEffect:null,stores:null},At.updateQueue=r,r.stores=[i]):(l=r.stores,l===null?r.stores=[i]:l.push(i))}function Jp(i,r,l,d){r.value=l,r.getSnapshot=d,em(r)&&tm(i)}function Zp(i,r,l){return l(function(){em(r)&&tm(i)})}function em(i){var r=i.getSnapshot;i=i.value;try{var l=r();return!ii(i,l)}catch{return!0}}function tm(i){var r=Ai(i,1);r!==null&&li(r,i,1,-1)}function nm(i){var r=pi();return typeof i=="function"&&(i=i()),r.memoizedState=r.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:So,lastRenderedState:i},r.queue=i,i=i.dispatch=jS.bind(null,At,i),[r.memoizedState,i]}function xo(i,r,l,d){return i={tag:i,create:r,destroy:l,deps:d,next:null},r=At.updateQueue,r===null?(r={lastEffect:null,stores:null},At.updateQueue=r,r.lastEffect=i.next=i):(l=r.lastEffect,l===null?r.lastEffect=i.next=i:(d=l.next,l.next=i,i.next=d,r.lastEffect=i)),i}function im(){return Gn().memoizedState}function Ua(i,r,l,d){var g=pi();At.flags|=i,g.memoizedState=xo(1|r,l,void 0,d===void 0?null:d)}function Wa(i,r,l,d){var g=Gn();d=d===void 0?null:d;var _=void 0;if(Vt!==null){var P=Vt.memoizedState;if(_=P.destroy,d!==null&&ou(d,P.deps)){g.memoizedState=xo(r,l,_,d);return}}At.flags|=i,g.memoizedState=xo(1|r,l,_,d)}function sm(i,r){return Ua(8390656,8,i,r)}function du(i,r){return Wa(2048,8,i,r)}function rm(i,r){return Wa(4,2,i,r)}function om(i,r){return Wa(4,4,i,r)}function am(i,r){if(typeof r=="function")return i=i(),r(i),function(){r(null)};if(r!=null)return i=i(),r.current=i,function(){r.current=null}}function lm(i,r,l){return l=l!=null?l.concat([i]):null,Wa(4,4,am.bind(null,r,i),l)}function hu(){}function cm(i,r){var l=Gn();r=r===void 0?null:r;var d=l.memoizedState;return d!==null&&r!==null&&ou(r,d[1])?d[0]:(l.memoizedState=[i,r],i)}function um(i,r){var l=Gn();r=r===void 0?null:r;var d=l.memoizedState;return d!==null&&r!==null&&ou(r,d[1])?d[0]:(i=i(),l.memoizedState=[i,r],i)}function dm(i,r,l){return(Ds&21)===0?(i.baseState&&(i.baseState=!1,Pn=!0),i.memoizedState=l):(ii(l,r)||(l=$f(),At.lanes|=l,Ms|=l,i.baseState=!0),r)}function ES(i,r){var l=pt;pt=l!==0&&4>l?l:4,i(!0);var d=ru.transition;ru.transition={};try{i(!1),r()}finally{pt=l,ru.transition=d}}function hm(){return Gn().memoizedState}function NS(i,r,l){var d=rs(i);if(l={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null},fm(i))pm(r,l);else if(l=Wp(i,r,l,d),l!==null){var g=Sn();li(l,i,d,g),mm(l,r,d)}}function jS(i,r,l){var d=rs(i),g={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null};if(fm(i))pm(r,g);else{var _=i.alternate;if(i.lanes===0&&(_===null||_.lanes===0)&&(_=r.lastRenderedReducer,_!==null))try{var P=r.lastRenderedState,V=_(P,l);if(g.hasEagerState=!0,g.eagerState=V,ii(V,P)){var J=r.interleaved;J===null?(g.next=g,Zc(r)):(g.next=J.next,J.next=g),r.interleaved=g;return}}catch{}finally{}l=Wp(i,r,g,d),l!==null&&(g=Sn(),li(l,i,d,g),mm(l,r,d))}}function fm(i){var r=i.alternate;return i===At||r!==null&&r===At}function pm(i,r){wo=Ha=!0;var l=i.pending;l===null?r.next=r:(r.next=l.next,l.next=r),i.pending=r}function mm(i,r,l){if((l&4194240)!==0){var d=r.lanes;d&=i.pendingLanes,l|=d,r.lanes=l,pc(i,l)}}var Ka={readContext:Yn,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useInsertionEffect:vn,useLayoutEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useMutableSource:vn,useSyncExternalStore:vn,useId:vn,unstable_isNewReconciler:!1},RS={readContext:Yn,useCallback:function(i,r){return pi().memoizedState=[i,r===void 0?null:r],i},useContext:Yn,useEffect:sm,useImperativeHandle:function(i,r,l){return l=l!=null?l.concat([i]):null,Ua(4194308,4,am.bind(null,r,i),l)},useLayoutEffect:function(i,r){return Ua(4194308,4,i,r)},useInsertionEffect:function(i,r){return Ua(4,2,i,r)},useMemo:function(i,r){var l=pi();return r=r===void 0?null:r,i=i(),l.memoizedState=[i,r],i},useReducer:function(i,r,l){var d=pi();return r=l!==void 0?l(r):r,d.memoizedState=d.baseState=r,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:r},d.queue=i,i=i.dispatch=NS.bind(null,At,i),[d.memoizedState,i]},useRef:function(i){var r=pi();return i={current:i},r.memoizedState=i},useState:nm,useDebugValue:hu,useDeferredValue:function(i){return pi().memoizedState=i},useTransition:function(){var i=nm(!1),r=i[0];return i=ES.bind(null,i[1]),pi().memoizedState=i,[r,i]},useMutableSource:function(){},useSyncExternalStore:function(i,r,l){var d=At,g=pi();if(jt){if(l===void 0)throw Error(n(407));l=l()}else{if(l=r(),nn===null)throw Error(n(349));(Ds&30)!==0||Qp(d,r,l)}g.memoizedState=l;var _={value:l,getSnapshot:r};return g.queue=_,sm(Zp.bind(null,d,_,i),[i]),d.flags|=2048,xo(9,Jp.bind(null,d,_,l,r),void 0,null),l},useId:function(){var i=pi(),r=nn.identifierPrefix;if(jt){var l=Li,d=Pi;l=(d&~(1<<32-Nn(d)-1)).toString(32)+l,r=":"+r+"R"+l,l=bo++,0<l&&(r+="H"+l.toString(32)),r+=":"}else l=CS++,r=":"+r+"r"+l.toString(32)+":";return i.memoizedState=r},unstable_isNewReconciler:!1},PS={readContext:Yn,useCallback:cm,useContext:Yn,useEffect:du,useImperativeHandle:lm,useInsertionEffect:rm,useLayoutEffect:om,useMemo:um,useReducer:cu,useRef:im,useState:function(){return cu(So)},useDebugValue:hu,useDeferredValue:function(i){var r=Gn();return dm(r,Vt.memoizedState,i)},useTransition:function(){var i=cu(So)[0],r=Gn().memoizedState;return[i,r]},useMutableSource:Gp,useSyncExternalStore:Xp,useId:hm,unstable_isNewReconciler:!1},LS={readContext:Yn,useCallback:cm,useContext:Yn,useEffect:du,useImperativeHandle:lm,useInsertionEffect:rm,useLayoutEffect:om,useMemo:um,useReducer:uu,useRef:im,useState:function(){return uu(So)},useDebugValue:hu,useDeferredValue:function(i){var r=Gn();return Vt===null?r.memoizedState=i:dm(r,Vt.memoizedState,i)},useTransition:function(){var i=uu(So)[0],r=Gn().memoizedState;return[i,r]},useMutableSource:Gp,useSyncExternalStore:Xp,useId:hm,unstable_isNewReconciler:!1};function ri(i,r){if(i&&i.defaultProps){r=D({},r),i=i.defaultProps;for(var l in i)r[l]===void 0&&(r[l]=i[l]);return r}return r}function fu(i,r,l,d){r=i.memoizedState,l=l(d,r),l=l==null?r:D({},r,l),i.memoizedState=l,i.lanes===0&&(i.updateQueue.baseState=l)}var qa={isMounted:function(i){return(i=i._reactInternals)?zt(i)===i:!1},enqueueSetState:function(i,r,l){i=i._reactInternals;var d=Sn(),g=rs(i),_=Ti(d,g);_.payload=r,l!=null&&(_.callback=l),r=ts(i,_,g),r!==null&&(li(r,i,g,d),Ba(r,i,g))},enqueueReplaceState:function(i,r,l){i=i._reactInternals;var d=Sn(),g=rs(i),_=Ti(d,g);_.tag=1,_.payload=r,l!=null&&(_.callback=l),r=ts(i,_,g),r!==null&&(li(r,i,g,d),Ba(r,i,g))},enqueueForceUpdate:function(i,r){i=i._reactInternals;var l=Sn(),d=rs(i),g=Ti(l,d);g.tag=2,r!=null&&(g.callback=r),r=ts(i,g,d),r!==null&&(li(r,i,d,l),Ba(r,i,d))}};function gm(i,r,l,d,g,_,P){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(d,_,P):r.prototype&&r.prototype.isPureReactComponent?!lo(l,d)||!lo(g,_):!0}function vm(i,r,l){var d=!1,g=Ji,_=r.contextType;return typeof _=="object"&&_!==null?_=Yn(_):(g=Rn(r)?Rs:gn.current,d=r.contextTypes,_=(d=d!=null)?dr(i,g):Ji),r=new r(l,_),i.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=qa,i.stateNode=r,r._reactInternals=i,d&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=g,i.__reactInternalMemoizedMaskedChildContext=_),r}function _m(i,r,l,d){i=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(l,d),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(l,d),r.state!==i&&qa.enqueueReplaceState(r,r.state,null)}function pu(i,r,l,d){var g=i.stateNode;g.props=l,g.state=i.memoizedState,g.refs={},eu(i);var _=r.contextType;typeof _=="object"&&_!==null?g.context=Yn(_):(_=Rn(r)?Rs:gn.current,g.context=dr(i,_)),g.state=i.memoizedState,_=r.getDerivedStateFromProps,typeof _=="function"&&(fu(i,r,_,l),g.state=i.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(r=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),r!==g.state&&qa.enqueueReplaceState(g,g.state,null),za(i,l,g,d),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308)}function yr(i,r){try{var l="",d=r;do l+=ce(d),d=d.return;while(d);var g=l}catch(_){g=`
|
|
39
39
|
Error generating stack: `+_.message+`
|
|
40
|
-
`+_.stack}return{value:i,source:r,stack:g,digest:null}}function mu(i,r,l){return{value:i,source:null,stack:l??null,digest:r??null}}function gu(i,r){try{console.error(r.value)}catch(l){setTimeout(function(){throw l})}}var AS=typeof WeakMap=="function"?WeakMap:Map;function ym(i,r,l){l=Ti(-1,l),l.tag=3,l.payload={element:null};var d=r.value;return l.callback=function(){Za||(Za=!0,Lu=d),gu(i,r)},l}function wm(i,r,l){l=Ti(-1,l),l.tag=3;var d=i.type.getDerivedStateFromError;if(typeof d=="function"){var g=r.value;l.payload=function(){return d(g)},l.callback=function(){gu(i,r)}}var _=i.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(l.callback=function(){gu(i,r),typeof d!="function"&&(is===null?is=new Set([this]):is.add(this));var P=r.stack;this.componentDidCatch(r.value,{componentStack:P!==null?P:""})}),l}function bm(i,r,l){var d=i.pingCache;if(d===null){d=i.pingCache=new AS;var g=new Set;d.set(r,g)}else g=d.get(r),g===void 0&&(g=new Set,d.set(r,g));g.has(l)||(g.add(l),i=qS.bind(null,i,r,l),r.then(i,i))}function Sm(i){do{var r;if((r=i.tag===13)&&(r=i.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return i;i=i.return}while(i!==null);return null}function xm(i,r,l,d,g){return(i.mode&1)===0?(i===r?i.flags|=65536:(i.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(r=Ti(-1,1),r.tag=2,ts(l,r,1))),l.lanes|=1),i):(i.flags|=65536,i.lanes=g,i)}var TS=O.ReactCurrentOwner,Pn=!1;function bn(i,r,l,d){r.child=i===null?Up(r,null,l,d):mr(r,i.child,l,d)}function km(i,r,l,d,g){l=l.render;var _=r.ref;return vr(r,g),d=au(i,r,l,d,_,g),l=lu(),i!==null&&!Pn?(r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~g,Di(i,r,g)):(jt&&l&&Wc(r),r.flags|=1,bn(i,r,d,g),r.child)}function Cm(i,r,l,d,g){if(i===null){var _=l.type;return typeof _=="function"&&!Bu(_)&&_.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(r.tag=15,r.type=_,Em(i,r,_,d,g)):(i=rl(l.type,null,d,r,r.mode,g),i.ref=r.ref,i.return=r,r.child=i)}if(_=i.child,(i.lanes&g)===0){var P=_.memoizedProps;if(l=l.compare,l=l!==null?l:lo,l(P,d)&&i.ref===r.ref)return Di(i,r,g)}return r.flags|=1,i=as(_,d),i.ref=r.ref,i.return=r,r.child=i}function Em(i,r,l,d,g){if(i!==null){var _=i.memoizedProps;if(lo(_,d)&&i.ref===r.ref)if(Pn=!1,r.pendingProps=d=_,(i.lanes&g)!==0)(i.flags&131072)!==0&&(Pn=!0);else return r.lanes=i.lanes,Di(i,r,g)}return vu(i,r,l,d,g)}function Nm(i,r,l){var d=r.pendingProps,g=d.children,_=i!==null?i.memoizedState:null;if(d.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},yt(br,Bn),Bn|=l;else{if((l&1073741824)===0)return i=_!==null?_.baseLanes|l:l,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:i,cachePool:null,transitions:null},r.updateQueue=null,yt(br,Bn),Bn|=i,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=_!==null?_.baseLanes:l,yt(br,Bn),Bn|=d}else _!==null?(d=_.baseLanes|l,r.memoizedState=null):d=l,yt(br,Bn),Bn|=d;return bn(i,r,g,l),r.child}function jm(i,r){var l=r.ref;(i===null&&l!==null||i!==null&&i.ref!==l)&&(r.flags|=512,r.flags|=2097152)}function vu(i,r,l,d,g){var _=Rn(l)?Rs:gn.current;return _=dr(r,_),vr(r,g),l=au(i,r,l,d,_,g),d=lu(),i!==null&&!Pn?(r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~g,Di(i,r,g)):(jt&&d&&Wc(r),r.flags|=1,bn(i,r,l,g),r.child)}function Rm(i,r,l,d,g){if(Rn(l)){var _=!0;Pa(r)}else _=!1;if(vr(r,g),r.stateNode===null)Ya(i,r),vm(r,l,d),pu(r,l,d,g),d=!0;else if(i===null){var P=r.stateNode,V=r.memoizedProps;P.props=V;var J=P.context,ae=l.contextType;typeof ae=="object"&&ae!==null?ae=Yn(ae):(ae=Rn(l)?Rs:gn.current,ae=dr(r,ae));var Se=l.getDerivedStateFromProps,ke=typeof Se=="function"||typeof P.getSnapshotBeforeUpdate=="function";ke||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(V!==d||J!==ae)&&_m(r,P,d,ae),es=!1;var ye=r.memoizedState;P.state=ye,za(r,d,P,g),J=r.memoizedState,V!==d||ye!==J||jn.current||es?(typeof Se=="function"&&(fu(r,l,Se,d),J=r.memoizedState),(V=es||gm(r,l,V,d,ye,J,ae))?(ke||typeof P.UNSAFE_componentWillMount!="function"&&typeof P.componentWillMount!="function"||(typeof P.componentWillMount=="function"&&P.componentWillMount(),typeof P.UNSAFE_componentWillMount=="function"&&P.UNSAFE_componentWillMount()),typeof P.componentDidMount=="function"&&(r.flags|=4194308)):(typeof P.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=d,r.memoizedState=J),P.props=d,P.state=J,P.context=ae,d=V):(typeof P.componentDidMount=="function"&&(r.flags|=4194308),d=!1)}else{P=r.stateNode,Kp(i,r),V=r.memoizedProps,ae=r.type===r.elementType?V:ri(r.type,V),P.props=ae,ke=r.pendingProps,ye=P.context,J=l.contextType,typeof J=="object"&&J!==null?J=Yn(J):(J=Rn(l)?Rs:gn.current,J=dr(r,J));var Pe=l.getDerivedStateFromProps;(Se=typeof Pe=="function"||typeof P.getSnapshotBeforeUpdate=="function")||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(V!==ke||ye!==J)&&_m(r,P,d,J),es=!1,ye=r.memoizedState,P.state=ye,za(r,d,P,g);var Oe=r.memoizedState;V!==ke||ye!==Oe||jn.current||es?(typeof Pe=="function"&&(fu(r,l,Pe,d),Oe=r.memoizedState),(ae=es||gm(r,l,ae,d,ye,Oe,J)||!1)?(Se||typeof P.UNSAFE_componentWillUpdate!="function"&&typeof P.componentWillUpdate!="function"||(typeof P.componentWillUpdate=="function"&&P.componentWillUpdate(d,Oe,J),typeof P.UNSAFE_componentWillUpdate=="function"&&P.UNSAFE_componentWillUpdate(d,Oe,J)),typeof P.componentDidUpdate=="function"&&(r.flags|=4),typeof P.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof P.componentDidUpdate!="function"||V===i.memoizedProps&&ye===i.memoizedState||(r.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||V===i.memoizedProps&&ye===i.memoizedState||(r.flags|=1024),r.memoizedProps=d,r.memoizedState=Oe),P.props=d,P.state=Oe,P.context=J,d=ae):(typeof P.componentDidUpdate!="function"||V===i.memoizedProps&&ye===i.memoizedState||(r.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||V===i.memoizedProps&&ye===i.memoizedState||(r.flags|=1024),d=!1)}return _u(i,r,l,d,_,g)}function _u(i,r,l,d,g,_){jm(i,r);var P=(r.flags&128)!==0;if(!d&&!P)return g&&Dp(r,l,!1),Di(i,r,_);d=r.stateNode,TS.current=r;var V=P&&typeof l.getDerivedStateFromError!="function"?null:d.render();return r.flags|=1,i!==null&&P?(r.child=mr(r,i.child,null,_),r.child=mr(r,null,V,_)):bn(i,r,V,_),r.memoizedState=d.state,g&&Dp(r,l,!0),r.child}function Pm(i){var r=i.stateNode;r.pendingContext?Ap(i,r.pendingContext,r.pendingContext!==r.context):r.context&&Ap(i,r.context,!1),tu(i,r.containerInfo)}function Lm(i,r,l,d,g){return pr(),Yc(g),r.flags|=256,bn(i,r,l,d),r.child}var yu={dehydrated:null,treeContext:null,retryLane:0};function wu(i){return{baseLanes:i,cachePool:null,transitions:null}}function Am(i,r,l){var d=r.pendingProps,g=Lt.current,_=!1,P=(r.flags&128)!==0,V;if((V=P)||(V=i!==null&&i.memoizedState===null?!1:(g&2)!==0),V?(_=!0,r.flags&=-129):(i===null||i.memoizedState!==null)&&(g|=1),yt(Lt,g&1),i===null)return Vc(r),i=r.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((r.mode&1)===0?r.lanes=1:i.data==="$!"?r.lanes=8:r.lanes=1073741824,null):(P=d.children,i=d.fallback,_?(d=r.mode,_=r.child,P={mode:"hidden",children:P},(d&1)===0&&_!==null?(_.childLanes=0,_.pendingProps=P):_=ol(P,d,0,null),i=zs(i,d,l,null),_.return=r,i.return=r,_.sibling=i,r.child=_,r.child.memoizedState=wu(l),r.memoizedState=yu,i):bu(r,P));if(g=i.memoizedState,g!==null&&(V=g.dehydrated,V!==null))return DS(i,r,P,d,V,g,l);if(_){_=d.fallback,P=r.mode,g=i.child,V=g.sibling;var J={mode:"hidden",children:d.children};return(P&1)===0&&r.child!==g?(d=r.child,d.childLanes=0,d.pendingProps=J,r.deletions=null):(d=as(g,J),d.subtreeFlags=g.subtreeFlags&14680064),V!==null?_=as(V,_):(_=zs(_,P,l,null),_.flags|=2),_.return=r,d.return=r,d.sibling=_,r.child=d,d=_,_=r.child,P=i.child.memoizedState,P=P===null?wu(l):{baseLanes:P.baseLanes|l,cachePool:null,transitions:P.transitions},_.memoizedState=P,_.childLanes=i.childLanes&~l,r.memoizedState=yu,d}return _=i.child,i=_.sibling,d=as(_,{mode:"visible",children:d.children}),(r.mode&1)===0&&(d.lanes=l),d.return=r,d.sibling=null,i!==null&&(l=r.deletions,l===null?(r.deletions=[i],r.flags|=16):l.push(i)),r.child=d,r.memoizedState=null,d}function bu(i,r){return r=ol({mode:"visible",children:r},i.mode,0,null),r.return=i,i.child=r}function Va(i,r,l,d){return d!==null&&Yc(d),mr(r,i.child,null,l),i=bu(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function DS(i,r,l,d,g,_,P){if(l)return r.flags&256?(r.flags&=-257,d=mu(Error(n(422))),Va(i,r,P,d)):r.memoizedState!==null?(r.child=i.child,r.flags|=128,null):(_=d.fallback,g=r.mode,d=ol({mode:"visible",children:d.children},g,0,null),_=zs(_,g,P,null),_.flags|=2,d.return=r,_.return=r,d.sibling=_,r.child=d,(r.mode&1)!==0&&mr(r,i.child,null,P),r.child.memoizedState=wu(P),r.memoizedState=yu,_);if((r.mode&1)===0)return Va(i,r,P,null);if(g.data==="$!"){if(d=g.nextSibling&&g.nextSibling.dataset,d)var V=d.dgst;return d=V,_=Error(n(419)),d=mu(_,d,void 0),Va(i,r,P,d)}if(V=(P&i.childLanes)!==0,Pn||V){if(d=nn,d!==null){switch(P&-P){case 4:g=2;break;case 16:g=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(d.suspendedLanes|P))!==0?0:g,g!==0&&g!==_.retryLane&&(_.retryLane=g,Ai(i,g),li(d,i,g,-1))}return Ou(),d=mu(Error(n(421))),Va(i,r,P,d)}return g.data==="$?"?(r.flags|=128,r.child=i.child,r=VS.bind(null,i),g._reactRetry=r,null):(i=_.treeContext,On=Xi(g.nextSibling),In=r,jt=!0,si=null,i!==null&&(qn[Vn++]=Pi,qn[Vn++]=Li,qn[Vn++]=Ps,Pi=i.id,Li=i.overflow,Ps=r),r=bu(r,d.children),r.flags|=4096,r)}function Tm(i,r,l){i.lanes|=r;var d=i.alternate;d!==null&&(d.lanes|=r),Jc(i.return,r,l)}function Su(i,r,l,d,g){var _=i.memoizedState;_===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:g}:(_.isBackwards=r,_.rendering=null,_.renderingStartTime=0,_.last=d,_.tail=l,_.tailMode=g)}function Dm(i,r,l){var d=r.pendingProps,g=d.revealOrder,_=d.tail;if(bn(i,r,d.children,l),d=Lt.current,(d&2)!==0)d=d&1|2,r.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Tm(i,l,r);else if(i.tag===19)Tm(i,l,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}d&=1}if(yt(Lt,d),(r.mode&1)===0)r.memoizedState=null;else switch(g){case"forwards":for(l=r.child,g=null;l!==null;)i=l.alternate,i!==null&&Fa(i)===null&&(g=l),l=l.sibling;l=g,l===null?(g=r.child,r.child=null):(g=l.sibling,l.sibling=null),Su(r,!1,g,l,_);break;case"backwards":for(l=null,g=r.child,r.child=null;g!==null;){if(i=g.alternate,i!==null&&Fa(i)===null){r.child=g;break}i=g.sibling,g.sibling=l,l=g,g=i}Su(r,!0,l,null,_);break;case"together":Su(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function Ya(i,r){(r.mode&1)===0&&i!==null&&(i.alternate=null,r.alternate=null,r.flags|=2)}function Di(i,r,l){if(i!==null&&(r.dependencies=i.dependencies),Ms|=r.lanes,(l&r.childLanes)===0)return null;if(i!==null&&r.child!==i.child)throw Error(n(153));if(r.child!==null){for(i=r.child,l=as(i,i.pendingProps),r.child=l,l.return=r;i.sibling!==null;)i=i.sibling,l=l.sibling=as(i,i.pendingProps),l.return=r;l.sibling=null}return r.child}function MS(i,r,l){switch(r.tag){case 3:Pm(r),pr();break;case 5:Yp(r);break;case 1:Rn(r.type)&&Pa(r);break;case 4:tu(r,r.stateNode.containerInfo);break;case 10:var d=r.type._context,g=r.memoizedProps.value;yt(Ia,d._currentValue),d._currentValue=g;break;case 13:if(d=r.memoizedState,d!==null)return d.dehydrated!==null?(yt(Lt,Lt.current&1),r.flags|=128,null):(l&r.child.childLanes)!==0?Am(i,r,l):(yt(Lt,Lt.current&1),i=Di(i,r,l),i!==null?i.sibling:null);yt(Lt,Lt.current&1);break;case 19:if(d=(l&r.childLanes)!==0,(i.flags&128)!==0){if(d)return Dm(i,r,l);r.flags|=128}if(g=r.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),yt(Lt,Lt.current),d)break;return null;case 22:case 23:return r.lanes=0,Nm(i,r,l)}return Di(i,r,l)}var Mm,xu,Im,Om;Mm=function(i,r){for(var l=r.child;l!==null;){if(l.tag===5||l.tag===6)i.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===r)break;for(;l.sibling===null;){if(l.return===null||l.return===r)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},xu=function(){},Im=function(i,r,l,d){var g=i.memoizedProps;if(g!==d){i=r.stateNode,Ts(fi.current);var _=null;switch(l){case"input":g=Pt(i,g),d=Pt(i,d),_=[];break;case"select":g=D({},g,{value:void 0}),d=D({},d,{value:void 0}),_=[];break;case"textarea":g=at(i,g),d=at(i,d),_=[];break;default:typeof g.onClick!="function"&&typeof d.onClick=="function"&&(i.onclick=Na)}_e(l,d);var P;l=null;for(ae in g)if(!d.hasOwnProperty(ae)&&g.hasOwnProperty(ae)&&g[ae]!=null)if(ae==="style"){var V=g[ae];for(P in V)V.hasOwnProperty(P)&&(l||(l={}),l[P]="")}else ae!=="dangerouslySetInnerHTML"&&ae!=="children"&&ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&ae!=="autoFocus"&&(o.hasOwnProperty(ae)?_||(_=[]):(_=_||[]).push(ae,null));for(ae in d){var J=d[ae];if(V=g!=null?g[ae]:void 0,d.hasOwnProperty(ae)&&J!==V&&(J!=null||V!=null))if(ae==="style")if(V){for(P in V)!V.hasOwnProperty(P)||J&&J.hasOwnProperty(P)||(l||(l={}),l[P]="");for(P in J)J.hasOwnProperty(P)&&V[P]!==J[P]&&(l||(l={}),l[P]=J[P])}else l||(_||(_=[]),_.push(ae,l)),l=J;else ae==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,V=V?V.__html:void 0,J!=null&&V!==J&&(_=_||[]).push(ae,J)):ae==="children"?typeof J!="string"&&typeof J!="number"||(_=_||[]).push(ae,""+J):ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&(o.hasOwnProperty(ae)?(J!=null&&ae==="onScroll"&&xt("scroll",i),_||V===J||(_=[])):(_=_||[]).push(ae,J))}l&&(_=_||[]).push("style",l);var ae=_;(r.updateQueue=ae)&&(r.flags|=4)}},Om=function(i,r,l,d){l!==d&&(r.flags|=4)};function ko(i,r){if(!jt)switch(i.tailMode){case"hidden":r=i.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?i.tail=null:l.sibling=null;break;case"collapsed":l=i.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:d.sibling=null}}function _n(i){var r=i.alternate!==null&&i.alternate.child===i.child,l=0,d=0;if(r)for(var g=i.child;g!==null;)l|=g.lanes|g.childLanes,d|=g.subtreeFlags&14680064,d|=g.flags&14680064,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)l|=g.lanes|g.childLanes,d|=g.subtreeFlags,d|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=d,i.childLanes=l,r}function IS(i,r,l){var d=r.pendingProps;switch(Kc(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _n(r),null;case 1:return Rn(r.type)&&Ra(),_n(r),null;case 3:return d=r.stateNode,_r(),kt(jn),kt(gn),su(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(i===null||i.child===null)&&(Da(r)?r.flags|=4:i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,si!==null&&(Du(si),si=null))),xu(i,r),_n(r),null;case 5:nu(r);var g=Ts(yo.current);if(l=r.type,i!==null&&r.stateNode!=null)Im(i,r,l,d,g),i.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!d){if(r.stateNode===null)throw Error(n(166));return _n(r),null}if(i=Ts(fi.current),Da(r)){d=r.stateNode,l=r.type;var _=r.memoizedProps;switch(d[hi]=r,d[po]=_,i=(r.mode&1)!==0,l){case"dialog":xt("cancel",d),xt("close",d);break;case"iframe":case"object":case"embed":xt("load",d);break;case"video":case"audio":for(g=0;g<uo.length;g++)xt(uo[g],d);break;case"source":xt("error",d);break;case"img":case"image":case"link":xt("error",d),xt("load",d);break;case"details":xt("toggle",d);break;case"input":Jt(d,_),xt("invalid",d);break;case"select":d._wrapperState={wasMultiple:!!_.multiple},xt("invalid",d);break;case"textarea":ie(d,_),xt("invalid",d)}_e(l,_),g=null;for(var P in _)if(_.hasOwnProperty(P)){var V=_[P];P==="children"?typeof V=="string"?d.textContent!==V&&(_.suppressHydrationWarning!==!0&&Ea(d.textContent,V,i),g=["children",V]):typeof V=="number"&&d.textContent!==""+V&&(_.suppressHydrationWarning!==!0&&Ea(d.textContent,V,i),g=["children",""+V]):o.hasOwnProperty(P)&&V!=null&&P==="onScroll"&&xt("scroll",d)}switch(l){case"input":dt(d),gt(d,_,!0);break;case"textarea":dt(d),Ie(d);break;case"select":case"option":break;default:typeof _.onClick=="function"&&(d.onclick=Na)}d=g,r.updateQueue=d,d!==null&&(r.flags|=4)}else{P=g.nodeType===9?g:g.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Be(l)),i==="http://www.w3.org/1999/xhtml"?l==="script"?(i=P.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof d.is=="string"?i=P.createElement(l,{is:d.is}):(i=P.createElement(l),l==="select"&&(P=i,d.multiple?P.multiple=!0:d.size&&(P.size=d.size))):i=P.createElementNS(i,l),i[hi]=r,i[po]=d,Mm(i,r,!1,!1),r.stateNode=i;e:{switch(P=Ee(l,d),l){case"dialog":xt("cancel",i),xt("close",i),g=d;break;case"iframe":case"object":case"embed":xt("load",i),g=d;break;case"video":case"audio":for(g=0;g<uo.length;g++)xt(uo[g],i);g=d;break;case"source":xt("error",i),g=d;break;case"img":case"image":case"link":xt("error",i),xt("load",i),g=d;break;case"details":xt("toggle",i),g=d;break;case"input":Jt(i,d),g=Pt(i,d),xt("invalid",i);break;case"option":g=d;break;case"select":i._wrapperState={wasMultiple:!!d.multiple},g=D({},d,{value:void 0}),xt("invalid",i);break;case"textarea":ie(i,d),g=at(i,d),xt("invalid",i);break;default:g=d}_e(l,g),V=g;for(_ in V)if(V.hasOwnProperty(_)){var J=V[_];_==="style"?ge(i,J):_==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&H(i,J)):_==="children"?typeof J=="string"?(l!=="textarea"||J!=="")&&te(i,J):typeof J=="number"&&te(i,""+J):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(o.hasOwnProperty(_)?J!=null&&_==="onScroll"&&xt("scroll",i):J!=null&&F(i,_,J,P))}switch(l){case"input":dt(i),gt(i,d,!1);break;case"textarea":dt(i),Ie(i);break;case"option":d.value!=null&&i.setAttribute("value",""+me(d.value));break;case"select":i.multiple=!!d.multiple,_=d.value,_!=null?rt(i,!!d.multiple,_,!1):d.defaultValue!=null&&rt(i,!!d.multiple,d.defaultValue,!0);break;default:typeof g.onClick=="function"&&(i.onclick=Na)}switch(l){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}}d&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return _n(r),null;case 6:if(i&&r.stateNode!=null)Om(i,r,i.memoizedProps,d);else{if(typeof d!="string"&&r.stateNode===null)throw Error(n(166));if(l=Ts(yo.current),Ts(fi.current),Da(r)){if(d=r.stateNode,l=r.memoizedProps,d[hi]=r,(_=d.nodeValue!==l)&&(i=In,i!==null))switch(i.tag){case 3:Ea(d.nodeValue,l,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&Ea(d.nodeValue,l,(i.mode&1)!==0)}_&&(r.flags|=4)}else d=(l.nodeType===9?l:l.ownerDocument).createTextNode(d),d[hi]=r,r.stateNode=d}return _n(r),null;case 13:if(kt(Lt),d=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(jt&&On!==null&&(r.mode&1)!==0&&(r.flags&128)===0)Fp(),pr(),r.flags|=98560,_=!1;else if(_=Da(r),d!==null&&d.dehydrated!==null){if(i===null){if(!_)throw Error(n(318));if(_=r.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(n(317));_[hi]=r}else pr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;_n(r),_=!1}else si!==null&&(Du(si),si=null),_=!0;if(!_)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=l,r):(d=d!==null,d!==(i!==null&&i.memoizedState!==null)&&d&&(r.child.flags|=8192,(r.mode&1)!==0&&(i===null||(Lt.current&1)!==0?Yt===0&&(Yt=3):Ou())),r.updateQueue!==null&&(r.flags|=4),_n(r),null);case 4:return _r(),xu(i,r),i===null&&ho(r.stateNode.containerInfo),_n(r),null;case 10:return Qc(r.type._context),_n(r),null;case 17:return Rn(r.type)&&Ra(),_n(r),null;case 19:if(kt(Lt),_=r.memoizedState,_===null)return _n(r),null;if(d=(r.flags&128)!==0,P=_.rendering,P===null)if(d)ko(_,!1);else{if(Yt!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(P=Fa(i),P!==null){for(r.flags|=128,ko(_,!1),d=P.updateQueue,d!==null&&(r.updateQueue=d,r.flags|=4),r.subtreeFlags=0,d=l,l=r.child;l!==null;)_=l,i=d,_.flags&=14680066,P=_.alternate,P===null?(_.childLanes=0,_.lanes=i,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=P.childLanes,_.lanes=P.lanes,_.child=P.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=P.memoizedProps,_.memoizedState=P.memoizedState,_.updateQueue=P.updateQueue,_.type=P.type,i=P.dependencies,_.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),l=l.sibling;return yt(Lt,Lt.current&1|2),r.child}i=i.sibling}_.tail!==null&&Nt()>Sr&&(r.flags|=128,d=!0,ko(_,!1),r.lanes=4194304)}else{if(!d)if(i=Fa(P),i!==null){if(r.flags|=128,d=!0,l=i.updateQueue,l!==null&&(r.updateQueue=l,r.flags|=4),ko(_,!0),_.tail===null&&_.tailMode==="hidden"&&!P.alternate&&!jt)return _n(r),null}else 2*Nt()-_.renderingStartTime>Sr&&l!==1073741824&&(r.flags|=128,d=!0,ko(_,!1),r.lanes=4194304);_.isBackwards?(P.sibling=r.child,r.child=P):(l=_.last,l!==null?l.sibling=P:r.child=P,_.last=P)}return _.tail!==null?(r=_.tail,_.rendering=r,_.tail=r.sibling,_.renderingStartTime=Nt(),r.sibling=null,l=Lt.current,yt(Lt,d?l&1|2:l&1),r):(_n(r),null);case 22:case 23:return Iu(),d=r.memoizedState!==null,i!==null&&i.memoizedState!==null!==d&&(r.flags|=8192),d&&(r.mode&1)!==0?(Bn&1073741824)!==0&&(_n(r),r.subtreeFlags&6&&(r.flags|=8192)):_n(r),null;case 24:return null;case 25:return null}throw Error(n(156,r.tag))}function OS(i,r){switch(Kc(r),r.tag){case 1:return Rn(r.type)&&Ra(),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return _r(),kt(jn),kt(gn),su(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 5:return nu(r),null;case 13:if(kt(Lt),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(n(340));pr()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return kt(Lt),null;case 4:return _r(),null;case 10:return Qc(r.type._context),null;case 22:case 23:return Iu(),null;case 24:return null;default:return null}}var Ga=!1,yn=!1,BS=typeof WeakSet=="function"?WeakSet:Set,Ae=null;function wr(i,r){var l=i.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(d){It(i,r,d)}else l.current=null}function ku(i,r,l){try{l()}catch(d){It(i,r,d)}}var Bm=!1;function zS(i,r){if(Ic=ma,i=gp(),jc(i)){if("selectionStart"in i)var l={start:i.selectionStart,end:i.selectionEnd};else e:{l=(l=i.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var g=d.anchorOffset,_=d.focusNode;d=d.focusOffset;try{l.nodeType,_.nodeType}catch{l=null;break e}var P=0,V=-1,J=-1,ae=0,Se=0,ke=i,ye=null;t:for(;;){for(var Pe;ke!==l||g!==0&&ke.nodeType!==3||(V=P+g),ke!==_||d!==0&&ke.nodeType!==3||(J=P+d),ke.nodeType===3&&(P+=ke.nodeValue.length),(Pe=ke.firstChild)!==null;)ye=ke,ke=Pe;for(;;){if(ke===i)break t;if(ye===l&&++ae===g&&(V=P),ye===_&&++Se===d&&(J=P),(Pe=ke.nextSibling)!==null)break;ke=ye,ye=ke.parentNode}ke=Pe}l=V===-1||J===-1?null:{start:V,end:J}}else l=null}l=l||{start:0,end:0}}else l=null;for(Oc={focusedElem:i,selectionRange:l},ma=!1,Ae=r;Ae!==null;)if(r=Ae,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,Ae=i;else for(;Ae!==null;){r=Ae;try{var Oe=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(Oe!==null){var ze=Oe.memoizedProps,Ft=Oe.memoizedState,ne=r.stateNode,ee=ne.getSnapshotBeforeUpdate(r.elementType===r.type?ze:ri(r.type,ze),Ft);ne.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:var re=r.stateNode.containerInfo;re.nodeType===1?re.textContent="":re.nodeType===9&&re.documentElement&&re.removeChild(re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ce){It(r,r.return,Ce)}if(i=r.sibling,i!==null){i.return=r.return,Ae=i;break}Ae=r.return}return Oe=Bm,Bm=!1,Oe}function Co(i,r,l){var d=r.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var g=d=d.next;do{if((g.tag&i)===i){var _=g.destroy;g.destroy=void 0,_!==void 0&&ku(r,l,_)}g=g.next}while(g!==d)}}function Xa(i,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&i)===i){var d=l.create;l.destroy=d()}l=l.next}while(l!==r)}}function Cu(i){var r=i.ref;if(r!==null){var l=i.stateNode;switch(i.tag){case 5:i=l;break;default:i=l}typeof r=="function"?r(i):r.current=i}}function zm(i){var r=i.alternate;r!==null&&(i.alternate=null,zm(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&(delete r[hi],delete r[po],delete r[$c],delete r[bS],delete r[SS])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Fm(i){return i.tag===5||i.tag===3||i.tag===4}function $m(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Fm(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Eu(i,r,l){var d=i.tag;if(d===5||d===6)i=i.stateNode,r?l.nodeType===8?l.parentNode.insertBefore(i,r):l.insertBefore(i,r):(l.nodeType===8?(r=l.parentNode,r.insertBefore(i,l)):(r=l,r.appendChild(i)),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=Na));else if(d!==4&&(i=i.child,i!==null))for(Eu(i,r,l),i=i.sibling;i!==null;)Eu(i,r,l),i=i.sibling}function Nu(i,r,l){var d=i.tag;if(d===5||d===6)i=i.stateNode,r?l.insertBefore(i,r):l.appendChild(i);else if(d!==4&&(i=i.child,i!==null))for(Nu(i,r,l),i=i.sibling;i!==null;)Nu(i,r,l),i=i.sibling}var hn=null,oi=!1;function ns(i,r,l){for(l=l.child;l!==null;)Hm(i,r,l),l=l.sibling}function Hm(i,r,l){if(en&&typeof en.onCommitFiberUnmount=="function")try{en.onCommitFiberUnmount(Ut,l)}catch{}switch(l.tag){case 5:yn||wr(l,r);case 6:var d=hn,g=oi;hn=null,ns(i,r,l),hn=d,oi=g,hn!==null&&(oi?(i=hn,l=l.stateNode,i.nodeType===8?i.parentNode.removeChild(l):i.removeChild(l)):hn.removeChild(l.stateNode));break;case 18:hn!==null&&(oi?(i=hn,l=l.stateNode,i.nodeType===8?Fc(i.parentNode,l):i.nodeType===1&&Fc(i,l),no(i)):Fc(hn,l.stateNode));break;case 4:d=hn,g=oi,hn=l.stateNode.containerInfo,oi=!0,ns(i,r,l),hn=d,oi=g;break;case 0:case 11:case 14:case 15:if(!yn&&(d=l.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){g=d=d.next;do{var _=g,P=_.destroy;_=_.tag,P!==void 0&&((_&2)!==0||(_&4)!==0)&&ku(l,r,P),g=g.next}while(g!==d)}ns(i,r,l);break;case 1:if(!yn&&(wr(l,r),d=l.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=l.memoizedProps,d.state=l.memoizedState,d.componentWillUnmount()}catch(V){It(l,r,V)}ns(i,r,l);break;case 21:ns(i,r,l);break;case 22:l.mode&1?(yn=(d=yn)||l.memoizedState!==null,ns(i,r,l),yn=d):ns(i,r,l);break;default:ns(i,r,l)}}function Um(i){var r=i.updateQueue;if(r!==null){i.updateQueue=null;var l=i.stateNode;l===null&&(l=i.stateNode=new BS),r.forEach(function(d){var g=YS.bind(null,i,d);l.has(d)||(l.add(d),d.then(g,g))})}}function ai(i,r){var l=r.deletions;if(l!==null)for(var d=0;d<l.length;d++){var g=l[d];try{var _=i,P=r,V=P;e:for(;V!==null;){switch(V.tag){case 5:hn=V.stateNode,oi=!1;break e;case 3:hn=V.stateNode.containerInfo,oi=!0;break e;case 4:hn=V.stateNode.containerInfo,oi=!0;break e}V=V.return}if(hn===null)throw Error(n(160));Hm(_,P,g),hn=null,oi=!1;var J=g.alternate;J!==null&&(J.return=null),g.return=null}catch(ae){It(g,r,ae)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)Wm(r,i),r=r.sibling}function Wm(i,r){var l=i.alternate,d=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(ai(r,i),mi(i),d&4){try{Co(3,i,i.return),Xa(3,i)}catch(ze){It(i,i.return,ze)}try{Co(5,i,i.return)}catch(ze){It(i,i.return,ze)}}break;case 1:ai(r,i),mi(i),d&512&&l!==null&&wr(l,l.return);break;case 5:if(ai(r,i),mi(i),d&512&&l!==null&&wr(l,l.return),i.flags&32){var g=i.stateNode;try{te(g,"")}catch(ze){It(i,i.return,ze)}}if(d&4&&(g=i.stateNode,g!=null)){var _=i.memoizedProps,P=l!==null?l.memoizedProps:_,V=i.type,J=i.updateQueue;if(i.updateQueue=null,J!==null)try{V==="input"&&_.type==="radio"&&_.name!=null&&Me(g,_),Ee(V,P);var ae=Ee(V,_);for(P=0;P<J.length;P+=2){var Se=J[P],ke=J[P+1];Se==="style"?ge(g,ke):Se==="dangerouslySetInnerHTML"?H(g,ke):Se==="children"?te(g,ke):F(g,Se,ke,ae)}switch(V){case"input":Et(g,_);break;case"textarea":xe(g,_);break;case"select":var ye=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!_.multiple;var Pe=_.value;Pe!=null?rt(g,!!_.multiple,Pe,!1):ye!==!!_.multiple&&(_.defaultValue!=null?rt(g,!!_.multiple,_.defaultValue,!0):rt(g,!!_.multiple,_.multiple?[]:"",!1))}g[po]=_}catch(ze){It(i,i.return,ze)}}break;case 6:if(ai(r,i),mi(i),d&4){if(i.stateNode===null)throw Error(n(162));g=i.stateNode,_=i.memoizedProps;try{g.nodeValue=_}catch(ze){It(i,i.return,ze)}}break;case 3:if(ai(r,i),mi(i),d&4&&l!==null&&l.memoizedState.isDehydrated)try{no(r.containerInfo)}catch(ze){It(i,i.return,ze)}break;case 4:ai(r,i),mi(i);break;case 13:ai(r,i),mi(i),g=i.child,g.flags&8192&&(_=g.memoizedState!==null,g.stateNode.isHidden=_,!_||g.alternate!==null&&g.alternate.memoizedState!==null||(Pu=Nt())),d&4&&Um(i);break;case 22:if(Se=l!==null&&l.memoizedState!==null,i.mode&1?(yn=(ae=yn)||Se,ai(r,i),yn=ae):ai(r,i),mi(i),d&8192){if(ae=i.memoizedState!==null,(i.stateNode.isHidden=ae)&&!Se&&(i.mode&1)!==0)for(Ae=i,Se=i.child;Se!==null;){for(ke=Ae=Se;Ae!==null;){switch(ye=Ae,Pe=ye.child,ye.tag){case 0:case 11:case 14:case 15:Co(4,ye,ye.return);break;case 1:wr(ye,ye.return);var Oe=ye.stateNode;if(typeof Oe.componentWillUnmount=="function"){d=ye,l=ye.return;try{r=d,Oe.props=r.memoizedProps,Oe.state=r.memoizedState,Oe.componentWillUnmount()}catch(ze){It(d,l,ze)}}break;case 5:wr(ye,ye.return);break;case 22:if(ye.memoizedState!==null){Vm(ke);continue}}Pe!==null?(Pe.return=ye,Ae=Pe):Vm(ke)}Se=Se.sibling}e:for(Se=null,ke=i;;){if(ke.tag===5){if(Se===null){Se=ke;try{g=ke.stateNode,ae?(_=g.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none"):(V=ke.stateNode,J=ke.memoizedProps.style,P=J!=null&&J.hasOwnProperty("display")?J.display:null,V.style.display=de("display",P))}catch(ze){It(i,i.return,ze)}}}else if(ke.tag===6){if(Se===null)try{ke.stateNode.nodeValue=ae?"":ke.memoizedProps}catch(ze){It(i,i.return,ze)}}else if((ke.tag!==22&&ke.tag!==23||ke.memoizedState===null||ke===i)&&ke.child!==null){ke.child.return=ke,ke=ke.child;continue}if(ke===i)break e;for(;ke.sibling===null;){if(ke.return===null||ke.return===i)break e;Se===ke&&(Se=null),ke=ke.return}Se===ke&&(Se=null),ke.sibling.return=ke.return,ke=ke.sibling}}break;case 19:ai(r,i),mi(i),d&4&&Um(i);break;case 21:break;default:ai(r,i),mi(i)}}function mi(i){var r=i.flags;if(r&2){try{e:{for(var l=i.return;l!==null;){if(Fm(l)){var d=l;break e}l=l.return}throw Error(n(160))}switch(d.tag){case 5:var g=d.stateNode;d.flags&32&&(te(g,""),d.flags&=-33);var _=$m(i);Nu(i,_,g);break;case 3:case 4:var P=d.stateNode.containerInfo,V=$m(i);Eu(i,V,P);break;default:throw Error(n(161))}}catch(J){It(i,i.return,J)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function FS(i,r,l){Ae=i,Km(i)}function Km(i,r,l){for(var d=(i.mode&1)!==0;Ae!==null;){var g=Ae,_=g.child;if(g.tag===22&&d){var P=g.memoizedState!==null||Ga;if(!P){var V=g.alternate,J=V!==null&&V.memoizedState!==null||yn;V=Ga;var ae=yn;if(Ga=P,(yn=J)&&!ae)for(Ae=g;Ae!==null;)P=Ae,J=P.child,P.tag===22&&P.memoizedState!==null?Ym(g):J!==null?(J.return=P,Ae=J):Ym(g);for(;_!==null;)Ae=_,Km(_),_=_.sibling;Ae=g,Ga=V,yn=ae}qm(i)}else(g.subtreeFlags&8772)!==0&&_!==null?(_.return=g,Ae=_):qm(i)}}function qm(i){for(;Ae!==null;){var r=Ae;if((r.flags&8772)!==0){var l=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:yn||Xa(5,r);break;case 1:var d=r.stateNode;if(r.flags&4&&!yn)if(l===null)d.componentDidMount();else{var g=r.elementType===r.type?l.memoizedProps:ri(r.type,l.memoizedProps);d.componentDidUpdate(g,l.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var _=r.updateQueue;_!==null&&Vp(r,_,d);break;case 3:var P=r.updateQueue;if(P!==null){if(l=null,r.child!==null)switch(r.child.tag){case 5:l=r.child.stateNode;break;case 1:l=r.child.stateNode}Vp(r,P,l)}break;case 5:var V=r.stateNode;if(l===null&&r.flags&4){l=V;var J=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&l.focus();break;case"img":J.src&&(l.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var ae=r.alternate;if(ae!==null){var Se=ae.memoizedState;if(Se!==null){var ke=Se.dehydrated;ke!==null&&no(ke)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}yn||r.flags&512&&Cu(r)}catch(ye){It(r,r.return,ye)}}if(r===i){Ae=null;break}if(l=r.sibling,l!==null){l.return=r.return,Ae=l;break}Ae=r.return}}function Vm(i){for(;Ae!==null;){var r=Ae;if(r===i){Ae=null;break}var l=r.sibling;if(l!==null){l.return=r.return,Ae=l;break}Ae=r.return}}function Ym(i){for(;Ae!==null;){var r=Ae;try{switch(r.tag){case 0:case 11:case 15:var l=r.return;try{Xa(4,r)}catch(J){It(r,l,J)}break;case 1:var d=r.stateNode;if(typeof d.componentDidMount=="function"){var g=r.return;try{d.componentDidMount()}catch(J){It(r,g,J)}}var _=r.return;try{Cu(r)}catch(J){It(r,_,J)}break;case 5:var P=r.return;try{Cu(r)}catch(J){It(r,P,J)}}}catch(J){It(r,r.return,J)}if(r===i){Ae=null;break}var V=r.sibling;if(V!==null){V.return=r.return,Ae=V;break}Ae=r.return}}var $S=Math.ceil,Qa=O.ReactCurrentDispatcher,ju=O.ReactCurrentOwner,Xn=O.ReactCurrentBatchConfig,lt=0,nn=null,Wt=null,fn=0,Bn=0,br=Qi(0),Yt=0,Eo=null,Ms=0,Ja=0,Ru=0,No=null,Ln=null,Pu=0,Sr=1/0,Mi=null,Za=!1,Lu=null,is=null,el=!1,ss=null,tl=0,jo=0,Au=null,nl=-1,il=0;function Sn(){return(lt&6)!==0?Nt():nl!==-1?nl:nl=Nt()}function rs(i){return(i.mode&1)===0?1:(lt&2)!==0&&fn!==0?fn&-fn:kS.transition!==null?(il===0&&(il=$f()),il):(i=pt,i!==0||(i=window.event,i=i===void 0?16:Xf(i.type)),i)}function li(i,r,l,d){if(50<jo)throw jo=0,Au=null,Error(n(185));Qr(i,l,d),((lt&2)===0||i!==nn)&&(i===nn&&((lt&2)===0&&(Ja|=l),Yt===4&&os(i,fn)),An(i,d),l===1&<===0&&(r.mode&1)===0&&(Sr=Nt()+500,La&&Zi()))}function An(i,r){var l=i.callbackNode;kb(i,r);var d=ha(i,i===nn?fn:0);if(d===0)l!==null&&Yr(l),i.callbackNode=null,i.callbackPriority=0;else if(r=d&-d,i.callbackPriority!==r){if(l!=null&&Yr(l),r===1)i.tag===0?xS(Xm.bind(null,i)):Mp(Xm.bind(null,i)),yS(function(){(lt&6)===0&&Zi()}),l=null;else{switch(Hf(d)){case 1:l=He;break;case 4:l=Ve;break;case 16:l=qe;break;case 536870912:l=St;break;default:l=qe}l=sg(l,Gm.bind(null,i))}i.callbackPriority=r,i.callbackNode=l}}function Gm(i,r){if(nl=-1,il=0,(lt&6)!==0)throw Error(n(327));var l=i.callbackNode;if(xr()&&i.callbackNode!==l)return null;var d=ha(i,i===nn?fn:0);if(d===0)return null;if((d&30)!==0||(d&i.expiredLanes)!==0||r)r=sl(i,d);else{r=d;var g=lt;lt|=2;var _=Jm();(nn!==i||fn!==r)&&(Mi=null,Sr=Nt()+500,Os(i,r));do try{WS();break}catch(V){Qm(i,V)}while(!0);Xc(),Qa.current=_,lt=g,Wt!==null?r=0:(nn=null,fn=0,r=Yt)}if(r!==0){if(r===2&&(g=hc(i),g!==0&&(d=g,r=Tu(i,g))),r===1)throw l=Eo,Os(i,0),os(i,d),An(i,Nt()),l;if(r===6)os(i,d);else{if(g=i.current.alternate,(d&30)===0&&!HS(g)&&(r=sl(i,d),r===2&&(_=hc(i),_!==0&&(d=_,r=Tu(i,_))),r===1))throw l=Eo,Os(i,0),os(i,d),An(i,Nt()),l;switch(i.finishedWork=g,i.finishedLanes=d,r){case 0:case 1:throw Error(n(345));case 2:Bs(i,Ln,Mi);break;case 3:if(os(i,d),(d&130023424)===d&&(r=Pu+500-Nt(),10<r)){if(ha(i,0)!==0)break;if(g=i.suspendedLanes,(g&d)!==d){Sn(),i.pingedLanes|=i.suspendedLanes&g;break}i.timeoutHandle=zc(Bs.bind(null,i,Ln,Mi),r);break}Bs(i,Ln,Mi);break;case 4:if(os(i,d),(d&4194240)===d)break;for(r=i.eventTimes,g=-1;0<d;){var P=31-Nn(d);_=1<<P,P=r[P],P>g&&(g=P),d&=~_}if(d=g,d=Nt()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*$S(d/1960))-d,10<d){i.timeoutHandle=zc(Bs.bind(null,i,Ln,Mi),d);break}Bs(i,Ln,Mi);break;case 5:Bs(i,Ln,Mi);break;default:throw Error(n(329))}}}return An(i,Nt()),i.callbackNode===l?Gm.bind(null,i):null}function Tu(i,r){var l=No;return i.current.memoizedState.isDehydrated&&(Os(i,r).flags|=256),i=sl(i,r),i!==2&&(r=Ln,Ln=l,r!==null&&Du(r)),i}function Du(i){Ln===null?Ln=i:Ln.push.apply(Ln,i)}function HS(i){for(var r=i;;){if(r.flags&16384){var l=r.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var d=0;d<l.length;d++){var g=l[d],_=g.getSnapshot;g=g.value;try{if(!ii(_(),g))return!1}catch{return!1}}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function os(i,r){for(r&=~Ru,r&=~Ja,i.suspendedLanes|=r,i.pingedLanes&=~r,i=i.expirationTimes;0<r;){var l=31-Nn(r),d=1<<l;i[l]=-1,r&=~d}}function Xm(i){if((lt&6)!==0)throw Error(n(327));xr();var r=ha(i,0);if((r&1)===0)return An(i,Nt()),null;var l=sl(i,r);if(i.tag!==0&&l===2){var d=hc(i);d!==0&&(r=d,l=Tu(i,d))}if(l===1)throw l=Eo,Os(i,0),os(i,r),An(i,Nt()),l;if(l===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=r,Bs(i,Ln,Mi),An(i,Nt()),null}function Mu(i,r){var l=lt;lt|=1;try{return i(r)}finally{lt=l,lt===0&&(Sr=Nt()+500,La&&Zi())}}function Is(i){ss!==null&&ss.tag===0&&(lt&6)===0&&xr();var r=lt;lt|=1;var l=Xn.transition,d=pt;try{if(Xn.transition=null,pt=1,i)return i()}finally{pt=d,Xn.transition=l,lt=r,(lt&6)===0&&Zi()}}function Iu(){Bn=br.current,kt(br)}function Os(i,r){i.finishedWork=null,i.finishedLanes=0;var l=i.timeoutHandle;if(l!==-1&&(i.timeoutHandle=-1,_S(l)),Wt!==null)for(l=Wt.return;l!==null;){var d=l;switch(Kc(d),d.tag){case 1:d=d.type.childContextTypes,d!=null&&Ra();break;case 3:_r(),kt(jn),kt(gn),su();break;case 5:nu(d);break;case 4:_r();break;case 13:kt(Lt);break;case 19:kt(Lt);break;case 10:Qc(d.type._context);break;case 22:case 23:Iu()}l=l.return}if(nn=i,Wt=i=as(i.current,null),fn=Bn=r,Yt=0,Eo=null,Ru=Ja=Ms=0,Ln=No=null,As!==null){for(r=0;r<As.length;r++)if(l=As[r],d=l.interleaved,d!==null){l.interleaved=null;var g=d.next,_=l.pending;if(_!==null){var P=_.next;_.next=g,d.next=P}l.pending=d}As=null}return i}function Qm(i,r){do{var l=Wt;try{if(Xc(),$a.current=Ka,Ha){for(var d=At.memoizedState;d!==null;){var g=d.queue;g!==null&&(g.pending=null),d=d.next}Ha=!1}if(Ds=0,tn=Vt=At=null,wo=!1,bo=0,ju.current=null,l===null||l.return===null){Yt=1,Eo=r,Wt=null;break}e:{var _=i,P=l.return,V=l,J=r;if(r=fn,V.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var ae=J,Se=V,ke=Se.tag;if((Se.mode&1)===0&&(ke===0||ke===11||ke===15)){var ye=Se.alternate;ye?(Se.updateQueue=ye.updateQueue,Se.memoizedState=ye.memoizedState,Se.lanes=ye.lanes):(Se.updateQueue=null,Se.memoizedState=null)}var Pe=Sm(P);if(Pe!==null){Pe.flags&=-257,xm(Pe,P,V,_,r),Pe.mode&1&&bm(_,ae,r),r=Pe,J=ae;var Oe=r.updateQueue;if(Oe===null){var ze=new Set;ze.add(J),r.updateQueue=ze}else Oe.add(J);break e}else{if((r&1)===0){bm(_,ae,r),Ou();break e}J=Error(n(426))}}else if(jt&&V.mode&1){var Ft=Sm(P);if(Ft!==null){(Ft.flags&65536)===0&&(Ft.flags|=256),xm(Ft,P,V,_,r),Yc(yr(J,V));break e}}_=J=yr(J,V),Yt!==4&&(Yt=2),No===null?No=[_]:No.push(_),_=P;do{switch(_.tag){case 3:_.flags|=65536,r&=-r,_.lanes|=r;var ne=ym(_,J,r);qp(_,ne);break e;case 1:V=J;var ee=_.type,re=_.stateNode;if((_.flags&128)===0&&(typeof ee.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(is===null||!is.has(re)))){_.flags|=65536,r&=-r,_.lanes|=r;var Ce=wm(_,V,r);qp(_,Ce);break e}}_=_.return}while(_!==null)}eg(l)}catch(Fe){r=Fe,Wt===l&&l!==null&&(Wt=l=l.return);continue}break}while(!0)}function Jm(){var i=Qa.current;return Qa.current=Ka,i===null?Ka:i}function Ou(){(Yt===0||Yt===3||Yt===2)&&(Yt=4),nn===null||(Ms&268435455)===0&&(Ja&268435455)===0||os(nn,fn)}function sl(i,r){var l=lt;lt|=2;var d=Jm();(nn!==i||fn!==r)&&(Mi=null,Os(i,r));do try{US();break}catch(g){Qm(i,g)}while(!0);if(Xc(),lt=l,Qa.current=d,Wt!==null)throw Error(n(261));return nn=null,fn=0,Yt}function US(){for(;Wt!==null;)Zm(Wt)}function WS(){for(;Wt!==null&&!tr();)Zm(Wt)}function Zm(i){var r=ig(i.alternate,i,Bn);i.memoizedProps=i.pendingProps,r===null?eg(i):Wt=r,ju.current=null}function eg(i){var r=i;do{var l=r.alternate;if(i=r.return,(r.flags&32768)===0){if(l=IS(l,r,Bn),l!==null){Wt=l;return}}else{if(l=OS(l,r),l!==null){l.flags&=32767,Wt=l;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{Yt=6,Wt=null;return}}if(r=r.sibling,r!==null){Wt=r;return}Wt=r=i}while(r!==null);Yt===0&&(Yt=5)}function Bs(i,r,l){var d=pt,g=Xn.transition;try{Xn.transition=null,pt=1,KS(i,r,l,d)}finally{Xn.transition=g,pt=d}return null}function KS(i,r,l,d){do xr();while(ss!==null);if((lt&6)!==0)throw Error(n(327));l=i.finishedWork;var g=i.finishedLanes;if(l===null)return null;if(i.finishedWork=null,i.finishedLanes=0,l===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var _=l.lanes|l.childLanes;if(Cb(i,_),i===nn&&(Wt=nn=null,fn=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||el||(el=!0,sg(qe,function(){return xr(),null})),_=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||_){_=Xn.transition,Xn.transition=null;var P=pt;pt=1;var V=lt;lt|=4,ju.current=null,zS(i,l),Wm(l,i),dS(Oc),ma=!!Ic,Oc=Ic=null,i.current=l,FS(l),ca(),lt=V,pt=P,Xn.transition=_}else i.current=l;if(el&&(el=!1,ss=i,tl=g),_=i.pendingLanes,_===0&&(is=null),dc(l.stateNode),An(i,Nt()),r!==null)for(d=i.onRecoverableError,l=0;l<r.length;l++)g=r[l],d(g.value,{componentStack:g.stack,digest:g.digest});if(Za)throw Za=!1,i=Lu,Lu=null,i;return(tl&1)!==0&&i.tag!==0&&xr(),_=i.pendingLanes,(_&1)!==0?i===Au?jo++:(jo=0,Au=i):jo=0,Zi(),null}function xr(){if(ss!==null){var i=Hf(tl),r=Xn.transition,l=pt;try{if(Xn.transition=null,pt=16>i?16:i,ss===null)var d=!1;else{if(i=ss,ss=null,tl=0,(lt&6)!==0)throw Error(n(331));var g=lt;for(lt|=4,Ae=i.current;Ae!==null;){var _=Ae,P=_.child;if((Ae.flags&16)!==0){var V=_.deletions;if(V!==null){for(var J=0;J<V.length;J++){var ae=V[J];for(Ae=ae;Ae!==null;){var Se=Ae;switch(Se.tag){case 0:case 11:case 15:Co(8,Se,_)}var ke=Se.child;if(ke!==null)ke.return=Se,Ae=ke;else for(;Ae!==null;){Se=Ae;var ye=Se.sibling,Pe=Se.return;if(zm(Se),Se===ae){Ae=null;break}if(ye!==null){ye.return=Pe,Ae=ye;break}Ae=Pe}}}var Oe=_.alternate;if(Oe!==null){var ze=Oe.child;if(ze!==null){Oe.child=null;do{var Ft=ze.sibling;ze.sibling=null,ze=Ft}while(ze!==null)}}Ae=_}}if((_.subtreeFlags&2064)!==0&&P!==null)P.return=_,Ae=P;else e:for(;Ae!==null;){if(_=Ae,(_.flags&2048)!==0)switch(_.tag){case 0:case 11:case 15:Co(9,_,_.return)}var ne=_.sibling;if(ne!==null){ne.return=_.return,Ae=ne;break e}Ae=_.return}}var ee=i.current;for(Ae=ee;Ae!==null;){P=Ae;var re=P.child;if((P.subtreeFlags&2064)!==0&&re!==null)re.return=P,Ae=re;else e:for(P=ee;Ae!==null;){if(V=Ae,(V.flags&2048)!==0)try{switch(V.tag){case 0:case 11:case 15:Xa(9,V)}}catch(Fe){It(V,V.return,Fe)}if(V===P){Ae=null;break e}var Ce=V.sibling;if(Ce!==null){Ce.return=V.return,Ae=Ce;break e}Ae=V.return}}if(lt=g,Zi(),en&&typeof en.onPostCommitFiberRoot=="function")try{en.onPostCommitFiberRoot(Ut,i)}catch{}d=!0}return d}finally{pt=l,Xn.transition=r}}return!1}function tg(i,r,l){r=yr(l,r),r=ym(i,r,1),i=ts(i,r,1),r=Sn(),i!==null&&(Qr(i,1,r),An(i,r))}function It(i,r,l){if(i.tag===3)tg(i,i,l);else for(;r!==null;){if(r.tag===3){tg(r,i,l);break}else if(r.tag===1){var d=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(is===null||!is.has(d))){i=yr(l,i),i=wm(r,i,1),r=ts(r,i,1),i=Sn(),r!==null&&(Qr(r,1,i),An(r,i));break}}r=r.return}}function qS(i,r,l){var d=i.pingCache;d!==null&&d.delete(r),r=Sn(),i.pingedLanes|=i.suspendedLanes&l,nn===i&&(fn&l)===l&&(Yt===4||Yt===3&&(fn&130023424)===fn&&500>Nt()-Pu?Os(i,0):Ru|=l),An(i,r)}function ng(i,r){r===0&&((i.mode&1)===0?r=1:(r=da,da<<=1,(da&130023424)===0&&(da=4194304)));var l=Sn();i=Ai(i,r),i!==null&&(Qr(i,r,l),An(i,l))}function VS(i){var r=i.memoizedState,l=0;r!==null&&(l=r.retryLane),ng(i,l)}function YS(i,r){var l=0;switch(i.tag){case 13:var d=i.stateNode,g=i.memoizedState;g!==null&&(l=g.retryLane);break;case 19:d=i.stateNode;break;default:throw Error(n(314))}d!==null&&d.delete(r),ng(i,l)}var ig;ig=function(i,r,l){if(i!==null)if(i.memoizedProps!==r.pendingProps||jn.current)Pn=!0;else{if((i.lanes&l)===0&&(r.flags&128)===0)return Pn=!1,MS(i,r,l);Pn=(i.flags&131072)!==0}else Pn=!1,jt&&(r.flags&1048576)!==0&&Ip(r,Ta,r.index);switch(r.lanes=0,r.tag){case 2:var d=r.type;Ya(i,r),i=r.pendingProps;var g=dr(r,gn.current);vr(r,l),g=au(null,r,d,i,g,l);var _=lu();return r.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,Rn(d)?(_=!0,Pa(r)):_=!1,r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,eu(r),g.updater=qa,r.stateNode=g,g._reactInternals=r,pu(r,d,i,l),r=_u(null,r,d,!0,_,l)):(r.tag=0,jt&&_&&Wc(r),bn(null,r,g,l),r=r.child),r;case 16:d=r.elementType;e:{switch(Ya(i,r),i=r.pendingProps,g=d._init,d=g(d._payload),r.type=d,g=r.tag=XS(d),i=ri(d,i),g){case 0:r=vu(null,r,d,i,l);break e;case 1:r=Rm(null,r,d,i,l);break e;case 11:r=km(null,r,d,i,l);break e;case 14:r=Cm(null,r,d,ri(d.type,i),l);break e}throw Error(n(306,d,""))}return r;case 0:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),vu(i,r,d,g,l);case 1:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),Rm(i,r,d,g,l);case 3:e:{if(Pm(r),i===null)throw Error(n(387));d=r.pendingProps,_=r.memoizedState,g=_.element,Kp(i,r),za(r,d,null,l);var P=r.memoizedState;if(d=P.element,_.isDehydrated)if(_={element:d,isDehydrated:!1,cache:P.cache,pendingSuspenseBoundaries:P.pendingSuspenseBoundaries,transitions:P.transitions},r.updateQueue.baseState=_,r.memoizedState=_,r.flags&256){g=yr(Error(n(423)),r),r=Lm(i,r,d,l,g);break e}else if(d!==g){g=yr(Error(n(424)),r),r=Lm(i,r,d,l,g);break e}else for(On=Xi(r.stateNode.containerInfo.firstChild),In=r,jt=!0,si=null,l=Up(r,null,d,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(pr(),d===g){r=Di(i,r,l);break e}bn(i,r,d,l)}r=r.child}return r;case 5:return Yp(r),i===null&&Vc(r),d=r.type,g=r.pendingProps,_=i!==null?i.memoizedProps:null,P=g.children,Bc(d,g)?P=null:_!==null&&Bc(d,_)&&(r.flags|=32),jm(i,r),bn(i,r,P,l),r.child;case 6:return i===null&&Vc(r),null;case 13:return Am(i,r,l);case 4:return tu(r,r.stateNode.containerInfo),d=r.pendingProps,i===null?r.child=mr(r,null,d,l):bn(i,r,d,l),r.child;case 11:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),km(i,r,d,g,l);case 7:return bn(i,r,r.pendingProps,l),r.child;case 8:return bn(i,r,r.pendingProps.children,l),r.child;case 12:return bn(i,r,r.pendingProps.children,l),r.child;case 10:e:{if(d=r.type._context,g=r.pendingProps,_=r.memoizedProps,P=g.value,yt(Ia,d._currentValue),d._currentValue=P,_!==null)if(ii(_.value,P)){if(_.children===g.children&&!jn.current){r=Di(i,r,l);break e}}else for(_=r.child,_!==null&&(_.return=r);_!==null;){var V=_.dependencies;if(V!==null){P=_.child;for(var J=V.firstContext;J!==null;){if(J.context===d){if(_.tag===1){J=Ti(-1,l&-l),J.tag=2;var ae=_.updateQueue;if(ae!==null){ae=ae.shared;var Se=ae.pending;Se===null?J.next=J:(J.next=Se.next,Se.next=J),ae.pending=J}}_.lanes|=l,J=_.alternate,J!==null&&(J.lanes|=l),Jc(_.return,l,r),V.lanes|=l;break}J=J.next}}else if(_.tag===10)P=_.type===r.type?null:_.child;else if(_.tag===18){if(P=_.return,P===null)throw Error(n(341));P.lanes|=l,V=P.alternate,V!==null&&(V.lanes|=l),Jc(P,l,r),P=_.sibling}else P=_.child;if(P!==null)P.return=_;else for(P=_;P!==null;){if(P===r){P=null;break}if(_=P.sibling,_!==null){_.return=P.return,P=_;break}P=P.return}_=P}bn(i,r,g.children,l),r=r.child}return r;case 9:return g=r.type,d=r.pendingProps.children,vr(r,l),g=Yn(g),d=d(g),r.flags|=1,bn(i,r,d,l),r.child;case 14:return d=r.type,g=ri(d,r.pendingProps),g=ri(d.type,g),Cm(i,r,d,g,l);case 15:return Em(i,r,r.type,r.pendingProps,l);case 17:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),Ya(i,r),r.tag=1,Rn(d)?(i=!0,Pa(r)):i=!1,vr(r,l),vm(r,d,g),pu(r,d,g,l),_u(null,r,d,!0,i,l);case 19:return Dm(i,r,l);case 22:return Nm(i,r,l)}throw Error(n(156,r.tag))};function sg(i,r){return Ns(i,r)}function GS(i,r,l,d){this.tag=i,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qn(i,r,l,d){return new GS(i,r,l,d)}function Bu(i){return i=i.prototype,!(!i||!i.isReactComponent)}function XS(i){if(typeof i=="function")return Bu(i)?1:0;if(i!=null){if(i=i.$$typeof,i===I)return 11;if(i===L)return 14}return 2}function as(i,r){var l=i.alternate;return l===null?(l=Qn(i.tag,r,i.key,i.mode),l.elementType=i.elementType,l.type=i.type,l.stateNode=i.stateNode,l.alternate=i,i.alternate=l):(l.pendingProps=r,l.type=i.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=i.flags&14680064,l.childLanes=i.childLanes,l.lanes=i.lanes,l.child=i.child,l.memoizedProps=i.memoizedProps,l.memoizedState=i.memoizedState,l.updateQueue=i.updateQueue,r=i.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=i.sibling,l.index=i.index,l.ref=i.ref,l}function rl(i,r,l,d,g,_){var P=2;if(d=i,typeof i=="function")Bu(i)&&(P=1);else if(typeof i=="string")P=5;else e:switch(i){case z:return zs(l.children,g,_,r);case Z:P=8,g|=8;break;case G:return i=Qn(12,l,r,g|2),i.elementType=G,i.lanes=_,i;case j:return i=Qn(13,l,r,g),i.elementType=j,i.lanes=_,i;case T:return i=Qn(19,l,r,g),i.elementType=T,i.lanes=_,i;case W:return ol(l,g,_,r);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case Q:P=10;break e;case B:P=9;break e;case I:P=11;break e;case L:P=14;break e;case $:P=16,d=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return r=Qn(P,l,r,g),r.elementType=i,r.type=d,r.lanes=_,r}function zs(i,r,l,d){return i=Qn(7,i,d,r),i.lanes=l,i}function ol(i,r,l,d){return i=Qn(22,i,d,r),i.elementType=W,i.lanes=l,i.stateNode={isHidden:!1},i}function zu(i,r,l){return i=Qn(6,i,null,r),i.lanes=l,i}function Fu(i,r,l){return r=Qn(4,i.children!==null?i.children:[],i.key,r),r.lanes=l,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}function QS(i,r,l,d,g){this.tag=r,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=fc(0),this.expirationTimes=fc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fc(0),this.identifierPrefix=d,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function $u(i,r,l,d,g,_,P,V,J){return i=new QS(i,r,l,V,J),r===1?(r=1,_===!0&&(r|=8)):r=0,_=Qn(3,null,null,r),i.current=_,_.stateNode=i,_.memoizedState={element:d,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},eu(_),i}function JS(i,r,l){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Y,key:d==null?null:""+d,children:i,containerInfo:r,implementation:l}}function rg(i){if(!i)return Ji;i=i._reactInternals;e:{if(zt(i)!==i||i.tag!==1)throw Error(n(170));var r=i;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(Rn(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(n(171))}if(i.tag===1){var l=i.type;if(Rn(l))return Tp(i,l,r)}return r}function og(i,r,l,d,g,_,P,V,J){return i=$u(l,d,!0,i,g,_,P,V,J),i.context=rg(null),l=i.current,d=Sn(),g=rs(l),_=Ti(d,g),_.callback=r??null,ts(l,_,g),i.current.lanes=g,Qr(i,g,d),An(i,d),i}function al(i,r,l,d){var g=r.current,_=Sn(),P=rs(g);return l=rg(l),r.context===null?r.context=l:r.pendingContext=l,r=Ti(_,P),r.payload={element:i},d=d===void 0?null:d,d!==null&&(r.callback=d),i=ts(g,r,P),i!==null&&(li(i,g,P,_),Ba(i,g,P)),P}function ll(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function ag(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var l=i.retryLane;i.retryLane=l!==0&&l<r?l:r}}function Hu(i,r){ag(i,r),(i=i.alternate)&&ag(i,r)}function ZS(){return null}var lg=typeof reportError=="function"?reportError:function(i){console.error(i)};function Uu(i){this._internalRoot=i}cl.prototype.render=Uu.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(n(409));al(i,r,null,null)},cl.prototype.unmount=Uu.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;Is(function(){al(null,i,null,null)}),r[ji]=null}};function cl(i){this._internalRoot=i}cl.prototype.unstable_scheduleHydration=function(i){if(i){var r=Kf();i={blockedOn:null,target:i,priority:r};for(var l=0;l<Vi.length&&r!==0&&r<Vi[l].priority;l++);Vi.splice(l,0,i),l===0&&Yf(i)}};function Wu(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function ul(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function cg(){}function e0(i,r,l,d,g){if(g){if(typeof d=="function"){var _=d;d=function(){var ae=ll(P);_.call(ae)}}var P=og(r,d,i,0,null,!1,!1,"",cg);return i._reactRootContainer=P,i[ji]=P.current,ho(i.nodeType===8?i.parentNode:i),Is(),P}for(;g=i.lastChild;)i.removeChild(g);if(typeof d=="function"){var V=d;d=function(){var ae=ll(J);V.call(ae)}}var J=$u(i,0,!1,null,null,!1,!1,"",cg);return i._reactRootContainer=J,i[ji]=J.current,ho(i.nodeType===8?i.parentNode:i),Is(function(){al(r,J,l,d)}),J}function dl(i,r,l,d,g){var _=l._reactRootContainer;if(_){var P=_;if(typeof g=="function"){var V=g;g=function(){var J=ll(P);V.call(J)}}al(r,P,i,g)}else P=e0(l,r,i,g,d);return ll(P)}Uf=function(i){switch(i.tag){case 3:var r=i.stateNode;if(r.current.memoizedState.isDehydrated){var l=Xr(r.pendingLanes);l!==0&&(pc(r,l|1),An(r,Nt()),(lt&6)===0&&(Sr=Nt()+500,Zi()))}break;case 13:Is(function(){var d=Ai(i,1);if(d!==null){var g=Sn();li(d,i,1,g)}}),Hu(i,1)}},mc=function(i){if(i.tag===13){var r=Ai(i,134217728);if(r!==null){var l=Sn();li(r,i,134217728,l)}Hu(i,134217728)}},Wf=function(i){if(i.tag===13){var r=rs(i),l=Ai(i,r);if(l!==null){var d=Sn();li(l,i,r,d)}Hu(i,r)}},Kf=function(){return pt},qf=function(i,r){var l=pt;try{return pt=i,r()}finally{pt=l}},Qe=function(i,r,l){switch(r){case"input":if(Et(i,l),r=l.name,l.type==="radio"&&r!=null){for(l=i;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<l.length;r++){var d=l[r];if(d!==i&&d.form===i.form){var g=ja(d);if(!g)throw Error(n(90));Ye(d),Et(d,g)}}}break;case"textarea":xe(i,l);break;case"select":r=l.value,r!=null&&rt(i,!!l.multiple,r,!1)}},Wn=Mu,ui=Is;var t0={usingClientEntryPoint:!1,Events:[mo,cr,ja,Zt,ni,Mu]},Ro={findFiberByHostInstance:js,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},n0={bundleType:Ro.bundleType,version:Ro.version,rendererPackageName:Ro.rendererPackageName,rendererConfig:Ro.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:O.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Es(i),i===null?null:i.stateNode},findFiberByHostInstance:Ro.findFiberByHostInstance||ZS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hl.isDisabled&&hl.supportsFiber)try{Ut=hl.inject(n0),en=hl}catch{}}return Tn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=t0,Tn.createPortal=function(i,r){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Wu(r))throw Error(n(200));return JS(i,r,null,l)},Tn.createRoot=function(i,r){if(!Wu(i))throw Error(n(299));var l=!1,d="",g=lg;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onRecoverableError!==void 0&&(g=r.onRecoverableError)),r=$u(i,1,!1,null,null,l,!1,d,g),i[ji]=r.current,ho(i.nodeType===8?i.parentNode:i),new Uu(r)},Tn.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=Es(r),i=i===null?null:i.stateNode,i},Tn.flushSync=function(i){return Is(i)},Tn.hydrate=function(i,r,l){if(!ul(r))throw Error(n(200));return dl(null,i,r,!0,l)},Tn.hydrateRoot=function(i,r,l){if(!Wu(i))throw Error(n(405));var d=l!=null&&l.hydratedSources||null,g=!1,_="",P=lg;if(l!=null&&(l.unstable_strictMode===!0&&(g=!0),l.identifierPrefix!==void 0&&(_=l.identifierPrefix),l.onRecoverableError!==void 0&&(P=l.onRecoverableError)),r=og(r,null,i,1,l??null,g,!1,_,P),i[ji]=r.current,ho(i),d)for(i=0;i<d.length;i++)l=d[i],g=l._getVersion,g=g(l._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[l,g]:r.mutableSourceEagerHydrationData.push(l,g);return new cl(r)},Tn.render=function(i,r,l){if(!ul(r))throw Error(n(200));return dl(null,i,r,!1,l)},Tn.unmountComponentAtNode=function(i){if(!ul(i))throw Error(n(40));return i._reactRootContainer?(Is(function(){dl(null,null,i,!1,function(){i._reactRootContainer=null,i[ji]=null})}),!0):!1},Tn.unstable_batchedUpdates=Mu,Tn.unstable_renderSubtreeIntoContainer=function(i,r,l,d){if(!ul(l))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return dl(i,r,l,!1,d)},Tn.version="18.3.1-next-f1338f8080-20240426",Tn}var vg;function d0(){if(vg)return Vu.exports;vg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Vu.exports=u0(),Vu.exports}var _g;function h0(){if(_g)return fl;_g=1;var e=d0();return fl.createRoot=e.createRoot,fl.hydrateRoot=e.hydrateRoot,fl}var f0=h0();const p0=Vh(f0);function Ht(e,t,n={}){return fetch(e,{...n,headers:{...n.headers||{},Authorization:`Bearer ${t}`}})}const X_=e=>`nc_seen_${e}`;async function Te(e,t,n={}){const s=await Ht(e,t,{method:n.method||"GET",headers:{"content-type":"application/json"},body:n.body?JSON.stringify(n.body):void 0}),o=await s.json().catch(()=>({}));if(!s.ok){const a=new Error(o.error||`HTTP ${s.status}`);throw a.status=s.status,a.data=o,a}return o}const cn=e=>Array.isArray(e)&&e.length?`/api/route/${e.map(encodeURIComponent).join("/")}/_`:"/api",un=(e,t)=>`${cn(e)}/fleet/${t}`,ws=(e,t)=>Te(un(t,"status"),e),Gh=(e,t,n)=>Te(un(n,"up"),e,{method:"POST",body:t}),Il=(e,t,n)=>Te(un(n,"down"),e,{method:"POST",body:t}),Q_=(e,t,n)=>Te(un(n,"boot"),e,{method:"POST",body:t}),Fo=(e,t,n)=>Te(un(n,"restart"),e,{method:"POST",body:{cell:t}}),Jl=(e,t)=>Te(un(t,"definitions"),e),m0=(e,t)=>Te(un(t,"credentials/status"),e),yg=(e,t,n,s)=>Te(un(s,"credentials/set"),e,{method:"POST",body:{envKey:t,value:n}}),g0=(e,t,n)=>Te(un(n,"credentials/remove"),e,{method:"POST",body:{envKey:t}}),v0=(e,t,n)=>Te(un(n,"define-engine"),e,{method:"POST",body:{def:t}}),_0=(e,t,n,s,o)=>Te(un(o,"edit-engine"),e,{method:"POST",body:{id:t,patch:n,envChanges:s}}),y0=(e,t,n)=>Te(un(n,"remove-engine"),e,{method:"POST",body:{id:t}}),w0=(e,t,n)=>Te(un(n,"define-cell"),e,{method:"POST",body:{def:t}}),J_=(e,t,n,s)=>Te(un(s,"edit-cell"),e,{method:"POST",body:{id:t,patch:n}}),Z_=(e,t,n=!1,s)=>Te(un(s,"remove-cell"),e,{method:"POST",body:{id:t,stop:n}}),b0=(e,t,n)=>Te(un(n,"import-cell"),e,{method:"POST",body:t}),S0=(e,t,n)=>Te(un(n,"restore-cells"),e,{method:"POST",body:{cells:t}}),x0=(e,t,n,s)=>Te(un(s,"restore-engines"),e,{method:"POST",body:{engines:t,overwrite:!!n}}),Xh=(e,t,n)=>Te(`${cn(n)}/sessions/${encodeURIComponent(t)}`,e,{method:"DELETE"}),ey=(e,t,n,s)=>Te(`${cn(s)}/sessions/${encodeURIComponent(t)}/visibility`,e,{method:"PATCH",body:{technical:!!n}}),Qh=(e,t,n)=>Te(`${cn(n)}/fs/dirs${t?`?path=${encodeURIComponent(t)}`:""}`,e),ty=e=>Te("/api/settings",e),k0=e=>Te("/api/nodes",e),C0=e=>Te("/api/peers",e),ny=(e,t=[])=>Te(`${cn(t)}/vl-nodes`,e),wg=(e,t,n,s={},o=[])=>Te(`${cn(o)}/vl-nodes/${encodeURIComponent(t)}/commands`,e,{method:"POST",body:{kind:n,args:s}}),E0=(e,t,n=0,s=[])=>Te(`${cn(s)}/vl-nodes/${encodeURIComponent(t)}/events${n?`?after=${encodeURIComponent(n)}`:""}`,e),iy=e=>Te("/api/topology",e),Jh=(e,t)=>Te(`${cn(t)}/sessions`,e),Zh=(e,t)=>Te(`${cn(t)}/config`,e),bg=(e,t)=>Te(`${cn(t)}/topology`,e),Wd=(e,t)=>Te("/api/settings/config",e,{method:"POST",body:t}),N0=e=>Te("/api/settings/token/rotate",e,{method:"POST"}),j0=(e,t)=>Te("/api/settings/nodes/pair",e,{method:"POST",body:t}),R0=(e,t,n=[])=>Te(`${cn(n)}/settings/peering/invite`,e,{method:"POST",body:t||{}}),sy=(e,t,n)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}/label`,e,{method:"PATCH",body:{label:n}}),P0=e=>Te("/api/settings/node-aliases",e),L0=(e,t,n)=>Te(`/api/settings/node-aliases/${encodeURIComponent(t)}`,e,{method:"PATCH",body:{alias:n}}),Sg=(e,t)=>Te(`/api/settings/node-aliases/${encodeURIComponent(t)}`,e,{method:"DELETE"}),xg=(e,t,n)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}`,e,{method:"PATCH",body:n}),A0=(e,t)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}`,e,{method:"DELETE"}),ef=(e,t,n)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}/${n}`,e,{method:"POST"}),T0=(e,t,n)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}/share`,e,{method:"PATCH",body:{shared:n}}),D0=(e,t,n,s=[])=>Te(`/api/settings/nodes/${encodeURIComponent(t)}/visibility`,e,{method:"PATCH",body:{visibility:n,selected:s}}),M0=e=>Te("/api/settings/audio",e),I0=(e,t)=>Te("/api/settings/audio/consent",e,{method:"PATCH",body:{consent:t}}),O0=e=>Te("/api/settings/audio/test",e,{method:"POST",body:{}}),B0=e=>Te("/api/settings/audio/stop",e,{method:"POST",body:{}}),z0=e=>Te("/api/settings/audio/groups",e),F0=(e,t,n)=>Te(`/api/settings/audio/groups/${encodeURIComponent(t)}`,e,{method:"PUT",body:n}),$0=(e,t)=>Te(`/api/settings/audio/groups/${encodeURIComponent(t)}`,e,{method:"DELETE"}),H0=e=>Te("/api/settings/service/regenerate",e,{method:"POST"}),U0=e=>Te("/api/settings/update/check",e,{method:"POST"}),W0=e=>Te("/api/settings/update/apply",e,{method:"POST"}),Zl=(e,t)=>`${cn(e)}/diagnostics/${t}`,K0=(e,t=[])=>Te(Zl(t,"status"),e),q0=(e,{after:t=0,limit:n=200}={},s=[])=>Te(`${Zl(s,"logs")}?after=${encodeURIComponent(t)}&limit=${encodeURIComponent(n)}`,e),kg=(e,t,n,s=[])=>Te(Zl(s,"verbose"),e,{method:"PATCH",body:{enabled:t,durationSeconds:n}}),V0=(e,t=[])=>Te(Zl(t,"logs"),e,{method:"DELETE"}),Y0=(e,t=!0)=>Te(`/api/asks${t?"?open=1":""}`,e),G0=(e,t,n)=>Te(`/api/asks/${encodeURIComponent(t)}/answer`,e,{method:"POST",body:{text:n}}),X0=(e,t)=>Te(`/api/asks/${encodeURIComponent(t)}`,e,{method:"DELETE"}),pl=(e,t=[])=>Te(`${cn(t)}/decks`,e),Cg=(e,t,n=[])=>Te(`${cn(n)}/decks`,e,{method:"POST",body:{name:t}}),ml=(e,t,n,s,o=[])=>Te(`${cn(o)}/decks/${encodeURIComponent(t)}`,e,{method:"PUT",body:{layout:n,expectedRevision:s}}),Q0=(e,t,n,s,o=[])=>Te(`${cn(o)}/decks/${encodeURIComponent(t)}`,e,{method:"PATCH",body:{name:n,expectedRevision:s}}),J0=(e,t,n,s=[])=>Te(`${cn(s)}/decks/${encodeURIComponent(t)}`,e,{method:"DELETE",body:{expectedRevision:n}}),Z0={power:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M12 3v8"}),c.jsx("path",{d:"M6.6 6.6a8 8 0 1 0 10.8 0"})]}),folder:c.jsx("path",{d:"M4 6a2 2 0 0 1 2-2h3.6a2 2 0 0 1 1.4.6L12.4 6H18a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z"}),keyboard:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3",y:"6",width:"18",height:"12",rx:"2"}),c.jsx("path",{d:"M7 10h.01M11 10h.01M15 10h.01M17 14h.01M7 14h7"})]}),mic:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"9",y:"3",width:"6",height:"11",rx:"3"}),c.jsx("path",{d:"M5 11a7 7 0 0 0 14 0"}),c.jsx("path",{d:"M12 18v3"})]}),enter:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M20 5v6a2 2 0 0 1-2 2H5"}),c.jsx("polyline",{points:"9 9 5 13 9 17"})]}),send:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M22 2 15 22 11 13 2 9Z"}),c.jsx("path",{d:"M22 2 11 13"})]}),trash:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M4 7h16"}),c.jsx("path",{d:"M9 7V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2"}),c.jsx("path",{d:"M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12"}),c.jsx("path",{d:"M10 11v6M14 11v6"})]}),x:c.jsx("path",{d:"M6 6l12 12M18 6 6 18"}),refresh:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M21 12a9 9 0 1 1-2.64-6.36L21 8"}),c.jsx("polyline",{points:"21 3 21 8 16 8"})]}),boot:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3",y:"4",width:"18",height:"13",rx:"2"}),c.jsx("path",{d:"M8 21h8M12 17v4M12 12V7"}),c.jsx("polyline",{points:"9 10 12 7 15 10"})]}),upload:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M12 16V5"}),c.jsx("polyline",{points:"8 9 12 5 16 9"}),c.jsx("path",{d:"M5 20h14"})]}),chevronLeft:c.jsx("polyline",{points:"14 6 8 12 14 18"}),chevronUp:c.jsx("polyline",{points:"6 14 12 8 18 14"}),chevronDown:c.jsx("polyline",{points:"6 10 12 16 18 10"}),history:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),c.jsx("polyline",{points:"3 3 3 8 8 8"}),c.jsx("path",{d:"M12 7v5l3 2"})]}),attach:c.jsx("path",{d:"M21.44 11.05 12.25 20.24a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"}),file:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),c.jsx("polyline",{points:"14 2 14 8 20 8"})]}),camera:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M14.5 4h-5L7.5 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3.5z"}),c.jsx("circle",{cx:"12",cy:"13",r:"3.5"})]}),image:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),c.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),c.jsx("path",{d:"M21 15l-5-5L5 21"})]}),zoomIn:c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"11",cy:"11",r:"7"}),c.jsx("path",{d:"M21 21l-4.35-4.35"}),c.jsx("path",{d:"M8 11h6M11 8v6"})]}),zoomOut:c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"11",cy:"11",r:"7"}),c.jsx("path",{d:"M21 21l-4.35-4.35"}),c.jsx("path",{d:"M8 11h6"})]}),gear:c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"12",cy:"12",r:"3"}),c.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),copy:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),c.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})};function Je({name:e,size:t=20}){return c.jsx("svg",{className:"nc-icon",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:Z0[e]||null})}const ex=["all","pinned","active","off","technical"],ry="nc_sidebar_views_v1",oy="nc_sidebar_order_v1";function ay(e){return ex.includes(e)?e:"all"}function tx(e,t=[],n="all"){const s=ay(n);return s==="technical"?e.technical===!0:e.technical===!0?!1:s==="pinned"?t.includes(e.key):s==="active"?!!e.live:s==="off"?!e.live:!0}function nx(e,t,n=[],s=[]){const o=n.indexOf(e.key),a=n.indexOf(t.key),u=o===-1?Number.MAX_SAFE_INTEGER:o,h=a===-1?Number.MAX_SAFE_INTEGER:a,p=s.indexOf(e.key),m=s.indexOf(t.key),v=p===-1?Number.MAX_SAFE_INTEGER:p,S=m===-1?Number.MAX_SAFE_INTEGER:m;return u-h||v-S||+!!t.live-+!!e.live||+!!t.fresh-+!!e.fresh||Number(t.activity||0)-Number(e.activity||0)||String(e.label||"").localeCompare(String(t.label||""))||String(e.key||"").localeCompare(String(t.key||""))}function ix(e=globalThis.localStorage){try{const t=JSON.parse(e.getItem(oy));if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[s,o]of Object.entries(t).slice(0,64)){if(typeof s!="string"||!s||s.length>160||!Array.isArray(o))continue;const a=[...new Set(o.filter(u=>typeof u=="string"&&u&&u.length<=256))].slice(0,128);a.length&&(n[s]=a)}return n}catch{return{}}}function Fi(e,t){return Array.isArray(e==null?void 0:e[t])?e[t]:[]}function sx(e,t=globalThis.localStorage){try{t.setItem(oy,JSON.stringify(e))}catch{}return e}function rx(e,t,n,s,o=[]){if(typeof t!="string"||!t||n===s)return e;const a=[...new Set(o.filter(y=>typeof y=="string"&&y))];if(!a.includes(n)||!a.includes(s))return e;const u=Fi(e,t).filter(y=>a.includes(y)),h=[...u,...a.filter(y=>!u.includes(y))],p=h.indexOf(n),m=h.indexOf(s);h.splice(p,1);const v=h.indexOf(s),S=p<m?v+1:v;return h.splice(S,0,n),{...e,[t]:h}}function ox(e=globalThis.localStorage){try{const t=JSON.parse(e.getItem(ry));return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function Eg(e,t){var n,s;return{open:((n=e==null?void 0:e[t])==null?void 0:n.open)!==!1,filter:ay((s=e==null?void 0:e[t])==null?void 0:s.filter)}}function ax(e,t=globalThis.localStorage){try{t.setItem(ry,JSON.stringify(e))}catch{}return e}function Ng(e,t=""){const n=String(t||"").trim().toLocaleLowerCase();return n?[e.label,e.key,e.searchText].filter(Boolean).join(" ").toLocaleLowerCase().includes(n):!0}function gs(e=[],t=[],n="all",s=[]){return[...e].filter(o=>tx(o,t,n)).sort((o,a)=>nx(o,a,t,s))}const tf=["it","en","es"];function lx(){try{const e=typeof navigator<"u"&&navigator.language||"",t=String(e).slice(0,2).toLowerCase();return tf.includes(t)?t:"en"}catch{return"en"}}const jl=lx(),ly="nc_lang",Kd="nc-lang";function cy(){return typeof localStorage<"u"?localStorage:null}const gl={it:{"update-available":"nuova versione {v} disponibile","install-version-mismatch":"installazione incompleta: frontend e server non coincidono (v{v})",reload:"ricarica","grid-empty":"trascina qui una sessione dalla sidebar, o doppio-clic per la vista singola","grid-full":"il deck può mostrare al massimo 9 sessioni",pin:"fissa in cima",reorder:"riordina","reorder-help":"trascina la maniglia; frecce su/giu da tastiera","rename-node":"rinomina nodo","rename-node-prompt":"Nuovo nome del nodo in NexusCrew","rename-node-invalid":"Nome non valido: massimo 64 caratteri, senza a capo.","reorder-deck-help":"trascina il deck; frecce sinistra/destra da tastiera",sessions:"sessioni","new-session":"nuova sessione",new:"nuova",fleet:"Flotta","fleet-tmux":"flotta tmux","other-sessions":"Altre sessioni","view-all":"tutte","view-pinned":"fissate","view-active":"attive","view-off":"spente","view-technical":"tecniche","mark-technical":"nascondi come sessione tecnica","mark-normal":"mostra come sessione normale","position-local":"Locale",files:"file",refresh:"aggiorna","filter-placeholder":"filtra sessioni…","loading-fleet":"carico la flotta…","no-sessions":"nessuna sessione tmux viva — la flotta parte al boot (systemd)","no-match":'nessuna sessione contiene "{q}"',"copy-url":"clicca per copiare l'URL","ssh-only":"solo tunnel SSH/VPN","new-files-outbox":"nuovi file in outbox",terminate:"termina","terminate-confirm":'Terminare la sessione "{name}"?',"cell-on":"tmux vivo","cell-off":"spenta","cell-working":"al lavoro","cell-idle":"in attesa","cell-degraded":"degradata: unit attiva, tmux morto","power-on":"accendi","power-off":"spegni","boot-enable":"attiva al boot","boot-disable":"disattiva al boot","state-on":"accesa","state-off":"spenta",engine:"Engine",model:"Modello","model-default":"Modello predefinito del provider","model-remembered":"Ultimo modello usato con questo engine","boot-persist":"avvia al boot","remove-boot":"togli anche dal boot","power-config-in-settings":"Engine, provider, profilo, modello e permessi si modificano in Impostazioni → Flotta.","no-remote-control":"⚠ engine non-native: niente RC da app claude.ai (da qui la piloti comunque)",cancel:"annulla",name:"nome","name-invalid":"nome non valido: a-zA-Z0-9._- max 64, senza '-' iniziale",cwd:"cartella",browse:"sfoglia","fs-home":"home","fs-parent":".. su",preset:"preset","preset-2x2":"griglia 2×2","preset-columns":"colonne","preset-equalize":"equalizza",collapse:"comprimi",expand:"espandi",create:"crea","auth-prompt":"Incolla il token (stampato dal server):","remember-device":"ricorda su questo device","zoom-out":"testo più piccolo","zoom-in":"testo più grande",composer:"composer",windows:"{n} finestre","empty-files":"vuota",upload:"carica","no-sessions-short":"nessuna sessione","composer-placeholder":"scrivi o detta…","composer-history-tools":"cronologia e dimensione input","composer-history":"cronologia della cella","composer-history-empty":"nessun input inviato","composer-history-clear":"cancella cronologia di questa cella","composer-expand":"espandi input","composer-collapse":"riduci input","composer-clear-data":"cancella bozze e cronologia","composer-clear-data-help":"Rimuove da questo browser tutte le bozze e la cronologia input delle celle.","composer-clear-confirm":"Cancellare tutte le bozze e la cronologia input salvate in questo browser?","composer-clear-done":"Bozze e cronologia cancellate.","composer-clear-failed":"Impossibile cancellare i dati del composer in questo browser.",attach:"allega","attach-file":"File","attach-camera":"Fotocamera","attach-gallery":"Galleria","attach-uploading":"carico…","attach-upload-progress":"allegato {n}/{total}…","attach-uploaded":"{n} allegati caricati",voice:"voice",send:"invia","composer-send-failed":"connessione non pronta — testo conservato, riprova",close:"chiudi","lang-label":"lingua",decks:"deck","new-deck":"nuovo deck","deck-name":"nome deck","open-deck-window":"apri in una nuova finestra","detach-deck":"stacca in una nuova finestra","deck-current":"questo deck (finestra corrente)","deck-owner-unavailable":"nodo owner non condiviso o non raggiungibile","rename-deck":"rinomina deck","delete-deck":"elimina deck","delete-deck-confirm":'Eliminare il deck "{name}"?',"send-to-deck":"manda al deck…","deck-autosave":"salvataggio automatico",saving:"salvataggio…",saved:"salvato","popup-blocked":"popup bloccato: apri qui","expand-owner":"espandi i deck di {owner}","collapse-owner":"comprimi i deck di {owner}","owner-deck-count-one":"{count} deck","owner-deck-count-many":"{count} deck","dot-working":"in uso (finestra attiva)","dot-on":"aperta in background","dot-neutral":"non aperta","dot-warn":"nodo offline","select-drag":"trascina per selezionare","copy-manual":"seleziona e copia manualmente","toggle-sidebar":"mostra/nascondi la barra laterale",settings:"impostazioni","tab-roles":"ruoli","tab-nodes":"nodi",local:"Locale",location:"Dove","pairing-link":"link di pairing","pairing-required":"nome, alias SSH e link di pairing sono obbligatori","pairing-connect-help":"Per collegare un nodo servono: nome, Host SSH già funzionante e link/QR creato sull’altra installazione NexusCrew.","pairing-localhost-hint":"127.0.0.1 nel link è corretto: non aprirlo qui. NexusCrew usa invito e porta attraverso l’Host SSH.","scan-qr":"scansiona QR","pairing-qr-invalid":"QR di pairing non valido","invite-node":"invita un nodo","create-pairing-link":"crea link / QR","visibility-network":"tutta la rete","visibility-relay":"solo relay","visibility-selected":"nodi selezionati","hydra-simple":"locale + nodi, una sola rete","local-ready":"Questo dispositivo è pronto. Puoi usarlo da solo o collegarlo a un nodo.","local-only":"solo locale","add-node":"aggiungi nodo",connect:"collega","node-connected":"Nodo collegato. La rete verrà sincronizzata automaticamente.","tab-system":"sistema","tab-fleet":"flotta","tab-audio":"audio","system-general":"generale","system-diagnostics":"diagnostica","system-this-node":"questo nodo","system-updates":"aggiornamenti","system-security":"sicurezza","system-local-data":"dati locali del browser","system-terminal":"terminale","alternate-screen":"schermo alternato","alternate-screen-help":"Mantiene il comportamento tmux standard per le nuove sessioni NexusCrew. Un’applicazione che segue il mouse scorre da sé; le altre fanno scorrere la storia di tmux. Non modifica le celle già attive.","tab-input":"input","tab-diagnostics":"diagnostica","input-settings-local":"Preferenze locali di questo browser. Si applicano subito a vista singola e deck, senza modificare il nodo remoto.","terminal-keyboard-gesture":"Apertura tastiera virtuale dal terminale","terminal-keyboard-double-tap":"Doppio tap (predefinito)","terminal-keyboard-single-tap":"Tap singolo","terminal-keyboard-never":"Mai dal terminale","terminal-keyboard-gesture-help":"Il tastierino e STT seguono i controlli separati sotto. Mouse e tastiera fisica restano utilizzabili.","keybar-ime-lock":"Tastierino: mantieni chiusa la tastiera virtuale","keybar-ime-lock-help":"ESC, frecce, PgUp/PgDn, Enter e menu inviano direttamente al PTY senza dare focus a un campo di testo.","voice-ime-lock":"Microfono STT: mantieni chiusa la tastiera virtuale","voice-ime-lock-help":"Il tap sul microfono avvia o ferma la voce senza focalizzare il composer.","keybar-enter-show":"Mostra Enter verticale nel tastierino","keybar-enter-show-help":"Enter resta a destra di PgUp/PgDn ed è alto quanto entrambe le righe.","keybar-layout":"Layout tastierino","keybar-layout-full":"Esteso (predefinito)","keybar-layout-compact":"Compatto","keybar-layout-help":"Compatto: una riga con expand ⊞ per accedere al set completo senza cambiare la preferenza.","input-settings-reset":"ripristina predefiniti input","diagnostics-local":"Questo nodo","diagnostics-target":"Nodo da diagnosticare","diagnostics-verbose":"Log verbosi temporanei","diagnostics-duration":"Durata verbose","diagnostics-expires":"Verbose attivo fino alle {time}","diagnostics-off":"Verbose spento; warning ed errori operativi restano disponibili.","diagnostics-level":"Livello","diagnostics-all-levels":"tutti i livelli","diagnostics-component":"componente","diagnostics-pause":"pausa","diagnostics-autoscroll":"scorrimento automatico","diagnostics-log":"Log diagnostico sanitizzato","diagnostics-empty":"Nessun evento diagnostico.","diagnostics-export":"esporta JSON","diagnostics-export-failed":"Esportazione non disponibile in questo browser.","diagnostics-clear":"svuota","diagnostics-clear-confirm":"Svuotare il buffer diagnostico di questo nodo?","diagnostics-unsupported":"Questo peer è offline o non supporta la diagnostica strutturata.","fleet-editor-loading":"Caricamento dell'editor Fleet…","fleet-editor-load-error":"Impossibile caricare l'editor Fleet.","fleet-editor-unavailable":"Editor Fleet non disponibile in questa posizione.","fleet-managed":"gestito da NexusCrew","fleet-custom":"comando personalizzato","fleet-managed-help":"Client, provider e avvio sono gestiti internamente; i segreti non vengono mostrati.","fleet-shell-engine-help":"Shell locale risolta sul dispositivo al momento dell’avvio; nessun percorso viene salvato nel backup.","fleet-shell-command-placeholder":"comando opzionale, es. npm test","fleet-shell-command-help":"Esecuzione tramite shell login interattiva (-lic), con PATH e alias utente. La cella si ferma quando il comando termina; gli errori immediati vengono segnalati.","fleet-shell-command-metachar":"Pipe, redirect, variabili e altri metacaratteri vengono interpretati dalla shell del dispositivo.","fleet-shell-interactive":"Vuoto: apre una shell interattiva locale e mantiene la cella attiva.","fleet-shell-launch-help":"Il comando Shell si configura nella cella da Impostazioni → Flotta.","fleet-credential-title":"API key su questo dispositivo","fleet-credential-help":"La key resta solo sul nodo selezionato, non viene mostrata, esportata o condivisa con la rete.","fleet-credential-set":"imposta key","fleet-credential-change":"cambia key","fleet-credential-forget":"dimentica","fleet-credential-saved":"Key salvata localmente.","fleet-credential-removed":"Key locale rimossa.","fleet-credential-remove-confirm":"Rimuovere la key locale {key}?","fleet-credential-source-environment":"ambiente","fleet-credential-source-local":"store locale","fleet-credential-source-compatibility":"config compatibile","fleet-credential-source-missing":"mancante","fleet-credential-source-policy":"origine credenziale","fleet-credential-source-policy-auto":"auto (precedenza legacy)","fleet-credential-source-policy-nexuscrew-store":"solo store NexusCrew","fleet-credential-source-policy-environment":"solo ambiente","fleet-key-section":"KEY","fleet-key-variable":"Variabile","fleet-key-value":"Valore per {key}","fleet-key-used-by":"Usata da: {engines}","fleet-key-used-by-none":"Non ancora usata da engine configurati su questo nodo.","fleet-key-shared-impact":"Sostituire o rimuovere {key} interessa tutti gli engine elencati: {engines}.","fleet-key-enter":"inserisci la key","fleet-key-blank-keeps":"vuoto = mantieni la fonte attuale","fleet-key-reveal":"mostra","fleet-key-hide":"nascondi","fleet-key-local-help":"Il valore resta write-only sul nodo selezionato e non entra in engine, backup o federazione.","fleet-key-create-missing":"Crea esplicitamente l’engine senza key (resterà “key richiesta”).","fleet-key-partial-create":"Engine creato; la key non è stata salvata. Puoi riprovare senza creare duplicati.","fleet-key-partial-edit":"Engine aggiornato; la key non è stata salvata. Le modifiche all’engine restano applicate.","fleet-provider-notice-claude-openrouter":"Claude Code è ottimizzato per modelli Anthropic: altri provider potrebbero non funzionare correttamente. Fast mode richiede il provider Anthropic first-party.","fleet-provider-notice-codex-openrouter":"OpenRouter Responses è beta e stateless; Codex-VL non usa fallback Chat Completions.","fleet-provider-notice-claude-kimi-code":"Kimi Code usa una configurazione Claude isolata con onboarding e fast mode dedicati; la configurazione Claude nativa non viene modificata.","fleet-provider-notice-alibaba-token-plan":"Token Plan Personal usa solo ALIBABA_CODE_API_KEY dal credential layer locale; qwen3.8-max-preview è il modello predefinito e non viene usato alcun fallback OpenAI/PAYG.","fleet-provider-notice-kimi-native":'Kimi Code CLI nativo usa il login del CLI (device-code) e la propria configurazione: NexusCrew non legge né copia credenziali. Distinto dal provider "Kimi Code" di Claude Code, che resta il percorso K3 gestito.',"fleet-model-default":"modello predefinito (opzionale)","fleet-model-required":"modello (obbligatorio)","fleet-standard-permissions":"permessi standard","fleet-unsafe-permissions":"non sicuro · ignora approvazioni/sandbox","fleet-unsafe-warning":"Modalità non sicura esplicita: il worker può agire senza le normali approvazioni o protezioni sandbox.","fleet-provider-display":"nome visualizzato del provider","fleet-custom-provider-default":"Provider personalizzato","fleet-api-key-env":"NOME_VARIABILE_API_KEY","fleet-provider-id":"id-provider","fleet-custom-secret-help":"NexusCrew salva solo il nome della variabile d’ambiente, mai il suo valore.","fleet-model-override":"modello alternativo","fleet-ready":"pronto","fleet-not-ready":"non configurato","fleet-engines":"Engine","fleet-cells":"Celle / sessioni cloud","fleet-backup":"backup / ripristino","fleet-backup-help":"Esporta o ripristina selettivamente engine, celle e system prompt. Token, API key e segreti provider non entrano mai nel file.","fleet-backup-export":"esporta","fleet-backup-import":"importa","fleet-backup-download":"scarica backup","fleet-backup-restore":"ripristina selezionate","fleet-backup-import-help":"Scegli un backup JSON, controlla le celle e seleziona l’engine di destinazione prima del ripristino.","fleet-backup-overwrite":"sovrascrive la cella esistente","fleet-backup-new":"nuova cella","fleet-backup-engine-missing":"scegli un engine disponibile","fleet-backup-restore-unavailable":"Il nodo selezionato supporta solo l’esportazione; aggiornalo per ripristinare backup.","fleet-backup-restored":"{n} celle ripristinate","fleet-backup-confirm-overwrite":"Sovrascrivere queste celle? {cells}","fleet-backup-needs-restart":"riavvio necessario: {cells}","fleet-backup-empty":"nessuna cella da esportare","fleet-backup-select-one":"seleziona almeno una cella","fleet-backup-too-large":"backup troppo grande (massimo 1 MB)","fleet-backup-invalid-json":"il file non contiene JSON valido","fleet-backup-invalid-format":"formato o versione del backup non supportati","fleet-backup-invalid-cell":"il backup contiene una cella non valida","fleet-backup-duplicate-cell":"il backup contiene ID cella duplicati","fleet-backup-invalid-engine":"il backup contiene un engine non valido","fleet-backup-duplicate-engine":"il backup contiene ID engine duplicati","fleet-backup-confirm-engine-overwrite":"Sovrascrivere questi engine? I valori ambiente già configurati sul target restano invariati. {engines}","fleet-backup-env-names":"nomi ambiente","fleet-backup-env-values-required":"i valori ambiente vanno configurati sul dispositivo","fleet-system-prompt":"system prompt",characters:"caratteri","select-all":"seleziona tutte","select-none":"nessuna",edit:"modifica",save:"salva",label:"etichetta","command-path":"path assoluto del comando","args-lines":"argomenti, uno per riga","env-write-only":"I valori env sono write-only: vuoto mantiene il valore esistente.","fleet-new-engine":"Nuovo engine","fleet-new-cell":"Nuova cella","fleet-saved":"Definizione salvata.","fleet-restart-confirm":"Modifica salvata. Riavviare ora: {cells}?","fleet-remove-engine":'Eliminare l’engine "{id}"?',"fleet-remove-cell":'Eliminare la cella "{id}"? Se è attiva verrà prima fermata.',"fleet-cwd-needs-repair":"cartella da riparare","fleet-cwd-repair":"ripara","fleet-cwd-repair-title":"Ripara cartella cella {id}","fleet-cwd-repair-help":"La cartella attuale non è portabile su questo dispositivo: appartiene a un altro dispositivo o non esiste sotto la home. Scegli una cartella home-relative (~) sul dispositivo target; il backend ricalcolerà il percorso assoluto.","fleet-cwd-repair-no-source-path":"Il percorso originale non viene mostrato: è specifico del dispositivo di origine.","fleet-cwd-repair-placeholder":"es. Dev","fleet-cwd-repair-preview":"Nuova cartella: {path}","fleet-cwd-repair-browse":"sfoglia sotto ~","fleet-cwd-repair-fs-empty":"nessuna sottocartella","fleet-cwd-repair-use-current":"usa questa cartella","fleet-cwd-repair-invalid":'percorso non valido: niente assoluto, "..", barra rovesciata o lettera disco',"fleet-cwd-repair-confirm":"Impostare la cartella della cella {id} su {path}? Verrà ricalcolata sul dispositivo target.","fleet-cwd-repair-unportable":"Il percorso scelto non è portabile su questo dispositivo: deve esistere sotto la home.","fleet-cwd-repair-suggestion":"Suggerimento dal dispositivo:","fleet-cwd-repair-use-suggestion":"usa {path}","fleet-cwd-repaired":"Cartella della cella riparata.","fleet-recovery-kimi-code-consent-yes":"Kimi Code: conferma la custom API key (Yes) nel terminale della cella, poi riavvia la cella.","fleet-recovery-kimi-code-config-custom-api-key":'Kimi Code: nel terminale della cella apri /config e abilita "Use custom API key", poi riavvia la cella. Se la chiave è cambiata, aggiorna la credenziale e riprova.',"fleet-recovery-kimi-cli-login":"Kimi Code CLI: nel terminale della cella esegui /login (device-code Kimi) oppure /provider, poi riavvia la cella.","fleet-recovery-client-terminal-dialog":"Completa il dialogo mostrato nel terminale della cella, poi riavvia la cella.","settings-readonly":"READONLY attivo: le modifiche sono bloccate dal server (NEXUSCREW_READONLY=1)","role-client":"client (hub)","role-client-desc":"questa macchina guarda altri nodi via tunnel SSH","role-node":"nodo (raggiungibile)","published-port":"porta pubblicata (opzionale)","no-nodes":"nessun nodo remoto configurato","node-add":"collega installazione NexusCrew","node-connect-help":"La porta SSH serve a raggiungere il server SSH. La porta NexusCrew è invece la porta locale mostrata da `nexuscrew status` sul nodo remoto.","node-name-label":"Nome del nodo","node-ssh-label":"Host SSH","pair-ssh-local-label":"Host o alias SSH su questo dispositivo","node-ssh-local-help":"Puoi sostituire l’indirizzo del link con lo stesso alias che funziona usando ssh su questo dispositivo. Alias, agent e chiavi restano locali e non viaggiano nel link.","node-ssh-port-label":"Porta SSH","node-ssh-port-help":"Di solito 22; usa la porta pubblica del server SSH.","node-app-port-label":"Porta NexusCrew sul nodo","node-app-port-help":"È la porta mostrata da `nexuscrew status` sul nodo remoto.","node-name-ph":"nome (a-z 0-9 -)","node-ssh-ph":"ssh (user@host)","node-port-ph":"porta remota (opz.)","node-remove-confirm":'Rimuovere il nodo "{name}"?',"node-remove-warning":"Elimina associazione, credenziali e tunnel locale. Non spegne il dispositivo remoto.","peer-inventory-title":"Nodi collegati al hub","peer-group-hubs":"Hub diretti","peer-group-clients":"Client collegati","peer-group-routed":"Nodi raggiungibili tramite la rete","peer-group-vl":"Nodi VL","vl-owners-unavailable":"Owner VL non raggiunti","peer-routed":"instradato","peer-routed-stale":"instradato, non raggiungibile","peer-visibility":"Visibilità nella rete","node-test":"test","tunnel-start":"avvia tunnel","tunnel-stop":"ferma tunnel","tunnel-restart":"riavvia tunnel","share-node":"Condividi questo nodo","share-local-heading":"Condivisione di questo dispositivo","share-local-hub":"Hub di condivisione","share-local-through":"Condividi {device} tramite {hub}","share-local-active":"Condiviso e raggiungibile dalla rete collegata all’hub.","share-local-pending":"Condivisione richiesta, ma il tunnel è giù: questo dispositivo non è ancora raggiungibile.","share-local-private":"Privato: solo questo dispositivo può usare il collegamento all’hub.","share-local-private-down":"Privato, ma il collegamento all’hub è giù. Riconnetti per applicare e verificare la modalità privata.","share-local-reconnect":"Riconnetti e riconcilia","share-off-hub-reconcile-pending":"Stato privato salvato; la revoca sull’hub è ancora in attesa.","fleet-cell-label":"nome leggibile (facoltativo)","share-off-local-reconcile-pending":"Revoca confermata dall’hub; il tunnel locale deve ancora riconciliarsi.","share-reverse-pool-pending":"Il canale reverse non risulta spento in modo dimostrabile: resta in quarantena, non chiuso.","share-node-off-desc":"Privato: resta collegato al nodo hub, ma gli altri client non possono raggiungerlo.","share-node-on-desc":"Condiviso: il nodo hub può mostrarlo e smistare celle e deck autorizzati.","peer-shared":"Nodo client condiviso nella rete Hydra","peer-private":"Nodo client privato: collegato, non pubblicato nella rete Hydra","peer-vl-federated":"Nodo VL: federato","row-vl-federated":"federato","node-connected-client":"client collegato","transport-used":"in uso","tunnel-up":"tunnel su","tunnel-down":"tunnel giù","vl-poll-online":"online (poll)","vl-poll-offline":"non risponde","authorized-keys-hint":"incolla questa riga in ~/.ssh/authorized_keys sull'host remoto:",copy:"copia",copied:"copiato","token-rotate":"ruota token","token-rotate-explain":"Il nuovo token NON verrà mostrato: recuperalo con `nexuscrew show token`. La sessione corrente verrà invalidata.","service-regenerate":"rigenera service","npm-auto-update":"aggiornamenti automatici da npm","npm-auto-update-help":"Controlla periodicamente latest e installa solo versioni più recenti. Mai downgrade.","npm-update-current":"installata","npm-update-latest":"npm latest","npm-update-check":"controlla ora","npm-update-install":"aggiorna ora","npm-update-restarting":"Aggiornamento avviato; NexusCrew si riaprirà dopo il riavvio del servizio.","npm-update-idle":"aggiornato","npm-update-checking":"controllo in corso","npm-update-available":"aggiornamento disponibile","npm-update-installing":"installazione in corso","npm-update-installed":"installato, riavvio in corso","npm-update-error":"controllo fallito","npm-update-unsupported":"disponibile solo con installazione npm globale","service-installed":"service installato","service-missing":"service non installato","service-active":"attivo","service-inactive":"non attivo",confirm:"conferma",add:"aggiungi",enable:"attiva","wizard-title":"benvenuto in NexusCrew","wizard-skip":"configura dopo dai settings","wizard-step-roles":"ruoli di questa installazione","wizard-step-node":"primo nodo remoto (opzionale)","wizard-done":"tutto pronto","wizard-done-desc":"setup completato — puoi cambiare tutto dai settings",next:"continua",back:"indietro",skip:"salta",finish:"fine","err-node-name":"nome non valido (a-z, 0-9, -, max 32)","err-local-name":"nome locale non valido: usa uno slug univoco, non “localhost”","err-ssh":"ssh non valido (atteso user@host o alias)","err-port":"porta non valida (1–65535)","err-ssh-port":"porta SSH non valida (1–65535)","err-node-port":"porta NexusCrew non valida (1–65535)","node-sessions":"{n} sessioni","tunnel-down-since":"tunnel giù da {t}","node-unreachable":"nodo non raggiungibile","node-passive":"client offline · stato normale","node-offline":"nodo offline","node-offline-seen":"offline · visto {t} fa","node-needs-repair":"legacy · ripeti il pairing","asks-title":"domande dalle celle","ask-dismiss":"Scarta la domanda","ask-reply-ph":"scrivi la risposta…","push-enable":"attiva notifiche push","push-disable":"disattiva notifiche push","push-on":"push attive su questo device","push-off":"push non attive","push-denied":"permesso notifiche negato dal browser","push-unsupported":"push non supportate in questo browser","notification-speech-enable":"leggi le notifiche ad alta voce","notification-speech-help":"Usa la voce del browser solo per nuove notifiche mentre questa PWA è visibile e in primo piano. Con l’app chiusa resta la notifica di sistema.","notification-speech-test":"prova voce","notification-speech-testing":"prova in corso…","notification-speech-preview":"NexusCrew. Notifiche vocali attive.","notification-speech-preview-ok":"Prova vocale completata.","notification-speech-preview-failed":"Il browser non ha avviato la prova vocale. Interagisci con la pagina e riprova.","notification-speech-needs-test":"Per questa sessione dell’app, premi “prova voce” prima di ricevere annunci vocali.","notification-speech-unsupported":"Sintesi vocale non supportata in questo browser.","audio-title":"Audio nativo del nodo","audio-help":"Consenso e controlli valgono solo per questo dispositivo. Share e visibilità non autorizzano suoni.","audio-consent":"consenti TTS su questo nodo","audio-consent-help":"Permette a celle autorizzate, locali o remote, di consegnare un comando vocale. Puoi revocarlo in ogni momento.","audio-capability":"Capability locale","audio-loading":"leggo lo stato audio locale…","audio-adapter":"adapter","audio-adapter-none":"nessuno","audio-installed":"installato","audio-installed-yes":"sì","audio-installed-no":"no","audio-liveness":"disponibilità","audio-liveness-ready":"pronto ad accettare","audio-liveness-unavailable":"non disponibile","audio-languages":"lingue dichiarate","audio-limits":"limiti","audio-test":"prova audio locale","audio-testing":"prova in corso…","audio-stop":"ferma audio locale","audio-stopping":"stop in corso…","audio-test-needs-consent":"Attiva il consenso locale prima di provare la voce.","audio-unavailable":"Nessun adapter TTS nativo disponibile su questo nodo.","audio-test-accepted":"Il nodo ha accettato la prova. Non dimostra che qualcuno l’abbia udita.","audio-test-refused":"Il nodo ha rifiutato la prova.","audio-test-unknown":"Esito della prova sconosciuto: il nodo non può confermare l’avvio.","audio-stop-stopped":"Audio locale fermato.","audio-stop-idle":"Nessun enunciato locale da fermare.","audio-groups-title":"Gruppi audio condivisi","audio-groups-help":"Decide su quali dispositivi si sente la voce quando una cella parla. Il gruppo è una preferenza locale di consegna, non un consenso. Ogni nodo conserva consenso, ACL, disponibilità e Stop locale.","audio-groups-empty":"Nessun gruppo: la voce esce solo su questo nodo.","audio-group-name":"nome gruppo","audio-group-mode":"modalità consegna","audio-group-primary":"primo disponibile (in ordine)","audio-group-fanout":"tutti i nodi elencati","audio-group-targets":"nodi target esatti","audio-group-local":"questo nodo","audio-group-unavailable-target":"non rilevato ora","audio-group-no-targets":"Nessun nodo con instanceId disponibile. Il gruppo non può usare nomi, wildcard o “tutti”.","audio-group-new":"nuovo gruppo","audio-group-edit":"modifica","audio-group-delete":"elimina","audio-group-save":"salva gruppo","audio-group-cancel":"annulla","audio-group-invalid":"Il gruppo richiede un nome valido e almeno un nodeId esatto.","audio-group-save-failed":"Salvataggio gruppo audio non riuscito.","node-display-label":"Nome (etichetta)","routed-node-aliases":"Alias nodi instradati","routed-node-aliases-help":"Visibili solo su questo dispositivo; route e nome remoto non cambiano.","node-local-alias":"Alias su questo dispositivo","alias-on-device":"Alias su questo dispositivo","reset-alias":"Ripristina nome remoto","node-slug-hint":"routing su slug: {slug}","device-name-label":"Nome dispositivo","device-name-hint":"come ti vedono i peer (modificabile)","local-route-name-label":"Nome locale / route","local-route-name-hint":"handle tecnico stabile: label leggibile + suffisso del nodeId; modificabile prima della connessione","err-label":"etichetta non valida (max 64 char, niente a capo)","fleet-inventory":"Celle e sessioni","fleet-inventory-help":"tutte le posizioni (Locale + route Hydra)","fleet-manage-location":"Gestisci posizione","fleet-network-overview":"Panoramica rete","fleet-manage-help":"crea e configura celle nella posizione selezionata","fleet-overview-help":"stato operativo di tutte le posizioni, senza duplicare l’editor","fleet-inventory-empty":"nessuna cella o sessione","cell-switcher-refreshing":"aggiorno le celle…","cell-switcher-empty-active":"nessuna cella attiva verificata","cell-switcher-not-confirmed":"stato non confermato","cell-switcher-not-active":"questa cella non è più attiva","cell-switcher-select":"seleziona una cella","cell-switcher-open":"apri cella","cell-switcher-show-all":"tutte","cell-switcher-show-active":"attive","cell-switcher-close":"chiudi selettore celle","fleet-not-available":"fleet non disponibile su questa posizione",start:"avvia",stop:"ferma",restart:"riavvia",delete:"elimina","copy-manual":"copia non riuscita — seleziona e Cmd+C, o copia a mano","copy-empty":"niente selezione: trascina con Shift per selezionare","selection-held":"evidenziazione persa, testo ancora in mano","invite-hub-only":"Un invito si conia sull’hub. Ammettere un nodo nuovo è la sola cosa che un nodo collegato non può chiedere per conto di un altro: apri NexusCrew sull’hub e crea l’invito da lì.","row-private":"privato","node-detail-open":"apri il dettaglio","node-detail-reach":"Raggiungibilità","node-detail-route":"percorso","node-detail-ssh":"SSH","node-detail-transport":"trasporto","node-detail-owner":"owner","node-detail-authority":"Cosa può fare questo nodo","authority-owner-equivalent":"Autorità pari alla tua: un nodo accoppiato può fare su questa macchina tutto quello che puoi fare tu.","authority-routed":"Non è accoppiato con questa macchina: la sua autorità vive presso l’hub che lo instrada.","authority-no-grants":"L’unico potere per-nodo che esiste è la scelta delle celle, qui sotto. Dentro quelle celle l’autorità resta piena.","authority-no-grants-elsewhere":"L’unico potere per-nodo che esiste è la scelta delle celle, e si imposta sull’installazione che le possiede — non da qui.","node-detail-network-view":"Cosa vede di questa rete","node-detail-command":"Comando","vl-no-commands":"Il device non dichiara comandi disponibili.","vl-events-title":"Sessione","vl-events-empty":"Nessun evento in memoria: la sessione non ha ancora parlato, oppure quello che ha detto è uscito dal buffer. La storia resta sul device.","vl-events-gap":"eventi non ricevuti:","vl-events-truncated":"contenuto troncato dal device","vl-events-turn-end":"— fine turno —","vl-events-done":"— fine risposta —","vl-events-writer-epoch":"— cambio scrittore —","vl-events-tool":"strumento","vl-events-tool-ok":"concluso","vl-events-tool-failed":"fallito","vl-events-usage":"consumo aggiornato","vl-events-stale":"Aggiornamento non riuscito: quello che vedi potrebbe non essere l’ultimo.","vl-cmd-phase-submitted":"inviato, in attesa di conferma","vl-cmd-phase-inflight":"in corso","vl-cmd-phase-done-ok":"completato","vl-cmd-phase-done-error":"fallito","vl-cmd-status":"stato","vl-cmd-health":"salute","vl-cmd-start":"avvia","vl-cmd-stop":"ferma","vl-cmd-restart":"riavvia","vl-cmd-version":"versione","vl-cmd-capabilities":"capacità","vl-cmd-logs":"log","vl-cmd-prompt":"prompt","vl-prompt-placeholder":"scrivi il prompt per la sessione del device…","vl-prompt-send":"invia prompt","vl-cmd-unpair":"disaccoppia","node-grant-none":"Nessun nodo scelto: condiviso, ma verso nessuno.","node-grant-unknown":"non più in inventario","node-grant-remove":"togli","node-grant-add":"Aggiungi un nodo","node-grant-search":"Cerca fra i nodi","node-grant-no-candidates":"Nessun nodo corrisponde.","cell-scope":"Celle visibili a questo nodo","cell-scope-help":"Vale su cio’ che questo nodo elenca e su cio’ che può toccare, terminale compreso. Dentro le celle concesse resta un nodo accoppiato a pieno titolo: non è una sandbox.","cell-scope-all":"tutte le celle","cell-scope-none":"nessuna cella","cell-scope-selected":"celle selezionate","cell-scope-none-granted":"Nessuna cella scelta: questo nodo non ne vede nessuna.","cell-scope-unknown":"cella non più esistente","cell-scope-add":"Aggiungi una cella","cell-scope-search":"Cerca fra le celle","cell-scope-no-candidates":"Nessuna cella corrisponde.","cell-scope-reset-warning":"Cambiando modo l’elenco viene azzerato: tornando a «celle selezionate» andrà rifatto.","cell-scope-list-unavailable":"Elenco delle celle non disponibile ora: le concessioni qui sotto restano valide, ma non si può dire se esistono ancora.","single-view":"vista singola",retract:"riduci","keybar-expand":"espandi la barra tasti","keybar-retract":"riduci la barra tasti","save-and-start":"salva e avvia",permissions:"Permessi","power-on-hint":"Spegni la cella; puoi anche toglierla dal boot.","launch-engine-help":"Provider, credenziali e nuovi engine si creano in Impostazioni → Flotta. Modello e permessi sono per questa cella.","launch-unavailable-hint":"Configurazione engine non disponibile su questo nodo.","import-as-cell":"Importa come cella","import-help":"Riconcilia una sessione tmux esistente in una cella gestita. Scegli un engine già dichiarato: nessun engine viene inventato.","import-engine-required":"scegli un engine (obbligatorio)","test-and-connect":"testa e collega","pairing-v2-hint":"Incolla o scansiona UN solo link: precompila nome, Host SSH ed etichetta quando il link li include (v2).","invite-v2-hint":"Crea un invito monouso. Serve l’indirizzo SSH di questo dispositivo, raggiungibile da chi lo userà.","invite-target-local":"Il nuovo dispositivo entrerà in","invite-target-this":"questo dispositivo","invite-endpoint-label":"Indirizzo SSH di questo hub visto dagli altri dispositivi","invite-endpoint-auto":"Endpoint già configurato","invite-endpoint-needed":"Inserisci user@host o un alias SSH condiviso. Non è 127.0.0.1 e non è l’URL HTTP NexusCrew.","invite-ssh-hint":"Il target SSH con cui L’ALTRO dispositivo raggiunge QUESTA installazione (user@host o alias). Obbligatorio: viene incluso nel link.","invite-next-steps":"copia questo link, apri NexusCrew sull’altro dispositivo e incollalo in Impostazioni → Nodi (o scansiona il QR): al resto pensa NexusCrew","pair-card-title":"collega con un solo link","pair-card-help":"Incolla il link di pairing generato sull’altro dispositivo (o scansiona il suo QR): NexusCrew decodifica, prova la connessione SSH e collega da solo.","pair-paste-ph":"incolla qui il link di pairing","pair-paste-btn":"incolla","pair-advanced":"avanzate / modifica","pair-progress":"collegamento in corso: SSH → invito → conferma → verifica…","pair-retry":"riprova","pair-invalid-link":"questo non è un link di pairing valido","pair-invalid-hint":"serve il link completo (http://…#pair=…) generato dall’altro NexusCrew: non aprirlo, incollalo qui","pair-missing-ssh":"il link non include il target SSH (formato v1): indica in “avanzate” come questo dispositivo raggiunge l’altro via SSH — non viene mai inventato","pair-missing-name":"manca il nome del nodo: completalo in “avanzate”","pair-clipboard-denied":"lettura degli appunti non consentita: incolla manualmente nel campo","pair-clipboard-empty":"appunti vuoti: copia prima il link di pairing","pair-stage-validation":"dati non validi","pair-stage-conflict":"nome già in uso","pair-stage-ssh-start":"avvio del tunnel SSH fallito","pair-stage-ssh-ready":"peer non raggiungibile via SSH","pair-stage-join":"scambio dell’invito fallito","pair-stage-tunnel-final":"tunnel negoziato fallito","pair-stage-confirm":"conferma del pairing fallita","pair-stage-health":"verifica finale della federazione fallita","pair-stage-internal":"errore interno","pair-stage-generic":"connessione fallita","qr-no-camera":"nessuna camera disponibile su questo dispositivo: usa una foto del QR","qr-permission":"permesso camera negato: consentilo nel browser o usa una foto del QR","qr-unsupported":"scanner live non supportato qui: carica una foto del QR","qr-upload":"usa una foto"},en:{"update-available":"new version {v} available","install-version-mismatch":"incomplete installation: frontend and server do not match (v{v})",reload:"reload","grid-empty":"drag a session here from the sidebar, or double-click for single view","grid-full":"a deck can show at most 9 sessions",pin:"pin to top",reorder:"reorder","reorder-help":"drag the handle; keyboard up/down arrows","rename-node":"rename node","rename-node-prompt":"New node name in NexusCrew","rename-node-invalid":"Invalid name: maximum 64 characters, no line breaks.","reorder-deck-help":"drag the deck; keyboard left/right arrows",sessions:"sessions","new-session":"new session",new:"new",fleet:"Fleet","fleet-tmux":"tmux fleet","other-sessions":"Other sessions","view-all":"all","view-pinned":"pinned","view-active":"active","view-off":"off","view-technical":"technical","mark-technical":"hide as technical session","mark-normal":"show as normal session","position-local":"Local",files:"files",refresh:"refresh","filter-placeholder":"filter sessions…","loading-fleet":"loading fleet…","no-sessions":"no live tmux sessions — the fleet starts at boot (systemd)","no-match":'no session matches "{q}"',"copy-url":"click to copy URL","ssh-only":"SSH/VPN tunnel only","new-files-outbox":"new files in outbox",terminate:"terminate","terminate-confirm":'Terminate session "{name}"?',"cell-on":"tmux alive","cell-off":"off","cell-working":"working","cell-idle":"idle","cell-degraded":"degraded: unit active, tmux dead","power-on":"power on","power-off":"power off","boot-enable":"enable at boot","boot-disable":"disable at boot","state-on":"running","state-off":"stopped",engine:"Engine",model:"Model","model-default":"Provider default model","model-remembered":"Last model used with this engine","boot-persist":"start at boot","remove-boot":"also remove from boot","power-config-in-settings":"Edit engine, provider, profile, model and permissions in Settings → Fleet.","no-remote-control":"⚠ non-native engine: no claude.ai app RC (you can still drive it from here)",cancel:"cancel",name:"name","name-invalid":"invalid name: a-zA-Z0-9._- max 64, no leading '-'",cwd:"folder",browse:"browse","fs-home":"home","fs-parent":".. up",preset:"preset","preset-2x2":"2×2 grid","preset-columns":"columns","preset-equalize":"equalize",collapse:"collapse",expand:"expand",create:"create","auth-prompt":"Paste the token (printed by the server):","remember-device":"remember on this device","zoom-out":"smaller text","zoom-in":"bigger text",composer:"composer",windows:"{n} windows","empty-files":"empty",upload:"upload","no-sessions-short":"no sessions","composer-placeholder":"type or dictate…","composer-history-tools":"input history and size","composer-history":"cell history","composer-history-empty":"no submitted input","composer-history-clear":"clear this cell history","composer-expand":"expand input","composer-collapse":"collapse input","composer-clear-data":"clear drafts and history","composer-clear-data-help":"Removes every saved cell draft and input-history entry from this browser.","composer-clear-confirm":"Clear every saved draft and input-history entry from this browser?","composer-clear-done":"Drafts and history cleared.","composer-clear-failed":"Could not clear composer data in this browser.",attach:"attach","attach-file":"File","attach-camera":"Camera","attach-gallery":"Gallery","attach-uploading":"uploading…","attach-upload-progress":"attachment {n}/{total}…","attach-uploaded":"{n} attachments uploaded",voice:"voice",send:"send","composer-send-failed":"connection not ready — text kept, try again",close:"close","lang-label":"language",decks:"decks","new-deck":"new deck","deck-name":"deck name","open-deck-window":"open in a new window","detach-deck":"detach into a new window","deck-current":"this deck (current window)","deck-owner-unavailable":"owner node is not shared or reachable","rename-deck":"rename deck","delete-deck":"delete deck","delete-deck-confirm":'Delete deck "{name}"?',"send-to-deck":"send to deck…","deck-autosave":"autosave",saving:"saving…",saved:"saved","popup-blocked":"popup blocked: open here","expand-owner":"expand {owner} decks","collapse-owner":"collapse {owner} decks","owner-deck-count-one":"{count} deck","owner-deck-count-many":"{count} decks","dot-working":"in use (active window)","dot-on":"open in background","dot-neutral":"not open","dot-warn":"owner offline","select-drag":"drag to select","copy-manual":"select and copy manually","toggle-sidebar":"show/hide the sidebar",settings:"settings","tab-roles":"roles","tab-nodes":"nodes",local:"Local",location:"Location","pairing-link":"pairing link","pairing-required":"name, SSH alias and pairing link are required","pairing-connect-help":"Connecting a node requires a name, a working SSH Host, and a link/QR created by the other NexusCrew installation.","pairing-localhost-hint":"127.0.0.1 in the link is correct: do not open it here. NexusCrew carries the invite and port through the SSH Host.","scan-qr":"scan QR","pairing-qr-invalid":"invalid pairing QR","invite-node":"invite a node","create-pairing-link":"create link / QR","visibility-network":"whole network","visibility-relay":"relay only","visibility-selected":"selected nodes","hydra-simple":"local + nodes, one network","local-ready":"This device is ready. Use it alone or connect it to a node.","local-only":"local only","add-node":"add node",connect:"connect","node-connected":"Node connected. The network will synchronize automatically.","tab-system":"system","tab-fleet":"fleet","tab-audio":"audio","system-general":"general","system-diagnostics":"diagnostics","system-this-node":"this node","system-updates":"updates","system-security":"security","system-local-data":"local browser data","system-terminal":"terminal","alternate-screen":"alternate screen","alternate-screen-help":"Keeps standard tmux behaviour for new NexusCrew sessions. An application that tracks the mouse scrolls on its own; the others browse the tmux scrollback. It does not change cells already running.","tab-input":"input","tab-diagnostics":"diagnostics","input-settings-local":"Local preferences for this browser. They apply immediately to single view and decks without changing the remote node.","terminal-keyboard-gesture":"Open the virtual keyboard from the terminal","terminal-keyboard-double-tap":"Double tap (default)","terminal-keyboard-single-tap":"Single tap","terminal-keyboard-never":"Never from terminal","terminal-keyboard-gesture-help":"The keypad and STT use the separate controls below. Mouse and physical keyboard remain available.","keybar-ime-lock":"Keypad: keep the virtual keyboard closed","keybar-ime-lock-help":"ESC, arrows, PgUp/PgDn, Enter and menu send directly to the PTY without focusing a text field.","voice-ime-lock":"STT microphone: keep the virtual keyboard closed","voice-ime-lock-help":"Tapping the microphone starts or stops voice without focusing the composer.","keybar-enter-show":"Show the tall Enter keypad key","keybar-enter-show-help":"Enter stays to the right of PgUp/PgDn and spans both rows.","keybar-layout":"Keypad layout","keybar-layout-full":"Full (default)","keybar-layout-compact":"Compact","keybar-layout-help":"Compact: one row with an expand toggle that reaches the full key set without changing the preference.","input-settings-reset":"restore input defaults","diagnostics-local":"This node","diagnostics-target":"Node to diagnose","diagnostics-verbose":"Temporary verbose logs","diagnostics-duration":"Verbose duration","diagnostics-expires":"Verbose enabled until {time}","diagnostics-off":"Verbose is off; operational warnings and errors remain available.","diagnostics-level":"Level","diagnostics-all-levels":"all levels","diagnostics-component":"component","diagnostics-pause":"pause","diagnostics-autoscroll":"autoscroll","diagnostics-log":"Sanitized diagnostic log","diagnostics-empty":"No diagnostic events.","diagnostics-export":"export JSON","diagnostics-export-failed":"Export is not available in this browser.","diagnostics-clear":"clear","diagnostics-clear-confirm":"Clear this node diagnostic buffer?","diagnostics-unsupported":"This peer is offline or does not support structured diagnostics.","fleet-editor-loading":"Loading the Fleet editor…","fleet-editor-load-error":"Unable to load the Fleet editor.","fleet-editor-unavailable":"The Fleet editor is unavailable at this location.","fleet-managed":"managed by NexusCrew","fleet-custom":"custom command","fleet-managed-help":"Client, provider and launch are managed internally; secrets are never displayed.","fleet-shell-engine-help":"The local shell is resolved on the device at launch time; no executable path is stored in backups.","fleet-shell-command-placeholder":"optional command, e.g. npm test","fleet-shell-command-help":"Runs through an interactive login shell (-lic), with the user PATH and aliases. The cell stops when the command finishes; immediate failures are reported.","fleet-shell-command-metachar":"Pipes, redirects, variables, and other metacharacters are interpreted by the device shell.","fleet-shell-interactive":"Empty: opens a local interactive shell and keeps the cell active.","fleet-shell-launch-help":"Configure the Shell command on the cell in Settings → Fleet.","fleet-credential-title":"API key on this device","fleet-credential-help":"The key stays only on the selected node and is never displayed, exported or shared with the network.","fleet-credential-set":"set key","fleet-credential-change":"change key","fleet-credential-forget":"forget","fleet-credential-saved":"Key saved locally.","fleet-credential-removed":"Local key removed.","fleet-credential-remove-confirm":"Remove the local {key} key?","fleet-credential-source-environment":"environment","fleet-credential-source-local":"local store","fleet-credential-source-compatibility":"compatible config","fleet-credential-source-missing":"missing","fleet-credential-source-policy":"credential source","fleet-credential-source-policy-auto":"auto (legacy precedence)","fleet-credential-source-policy-nexuscrew-store":"NexusCrew store only","fleet-credential-source-policy-environment":"environment only","fleet-key-section":"KEY","fleet-key-variable":"Variable","fleet-key-value":"Value for {key}","fleet-key-used-by":"Used by: {engines}","fleet-key-used-by-none":"Not yet used by configured engines on this node.","fleet-key-shared-impact":"Replacing or removing {key} affects every listed engine: {engines}.","fleet-key-enter":"enter the key","fleet-key-blank-keeps":"blank = keep the current source","fleet-key-reveal":"reveal","fleet-key-hide":"hide","fleet-key-local-help":"The value stays write-only on the selected node and never enters engines, backups or federation.","fleet-key-create-missing":"Explicitly create the engine without a key (it will remain “key required”).","fleet-key-partial-create":"Engine created; the key was not saved. Retry without creating a duplicate.","fleet-key-partial-edit":"Engine updated; the key was not saved. The engine changes remain applied.","fleet-provider-notice-claude-openrouter":"Claude Code is optimized for Anthropic models; other providers may not work correctly. Fast mode requires the first-party Anthropic provider.","fleet-provider-notice-codex-openrouter":"OpenRouter Responses is beta and stateless; Codex-VL has no Chat Completions fallback.","fleet-provider-notice-claude-kimi-code":"Kimi Code uses isolated Claude configuration with dedicated onboarding and fast-mode flags; native Claude configuration is not modified.","fleet-provider-notice-alibaba-token-plan":"Token Plan Personal uses only ALIBABA_CODE_API_KEY from the local credential layer; qwen3.8-max-preview is the default and no OpenAI/PAYG fallback is used.","fleet-provider-notice-kimi-native":'Native Kimi Code CLI uses the CLI login (device code) and its own configuration: NexusCrew never reads or copies credentials. Distinct from the Claude Code "Kimi Code" provider, which remains the managed K3 path.',"fleet-model-default":"default model (optional)","fleet-model-required":"model (required)","fleet-standard-permissions":"standard permissions","fleet-unsafe-permissions":"unsafe · bypass approvals/sandbox","fleet-unsafe-warning":"Explicit unsafe mode: the worker can act without normal approval or sandbox gates.","fleet-provider-display":"provider display name","fleet-custom-provider-default":"Custom provider","fleet-api-key-env":"API_KEY_ENV_NAME","fleet-provider-id":"provider-id","fleet-custom-secret-help":"NexusCrew stores only the environment-variable name, never its value.","fleet-model-override":"model override","fleet-ready":"ready","fleet-not-ready":"not configured","fleet-engines":"Engines","fleet-cells":"Cells / cloud sessions","fleet-backup":"backup / restore","fleet-backup-help":"Selectively export or restore engines, cells, and system prompts. Tokens, API keys, and provider secrets never enter the file.","fleet-backup-export":"export","fleet-backup-import":"import","fleet-backup-download":"download backup","fleet-backup-restore":"restore selected","fleet-backup-import-help":"Choose a JSON backup, review the cells and select a destination engine before restoring.","fleet-backup-overwrite":"overwrites existing cell","fleet-backup-new":"new cell","fleet-backup-engine-missing":"choose an available engine","fleet-backup-restore-unavailable":"The selected node supports export only; update it to restore backups.","fleet-backup-restored":"{n} cells restored","fleet-backup-confirm-overwrite":"Overwrite these cells? {cells}","fleet-backup-needs-restart":"restart required: {cells}","fleet-backup-empty":"no cells to export","fleet-backup-select-one":"select at least one cell","fleet-backup-too-large":"backup is too large (1 MB maximum)","fleet-backup-invalid-json":"the file does not contain valid JSON","fleet-backup-invalid-format":"unsupported backup format or version","fleet-backup-invalid-cell":"the backup contains an invalid cell","fleet-backup-duplicate-cell":"the backup contains duplicate cell IDs","fleet-backup-invalid-engine":"the backup contains an invalid engine","fleet-backup-duplicate-engine":"the backup contains duplicate engine IDs","fleet-backup-confirm-engine-overwrite":"Overwrite these engines? Environment values already configured on the target stay unchanged. {engines}","fleet-backup-env-names":"environment names","fleet-backup-env-values-required":"environment values must be configured on this device","fleet-system-prompt":"system prompt",characters:"characters","select-all":"select all","select-none":"select none",edit:"edit",save:"save",label:"label","command-path":"absolute command path","args-lines":"arguments, one per line","env-write-only":"Environment values are write-only: blank keeps the existing value.","fleet-new-engine":"New engine","fleet-new-cell":"New cell","fleet-saved":"Definition saved.","fleet-restart-confirm":"Change saved. Restart now: {cells}?","fleet-remove-engine":'Delete engine "{id}"?',"fleet-remove-cell":'Delete cell "{id}"? If active it will be stopped first.',"fleet-cwd-needs-repair":"folder needs repair","fleet-cwd-repair":"repair","fleet-cwd-repair-title":"Repair cell folder {id}","fleet-cwd-repair-help":"The current folder is not portable on this device: it belongs to another device or does not exist under the home directory. Choose a home-relative (~) folder on the target device; the backend will recompute the absolute path.","fleet-cwd-repair-no-source-path":"The original path is not shown: it is specific to the source device.","fleet-cwd-repair-placeholder":"e.g. Dev","fleet-cwd-repair-preview":"New folder: {path}","fleet-cwd-repair-browse":"browse under ~","fleet-cwd-repair-fs-empty":"no subfolders","fleet-cwd-repair-use-current":"use this folder","fleet-cwd-repair-invalid":'invalid path: no absolute path, "..", backslash or drive letter',"fleet-cwd-repair-confirm":"Set the folder of cell {id} to {path}? It will be recomputed on the target device.","fleet-cwd-repair-unportable":"The chosen path is not portable on this device: it must exist under the home directory.","fleet-cwd-repair-suggestion":"Suggestion from device:","fleet-cwd-repair-use-suggestion":"use {path}","fleet-cwd-repaired":"Cell folder repaired.","fleet-recovery-kimi-code-consent-yes":"Kimi Code: confirm the custom API key (Yes) in the cell terminal, then restart the cell.","fleet-recovery-kimi-code-config-custom-api-key":'Kimi Code: in the cell terminal open /config and enable "Use custom API key", then restart the cell. If the key changed, update the credential and retry.',"fleet-recovery-kimi-cli-login":"Kimi Code CLI: in the cell terminal run /login (Kimi device code) or /provider, then restart the cell.","fleet-recovery-client-terminal-dialog":"Complete the dialog shown in the cell terminal, then restart the cell.","settings-readonly":"READONLY active: changes are blocked by the server (NEXUSCREW_READONLY=1)","role-client":"client (hub)","role-client-desc":"this machine watches other nodes via SSH tunnels","role-node":"node (reachable)","published-port":"published port (optional)","no-nodes":"no remote nodes configured","node-add":"connect a NexusCrew installation","node-connect-help":"The SSH port reaches the SSH server. The NexusCrew port is the local port reported by `nexuscrew status` on the remote node.","node-name-label":"Node name","node-ssh-label":"SSH host","pair-ssh-local-label":"SSH host or alias on this device","node-ssh-local-help":"You may replace the link address with the same alias that works with ssh on this device. Aliases, agents and private keys stay local and are never carried in the link.","node-ssh-port-label":"SSH port","node-ssh-port-help":"Usually 22; use the SSH server public port.","node-app-port-label":"NexusCrew port on node","node-app-port-help":"The port reported by `nexuscrew status` on the remote node.","node-name-ph":"name (a-z 0-9 -)","node-ssh-ph":"ssh (user@host)","node-port-ph":"remote port (opt.)","node-remove-confirm":'Remove node "{name}"?',"node-remove-warning":"Deletes the pairing, credentials and local tunnel. It does not power off the remote device.","peer-inventory-title":"Nodes connected to the hub","peer-group-hubs":"Direct hubs","peer-group-clients":"Connected clients","peer-group-routed":"Nodes reachable through the network","peer-group-vl":"VL nodes","vl-owners-unavailable":"VL owners unreachable","peer-routed":"routed","peer-routed-stale":"routed, unreachable","peer-visibility":"Network visibility","node-test":"test","tunnel-start":"start tunnel","tunnel-stop":"stop tunnel","tunnel-restart":"restart tunnel","share-node":"Share this node","share-local-heading":"Share this device","share-local-hub":"Sharing hub","share-local-through":"Share {device} through {hub}","share-local-active":"Shared and reachable by the network connected to the hub.","share-local-pending":"Sharing is requested, but the tunnel is down: this device is not reachable yet.","share-local-private":"Private: only this device can use its hub connection.","share-local-private-down":"Private, but the hub connection is down. Reconnect to apply and verify private mode.","share-local-reconnect":"Reconnect and reconcile","share-off-hub-reconcile-pending":"Private state saved; hub revocation is still pending.","fleet-cell-label":"readable name (optional)","share-off-local-reconcile-pending":"Hub revocation confirmed; the local tunnel still needs reconciliation.","share-reverse-pool-pending":"The reverse channel was not demonstrably shut down: it is quarantined, not closed.","share-node-off-desc":"Private: it stays connected to the hub, but other clients cannot reach it.","share-node-on-desc":"Shared: the hub may advertise it and route authorized cells and decks.","peer-shared":"Client node shared on the Hydra network","peer-private":"Private client node: connected, not published on Hydra","peer-vl-federated":"VL node: federated","row-vl-federated":"federated","node-connected-client":"connected client","transport-used":"in use","tunnel-up":"tunnel up","tunnel-down":"tunnel down","vl-poll-online":"online (poll)","vl-poll-offline":"not responding","authorized-keys-hint":"paste this line into ~/.ssh/authorized_keys on the remote host:",copy:"copy",copied:"copied","token-rotate":"rotate token","token-rotate-explain":"The new token will NOT be shown: retrieve it with `nexuscrew show token`. The current session will be invalidated.","service-regenerate":"regenerate service","npm-auto-update":"automatic updates from npm","npm-auto-update-help":"Periodically checks latest and installs only newer versions. Never downgrades.","npm-update-current":"installed","npm-update-latest":"npm latest","npm-update-check":"check now","npm-update-install":"update now","npm-update-restarting":"Update started; NexusCrew will return after the service restarts.","npm-update-idle":"up to date","npm-update-checking":"checking","npm-update-available":"update available","npm-update-installing":"installing","npm-update-installed":"installed, restarting","npm-update-error":"check failed","npm-update-unsupported":"available only for global npm installations","service-installed":"service installed","service-missing":"service not installed","service-active":"active","service-inactive":"not active",confirm:"confirm",add:"add",enable:"enable","wizard-title":"welcome to NexusCrew","wizard-skip":"configure later from settings","wizard-step-roles":"roles of this install","wizard-step-node":"first remote node (optional)","wizard-done":"all set","wizard-done-desc":"setup complete — you can change everything from settings",next:"continue",back:"back",skip:"skip",finish:"finish","err-node-name":"invalid name (a-z, 0-9, -, max 32)","err-local-name":"invalid local name: use a unique slug, not “localhost”","err-ssh":"invalid ssh (expected user@host or alias)","err-port":"invalid port (1–65535)","err-ssh-port":"invalid SSH port (1–65535)","err-node-port":"invalid NexusCrew port (1–65535)","node-sessions":"{n} sessions","tunnel-down-since":"tunnel down for {t}","node-unreachable":"node unreachable","node-passive":"client offline · expected","node-offline":"node offline","node-offline-seen":"offline · seen {t} ago","node-needs-repair":"legacy · pair again","asks-title":"questions from the cells","ask-dismiss":"Dismiss question","ask-reply-ph":"type your answer…","push-enable":"enable push notifications","push-disable":"disable push notifications","push-on":"push active on this device","push-off":"push not active","push-denied":"notification permission denied by the browser","push-unsupported":"push not supported in this browser","notification-speech-enable":"read notifications aloud","notification-speech-help":"Uses the browser voice only for new notifications while this PWA is visible and in the foreground. When the app is closed, the system notification remains available.","notification-speech-test":"test voice","notification-speech-testing":"testing voice…","notification-speech-preview":"NexusCrew. Spoken notifications are active.","notification-speech-preview-ok":"Voice test completed.","notification-speech-preview-failed":"The browser did not start the voice test. Interact with the page and try again.","notification-speech-needs-test":"For this app session, select “test voice” before spoken alerts can play.","notification-speech-unsupported":"Speech synthesis is not supported in this browser.","audio-title":"Native node audio","audio-help":"Consent and controls apply only to this device. Share and visibility do not authorize sounds.","audio-consent":"allow TTS on this node","audio-consent-help":"Allows authorized local or remote cells to deliver a voice command. You can revoke it at any time.","audio-capability":"Local capability","audio-loading":"reading local audio state…","audio-adapter":"adapter","audio-adapter-none":"none","audio-installed":"installed","audio-installed-yes":"yes","audio-installed-no":"no","audio-liveness":"availability","audio-liveness-ready":"ready to accept","audio-liveness-unavailable":"unavailable","audio-languages":"declared languages","audio-limits":"limits","audio-test":"test local audio","audio-testing":"testing audio…","audio-stop":"stop local audio","audio-stopping":"stopping audio…","audio-test-needs-consent":"Enable local consent before testing the voice.","audio-unavailable":"No native TTS adapter is available on this node.","audio-test-accepted":"The node accepted the test. It does not prove that anyone heard it.","audio-test-refused":"The node refused the test.","audio-test-unknown":"Test outcome unknown: the node could not confirm startup.","audio-stop-stopped":"Local audio stopped.","audio-stop-idle":"No local utterance to stop.","audio-groups-title":"Shared audio groups","audio-groups-help":"Chooses which devices play the voice when a cell speaks. A group is a local delivery preference, not consent. Each node keeps its own consent, ACL, availability and local Stop.","audio-groups-empty":"No group: voice plays only on this node.","audio-group-name":"group name","audio-group-mode":"delivery mode","audio-group-primary":"first available (in order)","audio-group-fanout":"all listed nodes","audio-group-targets":"exact target nodes","audio-group-local":"this node","audio-group-unavailable-target":"not currently discovered","audio-group-no-targets":"No node with an available instanceId. A group cannot use names, wildcards, or “all”.","audio-group-new":"new group","audio-group-edit":"edit","audio-group-delete":"delete","audio-group-save":"save group","audio-group-cancel":"cancel","audio-group-invalid":"A group needs a valid name and at least one exact nodeId.","audio-group-save-failed":"Could not save audio group.","node-display-label":"Name (label)","routed-node-aliases":"Routed node aliases","routed-node-aliases-help":"Visible only on this device; the route and remote name do not change.","node-local-alias":"Alias on this device","alias-on-device":"Alias on this device","reset-alias":"Reset remote name","node-slug-hint":"routing on slug: {slug}","device-name-label":"Device name","device-name-hint":"how peers see you (editable)","local-route-name-label":"Local / route name","local-route-name-hint":"stable technical handle: readable label + nodeId suffix; editable before connecting","err-label":"invalid label (max 64 chars, no line breaks)","fleet-inventory":"Cells and sessions","fleet-inventory-help":"all positions (Local + Hydra routes)","fleet-manage-location":"Manage location","fleet-network-overview":"Network overview","fleet-manage-help":"create and configure cells at the selected location","fleet-overview-help":"operational state of every location, separate from the editor","fleet-inventory-empty":"no cells or sessions","cell-switcher-refreshing":"refreshing cells…","cell-switcher-empty-active":"no verified active cells","cell-switcher-not-confirmed":"status not confirmed","cell-switcher-not-active":"this cell is no longer active","cell-switcher-select":"select a cell","cell-switcher-open":"open cell","cell-switcher-show-all":"all","cell-switcher-show-active":"active","cell-switcher-close":"close cell switcher","fleet-not-available":"fleet not available on this position",start:"start",stop:"stop",restart:"restart",delete:"delete","copy-manual":"copy failed — select and press Cmd+C, or copy manually","copy-empty":"nothing selected: drag with Shift to select","selection-held":"highlight gone, text still held","invite-hub-only":"An invite is minted on the hub. Admitting a new node is the one thing a connected node cannot ask on another’s behalf: open NexusCrew on the hub and create the invite there.","row-private":"private","node-detail-open":"open details","node-detail-reach":"Reachability","node-detail-route":"path","node-detail-ssh":"SSH","node-detail-transport":"transport","node-detail-owner":"owner","node-detail-authority":"What this node can do","authority-owner-equivalent":"Authority equal to yours: a paired node can do on this machine everything you can do.","authority-routed":"Not paired with this machine: its authority lives on the hub that routes it.","authority-no-grants":"The only per-node power that exists is the choice of cells, below. Within those cells the authority stays full.","authority-no-grants-elsewhere":"The only per-node power that exists is the choice of cells, and it is set on the installation that owns them — not here.","node-detail-network-view":"What it sees of this network","node-detail-command":"Command","vl-no-commands":"The device declares no commands available.","vl-events-title":"Session","vl-events-empty":"No events in memory: the session has not spoken yet, or what it said has left the buffer. The history stays on the device.","vl-events-gap":"events not received:","vl-events-truncated":"content truncated by the device","vl-events-turn-end":"— end of turn —","vl-events-done":"— turn complete —","vl-events-writer-epoch":"— writer changed —","vl-events-tool":"tool","vl-events-tool-ok":"finished","vl-events-tool-failed":"failed","vl-events-usage":"usage updated","vl-events-stale":"Refresh failed: what you see may not be the latest.","vl-cmd-phase-submitted":"sent, awaiting confirmation","vl-cmd-phase-inflight":"in progress","vl-cmd-phase-done-ok":"completed","vl-cmd-phase-done-error":"failed","vl-cmd-status":"status","vl-cmd-health":"health","vl-cmd-start":"start","vl-cmd-stop":"stop","vl-cmd-restart":"restart","vl-cmd-version":"version","vl-cmd-capabilities":"capabilities","vl-cmd-logs":"logs","vl-cmd-prompt":"prompt","vl-prompt-placeholder":"write the prompt for the device session…","vl-prompt-send":"send prompt","vl-cmd-unpair":"unpair","node-grant-none":"No node chosen: shared, but towards nobody.","node-grant-unknown":"no longer in the inventory","node-grant-remove":"remove","node-grant-add":"Add a node","node-grant-search":"Search the nodes","node-grant-no-candidates":"No node matches.","cell-scope":"Cells this node can see","cell-scope-help":"Applies to what this node lists and to what it can act on, terminal included. Within the granted cells it remains a fully paired node: this is not a sandbox.","cell-scope-all":"every cell","cell-scope-none":"no cell","cell-scope-selected":"selected cells","cell-scope-none-granted":"No cell chosen: this node sees none of them.","cell-scope-unknown":"cell no longer exists","cell-scope-add":"Add a cell","cell-scope-search":"Search the cells","cell-scope-no-candidates":"No cell matches.","cell-scope-reset-warning":"Switching mode clears the list: coming back to “selected cells” means choosing them again.","cell-scope-list-unavailable":"Cell list unavailable right now: the grants below still hold, but we cannot tell whether they still exist.","single-view":"single view",retract:"retract","keybar-expand":"expand the key bar","keybar-retract":"retract the key bar","save-and-start":"save and start",permissions:"Permissions","power-on-hint":"Stop the cell; you can also remove it from boot.","launch-engine-help":"Providers, credentials and new engines are created in Settings → Fleet. Model and permissions are per cell.","launch-unavailable-hint":"Engine configuration is unavailable on this node.","import-as-cell":"Import as cell","import-help":"Reconcile an existing tmux session into a managed cell. Pick an already-declared engine: no engine is invented.","import-engine-required":"pick an engine (required)","test-and-connect":"test and connect","pairing-v2-hint":"Paste or scan ONE link: it prefills name, SSH host and label when the link carries them (v2).","invite-v2-hint":"Create one one-time invitation. It needs this device’s SSH address, reachable by whoever will use it.","invite-target-local":"The new device will join","invite-target-this":"this device","invite-endpoint-label":"This hub’s SSH address as seen by other devices","invite-endpoint-auto":"Configured endpoint","invite-endpoint-needed":"Enter user@host or a shared SSH alias. This is not 127.0.0.1 and not the NexusCrew HTTP URL.","invite-ssh-hint":"The SSH target the OTHER device uses to reach THIS installation (user@host or alias). Required: it is included in the link.","invite-next-steps":"copy this link, open NexusCrew on the other device and paste it in Settings → Nodes (or scan the QR): NexusCrew does the rest","pair-card-title":"connect with one link","pair-card-help":"Paste the pairing link generated on the other device (or scan its QR): NexusCrew decodes it, tests the SSH connection and connects on its own.","pair-paste-ph":"paste the pairing link here","pair-paste-btn":"paste","pair-advanced":"advanced / edit","pair-progress":"connecting: SSH → invite → confirm → verify…","pair-retry":"retry","pair-invalid-link":"this is not a valid pairing link","pair-invalid-hint":"you need the full link (http://…#pair=…) generated by the other NexusCrew: don’t open it, paste it here","pair-missing-ssh":"the link carries no SSH target (v1 format): set in “advanced” how this device reaches the other one over SSH — it is never invented","pair-missing-name":"the node name is missing: fill it in “advanced”","pair-clipboard-denied":"clipboard read not allowed: paste manually into the field","pair-clipboard-empty":"clipboard is empty: copy the pairing link first","pair-stage-validation":"invalid data","pair-stage-conflict":"name already in use","pair-stage-ssh-start":"SSH tunnel start failed","pair-stage-ssh-ready":"peer unreachable over SSH","pair-stage-join":"invite exchange failed","pair-stage-tunnel-final":"negotiated tunnel failed","pair-stage-confirm":"pairing confirmation failed","pair-stage-health":"final federation check failed","pair-stage-internal":"internal error","pair-stage-generic":"connection failed","qr-no-camera":"no camera available on this device: use a photo of the QR","qr-permission":"camera permission denied: allow it in the browser or use a photo of the QR","qr-unsupported":"live scanner not supported here: upload a photo of the QR","qr-upload":"use a photo"},es:{"update-available":"nueva versión {v} disponible","install-version-mismatch":"instalación incompleta: frontend y servidor no coinciden (v{v})",reload:"recargar","grid-empty":"arrastra aquí una sesión desde la barra lateral, o doble clic para vista única","grid-full":"un deck puede mostrar como máximo 9 sesiones",pin:"fijar arriba",reorder:"reordenar","reorder-help":"arrastra el control; flechas arriba/abajo","rename-node":"renombrar nodo","rename-node-prompt":"Nuevo nombre del nodo en NexusCrew","rename-node-invalid":"Nombre no válido: máximo 64 caracteres, sin saltos de línea.","reorder-deck-help":"arrastra el deck; flechas izquierda/derecha",sessions:"sesiones","new-session":"nueva sesión",new:"nueva",fleet:"Flota","fleet-tmux":"flota tmux","other-sessions":"Otras sesiones","view-all":"todas","view-pinned":"fijadas","view-active":"activas","view-off":"apagadas","view-technical":"técnicas","mark-technical":"ocultar como sesión técnica","mark-normal":"mostrar como sesión normal","position-local":"Local",files:"archivos",refresh:"actualizar","filter-placeholder":"filtrar sesiones…","loading-fleet":"cargando flota…","no-sessions":"sin sesiones tmux vivas — la flota arranca en el boot (systemd)","no-match":"ninguna sesión coincide con «{q}»","copy-url":"clic para copiar la URL","ssh-only":"solo túnel SSH/VPN","new-files-outbox":"archivos nuevos en outbox",terminate:"terminar","terminate-confirm":"¿Terminar la sesión «{name}»?","cell-on":"tmux activo","cell-off":"apagada","cell-working":"trabajando","cell-idle":"en espera","cell-degraded":"degradada: unit activa, tmux muerto","power-on":"encender","power-off":"apagar","boot-enable":"activar al iniciar","boot-disable":"desactivar al iniciar","state-on":"encendida","state-off":"apagada",engine:"Motor",model:"Modelo","model-default":"Modelo predeterminado del proveedor","model-remembered":"Último modelo usado con este motor","boot-persist":"iniciar en el boot","remove-boot":"quitar también del boot","power-config-in-settings":"Modifica motor, proveedor, perfil, modelo y permisos en Ajustes → Flota.","no-remote-control":"⚠ motor no nativo: sin RC de la app claude.ai (aquí puedes pilotarla igual)",cancel:"cancelar",name:"nombre","name-invalid":"nombre inválido: a-zA-Z0-9._- máx 64, sin '-' inicial",cwd:"carpeta",browse:"explorar","fs-home":"home","fs-parent":".. arriba",preset:"preset","preset-2x2":"cuadrícula 2×2","preset-columns":"columnas","preset-equalize":"igualar",collapse:"contraer",expand:"expandir",create:"crear","auth-prompt":"Pega el token (impreso por el servidor):","remember-device":"recordar en este dispositivo","zoom-out":"texto más pequeño","zoom-in":"texto más grande",composer:"composer",windows:"{n} ventanas","empty-files":"vacía",upload:"subir","no-sessions-short":"sin sesiones","composer-placeholder":"escribe o dicta…","composer-history-tools":"historial y tamaño de entrada","composer-history":"historial de la celda","composer-history-empty":"ninguna entrada enviada","composer-history-clear":"borrar historial de esta celda","composer-expand":"ampliar entrada","composer-collapse":"reducir entrada","composer-clear-data":"borrar borradores e historial","composer-clear-data-help":"Elimina de este navegador todos los borradores y el historial de entrada de las celdas.","composer-clear-confirm":"¿Borrar todos los borradores y el historial de entrada guardados en este navegador?","composer-clear-done":"Borradores e historial eliminados.","composer-clear-failed":"No se pudieron borrar los datos del composer en este navegador.",attach:"adjuntar","attach-file":"Archivo","attach-camera":"Cámara","attach-gallery":"Galería","attach-uploading":"subiendo…","attach-upload-progress":"adjunto {n}/{total}…","attach-uploaded":"{n} adjuntos subidos",voice:"voz",send:"enviar","composer-send-failed":"conexión no disponible — texto conservado, inténtalo de nuevo",close:"cerrar","lang-label":"idioma",decks:"decks","new-deck":"nuevo deck","deck-name":"nombre del deck","open-deck-window":"abrir en una ventana nueva","detach-deck":"separar en una ventana nueva","deck-current":"este deck (ventana actual)","deck-owner-unavailable":"el nodo propietario no está compartido o accesible","rename-deck":"renombrar deck","delete-deck":"eliminar deck","delete-deck-confirm":"¿Eliminar el deck «{name}»?","send-to-deck":"enviar al deck…","deck-autosave":"guardado automático",saving:"guardando…",saved:"guardado","popup-blocked":"ventana bloqueada: abrir aquí","expand-owner":"expandir decks de {owner}","collapse-owner":"comprimir decks de {owner}","owner-deck-count-one":"{count} deck","owner-deck-count-many":"{count} decks","dot-working":"en uso (ventana activa)","dot-on":"abierta en segundo plano","dot-neutral":"no abierta","dot-warn":"nodo sin conexión","select-drag":"arrastra para seleccionar","copy-manual":"selecciona y copia manualmente","toggle-sidebar":"mostrar/ocultar la barra lateral",settings:"ajustes","tab-roles":"roles","tab-nodes":"nodos",local:"Local",location:"Ubicación","pairing-link":"enlace de emparejamiento","pairing-required":"nombre, alias SSH y enlace son obligatorios","pairing-connect-help":"Para conectar un nodo necesitas un nombre, un Host SSH funcional y el enlace/QR creado por la otra instalación NexusCrew.","pairing-localhost-hint":"127.0.0.1 en el enlace es correcto: no lo abras aquí. NexusCrew usa la invitación y el puerto mediante el Host SSH.","scan-qr":"escanear QR","pairing-qr-invalid":"QR de emparejamiento no válido","invite-node":"invitar un nodo","create-pairing-link":"crear enlace / QR","visibility-network":"toda la red","visibility-relay":"solo relay","visibility-selected":"nodos seleccionados","hydra-simple":"local + nodos, una red","local-ready":"Este dispositivo está listo. Úsalo solo o conéctalo a un nodo.","local-only":"solo local","add-node":"añadir nodo",connect:"conectar","node-connected":"Nodo conectado. La red se sincronizará automáticamente.","tab-system":"sistema","tab-fleet":"flota","tab-audio":"audio","system-general":"general","system-diagnostics":"diagnóstico","system-this-node":"este nodo","system-updates":"actualizaciones","system-security":"seguridad","system-local-data":"datos locales del navegador","system-terminal":"terminal","alternate-screen":"pantalla alternativa","alternate-screen-help":"Mantiene el comportamiento estándar de tmux para las nuevas sesiones NexusCrew. Una aplicación que sigue el ratón se desplaza sola; las demás recorren el historial de tmux. No modifica las celdas ya activas.","tab-input":"entrada","tab-diagnostics":"diagnóstico","input-settings-local":"Preferencias locales de este navegador. Se aplican de inmediato a la vista única y a los decks sin cambiar el nodo remoto.","terminal-keyboard-gesture":"Abrir el teclado virtual desde el terminal","terminal-keyboard-double-tap":"Doble toque (predeterminado)","terminal-keyboard-single-tap":"Toque único","terminal-keyboard-never":"Nunca desde el terminal","terminal-keyboard-gesture-help":"El teclado auxiliar y STT usan los controles separados de abajo. El ratón y el teclado físico siguen disponibles.","keybar-ime-lock":"Teclado auxiliar: mantener cerrado el teclado virtual","keybar-ime-lock-help":"ESC, flechas, PgUp/PgDn, Enter y menú envían directamente al PTY sin enfocar un campo de texto.","voice-ime-lock":"Micrófono STT: mantener cerrado el teclado virtual","voice-ime-lock-help":"Tocar el micrófono inicia o detiene la voz sin enfocar el compositor.","keybar-enter-show":"Mostrar Enter vertical en el teclado auxiliar","keybar-enter-show-help":"Enter queda a la derecha de PgUp/PgDn y ocupa las dos filas.","keybar-layout":"Distribución del teclado auxiliar","keybar-layout-full":"Completo (predeterminado)","keybar-layout-compact":"Compacto","keybar-layout-help":"Compacto: una fila con un botón expandir que alcanza el conjunto completo sin cambiar la preferencia.","input-settings-reset":"restaurar valores de entrada","diagnostics-local":"Este nodo","diagnostics-target":"Nodo a diagnosticar","diagnostics-verbose":"Logs detallados temporales","diagnostics-duration":"Duración detallada","diagnostics-expires":"Log detallado activo hasta las {time}","diagnostics-off":"El log detallado está apagado; los avisos y errores operativos siguen disponibles.","diagnostics-level":"Nivel","diagnostics-all-levels":"todos los niveles","diagnostics-component":"componente","diagnostics-pause":"pausa","diagnostics-autoscroll":"desplazamiento automático","diagnostics-log":"Log de diagnóstico sanitizado","diagnostics-empty":"No hay eventos de diagnóstico.","diagnostics-export":"exportar JSON","diagnostics-export-failed":"La exportación no está disponible en este navegador.","diagnostics-clear":"vaciar","diagnostics-clear-confirm":"¿Vaciar el búfer de diagnóstico de este nodo?","diagnostics-unsupported":"Este par está desconectado o no admite diagnósticos estructurados.","fleet-editor-loading":"Cargando el editor de Fleet…","fleet-editor-load-error":"No se puede cargar el editor de Fleet.","fleet-editor-unavailable":"El editor de Fleet no está disponible en esta ubicación.","fleet-managed":"gestionado por NexusCrew","fleet-custom":"comando personalizado","fleet-managed-help":"Cliente, proveedor e inicio se gestionan internamente; los secretos nunca se muestran.","fleet-shell-engine-help":"La shell local se resuelve en el dispositivo al iniciar; no se guarda ninguna ruta ejecutable en las copias.","fleet-shell-command-placeholder":"comando opcional, p. ej. npm test","fleet-shell-command-help":"Se ejecuta mediante una shell de inicio interactiva (-lic), con PATH y alias del usuario. La celda se detiene al terminar; los fallos inmediatos se notifican.","fleet-shell-command-metachar":"Pipes, redirecciones, variables y otros metacaracteres son interpretados por la shell del dispositivo.","fleet-shell-interactive":"Vacío: abre una shell local interactiva y mantiene la celda activa.","fleet-shell-launch-help":"Configura el comando Shell de la celda en Ajustes → Flota.","fleet-credential-title":"Clave API en este dispositivo","fleet-credential-help":"La clave permanece solo en el nodo seleccionado y nunca se muestra, exporta ni comparte con la red.","fleet-credential-set":"poner clave","fleet-credential-change":"cambiar clave","fleet-credential-forget":"olvidar","fleet-credential-saved":"Clave guardada localmente.","fleet-credential-removed":"Clave local eliminada.","fleet-credential-remove-confirm":"¿Eliminar la clave local {key}?","fleet-credential-source-environment":"entorno","fleet-credential-source-local":"almacén local","fleet-credential-source-compatibility":"config compatible","fleet-credential-source-missing":"ausente","fleet-credential-source-policy":"origen de credencial","fleet-credential-source-policy-auto":"auto (precedencia legacy)","fleet-credential-source-policy-nexuscrew-store":"solo almacén NexusCrew","fleet-credential-source-policy-environment":"solo entorno","fleet-key-section":"KEY","fleet-key-variable":"Variable","fleet-key-value":"Valor para {key}","fleet-key-used-by":"Usada por: {engines}","fleet-key-used-by-none":"Aún no la usa ningún motor configurado en este nodo.","fleet-key-shared-impact":"Sustituir o eliminar {key} afecta a todos los motores listados: {engines}.","fleet-key-enter":"introduce la clave","fleet-key-blank-keeps":"vacío = mantener la fuente actual","fleet-key-reveal":"mostrar","fleet-key-hide":"ocultar","fleet-key-local-help":"El valor permanece write-only en el nodo seleccionado y nunca entra en motores, copias ni federación.","fleet-key-create-missing":"Crear explícitamente el motor sin clave (seguirá como “clave requerida”).","fleet-key-partial-create":"Motor creado; la clave no se guardó. Puedes reintentar sin crear un duplicado.","fleet-key-partial-edit":"Motor actualizado; la clave no se guardó. Los cambios del motor siguen aplicados.","fleet-provider-notice-claude-openrouter":"Claude Code está optimizado para modelos Anthropic; otros proveedores podrían no funcionar correctamente. Fast mode requiere el proveedor Anthropic first-party.","fleet-provider-notice-codex-openrouter":"OpenRouter Responses es beta y stateless; Codex-VL no usa fallback de Chat Completions.","fleet-provider-notice-claude-kimi-code":"Kimi Code usa una configuración Claude aislada con onboarding y fast mode dedicados; la configuración Claude nativa no se modifica.","fleet-provider-notice-alibaba-token-plan":"Token Plan Personal usa solo ALIBABA_CODE_API_KEY de la capa local de credenciales; qwen3.8-max-preview es el modelo predeterminado y no se usa fallback OpenAI/PAYG.","fleet-provider-notice-kimi-native":'Kimi Code CLI nativo usa el login del CLI (device-code) y su propia configuración: NexusCrew no lee ni copia credenciales. Distinto del proveedor "Kimi Code" de Claude Code, que sigue siendo la ruta K3 gestionada.',"fleet-model-default":"modelo predeterminado (opcional)","fleet-model-required":"modelo (obligatorio)","fleet-standard-permissions":"permisos estándar","fleet-unsafe-permissions":"inseguro · omitir aprobaciones/sandbox","fleet-unsafe-warning":"Modo inseguro explícito: el worker puede actuar sin las aprobaciones normales ni las protecciones del sandbox.","fleet-provider-display":"nombre visible del proveedor","fleet-custom-provider-default":"Proveedor personalizado","fleet-api-key-env":"NOMBRE_VARIABLE_API_KEY","fleet-provider-id":"id-proveedor","fleet-custom-secret-help":"NexusCrew guarda solo el nombre de la variable de entorno, nunca su valor.","fleet-model-override":"modelo alternativo","fleet-ready":"listo","fleet-not-ready":"no configurado","fleet-engines":"Motores","fleet-cells":"Celdas / sesiones cloud","fleet-backup":"copia / restauración","fleet-backup-help":"Exporta o restaura selectivamente motores, celdas y system prompts. Tokens, claves API y secretos del proveedor nunca entran en el archivo.","fleet-backup-export":"exportar","fleet-backup-import":"importar","fleet-backup-download":"descargar copia","fleet-backup-restore":"restaurar seleccionadas","fleet-backup-import-help":"Elige una copia JSON, revisa las celdas y selecciona un motor de destino antes de restaurar.","fleet-backup-overwrite":"sobrescribe la celda existente","fleet-backup-new":"celda nueva","fleet-backup-engine-missing":"elige un motor disponible","fleet-backup-restore-unavailable":"El nodo seleccionado solo admite exportación; actualízalo para restaurar copias.","fleet-backup-restored":"{n} celdas restauradas","fleet-backup-confirm-overwrite":"¿Sobrescribir estas celdas? {cells}","fleet-backup-needs-restart":"reinicio necesario: {cells}","fleet-backup-empty":"no hay celdas para exportar","fleet-backup-select-one":"selecciona al menos una celda","fleet-backup-too-large":"copia demasiado grande (máximo 1 MB)","fleet-backup-invalid-json":"el archivo no contiene JSON válido","fleet-backup-invalid-format":"formato o versión de copia no compatible","fleet-backup-invalid-cell":"la copia contiene una celda no válida","fleet-backup-duplicate-cell":"la copia contiene IDs de celda duplicados","fleet-backup-invalid-engine":"la copia contiene un motor no válido","fleet-backup-duplicate-engine":"la copia contiene IDs de motor duplicados","fleet-backup-confirm-engine-overwrite":"¿Sobrescribir estos motores? Los valores de entorno ya configurados en el destino no cambian. {engines}","fleet-backup-env-names":"nombres de entorno","fleet-backup-env-values-required":"los valores de entorno deben configurarse en este dispositivo","fleet-system-prompt":"system prompt",characters:"caracteres","select-all":"seleccionar todas","select-none":"ninguna",edit:"editar",save:"guardar",label:"etiqueta","command-path":"ruta absoluta del comando","args-lines":"argumentos, uno por línea","env-write-only":"Los valores env son de solo escritura: vacío conserva el valor existente.","fleet-new-engine":"Nuevo motor","fleet-new-cell":"Nueva celda","fleet-saved":"Definición guardada.","fleet-restart-confirm":"Cambio guardado. ¿Reiniciar ahora: {cells}?","fleet-remove-engine":'¿Eliminar el motor "{id}"?',"fleet-remove-cell":'¿Eliminar la celda "{id}"? Si está activa se detendrá primero.',"fleet-cwd-needs-repair":"carpeta a reparar","fleet-cwd-repair":"reparar","fleet-cwd-repair-title":"Reparar carpeta de celda {id}","fleet-cwd-repair-help":"La carpeta actual no es portátil en este dispositivo: pertenece a otro dispositivo o no existe bajo el directorio home. Elige una carpeta relativa a home (~) en el dispositivo destino; el backend recalculará la ruta absoluta.","fleet-cwd-repair-no-source-path":"La ruta original no se muestra: es específica del dispositivo de origen.","fleet-cwd-repair-placeholder":"p. ej. Dev","fleet-cwd-repair-preview":"Nueva carpeta: {path}","fleet-cwd-repair-browse":"examinar bajo ~","fleet-cwd-repair-fs-empty":"sin subcarpetas","fleet-cwd-repair-use-current":"usar esta carpeta","fleet-cwd-repair-invalid":'ruta no válida: nada de ruta absoluta, "..", barra invertida ni letra de unidad',"fleet-cwd-repair-confirm":"¿Establecer la carpeta de la celda {id} a {path}? Se recalculará en el dispositivo destino.","fleet-cwd-repair-unportable":"La ruta elegida no es portátil en este dispositivo: debe existir bajo el directorio home.","fleet-cwd-repair-suggestion":"Sugerencia del dispositivo:","fleet-cwd-repair-use-suggestion":"usar {path}","fleet-cwd-repaired":"Carpeta de la celda reparada.","fleet-recovery-kimi-code-consent-yes":"Kimi Code: confirma la clave API personalizada (Yes) en el terminal de la celda, luego reinicia la celda.","fleet-recovery-kimi-code-config-custom-api-key":'Kimi Code: en el terminal de la celda abre /config y activa "Use custom API key", luego reinicia la celda. Si la clave cambió, actualiza la credencial y reintenta.',"fleet-recovery-kimi-cli-login":"Kimi Code CLI: en el terminal de la celda ejecuta /login (código de dispositivo Kimi) o /provider, luego reinicia la celda.","fleet-recovery-client-terminal-dialog":"Completa el diálogo mostrado en el terminal de la celda, luego reinicia la celda.","settings-readonly":"READONLY activo: los cambios están bloqueados por el servidor (NEXUSCREW_READONLY=1)","role-client":"client (hub)","role-client-desc":"esta máquina observa otros nodos vía túneles SSH","role-node":"nodo (alcanzable)","published-port":"puerto publicado (opcional)","no-nodes":"sin nodos remotos configurados","node-add":"conectar una instalación NexusCrew","node-connect-help":"El puerto SSH conecta con el servidor SSH. El puerto NexusCrew es el puerto local indicado por `nexuscrew status` en el nodo remoto.","node-name-label":"Nombre del nodo","node-ssh-label":"Host SSH","pair-ssh-local-label":"Host o alias SSH en este dispositivo","node-ssh-local-help":"Puedes sustituir la dirección del enlace por el mismo alias que funciona con ssh en este dispositivo. Los alias, agentes y claves permanecen locales y nunca viajan en el enlace.","node-ssh-port-label":"Puerto SSH","node-ssh-port-help":"Normalmente 22; usa el puerto público del servidor SSH.","node-app-port-label":"Puerto NexusCrew del nodo","node-app-port-help":"El puerto indicado por `nexuscrew status` en el nodo remoto.","node-name-ph":"nombre (a-z 0-9 -)","node-ssh-ph":"ssh (user@host)","node-port-ph":"puerto remoto (opc.)","node-remove-confirm":"¿Eliminar el nodo «{name}»?","node-remove-warning":"Elimina el emparejamiento, las credenciales y el túnel local. No apaga el dispositivo remoto.","peer-inventory-title":"Nodos conectados al hub","peer-group-hubs":"Hubs directos","peer-group-clients":"Clientes conectados","peer-group-routed":"Nodos accesibles a través de la red","peer-group-vl":"Nodos VL","vl-owners-unavailable":"Owners VL no alcanzados","peer-routed":"enrutado","peer-routed-stale":"enrutado, no accesible","peer-visibility":"Visibilidad en la red","node-test":"test","tunnel-start":"iniciar túnel","tunnel-stop":"detener túnel","tunnel-restart":"reiniciar túnel","share-node":"Compartir este nodo","share-local-heading":"Compartir este dispositivo","share-local-hub":"Hub para compartir","share-local-through":"Compartir {device} mediante {hub}","share-local-active":"Compartido y accesible para la red conectada al hub.","share-local-pending":"Se solicitó compartir, pero el túnel está caído: este dispositivo aún no es accesible.","share-local-private":"Privado: solo este dispositivo puede usar la conexión al hub.","share-local-private-down":"Privado, pero la conexión al hub está caída. Reconecta para aplicar y verificar el modo privado.","share-local-reconnect":"Reconectar y reconciliar","share-off-hub-reconcile-pending":"Estado privado guardado; la revocación en el hub sigue pendiente.","fleet-cell-label":"nombre legible (opcional)","share-off-local-reconcile-pending":"Revocación confirmada por el hub; el túnel local aún debe reconciliarse.","share-reverse-pool-pending":"El canal inverso no se apagó de forma demostrable: queda en cuarentena, no cerrado.","share-node-off-desc":"Privado: sigue conectado al hub, pero otros clientes no pueden alcanzarlo.","share-node-on-desc":"Compartido: el hub puede anunciarlo y enrutar celdas y decks autorizados.","peer-shared":"Nodo cliente compartido en la red Hydra","peer-private":"Nodo cliente privado: conectado, no publicado en Hydra","peer-vl-federated":"Nodo VL: federado","row-vl-federated":"federado","node-connected-client":"cliente conectado","transport-used":"en uso","tunnel-up":"túnel activo","tunnel-down":"túnel caído","vl-poll-online":"en línea (poll)","vl-poll-offline":"sin respuesta","authorized-keys-hint":"pega esta línea en ~/.ssh/authorized_keys del host remoto:",copy:"copiar",copied:"copiado","token-rotate":"rotar token","token-rotate-explain":"El nuevo token NO se mostrará: recupéralo con `nexuscrew show token`. La sesión actual quedará invalidada.","service-regenerate":"regenerar service","npm-auto-update":"actualizaciones automáticas desde npm","npm-auto-update-help":"Comprueba latest periódicamente e instala solo versiones más recientes. Nunca baja de versión.","npm-update-current":"instalada","npm-update-latest":"npm latest","npm-update-check":"comprobar ahora","npm-update-install":"actualizar ahora","npm-update-restarting":"Actualización iniciada; NexusCrew volverá después de reiniciar el servicio.","npm-update-idle":"actualizado","npm-update-checking":"comprobando","npm-update-available":"actualización disponible","npm-update-installing":"instalando","npm-update-installed":"instalada, reiniciando","npm-update-error":"comprobación fallida","npm-update-unsupported":"disponible solo con instalación npm global","service-installed":"service instalado","service-missing":"service no instalado","service-active":"activo","service-inactive":"no activo",confirm:"confirmar",add:"añadir",enable:"activar","wizard-title":"bienvenido a NexusCrew","wizard-skip":"configura después desde ajustes","wizard-step-roles":"roles de esta instalación","wizard-step-node":"primer nodo remoto (opcional)","wizard-done":"todo listo","wizard-done-desc":"configuración completa — puedes cambiarlo todo desde ajustes",next:"continuar",back:"atrás",skip:"omitir",finish:"terminar","err-node-name":"nombre inválido (a-z, 0-9, -, máx 32)","err-local-name":"nombre local inválido: usa un slug único, no “localhost”","err-ssh":"ssh inválido (se espera user@host o alias)","err-port":"puerto inválido (1–65535)","err-ssh-port":"puerto SSH inválido (1–65535)","err-node-port":"puerto NexusCrew inválido (1–65535)","node-sessions":"{n} sesiones","tunnel-down-since":"túnel caído desde hace {t}","node-unreachable":"nodo inalcanzable","node-passive":"cliente desconectado · estado normal","node-offline":"nodo desconectado","node-offline-seen":"sin conexión · visto hace {t}","node-needs-repair":"legacy · vuelve a enlazar","asks-title":"preguntas de las celdas","ask-dismiss":"Descartar la pregunta","ask-reply-ph":"escribe la respuesta…","push-enable":"activar notificaciones push","push-disable":"desactivar notificaciones push","push-on":"push activas en este dispositivo","push-off":"push no activas","push-denied":"permiso de notificaciones denegado por el navegador","push-unsupported":"push no soportadas en este navegador","notification-speech-enable":"leer las notificaciones en voz alta","notification-speech-help":"Usa la voz del navegador solo para notificaciones nuevas mientras esta PWA está visible y en primer plano. Con la aplicación cerrada permanece la notificación del sistema.","notification-speech-test":"probar voz","notification-speech-testing":"probando voz…","notification-speech-preview":"NexusCrew. Las notificaciones por voz están activas.","notification-speech-preview-ok":"Prueba de voz completada.","notification-speech-preview-failed":"El navegador no inició la prueba de voz. Interactúa con la página y vuelve a intentarlo.","notification-speech-needs-test":"Para esta sesión de la aplicación, pulsa “probar voz” antes de recibir avisos hablados.","notification-speech-unsupported":"La síntesis de voz no está disponible en este navegador.","audio-title":"Audio nativo del nodo","audio-help":"El consentimiento y los controles valen solo para este dispositivo. Compartir y visibilidad no autorizan sonidos.","audio-consent":"permitir TTS en este nodo","audio-consent-help":"Permite que celdas autorizadas, locales o remotas, entreguen un comando de voz. Puedes revocarlo en cualquier momento.","audio-capability":"Capacidad local","audio-loading":"leyendo el estado de audio local…","audio-adapter":"adaptador","audio-adapter-none":"ninguno","audio-installed":"instalado","audio-installed-yes":"sí","audio-installed-no":"no","audio-liveness":"disponibilidad","audio-liveness-ready":"listo para aceptar","audio-liveness-unavailable":"no disponible","audio-languages":"idiomas declarados","audio-limits":"límites","audio-test":"probar audio local","audio-testing":"probando audio…","audio-stop":"detener audio local","audio-stopping":"deteniendo audio…","audio-test-needs-consent":"Activa el consentimiento local antes de probar la voz.","audio-unavailable":"No hay un adaptador TTS nativo disponible en este nodo.","audio-test-accepted":"El nodo aceptó la prueba. No demuestra que alguien la haya oído.","audio-test-refused":"El nodo rechazó la prueba.","audio-test-unknown":"Resultado de prueba desconocido: el nodo no pudo confirmar el inicio.","audio-stop-stopped":"Audio local detenido.","audio-stop-idle":"No hay enunciado local que detener.","audio-groups-title":"Grupos de audio compartido","audio-groups-help":"Decide en qué dispositivos se oye la voz cuando habla una celda. Un grupo es una preferencia local de entrega, no un consentimiento. Cada nodo conserva su consentimiento, ACL, disponibilidad y Stop local.","audio-groups-empty":"Sin grupos: la voz sale solo por este nodo.","audio-group-name":"nombre del grupo","audio-group-mode":"modo de entrega","audio-group-primary":"primero disponible (en orden)","audio-group-fanout":"todos los nodos enumerados","audio-group-targets":"nodos destino exactos","audio-group-local":"este nodo","audio-group-unavailable-target":"no detectado ahora","audio-group-no-targets":"No hay ningún nodo con instanceId disponible. Un grupo no puede usar nombres, comodines ni “todos”.","audio-group-new":"nuevo grupo","audio-group-edit":"editar","audio-group-delete":"eliminar","audio-group-save":"guardar grupo","audio-group-cancel":"cancelar","audio-group-invalid":"El grupo necesita un nombre válido y al menos un nodeId exacto.","audio-group-save-failed":"No se pudo guardar el grupo de audio.","node-display-label":"Nombre (etiqueta)","routed-node-aliases":"Alias de nodos enrutados","routed-node-aliases-help":"Visibles solo en este dispositivo; la ruta y el nombre remoto no cambian.","node-local-alias":"Alias en este dispositivo","alias-on-device":"Alias en este dispositivo","reset-alias":"Restablecer nombre remoto","node-slug-hint":"enrutado por slug: {slug}","device-name-label":"Nombre del dispositivo","device-name-hint":"cómo te ven los pares (editable)","local-route-name-label":"Nombre local / ruta","local-route-name-hint":"identificador técnico estable: etiqueta legible + sufijo del nodeId; editable antes de conectar","err-label":"etiqueta no válida (máx 64 caracteres, sin saltos de línea)","fleet-inventory":"Celdas y sesiones","fleet-inventory-help":"todas las posiciones (Local + rutas Hydra)","fleet-manage-location":"Gestionar ubicación","fleet-network-overview":"Vista de red","fleet-manage-help":"crea y configura celdas en la ubicación seleccionada","fleet-overview-help":"estado operativo de todas las ubicaciones, separado del editor","fleet-inventory-empty":"sin celdas ni sesiones","cell-switcher-refreshing":"actualizando celdas…","cell-switcher-empty-active":"no hay celdas activas verificadas","cell-switcher-not-confirmed":"estado sin confirmar","cell-switcher-not-active":"esta celda ya no está activa","cell-switcher-select":"selecciona una celda","cell-switcher-open":"abrir celda","cell-switcher-show-all":"todas","cell-switcher-show-active":"activas","cell-switcher-close":"cerrar selector de celdas","fleet-not-available":"fleet no disponible en esta posición",start:"iniciar",stop:"detener",restart:"reiniciar",delete:"eliminar","copy-manual":"copia fallida — selecciona y pulsa Cmd+C, o copia a mano","copy-empty":"nada seleccionado: arrastra con Shift para seleccionar","selection-held":"resaltado perdido, texto aún retenido","invite-hub-only":"Una invitación se acuña en el hub. Admitir un nodo nuevo es lo único que un nodo conectado no puede pedir en nombre de otro: abre NexusCrew en el hub y créala allí.","row-private":"privado","node-detail-open":"abrir el detalle","node-detail-reach":"Alcanzabilidad","node-detail-route":"ruta","node-detail-ssh":"SSH","node-detail-transport":"transporte","node-detail-owner":"propietario","node-detail-authority":"Qué puede hacer este nodo","authority-owner-equivalent":"Autoridad igual a la tuya: un nodo emparejado puede hacer en esta máquina todo lo que puedes hacer tú.","authority-routed":"No está emparejado con esta máquina: su autoridad vive en el hub que lo enruta.","authority-no-grants":"El único poder por nodo que existe es la elección de celdas, más abajo. Dentro de esas celdas la autoridad sigue siendo plena.","authority-no-grants-elsewhere":"El único poder por nodo que existe es la elección de celdas, y se configura en la instalación que las posee — no aquí.","node-detail-network-view":"Qué ve de esta red","node-detail-command":"Comando","vl-no-commands":"El dispositivo no declara comandos disponibles.","vl-events-title":"Sesión","vl-events-empty":"Ningún evento en memoria: la sesión aún no ha hablado, o lo que dijo ha salido del búfer. El historial queda en el dispositivo.","vl-events-gap":"eventos no recibidos:","vl-events-truncated":"contenido truncado por el dispositivo","vl-events-turn-end":"— fin del turno —","vl-events-done":"— fin de la respuesta —","vl-events-writer-epoch":"— cambio de escritor —","vl-events-tool":"herramienta","vl-events-tool-ok":"terminada","vl-events-tool-failed":"fallida","vl-events-usage":"consumo actualizado","vl-events-stale":"Actualización fallida: puede que no estés viendo lo último.","vl-cmd-phase-submitted":"enviado, a la espera de confirmación","vl-cmd-phase-inflight":"en curso","vl-cmd-phase-done-ok":"completado","vl-cmd-phase-done-error":"fallido","vl-cmd-status":"estado","vl-cmd-health":"salud","vl-cmd-start":"iniciar","vl-cmd-stop":"detener","vl-cmd-restart":"reiniciar","vl-cmd-version":"versión","vl-cmd-capabilities":"capacidades","vl-cmd-logs":"logs","vl-cmd-prompt":"prompt","vl-prompt-placeholder":"escribe el prompt para la sesión del dispositivo…","vl-prompt-send":"enviar prompt","vl-cmd-unpair":"desemparejar","node-grant-none":"Ningún nodo elegido: compartido, pero hacia nadie.","node-grant-unknown":"ya no está en el inventario","node-grant-remove":"quitar","node-grant-add":"Añadir un nodo","node-grant-search":"Buscar entre los nodos","node-grant-no-candidates":"Ningún nodo coincide.","cell-scope":"Celdas visibles para este nodo","cell-scope-help":"Se aplica a lo que este nodo lista y a lo que puede tocar, incluido el terminal. Dentro de las celdas concedidas sigue siendo un nodo emparejado por completo: no es un sandbox.","cell-scope-all":"todas las celdas","cell-scope-none":"ninguna celda","cell-scope-selected":"celdas seleccionadas","cell-scope-none-granted":"Ninguna celda elegida: este nodo no ve ninguna.","cell-scope-unknown":"la celda ya no existe","cell-scope-add":"Añadir una celda","cell-scope-search":"Buscar entre las celdas","cell-scope-no-candidates":"Ninguna celda coincide.","cell-scope-reset-warning":"Al cambiar de modo la lista se borra: volver a «celdas seleccionadas» obliga a elegirlas de nuevo.","cell-scope-list-unavailable":"Lista de celdas no disponible ahora: las concesiones de abajo siguen vigentes, pero no se puede saber si aún existen.","single-view":"vista única",retract:"reducir","keybar-expand":"ampliar la barra de teclas","keybar-retract":"reducir la barra de teclas","save-and-start":"guardar e iniciar",permissions:"Permisos","power-on-hint":"Detén la celda; también puedes quitarla del boot.","launch-engine-help":"Proveedores, credenciales y nuevos motores se crean en Ajustes → Flota. Modelo y permisos son por celda.","launch-unavailable-hint":"La configuración del motor no está disponible en este nodo.","import-as-cell":"Importar como celda","import-help":"Reconcilia una sesión tmux existente en una celda gestionada. Elige un motor ya declarado: no se inventa ninguno.","import-engine-required":"elige un motor (obligatorio)","test-and-connect":"probar y conectar","pairing-v2-hint":"Pega o escanea UN solo enlace: rellena nombre, Host SSH y etiqueta cuando los incluye (v2).","invite-v2-hint":"Crea una invitación de un solo uso. Hace falta la dirección SSH de este dispositivo, alcanzable por quien la use.","invite-target-local":"El nuevo dispositivo entrará en","invite-target-this":"este dispositivo","invite-endpoint-label":"Dirección SSH de este hub vista por los otros dispositivos","invite-endpoint-auto":"Endpoint ya configurado","invite-endpoint-needed":"Introduce usuario@host o un alias SSH compartido. No es 127.0.0.1 ni la URL HTTP de NexusCrew.","invite-ssh-hint":"El destino SSH con el que el OTRO dispositivo alcanza ESTA instalación (usuario@host o alias). Obligatorio: se incluye en el enlace.","invite-next-steps":"copia este enlace, abre NexusCrew en el otro dispositivo y pégalo en Ajustes → Nodos (o escanea el QR): NexusCrew hace el resto","pair-card-title":"conectar con un solo enlace","pair-card-help":"Pega el enlace de emparejamiento generado en el otro dispositivo (o escanea su QR): NexusCrew lo decodifica, prueba la conexión SSH y conecta solo.","pair-paste-ph":"pega aquí el enlace de emparejamiento","pair-paste-btn":"pegar","pair-advanced":"avanzado / editar","pair-progress":"conectando: SSH → invitación → confirmación → verificación…","pair-retry":"reintentar","pair-invalid-link":"esto no es un enlace de emparejamiento válido","pair-invalid-hint":"se necesita el enlace completo (http://…#pair=…) generado por el otro NexusCrew: no lo abras, pégalo aquí","pair-missing-ssh":"el enlace no incluye el destino SSH (formato v1): indica en “avanzado” cómo este dispositivo alcanza al otro por SSH — nunca se inventa","pair-missing-name":"falta el nombre del nodo: complétalo en “avanzado”","pair-clipboard-denied":"lectura del portapapeles no permitida: pega manualmente en el campo","pair-clipboard-empty":"portapapeles vacío: copia primero el enlace","pair-stage-validation":"datos no válidos","pair-stage-conflict":"nombre ya en uso","pair-stage-ssh-start":"fallo al iniciar el túnel SSH","pair-stage-ssh-ready":"peer inaccesible por SSH","pair-stage-join":"intercambio de invitación fallido","pair-stage-tunnel-final":"túnel negociado fallido","pair-stage-confirm":"confirmación de emparejamiento fallida","pair-stage-health":"verificación final de la federación fallida","pair-stage-internal":"error interno","pair-stage-generic":"conexión fallida","qr-no-camera":"no hay cámara disponible en este dispositivo: usa una foto del QR","qr-permission":"permiso de cámara denegado: permítelo en el navegador o usa una foto del QR","qr-unsupported":"escáner en vivo no soportado aquí: sube una foto del QR","qr-upload":"usar una foto"}};function Ol(){const e=cy(),t=e?e.getItem(ly):null;return tf.includes(t)?t:jl}function cx(e){const t=cy();if(t)try{t.setItem(ly,e)}catch{}typeof window<"u"&&window.dispatchEvent(new Event(Kd))}function f(e){const t=Ol(),n=gl[t]||gl[jl];return Object.prototype.hasOwnProperty.call(n,e)?n[e]:Object.prototype.hasOwnProperty.call(gl[jl],e)?gl[jl][e]:e}function ux(e){return typeof window>"u"?()=>{}:(window.addEventListener(Kd,e),()=>window.removeEventListener(Kd,e))}const uy=tf;function kn(){return[N.useSyncExternalStore(ux,Ol,Ol),cx]}function Bl({cell:e,token:t,route:n=[],onConfirm:s,onClose:o}){var $,W;kn();const a=!!(e&&e.active),u=Array.isArray(n)?n.join("/"):"",[h,p]=N.useState([]),[m,v]=N.useState(!1);N.useEffect(()=>{let x=!0;return(async()=>{if(t)try{const M=await ws(t,u?u.split("/"):[]);if(!x)return;if(v(M.provider==="builtin"&&(M.capabilities||[]).includes("edit")),M.provider==="builtin"&&(M.capabilities||[]).includes("definitions")){const D=await Jl(t,u?u.split("/"):[]);if(!x)return;const A=new Map((M.engines||[]).map(K=>[K.id,K]));p((D.engines||[]).map(K=>{var X,se,ce,fe,we,me,be;return{id:K.id,label:K.label||K.id,client:((X=K.managed)==null?void 0:X.client)||"",models:[...new Set([...((se=A.get(K.id))==null?void 0:se.models)||[],...((ce=K.managedInfo)==null?void 0:ce.models)||[]])].filter(Boolean),defaultModel:((fe=K.managed)==null?void 0:fe.model)||((we=K.managedInfo)==null?void 0:we.defaultModel)||"",policyDefault:((me=K.managed)==null?void 0:me.permissionPolicy)||((be=K.managed)!=null&&be.client&&K.managed.client==="claude"?"unsafe":"standard")}}))}}catch{}})(),()=>{x=!1}},[t,u]);const S=(e==null?void 0:e.engine)||(($=h[0])==null?void 0:$.id)||"",y=x=>(e==null?void 0:e.models)&&e.models[x]||"",b=x=>{const M=(e==null?void 0:e.permissionPolicies)&&e.permissionPolicies[x];if(M==="standard"||M==="unsafe")return M;const D=h.find(A=>A.id===x);return D?D.policyDefault:"standard"},[w,k]=N.useState(S),[C,R]=N.useState((e==null?void 0:e.model)||""),E=(e==null?void 0:e.permissionPolicy)==="standard"||(e==null?void 0:e.permissionPolicy)==="unsafe"?e.permissionPolicy:((W=e==null?void 0:e.permissionPolicies)==null?void 0:W[e==null?void 0:e.engine])||"",[F,O]=N.useState(E),[q,Y]=N.useState((e==null?void 0:e.boot)??!0),[z,Z]=N.useState(!1),[G,Q]=N.useState(null);N.useEffect(()=>{h.length&&(k(x=>x||S),R(x=>x||y((e==null?void 0:e.engine)||S)||""),O(x=>x==="standard"||x==="unsafe"?x:b((e==null?void 0:e.engine)||S)))},[h.length]);const B=N.useMemo(()=>h.find(x=>x.id===w)||null,[h,w]),I=!!(B&&["claude","codex","codex-vl","agy","kimi"].includes(B.client)),j=(B==null?void 0:B.client)==="shell";function T(x){k(x);const M=h.find(D=>D.id===x);R(y(x)||(M==null?void 0:M.defaultModel)||""),O(b(x))}async function L(x){x.preventDefault(),Z(!0),Q(null);try{if(a)await s({action:"down",boot:q});else{const M=F==="standard"||F==="unsafe"?F:(B==null?void 0:B.policyDefault)||"standard";await s({action:"up",...m?{engine:w,model:C||"",...I?{permissionPolicy:M}:(B==null?void 0:B.client)==="pi"?{permissionPolicy:"standard"}:{}}:{},boot:q})}o()}catch(M){Q(String(M&&M.message||M)),Z(!1)}}return c.jsx("div",{className:"nc-sheet-overlay nc-launch-overlay",onClick:o,children:c.jsxs("form",{className:"nc-sheet nc-power-sheet nc-launch-sheet",onClick:x=>x.stopPropagation(),onSubmit:L,children:[c.jsxs("div",{className:"nc-sheet-head",children:[c.jsx("b",{children:e==null?void 0:e.cell}),c.jsx("span",{className:"nc-sheet-state",children:f(a?"state-on":"state-off")})]}),a?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"nc-power-config",children:[c.jsx("span",{children:f("engine")}),c.jsx("b",{children:(e==null?void 0:e.engine)||"—"}),(e==null?void 0:e.model)&&c.jsxs("small",{children:[f("model"),": ",e.model]}),c.jsx("small",{children:f("power-on-hint")})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:q,onChange:x=>Y(x.target.checked)}),f("remove-boot")]})]}):c.jsxs(c.Fragment,{children:[m&&h.length>0?c.jsxs("div",{className:"nc-launch-fields",children:[c.jsxs("label",{className:"nc-field",children:[f("engine"),c.jsx("select",{value:w,onChange:x=>T(x.target.value),children:h.map(x=>c.jsx("option",{value:x.id,children:x.label},x.id))})]}),!j&&c.jsxs("label",{className:"nc-field",children:[f("model"),c.jsx("input",{value:C,list:"nc-launch-models",placeholder:f("model-default"),onChange:x=>R(x.target.value)}),c.jsx("datalist",{id:"nc-launch-models",children:((B==null?void 0:B.models)||[]).map(x=>c.jsx("option",{value:x},x))})]}),I?c.jsxs("label",{className:"nc-field",children:[f("permissions"),c.jsxs("select",{value:F,onChange:x=>O(x.target.value),children:[c.jsx("option",{value:"standard",children:f("fleet-standard-permissions")}),c.jsx("option",{value:"unsafe",children:f("fleet-unsafe-permissions")})]})]}):c.jsx("small",{className:"nc-note",children:f("fleet-standard-permissions")}),I&&F==="unsafe"&&c.jsx("small",{className:"nc-err",children:f("fleet-unsafe-warning")}),c.jsx("small",{className:"nc-note",children:f(j?"fleet-shell-launch-help":"launch-engine-help")})]}):c.jsxs("div",{className:"nc-power-config",children:[c.jsx("span",{children:f("engine")}),c.jsx("b",{children:(e==null?void 0:e.engine)||"—"}),(e==null?void 0:e.model)&&c.jsxs("small",{children:[f("model"),": ",e.model]}),c.jsx("small",{children:f("launch-unavailable-hint")})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:q,onChange:x=>Y(x.target.checked)}),f("boot-persist")]})]}),G&&c.jsx("div",{className:"nc-err",children:G}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:o,disabled:z,children:f("cancel")}),c.jsx("button",{type:"submit",className:"nc-btn primary",disabled:z,children:f(a?"power-off":"save-and-start")})]})]})})}const jg=/^[a-z0-9-]{1,32}$/;function Go(e,t){const n=Array.isArray(e)?e:[];return n.length?`${n.map(encodeURIComponent).join("/")}:${t}`:String(t)}function dx(e,t,n){const s={};for(const o of Array.isArray(t)?t:[]){const a=Array.isArray(o==null?void 0:o.route)?o.route:typeof(o==null?void 0:o.name)=="string"?[o.name]:[];if(!a.length)continue;const u=a.join("/"),h=o.status==="up"||o.tunnel&&o.tunnel.status==="up",p=o.status==="passive"||o.tunnel&&o.tunnel.status==="passive";!h&&!p&&(s[u]=e&&e[u]||n)}return s}function Rg(e,t,n){return!e||!Array.isArray(e.cells)?[]:e.cells.map(s=>({...s,route:t,key:`${n}:${s.tmuxSession||s.cell}`}))}function Pg({nodes:e,topology:t,remote:n,down:s,fleet:o,aliases:a}={}){var m,v,S,y;const u=[],h=new Set,p=new Set;for(const b of Array.isArray(e)?e:[]){if(!b||typeof b.name!="string"||!jg.test(b.name)||b.direction==="inbound"&&b.shared!==!0)continue;const w=[b.name],k=b.name;h.add(k);const C=((m=b.tunnel)==null?void 0:m.status)||"unknown",R=C==="up",E={name:b.name,label:b.label||b.name,originalLabel:b.label||b.name,alias:null,route:w,direct:!0,instanceId:b.nodeId||null,shared:b.shared===!0,tunnelStatus:C,sessions:[],cells:[],unmanaged:[],fleetAvailable:!1,capabilities:[],engines:[],health:b.health||null,direction:b.direction||"outbound",roles:b.roles||null,rolesKnown:b.rolesKnown===!0};if(b.nodeId&&p.add(b.nodeId),!b.nodeId&&b.paired===!1){u.push({...E,status:"needs-repair",downSince:s&&s[k]||null});continue}if(((v=b.health)==null?void 0:v.auth)==="failed"||C==="degraded"&&((S=b.health)==null?void 0:S.status)==="degraded"){u.push({...E,status:"needs-repair",downSince:s&&s[k]||null});continue}if(C==="passive"||((y=b.health)==null?void 0:y.status)==="passive"){u.push({...E,status:"passive",downSince:null});continue}if(!R){u.push({...E,status:"down",downSince:s&&s[k]||null});continue}const F=n&&(n[k]||n[b.name])||null,O=o&&(o[k]||o[b.name]),q=!!(F&&!F.error&&Array.isArray(F.sessions)),Y=!!(O&&O.available===!0&&Array.isArray(O.cells));if(!q&&!Y){u.push({...E,status:"unreachable"});continue}const z=(q?F.sessions:[]).filter(Q=>Q&&typeof Q.name=="string"&&Q.name).map(Q=>({...Q,node:k,route:w,key:`${k}:${Q.name}`})),Z=Rg(O,w,k),G=new Set(Z.map(Q=>Q.tmuxSession).filter(Boolean));u.push({...E,status:"up",sessions:z,cells:Z,unmanaged:z.filter(Q=>!G.has(Q.name)),fleetAvailable:!!(O&&O.available),capabilities:O&&O.capabilities||[],engines:O&&O.engines||[],fleetProvider:O&&O.provider||null,sessionsAvailable:q,inventoryPartial:!q})}for(const b of Array.isArray(t)?t:[]){if(!b||!Array.isArray(b.route)||b.route.length<1||b.route.some(G=>!jg.test(G)))continue;const w=b.route.join("/");if(h.has(w)||b.instanceId&&p.has(b.instanceId))continue;b.instanceId&&p.add(b.instanceId);const k=b.label||b.route.join(" › "),C=b.instanceId&&a&&typeof a[b.instanceId]=="string"?a[b.instanceId]:null,R={name:b.name,label:C||k,originalLabel:k,alias:C,route:[...b.route],direct:!1,instanceId:b.instanceId||null,shared:!0,tunnelStatus:null,sessions:[],cells:[],unmanaged:[],fleetAvailable:!1,capabilities:[],engines:[],health:b.health||null,lastSeen:b.lastSeen||null};if(b.stale){u.push({...R,status:"offline",downSince:s&&s[w]||b.lastSeen||null});continue}const E=n&&n[w]||null,F=o&&o[w],O=!!(E&&!E.error&&Array.isArray(E.sessions)),q=!!(F&&F.available===!0&&Array.isArray(F.cells));if(!O&&!q){u.push({...R,status:"unreachable",downSince:s&&s[w]||null});continue}const Y=(O?E.sessions:[]).filter(G=>G&&typeof G.name=="string"&&G.name).map(G=>({...G,node:w,route:b.route,key:`${w}:${G.name}`})),z=Rg(F,b.route,w),Z=new Set(z.map(G=>G.tmuxSession).filter(Boolean));u.push({...R,status:"up",sessions:Y,cells:z,unmanaged:Y.filter(G=>!Z.has(G.name)),fleetAvailable:!!(F&&F.available),capabilities:F&&F.capabilities||[],engines:F&&F.engines||[],fleetProvider:F&&F.provider||null,lastSeen:b.lastSeen||null,sessionsAvailable:O,inventoryPartial:!O})}return u.sort((b,w)=>b.label.localeCompare(w.label))}function dy(e,t={}){if(!e||typeof e!="object")return null;const n=typeof e.nodeId=="string"?e.nodeId:"";if(!n)return null;const s=typeof e.label=="string"&&e.label.trim()||typeof e.cell=="string"&&e.cell.trim()||n,o=Array.isArray(t.route)?[...t.route]:[];return{kind:"vl",nodeId:n,name:n,label:s,cell:e.cell??null,paired:!!e.pairedAt,online:!!e.online,lastSeen:e.lastSeen??null,generation:e.generation??null,version:e.version??null,health:e.health??null,session:e.session??null,capabilities:Array.isArray(e.capabilities)?e.capabilities:[],inflight:e.inflight??null,lastAck:e.lastAck??null,canManage:!!e.canManage,route:o,isLocal:o.length===0,ownerInstanceId:typeof t.instanceId=="string"?t.instanceId:null,ownerLabel:typeof t.label=="string"&&t.label?t.label:null}}function hx(e){var n;const t=[];for(const s of Array.isArray(e)?e:[]){if(!s||s.kind!=="vl"||!s.nodeId)continue;const o=s.online===!0,a=o&&((n=s.session)==null?void 0:n.attached)===!0,u=s.ownerInstanceId||"local";t.push({kind:"vl",name:`vl-${s.nodeId.slice(0,8)}`,label:s.label,route:Array.isArray(s.route)?[...s.route]:[],instanceId:null,direct:!1,status:o?"up":"offline",downSince:o?null:s.lastSeen??null,sessions:a?[{key:`vl:${u}:${s.nodeId}`,name:s.session.profile,attached:!0}]:[],cells:[],unmanaged:[],fleetAvailable:!1,capabilities:[],engines:[],health:s.health??null,peer:s})}return t}function hy(e,t){const n=e&&Array.isArray(e.nodes)?e.nodes:[],s=new Set([t]),o=[];for(const a of n){const u=a&&typeof a.instanceId=="string"?a.instanceId:"";if(!u||s.has(u)||a.stale===!0||!Array.isArray(a.route)||a.route.length===0)continue;s.add(u);const h=typeof a.label=="string"&&a.label||typeof a.name=="string"&&a.name||a.route.join(" › ");o.push({instanceId:u,route:[...a.route],label:h})}return o}const fx=4e3;function nf(e,t=!0,n=0){const[s,o]=N.useState([]),a=N.useRef({});return N.useEffect(()=>{if(!t||!e){o([]);return}let u=!0;async function h(){var O;let m=[],v=[],S={},y="";if(await Promise.all([k0(e).then(q=>{m=Array.isArray(q.nodes)?q.nodes:[]}).catch(()=>{}),iy(e).then(q=>{v=Array.isArray(q.nodes)?q.nodes:[]}).catch(()=>{}),P0(e).then(q=>{S=q&&typeof q.aliasesByInstanceId=="object"?q.aliasesByInstanceId:{}}).catch(()=>{}),Ht("/api/config",e).then(q=>q.json()).then(q=>{y=q&&typeof q.instanceId=="string"?q.instanceId:""}).catch(()=>{})]),!u)return;const b=[{instanceId:y||null,route:[],label:null},...hy({nodes:v},y)],w=[];if(await Promise.all(b.map(async q=>{try{const Y=await ny(e,q.route);for(const z of Y.nodes||[]){const Z=dy(z,q);Z&&w.push(Z)}}catch{}})),!u)return;const k={},C={},R=new Set(m.map(q=>q.name)),E=[];for(const q of m)((O=q.tunnel)==null?void 0:O.status)==="up"&&(q.nodeId||q.paired!==!1)&&(q.direction!=="inbound"||q.shared===!0)&&E.push([q.name]);for(const q of v)!q.stale&&Array.isArray(q.route)&&q.route.length>0&&!(q.route.length===1&&R.has(q.route[0]))&&E.push(q.route);if(await Promise.all(E.map(async q=>{const Y=q.join("/");try{k[Y]=await Jh(e,q)}catch{k[Y]={error:"unreachable"}}try{C[Y]=await ws(e,q)}catch{C[Y]={available:!1}}})),!u)return;const F=Pg({nodes:m,topology:v,remote:k,fleet:C,aliases:S,down:a.current});a.current=dx(a.current,F,Math.floor(Date.now()/1e3)),o([...Pg({nodes:m,topology:v,remote:k,fleet:C,aliases:S,down:a.current}),...hx(w)])}h();const p=setInterval(h,fx);return()=>{u=!1,clearInterval(p)}},[e,t,n]),s}const Lg=52,Ag=14;function bi({position:e,itemKey:t,label:n,onMove:s,onStep:o,canMove:a=()=>!0,scope:u="roster"}){const h=N.useRef(null),p=N.useRef(0),[m,v]=N.useState(!1),S=()=>{var R,E,F,O;const C=h.current;(E=(R=C==null?void 0:C.over)==null?void 0:R.classList)==null||E.remove("nc-roster-over"),(O=(F=C==null?void 0:C.source)==null?void 0:F.classList)==null||O.remove("nc-roster-dragging"),p.current&&cancelAnimationFrame(p.current),p.current=0},y=(C=!1)=>{const R=h.current;if(!R)return;const E=R.target;S(),h.current=null,v(!1);try{R.handle.releasePointerCapture(R.pointerId)}catch{}C&&E&&E!==t&&a(t,E)&&s(t,E)},b=(C,R)=>{var Z,G,Q,B,I,j,T,L,$;const E=h.current;if(!E)return;E.x=C,E.y=R;const F=u==="node"?"[data-node-order-key]":"[data-roster-key][data-position]",O=(G=(Z=document.elementFromPoint(C,R))==null?void 0:Z.closest)==null?void 0:G.call(Z,F),q=u==="node"?(Q=O==null?void 0:O.dataset)==null?void 0:Q.nodeOrderKey:(B=O==null?void 0:O.dataset)==null?void 0:B.rosterKey,z=(u==="node"||((I=O==null?void 0:O.dataset)==null?void 0:I.position)===e)&&q&&q!==t&&a(t,q);E.over!==(z?O:null)&&((T=(j=E.over)==null?void 0:j.classList)==null||T.remove("nc-roster-over"),E.over=z?O:null,($=(L=E.over)==null?void 0:L.classList)==null||$.add("nc-roster-over")),E.target=z?q:null},w=()=>{const C=h.current;if(!C){p.current=0;return}const R=C.container;if(R){const E=R.getBoundingClientRect(),F=C.y<E.top+Lg?-Ag:C.y>E.bottom-Lg?Ag:0;F&&(R.scrollTop+=F,b(C.x,C.y))}p.current=requestAnimationFrame(w)};N.useEffect(()=>{const C=E=>{E.key==="Escape"&&h.current&&(E.preventDefault(),y(!1))},R=()=>y(!1);return window.addEventListener("keydown",C),window.addEventListener("blur",R),()=>{window.removeEventListener("keydown",C),window.removeEventListener("blur",R),S(),h.current=null}},[t,e,u]);const k=C=>{var O;if(C.pointerType==="mouse"&&C.button!==0)return;C.preventDefault(),C.stopPropagation(),C.currentTarget.focus({preventScroll:!0});const R=u==="node"?"[data-node-order-key]":"[data-roster-key][data-position]",E=C.currentTarget.closest(R),F=C.currentTarget.closest(".nc-side-scroll, .nc-home-scroll, .nc-cell-switcher-list");h.current={pointerId:C.pointerId,handle:C.currentTarget,source:E,container:F,target:null,over:null,x:C.clientX,y:C.clientY},(O=E==null?void 0:E.classList)==null||O.add("nc-roster-dragging");try{C.currentTarget.setPointerCapture(C.pointerId)}catch{}v(!0),p.current=requestAnimationFrame(w)};return c.jsx("button",{type:"button",className:`nc-roster-handle${m?" active":""}`,"aria-label":`${f("reorder")} ${n}`,"aria-keyshortcuts":"ArrowUp ArrowDown",title:f("reorder-help"),onClick:C=>{C.preventDefault(),C.stopPropagation()},onDragStart:C=>C.preventDefault(),onKeyDown:C=>{C.key!=="ArrowUp"&&C.key!=="ArrowDown"||(C.preventDefault(),C.stopPropagation(),o(C.key==="ArrowUp"?-1:1))},onPointerDown:k,onPointerMove:C=>{!h.current||C.pointerId!==h.current.pointerId||(C.preventDefault(),C.stopPropagation(),b(C.clientX,C.clientY))},onPointerUp:C=>{!h.current||C.pointerId!==h.current.pointerId||(C.preventDefault(),C.stopPropagation(),y(!0))},onPointerCancel:()=>y(!1),onLostPointerCapture:()=>{h.current&&y(!1)},children:"↕"})}const sf="nc_pins";function px(){try{const e=JSON.parse(localStorage.getItem(sf));return Array.isArray(e)?e:[]}catch{return[]}}function mx(e,t){const n=e.includes(t)?e.filter(s=>s!==t):[...e,t];try{localStorage.setItem(sf,JSON.stringify(n))}catch{}return n}function gx(e,t,n){if(!e.includes(t)||!e.includes(n)||t===n)return e;const s=[...e],o=s.indexOf(t),a=s.indexOf(n);s.splice(o,1);const u=s.indexOf(n);s.splice(o<a?u+1:u,0,t);try{localStorage.setItem(sf,JSON.stringify(s))}catch{}return s}function vx(e,t,n){const s=e.indexOf(t);return[s===-1?1e9:s,-(n||0)]}function _x(e,t){return e[0]-t[0]||e[1]-t[1]}function rf(){const[e,t]=N.useState(px),[n,s]=N.useState(ox),[o,a]=N.useState(ix),u=y=>t(b=>mx(b,y)),h=y=>Eg(n,y),p=(y,b)=>s(w=>{const k={...w,[y]:{...Eg(w,y),...b}};return ax(k)}),m=(y,b)=>e.includes(y)===e.includes(b);function v(y,b,w,k){const C=e.includes(b),R=e.includes(w);if(C===R){if(C){t(E=>gx(E,b,w));return}a(E=>{var q;const F=((q=k.find(Y=>Y.key===b))==null?void 0:q.technical)===!0,O=gs(k,e,F?"technical":"all",Fi(E,y)).map(Y=>Y.key);return sx(rx(E,y,b,w,O))})}}function S(y,b,w,k){var q;const C=((q=k.find(Y=>Y.key===b))==null?void 0:q.technical)===!0,R=e.includes(b),E=gs(k,e,C?"technical":"all",Fi(o,y)).map(Y=>Y.key).filter(Y=>e.includes(Y)===R),F=E.indexOf(b),O=E[F+w];F>=0&&O&&v(y,b,O,k)}return{pins:e,views:n,orders:o,togglePin:u,viewFor:h,updateView:p,canMoveRoster:m,moveRoster:v,stepRoster:S}}const fy="nc_node_order_v1",yx=/^[a-f0-9]{16,64}$/;function qs(e){if(yx.test(String((e==null?void 0:e.instanceId)||"")))return`id:${e.instanceId}`;const t=Array.isArray(e==null?void 0:e.route)?e.route.filter(n=>typeof n=="string"&&n):[];return t.length?`route:${t.map(encodeURIComponent).join("/")}`:typeof(e==null?void 0:e.name)=="string"&&e.name?`name:${encodeURIComponent(e.name)}`:""}function Tg(e=globalThis.localStorage){try{const t=JSON.parse(e.getItem(fy));return Array.isArray(t)?[...new Set(t.filter(n=>typeof n=="string"&&n&&n.length<=192))].slice(0,128):[]}catch{return[]}}function wx(e,t=globalThis.localStorage){try{t.setItem(fy,JSON.stringify(e))}catch{}return e}function Dg(e=[],t=[]){const n=new Map(t.map((s,o)=>[s,o]));return e.map((s,o)=>({group:s,index:o})).sort((s,o)=>{const a=n.has(qs(s.group))?n.get(qs(s.group)):Number.MAX_SAFE_INTEGER,u=n.has(qs(o.group))?n.get(qs(o.group)):Number.MAX_SAFE_INTEGER;return a-u||s.index-o.index}).map(({group:s})=>s)}function bx(e,t,n,s=[]){if(!t||!n||t===n)return e;const o=s.map(qs).filter(Boolean);if(!o.includes(t)||!o.includes(n))return e;const a=[...e.filter(m=>o.includes(m)),...o.filter(m=>!e.includes(m))],u=a.indexOf(t),h=a.indexOf(n);a.splice(u,1);const p=a.indexOf(n);return a.splice(u<h?p+1:p,0,t),a}const qd="nexuscrew-node-preferences";function Sx(){try{window.dispatchEvent(new Event(qd))}catch{}}function py(){const[e,t]=N.useState(Tg);N.useEffect(()=>{const a=()=>t(Tg());return window.addEventListener("storage",a),window.addEventListener(qd,a),()=>{window.removeEventListener("storage",a),window.removeEventListener(qd,a)}},[]);const n=a=>Dg(a,e),s=(a,u,h)=>t(p=>{const m=bx(p,a,u,h);return wx(m),Sx(),m});return{order:e,groupsFor:n,moveNode:s,stepNode:(a,u,h)=>{const p=Dg(h,e).map(qs),m=p.indexOf(a),v=p[m+u];m>=0&&v&&s(a,v,h)},nodeKey:qs}}function Dr(e,t=Math.floor(Date.now()/1e3)){if(!e)return"";const n=t-e;return n<0||n<60?"ora":n<3600?`${Math.floor(n/60)}m`:n<86400?`${Math.floor(n/3600)}h`:`${Math.floor(n/86400)}g`}function Bi(e){return e.status==="passive"?f("node-passive"):e.status==="down"?e.downSince?f("tunnel-down-since").replace("{t}",Dr(e.downSince)):f("tunnel-down"):e.status==="unreachable"?f("node-unreachable"):e.status==="offline"?e.lastSeen?f("node-offline-seen").replace("{t}",Dr(e.lastSeen)):f("node-offline"):e.status==="needs-repair"?f("node-needs-repair"):""}function my(e,{passive:t=null}={}){return e?e.status==="passive"?t:e.status==="healthy"?"on":"warn":null}function qo(e){return e&&(e.detail||e.status)||""}function zl(e,t,n=globalThis.localStorage){if(!(e!=null&&e.outbox)||e.outbox.count<1)return!1;const s=Number(n.getItem(X_(t))||0);return e.outbox.latest>s}function of(e,t={}){const n=e||{};if(!n.tmux){const s=`${n.engine||""}${n.key?`·${n.key}`:""}`,o=[s,n.model&&n.model!==s?n.model:""].filter(Boolean).join(" · ");return{working:!1,subtitle:String(o||f("cell-off")).trim()}}if(t.working===!0){const s=f("cell-working"),o=String(t.status||"").trim();return{working:!0,subtitle:!o||/^working(?:\.{3}|…)?$/i.test(o)?s:`${s} · ${o}`}}return t.working===!1?{working:!1,subtitle:f("cell-idle")}:{working:!1,subtitle:String(t.preview||n.preview||f("cell-on")).trim()}}function gy(e,t){return[...new Set([e.engine,e.model,e.key,t.preview,e.preview,t.status].filter(Boolean).map(String))].join(" ")}function af(e,t,n,s=globalThis.localStorage){return[...(Array.isArray(e)?e:[]).map(o=>{const a=n.get(o.tmuxSession)||{},u=Go([],o.tmuxSession),h=of(o,a);return{type:"cell",value:o,key:u,label:o.cell,live:!!o.tmux,fresh:zl(a,u,s),activity:a.activity||0,working:h.working,subtitle:h.subtitle,searchText:gy(o,a)}}),...(Array.isArray(t)?t:[]).map(o=>{const a=Go([],o.name);return{type:"session",value:o,key:a,label:o.name,live:!0,technical:o.technical===!0,fresh:zl(o,a,s),activity:o.activity||0,searchText:`${o.preview||""} ${o.cmd||""}`}})]}function Fl(e,t=globalThis.localStorage){const n=e||{},s=Array.isArray(n.route)?n.route:[],o=new Map((n.sessions||[]).map(u=>[u.name,u])),a=[...(n.cells||[]).map(u=>{const h=o.get(u.tmuxSession)||{},p=Go(s,u.tmuxSession||u.cell),m=of(u,h);return{type:"cell",value:u,key:p,label:u.cell,live:!!u.tmux,fresh:zl(h,p,t),activity:h.activity||u.activity||0,working:m.working,subtitle:m.subtitle,searchText:gy(u,h)}}),...(n.unmanaged||[]).map(u=>{const h=Go(s,u.name);return{type:"session",value:u,key:h,label:u.name,live:!0,technical:u.technical===!0,fresh:zl(u,h,t),activity:u.activity||0,searchText:`${u.preview||""} ${u.cmd||""}`}})];return{route:s,rawItems:a}}const lf=9,$l=.2,xx=/^[a-z0-9-]{1,32}(?:\/[a-z0-9-]{1,32}){0,3}$/,Mr=/^[a-f0-9]{16,64}$/,Vd=e=>xx.test(e)&&new Set(e.split("/")).size===e.split("/").length;function ys(e){if(typeof e=="string"&&e){const t=e.indexOf(":");if(t<0)return{session:e};const n=e.slice(0,t),s=e.slice(t+1);return!Vd(n)||!s?null:{session:s,node:n}}if(e&&typeof e=="object"&&typeof e.session=="string"&&e.session){const t=e.ownerId===void 0?void 0:typeof e.ownerId=="string"&&Mr.test(e.ownerId)?e.ownerId:null;return t===null?null:e.node===void 0||e.node===null||e.node===""?{session:e.session,...t?{ownerId:t}:{}}:typeof e.node=="string"&&Vd(e.node)?{session:e.session,node:e.node,...t?{ownerId:t}:{}}:null}return null}function $n(e){const t=ys(e);return t?t.node?`${t.node}:${t.session}`:t.session:""}const vy=9,_y=24,ta=11,kx=e=>{const t=Number(e);return t>=vy&&t<=_y?t:ta};function Lr(){return{columns:[]}}function ki(e){return e.columns.flatMap(t=>t.tiles.map(n=>$n(n)))}function Cx(e){const t=[],n=Math.max(0,...e.columns.map(s=>s.tiles.length));for(let s=0;s<n;s+=1)for(const o of e.columns)o.tiles[s]&&t.push($n(o.tiles[s]));return t}const Fr=e=>({columns:e.columns.map(t=>({width:t.width,tiles:t.tiles.map(n=>({...n}))}))});function cf(e,t,n,s){const o=ys(t);if(!o||ki(e).includes($n(o))||ki(e).length>=lf)return e;const a=Fr(e),u={session:o.session,height:1,fontSize:ta,...s||{}};if(o.node&&(u.node=o.node),o.ownerId&&(u.ownerId=o.ownerId),n==="end")return a.columns.push({width:1,tiles:[u]}),a;if(n&&typeof n.col=="number"&&typeof n.row=="number"&&a.columns[n.col])return a.columns[n.col].tiles.splice(n.row,0,u),a;if(n&&typeof n.col=="number"){const h=Math.max(0,Math.min(a.columns.length,n.col));return a.columns.splice(h,0,{width:1,tiles:[u]}),a}return a.columns.push({width:1,tiles:[u]}),a}function yy(e,t){const n=$n(t);if(!n||ki(e).includes(n)||ki(e).length>=lf)return e;const s=ki(e).length+1,o=Math.ceil(Math.sqrt(s));if(e.columns.length>=o){let v=0;for(let S=1;S<e.columns.length;S+=1)e.columns[S].tiles.length<e.columns[v].tiles.length&&(v=S);return cf(e,t,{col:v,row:e.columns[v].tiles.length})}const a=[...Cx(e),n],u=new Map(e.columns.flatMap(v=>v.tiles.map(S=>[$n(S),S]))),h=ys(t),p=e.columns.length?e.columns.reduce((v,S)=>v+(Number(S.width)||1),0)/e.columns.length:1,m=Array.from({length:o},(v,S)=>{var y;return{width:((y=e.columns[S])==null?void 0:y.width)||p,tiles:[]}});return a.forEach((v,S)=>{const y=ys(v);if(!y)return;const b=u.get(v)||(v===n?h:{})||{},w={session:y.session,height:b.height||1,fontSize:b.fontSize||ta};y.node&&(w.node=y.node),b.ownerId&&(w.ownerId=b.ownerId),b.unavailable===!0&&(w.unavailable=!0),m[S%o].tiles.push(w)}),{columns:m.filter(v=>v.tiles.length)}}function Hl(e,t){const n=$n(t),s=Fr(e);for(const o of s.columns)o.tiles=o.tiles.filter(a=>$n(a)!==n);return s.columns=s.columns.filter(o=>o.tiles.length>0),s}function Ex(e,t,n){const s=$n(t);if(!ki(e).includes(s))return e;const o=e.columns.flatMap(a=>a.tiles).find(a=>$n(a)===s);return cf(Hl(e,s),s,n,{fontSize:o.fontSize,height:o.height,...o.ownerId?{ownerId:o.ownerId}:{},...o.unavailable===!0?{unavailable:!0}:{}})}function Nx(e,t){if(!(t instanceof Map)||t.size===0)return e;let n=!1;const s=Fr(e);for(const o of s.columns)for(const a of o.tiles){const u=t.get($n(a));if(!u)continue;const h=ys(u);h&&(a.session=h.session,h.node?a.node=h.node:delete a.node,h.ownerId&&(a.ownerId=h.ownerId),n=!0)}return n?Ys(s):e}function jx(e,t,n){const s=Fr(e);return s.columns[t]&&(s.columns[t].width=Math.max($l,Number(n)||1)),s}function Rx(e,t,n,s){const o=Fr(e),a=o.columns[t]&&o.columns[t].tiles[n];return a&&(a.height=Math.max($l,Number(s)||1)),o}function Px(e,t,n,s){if(!(e.columns[t]&&e.columns[t].tiles[n]))return e;const a=Fr(e),u=a.columns[t].tiles[n],h=Number(u.fontSize)||ta;return u.fontSize=Math.max(vy,Math.min(_y,h+(Number(s)||0))),a}function Lx(e,t,n,s){const o=e.columns[t];if(!o||!o.tiles[n])return null;switch(s){case"left":return{col:t};case"right":return{col:t+1};case"top":return{col:t,row:n};case"bottom":return{col:t,row:n+1};default:return null}}function Mg(e){for(const t of[.25,.5,.75])if(Math.abs(e-t)<=.03)return t;return e}function Ys(e){if(!e||!Array.isArray(e.columns))return Lr();const t=e.columns.map(s=>({width:Math.max($l,Number(s&&s.width)||1),tiles:(Array.isArray(s&&s.tiles)?s.tiles:[]).filter(o=>o&&typeof o.session=="string"&&o.session).filter(o=>o.node==null||typeof o.node=="string"&&Vd(o.node)).filter(o=>o.ownerId==null||typeof o.ownerId=="string"&&Mr.test(o.ownerId)).map(o=>{const a={session:o.session,height:Math.max($l,Number(o.height)||1),fontSize:kx(o.fontSize)};return o.node!=null&&(a.node=o.node),o.ownerId!=null&&(a.ownerId=o.ownerId),o.unavailable===!0&&(a.unavailable=!0),a})})).filter(s=>s.tiles.length>0),n=new Set;for(const s of t)s.tiles=s.tiles.filter(o=>!n.has($n(o))&&n.add($n(o))&&n.size<=lf);return{columns:t.filter(s=>s.tiles.length>0)}}const wy=/^[a-z0-9-]{1,32}$/,Ax=/^[A-Za-z0-9._-]{1,32}$/,Tx=/^[A-Za-z0-9][A-Za-z0-9._-]{0,254}$/,Dx=320;function Yd(e){return typeof e=="string"&&wy.test(e)}const Mx=64;function Ir(e){if(typeof e!="string")return!1;const t=e.trim();return t.length>0&&t.length<=Mx&&!/[\x00-\x1f\x7f]/.test(t)}function vs(e){return String(e??"").normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32).replace(/-+$/g,"")||"node"}function by(e){if(typeof e!="string"||!e||e.length>Dx||e.startsWith("-")||/[\0-\x20\x7f]/.test(e))return!1;if(!e.includes("@"))return/^[A-Za-z0-9][A-Za-z0-9._:-]{0,254}$/.test(e);const t=e.indexOf("@");return t<=0||t!==e.lastIndexOf("@")?!1:Ax.test(e.slice(0,t))&&Tx.test(e.slice(t+1))}function Ig(e){if(e===""||e===null||e===void 0)return null;const t=String(e).trim();if(!/^[0-9]{1,5}$/.test(t))return;const n=Number(t);return Number.isInteger(n)&&n>=1&&n<=65535?n:void 0}function Ix({name:e,ssh:t,sshPort:n,remotePort:s}={}){const o=typeof e=="string"?e.trim():e,a=typeof t=="string"?t.trim():t;if(!Yd(o))return{ok:!1,error:"err-node-name"};if(!by(a))return{ok:!1,error:"err-ssh"};const u=Ig(n);if(u===void 0)return{ok:!1,error:"err-ssh-port"};const h=Ig(s);if(h===void 0)return{ok:!1,error:"err-node-port"};const p={name:o,ssh:a};return u!==null&&(p.sshPort=u),h!==null&&(p.remotePort=h),{ok:!0,value:p}}function Ox(e,t){if(!e||!t||t<e)return null;const n=Math.floor((t-e)/1e3);return n<60?"ora":n<3600?`${Math.floor(n/60)}m`:n<86400?`${Math.floor(n/3600)}h`:`${Math.floor(n/86400)}g`}function Gd(e,t){const n=!!(e&&e.status==="up"),s=!!(e&&e.status==="passive");return{up:n,...s?{passive:!0}:{},label:n?"tunnel-up":s?"node-passive":"tunnel-down",since:n?Ox(e.since,t):null}}const Bx=new Set(["v","instanceId","port","label","invite"]),zx=new Set(["v","instanceId","port","label","invite","name","ssh","sshPort"]);function Fx(e){const t=String(e).replace(/-/g,"+").replace(/_/g,"/"),n=t+"=".repeat((4-t.length%4)%4),s=typeof atob=="function"?atob(n):Buffer.from(n,"base64").toString("binary"),o=Uint8Array.from(s,a=>a.charCodeAt(0));return typeof TextDecoder<"u"?new TextDecoder().decode(o):Buffer.from(o).toString("utf8")}function $x(e){let t="";try{const u=new URL(String(e));t=new URLSearchParams(u.hash.replace(/^#/,"")).get("pair")||""}catch{return{ok:!1}}if(!t)return{ok:!1};let n;try{n=JSON.parse(Fx(t))}catch{return{ok:!1}}if(!n||typeof n!="object"||Array.isArray(n))return{ok:!1};const s=n.v===1?Bx:n.v===2?zx:null;if(!s)return{ok:!1};for(const u of Object.keys(n))if(!s.has(u))return{ok:!1};if(!/^[a-f0-9]{16,64}$/.test(String(n.instanceId)))return{ok:!1};const o=Number(n.port);if(!Number.isInteger(o)||o<1||o>65535)return{ok:!1};if(typeof n.label!="string")return{ok:!1};if(typeof n.invite!="string"||!n.invite)return{ok:!1};const a={ok:!0,version:n.v,label:n.label,invite:n.invite,instanceId:n.instanceId,port:o};if(n.v===2){if(n.name!==void 0){if(typeof n.name!="string"||!wy.test(n.name))return{ok:!1};a.name=n.name}if(n.ssh!==void 0){if(!by(n.ssh))return{ok:!1};a.ssh=String(n.ssh).trim()}if(n.sshPort!==void 0){const u=Number(n.sshPort);if(!Number.isInteger(u)||u<1||u>65535)return{ok:!1};a.sshPort=u}}return a}function Hx(e,t,n=new Set){if(!t||!t.ok)return e;const s={...e},o=(a,u)=>{u==null||u===""||n.has(a)||(s[a]=u)};return o("label",t.label),t.version===2&&(o("name",t.name||(t.ssh?vs(t.label):"")),o("ssh",t.ssh),t.sshPort!==void 0&&o("sshPort",String(t.sshPort))),s}const Ux=["KIMI_AUTH_ACTION_REQUIRED","CLIENT_INTERACTION_REQUIRED"],Wx=["kimi-code-consent-yes","kimi-code-config-custom-api-key","kimi-cli-login","client-terminal-dialog"];function uf(e){const t=e&&typeof e=="object"?e.actionRequired:null;return!t||typeof t!="object"||!Ux.includes(t.code)||!Wx.includes(t.recovery)?null:{code:t.code,recovery:t.recovery,text:f(`fleet-recovery-${t.recovery}`)}}let Xd={sessions:[],cells:[],nodeGroups:[],localNodeId:"",localFresh:!1,refreshedAt:0};function Og(){return Xd}function Sy(e={}){return Xd={sessions:Array.isArray(e.sessions)?e.sessions:[],cells:Array.isArray(e.cells)?e.cells:[],nodeGroups:Array.isArray(e.nodeGroups)?e.nodeGroups:[],localNodeId:typeof e.localNodeId=="string"?e.localNodeId:"",localFresh:e.localFresh===!0,refreshedAt:Number.isFinite(e.refreshedAt)?e.refreshedAt:0},Xd}const kr=(e,t=[])=>`${t.length?t.join("/"):"local"}:${e}`;function Kx({onPick:e,token:t,onSettings:n,onOpenVlSession:s}){const[o,a]=kn(),u=nf(t),[h,p]=N.useState(null),[m,v]=N.useState(null),[S,y]=N.useState(""),[b,w]=N.useState(""),[k,C]=N.useState({bind:"127.0.0.1",port:""}),[R,E]=N.useState(""),[F,O]=N.useState([]),[q,Y]=N.useState([]),[z,Z]=N.useState({}),[G,Q]=N.useState(new Set),[B,I]=N.useState(null),[j,T]=N.useState(null),{pins:L,orders:$,togglePin:W,viewFor:x,updateView:M,canMoveRoster:D,moveRoster:A,stepRoster:K}=rf(),{groupsFor:X,moveNode:se,stepNode:ce,nodeKey:fe}=py(),we=X(u);N.useEffect(()=>{Sy({sessions:h||[],cells:F,nodeGroups:u,localNodeId:R})},[h,F,u,R]),N.useEffect(()=>{const U=new Map;for(const le of F)U.set(kr(le.cell),!!le.boot);for(const le of u){const de=le.route||[le.name];for(const ge of le.cells||[])U.set(kr(ge.cell,de),!!ge.boot)}Z(le=>{let de=!1;const ge={...le};for(const[Le,_e]of Object.entries(le))U.has(Le)&&U.get(Le)===_e&&(delete ge[Le],de=!0);return de?ge:le})},[F,u]);async function me(){try{const le=await(await Ht("/api/sessions",t)).json();le.error?(v(le.error),p([])):(v(null),p(le.sessions||[]))}catch(U){v(String(U)),p([])}try{const U=await ws(t);O(U.available?U.cells||[]:[]),Y(U.available?U.capabilities||[]:[])}catch{O([]),Y([])}}N.useEffect(()=>{me(),Ht("/api/config",t).then(le=>le.json()).then(le=>{w(le.version||""),C({bind:le.bind||"127.0.0.1",port:le.port||""}),E(Mr.test(String(le.instanceId||""))?le.instanceId:"")}).catch(()=>{});const U=setInterval(me,4e3);return()=>clearInterval(U)},[]);async function be(){if(!k.port)return;const U=`http://${k.bind}:${k.port}/#token=${t}`;try{await navigator.clipboard.writeText(U)}catch{}}function $e(U,le,de){const ge=kr(U,le);Z(Le=>({...Le,[ge]:!!de}))}function dt(U,le=[]){const de=kr(U.cell,le);return Object.prototype.hasOwnProperty.call(z,de)?z[de]:!!U.boot}async function Ye(U,le,de=[]){U.stopPropagation();const ge=kr(le.cell,de),Le=!dt(le,de);$e(le.cell,de,Le),Q(_e=>new Set(_e).add(ge));try{await Q_(t,{cell:le.cell,enabled:Le},de),de.length||O(_e=>_e.map(Ee=>Ee.cell===le.cell?{...Ee,boot:Le}:Ee))}catch(_e){Z(Ee=>{const tt={...Ee};return delete tt[ge],tt}),v(String((_e==null?void 0:_e.message)||_e))}finally{Q(_e=>{const Ee=new Set(_e);return Ee.delete(ge),Ee})}}async function De(U){if(!B)return;const{cell:le}=B,de=Array.isArray(B.route)?B.route:[];if(U.action==="up"){const ge=await Gh(t,{cell:le,boot:!!U.boot,...U.engine?{engine:U.engine}:{},...U.model!==void 0?{model:U.model}:{},...U.permissionPolicy?{permissionPolicy:U.permissionPolicy}:{}},de),Le=uf(ge);Le&&v(Le.text),$e(le,de,!!U.boot)}else await Il(t,{cell:le,boot:!!U.boot},de),U.boot&&$e(le,de,!1);me()}async function Pt(U,le=[]){try{await Xh(t,U,le)}catch{return}me()}async function Jt(U,le,de=[]){try{await ey(t,U,le,de)}catch{return}me()}async function Me(U){if(!(!(U!=null&&U.direct)||j)){T(U.name);try{await ef(t,U.name,U.tunnelStatus==="up"?"down":"up")}catch{}T(null)}}async function Et(U){if(!(U!=null&&U.direct))return;const le=window.prompt(f("rename-node-prompt"),U.label||U.name);if(le===null)return;const de=String(le).trim();if(!Ir(de)){window.alert(f("rename-node-invalid"));return}try{await sy(t,U.name,de)}catch(ge){window.alert(String((ge==null?void 0:ge.message)||ge))}}const gt=N.useMemo(()=>new Map((h||[]).map(U=>[U.name,U])),[h]),bt=N.useMemo(()=>new Set(F.map(U=>U.tmuxSession)),[F]),ht=N.useMemo(()=>(h||[]).filter(U=>!bt.has(U.name)),[h,bt]),rt=N.useMemo(()=>af(F,ht,gt),[F,ht,gt]),at=x("local"),ie=N.useMemo(()=>gs(rt,L,at.filter,Fi($,"local")).filter(U=>Ng(U,S)),[rt,L,at.filter,S,$]),xe=we.reduce((U,le)=>U+(le.cells||[]).length+(le.unmanaged||[]).filter(de=>!de.technical).length,0),Ie=gs(rt,L,"all",Fi($,"local")).length+xe,Be=rt.filter(U=>U.live).length+we.reduce((U,le)=>U+Fl(le).rawItems.filter(de=>de.live).length,0),ue=(h||[]).filter(U=>U.attached).length+we.reduce((U,le)=>U+(le.sessions||[]).filter(de=>de.attached).length,0),oe=Math.min(ue,Be),H=k.port?`${k.bind}:${k.port}`:k.bind;function te(U,le=null,de=rt){var Mt,ct;const ge=Array.isArray(le==null?void 0:le.route)?le.route:[],Le=ge.join("/"),_e=Le||"local",Ee=ge.length?le==null?void 0:le.instanceId:R,tt=(Ze,Zt)=>e({session:Ze,...Le?{node:Le}:{},...Mr.test(String(Ee||""))?{ownerId:Ee}:{},...typeof Zt=="string"&&Zt?{cellName:Zt}:{}}),ot=D;if(U.type==="cell"){const Ze=U.value,Zt=ge.length?((le==null?void 0:le.sessions)||[]).find(ft=>ft.name===Ze.tmuxSession):gt.get(Ze.tmuxSession),ni=Ze.degraded?f("cell-degraded"):U.working?U.subtitle:Ze.tmux?f("cell-idle"):f("cell-off"),Wn=ge.length===0||((le==null?void 0:le.capabilities)||[]).includes(Ze.active?"down":"up"),ui=ge.length===0?q.includes("boot"):((le==null?void 0:le.capabilities)||[]).includes("boot"),he=dt(Ze,ge),je=kr(Ze.cell,ge),Ke=`${f(he?"boot-disable":"boot-enable")} ${Ze.cell}`;return c.jsxs("div",{className:"nc-mcard","data-roster-key":U.key,"data-position":_e,children:[c.jsx(bi,{position:_e,itemKey:U.key,label:Ze.cell,canMove:ot,onMove:(ft,vt)=>A(_e,ft,vt,de),onStep:ft=>K(_e,U.key,ft,de)}),c.jsxs("button",{className:"nc-mcard-main",onClick:()=>Ze.tmux&&tt(Ze.tmuxSession,Ze.cell),title:ni,"aria-label":`${Ze.cell}, ${ni}`,children:[c.jsx("span",{className:`dot ${Ze.degraded?"warn":Ze.tmux?`on${U.working?" working":""}`:""}`}),c.jsxs("span",{className:"nc-mcard-text",children:[c.jsx("b",{children:Ze.cell}),c.jsx("small",{title:U.subtitle,children:U.subtitle})]})]}),U.activity?c.jsx("span",{className:"nc-rel",children:Dr(U.activity)}):null,U.fresh&&((Mt=Zt==null?void 0:Zt.outbox)==null?void 0:Mt.count)>0&&c.jsx("span",{className:"nc-badge",title:f("new-files-outbox"),children:Zt.outbox.count}),c.jsx("button",{className:`nc-act pin${L.includes(U.key)?" on":""}`,"aria-label":`${f("pin")} ${Ze.cell}`,title:f("pin"),onClick:()=>W(U.key),children:L.includes(U.key)?"★":"☆"}),ui&&c.jsx("button",{className:`nc-act boot${he?" on":""}`,disabled:G.has(je),onClick:ft=>Ye(ft,Ze,ge),title:Ke,"aria-label":Ke,children:c.jsx(Je,{name:"boot",size:16})}),Wn&&c.jsx("button",{className:`nc-act power${Ze.tmux?" on":""}${Ze.degraded?" warn":""}`,onClick:()=>I(ge.length?{...Ze,boot:he,route:ge,availableEngines:(le==null?void 0:le.engines)||[]}:{...Ze,boot:he}),title:Ze.active?f("power-off"):f("power-on"),"aria-label":`${Ze.active?f("power-off"):f("power-on")} ${Ze.cell}`,children:c.jsx(Je,{name:"power",size:16})})]},U.key)}const Qe=U.value;return c.jsxs("div",{className:"nc-mcard","data-roster-key":U.key,"data-position":_e,children:[c.jsx(bi,{position:_e,itemKey:U.key,label:Qe.name,canMove:ot,onMove:(Ze,Zt)=>A(_e,Ze,Zt,de),onStep:Ze=>K(_e,U.key,Ze,de)}),c.jsxs("button",{className:"nc-mcard-main",onClick:()=>tt(Qe.name),children:[c.jsx("span",{className:Qe.attached?"dot on":"dot"}),c.jsxs("span",{className:"nc-mcard-text",children:[c.jsx("b",{children:Qe.name}),c.jsx("small",{children:Qe.preview?Qe.preview:Qe.cmd?Qe.cmd:f("windows").replace("{n}",String(Qe.windows||0))})]})]}),U.activity?c.jsx("span",{className:"nc-rel",children:Dr(U.activity)}):null,U.fresh&&((ct=Qe.outbox)==null?void 0:ct.count)>0&&c.jsx("span",{className:"nc-badge",title:f("new-files-outbox"),children:Qe.outbox.count}),c.jsx("button",{className:`nc-act pin${L.includes(U.key)?" on":""}`,"aria-label":`${f("pin")} ${Qe.name}`,title:f("pin"),onClick:()=>W(U.key),children:L.includes(U.key)?"★":"☆"}),c.jsx("button",{className:`nc-act technical${Qe.technical?" on":""}`,title:Qe.technical?f("mark-normal"):f("mark-technical"),"aria-label":`${Qe.technical?f("mark-normal"):f("mark-technical")} ${Qe.name}`,onClick:()=>Jt(Qe.name,!Qe.technical,ge),children:"T"}),c.jsx("button",{className:"nc-menu",title:f("terminate"),"aria-label":`${f("terminate")} ${Qe.name}`,onClick:()=>{window.confirm(f("terminate-confirm").replace("{name}",Qe.name))&&Pt(Qe.name,ge)},children:"⋯"})]},U.key)}return c.jsxs("div",{className:"nc-home",children:[c.jsxs("header",{className:"nc-home-head",children:[c.jsxs("div",{className:"nc-wordmark",children:["NexusCrew",c.jsx("span",{className:"nc-cursor"})]}),c.jsxs("div",{className:"nc-home-sub",children:[f("fleet-tmux")," · ",Be," ",f("sessions"),oe>0&&` · ${oe} attached`]}),c.jsxs("span",{className:"nc-head-actions",children:[c.jsx("button",{className:"nc-refresh",onClick:()=>n("nodes",!1),title:f("settings"),children:c.jsx(Je,{name:"gear",size:18})}),c.jsx("button",{className:"nc-refresh",onClick:me,title:f("refresh"),children:c.jsx(Je,{name:"refresh",size:18})})]})]}),c.jsxs("main",{className:"nc-home-scroll",children:[Ie>8&&c.jsx("input",{className:"nc-filter",type:"search",placeholder:f("filter-placeholder"),"aria-label":f("filter-placeholder"),value:S,onChange:U=>y(U.target.value)}),m&&c.jsx("div",{className:"nc-err",children:m}),c.jsxs("section",{className:"nc-group","data-position":"local",children:[c.jsx(Xu,{label:f("position-local"),count:ie.length,state:at,dotClass:"on",onToggle:()=>M("local",{open:!at.open}),onFilter:U=>M("local",{filter:U})}),at.open&&ie.map(U=>te(U,null,rt)),at.open&&h===null&&c.jsx("div",{className:"nc-empty",children:f("loading-fleet")}),at.open&&h!==null&&ie.length===0&&!m&&c.jsx("div",{className:"nc-empty",children:S?f("no-match").replace("{q}",S):f("no-sessions-short")})]}),we.map(U=>{const de=my(U.health,{passive:"warn"})||(U.status==="up"?"on":U.status==="passive"?"":"warn"),ge=U.health?qo(U.health):U.status==="up"?"":Bi(U),_e=(U.route&&U.route.length?U.route:[U.name]).join("/"),Ee=x(_e);if(U.kind==="vl")return c.jsxs("section",{className:"nc-group nc-node-order-wrap","data-position":_e,"data-node-order-key":fe(U),children:[c.jsx(Xu,{label:U.label||U.name,count:U.sessions.length,state:Ee,dotClass:de,dotTitle:ge,detail:U.status==="up"?"":Bi(U),onToggle:()=>M(_e,{open:!Ee.open}),onFilter:ct=>M(_e,{filter:ct})}),U.status==="up"&&Ee.open&&U.sessions.map(ct=>c.jsx("div",{className:"nc-mcard nc-vl-session-row",children:c.jsxs("button",{className:"nc-mcard-main",onClick:()=>s&&s(U.peer),"aria-label":`${U.label||U.name}: ${ct.name}`,children:[c.jsx("span",{className:"dot on"}),c.jsxs("span",{className:"nc-mcard-text",children:[c.jsx("b",{children:ct.name}),c.jsx("small",{children:f("vl-events-title")})]})]})},ct.key)),U.status==="up"&&Ee.open&&U.sessions.length===0&&c.jsx("div",{className:"nc-empty",children:f("no-sessions-short")})]},`nodo-vl-${_e}-${U.name}`);const{rawItems:tt}=Fl(U),ot=gs(tt,L,Ee.filter,Fi($,_e)).filter(ct=>Ng(ct,S)),Qe=U.direct&&U.health&&U.health.managed!==!1?c.jsx("button",{type:"button",className:`nc-act power${U.tunnelStatus==="up"?" on":""}`,disabled:j===U.name,title:U.tunnelStatus==="up"?f("power-off"):f("power-on"),"aria-label":`${U.tunnelStatus==="up"?f("power-off"):f("power-on")} ${U.label||U.name}`,onClick:()=>Me(U),children:c.jsx(Je,{name:"power",size:15})}):null,Mt=c.jsxs("span",{className:"nc-node-actions",children:[c.jsx(bi,{scope:"node",position:"nodes",itemKey:fe(U),label:U.label||U.name,onMove:(ct,Ze)=>se(ct,Ze,u),onStep:ct=>ce(fe(U),ct,u)}),U.direct&&c.jsx("button",{type:"button",className:"nc-node-rename",title:f("rename-node"),"aria-label":`${f("rename-node")} ${U.label||U.name}`,onClick:()=>Et(U),children:"✎"}),Qe]});return c.jsxs("section",{className:"nc-group nc-node-order-wrap","data-position":_e,"data-node-order-key":fe(U),children:[c.jsx(Xu,{label:U.label||U.name,count:ot.length,state:Ee,dotClass:de,dotTitle:ge,detail:U.status==="up"?"":U.health&&qo(U.health)||Bi(U),onToggle:()=>M(_e,{open:!Ee.open}),onFilter:ct=>M(_e,{filter:ct}),onRename:U.direct?()=>Et(U):null,action:Mt}),U.status==="up"&&Ee.open&&ot.map(ct=>te(ct,U,tt)),U.status==="up"&&Ee.open&&ot.length===0&&c.jsx("div",{className:"nc-empty",children:S?f("no-match").replace("{q}",S):f("no-sessions-short")})]},`nodo-${_e}`)}),c.jsxs("footer",{className:"nc-home-foot",onClick:be,title:f("copy-url"),children:[c.jsxs("span",{className:"nc-home-meta",children:[b&&c.jsxs("span",{className:"nc-home-version",children:["v",b]}),c.jsxs("span",{className:"nc-home-endpoint",children:[H," · ",f("ssh-only")]})]}),c.jsx("span",{className:"nc-lang",onClick:U=>U.stopPropagation(),children:uy.map((U,le)=>c.jsxs("span",{children:[le>0&&" · ",c.jsx("button",{className:`nc-lang-btn${o===U?" on":""}`,onClick:()=>a(U),title:U,children:U.toUpperCase()})]},U))})]})]}),c.jsx("button",{className:"nc-fab",onClick:()=>n("fleet",!0),title:f("fleet-new-cell"),"aria-label":f("fleet-new-cell"),children:"+"}),B&&c.jsx(Bl,{cell:B,token:t,route:Array.isArray(B.route)?B.route:[],onConfirm:De,onClose:()=>I(null)})]})}function Xu({label:e,count:t,state:n,dotClass:s="",dotTitle:o="",detail:a="",onToggle:u,onFilter:h,onRename:p=null,action:m=null}){return c.jsxs("div",{className:"nc-mobile-position-head",onContextMenu:p?v=>{v.preventDefault(),p()}:void 0,children:[c.jsxs("button",{type:"button",className:"nc-mobile-position-toggle",onClick:u,"aria-expanded":n.open,"aria-label":`${e} · ${f("node-sessions").replace("{n}",String(t))}`,children:[c.jsx("span",{className:"nc-mobile-chevron","aria-hidden":"true",children:n.open?"⌄":"›"}),c.jsx("span",{className:`dot ${s}`,title:o}),c.jsxs("span",{className:"nc-mobile-position-copy",children:[c.jsx("b",{children:e}),c.jsx("small",{children:a||f("node-sessions").replace("{n}",String(t))})]})]}),c.jsxs("select",{className:"nc-mobile-position-filter",value:n.filter,"aria-label":`${e} · ${f("filter-placeholder")}`,title:f(`view-${n.filter}`),onChange:v=>h(v.target.value),children:[c.jsx("option",{value:"all",children:f("view-all")}),c.jsx("option",{value:"pinned",children:f("view-pinned")}),c.jsx("option",{value:"active",children:f("view-active")}),c.jsx("option",{value:"off",children:f("view-off")}),c.jsx("option",{value:"technical",children:f("view-technical")})]}),m]})}/**
|
|
40
|
+
`+_.stack}return{value:i,source:r,stack:g,digest:null}}function mu(i,r,l){return{value:i,source:null,stack:l??null,digest:r??null}}function gu(i,r){try{console.error(r.value)}catch(l){setTimeout(function(){throw l})}}var AS=typeof WeakMap=="function"?WeakMap:Map;function ym(i,r,l){l=Ti(-1,l),l.tag=3,l.payload={element:null};var d=r.value;return l.callback=function(){Za||(Za=!0,Lu=d),gu(i,r)},l}function wm(i,r,l){l=Ti(-1,l),l.tag=3;var d=i.type.getDerivedStateFromError;if(typeof d=="function"){var g=r.value;l.payload=function(){return d(g)},l.callback=function(){gu(i,r)}}var _=i.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(l.callback=function(){gu(i,r),typeof d!="function"&&(is===null?is=new Set([this]):is.add(this));var P=r.stack;this.componentDidCatch(r.value,{componentStack:P!==null?P:""})}),l}function bm(i,r,l){var d=i.pingCache;if(d===null){d=i.pingCache=new AS;var g=new Set;d.set(r,g)}else g=d.get(r),g===void 0&&(g=new Set,d.set(r,g));g.has(l)||(g.add(l),i=qS.bind(null,i,r,l),r.then(i,i))}function Sm(i){do{var r;if((r=i.tag===13)&&(r=i.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return i;i=i.return}while(i!==null);return null}function xm(i,r,l,d,g){return(i.mode&1)===0?(i===r?i.flags|=65536:(i.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(r=Ti(-1,1),r.tag=2,ts(l,r,1))),l.lanes|=1),i):(i.flags|=65536,i.lanes=g,i)}var TS=O.ReactCurrentOwner,Pn=!1;function bn(i,r,l,d){r.child=i===null?Up(r,null,l,d):mr(r,i.child,l,d)}function km(i,r,l,d,g){l=l.render;var _=r.ref;return vr(r,g),d=au(i,r,l,d,_,g),l=lu(),i!==null&&!Pn?(r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~g,Di(i,r,g)):(jt&&l&&Wc(r),r.flags|=1,bn(i,r,d,g),r.child)}function Cm(i,r,l,d,g){if(i===null){var _=l.type;return typeof _=="function"&&!Bu(_)&&_.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(r.tag=15,r.type=_,Em(i,r,_,d,g)):(i=rl(l.type,null,d,r,r.mode,g),i.ref=r.ref,i.return=r,r.child=i)}if(_=i.child,(i.lanes&g)===0){var P=_.memoizedProps;if(l=l.compare,l=l!==null?l:lo,l(P,d)&&i.ref===r.ref)return Di(i,r,g)}return r.flags|=1,i=as(_,d),i.ref=r.ref,i.return=r,r.child=i}function Em(i,r,l,d,g){if(i!==null){var _=i.memoizedProps;if(lo(_,d)&&i.ref===r.ref)if(Pn=!1,r.pendingProps=d=_,(i.lanes&g)!==0)(i.flags&131072)!==0&&(Pn=!0);else return r.lanes=i.lanes,Di(i,r,g)}return vu(i,r,l,d,g)}function Nm(i,r,l){var d=r.pendingProps,g=d.children,_=i!==null?i.memoizedState:null;if(d.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},yt(br,Bn),Bn|=l;else{if((l&1073741824)===0)return i=_!==null?_.baseLanes|l:l,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:i,cachePool:null,transitions:null},r.updateQueue=null,yt(br,Bn),Bn|=i,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=_!==null?_.baseLanes:l,yt(br,Bn),Bn|=d}else _!==null?(d=_.baseLanes|l,r.memoizedState=null):d=l,yt(br,Bn),Bn|=d;return bn(i,r,g,l),r.child}function jm(i,r){var l=r.ref;(i===null&&l!==null||i!==null&&i.ref!==l)&&(r.flags|=512,r.flags|=2097152)}function vu(i,r,l,d,g){var _=Rn(l)?Rs:gn.current;return _=dr(r,_),vr(r,g),l=au(i,r,l,d,_,g),d=lu(),i!==null&&!Pn?(r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~g,Di(i,r,g)):(jt&&d&&Wc(r),r.flags|=1,bn(i,r,l,g),r.child)}function Rm(i,r,l,d,g){if(Rn(l)){var _=!0;Pa(r)}else _=!1;if(vr(r,g),r.stateNode===null)Ya(i,r),vm(r,l,d),pu(r,l,d,g),d=!0;else if(i===null){var P=r.stateNode,V=r.memoizedProps;P.props=V;var J=P.context,ae=l.contextType;typeof ae=="object"&&ae!==null?ae=Yn(ae):(ae=Rn(l)?Rs:gn.current,ae=dr(r,ae));var Se=l.getDerivedStateFromProps,ke=typeof Se=="function"||typeof P.getSnapshotBeforeUpdate=="function";ke||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(V!==d||J!==ae)&&_m(r,P,d,ae),es=!1;var ye=r.memoizedState;P.state=ye,za(r,d,P,g),J=r.memoizedState,V!==d||ye!==J||jn.current||es?(typeof Se=="function"&&(fu(r,l,Se,d),J=r.memoizedState),(V=es||gm(r,l,V,d,ye,J,ae))?(ke||typeof P.UNSAFE_componentWillMount!="function"&&typeof P.componentWillMount!="function"||(typeof P.componentWillMount=="function"&&P.componentWillMount(),typeof P.UNSAFE_componentWillMount=="function"&&P.UNSAFE_componentWillMount()),typeof P.componentDidMount=="function"&&(r.flags|=4194308)):(typeof P.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=d,r.memoizedState=J),P.props=d,P.state=J,P.context=ae,d=V):(typeof P.componentDidMount=="function"&&(r.flags|=4194308),d=!1)}else{P=r.stateNode,Kp(i,r),V=r.memoizedProps,ae=r.type===r.elementType?V:ri(r.type,V),P.props=ae,ke=r.pendingProps,ye=P.context,J=l.contextType,typeof J=="object"&&J!==null?J=Yn(J):(J=Rn(l)?Rs:gn.current,J=dr(r,J));var Pe=l.getDerivedStateFromProps;(Se=typeof Pe=="function"||typeof P.getSnapshotBeforeUpdate=="function")||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(V!==ke||ye!==J)&&_m(r,P,d,J),es=!1,ye=r.memoizedState,P.state=ye,za(r,d,P,g);var Oe=r.memoizedState;V!==ke||ye!==Oe||jn.current||es?(typeof Pe=="function"&&(fu(r,l,Pe,d),Oe=r.memoizedState),(ae=es||gm(r,l,ae,d,ye,Oe,J)||!1)?(Se||typeof P.UNSAFE_componentWillUpdate!="function"&&typeof P.componentWillUpdate!="function"||(typeof P.componentWillUpdate=="function"&&P.componentWillUpdate(d,Oe,J),typeof P.UNSAFE_componentWillUpdate=="function"&&P.UNSAFE_componentWillUpdate(d,Oe,J)),typeof P.componentDidUpdate=="function"&&(r.flags|=4),typeof P.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof P.componentDidUpdate!="function"||V===i.memoizedProps&&ye===i.memoizedState||(r.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||V===i.memoizedProps&&ye===i.memoizedState||(r.flags|=1024),r.memoizedProps=d,r.memoizedState=Oe),P.props=d,P.state=Oe,P.context=J,d=ae):(typeof P.componentDidUpdate!="function"||V===i.memoizedProps&&ye===i.memoizedState||(r.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||V===i.memoizedProps&&ye===i.memoizedState||(r.flags|=1024),d=!1)}return _u(i,r,l,d,_,g)}function _u(i,r,l,d,g,_){jm(i,r);var P=(r.flags&128)!==0;if(!d&&!P)return g&&Dp(r,l,!1),Di(i,r,_);d=r.stateNode,TS.current=r;var V=P&&typeof l.getDerivedStateFromError!="function"?null:d.render();return r.flags|=1,i!==null&&P?(r.child=mr(r,i.child,null,_),r.child=mr(r,null,V,_)):bn(i,r,V,_),r.memoizedState=d.state,g&&Dp(r,l,!0),r.child}function Pm(i){var r=i.stateNode;r.pendingContext?Ap(i,r.pendingContext,r.pendingContext!==r.context):r.context&&Ap(i,r.context,!1),tu(i,r.containerInfo)}function Lm(i,r,l,d,g){return pr(),Yc(g),r.flags|=256,bn(i,r,l,d),r.child}var yu={dehydrated:null,treeContext:null,retryLane:0};function wu(i){return{baseLanes:i,cachePool:null,transitions:null}}function Am(i,r,l){var d=r.pendingProps,g=Lt.current,_=!1,P=(r.flags&128)!==0,V;if((V=P)||(V=i!==null&&i.memoizedState===null?!1:(g&2)!==0),V?(_=!0,r.flags&=-129):(i===null||i.memoizedState!==null)&&(g|=1),yt(Lt,g&1),i===null)return Vc(r),i=r.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((r.mode&1)===0?r.lanes=1:i.data==="$!"?r.lanes=8:r.lanes=1073741824,null):(P=d.children,i=d.fallback,_?(d=r.mode,_=r.child,P={mode:"hidden",children:P},(d&1)===0&&_!==null?(_.childLanes=0,_.pendingProps=P):_=ol(P,d,0,null),i=zs(i,d,l,null),_.return=r,i.return=r,_.sibling=i,r.child=_,r.child.memoizedState=wu(l),r.memoizedState=yu,i):bu(r,P));if(g=i.memoizedState,g!==null&&(V=g.dehydrated,V!==null))return DS(i,r,P,d,V,g,l);if(_){_=d.fallback,P=r.mode,g=i.child,V=g.sibling;var J={mode:"hidden",children:d.children};return(P&1)===0&&r.child!==g?(d=r.child,d.childLanes=0,d.pendingProps=J,r.deletions=null):(d=as(g,J),d.subtreeFlags=g.subtreeFlags&14680064),V!==null?_=as(V,_):(_=zs(_,P,l,null),_.flags|=2),_.return=r,d.return=r,d.sibling=_,r.child=d,d=_,_=r.child,P=i.child.memoizedState,P=P===null?wu(l):{baseLanes:P.baseLanes|l,cachePool:null,transitions:P.transitions},_.memoizedState=P,_.childLanes=i.childLanes&~l,r.memoizedState=yu,d}return _=i.child,i=_.sibling,d=as(_,{mode:"visible",children:d.children}),(r.mode&1)===0&&(d.lanes=l),d.return=r,d.sibling=null,i!==null&&(l=r.deletions,l===null?(r.deletions=[i],r.flags|=16):l.push(i)),r.child=d,r.memoizedState=null,d}function bu(i,r){return r=ol({mode:"visible",children:r},i.mode,0,null),r.return=i,i.child=r}function Va(i,r,l,d){return d!==null&&Yc(d),mr(r,i.child,null,l),i=bu(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function DS(i,r,l,d,g,_,P){if(l)return r.flags&256?(r.flags&=-257,d=mu(Error(n(422))),Va(i,r,P,d)):r.memoizedState!==null?(r.child=i.child,r.flags|=128,null):(_=d.fallback,g=r.mode,d=ol({mode:"visible",children:d.children},g,0,null),_=zs(_,g,P,null),_.flags|=2,d.return=r,_.return=r,d.sibling=_,r.child=d,(r.mode&1)!==0&&mr(r,i.child,null,P),r.child.memoizedState=wu(P),r.memoizedState=yu,_);if((r.mode&1)===0)return Va(i,r,P,null);if(g.data==="$!"){if(d=g.nextSibling&&g.nextSibling.dataset,d)var V=d.dgst;return d=V,_=Error(n(419)),d=mu(_,d,void 0),Va(i,r,P,d)}if(V=(P&i.childLanes)!==0,Pn||V){if(d=nn,d!==null){switch(P&-P){case 4:g=2;break;case 16:g=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(d.suspendedLanes|P))!==0?0:g,g!==0&&g!==_.retryLane&&(_.retryLane=g,Ai(i,g),li(d,i,g,-1))}return Ou(),d=mu(Error(n(421))),Va(i,r,P,d)}return g.data==="$?"?(r.flags|=128,r.child=i.child,r=VS.bind(null,i),g._reactRetry=r,null):(i=_.treeContext,On=Xi(g.nextSibling),In=r,jt=!0,si=null,i!==null&&(qn[Vn++]=Pi,qn[Vn++]=Li,qn[Vn++]=Ps,Pi=i.id,Li=i.overflow,Ps=r),r=bu(r,d.children),r.flags|=4096,r)}function Tm(i,r,l){i.lanes|=r;var d=i.alternate;d!==null&&(d.lanes|=r),Jc(i.return,r,l)}function Su(i,r,l,d,g){var _=i.memoizedState;_===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:g}:(_.isBackwards=r,_.rendering=null,_.renderingStartTime=0,_.last=d,_.tail=l,_.tailMode=g)}function Dm(i,r,l){var d=r.pendingProps,g=d.revealOrder,_=d.tail;if(bn(i,r,d.children,l),d=Lt.current,(d&2)!==0)d=d&1|2,r.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Tm(i,l,r);else if(i.tag===19)Tm(i,l,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}d&=1}if(yt(Lt,d),(r.mode&1)===0)r.memoizedState=null;else switch(g){case"forwards":for(l=r.child,g=null;l!==null;)i=l.alternate,i!==null&&Fa(i)===null&&(g=l),l=l.sibling;l=g,l===null?(g=r.child,r.child=null):(g=l.sibling,l.sibling=null),Su(r,!1,g,l,_);break;case"backwards":for(l=null,g=r.child,r.child=null;g!==null;){if(i=g.alternate,i!==null&&Fa(i)===null){r.child=g;break}i=g.sibling,g.sibling=l,l=g,g=i}Su(r,!0,l,null,_);break;case"together":Su(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function Ya(i,r){(r.mode&1)===0&&i!==null&&(i.alternate=null,r.alternate=null,r.flags|=2)}function Di(i,r,l){if(i!==null&&(r.dependencies=i.dependencies),Ms|=r.lanes,(l&r.childLanes)===0)return null;if(i!==null&&r.child!==i.child)throw Error(n(153));if(r.child!==null){for(i=r.child,l=as(i,i.pendingProps),r.child=l,l.return=r;i.sibling!==null;)i=i.sibling,l=l.sibling=as(i,i.pendingProps),l.return=r;l.sibling=null}return r.child}function MS(i,r,l){switch(r.tag){case 3:Pm(r),pr();break;case 5:Yp(r);break;case 1:Rn(r.type)&&Pa(r);break;case 4:tu(r,r.stateNode.containerInfo);break;case 10:var d=r.type._context,g=r.memoizedProps.value;yt(Ia,d._currentValue),d._currentValue=g;break;case 13:if(d=r.memoizedState,d!==null)return d.dehydrated!==null?(yt(Lt,Lt.current&1),r.flags|=128,null):(l&r.child.childLanes)!==0?Am(i,r,l):(yt(Lt,Lt.current&1),i=Di(i,r,l),i!==null?i.sibling:null);yt(Lt,Lt.current&1);break;case 19:if(d=(l&r.childLanes)!==0,(i.flags&128)!==0){if(d)return Dm(i,r,l);r.flags|=128}if(g=r.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),yt(Lt,Lt.current),d)break;return null;case 22:case 23:return r.lanes=0,Nm(i,r,l)}return Di(i,r,l)}var Mm,xu,Im,Om;Mm=function(i,r){for(var l=r.child;l!==null;){if(l.tag===5||l.tag===6)i.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===r)break;for(;l.sibling===null;){if(l.return===null||l.return===r)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},xu=function(){},Im=function(i,r,l,d){var g=i.memoizedProps;if(g!==d){i=r.stateNode,Ts(fi.current);var _=null;switch(l){case"input":g=Pt(i,g),d=Pt(i,d),_=[];break;case"select":g=D({},g,{value:void 0}),d=D({},d,{value:void 0}),_=[];break;case"textarea":g=at(i,g),d=at(i,d),_=[];break;default:typeof g.onClick!="function"&&typeof d.onClick=="function"&&(i.onclick=Na)}_e(l,d);var P;l=null;for(ae in g)if(!d.hasOwnProperty(ae)&&g.hasOwnProperty(ae)&&g[ae]!=null)if(ae==="style"){var V=g[ae];for(P in V)V.hasOwnProperty(P)&&(l||(l={}),l[P]="")}else ae!=="dangerouslySetInnerHTML"&&ae!=="children"&&ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&ae!=="autoFocus"&&(o.hasOwnProperty(ae)?_||(_=[]):(_=_||[]).push(ae,null));for(ae in d){var J=d[ae];if(V=g!=null?g[ae]:void 0,d.hasOwnProperty(ae)&&J!==V&&(J!=null||V!=null))if(ae==="style")if(V){for(P in V)!V.hasOwnProperty(P)||J&&J.hasOwnProperty(P)||(l||(l={}),l[P]="");for(P in J)J.hasOwnProperty(P)&&V[P]!==J[P]&&(l||(l={}),l[P]=J[P])}else l||(_||(_=[]),_.push(ae,l)),l=J;else ae==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,V=V?V.__html:void 0,J!=null&&V!==J&&(_=_||[]).push(ae,J)):ae==="children"?typeof J!="string"&&typeof J!="number"||(_=_||[]).push(ae,""+J):ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&(o.hasOwnProperty(ae)?(J!=null&&ae==="onScroll"&&xt("scroll",i),_||V===J||(_=[])):(_=_||[]).push(ae,J))}l&&(_=_||[]).push("style",l);var ae=_;(r.updateQueue=ae)&&(r.flags|=4)}},Om=function(i,r,l,d){l!==d&&(r.flags|=4)};function ko(i,r){if(!jt)switch(i.tailMode){case"hidden":r=i.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?i.tail=null:l.sibling=null;break;case"collapsed":l=i.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:d.sibling=null}}function _n(i){var r=i.alternate!==null&&i.alternate.child===i.child,l=0,d=0;if(r)for(var g=i.child;g!==null;)l|=g.lanes|g.childLanes,d|=g.subtreeFlags&14680064,d|=g.flags&14680064,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)l|=g.lanes|g.childLanes,d|=g.subtreeFlags,d|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=d,i.childLanes=l,r}function IS(i,r,l){var d=r.pendingProps;switch(Kc(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _n(r),null;case 1:return Rn(r.type)&&Ra(),_n(r),null;case 3:return d=r.stateNode,_r(),kt(jn),kt(gn),su(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(i===null||i.child===null)&&(Da(r)?r.flags|=4:i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,si!==null&&(Du(si),si=null))),xu(i,r),_n(r),null;case 5:nu(r);var g=Ts(yo.current);if(l=r.type,i!==null&&r.stateNode!=null)Im(i,r,l,d,g),i.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!d){if(r.stateNode===null)throw Error(n(166));return _n(r),null}if(i=Ts(fi.current),Da(r)){d=r.stateNode,l=r.type;var _=r.memoizedProps;switch(d[hi]=r,d[po]=_,i=(r.mode&1)!==0,l){case"dialog":xt("cancel",d),xt("close",d);break;case"iframe":case"object":case"embed":xt("load",d);break;case"video":case"audio":for(g=0;g<uo.length;g++)xt(uo[g],d);break;case"source":xt("error",d);break;case"img":case"image":case"link":xt("error",d),xt("load",d);break;case"details":xt("toggle",d);break;case"input":Jt(d,_),xt("invalid",d);break;case"select":d._wrapperState={wasMultiple:!!_.multiple},xt("invalid",d);break;case"textarea":ie(d,_),xt("invalid",d)}_e(l,_),g=null;for(var P in _)if(_.hasOwnProperty(P)){var V=_[P];P==="children"?typeof V=="string"?d.textContent!==V&&(_.suppressHydrationWarning!==!0&&Ea(d.textContent,V,i),g=["children",V]):typeof V=="number"&&d.textContent!==""+V&&(_.suppressHydrationWarning!==!0&&Ea(d.textContent,V,i),g=["children",""+V]):o.hasOwnProperty(P)&&V!=null&&P==="onScroll"&&xt("scroll",d)}switch(l){case"input":dt(d),gt(d,_,!0);break;case"textarea":dt(d),Ie(d);break;case"select":case"option":break;default:typeof _.onClick=="function"&&(d.onclick=Na)}d=g,r.updateQueue=d,d!==null&&(r.flags|=4)}else{P=g.nodeType===9?g:g.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Be(l)),i==="http://www.w3.org/1999/xhtml"?l==="script"?(i=P.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof d.is=="string"?i=P.createElement(l,{is:d.is}):(i=P.createElement(l),l==="select"&&(P=i,d.multiple?P.multiple=!0:d.size&&(P.size=d.size))):i=P.createElementNS(i,l),i[hi]=r,i[po]=d,Mm(i,r,!1,!1),r.stateNode=i;e:{switch(P=Ee(l,d),l){case"dialog":xt("cancel",i),xt("close",i),g=d;break;case"iframe":case"object":case"embed":xt("load",i),g=d;break;case"video":case"audio":for(g=0;g<uo.length;g++)xt(uo[g],i);g=d;break;case"source":xt("error",i),g=d;break;case"img":case"image":case"link":xt("error",i),xt("load",i),g=d;break;case"details":xt("toggle",i),g=d;break;case"input":Jt(i,d),g=Pt(i,d),xt("invalid",i);break;case"option":g=d;break;case"select":i._wrapperState={wasMultiple:!!d.multiple},g=D({},d,{value:void 0}),xt("invalid",i);break;case"textarea":ie(i,d),g=at(i,d),xt("invalid",i);break;default:g=d}_e(l,g),V=g;for(_ in V)if(V.hasOwnProperty(_)){var J=V[_];_==="style"?ge(i,J):_==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&H(i,J)):_==="children"?typeof J=="string"?(l!=="textarea"||J!=="")&&te(i,J):typeof J=="number"&&te(i,""+J):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(o.hasOwnProperty(_)?J!=null&&_==="onScroll"&&xt("scroll",i):J!=null&&F(i,_,J,P))}switch(l){case"input":dt(i),gt(i,d,!1);break;case"textarea":dt(i),Ie(i);break;case"option":d.value!=null&&i.setAttribute("value",""+me(d.value));break;case"select":i.multiple=!!d.multiple,_=d.value,_!=null?rt(i,!!d.multiple,_,!1):d.defaultValue!=null&&rt(i,!!d.multiple,d.defaultValue,!0);break;default:typeof g.onClick=="function"&&(i.onclick=Na)}switch(l){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}}d&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return _n(r),null;case 6:if(i&&r.stateNode!=null)Om(i,r,i.memoizedProps,d);else{if(typeof d!="string"&&r.stateNode===null)throw Error(n(166));if(l=Ts(yo.current),Ts(fi.current),Da(r)){if(d=r.stateNode,l=r.memoizedProps,d[hi]=r,(_=d.nodeValue!==l)&&(i=In,i!==null))switch(i.tag){case 3:Ea(d.nodeValue,l,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&Ea(d.nodeValue,l,(i.mode&1)!==0)}_&&(r.flags|=4)}else d=(l.nodeType===9?l:l.ownerDocument).createTextNode(d),d[hi]=r,r.stateNode=d}return _n(r),null;case 13:if(kt(Lt),d=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(jt&&On!==null&&(r.mode&1)!==0&&(r.flags&128)===0)Fp(),pr(),r.flags|=98560,_=!1;else if(_=Da(r),d!==null&&d.dehydrated!==null){if(i===null){if(!_)throw Error(n(318));if(_=r.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(n(317));_[hi]=r}else pr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;_n(r),_=!1}else si!==null&&(Du(si),si=null),_=!0;if(!_)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=l,r):(d=d!==null,d!==(i!==null&&i.memoizedState!==null)&&d&&(r.child.flags|=8192,(r.mode&1)!==0&&(i===null||(Lt.current&1)!==0?Yt===0&&(Yt=3):Ou())),r.updateQueue!==null&&(r.flags|=4),_n(r),null);case 4:return _r(),xu(i,r),i===null&&ho(r.stateNode.containerInfo),_n(r),null;case 10:return Qc(r.type._context),_n(r),null;case 17:return Rn(r.type)&&Ra(),_n(r),null;case 19:if(kt(Lt),_=r.memoizedState,_===null)return _n(r),null;if(d=(r.flags&128)!==0,P=_.rendering,P===null)if(d)ko(_,!1);else{if(Yt!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(P=Fa(i),P!==null){for(r.flags|=128,ko(_,!1),d=P.updateQueue,d!==null&&(r.updateQueue=d,r.flags|=4),r.subtreeFlags=0,d=l,l=r.child;l!==null;)_=l,i=d,_.flags&=14680066,P=_.alternate,P===null?(_.childLanes=0,_.lanes=i,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=P.childLanes,_.lanes=P.lanes,_.child=P.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=P.memoizedProps,_.memoizedState=P.memoizedState,_.updateQueue=P.updateQueue,_.type=P.type,i=P.dependencies,_.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),l=l.sibling;return yt(Lt,Lt.current&1|2),r.child}i=i.sibling}_.tail!==null&&Nt()>Sr&&(r.flags|=128,d=!0,ko(_,!1),r.lanes=4194304)}else{if(!d)if(i=Fa(P),i!==null){if(r.flags|=128,d=!0,l=i.updateQueue,l!==null&&(r.updateQueue=l,r.flags|=4),ko(_,!0),_.tail===null&&_.tailMode==="hidden"&&!P.alternate&&!jt)return _n(r),null}else 2*Nt()-_.renderingStartTime>Sr&&l!==1073741824&&(r.flags|=128,d=!0,ko(_,!1),r.lanes=4194304);_.isBackwards?(P.sibling=r.child,r.child=P):(l=_.last,l!==null?l.sibling=P:r.child=P,_.last=P)}return _.tail!==null?(r=_.tail,_.rendering=r,_.tail=r.sibling,_.renderingStartTime=Nt(),r.sibling=null,l=Lt.current,yt(Lt,d?l&1|2:l&1),r):(_n(r),null);case 22:case 23:return Iu(),d=r.memoizedState!==null,i!==null&&i.memoizedState!==null!==d&&(r.flags|=8192),d&&(r.mode&1)!==0?(Bn&1073741824)!==0&&(_n(r),r.subtreeFlags&6&&(r.flags|=8192)):_n(r),null;case 24:return null;case 25:return null}throw Error(n(156,r.tag))}function OS(i,r){switch(Kc(r),r.tag){case 1:return Rn(r.type)&&Ra(),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return _r(),kt(jn),kt(gn),su(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 5:return nu(r),null;case 13:if(kt(Lt),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(n(340));pr()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return kt(Lt),null;case 4:return _r(),null;case 10:return Qc(r.type._context),null;case 22:case 23:return Iu(),null;case 24:return null;default:return null}}var Ga=!1,yn=!1,BS=typeof WeakSet=="function"?WeakSet:Set,Ae=null;function wr(i,r){var l=i.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(d){It(i,r,d)}else l.current=null}function ku(i,r,l){try{l()}catch(d){It(i,r,d)}}var Bm=!1;function zS(i,r){if(Ic=ma,i=gp(),jc(i)){if("selectionStart"in i)var l={start:i.selectionStart,end:i.selectionEnd};else e:{l=(l=i.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var g=d.anchorOffset,_=d.focusNode;d=d.focusOffset;try{l.nodeType,_.nodeType}catch{l=null;break e}var P=0,V=-1,J=-1,ae=0,Se=0,ke=i,ye=null;t:for(;;){for(var Pe;ke!==l||g!==0&&ke.nodeType!==3||(V=P+g),ke!==_||d!==0&&ke.nodeType!==3||(J=P+d),ke.nodeType===3&&(P+=ke.nodeValue.length),(Pe=ke.firstChild)!==null;)ye=ke,ke=Pe;for(;;){if(ke===i)break t;if(ye===l&&++ae===g&&(V=P),ye===_&&++Se===d&&(J=P),(Pe=ke.nextSibling)!==null)break;ke=ye,ye=ke.parentNode}ke=Pe}l=V===-1||J===-1?null:{start:V,end:J}}else l=null}l=l||{start:0,end:0}}else l=null;for(Oc={focusedElem:i,selectionRange:l},ma=!1,Ae=r;Ae!==null;)if(r=Ae,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,Ae=i;else for(;Ae!==null;){r=Ae;try{var Oe=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(Oe!==null){var ze=Oe.memoizedProps,Ft=Oe.memoizedState,ne=r.stateNode,ee=ne.getSnapshotBeforeUpdate(r.elementType===r.type?ze:ri(r.type,ze),Ft);ne.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:var re=r.stateNode.containerInfo;re.nodeType===1?re.textContent="":re.nodeType===9&&re.documentElement&&re.removeChild(re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ce){It(r,r.return,Ce)}if(i=r.sibling,i!==null){i.return=r.return,Ae=i;break}Ae=r.return}return Oe=Bm,Bm=!1,Oe}function Co(i,r,l){var d=r.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var g=d=d.next;do{if((g.tag&i)===i){var _=g.destroy;g.destroy=void 0,_!==void 0&&ku(r,l,_)}g=g.next}while(g!==d)}}function Xa(i,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&i)===i){var d=l.create;l.destroy=d()}l=l.next}while(l!==r)}}function Cu(i){var r=i.ref;if(r!==null){var l=i.stateNode;switch(i.tag){case 5:i=l;break;default:i=l}typeof r=="function"?r(i):r.current=i}}function zm(i){var r=i.alternate;r!==null&&(i.alternate=null,zm(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&(delete r[hi],delete r[po],delete r[$c],delete r[bS],delete r[SS])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Fm(i){return i.tag===5||i.tag===3||i.tag===4}function $m(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Fm(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Eu(i,r,l){var d=i.tag;if(d===5||d===6)i=i.stateNode,r?l.nodeType===8?l.parentNode.insertBefore(i,r):l.insertBefore(i,r):(l.nodeType===8?(r=l.parentNode,r.insertBefore(i,l)):(r=l,r.appendChild(i)),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=Na));else if(d!==4&&(i=i.child,i!==null))for(Eu(i,r,l),i=i.sibling;i!==null;)Eu(i,r,l),i=i.sibling}function Nu(i,r,l){var d=i.tag;if(d===5||d===6)i=i.stateNode,r?l.insertBefore(i,r):l.appendChild(i);else if(d!==4&&(i=i.child,i!==null))for(Nu(i,r,l),i=i.sibling;i!==null;)Nu(i,r,l),i=i.sibling}var hn=null,oi=!1;function ns(i,r,l){for(l=l.child;l!==null;)Hm(i,r,l),l=l.sibling}function Hm(i,r,l){if(en&&typeof en.onCommitFiberUnmount=="function")try{en.onCommitFiberUnmount(Ut,l)}catch{}switch(l.tag){case 5:yn||wr(l,r);case 6:var d=hn,g=oi;hn=null,ns(i,r,l),hn=d,oi=g,hn!==null&&(oi?(i=hn,l=l.stateNode,i.nodeType===8?i.parentNode.removeChild(l):i.removeChild(l)):hn.removeChild(l.stateNode));break;case 18:hn!==null&&(oi?(i=hn,l=l.stateNode,i.nodeType===8?Fc(i.parentNode,l):i.nodeType===1&&Fc(i,l),no(i)):Fc(hn,l.stateNode));break;case 4:d=hn,g=oi,hn=l.stateNode.containerInfo,oi=!0,ns(i,r,l),hn=d,oi=g;break;case 0:case 11:case 14:case 15:if(!yn&&(d=l.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){g=d=d.next;do{var _=g,P=_.destroy;_=_.tag,P!==void 0&&((_&2)!==0||(_&4)!==0)&&ku(l,r,P),g=g.next}while(g!==d)}ns(i,r,l);break;case 1:if(!yn&&(wr(l,r),d=l.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=l.memoizedProps,d.state=l.memoizedState,d.componentWillUnmount()}catch(V){It(l,r,V)}ns(i,r,l);break;case 21:ns(i,r,l);break;case 22:l.mode&1?(yn=(d=yn)||l.memoizedState!==null,ns(i,r,l),yn=d):ns(i,r,l);break;default:ns(i,r,l)}}function Um(i){var r=i.updateQueue;if(r!==null){i.updateQueue=null;var l=i.stateNode;l===null&&(l=i.stateNode=new BS),r.forEach(function(d){var g=YS.bind(null,i,d);l.has(d)||(l.add(d),d.then(g,g))})}}function ai(i,r){var l=r.deletions;if(l!==null)for(var d=0;d<l.length;d++){var g=l[d];try{var _=i,P=r,V=P;e:for(;V!==null;){switch(V.tag){case 5:hn=V.stateNode,oi=!1;break e;case 3:hn=V.stateNode.containerInfo,oi=!0;break e;case 4:hn=V.stateNode.containerInfo,oi=!0;break e}V=V.return}if(hn===null)throw Error(n(160));Hm(_,P,g),hn=null,oi=!1;var J=g.alternate;J!==null&&(J.return=null),g.return=null}catch(ae){It(g,r,ae)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)Wm(r,i),r=r.sibling}function Wm(i,r){var l=i.alternate,d=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(ai(r,i),mi(i),d&4){try{Co(3,i,i.return),Xa(3,i)}catch(ze){It(i,i.return,ze)}try{Co(5,i,i.return)}catch(ze){It(i,i.return,ze)}}break;case 1:ai(r,i),mi(i),d&512&&l!==null&&wr(l,l.return);break;case 5:if(ai(r,i),mi(i),d&512&&l!==null&&wr(l,l.return),i.flags&32){var g=i.stateNode;try{te(g,"")}catch(ze){It(i,i.return,ze)}}if(d&4&&(g=i.stateNode,g!=null)){var _=i.memoizedProps,P=l!==null?l.memoizedProps:_,V=i.type,J=i.updateQueue;if(i.updateQueue=null,J!==null)try{V==="input"&&_.type==="radio"&&_.name!=null&&Me(g,_),Ee(V,P);var ae=Ee(V,_);for(P=0;P<J.length;P+=2){var Se=J[P],ke=J[P+1];Se==="style"?ge(g,ke):Se==="dangerouslySetInnerHTML"?H(g,ke):Se==="children"?te(g,ke):F(g,Se,ke,ae)}switch(V){case"input":Et(g,_);break;case"textarea":xe(g,_);break;case"select":var ye=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!_.multiple;var Pe=_.value;Pe!=null?rt(g,!!_.multiple,Pe,!1):ye!==!!_.multiple&&(_.defaultValue!=null?rt(g,!!_.multiple,_.defaultValue,!0):rt(g,!!_.multiple,_.multiple?[]:"",!1))}g[po]=_}catch(ze){It(i,i.return,ze)}}break;case 6:if(ai(r,i),mi(i),d&4){if(i.stateNode===null)throw Error(n(162));g=i.stateNode,_=i.memoizedProps;try{g.nodeValue=_}catch(ze){It(i,i.return,ze)}}break;case 3:if(ai(r,i),mi(i),d&4&&l!==null&&l.memoizedState.isDehydrated)try{no(r.containerInfo)}catch(ze){It(i,i.return,ze)}break;case 4:ai(r,i),mi(i);break;case 13:ai(r,i),mi(i),g=i.child,g.flags&8192&&(_=g.memoizedState!==null,g.stateNode.isHidden=_,!_||g.alternate!==null&&g.alternate.memoizedState!==null||(Pu=Nt())),d&4&&Um(i);break;case 22:if(Se=l!==null&&l.memoizedState!==null,i.mode&1?(yn=(ae=yn)||Se,ai(r,i),yn=ae):ai(r,i),mi(i),d&8192){if(ae=i.memoizedState!==null,(i.stateNode.isHidden=ae)&&!Se&&(i.mode&1)!==0)for(Ae=i,Se=i.child;Se!==null;){for(ke=Ae=Se;Ae!==null;){switch(ye=Ae,Pe=ye.child,ye.tag){case 0:case 11:case 14:case 15:Co(4,ye,ye.return);break;case 1:wr(ye,ye.return);var Oe=ye.stateNode;if(typeof Oe.componentWillUnmount=="function"){d=ye,l=ye.return;try{r=d,Oe.props=r.memoizedProps,Oe.state=r.memoizedState,Oe.componentWillUnmount()}catch(ze){It(d,l,ze)}}break;case 5:wr(ye,ye.return);break;case 22:if(ye.memoizedState!==null){Vm(ke);continue}}Pe!==null?(Pe.return=ye,Ae=Pe):Vm(ke)}Se=Se.sibling}e:for(Se=null,ke=i;;){if(ke.tag===5){if(Se===null){Se=ke;try{g=ke.stateNode,ae?(_=g.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none"):(V=ke.stateNode,J=ke.memoizedProps.style,P=J!=null&&J.hasOwnProperty("display")?J.display:null,V.style.display=de("display",P))}catch(ze){It(i,i.return,ze)}}}else if(ke.tag===6){if(Se===null)try{ke.stateNode.nodeValue=ae?"":ke.memoizedProps}catch(ze){It(i,i.return,ze)}}else if((ke.tag!==22&&ke.tag!==23||ke.memoizedState===null||ke===i)&&ke.child!==null){ke.child.return=ke,ke=ke.child;continue}if(ke===i)break e;for(;ke.sibling===null;){if(ke.return===null||ke.return===i)break e;Se===ke&&(Se=null),ke=ke.return}Se===ke&&(Se=null),ke.sibling.return=ke.return,ke=ke.sibling}}break;case 19:ai(r,i),mi(i),d&4&&Um(i);break;case 21:break;default:ai(r,i),mi(i)}}function mi(i){var r=i.flags;if(r&2){try{e:{for(var l=i.return;l!==null;){if(Fm(l)){var d=l;break e}l=l.return}throw Error(n(160))}switch(d.tag){case 5:var g=d.stateNode;d.flags&32&&(te(g,""),d.flags&=-33);var _=$m(i);Nu(i,_,g);break;case 3:case 4:var P=d.stateNode.containerInfo,V=$m(i);Eu(i,V,P);break;default:throw Error(n(161))}}catch(J){It(i,i.return,J)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function FS(i,r,l){Ae=i,Km(i)}function Km(i,r,l){for(var d=(i.mode&1)!==0;Ae!==null;){var g=Ae,_=g.child;if(g.tag===22&&d){var P=g.memoizedState!==null||Ga;if(!P){var V=g.alternate,J=V!==null&&V.memoizedState!==null||yn;V=Ga;var ae=yn;if(Ga=P,(yn=J)&&!ae)for(Ae=g;Ae!==null;)P=Ae,J=P.child,P.tag===22&&P.memoizedState!==null?Ym(g):J!==null?(J.return=P,Ae=J):Ym(g);for(;_!==null;)Ae=_,Km(_),_=_.sibling;Ae=g,Ga=V,yn=ae}qm(i)}else(g.subtreeFlags&8772)!==0&&_!==null?(_.return=g,Ae=_):qm(i)}}function qm(i){for(;Ae!==null;){var r=Ae;if((r.flags&8772)!==0){var l=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:yn||Xa(5,r);break;case 1:var d=r.stateNode;if(r.flags&4&&!yn)if(l===null)d.componentDidMount();else{var g=r.elementType===r.type?l.memoizedProps:ri(r.type,l.memoizedProps);d.componentDidUpdate(g,l.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var _=r.updateQueue;_!==null&&Vp(r,_,d);break;case 3:var P=r.updateQueue;if(P!==null){if(l=null,r.child!==null)switch(r.child.tag){case 5:l=r.child.stateNode;break;case 1:l=r.child.stateNode}Vp(r,P,l)}break;case 5:var V=r.stateNode;if(l===null&&r.flags&4){l=V;var J=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&l.focus();break;case"img":J.src&&(l.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var ae=r.alternate;if(ae!==null){var Se=ae.memoizedState;if(Se!==null){var ke=Se.dehydrated;ke!==null&&no(ke)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}yn||r.flags&512&&Cu(r)}catch(ye){It(r,r.return,ye)}}if(r===i){Ae=null;break}if(l=r.sibling,l!==null){l.return=r.return,Ae=l;break}Ae=r.return}}function Vm(i){for(;Ae!==null;){var r=Ae;if(r===i){Ae=null;break}var l=r.sibling;if(l!==null){l.return=r.return,Ae=l;break}Ae=r.return}}function Ym(i){for(;Ae!==null;){var r=Ae;try{switch(r.tag){case 0:case 11:case 15:var l=r.return;try{Xa(4,r)}catch(J){It(r,l,J)}break;case 1:var d=r.stateNode;if(typeof d.componentDidMount=="function"){var g=r.return;try{d.componentDidMount()}catch(J){It(r,g,J)}}var _=r.return;try{Cu(r)}catch(J){It(r,_,J)}break;case 5:var P=r.return;try{Cu(r)}catch(J){It(r,P,J)}}}catch(J){It(r,r.return,J)}if(r===i){Ae=null;break}var V=r.sibling;if(V!==null){V.return=r.return,Ae=V;break}Ae=r.return}}var $S=Math.ceil,Qa=O.ReactCurrentDispatcher,ju=O.ReactCurrentOwner,Xn=O.ReactCurrentBatchConfig,lt=0,nn=null,Wt=null,fn=0,Bn=0,br=Qi(0),Yt=0,Eo=null,Ms=0,Ja=0,Ru=0,No=null,Ln=null,Pu=0,Sr=1/0,Mi=null,Za=!1,Lu=null,is=null,el=!1,ss=null,tl=0,jo=0,Au=null,nl=-1,il=0;function Sn(){return(lt&6)!==0?Nt():nl!==-1?nl:nl=Nt()}function rs(i){return(i.mode&1)===0?1:(lt&2)!==0&&fn!==0?fn&-fn:kS.transition!==null?(il===0&&(il=$f()),il):(i=pt,i!==0||(i=window.event,i=i===void 0?16:Xf(i.type)),i)}function li(i,r,l,d){if(50<jo)throw jo=0,Au=null,Error(n(185));Qr(i,l,d),((lt&2)===0||i!==nn)&&(i===nn&&((lt&2)===0&&(Ja|=l),Yt===4&&os(i,fn)),An(i,d),l===1&<===0&&(r.mode&1)===0&&(Sr=Nt()+500,La&&Zi()))}function An(i,r){var l=i.callbackNode;kb(i,r);var d=ha(i,i===nn?fn:0);if(d===0)l!==null&&Yr(l),i.callbackNode=null,i.callbackPriority=0;else if(r=d&-d,i.callbackPriority!==r){if(l!=null&&Yr(l),r===1)i.tag===0?xS(Xm.bind(null,i)):Mp(Xm.bind(null,i)),yS(function(){(lt&6)===0&&Zi()}),l=null;else{switch(Hf(d)){case 1:l=He;break;case 4:l=Ve;break;case 16:l=qe;break;case 536870912:l=St;break;default:l=qe}l=sg(l,Gm.bind(null,i))}i.callbackPriority=r,i.callbackNode=l}}function Gm(i,r){if(nl=-1,il=0,(lt&6)!==0)throw Error(n(327));var l=i.callbackNode;if(xr()&&i.callbackNode!==l)return null;var d=ha(i,i===nn?fn:0);if(d===0)return null;if((d&30)!==0||(d&i.expiredLanes)!==0||r)r=sl(i,d);else{r=d;var g=lt;lt|=2;var _=Jm();(nn!==i||fn!==r)&&(Mi=null,Sr=Nt()+500,Os(i,r));do try{WS();break}catch(V){Qm(i,V)}while(!0);Xc(),Qa.current=_,lt=g,Wt!==null?r=0:(nn=null,fn=0,r=Yt)}if(r!==0){if(r===2&&(g=hc(i),g!==0&&(d=g,r=Tu(i,g))),r===1)throw l=Eo,Os(i,0),os(i,d),An(i,Nt()),l;if(r===6)os(i,d);else{if(g=i.current.alternate,(d&30)===0&&!HS(g)&&(r=sl(i,d),r===2&&(_=hc(i),_!==0&&(d=_,r=Tu(i,_))),r===1))throw l=Eo,Os(i,0),os(i,d),An(i,Nt()),l;switch(i.finishedWork=g,i.finishedLanes=d,r){case 0:case 1:throw Error(n(345));case 2:Bs(i,Ln,Mi);break;case 3:if(os(i,d),(d&130023424)===d&&(r=Pu+500-Nt(),10<r)){if(ha(i,0)!==0)break;if(g=i.suspendedLanes,(g&d)!==d){Sn(),i.pingedLanes|=i.suspendedLanes&g;break}i.timeoutHandle=zc(Bs.bind(null,i,Ln,Mi),r);break}Bs(i,Ln,Mi);break;case 4:if(os(i,d),(d&4194240)===d)break;for(r=i.eventTimes,g=-1;0<d;){var P=31-Nn(d);_=1<<P,P=r[P],P>g&&(g=P),d&=~_}if(d=g,d=Nt()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*$S(d/1960))-d,10<d){i.timeoutHandle=zc(Bs.bind(null,i,Ln,Mi),d);break}Bs(i,Ln,Mi);break;case 5:Bs(i,Ln,Mi);break;default:throw Error(n(329))}}}return An(i,Nt()),i.callbackNode===l?Gm.bind(null,i):null}function Tu(i,r){var l=No;return i.current.memoizedState.isDehydrated&&(Os(i,r).flags|=256),i=sl(i,r),i!==2&&(r=Ln,Ln=l,r!==null&&Du(r)),i}function Du(i){Ln===null?Ln=i:Ln.push.apply(Ln,i)}function HS(i){for(var r=i;;){if(r.flags&16384){var l=r.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var d=0;d<l.length;d++){var g=l[d],_=g.getSnapshot;g=g.value;try{if(!ii(_(),g))return!1}catch{return!1}}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function os(i,r){for(r&=~Ru,r&=~Ja,i.suspendedLanes|=r,i.pingedLanes&=~r,i=i.expirationTimes;0<r;){var l=31-Nn(r),d=1<<l;i[l]=-1,r&=~d}}function Xm(i){if((lt&6)!==0)throw Error(n(327));xr();var r=ha(i,0);if((r&1)===0)return An(i,Nt()),null;var l=sl(i,r);if(i.tag!==0&&l===2){var d=hc(i);d!==0&&(r=d,l=Tu(i,d))}if(l===1)throw l=Eo,Os(i,0),os(i,r),An(i,Nt()),l;if(l===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=r,Bs(i,Ln,Mi),An(i,Nt()),null}function Mu(i,r){var l=lt;lt|=1;try{return i(r)}finally{lt=l,lt===0&&(Sr=Nt()+500,La&&Zi())}}function Is(i){ss!==null&&ss.tag===0&&(lt&6)===0&&xr();var r=lt;lt|=1;var l=Xn.transition,d=pt;try{if(Xn.transition=null,pt=1,i)return i()}finally{pt=d,Xn.transition=l,lt=r,(lt&6)===0&&Zi()}}function Iu(){Bn=br.current,kt(br)}function Os(i,r){i.finishedWork=null,i.finishedLanes=0;var l=i.timeoutHandle;if(l!==-1&&(i.timeoutHandle=-1,_S(l)),Wt!==null)for(l=Wt.return;l!==null;){var d=l;switch(Kc(d),d.tag){case 1:d=d.type.childContextTypes,d!=null&&Ra();break;case 3:_r(),kt(jn),kt(gn),su();break;case 5:nu(d);break;case 4:_r();break;case 13:kt(Lt);break;case 19:kt(Lt);break;case 10:Qc(d.type._context);break;case 22:case 23:Iu()}l=l.return}if(nn=i,Wt=i=as(i.current,null),fn=Bn=r,Yt=0,Eo=null,Ru=Ja=Ms=0,Ln=No=null,As!==null){for(r=0;r<As.length;r++)if(l=As[r],d=l.interleaved,d!==null){l.interleaved=null;var g=d.next,_=l.pending;if(_!==null){var P=_.next;_.next=g,d.next=P}l.pending=d}As=null}return i}function Qm(i,r){do{var l=Wt;try{if(Xc(),$a.current=Ka,Ha){for(var d=At.memoizedState;d!==null;){var g=d.queue;g!==null&&(g.pending=null),d=d.next}Ha=!1}if(Ds=0,tn=Vt=At=null,wo=!1,bo=0,ju.current=null,l===null||l.return===null){Yt=1,Eo=r,Wt=null;break}e:{var _=i,P=l.return,V=l,J=r;if(r=fn,V.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var ae=J,Se=V,ke=Se.tag;if((Se.mode&1)===0&&(ke===0||ke===11||ke===15)){var ye=Se.alternate;ye?(Se.updateQueue=ye.updateQueue,Se.memoizedState=ye.memoizedState,Se.lanes=ye.lanes):(Se.updateQueue=null,Se.memoizedState=null)}var Pe=Sm(P);if(Pe!==null){Pe.flags&=-257,xm(Pe,P,V,_,r),Pe.mode&1&&bm(_,ae,r),r=Pe,J=ae;var Oe=r.updateQueue;if(Oe===null){var ze=new Set;ze.add(J),r.updateQueue=ze}else Oe.add(J);break e}else{if((r&1)===0){bm(_,ae,r),Ou();break e}J=Error(n(426))}}else if(jt&&V.mode&1){var Ft=Sm(P);if(Ft!==null){(Ft.flags&65536)===0&&(Ft.flags|=256),xm(Ft,P,V,_,r),Yc(yr(J,V));break e}}_=J=yr(J,V),Yt!==4&&(Yt=2),No===null?No=[_]:No.push(_),_=P;do{switch(_.tag){case 3:_.flags|=65536,r&=-r,_.lanes|=r;var ne=ym(_,J,r);qp(_,ne);break e;case 1:V=J;var ee=_.type,re=_.stateNode;if((_.flags&128)===0&&(typeof ee.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(is===null||!is.has(re)))){_.flags|=65536,r&=-r,_.lanes|=r;var Ce=wm(_,V,r);qp(_,Ce);break e}}_=_.return}while(_!==null)}eg(l)}catch(Fe){r=Fe,Wt===l&&l!==null&&(Wt=l=l.return);continue}break}while(!0)}function Jm(){var i=Qa.current;return Qa.current=Ka,i===null?Ka:i}function Ou(){(Yt===0||Yt===3||Yt===2)&&(Yt=4),nn===null||(Ms&268435455)===0&&(Ja&268435455)===0||os(nn,fn)}function sl(i,r){var l=lt;lt|=2;var d=Jm();(nn!==i||fn!==r)&&(Mi=null,Os(i,r));do try{US();break}catch(g){Qm(i,g)}while(!0);if(Xc(),lt=l,Qa.current=d,Wt!==null)throw Error(n(261));return nn=null,fn=0,Yt}function US(){for(;Wt!==null;)Zm(Wt)}function WS(){for(;Wt!==null&&!tr();)Zm(Wt)}function Zm(i){var r=ig(i.alternate,i,Bn);i.memoizedProps=i.pendingProps,r===null?eg(i):Wt=r,ju.current=null}function eg(i){var r=i;do{var l=r.alternate;if(i=r.return,(r.flags&32768)===0){if(l=IS(l,r,Bn),l!==null){Wt=l;return}}else{if(l=OS(l,r),l!==null){l.flags&=32767,Wt=l;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{Yt=6,Wt=null;return}}if(r=r.sibling,r!==null){Wt=r;return}Wt=r=i}while(r!==null);Yt===0&&(Yt=5)}function Bs(i,r,l){var d=pt,g=Xn.transition;try{Xn.transition=null,pt=1,KS(i,r,l,d)}finally{Xn.transition=g,pt=d}return null}function KS(i,r,l,d){do xr();while(ss!==null);if((lt&6)!==0)throw Error(n(327));l=i.finishedWork;var g=i.finishedLanes;if(l===null)return null;if(i.finishedWork=null,i.finishedLanes=0,l===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var _=l.lanes|l.childLanes;if(Cb(i,_),i===nn&&(Wt=nn=null,fn=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||el||(el=!0,sg(qe,function(){return xr(),null})),_=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||_){_=Xn.transition,Xn.transition=null;var P=pt;pt=1;var V=lt;lt|=4,ju.current=null,zS(i,l),Wm(l,i),dS(Oc),ma=!!Ic,Oc=Ic=null,i.current=l,FS(l),ca(),lt=V,pt=P,Xn.transition=_}else i.current=l;if(el&&(el=!1,ss=i,tl=g),_=i.pendingLanes,_===0&&(is=null),dc(l.stateNode),An(i,Nt()),r!==null)for(d=i.onRecoverableError,l=0;l<r.length;l++)g=r[l],d(g.value,{componentStack:g.stack,digest:g.digest});if(Za)throw Za=!1,i=Lu,Lu=null,i;return(tl&1)!==0&&i.tag!==0&&xr(),_=i.pendingLanes,(_&1)!==0?i===Au?jo++:(jo=0,Au=i):jo=0,Zi(),null}function xr(){if(ss!==null){var i=Hf(tl),r=Xn.transition,l=pt;try{if(Xn.transition=null,pt=16>i?16:i,ss===null)var d=!1;else{if(i=ss,ss=null,tl=0,(lt&6)!==0)throw Error(n(331));var g=lt;for(lt|=4,Ae=i.current;Ae!==null;){var _=Ae,P=_.child;if((Ae.flags&16)!==0){var V=_.deletions;if(V!==null){for(var J=0;J<V.length;J++){var ae=V[J];for(Ae=ae;Ae!==null;){var Se=Ae;switch(Se.tag){case 0:case 11:case 15:Co(8,Se,_)}var ke=Se.child;if(ke!==null)ke.return=Se,Ae=ke;else for(;Ae!==null;){Se=Ae;var ye=Se.sibling,Pe=Se.return;if(zm(Se),Se===ae){Ae=null;break}if(ye!==null){ye.return=Pe,Ae=ye;break}Ae=Pe}}}var Oe=_.alternate;if(Oe!==null){var ze=Oe.child;if(ze!==null){Oe.child=null;do{var Ft=ze.sibling;ze.sibling=null,ze=Ft}while(ze!==null)}}Ae=_}}if((_.subtreeFlags&2064)!==0&&P!==null)P.return=_,Ae=P;else e:for(;Ae!==null;){if(_=Ae,(_.flags&2048)!==0)switch(_.tag){case 0:case 11:case 15:Co(9,_,_.return)}var ne=_.sibling;if(ne!==null){ne.return=_.return,Ae=ne;break e}Ae=_.return}}var ee=i.current;for(Ae=ee;Ae!==null;){P=Ae;var re=P.child;if((P.subtreeFlags&2064)!==0&&re!==null)re.return=P,Ae=re;else e:for(P=ee;Ae!==null;){if(V=Ae,(V.flags&2048)!==0)try{switch(V.tag){case 0:case 11:case 15:Xa(9,V)}}catch(Fe){It(V,V.return,Fe)}if(V===P){Ae=null;break e}var Ce=V.sibling;if(Ce!==null){Ce.return=V.return,Ae=Ce;break e}Ae=V.return}}if(lt=g,Zi(),en&&typeof en.onPostCommitFiberRoot=="function")try{en.onPostCommitFiberRoot(Ut,i)}catch{}d=!0}return d}finally{pt=l,Xn.transition=r}}return!1}function tg(i,r,l){r=yr(l,r),r=ym(i,r,1),i=ts(i,r,1),r=Sn(),i!==null&&(Qr(i,1,r),An(i,r))}function It(i,r,l){if(i.tag===3)tg(i,i,l);else for(;r!==null;){if(r.tag===3){tg(r,i,l);break}else if(r.tag===1){var d=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(is===null||!is.has(d))){i=yr(l,i),i=wm(r,i,1),r=ts(r,i,1),i=Sn(),r!==null&&(Qr(r,1,i),An(r,i));break}}r=r.return}}function qS(i,r,l){var d=i.pingCache;d!==null&&d.delete(r),r=Sn(),i.pingedLanes|=i.suspendedLanes&l,nn===i&&(fn&l)===l&&(Yt===4||Yt===3&&(fn&130023424)===fn&&500>Nt()-Pu?Os(i,0):Ru|=l),An(i,r)}function ng(i,r){r===0&&((i.mode&1)===0?r=1:(r=da,da<<=1,(da&130023424)===0&&(da=4194304)));var l=Sn();i=Ai(i,r),i!==null&&(Qr(i,r,l),An(i,l))}function VS(i){var r=i.memoizedState,l=0;r!==null&&(l=r.retryLane),ng(i,l)}function YS(i,r){var l=0;switch(i.tag){case 13:var d=i.stateNode,g=i.memoizedState;g!==null&&(l=g.retryLane);break;case 19:d=i.stateNode;break;default:throw Error(n(314))}d!==null&&d.delete(r),ng(i,l)}var ig;ig=function(i,r,l){if(i!==null)if(i.memoizedProps!==r.pendingProps||jn.current)Pn=!0;else{if((i.lanes&l)===0&&(r.flags&128)===0)return Pn=!1,MS(i,r,l);Pn=(i.flags&131072)!==0}else Pn=!1,jt&&(r.flags&1048576)!==0&&Ip(r,Ta,r.index);switch(r.lanes=0,r.tag){case 2:var d=r.type;Ya(i,r),i=r.pendingProps;var g=dr(r,gn.current);vr(r,l),g=au(null,r,d,i,g,l);var _=lu();return r.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,Rn(d)?(_=!0,Pa(r)):_=!1,r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,eu(r),g.updater=qa,r.stateNode=g,g._reactInternals=r,pu(r,d,i,l),r=_u(null,r,d,!0,_,l)):(r.tag=0,jt&&_&&Wc(r),bn(null,r,g,l),r=r.child),r;case 16:d=r.elementType;e:{switch(Ya(i,r),i=r.pendingProps,g=d._init,d=g(d._payload),r.type=d,g=r.tag=XS(d),i=ri(d,i),g){case 0:r=vu(null,r,d,i,l);break e;case 1:r=Rm(null,r,d,i,l);break e;case 11:r=km(null,r,d,i,l);break e;case 14:r=Cm(null,r,d,ri(d.type,i),l);break e}throw Error(n(306,d,""))}return r;case 0:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),vu(i,r,d,g,l);case 1:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),Rm(i,r,d,g,l);case 3:e:{if(Pm(r),i===null)throw Error(n(387));d=r.pendingProps,_=r.memoizedState,g=_.element,Kp(i,r),za(r,d,null,l);var P=r.memoizedState;if(d=P.element,_.isDehydrated)if(_={element:d,isDehydrated:!1,cache:P.cache,pendingSuspenseBoundaries:P.pendingSuspenseBoundaries,transitions:P.transitions},r.updateQueue.baseState=_,r.memoizedState=_,r.flags&256){g=yr(Error(n(423)),r),r=Lm(i,r,d,l,g);break e}else if(d!==g){g=yr(Error(n(424)),r),r=Lm(i,r,d,l,g);break e}else for(On=Xi(r.stateNode.containerInfo.firstChild),In=r,jt=!0,si=null,l=Up(r,null,d,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(pr(),d===g){r=Di(i,r,l);break e}bn(i,r,d,l)}r=r.child}return r;case 5:return Yp(r),i===null&&Vc(r),d=r.type,g=r.pendingProps,_=i!==null?i.memoizedProps:null,P=g.children,Bc(d,g)?P=null:_!==null&&Bc(d,_)&&(r.flags|=32),jm(i,r),bn(i,r,P,l),r.child;case 6:return i===null&&Vc(r),null;case 13:return Am(i,r,l);case 4:return tu(r,r.stateNode.containerInfo),d=r.pendingProps,i===null?r.child=mr(r,null,d,l):bn(i,r,d,l),r.child;case 11:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),km(i,r,d,g,l);case 7:return bn(i,r,r.pendingProps,l),r.child;case 8:return bn(i,r,r.pendingProps.children,l),r.child;case 12:return bn(i,r,r.pendingProps.children,l),r.child;case 10:e:{if(d=r.type._context,g=r.pendingProps,_=r.memoizedProps,P=g.value,yt(Ia,d._currentValue),d._currentValue=P,_!==null)if(ii(_.value,P)){if(_.children===g.children&&!jn.current){r=Di(i,r,l);break e}}else for(_=r.child,_!==null&&(_.return=r);_!==null;){var V=_.dependencies;if(V!==null){P=_.child;for(var J=V.firstContext;J!==null;){if(J.context===d){if(_.tag===1){J=Ti(-1,l&-l),J.tag=2;var ae=_.updateQueue;if(ae!==null){ae=ae.shared;var Se=ae.pending;Se===null?J.next=J:(J.next=Se.next,Se.next=J),ae.pending=J}}_.lanes|=l,J=_.alternate,J!==null&&(J.lanes|=l),Jc(_.return,l,r),V.lanes|=l;break}J=J.next}}else if(_.tag===10)P=_.type===r.type?null:_.child;else if(_.tag===18){if(P=_.return,P===null)throw Error(n(341));P.lanes|=l,V=P.alternate,V!==null&&(V.lanes|=l),Jc(P,l,r),P=_.sibling}else P=_.child;if(P!==null)P.return=_;else for(P=_;P!==null;){if(P===r){P=null;break}if(_=P.sibling,_!==null){_.return=P.return,P=_;break}P=P.return}_=P}bn(i,r,g.children,l),r=r.child}return r;case 9:return g=r.type,d=r.pendingProps.children,vr(r,l),g=Yn(g),d=d(g),r.flags|=1,bn(i,r,d,l),r.child;case 14:return d=r.type,g=ri(d,r.pendingProps),g=ri(d.type,g),Cm(i,r,d,g,l);case 15:return Em(i,r,r.type,r.pendingProps,l);case 17:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),Ya(i,r),r.tag=1,Rn(d)?(i=!0,Pa(r)):i=!1,vr(r,l),vm(r,d,g),pu(r,d,g,l),_u(null,r,d,!0,i,l);case 19:return Dm(i,r,l);case 22:return Nm(i,r,l)}throw Error(n(156,r.tag))};function sg(i,r){return Ns(i,r)}function GS(i,r,l,d){this.tag=i,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qn(i,r,l,d){return new GS(i,r,l,d)}function Bu(i){return i=i.prototype,!(!i||!i.isReactComponent)}function XS(i){if(typeof i=="function")return Bu(i)?1:0;if(i!=null){if(i=i.$$typeof,i===I)return 11;if(i===L)return 14}return 2}function as(i,r){var l=i.alternate;return l===null?(l=Qn(i.tag,r,i.key,i.mode),l.elementType=i.elementType,l.type=i.type,l.stateNode=i.stateNode,l.alternate=i,i.alternate=l):(l.pendingProps=r,l.type=i.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=i.flags&14680064,l.childLanes=i.childLanes,l.lanes=i.lanes,l.child=i.child,l.memoizedProps=i.memoizedProps,l.memoizedState=i.memoizedState,l.updateQueue=i.updateQueue,r=i.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=i.sibling,l.index=i.index,l.ref=i.ref,l}function rl(i,r,l,d,g,_){var P=2;if(d=i,typeof i=="function")Bu(i)&&(P=1);else if(typeof i=="string")P=5;else e:switch(i){case z:return zs(l.children,g,_,r);case Z:P=8,g|=8;break;case G:return i=Qn(12,l,r,g|2),i.elementType=G,i.lanes=_,i;case j:return i=Qn(13,l,r,g),i.elementType=j,i.lanes=_,i;case T:return i=Qn(19,l,r,g),i.elementType=T,i.lanes=_,i;case W:return ol(l,g,_,r);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case Q:P=10;break e;case B:P=9;break e;case I:P=11;break e;case L:P=14;break e;case $:P=16,d=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return r=Qn(P,l,r,g),r.elementType=i,r.type=d,r.lanes=_,r}function zs(i,r,l,d){return i=Qn(7,i,d,r),i.lanes=l,i}function ol(i,r,l,d){return i=Qn(22,i,d,r),i.elementType=W,i.lanes=l,i.stateNode={isHidden:!1},i}function zu(i,r,l){return i=Qn(6,i,null,r),i.lanes=l,i}function Fu(i,r,l){return r=Qn(4,i.children!==null?i.children:[],i.key,r),r.lanes=l,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}function QS(i,r,l,d,g){this.tag=r,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=fc(0),this.expirationTimes=fc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fc(0),this.identifierPrefix=d,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function $u(i,r,l,d,g,_,P,V,J){return i=new QS(i,r,l,V,J),r===1?(r=1,_===!0&&(r|=8)):r=0,_=Qn(3,null,null,r),i.current=_,_.stateNode=i,_.memoizedState={element:d,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},eu(_),i}function JS(i,r,l){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Y,key:d==null?null:""+d,children:i,containerInfo:r,implementation:l}}function rg(i){if(!i)return Ji;i=i._reactInternals;e:{if(zt(i)!==i||i.tag!==1)throw Error(n(170));var r=i;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(Rn(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(n(171))}if(i.tag===1){var l=i.type;if(Rn(l))return Tp(i,l,r)}return r}function og(i,r,l,d,g,_,P,V,J){return i=$u(l,d,!0,i,g,_,P,V,J),i.context=rg(null),l=i.current,d=Sn(),g=rs(l),_=Ti(d,g),_.callback=r??null,ts(l,_,g),i.current.lanes=g,Qr(i,g,d),An(i,d),i}function al(i,r,l,d){var g=r.current,_=Sn(),P=rs(g);return l=rg(l),r.context===null?r.context=l:r.pendingContext=l,r=Ti(_,P),r.payload={element:i},d=d===void 0?null:d,d!==null&&(r.callback=d),i=ts(g,r,P),i!==null&&(li(i,g,P,_),Ba(i,g,P)),P}function ll(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function ag(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var l=i.retryLane;i.retryLane=l!==0&&l<r?l:r}}function Hu(i,r){ag(i,r),(i=i.alternate)&&ag(i,r)}function ZS(){return null}var lg=typeof reportError=="function"?reportError:function(i){console.error(i)};function Uu(i){this._internalRoot=i}cl.prototype.render=Uu.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(n(409));al(i,r,null,null)},cl.prototype.unmount=Uu.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;Is(function(){al(null,i,null,null)}),r[ji]=null}};function cl(i){this._internalRoot=i}cl.prototype.unstable_scheduleHydration=function(i){if(i){var r=Kf();i={blockedOn:null,target:i,priority:r};for(var l=0;l<Vi.length&&r!==0&&r<Vi[l].priority;l++);Vi.splice(l,0,i),l===0&&Yf(i)}};function Wu(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function ul(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function cg(){}function e0(i,r,l,d,g){if(g){if(typeof d=="function"){var _=d;d=function(){var ae=ll(P);_.call(ae)}}var P=og(r,d,i,0,null,!1,!1,"",cg);return i._reactRootContainer=P,i[ji]=P.current,ho(i.nodeType===8?i.parentNode:i),Is(),P}for(;g=i.lastChild;)i.removeChild(g);if(typeof d=="function"){var V=d;d=function(){var ae=ll(J);V.call(ae)}}var J=$u(i,0,!1,null,null,!1,!1,"",cg);return i._reactRootContainer=J,i[ji]=J.current,ho(i.nodeType===8?i.parentNode:i),Is(function(){al(r,J,l,d)}),J}function dl(i,r,l,d,g){var _=l._reactRootContainer;if(_){var P=_;if(typeof g=="function"){var V=g;g=function(){var J=ll(P);V.call(J)}}al(r,P,i,g)}else P=e0(l,r,i,g,d);return ll(P)}Uf=function(i){switch(i.tag){case 3:var r=i.stateNode;if(r.current.memoizedState.isDehydrated){var l=Xr(r.pendingLanes);l!==0&&(pc(r,l|1),An(r,Nt()),(lt&6)===0&&(Sr=Nt()+500,Zi()))}break;case 13:Is(function(){var d=Ai(i,1);if(d!==null){var g=Sn();li(d,i,1,g)}}),Hu(i,1)}},mc=function(i){if(i.tag===13){var r=Ai(i,134217728);if(r!==null){var l=Sn();li(r,i,134217728,l)}Hu(i,134217728)}},Wf=function(i){if(i.tag===13){var r=rs(i),l=Ai(i,r);if(l!==null){var d=Sn();li(l,i,r,d)}Hu(i,r)}},Kf=function(){return pt},qf=function(i,r){var l=pt;try{return pt=i,r()}finally{pt=l}},Qe=function(i,r,l){switch(r){case"input":if(Et(i,l),r=l.name,l.type==="radio"&&r!=null){for(l=i;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<l.length;r++){var d=l[r];if(d!==i&&d.form===i.form){var g=ja(d);if(!g)throw Error(n(90));Ye(d),Et(d,g)}}}break;case"textarea":xe(i,l);break;case"select":r=l.value,r!=null&&rt(i,!!l.multiple,r,!1)}},Wn=Mu,ui=Is;var t0={usingClientEntryPoint:!1,Events:[mo,cr,ja,Zt,ni,Mu]},Ro={findFiberByHostInstance:js,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},n0={bundleType:Ro.bundleType,version:Ro.version,rendererPackageName:Ro.rendererPackageName,rendererConfig:Ro.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:O.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Es(i),i===null?null:i.stateNode},findFiberByHostInstance:Ro.findFiberByHostInstance||ZS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hl.isDisabled&&hl.supportsFiber)try{Ut=hl.inject(n0),en=hl}catch{}}return Tn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=t0,Tn.createPortal=function(i,r){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Wu(r))throw Error(n(200));return JS(i,r,null,l)},Tn.createRoot=function(i,r){if(!Wu(i))throw Error(n(299));var l=!1,d="",g=lg;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onRecoverableError!==void 0&&(g=r.onRecoverableError)),r=$u(i,1,!1,null,null,l,!1,d,g),i[ji]=r.current,ho(i.nodeType===8?i.parentNode:i),new Uu(r)},Tn.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=Es(r),i=i===null?null:i.stateNode,i},Tn.flushSync=function(i){return Is(i)},Tn.hydrate=function(i,r,l){if(!ul(r))throw Error(n(200));return dl(null,i,r,!0,l)},Tn.hydrateRoot=function(i,r,l){if(!Wu(i))throw Error(n(405));var d=l!=null&&l.hydratedSources||null,g=!1,_="",P=lg;if(l!=null&&(l.unstable_strictMode===!0&&(g=!0),l.identifierPrefix!==void 0&&(_=l.identifierPrefix),l.onRecoverableError!==void 0&&(P=l.onRecoverableError)),r=og(r,null,i,1,l??null,g,!1,_,P),i[ji]=r.current,ho(i),d)for(i=0;i<d.length;i++)l=d[i],g=l._getVersion,g=g(l._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[l,g]:r.mutableSourceEagerHydrationData.push(l,g);return new cl(r)},Tn.render=function(i,r,l){if(!ul(r))throw Error(n(200));return dl(null,i,r,!1,l)},Tn.unmountComponentAtNode=function(i){if(!ul(i))throw Error(n(40));return i._reactRootContainer?(Is(function(){dl(null,null,i,!1,function(){i._reactRootContainer=null,i[ji]=null})}),!0):!1},Tn.unstable_batchedUpdates=Mu,Tn.unstable_renderSubtreeIntoContainer=function(i,r,l,d){if(!ul(l))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return dl(i,r,l,!1,d)},Tn.version="18.3.1-next-f1338f8080-20240426",Tn}var vg;function d0(){if(vg)return Vu.exports;vg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Vu.exports=u0(),Vu.exports}var _g;function h0(){if(_g)return fl;_g=1;var e=d0();return fl.createRoot=e.createRoot,fl.hydrateRoot=e.hydrateRoot,fl}var f0=h0();const p0=Vh(f0);function Ht(e,t,n={}){return fetch(e,{...n,headers:{...n.headers||{},Authorization:`Bearer ${t}`}})}const X_=e=>`nc_seen_${e}`;async function Te(e,t,n={}){const s=await Ht(e,t,{method:n.method||"GET",headers:{"content-type":"application/json"},body:n.body?JSON.stringify(n.body):void 0}),o=await s.json().catch(()=>({}));if(!s.ok){const a=new Error(o.error||`HTTP ${s.status}`);throw a.status=s.status,a.data=o,a}return o}const cn=e=>Array.isArray(e)&&e.length?`/api/route/${e.map(encodeURIComponent).join("/")}/_`:"/api",un=(e,t)=>`${cn(e)}/fleet/${t}`,ws=(e,t)=>Te(un(t,"status"),e),Gh=(e,t,n)=>Te(un(n,"up"),e,{method:"POST",body:t}),Il=(e,t,n)=>Te(un(n,"down"),e,{method:"POST",body:t}),Q_=(e,t,n)=>Te(un(n,"boot"),e,{method:"POST",body:t}),Fo=(e,t,n)=>Te(un(n,"restart"),e,{method:"POST",body:{cell:t}}),Jl=(e,t)=>Te(un(t,"definitions"),e),m0=(e,t)=>Te(un(t,"credentials/status"),e),yg=(e,t,n,s)=>Te(un(s,"credentials/set"),e,{method:"POST",body:{envKey:t,value:n}}),g0=(e,t,n)=>Te(un(n,"credentials/remove"),e,{method:"POST",body:{envKey:t}}),v0=(e,t,n)=>Te(un(n,"define-engine"),e,{method:"POST",body:{def:t}}),_0=(e,t,n,s,o)=>Te(un(o,"edit-engine"),e,{method:"POST",body:{id:t,patch:n,envChanges:s}}),y0=(e,t,n)=>Te(un(n,"remove-engine"),e,{method:"POST",body:{id:t}}),w0=(e,t,n)=>Te(un(n,"define-cell"),e,{method:"POST",body:{def:t}}),J_=(e,t,n,s)=>Te(un(s,"edit-cell"),e,{method:"POST",body:{id:t,patch:n}}),Z_=(e,t,n=!1,s)=>Te(un(s,"remove-cell"),e,{method:"POST",body:{id:t,stop:n}}),b0=(e,t,n)=>Te(un(n,"import-cell"),e,{method:"POST",body:t}),S0=(e,t,n)=>Te(un(n,"restore-cells"),e,{method:"POST",body:{cells:t}}),x0=(e,t,n,s)=>Te(un(s,"restore-engines"),e,{method:"POST",body:{engines:t,overwrite:!!n}}),Xh=(e,t,n)=>Te(`${cn(n)}/sessions/${encodeURIComponent(t)}`,e,{method:"DELETE"}),ey=(e,t,n,s)=>Te(`${cn(s)}/sessions/${encodeURIComponent(t)}/visibility`,e,{method:"PATCH",body:{technical:!!n}}),Qh=(e,t,n)=>Te(`${cn(n)}/fs/dirs${t?`?path=${encodeURIComponent(t)}`:""}`,e),ty=e=>Te("/api/settings",e),k0=e=>Te("/api/nodes",e),C0=e=>Te("/api/peers",e),ny=(e,t=[])=>Te(`${cn(t)}/vl-nodes`,e),wg=(e,t,n,s={},o=[])=>Te(`${cn(o)}/vl-nodes/${encodeURIComponent(t)}/commands`,e,{method:"POST",body:{kind:n,args:s}}),E0=(e,t,n=0,s=[])=>Te(`${cn(s)}/vl-nodes/${encodeURIComponent(t)}/events${n?`?after=${encodeURIComponent(n)}`:""}`,e),iy=e=>Te("/api/topology",e),Jh=(e,t)=>Te(`${cn(t)}/sessions`,e),Zh=(e,t)=>Te(`${cn(t)}/config`,e),bg=(e,t)=>Te(`${cn(t)}/topology`,e),Wd=(e,t)=>Te("/api/settings/config",e,{method:"POST",body:t}),N0=e=>Te("/api/settings/token/rotate",e,{method:"POST"}),j0=(e,t)=>Te("/api/settings/nodes/pair",e,{method:"POST",body:t}),R0=(e,t,n=[])=>Te(`${cn(n)}/settings/peering/invite`,e,{method:"POST",body:t||{}}),sy=(e,t,n)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}/label`,e,{method:"PATCH",body:{label:n}}),P0=e=>Te("/api/settings/node-aliases",e),L0=(e,t,n)=>Te(`/api/settings/node-aliases/${encodeURIComponent(t)}`,e,{method:"PATCH",body:{alias:n}}),Sg=(e,t)=>Te(`/api/settings/node-aliases/${encodeURIComponent(t)}`,e,{method:"DELETE"}),xg=(e,t,n)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}`,e,{method:"PATCH",body:n}),A0=(e,t)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}`,e,{method:"DELETE"}),ef=(e,t,n)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}/${n}`,e,{method:"POST"}),T0=(e,t,n)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}/share`,e,{method:"PATCH",body:{shared:n}}),D0=(e,t,n,s=[])=>Te(`/api/settings/nodes/${encodeURIComponent(t)}/visibility`,e,{method:"PATCH",body:{visibility:n,selected:s}}),M0=e=>Te("/api/settings/audio",e),I0=(e,t)=>Te("/api/settings/audio/consent",e,{method:"PATCH",body:{consent:t}}),O0=e=>Te("/api/settings/audio/test",e,{method:"POST",body:{}}),B0=e=>Te("/api/settings/audio/stop",e,{method:"POST",body:{}}),z0=e=>Te("/api/settings/audio/groups",e),F0=(e,t,n)=>Te(`/api/settings/audio/groups/${encodeURIComponent(t)}`,e,{method:"PUT",body:n}),$0=(e,t)=>Te(`/api/settings/audio/groups/${encodeURIComponent(t)}`,e,{method:"DELETE"}),H0=e=>Te("/api/settings/service/regenerate",e,{method:"POST"}),U0=e=>Te("/api/settings/update/check",e,{method:"POST"}),W0=e=>Te("/api/settings/update/apply",e,{method:"POST"}),Zl=(e,t)=>`${cn(e)}/diagnostics/${t}`,K0=(e,t=[])=>Te(Zl(t,"status"),e),q0=(e,{after:t=0,limit:n=200}={},s=[])=>Te(`${Zl(s,"logs")}?after=${encodeURIComponent(t)}&limit=${encodeURIComponent(n)}`,e),kg=(e,t,n,s=[])=>Te(Zl(s,"verbose"),e,{method:"PATCH",body:{enabled:t,durationSeconds:n}}),V0=(e,t=[])=>Te(Zl(t,"logs"),e,{method:"DELETE"}),Y0=(e,t=!0)=>Te(`/api/asks${t?"?open=1":""}`,e),G0=(e,t,n)=>Te(`/api/asks/${encodeURIComponent(t)}/answer`,e,{method:"POST",body:{text:n}}),X0=(e,t)=>Te(`/api/asks/${encodeURIComponent(t)}`,e,{method:"DELETE"}),pl=(e,t=[])=>Te(`${cn(t)}/decks`,e),Cg=(e,t,n=[])=>Te(`${cn(n)}/decks`,e,{method:"POST",body:{name:t}}),ml=(e,t,n,s,o=[])=>Te(`${cn(o)}/decks/${encodeURIComponent(t)}`,e,{method:"PUT",body:{layout:n,expectedRevision:s}}),Q0=(e,t,n,s,o=[])=>Te(`${cn(o)}/decks/${encodeURIComponent(t)}`,e,{method:"PATCH",body:{name:n,expectedRevision:s}}),J0=(e,t,n,s=[])=>Te(`${cn(s)}/decks/${encodeURIComponent(t)}`,e,{method:"DELETE",body:{expectedRevision:n}}),Z0={power:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M12 3v8"}),c.jsx("path",{d:"M6.6 6.6a8 8 0 1 0 10.8 0"})]}),folder:c.jsx("path",{d:"M4 6a2 2 0 0 1 2-2h3.6a2 2 0 0 1 1.4.6L12.4 6H18a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z"}),keyboard:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3",y:"6",width:"18",height:"12",rx:"2"}),c.jsx("path",{d:"M7 10h.01M11 10h.01M15 10h.01M17 14h.01M7 14h7"})]}),mic:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"9",y:"3",width:"6",height:"11",rx:"3"}),c.jsx("path",{d:"M5 11a7 7 0 0 0 14 0"}),c.jsx("path",{d:"M12 18v3"})]}),enter:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M20 5v6a2 2 0 0 1-2 2H5"}),c.jsx("polyline",{points:"9 9 5 13 9 17"})]}),send:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M22 2 15 22 11 13 2 9Z"}),c.jsx("path",{d:"M22 2 11 13"})]}),trash:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M4 7h16"}),c.jsx("path",{d:"M9 7V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2"}),c.jsx("path",{d:"M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12"}),c.jsx("path",{d:"M10 11v6M14 11v6"})]}),x:c.jsx("path",{d:"M6 6l12 12M18 6 6 18"}),refresh:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M21 12a9 9 0 1 1-2.64-6.36L21 8"}),c.jsx("polyline",{points:"21 3 21 8 16 8"})]}),boot:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3",y:"4",width:"18",height:"13",rx:"2"}),c.jsx("path",{d:"M8 21h8M12 17v4M12 12V7"}),c.jsx("polyline",{points:"9 10 12 7 15 10"})]}),upload:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M12 16V5"}),c.jsx("polyline",{points:"8 9 12 5 16 9"}),c.jsx("path",{d:"M5 20h14"})]}),chevronLeft:c.jsx("polyline",{points:"14 6 8 12 14 18"}),chevronUp:c.jsx("polyline",{points:"6 14 12 8 18 14"}),chevronDown:c.jsx("polyline",{points:"6 10 12 16 18 10"}),history:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),c.jsx("polyline",{points:"3 3 3 8 8 8"}),c.jsx("path",{d:"M12 7v5l3 2"})]}),attach:c.jsx("path",{d:"M21.44 11.05 12.25 20.24a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"}),file:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),c.jsx("polyline",{points:"14 2 14 8 20 8"})]}),camera:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M14.5 4h-5L7.5 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3.5z"}),c.jsx("circle",{cx:"12",cy:"13",r:"3.5"})]}),image:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),c.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),c.jsx("path",{d:"M21 15l-5-5L5 21"})]}),zoomIn:c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"11",cy:"11",r:"7"}),c.jsx("path",{d:"M21 21l-4.35-4.35"}),c.jsx("path",{d:"M8 11h6M11 8v6"})]}),zoomOut:c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"11",cy:"11",r:"7"}),c.jsx("path",{d:"M21 21l-4.35-4.35"}),c.jsx("path",{d:"M8 11h6"})]}),gear:c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"12",cy:"12",r:"3"}),c.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),copy:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),c.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})};function Je({name:e,size:t=20}){return c.jsx("svg",{className:"nc-icon",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:Z0[e]||null})}const ex=["all","pinned","active","off","technical"],ry="nc_sidebar_views_v1",oy="nc_sidebar_order_v1";function ay(e){return ex.includes(e)?e:"all"}function tx(e,t=[],n="all"){const s=ay(n);return s==="technical"?e.technical===!0:e.technical===!0?!1:s==="pinned"?t.includes(e.key):s==="active"?!!e.live:s==="off"?!e.live:!0}function nx(e,t,n=[],s=[]){const o=n.indexOf(e.key),a=n.indexOf(t.key),u=o===-1?Number.MAX_SAFE_INTEGER:o,h=a===-1?Number.MAX_SAFE_INTEGER:a,p=s.indexOf(e.key),m=s.indexOf(t.key),v=p===-1?Number.MAX_SAFE_INTEGER:p,S=m===-1?Number.MAX_SAFE_INTEGER:m;return u-h||v-S||+!!t.live-+!!e.live||+!!t.fresh-+!!e.fresh||Number(t.activity||0)-Number(e.activity||0)||String(e.label||"").localeCompare(String(t.label||""))||String(e.key||"").localeCompare(String(t.key||""))}function ix(e=globalThis.localStorage){try{const t=JSON.parse(e.getItem(oy));if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[s,o]of Object.entries(t).slice(0,64)){if(typeof s!="string"||!s||s.length>160||!Array.isArray(o))continue;const a=[...new Set(o.filter(u=>typeof u=="string"&&u&&u.length<=256))].slice(0,128);a.length&&(n[s]=a)}return n}catch{return{}}}function Fi(e,t){return Array.isArray(e==null?void 0:e[t])?e[t]:[]}function sx(e,t=globalThis.localStorage){try{t.setItem(oy,JSON.stringify(e))}catch{}return e}function rx(e,t,n,s,o=[]){if(typeof t!="string"||!t||n===s)return e;const a=[...new Set(o.filter(y=>typeof y=="string"&&y))];if(!a.includes(n)||!a.includes(s))return e;const u=Fi(e,t).filter(y=>a.includes(y)),h=[...u,...a.filter(y=>!u.includes(y))],p=h.indexOf(n),m=h.indexOf(s);h.splice(p,1);const v=h.indexOf(s),S=p<m?v+1:v;return h.splice(S,0,n),{...e,[t]:h}}function ox(e=globalThis.localStorage){try{const t=JSON.parse(e.getItem(ry));return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function Eg(e,t){var n,s;return{open:((n=e==null?void 0:e[t])==null?void 0:n.open)!==!1,filter:ay((s=e==null?void 0:e[t])==null?void 0:s.filter)}}function ax(e,t=globalThis.localStorage){try{t.setItem(ry,JSON.stringify(e))}catch{}return e}function Ng(e,t=""){const n=String(t||"").trim().toLocaleLowerCase();return n?[e.label,e.key,e.searchText].filter(Boolean).join(" ").toLocaleLowerCase().includes(n):!0}function gs(e=[],t=[],n="all",s=[]){return[...e].filter(o=>tx(o,t,n)).sort((o,a)=>nx(o,a,t,s))}const tf=["it","en","es"];function lx(){try{const e=typeof navigator<"u"&&navigator.language||"",t=String(e).slice(0,2).toLowerCase();return tf.includes(t)?t:"en"}catch{return"en"}}const jl=lx(),ly="nc_lang",Kd="nc-lang";function cy(){return typeof localStorage<"u"?localStorage:null}const gl={it:{"update-available":"nuova versione {v} disponibile","install-version-mismatch":"installazione incompleta: frontend e server non coincidono (v{v})",reload:"ricarica","grid-empty":"trascina qui una sessione dalla sidebar, o doppio-clic per la vista singola","grid-full":"il deck può mostrare al massimo 9 sessioni",pin:"fissa in cima",reorder:"riordina","reorder-help":"trascina la maniglia; frecce su/giu da tastiera","rename-node":"rinomina nodo","rename-node-prompt":"Nuovo nome del nodo in NexusCrew","rename-node-invalid":"Nome non valido: massimo 64 caratteri, senza a capo.","reorder-deck-help":"trascina il deck; frecce sinistra/destra da tastiera",sessions:"sessioni","new-session":"nuova sessione",new:"nuova",fleet:"Flotta","fleet-tmux":"flotta tmux","other-sessions":"Altre sessioni","view-all":"tutte","view-pinned":"fissate","view-active":"attive","view-off":"spente","view-technical":"tecniche","mark-technical":"nascondi come sessione tecnica","mark-normal":"mostra come sessione normale","position-local":"Locale",files:"file",refresh:"aggiorna","filter-placeholder":"filtra sessioni…","loading-fleet":"carico la flotta…","no-sessions":"nessuna sessione tmux viva — la flotta parte al boot (systemd)","no-match":'nessuna sessione contiene "{q}"',"copy-url":"clicca per copiare l'URL","ssh-only":"solo tunnel SSH/VPN","new-files-outbox":"nuovi file in outbox",terminate:"termina","terminate-confirm":'Terminare la sessione "{name}"?',"cell-on":"tmux vivo","cell-off":"spenta","cell-working":"al lavoro","cell-idle":"in attesa","cell-degraded":"degradata: unit attiva, tmux morto","power-on":"accendi","power-off":"spegni","boot-enable":"attiva al boot","boot-disable":"disattiva al boot","state-on":"accesa","state-off":"spenta",engine:"Engine",model:"Modello","model-default":"Modello predefinito del provider","model-remembered":"Ultimo modello usato con questo engine","boot-persist":"avvia al boot","remove-boot":"togli anche dal boot","power-config-in-settings":"Engine, provider, profilo, modello e permessi si modificano in Impostazioni → Flotta.","no-remote-control":"⚠ engine non-native: niente RC da app claude.ai (da qui la piloti comunque)",cancel:"annulla",name:"nome","name-invalid":"nome non valido: a-zA-Z0-9._- max 64, senza '-' iniziale",cwd:"cartella",browse:"sfoglia","fs-home":"home","fs-parent":".. su",preset:"preset","preset-2x2":"griglia 2×2","preset-columns":"colonne","preset-equalize":"equalizza",collapse:"comprimi",expand:"espandi",create:"crea","auth-prompt":"Incolla il token (stampato dal server):","remember-device":"ricorda su questo device","zoom-out":"testo più piccolo","zoom-in":"testo più grande",composer:"composer",windows:"{n} finestre","empty-files":"vuota",upload:"carica","no-sessions-short":"nessuna sessione","composer-placeholder":"scrivi o detta…","composer-history-tools":"cronologia e dimensione input","composer-history":"cronologia della cella","composer-history-empty":"nessun input inviato","composer-history-clear":"cancella cronologia di questa cella","composer-expand":"espandi input","composer-collapse":"riduci input","composer-clear-data":"cancella bozze e cronologia","composer-clear-data-help":"Rimuove da questo browser tutte le bozze e la cronologia input delle celle.","composer-clear-confirm":"Cancellare tutte le bozze e la cronologia input salvate in questo browser?","composer-clear-done":"Bozze e cronologia cancellate.","composer-clear-failed":"Impossibile cancellare i dati del composer in questo browser.",attach:"allega","attach-file":"File","attach-camera":"Fotocamera","attach-gallery":"Galleria","attach-uploading":"carico…","attach-upload-progress":"allegato {n}/{total}…","attach-uploaded":"{n} allegati caricati",voice:"voice",send:"invia","composer-send-failed":"connessione non pronta — testo conservato, riprova",close:"chiudi","lang-label":"lingua",decks:"deck","new-deck":"nuovo deck","deck-name":"nome deck","open-deck-window":"apri in una nuova finestra","detach-deck":"stacca in una nuova finestra","deck-current":"questo deck (finestra corrente)","deck-owner-unavailable":"nodo owner non condiviso o non raggiungibile","rename-deck":"rinomina deck","delete-deck":"elimina deck","delete-deck-confirm":'Eliminare il deck "{name}"?',"send-to-deck":"manda al deck…","deck-autosave":"salvataggio automatico",saving:"salvataggio…",saved:"salvato","popup-blocked":"popup bloccato: apri qui","expand-owner":"espandi i deck di {owner}","collapse-owner":"comprimi i deck di {owner}","owner-deck-count-one":"{count} deck","owner-deck-count-many":"{count} deck","dot-working":"in uso (finestra attiva)","dot-on":"aperta in background","dot-neutral":"non aperta","dot-warn":"nodo offline","select-drag":"trascina per selezionare","copy-manual":"seleziona e copia manualmente","toggle-sidebar":"mostra/nascondi la barra laterale",settings:"impostazioni","tab-roles":"ruoli","tab-nodes":"nodi",local:"Locale",location:"Dove","pairing-link":"link di pairing","pairing-required":"nome, alias SSH e link di pairing sono obbligatori","pairing-connect-help":"Per collegare un nodo servono: nome, Host SSH già funzionante e link/QR creato sull’altra installazione NexusCrew.","pairing-localhost-hint":"127.0.0.1 nel link è corretto: non aprirlo qui. NexusCrew usa invito e porta attraverso l’Host SSH.","scan-qr":"scansiona QR","pairing-qr-invalid":"QR di pairing non valido","invite-node":"invita un nodo","create-pairing-link":"crea link / QR","visibility-network":"tutta la rete","visibility-relay":"solo relay","visibility-selected":"nodi selezionati","hydra-simple":"locale + nodi, una sola rete","local-ready":"Questo dispositivo è pronto. Puoi usarlo da solo o collegarlo a un nodo.","local-only":"solo locale","add-node":"aggiungi nodo",connect:"collega","node-connected":"Nodo collegato. La rete verrà sincronizzata automaticamente.","tab-system":"sistema","tab-fleet":"flotta","tab-audio":"audio","system-general":"generale","system-diagnostics":"diagnostica","system-this-node":"questo nodo","system-updates":"aggiornamenti","system-security":"sicurezza","system-local-data":"dati locali del browser","system-terminal":"terminale","alternate-screen":"schermo alternato","alternate-screen-help":"Mantiene il comportamento tmux standard per le nuove sessioni NexusCrew. Un’applicazione che segue il mouse scorre da sé; le altre fanno scorrere la storia di tmux. Non modifica le celle già attive.","tab-input":"input","tab-diagnostics":"diagnostica","input-settings-local":"Preferenze locali di questo browser. Si applicano subito a vista singola e deck, senza modificare il nodo remoto.","terminal-keyboard-gesture":"Apertura tastiera virtuale dal terminale","terminal-keyboard-double-tap":"Doppio tap (predefinito)","terminal-keyboard-single-tap":"Tap singolo","terminal-keyboard-never":"Mai dal terminale","terminal-keyboard-gesture-help":"Il tastierino e STT seguono i controlli separati sotto. Mouse e tastiera fisica restano utilizzabili.","keybar-ime-lock":"Tastierino: mantieni chiusa la tastiera virtuale","keybar-ime-lock-help":"ESC, frecce, PgUp/PgDn, Enter e menu inviano direttamente al PTY senza dare focus a un campo di testo.","voice-ime-lock":"Microfono STT: mantieni chiusa la tastiera virtuale","voice-ime-lock-help":"Il tap sul microfono avvia o ferma la voce senza focalizzare il composer.","keybar-enter-show":"Mostra Enter verticale nel tastierino","keybar-enter-show-help":"Enter resta a destra di PgUp/PgDn ed è alto quanto entrambe le righe.","keybar-layout":"Layout tastierino","keybar-layout-full":"Esteso (predefinito)","keybar-layout-compact":"Compatto","keybar-layout-help":"Compatto: una riga con expand ⊞ per accedere al set completo senza cambiare la preferenza.","input-settings-reset":"ripristina predefiniti input","diagnostics-local":"Questo nodo","diagnostics-target":"Nodo da diagnosticare","diagnostics-verbose":"Log verbosi temporanei","diagnostics-duration":"Durata verbose","diagnostics-expires":"Verbose attivo fino alle {time}","diagnostics-off":"Verbose spento; warning ed errori operativi restano disponibili.","diagnostics-level":"Livello","diagnostics-all-levels":"tutti i livelli","diagnostics-component":"componente","diagnostics-pause":"pausa","diagnostics-autoscroll":"scorrimento automatico","diagnostics-log":"Log diagnostico sanitizzato","diagnostics-empty":"Nessun evento diagnostico.","diagnostics-export":"esporta JSON","diagnostics-export-failed":"Esportazione non disponibile in questo browser.","diagnostics-clear":"svuota","diagnostics-clear-confirm":"Svuotare il buffer diagnostico di questo nodo?","diagnostics-unsupported":"Questo peer è offline o non supporta la diagnostica strutturata.","fleet-editor-loading":"Caricamento dell'editor Fleet…","fleet-editor-load-error":"Impossibile caricare l'editor Fleet.","fleet-editor-unavailable":"Editor Fleet non disponibile in questa posizione.","fleet-managed":"gestito da NexusCrew","fleet-custom":"comando personalizzato","fleet-managed-help":"Client, provider e avvio sono gestiti internamente; i segreti non vengono mostrati.","fleet-shell-engine-help":"Shell locale risolta sul dispositivo al momento dell’avvio; nessun percorso viene salvato nel backup.","fleet-shell-command-placeholder":"comando opzionale, es. npm test","fleet-shell-command-help":"Esecuzione tramite shell login interattiva (-lic), con PATH e alias utente. La cella si ferma quando il comando termina; gli errori immediati vengono segnalati.","fleet-shell-command-metachar":"Pipe, redirect, variabili e altri metacaratteri vengono interpretati dalla shell del dispositivo.","fleet-shell-interactive":"Vuoto: apre una shell interattiva locale e mantiene la cella attiva.","fleet-shell-launch-help":"Il comando Shell si configura nella cella da Impostazioni → Flotta.","fleet-credential-title":"API key su questo dispositivo","fleet-credential-help":"La key resta solo sul nodo selezionato, non viene mostrata, esportata o condivisa con la rete.","fleet-credential-set":"imposta key","fleet-credential-change":"cambia key","fleet-credential-forget":"dimentica","fleet-credential-saved":"Key salvata localmente.","fleet-credential-removed":"Key locale rimossa.","fleet-credential-remove-confirm":"Rimuovere la key locale {key}?","fleet-credential-source-environment":"ambiente","fleet-credential-source-local":"store locale","fleet-credential-source-compatibility":"config compatibile","fleet-credential-source-missing":"mancante","fleet-credential-source-policy":"origine credenziale","fleet-credential-source-policy-auto":"auto (precedenza legacy)","fleet-credential-source-policy-nexuscrew-store":"solo store NexusCrew","fleet-credential-source-policy-environment":"solo ambiente","fleet-key-section":"KEY","fleet-key-variable":"Variabile","fleet-key-value":"Valore per {key}","fleet-key-used-by":"Usata da: {engines}","fleet-key-used-by-none":"Non ancora usata da engine configurati su questo nodo.","fleet-key-shared-impact":"Sostituire o rimuovere {key} interessa tutti gli engine elencati: {engines}.","fleet-key-enter":"inserisci la key","fleet-key-blank-keeps":"vuoto = mantieni la fonte attuale","fleet-key-reveal":"mostra","fleet-key-hide":"nascondi","fleet-key-local-help":"Il valore resta write-only sul nodo selezionato e non entra in engine, backup o federazione.","fleet-key-create-missing":"Crea esplicitamente l’engine senza key (resterà “key richiesta”).","fleet-key-partial-create":"Engine creato; la key non è stata salvata. Puoi riprovare senza creare duplicati.","fleet-key-partial-edit":"Engine aggiornato; la key non è stata salvata. Le modifiche all’engine restano applicate.","fleet-provider-notice-claude-openrouter":"Claude Code è ottimizzato per modelli Anthropic: altri provider potrebbero non funzionare correttamente. Fast mode richiede il provider Anthropic first-party.","fleet-provider-notice-codex-openrouter":"OpenRouter Responses è beta e stateless; Codex-VL non usa fallback Chat Completions.","fleet-provider-notice-claude-kimi-code":"Kimi Code usa una configurazione Claude isolata con onboarding e fast mode dedicati; la configurazione Claude nativa non viene modificata.","fleet-provider-notice-alibaba-token-plan":"Token Plan Personal usa solo ALIBABA_CODE_API_KEY dal credential layer locale; qwen3.8-max è il modello predefinito e non viene usato alcun fallback OpenAI/PAYG.","fleet-provider-notice-kimi-native":'Kimi Code CLI nativo usa il login del CLI (device-code) e la propria configurazione: NexusCrew non legge né copia credenziali. Distinto dal provider "Kimi Code" di Claude Code, che resta il percorso K3 gestito.',"fleet-model-default":"modello predefinito (opzionale)","fleet-model-required":"modello (obbligatorio)","fleet-standard-permissions":"permessi standard","fleet-unsafe-permissions":"non sicuro · ignora approvazioni/sandbox","fleet-unsafe-warning":"Modalità non sicura esplicita: il worker può agire senza le normali approvazioni o protezioni sandbox.","fleet-provider-display":"nome visualizzato del provider","fleet-custom-provider-default":"Provider personalizzato","fleet-api-key-env":"NOME_VARIABILE_API_KEY","fleet-provider-id":"id-provider","fleet-custom-secret-help":"NexusCrew salva solo il nome della variabile d’ambiente, mai il suo valore.","fleet-model-override":"modello alternativo","fleet-ready":"pronto","fleet-not-ready":"non configurato","fleet-engines":"Engine","fleet-cells":"Celle / sessioni cloud","fleet-backup":"backup / ripristino","fleet-backup-help":"Esporta o ripristina selettivamente engine, celle e system prompt. Token, API key e segreti provider non entrano mai nel file.","fleet-backup-export":"esporta","fleet-backup-import":"importa","fleet-backup-download":"scarica backup","fleet-backup-restore":"ripristina selezionate","fleet-backup-import-help":"Scegli un backup JSON, controlla le celle e seleziona l’engine di destinazione prima del ripristino.","fleet-backup-overwrite":"sovrascrive la cella esistente","fleet-backup-new":"nuova cella","fleet-backup-engine-missing":"scegli un engine disponibile","fleet-backup-restore-unavailable":"Il nodo selezionato supporta solo l’esportazione; aggiornalo per ripristinare backup.","fleet-backup-restored":"{n} celle ripristinate","fleet-backup-confirm-overwrite":"Sovrascrivere queste celle? {cells}","fleet-backup-needs-restart":"riavvio necessario: {cells}","fleet-backup-empty":"nessuna cella da esportare","fleet-backup-select-one":"seleziona almeno una cella","fleet-backup-too-large":"backup troppo grande (massimo 1 MB)","fleet-backup-invalid-json":"il file non contiene JSON valido","fleet-backup-invalid-format":"formato o versione del backup non supportati","fleet-backup-invalid-cell":"il backup contiene una cella non valida","fleet-backup-duplicate-cell":"il backup contiene ID cella duplicati","fleet-backup-invalid-engine":"il backup contiene un engine non valido","fleet-backup-duplicate-engine":"il backup contiene ID engine duplicati","fleet-backup-confirm-engine-overwrite":"Sovrascrivere questi engine? I valori ambiente già configurati sul target restano invariati. {engines}","fleet-backup-env-names":"nomi ambiente","fleet-backup-env-values-required":"i valori ambiente vanno configurati sul dispositivo","fleet-system-prompt":"system prompt",characters:"caratteri","select-all":"seleziona tutte","select-none":"nessuna",edit:"modifica",save:"salva",label:"etichetta","command-path":"path assoluto del comando","args-lines":"argomenti, uno per riga","env-write-only":"I valori env sono write-only: vuoto mantiene il valore esistente.","fleet-new-engine":"Nuovo engine","fleet-new-cell":"Nuova cella","fleet-saved":"Definizione salvata.","fleet-restart-confirm":"Modifica salvata. Riavviare ora: {cells}?","fleet-remove-engine":'Eliminare l’engine "{id}"?',"fleet-remove-cell":'Eliminare la cella "{id}"? Se è attiva verrà prima fermata.',"fleet-cwd-needs-repair":"cartella da riparare","fleet-cwd-repair":"ripara","fleet-cwd-repair-title":"Ripara cartella cella {id}","fleet-cwd-repair-help":"La cartella attuale non è portabile su questo dispositivo: appartiene a un altro dispositivo o non esiste sotto la home. Scegli una cartella home-relative (~) sul dispositivo target; il backend ricalcolerà il percorso assoluto.","fleet-cwd-repair-no-source-path":"Il percorso originale non viene mostrato: è specifico del dispositivo di origine.","fleet-cwd-repair-placeholder":"es. Dev","fleet-cwd-repair-preview":"Nuova cartella: {path}","fleet-cwd-repair-browse":"sfoglia sotto ~","fleet-cwd-repair-fs-empty":"nessuna sottocartella","fleet-cwd-repair-use-current":"usa questa cartella","fleet-cwd-repair-invalid":'percorso non valido: niente assoluto, "..", barra rovesciata o lettera disco',"fleet-cwd-repair-confirm":"Impostare la cartella della cella {id} su {path}? Verrà ricalcolata sul dispositivo target.","fleet-cwd-repair-unportable":"Il percorso scelto non è portabile su questo dispositivo: deve esistere sotto la home.","fleet-cwd-repair-suggestion":"Suggerimento dal dispositivo:","fleet-cwd-repair-use-suggestion":"usa {path}","fleet-cwd-repaired":"Cartella della cella riparata.","fleet-recovery-kimi-code-consent-yes":"Kimi Code: conferma la custom API key (Yes) nel terminale della cella, poi riavvia la cella.","fleet-recovery-kimi-code-config-custom-api-key":'Kimi Code: nel terminale della cella apri /config e abilita "Use custom API key", poi riavvia la cella. Se la chiave è cambiata, aggiorna la credenziale e riprova.',"fleet-recovery-kimi-cli-login":"Kimi Code CLI: nel terminale della cella esegui /login (device-code Kimi) oppure /provider, poi riavvia la cella.","fleet-recovery-client-terminal-dialog":"Completa il dialogo mostrato nel terminale della cella, poi riavvia la cella.","settings-readonly":"READONLY attivo: le modifiche sono bloccate dal server (NEXUSCREW_READONLY=1)","role-client":"client (hub)","role-client-desc":"questa macchina guarda altri nodi via tunnel SSH","role-node":"nodo (raggiungibile)","published-port":"porta pubblicata (opzionale)","no-nodes":"nessun nodo remoto configurato","node-add":"collega installazione NexusCrew","node-connect-help":"La porta SSH serve a raggiungere il server SSH. La porta NexusCrew è invece la porta locale mostrata da `nexuscrew status` sul nodo remoto.","node-name-label":"Nome del nodo","node-ssh-label":"Host SSH","pair-ssh-local-label":"Host o alias SSH su questo dispositivo","node-ssh-local-help":"Puoi sostituire l’indirizzo del link con lo stesso alias che funziona usando ssh su questo dispositivo. Alias, agent e chiavi restano locali e non viaggiano nel link.","node-ssh-port-label":"Porta SSH","node-ssh-port-help":"Di solito 22; usa la porta pubblica del server SSH.","node-app-port-label":"Porta NexusCrew sul nodo","node-app-port-help":"È la porta mostrata da `nexuscrew status` sul nodo remoto.","node-name-ph":"nome (a-z 0-9 -)","node-ssh-ph":"ssh (user@host)","node-port-ph":"porta remota (opz.)","node-remove-confirm":'Rimuovere il nodo "{name}"?',"node-remove-warning":"Elimina associazione, credenziali e tunnel locale. Non spegne il dispositivo remoto.","peer-inventory-title":"Nodi collegati al hub","peer-group-hubs":"Hub diretti","peer-group-clients":"Client collegati","peer-group-routed":"Nodi raggiungibili tramite la rete","peer-group-vl":"Nodi VL","vl-owners-unavailable":"Owner VL non raggiunti","peer-routed":"instradato","peer-routed-stale":"instradato, non raggiungibile","peer-visibility":"Visibilità nella rete","node-test":"test","tunnel-start":"avvia tunnel","tunnel-stop":"ferma tunnel","tunnel-restart":"riavvia tunnel","share-node":"Condividi questo nodo","share-local-heading":"Condivisione di questo dispositivo","share-local-hub":"Hub di condivisione","share-local-through":"Condividi {device} tramite {hub}","share-local-active":"Condiviso e raggiungibile dalla rete collegata all’hub.","share-local-pending":"Condivisione richiesta, ma il tunnel è giù: questo dispositivo non è ancora raggiungibile.","share-local-private":"Privato: solo questo dispositivo può usare il collegamento all’hub.","share-local-private-down":"Privato, ma il collegamento all’hub è giù. Riconnetti per applicare e verificare la modalità privata.","share-local-reconnect":"Riconnetti e riconcilia","share-off-hub-reconcile-pending":"Stato privato salvato; la revoca sull’hub è ancora in attesa.","fleet-cell-label":"nome leggibile (facoltativo)","share-off-local-reconcile-pending":"Revoca confermata dall’hub; il tunnel locale deve ancora riconciliarsi.","share-reverse-pool-pending":"Il canale reverse non risulta spento in modo dimostrabile: resta in quarantena, non chiuso.","share-node-off-desc":"Privato: resta collegato al nodo hub, ma gli altri client non possono raggiungerlo.","share-node-on-desc":"Condiviso: il nodo hub può mostrarlo e smistare celle e deck autorizzati.","peer-shared":"Nodo client condiviso nella rete Hydra","peer-private":"Nodo client privato: collegato, non pubblicato nella rete Hydra","peer-vl-federated":"Nodo VL: federato","row-vl-federated":"federato","node-connected-client":"client collegato","transport-used":"in uso","tunnel-up":"tunnel su","tunnel-down":"tunnel giù","vl-poll-online":"online (poll)","vl-poll-offline":"non risponde","authorized-keys-hint":"incolla questa riga in ~/.ssh/authorized_keys sull'host remoto:",copy:"copia",copied:"copiato","token-rotate":"ruota token","token-rotate-explain":"Il nuovo token NON verrà mostrato: recuperalo con `nexuscrew show token`. La sessione corrente verrà invalidata.","service-regenerate":"rigenera service","npm-auto-update":"aggiornamenti automatici da npm","npm-auto-update-help":"Controlla periodicamente latest e installa solo versioni più recenti. Mai downgrade.","npm-update-current":"installata","npm-update-latest":"npm latest","npm-update-check":"controlla ora","npm-update-install":"aggiorna ora","npm-update-restarting":"Aggiornamento avviato; NexusCrew si riaprirà dopo il riavvio del servizio.","npm-update-idle":"aggiornato","npm-update-checking":"controllo in corso","npm-update-available":"aggiornamento disponibile","npm-update-installing":"installazione in corso","npm-update-installed":"installato, riavvio in corso","npm-update-error":"controllo fallito","npm-update-unsupported":"disponibile solo con installazione npm globale","service-installed":"service installato","service-missing":"service non installato","service-active":"attivo","service-inactive":"non attivo",confirm:"conferma",add:"aggiungi",enable:"attiva","wizard-title":"benvenuto in NexusCrew","wizard-skip":"configura dopo dai settings","wizard-step-roles":"ruoli di questa installazione","wizard-step-node":"primo nodo remoto (opzionale)","wizard-done":"tutto pronto","wizard-done-desc":"setup completato — puoi cambiare tutto dai settings",next:"continua",back:"indietro",skip:"salta",finish:"fine","err-node-name":"nome non valido (a-z, 0-9, -, max 32)","err-local-name":"nome locale non valido: usa uno slug univoco, non “localhost”","err-ssh":"ssh non valido (atteso user@host o alias)","err-port":"porta non valida (1–65535)","err-ssh-port":"porta SSH non valida (1–65535)","err-node-port":"porta NexusCrew non valida (1–65535)","node-sessions":"{n} sessioni","tunnel-down-since":"tunnel giù da {t}","node-unreachable":"nodo non raggiungibile","node-passive":"client offline · stato normale","node-offline":"nodo offline","node-offline-seen":"offline · visto {t} fa","node-needs-repair":"legacy · ripeti il pairing","asks-title":"domande dalle celle","ask-dismiss":"Scarta la domanda","ask-reply-ph":"scrivi la risposta…","push-enable":"attiva notifiche push","push-disable":"disattiva notifiche push","push-on":"push attive su questo device","push-off":"push non attive","push-denied":"permesso notifiche negato dal browser","push-unsupported":"push non supportate in questo browser","notification-speech-enable":"leggi le notifiche ad alta voce","notification-speech-help":"Usa la voce del browser solo per nuove notifiche mentre questa PWA è visibile e in primo piano. Con l’app chiusa resta la notifica di sistema.","notification-speech-test":"prova voce","notification-speech-testing":"prova in corso…","notification-speech-preview":"NexusCrew. Notifiche vocali attive.","notification-speech-preview-ok":"Prova vocale completata.","notification-speech-preview-failed":"Il browser non ha avviato la prova vocale. Interagisci con la pagina e riprova.","notification-speech-needs-test":"Per questa sessione dell’app, premi “prova voce” prima di ricevere annunci vocali.","notification-speech-unsupported":"Sintesi vocale non supportata in questo browser.","audio-title":"Audio nativo del nodo","audio-help":"Consenso e controlli valgono solo per questo dispositivo. Share e visibilità non autorizzano suoni.","audio-consent":"consenti TTS su questo nodo","audio-consent-help":"Permette a celle autorizzate, locali o remote, di consegnare un comando vocale. Puoi revocarlo in ogni momento.","audio-capability":"Capability locale","audio-loading":"leggo lo stato audio locale…","audio-adapter":"adapter","audio-adapter-none":"nessuno","audio-installed":"installato","audio-installed-yes":"sì","audio-installed-no":"no","audio-liveness":"disponibilità","audio-liveness-ready":"pronto ad accettare","audio-liveness-unavailable":"non disponibile","audio-languages":"lingue dichiarate","audio-limits":"limiti","audio-test":"prova audio locale","audio-testing":"prova in corso…","audio-stop":"ferma audio locale","audio-stopping":"stop in corso…","audio-test-needs-consent":"Attiva il consenso locale prima di provare la voce.","audio-unavailable":"Nessun adapter TTS nativo disponibile su questo nodo.","audio-test-accepted":"Il nodo ha accettato la prova. Non dimostra che qualcuno l’abbia udita.","audio-test-refused":"Il nodo ha rifiutato la prova.","audio-test-unknown":"Esito della prova sconosciuto: il nodo non può confermare l’avvio.","audio-stop-stopped":"Audio locale fermato.","audio-stop-idle":"Nessun enunciato locale da fermare.","audio-groups-title":"Gruppi audio condivisi","audio-groups-help":"Decide su quali dispositivi si sente la voce quando una cella parla. Il gruppo è una preferenza locale di consegna, non un consenso. Ogni nodo conserva consenso, ACL, disponibilità e Stop locale.","audio-groups-empty":"Nessun gruppo: la voce esce solo su questo nodo.","audio-group-name":"nome gruppo","audio-group-mode":"modalità consegna","audio-group-primary":"primo disponibile (in ordine)","audio-group-fanout":"tutti i nodi elencati","audio-group-targets":"nodi target esatti","audio-group-local":"questo nodo","audio-group-unavailable-target":"non rilevato ora","audio-group-no-targets":"Nessun nodo con instanceId disponibile. Il gruppo non può usare nomi, wildcard o “tutti”.","audio-group-new":"nuovo gruppo","audio-group-edit":"modifica","audio-group-delete":"elimina","audio-group-save":"salva gruppo","audio-group-cancel":"annulla","audio-group-invalid":"Il gruppo richiede un nome valido e almeno un nodeId esatto.","audio-group-save-failed":"Salvataggio gruppo audio non riuscito.","node-display-label":"Nome (etichetta)","routed-node-aliases":"Alias nodi instradati","routed-node-aliases-help":"Visibili solo su questo dispositivo; route e nome remoto non cambiano.","node-local-alias":"Alias su questo dispositivo","alias-on-device":"Alias su questo dispositivo","reset-alias":"Ripristina nome remoto","node-slug-hint":"routing su slug: {slug}","device-name-label":"Nome dispositivo","device-name-hint":"come ti vedono i peer (modificabile)","local-route-name-label":"Nome locale / route","local-route-name-hint":"handle tecnico stabile: label leggibile + suffisso del nodeId; modificabile prima della connessione","err-label":"etichetta non valida (max 64 char, niente a capo)","fleet-inventory":"Celle e sessioni","fleet-inventory-help":"tutte le posizioni (Locale + route Hydra)","fleet-manage-location":"Gestisci posizione","fleet-network-overview":"Panoramica rete","fleet-manage-help":"crea e configura celle nella posizione selezionata","fleet-overview-help":"stato operativo di tutte le posizioni, senza duplicare l’editor","fleet-inventory-empty":"nessuna cella o sessione","cell-switcher-refreshing":"aggiorno le celle…","cell-switcher-empty-active":"nessuna cella attiva verificata","cell-switcher-not-confirmed":"stato non confermato","cell-switcher-not-active":"questa cella non è più attiva","cell-switcher-select":"seleziona una cella","cell-switcher-open":"apri cella","cell-switcher-show-all":"tutte","cell-switcher-show-active":"attive","cell-switcher-close":"chiudi selettore celle","fleet-not-available":"fleet non disponibile su questa posizione",start:"avvia",stop:"ferma",restart:"riavvia",delete:"elimina","copy-manual":"copia non riuscita — seleziona e Cmd+C, o copia a mano","copy-empty":"niente selezione: trascina con Shift per selezionare","selection-held":"evidenziazione persa, testo ancora in mano","invite-hub-only":"Un invito si conia sull’hub. Ammettere un nodo nuovo è la sola cosa che un nodo collegato non può chiedere per conto di un altro: apri NexusCrew sull’hub e crea l’invito da lì.","row-private":"privato","node-detail-open":"apri il dettaglio","node-detail-reach":"Raggiungibilità","node-detail-route":"percorso","node-detail-ssh":"SSH","node-detail-transport":"trasporto","node-detail-owner":"owner","node-detail-authority":"Cosa può fare questo nodo","authority-owner-equivalent":"Autorità pari alla tua: un nodo accoppiato può fare su questa macchina tutto quello che puoi fare tu.","authority-routed":"Non è accoppiato con questa macchina: la sua autorità vive presso l’hub che lo instrada.","authority-no-grants":"L’unico potere per-nodo che esiste è la scelta delle celle, qui sotto. Dentro quelle celle l’autorità resta piena.","authority-no-grants-elsewhere":"L’unico potere per-nodo che esiste è la scelta delle celle, e si imposta sull’installazione che le possiede — non da qui.","node-detail-network-view":"Cosa vede di questa rete","node-detail-command":"Comando","vl-no-commands":"Il device non dichiara comandi disponibili.","vl-events-title":"Sessione","vl-events-empty":"Nessun evento in memoria: la sessione non ha ancora parlato, oppure quello che ha detto è uscito dal buffer. La storia resta sul device.","vl-events-gap":"eventi non ricevuti:","vl-events-truncated":"contenuto troncato dal device","vl-events-turn-end":"— fine turno —","vl-events-done":"— fine risposta —","vl-events-writer-epoch":"— cambio scrittore —","vl-events-tool":"strumento","vl-events-tool-ok":"concluso","vl-events-tool-failed":"fallito","vl-events-usage":"consumo aggiornato","vl-events-stale":"Aggiornamento non riuscito: quello che vedi potrebbe non essere l’ultimo.","vl-cmd-phase-submitted":"inviato, in attesa di conferma","vl-cmd-phase-inflight":"in corso","vl-cmd-phase-done-ok":"completato","vl-cmd-phase-done-error":"fallito","vl-cmd-status":"stato","vl-cmd-health":"salute","vl-cmd-start":"avvia","vl-cmd-stop":"ferma","vl-cmd-restart":"riavvia","vl-cmd-version":"versione","vl-cmd-capabilities":"capacità","vl-cmd-logs":"log","vl-cmd-prompt":"prompt","vl-prompt-placeholder":"scrivi il prompt per la sessione del device…","vl-prompt-send":"invia prompt","vl-cmd-unpair":"disaccoppia","node-grant-none":"Nessun nodo scelto: condiviso, ma verso nessuno.","node-grant-unknown":"non più in inventario","node-grant-remove":"togli","node-grant-add":"Aggiungi un nodo","node-grant-search":"Cerca fra i nodi","node-grant-no-candidates":"Nessun nodo corrisponde.","cell-scope":"Celle visibili a questo nodo","cell-scope-help":"Vale su cio’ che questo nodo elenca e su cio’ che può toccare, terminale compreso. Dentro le celle concesse resta un nodo accoppiato a pieno titolo: non è una sandbox.","cell-scope-all":"tutte le celle","cell-scope-none":"nessuna cella","cell-scope-selected":"celle selezionate","cell-scope-none-granted":"Nessuna cella scelta: questo nodo non ne vede nessuna.","cell-scope-unknown":"cella non più esistente","cell-scope-add":"Aggiungi una cella","cell-scope-search":"Cerca fra le celle","cell-scope-no-candidates":"Nessuna cella corrisponde.","cell-scope-reset-warning":"Cambiando modo l’elenco viene azzerato: tornando a «celle selezionate» andrà rifatto.","cell-scope-list-unavailable":"Elenco delle celle non disponibile ora: le concessioni qui sotto restano valide, ma non si può dire se esistono ancora.","single-view":"vista singola",retract:"riduci","keybar-expand":"espandi la barra tasti","keybar-retract":"riduci la barra tasti","save-and-start":"salva e avvia",permissions:"Permessi","power-on-hint":"Spegni la cella; puoi anche toglierla dal boot.","launch-engine-help":"Provider, credenziali e nuovi engine si creano in Impostazioni → Flotta. Modello e permessi sono per questa cella.","launch-unavailable-hint":"Configurazione engine non disponibile su questo nodo.","import-as-cell":"Importa come cella","import-help":"Riconcilia una sessione tmux esistente in una cella gestita. Scegli un engine già dichiarato: nessun engine viene inventato.","import-engine-required":"scegli un engine (obbligatorio)","test-and-connect":"testa e collega","pairing-v2-hint":"Incolla o scansiona UN solo link: precompila nome, Host SSH ed etichetta quando il link li include (v2).","invite-v2-hint":"Crea un invito monouso. Serve l’indirizzo SSH di questo dispositivo, raggiungibile da chi lo userà.","invite-target-local":"Il nuovo dispositivo entrerà in","invite-target-this":"questo dispositivo","invite-endpoint-label":"Indirizzo SSH di questo hub visto dagli altri dispositivi","invite-endpoint-auto":"Endpoint già configurato","invite-endpoint-needed":"Inserisci user@host o un alias SSH condiviso. Non è 127.0.0.1 e non è l’URL HTTP NexusCrew.","invite-ssh-hint":"Il target SSH con cui L’ALTRO dispositivo raggiunge QUESTA installazione (user@host o alias). Obbligatorio: viene incluso nel link.","invite-next-steps":"copia questo link, apri NexusCrew sull’altro dispositivo e incollalo in Impostazioni → Nodi (o scansiona il QR): al resto pensa NexusCrew","pair-card-title":"collega con un solo link","pair-card-help":"Incolla il link di pairing generato sull’altro dispositivo (o scansiona il suo QR): NexusCrew decodifica, prova la connessione SSH e collega da solo.","pair-paste-ph":"incolla qui il link di pairing","pair-paste-btn":"incolla","pair-advanced":"avanzate / modifica","pair-progress":"collegamento in corso: SSH → invito → conferma → verifica…","pair-retry":"riprova","pair-invalid-link":"questo non è un link di pairing valido","pair-invalid-hint":"serve il link completo (http://…#pair=…) generato dall’altro NexusCrew: non aprirlo, incollalo qui","pair-missing-ssh":"il link non include il target SSH (formato v1): indica in “avanzate” come questo dispositivo raggiunge l’altro via SSH — non viene mai inventato","pair-missing-name":"manca il nome del nodo: completalo in “avanzate”","pair-clipboard-denied":"lettura degli appunti non consentita: incolla manualmente nel campo","pair-clipboard-empty":"appunti vuoti: copia prima il link di pairing","pair-stage-validation":"dati non validi","pair-stage-conflict":"nome già in uso","pair-stage-ssh-start":"avvio del tunnel SSH fallito","pair-stage-ssh-ready":"peer non raggiungibile via SSH","pair-stage-join":"scambio dell’invito fallito","pair-stage-tunnel-final":"tunnel negoziato fallito","pair-stage-confirm":"conferma del pairing fallita","pair-stage-health":"verifica finale della federazione fallita","pair-stage-internal":"errore interno","pair-stage-generic":"connessione fallita","qr-no-camera":"nessuna camera disponibile su questo dispositivo: usa una foto del QR","qr-permission":"permesso camera negato: consentilo nel browser o usa una foto del QR","qr-unsupported":"scanner live non supportato qui: carica una foto del QR","qr-upload":"usa una foto"},en:{"update-available":"new version {v} available","install-version-mismatch":"incomplete installation: frontend and server do not match (v{v})",reload:"reload","grid-empty":"drag a session here from the sidebar, or double-click for single view","grid-full":"a deck can show at most 9 sessions",pin:"pin to top",reorder:"reorder","reorder-help":"drag the handle; keyboard up/down arrows","rename-node":"rename node","rename-node-prompt":"New node name in NexusCrew","rename-node-invalid":"Invalid name: maximum 64 characters, no line breaks.","reorder-deck-help":"drag the deck; keyboard left/right arrows",sessions:"sessions","new-session":"new session",new:"new",fleet:"Fleet","fleet-tmux":"tmux fleet","other-sessions":"Other sessions","view-all":"all","view-pinned":"pinned","view-active":"active","view-off":"off","view-technical":"technical","mark-technical":"hide as technical session","mark-normal":"show as normal session","position-local":"Local",files:"files",refresh:"refresh","filter-placeholder":"filter sessions…","loading-fleet":"loading fleet…","no-sessions":"no live tmux sessions — the fleet starts at boot (systemd)","no-match":'no session matches "{q}"',"copy-url":"click to copy URL","ssh-only":"SSH/VPN tunnel only","new-files-outbox":"new files in outbox",terminate:"terminate","terminate-confirm":'Terminate session "{name}"?',"cell-on":"tmux alive","cell-off":"off","cell-working":"working","cell-idle":"idle","cell-degraded":"degraded: unit active, tmux dead","power-on":"power on","power-off":"power off","boot-enable":"enable at boot","boot-disable":"disable at boot","state-on":"running","state-off":"stopped",engine:"Engine",model:"Model","model-default":"Provider default model","model-remembered":"Last model used with this engine","boot-persist":"start at boot","remove-boot":"also remove from boot","power-config-in-settings":"Edit engine, provider, profile, model and permissions in Settings → Fleet.","no-remote-control":"⚠ non-native engine: no claude.ai app RC (you can still drive it from here)",cancel:"cancel",name:"name","name-invalid":"invalid name: a-zA-Z0-9._- max 64, no leading '-'",cwd:"folder",browse:"browse","fs-home":"home","fs-parent":".. up",preset:"preset","preset-2x2":"2×2 grid","preset-columns":"columns","preset-equalize":"equalize",collapse:"collapse",expand:"expand",create:"create","auth-prompt":"Paste the token (printed by the server):","remember-device":"remember on this device","zoom-out":"smaller text","zoom-in":"bigger text",composer:"composer",windows:"{n} windows","empty-files":"empty",upload:"upload","no-sessions-short":"no sessions","composer-placeholder":"type or dictate…","composer-history-tools":"input history and size","composer-history":"cell history","composer-history-empty":"no submitted input","composer-history-clear":"clear this cell history","composer-expand":"expand input","composer-collapse":"collapse input","composer-clear-data":"clear drafts and history","composer-clear-data-help":"Removes every saved cell draft and input-history entry from this browser.","composer-clear-confirm":"Clear every saved draft and input-history entry from this browser?","composer-clear-done":"Drafts and history cleared.","composer-clear-failed":"Could not clear composer data in this browser.",attach:"attach","attach-file":"File","attach-camera":"Camera","attach-gallery":"Gallery","attach-uploading":"uploading…","attach-upload-progress":"attachment {n}/{total}…","attach-uploaded":"{n} attachments uploaded",voice:"voice",send:"send","composer-send-failed":"connection not ready — text kept, try again",close:"close","lang-label":"language",decks:"decks","new-deck":"new deck","deck-name":"deck name","open-deck-window":"open in a new window","detach-deck":"detach into a new window","deck-current":"this deck (current window)","deck-owner-unavailable":"owner node is not shared or reachable","rename-deck":"rename deck","delete-deck":"delete deck","delete-deck-confirm":'Delete deck "{name}"?',"send-to-deck":"send to deck…","deck-autosave":"autosave",saving:"saving…",saved:"saved","popup-blocked":"popup blocked: open here","expand-owner":"expand {owner} decks","collapse-owner":"collapse {owner} decks","owner-deck-count-one":"{count} deck","owner-deck-count-many":"{count} decks","dot-working":"in use (active window)","dot-on":"open in background","dot-neutral":"not open","dot-warn":"owner offline","select-drag":"drag to select","copy-manual":"select and copy manually","toggle-sidebar":"show/hide the sidebar",settings:"settings","tab-roles":"roles","tab-nodes":"nodes",local:"Local",location:"Location","pairing-link":"pairing link","pairing-required":"name, SSH alias and pairing link are required","pairing-connect-help":"Connecting a node requires a name, a working SSH Host, and a link/QR created by the other NexusCrew installation.","pairing-localhost-hint":"127.0.0.1 in the link is correct: do not open it here. NexusCrew carries the invite and port through the SSH Host.","scan-qr":"scan QR","pairing-qr-invalid":"invalid pairing QR","invite-node":"invite a node","create-pairing-link":"create link / QR","visibility-network":"whole network","visibility-relay":"relay only","visibility-selected":"selected nodes","hydra-simple":"local + nodes, one network","local-ready":"This device is ready. Use it alone or connect it to a node.","local-only":"local only","add-node":"add node",connect:"connect","node-connected":"Node connected. The network will synchronize automatically.","tab-system":"system","tab-fleet":"fleet","tab-audio":"audio","system-general":"general","system-diagnostics":"diagnostics","system-this-node":"this node","system-updates":"updates","system-security":"security","system-local-data":"local browser data","system-terminal":"terminal","alternate-screen":"alternate screen","alternate-screen-help":"Keeps standard tmux behaviour for new NexusCrew sessions. An application that tracks the mouse scrolls on its own; the others browse the tmux scrollback. It does not change cells already running.","tab-input":"input","tab-diagnostics":"diagnostics","input-settings-local":"Local preferences for this browser. They apply immediately to single view and decks without changing the remote node.","terminal-keyboard-gesture":"Open the virtual keyboard from the terminal","terminal-keyboard-double-tap":"Double tap (default)","terminal-keyboard-single-tap":"Single tap","terminal-keyboard-never":"Never from terminal","terminal-keyboard-gesture-help":"The keypad and STT use the separate controls below. Mouse and physical keyboard remain available.","keybar-ime-lock":"Keypad: keep the virtual keyboard closed","keybar-ime-lock-help":"ESC, arrows, PgUp/PgDn, Enter and menu send directly to the PTY without focusing a text field.","voice-ime-lock":"STT microphone: keep the virtual keyboard closed","voice-ime-lock-help":"Tapping the microphone starts or stops voice without focusing the composer.","keybar-enter-show":"Show the tall Enter keypad key","keybar-enter-show-help":"Enter stays to the right of PgUp/PgDn and spans both rows.","keybar-layout":"Keypad layout","keybar-layout-full":"Full (default)","keybar-layout-compact":"Compact","keybar-layout-help":"Compact: one row with an expand toggle that reaches the full key set without changing the preference.","input-settings-reset":"restore input defaults","diagnostics-local":"This node","diagnostics-target":"Node to diagnose","diagnostics-verbose":"Temporary verbose logs","diagnostics-duration":"Verbose duration","diagnostics-expires":"Verbose enabled until {time}","diagnostics-off":"Verbose is off; operational warnings and errors remain available.","diagnostics-level":"Level","diagnostics-all-levels":"all levels","diagnostics-component":"component","diagnostics-pause":"pause","diagnostics-autoscroll":"autoscroll","diagnostics-log":"Sanitized diagnostic log","diagnostics-empty":"No diagnostic events.","diagnostics-export":"export JSON","diagnostics-export-failed":"Export is not available in this browser.","diagnostics-clear":"clear","diagnostics-clear-confirm":"Clear this node diagnostic buffer?","diagnostics-unsupported":"This peer is offline or does not support structured diagnostics.","fleet-editor-loading":"Loading the Fleet editor…","fleet-editor-load-error":"Unable to load the Fleet editor.","fleet-editor-unavailable":"The Fleet editor is unavailable at this location.","fleet-managed":"managed by NexusCrew","fleet-custom":"custom command","fleet-managed-help":"Client, provider and launch are managed internally; secrets are never displayed.","fleet-shell-engine-help":"The local shell is resolved on the device at launch time; no executable path is stored in backups.","fleet-shell-command-placeholder":"optional command, e.g. npm test","fleet-shell-command-help":"Runs through an interactive login shell (-lic), with the user PATH and aliases. The cell stops when the command finishes; immediate failures are reported.","fleet-shell-command-metachar":"Pipes, redirects, variables, and other metacharacters are interpreted by the device shell.","fleet-shell-interactive":"Empty: opens a local interactive shell and keeps the cell active.","fleet-shell-launch-help":"Configure the Shell command on the cell in Settings → Fleet.","fleet-credential-title":"API key on this device","fleet-credential-help":"The key stays only on the selected node and is never displayed, exported or shared with the network.","fleet-credential-set":"set key","fleet-credential-change":"change key","fleet-credential-forget":"forget","fleet-credential-saved":"Key saved locally.","fleet-credential-removed":"Local key removed.","fleet-credential-remove-confirm":"Remove the local {key} key?","fleet-credential-source-environment":"environment","fleet-credential-source-local":"local store","fleet-credential-source-compatibility":"compatible config","fleet-credential-source-missing":"missing","fleet-credential-source-policy":"credential source","fleet-credential-source-policy-auto":"auto (legacy precedence)","fleet-credential-source-policy-nexuscrew-store":"NexusCrew store only","fleet-credential-source-policy-environment":"environment only","fleet-key-section":"KEY","fleet-key-variable":"Variable","fleet-key-value":"Value for {key}","fleet-key-used-by":"Used by: {engines}","fleet-key-used-by-none":"Not yet used by configured engines on this node.","fleet-key-shared-impact":"Replacing or removing {key} affects every listed engine: {engines}.","fleet-key-enter":"enter the key","fleet-key-blank-keeps":"blank = keep the current source","fleet-key-reveal":"reveal","fleet-key-hide":"hide","fleet-key-local-help":"The value stays write-only on the selected node and never enters engines, backups or federation.","fleet-key-create-missing":"Explicitly create the engine without a key (it will remain “key required”).","fleet-key-partial-create":"Engine created; the key was not saved. Retry without creating a duplicate.","fleet-key-partial-edit":"Engine updated; the key was not saved. The engine changes remain applied.","fleet-provider-notice-claude-openrouter":"Claude Code is optimized for Anthropic models; other providers may not work correctly. Fast mode requires the first-party Anthropic provider.","fleet-provider-notice-codex-openrouter":"OpenRouter Responses is beta and stateless; Codex-VL has no Chat Completions fallback.","fleet-provider-notice-claude-kimi-code":"Kimi Code uses isolated Claude configuration with dedicated onboarding and fast-mode flags; native Claude configuration is not modified.","fleet-provider-notice-alibaba-token-plan":"Token Plan Personal uses only ALIBABA_CODE_API_KEY from the local credential layer; qwen3.8-max is the default and no OpenAI/PAYG fallback is used.","fleet-provider-notice-kimi-native":'Native Kimi Code CLI uses the CLI login (device code) and its own configuration: NexusCrew never reads or copies credentials. Distinct from the Claude Code "Kimi Code" provider, which remains the managed K3 path.',"fleet-model-default":"default model (optional)","fleet-model-required":"model (required)","fleet-standard-permissions":"standard permissions","fleet-unsafe-permissions":"unsafe · bypass approvals/sandbox","fleet-unsafe-warning":"Explicit unsafe mode: the worker can act without normal approval or sandbox gates.","fleet-provider-display":"provider display name","fleet-custom-provider-default":"Custom provider","fleet-api-key-env":"API_KEY_ENV_NAME","fleet-provider-id":"provider-id","fleet-custom-secret-help":"NexusCrew stores only the environment-variable name, never its value.","fleet-model-override":"model override","fleet-ready":"ready","fleet-not-ready":"not configured","fleet-engines":"Engines","fleet-cells":"Cells / cloud sessions","fleet-backup":"backup / restore","fleet-backup-help":"Selectively export or restore engines, cells, and system prompts. Tokens, API keys, and provider secrets never enter the file.","fleet-backup-export":"export","fleet-backup-import":"import","fleet-backup-download":"download backup","fleet-backup-restore":"restore selected","fleet-backup-import-help":"Choose a JSON backup, review the cells and select a destination engine before restoring.","fleet-backup-overwrite":"overwrites existing cell","fleet-backup-new":"new cell","fleet-backup-engine-missing":"choose an available engine","fleet-backup-restore-unavailable":"The selected node supports export only; update it to restore backups.","fleet-backup-restored":"{n} cells restored","fleet-backup-confirm-overwrite":"Overwrite these cells? {cells}","fleet-backup-needs-restart":"restart required: {cells}","fleet-backup-empty":"no cells to export","fleet-backup-select-one":"select at least one cell","fleet-backup-too-large":"backup is too large (1 MB maximum)","fleet-backup-invalid-json":"the file does not contain valid JSON","fleet-backup-invalid-format":"unsupported backup format or version","fleet-backup-invalid-cell":"the backup contains an invalid cell","fleet-backup-duplicate-cell":"the backup contains duplicate cell IDs","fleet-backup-invalid-engine":"the backup contains an invalid engine","fleet-backup-duplicate-engine":"the backup contains duplicate engine IDs","fleet-backup-confirm-engine-overwrite":"Overwrite these engines? Environment values already configured on the target stay unchanged. {engines}","fleet-backup-env-names":"environment names","fleet-backup-env-values-required":"environment values must be configured on this device","fleet-system-prompt":"system prompt",characters:"characters","select-all":"select all","select-none":"select none",edit:"edit",save:"save",label:"label","command-path":"absolute command path","args-lines":"arguments, one per line","env-write-only":"Environment values are write-only: blank keeps the existing value.","fleet-new-engine":"New engine","fleet-new-cell":"New cell","fleet-saved":"Definition saved.","fleet-restart-confirm":"Change saved. Restart now: {cells}?","fleet-remove-engine":'Delete engine "{id}"?',"fleet-remove-cell":'Delete cell "{id}"? If active it will be stopped first.',"fleet-cwd-needs-repair":"folder needs repair","fleet-cwd-repair":"repair","fleet-cwd-repair-title":"Repair cell folder {id}","fleet-cwd-repair-help":"The current folder is not portable on this device: it belongs to another device or does not exist under the home directory. Choose a home-relative (~) folder on the target device; the backend will recompute the absolute path.","fleet-cwd-repair-no-source-path":"The original path is not shown: it is specific to the source device.","fleet-cwd-repair-placeholder":"e.g. Dev","fleet-cwd-repair-preview":"New folder: {path}","fleet-cwd-repair-browse":"browse under ~","fleet-cwd-repair-fs-empty":"no subfolders","fleet-cwd-repair-use-current":"use this folder","fleet-cwd-repair-invalid":'invalid path: no absolute path, "..", backslash or drive letter',"fleet-cwd-repair-confirm":"Set the folder of cell {id} to {path}? It will be recomputed on the target device.","fleet-cwd-repair-unportable":"The chosen path is not portable on this device: it must exist under the home directory.","fleet-cwd-repair-suggestion":"Suggestion from device:","fleet-cwd-repair-use-suggestion":"use {path}","fleet-cwd-repaired":"Cell folder repaired.","fleet-recovery-kimi-code-consent-yes":"Kimi Code: confirm the custom API key (Yes) in the cell terminal, then restart the cell.","fleet-recovery-kimi-code-config-custom-api-key":'Kimi Code: in the cell terminal open /config and enable "Use custom API key", then restart the cell. If the key changed, update the credential and retry.',"fleet-recovery-kimi-cli-login":"Kimi Code CLI: in the cell terminal run /login (Kimi device code) or /provider, then restart the cell.","fleet-recovery-client-terminal-dialog":"Complete the dialog shown in the cell terminal, then restart the cell.","settings-readonly":"READONLY active: changes are blocked by the server (NEXUSCREW_READONLY=1)","role-client":"client (hub)","role-client-desc":"this machine watches other nodes via SSH tunnels","role-node":"node (reachable)","published-port":"published port (optional)","no-nodes":"no remote nodes configured","node-add":"connect a NexusCrew installation","node-connect-help":"The SSH port reaches the SSH server. The NexusCrew port is the local port reported by `nexuscrew status` on the remote node.","node-name-label":"Node name","node-ssh-label":"SSH host","pair-ssh-local-label":"SSH host or alias on this device","node-ssh-local-help":"You may replace the link address with the same alias that works with ssh on this device. Aliases, agents and private keys stay local and are never carried in the link.","node-ssh-port-label":"SSH port","node-ssh-port-help":"Usually 22; use the SSH server public port.","node-app-port-label":"NexusCrew port on node","node-app-port-help":"The port reported by `nexuscrew status` on the remote node.","node-name-ph":"name (a-z 0-9 -)","node-ssh-ph":"ssh (user@host)","node-port-ph":"remote port (opt.)","node-remove-confirm":'Remove node "{name}"?',"node-remove-warning":"Deletes the pairing, credentials and local tunnel. It does not power off the remote device.","peer-inventory-title":"Nodes connected to the hub","peer-group-hubs":"Direct hubs","peer-group-clients":"Connected clients","peer-group-routed":"Nodes reachable through the network","peer-group-vl":"VL nodes","vl-owners-unavailable":"VL owners unreachable","peer-routed":"routed","peer-routed-stale":"routed, unreachable","peer-visibility":"Network visibility","node-test":"test","tunnel-start":"start tunnel","tunnel-stop":"stop tunnel","tunnel-restart":"restart tunnel","share-node":"Share this node","share-local-heading":"Share this device","share-local-hub":"Sharing hub","share-local-through":"Share {device} through {hub}","share-local-active":"Shared and reachable by the network connected to the hub.","share-local-pending":"Sharing is requested, but the tunnel is down: this device is not reachable yet.","share-local-private":"Private: only this device can use its hub connection.","share-local-private-down":"Private, but the hub connection is down. Reconnect to apply and verify private mode.","share-local-reconnect":"Reconnect and reconcile","share-off-hub-reconcile-pending":"Private state saved; hub revocation is still pending.","fleet-cell-label":"readable name (optional)","share-off-local-reconcile-pending":"Hub revocation confirmed; the local tunnel still needs reconciliation.","share-reverse-pool-pending":"The reverse channel was not demonstrably shut down: it is quarantined, not closed.","share-node-off-desc":"Private: it stays connected to the hub, but other clients cannot reach it.","share-node-on-desc":"Shared: the hub may advertise it and route authorized cells and decks.","peer-shared":"Client node shared on the Hydra network","peer-private":"Private client node: connected, not published on Hydra","peer-vl-federated":"VL node: federated","row-vl-federated":"federated","node-connected-client":"connected client","transport-used":"in use","tunnel-up":"tunnel up","tunnel-down":"tunnel down","vl-poll-online":"online (poll)","vl-poll-offline":"not responding","authorized-keys-hint":"paste this line into ~/.ssh/authorized_keys on the remote host:",copy:"copy",copied:"copied","token-rotate":"rotate token","token-rotate-explain":"The new token will NOT be shown: retrieve it with `nexuscrew show token`. The current session will be invalidated.","service-regenerate":"regenerate service","npm-auto-update":"automatic updates from npm","npm-auto-update-help":"Periodically checks latest and installs only newer versions. Never downgrades.","npm-update-current":"installed","npm-update-latest":"npm latest","npm-update-check":"check now","npm-update-install":"update now","npm-update-restarting":"Update started; NexusCrew will return after the service restarts.","npm-update-idle":"up to date","npm-update-checking":"checking","npm-update-available":"update available","npm-update-installing":"installing","npm-update-installed":"installed, restarting","npm-update-error":"check failed","npm-update-unsupported":"available only for global npm installations","service-installed":"service installed","service-missing":"service not installed","service-active":"active","service-inactive":"not active",confirm:"confirm",add:"add",enable:"enable","wizard-title":"welcome to NexusCrew","wizard-skip":"configure later from settings","wizard-step-roles":"roles of this install","wizard-step-node":"first remote node (optional)","wizard-done":"all set","wizard-done-desc":"setup complete — you can change everything from settings",next:"continue",back:"back",skip:"skip",finish:"finish","err-node-name":"invalid name (a-z, 0-9, -, max 32)","err-local-name":"invalid local name: use a unique slug, not “localhost”","err-ssh":"invalid ssh (expected user@host or alias)","err-port":"invalid port (1–65535)","err-ssh-port":"invalid SSH port (1–65535)","err-node-port":"invalid NexusCrew port (1–65535)","node-sessions":"{n} sessions","tunnel-down-since":"tunnel down for {t}","node-unreachable":"node unreachable","node-passive":"client offline · expected","node-offline":"node offline","node-offline-seen":"offline · seen {t} ago","node-needs-repair":"legacy · pair again","asks-title":"questions from the cells","ask-dismiss":"Dismiss question","ask-reply-ph":"type your answer…","push-enable":"enable push notifications","push-disable":"disable push notifications","push-on":"push active on this device","push-off":"push not active","push-denied":"notification permission denied by the browser","push-unsupported":"push not supported in this browser","notification-speech-enable":"read notifications aloud","notification-speech-help":"Uses the browser voice only for new notifications while this PWA is visible and in the foreground. When the app is closed, the system notification remains available.","notification-speech-test":"test voice","notification-speech-testing":"testing voice…","notification-speech-preview":"NexusCrew. Spoken notifications are active.","notification-speech-preview-ok":"Voice test completed.","notification-speech-preview-failed":"The browser did not start the voice test. Interact with the page and try again.","notification-speech-needs-test":"For this app session, select “test voice” before spoken alerts can play.","notification-speech-unsupported":"Speech synthesis is not supported in this browser.","audio-title":"Native node audio","audio-help":"Consent and controls apply only to this device. Share and visibility do not authorize sounds.","audio-consent":"allow TTS on this node","audio-consent-help":"Allows authorized local or remote cells to deliver a voice command. You can revoke it at any time.","audio-capability":"Local capability","audio-loading":"reading local audio state…","audio-adapter":"adapter","audio-adapter-none":"none","audio-installed":"installed","audio-installed-yes":"yes","audio-installed-no":"no","audio-liveness":"availability","audio-liveness-ready":"ready to accept","audio-liveness-unavailable":"unavailable","audio-languages":"declared languages","audio-limits":"limits","audio-test":"test local audio","audio-testing":"testing audio…","audio-stop":"stop local audio","audio-stopping":"stopping audio…","audio-test-needs-consent":"Enable local consent before testing the voice.","audio-unavailable":"No native TTS adapter is available on this node.","audio-test-accepted":"The node accepted the test. It does not prove that anyone heard it.","audio-test-refused":"The node refused the test.","audio-test-unknown":"Test outcome unknown: the node could not confirm startup.","audio-stop-stopped":"Local audio stopped.","audio-stop-idle":"No local utterance to stop.","audio-groups-title":"Shared audio groups","audio-groups-help":"Chooses which devices play the voice when a cell speaks. A group is a local delivery preference, not consent. Each node keeps its own consent, ACL, availability and local Stop.","audio-groups-empty":"No group: voice plays only on this node.","audio-group-name":"group name","audio-group-mode":"delivery mode","audio-group-primary":"first available (in order)","audio-group-fanout":"all listed nodes","audio-group-targets":"exact target nodes","audio-group-local":"this node","audio-group-unavailable-target":"not currently discovered","audio-group-no-targets":"No node with an available instanceId. A group cannot use names, wildcards, or “all”.","audio-group-new":"new group","audio-group-edit":"edit","audio-group-delete":"delete","audio-group-save":"save group","audio-group-cancel":"cancel","audio-group-invalid":"A group needs a valid name and at least one exact nodeId.","audio-group-save-failed":"Could not save audio group.","node-display-label":"Name (label)","routed-node-aliases":"Routed node aliases","routed-node-aliases-help":"Visible only on this device; the route and remote name do not change.","node-local-alias":"Alias on this device","alias-on-device":"Alias on this device","reset-alias":"Reset remote name","node-slug-hint":"routing on slug: {slug}","device-name-label":"Device name","device-name-hint":"how peers see you (editable)","local-route-name-label":"Local / route name","local-route-name-hint":"stable technical handle: readable label + nodeId suffix; editable before connecting","err-label":"invalid label (max 64 chars, no line breaks)","fleet-inventory":"Cells and sessions","fleet-inventory-help":"all positions (Local + Hydra routes)","fleet-manage-location":"Manage location","fleet-network-overview":"Network overview","fleet-manage-help":"create and configure cells at the selected location","fleet-overview-help":"operational state of every location, separate from the editor","fleet-inventory-empty":"no cells or sessions","cell-switcher-refreshing":"refreshing cells…","cell-switcher-empty-active":"no verified active cells","cell-switcher-not-confirmed":"status not confirmed","cell-switcher-not-active":"this cell is no longer active","cell-switcher-select":"select a cell","cell-switcher-open":"open cell","cell-switcher-show-all":"all","cell-switcher-show-active":"active","cell-switcher-close":"close cell switcher","fleet-not-available":"fleet not available on this position",start:"start",stop:"stop",restart:"restart",delete:"delete","copy-manual":"copy failed — select and press Cmd+C, or copy manually","copy-empty":"nothing selected: drag with Shift to select","selection-held":"highlight gone, text still held","invite-hub-only":"An invite is minted on the hub. Admitting a new node is the one thing a connected node cannot ask on another’s behalf: open NexusCrew on the hub and create the invite there.","row-private":"private","node-detail-open":"open details","node-detail-reach":"Reachability","node-detail-route":"path","node-detail-ssh":"SSH","node-detail-transport":"transport","node-detail-owner":"owner","node-detail-authority":"What this node can do","authority-owner-equivalent":"Authority equal to yours: a paired node can do on this machine everything you can do.","authority-routed":"Not paired with this machine: its authority lives on the hub that routes it.","authority-no-grants":"The only per-node power that exists is the choice of cells, below. Within those cells the authority stays full.","authority-no-grants-elsewhere":"The only per-node power that exists is the choice of cells, and it is set on the installation that owns them — not here.","node-detail-network-view":"What it sees of this network","node-detail-command":"Command","vl-no-commands":"The device declares no commands available.","vl-events-title":"Session","vl-events-empty":"No events in memory: the session has not spoken yet, or what it said has left the buffer. The history stays on the device.","vl-events-gap":"events not received:","vl-events-truncated":"content truncated by the device","vl-events-turn-end":"— end of turn —","vl-events-done":"— turn complete —","vl-events-writer-epoch":"— writer changed —","vl-events-tool":"tool","vl-events-tool-ok":"finished","vl-events-tool-failed":"failed","vl-events-usage":"usage updated","vl-events-stale":"Refresh failed: what you see may not be the latest.","vl-cmd-phase-submitted":"sent, awaiting confirmation","vl-cmd-phase-inflight":"in progress","vl-cmd-phase-done-ok":"completed","vl-cmd-phase-done-error":"failed","vl-cmd-status":"status","vl-cmd-health":"health","vl-cmd-start":"start","vl-cmd-stop":"stop","vl-cmd-restart":"restart","vl-cmd-version":"version","vl-cmd-capabilities":"capabilities","vl-cmd-logs":"logs","vl-cmd-prompt":"prompt","vl-prompt-placeholder":"write the prompt for the device session…","vl-prompt-send":"send prompt","vl-cmd-unpair":"unpair","node-grant-none":"No node chosen: shared, but towards nobody.","node-grant-unknown":"no longer in the inventory","node-grant-remove":"remove","node-grant-add":"Add a node","node-grant-search":"Search the nodes","node-grant-no-candidates":"No node matches.","cell-scope":"Cells this node can see","cell-scope-help":"Applies to what this node lists and to what it can act on, terminal included. Within the granted cells it remains a fully paired node: this is not a sandbox.","cell-scope-all":"every cell","cell-scope-none":"no cell","cell-scope-selected":"selected cells","cell-scope-none-granted":"No cell chosen: this node sees none of them.","cell-scope-unknown":"cell no longer exists","cell-scope-add":"Add a cell","cell-scope-search":"Search the cells","cell-scope-no-candidates":"No cell matches.","cell-scope-reset-warning":"Switching mode clears the list: coming back to “selected cells” means choosing them again.","cell-scope-list-unavailable":"Cell list unavailable right now: the grants below still hold, but we cannot tell whether they still exist.","single-view":"single view",retract:"retract","keybar-expand":"expand the key bar","keybar-retract":"retract the key bar","save-and-start":"save and start",permissions:"Permissions","power-on-hint":"Stop the cell; you can also remove it from boot.","launch-engine-help":"Providers, credentials and new engines are created in Settings → Fleet. Model and permissions are per cell.","launch-unavailable-hint":"Engine configuration is unavailable on this node.","import-as-cell":"Import as cell","import-help":"Reconcile an existing tmux session into a managed cell. Pick an already-declared engine: no engine is invented.","import-engine-required":"pick an engine (required)","test-and-connect":"test and connect","pairing-v2-hint":"Paste or scan ONE link: it prefills name, SSH host and label when the link carries them (v2).","invite-v2-hint":"Create one one-time invitation. It needs this device’s SSH address, reachable by whoever will use it.","invite-target-local":"The new device will join","invite-target-this":"this device","invite-endpoint-label":"This hub’s SSH address as seen by other devices","invite-endpoint-auto":"Configured endpoint","invite-endpoint-needed":"Enter user@host or a shared SSH alias. This is not 127.0.0.1 and not the NexusCrew HTTP URL.","invite-ssh-hint":"The SSH target the OTHER device uses to reach THIS installation (user@host or alias). Required: it is included in the link.","invite-next-steps":"copy this link, open NexusCrew on the other device and paste it in Settings → Nodes (or scan the QR): NexusCrew does the rest","pair-card-title":"connect with one link","pair-card-help":"Paste the pairing link generated on the other device (or scan its QR): NexusCrew decodes it, tests the SSH connection and connects on its own.","pair-paste-ph":"paste the pairing link here","pair-paste-btn":"paste","pair-advanced":"advanced / edit","pair-progress":"connecting: SSH → invite → confirm → verify…","pair-retry":"retry","pair-invalid-link":"this is not a valid pairing link","pair-invalid-hint":"you need the full link (http://…#pair=…) generated by the other NexusCrew: don’t open it, paste it here","pair-missing-ssh":"the link carries no SSH target (v1 format): set in “advanced” how this device reaches the other one over SSH — it is never invented","pair-missing-name":"the node name is missing: fill it in “advanced”","pair-clipboard-denied":"clipboard read not allowed: paste manually into the field","pair-clipboard-empty":"clipboard is empty: copy the pairing link first","pair-stage-validation":"invalid data","pair-stage-conflict":"name already in use","pair-stage-ssh-start":"SSH tunnel start failed","pair-stage-ssh-ready":"peer unreachable over SSH","pair-stage-join":"invite exchange failed","pair-stage-tunnel-final":"negotiated tunnel failed","pair-stage-confirm":"pairing confirmation failed","pair-stage-health":"final federation check failed","pair-stage-internal":"internal error","pair-stage-generic":"connection failed","qr-no-camera":"no camera available on this device: use a photo of the QR","qr-permission":"camera permission denied: allow it in the browser or use a photo of the QR","qr-unsupported":"live scanner not supported here: upload a photo of the QR","qr-upload":"use a photo"},es:{"update-available":"nueva versión {v} disponible","install-version-mismatch":"instalación incompleta: frontend y servidor no coinciden (v{v})",reload:"recargar","grid-empty":"arrastra aquí una sesión desde la barra lateral, o doble clic para vista única","grid-full":"un deck puede mostrar como máximo 9 sesiones",pin:"fijar arriba",reorder:"reordenar","reorder-help":"arrastra el control; flechas arriba/abajo","rename-node":"renombrar nodo","rename-node-prompt":"Nuevo nombre del nodo en NexusCrew","rename-node-invalid":"Nombre no válido: máximo 64 caracteres, sin saltos de línea.","reorder-deck-help":"arrastra el deck; flechas izquierda/derecha",sessions:"sesiones","new-session":"nueva sesión",new:"nueva",fleet:"Flota","fleet-tmux":"flota tmux","other-sessions":"Otras sesiones","view-all":"todas","view-pinned":"fijadas","view-active":"activas","view-off":"apagadas","view-technical":"técnicas","mark-technical":"ocultar como sesión técnica","mark-normal":"mostrar como sesión normal","position-local":"Local",files:"archivos",refresh:"actualizar","filter-placeholder":"filtrar sesiones…","loading-fleet":"cargando flota…","no-sessions":"sin sesiones tmux vivas — la flota arranca en el boot (systemd)","no-match":"ninguna sesión coincide con «{q}»","copy-url":"clic para copiar la URL","ssh-only":"solo túnel SSH/VPN","new-files-outbox":"archivos nuevos en outbox",terminate:"terminar","terminate-confirm":"¿Terminar la sesión «{name}»?","cell-on":"tmux activo","cell-off":"apagada","cell-working":"trabajando","cell-idle":"en espera","cell-degraded":"degradada: unit activa, tmux muerto","power-on":"encender","power-off":"apagar","boot-enable":"activar al iniciar","boot-disable":"desactivar al iniciar","state-on":"encendida","state-off":"apagada",engine:"Motor",model:"Modelo","model-default":"Modelo predeterminado del proveedor","model-remembered":"Último modelo usado con este motor","boot-persist":"iniciar en el boot","remove-boot":"quitar también del boot","power-config-in-settings":"Modifica motor, proveedor, perfil, modelo y permisos en Ajustes → Flota.","no-remote-control":"⚠ motor no nativo: sin RC de la app claude.ai (aquí puedes pilotarla igual)",cancel:"cancelar",name:"nombre","name-invalid":"nombre inválido: a-zA-Z0-9._- máx 64, sin '-' inicial",cwd:"carpeta",browse:"explorar","fs-home":"home","fs-parent":".. arriba",preset:"preset","preset-2x2":"cuadrícula 2×2","preset-columns":"columnas","preset-equalize":"igualar",collapse:"contraer",expand:"expandir",create:"crear","auth-prompt":"Pega el token (impreso por el servidor):","remember-device":"recordar en este dispositivo","zoom-out":"texto más pequeño","zoom-in":"texto más grande",composer:"composer",windows:"{n} ventanas","empty-files":"vacía",upload:"subir","no-sessions-short":"sin sesiones","composer-placeholder":"escribe o dicta…","composer-history-tools":"historial y tamaño de entrada","composer-history":"historial de la celda","composer-history-empty":"ninguna entrada enviada","composer-history-clear":"borrar historial de esta celda","composer-expand":"ampliar entrada","composer-collapse":"reducir entrada","composer-clear-data":"borrar borradores e historial","composer-clear-data-help":"Elimina de este navegador todos los borradores y el historial de entrada de las celdas.","composer-clear-confirm":"¿Borrar todos los borradores y el historial de entrada guardados en este navegador?","composer-clear-done":"Borradores e historial eliminados.","composer-clear-failed":"No se pudieron borrar los datos del composer en este navegador.",attach:"adjuntar","attach-file":"Archivo","attach-camera":"Cámara","attach-gallery":"Galería","attach-uploading":"subiendo…","attach-upload-progress":"adjunto {n}/{total}…","attach-uploaded":"{n} adjuntos subidos",voice:"voz",send:"enviar","composer-send-failed":"conexión no disponible — texto conservado, inténtalo de nuevo",close:"cerrar","lang-label":"idioma",decks:"decks","new-deck":"nuevo deck","deck-name":"nombre del deck","open-deck-window":"abrir en una ventana nueva","detach-deck":"separar en una ventana nueva","deck-current":"este deck (ventana actual)","deck-owner-unavailable":"el nodo propietario no está compartido o accesible","rename-deck":"renombrar deck","delete-deck":"eliminar deck","delete-deck-confirm":"¿Eliminar el deck «{name}»?","send-to-deck":"enviar al deck…","deck-autosave":"guardado automático",saving:"guardando…",saved:"guardado","popup-blocked":"ventana bloqueada: abrir aquí","expand-owner":"expandir decks de {owner}","collapse-owner":"comprimir decks de {owner}","owner-deck-count-one":"{count} deck","owner-deck-count-many":"{count} decks","dot-working":"en uso (ventana activa)","dot-on":"abierta en segundo plano","dot-neutral":"no abierta","dot-warn":"nodo sin conexión","select-drag":"arrastra para seleccionar","copy-manual":"selecciona y copia manualmente","toggle-sidebar":"mostrar/ocultar la barra lateral",settings:"ajustes","tab-roles":"roles","tab-nodes":"nodos",local:"Local",location:"Ubicación","pairing-link":"enlace de emparejamiento","pairing-required":"nombre, alias SSH y enlace son obligatorios","pairing-connect-help":"Para conectar un nodo necesitas un nombre, un Host SSH funcional y el enlace/QR creado por la otra instalación NexusCrew.","pairing-localhost-hint":"127.0.0.1 en el enlace es correcto: no lo abras aquí. NexusCrew usa la invitación y el puerto mediante el Host SSH.","scan-qr":"escanear QR","pairing-qr-invalid":"QR de emparejamiento no válido","invite-node":"invitar un nodo","create-pairing-link":"crear enlace / QR","visibility-network":"toda la red","visibility-relay":"solo relay","visibility-selected":"nodos seleccionados","hydra-simple":"local + nodos, una red","local-ready":"Este dispositivo está listo. Úsalo solo o conéctalo a un nodo.","local-only":"solo local","add-node":"añadir nodo",connect:"conectar","node-connected":"Nodo conectado. La red se sincronizará automáticamente.","tab-system":"sistema","tab-fleet":"flota","tab-audio":"audio","system-general":"general","system-diagnostics":"diagnóstico","system-this-node":"este nodo","system-updates":"actualizaciones","system-security":"seguridad","system-local-data":"datos locales del navegador","system-terminal":"terminal","alternate-screen":"pantalla alternativa","alternate-screen-help":"Mantiene el comportamiento estándar de tmux para las nuevas sesiones NexusCrew. Una aplicación que sigue el ratón se desplaza sola; las demás recorren el historial de tmux. No modifica las celdas ya activas.","tab-input":"entrada","tab-diagnostics":"diagnóstico","input-settings-local":"Preferencias locales de este navegador. Se aplican de inmediato a la vista única y a los decks sin cambiar el nodo remoto.","terminal-keyboard-gesture":"Abrir el teclado virtual desde el terminal","terminal-keyboard-double-tap":"Doble toque (predeterminado)","terminal-keyboard-single-tap":"Toque único","terminal-keyboard-never":"Nunca desde el terminal","terminal-keyboard-gesture-help":"El teclado auxiliar y STT usan los controles separados de abajo. El ratón y el teclado físico siguen disponibles.","keybar-ime-lock":"Teclado auxiliar: mantener cerrado el teclado virtual","keybar-ime-lock-help":"ESC, flechas, PgUp/PgDn, Enter y menú envían directamente al PTY sin enfocar un campo de texto.","voice-ime-lock":"Micrófono STT: mantener cerrado el teclado virtual","voice-ime-lock-help":"Tocar el micrófono inicia o detiene la voz sin enfocar el compositor.","keybar-enter-show":"Mostrar Enter vertical en el teclado auxiliar","keybar-enter-show-help":"Enter queda a la derecha de PgUp/PgDn y ocupa las dos filas.","keybar-layout":"Distribución del teclado auxiliar","keybar-layout-full":"Completo (predeterminado)","keybar-layout-compact":"Compacto","keybar-layout-help":"Compacto: una fila con un botón expandir que alcanza el conjunto completo sin cambiar la preferencia.","input-settings-reset":"restaurar valores de entrada","diagnostics-local":"Este nodo","diagnostics-target":"Nodo a diagnosticar","diagnostics-verbose":"Logs detallados temporales","diagnostics-duration":"Duración detallada","diagnostics-expires":"Log detallado activo hasta las {time}","diagnostics-off":"El log detallado está apagado; los avisos y errores operativos siguen disponibles.","diagnostics-level":"Nivel","diagnostics-all-levels":"todos los niveles","diagnostics-component":"componente","diagnostics-pause":"pausa","diagnostics-autoscroll":"desplazamiento automático","diagnostics-log":"Log de diagnóstico sanitizado","diagnostics-empty":"No hay eventos de diagnóstico.","diagnostics-export":"exportar JSON","diagnostics-export-failed":"La exportación no está disponible en este navegador.","diagnostics-clear":"vaciar","diagnostics-clear-confirm":"¿Vaciar el búfer de diagnóstico de este nodo?","diagnostics-unsupported":"Este par está desconectado o no admite diagnósticos estructurados.","fleet-editor-loading":"Cargando el editor de Fleet…","fleet-editor-load-error":"No se puede cargar el editor de Fleet.","fleet-editor-unavailable":"El editor de Fleet no está disponible en esta ubicación.","fleet-managed":"gestionado por NexusCrew","fleet-custom":"comando personalizado","fleet-managed-help":"Cliente, proveedor e inicio se gestionan internamente; los secretos nunca se muestran.","fleet-shell-engine-help":"La shell local se resuelve en el dispositivo al iniciar; no se guarda ninguna ruta ejecutable en las copias.","fleet-shell-command-placeholder":"comando opcional, p. ej. npm test","fleet-shell-command-help":"Se ejecuta mediante una shell de inicio interactiva (-lic), con PATH y alias del usuario. La celda se detiene al terminar; los fallos inmediatos se notifican.","fleet-shell-command-metachar":"Pipes, redirecciones, variables y otros metacaracteres son interpretados por la shell del dispositivo.","fleet-shell-interactive":"Vacío: abre una shell local interactiva y mantiene la celda activa.","fleet-shell-launch-help":"Configura el comando Shell de la celda en Ajustes → Flota.","fleet-credential-title":"Clave API en este dispositivo","fleet-credential-help":"La clave permanece solo en el nodo seleccionado y nunca se muestra, exporta ni comparte con la red.","fleet-credential-set":"poner clave","fleet-credential-change":"cambiar clave","fleet-credential-forget":"olvidar","fleet-credential-saved":"Clave guardada localmente.","fleet-credential-removed":"Clave local eliminada.","fleet-credential-remove-confirm":"¿Eliminar la clave local {key}?","fleet-credential-source-environment":"entorno","fleet-credential-source-local":"almacén local","fleet-credential-source-compatibility":"config compatible","fleet-credential-source-missing":"ausente","fleet-credential-source-policy":"origen de credencial","fleet-credential-source-policy-auto":"auto (precedencia legacy)","fleet-credential-source-policy-nexuscrew-store":"solo almacén NexusCrew","fleet-credential-source-policy-environment":"solo entorno","fleet-key-section":"KEY","fleet-key-variable":"Variable","fleet-key-value":"Valor para {key}","fleet-key-used-by":"Usada por: {engines}","fleet-key-used-by-none":"Aún no la usa ningún motor configurado en este nodo.","fleet-key-shared-impact":"Sustituir o eliminar {key} afecta a todos los motores listados: {engines}.","fleet-key-enter":"introduce la clave","fleet-key-blank-keeps":"vacío = mantener la fuente actual","fleet-key-reveal":"mostrar","fleet-key-hide":"ocultar","fleet-key-local-help":"El valor permanece write-only en el nodo seleccionado y nunca entra en motores, copias ni federación.","fleet-key-create-missing":"Crear explícitamente el motor sin clave (seguirá como “clave requerida”).","fleet-key-partial-create":"Motor creado; la clave no se guardó. Puedes reintentar sin crear un duplicado.","fleet-key-partial-edit":"Motor actualizado; la clave no se guardó. Los cambios del motor siguen aplicados.","fleet-provider-notice-claude-openrouter":"Claude Code está optimizado para modelos Anthropic; otros proveedores podrían no funcionar correctamente. Fast mode requiere el proveedor Anthropic first-party.","fleet-provider-notice-codex-openrouter":"OpenRouter Responses es beta y stateless; Codex-VL no usa fallback de Chat Completions.","fleet-provider-notice-claude-kimi-code":"Kimi Code usa una configuración Claude aislada con onboarding y fast mode dedicados; la configuración Claude nativa no se modifica.","fleet-provider-notice-alibaba-token-plan":"Token Plan Personal usa solo ALIBABA_CODE_API_KEY de la capa local de credenciales; qwen3.8-max es el modelo predeterminado y no se usa fallback OpenAI/PAYG.","fleet-provider-notice-kimi-native":'Kimi Code CLI nativo usa el login del CLI (device-code) y su propia configuración: NexusCrew no lee ni copia credenciales. Distinto del proveedor "Kimi Code" de Claude Code, que sigue siendo la ruta K3 gestionada.',"fleet-model-default":"modelo predeterminado (opcional)","fleet-model-required":"modelo (obligatorio)","fleet-standard-permissions":"permisos estándar","fleet-unsafe-permissions":"inseguro · omitir aprobaciones/sandbox","fleet-unsafe-warning":"Modo inseguro explícito: el worker puede actuar sin las aprobaciones normales ni las protecciones del sandbox.","fleet-provider-display":"nombre visible del proveedor","fleet-custom-provider-default":"Proveedor personalizado","fleet-api-key-env":"NOMBRE_VARIABLE_API_KEY","fleet-provider-id":"id-proveedor","fleet-custom-secret-help":"NexusCrew guarda solo el nombre de la variable de entorno, nunca su valor.","fleet-model-override":"modelo alternativo","fleet-ready":"listo","fleet-not-ready":"no configurado","fleet-engines":"Motores","fleet-cells":"Celdas / sesiones cloud","fleet-backup":"copia / restauración","fleet-backup-help":"Exporta o restaura selectivamente motores, celdas y system prompts. Tokens, claves API y secretos del proveedor nunca entran en el archivo.","fleet-backup-export":"exportar","fleet-backup-import":"importar","fleet-backup-download":"descargar copia","fleet-backup-restore":"restaurar seleccionadas","fleet-backup-import-help":"Elige una copia JSON, revisa las celdas y selecciona un motor de destino antes de restaurar.","fleet-backup-overwrite":"sobrescribe la celda existente","fleet-backup-new":"celda nueva","fleet-backup-engine-missing":"elige un motor disponible","fleet-backup-restore-unavailable":"El nodo seleccionado solo admite exportación; actualízalo para restaurar copias.","fleet-backup-restored":"{n} celdas restauradas","fleet-backup-confirm-overwrite":"¿Sobrescribir estas celdas? {cells}","fleet-backup-needs-restart":"reinicio necesario: {cells}","fleet-backup-empty":"no hay celdas para exportar","fleet-backup-select-one":"selecciona al menos una celda","fleet-backup-too-large":"copia demasiado grande (máximo 1 MB)","fleet-backup-invalid-json":"el archivo no contiene JSON válido","fleet-backup-invalid-format":"formato o versión de copia no compatible","fleet-backup-invalid-cell":"la copia contiene una celda no válida","fleet-backup-duplicate-cell":"la copia contiene IDs de celda duplicados","fleet-backup-invalid-engine":"la copia contiene un motor no válido","fleet-backup-duplicate-engine":"la copia contiene IDs de motor duplicados","fleet-backup-confirm-engine-overwrite":"¿Sobrescribir estos motores? Los valores de entorno ya configurados en el destino no cambian. {engines}","fleet-backup-env-names":"nombres de entorno","fleet-backup-env-values-required":"los valores de entorno deben configurarse en este dispositivo","fleet-system-prompt":"system prompt",characters:"caracteres","select-all":"seleccionar todas","select-none":"ninguna",edit:"editar",save:"guardar",label:"etiqueta","command-path":"ruta absoluta del comando","args-lines":"argumentos, uno por línea","env-write-only":"Los valores env son de solo escritura: vacío conserva el valor existente.","fleet-new-engine":"Nuevo motor","fleet-new-cell":"Nueva celda","fleet-saved":"Definición guardada.","fleet-restart-confirm":"Cambio guardado. ¿Reiniciar ahora: {cells}?","fleet-remove-engine":'¿Eliminar el motor "{id}"?',"fleet-remove-cell":'¿Eliminar la celda "{id}"? Si está activa se detendrá primero.',"fleet-cwd-needs-repair":"carpeta a reparar","fleet-cwd-repair":"reparar","fleet-cwd-repair-title":"Reparar carpeta de celda {id}","fleet-cwd-repair-help":"La carpeta actual no es portátil en este dispositivo: pertenece a otro dispositivo o no existe bajo el directorio home. Elige una carpeta relativa a home (~) en el dispositivo destino; el backend recalculará la ruta absoluta.","fleet-cwd-repair-no-source-path":"La ruta original no se muestra: es específica del dispositivo de origen.","fleet-cwd-repair-placeholder":"p. ej. Dev","fleet-cwd-repair-preview":"Nueva carpeta: {path}","fleet-cwd-repair-browse":"examinar bajo ~","fleet-cwd-repair-fs-empty":"sin subcarpetas","fleet-cwd-repair-use-current":"usar esta carpeta","fleet-cwd-repair-invalid":'ruta no válida: nada de ruta absoluta, "..", barra invertida ni letra de unidad',"fleet-cwd-repair-confirm":"¿Establecer la carpeta de la celda {id} a {path}? Se recalculará en el dispositivo destino.","fleet-cwd-repair-unportable":"La ruta elegida no es portátil en este dispositivo: debe existir bajo el directorio home.","fleet-cwd-repair-suggestion":"Sugerencia del dispositivo:","fleet-cwd-repair-use-suggestion":"usar {path}","fleet-cwd-repaired":"Carpeta de la celda reparada.","fleet-recovery-kimi-code-consent-yes":"Kimi Code: confirma la clave API personalizada (Yes) en el terminal de la celda, luego reinicia la celda.","fleet-recovery-kimi-code-config-custom-api-key":'Kimi Code: en el terminal de la celda abre /config y activa "Use custom API key", luego reinicia la celda. Si la clave cambió, actualiza la credencial y reintenta.',"fleet-recovery-kimi-cli-login":"Kimi Code CLI: en el terminal de la celda ejecuta /login (código de dispositivo Kimi) o /provider, luego reinicia la celda.","fleet-recovery-client-terminal-dialog":"Completa el diálogo mostrado en el terminal de la celda, luego reinicia la celda.","settings-readonly":"READONLY activo: los cambios están bloqueados por el servidor (NEXUSCREW_READONLY=1)","role-client":"client (hub)","role-client-desc":"esta máquina observa otros nodos vía túneles SSH","role-node":"nodo (alcanzable)","published-port":"puerto publicado (opcional)","no-nodes":"sin nodos remotos configurados","node-add":"conectar una instalación NexusCrew","node-connect-help":"El puerto SSH conecta con el servidor SSH. El puerto NexusCrew es el puerto local indicado por `nexuscrew status` en el nodo remoto.","node-name-label":"Nombre del nodo","node-ssh-label":"Host SSH","pair-ssh-local-label":"Host o alias SSH en este dispositivo","node-ssh-local-help":"Puedes sustituir la dirección del enlace por el mismo alias que funciona con ssh en este dispositivo. Los alias, agentes y claves permanecen locales y nunca viajan en el enlace.","node-ssh-port-label":"Puerto SSH","node-ssh-port-help":"Normalmente 22; usa el puerto público del servidor SSH.","node-app-port-label":"Puerto NexusCrew del nodo","node-app-port-help":"El puerto indicado por `nexuscrew status` en el nodo remoto.","node-name-ph":"nombre (a-z 0-9 -)","node-ssh-ph":"ssh (user@host)","node-port-ph":"puerto remoto (opc.)","node-remove-confirm":"¿Eliminar el nodo «{name}»?","node-remove-warning":"Elimina el emparejamiento, las credenciales y el túnel local. No apaga el dispositivo remoto.","peer-inventory-title":"Nodos conectados al hub","peer-group-hubs":"Hubs directos","peer-group-clients":"Clientes conectados","peer-group-routed":"Nodos accesibles a través de la red","peer-group-vl":"Nodos VL","vl-owners-unavailable":"Owners VL no alcanzados","peer-routed":"enrutado","peer-routed-stale":"enrutado, no accesible","peer-visibility":"Visibilidad en la red","node-test":"test","tunnel-start":"iniciar túnel","tunnel-stop":"detener túnel","tunnel-restart":"reiniciar túnel","share-node":"Compartir este nodo","share-local-heading":"Compartir este dispositivo","share-local-hub":"Hub para compartir","share-local-through":"Compartir {device} mediante {hub}","share-local-active":"Compartido y accesible para la red conectada al hub.","share-local-pending":"Se solicitó compartir, pero el túnel está caído: este dispositivo aún no es accesible.","share-local-private":"Privado: solo este dispositivo puede usar la conexión al hub.","share-local-private-down":"Privado, pero la conexión al hub está caída. Reconecta para aplicar y verificar el modo privado.","share-local-reconnect":"Reconectar y reconciliar","share-off-hub-reconcile-pending":"Estado privado guardado; la revocación en el hub sigue pendiente.","fleet-cell-label":"nombre legible (opcional)","share-off-local-reconcile-pending":"Revocación confirmada por el hub; el túnel local aún debe reconciliarse.","share-reverse-pool-pending":"El canal inverso no se apagó de forma demostrable: queda en cuarentena, no cerrado.","share-node-off-desc":"Privado: sigue conectado al hub, pero otros clientes no pueden alcanzarlo.","share-node-on-desc":"Compartido: el hub puede anunciarlo y enrutar celdas y decks autorizados.","peer-shared":"Nodo cliente compartido en la red Hydra","peer-private":"Nodo cliente privado: conectado, no publicado en Hydra","peer-vl-federated":"Nodo VL: federado","row-vl-federated":"federado","node-connected-client":"cliente conectado","transport-used":"en uso","tunnel-up":"túnel activo","tunnel-down":"túnel caído","vl-poll-online":"en línea (poll)","vl-poll-offline":"sin respuesta","authorized-keys-hint":"pega esta línea en ~/.ssh/authorized_keys del host remoto:",copy:"copiar",copied:"copiado","token-rotate":"rotar token","token-rotate-explain":"El nuevo token NO se mostrará: recupéralo con `nexuscrew show token`. La sesión actual quedará invalidada.","service-regenerate":"regenerar service","npm-auto-update":"actualizaciones automáticas desde npm","npm-auto-update-help":"Comprueba latest periódicamente e instala solo versiones más recientes. Nunca baja de versión.","npm-update-current":"instalada","npm-update-latest":"npm latest","npm-update-check":"comprobar ahora","npm-update-install":"actualizar ahora","npm-update-restarting":"Actualización iniciada; NexusCrew volverá después de reiniciar el servicio.","npm-update-idle":"actualizado","npm-update-checking":"comprobando","npm-update-available":"actualización disponible","npm-update-installing":"instalando","npm-update-installed":"instalada, reiniciando","npm-update-error":"comprobación fallida","npm-update-unsupported":"disponible solo con instalación npm global","service-installed":"service instalado","service-missing":"service no instalado","service-active":"activo","service-inactive":"no activo",confirm:"confirmar",add:"añadir",enable:"activar","wizard-title":"bienvenido a NexusCrew","wizard-skip":"configura después desde ajustes","wizard-step-roles":"roles de esta instalación","wizard-step-node":"primer nodo remoto (opcional)","wizard-done":"todo listo","wizard-done-desc":"configuración completa — puedes cambiarlo todo desde ajustes",next:"continuar",back:"atrás",skip:"omitir",finish:"terminar","err-node-name":"nombre inválido (a-z, 0-9, -, máx 32)","err-local-name":"nombre local inválido: usa un slug único, no “localhost”","err-ssh":"ssh inválido (se espera user@host o alias)","err-port":"puerto inválido (1–65535)","err-ssh-port":"puerto SSH inválido (1–65535)","err-node-port":"puerto NexusCrew inválido (1–65535)","node-sessions":"{n} sesiones","tunnel-down-since":"túnel caído desde hace {t}","node-unreachable":"nodo inalcanzable","node-passive":"cliente desconectado · estado normal","node-offline":"nodo desconectado","node-offline-seen":"sin conexión · visto hace {t}","node-needs-repair":"legacy · vuelve a enlazar","asks-title":"preguntas de las celdas","ask-dismiss":"Descartar la pregunta","ask-reply-ph":"escribe la respuesta…","push-enable":"activar notificaciones push","push-disable":"desactivar notificaciones push","push-on":"push activas en este dispositivo","push-off":"push no activas","push-denied":"permiso de notificaciones denegado por el navegador","push-unsupported":"push no soportadas en este navegador","notification-speech-enable":"leer las notificaciones en voz alta","notification-speech-help":"Usa la voz del navegador solo para notificaciones nuevas mientras esta PWA está visible y en primer plano. Con la aplicación cerrada permanece la notificación del sistema.","notification-speech-test":"probar voz","notification-speech-testing":"probando voz…","notification-speech-preview":"NexusCrew. Las notificaciones por voz están activas.","notification-speech-preview-ok":"Prueba de voz completada.","notification-speech-preview-failed":"El navegador no inició la prueba de voz. Interactúa con la página y vuelve a intentarlo.","notification-speech-needs-test":"Para esta sesión de la aplicación, pulsa “probar voz” antes de recibir avisos hablados.","notification-speech-unsupported":"La síntesis de voz no está disponible en este navegador.","audio-title":"Audio nativo del nodo","audio-help":"El consentimiento y los controles valen solo para este dispositivo. Compartir y visibilidad no autorizan sonidos.","audio-consent":"permitir TTS en este nodo","audio-consent-help":"Permite que celdas autorizadas, locales o remotas, entreguen un comando de voz. Puedes revocarlo en cualquier momento.","audio-capability":"Capacidad local","audio-loading":"leyendo el estado de audio local…","audio-adapter":"adaptador","audio-adapter-none":"ninguno","audio-installed":"instalado","audio-installed-yes":"sí","audio-installed-no":"no","audio-liveness":"disponibilidad","audio-liveness-ready":"listo para aceptar","audio-liveness-unavailable":"no disponible","audio-languages":"idiomas declarados","audio-limits":"límites","audio-test":"probar audio local","audio-testing":"probando audio…","audio-stop":"detener audio local","audio-stopping":"deteniendo audio…","audio-test-needs-consent":"Activa el consentimiento local antes de probar la voz.","audio-unavailable":"No hay un adaptador TTS nativo disponible en este nodo.","audio-test-accepted":"El nodo aceptó la prueba. No demuestra que alguien la haya oído.","audio-test-refused":"El nodo rechazó la prueba.","audio-test-unknown":"Resultado de prueba desconocido: el nodo no pudo confirmar el inicio.","audio-stop-stopped":"Audio local detenido.","audio-stop-idle":"No hay enunciado local que detener.","audio-groups-title":"Grupos de audio compartido","audio-groups-help":"Decide en qué dispositivos se oye la voz cuando habla una celda. Un grupo es una preferencia local de entrega, no un consentimiento. Cada nodo conserva su consentimiento, ACL, disponibilidad y Stop local.","audio-groups-empty":"Sin grupos: la voz sale solo por este nodo.","audio-group-name":"nombre del grupo","audio-group-mode":"modo de entrega","audio-group-primary":"primero disponible (en orden)","audio-group-fanout":"todos los nodos enumerados","audio-group-targets":"nodos destino exactos","audio-group-local":"este nodo","audio-group-unavailable-target":"no detectado ahora","audio-group-no-targets":"No hay ningún nodo con instanceId disponible. Un grupo no puede usar nombres, comodines ni “todos”.","audio-group-new":"nuevo grupo","audio-group-edit":"editar","audio-group-delete":"eliminar","audio-group-save":"guardar grupo","audio-group-cancel":"cancelar","audio-group-invalid":"El grupo necesita un nombre válido y al menos un nodeId exacto.","audio-group-save-failed":"No se pudo guardar el grupo de audio.","node-display-label":"Nombre (etiqueta)","routed-node-aliases":"Alias de nodos enrutados","routed-node-aliases-help":"Visibles solo en este dispositivo; la ruta y el nombre remoto no cambian.","node-local-alias":"Alias en este dispositivo","alias-on-device":"Alias en este dispositivo","reset-alias":"Restablecer nombre remoto","node-slug-hint":"enrutado por slug: {slug}","device-name-label":"Nombre del dispositivo","device-name-hint":"cómo te ven los pares (editable)","local-route-name-label":"Nombre local / ruta","local-route-name-hint":"identificador técnico estable: etiqueta legible + sufijo del nodeId; editable antes de conectar","err-label":"etiqueta no válida (máx 64 caracteres, sin saltos de línea)","fleet-inventory":"Celdas y sesiones","fleet-inventory-help":"todas las posiciones (Local + rutas Hydra)","fleet-manage-location":"Gestionar ubicación","fleet-network-overview":"Vista de red","fleet-manage-help":"crea y configura celdas en la ubicación seleccionada","fleet-overview-help":"estado operativo de todas las ubicaciones, separado del editor","fleet-inventory-empty":"sin celdas ni sesiones","cell-switcher-refreshing":"actualizando celdas…","cell-switcher-empty-active":"no hay celdas activas verificadas","cell-switcher-not-confirmed":"estado sin confirmar","cell-switcher-not-active":"esta celda ya no está activa","cell-switcher-select":"selecciona una celda","cell-switcher-open":"abrir celda","cell-switcher-show-all":"todas","cell-switcher-show-active":"activas","cell-switcher-close":"cerrar selector de celdas","fleet-not-available":"fleet no disponible en esta posición",start:"iniciar",stop:"detener",restart:"reiniciar",delete:"eliminar","copy-manual":"copia fallida — selecciona y pulsa Cmd+C, o copia a mano","copy-empty":"nada seleccionado: arrastra con Shift para seleccionar","selection-held":"resaltado perdido, texto aún retenido","invite-hub-only":"Una invitación se acuña en el hub. Admitir un nodo nuevo es lo único que un nodo conectado no puede pedir en nombre de otro: abre NexusCrew en el hub y créala allí.","row-private":"privado","node-detail-open":"abrir el detalle","node-detail-reach":"Alcanzabilidad","node-detail-route":"ruta","node-detail-ssh":"SSH","node-detail-transport":"transporte","node-detail-owner":"propietario","node-detail-authority":"Qué puede hacer este nodo","authority-owner-equivalent":"Autoridad igual a la tuya: un nodo emparejado puede hacer en esta máquina todo lo que puedes hacer tú.","authority-routed":"No está emparejado con esta máquina: su autoridad vive en el hub que lo enruta.","authority-no-grants":"El único poder por nodo que existe es la elección de celdas, más abajo. Dentro de esas celdas la autoridad sigue siendo plena.","authority-no-grants-elsewhere":"El único poder por nodo que existe es la elección de celdas, y se configura en la instalación que las posee — no aquí.","node-detail-network-view":"Qué ve de esta red","node-detail-command":"Comando","vl-no-commands":"El dispositivo no declara comandos disponibles.","vl-events-title":"Sesión","vl-events-empty":"Ningún evento en memoria: la sesión aún no ha hablado, o lo que dijo ha salido del búfer. El historial queda en el dispositivo.","vl-events-gap":"eventos no recibidos:","vl-events-truncated":"contenido truncado por el dispositivo","vl-events-turn-end":"— fin del turno —","vl-events-done":"— fin de la respuesta —","vl-events-writer-epoch":"— cambio de escritor —","vl-events-tool":"herramienta","vl-events-tool-ok":"terminada","vl-events-tool-failed":"fallida","vl-events-usage":"consumo actualizado","vl-events-stale":"Actualización fallida: puede que no estés viendo lo último.","vl-cmd-phase-submitted":"enviado, a la espera de confirmación","vl-cmd-phase-inflight":"en curso","vl-cmd-phase-done-ok":"completado","vl-cmd-phase-done-error":"fallido","vl-cmd-status":"estado","vl-cmd-health":"salud","vl-cmd-start":"iniciar","vl-cmd-stop":"detener","vl-cmd-restart":"reiniciar","vl-cmd-version":"versión","vl-cmd-capabilities":"capacidades","vl-cmd-logs":"logs","vl-cmd-prompt":"prompt","vl-prompt-placeholder":"escribe el prompt para la sesión del dispositivo…","vl-prompt-send":"enviar prompt","vl-cmd-unpair":"desemparejar","node-grant-none":"Ningún nodo elegido: compartido, pero hacia nadie.","node-grant-unknown":"ya no está en el inventario","node-grant-remove":"quitar","node-grant-add":"Añadir un nodo","node-grant-search":"Buscar entre los nodos","node-grant-no-candidates":"Ningún nodo coincide.","cell-scope":"Celdas visibles para este nodo","cell-scope-help":"Se aplica a lo que este nodo lista y a lo que puede tocar, incluido el terminal. Dentro de las celdas concedidas sigue siendo un nodo emparejado por completo: no es un sandbox.","cell-scope-all":"todas las celdas","cell-scope-none":"ninguna celda","cell-scope-selected":"celdas seleccionadas","cell-scope-none-granted":"Ninguna celda elegida: este nodo no ve ninguna.","cell-scope-unknown":"la celda ya no existe","cell-scope-add":"Añadir una celda","cell-scope-search":"Buscar entre las celdas","cell-scope-no-candidates":"Ninguna celda coincide.","cell-scope-reset-warning":"Al cambiar de modo la lista se borra: volver a «celdas seleccionadas» obliga a elegirlas de nuevo.","cell-scope-list-unavailable":"Lista de celdas no disponible ahora: las concesiones de abajo siguen vigentes, pero no se puede saber si aún existen.","single-view":"vista única",retract:"reducir","keybar-expand":"ampliar la barra de teclas","keybar-retract":"reducir la barra de teclas","save-and-start":"guardar e iniciar",permissions:"Permisos","power-on-hint":"Detén la celda; también puedes quitarla del boot.","launch-engine-help":"Proveedores, credenciales y nuevos motores se crean en Ajustes → Flota. Modelo y permisos son por celda.","launch-unavailable-hint":"La configuración del motor no está disponible en este nodo.","import-as-cell":"Importar como celda","import-help":"Reconcilia una sesión tmux existente en una celda gestionada. Elige un motor ya declarado: no se inventa ninguno.","import-engine-required":"elige un motor (obligatorio)","test-and-connect":"probar y conectar","pairing-v2-hint":"Pega o escanea UN solo enlace: rellena nombre, Host SSH y etiqueta cuando los incluye (v2).","invite-v2-hint":"Crea una invitación de un solo uso. Hace falta la dirección SSH de este dispositivo, alcanzable por quien la use.","invite-target-local":"El nuevo dispositivo entrará en","invite-target-this":"este dispositivo","invite-endpoint-label":"Dirección SSH de este hub vista por los otros dispositivos","invite-endpoint-auto":"Endpoint ya configurado","invite-endpoint-needed":"Introduce usuario@host o un alias SSH compartido. No es 127.0.0.1 ni la URL HTTP de NexusCrew.","invite-ssh-hint":"El destino SSH con el que el OTRO dispositivo alcanza ESTA instalación (usuario@host o alias). Obligatorio: se incluye en el enlace.","invite-next-steps":"copia este enlace, abre NexusCrew en el otro dispositivo y pégalo en Ajustes → Nodos (o escanea el QR): NexusCrew hace el resto","pair-card-title":"conectar con un solo enlace","pair-card-help":"Pega el enlace de emparejamiento generado en el otro dispositivo (o escanea su QR): NexusCrew lo decodifica, prueba la conexión SSH y conecta solo.","pair-paste-ph":"pega aquí el enlace de emparejamiento","pair-paste-btn":"pegar","pair-advanced":"avanzado / editar","pair-progress":"conectando: SSH → invitación → confirmación → verificación…","pair-retry":"reintentar","pair-invalid-link":"esto no es un enlace de emparejamiento válido","pair-invalid-hint":"se necesita el enlace completo (http://…#pair=…) generado por el otro NexusCrew: no lo abras, pégalo aquí","pair-missing-ssh":"el enlace no incluye el destino SSH (formato v1): indica en “avanzado” cómo este dispositivo alcanza al otro por SSH — nunca se inventa","pair-missing-name":"falta el nombre del nodo: complétalo en “avanzado”","pair-clipboard-denied":"lectura del portapapeles no permitida: pega manualmente en el campo","pair-clipboard-empty":"portapapeles vacío: copia primero el enlace","pair-stage-validation":"datos no válidos","pair-stage-conflict":"nombre ya en uso","pair-stage-ssh-start":"fallo al iniciar el túnel SSH","pair-stage-ssh-ready":"peer inaccesible por SSH","pair-stage-join":"intercambio de invitación fallido","pair-stage-tunnel-final":"túnel negociado fallido","pair-stage-confirm":"confirmación de emparejamiento fallida","pair-stage-health":"verificación final de la federación fallida","pair-stage-internal":"error interno","pair-stage-generic":"conexión fallida","qr-no-camera":"no hay cámara disponible en este dispositivo: usa una foto del QR","qr-permission":"permiso de cámara denegado: permítelo en el navegador o usa una foto del QR","qr-unsupported":"escáner en vivo no soportado aquí: sube una foto del QR","qr-upload":"usar una foto"}};function Ol(){const e=cy(),t=e?e.getItem(ly):null;return tf.includes(t)?t:jl}function cx(e){const t=cy();if(t)try{t.setItem(ly,e)}catch{}typeof window<"u"&&window.dispatchEvent(new Event(Kd))}function f(e){const t=Ol(),n=gl[t]||gl[jl];return Object.prototype.hasOwnProperty.call(n,e)?n[e]:Object.prototype.hasOwnProperty.call(gl[jl],e)?gl[jl][e]:e}function ux(e){return typeof window>"u"?()=>{}:(window.addEventListener(Kd,e),()=>window.removeEventListener(Kd,e))}const uy=tf;function kn(){return[N.useSyncExternalStore(ux,Ol,Ol),cx]}function Bl({cell:e,token:t,route:n=[],onConfirm:s,onClose:o}){var $,W;kn();const a=!!(e&&e.active),u=Array.isArray(n)?n.join("/"):"",[h,p]=N.useState([]),[m,v]=N.useState(!1);N.useEffect(()=>{let x=!0;return(async()=>{if(t)try{const M=await ws(t,u?u.split("/"):[]);if(!x)return;if(v(M.provider==="builtin"&&(M.capabilities||[]).includes("edit")),M.provider==="builtin"&&(M.capabilities||[]).includes("definitions")){const D=await Jl(t,u?u.split("/"):[]);if(!x)return;const A=new Map((M.engines||[]).map(K=>[K.id,K]));p((D.engines||[]).map(K=>{var X,se,ce,fe,we,me,be;return{id:K.id,label:K.label||K.id,client:((X=K.managed)==null?void 0:X.client)||"",models:[...new Set([...((se=A.get(K.id))==null?void 0:se.models)||[],...((ce=K.managedInfo)==null?void 0:ce.models)||[]])].filter(Boolean),defaultModel:((fe=K.managed)==null?void 0:fe.model)||((we=K.managedInfo)==null?void 0:we.defaultModel)||"",policyDefault:((me=K.managed)==null?void 0:me.permissionPolicy)||((be=K.managed)!=null&&be.client&&K.managed.client==="claude"?"unsafe":"standard")}}))}}catch{}})(),()=>{x=!1}},[t,u]);const S=(e==null?void 0:e.engine)||(($=h[0])==null?void 0:$.id)||"",y=x=>(e==null?void 0:e.models)&&e.models[x]||"",b=x=>{const M=(e==null?void 0:e.permissionPolicies)&&e.permissionPolicies[x];if(M==="standard"||M==="unsafe")return M;const D=h.find(A=>A.id===x);return D?D.policyDefault:"standard"},[w,k]=N.useState(S),[C,R]=N.useState((e==null?void 0:e.model)||""),E=(e==null?void 0:e.permissionPolicy)==="standard"||(e==null?void 0:e.permissionPolicy)==="unsafe"?e.permissionPolicy:((W=e==null?void 0:e.permissionPolicies)==null?void 0:W[e==null?void 0:e.engine])||"",[F,O]=N.useState(E),[q,Y]=N.useState((e==null?void 0:e.boot)??!0),[z,Z]=N.useState(!1),[G,Q]=N.useState(null);N.useEffect(()=>{h.length&&(k(x=>x||S),R(x=>x||y((e==null?void 0:e.engine)||S)||""),O(x=>x==="standard"||x==="unsafe"?x:b((e==null?void 0:e.engine)||S)))},[h.length]);const B=N.useMemo(()=>h.find(x=>x.id===w)||null,[h,w]),I=!!(B&&["claude","codex","codex-vl","agy","kimi"].includes(B.client)),j=(B==null?void 0:B.client)==="shell";function T(x){k(x);const M=h.find(D=>D.id===x);R(y(x)||(M==null?void 0:M.defaultModel)||""),O(b(x))}async function L(x){x.preventDefault(),Z(!0),Q(null);try{if(a)await s({action:"down",boot:q});else{const M=F==="standard"||F==="unsafe"?F:(B==null?void 0:B.policyDefault)||"standard";await s({action:"up",...m?{engine:w,model:C||"",...I?{permissionPolicy:M}:(B==null?void 0:B.client)==="pi"?{permissionPolicy:"standard"}:{}}:{},boot:q})}o()}catch(M){Q(String(M&&M.message||M)),Z(!1)}}return c.jsx("div",{className:"nc-sheet-overlay nc-launch-overlay",onClick:o,children:c.jsxs("form",{className:"nc-sheet nc-power-sheet nc-launch-sheet",onClick:x=>x.stopPropagation(),onSubmit:L,children:[c.jsxs("div",{className:"nc-sheet-head",children:[c.jsx("b",{children:e==null?void 0:e.cell}),c.jsx("span",{className:"nc-sheet-state",children:f(a?"state-on":"state-off")})]}),a?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"nc-power-config",children:[c.jsx("span",{children:f("engine")}),c.jsx("b",{children:(e==null?void 0:e.engine)||"—"}),(e==null?void 0:e.model)&&c.jsxs("small",{children:[f("model"),": ",e.model]}),c.jsx("small",{children:f("power-on-hint")})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:q,onChange:x=>Y(x.target.checked)}),f("remove-boot")]})]}):c.jsxs(c.Fragment,{children:[m&&h.length>0?c.jsxs("div",{className:"nc-launch-fields",children:[c.jsxs("label",{className:"nc-field",children:[f("engine"),c.jsx("select",{value:w,onChange:x=>T(x.target.value),children:h.map(x=>c.jsx("option",{value:x.id,children:x.label},x.id))})]}),!j&&c.jsxs("label",{className:"nc-field",children:[f("model"),c.jsx("input",{value:C,list:"nc-launch-models",placeholder:f("model-default"),onChange:x=>R(x.target.value)}),c.jsx("datalist",{id:"nc-launch-models",children:((B==null?void 0:B.models)||[]).map(x=>c.jsx("option",{value:x},x))})]}),I?c.jsxs("label",{className:"nc-field",children:[f("permissions"),c.jsxs("select",{value:F,onChange:x=>O(x.target.value),children:[c.jsx("option",{value:"standard",children:f("fleet-standard-permissions")}),c.jsx("option",{value:"unsafe",children:f("fleet-unsafe-permissions")})]})]}):c.jsx("small",{className:"nc-note",children:f("fleet-standard-permissions")}),I&&F==="unsafe"&&c.jsx("small",{className:"nc-err",children:f("fleet-unsafe-warning")}),c.jsx("small",{className:"nc-note",children:f(j?"fleet-shell-launch-help":"launch-engine-help")})]}):c.jsxs("div",{className:"nc-power-config",children:[c.jsx("span",{children:f("engine")}),c.jsx("b",{children:(e==null?void 0:e.engine)||"—"}),(e==null?void 0:e.model)&&c.jsxs("small",{children:[f("model"),": ",e.model]}),c.jsx("small",{children:f("launch-unavailable-hint")})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:q,onChange:x=>Y(x.target.checked)}),f("boot-persist")]})]}),G&&c.jsx("div",{className:"nc-err",children:G}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:o,disabled:z,children:f("cancel")}),c.jsx("button",{type:"submit",className:"nc-btn primary",disabled:z,children:f(a?"power-off":"save-and-start")})]})]})})}const jg=/^[a-z0-9-]{1,32}$/;function Go(e,t){const n=Array.isArray(e)?e:[];return n.length?`${n.map(encodeURIComponent).join("/")}:${t}`:String(t)}function dx(e,t,n){const s={};for(const o of Array.isArray(t)?t:[]){const a=Array.isArray(o==null?void 0:o.route)?o.route:typeof(o==null?void 0:o.name)=="string"?[o.name]:[];if(!a.length)continue;const u=a.join("/"),h=o.status==="up"||o.tunnel&&o.tunnel.status==="up",p=o.status==="passive"||o.tunnel&&o.tunnel.status==="passive";!h&&!p&&(s[u]=e&&e[u]||n)}return s}function Rg(e,t,n){return!e||!Array.isArray(e.cells)?[]:e.cells.map(s=>({...s,route:t,key:`${n}:${s.tmuxSession||s.cell}`}))}function Pg({nodes:e,topology:t,remote:n,down:s,fleet:o,aliases:a}={}){var m,v,S,y;const u=[],h=new Set,p=new Set;for(const b of Array.isArray(e)?e:[]){if(!b||typeof b.name!="string"||!jg.test(b.name)||b.direction==="inbound"&&b.shared!==!0)continue;const w=[b.name],k=b.name;h.add(k);const C=((m=b.tunnel)==null?void 0:m.status)||"unknown",R=C==="up",E={name:b.name,label:b.label||b.name,originalLabel:b.label||b.name,alias:null,route:w,direct:!0,instanceId:b.nodeId||null,shared:b.shared===!0,tunnelStatus:C,sessions:[],cells:[],unmanaged:[],fleetAvailable:!1,capabilities:[],engines:[],health:b.health||null,direction:b.direction||"outbound",roles:b.roles||null,rolesKnown:b.rolesKnown===!0};if(b.nodeId&&p.add(b.nodeId),!b.nodeId&&b.paired===!1){u.push({...E,status:"needs-repair",downSince:s&&s[k]||null});continue}if(((v=b.health)==null?void 0:v.auth)==="failed"||C==="degraded"&&((S=b.health)==null?void 0:S.status)==="degraded"){u.push({...E,status:"needs-repair",downSince:s&&s[k]||null});continue}if(C==="passive"||((y=b.health)==null?void 0:y.status)==="passive"){u.push({...E,status:"passive",downSince:null});continue}if(!R){u.push({...E,status:"down",downSince:s&&s[k]||null});continue}const F=n&&(n[k]||n[b.name])||null,O=o&&(o[k]||o[b.name]),q=!!(F&&!F.error&&Array.isArray(F.sessions)),Y=!!(O&&O.available===!0&&Array.isArray(O.cells));if(!q&&!Y){u.push({...E,status:"unreachable"});continue}const z=(q?F.sessions:[]).filter(Q=>Q&&typeof Q.name=="string"&&Q.name).map(Q=>({...Q,node:k,route:w,key:`${k}:${Q.name}`})),Z=Rg(O,w,k),G=new Set(Z.map(Q=>Q.tmuxSession).filter(Boolean));u.push({...E,status:"up",sessions:z,cells:Z,unmanaged:z.filter(Q=>!G.has(Q.name)),fleetAvailable:!!(O&&O.available),capabilities:O&&O.capabilities||[],engines:O&&O.engines||[],fleetProvider:O&&O.provider||null,sessionsAvailable:q,inventoryPartial:!q})}for(const b of Array.isArray(t)?t:[]){if(!b||!Array.isArray(b.route)||b.route.length<1||b.route.some(G=>!jg.test(G)))continue;const w=b.route.join("/");if(h.has(w)||b.instanceId&&p.has(b.instanceId))continue;b.instanceId&&p.add(b.instanceId);const k=b.label||b.route.join(" › "),C=b.instanceId&&a&&typeof a[b.instanceId]=="string"?a[b.instanceId]:null,R={name:b.name,label:C||k,originalLabel:k,alias:C,route:[...b.route],direct:!1,instanceId:b.instanceId||null,shared:!0,tunnelStatus:null,sessions:[],cells:[],unmanaged:[],fleetAvailable:!1,capabilities:[],engines:[],health:b.health||null,lastSeen:b.lastSeen||null};if(b.stale){u.push({...R,status:"offline",downSince:s&&s[w]||b.lastSeen||null});continue}const E=n&&n[w]||null,F=o&&o[w],O=!!(E&&!E.error&&Array.isArray(E.sessions)),q=!!(F&&F.available===!0&&Array.isArray(F.cells));if(!O&&!q){u.push({...R,status:"unreachable",downSince:s&&s[w]||null});continue}const Y=(O?E.sessions:[]).filter(G=>G&&typeof G.name=="string"&&G.name).map(G=>({...G,node:w,route:b.route,key:`${w}:${G.name}`})),z=Rg(F,b.route,w),Z=new Set(z.map(G=>G.tmuxSession).filter(Boolean));u.push({...R,status:"up",sessions:Y,cells:z,unmanaged:Y.filter(G=>!Z.has(G.name)),fleetAvailable:!!(F&&F.available),capabilities:F&&F.capabilities||[],engines:F&&F.engines||[],fleetProvider:F&&F.provider||null,lastSeen:b.lastSeen||null,sessionsAvailable:O,inventoryPartial:!O})}return u.sort((b,w)=>b.label.localeCompare(w.label))}function dy(e,t={}){if(!e||typeof e!="object")return null;const n=typeof e.nodeId=="string"?e.nodeId:"";if(!n)return null;const s=typeof e.label=="string"&&e.label.trim()||typeof e.cell=="string"&&e.cell.trim()||n,o=Array.isArray(t.route)?[...t.route]:[];return{kind:"vl",nodeId:n,name:n,label:s,cell:e.cell??null,paired:!!e.pairedAt,online:!!e.online,lastSeen:e.lastSeen??null,generation:e.generation??null,version:e.version??null,health:e.health??null,session:e.session??null,capabilities:Array.isArray(e.capabilities)?e.capabilities:[],inflight:e.inflight??null,lastAck:e.lastAck??null,canManage:!!e.canManage,route:o,isLocal:o.length===0,ownerInstanceId:typeof t.instanceId=="string"?t.instanceId:null,ownerLabel:typeof t.label=="string"&&t.label?t.label:null}}function hx(e){var n;const t=[];for(const s of Array.isArray(e)?e:[]){if(!s||s.kind!=="vl"||!s.nodeId)continue;const o=s.online===!0,a=o&&((n=s.session)==null?void 0:n.attached)===!0,u=s.ownerInstanceId||"local";t.push({kind:"vl",name:`vl-${s.nodeId.slice(0,8)}`,label:s.label,route:Array.isArray(s.route)?[...s.route]:[],instanceId:null,direct:!1,status:o?"up":"offline",downSince:o?null:s.lastSeen??null,sessions:a?[{key:`vl:${u}:${s.nodeId}`,name:s.session.profile,attached:!0}]:[],cells:[],unmanaged:[],fleetAvailable:!1,capabilities:[],engines:[],health:s.health??null,peer:s})}return t}function hy(e,t){const n=e&&Array.isArray(e.nodes)?e.nodes:[],s=new Set([t]),o=[];for(const a of n){const u=a&&typeof a.instanceId=="string"?a.instanceId:"";if(!u||s.has(u)||a.stale===!0||!Array.isArray(a.route)||a.route.length===0)continue;s.add(u);const h=typeof a.label=="string"&&a.label||typeof a.name=="string"&&a.name||a.route.join(" › ");o.push({instanceId:u,route:[...a.route],label:h})}return o}const fx=4e3;function nf(e,t=!0,n=0){const[s,o]=N.useState([]),a=N.useRef({});return N.useEffect(()=>{if(!t||!e){o([]);return}let u=!0;async function h(){var O;let m=[],v=[],S={},y="";if(await Promise.all([k0(e).then(q=>{m=Array.isArray(q.nodes)?q.nodes:[]}).catch(()=>{}),iy(e).then(q=>{v=Array.isArray(q.nodes)?q.nodes:[]}).catch(()=>{}),P0(e).then(q=>{S=q&&typeof q.aliasesByInstanceId=="object"?q.aliasesByInstanceId:{}}).catch(()=>{}),Ht("/api/config",e).then(q=>q.json()).then(q=>{y=q&&typeof q.instanceId=="string"?q.instanceId:""}).catch(()=>{})]),!u)return;const b=[{instanceId:y||null,route:[],label:null},...hy({nodes:v},y)],w=[];if(await Promise.all(b.map(async q=>{try{const Y=await ny(e,q.route);for(const z of Y.nodes||[]){const Z=dy(z,q);Z&&w.push(Z)}}catch{}})),!u)return;const k={},C={},R=new Set(m.map(q=>q.name)),E=[];for(const q of m)((O=q.tunnel)==null?void 0:O.status)==="up"&&(q.nodeId||q.paired!==!1)&&(q.direction!=="inbound"||q.shared===!0)&&E.push([q.name]);for(const q of v)!q.stale&&Array.isArray(q.route)&&q.route.length>0&&!(q.route.length===1&&R.has(q.route[0]))&&E.push(q.route);if(await Promise.all(E.map(async q=>{const Y=q.join("/");try{k[Y]=await Jh(e,q)}catch{k[Y]={error:"unreachable"}}try{C[Y]=await ws(e,q)}catch{C[Y]={available:!1}}})),!u)return;const F=Pg({nodes:m,topology:v,remote:k,fleet:C,aliases:S,down:a.current});a.current=dx(a.current,F,Math.floor(Date.now()/1e3)),o([...Pg({nodes:m,topology:v,remote:k,fleet:C,aliases:S,down:a.current}),...hx(w)])}h();const p=setInterval(h,fx);return()=>{u=!1,clearInterval(p)}},[e,t,n]),s}const Lg=52,Ag=14;function bi({position:e,itemKey:t,label:n,onMove:s,onStep:o,canMove:a=()=>!0,scope:u="roster"}){const h=N.useRef(null),p=N.useRef(0),[m,v]=N.useState(!1),S=()=>{var R,E,F,O;const C=h.current;(E=(R=C==null?void 0:C.over)==null?void 0:R.classList)==null||E.remove("nc-roster-over"),(O=(F=C==null?void 0:C.source)==null?void 0:F.classList)==null||O.remove("nc-roster-dragging"),p.current&&cancelAnimationFrame(p.current),p.current=0},y=(C=!1)=>{const R=h.current;if(!R)return;const E=R.target;S(),h.current=null,v(!1);try{R.handle.releasePointerCapture(R.pointerId)}catch{}C&&E&&E!==t&&a(t,E)&&s(t,E)},b=(C,R)=>{var Z,G,Q,B,I,j,T,L,$;const E=h.current;if(!E)return;E.x=C,E.y=R;const F=u==="node"?"[data-node-order-key]":"[data-roster-key][data-position]",O=(G=(Z=document.elementFromPoint(C,R))==null?void 0:Z.closest)==null?void 0:G.call(Z,F),q=u==="node"?(Q=O==null?void 0:O.dataset)==null?void 0:Q.nodeOrderKey:(B=O==null?void 0:O.dataset)==null?void 0:B.rosterKey,z=(u==="node"||((I=O==null?void 0:O.dataset)==null?void 0:I.position)===e)&&q&&q!==t&&a(t,q);E.over!==(z?O:null)&&((T=(j=E.over)==null?void 0:j.classList)==null||T.remove("nc-roster-over"),E.over=z?O:null,($=(L=E.over)==null?void 0:L.classList)==null||$.add("nc-roster-over")),E.target=z?q:null},w=()=>{const C=h.current;if(!C){p.current=0;return}const R=C.container;if(R){const E=R.getBoundingClientRect(),F=C.y<E.top+Lg?-Ag:C.y>E.bottom-Lg?Ag:0;F&&(R.scrollTop+=F,b(C.x,C.y))}p.current=requestAnimationFrame(w)};N.useEffect(()=>{const C=E=>{E.key==="Escape"&&h.current&&(E.preventDefault(),y(!1))},R=()=>y(!1);return window.addEventListener("keydown",C),window.addEventListener("blur",R),()=>{window.removeEventListener("keydown",C),window.removeEventListener("blur",R),S(),h.current=null}},[t,e,u]);const k=C=>{var O;if(C.pointerType==="mouse"&&C.button!==0)return;C.preventDefault(),C.stopPropagation(),C.currentTarget.focus({preventScroll:!0});const R=u==="node"?"[data-node-order-key]":"[data-roster-key][data-position]",E=C.currentTarget.closest(R),F=C.currentTarget.closest(".nc-side-scroll, .nc-home-scroll, .nc-cell-switcher-list");h.current={pointerId:C.pointerId,handle:C.currentTarget,source:E,container:F,target:null,over:null,x:C.clientX,y:C.clientY},(O=E==null?void 0:E.classList)==null||O.add("nc-roster-dragging");try{C.currentTarget.setPointerCapture(C.pointerId)}catch{}v(!0),p.current=requestAnimationFrame(w)};return c.jsx("button",{type:"button",className:`nc-roster-handle${m?" active":""}`,"aria-label":`${f("reorder")} ${n}`,"aria-keyshortcuts":"ArrowUp ArrowDown",title:f("reorder-help"),onClick:C=>{C.preventDefault(),C.stopPropagation()},onDragStart:C=>C.preventDefault(),onKeyDown:C=>{C.key!=="ArrowUp"&&C.key!=="ArrowDown"||(C.preventDefault(),C.stopPropagation(),o(C.key==="ArrowUp"?-1:1))},onPointerDown:k,onPointerMove:C=>{!h.current||C.pointerId!==h.current.pointerId||(C.preventDefault(),C.stopPropagation(),b(C.clientX,C.clientY))},onPointerUp:C=>{!h.current||C.pointerId!==h.current.pointerId||(C.preventDefault(),C.stopPropagation(),y(!0))},onPointerCancel:()=>y(!1),onLostPointerCapture:()=>{h.current&&y(!1)},children:"↕"})}const sf="nc_pins";function px(){try{const e=JSON.parse(localStorage.getItem(sf));return Array.isArray(e)?e:[]}catch{return[]}}function mx(e,t){const n=e.includes(t)?e.filter(s=>s!==t):[...e,t];try{localStorage.setItem(sf,JSON.stringify(n))}catch{}return n}function gx(e,t,n){if(!e.includes(t)||!e.includes(n)||t===n)return e;const s=[...e],o=s.indexOf(t),a=s.indexOf(n);s.splice(o,1);const u=s.indexOf(n);s.splice(o<a?u+1:u,0,t);try{localStorage.setItem(sf,JSON.stringify(s))}catch{}return s}function vx(e,t,n){const s=e.indexOf(t);return[s===-1?1e9:s,-(n||0)]}function _x(e,t){return e[0]-t[0]||e[1]-t[1]}function rf(){const[e,t]=N.useState(px),[n,s]=N.useState(ox),[o,a]=N.useState(ix),u=y=>t(b=>mx(b,y)),h=y=>Eg(n,y),p=(y,b)=>s(w=>{const k={...w,[y]:{...Eg(w,y),...b}};return ax(k)}),m=(y,b)=>e.includes(y)===e.includes(b);function v(y,b,w,k){const C=e.includes(b),R=e.includes(w);if(C===R){if(C){t(E=>gx(E,b,w));return}a(E=>{var q;const F=((q=k.find(Y=>Y.key===b))==null?void 0:q.technical)===!0,O=gs(k,e,F?"technical":"all",Fi(E,y)).map(Y=>Y.key);return sx(rx(E,y,b,w,O))})}}function S(y,b,w,k){var q;const C=((q=k.find(Y=>Y.key===b))==null?void 0:q.technical)===!0,R=e.includes(b),E=gs(k,e,C?"technical":"all",Fi(o,y)).map(Y=>Y.key).filter(Y=>e.includes(Y)===R),F=E.indexOf(b),O=E[F+w];F>=0&&O&&v(y,b,O,k)}return{pins:e,views:n,orders:o,togglePin:u,viewFor:h,updateView:p,canMoveRoster:m,moveRoster:v,stepRoster:S}}const fy="nc_node_order_v1",yx=/^[a-f0-9]{16,64}$/;function qs(e){if(yx.test(String((e==null?void 0:e.instanceId)||"")))return`id:${e.instanceId}`;const t=Array.isArray(e==null?void 0:e.route)?e.route.filter(n=>typeof n=="string"&&n):[];return t.length?`route:${t.map(encodeURIComponent).join("/")}`:typeof(e==null?void 0:e.name)=="string"&&e.name?`name:${encodeURIComponent(e.name)}`:""}function Tg(e=globalThis.localStorage){try{const t=JSON.parse(e.getItem(fy));return Array.isArray(t)?[...new Set(t.filter(n=>typeof n=="string"&&n&&n.length<=192))].slice(0,128):[]}catch{return[]}}function wx(e,t=globalThis.localStorage){try{t.setItem(fy,JSON.stringify(e))}catch{}return e}function Dg(e=[],t=[]){const n=new Map(t.map((s,o)=>[s,o]));return e.map((s,o)=>({group:s,index:o})).sort((s,o)=>{const a=n.has(qs(s.group))?n.get(qs(s.group)):Number.MAX_SAFE_INTEGER,u=n.has(qs(o.group))?n.get(qs(o.group)):Number.MAX_SAFE_INTEGER;return a-u||s.index-o.index}).map(({group:s})=>s)}function bx(e,t,n,s=[]){if(!t||!n||t===n)return e;const o=s.map(qs).filter(Boolean);if(!o.includes(t)||!o.includes(n))return e;const a=[...e.filter(m=>o.includes(m)),...o.filter(m=>!e.includes(m))],u=a.indexOf(t),h=a.indexOf(n);a.splice(u,1);const p=a.indexOf(n);return a.splice(u<h?p+1:p,0,t),a}const qd="nexuscrew-node-preferences";function Sx(){try{window.dispatchEvent(new Event(qd))}catch{}}function py(){const[e,t]=N.useState(Tg);N.useEffect(()=>{const a=()=>t(Tg());return window.addEventListener("storage",a),window.addEventListener(qd,a),()=>{window.removeEventListener("storage",a),window.removeEventListener(qd,a)}},[]);const n=a=>Dg(a,e),s=(a,u,h)=>t(p=>{const m=bx(p,a,u,h);return wx(m),Sx(),m});return{order:e,groupsFor:n,moveNode:s,stepNode:(a,u,h)=>{const p=Dg(h,e).map(qs),m=p.indexOf(a),v=p[m+u];m>=0&&v&&s(a,v,h)},nodeKey:qs}}function Dr(e,t=Math.floor(Date.now()/1e3)){if(!e)return"";const n=t-e;return n<0||n<60?"ora":n<3600?`${Math.floor(n/60)}m`:n<86400?`${Math.floor(n/3600)}h`:`${Math.floor(n/86400)}g`}function Bi(e){return e.status==="passive"?f("node-passive"):e.status==="down"?e.downSince?f("tunnel-down-since").replace("{t}",Dr(e.downSince)):f("tunnel-down"):e.status==="unreachable"?f("node-unreachable"):e.status==="offline"?e.lastSeen?f("node-offline-seen").replace("{t}",Dr(e.lastSeen)):f("node-offline"):e.status==="needs-repair"?f("node-needs-repair"):""}function my(e,{passive:t=null}={}){return e?e.status==="passive"?t:e.status==="healthy"?"on":"warn":null}function qo(e){return e&&(e.detail||e.status)||""}function zl(e,t,n=globalThis.localStorage){if(!(e!=null&&e.outbox)||e.outbox.count<1)return!1;const s=Number(n.getItem(X_(t))||0);return e.outbox.latest>s}function of(e,t={}){const n=e||{};if(!n.tmux){const s=`${n.engine||""}${n.key?`·${n.key}`:""}`,o=[s,n.model&&n.model!==s?n.model:""].filter(Boolean).join(" · ");return{working:!1,subtitle:String(o||f("cell-off")).trim()}}if(t.working===!0){const s=f("cell-working"),o=String(t.status||"").trim();return{working:!0,subtitle:!o||/^working(?:\.{3}|…)?$/i.test(o)?s:`${s} · ${o}`}}return t.working===!1?{working:!1,subtitle:f("cell-idle")}:{working:!1,subtitle:String(t.preview||n.preview||f("cell-on")).trim()}}function gy(e,t){return[...new Set([e.engine,e.model,e.key,t.preview,e.preview,t.status].filter(Boolean).map(String))].join(" ")}function af(e,t,n,s=globalThis.localStorage){return[...(Array.isArray(e)?e:[]).map(o=>{const a=n.get(o.tmuxSession)||{},u=Go([],o.tmuxSession),h=of(o,a);return{type:"cell",value:o,key:u,label:o.cell,live:!!o.tmux,fresh:zl(a,u,s),activity:a.activity||0,working:h.working,subtitle:h.subtitle,searchText:gy(o,a)}}),...(Array.isArray(t)?t:[]).map(o=>{const a=Go([],o.name);return{type:"session",value:o,key:a,label:o.name,live:!0,technical:o.technical===!0,fresh:zl(o,a,s),activity:o.activity||0,searchText:`${o.preview||""} ${o.cmd||""}`}})]}function Fl(e,t=globalThis.localStorage){const n=e||{},s=Array.isArray(n.route)?n.route:[],o=new Map((n.sessions||[]).map(u=>[u.name,u])),a=[...(n.cells||[]).map(u=>{const h=o.get(u.tmuxSession)||{},p=Go(s,u.tmuxSession||u.cell),m=of(u,h);return{type:"cell",value:u,key:p,label:u.cell,live:!!u.tmux,fresh:zl(h,p,t),activity:h.activity||u.activity||0,working:m.working,subtitle:m.subtitle,searchText:gy(u,h)}}),...(n.unmanaged||[]).map(u=>{const h=Go(s,u.name);return{type:"session",value:u,key:h,label:u.name,live:!0,technical:u.technical===!0,fresh:zl(u,h,t),activity:u.activity||0,searchText:`${u.preview||""} ${u.cmd||""}`}})];return{route:s,rawItems:a}}const lf=9,$l=.2,xx=/^[a-z0-9-]{1,32}(?:\/[a-z0-9-]{1,32}){0,3}$/,Mr=/^[a-f0-9]{16,64}$/,Vd=e=>xx.test(e)&&new Set(e.split("/")).size===e.split("/").length;function ys(e){if(typeof e=="string"&&e){const t=e.indexOf(":");if(t<0)return{session:e};const n=e.slice(0,t),s=e.slice(t+1);return!Vd(n)||!s?null:{session:s,node:n}}if(e&&typeof e=="object"&&typeof e.session=="string"&&e.session){const t=e.ownerId===void 0?void 0:typeof e.ownerId=="string"&&Mr.test(e.ownerId)?e.ownerId:null;return t===null?null:e.node===void 0||e.node===null||e.node===""?{session:e.session,...t?{ownerId:t}:{}}:typeof e.node=="string"&&Vd(e.node)?{session:e.session,node:e.node,...t?{ownerId:t}:{}}:null}return null}function $n(e){const t=ys(e);return t?t.node?`${t.node}:${t.session}`:t.session:""}const vy=9,_y=24,ta=11,kx=e=>{const t=Number(e);return t>=vy&&t<=_y?t:ta};function Lr(){return{columns:[]}}function ki(e){return e.columns.flatMap(t=>t.tiles.map(n=>$n(n)))}function Cx(e){const t=[],n=Math.max(0,...e.columns.map(s=>s.tiles.length));for(let s=0;s<n;s+=1)for(const o of e.columns)o.tiles[s]&&t.push($n(o.tiles[s]));return t}const Fr=e=>({columns:e.columns.map(t=>({width:t.width,tiles:t.tiles.map(n=>({...n}))}))});function cf(e,t,n,s){const o=ys(t);if(!o||ki(e).includes($n(o))||ki(e).length>=lf)return e;const a=Fr(e),u={session:o.session,height:1,fontSize:ta,...s||{}};if(o.node&&(u.node=o.node),o.ownerId&&(u.ownerId=o.ownerId),n==="end")return a.columns.push({width:1,tiles:[u]}),a;if(n&&typeof n.col=="number"&&typeof n.row=="number"&&a.columns[n.col])return a.columns[n.col].tiles.splice(n.row,0,u),a;if(n&&typeof n.col=="number"){const h=Math.max(0,Math.min(a.columns.length,n.col));return a.columns.splice(h,0,{width:1,tiles:[u]}),a}return a.columns.push({width:1,tiles:[u]}),a}function yy(e,t){const n=$n(t);if(!n||ki(e).includes(n)||ki(e).length>=lf)return e;const s=ki(e).length+1,o=Math.ceil(Math.sqrt(s));if(e.columns.length>=o){let v=0;for(let S=1;S<e.columns.length;S+=1)e.columns[S].tiles.length<e.columns[v].tiles.length&&(v=S);return cf(e,t,{col:v,row:e.columns[v].tiles.length})}const a=[...Cx(e),n],u=new Map(e.columns.flatMap(v=>v.tiles.map(S=>[$n(S),S]))),h=ys(t),p=e.columns.length?e.columns.reduce((v,S)=>v+(Number(S.width)||1),0)/e.columns.length:1,m=Array.from({length:o},(v,S)=>{var y;return{width:((y=e.columns[S])==null?void 0:y.width)||p,tiles:[]}});return a.forEach((v,S)=>{const y=ys(v);if(!y)return;const b=u.get(v)||(v===n?h:{})||{},w={session:y.session,height:b.height||1,fontSize:b.fontSize||ta};y.node&&(w.node=y.node),b.ownerId&&(w.ownerId=b.ownerId),b.unavailable===!0&&(w.unavailable=!0),m[S%o].tiles.push(w)}),{columns:m.filter(v=>v.tiles.length)}}function Hl(e,t){const n=$n(t),s=Fr(e);for(const o of s.columns)o.tiles=o.tiles.filter(a=>$n(a)!==n);return s.columns=s.columns.filter(o=>o.tiles.length>0),s}function Ex(e,t,n){const s=$n(t);if(!ki(e).includes(s))return e;const o=e.columns.flatMap(a=>a.tiles).find(a=>$n(a)===s);return cf(Hl(e,s),s,n,{fontSize:o.fontSize,height:o.height,...o.ownerId?{ownerId:o.ownerId}:{},...o.unavailable===!0?{unavailable:!0}:{}})}function Nx(e,t){if(!(t instanceof Map)||t.size===0)return e;let n=!1;const s=Fr(e);for(const o of s.columns)for(const a of o.tiles){const u=t.get($n(a));if(!u)continue;const h=ys(u);h&&(a.session=h.session,h.node?a.node=h.node:delete a.node,h.ownerId&&(a.ownerId=h.ownerId),n=!0)}return n?Ys(s):e}function jx(e,t,n){const s=Fr(e);return s.columns[t]&&(s.columns[t].width=Math.max($l,Number(n)||1)),s}function Rx(e,t,n,s){const o=Fr(e),a=o.columns[t]&&o.columns[t].tiles[n];return a&&(a.height=Math.max($l,Number(s)||1)),o}function Px(e,t,n,s){if(!(e.columns[t]&&e.columns[t].tiles[n]))return e;const a=Fr(e),u=a.columns[t].tiles[n],h=Number(u.fontSize)||ta;return u.fontSize=Math.max(vy,Math.min(_y,h+(Number(s)||0))),a}function Lx(e,t,n,s){const o=e.columns[t];if(!o||!o.tiles[n])return null;switch(s){case"left":return{col:t};case"right":return{col:t+1};case"top":return{col:t,row:n};case"bottom":return{col:t,row:n+1};default:return null}}function Mg(e){for(const t of[.25,.5,.75])if(Math.abs(e-t)<=.03)return t;return e}function Ys(e){if(!e||!Array.isArray(e.columns))return Lr();const t=e.columns.map(s=>({width:Math.max($l,Number(s&&s.width)||1),tiles:(Array.isArray(s&&s.tiles)?s.tiles:[]).filter(o=>o&&typeof o.session=="string"&&o.session).filter(o=>o.node==null||typeof o.node=="string"&&Vd(o.node)).filter(o=>o.ownerId==null||typeof o.ownerId=="string"&&Mr.test(o.ownerId)).map(o=>{const a={session:o.session,height:Math.max($l,Number(o.height)||1),fontSize:kx(o.fontSize)};return o.node!=null&&(a.node=o.node),o.ownerId!=null&&(a.ownerId=o.ownerId),o.unavailable===!0&&(a.unavailable=!0),a})})).filter(s=>s.tiles.length>0),n=new Set;for(const s of t)s.tiles=s.tiles.filter(o=>!n.has($n(o))&&n.add($n(o))&&n.size<=lf);return{columns:t.filter(s=>s.tiles.length>0)}}const wy=/^[a-z0-9-]{1,32}$/,Ax=/^[A-Za-z0-9._-]{1,32}$/,Tx=/^[A-Za-z0-9][A-Za-z0-9._-]{0,254}$/,Dx=320;function Yd(e){return typeof e=="string"&&wy.test(e)}const Mx=64;function Ir(e){if(typeof e!="string")return!1;const t=e.trim();return t.length>0&&t.length<=Mx&&!/[\x00-\x1f\x7f]/.test(t)}function vs(e){return String(e??"").normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32).replace(/-+$/g,"")||"node"}function by(e){if(typeof e!="string"||!e||e.length>Dx||e.startsWith("-")||/[\0-\x20\x7f]/.test(e))return!1;if(!e.includes("@"))return/^[A-Za-z0-9][A-Za-z0-9._:-]{0,254}$/.test(e);const t=e.indexOf("@");return t<=0||t!==e.lastIndexOf("@")?!1:Ax.test(e.slice(0,t))&&Tx.test(e.slice(t+1))}function Ig(e){if(e===""||e===null||e===void 0)return null;const t=String(e).trim();if(!/^[0-9]{1,5}$/.test(t))return;const n=Number(t);return Number.isInteger(n)&&n>=1&&n<=65535?n:void 0}function Ix({name:e,ssh:t,sshPort:n,remotePort:s}={}){const o=typeof e=="string"?e.trim():e,a=typeof t=="string"?t.trim():t;if(!Yd(o))return{ok:!1,error:"err-node-name"};if(!by(a))return{ok:!1,error:"err-ssh"};const u=Ig(n);if(u===void 0)return{ok:!1,error:"err-ssh-port"};const h=Ig(s);if(h===void 0)return{ok:!1,error:"err-node-port"};const p={name:o,ssh:a};return u!==null&&(p.sshPort=u),h!==null&&(p.remotePort=h),{ok:!0,value:p}}function Ox(e,t){if(!e||!t||t<e)return null;const n=Math.floor((t-e)/1e3);return n<60?"ora":n<3600?`${Math.floor(n/60)}m`:n<86400?`${Math.floor(n/3600)}h`:`${Math.floor(n/86400)}g`}function Gd(e,t){const n=!!(e&&e.status==="up"),s=!!(e&&e.status==="passive");return{up:n,...s?{passive:!0}:{},label:n?"tunnel-up":s?"node-passive":"tunnel-down",since:n?Ox(e.since,t):null}}const Bx=new Set(["v","instanceId","port","label","invite"]),zx=new Set(["v","instanceId","port","label","invite","name","ssh","sshPort"]);function Fx(e){const t=String(e).replace(/-/g,"+").replace(/_/g,"/"),n=t+"=".repeat((4-t.length%4)%4),s=typeof atob=="function"?atob(n):Buffer.from(n,"base64").toString("binary"),o=Uint8Array.from(s,a=>a.charCodeAt(0));return typeof TextDecoder<"u"?new TextDecoder().decode(o):Buffer.from(o).toString("utf8")}function $x(e){let t="";try{const u=new URL(String(e));t=new URLSearchParams(u.hash.replace(/^#/,"")).get("pair")||""}catch{return{ok:!1}}if(!t)return{ok:!1};let n;try{n=JSON.parse(Fx(t))}catch{return{ok:!1}}if(!n||typeof n!="object"||Array.isArray(n))return{ok:!1};const s=n.v===1?Bx:n.v===2?zx:null;if(!s)return{ok:!1};for(const u of Object.keys(n))if(!s.has(u))return{ok:!1};if(!/^[a-f0-9]{16,64}$/.test(String(n.instanceId)))return{ok:!1};const o=Number(n.port);if(!Number.isInteger(o)||o<1||o>65535)return{ok:!1};if(typeof n.label!="string")return{ok:!1};if(typeof n.invite!="string"||!n.invite)return{ok:!1};const a={ok:!0,version:n.v,label:n.label,invite:n.invite,instanceId:n.instanceId,port:o};if(n.v===2){if(n.name!==void 0){if(typeof n.name!="string"||!wy.test(n.name))return{ok:!1};a.name=n.name}if(n.ssh!==void 0){if(!by(n.ssh))return{ok:!1};a.ssh=String(n.ssh).trim()}if(n.sshPort!==void 0){const u=Number(n.sshPort);if(!Number.isInteger(u)||u<1||u>65535)return{ok:!1};a.sshPort=u}}return a}function Hx(e,t,n=new Set){if(!t||!t.ok)return e;const s={...e},o=(a,u)=>{u==null||u===""||n.has(a)||(s[a]=u)};return o("label",t.label),t.version===2&&(o("name",t.name||(t.ssh?vs(t.label):"")),o("ssh",t.ssh),t.sshPort!==void 0&&o("sshPort",String(t.sshPort))),s}const Ux=["KIMI_AUTH_ACTION_REQUIRED","CLIENT_INTERACTION_REQUIRED"],Wx=["kimi-code-consent-yes","kimi-code-config-custom-api-key","kimi-cli-login","client-terminal-dialog"];function uf(e){const t=e&&typeof e=="object"?e.actionRequired:null;return!t||typeof t!="object"||!Ux.includes(t.code)||!Wx.includes(t.recovery)?null:{code:t.code,recovery:t.recovery,text:f(`fleet-recovery-${t.recovery}`)}}let Xd={sessions:[],cells:[],nodeGroups:[],localNodeId:"",localFresh:!1,refreshedAt:0};function Og(){return Xd}function Sy(e={}){return Xd={sessions:Array.isArray(e.sessions)?e.sessions:[],cells:Array.isArray(e.cells)?e.cells:[],nodeGroups:Array.isArray(e.nodeGroups)?e.nodeGroups:[],localNodeId:typeof e.localNodeId=="string"?e.localNodeId:"",localFresh:e.localFresh===!0,refreshedAt:Number.isFinite(e.refreshedAt)?e.refreshedAt:0},Xd}const kr=(e,t=[])=>`${t.length?t.join("/"):"local"}:${e}`;function Kx({onPick:e,token:t,onSettings:n,onOpenVlSession:s}){const[o,a]=kn(),u=nf(t),[h,p]=N.useState(null),[m,v]=N.useState(null),[S,y]=N.useState(""),[b,w]=N.useState(""),[k,C]=N.useState({bind:"127.0.0.1",port:""}),[R,E]=N.useState(""),[F,O]=N.useState([]),[q,Y]=N.useState([]),[z,Z]=N.useState({}),[G,Q]=N.useState(new Set),[B,I]=N.useState(null),[j,T]=N.useState(null),{pins:L,orders:$,togglePin:W,viewFor:x,updateView:M,canMoveRoster:D,moveRoster:A,stepRoster:K}=rf(),{groupsFor:X,moveNode:se,stepNode:ce,nodeKey:fe}=py(),we=X(u);N.useEffect(()=>{Sy({sessions:h||[],cells:F,nodeGroups:u,localNodeId:R})},[h,F,u,R]),N.useEffect(()=>{const U=new Map;for(const le of F)U.set(kr(le.cell),!!le.boot);for(const le of u){const de=le.route||[le.name];for(const ge of le.cells||[])U.set(kr(ge.cell,de),!!ge.boot)}Z(le=>{let de=!1;const ge={...le};for(const[Le,_e]of Object.entries(le))U.has(Le)&&U.get(Le)===_e&&(delete ge[Le],de=!0);return de?ge:le})},[F,u]);async function me(){try{const le=await(await Ht("/api/sessions",t)).json();le.error?(v(le.error),p([])):(v(null),p(le.sessions||[]))}catch(U){v(String(U)),p([])}try{const U=await ws(t);O(U.available?U.cells||[]:[]),Y(U.available?U.capabilities||[]:[])}catch{O([]),Y([])}}N.useEffect(()=>{me(),Ht("/api/config",t).then(le=>le.json()).then(le=>{w(le.version||""),C({bind:le.bind||"127.0.0.1",port:le.port||""}),E(Mr.test(String(le.instanceId||""))?le.instanceId:"")}).catch(()=>{});const U=setInterval(me,4e3);return()=>clearInterval(U)},[]);async function be(){if(!k.port)return;const U=`http://${k.bind}:${k.port}/#token=${t}`;try{await navigator.clipboard.writeText(U)}catch{}}function $e(U,le,de){const ge=kr(U,le);Z(Le=>({...Le,[ge]:!!de}))}function dt(U,le=[]){const de=kr(U.cell,le);return Object.prototype.hasOwnProperty.call(z,de)?z[de]:!!U.boot}async function Ye(U,le,de=[]){U.stopPropagation();const ge=kr(le.cell,de),Le=!dt(le,de);$e(le.cell,de,Le),Q(_e=>new Set(_e).add(ge));try{await Q_(t,{cell:le.cell,enabled:Le},de),de.length||O(_e=>_e.map(Ee=>Ee.cell===le.cell?{...Ee,boot:Le}:Ee))}catch(_e){Z(Ee=>{const tt={...Ee};return delete tt[ge],tt}),v(String((_e==null?void 0:_e.message)||_e))}finally{Q(_e=>{const Ee=new Set(_e);return Ee.delete(ge),Ee})}}async function De(U){if(!B)return;const{cell:le}=B,de=Array.isArray(B.route)?B.route:[];if(U.action==="up"){const ge=await Gh(t,{cell:le,boot:!!U.boot,...U.engine?{engine:U.engine}:{},...U.model!==void 0?{model:U.model}:{},...U.permissionPolicy?{permissionPolicy:U.permissionPolicy}:{}},de),Le=uf(ge);Le&&v(Le.text),$e(le,de,!!U.boot)}else await Il(t,{cell:le,boot:!!U.boot},de),U.boot&&$e(le,de,!1);me()}async function Pt(U,le=[]){try{await Xh(t,U,le)}catch{return}me()}async function Jt(U,le,de=[]){try{await ey(t,U,le,de)}catch{return}me()}async function Me(U){if(!(!(U!=null&&U.direct)||j)){T(U.name);try{await ef(t,U.name,U.tunnelStatus==="up"?"down":"up")}catch{}T(null)}}async function Et(U){if(!(U!=null&&U.direct))return;const le=window.prompt(f("rename-node-prompt"),U.label||U.name);if(le===null)return;const de=String(le).trim();if(!Ir(de)){window.alert(f("rename-node-invalid"));return}try{await sy(t,U.name,de)}catch(ge){window.alert(String((ge==null?void 0:ge.message)||ge))}}const gt=N.useMemo(()=>new Map((h||[]).map(U=>[U.name,U])),[h]),bt=N.useMemo(()=>new Set(F.map(U=>U.tmuxSession)),[F]),ht=N.useMemo(()=>(h||[]).filter(U=>!bt.has(U.name)),[h,bt]),rt=N.useMemo(()=>af(F,ht,gt),[F,ht,gt]),at=x("local"),ie=N.useMemo(()=>gs(rt,L,at.filter,Fi($,"local")).filter(U=>Ng(U,S)),[rt,L,at.filter,S,$]),xe=we.reduce((U,le)=>U+(le.cells||[]).length+(le.unmanaged||[]).filter(de=>!de.technical).length,0),Ie=gs(rt,L,"all",Fi($,"local")).length+xe,Be=rt.filter(U=>U.live).length+we.reduce((U,le)=>U+Fl(le).rawItems.filter(de=>de.live).length,0),ue=(h||[]).filter(U=>U.attached).length+we.reduce((U,le)=>U+(le.sessions||[]).filter(de=>de.attached).length,0),oe=Math.min(ue,Be),H=k.port?`${k.bind}:${k.port}`:k.bind;function te(U,le=null,de=rt){var Mt,ct;const ge=Array.isArray(le==null?void 0:le.route)?le.route:[],Le=ge.join("/"),_e=Le||"local",Ee=ge.length?le==null?void 0:le.instanceId:R,tt=(Ze,Zt)=>e({session:Ze,...Le?{node:Le}:{},...Mr.test(String(Ee||""))?{ownerId:Ee}:{},...typeof Zt=="string"&&Zt?{cellName:Zt}:{}}),ot=D;if(U.type==="cell"){const Ze=U.value,Zt=ge.length?((le==null?void 0:le.sessions)||[]).find(ft=>ft.name===Ze.tmuxSession):gt.get(Ze.tmuxSession),ni=Ze.degraded?f("cell-degraded"):U.working?U.subtitle:Ze.tmux?f("cell-idle"):f("cell-off"),Wn=ge.length===0||((le==null?void 0:le.capabilities)||[]).includes(Ze.active?"down":"up"),ui=ge.length===0?q.includes("boot"):((le==null?void 0:le.capabilities)||[]).includes("boot"),he=dt(Ze,ge),je=kr(Ze.cell,ge),Ke=`${f(he?"boot-disable":"boot-enable")} ${Ze.cell}`;return c.jsxs("div",{className:"nc-mcard","data-roster-key":U.key,"data-position":_e,children:[c.jsx(bi,{position:_e,itemKey:U.key,label:Ze.cell,canMove:ot,onMove:(ft,vt)=>A(_e,ft,vt,de),onStep:ft=>K(_e,U.key,ft,de)}),c.jsxs("button",{className:"nc-mcard-main",onClick:()=>Ze.tmux&&tt(Ze.tmuxSession,Ze.cell),title:ni,"aria-label":`${Ze.cell}, ${ni}`,children:[c.jsx("span",{className:`dot ${Ze.degraded?"warn":Ze.tmux?`on${U.working?" working":""}`:""}`}),c.jsxs("span",{className:"nc-mcard-text",children:[c.jsx("b",{children:Ze.cell}),c.jsx("small",{title:U.subtitle,children:U.subtitle})]})]}),U.activity?c.jsx("span",{className:"nc-rel",children:Dr(U.activity)}):null,U.fresh&&((Mt=Zt==null?void 0:Zt.outbox)==null?void 0:Mt.count)>0&&c.jsx("span",{className:"nc-badge",title:f("new-files-outbox"),children:Zt.outbox.count}),c.jsx("button",{className:`nc-act pin${L.includes(U.key)?" on":""}`,"aria-label":`${f("pin")} ${Ze.cell}`,title:f("pin"),onClick:()=>W(U.key),children:L.includes(U.key)?"★":"☆"}),ui&&c.jsx("button",{className:`nc-act boot${he?" on":""}`,disabled:G.has(je),onClick:ft=>Ye(ft,Ze,ge),title:Ke,"aria-label":Ke,children:c.jsx(Je,{name:"boot",size:16})}),Wn&&c.jsx("button",{className:`nc-act power${Ze.tmux?" on":""}${Ze.degraded?" warn":""}`,onClick:()=>I(ge.length?{...Ze,boot:he,route:ge,availableEngines:(le==null?void 0:le.engines)||[]}:{...Ze,boot:he}),title:Ze.active?f("power-off"):f("power-on"),"aria-label":`${Ze.active?f("power-off"):f("power-on")} ${Ze.cell}`,children:c.jsx(Je,{name:"power",size:16})})]},U.key)}const Qe=U.value;return c.jsxs("div",{className:"nc-mcard","data-roster-key":U.key,"data-position":_e,children:[c.jsx(bi,{position:_e,itemKey:U.key,label:Qe.name,canMove:ot,onMove:(Ze,Zt)=>A(_e,Ze,Zt,de),onStep:Ze=>K(_e,U.key,Ze,de)}),c.jsxs("button",{className:"nc-mcard-main",onClick:()=>tt(Qe.name),children:[c.jsx("span",{className:Qe.attached?"dot on":"dot"}),c.jsxs("span",{className:"nc-mcard-text",children:[c.jsx("b",{children:Qe.name}),c.jsx("small",{children:Qe.preview?Qe.preview:Qe.cmd?Qe.cmd:f("windows").replace("{n}",String(Qe.windows||0))})]})]}),U.activity?c.jsx("span",{className:"nc-rel",children:Dr(U.activity)}):null,U.fresh&&((ct=Qe.outbox)==null?void 0:ct.count)>0&&c.jsx("span",{className:"nc-badge",title:f("new-files-outbox"),children:Qe.outbox.count}),c.jsx("button",{className:`nc-act pin${L.includes(U.key)?" on":""}`,"aria-label":`${f("pin")} ${Qe.name}`,title:f("pin"),onClick:()=>W(U.key),children:L.includes(U.key)?"★":"☆"}),c.jsx("button",{className:`nc-act technical${Qe.technical?" on":""}`,title:Qe.technical?f("mark-normal"):f("mark-technical"),"aria-label":`${Qe.technical?f("mark-normal"):f("mark-technical")} ${Qe.name}`,onClick:()=>Jt(Qe.name,!Qe.technical,ge),children:"T"}),c.jsx("button",{className:"nc-menu",title:f("terminate"),"aria-label":`${f("terminate")} ${Qe.name}`,onClick:()=>{window.confirm(f("terminate-confirm").replace("{name}",Qe.name))&&Pt(Qe.name,ge)},children:"⋯"})]},U.key)}return c.jsxs("div",{className:"nc-home",children:[c.jsxs("header",{className:"nc-home-head",children:[c.jsxs("div",{className:"nc-wordmark",children:["NexusCrew",c.jsx("span",{className:"nc-cursor"})]}),c.jsxs("div",{className:"nc-home-sub",children:[f("fleet-tmux")," · ",Be," ",f("sessions"),oe>0&&` · ${oe} attached`]}),c.jsxs("span",{className:"nc-head-actions",children:[c.jsx("button",{className:"nc-refresh",onClick:()=>n("nodes",!1),title:f("settings"),children:c.jsx(Je,{name:"gear",size:18})}),c.jsx("button",{className:"nc-refresh",onClick:me,title:f("refresh"),children:c.jsx(Je,{name:"refresh",size:18})})]})]}),c.jsxs("main",{className:"nc-home-scroll",children:[Ie>8&&c.jsx("input",{className:"nc-filter",type:"search",placeholder:f("filter-placeholder"),"aria-label":f("filter-placeholder"),value:S,onChange:U=>y(U.target.value)}),m&&c.jsx("div",{className:"nc-err",children:m}),c.jsxs("section",{className:"nc-group","data-position":"local",children:[c.jsx(Xu,{label:f("position-local"),count:ie.length,state:at,dotClass:"on",onToggle:()=>M("local",{open:!at.open}),onFilter:U=>M("local",{filter:U})}),at.open&&ie.map(U=>te(U,null,rt)),at.open&&h===null&&c.jsx("div",{className:"nc-empty",children:f("loading-fleet")}),at.open&&h!==null&&ie.length===0&&!m&&c.jsx("div",{className:"nc-empty",children:S?f("no-match").replace("{q}",S):f("no-sessions-short")})]}),we.map(U=>{const de=my(U.health,{passive:"warn"})||(U.status==="up"?"on":U.status==="passive"?"":"warn"),ge=U.health?qo(U.health):U.status==="up"?"":Bi(U),_e=(U.route&&U.route.length?U.route:[U.name]).join("/"),Ee=x(_e);if(U.kind==="vl")return c.jsxs("section",{className:"nc-group nc-node-order-wrap","data-position":_e,"data-node-order-key":fe(U),children:[c.jsx(Xu,{label:U.label||U.name,count:U.sessions.length,state:Ee,dotClass:de,dotTitle:ge,detail:U.status==="up"?"":Bi(U),onToggle:()=>M(_e,{open:!Ee.open}),onFilter:ct=>M(_e,{filter:ct})}),U.status==="up"&&Ee.open&&U.sessions.map(ct=>c.jsx("div",{className:"nc-mcard nc-vl-session-row",children:c.jsxs("button",{className:"nc-mcard-main",onClick:()=>s&&s(U.peer),"aria-label":`${U.label||U.name}: ${ct.name}`,children:[c.jsx("span",{className:"dot on"}),c.jsxs("span",{className:"nc-mcard-text",children:[c.jsx("b",{children:ct.name}),c.jsx("small",{children:f("vl-events-title")})]})]})},ct.key)),U.status==="up"&&Ee.open&&U.sessions.length===0&&c.jsx("div",{className:"nc-empty",children:f("no-sessions-short")})]},`nodo-vl-${_e}-${U.name}`);const{rawItems:tt}=Fl(U),ot=gs(tt,L,Ee.filter,Fi($,_e)).filter(ct=>Ng(ct,S)),Qe=U.direct&&U.health&&U.health.managed!==!1?c.jsx("button",{type:"button",className:`nc-act power${U.tunnelStatus==="up"?" on":""}`,disabled:j===U.name,title:U.tunnelStatus==="up"?f("power-off"):f("power-on"),"aria-label":`${U.tunnelStatus==="up"?f("power-off"):f("power-on")} ${U.label||U.name}`,onClick:()=>Me(U),children:c.jsx(Je,{name:"power",size:15})}):null,Mt=c.jsxs("span",{className:"nc-node-actions",children:[c.jsx(bi,{scope:"node",position:"nodes",itemKey:fe(U),label:U.label||U.name,onMove:(ct,Ze)=>se(ct,Ze,u),onStep:ct=>ce(fe(U),ct,u)}),U.direct&&c.jsx("button",{type:"button",className:"nc-node-rename",title:f("rename-node"),"aria-label":`${f("rename-node")} ${U.label||U.name}`,onClick:()=>Et(U),children:"✎"}),Qe]});return c.jsxs("section",{className:"nc-group nc-node-order-wrap","data-position":_e,"data-node-order-key":fe(U),children:[c.jsx(Xu,{label:U.label||U.name,count:ot.length,state:Ee,dotClass:de,dotTitle:ge,detail:U.status==="up"?"":U.health&&qo(U.health)||Bi(U),onToggle:()=>M(_e,{open:!Ee.open}),onFilter:ct=>M(_e,{filter:ct}),onRename:U.direct?()=>Et(U):null,action:Mt}),U.status==="up"&&Ee.open&&ot.map(ct=>te(ct,U,tt)),U.status==="up"&&Ee.open&&ot.length===0&&c.jsx("div",{className:"nc-empty",children:S?f("no-match").replace("{q}",S):f("no-sessions-short")})]},`nodo-${_e}`)}),c.jsxs("footer",{className:"nc-home-foot",onClick:be,title:f("copy-url"),children:[c.jsxs("span",{className:"nc-home-meta",children:[b&&c.jsxs("span",{className:"nc-home-version",children:["v",b]}),c.jsxs("span",{className:"nc-home-endpoint",children:[H," · ",f("ssh-only")]})]}),c.jsx("span",{className:"nc-lang",onClick:U=>U.stopPropagation(),children:uy.map((U,le)=>c.jsxs("span",{children:[le>0&&" · ",c.jsx("button",{className:`nc-lang-btn${o===U?" on":""}`,onClick:()=>a(U),title:U,children:U.toUpperCase()})]},U))})]})]}),c.jsx("button",{className:"nc-fab",onClick:()=>n("fleet",!0),title:f("fleet-new-cell"),"aria-label":f("fleet-new-cell"),children:"+"}),B&&c.jsx(Bl,{cell:B,token:t,route:Array.isArray(B.route)?B.route:[],onConfirm:De,onClose:()=>I(null)})]})}function Xu({label:e,count:t,state:n,dotClass:s="",dotTitle:o="",detail:a="",onToggle:u,onFilter:h,onRename:p=null,action:m=null}){return c.jsxs("div",{className:"nc-mobile-position-head",onContextMenu:p?v=>{v.preventDefault(),p()}:void 0,children:[c.jsxs("button",{type:"button",className:"nc-mobile-position-toggle",onClick:u,"aria-expanded":n.open,"aria-label":`${e} · ${f("node-sessions").replace("{n}",String(t))}`,children:[c.jsx("span",{className:"nc-mobile-chevron","aria-hidden":"true",children:n.open?"⌄":"›"}),c.jsx("span",{className:`dot ${s}`,title:o}),c.jsxs("span",{className:"nc-mobile-position-copy",children:[c.jsx("b",{children:e}),c.jsx("small",{children:a||f("node-sessions").replace("{n}",String(t))})]})]}),c.jsxs("select",{className:"nc-mobile-position-filter",value:n.filter,"aria-label":`${e} · ${f("filter-placeholder")}`,title:f(`view-${n.filter}`),onChange:v=>h(v.target.value),children:[c.jsx("option",{value:"all",children:f("view-all")}),c.jsx("option",{value:"pinned",children:f("view-pinned")}),c.jsx("option",{value:"active",children:f("view-active")}),c.jsx("option",{value:"off",children:f("view-off")}),c.jsx("option",{value:"technical",children:f("view-technical")})]}),m]})}/**
|
|
41
41
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
42
42
|
* @license MIT
|
|
43
43
|
*
|
|
@@ -90,4 +90,4 @@ Minimum version required to store current data is: `+B+`.
|
|
|
90
90
|
`).filter(o=>o!==""),promptMode:e.promptMode};return e.modelFlag&&(s.model={flag:e.modelFlag,value:e.modelValue||""}),e.promptMode==="flag"&&(s.promptFlag=e.promptFlag),t&&(s.env=Object.fromEntries(e.envRows.filter(o=>!o.remove&&o.key).map(o=>[o.key,o.value]))),s}function $s({children:e,onClose:t,label:n,error:s=""}){const o=N.useRef(null),a=N.useRef(null),u=N.useRef(t);return u.current=t,N.useEffect(()=>{const h=document.activeElement,p=o.current,m=()=>Array.from((p==null?void 0:p.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [href], [tabindex]:not([tabindex="-1"])'))||[]).filter(y=>y.offsetParent!==null),v=requestAnimationFrame(()=>{var y;return(y=m()[0]||p)==null?void 0:y.focus({preventScroll:!0})}),S=y=>{var C;if(y.key==="Escape"){y.preventDefault(),(C=u.current)==null||C.call(u);return}if(y.key!=="Tab")return;const b=m();if(!b.length){y.preventDefault(),p==null||p.focus();return}const w=b[0],k=b[b.length-1];y.shiftKey&&document.activeElement===w?(y.preventDefault(),k.focus()):!y.shiftKey&&document.activeElement===k&&(y.preventDefault(),w.focus())};return document.addEventListener("keydown",S),()=>{cancelAnimationFrame(v),document.removeEventListener("keydown",S),h&&h.isConnected&&typeof h.focus=="function"&&h.focus({preventScroll:!0})}},[]),N.useEffect(()=>{s&&requestAnimationFrame(()=>{var h;return(h=a.current)==null?void 0:h.scrollIntoView({block:"nearest"})})},[s]),c.jsx("div",{className:"nc-fleet-modal",role:"presentation",onMouseDown:h=>{h.target===h.currentTarget&&t()},children:c.jsxs("div",{ref:o,className:"nc-fleet-modal-dialog",role:"dialog","aria-modal":"true","aria-label":n||f("settings"),tabIndex:-1,children:[e,s&&c.jsx("div",{ref:a,className:"nc-err nc-fleet-modal-error",role:"alert","aria-live":"assertive",children:s})]})})}function Fd({token:e,targets:t=[],readonly:n=!1,onPower:s,onImport:o}){const[a,u]=N.useState([]),[h,p]=N.useState(0);N.useEffect(()=>{let C=!0;async function R(){const F=[{route:[],label:f("local")}].concat((t||[]).map(q=>({route:Array.isArray(q.route)?q.route:[],label:q.label||(q.route||[]).join(" › ")}))),O=await Promise.all(F.map(async q=>{const Y={...q,available:!1,readonly:!1,capabilities:[],provider:null,cells:[],unmanaged:[],err:""};try{const z=await ws(e,q.route);Y.available=!!z.available,Y.capabilities=z.capabilities||[],Y.provider=z.provider||null,Y.cells=(z.cells||[]).map(Z=>({...Z,route:q.route}));try{Y.readonly=!!(await Zh(e,q.route)).readonlyDefault}catch{}try{const Z=await Jh(e,q.route),G=new Set(Y.cells.map(Q=>Q.tmuxSession).filter(Boolean));Y.unmanaged=(Z.sessions||[]).filter(Q=>Q&&!G.has(Q.name))}catch{}}catch(z){Y.err=String(z&&z.message||z)}return Y}));C&&u(O)}R();const E=setInterval(R,6e3);return()=>{C=!1,clearInterval(E)}},[e,t,h]);const m=(C,R)=>Array.isArray(C.capabilities)&&C.capabilities.includes(R)&&!n&&!C.readonly,v=()=>p(C=>C+1),S=(C,R)=>{s&&s({...C,route:R})},y=(C,R)=>{s&&s({...C,route:R})},b=async(C,R)=>{try{await Fo(e,C.cell,R)}catch{}v()},w=async(C,R)=>{if(window.confirm(f("fleet-remove-cell").replace("{id}",C.cell))){try{await Z_(e,C.cell,!0,R)}catch{}v()}},k=async(C,R)=>{if(window.confirm(f("terminate-confirm").replace("{name}",C.name))){try{await Xh(e,C.name,R)}catch{}v()}};return c.jsxs("div",{className:"nc-fleet-inventory",children:[c.jsxs("div",{className:"nc-fleet-section-head",children:[c.jsx("b",{children:f("fleet-inventory")}),c.jsx("small",{children:f("fleet-inventory-help")})]}),a.map(C=>{const R=C.route.length?C.route.join("/"):"local";return c.jsxs("div",{className:"nc-fleet-pos",children:[c.jsxs("div",{className:"nc-fleet-pos-title",children:[c.jsx("span",{className:`dot ${C.available?"on":"warn"}`}),c.jsx("b",{children:C.label}),c.jsx("small",{children:C.available?`${C.cells.length} ${f("fleet-cells")} · ${C.unmanaged.length} ${f("fleet-tmux")}`:C.err||f("fleet-not-available")})]}),C.cells.map(E=>c.jsxs("div",{className:"nc-fleet-item nc-fleet-cell",children:[c.jsxs("span",{children:[c.jsx("b",{children:E.cell}),c.jsx("small",{children:`${E.engine||""}${E.key?`·${E.key}`:""}${E.active?"":` · ${f("cell-off")}`}`})]}),c.jsxs("span",{className:"nc-fleet-cell-actions",children:[E.active&&m(C,"down")&&c.jsx("button",{className:"nc-btn ghost",title:f("power-off"),onClick:()=>y(E,C.route),children:f("stop")}),!E.active&&m(C,"up")&&c.jsx("button",{className:"nc-btn ghost",title:f("power-on"),onClick:()=>S(E,C.route),children:f("start")}),m(C,"restart")&&E.active&&c.jsx("button",{className:"nc-btn ghost",title:f("restart"),onClick:()=>b(E,C.route),children:f("restart")}),m(C,"remove")&&c.jsx("button",{className:"nc-btn danger",title:f("delete"),onClick:()=>w(E,C.route),children:"×"})]})]},`${R}:${E.cell}`)),C.unmanaged.map(E=>c.jsxs("div",{className:"nc-fleet-item nc-fleet-unmanaged",children:[c.jsxs("span",{children:[c.jsx("b",{children:E.name}),c.jsx("small",{children:f("fleet-tmux")})]}),c.jsxs("span",{className:"nc-fleet-cell-actions",children:[m(C,"import")&&o&&c.jsx("button",{className:"nc-btn ghost",title:f("import-as-cell"),onClick:()=>o(E,C.route),children:f("import-as-cell")}),c.jsx("button",{className:"nc-btn danger",title:f("terminate"),onClick:()=>k(E,C.route),children:"×"})]})]},`${R}:u:${E.name}`)),C.available&&C.cells.length===0&&C.unmanaged.length===0&&c.jsx("div",{className:"nc-empty",children:f("fleet-inventory-empty")})]},R)})]})}function tj({cells:e=[],engines:t=[],busy:n,canRestore:s=!1,onRestore:o,onClose:a}){const[u,h]=N.useState("export"),[p,m]=N.useState(()=>new Set(e.map(j=>j.id))),[v,S]=N.useState(()=>new Set(t.map(j=>j.id))),[y,b]=N.useState([]),[w,k]=N.useState([]),[C,R]=N.useState(""),E=new Set(t.map(j=>j.id)),F=new Set(e.map(j=>j.id)),O=(j,T)=>j(L=>{const $=new Set(L);return $.has(T)?$.delete(T):$.add(T),$}),q=()=>{const j=Y2(e,p,t,v);if(j.ok===!1){R(f(`fleet-backup-${j.error}`));return}const T=e.filter(M=>p.has(M.id)).length,L=t.filter(M=>v.has(M.id)).length;if(j.cells.length!==T){R(f("fleet-backup-invalid-cell"));return}if(j.engines.length!==L){R(f("fleet-backup-invalid-engine"));return}if(!j.cells.length&&!j.engines.length){R(f("fleet-backup-select-one"));return}const $=new Blob([`${JSON.stringify(j,null,2)}
|
|
91
91
|
`],{type:"application/json"}),W=URL.createObjectURL($),x=document.createElement("a");x.href=W,x.download=`nexuscrew-fleet-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(x),x.click(),x.remove(),setTimeout(()=>URL.revokeObjectURL(W),0),R("")},Y=async j=>{if(R(""),b([]),k([]),!!j){if(j.size>1024*1024){R(f("fleet-backup-too-large"));return}try{const T=G2(await j.text());if(!T.ok){R(f(`fleet-backup-${T.error}`));return}const L=new Set(T.engines.map($=>$.id));k(T.engines.map($=>({engine:$,exists:E.has($.id),selected:!E.has($.id)}))),b(T.cells.map($=>{const W=E.has($.engine)||L.has($.engine),x=F.has($.id);return{cell:$,engine:W?$.engine:"",selected:W&&!x,exists:x}}))}catch(T){R(String(T.message||T))}}},z=(j,T)=>b(L=>L.map(($,W)=>W===j?{...$,...T}:$)),Z=(j,T)=>k(L=>L.map(($,W)=>W===j?{...$,...T}:$)),G=new Set([...E,...w.filter(j=>j.selected).map(j=>j.engine.id)]),Q=y.filter(j=>j.selected&&j.engine&&G.has(j.engine)),B=w.filter(j=>j.selected),I=[...new Map([...t.map(j=>[j.id,j.label||j.id]),...w.filter(j=>j.selected).map(j=>[j.engine.id,j.engine.label||j.engine.id])]).entries()];return c.jsxs("div",{className:"nc-set-form nc-fleet-form nc-backup-dialog",children:[c.jsx("b",{children:f("fleet-backup")}),c.jsx("small",{children:f("fleet-backup-help")}),c.jsxs("div",{className:"nc-set-tabs nc-backup-tabs",children:[c.jsx("button",{type:"button",className:`nc-set-tabbtn${u==="export"?" on":""}`,onClick:()=>{h("export"),R("")},children:f("fleet-backup-export")}),c.jsx("button",{type:"button",className:`nc-set-tabbtn${u==="import"?" on":""}`,disabled:!s,title:s?"":f("fleet-backup-restore-unavailable"),onClick:()=>{h("import"),R("")},children:f("fleet-backup-import")})]}),u==="export"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:()=>{m(new Set(e.map(j=>j.id))),S(new Set(t.map(j=>j.id)))},children:f("select-all")}),c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:()=>{m(new Set),S(new Set)},children:f("select-none")})]}),c.jsxs("div",{className:"nc-backup-list",children:[c.jsx("b",{children:f("fleet-engines")}),t.map(j=>{var T;return c.jsxs("label",{className:"nc-check nc-backup-row",children:[c.jsx("input",{type:"checkbox",checked:v.has(j.id),onChange:()=>O(S,j.id)}),c.jsxs("span",{children:[c.jsx("b",{children:j.label||j.id}),c.jsxs("small",{children:[j.id,(T=j.envKeys)!=null&&T.length?` · ${j.envKeys.length} ${f("fleet-backup-env-names")}`:""]})]})]},j.id)}),c.jsx("b",{children:f("fleet-cells")}),e.map(j=>c.jsxs("label",{className:"nc-check nc-backup-row",children:[c.jsx("input",{type:"checkbox",checked:p.has(j.id),onChange:()=>O(m,j.id)}),c.jsxs("span",{children:[c.jsx("b",{children:j.id}),c.jsxs("small",{children:[j.engine," · ",f("fleet-system-prompt")," ",(j.prompt||"").length," ",f("characters")]})]})]},j.id)),!e.length&&!t.length&&c.jsx("div",{className:"nc-empty",children:f("fleet-backup-empty")})]}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:a,children:f("cancel")}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:!p.size&&!v.size,onClick:q,children:f("fleet-backup-download")})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"file",accept:"application/json,.json",disabled:n,onChange:j=>Y(j.target.files&&j.target.files[0])}),c.jsx("small",{children:f("fleet-backup-import-help")}),!!(y.length||w.length)&&c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:()=>{k(j=>j.map(T=>({...T,selected:!0}))),b(j=>j.map(T=>({...T,selected:!!T.engine})))},children:f("select-all")}),c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:()=>{k(j=>j.map(T=>({...T,selected:!1}))),b(j=>j.map(T=>({...T,selected:!1})))},children:f("select-none")})]}),c.jsxs("div",{className:"nc-backup-list",children:[!!w.length&&c.jsx("b",{children:f("fleet-engines")}),w.map((j,T)=>{var L;return c.jsx("div",{className:"nc-backup-import-row",children:c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:j.selected,onChange:$=>Z(T,{selected:$.target.checked})}),c.jsxs("span",{children:[c.jsx("b",{children:j.engine.label||j.engine.id}),c.jsxs("small",{children:[j.engine.id," · ",j.exists?f("fleet-backup-overwrite"):f("fleet-backup-new"),(L=j.engine.envKeys)!=null&&L.length?` · ${f("fleet-backup-env-values-required")}`:""]})]})]})},j.engine.id)}),!!y.length&&c.jsx("b",{children:f("fleet-cells")}),y.map((j,T)=>c.jsxs("div",{className:"nc-backup-import-row",children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:j.selected,disabled:!j.engine||!G.has(j.engine),onChange:L=>z(T,{selected:L.target.checked})}),c.jsxs("span",{children:[c.jsx("b",{children:j.cell.id}),c.jsxs("small",{children:[j.exists?f("fleet-backup-overwrite"):f("fleet-backup-new")," · ",f("fleet-system-prompt")," ",j.cell.systemPrompt.length," ",f("characters")]})]})]}),c.jsxs("select",{value:j.engine,onChange:L=>z(T,{engine:L.target.value,selected:!!L.target.value}),children:[c.jsx("option",{value:"",children:f("fleet-backup-engine-missing")}),I.map(([L,$])=>c.jsx("option",{value:L,children:$},L))]})]},j.cell.id))]}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:a,children:f("cancel")}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:n||!Q.length&&!B.length,onClick:()=>o({engineRows:w,cellRows:y}),children:f("fleet-backup-restore")})]})]}),C&&c.jsx("div",{className:"nc-err",children:C})]})}function nj({state:e,setState:t,busy:n,onSave:s,catalog:o}){var R;const a=e.form,u=E=>t({...e,form:{...a,...E}}),h=a.envRows||[],p=[...new Map(o.map(E=>[E.client,E.clientLabel||E.client])).entries()],m=o.filter(E=>E.client===a.client),v=Zo(o,a),S=typeof(v==null?void 0:v.credentialEnv)=="string"?v.credentialEnv:"",y=Array.isArray(v==null?void 0:v.credentialUsedBy)?v.credentialUsedBy:[],b=(v==null?void 0:v.credentialSource)||"missing",w=!!(v!=null&&v.credentialEnv)||a.credentialProfile==="a"||a.credentialProfile==="p",k=!!S&&e.mode==="new"&&(v==null?void 0:v.authConfigured)!==!0&&!a.credentialValue&&!a.allowMissingCredential,C=E=>{E&&u({client:E.client,provider:E.provider,credentialProfile:E.credentialProfile||"",managedModel:E.model||"",protocol:E.protocol||"",permissionPolicy:E.permissionPolicyDefault||"standard",credentialSourcePolicy:"auto",rc:!!E.rc,displayName:E.custom?f("fleet-custom-provider-default"):"",baseUrl:E.custom?"":E.endpoint||"",envKey:E.defaultEnvKey||"",providerId:"nexuscrew-custom",credentialValue:"",credentialReveal:!1,allowMissingCredential:!1,...e.mode==="new"?{id:E.id,label:""}:{}})};return c.jsxs("div",{className:"nc-set-form nc-fleet-form",children:[c.jsx("b",{children:e.mode==="new"?f("fleet-new-engine"):`${f("edit")} ${a.id}`}),c.jsx("input",{value:a.id,disabled:e.mode!=="new",placeholder:"id",onChange:E=>u({id:E.target.value})}),c.jsx("input",{value:a.label,placeholder:f("label"),onChange:E=>u({label:E.target.value})}),c.jsxs("select",{value:a.kind,disabled:e.mode!=="new",onChange:E=>u({kind:E.target.value}),children:[c.jsx("option",{value:"managed",children:f("fleet-managed")}),c.jsx("option",{value:"custom",children:f("fleet-custom")})]}),a.kind==="managed"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"nc-fleet-pair",children:[c.jsx("select",{value:a.client,disabled:e.mode!=="new",onChange:E=>C(o.find(F=>F.client===E.target.value&&F.default)||o.find(F=>F.client===E.target.value)),children:p.map(([E,F])=>c.jsx("option",{value:E,children:F},E))}),c.jsx("select",{value:((R=Zo(o,a))==null?void 0:R.id)||"",disabled:e.mode!=="new",onChange:E=>C(o.find(F=>F.id===E.target.value)),children:m.map(E=>c.jsx("option",{value:E.id,children:E.label},E.id))})]}),a.client!=="shell"&&c.jsxs(c.Fragment,{children:[c.jsx("input",{value:a.managedModel,list:"nc-managed-models",placeholder:f(v!=null&&v.requiresModel?"fleet-model-required":"fleet-model-default"),onChange:E=>u({managedModel:E.target.value})}),c.jsx("datalist",{id:"nc-managed-models",children:[...(v==null?void 0:v.models)||[],...a.modelOptions||[]].filter((E,F,O)=>E&&O.indexOf(E)===F).map(E=>c.jsx("option",{value:E},E))})]}),v!=null&&v.supportsUnsafe?c.jsxs("select",{value:a.permissionPolicy,onChange:E=>u({permissionPolicy:E.target.value}),children:[c.jsx("option",{value:"standard",children:f("fleet-standard-permissions")}),c.jsx("option",{value:"unsafe",children:f("fleet-unsafe-permissions")})]}):c.jsx("small",{children:f("fleet-standard-permissions")}),(v==null?void 0:v.supportsUnsafe)&&a.permissionPolicy==="unsafe"&&c.jsx("small",{className:"nc-err",children:f("fleet-unsafe-warning")}),w&&c.jsxs("select",{"aria-label":f("fleet-credential-source-policy"),value:a.credentialSourcePolicy||"auto",onChange:E=>u({credentialSourcePolicy:E.target.value}),children:[c.jsx("option",{value:"auto",children:f("fleet-credential-source-policy-auto")}),c.jsx("option",{value:"nexuscrew-store",children:f("fleet-credential-source-policy-nexuscrew-store")}),c.jsx("option",{value:"environment",children:f("fleet-credential-source-policy-environment")})]}),(v==null?void 0:v.credentialEnv)===!0&&c.jsxs(c.Fragment,{children:[c.jsx("input",{value:a.envKey,placeholder:f("fleet-api-key-env"),onChange:E=>u({envKey:E.target.value})}),c.jsx("small",{children:f("fleet-custom-secret-help")})]}),S&&c.jsxs("section",{className:"nc-fleet-key","aria-label":f("fleet-key-section"),children:[c.jsxs("div",{className:"nc-fleet-key-head",children:[c.jsx("b",{children:f("fleet-key-section")}),c.jsx("span",{children:f(`fleet-credential-source-${b}`)})]}),c.jsxs("label",{className:"nc-field",children:[f("fleet-key-variable"),c.jsx("input",{value:S,readOnly:!0,"aria-label":f("fleet-key-variable")})]}),c.jsx("small",{children:y.length?f("fleet-key-used-by").replace("{engines}",y.join(", ")):f("fleet-key-used-by-none")}),y.length>0&&c.jsx("small",{children:f("fleet-key-shared-impact").replace("{key}",S).replace("{engines}",y.join(", "))}),c.jsxs("div",{className:"nc-fleet-key-input",children:[c.jsx("input",{type:a.credentialReveal?"text":"password",value:a.credentialValue||"","aria-label":f("fleet-key-value").replace("{key}",S),autoComplete:"new-password",spellCheck:!1,autoCapitalize:"none",autoCorrect:"off",placeholder:v!=null&&v.authConfigured||e.mode==="edit"?f("fleet-key-blank-keeps"):f("fleet-key-enter"),onChange:E=>u({credentialValue:E.target.value,allowMissingCredential:E.target.value?!1:a.allowMissingCredential})}),c.jsx("button",{type:"button",className:"nc-btn ghost","aria-label":f(a.credentialReveal?"fleet-key-hide":"fleet-key-reveal"),onClick:()=>u({credentialReveal:!a.credentialReveal}),children:f(a.credentialReveal?"fleet-key-hide":"fleet-key-reveal")})]}),c.jsx("small",{children:f("fleet-key-local-help")}),e.mode==="new"&&(v==null?void 0:v.authConfigured)!==!0&&!a.credentialValue&&c.jsxs("label",{className:"nc-check nc-fleet-key-missing",children:[c.jsx("input",{type:"checkbox",checked:!!a.allowMissingCredential,onChange:E=>u({allowMissingCredential:E.target.checked})}),f("fleet-key-create-missing")]}),(v==null?void 0:v.notice)&&c.jsx("small",{className:"nc-fleet-provider-notice",children:f(`fleet-provider-notice-${v.notice}`)})]}),(v==null?void 0:v.notice)&&!S&&c.jsx("small",{className:"nc-fleet-provider-notice",children:f(`fleet-provider-notice-${v.notice}`)}),a.provider==="custom"&&c.jsxs(c.Fragment,{children:[c.jsx("input",{value:a.displayName,placeholder:f("fleet-provider-display"),onChange:E=>u({displayName:E.target.value})}),c.jsx("input",{value:a.baseUrl,placeholder:"https://api.example.com/v1",onChange:E=>u({baseUrl:E.target.value})}),((v==null?void 0:v.protocols)||[]).length>1&&c.jsx("select",{value:a.protocol,onChange:E=>u({protocol:E.target.value}),children:v.protocols.map(E=>c.jsx("option",{value:E,children:E},E))}),c.jsxs("div",{className:"nc-fleet-pair",children:[c.jsx("input",{value:a.envKey,placeholder:f("fleet-api-key-env"),onChange:E=>u({envKey:E.target.value})}),c.jsx("input",{value:a.providerId,placeholder:f("fleet-provider-id"),onChange:E=>u({providerId:E.target.value})})]}),c.jsxs("small",{children:[a.protocol," · ",f("fleet-custom-secret-help")]})]}),c.jsx("small",{children:f(a.client==="shell"?"fleet-shell-engine-help":"fleet-managed-help")})]}):c.jsxs(c.Fragment,{children:[c.jsx("input",{value:a.command,placeholder:f("command-path"),onChange:E=>u({command:E.target.value})}),c.jsx("textarea",{value:a.argsText,placeholder:f("args-lines"),onChange:E=>u({argsText:E.target.value})}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:a.rc,onChange:E=>u({rc:E.target.checked})})," remote control"]}),c.jsxs("select",{value:a.promptMode,onChange:E=>u({promptMode:E.target.value}),children:[c.jsx("option",{value:"send-keys",children:"send-keys"}),c.jsx("option",{value:"flag",children:"flag"})]}),a.promptMode==="flag"&&c.jsx("input",{value:a.promptFlag,placeholder:"prompt flag",onChange:E=>u({promptFlag:E.target.value})}),c.jsxs("div",{className:"nc-fleet-pair",children:[c.jsx("input",{value:a.modelFlag,placeholder:"model flag",onChange:E=>u({modelFlag:E.target.value})}),c.jsx("input",{value:a.modelValue,placeholder:"model default",onChange:E=>u({modelValue:E.target.value})})]}),c.jsx("small",{children:f("env-write-only")}),h.map((E,F)=>c.jsxs("div",{className:"nc-fleet-env",children:[c.jsx("input",{value:E.key,disabled:E.configured,placeholder:"ENV_KEY",onChange:O=>{const q=h.slice();q[F]={...E,key:O.target.value},u({envRows:q})}}),c.jsx("input",{type:"password",value:E.value,placeholder:E.configured?"•••••• (unchanged)":"value",onChange:O=>{const q=h.slice();q[F]={...E,value:O.target.value},u({envRows:q})}}),c.jsx("button",{className:"nc-btn danger",onClick:()=>u({envRows:h.filter((O,q)=>q!==F)}),children:"×"})]},`${E.key}-${F}`)),c.jsx("button",{className:"nc-btn ghost",onClick:()=>u({envRows:[...h,{key:"",value:"",configured:!1}]}),children:"+ env"})]}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{className:"nc-btn ghost",onClick:()=>t(null),children:f("cancel")}),c.jsx("button",{className:"nc-btn primary",disabled:n||!a.id||k||a.kind==="custom"&&!a.command||a.kind==="managed"&&(v==null?void 0:v.requiresModel)&&!a.managedModel||a.kind==="managed"&&(v==null?void 0:v.credentialEnv)===!0&&!a.envKey||a.kind==="managed"&&a.provider==="custom"&&(!a.displayName||!a.baseUrl||!a.envKey||!a.providerId),onClick:s,children:f("save")})]})]})}function ij({token:e,route:t,targets:n=[],location:s,setLocation:o,state:a,setState:u,engines:h,busy:p,onSave:m}){var Y;const[v,S]=N.useState(null),[y,b]=N.useState(""),w=a.form,k=z=>u({...a,form:{...w,...z}}),C=h.find(z=>z.id===w.engine),R=((Y=C==null?void 0:C.managed)==null?void 0:Y.client)==="shell",E=z=>{var Q,B,I,j;const Z=h.find(T=>T.id===z),G={...w.commands||{}};((Q=C==null?void 0:C.managed)==null?void 0:Q.client)==="shell"&&(w.command?G[w.engine]=w.command:delete G[w.engine]),k({engine:z,model:((B=w.models)==null?void 0:B[z])||((I=Z==null?void 0:Z.managed)==null?void 0:I.model)||((j=Z==null?void 0:Z.model)==null?void 0:j.value)||"",commands:G,command:G[z]||""})},F=z=>{const Z={...w.commands||{}};z?Z[w.engine]=z:delete Z[w.engine],k({command:z,commands:Z})},O=R&&/[|&;<>()`$*?{}\[\]~]/.test(w.command||""),q=async z=>{try{const Z=await Qh(e,z,t);S(Z),k({cwd:Z.path}),b("")}catch(Z){b(String(Z.message||Z))}};return c.jsxs("div",{className:"nc-set-form nc-fleet-form",children:[c.jsx("b",{children:a.mode==="new"?f("fleet-new-cell"):`${f("edit")} ${w.id}`}),a.mode==="new"&&c.jsxs("label",{className:"nc-field",children:[f("location"),c.jsx("span",{className:"nc-req",children:" *"}),c.jsxs("select",{value:s,onChange:z=>{o(z.target.value),k({engine:""})},children:[c.jsx("option",{value:"",children:f("local")}),n.map(z=>c.jsxs("option",{value:z.route.join("/"),disabled:z.status&&z.status!=="up",children:[z.label,z.status&&z.status!=="up"?` · ${f("node-offline")}`:""]},z.route.join("/")))]})]}),c.jsx("input",{value:w.id,disabled:a.mode!=="new",placeholder:"id",onChange:z=>k({id:z.target.value})}),c.jsx("input",{value:w.label||"",maxLength:64,placeholder:f("fleet-cell-label"),onChange:z=>k({label:z.target.value})}),c.jsxs("div",{className:"nc-fleet-pair",children:[c.jsx("input",{value:w.cwd,placeholder:f("cwd"),onChange:z=>k({cwd:z.target.value})}),c.jsx("button",{className:"nc-btn ghost",onClick:()=>v?S(null):q(w.cwd),children:f("browse")})]}),v&&c.jsxs("div",{className:"nc-fs",children:[c.jsx("div",{className:"nc-fs-path",children:v.path}),c.jsxs("div",{className:"nc-fs-list",children:[v.parent&&c.jsxs("button",{className:"nc-fs-item nc-fs-nav",onClick:()=>q(v.parent),children:["↑ ",f("fs-parent")]}),(v.dirs||[]).map(z=>c.jsxs("button",{className:"nc-fs-item",onClick:()=>q(`${v.path.replace(/\/$/,"")}/${z}`),children:["📁 ",z]},z))]})]}),y&&c.jsx("div",{className:"nc-err",children:y}),c.jsx("select",{value:w.engine,onChange:z=>E(z.target.value),children:h.map(z=>c.jsx("option",{value:z.id,children:z.label},z.id))}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:!!w.boot,onChange:z=>k({boot:z.target.checked})})," boot"]}),R?c.jsxs(c.Fragment,{children:[c.jsx("input",{value:w.command||"",maxLength:4096,placeholder:f("fleet-shell-command-placeholder"),onChange:z=>F(z.target.value)}),c.jsx("small",{children:w.command?f("fleet-shell-command-help"):f("fleet-shell-interactive")}),O&&c.jsx("small",{className:"nc-note",children:f("fleet-shell-command-metachar")})]}):c.jsxs(c.Fragment,{children:[c.jsx("input",{value:w.model||"",list:"nc-cell-models",placeholder:f("fleet-model-override"),onChange:z=>k({model:z.target.value})}),c.jsx("datalist",{id:"nc-cell-models",children:((C==null?void 0:C.availableModels)||[]).map(z=>c.jsx("option",{value:z},z))}),c.jsx("textarea",{value:w.prompt||"",placeholder:"prompt",onChange:z=>k({prompt:z.target.value})})]}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{className:"nc-btn ghost",onClick:()=>u(null),children:f("cancel")}),c.jsx("button",{className:"nc-btn primary",disabled:p||!w.id||!w.cwd||!w.engine,onClick:m,children:f("save")})]})]})}function O_({token:e,route:t=[],state:n,setState:s,busy:o,onSave:a}){const[u,h]=N.useState(null),[p,m]=N.useState([]),[v,S]=N.useState(""),y=Array.isArray(t)?t.join("/"):"";N.useEffect(()=>{let R=!0;return Jl(e,y?y.split("/"):[]).then(E=>{R&&(m(E.engines||[]),S(""))}).catch(E=>{R&&(m([]),S(String(E.message||E)))}),()=>{R=!1}},[e,y]);const b=n.form,w=R=>s({...n,form:{...b,...R}}),k=async R=>{try{const E=await Qh(e,R,t);h(E),w({cwd:E.path})}catch{}},C=!b.id&&b.tmuxSession?b.tmuxSession.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32):b.id;return c.jsxs("div",{className:"nc-set-form nc-fleet-form",children:[c.jsxs("b",{children:[f("import-as-cell")," · ",b.tmuxSession]}),c.jsx("small",{children:f("import-help")}),c.jsx("input",{value:b.tmuxSession,disabled:!0,placeholder:"tmux session",readOnly:!0}),c.jsx("input",{value:b.id,placeholder:f("name"),onChange:R=>w({id:R.target.value})}),c.jsxs("div",{className:"nc-fleet-pair",children:[c.jsx("input",{value:b.cwd,placeholder:f("cwd"),onChange:R=>w({cwd:R.target.value})}),c.jsx("button",{className:"nc-btn ghost",type:"button",onClick:()=>u?h(null):k(b.cwd),children:f("browse")})]}),u&&c.jsxs("div",{className:"nc-fs",children:[c.jsx("div",{className:"nc-fs-path",children:u.path}),c.jsxs("div",{className:"nc-fs-list",children:[u.parent&&c.jsxs("button",{className:"nc-fs-item nc-fs-nav",onClick:()=>k(u.parent),children:["↑ ",f("fs-parent")]}),(u.dirs||[]).map(R=>c.jsxs("button",{className:"nc-fs-item",onClick:()=>k(`${u.path.replace(/\/$/,"")}/${R}`),children:["📁 ",R]},R))]})]}),c.jsxs("select",{value:b.engine,onChange:R=>w({engine:R.target.value}),children:[c.jsx("option",{value:"",children:f("import-engine-required")}),p.map(R=>c.jsx("option",{value:R.id,children:R.label},R.id))]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:!!b.boot,onChange:R=>w({boot:R.target.checked})})," boot"]}),(n.err||v)&&c.jsx("div",{className:"nc-err",children:n.err||v}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{className:"nc-btn ghost",onClick:()=>s(null),children:f("cancel")}),c.jsx("button",{className:"nc-btn primary",disabled:o||!b.tmuxSession||!b.engine||!p.length,onClick:a,children:f(C?"import-as-cell":"save")})]})]})}function El(e){const t=Ks(e);return t===null?`~/${e}`:t?`~/${t}`:"~"}function sj(e){if(!e||typeof e.path!="string"||typeof e.home!="string")return"";const{path:t,home:n}=e;return!n||t===n||!t.startsWith(n+"/")?"":t.slice(n.length+1).replace(/\/+$/,"")}function rj({token:e,route:t,cell:n,busy:s=!1,onSaved:o,onClose:a}){const[u,h]=N.useState(""),[p,m]=N.useState(null),[v,S]=N.useState(!1),[y,b]=N.useState(""),w=typeof(n==null?void 0:n.cwdSuggestion)=="string"&&Ks(n.cwdSuggestion)!==null?Ks(n.cwdSuggestion):null,[k,C]=N.useState(w),R=n==null?void 0:n.id,E=s||v,F=async G=>{const Q=Ks(G);if(Q===null){m({rel:"",dirs:[],loading:!1,err:f("fleet-cwd-repair-invalid")});return}m({rel:Q,dirs:[],loading:!0,err:""});try{const B=await Qh(e,Q,t),I=sj(B);m({rel:I,dirs:Array.isArray(B.dirs)?B.dirs:[],loading:!1,err:""})}catch(B){m({rel:Q,dirs:[],loading:!1,err:String(B&&B.message||B)})}},O=G=>{if(!p)return;const Q=p.rel?`${p.rel}/${G}`:G;F(Q)},q=()=>{p!=null&&p.rel&&F(p.rel.split("/").slice(0,-1).join("/"))},Y=()=>{p&&(h(p.rel||""),m(null),b(""),C(null))},z=()=>{k!==null&&(h(k),C(null),b(""))},Z=async()=>{if(E)return;const G=Ks(u);if(G===null){b(f("fleet-cwd-repair-invalid"));return}const Q=El(G);let B=!0;try{B=window.confirm(f("fleet-cwd-repair-confirm").replace("{id}",String(R||"")).replace("{path}",Q))}catch{B=!1}if(B){S(!0),b(""),C(null);try{const I=await J_(e,R,{cwdRel:G},t);o==null||o(I)}catch(I){const j=I&&I.data||{};if(j.code==="unportable-cwd"){b(f("fleet-cwd-repair-unportable"));const T=Array.isArray(j.cells)?j.cells.find($=>$&&$.id===R):null,L=T&&typeof T.suggestion=="string"?T.suggestion:null;L!==null&&Ks(L)!==null&&C(L)}else b(String(I&&I.message||I))}finally{S(!1)}}};return c.jsxs("div",{className:"nc-set-form nc-fleet-form nc-cwd-repair",children:[c.jsx("b",{children:f("fleet-cwd-repair-title").replace("{id}",String(R||""))}),c.jsx("small",{className:"nc-set-info",children:f("fleet-cwd-repair-help")}),c.jsx("small",{className:"nc-cwd-no-source",children:f("fleet-cwd-repair-no-source-path")}),c.jsxs("label",{className:"nc-field",children:[f("cwd"),c.jsxs("div",{className:"nc-cwd-rel-row",children:[c.jsx("span",{className:"nc-cwd-rel-prefix",children:"~/"}),c.jsx("input",{value:u,placeholder:f("fleet-cwd-repair-placeholder"),autoComplete:"off",spellCheck:"false",autoCapitalize:"none",onChange:G=>h(G.target.value)}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:E,onClick:()=>p?m(null):F(""),children:f(p?"close":"fleet-cwd-repair-browse")})]})]}),c.jsx("div",{className:"nc-cwd-preview",children:f("fleet-cwd-repair-preview").replace("{path}",El(u))}),p&&c.jsxs("div",{className:"nc-fs",children:[c.jsx("div",{className:"nc-fs-path",children:El(p.rel)}),c.jsxs("div",{className:"nc-fs-list",children:[p.rel&&c.jsxs("button",{type:"button",className:"nc-fs-item nc-fs-nav",onClick:q,children:["↑ ",f("fs-parent")]}),p.loading&&c.jsx("div",{className:"nc-fs-empty",children:"…"}),!p.loading&&p.dirs.length===0&&c.jsx("div",{className:"nc-fs-empty",children:f("fleet-cwd-repair-fs-empty")}),!p.loading&&p.dirs.map(G=>c.jsxs("button",{type:"button",className:"nc-fs-item",onClick:()=>O(G),children:["📁 ",G]},G))]}),p.err&&c.jsx("div",{className:"nc-err",children:p.err}),c.jsx("div",{className:"nc-sheet-actions",children:c.jsx("button",{type:"button",className:"nc-btn primary",disabled:E||p.loading||!!p.err,onClick:Y,children:f("fleet-cwd-repair-use-current")})})]}),y&&c.jsx("div",{className:"nc-err",role:"alert",children:y}),k!==null&&c.jsxs("div",{className:"nc-cwd-suggestion",role:"status",children:[c.jsx("span",{children:f("fleet-cwd-repair-suggestion")}),c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:z,children:f("fleet-cwd-repair-use-suggestion").replace("{path}",El(k))})]}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:v,onClick:a,children:f("cancel")}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:E,onClick:Z,children:v?"…":f("save")})]})]})}function oj({token:e,readonly:t,targets:n=[],startNewCell:s=!1,initialLocation:o=""}){const[a,u]=N.useState({engines:[],cells:[],managedCatalog:[]}),[h,p]=N.useState({available:!1,capabilities:[]}),[m,v]=N.useState(!1),[S,y]=N.useState(null),[b,w]=N.useState(null),[k,C]=N.useState(!1),[R,E]=N.useState(""),[F,O]=N.useState(""),[q,Y]=N.useState(o),[z,Z]=N.useState(!1),[G,Q]=N.useState(null),[B,I]=N.useState(null),[j,T]=N.useState(null),[L,$]=N.useState(!1),[W,x]=N.useState([]),[M,D]=N.useState(null),[A,K]=N.useState("manage"),X=N.useRef(!1),se=q?q.split("/"):[],ce=N.useCallback(async()=>{try{const ie=await ws(e,se);p(ie);try{const xe=await Zh(e,se);Z(!!xe.readonlyDefault)}catch{Z(!1)}if(ie.provider==="builtin"&&(ie.capabilities||[]).includes("definitions")){const xe=await Jl(e,se),Ie=new Map((ie.engines||[]).map(Be=>[Be.id,Be]));if(xe.engines=(xe.engines||[]).map(Be=>{var ue;return{...Be,availableModels:((ue=Ie.get(Be.id))==null?void 0:ue.models)||[]}}),u(xe),(ie.capabilities||[]).includes("credentials"))try{x((await m0(e,se)).credentials||[])}catch{x([])}else x([])}E("")}catch(ie){E(String(ie.message||ie))}finally{v(!0)}},[e,q]);N.useEffect(()=>{ce();const ie=setInterval(ce,5e3);return()=>clearInterval(ie)},[ce]);const fe=new Set((h.cells||[]).filter(ie=>ie.active).map(ie=>ie.cell)),we=h.provider==="builtin"&&(h.capabilities||[]).includes("edit"),me=(h.capabilities||[]).includes("restore");N.useEffect(()=>{!s||X.current||!we||!a.engines.length||(X.current=!0,w({mode:"new",form:I_(a.engines[0].id)}))},[s,we,a.engines]);const be=async ie=>{C(!0),E(""),O("");try{await ie(),await ce()}catch(xe){E(String(xe.message||xe))}C(!1)},$e=()=>be(async()=>{var ge;const ie=S.mode==="new",xe=S.form,Ie=a.managedCatalog||[],Be=xe.kind==="managed"?Zo(Ie,xe):null,ue=typeof(Be==null?void 0:Be.credentialEnv)=="string"?Be.credentialEnv:"",oe=ue&&xe.credentialValue||"",H=ej(xe,ie,Ie);!ie&&S.form.kind==="custom"&&!S.form.modelFlag&&(H.model=null),!ie&&S.form.kind==="custom"&&S.form.promptMode!=="flag"&&(H.promptFlag=null);let te;if(ie)te=await v0(e,H,se);else{const Le=S.original,_e=new Set(S.form.envRows.filter(ot=>!ot.remove).map(ot=>ot.key)),Ee=(Le.envKeys||[]).filter(ot=>!_e.has(ot)),tt=Object.fromEntries(S.form.envRows.filter(ot=>!ot.remove&&ot.key&&(!ot.configured||ot.value!=="")).map(ot=>[ot.key,ot.value]));te=await _0(e,Le.id,H,S.form.kind==="custom"?{set:tt,remove:Ee}:void 0,se)}let U=null;if(ue&&oe)try{U=await yg(e,ue,oe,se),x(U.credentials||[])}catch{throw await ce(),ie&&y({mode:"edit",original:{...H,id:xe.id},form:{...xe,credentialReveal:!1}}),new Error(f(ie?"fleet-key-partial-create":"fleet-key-partial-edit"))}await ce(),y(null),O(f("fleet-saved"));const le=((ge=((U==null?void 0:U.credentials)||[]).find(Le=>Le.envKey===ue))==null?void 0:ge.activeCells)||[],de=[...new Set([...(te==null?void 0:te.activeCells)||[],...le])];if(de.length&&window.confirm(f("fleet-restart-confirm").replace("{cells}",de.join(", "))))for(const Le of de)await Fo(e,Le,se)}),dt=()=>be(async()=>{var U,le,de,ge,Le,_e;const ie=b.mode==="new",xe=b.form,Ie={...ie?{id:xe.id}:{},cwd:xe.cwd,engine:xe.engine,boot:!!xe.boot},Be={...xe.commands||{}},ue=a.engines.find(Ee=>Ee.id===xe.engine);((U=ue==null?void 0:ue.managed)==null?void 0:U.client)==="shell"&&typeof xe.command=="string"&&xe.command.length?Be[xe.engine]=xe.command:((le=ue==null?void 0:ue.managed)==null?void 0:le.client)==="shell"&&delete Be[xe.engine],(Object.keys(Be).length||!ie)&&(Ie.commands=Be);const oe=(xe.label||"").trim();ie?oe&&(Ie.label=oe):Ie.label=oe||null,ie?(((de=ue==null?void 0:ue.managed)==null?void 0:de.client)!=="shell"&&xe.model&&(Ie.model=xe.model),((ge=ue==null?void 0:ue.managed)==null?void 0:ge.client)!=="shell"&&xe.prompt&&(Ie.prompt=xe.prompt)):(Ie.model=((Le=ue==null?void 0:ue.managed)==null?void 0:Le.client)==="shell"?null:xe.model||null,((_e=ue==null?void 0:ue.managed)==null?void 0:_e.client)!=="shell"&&(Ie.prompt=xe.prompt||null));const H=ie?await w0(e,Ie,se):await J_(e,b.original.id,Ie,se),te=ie?xe.id:b.original.id;w(null),O(f("fleet-saved")),!ie&&(H!=null&&H.active)&&window.confirm(f("fleet-restart-confirm").replace("{cells}",te))&&await Fo(e,te,se)}),Ye=t||z,De=ie=>W.find(xe=>{var Ie;return(Ie=xe.engines)==null?void 0:Ie.includes(ie.id)})||null,Pt=()=>be(async()=>{var Ie;const ie=await yg(e,M.envKey,M.value,se);x(ie.credentials||[]),D(null),O(f("fleet-credential-saved"));const xe=((Ie=(ie.credentials||[]).find(Be=>Be.envKey===M.envKey))==null?void 0:Ie.activeCells)||[];if(xe.length&&window.confirm(f("fleet-restart-confirm").replace("{cells}",xe.join(", "))))for(const Be of xe)await Fo(e,Be,se)}),Jt=ie=>be(async()=>{if(!window.confirm(f("fleet-credential-remove-confirm").replace("{key}",ie.envKey)))return;const xe=await g0(e,ie.envKey,se);x(xe.credentials||[]),O(f("fleet-credential-removed"))}),Me=ie=>Q({...ie,route:Array.isArray(ie==null?void 0:ie.route)?ie.route:se}),Et=async ie=>{if(!G)return;const xe=G.cell||G.id,Ie=Array.isArray(G.route)?G.route:se;if(ie.action==="up"){const Be=await Gh(e,{cell:xe,boot:!!ie.boot,...ie.engine?{engine:ie.engine}:{},...ie.model!==void 0?{model:ie.model}:{},...ie.permissionPolicy?{permissionPolicy:ie.permissionPolicy}:{}},Ie),ue=uf(Be);ue&&O(ue.text)}else await Il(e,{cell:xe,boot:!!ie.boot},Ie)},gt=(ie,xe)=>{E(""),I({mode:"new",route:Array.isArray(xe)?xe:se,form:{tmuxSession:ie.name,id:"",engine:"",cwd:"",boot:!1},err:""})},bt=()=>be(async()=>{const ie=B.form;if(!ie.engine){I({...B,err:f("import-engine-required")});return}await b0(e,{tmuxSession:ie.tmuxSession,id:ie.id||void 0,engine:ie.engine,cwd:ie.cwd||void 0,boot:!!ie.boot},ie.route||se),I(null),O(f("fleet-saved"))}),ht=({engineRows:ie=[],cellRows:xe=[]})=>be(async()=>{const Ie=ie.filter(ge=>ge.selected),Be=Ie.map(ge=>rb(ge.engine));if(Be.some(ge=>!ge))throw new Error(f("fleet-backup-invalid-engine"));const ue=Ie.filter(ge=>ge.exists).map(ge=>ge.engine.id);if(ue.length&&!window.confirm(f("fleet-backup-confirm-engine-overwrite").replace("{engines}",ue.join(", "))))return;const oe=[...new Set([...a.engines.map(ge=>ge.id),...Be.map(ge=>ge.id)])],H=[];for(const ge of xe.filter(Le=>Le.selected)){const Le=X2(ge.cell,ge.engine,oe);if(!Le)throw new Error(`${ge.cell.id}: ${f("fleet-backup-engine-missing")}`);H.push(Le)}const te=xe.filter(ge=>ge.selected&&ge.exists).map(ge=>ge.cell.id);if(te.length&&!window.confirm(f("fleet-backup-confirm-overwrite").replace("{cells}",te.join(", "))))return;const U=Be.length?await x0(e,Be,ue.length>0,se):{needsRestart:[]},le=H.length?await S0(e,H,se):{needsRestart:[]},de=[...new Set([...U.needsRestart||[],...le.needsRestart||[]])];$(!1),O(`${f("fleet-backup-restored").replace("{n}",String(H.length))}${Be.length?` · ${Be.length} ${f("fleet-engines").toLowerCase()}`:""}${de.length?` · ${f("fleet-backup-needs-restart").replace("{cells}",de.join(", "))}`:""}`)}),rt=c.jsxs("label",{className:"nc-field",children:[f("location"),c.jsxs("select",{value:q,onChange:ie=>{Y(ie.target.value),y(null),w(null),E(""),O(""),Z(!1),v(!1),p({available:!1,capabilities:[]}),u({engines:[],cells:[],managedCatalog:[]}),x([]),D(null)},children:[c.jsx("option",{value:"",children:f("local")}),n.map(ie=>c.jsxs("option",{value:ie.route.join("/"),disabled:ie.status&&ie.status!=="up",children:[ie.label,ie.status&&ie.status!=="up"?` · ${f("node-offline")}`:""]},ie.route.join("/")))]})]}),at=c.jsxs("div",{className:"nc-fleet-view-tabs",role:"tablist","aria-label":f("tab-fleet"),children:[c.jsx("button",{type:"button",role:"tab","aria-selected":A==="manage",className:`nc-set-tabbtn${A==="manage"?" on":""}`,onClick:()=>K("manage"),children:f("fleet-manage-location")}),c.jsx("button",{type:"button",role:"tab","aria-selected":A==="overview",className:`nc-set-tabbtn${A==="overview"?" on":""}`,onClick:()=>K("overview"),children:f("fleet-network-overview")})]});return m?we?c.jsxs("div",{className:"nc-set-tab nc-fleet-editor",children:[at,A==="overview"?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"nc-set-info",children:f("fleet-overview-help")}),c.jsx(Fd,{token:e,targets:n,readonly:t,onPower:Me,onImport:gt})]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"nc-set-info",children:f("fleet-manage-help")}),rt,c.jsxs("div",{className:"nc-set-row nc-fleet-backup-actions",children:[c.jsx("button",{className:"nc-btn ghost",disabled:Ye||k,onClick:()=>{E(""),$(!0)},children:f("fleet-backup")}),c.jsx("small",{children:f("fleet-backup-help")})]}),c.jsxs("div",{className:"nc-fleet-section-head",children:[c.jsx("b",{children:f("fleet-cells")}),c.jsx("span",{className:"nc-fleet-head-actions",children:c.jsxs("button",{className:"nc-btn primary",disabled:Ye||k||!a.engines.length,onClick:()=>{var ie;E(""),w({mode:"new",form:I_((ie=a.engines[0])==null?void 0:ie.id)})},children:["+ ",f("add")]})})]}),a.cells.map(ie=>{const xe=fe.has(ie.id),Ie=h.capabilities||[],Be=ie.needsRepair===!0;return c.jsxs("div",{className:"nc-fleet-item",children:[c.jsxs("span",{children:[c.jsx("b",{children:ie.id}),ie.label?c.jsxs("small",{className:"nc-fleet-label",children:[" ",ie.label]}):null,c.jsxs("small",{children:[ie.engine," · ",Be?c.jsx("span",{className:"nc-fleet-tag nc-fleet-tag-warn",children:f("fleet-cwd-needs-repair")}):ie.cwd,xe?` · ${f("service-active")}`:` · ${f("cell-off")}`]})]}),c.jsxs("span",{children:[xe&&Ie.includes("down")&&c.jsx("button",{className:"nc-btn ghost",disabled:Ye||k,onClick:()=>be(()=>Il(e,{cell:ie.id},se)),children:f("stop")}),!xe&&Ie.includes("up")&&c.jsx("button",{className:"nc-btn primary",disabled:Ye||k,onClick:()=>Me({cell:ie.id,id:ie.id,engine:ie.engine,model:ie.model,models:ie.models,permissionPolicies:ie.permissionPolicies,active:!1,boot:ie.boot}),children:f("start")}),xe&&Ie.includes("restart")&&c.jsx("button",{className:"nc-btn ghost",disabled:Ye||k,onClick:()=>be(()=>Fo(e,ie.id,se)),children:f("restart")}),Be?c.jsx("button",{className:"nc-btn ghost",disabled:Ye||k,onClick:()=>{E(""),T(ie)},children:f("fleet-cwd-repair")}):c.jsx("button",{className:"nc-btn ghost",disabled:Ye||k,onClick:()=>{var ue;E(""),w({mode:"edit",original:ie,form:{...ie,commands:{...ie.commands||{}},command:((ue=ie.commands)==null?void 0:ue[ie.engine])||""}})},children:f("edit")}),c.jsx("button",{className:"nc-btn danger",disabled:Ye||k,onClick:()=>be(async()=>{window.confirm(f("fleet-remove-cell").replace("{id}",ie.id))&&await Z_(e,ie.id,!0,se)}),children:"×"})]})]},ie.id)}),c.jsxs("div",{className:"nc-fleet-section-head",children:[c.jsx("b",{children:f("fleet-engines")}),c.jsxs("button",{className:"nc-btn primary",disabled:Ye||k,onClick:()=>{E(""),y({mode:"new",form:Q2()})},children:["+ ",f("add")]})]}),a.engines.map(ie=>{var Ie,Be;const xe=De(ie);return c.jsxs("div",{className:"nc-fleet-item",children:[c.jsxs("span",{children:[c.jsx("b",{children:ie.label}),c.jsx("small",{children:ie.managed?`${ie.id} · ${ie.managed.client} / ${ie.managed.provider} · ${(Ie=ie.managedInfo)!=null&&Ie.configured?f("fleet-ready"):((Be=ie.managedInfo)==null?void 0:Be.reason)||f("fleet-not-ready")}`:`${ie.id} · ${ie.command}`}),xe&&c.jsxs("small",{children:[xe.envKey," · ",f(`fleet-credential-source-${xe.source||"missing"}`)]})]}),c.jsxs("span",{children:[xe&&c.jsx("button",{className:"nc-btn ghost",disabled:Ye||k,onClick:()=>{E(""),D({envKey:xe.envKey,value:""})},children:xe.configured?f("fleet-credential-change"):f("fleet-credential-set")}),(xe==null?void 0:xe.source)==="local"&&c.jsx("button",{className:"nc-btn danger",disabled:Ye||k,onClick:()=>Jt(xe),children:f("fleet-credential-forget")}),c.jsx("button",{className:"nc-btn ghost",disabled:Ye||k,onClick:()=>{E(""),y({mode:"edit",original:ie,form:Z2(ie)})},children:f("edit")}),c.jsx("button",{className:"nc-btn danger",disabled:Ye||k,onClick:()=>be(async()=>{window.confirm(f("fleet-remove-engine").replace("{id}",ie.id))&&await y0(e,ie.id,se)}),children:"×"})]})]},ie.id)})]}),S&&c.jsx($s,{onClose:()=>y(null),label:f("fleet-new-engine"),error:R,children:c.jsx(nj,{state:S,setState:y,busy:k,onSave:$e,catalog:a.managedCatalog||[]})}),b&&c.jsx($s,{onClose:()=>w(null),label:f("fleet-new-cell"),error:R,children:c.jsx(ij,{token:e,route:se,targets:n,location:q,setLocation:Y,state:b,setState:w,engines:a.engines,busy:k,onSave:dt})}),j&&c.jsx($s,{onClose:()=>T(null),label:f("fleet-cwd-repair-title").replace("{id}",j.id),error:"",children:c.jsx(rj,{token:e,route:se,cell:j,busy:k,onSaved:async()=>{T(null),O(f("fleet-cwd-repaired")),await ce()},onClose:()=>T(null)})}),F&&c.jsx("div",{className:"nc-set-note",children:F}),R&&c.jsx("div",{className:"nc-err",children:R}),L&&c.jsx($s,{onClose:()=>$(!1),label:f("fleet-backup"),error:R,children:c.jsx(tj,{cells:a.cells,engines:a.engines,busy:k,canRestore:me,onRestore:ht,onClose:()=>$(!1)})}),M&&c.jsx($s,{onClose:()=>D(null),label:f("fleet-credential-title"),error:R,children:c.jsxs("div",{className:"nc-fleet-form nc-credential-form",children:[c.jsx("b",{children:f("fleet-credential-title")}),c.jsx("small",{children:f("fleet-credential-help")}),c.jsxs("label",{className:"nc-field",children:[M.envKey,c.jsx("input",{type:"password",autoComplete:"off",spellCheck:"false",autoCapitalize:"none",value:M.value,onChange:ie=>D({...M,value:ie.target.value})})]}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{className:"nc-btn ghost",onClick:()=>D(null),children:f("cancel")}),c.jsx("button",{className:"nc-btn primary",disabled:k||!M.value,onClick:Pt,children:f("save")})]})]})}),B&&c.jsx($s,{onClose:()=>I(null),label:f("import-as-cell"),error:R,children:c.jsx(O_,{token:e,route:B.route||se,state:B,setState:I,busy:k,onSave:bt})}),G&&c.jsx(Bl,{cell:G,token:e,route:Array.isArray(G.route)?G.route:se,onConfirm:async ie=>{try{await Et(ie)}finally{await ce()}},onClose:()=>Q(null)})]}):c.jsxs("div",{className:"nc-set-tab",children:[at,A==="overview"?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"nc-set-info",children:f("fleet-overview-help")}),c.jsx(Fd,{token:e,targets:n,readonly:t,onPower:Me,onImport:gt})]}):c.jsxs(c.Fragment,{children:[rt,c.jsxs("div",{className:"nc-set-info",children:[f(R?"fleet-editor-load-error":"fleet-editor-unavailable"),!R&&h.reason?` ${h.reason}`:""]})]}),R&&c.jsx("div",{className:"nc-err",children:R}),B&&c.jsx($s,{onClose:()=>I(null),label:f("import-as-cell"),error:R,children:c.jsx(O_,{token:e,route:B.route||se,state:B,setState:I,busy:k,onSave:bt})}),G&&c.jsx(Bl,{cell:G,token:e,route:Array.isArray(G.route)?G.route:se,onConfirm:async ie=>{try{await Et(ie)}finally{await ce()}},onClose:()=>Q(null)})]}):c.jsxs("div",{className:"nc-set-tab",children:[at,A==="overview"?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"nc-set-info",children:f("fleet-overview-help")}),c.jsx(Fd,{token:e,targets:n,readonly:t,onPower:Me,onImport:gt})]}):c.jsxs(c.Fragment,{children:[rt,c.jsx("div",{className:"nc-set-info",children:f("fleet-editor-loading")})]})]})}const Of="nc_notification_speech_v1",Nl="nc-notification-speech",$h="nc-notification-speech-preview",aj=320,lj=2,cj=3e4,uj=1e4,dj=6e4,hj=64,B_=Object.freeze({enabled:!1}),fj=Object.freeze({it:"it-IT",en:"en-US",es:"es-ES"}),pj=Object.freeze({it:new Set(["che","con","correzione","della","delle","difetto","il","lavoro","nessun","non","per","pronto","pubblicata","pubblicato","rilascio","sono","stato","tutti","verificata","verificato","versione","completata","completato","riepilogo"]),en:new Set(["all","and","completed","fix","for","issue","no","published","ready","release","summary","the","verified","version","with","work"]),es:new Set(["con","correccion","defecto","el","esta","para","publicada","publicado","resumen","sin","todos","trabajo","verificada","verificado","version","y"])}),Bf=new WeakSet;function zf(e){return{enabled:(e&&typeof e=="object"&&!Array.isArray(e)?e:{}).enabled===!0}}function ab(){try{return typeof localStorage<"u"?localStorage:null}catch{return null}}function z_(e=ab()){if(!e)return{...B_};try{return zf(JSON.parse(e.getItem(Of)||"null"))}catch{return{...B_}}}function mj(e,t=ab()){const n=zf(e);if(t)try{t.setItem(Of,JSON.stringify(n))}catch{}return n}function Wr(){try{return typeof window<"u"?window:null}catch{return null}}function ea(e=Wr()){try{return!!(e&&e.speechSynthesis&&typeof e.speechSynthesis.speak=="function"&&typeof e.SpeechSynthesisUtterance=="function")}catch{return!1}}function lb(e=Wr()){return!!(e&&(typeof e=="object"||typeof e=="function")&&Bf.has(e))}function Hh(e=Wr()){e&&(typeof e=="object"||typeof e=="function")&&Bf.delete(e)}function Tr(e){const t=String(e||"").trim().toLowerCase().split("-")[0];return fj[t]||""}function uc(e){return String(e||"").normalize("NFC").replace(/[\p{Cc}\p{Cf}]+/gu," ").replace(/\s+/g," ").trim()}function gj(e){const t=uc(e).normalize("NFD").replace(new RegExp("\\p{M}+","gu"),"").toLowerCase(),n=new Set(t.match(new RegExp("\\p{L}+","gu"))||[]);if(n.size<4)return"";const s=Object.entries(pj).map(([o,a])=>({lang:o,score:[...n].reduce((u,h)=>u+(a.has(h)?1:0),0)})).sort((o,a)=>a.score-o.score);return s[0].score>=3&&s[0].score-s[1].score>=2?s[0].lang:""}function vj(e,t){const n=Tr(e&&e.lang);return n||Tr(gj(e&&e.body))||Tr(t)}function cb(e){try{const t=e&&e.speechSynthesis&&e.speechSynthesis.getVoices;return typeof t=="function"?Array.from(t.call(e.speechSynthesis)||[]).filter(Boolean):[]}catch{return[]}}function ub(e,t){const n=Tr(t);if(!n)return null;const s=Array.from(e||[]).filter(h=>h&&typeof h.lang=="string"&&h.lang.trim()),o=s.filter(h=>h.lang.trim().toLowerCase()===n.toLowerCase()),a=n.slice(0,2).toLowerCase(),u=s.filter(h=>h.lang.trim().toLowerCase().split("-")[0]===a);return o.find(h=>h.default===!0)||o[0]||u.find(h=>h.default===!0)||u[0]||null}function F_(e){return uc(e).replace(/\bBearer\s+\S+/gi,"Bearer [redacted]").replace(/\b(?:sk|hf|zai|xox[baprs]|gh[pousr]|npm)[_-][A-Za-z0-9._-]{8,}\b/gi,"[redacted]").replace(/\b(?:token|password|secret|credential|api[_-]?key)\s*[=:]\s*(?:"[^"]*"|'[^']*'|\S+)/gi,"[redacted]").replace(/\b[A-Z][A-Z0-9_]{2,}\s*=\s*(?:"[^"]*"|'[^']*'|\S+)/g,"[redacted]").replace(/(?:\/home\/[^/\s]+|\/Users\/[^/\s]+|\/data\/(?:data|user\/\d+)\/[^/\s]+)(?:\/[^\s]*)?/g,"[private path]").replace(/\b[A-Za-z]:\\Users\\[^\\\s]+(?:\\[^\s]*)?/g,"[private path]")}function _j(e,t=aj){const n=F_(e&&e.title),s=F_(e&&e.body),o=[n,s&&s!==n?s:""].filter(Boolean).join(". "),a=Array.from(o);return a.length<=t?o:`${a.slice(0,Math.max(0,t-1)).join("").trimEnd()}…`}function yj(e){try{return!!(e&&e.visibilityState==="visible"&&typeof e.hasFocus=="function"&&e.hasFocus())}catch{return!1}}function db(e=Wr()){if(!ea(e))return!1;try{return e.speechSynthesis.cancel(),!0}catch{return!1}}function wj(e){try{e&&typeof e.dispatchEvent=="function"&&typeof e.Event=="function"&&e.dispatchEvent(new e.Event($h))}catch{}}function bj(e,t,n=Wr(),s={}){var m;if(Hh(n),!ea(n))return Promise.resolve(!1);const o=uc(e);if(!o||(m=s.signal)!=null&&m.aborted)return Promise.resolve(!1);const a=Number.isFinite(s.timeoutMs)&&s.timeoutMs>0?s.timeoutMs:uj,u=s.setTimer||((v,S)=>setTimeout(v,S)),h=s.clearTimer||(v=>clearTimeout(v)),p=s.signal;return wj(n),new Promise(v=>{let S=!1,y=!1,b=null,w=null;const k=C=>{if(!S){if(S=!0,p&&w&&p.removeEventListener("abort",w),b!==null&&h(b),C)Bf.add(n);else try{n.speechSynthesis.cancel()}catch{}v(C)}};w=()=>k(!1),p&&p.addEventListener("abort",w,{once:!0});try{n.speechSynthesis.cancel();const C=new n.SpeechSynthesisUtterance(o);C.lang=Tr(t);const R=ub(cb(n),C.lang);R&&(C.voice=R),C.onstart=()=>{y=!0},C.onend=()=>k(y),C.onerror=()=>k(!1),b=u(()=>k(!1),a),n.speechSynthesis.speak(C)}catch{k(!1)}})}function Sj(e={}){const t=e.scope||Wr(),n=e.document||t&&t.document,s=Number.isInteger(e.maxPending)&&e.maxPending>=0?e.maxPending:lj,o=Number.isFinite(e.watchdogMs)&&e.watchdogMs>0?e.watchdogMs:cj,a=Number.isFinite(e.dedupWindowMs)&&e.dedupWindowMs>0?e.dedupWindowMs:dj,u=Number.isInteger(e.maxDedup)&&e.maxDedup>0?e.maxDedup:hj,h=e.now||Date.now,p=e.setTimer||((B,I)=>setTimeout(B,I)),m=e.clearTimer||(B=>clearTimeout(B)),v=e.isPrimed||(()=>lb(t)),S=t&&t.speechSynthesis;let y=null,b=null,w=[],k=[],C=()=>{};const R=new Map,E=()=>{k=cb(t)};if(E(),S&&typeof S.addEventListener=="function")S.addEventListener("voiceschanged",E),C=()=>S.removeEventListener("voiceschanged",E);else if(S&&"onvoiceschanged"in S){const B=S.onvoiceschanged,I=(...j)=>{E(),typeof B=="function"&&B.apply(S,j)};S.onvoiceschanged=I,C=()=>{S.onvoiceschanged===I&&(S.onvoiceschanged=B)}}const F=B=>{if(B&&typeof B.id=="string"&&B.id)return`id:${B.id}`;const I=Number(B&&B.ts),j=uc(B&&B.title);return Number.isFinite(I)&&j?`frame:${I}:${j}`:""},O=B=>{if(!B)return!0;const I=h();for(const[j,T]of R)I-T>=a&&R.delete(j);if(R.has(B))return!1;for(R.set(B,I);R.size>u;)R.delete(R.keys().next().value);return!0},q=()=>{b!==null&&m(b),b=null},Y=()=>{q(),y&&(y.onend=null,y.onerror=null,y=null),db(t)},z=B=>{if(!ea(t))return w=[],"unsupported";let I;try{I=new t.SpeechSynthesisUtterance(B.text),I.lang=Tr(B.lang);const T=ub(k,I.lang);T&&(I.voice=T)}catch{return w=[],"error"}y=I;const j=()=>{if(y!==I)return;q(),y=null,I.onend=null,I.onerror=null;const T=w.shift();T&&z(T)};I.onend=j,I.onerror=j;try{return b=p(()=>{if(y!==I)return;y=null,I.onend=null,I.onerror=null;try{t.speechSynthesis.cancel()}catch{}q();const T=w.shift();T&&z(T)},o),t.speechSynthesis.speak(I),"speaking"}catch{return j(),"error"}},Z=(B,I)=>{if(!ea(t))return"unsupported";const j=_j(B);if(!j)return"empty";if(!O(F(B)))return"duplicate";if(!yj(n))return"inactive";if(!v())return"unprimed";const T={text:j,lang:I};return B&&B.urgency==="high"?(w=[],Y(),z(T)):y?s===0?"dropped":(w.length>=s&&w.shift(),w.push(T),"queued"):z(T)},G=()=>{w=[],Y()};return{enqueue:Z,stop:G,dispose:()=>{G(),C(),C=()=>{}}}}function hb(){const[e,t]=N.useState(z_);N.useEffect(()=>{const s=o=>{if((o==null?void 0:o.type)==="storage"&&o.key!==Of&&o.key!==null)return;const a=(o==null?void 0:o.type)===Nl?zf(o.detail):z_();t(a)};return window.addEventListener(Nl,s),window.addEventListener("storage",s),()=>{window.removeEventListener(Nl,s),window.removeEventListener("storage",s)}},[]);const n=N.useCallback(s=>{const o=mj({enabled:s===!0});return t(o),window.dispatchEvent(new CustomEvent(Nl,{detail:o})),o.enabled},[]);return[e.enabled,n]}function xj({text:e}){const[t,n]=N.useState(!1),s=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}};return c.jsxs("div",{className:"nc-set-copyline",children:[c.jsx("code",{children:e}),c.jsxs("button",{type:"button",className:"nc-btn ghost",onClick:s,children:[c.jsx(Je,{name:"copy",size:14})," ",f(t?"copied":"copy")]})]})}function kj({value:e}){const[t,n]=N.useState("");return N.useEffect(()=>{let s=!0;return n2.toDataURL(e,{margin:1,width:220}).then(o=>{s&&n(o)}).catch(()=>{}),()=>{s=!1}},[e]),t?c.jsx("img",{src:t,width:"220",height:"220",alt:"NexusCrew pairing QR"}):null}function Cj({token:e,nodes:t,roster:n,settings:s,readonly:o,refresh:a,refreshAliases:u,vlUnavailable:h=[]}){const[p,m]=N.useState(null),[v,S]=N.useState(null),[y,b]=N.useState(null),[w,k]=N.useState({ssh:"",sshPort:"",name:""}),[C,R]=N.useState(""),[E,F]=N.useState(""),[O,q]=N.useState(!1),[Y,z]=N.useState(null),Z=Date.now(),G=s&&s.deviceName||"",Q=(t||[]).filter(x=>x&&x.direction==="outbound"&&x.name&&x.ssh),B=Q.find(x=>x.name===C)||Q[0]||null,I=B?Gd(B.tunnel,Z):null,j=B!=null&&B.shared?I!=null&&I.up?"share-local-active":"share-local-pending":I!=null&&I.up?"share-local-private":"share-local-private-down",T=[{key:"peer-group-hubs",rows:(t||[]).filter(x=>x.kind!=="transitive"&&x.kind!=="vl"&&x.relation!=="client")},{key:"peer-group-clients",rows:(t||[]).filter(x=>x.kind!=="transitive"&&x.kind!=="vl"&&x.relation==="client")},{key:"peer-group-routed",rows:(t||[]).filter(x=>x.kind==="transitive")},{key:"peer-group-vl",rows:(t||[]).filter(x=>x.kind==="vl")}],L=Y&&(t||[]).find(x=>`${x.kind||"direct"}:${x.nodeId||x.name}`===Y)||null,$=async x=>{if(B){m(null),S(`${B.name}:share`);try{const M=await T0(e,B.name,x);await a(),M&&M.reversePoolPending===!0&&m(`${B.name}: ${f("share-reverse-pool-pending")}`)}catch(M){const D=M!=null&&M.data&&M.data.shared===!1?M.data:null;if(D)try{await a()}catch{}const A=M!=null&&M.data&&typeof M.data.hint=="string"?M.data.hint:"",K=(D==null?void 0:D.revoked)===!0&&(D==null?void 0:D.localReconcilePending)===!0?f("share-off-local-reconcile-pending"):(D==null?void 0:D.revoked)===!1&&(D==null?void 0:D.reconcilePending)===!0?f("share-off-hub-reconcile-pending"):"",X=M!=null&&M.data&&M.data.reversePoolPending===!0?f("share-reverse-pool-pending"):"",se=M!=null&&M.data&&typeof M.data.code=="string"?M.data.code:"",ce=M!=null&&M.data&&typeof M.data.detail=="string"?M.data.detail.trim():"",fe=ce&&ce!==String(M.message||"")?ce:"";m(`${B.name}: ${String(M.message||M)}${se?` [${se}]`:""}${fe?` — ${fe}`:""}${A?` — ${A}`:""}${K?` — ${K}`:""}${X?` — ${X}`:""}`)}S(null)}},W=async()=>{m(null);const x=vs(w.name||E||G||"NexusCrew"),M=Ix({name:x,ssh:w.ssh,sshPort:w.sshPort});if(!M.ok){m(f(M.error));return}S("invite");try{b(await R0(e,{...E||G?{label:E||G}:{},name:x,ssh:M.value.ssh,...M.value.sshPort?{sshPort:M.value.sshPort}:{}}))}catch(D){m(String(D.message||D))}S(null)};return c.jsxs("div",{className:"nc-set-tab",children:[c.jsx("div",{className:"nc-sheet-label",children:f("peer-inventory-title")}),(t||[]).length===0&&c.jsx("div",{className:"nc-empty",children:f("no-nodes")}),T.map(x=>x.rows.length>0&&c.jsxs("div",{className:"nc-peer-group",children:[c.jsxs("div",{className:"nc-peer-group-title",children:[f(x.key)," ",c.jsx("span",{children:x.rows.length})]}),x.rows.map(M=>{const D=p2(M);if(!D)return null;const A=`${M.kind||"direct"}:${M.nodeId||M.name}`,K=D.routed?{up:D.reach.up,since:null}:Gd(M.tunnel,Z);return c.jsxs("button",{type:"button",className:`nc-set-node nc-node-row${D.routed?" routed":""}`,"aria-label":`${D.title} — ${f("node-detail-open")}`,onClick:()=>z(A),children:[c.jsx("span",{className:`nc-dot ${D.reach.up?"on":""}`}),c.jsxs("span",{className:"nc-node-row-text",children:[c.jsx("b",{children:D.title}),c.jsxs("small",{children:[D.routed?D.routeLabel:`${D.subtitle} · ${f(D.exposure.shortKey)}`,!D.routed&&D.exposure.shortKey==="visibility-selected"?` (${D.exposure.count})`:""]})]}),c.jsxs("span",{className:`nc-set-tunnel${D.reach.up?" up":""}`,children:[f(D.reach.key),K.since?` · ${K.since}`:""]}),c.jsx("span",{className:"nc-node-row-more",children:c.jsx(Je,{name:"chevronDown",size:14})})]},A)})]},x.key)),h.length>0&&c.jsxs("div",{className:"nc-err",children:[f("vl-owners-unavailable"),": ",h.map(x=>x.label||x.route.join("/")).join(", ")]}),L&&c.jsx(R2,{node:L,nodes:t||[],token:e,readonly:o,refresh:a,onClose:()=>z(null)}),(n||[]).some(x=>!x.direct&&x.instanceId)&&c.jsxs("div",{className:"nc-set-form",children:[c.jsx("div",{className:"nc-sheet-label",children:f("routed-node-aliases")}),c.jsx("small",{className:"nc-set-hint",children:f("routed-node-aliases-help")}),(n||[]).filter(x=>!x.direct&&x.instanceId).map(x=>c.jsxs("div",{className:"nc-set-node",children:[c.jsxs("div",{className:"nc-set-node-head",children:[c.jsx("span",{className:`nc-dot ${x.status==="up"?"on":""}`}),c.jsx("b",{children:x.label||x.name}),c.jsx("small",{children:(x.route||[]).join(" › ")})]}),c.jsxs("div",{className:"nc-set-node-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:o||!!v,onClick:async()=>{const M=window.prompt(f("node-local-alias"),x.alias||"");if(M!=null){if(M.trim()&&!Ir(M.normalize("NFC"))){m(f("err-label"));return}S(`${x.instanceId}:alias`),m(null);try{M.trim()?await L0(e,x.instanceId,M):await Sg(e,x.instanceId),u()}catch(D){m(String(D.message||D))}S(null)}},children:f("alias-on-device")}),x.alias&&c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:o||!!v,onClick:async()=>{S(`${x.instanceId}:alias-reset`),m(null);try{await Sg(e,x.instanceId),u()}catch(M){m(String(M.message||M))}S(null)},children:f("reset-alias")})]})]},x.instanceId))]}),B&&c.jsxs("div",{className:"nc-set-form nc-local-share",children:[c.jsx("div",{className:"nc-sheet-label",children:f("share-local-heading")}),Q.length>1&&c.jsxs("label",{className:"nc-field",children:[f("share-local-hub"),c.jsx("select",{value:B.name,disabled:o||!!v,onChange:x=>R(x.target.value),children:Q.map(x=>c.jsx("option",{value:x.name,children:x.label||x.name},x.name))})]}),c.jsxs("label",{className:"nc-check nc-node-share",children:[c.jsx("input",{type:"checkbox",checked:B.shared===!0,disabled:o||!!v,onChange:x=>$(x.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:f("share-local-through").replace("{device}",G||f("local")).replace("{hub}",B.label||B.name)}),c.jsx("small",{children:f(B.shared?"share-node-on-desc":"share-node-off-desc")})]})]}),c.jsx("div",{className:`nc-set-test${B.shared&&(I!=null&&I.up)?" ok":I!=null&&I.up?"":" ko"}`,children:f(j)}),!(I!=null&&I.up)&&c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:o||!!v,onClick:()=>$(B.shared===!0),children:f("share-local-reconnect")})]}),c.jsx(Gw,{token:e,deviceDefault:G,localNodeId:s&&s.nodeId||"",localNameDefault:s&&s.localName||"",readonly:o,onSuccess:a}),c.jsxs("div",{className:"nc-set-form",children:[c.jsx("div",{className:"nc-sheet-label",children:f("invite-node")}),c.jsx("small",{className:"nc-set-hint",children:f("invite-v2-hint")}),c.jsxs("div",{className:"nc-set-info nc-invite-endpoint",children:[f("invite-target-local"),": ",c.jsx("b",{children:G||f("invite-target-this")})]}),c.jsxs("label",{className:"nc-field",children:[f("invite-endpoint-label"),c.jsx("input",{placeholder:"user@host",value:w.ssh,disabled:o,onChange:x=>k({...w,ssh:x.target.value})}),c.jsx("small",{className:"nc-set-hint",children:f("invite-endpoint-needed")})]}),Q.length>0&&c.jsx("small",{className:"nc-set-hint nc-invite-hub-hint",children:f("invite-hub-only")}),O&&c.jsxs("div",{className:"nc-invite-advanced",children:[c.jsxs("label",{className:"nc-field",children:[f("node-ssh-port-label"),c.jsx("input",{inputMode:"numeric",placeholder:"22",value:w.sshPort,disabled:o,onChange:x=>k({...w,sshPort:x.target.value.replace(/[^0-9]/g,"").slice(0,5)})})]}),c.jsxs("label",{className:"nc-field",children:[f("device-name-label"),c.jsx("input",{placeholder:G||"NexusCrew",value:E,disabled:o,onChange:x=>F(x.target.value)}),c.jsx("small",{className:"nc-set-hint",children:f("device-name-hint")})]}),c.jsxs("label",{className:"nc-field",children:[f("node-name-label"),c.jsx("input",{placeholder:vs(E||G||f("node-name-ph")),value:w.name,disabled:o,onChange:x=>k({...w,name:x.target.value?vs(x.target.value):""})})]})]}),c.jsxs("div",{className:"nc-set-row nc-invite-actions",children:[c.jsx("button",{type:"button",className:"nc-btn primary",disabled:o||!!v||!w.ssh.trim(),onClick:W,children:f("create-pairing-link")}),c.jsxs("button",{type:"button",className:"nc-btn ghost",disabled:!!v,onClick:()=>q(x=>!x),children:[O?"▾":"▸"," ",f("pair-advanced")]})]}),y&&c.jsxs(c.Fragment,{children:[c.jsx(kj,{value:y.pairingUrl}),c.jsx(xj,{text:y.pairingUrl}),c.jsx("div",{className:"nc-set-info",children:f("invite-next-steps")})]})]}),p&&c.jsx("div",{className:"nc-err",children:p})]})}function Ej({token:e,readonly:t}){const[n,s]=N.useState("idle"),[o,a]=N.useState(!1),[u,h]=N.useState(null);N.useEffect(()=>{let m=!1;return L2().then(v=>{m||s(v)}),()=>{m=!0}},[]);const p=async()=>{h(null),a(!0);try{n==="subscribed"?(await T2(e),s("idle")):(await A2(e),s("subscribed"))}catch(m){const v=String(m.message||m);v==="push-denied"?(s("denied"),h(f("push-denied"))):v==="push-unsupported"?(s("unsupported"),h(f("push-unsupported"))):h(v)}a(!1)};return n==="unsupported"?c.jsx("div",{className:"nc-set-info",children:f("push-unsupported")}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:t||o||n==="denied",title:t?f("settings-readonly"):"",onClick:p,children:f(n==="subscribed"?"push-disable":"push-enable")}),c.jsx("span",{className:"nc-set-info",children:f(n==="subscribed"?"push-on":n==="denied"?"push-denied":"push-off")})]}),u&&c.jsx("div",{className:"nc-err",children:u})]})}function Nj(){const[e,t]=hb(),[n,s]=N.useState(""),[o,a]=N.useState(""),[u,h]=N.useState(!1),[p,m]=N.useState(lb),v=N.useRef(0),S=N.useRef(!1),y=N.useRef(null),b=ea();N.useEffect(()=>()=>{var C;v.current+=1,S.current&&((C=y.current)==null||C.abort(),y.current=null,S.current=!1,Hh())},[]);const w=async()=>{const C=v.current+=1,R=typeof AbortController=="function"?new AbortController:null;s(""),a(""),h(!0),m(!1),S.current=!0,y.current=R;const E=await bj(f("notification-speech-preview"),Ol(),void 0,R?{signal:R.signal}:{});return C!==v.current||(y.current=null,S.current=!1,h(!1),m(E),E?a(f("notification-speech-preview-ok")):s(f("notification-speech-preview-failed"))),E},k=C=>{var R;if(t(C),s(""),a(""),C)w();else{v.current+=1;const E=S.current;(R=y.current)==null||R.abort(),y.current=null,S.current=!1,h(!1),m(!1),Hh(),E||db()}};return c.jsxs("div",{className:"nc-set-form",children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox","aria-label":f("notification-speech-enable"),checked:e,disabled:!b,onChange:C=>k(C.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:f("notification-speech-enable")}),c.jsx("small",{children:f("notification-speech-help")})]})]}),b?c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:!e||u,onClick:()=>{w()},children:f(u?"notification-speech-testing":"notification-speech-test")})}):c.jsx("div",{className:"nc-set-info",children:f("notification-speech-unsupported")}),e&&!p&&!u&&!n&&c.jsx("div",{className:"nc-set-info",children:f("notification-speech-needs-test")}),o&&c.jsx("div",{className:"nc-set-info",role:"status",children:o}),n&&c.jsx("div",{className:"nc-err",children:n})]})}function jj({token:e,readonly:t,nodes:n=[],settings:s=null}){const[o,a]=N.useState(null),[u,h]=N.useState([]),[p,m]=N.useState({name:"",mode:"primary-failover",targets:[]}),[v,S]=N.useState(null),[y,b]=N.useState(!1),[w,k]=N.useState(null),[C,R]=N.useState(""),E=N.useCallback(async()=>{try{const[W,x]=await Promise.all([M0(e),z0(e)]);a(W),h(Array.isArray(x==null?void 0:x.groups)?x.groups:[]),R("")}catch(W){R(String(W.message||W))}},[e]);N.useEffect(()=>{E()},[E]);const F=async W=>{b(!0),k(null),R("");try{a(await I0(e,W))}catch(x){R(String(x.message||x))}b(!1)},O=async()=>{b(!0),k(null),R("");try{k({kind:"test",...await O0(e)})}catch(W){R(String(W.message||W))}b(!1)},q=async()=>{b(!0),k(null),R("");try{k({kind:"stop",...await B0(e)})}catch(W){R(String(W.message||W))}b(!1)},Y=[],z=new Set,Z=(W,x)=>{const M=typeof W=="string"?W.toLowerCase():"";!/^[a-f0-9]{32}$/.test(M)||z.has(M)||(z.add(M),Y.push({id:M,label:x||M}))};Z(s==null?void 0:s.nodeId,f("audio-group-local"));for(const W of n||[])Z((W==null?void 0:W.nodeId)||(W==null?void 0:W.instanceId),(W==null?void 0:W.label)||(W==null?void 0:W.name)||(W==null?void 0:W.nodeId));for(const W of p.targets)Z(W,`${W} (${f("audio-group-unavailable-target")})`);const G=(W=null)=>{R(""),W?(S(W.name),m({name:W.name,mode:W.mode,targets:[...W.targets||[]]})):(S(null),m({name:"",mode:"primary-failover",targets:[]}))},Q=(W,x)=>m(M=>({...M,targets:x?[...new Set([...M.targets,W])]:M.targets.filter(D=>D!==W)})),B=async()=>{const W=p.name.trim().toLowerCase();if(!/^[a-z0-9][a-z0-9-]{0,31}$/.test(W)||p.targets.length<1){R(f("audio-group-invalid"));return}b(!0),R("");try{const x=await F0(e,W,{targets:p.targets,mode:p.mode}),M=x==null?void 0:x.group;if(!M||!M.name)throw new Error(f("audio-group-save-failed"));h(D=>[...D.filter(A=>A.name!==M.name),M].sort((A,K)=>A.name.localeCompare(K.name))),G(null)}catch(x){R(String(x.message||x))}b(!1)},I=async W=>{b(!0),R("");try{await $0(e,W),h(x=>x.filter(M=>M.name!==W)),v===W&&G(null)}catch(x){R(String(x.message||x))}b(!1)},j=(o==null?void 0:o.installed)===!0,T=(o==null?void 0:o.liveness)==="ready",L=(o==null?void 0:o.consent)===!0&&j&&T,$=w?w.kind==="stop"?f(w.stopped?"audio-stop-stopped":"audio-stop-idle"):w.status==="accepted"||w.status==="spoken"?f("audio-test-accepted"):w.status==="unknown"?f("audio-test-unknown"):`${f("audio-test-refused")}${w.reason?` (${w.reason})`:""}`:"";return c.jsxs("div",{className:"nc-set-tab nc-audio-settings",children:[c.jsxs("div",{className:"nc-set-info",children:[c.jsx("b",{children:f("audio-title")}),c.jsx("br",{}),f("audio-help")]}),o?c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox","aria-label":f("audio-consent"),checked:o.consent===!0,disabled:t||y,onChange:W=>{F(W.target.checked)}}),c.jsxs("span",{children:[c.jsx("b",{children:f("audio-consent")}),c.jsx("small",{children:f("audio-consent-help")})]})]}),c.jsxs("div",{className:"nc-set-form",children:[c.jsx("div",{className:"nc-sheet-label",children:f("audio-capability")}),c.jsxs("div",{className:"nc-set-info",children:[f("audio-adapter"),": ",o.adapter||f("audio-adapter-none"),c.jsx("br",{}),f("audio-installed"),": ",f(j?"audio-installed-yes":"audio-installed-no"),c.jsx("br",{}),f("audio-liveness"),": ",f(T?"audio-liveness-ready":"audio-liveness-unavailable"),Array.isArray(o.languages)&&o.languages.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("br",{}),f("audio-languages"),": ",o.languages.join(", ")]})]}),o.limits&&c.jsxs("small",{className:"nc-set-hint",children:[f("audio-limits"),": ",o.limits]})]}),!o.consent&&c.jsx("div",{className:"nc-set-info",children:f("audio-test-needs-consent")}),!j&&c.jsx("div",{className:"nc-set-info",children:f("audio-unavailable")}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn primary",disabled:t||y||!L,title:t?f("settings-readonly"):"",onClick:()=>{O()},children:f(y?"audio-testing":"audio-test")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:y,onClick:()=>{q()},children:f(y?"audio-stopping":"audio-stop")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:y,onClick:()=>{E()},children:f("refresh")})]}),c.jsxs("div",{className:"nc-set-form",children:[c.jsx("div",{className:"nc-sheet-label",children:f("audio-groups-title")}),c.jsx("small",{className:"nc-set-hint",children:f("audio-groups-help")}),u.length===0&&c.jsx("div",{className:"nc-set-info",children:f("audio-groups-empty")}),u.map(W=>{var x;return c.jsxs("div",{className:"nc-set-row",children:[c.jsxs("span",{children:[c.jsx("b",{children:W.name})," ",c.jsxs("small",{children:["· ",W.mode==="fanout"?f("audio-group-fanout"):f("audio-group-primary")," · ",((x=W.targets)==null?void 0:x.length)||0]})]}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:t||y,onClick:()=>G(W),children:f("audio-group-edit")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:t||y,onClick:()=>{I(W.name)},children:f("audio-group-delete")})]},W.name)}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:t||y,onClick:()=>G(null),children:f("audio-group-new")})}),c.jsxs("label",{className:"nc-field",children:[f("audio-group-name"),c.jsx("input",{"aria-label":f("audio-group-name"),value:p.name,maxLength:"32",disabled:t||y,onChange:W=>m(x=>({...x,name:W.target.value}))})]}),c.jsxs("label",{className:"nc-field",children:[f("audio-group-mode"),c.jsxs("select",{"aria-label":f("audio-group-mode"),value:p.mode,disabled:t||y,onChange:W=>m(x=>({...x,mode:W.target.value})),children:[c.jsx("option",{value:"primary-failover",children:f("audio-group-primary")}),c.jsx("option",{value:"fanout",children:f("audio-group-fanout")})]})]}),c.jsx("div",{className:"nc-set-info",children:f("audio-group-targets")}),Y.length===0?c.jsx("small",{className:"nc-set-hint",children:f("audio-group-no-targets")}):Y.map(W=>c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:p.targets.includes(W.id),disabled:t||y,onChange:x=>Q(W.id,x.target.checked)}),c.jsxs("span",{children:[W.label,c.jsx("small",{children:W.id})]})]},W.id)),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn primary",disabled:t||y,onClick:()=>{B()},children:f("audio-group-save")}),v&&c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:y,onClick:()=>G(null),children:f("audio-group-cancel")})]})]})]}):c.jsx("div",{className:"nc-set-info",children:f("audio-loading")}),$&&c.jsx("div",{className:"nc-set-note",role:"status",children:$}),C&&c.jsx("div",{className:"nc-err",children:C})]})}function Rj(){const[e,t]=kf();return c.jsxs("div",{className:"nc-set-tab nc-input-settings",children:[c.jsx("div",{className:"nc-set-info",children:f("input-settings-local")}),c.jsxs("div",{className:"nc-set-form",children:[c.jsxs("label",{className:"nc-field",children:[f("terminal-keyboard-gesture"),c.jsx("select",{"aria-label":f("terminal-keyboard-gesture"),value:e.terminalKeyboardGesture,onChange:n=>t({terminalKeyboardGesture:n.target.value}),children:Nw.map(n=>c.jsx("option",{value:n,children:f(`terminal-keyboard-${n}`)},n))}),c.jsx("small",{children:f("terminal-keyboard-gesture-help")})]}),c.jsxs("label",{className:"nc-field",children:[f("keybar-layout"),c.jsx("select",{"aria-label":f("keybar-layout"),value:e.keybarLayout,onChange:n=>t({keybarLayout:n.target.value}),children:jw.map(n=>c.jsx("option",{value:n,children:f(`keybar-layout-${n}`)},n))}),c.jsx("small",{children:f("keybar-layout-help")})]})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:e.keybarKeepsKeyboardClosed,onChange:n=>t({keybarKeepsKeyboardClosed:n.target.checked})}),c.jsxs("span",{children:[c.jsx("b",{children:f("keybar-ime-lock")}),c.jsx("small",{children:f("keybar-ime-lock-help")})]})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:e.voiceKeepsKeyboardClosed,onChange:n=>t({voiceKeepsKeyboardClosed:n.target.checked})}),c.jsxs("span",{children:[c.jsx("b",{children:f("voice-ime-lock")}),c.jsx("small",{children:f("voice-ime-lock-help")})]})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:e.showKeybarEnter,onChange:n=>t({showKeybarEnter:n.target.checked})}),c.jsxs("span",{children:[c.jsx("b",{children:f("keybar-enter-show")}),c.jsx("small",{children:f("keybar-enter-show-help")})]})]}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:()=>t(ps),children:f("input-settings-reset")})})]})}function Pj({token:e,roster:t=[],readonly:n}){const s=[{key:"local",route:[],label:f("diagnostics-local"),status:"up"},...t.filter(L=>Array.isArray(L.route)&&L.route.length).map(L=>({key:L.route.join("/"),route:L.route,label:L.label||L.name,status:L.status}))],[o,a]=N.useState("local"),u=s.find(L=>L.key===o)||s[0],[h,p]=N.useState(null),[m,v]=N.useState([]),[S,y]=N.useState(""),[b,w]=N.useState(!1),[k,C]=N.useState(!0),[R,E]=N.useState(900),[F,O]=N.useState("all"),[q,Y]=N.useState(""),z=N.useRef(0),Z=N.useRef(null),G=N.useCallback(async()=>{try{const L=await K0(e,u.route);if(p(L),y(""),!b){const $=await q0(e,{after:z.current,limit:200},u.route);Array.isArray($.records)&&$.records.length&&(z.current=$.cursor,v(W=>[...W,...$.records].slice(-500)))}}catch(L){y(L&&L.status===404?f("diagnostics-unsupported"):String(L.message||L))}},[e,u.key,b]);N.useEffect(()=>{z.current=0,v([]),p(null),y("")},[u.key]),N.useEffect(()=>{let L=null,$=!0;const W=()=>{!$||document.visibilityState==="hidden"||G()},x=()=>{L&&clearInterval(L),L=document.visibilityState==="hidden"?null:setInterval(W,2e3),document.visibilityState!=="hidden"&&W()};return document.addEventListener("visibilitychange",x),x(),()=>{$=!1,L&&clearInterval(L),document.removeEventListener("visibilitychange",x)}},[G]),N.useEffect(()=>{k&&Z.current&&(Z.current.scrollTop=Z.current.scrollHeight)},[m,k]);const Q=m.filter(L=>(F==="all"||L.level===F)&&(!q||String(L.component||"").toLowerCase().includes(q.toLowerCase()))),B=Q.map(L=>`${L.ts} ${L.level.toUpperCase()} ${L.component} ${L.code} ${L.message}${Object.keys(L.meta||{}).length?` ${JSON.stringify(L.meta)}`:""}`).join(`
|
|
92
92
|
`),I=async L=>{y("");try{const $=await L();p($),await G()}catch($){y(String($.message||$))}},j=async()=>{try{await navigator.clipboard.writeText(B)}catch{y(f("copy-manual"))}},T=()=>{try{const L=new Blob([`${JSON.stringify(Q,null,2)}
|
|
93
|
-
`],{type:"application/json"}),$=URL.createObjectURL(L),W=document.createElement("a");W.href=$,W.download="nexuscrew-diagnostics.json",W.click(),URL.revokeObjectURL($)}catch{y(f("diagnostics-export-failed"))}};return c.jsxs("div",{className:"nc-set-tab nc-diagnostics",children:[c.jsxs("label",{className:"nc-field",children:[f("diagnostics-target"),c.jsx("select",{value:u.key,onChange:L=>a(L.target.value),children:s.map(L=>c.jsxs("option",{value:L.key,children:[L.label,L.status!=="up"?` · ${L.status}`:""]},L.key))})]}),c.jsxs("div",{className:"nc-set-form nc-diag-controls",children:[c.jsx("div",{className:"nc-sheet-label",children:f("diagnostics-verbose")}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("select",{"aria-label":f("diagnostics-duration"),value:R,onChange:L=>E(Number(L.target.value)),disabled:n,children:[300,900,1800,3600].map(L=>c.jsxs("option",{value:L,children:[L/60," min"]},L))}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:n||(h==null?void 0:h.verbose)===!0,onClick:()=>I(()=>kg(e,!0,R,u.route)),children:f("enable")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||(h==null?void 0:h.verbose)!==!0,onClick:()=>I(()=>kg(e,!1,R,u.route)),children:f("stop")})]}),c.jsx("small",{className:"nc-set-hint",children:h!=null&&h.verbose?f("diagnostics-expires").replace("{time}",new Date(h.expiresAt).toLocaleTimeString()):f("diagnostics-off")})]}),c.jsxs("div",{className:"nc-diag-filters",children:[c.jsxs("select",{"aria-label":f("diagnostics-level"),value:F,onChange:L=>O(L.target.value),children:[c.jsx("option",{value:"all",children:f("diagnostics-all-levels")}),["debug","info","warn","error"].map(L=>c.jsx("option",{value:L,children:L},L))]}),c.jsx("input",{"aria-label":f("diagnostics-component"),placeholder:f("diagnostics-component"),value:q,onChange:L=>Y(L.target.value)})]}),c.jsxs("div",{className:"nc-set-row",children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:b,onChange:L=>w(L.target.checked)})," ",f("diagnostics-pause")]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:k,onChange:L=>C(L.target.checked)})," ",f("diagnostics-autoscroll")]})]}),c.jsx("pre",{ref:Z,className:"nc-diag-log","aria-label":f("diagnostics-log"),children:B||f("diagnostics-empty")}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:j,children:f("copy")}),c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:T,children:f("diagnostics-export")}),c.jsx("button",{type:"button",className:"nc-btn danger",disabled:n,onClick:()=>{window.confirm(f("diagnostics-clear-confirm"))&&I(async()=>{const L=await V0(e,u.route);return z.current=0,v([]),L})},children:f("diagnostics-clear")})]}),S&&c.jsx("div",{className:"nc-err",children:S})]})}function Lj({token:e,settings:t,readonly:n,refresh:s,roster:o,section:a,setSection:u}){const[h,p]=N.useState(null),[m,v]=N.useState(null),[S,y]=N.useState(!1),[b,w]=N.useState(!1),[k,C]=N.useState(null),[R,E]=N.useState(!0),[F,O]=N.useState(!1);N.useEffect(()=>{C(t&&t.update||null),E(!t||t.autoUpdate!==!1),O(!!(t&&t.alternateScreen))},[t]);const q=async()=>{p(null),v(null),w(!0);try{const j=await N0(e);v(j.note||"ok"),y(!1)}catch(j){p(String(j.message||j))}w(!1)},Y=async()=>{p(null),v(null),w(!0);try{const j=await H0(e);v(`${j.note||"ok"}${j.target?` (${j.target})`:""}`)}catch(j){p(String(j.message||j))}w(!1)},z=async j=>{p(null),v(null),w(!0);try{await Wd(e,{autoUpdate:j}),E(j),s&&await s()}catch(T){p(String(T.message||T))}w(!1)},Z=async j=>{p(null),v(null),w(!0);try{await Wd(e,{alternateScreen:j}),O(j),s&&await s()}catch(T){p(String(T.message||T))}w(!1)},G=async()=>{p(null),v(null),w(!0);try{C(await U0(e))}catch(j){p(String(j.message||j))}w(!1)},Q=async()=>{p(null),v(null),w(!0);try{const j=await W0(e);C(j),v(f("npm-update-restarting"))}catch(j){p(String(j.message||j))}w(!1)},B=()=>{window.confirm(f("composer-clear-confirm"))&&(p(null),KE()?(window.dispatchEvent(new Event(Mh)),v(f("composer-clear-done"))):p(f("composer-clear-failed")))},I=t&&t.service;return c.jsxs("div",{className:"nc-set-tab",children:[c.jsx("div",{className:"nc-system-tabs",role:"tablist","aria-label":f("tab-system"),children:["general","diagnostics"].map(j=>c.jsx("button",{type:"button",role:"tab","aria-selected":a===j,className:`nc-set-tabbtn${a===j?" on":""}`,onClick:()=>u(j),children:f(`system-${j}`)},j))}),a==="general"&&c.jsxs(c.Fragment,{children:[c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:f("system-this-node")}),t&&c.jsxs("div",{className:"nc-set-info",children:["v",t.version," · ",t.platform," · :",t.port,c.jsx("br",{}),I&&I.installed?f("service-installed"):f("service-missing"),I&&I.installed?` · ${I.active?f("service-active"):f("service-inactive")}`:"",I?` · boot ${I.boot?"on":"off"}`:""]}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||b,title:n?f("settings-readonly"):"",onClick:Y,children:f("service-regenerate")})}),c.jsx(Ej,{token:e,readonly:n}),c.jsx(Nj,{})]}),c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:f("system-updates")}),c.jsxs("div",{className:"nc-set-form nc-update-settings",children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:R,disabled:n||b||k&&!k.supported,onChange:j=>z(j.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:f("npm-auto-update")}),c.jsx("small",{children:f("npm-auto-update-help")})]})]}),k&&c.jsxs("div",{className:"nc-set-info",children:[f("npm-update-current")," v",k.current,k.latest?` · ${f("npm-update-latest")} v${k.latest}`:""," · ",f(`npm-update-${k.supported?k.phase:"unsupported"}`)]}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||b||!k||!k.supported,onClick:G,children:f("npm-update-check")}),k&&k.available&&c.jsx("button",{type:"button",className:"nc-btn primary",disabled:n||b||k.phase==="installing",onClick:Q,children:f("npm-update-install")})]}),k&&k.lastError&&c.jsx("div",{className:"nc-err",children:k.lastError})]})]}),c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:f("system-security")}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||b,title:n?f("settings-readonly"):"",onClick:()=>{p(null),v(null),y(!0)},children:f("token-rotate")})})]}),c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:f("system-local-data")}),c.jsxs("div",{className:"nc-set-form",children:[c.jsx("div",{className:"nc-sheet-label",children:f("composer-clear-data")}),c.jsx("small",{className:"nc-set-hint",children:f("composer-clear-data-help")}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:B,children:f("composer-clear-data")})})]})]})]}),a==="diagnostics"&&c.jsxs("section",{className:"nc-system-group nc-system-diagnostics",children:[c.jsx("h3",{children:f("system-diagnostics")}),c.jsxs("div",{className:"nc-set-form nc-alternate-screen-settings",children:[c.jsx("div",{className:"nc-sheet-label",children:f("system-terminal")}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox","aria-label":f("alternate-screen"),checked:F,disabled:n||b,onChange:j=>Z(j.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:f("alternate-screen")}),c.jsx("small",{children:f("alternate-screen-help")})]})]})]}),c.jsx(Pj,{token:e,roster:o,readonly:n})]}),S&&c.jsxs("div",{className:"nc-set-confirm",children:[c.jsx("div",{children:f("token-rotate-explain")}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:b,onClick:()=>y(!1),children:f("cancel")}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:b,onClick:q,children:f("confirm")})]})]}),m&&c.jsx("div",{className:"nc-set-note",children:m}),h&&c.jsx("div",{className:"nc-err",children:h})]})}function Aj({token:e,onClose:t,initialTab:n="nodes",initialLocation:s="",startNewCell:o=!1}){kn();const a=n==="diagnostics"?"diagnostics":"general",[u,h]=N.useState(n==="diagnostics"?"system":n),p=N.useRef(null),m=N.useRef(null),[v,S]=N.useState({start:!1,end:!1}),[y,b]=N.useState(a),[w,k]=N.useState(null),[C,R]=N.useState([]),[E,F]=N.useState([]),[O,q]=N.useState(!1),[Y,z]=N.useState(null),[Z,G]=N.useState(0),Q=nf(e,!0,Z),B=N.useCallback(()=>{const j=p.current;if(!j)return;const T=j.scrollWidth>j.clientWidth+1,L={start:T&&j.scrollLeft>1,end:T&&j.scrollLeft+j.clientWidth<j.scrollWidth-1};S($=>$.start===L.start&&$.end===L.end?$:L)},[]);N.useEffect(()=>{const j=p.current;if(!j)return;const T=typeof ResizeObserver=="function"?new ResizeObserver(B):null;return T==null||T.observe(j),window.addEventListener("resize",B),B(),()=>{T==null||T.disconnect(),window.removeEventListener("resize",B)}},[B]),N.useEffect(()=>{var T,L;(L=(T=m.current)==null?void 0:T.scrollIntoView)==null||L.call(T,{behavior:"smooth",block:"nearest",inline:"nearest"});const j=window.requestAnimationFrame?window.requestAnimationFrame(B):setTimeout(B,0);return()=>{window.cancelAnimationFrame?window.cancelAnimationFrame(j):clearTimeout(j)}},[u,B]);const I=N.useCallback(async()=>{var j;try{const T=await ty(e);k(T),z(null)}catch(T){z(String(T.message||T))}try{const L=(await C0(e)).peers||[];let $=[],W=[];try{const[x,M]=await Promise.all([Ht("/api/config",e).then(X=>X.json()).catch(()=>null),iy(e).catch(()=>null)]),D=x&&typeof x.instanceId=="string"?x.instanceId:"",A=[{instanceId:D||null,route:[],label:null},...hy(M,D)],K=await Promise.all(A.map(async X=>{try{return{ok:!0,peers:((await ny(e,X.route)).nodes||[]).map(fe=>dy(fe,X)).filter(Boolean)}}catch(se){return{ok:!1,owner:X,error:se}}}));for(const X of K){if(X.ok){$.push(...X.peers);continue}X.owner.route.length!==0&&W.push({instanceId:X.owner.instanceId,label:X.owner.label,route:X.owner.route,failure:/timeout/i.test(String(((j=X.error)==null?void 0:j.message)||X.error))?"timeout":"unreachable"})}}catch{}F(W),R([...L,...$])}catch(T){z(String(T.message||T))}},[e]);return N.useEffect(()=>{I();const j=setInterval(I,5e3);return()=>clearInterval(j)},[I]),N.useEffect(()=>{let j=!1;return Ht("/api/config",e).then(T=>T.json()).then(T=>{j||q(!!T.readonlyDefault)}).catch(()=>{}),()=>{j=!0}},[e]),c.jsx("div",{className:"nc-set-overlay",onClick:t,children:c.jsxs("div",{className:"nc-set-panel",onClick:j=>j.stopPropagation(),children:[c.jsxs("div",{className:"nc-set-head",children:[c.jsx(Je,{name:"gear",size:18}),c.jsx("b",{children:f("settings")}),c.jsx("button",{type:"button",className:"nc-set-close",onClick:t,title:f("close"),children:c.jsx(Je,{name:"x",size:18})})]}),O&&c.jsx("div",{className:"nc-set-readonly",children:f("settings-readonly")}),Y&&c.jsx("div",{className:"nc-err",children:Y}),c.jsx("div",{className:`nc-set-tabs-wrap${v.start?" has-start-overflow":""}${v.end?" has-end-overflow":""}`,children:c.jsx("div",{className:"nc-set-tabs",ref:p,onScroll:B,children:["nodes","fleet","audio","input","system"].map(j=>c.jsx("button",{ref:u===j?m:null,type:"button",className:`nc-set-tabbtn${u===j?" on":""}`,onClick:()=>h(j),children:f(`tab-${j}`)},j))})}),c.jsxs("div",{className:"nc-set-body",children:[u==="nodes"&&c.jsx(Cj,{token:e,nodes:C,roster:Q,settings:w,readonly:O,vlUnavailable:E,refresh:I,refreshAliases:()=>G(j=>j+1)}),u==="fleet"&&c.jsx(oj,{token:e,readonly:O,startNewCell:o,initialLocation:s,targets:Q.map(j=>({route:j.route,label:j.label||j.name,status:j.status}))}),u==="audio"&&c.jsx(jj,{token:e,readonly:O,nodes:C,settings:w}),u==="input"&&c.jsx(Rj,{}),u==="system"&&c.jsx(Lj,{token:e,settings:w,readonly:O,refresh:I,roster:Q,section:y,setSection:b})]})]})})}function Tj({token:e,initialPair:t,deviceDefault:n="",localNodeId:s="",localNameDefault:o="",onPairDone:a,onDone:u}){kn();const[h,p]=N.useState(t?"pair":"welcome"),[m,v]=N.useState(!1),[S,y]=N.useState(null),b=async()=>{v(!0),y(null);try{await Wd(e,{wizardDone:!0}),a&&a(),u()}catch(w){y(String(w.message||w)),v(!1)}};return c.jsx("div",{className:"nc-wiz-overlay",children:c.jsxs("div",{className:"nc-wiz",children:[c.jsxs("div",{className:"nc-wiz-head",children:[c.jsx("b",{children:f("wizard-title")}),c.jsx("small",{children:f("hydra-simple")})]}),h==="welcome"&&c.jsxs("div",{className:"nc-wiz-body",children:[c.jsx("div",{className:"nc-wiz-done",children:f("local-ready")}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{className:"nc-btn ghost",disabled:m,onClick:b,children:f("local-only")}),c.jsx("button",{className:"nc-btn primary",disabled:m,onClick:()=>p("pair"),children:f("add-node")})]})]}),h==="pair"&&c.jsxs("div",{className:"nc-wiz-body",children:[c.jsx(Gw,{token:e,initial:t||"",autoStart:!!t,deviceDefault:n,localNodeId:s,localNameDefault:o,onBusyChange:v,onSuccess:async()=>{a&&a(),p("done")}}),c.jsx("div",{className:"nc-sheet-actions",children:c.jsx("button",{className:"nc-btn ghost",disabled:m,onClick:()=>{a&&a(),p("welcome")},children:f("back")})})]}),h==="done"&&c.jsxs("div",{className:"nc-wiz-body",children:[c.jsx("div",{className:"nc-wiz-done",children:f("node-connected")}),c.jsx("div",{className:"nc-sheet-actions",children:c.jsx("button",{className:"nc-btn primary",disabled:m,onClick:b,children:f("finish")})})]}),S&&c.jsx("div",{className:"nc-err",children:S})]})})}function Dj(e,t){if(typeof EventSource>"u"||!e)return()=>{};const n=new EventSource(`/api/events?token=${encodeURIComponent(e)}`);return n.onmessage=s=>{try{const o=JSON.parse(s.data);o&&typeof o=="object"&&typeof o.type=="string"&&t(o)}catch{}},()=>{try{n.close()}catch{}}}const Mj=6e3,Ij=12e3;function Oj({n:e,onClose:t}){return c.jsxs("div",{className:`nc-ntf-toast${e.urgency==="high"?" high":""}`,role:"status","aria-live":"polite",children:[c.jsxs("div",{className:"nc-ntf-toast-txt",children:[c.jsx("b",{children:e.title}),e.body&&c.jsx("small",{children:e.body}),e.session&&c.jsx("span",{className:"nc-ntf-from",children:e.session})]}),c.jsx("button",{type:"button",className:"nc-ntf-x",onClick:t,title:f("close"),children:c.jsx(Je,{name:"x",size:14})})]})}function Bj({ask:e,token:t,onAnswered:n,onDismiss:s}){const[o,a]=N.useState(""),[u,h]=N.useState(!1),[p,m]=N.useState(null),[v,S]=N.useState(!1),y=async w=>{const k=String(w||"").trim();if(!(!k||u)){m(null),h(!0);try{await G0(t,e.id,k),n(e.id)}catch(C){m(String(C.message||C))}h(!1)}},b=async()=>{if(!v){S(!0);try{await X0(t,e.id),s(e.id)}catch{S(!1)}}};return c.jsxs("div",{className:"nc-ask-card",children:[c.jsxs("div",{className:"nc-ask-head",children:[c.jsx("span",{className:"nc-ntf-from",children:e.session}),c.jsxs("code",{className:"nc-ask-id",children:["#",e.id]}),c.jsx("button",{type:"button",className:"nc-ask-dismiss",title:f("ask-dismiss"),"aria-label":f("ask-dismiss"),disabled:v,onClick:b,children:c.jsx(Je,{name:"x",size:14})})]}),c.jsx("div",{className:"nc-ask-q",children:e.question}),Array.isArray(e.options)&&e.options.length>0&&c.jsx("div",{className:"nc-ask-opts",children:e.options.map(w=>c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:u,onClick:()=>y(w),children:w},w))}),c.jsxs("div",{className:"nc-ask-reply",children:[c.jsx("textarea",{rows:2,placeholder:f("ask-reply-ph"),value:o,disabled:u,onChange:w=>a(w.target.value)}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:u||!o.trim(),onClick:()=>y(o),children:f("send")})]}),p&&c.jsx("div",{className:"nc-err",children:p})]})}function zj({token:e}){const[t]=kn(),[n]=hb(),[s,o]=N.useState([]),[a,u]=N.useState([]),[h,p]=N.useState(()=>{try{return/(?:^|[#&])ask=/.test(location.hash)}catch{return!1}}),m=N.useRef(0),v=N.useRef(null);v.current||(v.current=Sj());const S=N.useRef({enabled:n,lang:t});S.current={enabled:n,lang:t};const y=N.useCallback(C=>{o(R=>R.filter(E=>E.key!==C))},[]),b=N.useCallback(C=>{const R=`t${m.current+=1}`;o(F=>[...F.slice(-3),{...C,key:R}]),setTimeout(()=>y(R),C.urgency==="high"?Ij:Mj);const E=S.current;if(E.enabled)try{v.current.enqueue(C,vj(C,E.lang))}catch{}},[y]);N.useEffect(()=>{n||v.current.stop()},[n]),N.useEffect(()=>{const C=()=>{(document.visibilityState!=="visible"||!document.hasFocus())&&v.current.stop()},R=()=>v.current.stop();return document.addEventListener("visibilitychange",C),window.addEventListener("blur",C),window.addEventListener($h,R),()=>{document.removeEventListener("visibilitychange",C),window.removeEventListener("blur",C),window.removeEventListener($h,R),typeof v.current.dispose=="function"?v.current.dispose():v.current.stop()}},[]),N.useEffect(()=>{if(!e)return;let C=!1;Y0(e).then(E=>{C||u(E.asks||[])}).catch(()=>{});const R=Dj(e,E=>{E.type==="notify"?b(E):E.type==="ask"&&E.ask&&E.ask.id?u(F=>F.some(O=>O.id===E.ask.id)?F:[...F,E.ask]):E.type==="ask-answered"&&E.id?u(F=>F.filter(O=>O.id!==E.id)):E.type==="ask-dismissed"&&E.id&&u(F=>F.filter(O=>O.id!==E.id))});return()=>{C=!0,R()}},[e,b]);const w=C=>u(R=>R.filter(E=>E.id!==C)),k=C=>u(R=>R.filter(E=>E.id!==C));return c.jsxs(c.Fragment,{children:[s.length>0&&c.jsx("div",{className:"nc-ntf-toasts",children:s.map(C=>c.jsx(Oj,{n:C,onClose:()=>y(C.key)},C.key))}),a.length>0&&!h&&c.jsxs("button",{type:"button",className:"nc-ask-badge",onClick:()=>p(!0),title:f("asks-title"),children:["? ",c.jsx("span",{className:"nc-ask-count",children:a.length})]}),a.length>0&&h&&c.jsxs("div",{className:"nc-ask-panel",children:[c.jsxs("div",{className:"nc-ask-panel-head",children:[c.jsx("b",{children:f("asks-title")}),c.jsx("span",{className:"nc-ask-count",children:a.length}),c.jsx("button",{type:"button",className:"nc-ntf-x",onClick:()=>p(!1),title:f("close"),children:c.jsx(Je,{name:"x",size:16})})]}),c.jsx("div",{className:"nc-ask-panel-body",children:a.map(C=>c.jsx(Bj,{ask:C,token:e,onAnswered:w,onDismiss:k},C.id))})]})]})}const Fj=4e3;async function $j(e){const t=await Ht("/api/sessions",e);if((t==null?void 0:t.ok)===!1)throw new Error(`HTTP ${t.status}`);const n=await t.json();if(!Array.isArray(n==null?void 0:n.sessions))throw new Error("invalid sessions payload");return n.sessions}async function $d(e,t=[]){var h;const[n,s]=await Promise.allSettled([t.length?Jh(e,t):$j(e),ws(e,t)]),o=n.status==="fulfilled"&&Array.isArray((h=n.value)==null?void 0:h.sessions)?n.value.sessions:Array.isArray(n.value)?n.value:null,a=s.status==="fulfilled"?s.value:null,u=(a==null?void 0:a.available)===!0&&Array.isArray(a.cells)?a.cells:null;return{sessions:o,cells:u,fresh:Array.isArray(o)&&Array.isArray(u)}}function fb(e,t,n){return n===!0&&(e==null?void 0:e.degraded)!==!0&&(e==null?void 0:e.active)===!0&&e.tmux!==!1&&!!e.tmuxSession&&(t||[]).some(s=>(s==null?void 0:s.name)===e.tmuxSession)}function Hj(e){const t=new Map((e.sessions||[]).map(o=>[o.name,o])),n=[],s=(o,a,u,h=[],p="")=>{const m=new Map((a||[]).map(v=>[v.name,v]));for(const v of o||[]){const S=m.get(v.tmuxSession)||{},y=of(v,S),b=fb(v,a,u);n.push({key:Go(h,v.tmuxSession||v.cell),session:v.tmuxSession,route:h,cellName:v.cell,label:v.cell,node:h.length?h.join("/"):"",nodeLabel:p,live:b,selectable:b,verified:u===!0,working:y.working,degraded:!!v.degraded,active:v.active===!0,activity:S.activity||v.activity||0,subtitle:y.subtitle})}};s(e.cells,[...t.values()],e.localFresh===!0);for(const o of e.nodeGroups||[]){const a=Array.isArray(o.route)?o.route:[];o.kind==="vl"||!a.length||s(o.cells,o.sessions,o.switcherFresh===!0,a,o.label||o.name||"")}return n}function Uj(e){const t=new Map,n=Array.isArray(e.sessions)?e.sessions:[],s=Array.isArray(e.cells)?e.cells:[],o=new Map(n.map(u=>[u.name,u])),a=new Set(s.map(u=>u.tmuxSession).filter(Boolean));t.set("local",af(s,n.filter(u=>!a.has(u.name)),o));for(const u of e.nodeGroups||[]){const h=Array.isArray(u.route)?u.route:[];if(u.kind==="vl"||!h.length)continue;const p=Array.isArray(u.cells)?u.cells:[],m=Array.isArray(u.sessions)?u.sessions:[],v=new Set(p.map(S=>S.tmuxSession).filter(Boolean));t.set(h.join("/"),Fl({...u,route:h,cells:p,sessions:m,unmanaged:m.filter(S=>!v.has(S.name))}).rawItems)}return t}function Wj(e,t,n,s){return[...new Set(e.map(a=>a.node||"local"))].flatMap(a=>{const u=e.filter(v=>(v.node||"local")===a),h=new Map((t.get(a)||[]).map(v=>[v.key,v])),p=new Map(u.map(v=>[v.key,v])),m=u.map(v=>{const S=h.get(v.key);return{...v,label:(S==null?void 0:S.label)||v.label,live:(S==null?void 0:S.live)??v.live,fresh:(S==null?void 0:S.fresh)===!0,activity:(S==null?void 0:S.activity)??v.activity}});return gs(m,n,"all",Fi(s,a)).map(v=>p.get(v.key))})}function Kj({token:e,current:t,onPick:n,onClose:s}){const[o,a]=N.useState(Og),[u,h]=N.useState(!1),[p,m]=N.useState(!1),[v,S]=N.useState(""),[y,b]=N.useState(""),[w,k]=N.useState(""),C=N.useRef(null),R=N.useRef(null),E=N.useMemo(()=>Hj(o),[o]),F=N.useMemo(()=>Uj(o),[o]),{pins:O,orders:q,canMoveRoster:Y,moveRoster:z,stepRoster:Z}=rf(),G=N.useMemo(()=>Wj(E,F,O,q),[E,F,O,q]),Q=N.useMemo(()=>u?G:G.filter(L=>L.selectable||L.degraded&&L.active),[G,u]),B=N.useMemo(()=>E.find(L=>L.key===y&&L.selectable),[E,y]);N.useEffect(()=>{var W;const L=document.activeElement;(W=R.current)==null||W.focus();const $=x=>{x.key==="Escape"&&s()};return document.addEventListener("keydown",$),()=>{var x;document.removeEventListener("keydown",$),(x=L==null?void 0:L.focus)==null||x.call(L)}},[s]),N.useEffect(()=>{let L=!0,$=!1;const W=async()=>{if($)return;$=!0;const M=Og(),D=Array.isArray(M.nodeGroups)?M.nodeGroups:[],A=$d(e),K=me=>me.kind!=="vl"&&Array.isArray(me.route)&&me.route.length>0,X=await Promise.all(D.filter(K).map(async me=>({group:me,result:await $d(e,me.route)}))),se=await A;if(!L)return;const ce=new Map(X.map(({group:me,result:be})=>[JSON.stringify(me.route||[]),be])),fe=D.map(me=>{if(!K(me))return{...me,switcherFresh:!1};const be=ce.get(JSON.stringify(me.route||[]));return be?{...me,sessions:be.sessions||me.sessions||[],cells:be.cells||me.cells||[],switcherFresh:be.fresh}:{...me,switcherFresh:!1}}),we=Sy({...M,sessions:se.sessions||M.sessions||[],cells:se.cells||M.cells||[],localFresh:se.fresh,nodeGroups:fe,refreshedAt:Date.now()});a(we),m(!0),$=!1};W();const x=setInterval(W,Fj);return()=>{L=!1,clearInterval(x)}},[e]);const I=L=>L.degraded?f("cell-degraded"):L.verified?L.selectable?L.working?f("cell-working"):f("cell-idle"):f("cell-off"):f("cell-switcher-not-confirmed"),j=L=>{if(S(""),!L.selectable){S(f("cell-switcher-not-active"));return}b(L.key)},T=async()=>{const L=B;if(!L){S(f("cell-switcher-select"));return}S(""),k(L.key);try{const $=await $d(e,L.route),W=($.cells||[]).find(x=>(x==null?void 0:x.cell)===L.cellName&&(x==null?void 0:x.tmuxSession)===L.session);if(!fb(W,$.sessions,$.fresh)){S(f("cell-switcher-not-active"));return}n({session:L.session,...L.node?{node:L.node}:{},cellName:L.cellName}),s()}catch{S(f("cell-switcher-not-active"))}finally{k("")}};return c.jsx("div",{className:"nc-cell-switcher-backdrop",onClick:s,children:c.jsxs("aside",{ref:C,className:"nc-cell-switcher",role:"dialog","aria-label":f("fleet-cells"),tabIndex:-1,onClick:L=>L.stopPropagation(),children:[c.jsxs("div",{className:"nc-cell-switcher-list",children:[!p&&c.jsx("div",{className:"nc-empty",role:"status",children:f("cell-switcher-refreshing")}),p&&Q.length===0&&c.jsx("div",{className:"nc-empty",role:"status",children:f("cell-switcher-empty-active")}),Q.map(L=>{const $=(t==null?void 0:t.session)===L.session&&((t==null?void 0:t.node)||"")===L.node,W=y===L.key,x=I(L),M=L.node||"local",D=F.get(M)||E.filter(A=>(A.node||"local")===M);return c.jsxs("div",{className:`nc-cell-switcher-row${$?" current":""}${W?" selected":""}${L.selectable?"":" off"}`,"data-roster-key":L.key,"data-position":M,children:[c.jsx(bi,{position:M,itemKey:L.key,label:L.cellName,canMove:Y,onMove:(A,K)=>z(M,A,K,D),onStep:A=>Z(M,L.key,A,D)}),c.jsxs("button",{type:"button",className:"nc-cell-switcher-row-select","aria-current":$?"true":void 0,"aria-pressed":W,"aria-disabled":!L.selectable,disabled:w===L.key,onClick:()=>j(L),children:[c.jsx("span",{className:`nc-cell-switcher-dot${L.degraded?" warn":L.live?` on${L.working?" working":""}`:""}`}),c.jsxs("span",{className:"nc-cell-switcher-copy",children:[c.jsx("b",{children:L.cellName}),c.jsx("small",{className:"nc-cell-switcher-state",children:x}),c.jsx("small",{children:[L.nodeLabel,L.subtitle].filter(Boolean).join(" · ")})]})]})]},L.key)})]}),v&&c.jsx("div",{className:"nc-cell-switcher-notice",role:"status",children:v}),c.jsx("div",{className:"nc-cell-switcher-actions",children:c.jsx("button",{type:"button",className:"nc-cell-switcher-open",disabled:!B||!!w,onClick:T,children:B?`${f("cell-switcher-open")}: ${B.cellName}`:f("cell-switcher-select")})}),c.jsxs("div",{className:"nc-cell-switcher-controls",children:[c.jsx("b",{children:f("fleet-cells")}),c.jsx("button",{type:"button",className:"nc-cell-switcher-filter","aria-pressed":u,onClick:()=>{S(""),h(L=>!L)},children:f(u?"cell-switcher-show-active":"cell-switcher-show-all")}),c.jsx("button",{ref:R,type:"button",className:"nc-cell-switcher-close","aria-label":f("cell-switcher-close"),title:f("cell-switcher-close"),onClick:s,children:"×"})]})]})})}const qj=2e3;function Vj(e){if(e.kind==="gap")return`${f("vl-events-gap")} ${e.count||"?"}`;if(e.kind==="truncate")return f("vl-events-truncated");if(e.kind==="turn_end")return f("vl-events-turn-end");if(e.kind==="done")return f("vl-events-done");if(e.kind==="writer_epoch")return f("vl-events-writer-epoch");if(e.kind==="tool_start")return`${f("vl-events-tool")} ${e.name||""}`.trim();if(e.kind==="tool_end"){const t=e.isError?f("vl-events-tool-failed"):f("vl-events-tool-ok");return`${f("vl-events-tool")} ${e.name||""} — ${t}`.trim()}return e.kind==="usage"?e.text||f("vl-events-usage"):e.text||""}function Yj({token:e,nodeId:t,route:n=[]}){const[s,o]=N.useState([]),[a,u]=N.useState(!1),h=N.useRef(0),p=N.useRef(!1);return N.useEffect(()=>{let m=!0;h.current=0,p.current=!1,o([]);const v=async()=>{if(!p.current){p.current=!0;try{const b=await E0(e,t,h.current,n);if(!m)return;u(!1);const k=(Array.isArray(b==null?void 0:b.events)?b.events:[]).filter(C=>Number.isSafeInteger(C==null?void 0:C.seq)&&C.seq>h.current);k.length&&(o(C=>C.concat(k).slice(-500)),h.current=k[k.length-1].seq),Number.isSafeInteger(b==null?void 0:b.cursor)&&b.cursor>h.current&&(h.current=b.cursor)}catch{m&&u(!0)}finally{p.current=!1}}},S=()=>{v().catch(()=>{})};S();const y=setInterval(S,qj);return()=>{m=!1,clearInterval(y)}},[e,t,JSON.stringify(n)]),c.jsxs("div",{className:"nc-vl-events",children:[a&&c.jsx("div",{className:"nc-set-hint nc-vl-events-stale",children:f("vl-events-stale")}),s.length===0&&!a&&c.jsx("small",{className:"nc-set-hint","data-testid":"vl-events-empty",children:f("vl-events-empty")}),s.length>0&&c.jsx("ol",{className:"nc-vl-events-list",children:s.map(m=>c.jsx("li",{"data-testid":`vl-ev-${m.seq}`,className:`nc-vl-ev nc-vl-ev-${m.kind}${m.isError?" error":""}${m.kind==="gap"?" gap":""}`,children:Vj(m)},`${m.seq}-${m.kind}`))})]})}function $_({peer:e,token:t,onBack:n}){var s;return kn(),e?c.jsxs("section",{className:"nc-vl-session-view",children:[c.jsxs("header",{className:"nc-bar nc-bar-single",children:[c.jsxs("button",{onClick:n,title:f("back"),children:[c.jsx(Je,{name:"chevronLeft",size:18}),c.jsx("span",{className:"nc-bar-label",children:f("back")})]}),c.jsxs("span",{className:"nc-bar-center",children:[c.jsx("b",{title:e.label,children:e.label}),((s=e.session)==null?void 0:s.profile)&&c.jsxs("small",{className:"nc-bar-sub",children:[e.session.profile," · ",f("vl-events-title")]})]}),c.jsx("span",{className:"nc-bar-right"})]}),c.jsx("div",{className:"nc-vl-session-body",children:c.jsx(Yj,{token:t,nodeId:e.nodeId,route:e.route||[]})})]}):null}const Hd=e=>ki(Ys(e)).length===0,Ud=e=>Array.isArray(e)?e.join("/"):"";function Gj(e){const t=new Set,n=[];for(const s of Array.isArray(e)?e:[])!s||!Hn.test(String(s.instanceId||""))||!Array.isArray(s.route)||!s.route.length||t.has(s.instanceId)||(t.add(s.instanceId),n.push({instanceId:s.instanceId,route:[...s.route],label:String(s.label||s.name||s.route.join(" › ")),status:s.status||"offline"}));return n.sort((s,o)=>s.label.localeCompare(o.label))}function zo(e){return{instanceId:e.ownerId,route:e.ownerRoute||[],label:e.ownerLabel,status:e.available===!1?"offline":"up"}}function Hs(e,t,n,s=!1,o=!0){const a=t.instanceId;return{...e,id:Ar(s?null:a,e.name),ownerId:a,ownerRoute:s?[]:[...t.route],ownerLabel:s?"Local":t.label,local:s,available:o,ownerTopology:Array.isArray(n)?n:[],layout:Oh(e.layout,a,n)}}function Xj(e,t,n,s,o=[]){const[a,u]=N.useState([]),[h,p]=N.useState(!1),[m,v]=N.useState("idle"),[S,y]=N.useState(""),[b,w]=N.useState(""),k=N.useRef([]),C=N.useRef([]),R=N.useRef(""),E=N.useRef(t),F=N.useRef(n),O=N.useRef(!1),q=N.useRef(!0),Y=N.useRef(""),z=N.useMemo(()=>Gj(o),[o]),Z=z.map(D=>`${D.instanceId}:${Ud(D.route)}:${D.status}:${D.label}`).join("|");C.current=z,F.current=n,E.current=t,k.current=a;const G=N.useCallback(D=>Bh(D.layout,R.current,C.current),[]),Q=N.useCallback((D,A=!0,K=E.current)=>{const X=Vv(D,xl()),se=k.current.some(fe=>fe.id===K);k.current=X,u(X);const ce=X.find(fe=>fe.id===K);if(A&&ce){q.current=!0;const fe=G(ce);s(fe),ce.local&&mN(ce.name,fe)}else se&&!ce&&(q.current=!0,s(Lr()),y("deck non più condiviso dal nodo owner"));dN(X.filter(fe=>fe.local).map(fe=>fe.name))},[s,G]),B=N.useCallback(async D=>{let A=await pl(e);const K=A.decks.find(X=>X.name==="main");if(A.decks.length===1&&K&&K.revision===0&&Hd(K.layout)){const X=uN(),se=Ys(zh("main")||Lr());if(!Hd(se)){const ce=Oh(se,D,[]);A.decks[0]=await ml(e,"main",ce,0,[])}for(const ce of X.filter(fe=>fe!=="main"))try{let fe=await Cg(e,ce,[]);const we=Ys(zh(ce)||Lr());Hd(we)||(fe=await ml(e,ce,Oh(we,D,[]),fe.revision,[]))}catch{}A=await pl(e)}return A},[e]),I=N.useCallback(async({migrate:D=!1}={})=>{const A=await Zh(e,[]),K=Hn.test(String(A.instanceId||""))?A.instanceId:"";if(!K)throw new Error("instanceId locale non disponibile");R.current=K,w(K);const[X,se]=await Promise.all([D?B(K):pl(e),bg(e,[]).catch(()=>({nodes:[]}))]),ce={instanceId:K,route:[],label:"Local"},fe=X.decks.map(me=>Hs(me,ce,se.nodes,!0,!0)),we=k.current;return await Promise.all(C.current.map(async me=>{if(me.status!=="up"){fe.push(...we.filter(be=>!be.local&&be.ownerId===me.instanceId).map(be=>({...be,ownerRoute:[...me.route],ownerLabel:me.label,available:!1})));return}try{const[be,$e]=await Promise.all([pl(e,me.route),bg(e,me.route).catch(()=>({nodes:[]}))]);fe.push(...be.decks.map(dt=>Hs(dt,me,$e.nodes,!1,!0)))}catch{fe.push(...we.filter($e=>!$e.local&&$e.ownerId===me.instanceId).map($e=>({...$e,ownerRoute:[...me.route],ownerLabel:me.label,available:!1})))}})),fe.sort((me,be)=>me.local===be.local?me.ownerLabel.localeCompare(be.ownerLabel)||(me.name==="main"?-1:be.name==="main"?1:me.name.localeCompare(be.name)):me.local?-1:1),fe},[e,B,Z]);N.useEffect(()=>{if(!e)return;let D=!1;const A=Y.current!==e;return Y.current=e,I({migrate:A}).then(K=>{if(D)return;const X=k.current.find(fe=>fe.id===E.current),se=K.find(fe=>fe.id===E.current),ce=se&&(!X||se.revision>X.revision||X.available!==se.available||Ud(X.ownerRoute)!==Ud(se.ownerRoute));Q(K,A||!!ce&&!O.current),p(!0),se&&y("")}).catch(K=>{D||(p(!0),y(String(K.message||K)))}),()=>{D=!0}},[Q,I,Z,e]);const j=N.useCallback(async(D=E.current)=>{if(!h||!O.current)return!0;const A=k.current.find(K=>K.id===D);if(!A)return y(`deck inesistente: ${D}`),!1;if(A.available===!1)return y(`nodo owner offline: ${A.ownerLabel}`),!1;v("saving");try{const K=Kv(Ys(F.current),A.ownerId,A.ownerTopology),X=await ml(e,A.name,K,A.revision,A.ownerRoute),se=Hs(X,zo(A),A.ownerTopology,A.local,!0);return Q(k.current.map(ce=>ce.id===D?se:ce),!1),O.current=!1,v("saved"),y(""),setTimeout(()=>v("idle"),1500),!0}catch(K){if(v("error"),y(String(K.message||K)),K.status===409&&K.data&&K.data.current){const X=k.current.find(ce=>ce.id===D),se=Hs(K.data.current,zo(X),X.ownerTopology,X.local,!0);Q(k.current.map(ce=>ce.id===D?se:ce),!1)}return!1}},[h,e,Q]);return N.useEffect(()=>{if(!h)return;if(q.current){q.current=!1;return}O.current=!0,v("saving");const D=setTimeout(j,650);return()=>clearTimeout(D)},[n,h,j]),N.useEffect(()=>{if(!h)return;const D=setInterval(async()=>{try{const A=await I(),K=k.current.find(ce=>ce.id===E.current),X=A.find(ce=>ce.id===E.current),se=X&&(!K||X.revision>K.revision||K.available!==X.available);Q(A,se&&!O.current)}catch{}},5e3);return()=>clearInterval(D)},[h,I,Q]),{decks:a,records:a,localNodeId:b,ready:h,saveState:m,error:S,setError:y,saveNow:j,select:async D=>{if(O.current&&!await j(E.current))throw new Error("salvataggio del deck corrente fallito: cambio annullato");const A=k.current.find(K=>K.id===D);if(!A)throw new Error(`deck inesistente: ${D}`);return O.current=!1,q.current=!0,G(A)},add:async(D,A=null)=>{const K=A===Si?k.current.find(ce=>ce.local):A?k.current.find(ce=>ce.ownerId===A):null;if(!K||K.available===!1)throw new Error("nodo owner non disponibile");const X=await Cg(e,D,K.ownerRoute),se=Hs(X,zo(K),K.ownerTopology,K.local,!0);return Q([...k.current,se],!1),se},rename:async(D,A)=>{const K=k.current.find(we=>we.id===D);if(!K)throw new Error("deck inesistente");if(D===E.current&&O.current&&!await j(D))throw new Error(`salvataggio di "${K.name}" fallito: rinomina annullata`);const X=k.current.find(we=>we.id===D);if(!X)throw new Error("deck inesistente");const se=await Q0(e,X.name,A,X.revision,X.ownerRoute),ce=Hs(se,zo(X),X.ownerTopology,X.local,!0),fe=X.local?Si:X.ownerId;return md(fN(xl(),fe,D,ce.id)),Q(k.current.map(we=>we.id===D?ce:we),!1),ce},remove:async D=>{const A=k.current.find(X=>X.id===D);if(!A)throw new Error("deck inesistente");D===E.current&&(O.current=!1),await J0(e,A.name,A.revision,A.ownerRoute);const K=A.local?Si:A.ownerId;md(pN(xl(),K,D)),Q(k.current.filter(X=>X.id!==D),!1)},reorder:(D,A)=>{const K=k.current.find(me=>me.id===D),X=k.current.find(me=>me.id===A);if(!K||!X)return!1;const se=K.local?Si:K.ownerId,ce=X.local?Si:X.ownerId;if(se!==ce)return!1;const fe=k.current.filter(me=>(me.local?Si:me.ownerId)===se).map(me=>me.id),we=md(hN(xl(),se,D,A,fe));return Q(Vv(k.current,we),!1),!0},addTileTo:async(D,A)=>{const K=k.current.find(me=>me.id===D);if(!K)throw new Error("deck inesistente");if(K.available===!1)throw new Error(`nodo owner offline: ${K.ownerLabel}`);const X=Lw(A,R.current,C.current);if(!X)throw new Error("riferimento sessione non valido");const se=G(K),ce=Kv(yy(se,X),K.ownerId,K.ownerTopology),fe=await ml(e,K.name,ce,K.revision,K.ownerRoute),we=Hs(fe,zo(K),K.ownerTopology,K.local,!0);return Q(k.current.map(me=>me.id===D?we:me),!1),we},localMainId:Ar(null,"main"),parseDeckId:rc}}const Qj="/sw.js",Uh="nc-sw-update";let Wh=null,Kh=!1,qh=null,pb=Object.freeze({needed:!1,kind:null,version:""}),mb=!1;function gb(){typeof window<"u"&&window.dispatchEvent(new Event(Uh))}function vb(){const e=qh||(Kh?{kind:"reload",version:""}:null);pb=Object.freeze({needed:!!e,kind:(e==null?void 0:e.kind)||null,version:(e==null?void 0:e.version)||""})}function H_(){return pb}function Jj(e){return typeof window>"u"?()=>{}:(window.addEventListener(Uh,e),()=>window.removeEventListener(Uh,e))}function Ff(e){Kh!==e&&(Kh=e,vb(),gb())}function Zj(e,t,n){let s=null;e&&t&&e!==t?s={kind:"install",version:e}:t&&n&&t!==n&&(s={kind:"reload",version:t});const o=JSON.stringify(s)===JSON.stringify(qh);qh=s,vb(),o||gb()}function eR(e){e.addEventListener("statechange",()=>{e.state==="installed"&&navigator.serviceWorker.controller&&Ff(!0)})}function tR(){typeof navigator>"u"||!("serviceWorker"in navigator)||(navigator.serviceWorker.addEventListener("controllerchange",()=>{mb&&location.reload()}),navigator.serviceWorker.register(Qj).then(e=>{Wh=e,e.waiting&&Ff(!0),e.addEventListener("updatefound",()=>{const t=e.installing;t&&eR(t)}),setInterval(()=>{e.update().catch(()=>{})},3600*1e3)}).catch(()=>{}))}function nR(){mb=!0,Ff(!1);const e=Wh&&Wh.waiting;e?(e.postMessage({type:"SKIP_WAITING"}),setTimeout(()=>location.reload(),4e3)):location.reload()}function iR({hash:e="",origin:t="",pathname:n="",search:s=""}={}){const o=String(e||"").replace(/^#/,""),a=`${n||""}${s||""}`;if(!o)return{token:"",pair:"",nextUrl:a};const u=new URLSearchParams(o),h=u.get("token")||"",p=u.get("pair")||"",m=p?`${t||""}${n||""}#pair=${p}`:"";return{token:h,pair:m,nextUrl:a}}const _b=9,yb=24,wb="nc_side_w",U_="nc_side_min",sR=240,W_="(min-width:1024px) and (pointer:fine)";function rR(){const e=Number(localStorage.getItem(wb));return e>=180&&e<=480?e:sR}function oR(){const e=Number(localStorage.getItem("nc_fontsize"));return e>=_b&&e<=yb?e:13}function aR(){const e={token:"",pair:""};try{const{token:t,pair:n,nextUrl:s}=iR({hash:location.hash,origin:location.origin,pathname:location.pathname,search:location.search});if(t){e.token=t;try{localStorage.setItem("nc_token",t)}catch{}}if(n){e.pair=n;try{sessionStorage.setItem("nc_pair",n)}catch{}}if(location.hash)try{history.replaceState(null,"",s)}catch{}}catch{}if(e.token||(e.token=sessionStorage.getItem("nc_token")||localStorage.getItem("nc_token")||""),!e.pair){const t=sessionStorage.getItem("nc_pair");t&&(e.pair=t)}return e}function lR(e){try{return Ys(zh(e))}catch{return Lr()}}function K_(e){if(!e)return"";const t=Math.floor(Date.now()/1e3)-e;return t<0||t<60?"ora":t<3600?`${Math.floor(t/60)}m`:t<86400?`${Math.floor(t/3600)}h`:`${Math.floor(t/86400)}g`}function cR(){const[e,t]=N.useState(()=>window.matchMedia(W_).matches);return N.useEffect(()=>{const n=window.matchMedia(W_),s=o=>t(o.matches);return n.addEventListener("change",s),()=>n.removeEventListener("change",s)},[]),e}function q_({session:e,node:t,ownerId:n,cellName:s,token:o,readonly:a=!1,onBack:u,onCellSwitcher:h,cellSwitcherOpen:p=!1}){kn();const[m]=kf(),[v,S]=N.useState(!1),[y,b]=N.useState(()=>window.matchMedia("(pointer: coarse)").matches),[w,k]=N.useState(null),[C,R]=N.useState(oR),[E,F]=N.useState(s||e),[O,q]=N.useState(""),Y=$=>R(W=>{const x=Math.max(_b,Math.min(yb,W+$));return localStorage.setItem("nc_fontsize",String(x)),x}),z=N.useRef(()=>{}),Z=N.useRef(()=>!1),G=N.useRef(()=>{}),Q=N.useRef(!1),[B,I]=N.useState(!1),[j,T]=N.useState(!1),L=()=>{Q.current=!Q.current,I(Q.current)};return N.useEffect(()=>{F(s||e)},[s,e]),N.useEffect(()=>{let $=!0;const W=t?t.split("/"):[],x=t?`/api/route/${t.split("/").map(encodeURIComponent).join("/")}/_`:"/api";async function M(){let A=null,K=null;try{const ce=await(await Ht(`${x}/sessions`,o)).json();Array.isArray(ce.sessions)&&(A=ce.sessions.find(fe=>fe.name===e))}catch{}try{const se=await ws(o,W);se.available&&Array.isArray(se.cells)&&(K=se.cells.find(ce=>ce.tmuxSession===e))}catch{}if(!$)return;F(Cf({session:e,cell:K||(s?{cell:s}:null)}));let X="";K?X=`${K.engine}${K.key?`·${K.key}`:""}`:A&&(X=A.attached?`attached · ${K_(A.activity)}`:A.activity?K_(A.activity):""),q(X)}M();const D=setInterval(M,4e3);return()=>{$=!1,clearInterval(D)}},[e,t,o]),c.jsxs("div",{className:"nc-app",children:[c.jsxs("header",{className:"nc-bar nc-bar-single",children:[c.jsxs("button",{onClick:u,title:f("sessions"),children:[c.jsx(Je,{name:"chevronLeft",size:18}),c.jsx("span",{className:"nc-bar-label",children:f("sessions")})]}),c.jsxs("span",{className:"nc-bar-center",children:[c.jsx("b",{title:t?`${E} · ${t}`:E,children:E}),O&&c.jsx("small",{className:"nc-bar-sub",children:O})]}),c.jsxs("span",{className:"nc-bar-right",children:[c.jsx("button",{onClick:()=>Y(-1),title:f("zoom-out"),children:c.jsx(Je,{name:"zoomOut",size:18})}),c.jsx("button",{onClick:()=>Y(1),title:f("zoom-in"),children:c.jsx(Je,{name:"zoomIn",size:18})}),c.jsx("button",{onClick:()=>b($=>!$),title:f("composer"),children:c.jsx(Je,{name:"keyboard",size:20})}),c.jsx("button",{onClick:()=>S($=>!$),title:f("files"),children:c.jsx(Je,{name:"folder",size:20})})]})]}),c.jsx("div",{className:"nc-termwrap",children:c.jsx(gw,{session:e,node:t,token:o,readonly:a,takeSize:!0,sendRef:z,composerRef:Z,actionRef:G,ctrlRef:Q,setCtrlArmed:I,onFiles:k,fontSize:C,selectionMode:j,onSelectionModeChange:T,keyboardGesture:m.terminalKeyboardGesture})}),c.jsx(DE,{onKeyboard:()=>b($=>!$),onCellSwitcher:h,cellSwitcherOpen:p,send:$=>z.current($),action:$=>G.current($),ctrlArmed:B,onCtrl:L,selectionMode:j,onSelectionMode:T,keepKeyboardClosed:m.keybarKeepsKeyboardClosed,showEnter:m.showKeybarEnter,keybarLayout:m.keybarLayout}),y&&c.jsx(Ew,{submitText:$=>Z.current($),token:o,session:e,node:t,ownerId:n,keepKeyboardClosedOnVoice:m.voiceKeepsKeyboardClosed}),v&&c.jsx(vw,{session:e,node:t,token:o,filesEvent:w,onClose:()=>S(!1)})]})}function uR(){kn();const[e]=N.useState(aR),[t,n]=N.useState(e.token),[s,o]=N.useState(e.pair||""),a=N.useCallback(()=>{o("");try{sessionStorage.removeItem("nc_pair")}catch{}},[]),[u,h]=N.useState(!1),p=cR(),[m]=N.useState(()=>cN(typeof location<"u"?location.pathname:"/")),[v,S]=N.useState(m.id),y=v===Ar(null,Un),[b,w]=N.useState(null),k=he=>{const je=ys(he);w(je?{...je,...typeof(he==null?void 0:he.cellName)=="string"&&he.cellName?{cellName:he.cellName}:{}}:null)},[C,R]=N.useState([]),[E,F]=N.useState([]),[O,q]=N.useState([]),[Y,z]=N.useState(()=>m.ownerId?Lr():lR(m.name)),[Z,G]=N.useState(null),[Q,B]=N.useState(null),I=he=>B(ys(he)),[j,T]=N.useState(null),L=nf(t,p),$=N.useMemo(()=>(L||[]).filter(he=>he.instanceId).map(he=>({instanceId:he.instanceId,route:he.route,label:he.label,status:he.status})),[L]),W=Xj(t,v,Y,z,$),x=W.decks;N.useEffect(()=>{const he=new Map;for(const je of L||[]){const Ke=(je.route||[je.name]).join("/"),ft=new Set((je.sessions||[]).map(vt=>vt.name));for(const vt of je.cells||[])!vt.cell||!vt.tmuxSession||vt.cell===vt.tmuxSession||ft.has(vt.cell)||he.set(`${Ke}:${vt.cell}`,`${Ke}:${vt.tmuxSession}`)}z(je=>Nx(je,he))},[L]),N.useEffect(()=>{W.localNodeId&&z(he=>{const je=Bh(he,W.localNodeId,$);return JSON.stringify(je)===JSON.stringify(he)?he:je})},[$,W.localNodeId]);const[M,D]=N.useState(null),[A,K]=N.useState(null),X=N.useRef(0),[se,ce]=N.useState(!1),[fe,we]=N.useState(rR),[me,be]=N.useState(!y),[$e,dt]=N.useState(()=>y?localStorage.getItem(U_)==="1":!0),[Ye,De]=N.useState(!1),[Pt,Jt]=N.useState("nodes"),[Me,Et]=N.useState(!1),[gt,bt]=N.useState(""),[ht,rt]=N.useState(!1),at=(he="nodes",je=!1,Ke="")=>{Jt(he),Et(je),bt(Ke),De(!0)},[ie,xe]=N.useState(!1),[Ie,Be]=N.useState({deviceDefault:"",localNodeId:"",localNameDefault:""}),[ue,oe]=N.useState(!1);N.useEffect(()=>{try{localStorage.setItem(wb,String(fe))}catch{}},[fe]),N.useEffect(()=>{try{localStorage.setItem(U_,$e?"1":"")}catch{}},[$e]),N.useEffect(()=>{if(!t)return;let he=!1;return Promise.all([ty(t),Ht("/api/config",t).then(je=>je.json())]).then(([je,Ke])=>{he||(Be({deviceDefault:je.deviceName||"",localNodeId:je.nodeId||"",localNameDefault:je.localName||""}),oe(!!Ke.readonlyDefault),(je.firstRun===!0&&!Ke.readonlyDefault||s)&&xe(!0))}).catch(()=>{}),()=>{he=!0}},[t,s]);const H=N.useCallback(async()=>{try{const je=await(await Ht("/api/sessions",t)).json();je.error||R(je.sessions||[])}catch{}try{const he=await ws(t);F(he.available?he.cells||[]:[]),q(he.available?he.capabilities||[]:[])}catch{F([]),q([])}},[t]);N.useEffect(()=>{if(!p)return;H();const he=setInterval(H,4e3);return()=>clearInterval(he)},[p,H]),N.useEffect(()=>{let he=!1;return Ht("/api/config",t).then(je=>je.json()).then(je=>{he||Zj(je.version,je.uiVersion,"0.8.52-rc.24")}).catch(()=>{}),()=>{he=!0}},[t]);const te=new Set([...C.map(he=>he.name),...L.flatMap(he=>he.sessions.map(je=>je.key))]),U=ki(Y),le=he=>z(je=>{const Ke=Lw(he,W.localNodeId,$)||he,ft=yy(je,Ke);return ft===je&&ki(je).length>=9&&W.setError(f("grid-full")),ft}),de=async(he,je=[])=>{try{await Xh(t,he,je)}catch{return}const Ke=je.length?`${je.join("/")}:${he}`:he;z(ft=>Hl(ft,Ke)),H()},ge=async(he,je,Ke=[])=>{try{await ey(t,he,je,Ke)}catch{return}H()},Le=async(he,je,Ke=[])=>{await Q_(t,{cell:he,enabled:!!je},Ke),H()},_e=async he=>{if(!M)return;const{cell:je}=M,Ke=Array.isArray(M.route)?M.route:[];if(he.action==="up"){const vt=await Gh(t,{cell:je,boot:!!he.boot,...he.engine?{engine:he.engine}:{},...he.model!==void 0?{model:he.model}:{},...he.permissionPolicy?{permissionPolicy:he.permissionPolicy}:{}},Ke),bs=uf(vt);bs&&W.setError(bs.text)}else await Il(t,{cell:je,boot:!!he.boot},Ke);const ft=he.action==="up"?!!he.boot:he.boot?!1:!!M.boot;K({id:++X.current,cell:je,route:Ke,enabled:ft}),H()},Ee=N.useCallback(he=>{K(je=>(je==null?void 0:je.id)===he?null:je)},[]),tt=async he=>{if(!(!(he!=null&&he.direct)||se)){ce(!0);try{await ef(t,he.name,he.tunnelStatus==="up"?"down":"up")}finally{ce(!1)}}},ot=async(he,je)=>{const Ke=String(je||"").trim();return!(he!=null&&he.direct)||!Ir(Ke)?!1:(await sy(t,he.name,Ke),!0)},Qe=he=>{const je=x.find(Ke=>Ke.id===he);if(!je)return!1;try{const Ke=window.open(pd(je,t),"_blank");return Ke&&(Ke.opener=null),!!Ke}catch{return!1}},Mt=async he=>{if(!he||he===v)return;const je=await W.select(he),Ke=W.records.find(ft=>ft.id===he);S(he),z(je),G(null),B(null);try{history.replaceState(null,"",pd(Ke||he,null))}catch{}},ct=async(he,je)=>{const Ke=await W.add(he,je);await Mt(Ke.id)},Ze=async(he,je)=>{const Ke=await W.rename(he,je);if(he===v){S(Ke.id),z(Bh(Ke.layout,W.localNodeId,$)),G(null),B(null);try{history.replaceState(null,"",pd(Ke,null))}catch{}}},Zt=async he=>{await W.remove(he),he===v&&await Mt(W.localMainId)},ni=async(he,je)=>{!je||je===v||(await W.addTileTo(je,he),z(Ke=>Hl(Ke,he)))};if(!t)return c.jsxs("div",{className:"nc-auth",children:[c.jsx("p",{children:f("auth-prompt")}),c.jsx("input",{onChange:he=>n(he.target.value.trim()),placeholder:"token"}),c.jsxs("label",{children:[c.jsx("input",{type:"checkbox",checked:u,onChange:he=>h(he.target.checked)})," ",f("remember-device")]}),c.jsx("button",{onClick:()=>{(u?localStorage:sessionStorage).setItem("nc_token",t)},children:"ok"})]});const Wn=c.jsxs(c.Fragment,{children:[Ye&&c.jsx(Aj,{token:t,initialTab:Pt,initialLocation:gt,startNewCell:Me,onClose:()=>{De(!1),Et(!1),bt("")}}),ie&&c.jsx(Tj,{token:t,initialPair:s,...Ie,onPairDone:a,onDone:()=>xe(!1)}),c.jsx(zj,{token:t})]});if(!p)return j?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"nc-single-overlay",children:c.jsx($_,{peer:j,token:t,onBack:()=>T(null)})}),Wn]}):b?c.jsxs(c.Fragment,{children:[c.jsx(q_,{session:b.session,node:b.node,ownerId:b.ownerId,cellName:b.cellName,token:t,readonly:ue,onBack:()=>w(null),onCellSwitcher:()=>rt(!0),cellSwitcherOpen:ht}),ht&&c.jsx(Kj,{token:t,current:b,onPick:he=>{k(he),rt(!1)},onClose:()=>rt(!1)}),Wn]}):c.jsxs(c.Fragment,{children:[c.jsx(Kx,{onPick:k,token:t,onSettings:at,onOpenVlSession:T}),Wn]});const ui=y||!me;return c.jsxs("div",{className:"nc-workspace",children:[ui&&c.jsx(QE,{sessions:C,cells:E,activeSessions:U,nodeGroups:L,fleetCapabilities:O,bootSettlement:A,onBootSettlementApplied:Ee,localNodeId:W.localNodeId,onPick:I,onAddTile:le,onPower:D,onBoot:Le,onBootError:he=>W.setError(String((he==null?void 0:he.message)||he)),onNodePower:tt,onNodeRename:ot,onKill:de,onVisibility:ge,onNew:()=>at("fleet",!0),onSettings:at,onOpenVlSession:T,width:fe,collapsed:$e,onResize:we,onToggleCollapse:()=>dt(he=>!he)}),c.jsxs("div",{className:"nc-workspace-main",children:[c.jsx(AN,{decks:x,currentDeck:v,onCreate:ct,onRename:Ze,onDelete:Zt,onReorder:W.reorder,onOpenWindow:Qe,onNavigate:Mt,saveState:W.saveState,error:W.error,sidebarVisible:ui,onToggleSidebar:y?null:()=>be(he=>!he)}),c.jsx(sN,{layout:Y,onLayoutChange:z,token:t,readonly:ue,sessionsAlive:te,focusSession:Z,onFocus:G,onOpenSingle:I,decks:x,currentDeck:v,onSendToDeck:ni,cells:E,nodeGroups:L})]}),j&&c.jsx("div",{className:"nc-single-overlay",children:c.jsx($_,{peer:j,token:t,onBack:()=>T(null)})}),Q&&c.jsx("div",{className:"nc-single-overlay",children:c.jsx(q_,{session:Q.session,node:Q.node,ownerId:Q.ownerId,cellName:Cf({session:Q.session,node:Q.node,ownerId:Q.ownerId,cells:E,nodeGroups:L}),token:t,readonly:ue,onBack:()=>B(null)})}),M&&c.jsx(Bl,{cell:M,token:t,route:Array.isArray(M.route)?M.route:[],onConfirm:_e,onClose:()=>D(null)}),Wn]})}function dR(){kn();const e=N.useSyncExternalStore(Jj,H_,H_);if(!e.needed)return null;const t=e.kind==="install"?f("install-version-mismatch").replace("{v}",e.version):f("update-available").replace("{v}",e.version).replace(" "," ").trim();return c.jsxs("div",{className:"nc-update",role:"status","aria-live":"polite",children:[c.jsx("span",{className:"nc-update-msg",children:t}),e.kind==="reload"&&c.jsx("button",{className:"nc-update-btn",onClick:nR,children:f("reload")})]})}tR();p0.createRoot(document.getElementById("root")).render(c.jsxs(a0.StrictMode,{children:[c.jsx(uR,{}),c.jsx(dR,{})]}));
|
|
93
|
+
`],{type:"application/json"}),$=URL.createObjectURL(L),W=document.createElement("a");W.href=$,W.download="nexuscrew-diagnostics.json",W.click(),URL.revokeObjectURL($)}catch{y(f("diagnostics-export-failed"))}};return c.jsxs("div",{className:"nc-set-tab nc-diagnostics",children:[c.jsxs("label",{className:"nc-field",children:[f("diagnostics-target"),c.jsx("select",{value:u.key,onChange:L=>a(L.target.value),children:s.map(L=>c.jsxs("option",{value:L.key,children:[L.label,L.status!=="up"?` · ${L.status}`:""]},L.key))})]}),c.jsxs("div",{className:"nc-set-form nc-diag-controls",children:[c.jsx("div",{className:"nc-sheet-label",children:f("diagnostics-verbose")}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("select",{"aria-label":f("diagnostics-duration"),value:R,onChange:L=>E(Number(L.target.value)),disabled:n,children:[300,900,1800,3600].map(L=>c.jsxs("option",{value:L,children:[L/60," min"]},L))}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:n||(h==null?void 0:h.verbose)===!0,onClick:()=>I(()=>kg(e,!0,R,u.route)),children:f("enable")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||(h==null?void 0:h.verbose)!==!0,onClick:()=>I(()=>kg(e,!1,R,u.route)),children:f("stop")})]}),c.jsx("small",{className:"nc-set-hint",children:h!=null&&h.verbose?f("diagnostics-expires").replace("{time}",new Date(h.expiresAt).toLocaleTimeString()):f("diagnostics-off")})]}),c.jsxs("div",{className:"nc-diag-filters",children:[c.jsxs("select",{"aria-label":f("diagnostics-level"),value:F,onChange:L=>O(L.target.value),children:[c.jsx("option",{value:"all",children:f("diagnostics-all-levels")}),["debug","info","warn","error"].map(L=>c.jsx("option",{value:L,children:L},L))]}),c.jsx("input",{"aria-label":f("diagnostics-component"),placeholder:f("diagnostics-component"),value:q,onChange:L=>Y(L.target.value)})]}),c.jsxs("div",{className:"nc-set-row",children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:b,onChange:L=>w(L.target.checked)})," ",f("diagnostics-pause")]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:k,onChange:L=>C(L.target.checked)})," ",f("diagnostics-autoscroll")]})]}),c.jsx("pre",{ref:Z,className:"nc-diag-log","aria-label":f("diagnostics-log"),children:B||f("diagnostics-empty")}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:j,children:f("copy")}),c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:T,children:f("diagnostics-export")}),c.jsx("button",{type:"button",className:"nc-btn danger",disabled:n,onClick:()=>{window.confirm(f("diagnostics-clear-confirm"))&&I(async()=>{const L=await V0(e,u.route);return z.current=0,v([]),L})},children:f("diagnostics-clear")})]}),S&&c.jsx("div",{className:"nc-err",children:S})]})}function Lj({token:e,settings:t,readonly:n,refresh:s,roster:o,section:a,setSection:u}){const[h,p]=N.useState(null),[m,v]=N.useState(null),[S,y]=N.useState(!1),[b,w]=N.useState(!1),[k,C]=N.useState(null),[R,E]=N.useState(!0),[F,O]=N.useState(!1);N.useEffect(()=>{C(t&&t.update||null),E(!t||t.autoUpdate!==!1),O(!!(t&&t.alternateScreen))},[t]);const q=async()=>{p(null),v(null),w(!0);try{const j=await N0(e);v(j.note||"ok"),y(!1)}catch(j){p(String(j.message||j))}w(!1)},Y=async()=>{p(null),v(null),w(!0);try{const j=await H0(e);v(`${j.note||"ok"}${j.target?` (${j.target})`:""}`)}catch(j){p(String(j.message||j))}w(!1)},z=async j=>{p(null),v(null),w(!0);try{await Wd(e,{autoUpdate:j}),E(j),s&&await s()}catch(T){p(String(T.message||T))}w(!1)},Z=async j=>{p(null),v(null),w(!0);try{await Wd(e,{alternateScreen:j}),O(j),s&&await s()}catch(T){p(String(T.message||T))}w(!1)},G=async()=>{p(null),v(null),w(!0);try{C(await U0(e))}catch(j){p(String(j.message||j))}w(!1)},Q=async()=>{p(null),v(null),w(!0);try{const j=await W0(e);C(j),v(f("npm-update-restarting"))}catch(j){p(String(j.message||j))}w(!1)},B=()=>{window.confirm(f("composer-clear-confirm"))&&(p(null),KE()?(window.dispatchEvent(new Event(Mh)),v(f("composer-clear-done"))):p(f("composer-clear-failed")))},I=t&&t.service;return c.jsxs("div",{className:"nc-set-tab",children:[c.jsx("div",{className:"nc-system-tabs",role:"tablist","aria-label":f("tab-system"),children:["general","diagnostics"].map(j=>c.jsx("button",{type:"button",role:"tab","aria-selected":a===j,className:`nc-set-tabbtn${a===j?" on":""}`,onClick:()=>u(j),children:f(`system-${j}`)},j))}),a==="general"&&c.jsxs(c.Fragment,{children:[c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:f("system-this-node")}),t&&c.jsxs("div",{className:"nc-set-info",children:["v",t.version," · ",t.platform," · :",t.port,c.jsx("br",{}),I&&I.installed?f("service-installed"):f("service-missing"),I&&I.installed?` · ${I.active?f("service-active"):f("service-inactive")}`:"",I?` · boot ${I.boot?"on":"off"}`:""]}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||b,title:n?f("settings-readonly"):"",onClick:Y,children:f("service-regenerate")})}),c.jsx(Ej,{token:e,readonly:n}),c.jsx(Nj,{})]}),c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:f("system-updates")}),c.jsxs("div",{className:"nc-set-form nc-update-settings",children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:R,disabled:n||b||k&&!k.supported,onChange:j=>z(j.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:f("npm-auto-update")}),c.jsx("small",{children:f("npm-auto-update-help")})]})]}),k&&c.jsxs("div",{className:"nc-set-info",children:[f("npm-update-current")," v",k.current,k.latest?` · ${f("npm-update-latest")} v${k.latest}`:""," · ",f(`npm-update-${k.supported?k.phase:"unsupported"}`)]}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||b||!k||!k.supported,onClick:G,children:f("npm-update-check")}),k&&k.available&&c.jsx("button",{type:"button",className:"nc-btn primary",disabled:n||b||k.phase==="installing",onClick:Q,children:f("npm-update-install")})]}),k&&k.lastError&&c.jsx("div",{className:"nc-err",children:k.lastError})]})]}),c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:f("system-security")}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||b,title:n?f("settings-readonly"):"",onClick:()=>{p(null),v(null),y(!0)},children:f("token-rotate")})})]}),c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:f("system-local-data")}),c.jsxs("div",{className:"nc-set-form",children:[c.jsx("div",{className:"nc-sheet-label",children:f("composer-clear-data")}),c.jsx("small",{className:"nc-set-hint",children:f("composer-clear-data-help")}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:B,children:f("composer-clear-data")})})]})]})]}),a==="diagnostics"&&c.jsxs("section",{className:"nc-system-group nc-system-diagnostics",children:[c.jsx("h3",{children:f("system-diagnostics")}),c.jsxs("div",{className:"nc-set-form nc-alternate-screen-settings",children:[c.jsx("div",{className:"nc-sheet-label",children:f("system-terminal")}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox","aria-label":f("alternate-screen"),checked:F,disabled:n||b,onChange:j=>Z(j.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:f("alternate-screen")}),c.jsx("small",{children:f("alternate-screen-help")})]})]})]}),c.jsx(Pj,{token:e,roster:o,readonly:n})]}),S&&c.jsxs("div",{className:"nc-set-confirm",children:[c.jsx("div",{children:f("token-rotate-explain")}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:b,onClick:()=>y(!1),children:f("cancel")}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:b,onClick:q,children:f("confirm")})]})]}),m&&c.jsx("div",{className:"nc-set-note",children:m}),h&&c.jsx("div",{className:"nc-err",children:h})]})}function Aj({token:e,onClose:t,initialTab:n="nodes",initialLocation:s="",startNewCell:o=!1}){kn();const a=n==="diagnostics"?"diagnostics":"general",[u,h]=N.useState(n==="diagnostics"?"system":n),p=N.useRef(null),m=N.useRef(null),[v,S]=N.useState({start:!1,end:!1}),[y,b]=N.useState(a),[w,k]=N.useState(null),[C,R]=N.useState([]),[E,F]=N.useState([]),[O,q]=N.useState(!1),[Y,z]=N.useState(null),[Z,G]=N.useState(0),Q=nf(e,!0,Z),B=N.useCallback(()=>{const j=p.current;if(!j)return;const T=j.scrollWidth>j.clientWidth+1,L={start:T&&j.scrollLeft>1,end:T&&j.scrollLeft+j.clientWidth<j.scrollWidth-1};S($=>$.start===L.start&&$.end===L.end?$:L)},[]);N.useEffect(()=>{const j=p.current;if(!j)return;const T=typeof ResizeObserver=="function"?new ResizeObserver(B):null;return T==null||T.observe(j),window.addEventListener("resize",B),B(),()=>{T==null||T.disconnect(),window.removeEventListener("resize",B)}},[B]),N.useEffect(()=>{var T,L;(L=(T=m.current)==null?void 0:T.scrollIntoView)==null||L.call(T,{behavior:"smooth",block:"nearest",inline:"nearest"});const j=window.requestAnimationFrame?window.requestAnimationFrame(B):setTimeout(B,0);return()=>{window.cancelAnimationFrame?window.cancelAnimationFrame(j):clearTimeout(j)}},[u,B]);const I=N.useCallback(async()=>{var j;try{const T=await ty(e);k(T),z(null)}catch(T){z(String(T.message||T))}try{const L=(await C0(e)).peers||[];let $=[],W=[];try{const[x,M]=await Promise.all([Ht("/api/config",e).then(X=>X.json()).catch(()=>null),iy(e).catch(()=>null)]),D=x&&typeof x.instanceId=="string"?x.instanceId:"",A=[{instanceId:D||null,route:[],label:null},...hy(M,D)],K=await Promise.all(A.map(async X=>{try{return{ok:!0,peers:((await ny(e,X.route)).nodes||[]).map(fe=>dy(fe,X)).filter(Boolean)}}catch(se){return{ok:!1,owner:X,error:se}}}));for(const X of K){if(X.ok){$.push(...X.peers);continue}X.owner.route.length!==0&&W.push({instanceId:X.owner.instanceId,label:X.owner.label,route:X.owner.route,failure:/timeout/i.test(String(((j=X.error)==null?void 0:j.message)||X.error))?"timeout":"unreachable"})}}catch{}F(W),R([...L,...$])}catch(T){z(String(T.message||T))}},[e]);return N.useEffect(()=>{I();const j=setInterval(I,5e3);return()=>clearInterval(j)},[I]),N.useEffect(()=>{let j=!1;return Ht("/api/config",e).then(T=>T.json()).then(T=>{j||q(!!T.readonlyDefault)}).catch(()=>{}),()=>{j=!0}},[e]),c.jsx("div",{className:"nc-set-overlay",onClick:t,children:c.jsxs("div",{className:"nc-set-panel",onClick:j=>j.stopPropagation(),children:[c.jsxs("div",{className:"nc-set-head",children:[c.jsx(Je,{name:"gear",size:18}),c.jsx("b",{children:f("settings")}),c.jsx("button",{type:"button",className:"nc-set-close",onClick:t,title:f("close"),children:c.jsx(Je,{name:"x",size:18})})]}),O&&c.jsx("div",{className:"nc-set-readonly",children:f("settings-readonly")}),Y&&c.jsx("div",{className:"nc-err",children:Y}),c.jsx("div",{className:`nc-set-tabs-wrap${v.start?" has-start-overflow":""}${v.end?" has-end-overflow":""}`,children:c.jsx("div",{className:"nc-set-tabs",ref:p,onScroll:B,children:["nodes","fleet","audio","input","system"].map(j=>c.jsx("button",{ref:u===j?m:null,type:"button",className:`nc-set-tabbtn${u===j?" on":""}`,onClick:()=>h(j),children:f(`tab-${j}`)},j))})}),c.jsxs("div",{className:"nc-set-body",children:[u==="nodes"&&c.jsx(Cj,{token:e,nodes:C,roster:Q,settings:w,readonly:O,vlUnavailable:E,refresh:I,refreshAliases:()=>G(j=>j+1)}),u==="fleet"&&c.jsx(oj,{token:e,readonly:O,startNewCell:o,initialLocation:s,targets:Q.map(j=>({route:j.route,label:j.label||j.name,status:j.status}))}),u==="audio"&&c.jsx(jj,{token:e,readonly:O,nodes:C,settings:w}),u==="input"&&c.jsx(Rj,{}),u==="system"&&c.jsx(Lj,{token:e,settings:w,readonly:O,refresh:I,roster:Q,section:y,setSection:b})]})]})})}function Tj({token:e,initialPair:t,deviceDefault:n="",localNodeId:s="",localNameDefault:o="",onPairDone:a,onDone:u}){kn();const[h,p]=N.useState(t?"pair":"welcome"),[m,v]=N.useState(!1),[S,y]=N.useState(null),b=async()=>{v(!0),y(null);try{await Wd(e,{wizardDone:!0}),a&&a(),u()}catch(w){y(String(w.message||w)),v(!1)}};return c.jsx("div",{className:"nc-wiz-overlay",children:c.jsxs("div",{className:"nc-wiz",children:[c.jsxs("div",{className:"nc-wiz-head",children:[c.jsx("b",{children:f("wizard-title")}),c.jsx("small",{children:f("hydra-simple")})]}),h==="welcome"&&c.jsxs("div",{className:"nc-wiz-body",children:[c.jsx("div",{className:"nc-wiz-done",children:f("local-ready")}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{className:"nc-btn ghost",disabled:m,onClick:b,children:f("local-only")}),c.jsx("button",{className:"nc-btn primary",disabled:m,onClick:()=>p("pair"),children:f("add-node")})]})]}),h==="pair"&&c.jsxs("div",{className:"nc-wiz-body",children:[c.jsx(Gw,{token:e,initial:t||"",autoStart:!!t,deviceDefault:n,localNodeId:s,localNameDefault:o,onBusyChange:v,onSuccess:async()=>{a&&a(),p("done")}}),c.jsx("div",{className:"nc-sheet-actions",children:c.jsx("button",{className:"nc-btn ghost",disabled:m,onClick:()=>{a&&a(),p("welcome")},children:f("back")})})]}),h==="done"&&c.jsxs("div",{className:"nc-wiz-body",children:[c.jsx("div",{className:"nc-wiz-done",children:f("node-connected")}),c.jsx("div",{className:"nc-sheet-actions",children:c.jsx("button",{className:"nc-btn primary",disabled:m,onClick:b,children:f("finish")})})]}),S&&c.jsx("div",{className:"nc-err",children:S})]})})}function Dj(e,t){if(typeof EventSource>"u"||!e)return()=>{};const n=new EventSource(`/api/events?token=${encodeURIComponent(e)}`);return n.onmessage=s=>{try{const o=JSON.parse(s.data);o&&typeof o=="object"&&typeof o.type=="string"&&t(o)}catch{}},()=>{try{n.close()}catch{}}}const Mj=6e3,Ij=12e3;function Oj({n:e,onClose:t}){return c.jsxs("div",{className:`nc-ntf-toast${e.urgency==="high"?" high":""}`,role:"status","aria-live":"polite",children:[c.jsxs("div",{className:"nc-ntf-toast-txt",children:[c.jsx("b",{children:e.title}),e.body&&c.jsx("small",{children:e.body}),e.session&&c.jsx("span",{className:"nc-ntf-from",children:e.session})]}),c.jsx("button",{type:"button",className:"nc-ntf-x",onClick:t,title:f("close"),children:c.jsx(Je,{name:"x",size:14})})]})}function Bj({ask:e,token:t,onAnswered:n,onDismiss:s}){const[o,a]=N.useState(""),[u,h]=N.useState(!1),[p,m]=N.useState(null),[v,S]=N.useState(!1),y=async w=>{const k=String(w||"").trim();if(!(!k||u)){m(null),h(!0);try{await G0(t,e.id,k),n(e.id)}catch(C){m(String(C.message||C))}h(!1)}},b=async()=>{if(!v){S(!0);try{await X0(t,e.id),s(e.id)}catch{S(!1)}}};return c.jsxs("div",{className:"nc-ask-card",children:[c.jsxs("div",{className:"nc-ask-head",children:[c.jsx("span",{className:"nc-ntf-from",children:e.session}),c.jsxs("code",{className:"nc-ask-id",children:["#",e.id]}),c.jsx("button",{type:"button",className:"nc-ask-dismiss",title:f("ask-dismiss"),"aria-label":f("ask-dismiss"),disabled:v,onClick:b,children:c.jsx(Je,{name:"x",size:14})})]}),c.jsx("div",{className:"nc-ask-q",children:e.question}),Array.isArray(e.options)&&e.options.length>0&&c.jsx("div",{className:"nc-ask-opts",children:e.options.map(w=>c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:u,onClick:()=>y(w),children:w},w))}),c.jsxs("div",{className:"nc-ask-reply",children:[c.jsx("textarea",{rows:2,placeholder:f("ask-reply-ph"),value:o,disabled:u,onChange:w=>a(w.target.value)}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:u||!o.trim(),onClick:()=>y(o),children:f("send")})]}),p&&c.jsx("div",{className:"nc-err",children:p})]})}function zj({token:e}){const[t]=kn(),[n]=hb(),[s,o]=N.useState([]),[a,u]=N.useState([]),[h,p]=N.useState(()=>{try{return/(?:^|[#&])ask=/.test(location.hash)}catch{return!1}}),m=N.useRef(0),v=N.useRef(null);v.current||(v.current=Sj());const S=N.useRef({enabled:n,lang:t});S.current={enabled:n,lang:t};const y=N.useCallback(C=>{o(R=>R.filter(E=>E.key!==C))},[]),b=N.useCallback(C=>{const R=`t${m.current+=1}`;o(F=>[...F.slice(-3),{...C,key:R}]),setTimeout(()=>y(R),C.urgency==="high"?Ij:Mj);const E=S.current;if(E.enabled)try{v.current.enqueue(C,vj(C,E.lang))}catch{}},[y]);N.useEffect(()=>{n||v.current.stop()},[n]),N.useEffect(()=>{const C=()=>{(document.visibilityState!=="visible"||!document.hasFocus())&&v.current.stop()},R=()=>v.current.stop();return document.addEventListener("visibilitychange",C),window.addEventListener("blur",C),window.addEventListener($h,R),()=>{document.removeEventListener("visibilitychange",C),window.removeEventListener("blur",C),window.removeEventListener($h,R),typeof v.current.dispose=="function"?v.current.dispose():v.current.stop()}},[]),N.useEffect(()=>{if(!e)return;let C=!1;Y0(e).then(E=>{C||u(E.asks||[])}).catch(()=>{});const R=Dj(e,E=>{E.type==="notify"?b(E):E.type==="ask"&&E.ask&&E.ask.id?u(F=>F.some(O=>O.id===E.ask.id)?F:[...F,E.ask]):E.type==="ask-answered"&&E.id?u(F=>F.filter(O=>O.id!==E.id)):E.type==="ask-dismissed"&&E.id&&u(F=>F.filter(O=>O.id!==E.id))});return()=>{C=!0,R()}},[e,b]);const w=C=>u(R=>R.filter(E=>E.id!==C)),k=C=>u(R=>R.filter(E=>E.id!==C));return c.jsxs(c.Fragment,{children:[s.length>0&&c.jsx("div",{className:"nc-ntf-toasts",children:s.map(C=>c.jsx(Oj,{n:C,onClose:()=>y(C.key)},C.key))}),a.length>0&&!h&&c.jsxs("button",{type:"button",className:"nc-ask-badge",onClick:()=>p(!0),title:f("asks-title"),children:["? ",c.jsx("span",{className:"nc-ask-count",children:a.length})]}),a.length>0&&h&&c.jsxs("div",{className:"nc-ask-panel",children:[c.jsxs("div",{className:"nc-ask-panel-head",children:[c.jsx("b",{children:f("asks-title")}),c.jsx("span",{className:"nc-ask-count",children:a.length}),c.jsx("button",{type:"button",className:"nc-ntf-x",onClick:()=>p(!1),title:f("close"),children:c.jsx(Je,{name:"x",size:16})})]}),c.jsx("div",{className:"nc-ask-panel-body",children:a.map(C=>c.jsx(Bj,{ask:C,token:e,onAnswered:w,onDismiss:k},C.id))})]})]})}const Fj=4e3;async function $j(e){const t=await Ht("/api/sessions",e);if((t==null?void 0:t.ok)===!1)throw new Error(`HTTP ${t.status}`);const n=await t.json();if(!Array.isArray(n==null?void 0:n.sessions))throw new Error("invalid sessions payload");return n.sessions}async function $d(e,t=[]){var h;const[n,s]=await Promise.allSettled([t.length?Jh(e,t):$j(e),ws(e,t)]),o=n.status==="fulfilled"&&Array.isArray((h=n.value)==null?void 0:h.sessions)?n.value.sessions:Array.isArray(n.value)?n.value:null,a=s.status==="fulfilled"?s.value:null,u=(a==null?void 0:a.available)===!0&&Array.isArray(a.cells)?a.cells:null;return{sessions:o,cells:u,fresh:Array.isArray(o)&&Array.isArray(u)}}function fb(e,t,n){return n===!0&&(e==null?void 0:e.degraded)!==!0&&(e==null?void 0:e.active)===!0&&e.tmux!==!1&&!!e.tmuxSession&&(t||[]).some(s=>(s==null?void 0:s.name)===e.tmuxSession)}function Hj(e){const t=new Map((e.sessions||[]).map(o=>[o.name,o])),n=[],s=(o,a,u,h=[],p="")=>{const m=new Map((a||[]).map(v=>[v.name,v]));for(const v of o||[]){const S=m.get(v.tmuxSession)||{},y=of(v,S),b=fb(v,a,u);n.push({key:Go(h,v.tmuxSession||v.cell),session:v.tmuxSession,route:h,cellName:v.cell,label:v.cell,node:h.length?h.join("/"):"",nodeLabel:p,live:b,selectable:b,verified:u===!0,working:y.working,degraded:!!v.degraded,active:v.active===!0,activity:S.activity||v.activity||0,subtitle:y.subtitle})}};s(e.cells,[...t.values()],e.localFresh===!0);for(const o of e.nodeGroups||[]){const a=Array.isArray(o.route)?o.route:[];o.kind==="vl"||!a.length||s(o.cells,o.sessions,o.switcherFresh===!0,a,o.label||o.name||"")}return n}function Uj(e){const t=new Map,n=Array.isArray(e.sessions)?e.sessions:[],s=Array.isArray(e.cells)?e.cells:[],o=new Map(n.map(u=>[u.name,u])),a=new Set(s.map(u=>u.tmuxSession).filter(Boolean));t.set("local",af(s,n.filter(u=>!a.has(u.name)),o));for(const u of e.nodeGroups||[]){const h=Array.isArray(u.route)?u.route:[];if(u.kind==="vl"||!h.length)continue;const p=Array.isArray(u.cells)?u.cells:[],m=Array.isArray(u.sessions)?u.sessions:[],v=new Set(p.map(S=>S.tmuxSession).filter(Boolean));t.set(h.join("/"),Fl({...u,route:h,cells:p,sessions:m,unmanaged:m.filter(S=>!v.has(S.name))}).rawItems)}return t}function Wj(e,t,n,s){return[...new Set(e.map(a=>a.node||"local"))].flatMap(a=>{const u=e.filter(v=>(v.node||"local")===a),h=new Map((t.get(a)||[]).map(v=>[v.key,v])),p=new Map(u.map(v=>[v.key,v])),m=u.map(v=>{const S=h.get(v.key);return{...v,label:(S==null?void 0:S.label)||v.label,live:(S==null?void 0:S.live)??v.live,fresh:(S==null?void 0:S.fresh)===!0,activity:(S==null?void 0:S.activity)??v.activity}});return gs(m,n,"all",Fi(s,a)).map(v=>p.get(v.key))})}function Kj({token:e,current:t,onPick:n,onClose:s}){const[o,a]=N.useState(Og),[u,h]=N.useState(!1),[p,m]=N.useState(!1),[v,S]=N.useState(""),[y,b]=N.useState(""),[w,k]=N.useState(""),C=N.useRef(null),R=N.useRef(null),E=N.useMemo(()=>Hj(o),[o]),F=N.useMemo(()=>Uj(o),[o]),{pins:O,orders:q,canMoveRoster:Y,moveRoster:z,stepRoster:Z}=rf(),G=N.useMemo(()=>Wj(E,F,O,q),[E,F,O,q]),Q=N.useMemo(()=>u?G:G.filter(L=>L.selectable||L.degraded&&L.active),[G,u]),B=N.useMemo(()=>E.find(L=>L.key===y&&L.selectable),[E,y]);N.useEffect(()=>{var W;const L=document.activeElement;(W=R.current)==null||W.focus();const $=x=>{x.key==="Escape"&&s()};return document.addEventListener("keydown",$),()=>{var x;document.removeEventListener("keydown",$),(x=L==null?void 0:L.focus)==null||x.call(L)}},[s]),N.useEffect(()=>{let L=!0,$=!1;const W=async()=>{if($)return;$=!0;const M=Og(),D=Array.isArray(M.nodeGroups)?M.nodeGroups:[],A=$d(e),K=me=>me.kind!=="vl"&&Array.isArray(me.route)&&me.route.length>0,X=await Promise.all(D.filter(K).map(async me=>({group:me,result:await $d(e,me.route)}))),se=await A;if(!L)return;const ce=new Map(X.map(({group:me,result:be})=>[JSON.stringify(me.route||[]),be])),fe=D.map(me=>{if(!K(me))return{...me,switcherFresh:!1};const be=ce.get(JSON.stringify(me.route||[]));return be?{...me,sessions:be.sessions||me.sessions||[],cells:be.cells||me.cells||[],switcherFresh:be.fresh}:{...me,switcherFresh:!1}}),we=Sy({...M,sessions:se.sessions||M.sessions||[],cells:se.cells||M.cells||[],localFresh:se.fresh,nodeGroups:fe,refreshedAt:Date.now()});a(we),m(!0),$=!1};W();const x=setInterval(W,Fj);return()=>{L=!1,clearInterval(x)}},[e]);const I=L=>L.degraded?f("cell-degraded"):L.verified?L.selectable?L.working?f("cell-working"):f("cell-idle"):f("cell-off"):f("cell-switcher-not-confirmed"),j=L=>{if(S(""),!L.selectable){S(f("cell-switcher-not-active"));return}b(L.key)},T=async()=>{const L=B;if(!L){S(f("cell-switcher-select"));return}S(""),k(L.key);try{const $=await $d(e,L.route),W=($.cells||[]).find(x=>(x==null?void 0:x.cell)===L.cellName&&(x==null?void 0:x.tmuxSession)===L.session);if(!fb(W,$.sessions,$.fresh)){S(f("cell-switcher-not-active"));return}n({session:L.session,...L.node?{node:L.node}:{},cellName:L.cellName}),s()}catch{S(f("cell-switcher-not-active"))}finally{k("")}};return c.jsx("div",{className:"nc-cell-switcher-backdrop",onClick:s,children:c.jsxs("aside",{ref:C,className:"nc-cell-switcher",role:"dialog","aria-label":f("fleet-cells"),tabIndex:-1,onClick:L=>L.stopPropagation(),children:[c.jsxs("div",{className:"nc-cell-switcher-list",children:[!p&&c.jsx("div",{className:"nc-empty",role:"status",children:f("cell-switcher-refreshing")}),p&&Q.length===0&&c.jsx("div",{className:"nc-empty",role:"status",children:f("cell-switcher-empty-active")}),Q.map(L=>{const $=(t==null?void 0:t.session)===L.session&&((t==null?void 0:t.node)||"")===L.node,W=y===L.key,x=I(L),M=L.node||"local",D=F.get(M)||E.filter(A=>(A.node||"local")===M);return c.jsxs("div",{className:`nc-cell-switcher-row${$?" current":""}${W?" selected":""}${L.selectable?"":" off"}`,"data-roster-key":L.key,"data-position":M,children:[c.jsx(bi,{position:M,itemKey:L.key,label:L.cellName,canMove:Y,onMove:(A,K)=>z(M,A,K,D),onStep:A=>Z(M,L.key,A,D)}),c.jsxs("button",{type:"button",className:"nc-cell-switcher-row-select","aria-current":$?"true":void 0,"aria-pressed":W,"aria-disabled":!L.selectable,disabled:w===L.key,onClick:()=>j(L),children:[c.jsx("span",{className:`nc-cell-switcher-dot${L.degraded?" warn":L.live?` on${L.working?" working":""}`:""}`}),c.jsxs("span",{className:"nc-cell-switcher-copy",children:[c.jsx("b",{children:L.cellName}),c.jsx("small",{className:"nc-cell-switcher-state",children:x}),c.jsx("small",{children:[L.nodeLabel,L.subtitle].filter(Boolean).join(" · ")})]})]})]},L.key)})]}),v&&c.jsx("div",{className:"nc-cell-switcher-notice",role:"status",children:v}),c.jsx("div",{className:"nc-cell-switcher-actions",children:c.jsx("button",{type:"button",className:"nc-cell-switcher-open",disabled:!B||!!w,onClick:T,children:B?`${f("cell-switcher-open")}: ${B.cellName}`:f("cell-switcher-select")})}),c.jsxs("div",{className:"nc-cell-switcher-controls",children:[c.jsx("b",{children:f("fleet-cells")}),c.jsx("button",{type:"button",className:"nc-cell-switcher-filter","aria-pressed":u,onClick:()=>{S(""),h(L=>!L)},children:f(u?"cell-switcher-show-active":"cell-switcher-show-all")}),c.jsx("button",{ref:R,type:"button",className:"nc-cell-switcher-close","aria-label":f("cell-switcher-close"),title:f("cell-switcher-close"),onClick:s,children:"×"})]})]})})}const qj=2e3;function Vj(e){if(e.kind==="gap")return`${f("vl-events-gap")} ${e.count||"?"}`;if(e.kind==="truncate")return f("vl-events-truncated");if(e.kind==="turn_end")return f("vl-events-turn-end");if(e.kind==="done")return f("vl-events-done");if(e.kind==="writer_epoch")return f("vl-events-writer-epoch");if(e.kind==="tool_start")return`${f("vl-events-tool")} ${e.name||""}`.trim();if(e.kind==="tool_end"){const t=e.isError?f("vl-events-tool-failed"):f("vl-events-tool-ok");return`${f("vl-events-tool")} ${e.name||""} — ${t}`.trim()}return e.kind==="usage"?e.text||f("vl-events-usage"):e.text||""}function Yj({token:e,nodeId:t,route:n=[]}){const[s,o]=N.useState([]),[a,u]=N.useState(!1),h=N.useRef(0),p=N.useRef(!1);return N.useEffect(()=>{let m=!0;h.current=0,p.current=!1,o([]);const v=async()=>{if(!p.current){p.current=!0;try{const b=await E0(e,t,h.current,n);if(!m)return;u(!1);const k=(Array.isArray(b==null?void 0:b.events)?b.events:[]).filter(C=>Number.isSafeInteger(C==null?void 0:C.seq)&&C.seq>h.current);k.length&&(o(C=>C.concat(k).slice(-500)),h.current=k[k.length-1].seq),Number.isSafeInteger(b==null?void 0:b.cursor)&&b.cursor>h.current&&(h.current=b.cursor)}catch{m&&u(!0)}finally{p.current=!1}}},S=()=>{v().catch(()=>{})};S();const y=setInterval(S,qj);return()=>{m=!1,clearInterval(y)}},[e,t,JSON.stringify(n)]),c.jsxs("div",{className:"nc-vl-events",children:[a&&c.jsx("div",{className:"nc-set-hint nc-vl-events-stale",children:f("vl-events-stale")}),s.length===0&&!a&&c.jsx("small",{className:"nc-set-hint","data-testid":"vl-events-empty",children:f("vl-events-empty")}),s.length>0&&c.jsx("ol",{className:"nc-vl-events-list",children:s.map(m=>c.jsx("li",{"data-testid":`vl-ev-${m.seq}`,className:`nc-vl-ev nc-vl-ev-${m.kind}${m.isError?" error":""}${m.kind==="gap"?" gap":""}`,children:Vj(m)},`${m.seq}-${m.kind}`))})]})}function $_({peer:e,token:t,onBack:n}){var s;return kn(),e?c.jsxs("section",{className:"nc-vl-session-view",children:[c.jsxs("header",{className:"nc-bar nc-bar-single",children:[c.jsxs("button",{onClick:n,title:f("back"),children:[c.jsx(Je,{name:"chevronLeft",size:18}),c.jsx("span",{className:"nc-bar-label",children:f("back")})]}),c.jsxs("span",{className:"nc-bar-center",children:[c.jsx("b",{title:e.label,children:e.label}),((s=e.session)==null?void 0:s.profile)&&c.jsxs("small",{className:"nc-bar-sub",children:[e.session.profile," · ",f("vl-events-title")]})]}),c.jsx("span",{className:"nc-bar-right"})]}),c.jsx("div",{className:"nc-vl-session-body",children:c.jsx(Yj,{token:t,nodeId:e.nodeId,route:e.route||[]})})]}):null}const Hd=e=>ki(Ys(e)).length===0,Ud=e=>Array.isArray(e)?e.join("/"):"";function Gj(e){const t=new Set,n=[];for(const s of Array.isArray(e)?e:[])!s||!Hn.test(String(s.instanceId||""))||!Array.isArray(s.route)||!s.route.length||t.has(s.instanceId)||(t.add(s.instanceId),n.push({instanceId:s.instanceId,route:[...s.route],label:String(s.label||s.name||s.route.join(" › ")),status:s.status||"offline"}));return n.sort((s,o)=>s.label.localeCompare(o.label))}function zo(e){return{instanceId:e.ownerId,route:e.ownerRoute||[],label:e.ownerLabel,status:e.available===!1?"offline":"up"}}function Hs(e,t,n,s=!1,o=!0){const a=t.instanceId;return{...e,id:Ar(s?null:a,e.name),ownerId:a,ownerRoute:s?[]:[...t.route],ownerLabel:s?"Local":t.label,local:s,available:o,ownerTopology:Array.isArray(n)?n:[],layout:Oh(e.layout,a,n)}}function Xj(e,t,n,s,o=[]){const[a,u]=N.useState([]),[h,p]=N.useState(!1),[m,v]=N.useState("idle"),[S,y]=N.useState(""),[b,w]=N.useState(""),k=N.useRef([]),C=N.useRef([]),R=N.useRef(""),E=N.useRef(t),F=N.useRef(n),O=N.useRef(!1),q=N.useRef(!0),Y=N.useRef(""),z=N.useMemo(()=>Gj(o),[o]),Z=z.map(D=>`${D.instanceId}:${Ud(D.route)}:${D.status}:${D.label}`).join("|");C.current=z,F.current=n,E.current=t,k.current=a;const G=N.useCallback(D=>Bh(D.layout,R.current,C.current),[]),Q=N.useCallback((D,A=!0,K=E.current)=>{const X=Vv(D,xl()),se=k.current.some(fe=>fe.id===K);k.current=X,u(X);const ce=X.find(fe=>fe.id===K);if(A&&ce){q.current=!0;const fe=G(ce);s(fe),ce.local&&mN(ce.name,fe)}else se&&!ce&&(q.current=!0,s(Lr()),y("deck non più condiviso dal nodo owner"));dN(X.filter(fe=>fe.local).map(fe=>fe.name))},[s,G]),B=N.useCallback(async D=>{let A=await pl(e);const K=A.decks.find(X=>X.name==="main");if(A.decks.length===1&&K&&K.revision===0&&Hd(K.layout)){const X=uN(),se=Ys(zh("main")||Lr());if(!Hd(se)){const ce=Oh(se,D,[]);A.decks[0]=await ml(e,"main",ce,0,[])}for(const ce of X.filter(fe=>fe!=="main"))try{let fe=await Cg(e,ce,[]);const we=Ys(zh(ce)||Lr());Hd(we)||(fe=await ml(e,ce,Oh(we,D,[]),fe.revision,[]))}catch{}A=await pl(e)}return A},[e]),I=N.useCallback(async({migrate:D=!1}={})=>{const A=await Zh(e,[]),K=Hn.test(String(A.instanceId||""))?A.instanceId:"";if(!K)throw new Error("instanceId locale non disponibile");R.current=K,w(K);const[X,se]=await Promise.all([D?B(K):pl(e),bg(e,[]).catch(()=>({nodes:[]}))]),ce={instanceId:K,route:[],label:"Local"},fe=X.decks.map(me=>Hs(me,ce,se.nodes,!0,!0)),we=k.current;return await Promise.all(C.current.map(async me=>{if(me.status!=="up"){fe.push(...we.filter(be=>!be.local&&be.ownerId===me.instanceId).map(be=>({...be,ownerRoute:[...me.route],ownerLabel:me.label,available:!1})));return}try{const[be,$e]=await Promise.all([pl(e,me.route),bg(e,me.route).catch(()=>({nodes:[]}))]);fe.push(...be.decks.map(dt=>Hs(dt,me,$e.nodes,!1,!0)))}catch{fe.push(...we.filter($e=>!$e.local&&$e.ownerId===me.instanceId).map($e=>({...$e,ownerRoute:[...me.route],ownerLabel:me.label,available:!1})))}})),fe.sort((me,be)=>me.local===be.local?me.ownerLabel.localeCompare(be.ownerLabel)||(me.name==="main"?-1:be.name==="main"?1:me.name.localeCompare(be.name)):me.local?-1:1),fe},[e,B,Z]);N.useEffect(()=>{if(!e)return;let D=!1;const A=Y.current!==e;return Y.current=e,I({migrate:A}).then(K=>{if(D)return;const X=k.current.find(fe=>fe.id===E.current),se=K.find(fe=>fe.id===E.current),ce=se&&(!X||se.revision>X.revision||X.available!==se.available||Ud(X.ownerRoute)!==Ud(se.ownerRoute));Q(K,A||!!ce&&!O.current),p(!0),se&&y("")}).catch(K=>{D||(p(!0),y(String(K.message||K)))}),()=>{D=!0}},[Q,I,Z,e]);const j=N.useCallback(async(D=E.current)=>{if(!h||!O.current)return!0;const A=k.current.find(K=>K.id===D);if(!A)return y(`deck inesistente: ${D}`),!1;if(A.available===!1)return y(`nodo owner offline: ${A.ownerLabel}`),!1;v("saving");try{const K=Kv(Ys(F.current),A.ownerId,A.ownerTopology),X=await ml(e,A.name,K,A.revision,A.ownerRoute),se=Hs(X,zo(A),A.ownerTopology,A.local,!0);return Q(k.current.map(ce=>ce.id===D?se:ce),!1),O.current=!1,v("saved"),y(""),setTimeout(()=>v("idle"),1500),!0}catch(K){if(v("error"),y(String(K.message||K)),K.status===409&&K.data&&K.data.current){const X=k.current.find(ce=>ce.id===D),se=Hs(K.data.current,zo(X),X.ownerTopology,X.local,!0);Q(k.current.map(ce=>ce.id===D?se:ce),!1)}return!1}},[h,e,Q]);return N.useEffect(()=>{if(!h)return;if(q.current){q.current=!1;return}O.current=!0,v("saving");const D=setTimeout(j,650);return()=>clearTimeout(D)},[n,h,j]),N.useEffect(()=>{if(!h)return;const D=setInterval(async()=>{try{const A=await I(),K=k.current.find(ce=>ce.id===E.current),X=A.find(ce=>ce.id===E.current),se=X&&(!K||X.revision>K.revision||K.available!==X.available);Q(A,se&&!O.current)}catch{}},5e3);return()=>clearInterval(D)},[h,I,Q]),{decks:a,records:a,localNodeId:b,ready:h,saveState:m,error:S,setError:y,saveNow:j,select:async D=>{if(O.current&&!await j(E.current))throw new Error("salvataggio del deck corrente fallito: cambio annullato");const A=k.current.find(K=>K.id===D);if(!A)throw new Error(`deck inesistente: ${D}`);return O.current=!1,q.current=!0,G(A)},add:async(D,A=null)=>{const K=A===Si?k.current.find(ce=>ce.local):A?k.current.find(ce=>ce.ownerId===A):null;if(!K||K.available===!1)throw new Error("nodo owner non disponibile");const X=await Cg(e,D,K.ownerRoute),se=Hs(X,zo(K),K.ownerTopology,K.local,!0);return Q([...k.current,se],!1),se},rename:async(D,A)=>{const K=k.current.find(we=>we.id===D);if(!K)throw new Error("deck inesistente");if(D===E.current&&O.current&&!await j(D))throw new Error(`salvataggio di "${K.name}" fallito: rinomina annullata`);const X=k.current.find(we=>we.id===D);if(!X)throw new Error("deck inesistente");const se=await Q0(e,X.name,A,X.revision,X.ownerRoute),ce=Hs(se,zo(X),X.ownerTopology,X.local,!0),fe=X.local?Si:X.ownerId;return md(fN(xl(),fe,D,ce.id)),Q(k.current.map(we=>we.id===D?ce:we),!1),ce},remove:async D=>{const A=k.current.find(X=>X.id===D);if(!A)throw new Error("deck inesistente");D===E.current&&(O.current=!1),await J0(e,A.name,A.revision,A.ownerRoute);const K=A.local?Si:A.ownerId;md(pN(xl(),K,D)),Q(k.current.filter(X=>X.id!==D),!1)},reorder:(D,A)=>{const K=k.current.find(me=>me.id===D),X=k.current.find(me=>me.id===A);if(!K||!X)return!1;const se=K.local?Si:K.ownerId,ce=X.local?Si:X.ownerId;if(se!==ce)return!1;const fe=k.current.filter(me=>(me.local?Si:me.ownerId)===se).map(me=>me.id),we=md(hN(xl(),se,D,A,fe));return Q(Vv(k.current,we),!1),!0},addTileTo:async(D,A)=>{const K=k.current.find(me=>me.id===D);if(!K)throw new Error("deck inesistente");if(K.available===!1)throw new Error(`nodo owner offline: ${K.ownerLabel}`);const X=Lw(A,R.current,C.current);if(!X)throw new Error("riferimento sessione non valido");const se=G(K),ce=Kv(yy(se,X),K.ownerId,K.ownerTopology),fe=await ml(e,K.name,ce,K.revision,K.ownerRoute),we=Hs(fe,zo(K),K.ownerTopology,K.local,!0);return Q(k.current.map(me=>me.id===D?we:me),!1),we},localMainId:Ar(null,"main"),parseDeckId:rc}}const Qj="/sw.js",Uh="nc-sw-update";let Wh=null,Kh=!1,qh=null,pb=Object.freeze({needed:!1,kind:null,version:""}),mb=!1;function gb(){typeof window<"u"&&window.dispatchEvent(new Event(Uh))}function vb(){const e=qh||(Kh?{kind:"reload",version:""}:null);pb=Object.freeze({needed:!!e,kind:(e==null?void 0:e.kind)||null,version:(e==null?void 0:e.version)||""})}function H_(){return pb}function Jj(e){return typeof window>"u"?()=>{}:(window.addEventListener(Uh,e),()=>window.removeEventListener(Uh,e))}function Ff(e){Kh!==e&&(Kh=e,vb(),gb())}function Zj(e,t,n){let s=null;e&&t&&e!==t?s={kind:"install",version:e}:t&&n&&t!==n&&(s={kind:"reload",version:t});const o=JSON.stringify(s)===JSON.stringify(qh);qh=s,vb(),o||gb()}function eR(e){e.addEventListener("statechange",()=>{e.state==="installed"&&navigator.serviceWorker.controller&&Ff(!0)})}function tR(){typeof navigator>"u"||!("serviceWorker"in navigator)||(navigator.serviceWorker.addEventListener("controllerchange",()=>{mb&&location.reload()}),navigator.serviceWorker.register(Qj).then(e=>{Wh=e,e.waiting&&Ff(!0),e.addEventListener("updatefound",()=>{const t=e.installing;t&&eR(t)}),setInterval(()=>{e.update().catch(()=>{})},3600*1e3)}).catch(()=>{}))}function nR(){mb=!0,Ff(!1);const e=Wh&&Wh.waiting;e?(e.postMessage({type:"SKIP_WAITING"}),setTimeout(()=>location.reload(),4e3)):location.reload()}function iR({hash:e="",origin:t="",pathname:n="",search:s=""}={}){const o=String(e||"").replace(/^#/,""),a=`${n||""}${s||""}`;if(!o)return{token:"",pair:"",nextUrl:a};const u=new URLSearchParams(o),h=u.get("token")||"",p=u.get("pair")||"",m=p?`${t||""}${n||""}#pair=${p}`:"";return{token:h,pair:m,nextUrl:a}}const _b=9,yb=24,wb="nc_side_w",U_="nc_side_min",sR=240,W_="(min-width:1024px) and (pointer:fine)";function rR(){const e=Number(localStorage.getItem(wb));return e>=180&&e<=480?e:sR}function oR(){const e=Number(localStorage.getItem("nc_fontsize"));return e>=_b&&e<=yb?e:13}function aR(){const e={token:"",pair:""};try{const{token:t,pair:n,nextUrl:s}=iR({hash:location.hash,origin:location.origin,pathname:location.pathname,search:location.search});if(t){e.token=t;try{localStorage.setItem("nc_token",t)}catch{}}if(n){e.pair=n;try{sessionStorage.setItem("nc_pair",n)}catch{}}if(location.hash)try{history.replaceState(null,"",s)}catch{}}catch{}if(e.token||(e.token=sessionStorage.getItem("nc_token")||localStorage.getItem("nc_token")||""),!e.pair){const t=sessionStorage.getItem("nc_pair");t&&(e.pair=t)}return e}function lR(e){try{return Ys(zh(e))}catch{return Lr()}}function K_(e){if(!e)return"";const t=Math.floor(Date.now()/1e3)-e;return t<0||t<60?"ora":t<3600?`${Math.floor(t/60)}m`:t<86400?`${Math.floor(t/3600)}h`:`${Math.floor(t/86400)}g`}function cR(){const[e,t]=N.useState(()=>window.matchMedia(W_).matches);return N.useEffect(()=>{const n=window.matchMedia(W_),s=o=>t(o.matches);return n.addEventListener("change",s),()=>n.removeEventListener("change",s)},[]),e}function q_({session:e,node:t,ownerId:n,cellName:s,token:o,readonly:a=!1,onBack:u,onCellSwitcher:h,cellSwitcherOpen:p=!1}){kn();const[m]=kf(),[v,S]=N.useState(!1),[y,b]=N.useState(()=>window.matchMedia("(pointer: coarse)").matches),[w,k]=N.useState(null),[C,R]=N.useState(oR),[E,F]=N.useState(s||e),[O,q]=N.useState(""),Y=$=>R(W=>{const x=Math.max(_b,Math.min(yb,W+$));return localStorage.setItem("nc_fontsize",String(x)),x}),z=N.useRef(()=>{}),Z=N.useRef(()=>!1),G=N.useRef(()=>{}),Q=N.useRef(!1),[B,I]=N.useState(!1),[j,T]=N.useState(!1),L=()=>{Q.current=!Q.current,I(Q.current)};return N.useEffect(()=>{F(s||e)},[s,e]),N.useEffect(()=>{let $=!0;const W=t?t.split("/"):[],x=t?`/api/route/${t.split("/").map(encodeURIComponent).join("/")}/_`:"/api";async function M(){let A=null,K=null;try{const ce=await(await Ht(`${x}/sessions`,o)).json();Array.isArray(ce.sessions)&&(A=ce.sessions.find(fe=>fe.name===e))}catch{}try{const se=await ws(o,W);se.available&&Array.isArray(se.cells)&&(K=se.cells.find(ce=>ce.tmuxSession===e))}catch{}if(!$)return;F(Cf({session:e,cell:K||(s?{cell:s}:null)}));let X="";K?X=`${K.engine}${K.key?`·${K.key}`:""}`:A&&(X=A.attached?`attached · ${K_(A.activity)}`:A.activity?K_(A.activity):""),q(X)}M();const D=setInterval(M,4e3);return()=>{$=!1,clearInterval(D)}},[e,t,o]),c.jsxs("div",{className:"nc-app",children:[c.jsxs("header",{className:"nc-bar nc-bar-single",children:[c.jsxs("button",{onClick:u,title:f("sessions"),children:[c.jsx(Je,{name:"chevronLeft",size:18}),c.jsx("span",{className:"nc-bar-label",children:f("sessions")})]}),c.jsxs("span",{className:"nc-bar-center",children:[c.jsx("b",{title:t?`${E} · ${t}`:E,children:E}),O&&c.jsx("small",{className:"nc-bar-sub",children:O})]}),c.jsxs("span",{className:"nc-bar-right",children:[c.jsx("button",{onClick:()=>Y(-1),title:f("zoom-out"),children:c.jsx(Je,{name:"zoomOut",size:18})}),c.jsx("button",{onClick:()=>Y(1),title:f("zoom-in"),children:c.jsx(Je,{name:"zoomIn",size:18})}),c.jsx("button",{onClick:()=>b($=>!$),title:f("composer"),children:c.jsx(Je,{name:"keyboard",size:20})}),c.jsx("button",{onClick:()=>S($=>!$),title:f("files"),children:c.jsx(Je,{name:"folder",size:20})})]})]}),c.jsx("div",{className:"nc-termwrap",children:c.jsx(gw,{session:e,node:t,token:o,readonly:a,takeSize:!0,sendRef:z,composerRef:Z,actionRef:G,ctrlRef:Q,setCtrlArmed:I,onFiles:k,fontSize:C,selectionMode:j,onSelectionModeChange:T,keyboardGesture:m.terminalKeyboardGesture})}),c.jsx(DE,{onKeyboard:()=>b($=>!$),onCellSwitcher:h,cellSwitcherOpen:p,send:$=>z.current($),action:$=>G.current($),ctrlArmed:B,onCtrl:L,selectionMode:j,onSelectionMode:T,keepKeyboardClosed:m.keybarKeepsKeyboardClosed,showEnter:m.showKeybarEnter,keybarLayout:m.keybarLayout}),y&&c.jsx(Ew,{submitText:$=>Z.current($),token:o,session:e,node:t,ownerId:n,keepKeyboardClosedOnVoice:m.voiceKeepsKeyboardClosed}),v&&c.jsx(vw,{session:e,node:t,token:o,filesEvent:w,onClose:()=>S(!1)})]})}function uR(){kn();const[e]=N.useState(aR),[t,n]=N.useState(e.token),[s,o]=N.useState(e.pair||""),a=N.useCallback(()=>{o("");try{sessionStorage.removeItem("nc_pair")}catch{}},[]),[u,h]=N.useState(!1),p=cR(),[m]=N.useState(()=>cN(typeof location<"u"?location.pathname:"/")),[v,S]=N.useState(m.id),y=v===Ar(null,Un),[b,w]=N.useState(null),k=he=>{const je=ys(he);w(je?{...je,...typeof(he==null?void 0:he.cellName)=="string"&&he.cellName?{cellName:he.cellName}:{}}:null)},[C,R]=N.useState([]),[E,F]=N.useState([]),[O,q]=N.useState([]),[Y,z]=N.useState(()=>m.ownerId?Lr():lR(m.name)),[Z,G]=N.useState(null),[Q,B]=N.useState(null),I=he=>B(ys(he)),[j,T]=N.useState(null),L=nf(t,p),$=N.useMemo(()=>(L||[]).filter(he=>he.instanceId).map(he=>({instanceId:he.instanceId,route:he.route,label:he.label,status:he.status})),[L]),W=Xj(t,v,Y,z,$),x=W.decks;N.useEffect(()=>{const he=new Map;for(const je of L||[]){const Ke=(je.route||[je.name]).join("/"),ft=new Set((je.sessions||[]).map(vt=>vt.name));for(const vt of je.cells||[])!vt.cell||!vt.tmuxSession||vt.cell===vt.tmuxSession||ft.has(vt.cell)||he.set(`${Ke}:${vt.cell}`,`${Ke}:${vt.tmuxSession}`)}z(je=>Nx(je,he))},[L]),N.useEffect(()=>{W.localNodeId&&z(he=>{const je=Bh(he,W.localNodeId,$);return JSON.stringify(je)===JSON.stringify(he)?he:je})},[$,W.localNodeId]);const[M,D]=N.useState(null),[A,K]=N.useState(null),X=N.useRef(0),[se,ce]=N.useState(!1),[fe,we]=N.useState(rR),[me,be]=N.useState(!y),[$e,dt]=N.useState(()=>y?localStorage.getItem(U_)==="1":!0),[Ye,De]=N.useState(!1),[Pt,Jt]=N.useState("nodes"),[Me,Et]=N.useState(!1),[gt,bt]=N.useState(""),[ht,rt]=N.useState(!1),at=(he="nodes",je=!1,Ke="")=>{Jt(he),Et(je),bt(Ke),De(!0)},[ie,xe]=N.useState(!1),[Ie,Be]=N.useState({deviceDefault:"",localNodeId:"",localNameDefault:""}),[ue,oe]=N.useState(!1);N.useEffect(()=>{try{localStorage.setItem(wb,String(fe))}catch{}},[fe]),N.useEffect(()=>{try{localStorage.setItem(U_,$e?"1":"")}catch{}},[$e]),N.useEffect(()=>{if(!t)return;let he=!1;return Promise.all([ty(t),Ht("/api/config",t).then(je=>je.json())]).then(([je,Ke])=>{he||(Be({deviceDefault:je.deviceName||"",localNodeId:je.nodeId||"",localNameDefault:je.localName||""}),oe(!!Ke.readonlyDefault),(je.firstRun===!0&&!Ke.readonlyDefault||s)&&xe(!0))}).catch(()=>{}),()=>{he=!0}},[t,s]);const H=N.useCallback(async()=>{try{const je=await(await Ht("/api/sessions",t)).json();je.error||R(je.sessions||[])}catch{}try{const he=await ws(t);F(he.available?he.cells||[]:[]),q(he.available?he.capabilities||[]:[])}catch{F([]),q([])}},[t]);N.useEffect(()=>{if(!p)return;H();const he=setInterval(H,4e3);return()=>clearInterval(he)},[p,H]),N.useEffect(()=>{let he=!1;return Ht("/api/config",t).then(je=>je.json()).then(je=>{he||Zj(je.version,je.uiVersion,"0.8.52-rc.25")}).catch(()=>{}),()=>{he=!0}},[t]);const te=new Set([...C.map(he=>he.name),...L.flatMap(he=>he.sessions.map(je=>je.key))]),U=ki(Y),le=he=>z(je=>{const Ke=Lw(he,W.localNodeId,$)||he,ft=yy(je,Ke);return ft===je&&ki(je).length>=9&&W.setError(f("grid-full")),ft}),de=async(he,je=[])=>{try{await Xh(t,he,je)}catch{return}const Ke=je.length?`${je.join("/")}:${he}`:he;z(ft=>Hl(ft,Ke)),H()},ge=async(he,je,Ke=[])=>{try{await ey(t,he,je,Ke)}catch{return}H()},Le=async(he,je,Ke=[])=>{await Q_(t,{cell:he,enabled:!!je},Ke),H()},_e=async he=>{if(!M)return;const{cell:je}=M,Ke=Array.isArray(M.route)?M.route:[];if(he.action==="up"){const vt=await Gh(t,{cell:je,boot:!!he.boot,...he.engine?{engine:he.engine}:{},...he.model!==void 0?{model:he.model}:{},...he.permissionPolicy?{permissionPolicy:he.permissionPolicy}:{}},Ke),bs=uf(vt);bs&&W.setError(bs.text)}else await Il(t,{cell:je,boot:!!he.boot},Ke);const ft=he.action==="up"?!!he.boot:he.boot?!1:!!M.boot;K({id:++X.current,cell:je,route:Ke,enabled:ft}),H()},Ee=N.useCallback(he=>{K(je=>(je==null?void 0:je.id)===he?null:je)},[]),tt=async he=>{if(!(!(he!=null&&he.direct)||se)){ce(!0);try{await ef(t,he.name,he.tunnelStatus==="up"?"down":"up")}finally{ce(!1)}}},ot=async(he,je)=>{const Ke=String(je||"").trim();return!(he!=null&&he.direct)||!Ir(Ke)?!1:(await sy(t,he.name,Ke),!0)},Qe=he=>{const je=x.find(Ke=>Ke.id===he);if(!je)return!1;try{const Ke=window.open(pd(je,t),"_blank");return Ke&&(Ke.opener=null),!!Ke}catch{return!1}},Mt=async he=>{if(!he||he===v)return;const je=await W.select(he),Ke=W.records.find(ft=>ft.id===he);S(he),z(je),G(null),B(null);try{history.replaceState(null,"",pd(Ke||he,null))}catch{}},ct=async(he,je)=>{const Ke=await W.add(he,je);await Mt(Ke.id)},Ze=async(he,je)=>{const Ke=await W.rename(he,je);if(he===v){S(Ke.id),z(Bh(Ke.layout,W.localNodeId,$)),G(null),B(null);try{history.replaceState(null,"",pd(Ke,null))}catch{}}},Zt=async he=>{await W.remove(he),he===v&&await Mt(W.localMainId)},ni=async(he,je)=>{!je||je===v||(await W.addTileTo(je,he),z(Ke=>Hl(Ke,he)))};if(!t)return c.jsxs("div",{className:"nc-auth",children:[c.jsx("p",{children:f("auth-prompt")}),c.jsx("input",{onChange:he=>n(he.target.value.trim()),placeholder:"token"}),c.jsxs("label",{children:[c.jsx("input",{type:"checkbox",checked:u,onChange:he=>h(he.target.checked)})," ",f("remember-device")]}),c.jsx("button",{onClick:()=>{(u?localStorage:sessionStorage).setItem("nc_token",t)},children:"ok"})]});const Wn=c.jsxs(c.Fragment,{children:[Ye&&c.jsx(Aj,{token:t,initialTab:Pt,initialLocation:gt,startNewCell:Me,onClose:()=>{De(!1),Et(!1),bt("")}}),ie&&c.jsx(Tj,{token:t,initialPair:s,...Ie,onPairDone:a,onDone:()=>xe(!1)}),c.jsx(zj,{token:t})]});if(!p)return j?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"nc-single-overlay",children:c.jsx($_,{peer:j,token:t,onBack:()=>T(null)})}),Wn]}):b?c.jsxs(c.Fragment,{children:[c.jsx(q_,{session:b.session,node:b.node,ownerId:b.ownerId,cellName:b.cellName,token:t,readonly:ue,onBack:()=>w(null),onCellSwitcher:()=>rt(!0),cellSwitcherOpen:ht}),ht&&c.jsx(Kj,{token:t,current:b,onPick:he=>{k(he),rt(!1)},onClose:()=>rt(!1)}),Wn]}):c.jsxs(c.Fragment,{children:[c.jsx(Kx,{onPick:k,token:t,onSettings:at,onOpenVlSession:T}),Wn]});const ui=y||!me;return c.jsxs("div",{className:"nc-workspace",children:[ui&&c.jsx(QE,{sessions:C,cells:E,activeSessions:U,nodeGroups:L,fleetCapabilities:O,bootSettlement:A,onBootSettlementApplied:Ee,localNodeId:W.localNodeId,onPick:I,onAddTile:le,onPower:D,onBoot:Le,onBootError:he=>W.setError(String((he==null?void 0:he.message)||he)),onNodePower:tt,onNodeRename:ot,onKill:de,onVisibility:ge,onNew:()=>at("fleet",!0),onSettings:at,onOpenVlSession:T,width:fe,collapsed:$e,onResize:we,onToggleCollapse:()=>dt(he=>!he)}),c.jsxs("div",{className:"nc-workspace-main",children:[c.jsx(AN,{decks:x,currentDeck:v,onCreate:ct,onRename:Ze,onDelete:Zt,onReorder:W.reorder,onOpenWindow:Qe,onNavigate:Mt,saveState:W.saveState,error:W.error,sidebarVisible:ui,onToggleSidebar:y?null:()=>be(he=>!he)}),c.jsx(sN,{layout:Y,onLayoutChange:z,token:t,readonly:ue,sessionsAlive:te,focusSession:Z,onFocus:G,onOpenSingle:I,decks:x,currentDeck:v,onSendToDeck:ni,cells:E,nodeGroups:L})]}),j&&c.jsx("div",{className:"nc-single-overlay",children:c.jsx($_,{peer:j,token:t,onBack:()=>T(null)})}),Q&&c.jsx("div",{className:"nc-single-overlay",children:c.jsx(q_,{session:Q.session,node:Q.node,ownerId:Q.ownerId,cellName:Cf({session:Q.session,node:Q.node,ownerId:Q.ownerId,cells:E,nodeGroups:L}),token:t,readonly:ue,onBack:()=>B(null)})}),M&&c.jsx(Bl,{cell:M,token:t,route:Array.isArray(M.route)?M.route:[],onConfirm:_e,onClose:()=>D(null)}),Wn]})}function dR(){kn();const e=N.useSyncExternalStore(Jj,H_,H_);if(!e.needed)return null;const t=e.kind==="install"?f("install-version-mismatch").replace("{v}",e.version):f("update-available").replace("{v}",e.version).replace(" "," ").trim();return c.jsxs("div",{className:"nc-update",role:"status","aria-live":"polite",children:[c.jsx("span",{className:"nc-update-msg",children:t}),e.kind==="reload"&&c.jsx("button",{className:"nc-update-btn",onClick:nR,children:f("reload")})]})}tR();p0.createRoot(document.getElementById("root")).render(c.jsxs(a0.StrictMode,{children:[c.jsx(uR,{}),c.jsx(dR,{})]}));
|