@claudecam/dashboard 0.1.5 → 0.1.7
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/dist/assets/{howler-CzrxH3Wg.js → howler-BY4p9zcX.js} +2 -2
- package/dist/assets/{howler-CzrxH3Wg.js.map → howler-BY4p9zcX.js.map} +1 -1
- package/dist/assets/{index-CZU3kiy9.js → index-CPeO9TMq.js} +5 -5
- package/dist/assets/{index-CZU3kiy9.js.map → index-CPeO9TMq.js.map} +1 -1
- package/dist/index.html +1 -1
- package/package.json +13 -12
|
@@ -46,7 +46,7 @@ var SEe=Object.defineProperty;var AEe=(e,t,i)=>t in e?SEe(e,t,{enumerable:!0,con
|
|
|
46
46
|
`+Ie[D].replace(" at new "," at ");return p.displayName&&St.includes("<anonymous>")&&(St=St.replace("<anonymous>",p.displayName)),St}while(1<=D&&0<=k);break}}}finally{Re=!1,Error.prepareStackTrace=A}return(A=p?p.displayName||p.name:"")?Pe(A):""}function He(p,v){switch(p.tag){case 26:case 27:case 5:return Pe(p.type);case 16:return Pe("Lazy");case 13:return p.child!==v&&v!==null?Pe("Suspense Fallback"):Pe("Suspense");case 19:return Pe("SuspenseList");case 0:case 15:return ze(p.type,!1);case 11:return ze(p.type.render,!1);case 1:return ze(p.type,!0);case 31:return Pe("Activity");default:return""}}function de(p){try{var v="",A=null;do v+=He(p,A),A=p,p=p.return;while(p);return v}catch(D){return`
|
|
47
47
|
Error generating stack: `+D.message+`
|
|
48
48
|
`+D.stack}}var et=Object.prototype.hasOwnProperty,ut=e.unstable_scheduleCallback,vt=e.unstable_cancelCallback,fe=e.unstable_shouldYield,q=e.unstable_requestPaint,K=e.unstable_now,be=e.unstable_getCurrentPriorityLevel,ie=e.unstable_ImmediatePriority,Be=e.unstable_UserBlockingPriority,Ue=e.unstable_NormalPriority,nt=e.unstable_LowPriority,Oe=e.unstable_IdlePriority,_t=e.log,bt=e.unstable_setDisableYieldValue,Qe=null,rt=null;function wt(p){if(typeof _t=="function"&&bt(p),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(Qe,p)}catch{}}var xt=Math.clz32?Math.clz32:ue,Rt=Math.log,ai=Math.LN2;function ue(p){return p>>>=0,p===0?32:31-(Rt(p)/ai|0)|0}var ke=256,je=262144,ct=4194304;function at(p){var v=p&42;if(v!==0)return v;switch(p&-p){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return p&261888;case 262144:case 524288:case 1048576:case 2097152:return p&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return p&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return p}}function $e(p,v,A){var D=p.pendingLanes;if(D===0)return 0;var k=0,B=p.suspendedLanes,te=p.pingedLanes;p=p.warmLanes;var ye=D&134217727;return ye!==0?(D=ye&~B,D!==0?k=at(D):(te&=ye,te!==0?k=at(te):A||(A=ye&~p,A!==0&&(k=at(A))))):(ye=D&~B,ye!==0?k=at(ye):te!==0?k=at(te):A||(A=D&~p,A!==0&&(k=at(A)))),k===0?0:v!==0&&v!==k&&(v&B)===0&&(B=k&-k,A=v&-v,B>=A||B===32&&(A&4194048)!==0)?v:k}function Lt(p,v){return(p.pendingLanes&~(p.suspendedLanes&~p.pingedLanes)&v)===0}function ri(p,v){switch(p){case 1:case 2:case 4:case 8:case 64:return v+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return v+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Wi(){var p=ct;return ct<<=1,(ct&62914560)===0&&(ct=4194304),p}function di(p){for(var v=[],A=0;31>A;A++)v.push(p);return v}function pn(p,v){p.pendingLanes|=v,v!==268435456&&(p.suspendedLanes=0,p.pingedLanes=0,p.warmLanes=0)}function sn(p,v,A,D,k,B){var te=p.pendingLanes;p.pendingLanes=A,p.suspendedLanes=0,p.pingedLanes=0,p.warmLanes=0,p.expiredLanes&=A,p.entangledLanes&=A,p.errorRecoveryDisabledLanes&=A,p.shellSuspendCounter=0;var ye=p.entanglements,Ie=p.expirationTimes,it=p.hiddenUpdates;for(A=te&~A;0<A;){var St=31-xt(A),Ct=1<<St;ye[St]=0,Ie[St]=-1;var ot=it[St];if(ot!==null)for(it[St]=null,St=0;St<ot.length;St++){var gt=ot[St];gt!==null&&(gt.lane&=-536870913)}A&=~Ct}D!==0&&no(p,D,0),B!==0&&k===0&&p.tag!==0&&(p.suspendedLanes|=B&~(te&~v))}function no(p,v,A){p.pendingLanes|=v,p.suspendedLanes&=~v;var D=31-xt(v);p.entangledLanes|=v,p.entanglements[D]=p.entanglements[D]|1073741824|A&261930}function Dl(p,v){var A=p.entangledLanes|=v;for(p=p.entanglements;A;){var D=31-xt(A),k=1<<D;k&v|p[D]&v&&(p[D]|=v),A&=~k}}function Ih(p,v){var A=v&-v;return A=(A&42)!==0?1:To(A),(A&(p.suspendedLanes|v))!==0?0:A}function To(p){switch(p){case 2:p=1;break;case 8:p=4;break;case 32:p=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:p=128;break;case 268435456:p=134217728;break;default:p=0}return p}function _e(p){return p&=-p,2<p?8<p?(p&134217727)!==0?32:268435456:8:2}function Ke(){var p=W.p;return p!==0?p:(p=window.event,p===void 0?32:uQ(p.type))}function ft(p,v){var A=W.p;try{return W.p=p,v()}finally{W.p=A}}var We=Math.random().toString(36).slice(2),lt="__reactFiber$"+We,Vt="__reactProps$"+We,fi="__reactContainer$"+We,li="__reactEvents$"+We,ii="__reactListeners$"+We,or="__reactHandles$"+We,ji="__reactResources$"+We,Si="__reactMarker$"+We;function bi(p){delete p[lt],delete p[Vt],delete p[li],delete p[ii],delete p[or]}function on(p){var v=p[lt];if(v)return v;for(var A=p.parentNode;A;){if(v=A[fi]||A[lt]){if(A=v.alternate,v.child!==null||A!==null&&A.child!==null)for(p=YK(p);p!==null;){if(A=p[lt])return A;p=YK(p)}return v}p=A,A=p.parentNode}return null}function ha(p){if(p=p[lt]||p[fi]){var v=p.tag;if(v===5||v===6||v===13||v===31||v===26||v===27||v===3)return p}return null}function hs(p){var v=p.tag;if(v===5||v===26||v===27||v===6)return p.stateNode;throw Error(r(33))}function pe(p){var v=p[ji];return v||(v=p[ji]={hoistableStyles:new Map,hoistableScripts:new Map}),v}function De(p){p[Si]=!0}var Ze=new Set,Ve={};function Ye(p,v){Nt(p,v),Nt(p+"Capture",v)}function Nt(p,v){for(Ve[p]=v,p=0;p<v.length;p++)Ze.add(v[p])}var Bt=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),kt={},re={};function le(p){return et.call(re,p)?!0:et.call(kt,p)?!1:Bt.test(p)?re[p]=!0:(kt[p]=!0,!1)}function Ae(p,v,A){if(le(v))if(A===null)p.removeAttribute(v);else{switch(typeof A){case"undefined":case"function":case"symbol":p.removeAttribute(v);return;case"boolean":var D=v.toLowerCase().slice(0,5);if(D!=="data-"&&D!=="aria-"){p.removeAttribute(v);return}}p.setAttribute(v,""+A)}}function ve(p,v,A){if(A===null)p.removeAttribute(v);else{switch(typeof A){case"undefined":case"function":case"symbol":case"boolean":p.removeAttribute(v);return}p.setAttribute(v,""+A)}}function Te(p,v,A,D){if(D===null)p.removeAttribute(A);else{switch(typeof D){case"undefined":case"function":case"symbol":case"boolean":p.removeAttribute(A);return}p.setAttributeNS(v,A,""+D)}}function pt(p){switch(typeof p){case"bigint":case"boolean":case"number":case"string":case"undefined":return p;case"object":return p;default:return""}}function Er(p){var v=p.type;return(p=p.nodeName)&&p.toLowerCase()==="input"&&(v==="checkbox"||v==="radio")}function Jr(p,v,A){var D=Object.getOwnPropertyDescriptor(p.constructor.prototype,v);if(!p.hasOwnProperty(v)&&typeof D<"u"&&typeof D.get=="function"&&typeof D.set=="function"){var k=D.get,B=D.set;return Object.defineProperty(p,v,{configurable:!0,get:function(){return k.call(this)},set:function(te){A=""+te,B.call(this,te)}}),Object.defineProperty(p,v,{enumerable:D.enumerable}),{getValue:function(){return A},setValue:function(te){A=""+te},stopTracking:function(){p._valueTracker=null,delete p[v]}}}}function pr(p){if(!p._valueTracker){var v=Er(p)?"checked":"value";p._valueTracker=Jr(p,v,""+p[v])}}function _r(p){if(!p)return!1;var v=p._valueTracker;if(!v)return!0;var A=v.getValue(),D="";return p&&(D=Er(p)?p.checked?"true":"false":p.value),p=D,p!==A?(v.setValue(p),!0):!1}function Ut(p){if(p=p||(typeof document<"u"?document:void 0),typeof p>"u")return null;try{return p.activeElement||p.body}catch{return p.body}}var da=/[\n"\\]/g;function Bi(p){return p.replace(da,function(v){return"\\"+v.charCodeAt(0).toString(16)+" "})}function ds(p,v,A,D,k,B,te,ye){p.name="",te!=null&&typeof te!="function"&&typeof te!="symbol"&&typeof te!="boolean"?p.type=te:p.removeAttribute("type"),v!=null?te==="number"?(v===0&&p.value===""||p.value!=v)&&(p.value=""+pt(v)):p.value!==""+pt(v)&&(p.value=""+pt(v)):te!=="submit"&&te!=="reset"||p.removeAttribute("value"),v!=null?$a(p,te,pt(v)):A!=null?$a(p,te,pt(A)):D!=null&&p.removeAttribute("value"),k==null&&B!=null&&(p.defaultChecked=!!B),k!=null&&(p.checked=k&&typeof k!="function"&&typeof k!="symbol"),ye!=null&&typeof ye!="function"&&typeof ye!="symbol"&&typeof ye!="boolean"?p.name=""+pt(ye):p.removeAttribute("name")}function Co(p,v,A,D,k,B,te,ye){if(B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(p.type=B),v!=null||A!=null){if(!(B!=="submit"&&B!=="reset"||v!=null)){pr(p);return}A=A!=null?""+pt(A):"",v=v!=null?""+pt(v):A,ye||v===p.value||(p.value=v),p.defaultValue=v}D=D??k,D=typeof D!="function"&&typeof D!="symbol"&&!!D,p.checked=ye?p.checked:!!D,p.defaultChecked=!!D,te!=null&&typeof te!="function"&&typeof te!="symbol"&&typeof te!="boolean"&&(p.name=te),pr(p)}function $a(p,v,A){v==="number"&&Ut(p.ownerDocument)===p||p.defaultValue===""+A||(p.defaultValue=""+A)}function ao(p,v,A,D){if(p=p.options,v){v={};for(var k=0;k<A.length;k++)v["$"+A[k]]=!0;for(A=0;A<p.length;A++)k=v.hasOwnProperty("$"+p[A].value),p[A].selected!==k&&(p[A].selected=k),k&&D&&(p[A].defaultSelected=!0)}else{for(A=""+pt(A),v=null,k=0;k<p.length;k++){if(p[k].value===A){p[k].selected=!0,D&&(p[k].defaultSelected=!0);return}v!==null||p[k].disabled||(v=p[k])}v!==null&&(v.selected=!0)}}function qr(p,v,A){if(v!=null&&(v=""+pt(v),v!==p.value&&(p.value=v),A==null)){p.defaultValue!==v&&(p.defaultValue=v);return}p.defaultValue=A!=null?""+pt(A):""}function fa(p,v,A,D){if(v==null){if(D!=null){if(A!=null)throw Error(r(92));if(G(D)){if(1<D.length)throw Error(r(93));D=D[0]}A=D}A==null&&(A=""),v=A}A=pt(v),p.defaultValue=A,D=p.textContent,D===A&&D!==""&&D!==null&&(p.value=D),pr(p)}function so(p,v){if(v){var A=p.firstChild;if(A&&A===p.lastChild&&A.nodeType===3){A.nodeValue=v;return}}p.textContent=v}var _a=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function dc(p,v,A){var D=v.indexOf("--")===0;A==null||typeof A=="boolean"||A===""?D?p.setProperty(v,""):v==="float"?p.cssFloat="":p[v]="":D?p.setProperty(v,A):typeof A!="number"||A===0||_a.has(v)?v==="float"?p.cssFloat=A:p[v]=(""+A).trim():p[v]=A+"px"}function Tu(p,v,A){if(v!=null&&typeof v!="object")throw Error(r(62));if(p=p.style,A!=null){for(var D in A)!A.hasOwnProperty(D)||v!=null&&v.hasOwnProperty(D)||(D.indexOf("--")===0?p.setProperty(D,""):D==="float"?p.cssFloat="":p[D]="");for(var k in v)D=v[k],v.hasOwnProperty(k)&&A[k]!==D&&dc(p,k,D)}else for(var B in v)v.hasOwnProperty(B)&&dc(p,B,v[B])}function mp(p){if(p.indexOf("-")===-1)return!1;switch(p){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 LD=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),RA=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function H0(p){return RA.test(""+p)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":p}function Nh(){}var Ob=null;function Rb(p){return p=p.target||p.srcElement||window,p.correspondingUseElement&&(p=p.correspondingUseElement),p.nodeType===3?p.parentNode:p}var gp=null,Nd=null;function IA(p){var v=ha(p);if(v&&(p=v.stateNode)){var A=p[Vt]||null;e:switch(p=v.stateNode,v.type){case"input":if(ds(p,A.value,A.defaultValue,A.defaultValue,A.checked,A.defaultChecked,A.type,A.name),v=A.name,A.type==="radio"&&v!=null){for(A=p;A.parentNode;)A=A.parentNode;for(A=A.querySelectorAll('input[name="'+Bi(""+v)+'"][type="radio"]'),v=0;v<A.length;v++){var D=A[v];if(D!==p&&D.form===p.form){var k=D[Vt]||null;if(!k)throw Error(r(90));ds(D,k.value,k.defaultValue,k.defaultValue,k.checked,k.defaultChecked,k.type,k.name)}}for(v=0;v<A.length;v++)D=A[v],D.form===p.form&&_r(D)}break e;case"textarea":qr(p,A.value,A.defaultValue);break e;case"select":v=A.value,v!=null&&ao(p,!!A.multiple,v,!1)}}}var Ib=!1;function NA(p,v,A){if(Ib)return p(v,A);Ib=!0;try{var D=p(v);return D}finally{if(Ib=!1,(gp!==null||Nd!==null)&&(nu(),gp&&(v=gp,p=Nd,Nd=gp=null,IA(v),p)))for(v=0;v<p.length;v++)IA(p[v])}}function dg(p,v){var A=p.stateNode;if(A===null)return null;var D=A[Vt]||null;if(D===null)return null;A=D[v];e:switch(v){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)||(p=p.type,D=!(p==="button"||p==="input"||p==="select"||p==="textarea")),p=!D;break e;default:p=!1}if(p)return null;if(A&&typeof A!="function")throw Error(r(231,v,typeof A));return A}var Cu=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),LA=!1;if(Cu)try{var fg={};Object.defineProperty(fg,"passive",{get:function(){LA=!0}}),window.addEventListener("test",fg,fg),window.removeEventListener("test",fg,fg)}catch{LA=!1}var Ol=null,Nb=null,vp=null;function G0(){if(vp)return vp;var p,v=Nb,A=v.length,D,k="value"in Ol?Ol.value:Ol.textContent,B=k.length;for(p=0;p<A&&v[p]===k[p];p++);var te=A-p;for(D=1;D<=te&&v[A-D]===k[B-D];D++);return vp=k.slice(p,1<D?1-D:void 0)}function W0(p){var v=p.keyCode;return"charCode"in p?(p=p.charCode,p===0&&v===13&&(p=13)):p=v,p===10&&(p=13),32<=p||p===13?p:0}function pg(){return!0}function kD(){return!1}function Po(p){function v(A,D,k,B,te){this._reactName=A,this._targetInst=k,this.type=D,this.nativeEvent=B,this.target=te,this.currentTarget=null;for(var ye in p)p.hasOwnProperty(ye)&&(A=p[ye],this[ye]=A?A(B):B[ye]);return this.isDefaultPrevented=(B.defaultPrevented!=null?B.defaultPrevented:B.returnValue===!1)?pg:kD,this.isPropagationStopped=kD,this}return h(v.prototype,{preventDefault:function(){this.defaultPrevented=!0;var A=this.nativeEvent;A&&(A.preventDefault?A.preventDefault():typeof A.returnValue!="unknown"&&(A.returnValue=!1),this.isDefaultPrevented=pg)},stopPropagation:function(){var A=this.nativeEvent;A&&(A.stopPropagation?A.stopPropagation():typeof A.cancelBubble!="unknown"&&(A.cancelBubble=!0),this.isPropagationStopped=pg)},persist:function(){},isPersistent:pg}),v}var Ld={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(p){return p.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},q0=Po(Ld),mg=h({},Ld,{view:0,detail:0}),zD=Po(mg),X0,Lb,gg,vg=h({},mg,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ub,button:0,buttons:0,relatedTarget:function(p){return p.relatedTarget===void 0?p.fromElement===p.srcElement?p.toElement:p.fromElement:p.relatedTarget},movementX:function(p){return"movementX"in p?p.movementX:(p!==gg&&(gg&&p.type==="mousemove"?(X0=p.screenX-gg.screenX,Lb=p.screenY-gg.screenY):Lb=X0=0,gg=p),X0)},movementY:function(p){return"movementY"in p?p.movementY:Lb}}),kA=Po(vg),BD=h({},vg,{dataTransfer:0}),UD=Po(BD),zA=h({},mg,{relatedTarget:0}),kb=Po(zA),jD=h({},Ld,{animationName:0,elapsedTime:0,pseudoElement:0}),aU=Po(jD),sU=h({},Ld,{clipboardData:function(p){return"clipboardData"in p?p.clipboardData:window.clipboardData}}),FD=Po(sU),Y0=h({},Ld,{data:0}),zb=Po(Y0),Bb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},VD={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"},HD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function BA(p){var v=this.nativeEvent;return v.getModifierState?v.getModifierState(p):(p=HD[p])?!!v[p]:!1}function Ub(){return BA}var GD=h({},mg,{key:function(p){if(p.key){var v=Bb[p.key]||p.key;if(v!=="Unidentified")return v}return p.type==="keypress"?(p=W0(p),p===13?"Enter":String.fromCharCode(p)):p.type==="keydown"||p.type==="keyup"?VD[p.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ub,charCode:function(p){return p.type==="keypress"?W0(p):0},keyCode:function(p){return p.type==="keydown"||p.type==="keyup"?p.keyCode:0},which:function(p){return p.type==="keypress"?W0(p):p.type==="keydown"||p.type==="keyup"?p.keyCode:0}}),yp=Po(GD),jb=h({},vg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),UA=Po(jb),jA=h({},mg,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ub}),WD=Po(jA),qD=h({},Ld,{propertyName:0,elapsedTime:0,pseudoElement:0}),oU=Po(qD),Ls=h({},vg,{deltaX:function(p){return"deltaX"in p?p.deltaX:"wheelDeltaX"in p?-p.wheelDeltaX:0},deltaY:function(p){return"deltaY"in p?p.deltaY:"wheelDeltaY"in p?-p.wheelDeltaY:"wheelDelta"in p?-p.wheelDelta:0},deltaZ:0,deltaMode:0}),XD=Po(Ls),YD=h({},Ld,{newState:0,oldState:0}),$D=Po(YD),KD=[9,13,27,32],xp=Cu&&"CompositionEvent"in window,yg=null;Cu&&"documentMode"in document&&(yg=document.documentMode);var Fb=Cu&&"TextEvent"in window&&!yg,FA=Cu&&(!xp||yg&&8<yg&&11>=yg),QD=" ",$0=!1;function Vb(p,v){switch(p){case"keyup":return KD.indexOf(v.keyCode)!==-1;case"keydown":return v.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function VA(p){return p=p.detail,typeof p=="object"&&"data"in p?p.data:null}var bp=!1;function ZD(p,v){switch(p){case"compositionend":return VA(v);case"keypress":return v.which!==32?null:($0=!0,QD);case"textInput":return p=v.data,p===QD&&$0?null:p;default:return null}}function HA(p,v){if(bp)return p==="compositionend"||!xp&&Vb(p,v)?(p=G0(),vp=Nb=Ol=null,bp=!1,p):null;switch(p){case"paste":return null;case"keypress":if(!(v.ctrlKey||v.altKey||v.metaKey)||v.ctrlKey&&v.altKey){if(v.char&&1<v.char.length)return v.char;if(v.which)return String.fromCharCode(v.which)}return null;case"compositionend":return FA&&v.locale!=="ko"?null:v.data;default:return null}}var GA={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 WA(p){var v=p&&p.nodeName&&p.nodeName.toLowerCase();return v==="input"?!!GA[p.type]:v==="textarea"}function Hb(p,v,A,D){gp?Nd?Nd.push(D):Nd=[D]:gp=D,v=r2(v,"onChange"),0<v.length&&(A=new q0("onChange","change",null,A,D),p.push({event:A,listeners:v}))}var kd=null,wp=null;function JD(p){NK(p,0)}function xg(p){var v=hs(p);if(_r(v))return p}function qA(p,v){if(p==="change")return v}var Pu=!1;if(Cu){var K0;if(Cu){var XA="oninput"in document;if(!XA){var YA=document.createElement("div");YA.setAttribute("oninput","return;"),XA=typeof YA.oninput=="function"}K0=XA}else K0=!1;Pu=K0&&(!document.documentMode||9<document.documentMode)}function fc(){kd&&(kd.detachEvent("onpropertychange",Q0),wp=kd=null)}function Q0(p){if(p.propertyName==="value"&&xg(wp)){var v=[];Hb(v,wp,p,Rb(p)),NA(JD,v)}}function e3(p,v,A){p==="focusin"?(fc(),kd=v,wp=A,kd.attachEvent("onpropertychange",Q0)):p==="focusout"&&fc()}function $A(p){if(p==="selectionchange"||p==="keyup"||p==="keydown")return xg(wp)}function t3(p,v){if(p==="click")return xg(v)}function i3(p,v){if(p==="input"||p==="change")return xg(v)}function KA(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var Do=typeof Object.is=="function"?Object.is:KA;function bg(p,v){if(Do(p,v))return!0;if(typeof p!="object"||p===null||typeof v!="object"||v===null)return!1;var A=Object.keys(p),D=Object.keys(v);if(A.length!==D.length)return!1;for(D=0;D<A.length;D++){var k=A[D];if(!et.call(v,k)||!Do(p[k],v[k]))return!1}return!0}function Z0(p){for(;p&&p.firstChild;)p=p.firstChild;return p}function wg(p,v){var A=Z0(p);p=0;for(var D;A;){if(A.nodeType===3){if(D=p+A.textContent.length,p<=v&&D>=v)return{node:A,offset:v-p};p=D}e:{for(;A;){if(A.nextSibling){A=A.nextSibling;break e}A=A.parentNode}A=void 0}A=Z0(A)}}function Cn(p,v){return p&&v?p===v?!0:p&&p.nodeType===3?!1:v&&v.nodeType===3?Cn(p,v.parentNode):"contains"in p?p.contains(v):p.compareDocumentPosition?!!(p.compareDocumentPosition(v)&16):!1:!1}function r3(p){p=p!=null&&p.ownerDocument!=null&&p.ownerDocument.defaultView!=null?p.ownerDocument.defaultView:window;for(var v=Ut(p.document);v instanceof p.HTMLIFrameElement;){try{var A=typeof v.contentWindow.location.href=="string"}catch{A=!1}if(A)p=v.contentWindow;else break;v=Ut(p.document)}return v}function QA(p){var v=p&&p.nodeName&&p.nodeName.toLowerCase();return v&&(v==="input"&&(p.type==="text"||p.type==="search"||p.type==="tel"||p.type==="url"||p.type==="password")||v==="textarea"||p.contentEditable==="true")}var n3=Cu&&"documentMode"in document&&11>=document.documentMode,Du=null,Ou=null,_g=null,Gb=!1;function Sg(p,v,A){var D=A.window===A?A.document:A.nodeType===9?A:A.ownerDocument;Gb||Du==null||Du!==Ut(D)||(D=Du,"selectionStart"in D&&QA(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}),_g&&bg(_g,D)||(_g=D,D=r2(Ou,"onSelect"),0<D.length&&(v=new q0("onSelect","select",null,v,A),p.push({event:v,listeners:D}),v.target=Du)))}function oo(p,v){var A={};return A[p.toLowerCase()]=v.toLowerCase(),A["Webkit"+p]="webkit"+v,A["Moz"+p]="moz"+v,A}var _p={animationend:oo("Animation","AnimationEnd"),animationiteration:oo("Animation","AnimationIteration"),animationstart:oo("Animation","AnimationStart"),transitionrun:oo("Transition","TransitionRun"),transitionstart:oo("Transition","TransitionStart"),transitioncancel:oo("Transition","TransitionCancel"),transitionend:oo("Transition","TransitionEnd")},J0={},ZA={};Cu&&(ZA=document.createElement("div").style,"AnimationEvent"in window||(delete _p.animationend.animation,delete _p.animationiteration.animation,delete _p.animationstart.animation),"TransitionEvent"in window||delete _p.transitionend.transition);function Lh(p){if(J0[p])return J0[p];if(!_p[p])return p;var v=_p[p],A;for(A in v)if(v.hasOwnProperty(A)&&A in ZA)return J0[p]=v[A];return p}var Wb=Lh("animationend"),ey=Lh("animationiteration"),JA=Lh("animationstart"),a3=Lh("transitionrun"),lU=Lh("transitionstart"),s3=Lh("transitioncancel"),eM=Lh("transitionend"),pc=new Map,ty="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ty.push("scrollEnd");function mc(p,v){pc.set(p,v),Ye(v,[p])}var iy=typeof reportError=="function"?reportError:function(p){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var v=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof p=="object"&&p!==null&&typeof p.message=="string"?String(p.message):String(p),error:p});if(!window.dispatchEvent(v))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",p);return}console.error(p)},gc=[],kh=0,fs=0;function ry(){for(var p=kh,v=fs=kh=0;v<p;){var A=gc[v];gc[v++]=null;var D=gc[v];gc[v++]=null;var k=gc[v];gc[v++]=null;var B=gc[v];if(gc[v++]=null,D!==null&&k!==null){var te=D.pending;te===null?k.next=k:(k.next=te.next,te.next=k),D.pending=k}B!==0&&zd(A,k,B)}}function ps(p,v,A,D){gc[kh++]=p,gc[kh++]=v,gc[kh++]=A,gc[kh++]=D,fs|=D,p.lanes|=D,p=p.alternate,p!==null&&(p.lanes|=D)}function qb(p,v,A,D){return ps(p,v,A,D),vc(p)}function Oo(p,v){return ps(p,null,null,v),vc(p)}function zd(p,v,A){p.lanes|=A;var D=p.alternate;D!==null&&(D.lanes|=A);for(var k=!1,B=p.return;B!==null;)B.childLanes|=A,D=B.alternate,D!==null&&(D.childLanes|=A),B.tag===22&&(p=B.stateNode,p===null||p._visibility&1||(k=!0)),p=B,B=B.return;return p.tag===3?(B=p.stateNode,k&&v!==null&&(k=31-xt(A),p=B.hiddenUpdates,D=p[k],D===null?p[k]=[v]:D.push(v),v.lane=A|536870912),B):null}function vc(p){if(50<rf)throw rf=0,Fp=null,Error(r(185));for(var v=p.return;v!==null;)p=v,v=p.return;return p.tag===3?p.stateNode:null}var Bd={};function tM(p,v,A,D){this.tag=p,this.key=A,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=v,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 Zn(p,v,A,D){return new tM(p,v,A,D)}function Xb(p){return p=p.prototype,!(!p||!p.isReactComponent)}function tl(p,v){var A=p.alternate;return A===null?(A=Zn(p.tag,v,p.key,p.mode),A.elementType=p.elementType,A.type=p.type,A.stateNode=p.stateNode,A.alternate=p,p.alternate=A):(A.pendingProps=v,A.type=p.type,A.flags=0,A.subtreeFlags=0,A.deletions=null),A.flags=p.flags&65011712,A.childLanes=p.childLanes,A.lanes=p.lanes,A.child=p.child,A.memoizedProps=p.memoizedProps,A.memoizedState=p.memoizedState,A.updateQueue=p.updateQueue,v=p.dependencies,A.dependencies=v===null?null:{lanes:v.lanes,firstContext:v.firstContext},A.sibling=p.sibling,A.index=p.index,A.ref=p.ref,A.refCleanup=p.refCleanup,A}function Ag(p,v){p.flags&=65011714;var A=p.alternate;return A===null?(p.childLanes=0,p.lanes=v,p.child=null,p.subtreeFlags=0,p.memoizedProps=null,p.memoizedState=null,p.updateQueue=null,p.dependencies=null,p.stateNode=null):(p.childLanes=A.childLanes,p.lanes=A.lanes,p.child=A.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=A.memoizedProps,p.memoizedState=A.memoizedState,p.updateQueue=A.updateQueue,p.type=A.type,v=A.dependencies,p.dependencies=v===null?null:{lanes:v.lanes,firstContext:v.firstContext}),p}function Ru(p,v,A,D,k,B){var te=0;if(D=p,typeof p=="function")Xb(p)&&(te=1);else if(typeof p=="string")te=hEe(p,A,oe.current)?26:p==="html"||p==="head"||p==="body"?27:5;else e:switch(p){case I:return p=Zn(31,A,v,k),p.elementType=I,p.lanes=B,p;case y:return Ud(A.children,k,B,v);case g:te=8,k|=24;break;case x:return p=Zn(12,A,v,k|2),p.elementType=x,p.lanes=B,p;case E:return p=Zn(13,A,v,k),p.elementType=E,p.lanes=B,p;case T:return p=Zn(19,A,v,k),p.elementType=T,p.lanes=B,p;default:if(typeof p=="object"&&p!==null)switch(p.$$typeof){case S:te=10;break e;case w:te=9;break e;case M:te=11;break e;case R:te=14;break e;case P:te=16,D=null;break e}te=29,A=Error(r(130,p===null?"null":typeof p,"")),D=null}return v=Zn(te,A,v,k),v.elementType=p,v.type=D,v.lanes=B,v}function Ud(p,v,A,D){return p=Zn(7,p,D,v),p.lanes=A,p}function Yb(p,v,A){return p=Zn(6,p,null,v),p.lanes=A,p}function Mg(p){var v=Zn(18,null,null,0);return v.stateNode=p,v}function $b(p,v,A){return v=Zn(4,p.children!==null?p.children:[],p.key,v),v.lanes=A,v.stateNode={containerInfo:p.containerInfo,pendingChildren:null,implementation:p.implementation},v}var ny=new WeakMap;function Rl(p,v){if(typeof p=="object"&&p!==null){var A=ny.get(p);return A!==void 0?A:(v={value:p,source:v,stack:de(v)},ny.set(p,v),v)}return{value:p,source:v,stack:de(v)}}var jd=[],Fd=0,Eg=null,Tg=0,il=[],Gn=0,zh=null,Jn=1,eu="";function Iu(p,v){jd[Fd++]=Tg,jd[Fd++]=Eg,Eg=p,Tg=v}function o3(p,v,A){il[Gn++]=Jn,il[Gn++]=eu,il[Gn++]=zh,zh=p;var D=Jn;p=eu;var k=32-xt(D)-1;D&=~(1<<k),A+=1;var B=32-xt(v)+k;if(30<B){var te=k-k%5;B=(D&(1<<te)-1).toString(32),D>>=te,k-=te,Jn=1<<32-xt(v)+k|A<<k|D,eu=B+p}else Jn=1<<B|A<<k|D,eu=p}function Nu(p){p.return!==null&&(Iu(p,1),o3(p,1,0))}function Kb(p){for(;p===Eg;)Eg=jd[--Fd],jd[Fd]=null,Tg=jd[--Fd],jd[Fd]=null;for(;p===zh;)zh=il[--Gn],il[Gn]=null,eu=il[--Gn],il[Gn]=null,Jn=il[--Gn],il[Gn]=null}function Qb(p,v){il[Gn++]=Jn,il[Gn++]=eu,il[Gn++]=zh,Jn=v.id,eu=v.overflow,zh=p}var pa=null,Pn=null,Tr=!1,Bh=null,Il=!1,Cg=Error(r(519));function Lu(p){var v=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ku(Rl(v,p)),Cg}function l3(p){var v=p.stateNode,A=p.type,D=p.memoizedProps;switch(v[lt]=p,v[Vt]=D,A){case"dialog":Rr("cancel",v),Rr("close",v);break;case"iframe":case"object":case"embed":Rr("load",v);break;case"video":case"audio":for(A=0;A<Dc.length;A++)Rr(Dc[A],v);break;case"source":Rr("error",v);break;case"img":case"image":case"link":Rr("error",v),Rr("load",v);break;case"details":Rr("toggle",v);break;case"input":Rr("invalid",v),Co(v,D.value,D.defaultValue,D.checked,D.defaultChecked,D.type,D.name,!0);break;case"select":Rr("invalid",v);break;case"textarea":Rr("invalid",v),fa(v,D.value,D.defaultValue,D.children)}A=D.children,typeof A!="string"&&typeof A!="number"&&typeof A!="bigint"||v.textContent===""+A||D.suppressHydrationWarning===!0||BK(v.textContent,A)?(D.popover!=null&&(Rr("beforetoggle",v),Rr("toggle",v)),D.onScroll!=null&&Rr("scroll",v),D.onScrollEnd!=null&&Rr("scrollend",v),D.onClick!=null&&(v.onclick=Nh),v=!0):v=!1,v||Lu(p,!0)}function c3(p){for(pa=p.return;pa;)switch(pa.tag){case 5:case 31:case 13:Il=!1;return;case 27:case 3:Il=!0;return;default:pa=pa.return}}function Pg(p){if(p!==pa)return!1;if(!Tr)return c3(p),Tr=!0,!1;var v=p.tag,A;if((A=v!==3&&v!==27)&&((A=v===5)&&(A=p.type,A=!(A!=="form"&&A!=="button")||AU(p.type,p.memoizedProps)),A=!A),A&&Pn&&Lu(p),c3(p),v===13){if(p=p.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));Pn=XK(p)}else if(v===31){if(p=p.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));Pn=XK(p)}else v===27?(v=Pn,$g(p.type)?(p=PU,PU=null,Pn=p):Pn=v):Pn=pa?Ku(p.stateNode.nextSibling):null;return!0}function Vd(){Pn=pa=null,Tr=!1}function Zb(){var p=Bh;return p!==null&&(ga===null?ga=p:ga.push.apply(ga,p),Bh=null),p}function ku(p){Bh===null?Bh=[p]:Bh.push(p)}var Dg=$(null),Hd=null,zu=null;function Uh(p,v,A){ae(Dg,v._currentValue),v._currentValue=A}function Bu(p){p._currentValue=Dg.current,J(Dg)}function Jb(p,v,A){for(;p!==null;){var D=p.alternate;if((p.childLanes&v)!==v?(p.childLanes|=v,D!==null&&(D.childLanes|=v)):D!==null&&(D.childLanes&v)!==v&&(D.childLanes|=v),p===A)break;p=p.return}}function e1(p,v,A,D){var k=p.child;for(k!==null&&(k.return=p);k!==null;){var B=k.dependencies;if(B!==null){var te=k.child;B=B.firstContext;e:for(;B!==null;){var ye=B;B=k;for(var Ie=0;Ie<v.length;Ie++)if(ye.context===v[Ie]){B.lanes|=A,ye=B.alternate,ye!==null&&(ye.lanes|=A),Jb(B.return,A,p),D||(te=null);break e}B=ye.next}}else if(k.tag===18){if(te=k.return,te===null)throw Error(r(341));te.lanes|=A,B=te.alternate,B!==null&&(B.lanes|=A),Jb(te,A,p),te=null}else te=k.child;if(te!==null)te.return=k;else for(te=k;te!==null;){if(te===p){te=null;break}if(k=te.sibling,k!==null){k.return=te.return,te=k;break}te=te.return}k=te}}function Uu(p,v,A,D){p=null;for(var k=v,B=!1;k!==null;){if(!B){if((k.flags&524288)!==0)B=!0;else if((k.flags&262144)!==0)break}if(k.tag===10){var te=k.alternate;if(te===null)throw Error(r(387));if(te=te.memoizedProps,te!==null){var ye=k.type;Do(k.pendingProps.value,te.value)||(p!==null?p.push(ye):p=[ye])}}else if(k===ce.current){if(te=k.alternate,te===null)throw Error(r(387));te.memoizedState.memoizedState!==k.memoizedState.memoizedState&&(p!==null?p.push(ZM):p=[ZM])}k=k.return}p!==null&&e1(v,p,A,D),v.flags|=262144}function ay(p){for(p=p.firstContext;p!==null;){if(!Do(p.context._currentValue,p.memoizedValue))return!0;p=p.next}return!1}function Gd(p){Hd=p,zu=null,p=p.dependencies,p!==null&&(p.firstContext=null)}function Fi(p){return u3(Hd,p)}function Og(p,v){return Hd===null&&Gd(p),u3(p,v)}function u3(p,v){var A=v._currentValue;if(v={context:v,memoizedValue:A,next:null},zu===null){if(p===null)throw Error(r(308));zu=v,p.dependencies={lanes:0,firstContext:v},p.flags|=524288}else zu=zu.next=v;return A}var h3=typeof AbortController<"u"?AbortController:function(){var p=[],v=this.signal={aborted:!1,addEventListener:function(A,D){p.push(D)}};this.abort=function(){v.aborted=!0,p.forEach(function(A){return A()})}},cU=e.unstable_scheduleCallback,uU=e.unstable_NormalPriority,Na={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function iM(){return{controller:new h3,data:new Map,refCount:0}}function Sp(p){p.refCount--,p.refCount===0&&cU(uU,function(){p.controller.abort()})}var Nl=null,t1=0,jh=0,yc=null;function rM(p,v){if(Nl===null){var A=Nl=[];t1=0,jh=ht(),yc={status:"pending",value:void 0,then:function(D){A.push(D)}}}return t1++,v.then(nM,nM),v}function nM(){if(--t1===0&&Nl!==null){yc!==null&&(yc.status="fulfilled");var p=Nl;Nl=null,jh=0,yc=null;for(var v=0;v<p.length;v++)(0,p[v])()}}function aM(p,v){var A=[],D={status:"pending",value:null,reason:null,then:function(k){A.push(k)}};return p.then(function(){D.status="fulfilled",D.value=v;for(var k=0;k<A.length;k++)(0,A[k])(v)},function(k){for(D.status="rejected",D.reason=k,k=0;k<A.length;k++)(0,A[k])(void 0)}),D}var d3=H.S;H.S=function(p,v){qM=K(),typeof v=="object"&&v!==null&&typeof v.then=="function"&&rM(p,v),d3!==null&&d3(p,v)};var Wd=$(null);function i1(){var p=Wd.current;return p!==null?p:qi.pooledCache}function sy(p,v){v===null?ae(Wd,Wd.current):ae(Wd,v.pool)}function sM(){var p=i1();return p===null?null:{parent:Na._currentValue,pool:p}}var Ap=Error(r(460)),oy=Error(r(474)),ur=Error(r(542)),r1={then:function(){}};function rl(p){return p=p.status,p==="fulfilled"||p==="rejected"}function n1(p,v,A){switch(A=p[A],A===void 0?p.push(v):A!==v&&(v.then(Nh,Nh),v=A),v.status){case"fulfilled":return v.value;case"rejected":throw p=v.reason,Tp(p),p;default:if(typeof v.status=="string")v.then(Nh,Nh);else{if(p=qi,p!==null&&100<p.shellSuspendCounter)throw Error(r(482));p=v,p.status="pending",p.then(function(D){if(v.status==="pending"){var k=v;k.status="fulfilled",k.value=D}},function(D){if(v.status==="pending"){var k=v;k.status="rejected",k.reason=D}})}switch(v.status){case"fulfilled":return v.value;case"rejected":throw p=v.reason,Tp(p),p}throw ju=v,Ap}}function Mp(p){try{var v=p._init;return v(p._payload)}catch(A){throw A!==null&&typeof A=="object"&&typeof A.then=="function"?(ju=A,Ap):A}}var ju=null;function Ep(){if(ju===null)throw Error(r(459));var p=ju;return ju=null,p}function Tp(p){if(p===Ap||p===ur)throw Error(r(483))}var Cp=null,Pp=0;function ly(p){var v=Pp;return Pp+=1,Cp===null&&(Cp=[]),n1(Cp,p,v)}function xc(p,v){v=v.props.ref,p.ref=v!==void 0?v:null}function Rg(p,v){throw v.$$typeof===d?Error(r(525)):(p=Object.prototype.toString.call(v),Error(r(31,p==="[object Object]"?"object with keys {"+Object.keys(v).join(", ")+"}":p)))}function a1(p){function v(qe,Fe){if(p){var tt=qe.deletions;tt===null?(qe.deletions=[Fe],qe.flags|=16):tt.push(Fe)}}function A(qe,Fe){if(!p)return null;for(;Fe!==null;)v(qe,Fe),Fe=Fe.sibling;return null}function D(qe){for(var Fe=new Map;qe!==null;)qe.key!==null?Fe.set(qe.key,qe):Fe.set(qe.index,qe),qe=qe.sibling;return Fe}function k(qe,Fe){return qe=tl(qe,Fe),qe.index=0,qe.sibling=null,qe}function B(qe,Fe,tt){return qe.index=tt,p?(tt=qe.alternate,tt!==null?(tt=tt.index,tt<Fe?(qe.flags|=67108866,Fe):tt):(qe.flags|=67108866,Fe)):(qe.flags|=1048576,Fe)}function te(qe){return p&&qe.alternate===null&&(qe.flags|=67108866),qe}function ye(qe,Fe,tt,Et){return Fe===null||Fe.tag!==6?(Fe=Yb(tt,qe.mode,Et),Fe.return=qe,Fe):(Fe=k(Fe,tt),Fe.return=qe,Fe)}function Ie(qe,Fe,tt,Et){var Mi=tt.type;return Mi===y?St(qe,Fe,tt.props.children,Et,tt.key):Fe!==null&&(Fe.elementType===Mi||typeof Mi=="object"&&Mi!==null&&Mi.$$typeof===P&&Mp(Mi)===Fe.type)?(Fe=k(Fe,tt.props),xc(Fe,tt),Fe.return=qe,Fe):(Fe=Ru(tt.type,tt.key,tt.props,null,qe.mode,Et),xc(Fe,tt),Fe.return=qe,Fe)}function it(qe,Fe,tt,Et){return Fe===null||Fe.tag!==4||Fe.stateNode.containerInfo!==tt.containerInfo||Fe.stateNode.implementation!==tt.implementation?(Fe=$b(tt,qe.mode,Et),Fe.return=qe,Fe):(Fe=k(Fe,tt.children||[]),Fe.return=qe,Fe)}function St(qe,Fe,tt,Et,Mi){return Fe===null||Fe.tag!==7?(Fe=Ud(tt,qe.mode,Et,Mi),Fe.return=qe,Fe):(Fe=k(Fe,tt),Fe.return=qe,Fe)}function Ct(qe,Fe,tt){if(typeof Fe=="string"&&Fe!==""||typeof Fe=="number"||typeof Fe=="bigint")return Fe=Yb(""+Fe,qe.mode,tt),Fe.return=qe,Fe;if(typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case f:return tt=Ru(Fe.type,Fe.key,Fe.props,null,qe.mode,tt),xc(tt,Fe),tt.return=qe,tt;case m:return Fe=$b(Fe,qe.mode,tt),Fe.return=qe,Fe;case P:return Fe=Mp(Fe),Ct(qe,Fe,tt)}if(G(Fe)||U(Fe))return Fe=Ud(Fe,qe.mode,tt,null),Fe.return=qe,Fe;if(typeof Fe.then=="function")return Ct(qe,ly(Fe),tt);if(Fe.$$typeof===S)return Ct(qe,Og(qe,Fe),tt);Rg(qe,Fe)}return null}function ot(qe,Fe,tt,Et){var Mi=Fe!==null?Fe.key:null;if(typeof tt=="string"&&tt!==""||typeof tt=="number"||typeof tt=="bigint")return Mi!==null?null:ye(qe,Fe,""+tt,Et);if(typeof tt=="object"&&tt!==null){switch(tt.$$typeof){case f:return tt.key===Mi?Ie(qe,Fe,tt,Et):null;case m:return tt.key===Mi?it(qe,Fe,tt,Et):null;case P:return tt=Mp(tt),ot(qe,Fe,tt,Et)}if(G(tt)||U(tt))return Mi!==null?null:St(qe,Fe,tt,Et,null);if(typeof tt.then=="function")return ot(qe,Fe,ly(tt),Et);if(tt.$$typeof===S)return ot(qe,Fe,Og(qe,tt),Et);Rg(qe,tt)}return null}function gt(qe,Fe,tt,Et,Mi){if(typeof Et=="string"&&Et!==""||typeof Et=="number"||typeof Et=="bigint")return qe=qe.get(tt)||null,ye(Fe,qe,""+Et,Mi);if(typeof Et=="object"&&Et!==null){switch(Et.$$typeof){case f:return qe=qe.get(Et.key===null?tt:Et.key)||null,Ie(Fe,qe,Et,Mi);case m:return qe=qe.get(Et.key===null?tt:Et.key)||null,it(Fe,qe,Et,Mi);case P:return Et=Mp(Et),gt(qe,Fe,tt,Et,Mi)}if(G(Et)||U(Et))return qe=qe.get(tt)||null,St(Fe,qe,Et,Mi,null);if(typeof Et.then=="function")return gt(qe,Fe,tt,ly(Et),Mi);if(Et.$$typeof===S)return gt(qe,Fe,tt,Og(Fe,Et),Mi);Rg(Fe,Et)}return null}function ci(qe,Fe,tt,Et){for(var Mi=null,en=null,mi=Fe,mr=Fe=0,kr=null;mi!==null&&mr<tt.length;mr++){mi.index>mr?(kr=mi,mi=null):kr=mi.sibling;var tn=ot(qe,mi,tt[mr],Et);if(tn===null){mi===null&&(mi=kr);break}p&&mi&&tn.alternate===null&&v(qe,mi),Fe=B(tn,Fe,mr),en===null?Mi=tn:en.sibling=tn,en=tn,mi=kr}if(mr===tt.length)return A(qe,mi),Tr&&Iu(qe,mr),Mi;if(mi===null){for(;mr<tt.length;mr++)mi=Ct(qe,tt[mr],Et),mi!==null&&(Fe=B(mi,Fe,mr),en===null?Mi=mi:en.sibling=mi,en=mi);return Tr&&Iu(qe,mr),Mi}for(mi=D(mi);mr<tt.length;mr++)kr=gt(mi,qe,mr,tt[mr],Et),kr!==null&&(p&&kr.alternate!==null&&mi.delete(kr.key===null?mr:kr.key),Fe=B(kr,Fe,mr),en===null?Mi=kr:en.sibling=kr,en=kr);return p&&mi.forEach(function(ev){return v(qe,ev)}),Tr&&Iu(qe,mr),Mi}function Ui(qe,Fe,tt,Et){if(tt==null)throw Error(r(151));for(var Mi=null,en=null,mi=Fe,mr=Fe=0,kr=null,tn=tt.next();mi!==null&&!tn.done;mr++,tn=tt.next()){mi.index>mr?(kr=mi,mi=null):kr=mi.sibling;var ev=ot(qe,mi,tn.value,Et);if(ev===null){mi===null&&(mi=kr);break}p&&mi&&ev.alternate===null&&v(qe,mi),Fe=B(ev,Fe,mr),en===null?Mi=ev:en.sibling=ev,en=ev,mi=kr}if(tn.done)return A(qe,mi),Tr&&Iu(qe,mr),Mi;if(mi===null){for(;!tn.done;mr++,tn=tt.next())tn=Ct(qe,tn.value,Et),tn!==null&&(Fe=B(tn,Fe,mr),en===null?Mi=tn:en.sibling=tn,en=tn);return Tr&&Iu(qe,mr),Mi}for(mi=D(mi);!tn.done;mr++,tn=tt.next())tn=gt(mi,qe,mr,tn.value,Et),tn!==null&&(p&&tn.alternate!==null&&mi.delete(tn.key===null?mr:tn.key),Fe=B(tn,Fe,mr),en===null?Mi=tn:en.sibling=tn,en=tn);return p&&mi.forEach(function(_Ee){return v(qe,_Ee)}),Tr&&Iu(qe,mr),Mi}function Rn(qe,Fe,tt,Et){if(typeof tt=="object"&&tt!==null&&tt.type===y&&tt.key===null&&(tt=tt.props.children),typeof tt=="object"&&tt!==null){switch(tt.$$typeof){case f:e:{for(var Mi=tt.key;Fe!==null;){if(Fe.key===Mi){if(Mi=tt.type,Mi===y){if(Fe.tag===7){A(qe,Fe.sibling),Et=k(Fe,tt.props.children),Et.return=qe,qe=Et;break e}}else if(Fe.elementType===Mi||typeof Mi=="object"&&Mi!==null&&Mi.$$typeof===P&&Mp(Mi)===Fe.type){A(qe,Fe.sibling),Et=k(Fe,tt.props),xc(Et,tt),Et.return=qe,qe=Et;break e}A(qe,Fe);break}else v(qe,Fe);Fe=Fe.sibling}tt.type===y?(Et=Ud(tt.props.children,qe.mode,Et,tt.key),Et.return=qe,qe=Et):(Et=Ru(tt.type,tt.key,tt.props,null,qe.mode,Et),xc(Et,tt),Et.return=qe,qe=Et)}return te(qe);case m:e:{for(Mi=tt.key;Fe!==null;){if(Fe.key===Mi)if(Fe.tag===4&&Fe.stateNode.containerInfo===tt.containerInfo&&Fe.stateNode.implementation===tt.implementation){A(qe,Fe.sibling),Et=k(Fe,tt.children||[]),Et.return=qe,qe=Et;break e}else{A(qe,Fe);break}else v(qe,Fe);Fe=Fe.sibling}Et=$b(tt,qe.mode,Et),Et.return=qe,qe=Et}return te(qe);case P:return tt=Mp(tt),Rn(qe,Fe,tt,Et)}if(G(tt))return ci(qe,Fe,tt,Et);if(U(tt)){if(Mi=U(tt),typeof Mi!="function")throw Error(r(150));return tt=Mi.call(tt),Ui(qe,Fe,tt,Et)}if(typeof tt.then=="function")return Rn(qe,Fe,ly(tt),Et);if(tt.$$typeof===S)return Rn(qe,Fe,Og(qe,tt),Et);Rg(qe,tt)}return typeof tt=="string"&&tt!==""||typeof tt=="number"||typeof tt=="bigint"?(tt=""+tt,Fe!==null&&Fe.tag===6?(A(qe,Fe.sibling),Et=k(Fe,tt),Et.return=qe,qe=Et):(A(qe,Fe),Et=Yb(tt,qe.mode,Et),Et.return=qe,qe=Et),te(qe)):A(qe,Fe)}return function(qe,Fe,tt,Et){try{Pp=0;var Mi=Rn(qe,Fe,tt,Et);return Cp=null,Mi}catch(mi){if(mi===Ap||mi===ur)throw mi;var en=Zn(29,mi,null,qe.mode);return en.lanes=Et,en.return=qe,en}finally{}}}var Fh=a1(!0),s1=a1(!1),Ro=!1;function cy(p){p.updateQueue={baseState:p.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function oM(p,v){p=p.updateQueue,v.updateQueue===p&&(v.updateQueue={baseState:p.baseState,firstBaseUpdate:p.firstBaseUpdate,lastBaseUpdate:p.lastBaseUpdate,shared:p.shared,callbacks:null})}function Vh(p){return{lane:p,tag:0,payload:null,callback:null,next:null}}function qd(p,v,A){var D=p.updateQueue;if(D===null)return null;if(D=D.shared,(vi&2)!==0){var k=D.pending;return k===null?v.next=v:(v.next=k.next,k.next=v),D.pending=v,v=vc(p),zd(p,null,A),v}return ps(p,D,v,A),vc(p)}function Xd(p,v,A){if(v=v.updateQueue,v!==null&&(v=v.shared,(A&4194048)!==0)){var D=v.lanes;D&=p.pendingLanes,A|=D,v.lanes=A,Dl(p,A)}}function Ai(p,v){var A=p.updateQueue,D=p.alternate;if(D!==null&&(D=D.updateQueue,A===D)){var k=null,B=null;if(A=A.firstBaseUpdate,A!==null){do{var te={lane:A.lane,tag:A.tag,payload:A.payload,callback:null,next:null};B===null?k=B=te:B=B.next=te,A=A.next}while(A!==null);B===null?k=B=v:B=B.next=v}else k=B=v;A={baseState:D.baseState,firstBaseUpdate:k,lastBaseUpdate:B,shared:D.shared,callbacks:D.callbacks},p.updateQueue=A;return}p=A.lastBaseUpdate,p===null?A.firstBaseUpdate=v:p.next=v,A.lastBaseUpdate=v}var lM=!1;function uy(){if(lM){var p=yc;if(p!==null)throw p}}function Ig(p,v,A,D){lM=!1;var k=p.updateQueue;Ro=!1;var B=k.firstBaseUpdate,te=k.lastBaseUpdate,ye=k.shared.pending;if(ye!==null){k.shared.pending=null;var Ie=ye,it=Ie.next;Ie.next=null,te===null?B=it:te.next=it,te=Ie;var St=p.alternate;St!==null&&(St=St.updateQueue,ye=St.lastBaseUpdate,ye!==te&&(ye===null?St.firstBaseUpdate=it:ye.next=it,St.lastBaseUpdate=Ie))}if(B!==null){var Ct=k.baseState;te=0,St=it=Ie=null,ye=B;do{var ot=ye.lane&-536870913,gt=ot!==ye.lane;if(gt?(lr&ot)===ot:(D&ot)===ot){ot!==0&&ot===jh&&(lM=!0),St!==null&&(St=St.next={lane:0,tag:ye.tag,payload:ye.payload,callback:null,next:null});e:{var ci=p,Ui=ye;ot=v;var Rn=A;switch(Ui.tag){case 1:if(ci=Ui.payload,typeof ci=="function"){Ct=ci.call(Rn,Ct,ot);break e}Ct=ci;break e;case 3:ci.flags=ci.flags&-65537|128;case 0:if(ci=Ui.payload,ot=typeof ci=="function"?ci.call(Rn,Ct,ot):ci,ot==null)break e;Ct=h({},Ct,ot);break e;case 2:Ro=!0}}ot=ye.callback,ot!==null&&(p.flags|=64,gt&&(p.flags|=8192),gt=k.callbacks,gt===null?k.callbacks=[ot]:gt.push(ot))}else gt={lane:ot,tag:ye.tag,payload:ye.payload,callback:ye.callback,next:null},St===null?(it=St=gt,Ie=Ct):St=St.next=gt,te|=ot;if(ye=ye.next,ye===null){if(ye=k.shared.pending,ye===null)break;gt=ye,ye=gt.next,gt.next=null,k.lastBaseUpdate=gt,k.shared.pending=null}}while(!0);St===null&&(Ie=Ct),k.baseState=Ie,k.firstBaseUpdate=it,k.lastBaseUpdate=St,B===null&&(k.shared.lanes=0),Xu|=te,p.lanes=te,p.memoizedState=Ct}}function Ng(p,v){if(typeof p!="function")throw Error(r(191,p));p.call(v)}function f3(p,v){var A=p.callbacks;if(A!==null)for(p.callbacks=null,p=0;p<A.length;p++)Ng(A[p],v)}var Lg=$(null),o1=$(0);function p3(p,v){p=Bl,ae(o1,p),ae(Lg,v),Bl=p|v.baseLanes}function cM(){ae(o1,Bl),ae(Lg,Lg.current)}function hy(){Bl=o1.current,J(Lg),J(o1)}var nl=$(null),Io=null;function Hh(p){var v=p.alternate;ae(Cr,Cr.current&1),ae(nl,p),Io===null&&(v===null||Lg.current!==null||v.memoizedState!==null)&&(Io=p)}function uM(p){ae(Cr,Cr.current),ae(nl,p),Io===null&&(Io=p)}function m3(p){p.tag===22?(ae(Cr,Cr.current),ae(nl,p),Io===null&&(Io=p)):al()}function al(){ae(Cr,Cr.current),ae(nl,nl.current)}function Sa(p){J(nl),Io===p&&(Io=null),J(Cr)}var Cr=$(0);function Ll(p){for(var v=p;v!==null;){if(v.tag===13){var A=v.memoizedState;if(A!==null&&(A=A.dehydrated,A===null||TU(A)||CU(A)))return v}else if(v.tag===19&&(v.memoizedProps.revealOrder==="forwards"||v.memoizedProps.revealOrder==="backwards"||v.memoizedProps.revealOrder==="unstable_legacy-backwards"||v.memoizedProps.revealOrder==="together")){if((v.flags&128)!==0)return v}else if(v.child!==null){v.child.return=v,v=v.child;continue}if(v===p)break;for(;v.sibling===null;){if(v.return===null||v.return===p)return null;v=v.return}v.sibling.return=v.return,v=v.sibling}return null}var Wn=0,tr=null,mn=null,Sr=null,bc=!1,kg=!1,Dp=!1,l1=0,dy=0,zg=null,hM=0;function ea(){throw Error(r(321))}function dM(p,v){if(v===null)return!1;for(var A=0;A<v.length&&A<p.length;A++)if(!Do(p[A],v[A]))return!1;return!0}function c1(p,v,A,D,k,B){return Wn=B,tr=v,v.memoizedState=null,v.updateQueue=null,v.lanes=0,H.H=p===null||p.memoizedState===null?X3:RM,Dp=!1,B=A(D,k),Dp=!1,kg&&(B=Op(v,A,D,k)),g3(p),B}function g3(p){H.H=Bg;var v=mn!==null&&mn.next!==null;if(Wn=0,Sr=mn=tr=null,bc=!1,dy=0,zg=null,v)throw Error(r(300));p===null||La||(p=p.dependencies,p!==null&&ay(p)&&(La=!0))}function Op(p,v,A,D){tr=p;var k=0;do{if(kg&&(zg=null),dy=0,kg=!1,25<=k)throw Error(r(301));if(k+=1,Sr=mn=null,p.updateQueue!=null){var B=p.updateQueue;B.lastEffect=null,B.events=null,B.stores=null,B.memoCache!=null&&(B.memoCache.index=0)}H.H=wc,B=v(A,D)}while(kg);return B}function Rp(){var p=H.H,v=p.useState()[0];return v=typeof v.then=="function"?fy(v):v,p=p.useState()[0],(mn!==null?mn.memoizedState:null)!==p&&(tr.flags|=1024),v}function fM(){var p=l1!==0;return l1=0,p}function pM(p,v,A){v.updateQueue=p.updateQueue,v.flags&=-2053,p.lanes&=~A}function mM(p){if(bc){for(p=p.memoizedState;p!==null;){var v=p.queue;v!==null&&(v.pending=null),p=p.next}bc=!1}Wn=0,Sr=mn=tr=null,kg=!1,dy=l1=0,zg=null}function Ka(){var p={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Sr===null?tr.memoizedState=Sr=p:Sr=Sr.next=p,Sr}function Aa(){if(mn===null){var p=tr.alternate;p=p!==null?p.memoizedState:null}else p=mn.next;var v=Sr===null?tr.memoizedState:Sr.next;if(v!==null)Sr=v,mn=p;else{if(p===null)throw tr.alternate===null?Error(r(467)):Error(r(310));mn=p,p={memoizedState:mn.memoizedState,baseState:mn.baseState,baseQueue:mn.baseQueue,queue:mn.queue,next:null},Sr===null?tr.memoizedState=Sr=p:Sr=Sr.next=p}return Sr}function u1(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fy(p){var v=dy;return dy+=1,zg===null&&(zg=[]),p=n1(zg,p,v),v=tr,(Sr===null?v.memoizedState:Sr.next)===null&&(v=v.alternate,H.H=v===null||v.memoizedState===null?X3:RM),p}function Yd(p){if(p!==null&&typeof p=="object"){if(typeof p.then=="function")return fy(p);if(p.$$typeof===S)return Fi(p)}throw Error(r(438,String(p)))}function gM(p){var v=null,A=tr.updateQueue;if(A!==null&&(v=A.memoCache),v==null){var D=tr.alternate;D!==null&&(D=D.updateQueue,D!==null&&(D=D.memoCache,D!=null&&(v={data:D.data.map(function(k){return k.slice()}),index:0})))}if(v==null&&(v={data:[],index:0}),A===null&&(A=u1(),tr.updateQueue=A),A.memoCache=v,A=v.data[v.index],A===void 0)for(A=v.data[v.index]=Array(p),D=0;D<p;D++)A[D]=L;return v.index++,A}function Gh(p,v){return typeof v=="function"?v(p):v}function h1(p){var v=Aa();return vM(v,mn,p)}function vM(p,v,A){var D=p.queue;if(D===null)throw Error(r(311));D.lastRenderedReducer=A;var k=p.baseQueue,B=D.pending;if(B!==null){if(k!==null){var te=k.next;k.next=B.next,B.next=te}v.baseQueue=k=B,D.pending=null}if(B=p.baseState,k===null)p.memoizedState=B;else{v=k.next;var ye=te=null,Ie=null,it=v,St=!1;do{var Ct=it.lane&-536870913;if(Ct!==it.lane?(lr&Ct)===Ct:(Wn&Ct)===Ct){var ot=it.revertLane;if(ot===0)Ie!==null&&(Ie=Ie.next={lane:0,revertLane:0,gesture:null,action:it.action,hasEagerState:it.hasEagerState,eagerState:it.eagerState,next:null}),Ct===jh&&(St=!0);else if((Wn&ot)===ot){it=it.next,ot===jh&&(St=!0);continue}else Ct={lane:0,revertLane:it.revertLane,gesture:null,action:it.action,hasEagerState:it.hasEagerState,eagerState:it.eagerState,next:null},Ie===null?(ye=Ie=Ct,te=B):Ie=Ie.next=Ct,tr.lanes|=ot,Xu|=ot;Ct=it.action,Dp&&A(B,Ct),B=it.hasEagerState?it.eagerState:A(B,Ct)}else ot={lane:Ct,revertLane:it.revertLane,gesture:it.gesture,action:it.action,hasEagerState:it.hasEagerState,eagerState:it.eagerState,next:null},Ie===null?(ye=Ie=ot,te=B):Ie=Ie.next=ot,tr.lanes|=Ct,Xu|=Ct;it=it.next}while(it!==null&&it!==v);if(Ie===null?te=B:Ie.next=ye,!Do(B,p.memoizedState)&&(La=!0,St&&(A=yc,A!==null)))throw A;p.memoizedState=B,p.baseState=te,p.baseQueue=Ie,D.lastRenderedState=B}return k===null&&(D.lanes=0),[p.memoizedState,D.dispatch]}function yM(p){var v=Aa(),A=v.queue;if(A===null)throw Error(r(311));A.lastRenderedReducer=p;var D=A.dispatch,k=A.pending,B=v.memoizedState;if(k!==null){A.pending=null;var te=k=k.next;do B=p(B,te.action),te=te.next;while(te!==k);Do(B,v.memoizedState)||(La=!0),v.memoizedState=B,v.baseQueue===null&&(v.baseState=B),A.lastRenderedState=B}return[B,D]}function v3(p,v,A){var D=tr,k=Aa(),B=Tr;if(B){if(A===void 0)throw Error(r(407));A=A()}else A=v();var te=!Do((mn||k).memoizedState,A);if(te&&(k.memoizedState=A,La=!0),k=k.queue,EM(b3.bind(null,D,k,p),[p]),k.getSnapshot!==v||te||Sr!==null&&Sr.memoizedState.tag&1){if(D.flags|=2048,$d(9,{destroy:void 0},x3.bind(null,D,k,A,v),null),qi===null)throw Error(r(349));B||(Wn&127)!==0||y3(D,v,A)}return A}function y3(p,v,A){p.flags|=16384,p={getSnapshot:v,value:A},v=tr.updateQueue,v===null?(v=u1(),tr.updateQueue=v,v.stores=[p]):(A=v.stores,A===null?v.stores=[p]:A.push(p))}function x3(p,v,A,D){v.value=A,v.getSnapshot=D,w3(v)&&_3(p)}function b3(p,v,A){return A(function(){w3(v)&&_3(p)})}function w3(p){var v=p.getSnapshot;p=p.value;try{var A=v();return!Do(p,A)}catch{return!0}}function _3(p){var v=Oo(p,2);v!==null&&dr(v,p,2)}function xM(p){var v=Ka();if(typeof p=="function"){var A=p;if(p=A(),Dp){wt(!0);try{A()}finally{wt(!1)}}}return v.memoizedState=v.baseState=p,v.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gh,lastRenderedState:p},v}function bM(p,v,A,D){return p.baseState=A,vM(p,mn,typeof D=="function"?D:Gh)}function hU(p,v,A,D,k){if(m1(p))throw Error(r(485));if(p=v.action,p!==null){var B={payload:k,action:p,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(te){B.listeners.push(te)}};H.T!==null?A(!0):B.isTransition=!1,D(B),A=v.pending,A===null?(B.next=v.pending=B,S3(v,B)):(B.next=A.next,v.pending=A.next=B)}}function S3(p,v){var A=v.action,D=v.payload,k=p.state;if(v.isTransition){var B=H.T,te={};H.T=te;try{var ye=A(k,D),Ie=H.S;Ie!==null&&Ie(te,ye),A3(p,v,ye)}catch(it){wM(p,v,it)}finally{B!==null&&te.types!==null&&(B.types=te.types),H.T=B}}else try{B=A(k,D),A3(p,v,B)}catch(it){wM(p,v,it)}}function A3(p,v,A){A!==null&&typeof A=="object"&&typeof A.then=="function"?A.then(function(D){M3(p,v,D)},function(D){return wM(p,v,D)}):M3(p,v,A)}function M3(p,v,A){v.status="fulfilled",v.value=A,E3(v),p.state=A,v=p.pending,v!==null&&(A=v.next,A===v?p.pending=null:(A=A.next,v.next=A,S3(p,A)))}function wM(p,v,A){var D=p.pending;if(p.pending=null,D!==null){D=D.next;do v.status="rejected",v.reason=A,E3(v),v=v.next;while(v!==D)}p.action=null}function E3(p){p=p.listeners;for(var v=0;v<p.length;v++)(0,p[v])()}function _M(p,v){return v}function SM(p,v){if(Tr){var A=qi.formState;if(A!==null){e:{var D=tr;if(Tr){if(Pn){t:{for(var k=Pn,B=Il;k.nodeType!==8;){if(!B){k=null;break t}if(k=Ku(k.nextSibling),k===null){k=null;break t}}B=k.data,k=B==="F!"||B==="F"?k:null}if(k){Pn=Ku(k.nextSibling),D=k.data==="F!";break e}}Lu(D)}D=!1}D&&(v=A[0])}}return A=Ka(),A.memoizedState=A.baseState=v,D={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_M,lastRenderedState:v},A.queue=D,A=G3.bind(null,tr,D),D.dispatch=A,D=xM(!1),B=OM.bind(null,tr,!1,D.queue),D=Ka(),k={state:v,dispatch:null,action:p,pending:null},D.queue=k,A=hU.bind(null,tr,k,B,A),k.dispatch=A,D.memoizedState=p,[v,A,!1]}function T3(p){var v=Aa();return AM(v,mn,p)}function AM(p,v,A){if(v=vM(p,v,_M)[0],p=h1(Gh)[0],typeof v=="object"&&v!==null&&typeof v.then=="function")try{var D=fy(v)}catch(te){throw te===Ap?ur:te}else D=v;v=Aa();var k=v.queue,B=k.dispatch;return A!==v.memoizedState&&(tr.flags|=2048,$d(9,{destroy:void 0},C3.bind(null,k,A),null)),[D,B,p]}function C3(p,v){p.action=v}function MM(p){var v=Aa(),A=mn;if(A!==null)return AM(v,A,p);Aa(),v=v.memoizedState,A=Aa();var D=A.queue.dispatch;return A.memoizedState=p,[v,D,!1]}function $d(p,v,A,D){return p={tag:p,create:A,deps:D,inst:v,next:null},v=tr.updateQueue,v===null&&(v=u1(),tr.updateQueue=v),A=v.lastEffect,A===null?v.lastEffect=p.next=p:(D=A.next,A.next=p,p.next=D,v.lastEffect=p),p}function d1(){return Aa().memoizedState}function f1(p,v,A,D){var k=Ka();tr.flags|=p,k.memoizedState=$d(1|v,{destroy:void 0},A,D===void 0?null:D)}function p1(p,v,A,D){var k=Aa();D=D===void 0?null:D;var B=k.memoizedState.inst;mn!==null&&D!==null&&dM(D,mn.memoizedState.deps)?k.memoizedState=$d(v,B,A,D):(tr.flags|=p,k.memoizedState=$d(1|v,B,A,D))}function P3(p,v){f1(8390656,8,p,v)}function EM(p,v){p1(2048,8,p,v)}function D3(p){tr.flags|=4;var v=tr.updateQueue;if(v===null)v=u1(),tr.updateQueue=v,v.events=[p];else{var A=v.events;A===null?v.events=[p]:A.push(p)}}function O3(p){var v=Aa().memoizedState;return D3({ref:v,nextImpl:p}),function(){if((vi&2)!==0)throw Error(r(440));return v.impl.apply(void 0,arguments)}}function R3(p,v){return p1(4,2,p,v)}function I3(p,v){return p1(4,4,p,v)}function N3(p,v){if(typeof v=="function"){p=p();var A=v(p);return function(){typeof A=="function"?A():v(null)}}if(v!=null)return p=p(),v.current=p,function(){v.current=null}}function L3(p,v,A){A=A!=null?A.concat([p]):null,p1(4,4,N3.bind(null,v,p),A)}function TM(){}function k3(p,v){var A=Aa();v=v===void 0?null:v;var D=A.memoizedState;return v!==null&&dM(v,D[1])?D[0]:(A.memoizedState=[p,v],p)}function z3(p,v){var A=Aa();v=v===void 0?null:v;var D=A.memoizedState;if(v!==null&&dM(v,D[1]))return D[0];if(D=p(),Dp){wt(!0);try{p()}finally{wt(!1)}}return A.memoizedState=[D,v],D}function CM(p,v,A){return A===void 0||(Wn&1073741824)!==0&&(lr&261930)===0?p.memoizedState=v:(p.memoizedState=A,p=yr(),tr.lanes|=p,Xu|=p,A)}function B3(p,v,A,D){return Do(A,v)?A:Lg.current!==null?(p=CM(p,A,D),Do(p,v)||(La=!0),p):(Wn&42)===0||(Wn&1073741824)!==0&&(lr&261930)===0?(La=!0,p.memoizedState=A):(p=yr(),tr.lanes|=p,Xu|=p,v)}function U3(p,v,A,D,k){var B=W.p;W.p=B!==0&&8>B?B:8;var te=H.T,ye={};H.T=ye,OM(p,!1,v,A);try{var Ie=k(),it=H.S;if(it!==null&&it(ye,Ie),Ie!==null&&typeof Ie=="object"&&typeof Ie.then=="function"){var St=aM(Ie,D);py(p,v,St,jl(p))}else py(p,v,D,jl(p))}catch(Ct){py(p,v,{then:function(){},status:"rejected",reason:Ct},jl())}finally{W.p=B,te!==null&&ye.types!==null&&(te.types=ye.types),H.T=te}}function dU(){}function PM(p,v,A,D){if(p.tag!==5)throw Error(r(476));var k=j3(p).queue;U3(p,k,v,Q,A===null?dU:function(){return F3(p),A(D)})}function j3(p){var v=p.memoizedState;if(v!==null)return v;v={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gh,lastRenderedState:Q},next:null};var A={};return v.next={memoizedState:A,baseState:A,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gh,lastRenderedState:A},next:null},p.memoizedState=v,p=p.alternate,p!==null&&(p.memoizedState=v),v}function F3(p){var v=j3(p);v.next===null&&(v=p.alternate.memoizedState),py(p,v.next.queue,{},jl())}function DM(){return Fi(ZM)}function V3(){return Aa().memoizedState}function H3(){return Aa().memoizedState}function fU(p){for(var v=p.return;v!==null;){switch(v.tag){case 24:case 3:var A=jl();p=Vh(A);var D=qd(v,p,A);D!==null&&(dr(D,v,A),Xd(D,v,A)),v={cache:iM()},p.payload=v;return}v=v.return}}function pU(p,v,A){var D=jl();A={lane:D,revertLane:0,gesture:null,action:A,hasEagerState:!1,eagerState:null,next:null},m1(p)?W3(v,A):(A=qb(p,v,A,D),A!==null&&(dr(A,p,D),q3(A,v,D)))}function G3(p,v,A){var D=jl();py(p,v,A,D)}function py(p,v,A,D){var k={lane:D,revertLane:0,gesture:null,action:A,hasEagerState:!1,eagerState:null,next:null};if(m1(p))W3(v,k);else{var B=p.alternate;if(p.lanes===0&&(B===null||B.lanes===0)&&(B=v.lastRenderedReducer,B!==null))try{var te=v.lastRenderedState,ye=B(te,A);if(k.hasEagerState=!0,k.eagerState=ye,Do(ye,te))return ps(p,v,k,0),qi===null&&ry(),!1}catch{}finally{}if(A=qb(p,v,k,D),A!==null)return dr(A,p,D),q3(A,v,D),!0}return!1}function OM(p,v,A,D){if(D={lane:2,revertLane:ht(),gesture:null,action:D,hasEagerState:!1,eagerState:null,next:null},m1(p)){if(v)throw Error(r(479))}else v=qb(p,A,D,2),v!==null&&dr(v,p,2)}function m1(p){var v=p.alternate;return p===tr||v!==null&&v===tr}function W3(p,v){kg=bc=!0;var A=p.pending;A===null?v.next=v:(v.next=A.next,A.next=v),p.pending=v}function q3(p,v,A){if((A&4194048)!==0){var D=v.lanes;D&=p.pendingLanes,A|=D,v.lanes=A,Dl(p,A)}}var Bg={readContext:Fi,use:Yd,useCallback:ea,useContext:ea,useEffect:ea,useImperativeHandle:ea,useLayoutEffect:ea,useInsertionEffect:ea,useMemo:ea,useReducer:ea,useRef:ea,useState:ea,useDebugValue:ea,useDeferredValue:ea,useTransition:ea,useSyncExternalStore:ea,useId:ea,useHostTransitionStatus:ea,useFormState:ea,useActionState:ea,useOptimistic:ea,useMemoCache:ea,useCacheRefresh:ea};Bg.useEffectEvent=ea;var X3={readContext:Fi,use:Yd,useCallback:function(p,v){return Ka().memoizedState=[p,v===void 0?null:v],p},useContext:Fi,useEffect:P3,useImperativeHandle:function(p,v,A){A=A!=null?A.concat([p]):null,f1(4194308,4,N3.bind(null,v,p),A)},useLayoutEffect:function(p,v){return f1(4194308,4,p,v)},useInsertionEffect:function(p,v){f1(4,2,p,v)},useMemo:function(p,v){var A=Ka();v=v===void 0?null:v;var D=p();if(Dp){wt(!0);try{p()}finally{wt(!1)}}return A.memoizedState=[D,v],D},useReducer:function(p,v,A){var D=Ka();if(A!==void 0){var k=A(v);if(Dp){wt(!0);try{A(v)}finally{wt(!1)}}}else k=v;return D.memoizedState=D.baseState=k,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:p,lastRenderedState:k},D.queue=p,p=p.dispatch=pU.bind(null,tr,p),[D.memoizedState,p]},useRef:function(p){var v=Ka();return p={current:p},v.memoizedState=p},useState:function(p){p=xM(p);var v=p.queue,A=G3.bind(null,tr,v);return v.dispatch=A,[p.memoizedState,A]},useDebugValue:TM,useDeferredValue:function(p,v){var A=Ka();return CM(A,p,v)},useTransition:function(){var p=xM(!1);return p=U3.bind(null,tr,p.queue,!0,!1),Ka().memoizedState=p,[!1,p]},useSyncExternalStore:function(p,v,A){var D=tr,k=Ka();if(Tr){if(A===void 0)throw Error(r(407));A=A()}else{if(A=v(),qi===null)throw Error(r(349));(lr&127)!==0||y3(D,v,A)}k.memoizedState=A;var B={value:A,getSnapshot:v};return k.queue=B,P3(b3.bind(null,D,B,p),[p]),D.flags|=2048,$d(9,{destroy:void 0},x3.bind(null,D,B,A,v),null),A},useId:function(){var p=Ka(),v=qi.identifierPrefix;if(Tr){var A=eu,D=Jn;A=(D&~(1<<32-xt(D)-1)).toString(32)+A,v="_"+v+"R_"+A,A=l1++,0<A&&(v+="H"+A.toString(32)),v+="_"}else A=hM++,v="_"+v+"r_"+A.toString(32)+"_";return p.memoizedState=v},useHostTransitionStatus:DM,useFormState:SM,useActionState:SM,useOptimistic:function(p){var v=Ka();v.memoizedState=v.baseState=p;var A={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return v.queue=A,v=OM.bind(null,tr,!0,A),A.dispatch=v,[p,v]},useMemoCache:gM,useCacheRefresh:function(){return Ka().memoizedState=fU.bind(null,tr)},useEffectEvent:function(p){var v=Ka(),A={impl:p};return v.memoizedState=A,function(){if((vi&2)!==0)throw Error(r(440));return A.impl.apply(void 0,arguments)}}},RM={readContext:Fi,use:Yd,useCallback:k3,useContext:Fi,useEffect:EM,useImperativeHandle:L3,useInsertionEffect:R3,useLayoutEffect:I3,useMemo:z3,useReducer:h1,useRef:d1,useState:function(){return h1(Gh)},useDebugValue:TM,useDeferredValue:function(p,v){var A=Aa();return B3(A,mn.memoizedState,p,v)},useTransition:function(){var p=h1(Gh)[0],v=Aa().memoizedState;return[typeof p=="boolean"?p:fy(p),v]},useSyncExternalStore:v3,useId:V3,useHostTransitionStatus:DM,useFormState:T3,useActionState:T3,useOptimistic:function(p,v){var A=Aa();return bM(A,mn,p,v)},useMemoCache:gM,useCacheRefresh:H3};RM.useEffectEvent=O3;var wc={readContext:Fi,use:Yd,useCallback:k3,useContext:Fi,useEffect:EM,useImperativeHandle:L3,useInsertionEffect:R3,useLayoutEffect:I3,useMemo:z3,useReducer:yM,useRef:d1,useState:function(){return yM(Gh)},useDebugValue:TM,useDeferredValue:function(p,v){var A=Aa();return mn===null?CM(A,p,v):B3(A,mn.memoizedState,p,v)},useTransition:function(){var p=yM(Gh)[0],v=Aa().memoizedState;return[typeof p=="boolean"?p:fy(p),v]},useSyncExternalStore:v3,useId:V3,useHostTransitionStatus:DM,useFormState:MM,useActionState:MM,useOptimistic:function(p,v){var A=Aa();return mn!==null?bM(A,mn,p,v):(A.baseState=p,[p,A.queue.dispatch])},useMemoCache:gM,useCacheRefresh:H3};wc.useEffectEvent=O3;function g1(p,v,A,D){v=p.memoizedState,A=A(D,v),A=A==null?v:h({},v,A),p.memoizedState=A,p.lanes===0&&(p.updateQueue.baseState=A)}var my={enqueueSetState:function(p,v,A){p=p._reactInternals;var D=jl(),k=Vh(D);k.payload=v,A!=null&&(k.callback=A),v=qd(p,k,D),v!==null&&(dr(v,p,D),Xd(v,p,D))},enqueueReplaceState:function(p,v,A){p=p._reactInternals;var D=jl(),k=Vh(D);k.tag=1,k.payload=v,A!=null&&(k.callback=A),v=qd(p,k,D),v!==null&&(dr(v,p,D),Xd(v,p,D))},enqueueForceUpdate:function(p,v){p=p._reactInternals;var A=jl(),D=Vh(A);D.tag=2,v!=null&&(D.callback=v),v=qd(p,D,A),v!==null&&(dr(v,p,A),Xd(v,p,A))}};function IM(p,v,A,D,k,B,te){return p=p.stateNode,typeof p.shouldComponentUpdate=="function"?p.shouldComponentUpdate(D,B,te):v.prototype&&v.prototype.isPureReactComponent?!bg(A,D)||!bg(k,B):!0}function NM(p,v,A,D){p=v.state,typeof v.componentWillReceiveProps=="function"&&v.componentWillReceiveProps(A,D),typeof v.UNSAFE_componentWillReceiveProps=="function"&&v.UNSAFE_componentWillReceiveProps(A,D),v.state!==p&&my.enqueueReplaceState(v,v.state,null)}function Kd(p,v){var A=v;if("ref"in v){A={};for(var D in v)D!=="ref"&&(A[D]=v[D])}if(p=p.defaultProps){A===v&&(A=h({},A));for(var k in p)A[k]===void 0&&(A[k]=p[k])}return A}function Y3(p){iy(p)}function LM(p){console.error(p)}function kM(p){iy(p)}function v1(p,v){try{var A=p.onUncaughtError;A(v.value,{componentStack:v.stack})}catch(D){setTimeout(function(){throw D})}}function $3(p,v,A){try{var D=p.onCaughtError;D(A.value,{componentStack:A.stack,errorBoundary:v.tag===1?v.stateNode:null})}catch(k){setTimeout(function(){throw k})}}function zM(p,v,A){return A=Vh(A),A.tag=3,A.payload={element:null},A.callback=function(){v1(p,v)},A}function BM(p){return p=Vh(p),p.tag=3,p}function K3(p,v,A,D){var k=A.type.getDerivedStateFromError;if(typeof k=="function"){var B=D.value;p.payload=function(){return k(B)},p.callback=function(){$3(v,A,D)}}var te=A.stateNode;te!==null&&typeof te.componentDidCatch=="function"&&(p.callback=function(){$3(v,A,D),typeof k!="function"&&(Ta===null?Ta=new Set([this]):Ta.add(this));var ye=D.stack;this.componentDidCatch(D.value,{componentStack:ye!==null?ye:""})})}function Qa(p,v,A,D,k){if(A.flags|=32768,D!==null&&typeof D=="object"&&typeof D.then=="function"){if(v=A.alternate,v!==null&&Uu(v,A,k,!0),A=nl.current,A!==null){switch(A.tag){case 31:case 13:return Io===null?Wg():A.alternate===null&&ta===0&&(ta=3),A.flags&=-257,A.flags|=65536,A.lanes=k,D===r1?A.flags|=16384:(v=A.updateQueue,v===null?A.updateQueue=new Set([D]):v.add(D),Ty(p,D,k)),!1;case 22:return A.flags|=65536,D===r1?A.flags|=16384:(v=A.updateQueue,v===null?(v={transitions:null,markerInstances:null,retryQueue:new Set([D])},A.updateQueue=v):(A=v.retryQueue,A===null?v.retryQueue=new Set([D]):A.add(D)),Ty(p,D,k)),!1}throw Error(r(435,A.tag))}return Ty(p,D,k),Wg(),!1}if(Tr)return v=nl.current,v!==null?((v.flags&65536)===0&&(v.flags|=256),v.flags|=65536,v.lanes=k,D!==Cg&&(p=Error(r(422),{cause:D}),ku(Rl(p,A)))):(D!==Cg&&(v=Error(r(423),{cause:D}),ku(Rl(v,A))),p=p.current.alternate,p.flags|=65536,k&=-k,p.lanes|=k,D=Rl(D,A),k=zM(p.stateNode,D,k),Ai(p,k),ta!==4&&(ta=2)),!1;var B=Error(r(520),{cause:D});if(B=Rl(B,A),jp===null?jp=[B]:jp.push(B),ta!==4&&(ta=2),v===null)return!0;D=Rl(D,A),A=v;do{switch(A.tag){case 3:return A.flags|=65536,p=k&-k,A.lanes|=p,p=zM(A.stateNode,D,p),Ai(A,p),!1;case 1:if(v=A.type,B=A.stateNode,(A.flags&128)===0&&(typeof v.getDerivedStateFromError=="function"||B!==null&&typeof B.componentDidCatch=="function"&&(Ta===null||!Ta.has(B))))return A.flags|=65536,k&=-k,A.lanes|=k,k=BM(k),K3(k,p,A,D),Ai(A,k),!1}A=A.return}while(A!==null);return!1}var y1=Error(r(461)),La=!1;function ms(p,v,A,D){v.child=p===null?s1(v,null,A,D):Fh(v,p.child,A,D)}function UM(p,v,A,D,k){A=A.render;var B=v.ref;if("ref"in D){var te={};for(var ye in D)ye!=="ref"&&(te[ye]=D[ye])}else te=D;return Gd(v),D=c1(p,v,A,te,B,k),ye=fM(),p!==null&&!La?(pM(p,v,k),Ma(p,v,k)):(Tr&&ye&&Nu(v),v.flags|=1,ms(p,v,D,k),v.child)}function Ip(p,v,A,D,k){if(p===null){var B=A.type;return typeof B=="function"&&!Xb(B)&&B.defaultProps===void 0&&A.compare===null?(v.tag=15,v.type=B,x1(p,v,B,D,k)):(p=Ru(A.type,null,D,v,v.mode,k),p.ref=v.ref,p.return=v,v.child=p)}if(B=p.child,!M1(p,k)){var te=B.memoizedProps;if(A=A.compare,A=A!==null?A:bg,A(te,D)&&p.ref===v.ref)return Ma(p,v,k)}return v.flags|=1,p=tl(B,D),p.ref=v.ref,p.return=v,v.child=p}function x1(p,v,A,D,k){if(p!==null){var B=p.memoizedProps;if(bg(B,D)&&p.ref===v.ref)if(La=!1,v.pendingProps=D=B,M1(p,k))(p.flags&131072)!==0&&(La=!0);else return v.lanes=p.lanes,Ma(p,v,k)}return Ug(p,v,A,D,k)}function Np(p,v,A,D){var k=D.children,B=p!==null?p.memoizedState:null;if(p===null&&v.stateNode===null&&(v.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),D.mode==="hidden"){if((v.flags&128)!==0){if(B=B!==null?B.baseLanes|A:A,p!==null){for(D=v.child=p.child,k=0;D!==null;)k=k|D.lanes|D.childLanes,D=D.sibling;D=k&~B}else D=0,v.child=null;return sl(p,v,B,A,D)}if((A&536870912)!==0)v.memoizedState={baseLanes:0,cachePool:null},p!==null&&sy(v,B!==null?B.cachePool:null),B!==null?p3(v,B):cM(),m3(v);else return D=v.lanes=536870912,sl(p,v,B!==null?B.baseLanes|A:A,A,D)}else B!==null?(sy(v,B.cachePool),p3(v,B),al(),v.memoizedState=null):(p!==null&&sy(v,null),cM(),al());return ms(p,v,k,A),v.child}function Fu(p,v){return p!==null&&p.tag===22||v.stateNode!==null||(v.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),v.sibling}function sl(p,v,A,D,k){var B=i1();return B=B===null?null:{parent:Na._currentValue,pool:B},v.memoizedState={baseLanes:A,cachePool:B},p!==null&&sy(v,null),cM(),m3(v),p!==null&&Uu(p,v,D,!0),v.childLanes=k,null}function b1(p,v){return v=A1({mode:v.mode,children:v.children},p.mode),v.ref=p.ref,p.child=v,v.return=p,v}function Q3(p,v,A){return Fh(v,p.child,null,A),p=b1(v,v.pendingProps),p.flags|=2,Sa(v),v.memoizedState=null,p}function w1(p,v,A){var D=v.pendingProps,k=(v.flags&128)!==0;if(v.flags&=-129,p===null){if(Tr){if(D.mode==="hidden")return p=b1(v,D),v.lanes=536870912,Fu(null,p);if(uM(v),(p=Pn)?(p=qK(p,Il),p=p!==null&&p.data==="&"?p:null,p!==null&&(v.memoizedState={dehydrated:p,treeContext:zh!==null?{id:Jn,overflow:eu}:null,retryLane:536870912,hydrationErrors:null},A=Mg(p),A.return=v,v.child=A,pa=v,Pn=null)):p=null,p===null)throw Lu(v);return v.lanes=536870912,null}return b1(v,D)}var B=p.memoizedState;if(B!==null){var te=B.dehydrated;if(uM(v),k)if(v.flags&256)v.flags&=-257,v=Q3(p,v,A);else if(v.memoizedState!==null)v.child=p.child,v.flags|=128,v=null;else throw Error(r(558));else if(La||Uu(p,v,A,!1),k=(A&p.childLanes)!==0,La||k){if(D=qi,D!==null&&(te=Ih(D,A),te!==0&&te!==B.retryLane))throw B.retryLane=te,Oo(p,te),dr(D,p,te),y1;Wg(),v=Q3(p,v,A)}else p=B.treeContext,Pn=Ku(te.nextSibling),pa=v,Tr=!0,Bh=null,Il=!1,p!==null&&Qb(v,p),v=b1(v,D),v.flags|=4096;return v}return p=tl(p.child,{mode:D.mode,children:D.children}),p.ref=v.ref,v.child=p,p.return=v,p}function Lp(p,v){var A=v.ref;if(A===null)p!==null&&p.ref!==null&&(v.flags|=4194816);else{if(typeof A!="function"&&typeof A!="object")throw Error(r(284));(p===null||p.ref!==A)&&(v.flags|=4194816)}}function Ug(p,v,A,D,k){return Gd(v),A=c1(p,v,A,D,void 0,k),D=fM(),p!==null&&!La?(pM(p,v,k),Ma(p,v,k)):(Tr&&D&&Nu(v),v.flags|=1,ms(p,v,A,k),v.child)}function gy(p,v,A,D,k,B){return Gd(v),v.updateQueue=null,A=Op(v,D,A,k),g3(p),D=fM(),p!==null&&!La?(pM(p,v,B),Ma(p,v,B)):(Tr&&D&&Nu(v),v.flags|=1,ms(p,v,A,B),v.child)}function _1(p,v,A,D,k){if(Gd(v),v.stateNode===null){var B=Bd,te=A.contextType;typeof te=="object"&&te!==null&&(B=Fi(te)),B=new A(D,B),v.memoizedState=B.state!==null&&B.state!==void 0?B.state:null,B.updater=my,v.stateNode=B,B._reactInternals=v,B=v.stateNode,B.props=D,B.state=v.memoizedState,B.refs={},cy(v),te=A.contextType,B.context=typeof te=="object"&&te!==null?Fi(te):Bd,B.state=v.memoizedState,te=A.getDerivedStateFromProps,typeof te=="function"&&(g1(v,A,te,D),B.state=v.memoizedState),typeof A.getDerivedStateFromProps=="function"||typeof B.getSnapshotBeforeUpdate=="function"||typeof B.UNSAFE_componentWillMount!="function"&&typeof B.componentWillMount!="function"||(te=B.state,typeof B.componentWillMount=="function"&&B.componentWillMount(),typeof B.UNSAFE_componentWillMount=="function"&&B.UNSAFE_componentWillMount(),te!==B.state&&my.enqueueReplaceState(B,B.state,null),Ig(v,D,B,k),uy(),B.state=v.memoizedState),typeof B.componentDidMount=="function"&&(v.flags|=4194308),D=!0}else if(p===null){B=v.stateNode;var ye=v.memoizedProps,Ie=Kd(A,ye);B.props=Ie;var it=B.context,St=A.contextType;te=Bd,typeof St=="object"&&St!==null&&(te=Fi(St));var Ct=A.getDerivedStateFromProps;St=typeof Ct=="function"||typeof B.getSnapshotBeforeUpdate=="function",ye=v.pendingProps!==ye,St||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||(ye||it!==te)&&NM(v,B,D,te),Ro=!1;var ot=v.memoizedState;B.state=ot,Ig(v,D,B,k),uy(),it=v.memoizedState,ye||ot!==it||Ro?(typeof Ct=="function"&&(g1(v,A,Ct,D),it=v.memoizedState),(Ie=Ro||IM(v,A,Ie,D,ot,it,te))?(St||typeof B.UNSAFE_componentWillMount!="function"&&typeof B.componentWillMount!="function"||(typeof B.componentWillMount=="function"&&B.componentWillMount(),typeof B.UNSAFE_componentWillMount=="function"&&B.UNSAFE_componentWillMount()),typeof B.componentDidMount=="function"&&(v.flags|=4194308)):(typeof B.componentDidMount=="function"&&(v.flags|=4194308),v.memoizedProps=D,v.memoizedState=it),B.props=D,B.state=it,B.context=te,D=Ie):(typeof B.componentDidMount=="function"&&(v.flags|=4194308),D=!1)}else{B=v.stateNode,oM(p,v),te=v.memoizedProps,St=Kd(A,te),B.props=St,Ct=v.pendingProps,ot=B.context,it=A.contextType,Ie=Bd,typeof it=="object"&&it!==null&&(Ie=Fi(it)),ye=A.getDerivedStateFromProps,(it=typeof ye=="function"||typeof B.getSnapshotBeforeUpdate=="function")||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||(te!==Ct||ot!==Ie)&&NM(v,B,D,Ie),Ro=!1,ot=v.memoizedState,B.state=ot,Ig(v,D,B,k),uy();var gt=v.memoizedState;te!==Ct||ot!==gt||Ro||p!==null&&p.dependencies!==null&&ay(p.dependencies)?(typeof ye=="function"&&(g1(v,A,ye,D),gt=v.memoizedState),(St=Ro||IM(v,A,St,D,ot,gt,Ie)||p!==null&&p.dependencies!==null&&ay(p.dependencies))?(it||typeof B.UNSAFE_componentWillUpdate!="function"&&typeof B.componentWillUpdate!="function"||(typeof B.componentWillUpdate=="function"&&B.componentWillUpdate(D,gt,Ie),typeof B.UNSAFE_componentWillUpdate=="function"&&B.UNSAFE_componentWillUpdate(D,gt,Ie)),typeof B.componentDidUpdate=="function"&&(v.flags|=4),typeof B.getSnapshotBeforeUpdate=="function"&&(v.flags|=1024)):(typeof B.componentDidUpdate!="function"||te===p.memoizedProps&&ot===p.memoizedState||(v.flags|=4),typeof B.getSnapshotBeforeUpdate!="function"||te===p.memoizedProps&&ot===p.memoizedState||(v.flags|=1024),v.memoizedProps=D,v.memoizedState=gt),B.props=D,B.state=gt,B.context=Ie,D=St):(typeof B.componentDidUpdate!="function"||te===p.memoizedProps&&ot===p.memoizedState||(v.flags|=4),typeof B.getSnapshotBeforeUpdate!="function"||te===p.memoizedProps&&ot===p.memoizedState||(v.flags|=1024),D=!1)}return B=D,Lp(p,v),D=(v.flags&128)!==0,B||D?(B=v.stateNode,A=D&&typeof A.getDerivedStateFromError!="function"?null:B.render(),v.flags|=1,p!==null&&D?(v.child=Fh(v,p.child,null,k),v.child=Fh(v,null,A,k)):ms(p,v,A,k),v.memoizedState=B.state,p=v.child):p=Ma(p,v,k),p}function Z3(p,v,A,D){return Vd(),v.flags|=256,ms(p,v,A,D),v.child}var jM={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lo(p){return{baseLanes:p,cachePool:sM()}}function S1(p,v,A){return p=p!==null?p.childLanes&~A:0,v&&(p|=ko),p}function J3(p,v,A){var D=v.pendingProps,k=!1,B=(v.flags&128)!==0,te;if((te=B)||(te=p!==null&&p.memoizedState===null?!1:(Cr.current&2)!==0),te&&(k=!0,v.flags&=-129),te=(v.flags&32)!==0,v.flags&=-33,p===null){if(Tr){if(k?Hh(v):al(),(p=Pn)?(p=qK(p,Il),p=p!==null&&p.data!=="&"?p:null,p!==null&&(v.memoizedState={dehydrated:p,treeContext:zh!==null?{id:Jn,overflow:eu}:null,retryLane:536870912,hydrationErrors:null},A=Mg(p),A.return=v,v.child=A,pa=v,Pn=null)):p=null,p===null)throw Lu(v);return CU(p)?v.lanes=32:v.lanes=536870912,null}var ye=D.children;return D=D.fallback,k?(al(),k=v.mode,ye=A1({mode:"hidden",children:ye},k),D=Ud(D,k,A,null),ye.return=v,D.return=v,ye.sibling=D,v.child=ye,D=v.child,D.memoizedState=lo(A),D.childLanes=S1(p,te,A),v.memoizedState=jM,Fu(null,D)):(Hh(v),vy(v,ye))}var Ie=p.memoizedState;if(Ie!==null&&(ye=Ie.dehydrated,ye!==null)){if(B)v.flags&256?(Hh(v),v.flags&=-257,v=FM(p,v,A)):v.memoizedState!==null?(al(),v.child=p.child,v.flags|=128,v=null):(al(),ye=D.fallback,k=v.mode,D=A1({mode:"visible",children:D.children},k),ye=Ud(ye,k,A,null),ye.flags|=2,D.return=v,ye.return=v,D.sibling=ye,v.child=D,Fh(v,p.child,null,A),D=v.child,D.memoizedState=lo(A),D.childLanes=S1(p,te,A),v.memoizedState=jM,v=Fu(null,D));else if(Hh(v),CU(ye)){if(te=ye.nextSibling&&ye.nextSibling.dataset,te)var it=te.dgst;te=it,D=Error(r(419)),D.stack="",D.digest=te,ku({value:D,source:null,stack:null}),v=FM(p,v,A)}else if(La||Uu(p,v,A,!1),te=(A&p.childLanes)!==0,La||te){if(te=qi,te!==null&&(D=Ih(te,A),D!==0&&D!==Ie.retryLane))throw Ie.retryLane=D,Oo(p,D),dr(te,p,D),y1;TU(ye)||Wg(),v=FM(p,v,A)}else TU(ye)?(v.flags|=192,v.child=p.child,v=null):(p=Ie.treeContext,Pn=Ku(ye.nextSibling),pa=v,Tr=!0,Bh=null,Il=!1,p!==null&&Qb(v,p),v=vy(v,D.children),v.flags|=4096);return v}return k?(al(),ye=D.fallback,k=v.mode,Ie=p.child,it=Ie.sibling,D=tl(Ie,{mode:"hidden",children:D.children}),D.subtreeFlags=Ie.subtreeFlags&65011712,it!==null?ye=tl(it,ye):(ye=Ud(ye,k,A,null),ye.flags|=2),ye.return=v,D.return=v,D.sibling=ye,v.child=D,Fu(null,D),D=v.child,ye=p.child.memoizedState,ye===null?ye=lo(A):(k=ye.cachePool,k!==null?(Ie=Na._currentValue,k=k.parent!==Ie?{parent:Ie,pool:Ie}:k):k=sM(),ye={baseLanes:ye.baseLanes|A,cachePool:k}),D.memoizedState=ye,D.childLanes=S1(p,te,A),v.memoizedState=jM,Fu(p.child,D)):(Hh(v),A=p.child,p=A.sibling,A=tl(A,{mode:"visible",children:D.children}),A.return=v,A.sibling=null,p!==null&&(te=v.deletions,te===null?(v.deletions=[p],v.flags|=16):te.push(p)),v.child=A,v.memoizedState=null,A)}function vy(p,v){return v=A1({mode:"visible",children:v},p.mode),v.return=p,p.child=v}function A1(p,v){return p=Zn(22,p,null,v),p.lanes=0,p}function FM(p,v,A){return Fh(v,p.child,null,A),p=vy(v,v.pendingProps.children),p.flags|=2,v.memoizedState=null,p}function e2(p,v,A){p.lanes|=v;var D=p.alternate;D!==null&&(D.lanes|=v),Jb(p.return,v,A)}function kp(p,v,A,D,k,B){var te=p.memoizedState;te===null?p.memoizedState={isBackwards:v,rendering:null,renderingStartTime:0,last:D,tail:A,tailMode:k,treeForkCount:B}:(te.isBackwards=v,te.rendering=null,te.renderingStartTime=0,te.last=D,te.tail=A,te.tailMode=k,te.treeForkCount=B)}function ol(p,v,A){var D=v.pendingProps,k=D.revealOrder,B=D.tail;D=D.children;var te=Cr.current,ye=(te&2)!==0;if(ye?(te=te&1|2,v.flags|=128):te&=1,ae(Cr,te),ms(p,v,D,A),D=Tr?Tg:0,!ye&&p!==null&&(p.flags&128)!==0)e:for(p=v.child;p!==null;){if(p.tag===13)p.memoizedState!==null&&e2(p,A,v);else if(p.tag===19)e2(p,A,v);else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===v)break e;for(;p.sibling===null;){if(p.return===null||p.return===v)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}switch(k){case"forwards":for(A=v.child,k=null;A!==null;)p=A.alternate,p!==null&&Ll(p)===null&&(k=A),A=A.sibling;A=k,A===null?(k=v.child,v.child=null):(k=A.sibling,A.sibling=null),kp(v,!1,k,A,B,D);break;case"backwards":case"unstable_legacy-backwards":for(A=null,k=v.child,v.child=null;k!==null;){if(p=k.alternate,p!==null&&Ll(p)===null){v.child=k;break}p=k.sibling,k.sibling=A,A=k,k=p}kp(v,!0,A,null,B,D);break;case"together":kp(v,!1,null,null,void 0,D);break;default:v.memoizedState=null}return v.child}function Ma(p,v,A){if(p!==null&&(v.dependencies=p.dependencies),Xu|=v.lanes,(A&v.childLanes)===0)if(p!==null){if(Uu(p,v,A,!1),(A&v.childLanes)===0)return null}else return null;if(p!==null&&v.child!==p.child)throw Error(r(153));if(v.child!==null){for(p=v.child,A=tl(p,p.pendingProps),v.child=A,A.return=v;p.sibling!==null;)p=p.sibling,A=A.sibling=tl(p,p.pendingProps),A.return=v;A.sibling=null}return v.child}function M1(p,v){return(p.lanes&v)!==0?!0:(p=p.dependencies,!!(p!==null&&ay(p)))}function mU(p,v,A){switch(v.tag){case 3:me(v,v.stateNode.containerInfo),Uh(v,Na,p.memoizedState.cache),Vd();break;case 27:case 5:we(v);break;case 4:me(v,v.stateNode.containerInfo);break;case 10:Uh(v,v.type,v.memoizedProps.value);break;case 31:if(v.memoizedState!==null)return v.flags|=128,uM(v),null;break;case 13:var D=v.memoizedState;if(D!==null)return D.dehydrated!==null?(Hh(v),v.flags|=128,null):(A&v.child.childLanes)!==0?J3(p,v,A):(Hh(v),p=Ma(p,v,A),p!==null?p.sibling:null);Hh(v);break;case 19:var k=(p.flags&128)!==0;if(D=(A&v.childLanes)!==0,D||(Uu(p,v,A,!1),D=(A&v.childLanes)!==0),k){if(D)return ol(p,v,A);v.flags|=128}if(k=v.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),ae(Cr,Cr.current),D)break;return null;case 22:return v.lanes=0,Np(p,v,A,v.pendingProps);case 24:Uh(v,Na,p.memoizedState.cache)}return Ma(p,v,A)}function E1(p,v,A){if(p!==null)if(p.memoizedProps!==v.pendingProps)La=!0;else{if(!M1(p,A)&&(v.flags&128)===0)return La=!1,mU(p,v,A);La=(p.flags&131072)!==0}else La=!1,Tr&&(v.flags&1048576)!==0&&o3(v,Tg,v.index);switch(v.lanes=0,v.tag){case 16:e:{var D=v.pendingProps;if(p=Mp(v.elementType),v.type=p,typeof p=="function")Xb(p)?(D=Kd(p,D),v.tag=1,v=_1(null,v,p,D,A)):(v.tag=0,v=Ug(null,v,p,D,A));else{if(p!=null){var k=p.$$typeof;if(k===M){v.tag=11,v=UM(null,v,p,D,A);break e}else if(k===R){v.tag=14,v=Ip(null,v,p,D,A);break e}}throw v=F(p)||p,Error(r(306,v,""))}}return v;case 0:return Ug(p,v,v.type,v.pendingProps,A);case 1:return D=v.type,k=Kd(D,v.pendingProps),_1(p,v,D,k,A);case 3:e:{if(me(v,v.stateNode.containerInfo),p===null)throw Error(r(387));D=v.pendingProps;var B=v.memoizedState;k=B.element,oM(p,v),Ig(v,D,null,A);var te=v.memoizedState;if(D=te.cache,Uh(v,Na,D),D!==B.cache&&e1(v,[Na],A,!0),uy(),D=te.element,B.isDehydrated)if(B={element:D,isDehydrated:!1,cache:te.cache},v.updateQueue.baseState=B,v.memoizedState=B,v.flags&256){v=Z3(p,v,D,A);break e}else if(D!==k){k=Rl(Error(r(424)),v),ku(k),v=Z3(p,v,D,A);break e}else{switch(p=v.stateNode.containerInfo,p.nodeType){case 9:p=p.body;break;default:p=p.nodeName==="HTML"?p.ownerDocument.body:p}for(Pn=Ku(p.firstChild),pa=v,Tr=!0,Bh=null,Il=!0,A=s1(v,null,D,A),v.child=A;A;)A.flags=A.flags&-3|4096,A=A.sibling}else{if(Vd(),D===k){v=Ma(p,v,A);break e}ms(p,v,D,A)}v=v.child}return v;case 26:return Lp(p,v),p===null?(A=ZK(v.type,null,v.pendingProps,null))?v.memoizedState=A:Tr||(A=v.type,p=v.pendingProps,D=n2(Z.current).createElement(A),D[lt]=v,D[Vt]=p,Bo(D,A,p),De(D),v.stateNode=D):v.memoizedState=ZK(v.type,p.memoizedProps,v.pendingProps,p.memoizedState),null;case 27:return we(v),p===null&&Tr&&(D=v.stateNode=$K(v.type,v.pendingProps,Z.current),pa=v,Il=!0,k=Pn,$g(v.type)?(PU=k,Pn=Ku(D.firstChild)):Pn=k),ms(p,v,v.pendingProps.children,A),Lp(p,v),p===null&&(v.flags|=4194304),v.child;case 5:return p===null&&Tr&&((k=D=Pn)&&(D=ZMe(D,v.type,v.pendingProps,Il),D!==null?(v.stateNode=D,pa=v,Pn=Ku(D.firstChild),Il=!1,k=!0):k=!1),k||Lu(v)),we(v),k=v.type,B=v.pendingProps,te=p!==null?p.memoizedProps:null,D=B.children,AU(k,B)?D=null:te!==null&&AU(k,te)&&(v.flags|=32),v.memoizedState!==null&&(k=c1(p,v,Rp,null,null,A),ZM._currentValue=k),Lp(p,v),ms(p,v,D,A),v.child;case 6:return p===null&&Tr&&((p=A=Pn)&&(A=JMe(A,v.pendingProps,Il),A!==null?(v.stateNode=A,pa=v,Pn=null,p=!0):p=!1),p||Lu(v)),null;case 13:return J3(p,v,A);case 4:return me(v,v.stateNode.containerInfo),D=v.pendingProps,p===null?v.child=Fh(v,null,D,A):ms(p,v,D,A),v.child;case 11:return UM(p,v,v.type,v.pendingProps,A);case 7:return ms(p,v,v.pendingProps,A),v.child;case 8:return ms(p,v,v.pendingProps.children,A),v.child;case 12:return ms(p,v,v.pendingProps.children,A),v.child;case 10:return D=v.pendingProps,Uh(v,v.type,D.value),ms(p,v,D.children,A),v.child;case 9:return k=v.type._context,D=v.pendingProps.children,Gd(v),k=Fi(k),D=D(k),v.flags|=1,ms(p,v,D,A),v.child;case 14:return Ip(p,v,v.type,v.pendingProps,A);case 15:return x1(p,v,v.type,v.pendingProps,A);case 19:return ol(p,v,A);case 31:return w1(p,v,A);case 22:return Np(p,v,A,v.pendingProps);case 24:return Gd(v),D=Fi(Na),p===null?(k=i1(),k===null&&(k=qi,B=iM(),k.pooledCache=B,B.refCount++,B!==null&&(k.pooledCacheLanes|=A),k=B),v.memoizedState={parent:D,cache:k},cy(v),Uh(v,Na,k)):((p.lanes&A)!==0&&(oM(p,v),Ig(v,null,null,A),uy()),k=p.memoizedState,B=v.memoizedState,k.parent!==D?(k={parent:D,cache:D},v.memoizedState=k,v.lanes===0&&(v.memoizedState=v.updateQueue.baseState=k),Uh(v,Na,D)):(D=B.cache,Uh(v,Na,D),D!==k.cache&&e1(v,[Na],A,!0))),ms(p,v,v.pendingProps.children,A),v.child;case 29:throw v.pendingProps}throw Error(r(156,v.tag))}function Vu(p){p.flags|=4}function yy(p,v,A,D,k){if((v=(p.mode&32)!==0)&&(v=!1),v){if(p.flags|=16777216,(k&335544128)===k)if(p.stateNode.complete)p.flags|=8192;else if(ra())p.flags|=8192;else throw ju=r1,oy}else p.flags&=-16777217}function VM(p,v){if(v.type!=="stylesheet"||(v.state.loading&4)!==0)p.flags&=-16777217;else if(p.flags|=16777216,!rQ(v))if(ra())p.flags|=8192;else throw ju=r1,oy}function Wh(p,v){v!==null&&(p.flags|=4),p.flags&16384&&(v=p.tag!==22?Wi():536870912,p.lanes|=v,Un|=v)}function Hu(p,v){if(!Tr)switch(p.tailMode){case"hidden":v=p.tail;for(var A=null;v!==null;)v.alternate!==null&&(A=v),v=v.sibling;A===null?p.tail=null:A.sibling=null;break;case"collapsed":A=p.tail;for(var D=null;A!==null;)A.alternate!==null&&(D=A),A=A.sibling;D===null?v||p.tail===null?p.tail=null:p.tail.sibling=null:D.sibling=null}}function gn(p){var v=p.alternate!==null&&p.alternate.child===p.child,A=0,D=0;if(v)for(var k=p.child;k!==null;)A|=k.lanes|k.childLanes,D|=k.subtreeFlags&65011712,D|=k.flags&65011712,k.return=p,k=k.sibling;else for(k=p.child;k!==null;)A|=k.lanes|k.childLanes,D|=k.subtreeFlags,D|=k.flags,k.return=p,k=k.sibling;return p.subtreeFlags|=D,p.childLanes=A,v}function xy(p,v,A){var D=v.pendingProps;switch(Kb(v),v.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gn(v),null;case 1:return gn(v),null;case 3:return A=v.stateNode,D=null,p!==null&&(D=p.memoizedState.cache),v.memoizedState.cache!==D&&(v.flags|=2048),Bu(Na),he(),A.pendingContext&&(A.context=A.pendingContext,A.pendingContext=null),(p===null||p.child===null)&&(Pg(v)?Vu(v):p===null||p.memoizedState.isDehydrated&&(v.flags&256)===0||(v.flags|=1024,Zb())),gn(v),null;case 26:var k=v.type,B=v.memoizedState;return p===null?(Vu(v),B!==null?(gn(v),VM(v,B)):(gn(v),yy(v,k,null,D,A))):B?B!==p.memoizedState?(Vu(v),gn(v),VM(v,B)):(gn(v),v.flags&=-16777217):(p=p.memoizedProps,p!==D&&Vu(v),gn(v),yy(v,k,p,D,A)),null;case 27:if(Ee(v),A=Z.current,k=v.type,p!==null&&v.stateNode!=null)p.memoizedProps!==D&&Vu(v);else{if(!D){if(v.stateNode===null)throw Error(r(166));return gn(v),null}p=oe.current,Pg(v)?l3(v):(p=$K(k,D,A),v.stateNode=p,Vu(v))}return gn(v),null;case 5:if(Ee(v),k=v.type,p!==null&&v.stateNode!=null)p.memoizedProps!==D&&Vu(v);else{if(!D){if(v.stateNode===null)throw Error(r(166));return gn(v),null}if(B=oe.current,Pg(v))l3(v);else{var te=n2(Z.current);switch(B){case 1:B=te.createElementNS("http://www.w3.org/2000/svg",k);break;case 2:B=te.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;default:switch(k){case"svg":B=te.createElementNS("http://www.w3.org/2000/svg",k);break;case"math":B=te.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;case"script":B=te.createElement("div"),B.innerHTML="<script><\/script>",B=B.removeChild(B.firstChild);break;case"select":B=typeof D.is=="string"?te.createElement("select",{is:D.is}):te.createElement("select"),D.multiple?B.multiple=!0:D.size&&(B.size=D.size);break;default:B=typeof D.is=="string"?te.createElement(k,{is:D.is}):te.createElement(k)}}B[lt]=v,B[Vt]=D;e:for(te=v.child;te!==null;){if(te.tag===5||te.tag===6)B.appendChild(te.stateNode);else if(te.tag!==4&&te.tag!==27&&te.child!==null){te.child.return=te,te=te.child;continue}if(te===v)break e;for(;te.sibling===null;){if(te.return===null||te.return===v)break e;te=te.return}te.sibling.return=te.return,te=te.sibling}v.stateNode=B;e:switch(Bo(B,k,D),k){case"button":case"input":case"select":case"textarea":D=!!D.autoFocus;break e;case"img":D=!0;break e;default:D=!1}D&&Vu(v)}}return gn(v),yy(v,v.type,p===null?null:p.memoizedProps,v.pendingProps,A),null;case 6:if(p&&v.stateNode!=null)p.memoizedProps!==D&&Vu(v);else{if(typeof D!="string"&&v.stateNode===null)throw Error(r(166));if(p=Z.current,Pg(v)){if(p=v.stateNode,A=v.memoizedProps,D=null,k=pa,k!==null)switch(k.tag){case 27:case 5:D=k.memoizedProps}p[lt]=v,p=!!(p.nodeValue===A||D!==null&&D.suppressHydrationWarning===!0||BK(p.nodeValue,A)),p||Lu(v,!0)}else p=n2(p).createTextNode(D),p[lt]=v,v.stateNode=p}return gn(v),null;case 31:if(A=v.memoizedState,p===null||p.memoizedState!==null){if(D=Pg(v),A!==null){if(p===null){if(!D)throw Error(r(318));if(p=v.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(557));p[lt]=v}else Vd(),(v.flags&128)===0&&(v.memoizedState=null),v.flags|=4;gn(v),p=!1}else A=Zb(),p!==null&&p.memoizedState!==null&&(p.memoizedState.hydrationErrors=A),p=!0;if(!p)return v.flags&256?(Sa(v),v):(Sa(v),null);if((v.flags&128)!==0)throw Error(r(558))}return gn(v),null;case 13:if(D=v.memoizedState,p===null||p.memoizedState!==null&&p.memoizedState.dehydrated!==null){if(k=Pg(v),D!==null&&D.dehydrated!==null){if(p===null){if(!k)throw Error(r(318));if(k=v.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(r(317));k[lt]=v}else Vd(),(v.flags&128)===0&&(v.memoizedState=null),v.flags|=4;gn(v),k=!1}else k=Zb(),p!==null&&p.memoizedState!==null&&(p.memoizedState.hydrationErrors=k),k=!0;if(!k)return v.flags&256?(Sa(v),v):(Sa(v),null)}return Sa(v),(v.flags&128)!==0?(v.lanes=A,v):(A=D!==null,p=p!==null&&p.memoizedState!==null,A&&(D=v.child,k=null,D.alternate!==null&&D.alternate.memoizedState!==null&&D.alternate.memoizedState.cachePool!==null&&(k=D.alternate.memoizedState.cachePool.pool),B=null,D.memoizedState!==null&&D.memoizedState.cachePool!==null&&(B=D.memoizedState.cachePool.pool),B!==k&&(D.flags|=2048)),A!==p&&A&&(v.child.flags|=8192),Wh(v,v.updateQueue),gn(v),null);case 4:return he(),p===null&&xU(v.stateNode.containerInfo),gn(v),null;case 10:return Bu(v.type),gn(v),null;case 19:if(J(Cr),D=v.memoizedState,D===null)return gn(v),null;if(k=(v.flags&128)!==0,B=D.rendering,B===null)if(k)Hu(D,!1);else{if(ta!==0||p!==null&&(p.flags&128)!==0)for(p=v.child;p!==null;){if(B=Ll(p),B!==null){for(v.flags|=128,Hu(D,!1),p=B.updateQueue,v.updateQueue=p,Wh(v,p),v.subtreeFlags=0,p=A,A=v.child;A!==null;)Ag(A,p),A=A.sibling;return ae(Cr,Cr.current&1|2),Tr&&Iu(v,D.treeForkCount),v.child}p=p.sibling}D.tail!==null&&K()>Ea&&(v.flags|=128,k=!0,Hu(D,!1),v.lanes=4194304)}else{if(!k)if(p=Ll(B),p!==null){if(v.flags|=128,k=!0,p=p.updateQueue,v.updateQueue=p,Wh(v,p),Hu(D,!0),D.tail===null&&D.tailMode==="hidden"&&!B.alternate&&!Tr)return gn(v),null}else 2*K()-D.renderingStartTime>Ea&&A!==536870912&&(v.flags|=128,k=!0,Hu(D,!1),v.lanes=4194304);D.isBackwards?(B.sibling=v.child,v.child=B):(p=D.last,p!==null?p.sibling=B:v.child=B,D.last=B)}return D.tail!==null?(p=D.tail,D.rendering=p,D.tail=p.sibling,D.renderingStartTime=K(),p.sibling=null,A=Cr.current,ae(Cr,k?A&1|2:A&1),Tr&&Iu(v,D.treeForkCount),p):(gn(v),null);case 22:case 23:return Sa(v),hy(),D=v.memoizedState!==null,p!==null?p.memoizedState!==null!==D&&(v.flags|=8192):D&&(v.flags|=8192),D?(A&536870912)!==0&&(v.flags&128)===0&&(gn(v),v.subtreeFlags&6&&(v.flags|=8192)):gn(v),A=v.updateQueue,A!==null&&Wh(v,A.retryQueue),A=null,p!==null&&p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(A=p.memoizedState.cachePool.pool),D=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(D=v.memoizedState.cachePool.pool),D!==A&&(v.flags|=2048),p!==null&&J(Wd),null;case 24:return A=null,p!==null&&(A=p.memoizedState.cache),v.memoizedState.cache!==A&&(v.flags|=2048),Bu(Na),gn(v),null;case 25:return null;case 30:return null}throw Error(r(156,v.tag))}function _c(p,v){switch(Kb(v),v.tag){case 1:return p=v.flags,p&65536?(v.flags=p&-65537|128,v):null;case 3:return Bu(Na),he(),p=v.flags,(p&65536)!==0&&(p&128)===0?(v.flags=p&-65537|128,v):null;case 26:case 27:case 5:return Ee(v),null;case 31:if(v.memoizedState!==null){if(Sa(v),v.alternate===null)throw Error(r(340));Vd()}return p=v.flags,p&65536?(v.flags=p&-65537|128,v):null;case 13:if(Sa(v),p=v.memoizedState,p!==null&&p.dehydrated!==null){if(v.alternate===null)throw Error(r(340));Vd()}return p=v.flags,p&65536?(v.flags=p&-65537|128,v):null;case 19:return J(Cr),null;case 4:return he(),null;case 10:return Bu(v.type),null;case 22:case 23:return Sa(v),hy(),p!==null&&J(Wd),p=v.flags,p&65536?(v.flags=p&-65537|128,v):null;case 24:return Bu(Na),null;case 25:return null;default:return null}}function kl(p,v){switch(Kb(v),v.tag){case 3:Bu(Na),he();break;case 26:case 27:case 5:Ee(v);break;case 4:he();break;case 31:v.memoizedState!==null&&Sa(v);break;case 13:Sa(v);break;case 19:J(Cr);break;case 10:Bu(v.type);break;case 22:case 23:Sa(v),hy(),p!==null&&J(Wd);break;case 24:Bu(Na)}}function Sc(p,v){try{var A=v.updateQueue,D=A!==null?A.lastEffect:null;if(D!==null){var k=D.next;A=k;do{if((A.tag&p)===p){D=void 0;var B=A.create,te=A.inst;D=B(),te.destroy=D}A=A.next}while(A!==k)}}catch(ye){Vr(v,v.return,ye)}}function ks(p,v,A){try{var D=v.updateQueue,k=D!==null?D.lastEffect:null;if(k!==null){var B=k.next;D=B;do{if((D.tag&p)===p){var te=D.inst,ye=te.destroy;if(ye!==void 0){te.destroy=void 0,k=v;var Ie=A,it=ye;try{it()}catch(St){Vr(k,Ie,St)}}}D=D.next}while(D!==B)}}catch(St){Vr(v,v.return,St)}}function tu(p){var v=p.updateQueue;if(v!==null){var A=p.stateNode;try{f3(v,A)}catch(D){Vr(p,p.return,D)}}}function gs(p,v,A){A.props=Kd(p.type,p.memoizedProps),A.state=p.memoizedState;try{A.componentWillUnmount()}catch(D){Vr(p,v,D)}}function qh(p,v){try{var A=p.ref;if(A!==null){switch(p.tag){case 26:case 27:case 5:var D=p.stateNode;break;case 30:D=p.stateNode;break;default:D=p.stateNode}typeof A=="function"?p.refCleanup=A(D):A.current=D}}catch(k){Vr(p,v,k)}}function zs(p,v){var A=p.ref,D=p.refCleanup;if(A!==null)if(typeof D=="function")try{D()}catch(k){Vr(p,v,k)}finally{p.refCleanup=null,p=p.alternate,p!=null&&(p.refCleanup=null)}else if(typeof A=="function")try{A(null)}catch(k){Vr(p,v,k)}else A.current=null}function by(p){var v=p.type,A=p.memoizedProps,D=p.stateNode;try{e:switch(v){case"button":case"input":case"select":case"textarea":A.autoFocus&&D.focus();break e;case"img":A.src?D.src=A.src:A.srcSet&&(D.srcset=A.srcSet)}}catch(k){Vr(p,p.return,k)}}function Za(p,v,A){try{var D=p.stateNode;qMe(D,p.type,A,v),D[Vt]=v}catch(k){Vr(p,p.return,k)}}function qn(p){return p.tag===5||p.tag===3||p.tag===26||p.tag===27&&$g(p.type)||p.tag===4}function Ar(p){e:for(;;){for(;p.sibling===null;){if(p.return===null||qn(p.return))return null;p=p.return}for(p.sibling.return=p.return,p=p.sibling;p.tag!==5&&p.tag!==6&&p.tag!==18;){if(p.tag===27&&$g(p.type)||p.flags&2||p.child===null||p.tag===4)continue e;p.child.return=p,p=p.child}if(!(p.flags&2))return p.stateNode}}function Gu(p,v,A){var D=p.tag;if(D===5||D===6)p=p.stateNode,v?(A.nodeType===9?A.body:A.nodeName==="HTML"?A.ownerDocument.body:A).insertBefore(p,v):(v=A.nodeType===9?A.body:A.nodeName==="HTML"?A.ownerDocument.body:A,v.appendChild(p),A=A._reactRootContainer,A!=null||v.onclick!==null||(v.onclick=Nh));else if(D!==4&&(D===27&&$g(p.type)&&(A=p.stateNode,v=null),p=p.child,p!==null))for(Gu(p,v,A),p=p.sibling;p!==null;)Gu(p,v,A),p=p.sibling}function No(p,v,A){var D=p.tag;if(D===5||D===6)p=p.stateNode,v?A.insertBefore(p,v):A.appendChild(p);else if(D!==4&&(D===27&&$g(p.type)&&(A=p.stateNode),p=p.child,p!==null))for(No(p,v,A),p=p.sibling;p!==null;)No(p,v,A),p=p.sibling}function T1(p){var v=p.stateNode,A=p.memoizedProps;try{for(var D=p.type,k=v.attributes;k.length;)v.removeAttributeNode(k[0]);Bo(v,D,A),v[lt]=p,v[Vt]=A}catch(B){Vr(p,p.return,B)}}var Ac=!1,Dn=!1,iu=!1,t2=typeof WeakSet=="function"?WeakSet:Set,vs=null;function gU(p,v){if(p=p.containerInfo,_U=h2,p=r3(p),QA(p)){if("selectionStart"in p)var A={start:p.selectionStart,end:p.selectionEnd};else e:{A=(A=p.ownerDocument)&&A.defaultView||window;var D=A.getSelection&&A.getSelection();if(D&&D.rangeCount!==0){A=D.anchorNode;var k=D.anchorOffset,B=D.focusNode;D=D.focusOffset;try{A.nodeType,B.nodeType}catch{A=null;break e}var te=0,ye=-1,Ie=-1,it=0,St=0,Ct=p,ot=null;t:for(;;){for(var gt;Ct!==A||k!==0&&Ct.nodeType!==3||(ye=te+k),Ct!==B||D!==0&&Ct.nodeType!==3||(Ie=te+D),Ct.nodeType===3&&(te+=Ct.nodeValue.length),(gt=Ct.firstChild)!==null;)ot=Ct,Ct=gt;for(;;){if(Ct===p)break t;if(ot===A&&++it===k&&(ye=te),ot===B&&++St===D&&(Ie=te),(gt=Ct.nextSibling)!==null)break;Ct=ot,ot=Ct.parentNode}Ct=gt}A=ye===-1||Ie===-1?null:{start:ye,end:Ie}}else A=null}A=A||{start:0,end:0}}else A=null;for(SU={focusedElem:p,selectionRange:A},h2=!1,vs=v;vs!==null;)if(v=vs,p=v.child,(v.subtreeFlags&1028)!==0&&p!==null)p.return=v,vs=p;else for(;vs!==null;){switch(v=vs,B=v.alternate,p=v.flags,v.tag){case 0:if((p&4)!==0&&(p=v.updateQueue,p=p!==null?p.events:null,p!==null))for(A=0;A<p.length;A++)k=p[A],k.ref.impl=k.nextImpl;break;case 11:case 15:break;case 1:if((p&1024)!==0&&B!==null){p=void 0,A=v,k=B.memoizedProps,B=B.memoizedState,D=A.stateNode;try{var ci=Kd(A.type,k);p=D.getSnapshotBeforeUpdate(ci,B),D.__reactInternalSnapshotBeforeUpdate=p}catch(Ui){Vr(A,A.return,Ui)}}break;case 3:if((p&1024)!==0){if(p=v.stateNode.containerInfo,A=p.nodeType,A===9)EU(p);else if(A===1)switch(p.nodeName){case"HEAD":case"HTML":case"BODY":EU(p);break;default:p.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((p&1024)!==0)throw Error(r(163))}if(p=v.sibling,p!==null){p.return=v.return,vs=p;break}vs=v.return}}function Xn(p,v,A){var D=A.flags;switch(A.tag){case 0:case 11:case 15:Tc(p,A),D&4&&Sc(5,A);break;case 1:if(Tc(p,A),D&4)if(p=A.stateNode,v===null)try{p.componentDidMount()}catch(te){Vr(A,A.return,te)}else{var k=Kd(A.type,v.memoizedProps);v=v.memoizedState;try{p.componentDidUpdate(k,v,p.__reactInternalSnapshotBeforeUpdate)}catch(te){Vr(A,A.return,te)}}D&64&&tu(A),D&512&&qh(A,A.return);break;case 3:if(Tc(p,A),D&64&&(p=A.updateQueue,p!==null)){if(v=null,A.child!==null)switch(A.child.tag){case 27:case 5:v=A.child.stateNode;break;case 1:v=A.child.stateNode}try{f3(p,v)}catch(te){Vr(A,A.return,te)}}break;case 27:v===null&&D&4&&T1(A);case 26:case 5:Tc(p,A),v===null&&D&4&&by(A),D&512&&qh(A,A.return);break;case 12:Tc(p,A);break;case 31:Tc(p,A),D&4&&Qd(p,A);break;case 13:Tc(p,A),D&4&&jg(p,A),D&64&&(p=A.memoizedState,p!==null&&(p=p.dehydrated,p!==null&&(A=O.bind(null,A),eEe(p,A))));break;case 22:if(D=A.memoizedState!==null||Ac,!D){v=v!==null&&v.memoizedState!==null||Dn,k=Ac;var B=Dn;Ac=D,(Dn=v)&&!B?Lo(p,A,(A.subtreeFlags&8772)!==0):Tc(p,A),Ac=k,Dn=B}break;case 30:break;default:Tc(p,A)}}function wy(p){var v=p.alternate;v!==null&&(p.alternate=null,wy(v)),p.child=null,p.deletions=null,p.sibling=null,p.tag===5&&(v=p.stateNode,v!==null&&bi(v)),p.stateNode=null,p.return=null,p.dependencies=null,p.memoizedProps=null,p.memoizedState=null,p.pendingProps=null,p.stateNode=null,p.updateQueue=null}var ln=null,co=!1;function Mc(p,v,A){for(A=A.child;A!==null;)C1(p,v,A),A=A.sibling}function C1(p,v,A){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(Qe,A)}catch{}switch(A.tag){case 26:Dn||zs(A,v),Mc(p,v,A),A.memoizedState?A.memoizedState.count--:A.stateNode&&(A=A.stateNode,A.parentNode.removeChild(A));break;case 27:Dn||zs(A,v);var D=ln,k=co;$g(A.type)&&(ln=A.stateNode,co=!1),Mc(p,v,A),$M(A.stateNode),ln=D,co=k;break;case 5:Dn||zs(A,v);case 6:if(D=ln,k=co,ln=null,Mc(p,v,A),ln=D,co=k,ln!==null)if(co)try{(ln.nodeType===9?ln.body:ln.nodeName==="HTML"?ln.ownerDocument.body:ln).removeChild(A.stateNode)}catch(B){Vr(A,v,B)}else try{ln.removeChild(A.stateNode)}catch(B){Vr(A,v,B)}break;case 18:ln!==null&&(co?(p=ln,GK(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,A.stateNode),k1(p)):GK(ln,A.stateNode));break;case 4:D=ln,k=co,ln=A.stateNode.containerInfo,co=!0,Mc(p,v,A),ln=D,co=k;break;case 0:case 11:case 14:case 15:ks(2,A,v),Dn||ks(4,A,v),Mc(p,v,A);break;case 1:Dn||(zs(A,v),D=A.stateNode,typeof D.componentWillUnmount=="function"&&gs(A,v,D)),Mc(p,v,A);break;case 21:Mc(p,v,A);break;case 22:Dn=(D=Dn)||A.memoizedState!==null,Mc(p,v,A),Dn=D;break;default:Mc(p,v,A)}}function Qd(p,v){if(v.memoizedState===null&&(p=v.alternate,p!==null&&(p=p.memoizedState,p!==null))){p=p.dehydrated;try{k1(p)}catch(A){Vr(v,v.return,A)}}}function jg(p,v){if(v.memoizedState===null&&(p=v.alternate,p!==null&&(p=p.memoizedState,p!==null&&(p=p.dehydrated,p!==null))))try{k1(p)}catch(A){Vr(v,v.return,A)}}function HM(p){switch(p.tag){case 31:case 13:case 19:var v=p.stateNode;return v===null&&(v=p.stateNode=new t2),v;case 22:return p=p.stateNode,v=p._retryCache,v===null&&(v=p._retryCache=new t2),v;default:throw Error(r(435,p.tag))}}function Xh(p,v){var A=HM(p);v.forEach(function(D){if(!A.has(D)){A.add(D);var k=N.bind(null,p,D);D.then(k,k)}})}function Ja(p,v){var A=v.deletions;if(A!==null)for(var D=0;D<A.length;D++){var k=A[D],B=p,te=v,ye=te;e:for(;ye!==null;){switch(ye.tag){case 27:if($g(ye.type)){ln=ye.stateNode,co=!1;break e}break;case 5:ln=ye.stateNode,co=!1;break e;case 3:case 4:ln=ye.stateNode.containerInfo,co=!0;break e}ye=ye.return}if(ln===null)throw Error(r(160));C1(B,te,k),ln=null,co=!1,B=k.alternate,B!==null&&(B.return=null),k.return=null}if(v.subtreeFlags&13886)for(v=v.child;v!==null;)Zd(v,p),v=v.sibling}var Ec=null;function Zd(p,v){var A=p.alternate,D=p.flags;switch(p.tag){case 0:case 11:case 14:case 15:Ja(v,p),es(p),D&4&&(ks(3,p,p.return),Sc(3,p),ks(5,p,p.return));break;case 1:Ja(v,p),es(p),D&512&&(Dn||A===null||zs(A,A.return)),D&64&&Ac&&(p=p.updateQueue,p!==null&&(D=p.callbacks,D!==null&&(A=p.shared.hiddenCallbacks,p.shared.hiddenCallbacks=A===null?D:A.concat(D))));break;case 26:var k=Ec;if(Ja(v,p),es(p),D&512&&(Dn||A===null||zs(A,A.return)),D&4){var B=A!==null?A.memoizedState:null;if(D=p.memoizedState,A===null)if(D===null)if(p.stateNode===null){e:{D=p.type,A=p.memoizedProps,k=k.ownerDocument||k;t:switch(D){case"title":B=k.getElementsByTagName("title")[0],(!B||B[Si]||B[lt]||B.namespaceURI==="http://www.w3.org/2000/svg"||B.hasAttribute("itemprop"))&&(B=k.createElement(D),k.head.insertBefore(B,k.querySelector("head > title"))),Bo(B,D,A),B[lt]=p,De(B),D=B;break e;case"link":var te=tQ("link","href",k).get(D+(A.href||""));if(te){for(var ye=0;ye<te.length;ye++)if(B=te[ye],B.getAttribute("href")===(A.href==null||A.href===""?null:A.href)&&B.getAttribute("rel")===(A.rel==null?null:A.rel)&&B.getAttribute("title")===(A.title==null?null:A.title)&&B.getAttribute("crossorigin")===(A.crossOrigin==null?null:A.crossOrigin)){te.splice(ye,1);break t}}B=k.createElement(D),Bo(B,D,A),k.head.appendChild(B);break;case"meta":if(te=tQ("meta","content",k).get(D+(A.content||""))){for(ye=0;ye<te.length;ye++)if(B=te[ye],B.getAttribute("content")===(A.content==null?null:""+A.content)&&B.getAttribute("name")===(A.name==null?null:A.name)&&B.getAttribute("property")===(A.property==null?null:A.property)&&B.getAttribute("http-equiv")===(A.httpEquiv==null?null:A.httpEquiv)&&B.getAttribute("charset")===(A.charSet==null?null:A.charSet)){te.splice(ye,1);break t}}B=k.createElement(D),Bo(B,D,A),k.head.appendChild(B);break;default:throw Error(r(468,D))}B[lt]=p,De(B),D=B}p.stateNode=D}else iQ(k,p.type,p.stateNode);else p.stateNode=eQ(k,D,p.memoizedProps);else B!==D?(B===null?A.stateNode!==null&&(A=A.stateNode,A.parentNode.removeChild(A)):B.count--,D===null?iQ(k,p.type,p.stateNode):eQ(k,D,p.memoizedProps)):D===null&&p.stateNode!==null&&Za(p,p.memoizedProps,A.memoizedProps)}break;case 27:Ja(v,p),es(p),D&512&&(Dn||A===null||zs(A,A.return)),A!==null&&D&4&&Za(p,p.memoizedProps,A.memoizedProps);break;case 5:if(Ja(v,p),es(p),D&512&&(Dn||A===null||zs(A,A.return)),p.flags&32){k=p.stateNode;try{so(k,"")}catch(ci){Vr(p,p.return,ci)}}D&4&&p.stateNode!=null&&(k=p.memoizedProps,Za(p,k,A!==null?A.memoizedProps:k)),D&1024&&(iu=!0);break;case 6:if(Ja(v,p),es(p),D&4){if(p.stateNode===null)throw Error(r(162));D=p.memoizedProps,A=p.stateNode;try{A.nodeValue=D}catch(ci){Vr(p,p.return,ci)}}break;case 3:if(o2=null,k=Ec,Ec=a2(v.containerInfo),Ja(v,p),Ec=k,es(p),D&4&&A!==null&&A.memoizedState.isDehydrated)try{k1(v.containerInfo)}catch(ci){Vr(p,p.return,ci)}iu&&(iu=!1,P1(p));break;case 4:D=Ec,Ec=a2(p.stateNode.containerInfo),Ja(v,p),es(p),Ec=D;break;case 12:Ja(v,p),es(p);break;case 31:Ja(v,p),es(p),D&4&&(D=p.updateQueue,D!==null&&(p.updateQueue=null,Xh(p,D)));break;case 13:Ja(v,p),es(p),p.child.flags&8192&&p.memoizedState!==null!=(A!==null&&A.memoizedState!==null)&&(Fg=K()),D&4&&(D=p.updateQueue,D!==null&&(p.updateQueue=null,Xh(p,D)));break;case 22:k=p.memoizedState!==null;var Ie=A!==null&&A.memoizedState!==null,it=Ac,St=Dn;if(Ac=it||k,Dn=St||Ie,Ja(v,p),Dn=St,Ac=it,es(p),D&8192)e:for(v=p.stateNode,v._visibility=k?v._visibility&-2:v._visibility|1,k&&(A===null||Ie||Ac||Dn||Wu(p)),A=null,v=p;;){if(v.tag===5||v.tag===26){if(A===null){Ie=A=v;try{if(B=Ie.stateNode,k)te=B.style,typeof te.setProperty=="function"?te.setProperty("display","none","important"):te.display="none";else{ye=Ie.stateNode;var Ct=Ie.memoizedProps.style,ot=Ct!=null&&Ct.hasOwnProperty("display")?Ct.display:null;ye.style.display=ot==null||typeof ot=="boolean"?"":(""+ot).trim()}}catch(ci){Vr(Ie,Ie.return,ci)}}}else if(v.tag===6){if(A===null){Ie=v;try{Ie.stateNode.nodeValue=k?"":Ie.memoizedProps}catch(ci){Vr(Ie,Ie.return,ci)}}}else if(v.tag===18){if(A===null){Ie=v;try{var gt=Ie.stateNode;k?WK(gt,!0):WK(Ie.stateNode,!1)}catch(ci){Vr(Ie,Ie.return,ci)}}}else if((v.tag!==22&&v.tag!==23||v.memoizedState===null||v===p)&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===p)break e;for(;v.sibling===null;){if(v.return===null||v.return===p)break e;A===v&&(A=null),v=v.return}A===v&&(A=null),v.sibling.return=v.return,v=v.sibling}D&4&&(D=p.updateQueue,D!==null&&(A=D.retryQueue,A!==null&&(D.retryQueue=null,Xh(p,A))));break;case 19:Ja(v,p),es(p),D&4&&(D=p.updateQueue,D!==null&&(p.updateQueue=null,Xh(p,D)));break;case 30:break;case 21:break;default:Ja(v,p),es(p)}}function es(p){var v=p.flags;if(v&2){try{for(var A,D=p.return;D!==null;){if(qn(D)){A=D;break}D=D.return}if(A==null)throw Error(r(160));switch(A.tag){case 27:var k=A.stateNode,B=Ar(p);No(p,B,k);break;case 5:var te=A.stateNode;A.flags&32&&(so(te,""),A.flags&=-33);var ye=Ar(p);No(p,ye,te);break;case 3:case 4:var Ie=A.stateNode.containerInfo,it=Ar(p);Gu(p,it,Ie);break;default:throw Error(r(161))}}catch(St){Vr(p,p.return,St)}p.flags&=-3}v&4096&&(p.flags&=-4097)}function P1(p){if(p.subtreeFlags&1024)for(p=p.child;p!==null;){var v=p;P1(v),v.tag===5&&v.flags&1024&&v.stateNode.reset(),p=p.sibling}}function Tc(p,v){if(v.subtreeFlags&8772)for(v=v.child;v!==null;)Xn(p,v.alternate,v),v=v.sibling}function Wu(p){for(p=p.child;p!==null;){var v=p;switch(v.tag){case 0:case 11:case 14:case 15:ks(4,v,v.return),Wu(v);break;case 1:zs(v,v.return);var A=v.stateNode;typeof A.componentWillUnmount=="function"&&gs(v,v.return,A),Wu(v);break;case 27:$M(v.stateNode);case 26:case 5:zs(v,v.return),Wu(v);break;case 22:v.memoizedState===null&&Wu(v);break;case 30:Wu(v);break;default:Wu(v)}p=p.sibling}}function Lo(p,v,A){for(A=A&&(v.subtreeFlags&8772)!==0,v=v.child;v!==null;){var D=v.alternate,k=p,B=v,te=B.flags;switch(B.tag){case 0:case 11:case 15:Lo(k,B,A),Sc(4,B);break;case 1:if(Lo(k,B,A),D=B,k=D.stateNode,typeof k.componentDidMount=="function")try{k.componentDidMount()}catch(it){Vr(D,D.return,it)}if(D=B,k=D.updateQueue,k!==null){var ye=D.stateNode;try{var Ie=k.shared.hiddenCallbacks;if(Ie!==null)for(k.shared.hiddenCallbacks=null,k=0;k<Ie.length;k++)Ng(Ie[k],ye)}catch(it){Vr(D,D.return,it)}}A&&te&64&&tu(B),qh(B,B.return);break;case 27:T1(B);case 26:case 5:Lo(k,B,A),A&&D===null&&te&4&&by(B),qh(B,B.return);break;case 12:Lo(k,B,A);break;case 31:Lo(k,B,A),A&&te&4&&Qd(k,B);break;case 13:Lo(k,B,A),A&&te&4&&jg(k,B);break;case 22:B.memoizedState===null&&Lo(k,B,A),qh(B,B.return);break;case 30:break;default:Lo(k,B,A)}v=v.sibling}}function Jd(p,v){var A=null;p!==null&&p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(A=p.memoizedState.cachePool.pool),p=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(p=v.memoizedState.cachePool.pool),p!==A&&(p!=null&&p.refCount++,A!=null&&Sp(A))}function zp(p,v){p=null,v.alternate!==null&&(p=v.alternate.memoizedState.cache),v=v.memoizedState.cache,v!==p&&(v.refCount++,p!=null&&Sp(p))}function Bs(p,v,A,D){if(v.subtreeFlags&10256)for(v=v.child;v!==null;)GM(p,v,A,D),v=v.sibling}function GM(p,v,A,D){var k=v.flags;switch(v.tag){case 0:case 11:case 15:Bs(p,v,A,D),k&2048&&Sc(9,v);break;case 1:Bs(p,v,A,D);break;case 3:Bs(p,v,A,D),k&2048&&(p=null,v.alternate!==null&&(p=v.alternate.memoizedState.cache),v=v.memoizedState.cache,v!==p&&(v.refCount++,p!=null&&Sp(p)));break;case 12:if(k&2048){Bs(p,v,A,D),p=v.stateNode;try{var B=v.memoizedProps,te=B.id,ye=B.onPostCommit;typeof ye=="function"&&ye(te,v.alternate===null?"mount":"update",p.passiveEffectDuration,-0)}catch(Ie){Vr(v,v.return,Ie)}}else Bs(p,v,A,D);break;case 31:Bs(p,v,A,D);break;case 13:Bs(p,v,A,D);break;case 23:break;case 22:B=v.stateNode,te=v.alternate,v.memoizedState!==null?B._visibility&2?Bs(p,v,A,D):qu(p,v):B._visibility&2?Bs(p,v,A,D):(B._visibility|=2,Us(p,v,A,D,(v.subtreeFlags&10256)!==0||!1)),k&2048&&Jd(te,v);break;case 24:Bs(p,v,A,D),k&2048&&zp(v.alternate,v);break;default:Bs(p,v,A,D)}}function Us(p,v,A,D,k){for(k=k&&((v.subtreeFlags&10256)!==0||!1),v=v.child;v!==null;){var B=p,te=v,ye=A,Ie=D,it=te.flags;switch(te.tag){case 0:case 11:case 15:Us(B,te,ye,Ie,k),Sc(8,te);break;case 23:break;case 22:var St=te.stateNode;te.memoizedState!==null?St._visibility&2?Us(B,te,ye,Ie,k):qu(B,te):(St._visibility|=2,Us(B,te,ye,Ie,k)),k&&it&2048&&Jd(te.alternate,te);break;case 24:Us(B,te,ye,Ie,k),k&&it&2048&&zp(te.alternate,te);break;default:Us(B,te,ye,Ie,k)}v=v.sibling}}function qu(p,v){if(v.subtreeFlags&10256)for(v=v.child;v!==null;){var A=p,D=v,k=D.flags;switch(D.tag){case 22:qu(A,D),k&2048&&Jd(D.alternate,D);break;case 24:qu(A,D),k&2048&&zp(D.alternate,D);break;default:qu(A,D)}v=v.sibling}}var Bp=8192;function zl(p,v,A){if(p.subtreeFlags&Bp)for(p=p.child;p!==null;)D1(p,v,A),p=p.sibling}function D1(p,v,A){switch(p.tag){case 26:zl(p,v,A),p.flags&Bp&&p.memoizedState!==null&&dEe(A,Ec,p.memoizedState,p.memoizedProps);break;case 5:zl(p,v,A);break;case 3:case 4:var D=Ec;Ec=a2(p.stateNode.containerInfo),zl(p,v,A),Ec=D;break;case 22:p.memoizedState===null&&(D=p.alternate,D!==null&&D.memoizedState!==null?(D=Bp,Bp=16777216,zl(p,v,A),Bp=D):zl(p,v,A));break;default:zl(p,v,A)}}function Up(p){var v=p.alternate;if(v!==null&&(p=v.child,p!==null)){v.child=null;do v=p.sibling,p.sibling=null,p=v;while(p!==null)}}function ef(p){var v=p.deletions;if((p.flags&16)!==0){if(v!==null)for(var A=0;A<v.length;A++){var D=v[A];vs=D,ma(D,p)}Up(p)}if(p.subtreeFlags&10256)for(p=p.child;p!==null;)ll(p),p=p.sibling}function ll(p){switch(p.tag){case 0:case 11:case 15:ef(p),p.flags&2048&&ks(9,p,p.return);break;case 3:ef(p);break;case 12:ef(p);break;case 22:var v=p.stateNode;p.memoizedState!==null&&v._visibility&2&&(p.return===null||p.return.tag!==13)?(v._visibility&=-3,cl(p)):ef(p);break;default:ef(p)}}function cl(p){var v=p.deletions;if((p.flags&16)!==0){if(v!==null)for(var A=0;A<v.length;A++){var D=v[A];vs=D,ma(D,p)}Up(p)}for(p=p.child;p!==null;){switch(v=p,v.tag){case 0:case 11:case 15:ks(8,v,v.return),cl(v);break;case 22:A=v.stateNode,A._visibility&2&&(A._visibility&=-3,cl(v));break;default:cl(v)}p=p.sibling}}function ma(p,v){for(;vs!==null;){var A=vs;switch(A.tag){case 0:case 11:case 15:ks(8,A,v);break;case 23:case 22:if(A.memoizedState!==null&&A.memoizedState.cachePool!==null){var D=A.memoizedState.cachePool.pool;D!=null&&D.refCount++}break;case 24:Sp(A.memoizedState.cache)}if(D=A.child,D!==null)D.return=A,vs=D;else e:for(A=p;vs!==null;){D=vs;var k=D.sibling,B=D.return;if(wy(D),D===A){vs=null;break e}if(k!==null){k.return=B,vs=k;break e}vs=B}}}var Yh={getCacheForType:function(p){var v=Fi(Na),A=v.data.get(p);return A===void 0&&(A=p(),v.data.set(p,A)),A},cacheSignal:function(){return Fi(Na).controller.signal}},ir=typeof WeakMap=="function"?WeakMap:Map,vi=0,qi=null,hr=null,lr=0,Or=0,uo=null,Cc=!1,ru=!1,WM=!1,Bl=0,ta=0,Xu=0,tf=0,_y=0,ko=0,Un=0,jp=null,ga=null,va=!1,Fg=0,qM=0,Ea=1/0,ia=null,Ta=null,cn=0,Ul=null,Vg=null,Pc=0,Hg=0,Gg=null,Sy=null,rf=0,Fp=null;function jl(){return(vi&2)!==0&&lr!==0?lr&-lr:H.T!==null?ht():Ke()}function yr(){if(ko===0)if((lr&536870912)===0||Tr){var p=je;je<<=1,(je&3932160)===0&&(je=262144),ko=p}else ko=536870912;return p=nl.current,p!==null&&(p.flags|=32),ko}function dr(p,v,A){(p===qi&&(Or===2||Or===9)||p.cancelPendingCommit!==null)&&(af(p,0),ka(p,lr,ko,!1)),pn(p,A),((vi&2)===0||p!==qi)&&(p===qi&&((vi&2)===0&&(tf|=A),ta===4&&ka(p,lr,ko,!1)),It(p))}function xr(p,v,A){if((vi&6)!==0)throw Error(r(327));var D=!A&&(v&127)===0&&(v&p.expiredLanes)===0||Lt(p,v),k=D?Ay(p,v):zo(p,v,!0),B=D;do{if(k===0){ru&&!D&&ka(p,v,0,!1);break}else{if(A=p.current.alternate,B&&!un(A)){k=zo(p,v,!1),B=!1;continue}if(k===2){if(B=v,p.errorRecoveryDisabledLanes&B)var te=0;else te=p.pendingLanes&-536870913,te=te!==0?te:te&536870912?536870912:0;if(te!==0){v=te;e:{var ye=p;k=jp;var Ie=ye.current.memoizedState.isDehydrated;if(Ie&&(af(ye,te).flags|=256),te=zo(ye,te,!1),te!==2){if(WM&&!Ie){ye.errorRecoveryDisabledLanes|=B,tf|=B,k=4;break e}B=ga,ga=k,B!==null&&(ga===null?ga=B:ga.push.apply(ga,B))}k=te}if(B=!1,k!==2)continue}}if(k===1){af(p,0),ka(p,v,0,!0);break}e:{switch(D=p,B=k,B){case 0:case 1:throw Error(r(345));case 4:if((v&4194048)!==v)break;case 6:ka(D,v,ko,!Cc);break e;case 2:ga=null;break;case 3:case 5:break;default:throw Error(r(329))}if((v&62914560)===v&&(k=Fg+300-K(),10<k)){if(ka(D,v,ko,!Cc),$e(D,0,!0)!==0)break e;Pc=v,D.timeoutHandle=VK(Mr.bind(null,D,A,ga,ia,va,v,ko,tf,Un,Cc,B,"Throttled",-0,0),k);break e}Mr(D,A,ga,ia,va,v,ko,tf,Un,Cc,B,null,-0,0)}}break}while(!0);It(p)}function Mr(p,v,A,D,k,B,te,ye,Ie,it,St,Ct,ot,gt){if(p.timeoutHandle=-1,Ct=v.subtreeFlags,Ct&8192||(Ct&16785408)===16785408){Ct={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Nh},D1(v,B,Ct);var ci=(B&62914560)===B?Fg-K():(B&4194048)===B?qM-K():0;if(ci=fEe(Ct,ci),ci!==null){Pc=B,p.cancelPendingCommit=ci(Kh.bind(null,p,v,B,A,D,k,te,ye,Ie,St,Ct,null,ot,gt)),ka(p,B,te,!it);return}}Kh(p,v,B,A,D,k,te,ye,Ie)}function un(p){for(var v=p;;){var A=v.tag;if((A===0||A===11||A===15)&&v.flags&16384&&(A=v.updateQueue,A!==null&&(A=A.stores,A!==null)))for(var D=0;D<A.length;D++){var k=A[D],B=k.getSnapshot;k=k.value;try{if(!Do(B(),k))return!1}catch{return!1}}if(A=v.child,v.subtreeFlags&16384&&A!==null)A.return=v,v=A;else{if(v===p)break;for(;v.sibling===null;){if(v.return===null||v.return===p)return!0;v=v.return}v.sibling.return=v.return,v=v.sibling}}return!0}function ka(p,v,A,D){v&=~_y,v&=~tf,p.suspendedLanes|=v,p.pingedLanes&=~v,D&&(p.warmLanes|=v),D=p.expirationTimes;for(var k=v;0<k;){var B=31-xt(k),te=1<<B;D[B]=-1,k&=~te}A!==0&&no(p,A,v)}function nu(){return(vi&6)===0?(Qt(0),!1):!0}function nf(){if(hr!==null){if(Or===0)var p=hr.return;else p=hr,zu=Hd=null,mM(p),Cp=null,Pp=0,p=hr;for(;p!==null;)kl(p.alternate,p),p=p.return;hr=null}}function af(p,v){var A=p.timeoutHandle;A!==-1&&(p.timeoutHandle=-1,$Me(A)),A=p.cancelPendingCommit,A!==null&&(p.cancelPendingCommit=null,A()),Pc=0,nf(),qi=p,hr=A=tl(p.current,null),lr=v,Or=0,uo=null,Cc=!1,ru=Lt(p,v),WM=!1,Un=ko=_y=tf=Xu=ta=0,ga=jp=null,va=!1,(v&8)!==0&&(v|=v&32);var D=p.entangledLanes;if(D!==0)for(p=p.entanglements,D&=v;0<D;){var k=31-xt(D),B=1<<k;v|=p[k],D&=~B}return Bl=v,ry(),A}function Yu(p,v){tr=null,H.H=Bg,v===Ap||v===ur?(v=Ep(),Or=3):v===oy?(v=Ep(),Or=4):Or=v===y1?8:v!==null&&typeof v=="object"&&typeof v.then=="function"?6:1,uo=v,hr===null&&(ta=1,v1(p,Rl(v,p.current)))}function ra(){var p=nl.current;return p===null?!0:(lr&4194048)===lr?Io===null:(lr&62914560)===lr||(lr&536870912)!==0?p===Io:!1}function $h(){var p=H.H;return H.H=Bg,p===null?Bg:p}function sf(){var p=H.A;return H.A=Yh,p}function Wg(){ta=4,Cc||(lr&4194048)!==lr&&nl.current!==null||(ru=!0),(Xu&134217727)===0&&(tf&134217727)===0||qi===null||ka(qi,lr,ko,!1)}function zo(p,v,A){var D=vi;vi|=2;var k=$h(),B=sf();(qi!==p||lr!==v)&&(ia=null,af(p,v)),v=!1;var te=ta;e:do try{if(Or!==0&&hr!==null){var ye=hr,Ie=uo;switch(Or){case 8:nf(),te=6;break e;case 3:case 2:case 9:case 6:nl.current===null&&(v=!0);var it=Or;if(Or=0,uo=null,Vp(p,ye,Ie,it),A&&ru){te=0;break e}break;default:it=Or,Or=0,uo=null,Vp(p,ye,Ie,it)}}qg(),te=ta;break}catch(St){Yu(p,St)}while(!0);return v&&p.shellSuspendCounter++,zu=Hd=null,vi=D,H.H=k,H.A=B,hr===null&&(qi=null,lr=0,ry()),te}function qg(){for(;hr!==null;)O1(hr)}function Ay(p,v){var A=vi;vi|=2;var D=$h(),k=sf();qi!==p||lr!==v?(ia=null,Ea=K()+500,af(p,v)):ru=Lt(p,v);e:do try{if(Or!==0&&hr!==null){v=hr;var B=uo;t:switch(Or){case 1:Or=0,uo=null,Vp(p,v,B,1);break;case 2:case 9:if(rl(B)){Or=0,uo=null,My(v);break}v=function(){Or!==2&&Or!==9||qi!==p||(Or=7),It(p)},B.then(v,v);break e;case 3:Or=7;break e;case 4:Or=5;break e;case 7:rl(B)?(Or=0,uo=null,My(v)):(Or=0,uo=null,Vp(p,v,B,7));break;case 5:var te=null;switch(hr.tag){case 26:te=hr.memoizedState;case 5:case 27:var ye=hr;if(te?rQ(te):ye.stateNode.complete){Or=0,uo=null;var Ie=ye.sibling;if(Ie!==null)hr=Ie;else{var it=ye.return;it!==null?(hr=it,of(it)):hr=null}break t}}Or=0,uo=null,Vp(p,v,B,5);break;case 6:Or=0,uo=null,Vp(p,v,B,6);break;case 8:nf(),ta=6;break e;default:throw Error(r(462))}}ul();break}catch(St){Yu(p,St)}while(!0);return zu=Hd=null,H.H=D,H.A=k,vi=A,hr!==null?0:(qi=null,lr=0,ry(),ta)}function ul(){for(;hr!==null&&!fe();)O1(hr)}function O1(p){var v=E1(p.alternate,p,Bl);p.memoizedProps=p.pendingProps,v===null?of(p):hr=v}function My(p){var v=p,A=v.alternate;switch(v.tag){case 15:case 0:v=gy(A,v,v.pendingProps,v.type,void 0,lr);break;case 11:v=gy(A,v,v.pendingProps,v.type.render,v.ref,lr);break;case 5:mM(v);default:kl(A,v),v=hr=Ag(v,Bl),v=E1(A,v,Bl)}p.memoizedProps=p.pendingProps,v===null?of(p):hr=v}function Vp(p,v,A,D){zu=Hd=null,mM(v),Cp=null,Pp=0;var k=v.return;try{if(Qa(p,k,v,A,lr)){ta=1,v1(p,Rl(A,p.current)),hr=null;return}}catch(B){if(k!==null)throw hr=k,B;ta=1,v1(p,Rl(A,p.current)),hr=null;return}v.flags&32768?(Tr||D===1?p=!0:ru||(lr&536870912)!==0?p=!1:(Cc=p=!0,(D===2||D===9||D===3||D===6)&&(D=nl.current,D!==null&&D.tag===13&&(D.flags|=16384))),Ey(v,p)):of(v)}function of(p){var v=p;do{if((v.flags&32768)!==0){Ey(v,Cc);return}p=v.return;var A=xy(v.alternate,v,Bl);if(A!==null){hr=A;return}if(v=v.sibling,v!==null){hr=v;return}hr=v=p}while(v!==null);ta===0&&(ta=5)}function Ey(p,v){do{var A=_c(p.alternate,p);if(A!==null){A.flags&=32767,hr=A;return}if(A=p.return,A!==null&&(A.flags|=32768,A.subtreeFlags=0,A.deletions=null),!v&&(p=p.sibling,p!==null)){hr=p;return}hr=p=A}while(p!==null);ta=6,hr=null}function Kh(p,v,A,D,k,B,te,ye,Ie){p.cancelPendingCommit=null;do Xg();while(cn!==0);if((vi&6)!==0)throw Error(r(327));if(v!==null){if(v===p.current)throw Error(r(177));if(B=v.lanes|v.childLanes,B|=fs,sn(p,A,B,te,ye,Ie),p===qi&&(hr=qi=null,lr=0),Vg=v,Ul=p,Pc=A,Hg=B,Gg=k,Sy=D,(v.subtreeFlags&10256)!==0||(v.flags&10256)!==0?(p.callbackNode=null,p.callbackPriority=0,V(Ue,function(){return R1(),null})):(p.callbackNode=null,p.callbackPriority=0),D=(v.flags&13878)!==0,(v.subtreeFlags&13878)!==0||D){D=H.T,H.T=null,k=W.p,W.p=2,te=vi,vi|=4;try{gU(p,v,A)}finally{vi=te,W.p=k,H.T=D}}cn=1,za(),Qh(),Hp()}}function za(){if(cn===1){cn=0;var p=Ul,v=Vg,A=(v.flags&13878)!==0;if((v.subtreeFlags&13878)!==0||A){A=H.T,H.T=null;var D=W.p;W.p=2;var k=vi;vi|=4;try{Zd(v,p);var B=SU,te=r3(p.containerInfo),ye=B.focusedElem,Ie=B.selectionRange;if(te!==ye&&ye&&ye.ownerDocument&&Cn(ye.ownerDocument.documentElement,ye)){if(Ie!==null&&QA(ye)){var it=Ie.start,St=Ie.end;if(St===void 0&&(St=it),"selectionStart"in ye)ye.selectionStart=it,ye.selectionEnd=Math.min(St,ye.value.length);else{var Ct=ye.ownerDocument||document,ot=Ct&&Ct.defaultView||window;if(ot.getSelection){var gt=ot.getSelection(),ci=ye.textContent.length,Ui=Math.min(Ie.start,ci),Rn=Ie.end===void 0?Ui:Math.min(Ie.end,ci);!gt.extend&&Ui>Rn&&(te=Rn,Rn=Ui,Ui=te);var qe=wg(ye,Ui),Fe=wg(ye,Rn);if(qe&&Fe&&(gt.rangeCount!==1||gt.anchorNode!==qe.node||gt.anchorOffset!==qe.offset||gt.focusNode!==Fe.node||gt.focusOffset!==Fe.offset)){var tt=Ct.createRange();tt.setStart(qe.node,qe.offset),gt.removeAllRanges(),Ui>Rn?(gt.addRange(tt),gt.extend(Fe.node,Fe.offset)):(tt.setEnd(Fe.node,Fe.offset),gt.addRange(tt))}}}}for(Ct=[],gt=ye;gt=gt.parentNode;)gt.nodeType===1&&Ct.push({element:gt,left:gt.scrollLeft,top:gt.scrollTop});for(typeof ye.focus=="function"&&ye.focus(),ye=0;ye<Ct.length;ye++){var Et=Ct[ye];Et.element.scrollLeft=Et.left,Et.element.scrollTop=Et.top}}h2=!!_U,SU=_U=null}finally{vi=k,W.p=D,H.T=A}}p.current=v,cn=2}}function Qh(){if(cn===2){cn=0;var p=Ul,v=Vg,A=(v.flags&8772)!==0;if((v.subtreeFlags&8772)!==0||A){A=H.T,H.T=null;var D=W.p;W.p=2;var k=vi;vi|=4;try{Xn(p,v.alternate,v)}finally{vi=k,W.p=D,H.T=A}}cn=3}}function Hp(){if(cn===4||cn===3){cn=0,q();var p=Ul,v=Vg,A=Pc,D=Sy;(v.subtreeFlags&10256)!==0||(v.flags&10256)!==0?cn=5:(cn=0,Vg=Ul=null,$u(p,p.pendingLanes));var k=p.pendingLanes;if(k===0&&(Ta=null),_e(A),v=v.stateNode,rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(Qe,v,void 0,(v.current.flags&128)===128)}catch{}if(D!==null){v=H.T,k=W.p,W.p=2,H.T=null;try{for(var B=p.onRecoverableError,te=0;te<D.length;te++){var ye=D[te];B(ye.value,{componentStack:ye.stack})}}finally{H.T=v,W.p=k}}(Pc&3)!==0&&Xg(),It(p),k=p.pendingLanes,(A&261930)!==0&&(k&42)!==0?p===Fp?rf++:(rf=0,Fp=p):rf=0,Qt(0)}}function $u(p,v){(p.pooledCacheLanes&=v)===0&&(v=p.pooledCache,v!=null&&(p.pooledCache=null,Sp(v)))}function Xg(){return za(),Qh(),Hp(),R1()}function R1(){if(cn!==5)return!1;var p=Ul,v=Hg;Hg=0;var A=_e(Pc),D=H.T,k=W.p;try{W.p=32>A?32:A,H.T=null,A=Gg,Gg=null;var B=Ul,te=Pc;if(cn=0,Vg=Ul=null,Pc=0,(vi&6)!==0)throw Error(r(331));var ye=vi;if(vi|=4,ll(B.current),GM(B,B.current,te,A),vi=ye,Qt(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(Qe,B)}catch{}return!0}finally{W.p=k,H.T=D,$u(p,v)}}function XM(p,v,A){v=Rl(A,v),v=zM(p.stateNode,v,2),p=qd(p,v,2),p!==null&&(pn(p,2),It(p))}function Vr(p,v,A){if(p.tag===3)XM(p,p,A);else for(;v!==null;){if(v.tag===3){XM(v,p,A);break}else if(v.tag===1){var D=v.stateNode;if(typeof v.type.getDerivedStateFromError=="function"||typeof D.componentDidCatch=="function"&&(Ta===null||!Ta.has(D))){p=Rl(A,p),A=BM(2),D=qd(v,A,2),D!==null&&(K3(A,D,v,p),pn(D,2),It(D));break}}v=v.return}}function Ty(p,v,A){var D=p.pingCache;if(D===null){D=p.pingCache=new ir;var k=new Set;D.set(v,k)}else k=D.get(v),k===void 0&&(k=new Set,D.set(v,k));k.has(A)||(WM=!0,k.add(A),p=b.bind(null,p,v,A),v.then(p,p))}function b(p,v,A){var D=p.pingCache;D!==null&&D.delete(v),p.pingedLanes|=p.suspendedLanes&A,p.warmLanes&=~A,qi===p&&(lr&A)===A&&(ta===4||ta===3&&(lr&62914560)===lr&&300>K()-Fg?(vi&2)===0&&af(p,0):_y|=A,Un===lr&&(Un=0)),It(p)}function _(p,v){v===0&&(v=Wi()),p=Oo(p,v),p!==null&&(pn(p,v),It(p))}function O(p){var v=p.memoizedState,A=0;v!==null&&(A=v.retryLane),_(p,A)}function N(p,v){var A=0;switch(p.tag){case 31:case 13:var D=p.stateNode,k=p.memoizedState;k!==null&&(A=k.retryLane);break;case 19:D=p.stateNode;break;case 22:D=p.stateNode._retryCache;break;default:throw Error(r(314))}D!==null&&D.delete(v),_(p,A)}function V(p,v){return ut(p,v)}var X=null,ge=null,Le=!1,mt=!1,Ot=!1,Ht=0;function It(p){p!==ge&&p.next===null&&(ge===null?X=ge=p:ge=ge.next=p),mt=!0,Le||(Le=!0,Xe())}function Qt(p,v){if(!Ot&&mt){Ot=!0;do for(var A=!1,D=X;D!==null;){if(p!==0){var k=D.pendingLanes;if(k===0)var B=0;else{var te=D.suspendedLanes,ye=D.pingedLanes;B=(1<<31-xt(42|p)+1)-1,B&=k&~(te&~ye),B=B&201326741?B&201326741|1:B?B|2:0}B!==0&&(A=!0,st(D,B))}else B=lr,B=$e(D,D===qi?B:0,D.cancelPendingCommit!==null||D.timeoutHandle!==-1),(B&3)===0||Lt(D,B)||(A=!0,st(D,B));D=D.next}while(A);Ot=!1}}function Qi(){Ca()}function Ca(){mt=Le=!1;var p=0;Ht!==0&&YMe()&&(p=Ht);for(var v=K(),A=null,D=X;D!==null;){var k=D.next,B=Yg(D,v);B===0?(D.next=null,A===null?X=k:A.next=k,k===null&&(ge=A)):(A=D,(p!==0||(B&3)!==0)&&(mt=!0)),D=k}cn!==0&&cn!==5||Qt(p),Ht!==0&&(Ht=0)}function Yg(p,v){for(var A=p.suspendedLanes,D=p.pingedLanes,k=p.expirationTimes,B=p.pendingLanes&-62914561;0<B;){var te=31-xt(B),ye=1<<te,Ie=k[te];Ie===-1?((ye&A)===0||(ye&D)!==0)&&(k[te]=ri(ye,v)):Ie<=v&&(p.expiredLanes|=ye),B&=~ye}if(v=qi,A=lr,A=$e(p,p===v?A:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),D=p.callbackNode,A===0||p===v&&(Or===2||Or===9)||p.cancelPendingCommit!==null)return D!==null&&D!==null&&vt(D),p.callbackNode=null,p.callbackPriority=0;if((A&3)===0||Lt(p,A)){if(v=A&-A,v===p.callbackPriority)return v;switch(D!==null&&vt(D),_e(A)){case 2:case 8:A=Be;break;case 32:A=Ue;break;case 268435456:A=Oe;break;default:A=Ue}return D=lf.bind(null,p),A=ut(A,D),p.callbackPriority=v,p.callbackNode=A,v}return D!==null&&D!==null&&vt(D),p.callbackPriority=2,p.callbackNode=null,2}function lf(p,v){if(cn!==0&&cn!==5)return p.callbackNode=null,p.callbackPriority=0,null;var A=p.callbackNode;if(Xg()&&p.callbackNode!==A)return null;var D=lr;return D=$e(p,p===qi?D:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),D===0?null:(xr(p,D,v),Yg(p,K()),p.callbackNode!=null&&p.callbackNode===A?lf.bind(null,p):null)}function st(p,v){if(Xg())return null;xr(p,v,!0)}function Xe(){KMe(function(){(vi&6)!==0?ut(ie,Qi):Ca()})}function ht(){if(Ht===0){var p=jh;p===0&&(p=ke,ke<<=1,(ke&261888)===0&&(ke=256)),Ht=p}return Ht}function zt(p){return p==null||typeof p=="symbol"||typeof p=="boolean"?null:typeof p=="function"?p:H0(""+p)}function Ti(p,v){var A=v.ownerDocument.createElement("input");return A.name=v.name,A.value=v.value,p.id&&A.setAttribute("form",p.id),v.parentNode.insertBefore(A,v),p=new FormData(p),A.parentNode.removeChild(A),p}function na(p,v,A,D,k){if(v==="submit"&&A&&A.stateNode===k){var B=zt((k[Vt]||null).action),te=D.submitter;te&&(v=(v=te[Vt]||null)?zt(v.formAction):te.getAttribute("formAction"),v!==null&&(B=v,te=null));var ye=new q0("action","action",null,D,k);p.push({event:ye,listeners:[{instance:null,listener:function(){if(D.defaultPrevented){if(Ht!==0){var Ie=te?Ti(k,te):new FormData(k);PM(A,{pending:!0,data:Ie,method:k.method,action:B},null,Ie)}}else typeof B=="function"&&(ye.preventDefault(),Ie=te?Ti(k,te):new FormData(k),PM(A,{pending:!0,data:Ie,method:k.method,action:B},B,Ie))},currentTarget:k}]})}}for(var Li=0;Li<ty.length;Li++){var Lr=ty[Li],ys=Lr.toLowerCase(),Xr=Lr[0].toUpperCase()+Lr.slice(1);mc(ys,"on"+Xr)}mc(Wb,"onAnimationEnd"),mc(ey,"onAnimationIteration"),mc(JA,"onAnimationStart"),mc("dblclick","onDoubleClick"),mc("focusin","onFocus"),mc("focusout","onBlur"),mc(a3,"onTransitionRun"),mc(lU,"onTransitionStart"),mc(s3,"onTransitionCancel"),mc(eM,"onTransitionEnd"),Nt("onMouseEnter",["mouseout","mouseover"]),Nt("onMouseLeave",["mouseout","mouseover"]),Nt("onPointerEnter",["pointerout","pointerover"]),Nt("onPointerLeave",["pointerout","pointerover"]),Ye("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ye("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ye("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ye("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ye("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ye("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dc="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(" "),vU=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Dc));function NK(p,v){v=(v&4)!==0;for(var A=0;A<p.length;A++){var D=p[A],k=D.event;D=D.listeners;e:{var B=void 0;if(v)for(var te=D.length-1;0<=te;te--){var ye=D[te],Ie=ye.instance,it=ye.currentTarget;if(ye=ye.listener,Ie!==B&&k.isPropagationStopped())break e;B=ye,k.currentTarget=it;try{B(k)}catch(St){iy(St)}k.currentTarget=null,B=Ie}else for(te=0;te<D.length;te++){if(ye=D[te],Ie=ye.instance,it=ye.currentTarget,ye=ye.listener,Ie!==B&&k.isPropagationStopped())break e;B=ye,k.currentTarget=it;try{B(k)}catch(St){iy(St)}k.currentTarget=null,B=Ie}}}}function Rr(p,v){var A=v[li];A===void 0&&(A=v[li]=new Set);var D=p+"__bubble";A.has(D)||(LK(v,p,2,!1),A.add(D))}function yU(p,v,A){var D=0;v&&(D|=4),LK(A,p,D,v)}var i2="_reactListening"+Math.random().toString(36).slice(2);function xU(p){if(!p[i2]){p[i2]=!0,Ze.forEach(function(A){A!=="selectionchange"&&(vU.has(A)||yU(A,!1,p),yU(A,!0,p))});var v=p.nodeType===9?p:p.ownerDocument;v===null||v[i2]||(v[i2]=!0,yU("selectionchange",!1,v))}}function LK(p,v,A,D){switch(uQ(v)){case 2:var k=gEe;break;case 8:k=vEe;break;default:k=NU}A=k.bind(null,v,A,p),k=void 0,!LA||v!=="touchstart"&&v!=="touchmove"&&v!=="wheel"||(k=!0),D?k!==void 0?p.addEventListener(v,A,{capture:!0,passive:k}):p.addEventListener(v,A,!0):k!==void 0?p.addEventListener(v,A,{passive:k}):p.addEventListener(v,A,!1)}function bU(p,v,A,D,k){var B=D;if((v&1)===0&&(v&2)===0&&D!==null)e:for(;;){if(D===null)return;var te=D.tag;if(te===3||te===4){var ye=D.stateNode.containerInfo;if(ye===k)break;if(te===4)for(te=D.return;te!==null;){var Ie=te.tag;if((Ie===3||Ie===4)&&te.stateNode.containerInfo===k)return;te=te.return}for(;ye!==null;){if(te=on(ye),te===null)return;if(Ie=te.tag,Ie===5||Ie===6||Ie===26||Ie===27){D=B=te;continue e}ye=ye.parentNode}}D=D.return}NA(function(){var it=B,St=Rb(A),Ct=[];e:{var ot=pc.get(p);if(ot!==void 0){var gt=q0,ci=p;switch(p){case"keypress":if(W0(A)===0)break e;case"keydown":case"keyup":gt=yp;break;case"focusin":ci="focus",gt=kb;break;case"focusout":ci="blur",gt=kb;break;case"beforeblur":case"afterblur":gt=kb;break;case"click":if(A.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":gt=kA;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":gt=UD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":gt=WD;break;case Wb:case ey:case JA:gt=aU;break;case eM:gt=oU;break;case"scroll":case"scrollend":gt=zD;break;case"wheel":gt=XD;break;case"copy":case"cut":case"paste":gt=FD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":gt=UA;break;case"toggle":case"beforetoggle":gt=$D}var Ui=(v&4)!==0,Rn=!Ui&&(p==="scroll"||p==="scrollend"),qe=Ui?ot!==null?ot+"Capture":null:ot;Ui=[];for(var Fe=it,tt;Fe!==null;){var Et=Fe;if(tt=Et.stateNode,Et=Et.tag,Et!==5&&Et!==26&&Et!==27||tt===null||qe===null||(Et=dg(Fe,qe),Et!=null&&Ui.push(YM(Fe,Et,tt))),Rn)break;Fe=Fe.return}0<Ui.length&&(ot=new gt(ot,ci,null,A,St),Ct.push({event:ot,listeners:Ui}))}}if((v&7)===0){e:{if(ot=p==="mouseover"||p==="pointerover",gt=p==="mouseout"||p==="pointerout",ot&&A!==Ob&&(ci=A.relatedTarget||A.fromElement)&&(on(ci)||ci[fi]))break e;if((gt||ot)&&(ot=St.window===St?St:(ot=St.ownerDocument)?ot.defaultView||ot.parentWindow:window,gt?(ci=A.relatedTarget||A.toElement,gt=it,ci=ci?on(ci):null,ci!==null&&(Rn=a(ci),Ui=ci.tag,ci!==Rn||Ui!==5&&Ui!==27&&Ui!==6)&&(ci=null)):(gt=null,ci=it),gt!==ci)){if(Ui=kA,Et="onMouseLeave",qe="onMouseEnter",Fe="mouse",(p==="pointerout"||p==="pointerover")&&(Ui=UA,Et="onPointerLeave",qe="onPointerEnter",Fe="pointer"),Rn=gt==null?ot:hs(gt),tt=ci==null?ot:hs(ci),ot=new Ui(Et,Fe+"leave",gt,A,St),ot.target=Rn,ot.relatedTarget=tt,Et=null,on(St)===it&&(Ui=new Ui(qe,Fe+"enter",ci,A,St),Ui.target=tt,Ui.relatedTarget=Rn,Et=Ui),Rn=Et,gt&&ci)t:{for(Ui=HMe,qe=gt,Fe=ci,tt=0,Et=qe;Et;Et=Ui(Et))tt++;Et=0;for(var Mi=Fe;Mi;Mi=Ui(Mi))Et++;for(;0<tt-Et;)qe=Ui(qe),tt--;for(;0<Et-tt;)Fe=Ui(Fe),Et--;for(;tt--;){if(qe===Fe||Fe!==null&&qe===Fe.alternate){Ui=qe;break t}qe=Ui(qe),Fe=Ui(Fe)}Ui=null}else Ui=null;gt!==null&&kK(Ct,ot,gt,Ui,!1),ci!==null&&Rn!==null&&kK(Ct,Rn,ci,Ui,!0)}}e:{if(ot=it?hs(it):window,gt=ot.nodeName&&ot.nodeName.toLowerCase(),gt==="select"||gt==="input"&&ot.type==="file")var en=qA;else if(WA(ot))if(Pu)en=i3;else{en=$A;var mi=e3}else gt=ot.nodeName,!gt||gt.toLowerCase()!=="input"||ot.type!=="checkbox"&&ot.type!=="radio"?it&&mp(it.elementType)&&(en=qA):en=t3;if(en&&(en=en(p,it))){Hb(Ct,en,A,St);break e}mi&&mi(p,ot,it),p==="focusout"&&it&&ot.type==="number"&&it.memoizedProps.value!=null&&$a(ot,"number",ot.value)}switch(mi=it?hs(it):window,p){case"focusin":(WA(mi)||mi.contentEditable==="true")&&(Du=mi,Ou=it,_g=null);break;case"focusout":_g=Ou=Du=null;break;case"mousedown":Gb=!0;break;case"contextmenu":case"mouseup":case"dragend":Gb=!1,Sg(Ct,A,St);break;case"selectionchange":if(n3)break;case"keydown":case"keyup":Sg(Ct,A,St)}var mr;if(xp)e:{switch(p){case"compositionstart":var kr="onCompositionStart";break e;case"compositionend":kr="onCompositionEnd";break e;case"compositionupdate":kr="onCompositionUpdate";break e}kr=void 0}else bp?Vb(p,A)&&(kr="onCompositionEnd"):p==="keydown"&&A.keyCode===229&&(kr="onCompositionStart");kr&&(FA&&A.locale!=="ko"&&(bp||kr!=="onCompositionStart"?kr==="onCompositionEnd"&&bp&&(mr=G0()):(Ol=St,Nb="value"in Ol?Ol.value:Ol.textContent,bp=!0)),mi=r2(it,kr),0<mi.length&&(kr=new zb(kr,p,null,A,St),Ct.push({event:kr,listeners:mi}),mr?kr.data=mr:(mr=VA(A),mr!==null&&(kr.data=mr)))),(mr=Fb?ZD(p,A):HA(p,A))&&(kr=r2(it,"onBeforeInput"),0<kr.length&&(mi=new zb("onBeforeInput","beforeinput",null,A,St),Ct.push({event:mi,listeners:kr}),mi.data=mr)),na(Ct,p,it,A,St)}NK(Ct,v)})}function YM(p,v,A){return{instance:p,listener:v,currentTarget:A}}function r2(p,v){for(var A=v+"Capture",D=[];p!==null;){var k=p,B=k.stateNode;if(k=k.tag,k!==5&&k!==26&&k!==27||B===null||(k=dg(p,A),k!=null&&D.unshift(YM(p,k,B)),k=dg(p,v),k!=null&&D.push(YM(p,k,B))),p.tag===3)return D;p=p.return}return[]}function HMe(p){if(p===null)return null;do p=p.return;while(p&&p.tag!==5&&p.tag!==27);return p||null}function kK(p,v,A,D,k){for(var B=v._reactName,te=[];A!==null&&A!==D;){var ye=A,Ie=ye.alternate,it=ye.stateNode;if(ye=ye.tag,Ie!==null&&Ie===D)break;ye!==5&&ye!==26&&ye!==27||it===null||(Ie=it,k?(it=dg(A,B),it!=null&&te.unshift(YM(A,it,Ie))):k||(it=dg(A,B),it!=null&&te.push(YM(A,it,Ie)))),A=A.return}te.length!==0&&p.push({event:v,listeners:te})}var GMe=/\r\n?/g,WMe=/\u0000|\uFFFD/g;function zK(p){return(typeof p=="string"?p:""+p).replace(GMe,`
|
|
49
|
-
`).replace(WMe,"")}function BK(p,v){return v=zK(v),zK(p)===v}function On(p,v,A,D,k,B){switch(A){case"children":typeof D=="string"?v==="body"||v==="textarea"&&D===""||so(p,D):(typeof D=="number"||typeof D=="bigint")&&v!=="body"&&so(p,""+D);break;case"className":ve(p,"class",D);break;case"tabIndex":ve(p,"tabindex",D);break;case"dir":case"role":case"viewBox":case"width":case"height":ve(p,A,D);break;case"style":Tu(p,D,B);break;case"data":if(v!=="object"){ve(p,"data",D);break}case"src":case"href":if(D===""&&(v!=="a"||A!=="href")){p.removeAttribute(A);break}if(D==null||typeof D=="function"||typeof D=="symbol"||typeof D=="boolean"){p.removeAttribute(A);break}D=H0(""+D),p.setAttribute(A,D);break;case"action":case"formAction":if(typeof D=="function"){p.setAttribute(A,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof B=="function"&&(A==="formAction"?(v!=="input"&&On(p,v,"name",k.name,k,null),On(p,v,"formEncType",k.formEncType,k,null),On(p,v,"formMethod",k.formMethod,k,null),On(p,v,"formTarget",k.formTarget,k,null)):(On(p,v,"encType",k.encType,k,null),On(p,v,"method",k.method,k,null),On(p,v,"target",k.target,k,null)));if(D==null||typeof D=="symbol"||typeof D=="boolean"){p.removeAttribute(A);break}D=H0(""+D),p.setAttribute(A,D);break;case"onClick":D!=null&&(p.onclick=Nh);break;case"onScroll":D!=null&&Rr("scroll",p);break;case"onScrollEnd":D!=null&&Rr("scrollend",p);break;case"dangerouslySetInnerHTML":if(D!=null){if(typeof D!="object"||!("__html"in D))throw Error(r(61));if(A=D.__html,A!=null){if(k.children!=null)throw Error(r(60));p.innerHTML=A}}break;case"multiple":p.multiple=D&&typeof D!="function"&&typeof D!="symbol";break;case"muted":p.muted=D&&typeof D!="function"&&typeof D!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(D==null||typeof D=="function"||typeof D=="boolean"||typeof D=="symbol"){p.removeAttribute("xlink:href");break}A=H0(""+D),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",A);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":D!=null&&typeof D!="function"&&typeof D!="symbol"?p.setAttribute(A,""+D):p.removeAttribute(A);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":D&&typeof D!="function"&&typeof D!="symbol"?p.setAttribute(A,""):p.removeAttribute(A);break;case"capture":case"download":D===!0?p.setAttribute(A,""):D!==!1&&D!=null&&typeof D!="function"&&typeof D!="symbol"?p.setAttribute(A,D):p.removeAttribute(A);break;case"cols":case"rows":case"size":case"span":D!=null&&typeof D!="function"&&typeof D!="symbol"&&!isNaN(D)&&1<=D?p.setAttribute(A,D):p.removeAttribute(A);break;case"rowSpan":case"start":D==null||typeof D=="function"||typeof D=="symbol"||isNaN(D)?p.removeAttribute(A):p.setAttribute(A,D);break;case"popover":Rr("beforetoggle",p),Rr("toggle",p),Ae(p,"popover",D);break;case"xlinkActuate":Te(p,"http://www.w3.org/1999/xlink","xlink:actuate",D);break;case"xlinkArcrole":Te(p,"http://www.w3.org/1999/xlink","xlink:arcrole",D);break;case"xlinkRole":Te(p,"http://www.w3.org/1999/xlink","xlink:role",D);break;case"xlinkShow":Te(p,"http://www.w3.org/1999/xlink","xlink:show",D);break;case"xlinkTitle":Te(p,"http://www.w3.org/1999/xlink","xlink:title",D);break;case"xlinkType":Te(p,"http://www.w3.org/1999/xlink","xlink:type",D);break;case"xmlBase":Te(p,"http://www.w3.org/XML/1998/namespace","xml:base",D);break;case"xmlLang":Te(p,"http://www.w3.org/XML/1998/namespace","xml:lang",D);break;case"xmlSpace":Te(p,"http://www.w3.org/XML/1998/namespace","xml:space",D);break;case"is":Ae(p,"is",D);break;case"innerText":case"textContent":break;default:(!(2<A.length)||A[0]!=="o"&&A[0]!=="O"||A[1]!=="n"&&A[1]!=="N")&&(A=LD.get(A)||A,Ae(p,A,D))}}function wU(p,v,A,D,k,B){switch(A){case"style":Tu(p,D,B);break;case"dangerouslySetInnerHTML":if(D!=null){if(typeof D!="object"||!("__html"in D))throw Error(r(61));if(A=D.__html,A!=null){if(k.children!=null)throw Error(r(60));p.innerHTML=A}}break;case"children":typeof D=="string"?so(p,D):(typeof D=="number"||typeof D=="bigint")&&so(p,""+D);break;case"onScroll":D!=null&&Rr("scroll",p);break;case"onScrollEnd":D!=null&&Rr("scrollend",p);break;case"onClick":D!=null&&(p.onclick=Nh);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ve.hasOwnProperty(A))e:{if(A[0]==="o"&&A[1]==="n"&&(k=A.endsWith("Capture"),v=A.slice(2,k?A.length-7:void 0),B=p[Vt]||null,B=B!=null?B[A]:null,typeof B=="function"&&p.removeEventListener(v,B,k),typeof D=="function")){typeof B!="function"&&B!==null&&(A in p?p[A]=null:p.hasAttribute(A)&&p.removeAttribute(A)),p.addEventListener(v,D,k);break e}A in p?p[A]=D:D===!0?p.setAttribute(A,""):Ae(p,A,D)}}}function Bo(p,v,A){switch(v){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Rr("error",p),Rr("load",p);var D=!1,k=!1,B;for(B in A)if(A.hasOwnProperty(B)){var te=A[B];if(te!=null)switch(B){case"src":D=!0;break;case"srcSet":k=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,v));default:On(p,v,B,te,A,null)}}k&&On(p,v,"srcSet",A.srcSet,A,null),D&&On(p,v,"src",A.src,A,null);return;case"input":Rr("invalid",p);var ye=B=te=k=null,Ie=null,it=null;for(D in A)if(A.hasOwnProperty(D)){var St=A[D];if(St!=null)switch(D){case"name":k=St;break;case"type":te=St;break;case"checked":Ie=St;break;case"defaultChecked":it=St;break;case"value":B=St;break;case"defaultValue":ye=St;break;case"children":case"dangerouslySetInnerHTML":if(St!=null)throw Error(r(137,v));break;default:On(p,v,D,St,A,null)}}Co(p,B,ye,Ie,it,te,k,!1);return;case"select":Rr("invalid",p),D=te=B=null;for(k in A)if(A.hasOwnProperty(k)&&(ye=A[k],ye!=null))switch(k){case"value":B=ye;break;case"defaultValue":te=ye;break;case"multiple":D=ye;default:On(p,v,k,ye,A,null)}v=B,A=te,p.multiple=!!D,v!=null?ao(p,!!D,v,!1):A!=null&&ao(p,!!D,A,!0);return;case"textarea":Rr("invalid",p),B=k=D=null;for(te in A)if(A.hasOwnProperty(te)&&(ye=A[te],ye!=null))switch(te){case"value":D=ye;break;case"defaultValue":k=ye;break;case"children":B=ye;break;case"dangerouslySetInnerHTML":if(ye!=null)throw Error(r(91));break;default:On(p,v,te,ye,A,null)}fa(p,D,k,B);return;case"option":for(Ie in A)if(A.hasOwnProperty(Ie)&&(D=A[Ie],D!=null))switch(Ie){case"selected":p.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:On(p,v,Ie,D,A,null)}return;case"dialog":Rr("beforetoggle",p),Rr("toggle",p),Rr("cancel",p),Rr("close",p);break;case"iframe":case"object":Rr("load",p);break;case"video":case"audio":for(D=0;D<Dc.length;D++)Rr(Dc[D],p);break;case"image":Rr("error",p),Rr("load",p);break;case"details":Rr("toggle",p);break;case"embed":case"source":case"link":Rr("error",p),Rr("load",p);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(it in A)if(A.hasOwnProperty(it)&&(D=A[it],D!=null))switch(it){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,v));default:On(p,v,it,D,A,null)}return;default:if(mp(v)){for(St in A)A.hasOwnProperty(St)&&(D=A[St],D!==void 0&&wU(p,v,St,D,A,void 0));return}}for(ye in A)A.hasOwnProperty(ye)&&(D=A[ye],D!=null&&On(p,v,ye,D,A,null))}function qMe(p,v,A,D){switch(v){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var k=null,B=null,te=null,ye=null,Ie=null,it=null,St=null;for(gt in A){var Ct=A[gt];if(A.hasOwnProperty(gt)&&Ct!=null)switch(gt){case"checked":break;case"value":break;case"defaultValue":Ie=Ct;default:D.hasOwnProperty(gt)||On(p,v,gt,null,D,Ct)}}for(var ot in D){var gt=D[ot];if(Ct=A[ot],D.hasOwnProperty(ot)&&(gt!=null||Ct!=null))switch(ot){case"type":B=gt;break;case"name":k=gt;break;case"checked":it=gt;break;case"defaultChecked":St=gt;break;case"value":te=gt;break;case"defaultValue":ye=gt;break;case"children":case"dangerouslySetInnerHTML":if(gt!=null)throw Error(r(137,v));break;default:gt!==Ct&&On(p,v,ot,gt,D,Ct)}}ds(p,te,ye,Ie,it,St,B,k);return;case"select":gt=te=ye=ot=null;for(B in A)if(Ie=A[B],A.hasOwnProperty(B)&&Ie!=null)switch(B){case"value":break;case"multiple":gt=Ie;default:D.hasOwnProperty(B)||On(p,v,B,null,D,Ie)}for(k in D)if(B=D[k],Ie=A[k],D.hasOwnProperty(k)&&(B!=null||Ie!=null))switch(k){case"value":ot=B;break;case"defaultValue":ye=B;break;case"multiple":te=B;default:B!==Ie&&On(p,v,k,B,D,Ie)}v=ye,A=te,D=gt,ot!=null?ao(p,!!A,ot,!1):!!D!=!!A&&(v!=null?ao(p,!!A,v,!0):ao(p,!!A,A?[]:"",!1));return;case"textarea":gt=ot=null;for(ye in A)if(k=A[ye],A.hasOwnProperty(ye)&&k!=null&&!D.hasOwnProperty(ye))switch(ye){case"value":break;case"children":break;default:On(p,v,ye,null,D,k)}for(te in D)if(k=D[te],B=A[te],D.hasOwnProperty(te)&&(k!=null||B!=null))switch(te){case"value":ot=k;break;case"defaultValue":gt=k;break;case"children":break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(91));break;default:k!==B&&On(p,v,te,k,D,B)}qr(p,ot,gt);return;case"option":for(var ci in A)if(ot=A[ci],A.hasOwnProperty(ci)&&ot!=null&&!D.hasOwnProperty(ci))switch(ci){case"selected":p.selected=!1;break;default:On(p,v,ci,null,D,ot)}for(Ie in D)if(ot=D[Ie],gt=A[Ie],D.hasOwnProperty(Ie)&&ot!==gt&&(ot!=null||gt!=null))switch(Ie){case"selected":p.selected=ot&&typeof ot!="function"&&typeof ot!="symbol";break;default:On(p,v,Ie,ot,D,gt)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ui in A)ot=A[Ui],A.hasOwnProperty(Ui)&&ot!=null&&!D.hasOwnProperty(Ui)&&On(p,v,Ui,null,D,ot);for(it in D)if(ot=D[it],gt=A[it],D.hasOwnProperty(it)&&ot!==gt&&(ot!=null||gt!=null))switch(it){case"children":case"dangerouslySetInnerHTML":if(ot!=null)throw Error(r(137,v));break;default:On(p,v,it,ot,D,gt)}return;default:if(mp(v)){for(var Rn in A)ot=A[Rn],A.hasOwnProperty(Rn)&&ot!==void 0&&!D.hasOwnProperty(Rn)&&wU(p,v,Rn,void 0,D,ot);for(St in D)ot=D[St],gt=A[St],!D.hasOwnProperty(St)||ot===gt||ot===void 0&>===void 0||wU(p,v,St,ot,D,gt);return}}for(var qe in A)ot=A[qe],A.hasOwnProperty(qe)&&ot!=null&&!D.hasOwnProperty(qe)&&On(p,v,qe,null,D,ot);for(Ct in D)ot=D[Ct],gt=A[Ct],!D.hasOwnProperty(Ct)||ot===gt||ot==null&>==null||On(p,v,Ct,ot,D,gt)}function UK(p){switch(p){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function XMe(){if(typeof performance.getEntriesByType=="function"){for(var p=0,v=0,A=performance.getEntriesByType("resource"),D=0;D<A.length;D++){var k=A[D],B=k.transferSize,te=k.initiatorType,ye=k.duration;if(B&&ye&&UK(te)){for(te=0,ye=k.responseEnd,D+=1;D<A.length;D++){var Ie=A[D],it=Ie.startTime;if(it>ye)break;var St=Ie.transferSize,Ct=Ie.initiatorType;St&&UK(Ct)&&(Ie=Ie.responseEnd,te+=St*(Ie<ye?1:(ye-it)/(Ie-it)))}if(--D,v+=8*(B+te)/(k.duration/1e3),p++,10<p)break}}if(0<p)return v/p/1e6}return navigator.connection&&(p=navigator.connection.downlink,typeof p=="number")?p:5}var _U=null,SU=null;function n2(p){return p.nodeType===9?p:p.ownerDocument}function jK(p){switch(p){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function FK(p,v){if(p===0)switch(v){case"svg":return 1;case"math":return 2;default:return 0}return p===1&&v==="foreignObject"?0:p}function AU(p,v){return p==="textarea"||p==="noscript"||typeof v.children=="string"||typeof v.children=="number"||typeof v.children=="bigint"||typeof v.dangerouslySetInnerHTML=="object"&&v.dangerouslySetInnerHTML!==null&&v.dangerouslySetInnerHTML.__html!=null}var MU=null;function YMe(){var p=window.event;return p&&p.type==="popstate"?p===MU?!1:(MU=p,!0):(MU=null,!1)}var VK=typeof setTimeout=="function"?setTimeout:void 0,$Me=typeof clearTimeout=="function"?clearTimeout:void 0,HK=typeof Promise=="function"?Promise:void 0,KMe=typeof queueMicrotask=="function"?queueMicrotask:typeof HK<"u"?function(p){return HK.resolve(null).then(p).catch(QMe)}:VK;function QMe(p){setTimeout(function(){throw p})}function $g(p){return p==="head"}function GK(p,v){var A=v,D=0;do{var k=A.nextSibling;if(p.removeChild(A),k&&k.nodeType===8)if(A=k.data,A==="/$"||A==="/&"){if(D===0){p.removeChild(k),k1(v);return}D--}else if(A==="$"||A==="$?"||A==="$~"||A==="$!"||A==="&")D++;else if(A==="html")$M(p.ownerDocument.documentElement);else if(A==="head"){A=p.ownerDocument.head,$M(A);for(var B=A.firstChild;B;){var te=B.nextSibling,ye=B.nodeName;B[Si]||ye==="SCRIPT"||ye==="STYLE"||ye==="LINK"&&B.rel.toLowerCase()==="stylesheet"||A.removeChild(B),B=te}}else A==="body"&&$M(p.ownerDocument.body);A=k}while(A);k1(v)}function WK(p,v){var A=p;p=0;do{var D=A.nextSibling;if(A.nodeType===1?v?(A._stashedDisplay=A.style.display,A.style.display="none"):(A.style.display=A._stashedDisplay||"",A.getAttribute("style")===""&&A.removeAttribute("style")):A.nodeType===3&&(v?(A._stashedText=A.nodeValue,A.nodeValue=""):A.nodeValue=A._stashedText||""),D&&D.nodeType===8)if(A=D.data,A==="/$"){if(p===0)break;p--}else A!=="$"&&A!=="$?"&&A!=="$~"&&A!=="$!"||p++;A=D}while(A)}function EU(p){var v=p.firstChild;for(v&&v.nodeType===10&&(v=v.nextSibling);v;){var A=v;switch(v=v.nextSibling,A.nodeName){case"HTML":case"HEAD":case"BODY":EU(A),bi(A);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(A.rel.toLowerCase()==="stylesheet")continue}p.removeChild(A)}}function ZMe(p,v,A,D){for(;p.nodeType===1;){var k=A;if(p.nodeName.toLowerCase()!==v.toLowerCase()){if(!D&&(p.nodeName!=="INPUT"||p.type!=="hidden"))break}else if(D){if(!p[Si])switch(v){case"meta":if(!p.hasAttribute("itemprop"))break;return p;case"link":if(B=p.getAttribute("rel"),B==="stylesheet"&&p.hasAttribute("data-precedence"))break;if(B!==k.rel||p.getAttribute("href")!==(k.href==null||k.href===""?null:k.href)||p.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin)||p.getAttribute("title")!==(k.title==null?null:k.title))break;return p;case"style":if(p.hasAttribute("data-precedence"))break;return p;case"script":if(B=p.getAttribute("src"),(B!==(k.src==null?null:k.src)||p.getAttribute("type")!==(k.type==null?null:k.type)||p.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin))&&B&&p.hasAttribute("async")&&!p.hasAttribute("itemprop"))break;return p;default:return p}}else if(v==="input"&&p.type==="hidden"){var B=k.name==null?null:""+k.name;if(k.type==="hidden"&&p.getAttribute("name")===B)return p}else return p;if(p=Ku(p.nextSibling),p===null)break}return null}function JMe(p,v,A){if(v==="")return null;for(;p.nodeType!==3;)if((p.nodeType!==1||p.nodeName!=="INPUT"||p.type!=="hidden")&&!A||(p=Ku(p.nextSibling),p===null))return null;return p}function qK(p,v){for(;p.nodeType!==8;)if((p.nodeType!==1||p.nodeName!=="INPUT"||p.type!=="hidden")&&!v||(p=Ku(p.nextSibling),p===null))return null;return p}function TU(p){return p.data==="$?"||p.data==="$~"}function CU(p){return p.data==="$!"||p.data==="$?"&&p.ownerDocument.readyState!=="loading"}function eEe(p,v){var A=p.ownerDocument;if(p.data==="$~")p._reactRetry=v;else if(p.data!=="$?"||A.readyState!=="loading")v();else{var D=function(){v(),A.removeEventListener("DOMContentLoaded",D)};A.addEventListener("DOMContentLoaded",D),p._reactRetry=D}}function Ku(p){for(;p!=null;p=p.nextSibling){var v=p.nodeType;if(v===1||v===3)break;if(v===8){if(v=p.data,v==="$"||v==="$!"||v==="$?"||v==="$~"||v==="&"||v==="F!"||v==="F")break;if(v==="/$"||v==="/&")return null}}return p}var PU=null;function XK(p){p=p.nextSibling;for(var v=0;p;){if(p.nodeType===8){var A=p.data;if(A==="/$"||A==="/&"){if(v===0)return Ku(p.nextSibling);v--}else A!=="$"&&A!=="$!"&&A!=="$?"&&A!=="$~"&&A!=="&"||v++}p=p.nextSibling}return null}function YK(p){p=p.previousSibling;for(var v=0;p;){if(p.nodeType===8){var A=p.data;if(A==="$"||A==="$!"||A==="$?"||A==="$~"||A==="&"){if(v===0)return p;v--}else A!=="/$"&&A!=="/&"||v++}p=p.previousSibling}return null}function $K(p,v,A){switch(v=n2(A),p){case"html":if(p=v.documentElement,!p)throw Error(r(452));return p;case"head":if(p=v.head,!p)throw Error(r(453));return p;case"body":if(p=v.body,!p)throw Error(r(454));return p;default:throw Error(r(451))}}function $M(p){for(var v=p.attributes;v.length;)p.removeAttributeNode(v[0]);bi(p)}var Qu=new Map,KK=new Set;function a2(p){return typeof p.getRootNode=="function"?p.getRootNode():p.nodeType===9?p:p.ownerDocument}var Gp=W.d;W.d={f:tEe,r:iEe,D:rEe,C:nEe,L:aEe,m:sEe,X:lEe,S:oEe,M:cEe};function tEe(){var p=Gp.f(),v=nu();return p||v}function iEe(p){var v=ha(p);v!==null&&v.tag===5&&v.type==="form"?F3(v):Gp.r(p)}var I1=typeof document>"u"?null:document;function QK(p,v,A){var D=I1;if(D&&typeof v=="string"&&v){var k=Bi(v);k='link[rel="'+p+'"][href="'+k+'"]',typeof A=="string"&&(k+='[crossorigin="'+A+'"]'),KK.has(k)||(KK.add(k),p={rel:p,crossOrigin:A,href:v},D.querySelector(k)===null&&(v=D.createElement("link"),Bo(v,"link",p),De(v),D.head.appendChild(v)))}}function rEe(p){Gp.D(p),QK("dns-prefetch",p,null)}function nEe(p,v){Gp.C(p,v),QK("preconnect",p,v)}function aEe(p,v,A){Gp.L(p,v,A);var D=I1;if(D&&p&&v){var k='link[rel="preload"][as="'+Bi(v)+'"]';v==="image"&&A&&A.imageSrcSet?(k+='[imagesrcset="'+Bi(A.imageSrcSet)+'"]',typeof A.imageSizes=="string"&&(k+='[imagesizes="'+Bi(A.imageSizes)+'"]')):k+='[href="'+Bi(p)+'"]';var B=k;switch(v){case"style":B=N1(p);break;case"script":B=L1(p)}Qu.has(B)||(p=h({rel:"preload",href:v==="image"&&A&&A.imageSrcSet?void 0:p,as:v},A),Qu.set(B,p),D.querySelector(k)!==null||v==="style"&&D.querySelector(KM(B))||v==="script"&&D.querySelector(QM(B))||(v=D.createElement("link"),Bo(v,"link",p),De(v),D.head.appendChild(v)))}}function sEe(p,v){Gp.m(p,v);var A=I1;if(A&&p){var D=v&&typeof v.as=="string"?v.as:"script",k='link[rel="modulepreload"][as="'+Bi(D)+'"][href="'+Bi(p)+'"]',B=k;switch(D){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":B=L1(p)}if(!Qu.has(B)&&(p=h({rel:"modulepreload",href:p},v),Qu.set(B,p),A.querySelector(k)===null)){switch(D){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(A.querySelector(QM(B)))return}D=A.createElement("link"),Bo(D,"link",p),De(D),A.head.appendChild(D)}}}function oEe(p,v,A){Gp.S(p,v,A);var D=I1;if(D&&p){var k=pe(D).hoistableStyles,B=N1(p);v=v||"default";var te=k.get(B);if(!te){var ye={loading:0,preload:null};if(te=D.querySelector(KM(B)))ye.loading=5;else{p=h({rel:"stylesheet",href:p,"data-precedence":v},A),(A=Qu.get(B))&&DU(p,A);var Ie=te=D.createElement("link");De(Ie),Bo(Ie,"link",p),Ie._p=new Promise(function(it,St){Ie.onload=it,Ie.onerror=St}),Ie.addEventListener("load",function(){ye.loading|=1}),Ie.addEventListener("error",function(){ye.loading|=2}),ye.loading|=4,s2(te,v,D)}te={type:"stylesheet",instance:te,count:1,state:ye},k.set(B,te)}}}function lEe(p,v){Gp.X(p,v);var A=I1;if(A&&p){var D=pe(A).hoistableScripts,k=L1(p),B=D.get(k);B||(B=A.querySelector(QM(k)),B||(p=h({src:p,async:!0},v),(v=Qu.get(k))&&OU(p,v),B=A.createElement("script"),De(B),Bo(B,"link",p),A.head.appendChild(B)),B={type:"script",instance:B,count:1,state:null},D.set(k,B))}}function cEe(p,v){Gp.M(p,v);var A=I1;if(A&&p){var D=pe(A).hoistableScripts,k=L1(p),B=D.get(k);B||(B=A.querySelector(QM(k)),B||(p=h({src:p,async:!0,type:"module"},v),(v=Qu.get(k))&&OU(p,v),B=A.createElement("script"),De(B),Bo(B,"link",p),A.head.appendChild(B)),B={type:"script",instance:B,count:1,state:null},D.set(k,B))}}function ZK(p,v,A,D){var k=(k=Z.current)?a2(k):null;if(!k)throw Error(r(446));switch(p){case"meta":case"title":return null;case"style":return typeof A.precedence=="string"&&typeof A.href=="string"?(v=N1(A.href),A=pe(k).hoistableStyles,D=A.get(v),D||(D={type:"style",instance:null,count:0,state:null},A.set(v,D)),D):{type:"void",instance:null,count:0,state:null};case"link":if(A.rel==="stylesheet"&&typeof A.href=="string"&&typeof A.precedence=="string"){p=N1(A.href);var B=pe(k).hoistableStyles,te=B.get(p);if(te||(k=k.ownerDocument||k,te={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},B.set(p,te),(B=k.querySelector(KM(p)))&&!B._p&&(te.instance=B,te.state.loading=5),Qu.has(p)||(A={rel:"preload",as:"style",href:A.href,crossOrigin:A.crossOrigin,integrity:A.integrity,media:A.media,hrefLang:A.hrefLang,referrerPolicy:A.referrerPolicy},Qu.set(p,A),B||uEe(k,p,A,te.state))),v&&D===null)throw Error(r(528,""));return te}if(v&&D!==null)throw Error(r(529,""));return null;case"script":return v=A.async,A=A.src,typeof A=="string"&&v&&typeof v!="function"&&typeof v!="symbol"?(v=L1(A),A=pe(k).hoistableScripts,D=A.get(v),D||(D={type:"script",instance:null,count:0,state:null},A.set(v,D)),D):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,p))}}function N1(p){return'href="'+Bi(p)+'"'}function KM(p){return'link[rel="stylesheet"]['+p+"]"}function JK(p){return h({},p,{"data-precedence":p.precedence,precedence:null})}function uEe(p,v,A,D){p.querySelector('link[rel="preload"][as="style"]['+v+"]")?D.loading=1:(v=p.createElement("link"),D.preload=v,v.addEventListener("load",function(){return D.loading|=1}),v.addEventListener("error",function(){return D.loading|=2}),Bo(v,"link",A),De(v),p.head.appendChild(v))}function L1(p){return'[src="'+Bi(p)+'"]'}function QM(p){return"script[async]"+p}function eQ(p,v,A){if(v.count++,v.instance===null)switch(v.type){case"style":var D=p.querySelector('style[data-href~="'+Bi(A.href)+'"]');if(D)return v.instance=D,De(D),D;var k=h({},A,{"data-href":A.href,"data-precedence":A.precedence,href:null,precedence:null});return D=(p.ownerDocument||p).createElement("style"),De(D),Bo(D,"style",k),s2(D,A.precedence,p),v.instance=D;case"stylesheet":k=N1(A.href);var B=p.querySelector(KM(k));if(B)return v.state.loading|=4,v.instance=B,De(B),B;D=JK(A),(k=Qu.get(k))&&DU(D,k),B=(p.ownerDocument||p).createElement("link"),De(B);var te=B;return te._p=new Promise(function(ye,Ie){te.onload=ye,te.onerror=Ie}),Bo(B,"link",D),v.state.loading|=4,s2(B,A.precedence,p),v.instance=B;case"script":return B=L1(A.src),(k=p.querySelector(QM(B)))?(v.instance=k,De(k),k):(D=A,(k=Qu.get(B))&&(D=h({},A),OU(D,k)),p=p.ownerDocument||p,k=p.createElement("script"),De(k),Bo(k,"link",D),p.head.appendChild(k),v.instance=k);case"void":return null;default:throw Error(r(443,v.type))}else v.type==="stylesheet"&&(v.state.loading&4)===0&&(D=v.instance,v.state.loading|=4,s2(D,A.precedence,p));return v.instance}function s2(p,v,A){for(var D=A.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),k=D.length?D[D.length-1]:null,B=k,te=0;te<D.length;te++){var ye=D[te];if(ye.dataset.precedence===v)B=ye;else if(B!==k)break}B?B.parentNode.insertBefore(p,B.nextSibling):(v=A.nodeType===9?A.head:A,v.insertBefore(p,v.firstChild))}function DU(p,v){p.crossOrigin==null&&(p.crossOrigin=v.crossOrigin),p.referrerPolicy==null&&(p.referrerPolicy=v.referrerPolicy),p.title==null&&(p.title=v.title)}function OU(p,v){p.crossOrigin==null&&(p.crossOrigin=v.crossOrigin),p.referrerPolicy==null&&(p.referrerPolicy=v.referrerPolicy),p.integrity==null&&(p.integrity=v.integrity)}var o2=null;function tQ(p,v,A){if(o2===null){var D=new Map,k=o2=new Map;k.set(A,D)}else k=o2,D=k.get(A),D||(D=new Map,k.set(A,D));if(D.has(p))return D;for(D.set(p,null),A=A.getElementsByTagName(p),k=0;k<A.length;k++){var B=A[k];if(!(B[Si]||B[lt]||p==="link"&&B.getAttribute("rel")==="stylesheet")&&B.namespaceURI!=="http://www.w3.org/2000/svg"){var te=B.getAttribute(v)||"";te=p+te;var ye=D.get(te);ye?ye.push(B):D.set(te,[B])}}return D}function iQ(p,v,A){p=p.ownerDocument||p,p.head.insertBefore(A,v==="title"?p.querySelector("head > title"):null)}function hEe(p,v,A){if(A===1||v.itemProp!=null)return!1;switch(p){case"meta":case"title":return!0;case"style":if(typeof v.precedence!="string"||typeof v.href!="string"||v.href==="")break;return!0;case"link":if(typeof v.rel!="string"||typeof v.href!="string"||v.href===""||v.onLoad||v.onError)break;switch(v.rel){case"stylesheet":return p=v.disabled,typeof v.precedence=="string"&&p==null;default:return!0}case"script":if(v.async&&typeof v.async!="function"&&typeof v.async!="symbol"&&!v.onLoad&&!v.onError&&v.src&&typeof v.src=="string")return!0}return!1}function rQ(p){return!(p.type==="stylesheet"&&(p.state.loading&3)===0)}function dEe(p,v,A,D){if(A.type==="stylesheet"&&(typeof D.media!="string"||matchMedia(D.media).matches!==!1)&&(A.state.loading&4)===0){if(A.instance===null){var k=N1(D.href),B=v.querySelector(KM(k));if(B){v=B._p,v!==null&&typeof v=="object"&&typeof v.then=="function"&&(p.count++,p=l2.bind(p),v.then(p,p)),A.state.loading|=4,A.instance=B,De(B);return}B=v.ownerDocument||v,D=JK(D),(k=Qu.get(k))&&DU(D,k),B=B.createElement("link"),De(B);var te=B;te._p=new Promise(function(ye,Ie){te.onload=ye,te.onerror=Ie}),Bo(B,"link",D),A.instance=B}p.stylesheets===null&&(p.stylesheets=new Map),p.stylesheets.set(A,v),(v=A.state.preload)&&(A.state.loading&3)===0&&(p.count++,A=l2.bind(p),v.addEventListener("load",A),v.addEventListener("error",A))}}var RU=0;function fEe(p,v){return p.stylesheets&&p.count===0&&u2(p,p.stylesheets),0<p.count||0<p.imgCount?function(A){var D=setTimeout(function(){if(p.stylesheets&&u2(p,p.stylesheets),p.unsuspend){var B=p.unsuspend;p.unsuspend=null,B()}},6e4+v);0<p.imgBytes&&RU===0&&(RU=62500*XMe());var k=setTimeout(function(){if(p.waitingForImages=!1,p.count===0&&(p.stylesheets&&u2(p,p.stylesheets),p.unsuspend)){var B=p.unsuspend;p.unsuspend=null,B()}},(p.imgBytes>RU?50:800)+v);return p.unsuspend=A,function(){p.unsuspend=null,clearTimeout(D),clearTimeout(k)}}:null}function l2(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)u2(this,this.stylesheets);else if(this.unsuspend){var p=this.unsuspend;this.unsuspend=null,p()}}}var c2=null;function u2(p,v){p.stylesheets=null,p.unsuspend!==null&&(p.count++,c2=new Map,v.forEach(pEe,p),c2=null,l2.call(p))}function pEe(p,v){if(!(v.state.loading&4)){var A=c2.get(p);if(A)var D=A.get(null);else{A=new Map,c2.set(p,A);for(var k=p.querySelectorAll("link[data-precedence],style[data-precedence]"),B=0;B<k.length;B++){var te=k[B];(te.nodeName==="LINK"||te.getAttribute("media")!=="not all")&&(A.set(te.dataset.precedence,te),D=te)}D&&A.set(null,D)}k=v.instance,te=k.getAttribute("data-precedence"),B=A.get(te)||D,B===D&&A.set(null,k),A.set(te,k),this.count++,D=l2.bind(this),k.addEventListener("load",D),k.addEventListener("error",D),B?B.parentNode.insertBefore(k,B.nextSibling):(p=p.nodeType===9?p.head:p,p.insertBefore(k,p.firstChild)),v.state.loading|=4}}var ZM={$$typeof:S,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function mEe(p,v,A,D,k,B,te,ye,Ie){this.tag=1,this.containerInfo=p,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=di(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=di(0),this.hiddenUpdates=di(null),this.identifierPrefix=D,this.onUncaughtError=k,this.onCaughtError=B,this.onRecoverableError=te,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Ie,this.incompleteTransitions=new Map}function nQ(p,v,A,D,k,B,te,ye,Ie,it,St,Ct){return p=new mEe(p,v,A,te,Ie,it,St,Ct,ye),v=1,B===!0&&(v|=24),B=Zn(3,null,null,v),p.current=B,B.stateNode=p,v=iM(),v.refCount++,p.pooledCache=v,v.refCount++,B.memoizedState={element:D,isDehydrated:A,cache:v},cy(B),p}function aQ(p){return p?(p=Bd,p):Bd}function sQ(p,v,A,D,k,B){k=aQ(k),D.context===null?D.context=k:D.pendingContext=k,D=Vh(v),D.payload={element:A},B=B===void 0?null:B,B!==null&&(D.callback=B),A=qd(p,D,v),A!==null&&(dr(A,p,v),Xd(A,p,v))}function oQ(p,v){if(p=p.memoizedState,p!==null&&p.dehydrated!==null){var A=p.retryLane;p.retryLane=A!==0&&A<v?A:v}}function IU(p,v){oQ(p,v),(p=p.alternate)&&oQ(p,v)}function lQ(p){if(p.tag===13||p.tag===31){var v=Oo(p,67108864);v!==null&&dr(v,p,67108864),IU(p,67108864)}}function cQ(p){if(p.tag===13||p.tag===31){var v=jl();v=To(v);var A=Oo(p,v);A!==null&&dr(A,p,v),IU(p,v)}}var h2=!0;function gEe(p,v,A,D){var k=H.T;H.T=null;var B=W.p;try{W.p=2,NU(p,v,A,D)}finally{W.p=B,H.T=k}}function vEe(p,v,A,D){var k=H.T;H.T=null;var B=W.p;try{W.p=8,NU(p,v,A,D)}finally{W.p=B,H.T=k}}function NU(p,v,A,D){if(h2){var k=LU(D);if(k===null)bU(p,v,D,d2,A),hQ(p,D);else if(xEe(k,p,v,A,D))D.stopPropagation();else if(hQ(p,D),v&4&&-1<yEe.indexOf(p)){for(;k!==null;){var B=ha(k);if(B!==null)switch(B.tag){case 3:if(B=B.stateNode,B.current.memoizedState.isDehydrated){var te=at(B.pendingLanes);if(te!==0){var ye=B;for(ye.pendingLanes|=2,ye.entangledLanes|=2;te;){var Ie=1<<31-xt(te);ye.entanglements[1]|=Ie,te&=~Ie}It(B),(vi&6)===0&&(Ea=K()+500,Qt(0))}}break;case 31:case 13:ye=Oo(B,2),ye!==null&&dr(ye,B,2),nu(),IU(B,2)}if(B=LU(D),B===null&&bU(p,v,D,d2,A),B===k)break;k=B}k!==null&&D.stopPropagation()}else bU(p,v,D,null,A)}}function LU(p){return p=Rb(p),kU(p)}var d2=null;function kU(p){if(d2=null,p=on(p),p!==null){var v=a(p);if(v===null)p=null;else{var A=v.tag;if(A===13){if(p=s(v),p!==null)return p;p=null}else if(A===31){if(p=o(v),p!==null)return p;p=null}else if(A===3){if(v.stateNode.current.memoizedState.isDehydrated)return v.tag===3?v.stateNode.containerInfo:null;p=null}else v!==p&&(p=null)}}return d2=p,null}function uQ(p){switch(p){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(be()){case ie:return 2;case Be:return 8;case Ue:case nt:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var zU=!1,Kg=null,Qg=null,Zg=null,JM=new Map,eE=new Map,Jg=[],yEe="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function hQ(p,v){switch(p){case"focusin":case"focusout":Kg=null;break;case"dragenter":case"dragleave":Qg=null;break;case"mouseover":case"mouseout":Zg=null;break;case"pointerover":case"pointerout":JM.delete(v.pointerId);break;case"gotpointercapture":case"lostpointercapture":eE.delete(v.pointerId)}}function tE(p,v,A,D,k,B){return p===null||p.nativeEvent!==B?(p={blockedOn:v,domEventName:A,eventSystemFlags:D,nativeEvent:B,targetContainers:[k]},v!==null&&(v=ha(v),v!==null&&lQ(v)),p):(p.eventSystemFlags|=D,v=p.targetContainers,k!==null&&v.indexOf(k)===-1&&v.push(k),p)}function xEe(p,v,A,D,k){switch(v){case"focusin":return Kg=tE(Kg,p,v,A,D,k),!0;case"dragenter":return Qg=tE(Qg,p,v,A,D,k),!0;case"mouseover":return Zg=tE(Zg,p,v,A,D,k),!0;case"pointerover":var B=k.pointerId;return JM.set(B,tE(JM.get(B)||null,p,v,A,D,k)),!0;case"gotpointercapture":return B=k.pointerId,eE.set(B,tE(eE.get(B)||null,p,v,A,D,k)),!0}return!1}function dQ(p){var v=on(p.target);if(v!==null){var A=a(v);if(A!==null){if(v=A.tag,v===13){if(v=s(A),v!==null){p.blockedOn=v,ft(p.priority,function(){cQ(A)});return}}else if(v===31){if(v=o(A),v!==null){p.blockedOn=v,ft(p.priority,function(){cQ(A)});return}}else if(v===3&&A.stateNode.current.memoizedState.isDehydrated){p.blockedOn=A.tag===3?A.stateNode.containerInfo:null;return}}}p.blockedOn=null}function f2(p){if(p.blockedOn!==null)return!1;for(var v=p.targetContainers;0<v.length;){var A=LU(p.nativeEvent);if(A===null){A=p.nativeEvent;var D=new A.constructor(A.type,A);Ob=D,A.target.dispatchEvent(D),Ob=null}else return v=ha(A),v!==null&&lQ(v),p.blockedOn=A,!1;v.shift()}return!0}function fQ(p,v,A){f2(p)&&A.delete(v)}function bEe(){zU=!1,Kg!==null&&f2(Kg)&&(Kg=null),Qg!==null&&f2(Qg)&&(Qg=null),Zg!==null&&f2(Zg)&&(Zg=null),JM.forEach(fQ),eE.forEach(fQ)}function p2(p,v){p.blockedOn===v&&(p.blockedOn=null,zU||(zU=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,bEe)))}var m2=null;function pQ(p){m2!==p&&(m2=p,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){m2===p&&(m2=null);for(var v=0;v<p.length;v+=3){var A=p[v],D=p[v+1],k=p[v+2];if(typeof D!="function"){if(kU(D||A)===null)continue;break}var B=ha(A);B!==null&&(p.splice(v,3),v-=3,PM(B,{pending:!0,data:k,method:A.method,action:D},D,k))}}))}function k1(p){function v(Ie){return p2(Ie,p)}Kg!==null&&p2(Kg,p),Qg!==null&&p2(Qg,p),Zg!==null&&p2(Zg,p),JM.forEach(v),eE.forEach(v);for(var A=0;A<Jg.length;A++){var D=Jg[A];D.blockedOn===p&&(D.blockedOn=null)}for(;0<Jg.length&&(A=Jg[0],A.blockedOn===null);)dQ(A),A.blockedOn===null&&Jg.shift();if(A=(p.ownerDocument||p).$$reactFormReplay,A!=null)for(D=0;D<A.length;D+=3){var k=A[D],B=A[D+1],te=k[Vt]||null;if(typeof B=="function")te||pQ(A);else if(te){var ye=null;if(B&&B.hasAttribute("formAction")){if(k=B,te=B[Vt]||null)ye=te.formAction;else if(kU(k)!==null)continue}else ye=te.action;typeof ye=="function"?A[D+1]=ye:(A.splice(D,3),D-=3),pQ(A)}}}function mQ(){function p(B){B.canIntercept&&B.info==="react-transition"&&B.intercept({handler:function(){return new Promise(function(te){return k=te})},focusReset:"manual",scroll:"manual"})}function v(){k!==null&&(k(),k=null),D||setTimeout(A,20)}function A(){if(!D&&!navigation.transition){var B=navigation.currentEntry;B&&B.url!=null&&navigation.navigate(B.url,{state:B.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var D=!1,k=null;return navigation.addEventListener("navigate",p),navigation.addEventListener("navigatesuccess",v),navigation.addEventListener("navigateerror",v),setTimeout(A,100),function(){D=!0,navigation.removeEventListener("navigate",p),navigation.removeEventListener("navigatesuccess",v),navigation.removeEventListener("navigateerror",v),k!==null&&(k(),k=null)}}}function BU(p){this._internalRoot=p}g2.prototype.render=BU.prototype.render=function(p){var v=this._internalRoot;if(v===null)throw Error(r(409));var A=v.current,D=jl();sQ(A,D,p,v,null,null)},g2.prototype.unmount=BU.prototype.unmount=function(){var p=this._internalRoot;if(p!==null){this._internalRoot=null;var v=p.containerInfo;sQ(p.current,2,null,p,null,null),nu(),v[fi]=null}};function g2(p){this._internalRoot=p}g2.prototype.unstable_scheduleHydration=function(p){if(p){var v=Ke();p={blockedOn:null,target:p,priority:v};for(var A=0;A<Jg.length&&v!==0&&v<Jg[A].priority;A++);Jg.splice(A,0,p),A===0&&dQ(p)}};var gQ=t.version;if(gQ!=="19.2.4")throw Error(r(527,gQ,"19.2.4"));W.findDOMNode=function(p){var v=p._reactInternals;if(v===void 0)throw typeof p.render=="function"?Error(r(188)):(p=Object.keys(p).join(","),Error(r(268,p)));return p=c(v),p=p!==null?u(p):null,p=p===null?null:p.stateNode,p};var wEe={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var v2=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!v2.isDisabled&&v2.supportsFiber)try{Qe=v2.inject(wEe),rt=v2}catch{}}return nE.createRoot=function(p,v){if(!n(p))throw Error(r(299));var A=!1,D="",k=Y3,B=LM,te=kM;return v!=null&&(v.unstable_strictMode===!0&&(A=!0),v.identifierPrefix!==void 0&&(D=v.identifierPrefix),v.onUncaughtError!==void 0&&(k=v.onUncaughtError),v.onCaughtError!==void 0&&(B=v.onCaughtError),v.onRecoverableError!==void 0&&(te=v.onRecoverableError)),v=nQ(p,1,!1,null,null,A,D,null,k,B,te,mQ),p[fi]=v.current,xU(p),new BU(v)},nE.hydrateRoot=function(p,v,A){if(!n(p))throw Error(r(299));var D=!1,k="",B=Y3,te=LM,ye=kM,Ie=null;return A!=null&&(A.unstable_strictMode===!0&&(D=!0),A.identifierPrefix!==void 0&&(k=A.identifierPrefix),A.onUncaughtError!==void 0&&(B=A.onUncaughtError),A.onCaughtError!==void 0&&(te=A.onCaughtError),A.onRecoverableError!==void 0&&(ye=A.onRecoverableError),A.formState!==void 0&&(Ie=A.formState)),v=nQ(p,1,!0,v,A??null,D,k,Ie,B,te,ye,mQ),v.context=aQ(null),A=v.current,D=jl(),D=To(D),k=Vh(D),k.callback=null,qd(A,k,D),A=D,v.current.lanes=A,pn(v,A),It(v),p[fi]=v.current,xU(p),new g2(v)},nE.version="19.2.4",nE}var EQ;function NEe(){if(EQ)return FU.exports;EQ=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(),FU.exports=IEe(),FU.exports}var LEe=NEe();const TQ=e=>{let t;const i=new Set,r=(c,u)=>{const h=typeof c=="function"?c(t):c;if(!Object.is(h,t)){const d=t;t=u??(typeof h!="object"||h===null)?h:Object.assign({},t,h),i.forEach(f=>f(t,d))}},n=()=>t,o={setState:r,getState:n,getInitialState:()=>l,subscribe:c=>(i.add(c),()=>i.delete(c))},l=t=e(r,n,o);return o},Rpe=(e=>e?TQ(e):TQ),kEe=e=>e;function zEe(e,t=kEe){const i=Ge.useSyncExternalStore(e.subscribe,Ge.useCallback(()=>t(e.getState()),[e,t]),Ge.useCallback(()=>t(e.getInitialState()),[e,t]));return Ge.useDebugValue(i),i}const CQ=e=>{const t=Rpe(e),i=r=>zEe(t,r);return Object.assign(i,t),i},sg=(e=>e?CQ(e):CQ);function BEe(e,t){let i;try{i=e()}catch{return}return{getItem:n=>{var a;const s=l=>l===null?null:JSON.parse(l,void 0),o=(a=i.getItem(n))!=null?a:null;return o instanceof Promise?o.then(s):s(o)},setItem:(n,a)=>i.setItem(n,JSON.stringify(a,void 0)),removeItem:n=>i.removeItem(n)}}const SG=e=>t=>{try{const i=e(t);return i instanceof Promise?i:{then(r){return SG(r)(i)},catch(r){return this}}}catch(i){return{then(r){return this},catch(r){return SG(r)(i)}}}},UEe=(e,t)=>(i,r,n)=>{let a={storage:BEe(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,x)=>({...x,...g}),...t},s=!1,o=0;const l=new Set,c=new Set;let u=a.storage;if(!u)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),i(...g)},r,n);const h=()=>{const g=a.partialize({...r()});return u.setItem(a.name,{state:g,version:a.version})},d=n.setState;n.setState=(g,x)=>(d(g,x),h());const f=e((...g)=>(i(...g),h()),r,n);n.getInitialState=()=>f;let m;const y=()=>{var g,x;if(!u)return;const w=++o;s=!1,l.forEach(M=>{var E;return M((E=r())!=null?E:f)});const S=((x=a.onRehydrateStorage)==null?void 0:x.call(a,(g=r())!=null?g:f))||void 0;return SG(u.getItem.bind(u))(a.name).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==a.version){if(a.migrate){const E=a.migrate(M.state,M.version);return E instanceof Promise?E.then(T=>[!0,T]):[!0,E]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,M.state];return[!1,void 0]}).then(M=>{var E;if(w!==o)return;const[T,R]=M;if(m=a.merge(R,(E=r())!=null?E:f),i(m,!0),T)return h()}).then(()=>{w===o&&(S==null||S(m,void 0),m=r(),s=!0,c.forEach(M=>M(m)))}).catch(M=>{w===o&&(S==null||S(void 0,M))})};return n.persist={setOptions:g=>{a={...a,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u==null||u.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>y(),hasHydrated:()=>s,onHydrate:g=>(l.add(g),()=>{l.delete(g)}),onFinishHydration:g=>(c.add(g),()=>{c.delete(g)})},a.skipHydration||y(),m||f},Ipe=UEe,$P=sg()(Ipe(e=>({theme:"modern",accentColor:"#3b82f6",setTheme:t=>e({theme:t}),setAccentColor:t=>e({accentColor:t})}),{name:"cam-theme"})),jEe=sg(e=>({settingsOpen:!1,sidebarCollapsed:!1,openSettings:()=>e({settingsOpen:!0}),closeSettings:()=>e({settingsOpen:!1}),toggleSettings:()=>e(t=>({settingsOpen:!t.settingsOpen})),toggleSidebar:()=>e(t=>({sidebarCollapsed:!t.sidebarCollapsed})),setSidebarCollapsed:t=>e({sidebarCollapsed:t})})),PQ={theme:"modern",accentColor:"#3b82f6",followMode:!0,hidePolling:!1,pollingTools:["TaskList","TaskGet"],groupRepetitive:!1,activityWindow:3e5,showLabels:!0,showInteractions:!0,displayMode:"technical",speechBubbleTimeout:5,maxEvents:500,maxCommunicationLines:5,lockPanels:!1,showTimeline:!0},Di=sg()(Ipe(e=>({...PQ,setTheme:t=>e({theme:t}),setAccentColor:t=>e({accentColor:t}),setFollowMode:t=>e({followMode:t}),setHidePolling:t=>e({hidePolling:t}),setPollingTools:t=>e({pollingTools:t}),setGroupRepetitive:t=>e({groupRepetitive:t}),setActivityWindow:t=>e({activityWindow:t}),setShowLabels:t=>e({showLabels:t}),setShowInteractions:t=>e({showInteractions:t}),setDisplayMode:t=>e({displayMode:t}),setSpeechBubbleTimeout:t=>e({speechBubbleTimeout:t}),setMaxEvents:t=>e({maxEvents:t}),setMaxCommunicationLines:t=>e({maxCommunicationLines:t}),setLockPanels:t=>e({lockPanels:t}),setShowTimeline:t=>e({showTimeline:t}),toggleFollowMode:()=>e(t=>({followMode:!t.followMode})),toggleHidePolling:()=>e(t=>({hidePolling:!t.hidePolling})),toggleGroupRepetitive:()=>e(t=>({groupRepetitive:!t.groupRepetitive})),toggleLabels:()=>e(t=>({showLabels:!t.showLabels})),toggleInteractions:()=>e(t=>({showInteractions:!t.showInteractions})),toggleLockPanels:()=>e(t=>({lockPanels:!t.lockPanels})),toggleTimeline:()=>e(t=>({showTimeline:!t.showTimeline})),addPollingTool:t=>e(i=>i.pollingTools.includes(t)?i:{pollingTools:[...i.pollingTools,t]}),removePollingTool:t=>e(i=>({pollingTools:i.pollingTools.filter(r=>r!==t)})),resetToDefaults:()=>e({...PQ})}),{name:"cam-settings"})),_n=sg(e=>({projects:[],activeProject:null,activeSprint:null,sprints:[],tasks:[],viewMode:"agents",selectedTaskId:null,setProjects:t=>e({projects:t}),setActiveProject:t=>e({activeProject:t}),setActiveSprint:t=>e({activeSprint:t}),setSprints:t=>e({sprints:t}),setTasks:t=>e({tasks:t}),updateTask:(t,i)=>e(r=>({tasks:r.tasks.map(n=>n.id===t?{...n,...i}:n)})),updateActiveProject:t=>e(i=>({activeProject:i.activeProject?{...i.activeProject,...t}:null})),updateActiveSprint:t=>e(i=>({activeSprint:i.activeSprint?{...i.activeSprint,...t}:null})),removeProject:t=>e(i=>{var r;return{projects:i.projects.filter(n=>n.id!==t),activeProject:((r=i.activeProject)==null?void 0:r.id)===t?null:i.activeProject}}),setViewMode:t=>e({viewMode:t}),selectTask:t=>e({selectedTaskId:t})})),Ni=sg(e=>({session:null,projectId:null,agents:[],events:[],selectedAgentId:null,isConnected:!1,connectionStatus:"disconnected",lastHeartbeat:null,activityWindow:3e5,setSession:t=>e({session:t}),setProjectId:t=>e({projectId:t}),setAgents:t=>e({agents:t}),addAgent:t=>e(i=>i.agents.find(n=>n.id===t.id)?{agents:i.agents.map(n=>n.id===t.id?t:n)}:{agents:[...i.agents,t]}),updateAgent:(t,i)=>e(r=>({agents:r.agents.map(n=>n.id===t?{...n,...i}:n)})),setEvents:t=>e({events:t}),addEvent:t=>e(i=>({events:[t,...i.events].slice(0,500)})),selectAgent:t=>e({selectedAgentId:t}),setConnected:t=>e({isConnected:t}),setConnectionStatus:t=>e({connectionStatus:t,isConnected:t==="connected"}),setLastHeartbeat:t=>e({lastHeartbeat:t}),setActivityWindow:t=>e({activityWindow:t}),reset:()=>e({session:null,projectId:null,agents:[],events:[],selectedAgentId:null,isConnected:!1,connectionStatus:"disconnected",lastHeartbeat:null,activityWindow:3e5})}));function gu(e){return new Date(e).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function qc(e){const t=Date.now(),i=new Date(e).getTime(),r=t-i;return r<1e3?"just now":r<6e4?`${Math.floor(r/1e3)}s ago`:r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:`${Math.floor(r/864e5)}d ago`}function H7(e,t){const i=new Date(e).getTime(),r=t?new Date(t).getTime():Date.now(),n=Math.floor((r-i)/1e3),a=Math.floor(n/3600),s=Math.floor(n%3600/60),o=n%60,l=[];return a>0&&l.push(`${a}h`),(s>0||a>0)&&l.push(`${String(s).padStart(2,"0")}m`),l.push(`${String(o).padStart(2,"0")}s`),l.join(" ")}function Lm(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function Npe(e,t){return t===0?"0%":`${Math.round(e/t*100)}%`}function AG(e){return{active:"bg-cam-success",idle:"bg-cam-warning",error:"bg-cam-error",completed:"bg-cam-info",shutdown:"bg-cam-text-muted"}[e]||"bg-cam-text-muted"}function Lpe(e){return{tool_call:"text-cam-accent",file_change:"text-cam-success",command:"text-amber-400",message:"text-purple-400",lifecycle:"text-cam-info",error:"text-cam-error",compact:"text-cam-text-muted",notification:"text-cam-warning"}[e]||"text-cam-text-secondary"}function G7(e){return{critical:"bg-red-500/20 text-red-400 border-red-500/30",high:"bg-orange-500/20 text-orange-400 border-orange-500/30",medium:"bg-blue-500/20 text-blue-400 border-blue-500/30",low:"bg-gray-500/20 text-gray-400 border-gray-500/30"}[e]||"bg-gray-500/20 text-gray-400 border-gray-500/30"}function FEe(e){return{backlog:"bg-gray-500/20 text-gray-400",planned:"bg-blue-500/20 text-blue-400",pending:"bg-yellow-500/20 text-yellow-400",in_progress:"bg-emerald-500/20 text-emerald-400",in_review:"bg-purple-500/20 text-purple-400",completed:"bg-green-500/20 text-green-400",blocked:"bg-red-500/20 text-red-400",deferred:"bg-gray-500/20 text-gray-500"}[e]||"bg-gray-500/20 text-gray-400"}function f0(e){let t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((t<<5)-t);return`hsl(${Math.abs(t%360)}, 70%, 60%)`}function W7(e){if(!e)return"";const t=e.match(/^Sprint\s+(\d+)/i);if(t)return`S${t[1]}`;const i=e.match(/^(v[\d.]+)/i);return i?i[1]:""}function VEe(){const{session:e,agents:t,events:i}=Ni(),[r,n]=ee.useState("00m 00s");ee.useEffect(()=>{if(!(e!=null&&e.startedAt))return;const h=()=>n(H7(e.startedAt,e.endedAt));if(h(),!e.endedAt){const d=setInterval(h,1e3);return()=>clearInterval(d)}},[e==null?void 0:e.startedAt,e==null?void 0:e.endedAt]);const a=t.filter(h=>h.status==="active").length,s=t.reduce((h,d)=>h+d.errorCount,0),o=t.reduce((h,d)=>h+d.toolCallCount,0),l=i.filter(h=>h.category==="file_change").length,u=[...(e==null?void 0:e.status)==="completed"||(e==null?void 0:e.status)==="error"?[{label:(e==null?void 0:e.status)==="error"?"Ended (error)":"Ended",value:e!=null&&e.endedAt?new Date(e.endedAt).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}):"--:--",accent:!1,isEnded:!0}]:[],{label:"Session Duration",value:r,accent:!1,isEnded:!1},{label:"Agents",value:`${a}/${t.length}`,accent:a>0,isEnded:!1},{label:"Tool Calls",value:Lm(o),accent:!1,isEnded:!1},{label:"Events",value:Lm((e==null?void 0:e.eventCount)??0),accent:!1,isEnded:!1},{label:"Files",value:Lm(l),accent:!1,isEnded:!1},{label:"Errors",value:String(s),accent:s>0,isEnded:!1}];return C.jsx("div",{className:"h-10 flex items-center gap-0 px-4 border-b border-cam-border/30 bg-cam-surface/40 shrink-0",children:u.map((h,d)=>C.jsxs("div",{className:`flex items-center gap-2 ${d>0?"border-l border-cam-border/30 pl-4 ml-4":""}`,children:[C.jsx("span",{className:"text-[10px] uppercase tracking-wider text-cam-text-muted font-medium",children:h.label}),C.jsx("span",{className:`text-sm font-mono font-semibold ${h.isEnded?"text-amber-400":h.label==="Errors"&&s>0?"text-cam-error":h.accent?"text-cam-success":"text-cam-text"}`,children:h.value})]},h.label))})}const HEe="/api";async function $c(e,t){const i=await fetch(`${HEe}${e}`,{headers:{"Content-Type":"application/json"},...t});if(!i.ok)throw new Error(`API Error: ${i.status} ${i.statusText}`);return i.json()}async function q7(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.limit&&t.set("limit",String(e.limit));const i=t.toString();return $c(`/sessions${i?`?${i}`:""}`)}async function gC(e){return $c(`/sessions/${e}`)}async function GEe(e,t){return $c(`/sessions/${e}/name`,{method:"PATCH",body:JSON.stringify({name:t})})}async function WEe(e){return $c(`/sessions/${e}/close`,{method:"PATCH"})}async function kpe(e){return $c(`/sessions/${e}/agents`)}async function qEe(e,t){const i=new URLSearchParams;t!=null&&t.category&&i.set("category",t.category),t!=null&&t.agent_id&&i.set("agent_id",t.agent_id),t!=null&&t.tool&&i.set("tool",t.tool),i.set("limit",String(t.limit)),t!=null&&t.offset&&i.set("offset",String(t.offset));const r=i.toString();return $c(`/sessions/${e}/events${r?`?${r}`:""}`)}async function X7(e){return $c(`/sessions/${e}/files`)}async function XEe(){return $c("/projects")}async function YEe(e){return $c(`/projects/${e}`,{method:"DELETE"})}async function $Ee(e){return $c(`/projects/${e}/sprints`)}async function DQ(e,t){const r=new URLSearchParams().toString();return $c(`/projects/${e}/tasks${r?`?${r}`:""}`)}async function KEe(e,t){return $c(`/projects/${e}/tasks/${t}/activity`)}async function QEe(){return $c("/registry")}async function Y7(e){const t=new URLSearchParams;return t.set("project_id",e),$c(`/sessions?${t.toString()}`)}async function ZEe(e){try{const{sessions:t}=await Y7(e),i=t.map(async n=>{try{const{agents:a}=await kpe(n.id);return a}catch{return[]}});return{agents:(await Promise.all(i)).flat()}}catch{return{agents:[]}}}function $7(){const{session:e,projectId:t,agents:i,setAgents:r}=Ni();return ee.useEffect(()=>{if(!(e!=null&&e.id)&&!t)return;const n=async()=>{try{if(t){const{agents:s}=await ZEe(t);if(s.length>0||!(e!=null&&e.id)){r(s);return}}if(e!=null&&e.id){const{agents:s}=await kpe(e.id);r(s)}}catch{}};n();const a=setInterval(n,15e3);return()=>clearInterval(a)},[e==null?void 0:e.id,t,r]),i}const JEe=new Set(["main","team-lead","team_lead","teamlead","lead","orchestrator","coordinator"]),zpe=/^(opus|sonnet|haiku|claude)\s/i;function eTe(e){return zpe.test(e)}const tTe=new Set(["general-purpose","general_purpose","default","agent","unknown",""]);function Ch(e,t,i){const r=t.toLowerCase().trim();return JEe.has(r)?"main":zpe.test(t)||iTe(t)?t:i&&!tTe.has(i.toLowerCase().trim())?i:"Subagent"}function iTe(e){const t=e.trim();return!(t.length===0||t.length<=1||/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t)||/^[0-9a-f]{8,}$/i.test(t))}function Ah(e){const t=e.split("/");return t[t.length-1]||e}function rTe(e){return e.status==="active"}function nTe(){const e=$7(),{selectedAgentId:t,selectAgent:i}=Ni(),[r,n]=ee.useState(!1),{activeAgents:a,inactiveAgents:s}=ee.useMemo(()=>{const o=[],l=[];for(const u of e)rTe(u)?o.push(u):l.push(u);l.sort((u,h)=>new Date(h.lastActivityAt).getTime()-new Date(u.lastActivityAt).getTime());const c=l.slice(0,5);return{activeAgents:o,inactiveAgents:c}},[e]);return e.length===0?C.jsxs("div",{className:"p-4 flex flex-col items-center justify-center h-full text-center",children:[C.jsx("div",{className:"w-10 h-10 rounded-full bg-cam-surface-2 border border-cam-border flex items-center justify-center mb-3",children:C.jsx("svg",{className:"w-5 h-5 text-cam-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})})}),C.jsx("p",{className:"text-xs text-cam-text-muted",children:"Waiting for agents..."}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1",children:"Agents will appear when Claude Code starts"})]}):C.jsxs("div",{className:"p-2",children:[C.jsx("div",{className:"px-2 py-1.5 mb-1",children:C.jsxs("span",{className:"text-[10px] uppercase tracking-wider text-cam-text-muted font-medium",children:["Active (",a.length,")"]})}),a.length>0?C.jsx("div",{className:"space-y-0.5",children:a.map(o=>C.jsx(OQ,{agent:o,isSelected:t===o.id,onSelect:()=>i(t===o.id?null:o.id)},o.id))}):C.jsx("div",{className:"px-2 py-3 text-center",children:C.jsx("p",{className:"text-[10px] text-cam-text-muted",children:"No active agents"})}),s.length>0&&C.jsxs("div",{className:"mt-3",children:[C.jsxs("button",{onClick:()=>n(!r),className:"w-full flex items-center justify-between px-2 py-1.5 rounded-md hover:bg-cam-surface-2 transition-colors group",children:[C.jsx("span",{className:"text-[10px] uppercase tracking-wider text-cam-text-muted font-medium",children:"Recent inactive"}),C.jsxs("div",{className:"flex items-center gap-1.5",children:[C.jsx("span",{className:"text-[10px] bg-cam-surface-2 text-cam-text-muted px-1.5 py-0.5 rounded-full font-medium",children:s.length}),C.jsx("svg",{className:`w-3 h-3 text-cam-text-muted transition-transform duration-200 ${r?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),r&&C.jsx("div",{className:"space-y-0.5 mt-1",children:s.map(o=>C.jsx(OQ,{agent:o,isSelected:t===o.id,onSelect:()=>i(t===o.id?null:o.id),compact:!0},o.id))})]})]})}function OQ({agent:e,isSelected:t,onSelect:i,compact:r=!1}){const n=Ch(e.id,e.name,e.type??void 0),a=f0(e.name);return r?C.jsx("button",{onClick:i,title:`${n} | ${e.type} | ${e.id}`,className:`
|
|
49
|
+
`).replace(WMe,"")}function BK(p,v){return v=zK(v),zK(p)===v}function On(p,v,A,D,k,B){switch(A){case"children":typeof D=="string"?v==="body"||v==="textarea"&&D===""||so(p,D):(typeof D=="number"||typeof D=="bigint")&&v!=="body"&&so(p,""+D);break;case"className":ve(p,"class",D);break;case"tabIndex":ve(p,"tabindex",D);break;case"dir":case"role":case"viewBox":case"width":case"height":ve(p,A,D);break;case"style":Tu(p,D,B);break;case"data":if(v!=="object"){ve(p,"data",D);break}case"src":case"href":if(D===""&&(v!=="a"||A!=="href")){p.removeAttribute(A);break}if(D==null||typeof D=="function"||typeof D=="symbol"||typeof D=="boolean"){p.removeAttribute(A);break}D=H0(""+D),p.setAttribute(A,D);break;case"action":case"formAction":if(typeof D=="function"){p.setAttribute(A,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof B=="function"&&(A==="formAction"?(v!=="input"&&On(p,v,"name",k.name,k,null),On(p,v,"formEncType",k.formEncType,k,null),On(p,v,"formMethod",k.formMethod,k,null),On(p,v,"formTarget",k.formTarget,k,null)):(On(p,v,"encType",k.encType,k,null),On(p,v,"method",k.method,k,null),On(p,v,"target",k.target,k,null)));if(D==null||typeof D=="symbol"||typeof D=="boolean"){p.removeAttribute(A);break}D=H0(""+D),p.setAttribute(A,D);break;case"onClick":D!=null&&(p.onclick=Nh);break;case"onScroll":D!=null&&Rr("scroll",p);break;case"onScrollEnd":D!=null&&Rr("scrollend",p);break;case"dangerouslySetInnerHTML":if(D!=null){if(typeof D!="object"||!("__html"in D))throw Error(r(61));if(A=D.__html,A!=null){if(k.children!=null)throw Error(r(60));p.innerHTML=A}}break;case"multiple":p.multiple=D&&typeof D!="function"&&typeof D!="symbol";break;case"muted":p.muted=D&&typeof D!="function"&&typeof D!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(D==null||typeof D=="function"||typeof D=="boolean"||typeof D=="symbol"){p.removeAttribute("xlink:href");break}A=H0(""+D),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",A);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":D!=null&&typeof D!="function"&&typeof D!="symbol"?p.setAttribute(A,""+D):p.removeAttribute(A);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":D&&typeof D!="function"&&typeof D!="symbol"?p.setAttribute(A,""):p.removeAttribute(A);break;case"capture":case"download":D===!0?p.setAttribute(A,""):D!==!1&&D!=null&&typeof D!="function"&&typeof D!="symbol"?p.setAttribute(A,D):p.removeAttribute(A);break;case"cols":case"rows":case"size":case"span":D!=null&&typeof D!="function"&&typeof D!="symbol"&&!isNaN(D)&&1<=D?p.setAttribute(A,D):p.removeAttribute(A);break;case"rowSpan":case"start":D==null||typeof D=="function"||typeof D=="symbol"||isNaN(D)?p.removeAttribute(A):p.setAttribute(A,D);break;case"popover":Rr("beforetoggle",p),Rr("toggle",p),Ae(p,"popover",D);break;case"xlinkActuate":Te(p,"http://www.w3.org/1999/xlink","xlink:actuate",D);break;case"xlinkArcrole":Te(p,"http://www.w3.org/1999/xlink","xlink:arcrole",D);break;case"xlinkRole":Te(p,"http://www.w3.org/1999/xlink","xlink:role",D);break;case"xlinkShow":Te(p,"http://www.w3.org/1999/xlink","xlink:show",D);break;case"xlinkTitle":Te(p,"http://www.w3.org/1999/xlink","xlink:title",D);break;case"xlinkType":Te(p,"http://www.w3.org/1999/xlink","xlink:type",D);break;case"xmlBase":Te(p,"http://www.w3.org/XML/1998/namespace","xml:base",D);break;case"xmlLang":Te(p,"http://www.w3.org/XML/1998/namespace","xml:lang",D);break;case"xmlSpace":Te(p,"http://www.w3.org/XML/1998/namespace","xml:space",D);break;case"is":Ae(p,"is",D);break;case"innerText":case"textContent":break;default:(!(2<A.length)||A[0]!=="o"&&A[0]!=="O"||A[1]!=="n"&&A[1]!=="N")&&(A=LD.get(A)||A,Ae(p,A,D))}}function wU(p,v,A,D,k,B){switch(A){case"style":Tu(p,D,B);break;case"dangerouslySetInnerHTML":if(D!=null){if(typeof D!="object"||!("__html"in D))throw Error(r(61));if(A=D.__html,A!=null){if(k.children!=null)throw Error(r(60));p.innerHTML=A}}break;case"children":typeof D=="string"?so(p,D):(typeof D=="number"||typeof D=="bigint")&&so(p,""+D);break;case"onScroll":D!=null&&Rr("scroll",p);break;case"onScrollEnd":D!=null&&Rr("scrollend",p);break;case"onClick":D!=null&&(p.onclick=Nh);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ve.hasOwnProperty(A))e:{if(A[0]==="o"&&A[1]==="n"&&(k=A.endsWith("Capture"),v=A.slice(2,k?A.length-7:void 0),B=p[Vt]||null,B=B!=null?B[A]:null,typeof B=="function"&&p.removeEventListener(v,B,k),typeof D=="function")){typeof B!="function"&&B!==null&&(A in p?p[A]=null:p.hasAttribute(A)&&p.removeAttribute(A)),p.addEventListener(v,D,k);break e}A in p?p[A]=D:D===!0?p.setAttribute(A,""):Ae(p,A,D)}}}function Bo(p,v,A){switch(v){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Rr("error",p),Rr("load",p);var D=!1,k=!1,B;for(B in A)if(A.hasOwnProperty(B)){var te=A[B];if(te!=null)switch(B){case"src":D=!0;break;case"srcSet":k=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,v));default:On(p,v,B,te,A,null)}}k&&On(p,v,"srcSet",A.srcSet,A,null),D&&On(p,v,"src",A.src,A,null);return;case"input":Rr("invalid",p);var ye=B=te=k=null,Ie=null,it=null;for(D in A)if(A.hasOwnProperty(D)){var St=A[D];if(St!=null)switch(D){case"name":k=St;break;case"type":te=St;break;case"checked":Ie=St;break;case"defaultChecked":it=St;break;case"value":B=St;break;case"defaultValue":ye=St;break;case"children":case"dangerouslySetInnerHTML":if(St!=null)throw Error(r(137,v));break;default:On(p,v,D,St,A,null)}}Co(p,B,ye,Ie,it,te,k,!1);return;case"select":Rr("invalid",p),D=te=B=null;for(k in A)if(A.hasOwnProperty(k)&&(ye=A[k],ye!=null))switch(k){case"value":B=ye;break;case"defaultValue":te=ye;break;case"multiple":D=ye;default:On(p,v,k,ye,A,null)}v=B,A=te,p.multiple=!!D,v!=null?ao(p,!!D,v,!1):A!=null&&ao(p,!!D,A,!0);return;case"textarea":Rr("invalid",p),B=k=D=null;for(te in A)if(A.hasOwnProperty(te)&&(ye=A[te],ye!=null))switch(te){case"value":D=ye;break;case"defaultValue":k=ye;break;case"children":B=ye;break;case"dangerouslySetInnerHTML":if(ye!=null)throw Error(r(91));break;default:On(p,v,te,ye,A,null)}fa(p,D,k,B);return;case"option":for(Ie in A)if(A.hasOwnProperty(Ie)&&(D=A[Ie],D!=null))switch(Ie){case"selected":p.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:On(p,v,Ie,D,A,null)}return;case"dialog":Rr("beforetoggle",p),Rr("toggle",p),Rr("cancel",p),Rr("close",p);break;case"iframe":case"object":Rr("load",p);break;case"video":case"audio":for(D=0;D<Dc.length;D++)Rr(Dc[D],p);break;case"image":Rr("error",p),Rr("load",p);break;case"details":Rr("toggle",p);break;case"embed":case"source":case"link":Rr("error",p),Rr("load",p);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(it in A)if(A.hasOwnProperty(it)&&(D=A[it],D!=null))switch(it){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,v));default:On(p,v,it,D,A,null)}return;default:if(mp(v)){for(St in A)A.hasOwnProperty(St)&&(D=A[St],D!==void 0&&wU(p,v,St,D,A,void 0));return}}for(ye in A)A.hasOwnProperty(ye)&&(D=A[ye],D!=null&&On(p,v,ye,D,A,null))}function qMe(p,v,A,D){switch(v){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var k=null,B=null,te=null,ye=null,Ie=null,it=null,St=null;for(gt in A){var Ct=A[gt];if(A.hasOwnProperty(gt)&&Ct!=null)switch(gt){case"checked":break;case"value":break;case"defaultValue":Ie=Ct;default:D.hasOwnProperty(gt)||On(p,v,gt,null,D,Ct)}}for(var ot in D){var gt=D[ot];if(Ct=A[ot],D.hasOwnProperty(ot)&&(gt!=null||Ct!=null))switch(ot){case"type":B=gt;break;case"name":k=gt;break;case"checked":it=gt;break;case"defaultChecked":St=gt;break;case"value":te=gt;break;case"defaultValue":ye=gt;break;case"children":case"dangerouslySetInnerHTML":if(gt!=null)throw Error(r(137,v));break;default:gt!==Ct&&On(p,v,ot,gt,D,Ct)}}ds(p,te,ye,Ie,it,St,B,k);return;case"select":gt=te=ye=ot=null;for(B in A)if(Ie=A[B],A.hasOwnProperty(B)&&Ie!=null)switch(B){case"value":break;case"multiple":gt=Ie;default:D.hasOwnProperty(B)||On(p,v,B,null,D,Ie)}for(k in D)if(B=D[k],Ie=A[k],D.hasOwnProperty(k)&&(B!=null||Ie!=null))switch(k){case"value":ot=B;break;case"defaultValue":ye=B;break;case"multiple":te=B;default:B!==Ie&&On(p,v,k,B,D,Ie)}v=ye,A=te,D=gt,ot!=null?ao(p,!!A,ot,!1):!!D!=!!A&&(v!=null?ao(p,!!A,v,!0):ao(p,!!A,A?[]:"",!1));return;case"textarea":gt=ot=null;for(ye in A)if(k=A[ye],A.hasOwnProperty(ye)&&k!=null&&!D.hasOwnProperty(ye))switch(ye){case"value":break;case"children":break;default:On(p,v,ye,null,D,k)}for(te in D)if(k=D[te],B=A[te],D.hasOwnProperty(te)&&(k!=null||B!=null))switch(te){case"value":ot=k;break;case"defaultValue":gt=k;break;case"children":break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(91));break;default:k!==B&&On(p,v,te,k,D,B)}qr(p,ot,gt);return;case"option":for(var ci in A)if(ot=A[ci],A.hasOwnProperty(ci)&&ot!=null&&!D.hasOwnProperty(ci))switch(ci){case"selected":p.selected=!1;break;default:On(p,v,ci,null,D,ot)}for(Ie in D)if(ot=D[Ie],gt=A[Ie],D.hasOwnProperty(Ie)&&ot!==gt&&(ot!=null||gt!=null))switch(Ie){case"selected":p.selected=ot&&typeof ot!="function"&&typeof ot!="symbol";break;default:On(p,v,Ie,ot,D,gt)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ui in A)ot=A[Ui],A.hasOwnProperty(Ui)&&ot!=null&&!D.hasOwnProperty(Ui)&&On(p,v,Ui,null,D,ot);for(it in D)if(ot=D[it],gt=A[it],D.hasOwnProperty(it)&&ot!==gt&&(ot!=null||gt!=null))switch(it){case"children":case"dangerouslySetInnerHTML":if(ot!=null)throw Error(r(137,v));break;default:On(p,v,it,ot,D,gt)}return;default:if(mp(v)){for(var Rn in A)ot=A[Rn],A.hasOwnProperty(Rn)&&ot!==void 0&&!D.hasOwnProperty(Rn)&&wU(p,v,Rn,void 0,D,ot);for(St in D)ot=D[St],gt=A[St],!D.hasOwnProperty(St)||ot===gt||ot===void 0&>===void 0||wU(p,v,St,ot,D,gt);return}}for(var qe in A)ot=A[qe],A.hasOwnProperty(qe)&&ot!=null&&!D.hasOwnProperty(qe)&&On(p,v,qe,null,D,ot);for(Ct in D)ot=D[Ct],gt=A[Ct],!D.hasOwnProperty(Ct)||ot===gt||ot==null&>==null||On(p,v,Ct,ot,D,gt)}function UK(p){switch(p){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function XMe(){if(typeof performance.getEntriesByType=="function"){for(var p=0,v=0,A=performance.getEntriesByType("resource"),D=0;D<A.length;D++){var k=A[D],B=k.transferSize,te=k.initiatorType,ye=k.duration;if(B&&ye&&UK(te)){for(te=0,ye=k.responseEnd,D+=1;D<A.length;D++){var Ie=A[D],it=Ie.startTime;if(it>ye)break;var St=Ie.transferSize,Ct=Ie.initiatorType;St&&UK(Ct)&&(Ie=Ie.responseEnd,te+=St*(Ie<ye?1:(ye-it)/(Ie-it)))}if(--D,v+=8*(B+te)/(k.duration/1e3),p++,10<p)break}}if(0<p)return v/p/1e6}return navigator.connection&&(p=navigator.connection.downlink,typeof p=="number")?p:5}var _U=null,SU=null;function n2(p){return p.nodeType===9?p:p.ownerDocument}function jK(p){switch(p){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function FK(p,v){if(p===0)switch(v){case"svg":return 1;case"math":return 2;default:return 0}return p===1&&v==="foreignObject"?0:p}function AU(p,v){return p==="textarea"||p==="noscript"||typeof v.children=="string"||typeof v.children=="number"||typeof v.children=="bigint"||typeof v.dangerouslySetInnerHTML=="object"&&v.dangerouslySetInnerHTML!==null&&v.dangerouslySetInnerHTML.__html!=null}var MU=null;function YMe(){var p=window.event;return p&&p.type==="popstate"?p===MU?!1:(MU=p,!0):(MU=null,!1)}var VK=typeof setTimeout=="function"?setTimeout:void 0,$Me=typeof clearTimeout=="function"?clearTimeout:void 0,HK=typeof Promise=="function"?Promise:void 0,KMe=typeof queueMicrotask=="function"?queueMicrotask:typeof HK<"u"?function(p){return HK.resolve(null).then(p).catch(QMe)}:VK;function QMe(p){setTimeout(function(){throw p})}function $g(p){return p==="head"}function GK(p,v){var A=v,D=0;do{var k=A.nextSibling;if(p.removeChild(A),k&&k.nodeType===8)if(A=k.data,A==="/$"||A==="/&"){if(D===0){p.removeChild(k),k1(v);return}D--}else if(A==="$"||A==="$?"||A==="$~"||A==="$!"||A==="&")D++;else if(A==="html")$M(p.ownerDocument.documentElement);else if(A==="head"){A=p.ownerDocument.head,$M(A);for(var B=A.firstChild;B;){var te=B.nextSibling,ye=B.nodeName;B[Si]||ye==="SCRIPT"||ye==="STYLE"||ye==="LINK"&&B.rel.toLowerCase()==="stylesheet"||A.removeChild(B),B=te}}else A==="body"&&$M(p.ownerDocument.body);A=k}while(A);k1(v)}function WK(p,v){var A=p;p=0;do{var D=A.nextSibling;if(A.nodeType===1?v?(A._stashedDisplay=A.style.display,A.style.display="none"):(A.style.display=A._stashedDisplay||"",A.getAttribute("style")===""&&A.removeAttribute("style")):A.nodeType===3&&(v?(A._stashedText=A.nodeValue,A.nodeValue=""):A.nodeValue=A._stashedText||""),D&&D.nodeType===8)if(A=D.data,A==="/$"){if(p===0)break;p--}else A!=="$"&&A!=="$?"&&A!=="$~"&&A!=="$!"||p++;A=D}while(A)}function EU(p){var v=p.firstChild;for(v&&v.nodeType===10&&(v=v.nextSibling);v;){var A=v;switch(v=v.nextSibling,A.nodeName){case"HTML":case"HEAD":case"BODY":EU(A),bi(A);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(A.rel.toLowerCase()==="stylesheet")continue}p.removeChild(A)}}function ZMe(p,v,A,D){for(;p.nodeType===1;){var k=A;if(p.nodeName.toLowerCase()!==v.toLowerCase()){if(!D&&(p.nodeName!=="INPUT"||p.type!=="hidden"))break}else if(D){if(!p[Si])switch(v){case"meta":if(!p.hasAttribute("itemprop"))break;return p;case"link":if(B=p.getAttribute("rel"),B==="stylesheet"&&p.hasAttribute("data-precedence"))break;if(B!==k.rel||p.getAttribute("href")!==(k.href==null||k.href===""?null:k.href)||p.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin)||p.getAttribute("title")!==(k.title==null?null:k.title))break;return p;case"style":if(p.hasAttribute("data-precedence"))break;return p;case"script":if(B=p.getAttribute("src"),(B!==(k.src==null?null:k.src)||p.getAttribute("type")!==(k.type==null?null:k.type)||p.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin))&&B&&p.hasAttribute("async")&&!p.hasAttribute("itemprop"))break;return p;default:return p}}else if(v==="input"&&p.type==="hidden"){var B=k.name==null?null:""+k.name;if(k.type==="hidden"&&p.getAttribute("name")===B)return p}else return p;if(p=Ku(p.nextSibling),p===null)break}return null}function JMe(p,v,A){if(v==="")return null;for(;p.nodeType!==3;)if((p.nodeType!==1||p.nodeName!=="INPUT"||p.type!=="hidden")&&!A||(p=Ku(p.nextSibling),p===null))return null;return p}function qK(p,v){for(;p.nodeType!==8;)if((p.nodeType!==1||p.nodeName!=="INPUT"||p.type!=="hidden")&&!v||(p=Ku(p.nextSibling),p===null))return null;return p}function TU(p){return p.data==="$?"||p.data==="$~"}function CU(p){return p.data==="$!"||p.data==="$?"&&p.ownerDocument.readyState!=="loading"}function eEe(p,v){var A=p.ownerDocument;if(p.data==="$~")p._reactRetry=v;else if(p.data!=="$?"||A.readyState!=="loading")v();else{var D=function(){v(),A.removeEventListener("DOMContentLoaded",D)};A.addEventListener("DOMContentLoaded",D),p._reactRetry=D}}function Ku(p){for(;p!=null;p=p.nextSibling){var v=p.nodeType;if(v===1||v===3)break;if(v===8){if(v=p.data,v==="$"||v==="$!"||v==="$?"||v==="$~"||v==="&"||v==="F!"||v==="F")break;if(v==="/$"||v==="/&")return null}}return p}var PU=null;function XK(p){p=p.nextSibling;for(var v=0;p;){if(p.nodeType===8){var A=p.data;if(A==="/$"||A==="/&"){if(v===0)return Ku(p.nextSibling);v--}else A!=="$"&&A!=="$!"&&A!=="$?"&&A!=="$~"&&A!=="&"||v++}p=p.nextSibling}return null}function YK(p){p=p.previousSibling;for(var v=0;p;){if(p.nodeType===8){var A=p.data;if(A==="$"||A==="$!"||A==="$?"||A==="$~"||A==="&"){if(v===0)return p;v--}else A!=="/$"&&A!=="/&"||v++}p=p.previousSibling}return null}function $K(p,v,A){switch(v=n2(A),p){case"html":if(p=v.documentElement,!p)throw Error(r(452));return p;case"head":if(p=v.head,!p)throw Error(r(453));return p;case"body":if(p=v.body,!p)throw Error(r(454));return p;default:throw Error(r(451))}}function $M(p){for(var v=p.attributes;v.length;)p.removeAttributeNode(v[0]);bi(p)}var Qu=new Map,KK=new Set;function a2(p){return typeof p.getRootNode=="function"?p.getRootNode():p.nodeType===9?p:p.ownerDocument}var Gp=W.d;W.d={f:tEe,r:iEe,D:rEe,C:nEe,L:aEe,m:sEe,X:lEe,S:oEe,M:cEe};function tEe(){var p=Gp.f(),v=nu();return p||v}function iEe(p){var v=ha(p);v!==null&&v.tag===5&&v.type==="form"?F3(v):Gp.r(p)}var I1=typeof document>"u"?null:document;function QK(p,v,A){var D=I1;if(D&&typeof v=="string"&&v){var k=Bi(v);k='link[rel="'+p+'"][href="'+k+'"]',typeof A=="string"&&(k+='[crossorigin="'+A+'"]'),KK.has(k)||(KK.add(k),p={rel:p,crossOrigin:A,href:v},D.querySelector(k)===null&&(v=D.createElement("link"),Bo(v,"link",p),De(v),D.head.appendChild(v)))}}function rEe(p){Gp.D(p),QK("dns-prefetch",p,null)}function nEe(p,v){Gp.C(p,v),QK("preconnect",p,v)}function aEe(p,v,A){Gp.L(p,v,A);var D=I1;if(D&&p&&v){var k='link[rel="preload"][as="'+Bi(v)+'"]';v==="image"&&A&&A.imageSrcSet?(k+='[imagesrcset="'+Bi(A.imageSrcSet)+'"]',typeof A.imageSizes=="string"&&(k+='[imagesizes="'+Bi(A.imageSizes)+'"]')):k+='[href="'+Bi(p)+'"]';var B=k;switch(v){case"style":B=N1(p);break;case"script":B=L1(p)}Qu.has(B)||(p=h({rel:"preload",href:v==="image"&&A&&A.imageSrcSet?void 0:p,as:v},A),Qu.set(B,p),D.querySelector(k)!==null||v==="style"&&D.querySelector(KM(B))||v==="script"&&D.querySelector(QM(B))||(v=D.createElement("link"),Bo(v,"link",p),De(v),D.head.appendChild(v)))}}function sEe(p,v){Gp.m(p,v);var A=I1;if(A&&p){var D=v&&typeof v.as=="string"?v.as:"script",k='link[rel="modulepreload"][as="'+Bi(D)+'"][href="'+Bi(p)+'"]',B=k;switch(D){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":B=L1(p)}if(!Qu.has(B)&&(p=h({rel:"modulepreload",href:p},v),Qu.set(B,p),A.querySelector(k)===null)){switch(D){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(A.querySelector(QM(B)))return}D=A.createElement("link"),Bo(D,"link",p),De(D),A.head.appendChild(D)}}}function oEe(p,v,A){Gp.S(p,v,A);var D=I1;if(D&&p){var k=pe(D).hoistableStyles,B=N1(p);v=v||"default";var te=k.get(B);if(!te){var ye={loading:0,preload:null};if(te=D.querySelector(KM(B)))ye.loading=5;else{p=h({rel:"stylesheet",href:p,"data-precedence":v},A),(A=Qu.get(B))&&DU(p,A);var Ie=te=D.createElement("link");De(Ie),Bo(Ie,"link",p),Ie._p=new Promise(function(it,St){Ie.onload=it,Ie.onerror=St}),Ie.addEventListener("load",function(){ye.loading|=1}),Ie.addEventListener("error",function(){ye.loading|=2}),ye.loading|=4,s2(te,v,D)}te={type:"stylesheet",instance:te,count:1,state:ye},k.set(B,te)}}}function lEe(p,v){Gp.X(p,v);var A=I1;if(A&&p){var D=pe(A).hoistableScripts,k=L1(p),B=D.get(k);B||(B=A.querySelector(QM(k)),B||(p=h({src:p,async:!0},v),(v=Qu.get(k))&&OU(p,v),B=A.createElement("script"),De(B),Bo(B,"link",p),A.head.appendChild(B)),B={type:"script",instance:B,count:1,state:null},D.set(k,B))}}function cEe(p,v){Gp.M(p,v);var A=I1;if(A&&p){var D=pe(A).hoistableScripts,k=L1(p),B=D.get(k);B||(B=A.querySelector(QM(k)),B||(p=h({src:p,async:!0,type:"module"},v),(v=Qu.get(k))&&OU(p,v),B=A.createElement("script"),De(B),Bo(B,"link",p),A.head.appendChild(B)),B={type:"script",instance:B,count:1,state:null},D.set(k,B))}}function ZK(p,v,A,D){var k=(k=Z.current)?a2(k):null;if(!k)throw Error(r(446));switch(p){case"meta":case"title":return null;case"style":return typeof A.precedence=="string"&&typeof A.href=="string"?(v=N1(A.href),A=pe(k).hoistableStyles,D=A.get(v),D||(D={type:"style",instance:null,count:0,state:null},A.set(v,D)),D):{type:"void",instance:null,count:0,state:null};case"link":if(A.rel==="stylesheet"&&typeof A.href=="string"&&typeof A.precedence=="string"){p=N1(A.href);var B=pe(k).hoistableStyles,te=B.get(p);if(te||(k=k.ownerDocument||k,te={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},B.set(p,te),(B=k.querySelector(KM(p)))&&!B._p&&(te.instance=B,te.state.loading=5),Qu.has(p)||(A={rel:"preload",as:"style",href:A.href,crossOrigin:A.crossOrigin,integrity:A.integrity,media:A.media,hrefLang:A.hrefLang,referrerPolicy:A.referrerPolicy},Qu.set(p,A),B||uEe(k,p,A,te.state))),v&&D===null)throw Error(r(528,""));return te}if(v&&D!==null)throw Error(r(529,""));return null;case"script":return v=A.async,A=A.src,typeof A=="string"&&v&&typeof v!="function"&&typeof v!="symbol"?(v=L1(A),A=pe(k).hoistableScripts,D=A.get(v),D||(D={type:"script",instance:null,count:0,state:null},A.set(v,D)),D):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,p))}}function N1(p){return'href="'+Bi(p)+'"'}function KM(p){return'link[rel="stylesheet"]['+p+"]"}function JK(p){return h({},p,{"data-precedence":p.precedence,precedence:null})}function uEe(p,v,A,D){p.querySelector('link[rel="preload"][as="style"]['+v+"]")?D.loading=1:(v=p.createElement("link"),D.preload=v,v.addEventListener("load",function(){return D.loading|=1}),v.addEventListener("error",function(){return D.loading|=2}),Bo(v,"link",A),De(v),p.head.appendChild(v))}function L1(p){return'[src="'+Bi(p)+'"]'}function QM(p){return"script[async]"+p}function eQ(p,v,A){if(v.count++,v.instance===null)switch(v.type){case"style":var D=p.querySelector('style[data-href~="'+Bi(A.href)+'"]');if(D)return v.instance=D,De(D),D;var k=h({},A,{"data-href":A.href,"data-precedence":A.precedence,href:null,precedence:null});return D=(p.ownerDocument||p).createElement("style"),De(D),Bo(D,"style",k),s2(D,A.precedence,p),v.instance=D;case"stylesheet":k=N1(A.href);var B=p.querySelector(KM(k));if(B)return v.state.loading|=4,v.instance=B,De(B),B;D=JK(A),(k=Qu.get(k))&&DU(D,k),B=(p.ownerDocument||p).createElement("link"),De(B);var te=B;return te._p=new Promise(function(ye,Ie){te.onload=ye,te.onerror=Ie}),Bo(B,"link",D),v.state.loading|=4,s2(B,A.precedence,p),v.instance=B;case"script":return B=L1(A.src),(k=p.querySelector(QM(B)))?(v.instance=k,De(k),k):(D=A,(k=Qu.get(B))&&(D=h({},A),OU(D,k)),p=p.ownerDocument||p,k=p.createElement("script"),De(k),Bo(k,"link",D),p.head.appendChild(k),v.instance=k);case"void":return null;default:throw Error(r(443,v.type))}else v.type==="stylesheet"&&(v.state.loading&4)===0&&(D=v.instance,v.state.loading|=4,s2(D,A.precedence,p));return v.instance}function s2(p,v,A){for(var D=A.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),k=D.length?D[D.length-1]:null,B=k,te=0;te<D.length;te++){var ye=D[te];if(ye.dataset.precedence===v)B=ye;else if(B!==k)break}B?B.parentNode.insertBefore(p,B.nextSibling):(v=A.nodeType===9?A.head:A,v.insertBefore(p,v.firstChild))}function DU(p,v){p.crossOrigin==null&&(p.crossOrigin=v.crossOrigin),p.referrerPolicy==null&&(p.referrerPolicy=v.referrerPolicy),p.title==null&&(p.title=v.title)}function OU(p,v){p.crossOrigin==null&&(p.crossOrigin=v.crossOrigin),p.referrerPolicy==null&&(p.referrerPolicy=v.referrerPolicy),p.integrity==null&&(p.integrity=v.integrity)}var o2=null;function tQ(p,v,A){if(o2===null){var D=new Map,k=o2=new Map;k.set(A,D)}else k=o2,D=k.get(A),D||(D=new Map,k.set(A,D));if(D.has(p))return D;for(D.set(p,null),A=A.getElementsByTagName(p),k=0;k<A.length;k++){var B=A[k];if(!(B[Si]||B[lt]||p==="link"&&B.getAttribute("rel")==="stylesheet")&&B.namespaceURI!=="http://www.w3.org/2000/svg"){var te=B.getAttribute(v)||"";te=p+te;var ye=D.get(te);ye?ye.push(B):D.set(te,[B])}}return D}function iQ(p,v,A){p=p.ownerDocument||p,p.head.insertBefore(A,v==="title"?p.querySelector("head > title"):null)}function hEe(p,v,A){if(A===1||v.itemProp!=null)return!1;switch(p){case"meta":case"title":return!0;case"style":if(typeof v.precedence!="string"||typeof v.href!="string"||v.href==="")break;return!0;case"link":if(typeof v.rel!="string"||typeof v.href!="string"||v.href===""||v.onLoad||v.onError)break;switch(v.rel){case"stylesheet":return p=v.disabled,typeof v.precedence=="string"&&p==null;default:return!0}case"script":if(v.async&&typeof v.async!="function"&&typeof v.async!="symbol"&&!v.onLoad&&!v.onError&&v.src&&typeof v.src=="string")return!0}return!1}function rQ(p){return!(p.type==="stylesheet"&&(p.state.loading&3)===0)}function dEe(p,v,A,D){if(A.type==="stylesheet"&&(typeof D.media!="string"||matchMedia(D.media).matches!==!1)&&(A.state.loading&4)===0){if(A.instance===null){var k=N1(D.href),B=v.querySelector(KM(k));if(B){v=B._p,v!==null&&typeof v=="object"&&typeof v.then=="function"&&(p.count++,p=l2.bind(p),v.then(p,p)),A.state.loading|=4,A.instance=B,De(B);return}B=v.ownerDocument||v,D=JK(D),(k=Qu.get(k))&&DU(D,k),B=B.createElement("link"),De(B);var te=B;te._p=new Promise(function(ye,Ie){te.onload=ye,te.onerror=Ie}),Bo(B,"link",D),A.instance=B}p.stylesheets===null&&(p.stylesheets=new Map),p.stylesheets.set(A,v),(v=A.state.preload)&&(A.state.loading&3)===0&&(p.count++,A=l2.bind(p),v.addEventListener("load",A),v.addEventListener("error",A))}}var RU=0;function fEe(p,v){return p.stylesheets&&p.count===0&&u2(p,p.stylesheets),0<p.count||0<p.imgCount?function(A){var D=setTimeout(function(){if(p.stylesheets&&u2(p,p.stylesheets),p.unsuspend){var B=p.unsuspend;p.unsuspend=null,B()}},6e4+v);0<p.imgBytes&&RU===0&&(RU=62500*XMe());var k=setTimeout(function(){if(p.waitingForImages=!1,p.count===0&&(p.stylesheets&&u2(p,p.stylesheets),p.unsuspend)){var B=p.unsuspend;p.unsuspend=null,B()}},(p.imgBytes>RU?50:800)+v);return p.unsuspend=A,function(){p.unsuspend=null,clearTimeout(D),clearTimeout(k)}}:null}function l2(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)u2(this,this.stylesheets);else if(this.unsuspend){var p=this.unsuspend;this.unsuspend=null,p()}}}var c2=null;function u2(p,v){p.stylesheets=null,p.unsuspend!==null&&(p.count++,c2=new Map,v.forEach(pEe,p),c2=null,l2.call(p))}function pEe(p,v){if(!(v.state.loading&4)){var A=c2.get(p);if(A)var D=A.get(null);else{A=new Map,c2.set(p,A);for(var k=p.querySelectorAll("link[data-precedence],style[data-precedence]"),B=0;B<k.length;B++){var te=k[B];(te.nodeName==="LINK"||te.getAttribute("media")!=="not all")&&(A.set(te.dataset.precedence,te),D=te)}D&&A.set(null,D)}k=v.instance,te=k.getAttribute("data-precedence"),B=A.get(te)||D,B===D&&A.set(null,k),A.set(te,k),this.count++,D=l2.bind(this),k.addEventListener("load",D),k.addEventListener("error",D),B?B.parentNode.insertBefore(k,B.nextSibling):(p=p.nodeType===9?p.head:p,p.insertBefore(k,p.firstChild)),v.state.loading|=4}}var ZM={$$typeof:S,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function mEe(p,v,A,D,k,B,te,ye,Ie){this.tag=1,this.containerInfo=p,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=di(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=di(0),this.hiddenUpdates=di(null),this.identifierPrefix=D,this.onUncaughtError=k,this.onCaughtError=B,this.onRecoverableError=te,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Ie,this.incompleteTransitions=new Map}function nQ(p,v,A,D,k,B,te,ye,Ie,it,St,Ct){return p=new mEe(p,v,A,te,Ie,it,St,Ct,ye),v=1,B===!0&&(v|=24),B=Zn(3,null,null,v),p.current=B,B.stateNode=p,v=iM(),v.refCount++,p.pooledCache=v,v.refCount++,B.memoizedState={element:D,isDehydrated:A,cache:v},cy(B),p}function aQ(p){return p?(p=Bd,p):Bd}function sQ(p,v,A,D,k,B){k=aQ(k),D.context===null?D.context=k:D.pendingContext=k,D=Vh(v),D.payload={element:A},B=B===void 0?null:B,B!==null&&(D.callback=B),A=qd(p,D,v),A!==null&&(dr(A,p,v),Xd(A,p,v))}function oQ(p,v){if(p=p.memoizedState,p!==null&&p.dehydrated!==null){var A=p.retryLane;p.retryLane=A!==0&&A<v?A:v}}function IU(p,v){oQ(p,v),(p=p.alternate)&&oQ(p,v)}function lQ(p){if(p.tag===13||p.tag===31){var v=Oo(p,67108864);v!==null&&dr(v,p,67108864),IU(p,67108864)}}function cQ(p){if(p.tag===13||p.tag===31){var v=jl();v=To(v);var A=Oo(p,v);A!==null&&dr(A,p,v),IU(p,v)}}var h2=!0;function gEe(p,v,A,D){var k=H.T;H.T=null;var B=W.p;try{W.p=2,NU(p,v,A,D)}finally{W.p=B,H.T=k}}function vEe(p,v,A,D){var k=H.T;H.T=null;var B=W.p;try{W.p=8,NU(p,v,A,D)}finally{W.p=B,H.T=k}}function NU(p,v,A,D){if(h2){var k=LU(D);if(k===null)bU(p,v,D,d2,A),hQ(p,D);else if(xEe(k,p,v,A,D))D.stopPropagation();else if(hQ(p,D),v&4&&-1<yEe.indexOf(p)){for(;k!==null;){var B=ha(k);if(B!==null)switch(B.tag){case 3:if(B=B.stateNode,B.current.memoizedState.isDehydrated){var te=at(B.pendingLanes);if(te!==0){var ye=B;for(ye.pendingLanes|=2,ye.entangledLanes|=2;te;){var Ie=1<<31-xt(te);ye.entanglements[1]|=Ie,te&=~Ie}It(B),(vi&6)===0&&(Ea=K()+500,Qt(0))}}break;case 31:case 13:ye=Oo(B,2),ye!==null&&dr(ye,B,2),nu(),IU(B,2)}if(B=LU(D),B===null&&bU(p,v,D,d2,A),B===k)break;k=B}k!==null&&D.stopPropagation()}else bU(p,v,D,null,A)}}function LU(p){return p=Rb(p),kU(p)}var d2=null;function kU(p){if(d2=null,p=on(p),p!==null){var v=a(p);if(v===null)p=null;else{var A=v.tag;if(A===13){if(p=s(v),p!==null)return p;p=null}else if(A===31){if(p=o(v),p!==null)return p;p=null}else if(A===3){if(v.stateNode.current.memoizedState.isDehydrated)return v.tag===3?v.stateNode.containerInfo:null;p=null}else v!==p&&(p=null)}}return d2=p,null}function uQ(p){switch(p){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(be()){case ie:return 2;case Be:return 8;case Ue:case nt:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var zU=!1,Kg=null,Qg=null,Zg=null,JM=new Map,eE=new Map,Jg=[],yEe="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function hQ(p,v){switch(p){case"focusin":case"focusout":Kg=null;break;case"dragenter":case"dragleave":Qg=null;break;case"mouseover":case"mouseout":Zg=null;break;case"pointerover":case"pointerout":JM.delete(v.pointerId);break;case"gotpointercapture":case"lostpointercapture":eE.delete(v.pointerId)}}function tE(p,v,A,D,k,B){return p===null||p.nativeEvent!==B?(p={blockedOn:v,domEventName:A,eventSystemFlags:D,nativeEvent:B,targetContainers:[k]},v!==null&&(v=ha(v),v!==null&&lQ(v)),p):(p.eventSystemFlags|=D,v=p.targetContainers,k!==null&&v.indexOf(k)===-1&&v.push(k),p)}function xEe(p,v,A,D,k){switch(v){case"focusin":return Kg=tE(Kg,p,v,A,D,k),!0;case"dragenter":return Qg=tE(Qg,p,v,A,D,k),!0;case"mouseover":return Zg=tE(Zg,p,v,A,D,k),!0;case"pointerover":var B=k.pointerId;return JM.set(B,tE(JM.get(B)||null,p,v,A,D,k)),!0;case"gotpointercapture":return B=k.pointerId,eE.set(B,tE(eE.get(B)||null,p,v,A,D,k)),!0}return!1}function dQ(p){var v=on(p.target);if(v!==null){var A=a(v);if(A!==null){if(v=A.tag,v===13){if(v=s(A),v!==null){p.blockedOn=v,ft(p.priority,function(){cQ(A)});return}}else if(v===31){if(v=o(A),v!==null){p.blockedOn=v,ft(p.priority,function(){cQ(A)});return}}else if(v===3&&A.stateNode.current.memoizedState.isDehydrated){p.blockedOn=A.tag===3?A.stateNode.containerInfo:null;return}}}p.blockedOn=null}function f2(p){if(p.blockedOn!==null)return!1;for(var v=p.targetContainers;0<v.length;){var A=LU(p.nativeEvent);if(A===null){A=p.nativeEvent;var D=new A.constructor(A.type,A);Ob=D,A.target.dispatchEvent(D),Ob=null}else return v=ha(A),v!==null&&lQ(v),p.blockedOn=A,!1;v.shift()}return!0}function fQ(p,v,A){f2(p)&&A.delete(v)}function bEe(){zU=!1,Kg!==null&&f2(Kg)&&(Kg=null),Qg!==null&&f2(Qg)&&(Qg=null),Zg!==null&&f2(Zg)&&(Zg=null),JM.forEach(fQ),eE.forEach(fQ)}function p2(p,v){p.blockedOn===v&&(p.blockedOn=null,zU||(zU=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,bEe)))}var m2=null;function pQ(p){m2!==p&&(m2=p,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){m2===p&&(m2=null);for(var v=0;v<p.length;v+=3){var A=p[v],D=p[v+1],k=p[v+2];if(typeof D!="function"){if(kU(D||A)===null)continue;break}var B=ha(A);B!==null&&(p.splice(v,3),v-=3,PM(B,{pending:!0,data:k,method:A.method,action:D},D,k))}}))}function k1(p){function v(Ie){return p2(Ie,p)}Kg!==null&&p2(Kg,p),Qg!==null&&p2(Qg,p),Zg!==null&&p2(Zg,p),JM.forEach(v),eE.forEach(v);for(var A=0;A<Jg.length;A++){var D=Jg[A];D.blockedOn===p&&(D.blockedOn=null)}for(;0<Jg.length&&(A=Jg[0],A.blockedOn===null);)dQ(A),A.blockedOn===null&&Jg.shift();if(A=(p.ownerDocument||p).$$reactFormReplay,A!=null)for(D=0;D<A.length;D+=3){var k=A[D],B=A[D+1],te=k[Vt]||null;if(typeof B=="function")te||pQ(A);else if(te){var ye=null;if(B&&B.hasAttribute("formAction")){if(k=B,te=B[Vt]||null)ye=te.formAction;else if(kU(k)!==null)continue}else ye=te.action;typeof ye=="function"?A[D+1]=ye:(A.splice(D,3),D-=3),pQ(A)}}}function mQ(){function p(B){B.canIntercept&&B.info==="react-transition"&&B.intercept({handler:function(){return new Promise(function(te){return k=te})},focusReset:"manual",scroll:"manual"})}function v(){k!==null&&(k(),k=null),D||setTimeout(A,20)}function A(){if(!D&&!navigation.transition){var B=navigation.currentEntry;B&&B.url!=null&&navigation.navigate(B.url,{state:B.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var D=!1,k=null;return navigation.addEventListener("navigate",p),navigation.addEventListener("navigatesuccess",v),navigation.addEventListener("navigateerror",v),setTimeout(A,100),function(){D=!0,navigation.removeEventListener("navigate",p),navigation.removeEventListener("navigatesuccess",v),navigation.removeEventListener("navigateerror",v),k!==null&&(k(),k=null)}}}function BU(p){this._internalRoot=p}g2.prototype.render=BU.prototype.render=function(p){var v=this._internalRoot;if(v===null)throw Error(r(409));var A=v.current,D=jl();sQ(A,D,p,v,null,null)},g2.prototype.unmount=BU.prototype.unmount=function(){var p=this._internalRoot;if(p!==null){this._internalRoot=null;var v=p.containerInfo;sQ(p.current,2,null,p,null,null),nu(),v[fi]=null}};function g2(p){this._internalRoot=p}g2.prototype.unstable_scheduleHydration=function(p){if(p){var v=Ke();p={blockedOn:null,target:p,priority:v};for(var A=0;A<Jg.length&&v!==0&&v<Jg[A].priority;A++);Jg.splice(A,0,p),A===0&&dQ(p)}};var gQ=t.version;if(gQ!=="19.2.4")throw Error(r(527,gQ,"19.2.4"));W.findDOMNode=function(p){var v=p._reactInternals;if(v===void 0)throw typeof p.render=="function"?Error(r(188)):(p=Object.keys(p).join(","),Error(r(268,p)));return p=c(v),p=p!==null?u(p):null,p=p===null?null:p.stateNode,p};var wEe={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var v2=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!v2.isDisabled&&v2.supportsFiber)try{Qe=v2.inject(wEe),rt=v2}catch{}}return nE.createRoot=function(p,v){if(!n(p))throw Error(r(299));var A=!1,D="",k=Y3,B=LM,te=kM;return v!=null&&(v.unstable_strictMode===!0&&(A=!0),v.identifierPrefix!==void 0&&(D=v.identifierPrefix),v.onUncaughtError!==void 0&&(k=v.onUncaughtError),v.onCaughtError!==void 0&&(B=v.onCaughtError),v.onRecoverableError!==void 0&&(te=v.onRecoverableError)),v=nQ(p,1,!1,null,null,A,D,null,k,B,te,mQ),p[fi]=v.current,xU(p),new BU(v)},nE.hydrateRoot=function(p,v,A){if(!n(p))throw Error(r(299));var D=!1,k="",B=Y3,te=LM,ye=kM,Ie=null;return A!=null&&(A.unstable_strictMode===!0&&(D=!0),A.identifierPrefix!==void 0&&(k=A.identifierPrefix),A.onUncaughtError!==void 0&&(B=A.onUncaughtError),A.onCaughtError!==void 0&&(te=A.onCaughtError),A.onRecoverableError!==void 0&&(ye=A.onRecoverableError),A.formState!==void 0&&(Ie=A.formState)),v=nQ(p,1,!0,v,A??null,D,k,Ie,B,te,ye,mQ),v.context=aQ(null),A=v.current,D=jl(),D=To(D),k=Vh(D),k.callback=null,qd(A,k,D),A=D,v.current.lanes=A,pn(v,A),It(v),p[fi]=v.current,xU(p),new g2(v)},nE.version="19.2.4",nE}var EQ;function NEe(){if(EQ)return FU.exports;EQ=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(),FU.exports=IEe(),FU.exports}var LEe=NEe();const TQ=e=>{let t;const i=new Set,r=(c,u)=>{const h=typeof c=="function"?c(t):c;if(!Object.is(h,t)){const d=t;t=u??(typeof h!="object"||h===null)?h:Object.assign({},t,h),i.forEach(f=>f(t,d))}},n=()=>t,o={setState:r,getState:n,getInitialState:()=>l,subscribe:c=>(i.add(c),()=>i.delete(c))},l=t=e(r,n,o);return o},Rpe=(e=>e?TQ(e):TQ),kEe=e=>e;function zEe(e,t=kEe){const i=Ge.useSyncExternalStore(e.subscribe,Ge.useCallback(()=>t(e.getState()),[e,t]),Ge.useCallback(()=>t(e.getInitialState()),[e,t]));return Ge.useDebugValue(i),i}const CQ=e=>{const t=Rpe(e),i=r=>zEe(t,r);return Object.assign(i,t),i},sg=(e=>e?CQ(e):CQ);function BEe(e,t){let i;try{i=e()}catch{return}return{getItem:n=>{var a;const s=l=>l===null?null:JSON.parse(l,void 0),o=(a=i.getItem(n))!=null?a:null;return o instanceof Promise?o.then(s):s(o)},setItem:(n,a)=>i.setItem(n,JSON.stringify(a,void 0)),removeItem:n=>i.removeItem(n)}}const SG=e=>t=>{try{const i=e(t);return i instanceof Promise?i:{then(r){return SG(r)(i)},catch(r){return this}}}catch(i){return{then(r){return this},catch(r){return SG(r)(i)}}}},UEe=(e,t)=>(i,r,n)=>{let a={storage:BEe(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,x)=>({...x,...g}),...t},s=!1,o=0;const l=new Set,c=new Set;let u=a.storage;if(!u)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),i(...g)},r,n);const h=()=>{const g=a.partialize({...r()});return u.setItem(a.name,{state:g,version:a.version})},d=n.setState;n.setState=(g,x)=>(d(g,x),h());const f=e((...g)=>(i(...g),h()),r,n);n.getInitialState=()=>f;let m;const y=()=>{var g,x;if(!u)return;const w=++o;s=!1,l.forEach(M=>{var E;return M((E=r())!=null?E:f)});const S=((x=a.onRehydrateStorage)==null?void 0:x.call(a,(g=r())!=null?g:f))||void 0;return SG(u.getItem.bind(u))(a.name).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==a.version){if(a.migrate){const E=a.migrate(M.state,M.version);return E instanceof Promise?E.then(T=>[!0,T]):[!0,E]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,M.state];return[!1,void 0]}).then(M=>{var E;if(w!==o)return;const[T,R]=M;if(m=a.merge(R,(E=r())!=null?E:f),i(m,!0),T)return h()}).then(()=>{w===o&&(S==null||S(m,void 0),m=r(),s=!0,c.forEach(M=>M(m)))}).catch(M=>{w===o&&(S==null||S(void 0,M))})};return n.persist={setOptions:g=>{a={...a,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u==null||u.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>y(),hasHydrated:()=>s,onHydrate:g=>(l.add(g),()=>{l.delete(g)}),onFinishHydration:g=>(c.add(g),()=>{c.delete(g)})},a.skipHydration||y(),m||f},Ipe=UEe,$P=sg()(Ipe(e=>({theme:"modern",accentColor:"#3b82f6",setTheme:t=>e({theme:t}),setAccentColor:t=>e({accentColor:t})}),{name:"cam-theme"})),jEe=sg(e=>({settingsOpen:!1,sidebarCollapsed:!1,openSettings:()=>e({settingsOpen:!0}),closeSettings:()=>e({settingsOpen:!1}),toggleSettings:()=>e(t=>({settingsOpen:!t.settingsOpen})),toggleSidebar:()=>e(t=>({sidebarCollapsed:!t.sidebarCollapsed})),setSidebarCollapsed:t=>e({sidebarCollapsed:t})})),PQ={theme:"modern",accentColor:"#3b82f6",followMode:!0,hidePolling:!1,pollingTools:["TaskList","TaskGet"],groupRepetitive:!1,activityWindow:3e5,showLabels:!0,showInteractions:!0,displayMode:"technical",speechBubbleTimeout:5,maxEvents:500,maxCommunicationLines:5,lockPanels:!1,showTimeline:!0},Di=sg()(Ipe(e=>({...PQ,setTheme:t=>e({theme:t}),setAccentColor:t=>e({accentColor:t}),setFollowMode:t=>e({followMode:t}),setHidePolling:t=>e({hidePolling:t}),setPollingTools:t=>e({pollingTools:t}),setGroupRepetitive:t=>e({groupRepetitive:t}),setActivityWindow:t=>e({activityWindow:t}),setShowLabels:t=>e({showLabels:t}),setShowInteractions:t=>e({showInteractions:t}),setDisplayMode:t=>e({displayMode:t}),setSpeechBubbleTimeout:t=>e({speechBubbleTimeout:t}),setMaxEvents:t=>e({maxEvents:t}),setMaxCommunicationLines:t=>e({maxCommunicationLines:t}),setLockPanels:t=>e({lockPanels:t}),setShowTimeline:t=>e({showTimeline:t}),toggleFollowMode:()=>e(t=>({followMode:!t.followMode})),toggleHidePolling:()=>e(t=>({hidePolling:!t.hidePolling})),toggleGroupRepetitive:()=>e(t=>({groupRepetitive:!t.groupRepetitive})),toggleLabels:()=>e(t=>({showLabels:!t.showLabels})),toggleInteractions:()=>e(t=>({showInteractions:!t.showInteractions})),toggleLockPanels:()=>e(t=>({lockPanels:!t.lockPanels})),toggleTimeline:()=>e(t=>({showTimeline:!t.showTimeline})),addPollingTool:t=>e(i=>i.pollingTools.includes(t)?i:{pollingTools:[...i.pollingTools,t]}),removePollingTool:t=>e(i=>({pollingTools:i.pollingTools.filter(r=>r!==t)})),resetToDefaults:()=>e({...PQ})}),{name:"cam-settings"})),_n=sg(e=>({projects:[],activeProject:null,activeSprint:null,sprints:[],tasks:[],viewMode:"agents",selectedTaskId:null,setProjects:t=>e({projects:t}),setActiveProject:t=>e({activeProject:t}),setActiveSprint:t=>e({activeSprint:t}),setSprints:t=>e({sprints:t}),setTasks:t=>e({tasks:t}),updateTask:(t,i)=>e(r=>({tasks:r.tasks.map(n=>n.id===t?{...n,...i}:n)})),updateActiveProject:t=>e(i=>({activeProject:i.activeProject?{...i.activeProject,...t}:null})),updateActiveSprint:t=>e(i=>({activeSprint:i.activeSprint?{...i.activeSprint,...t}:null})),removeProject:t=>e(i=>{var r;return{projects:i.projects.filter(n=>n.id!==t),activeProject:((r=i.activeProject)==null?void 0:r.id)===t?null:i.activeProject}}),setViewMode:t=>e({viewMode:t}),selectTask:t=>e({selectedTaskId:t})})),Ni=sg(e=>({session:null,projectId:null,agents:[],events:[],selectedAgentId:null,isConnected:!1,connectionStatus:"disconnected",lastHeartbeat:null,activityWindow:3e5,setSession:t=>e(i=>{var n;return((n=i.session)==null?void 0:n.id)===(t==null?void 0:t.id)?{session:t}:{session:t,events:[],agents:[],selectedAgentId:null}}),setProjectId:t=>e({projectId:t}),setAgents:t=>e({agents:t}),addAgent:t=>e(i=>i.agents.find(n=>n.id===t.id)?{agents:i.agents.map(n=>n.id===t.id?t:n)}:{agents:[...i.agents,t]}),updateAgent:(t,i)=>e(r=>({agents:r.agents.map(n=>n.id===t?{...n,...i}:n)})),setEvents:t=>e({events:t}),addEvent:t=>e(i=>i.session&&t.sessionId!==i.session.id?i:{events:[t,...i.events].slice(0,500)}),selectAgent:t=>e({selectedAgentId:t}),setConnected:t=>e({isConnected:t}),setConnectionStatus:t=>e({connectionStatus:t,isConnected:t==="connected"}),setLastHeartbeat:t=>e({lastHeartbeat:t}),setActivityWindow:t=>e({activityWindow:t}),reset:()=>e({session:null,projectId:null,agents:[],events:[],selectedAgentId:null,isConnected:!1,connectionStatus:"disconnected",lastHeartbeat:null,activityWindow:3e5})}));function gu(e){return new Date(e).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function qc(e){const t=Date.now(),i=new Date(e).getTime(),r=t-i;return r<1e3?"just now":r<6e4?`${Math.floor(r/1e3)}s ago`:r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:`${Math.floor(r/864e5)}d ago`}function H7(e,t){const i=new Date(e).getTime(),r=t?new Date(t).getTime():Date.now(),n=Math.floor((r-i)/1e3),a=Math.floor(n/3600),s=Math.floor(n%3600/60),o=n%60,l=[];return a>0&&l.push(`${a}h`),(s>0||a>0)&&l.push(`${String(s).padStart(2,"0")}m`),l.push(`${String(o).padStart(2,"0")}s`),l.join(" ")}function Lm(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function Npe(e,t){return t===0?"0%":`${Math.round(e/t*100)}%`}function AG(e){return{active:"bg-cam-success",idle:"bg-cam-warning",error:"bg-cam-error",completed:"bg-cam-info",shutdown:"bg-cam-text-muted"}[e]||"bg-cam-text-muted"}function Lpe(e){return{tool_call:"text-cam-accent",file_change:"text-cam-success",command:"text-amber-400",message:"text-purple-400",lifecycle:"text-cam-info",error:"text-cam-error",compact:"text-cam-text-muted",notification:"text-cam-warning"}[e]||"text-cam-text-secondary"}function G7(e){return{critical:"bg-red-500/20 text-red-400 border-red-500/30",high:"bg-orange-500/20 text-orange-400 border-orange-500/30",medium:"bg-blue-500/20 text-blue-400 border-blue-500/30",low:"bg-gray-500/20 text-gray-400 border-gray-500/30"}[e]||"bg-gray-500/20 text-gray-400 border-gray-500/30"}function FEe(e){return{backlog:"bg-gray-500/20 text-gray-400",planned:"bg-blue-500/20 text-blue-400",pending:"bg-yellow-500/20 text-yellow-400",in_progress:"bg-emerald-500/20 text-emerald-400",in_review:"bg-purple-500/20 text-purple-400",completed:"bg-green-500/20 text-green-400",blocked:"bg-red-500/20 text-red-400",deferred:"bg-gray-500/20 text-gray-500"}[e]||"bg-gray-500/20 text-gray-400"}function f0(e){let t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((t<<5)-t);return`hsl(${Math.abs(t%360)}, 70%, 60%)`}function W7(e){if(!e)return"";const t=e.match(/^Sprint\s+(\d+)/i);if(t)return`S${t[1]}`;const i=e.match(/^(v[\d.]+)/i);return i?i[1]:""}function VEe(){const{session:e,agents:t,events:i}=Ni(),[r,n]=ee.useState("00m 00s");ee.useEffect(()=>{if(!(e!=null&&e.startedAt))return;const h=()=>n(H7(e.startedAt,e.endedAt));if(h(),!e.endedAt){const d=setInterval(h,1e3);return()=>clearInterval(d)}},[e==null?void 0:e.startedAt,e==null?void 0:e.endedAt]);const a=t.filter(h=>h.status==="active").length,s=t.reduce((h,d)=>h+d.errorCount,0),o=t.reduce((h,d)=>h+d.toolCallCount,0),l=i.filter(h=>h.category==="file_change").length,u=[...(e==null?void 0:e.status)==="completed"||(e==null?void 0:e.status)==="error"?[{label:(e==null?void 0:e.status)==="error"?"Ended (error)":"Ended",value:e!=null&&e.endedAt?new Date(e.endedAt).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}):"--:--",accent:!1,isEnded:!0}]:[],{label:"Session Duration",value:r,accent:!1,isEnded:!1},{label:"Agents",value:`${a}/${t.length}`,accent:a>0,isEnded:!1},{label:"Tool Calls",value:Lm(o),accent:!1,isEnded:!1},{label:"Events",value:Lm((e==null?void 0:e.eventCount)??0),accent:!1,isEnded:!1},{label:"Files",value:Lm(l),accent:!1,isEnded:!1},{label:"Errors",value:String(s),accent:s>0,isEnded:!1}];return C.jsx("div",{className:"h-10 flex items-center gap-0 px-4 border-b border-cam-border/30 bg-cam-surface/40 shrink-0",children:u.map((h,d)=>C.jsxs("div",{className:`flex items-center gap-2 ${d>0?"border-l border-cam-border/30 pl-4 ml-4":""}`,children:[C.jsx("span",{className:"text-[10px] uppercase tracking-wider text-cam-text-muted font-medium",children:h.label}),C.jsx("span",{className:`text-sm font-mono font-semibold ${h.isEnded?"text-amber-400":h.label==="Errors"&&s>0?"text-cam-error":h.accent?"text-cam-success":"text-cam-text"}`,children:h.value})]},h.label))})}const HEe="/api";async function $c(e,t){const i=await fetch(`${HEe}${e}`,{headers:{"Content-Type":"application/json"},...t});if(!i.ok)throw new Error(`API Error: ${i.status} ${i.statusText}`);return i.json()}async function q7(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.limit&&t.set("limit",String(e.limit));const i=t.toString();return $c(`/sessions${i?`?${i}`:""}`)}async function gC(e){return $c(`/sessions/${e}`)}async function GEe(e,t){return $c(`/sessions/${e}/name`,{method:"PATCH",body:JSON.stringify({name:t})})}async function WEe(e){return $c(`/sessions/${e}/close`,{method:"PATCH"})}async function kpe(e){return $c(`/sessions/${e}/agents`)}async function qEe(e,t){const i=new URLSearchParams;t!=null&&t.category&&i.set("category",t.category),t!=null&&t.agent_id&&i.set("agent_id",t.agent_id),t!=null&&t.tool&&i.set("tool",t.tool),i.set("limit",String(t.limit)),t!=null&&t.offset&&i.set("offset",String(t.offset));const r=i.toString();return $c(`/sessions/${e}/events${r?`?${r}`:""}`)}async function X7(e){return $c(`/sessions/${e}/files`)}async function XEe(){return $c("/projects")}async function YEe(e){return $c(`/projects/${e}`,{method:"DELETE"})}async function $Ee(e){return $c(`/projects/${e}/sprints`)}async function DQ(e,t){const r=new URLSearchParams().toString();return $c(`/projects/${e}/tasks${r?`?${r}`:""}`)}async function KEe(e,t){return $c(`/projects/${e}/tasks/${t}/activity`)}async function QEe(){return $c("/registry")}async function Y7(e){const t=new URLSearchParams;return t.set("project_id",e),$c(`/sessions?${t.toString()}`)}async function ZEe(e){try{const{sessions:t}=await Y7(e),i=t.map(async n=>{try{const{agents:a}=await kpe(n.id);return a}catch{return[]}});return{agents:(await Promise.all(i)).flat()}}catch{return{agents:[]}}}function $7(){const{session:e,projectId:t,agents:i,setAgents:r}=Ni();return ee.useEffect(()=>{if(!(e!=null&&e.id)&&!t)return;const n=async()=>{try{if(t){const{agents:s}=await ZEe(t);if(s.length>0||!(e!=null&&e.id)){r(s);return}}if(e!=null&&e.id){const{agents:s}=await kpe(e.id);r(s)}}catch{}};n();const a=setInterval(n,15e3);return()=>clearInterval(a)},[e==null?void 0:e.id,t,r]),i}const JEe=new Set(["main","team-lead","team_lead","teamlead","lead","orchestrator","coordinator"]),zpe=/^(opus|sonnet|haiku|claude)\s/i;function eTe(e){return zpe.test(e)}const tTe=new Set(["general-purpose","general_purpose","default","agent","unknown",""]);function Ch(e,t,i){const r=t.toLowerCase().trim();return JEe.has(r)?"main":zpe.test(t)||iTe(t)?t:i&&!tTe.has(i.toLowerCase().trim())?i:"Subagent"}function iTe(e){const t=e.trim();return!(t.length===0||t.length<=1||/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t)||/^[0-9a-f]{8,}$/i.test(t))}function Ah(e){const t=e.split("/");return t[t.length-1]||e}function rTe(e){return e.status==="active"}function nTe(){const e=$7(),{selectedAgentId:t,selectAgent:i}=Ni(),[r,n]=ee.useState(!1),{activeAgents:a,inactiveAgents:s}=ee.useMemo(()=>{const o=[],l=[];for(const u of e)rTe(u)?o.push(u):l.push(u);l.sort((u,h)=>new Date(h.lastActivityAt).getTime()-new Date(u.lastActivityAt).getTime());const c=l.slice(0,5);return{activeAgents:o,inactiveAgents:c}},[e]);return e.length===0?C.jsxs("div",{className:"p-4 flex flex-col items-center justify-center h-full text-center",children:[C.jsx("div",{className:"w-10 h-10 rounded-full bg-cam-surface-2 border border-cam-border flex items-center justify-center mb-3",children:C.jsx("svg",{className:"w-5 h-5 text-cam-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})})}),C.jsx("p",{className:"text-xs text-cam-text-muted",children:"Waiting for agents..."}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1",children:"Agents will appear when Claude Code starts"})]}):C.jsxs("div",{className:"p-2",children:[C.jsx("div",{className:"px-2 py-1.5 mb-1",children:C.jsxs("span",{className:"text-[10px] uppercase tracking-wider text-cam-text-muted font-medium",children:["Active (",a.length,")"]})}),a.length>0?C.jsx("div",{className:"space-y-0.5",children:a.map(o=>C.jsx(OQ,{agent:o,isSelected:t===o.id,onSelect:()=>i(t===o.id?null:o.id)},o.id))}):C.jsx("div",{className:"px-2 py-3 text-center",children:C.jsx("p",{className:"text-[10px] text-cam-text-muted",children:"No active agents"})}),s.length>0&&C.jsxs("div",{className:"mt-3",children:[C.jsxs("button",{onClick:()=>n(!r),className:"w-full flex items-center justify-between px-2 py-1.5 rounded-md hover:bg-cam-surface-2 transition-colors group",children:[C.jsx("span",{className:"text-[10px] uppercase tracking-wider text-cam-text-muted font-medium",children:"Recent inactive"}),C.jsxs("div",{className:"flex items-center gap-1.5",children:[C.jsx("span",{className:"text-[10px] bg-cam-surface-2 text-cam-text-muted px-1.5 py-0.5 rounded-full font-medium",children:s.length}),C.jsx("svg",{className:`w-3 h-3 text-cam-text-muted transition-transform duration-200 ${r?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),r&&C.jsx("div",{className:"space-y-0.5 mt-1",children:s.map(o=>C.jsx(OQ,{agent:o,isSelected:t===o.id,onSelect:()=>i(t===o.id?null:o.id),compact:!0},o.id))})]})]})}function OQ({agent:e,isSelected:t,onSelect:i,compact:r=!1}){const n=Ch(e.id,e.name,e.type??void 0),a=f0(e.name);return r?C.jsx("button",{onClick:i,title:`${n} | ${e.type} | ${e.id}`,className:`
|
|
50
50
|
w-full text-left rounded-md px-2 py-1.5 transition-all duration-150
|
|
51
51
|
${t?"bg-cam-accent/10 border border-cam-accent/30":"hover:bg-cam-surface-2 border border-transparent"}
|
|
52
52
|
`,children:C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("div",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${AG(e.status)}`}),C.jsx("span",{className:"text-[11px] text-cam-text-muted truncate flex-1",children:n}),C.jsxs("span",{className:"text-[9px] text-cam-text-muted shrink-0",children:[e.toolCallCount,"c"]}),C.jsx("span",{className:"text-[9px] text-cam-text-muted shrink-0",children:qc(e.lastActivityAt)})]})}):C.jsx("button",{onClick:i,title:`${n} | ${e.type} | ${e.id}`,className:`
|
|
@@ -5551,7 +5551,7 @@ float sobelSample(sampler2D t, sampler2D d, vec2 uv, vec2 resolution, float outl
|
|
|
5551
5551
|
outgoingLight = spe_blend( diffuseColor, outgoingLight, ${a.result} * ${h}, ${s.result} );
|
|
5552
5552
|
}
|
|
5553
5553
|
`),o&&u.push(o.code,`outgoingLight = spe_blend(outgoingLight, ${o.result}, 1.0, SPE_BLENDING_NORMAL);`),l?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${l.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),c&&u.push(`gl_FragColor.a *= ${c.result};`),u.push("#include <encodings_fragment>","#include <fog_fragment>","#include <dithering_fragment>"),t=u.join(`
|
|
5554
|
-
`)}return t}},wut=class{constructor(e=1e3*10){this.timeout=e,this.cache=new Map,this.head={data:null,time:0,src:null,next:null,prev:null},this.tail={data:null,time:1/0,src:null,next:null,prev:null},this.hasClean=!1,this.cleanupTimer=null,this.head.next=this.tail,this.tail.prev=this.head}log(...e){}remove(e){let t=this.cache.get(e);t&&(this.dispose(e,t.data),this.cache.delete(e),t.prev.next=t.next,t.next.prev=t.prev,t.next=null,t.prev=null,t.data=null)}scheduleCleanup(){this.hasClean||(this.log("scheduled cleanup"),this.hasClean=!0,this.cleanupTimer=setTimeout(()=>{this.hasClean=!1,this.cleanupTimer=null,this.log("cleaning");let e=Date.now(),t=this.head.next;for(;t.time<e-this.timeout;){this.dispose(t.src,t.data),this.cache.delete(t.src);let i=t;t=t.next,t.prev=this.head,this.head.next=t,i.next=null,i.prev=null,i.data=null}this.head.next!==this.tail?this.scheduleCleanup():this.log("no more cleanup")},this.timeout+1e3))}has(e){var t;return(t=this.cache.get(e))==null?void 0:t.data}load(e){let t=Date.now(),i=this.cache.get(e);return i===void 0?(i={data:this.create(e),src:e,time:t,next:null,prev:null},this.cache.set(e,i)):(i.time=t,i.prev.next=i.next,i.next.prev=i.prev),i.prev=this.tail.prev,i.next=this.tail,this.tail.prev.next=i,this.tail.prev=i,this.scheduleCleanup(),i.data}disposeAll(){this.cleanupTimer!==null&&(clearTimeout(this.cleanupTimer),this.cleanupTimer=null),this.hasClean=!1,this.cache.forEach((e,t)=>{this.dispose(t,e.data),e.next=null,e.prev=null,e.data=null}),this.cache.clear(),this.head.next=this.tail,this.tail.prev=this.head}destroy(){this.disposeAll(),this.head=null,this.tail=null}},_ut=class extends wut{create(e){return URL.createObjectURL(new Blob([e]))}dispose(e,t){URL.revokeObjectURL(t)}},$T;function Sut(e){return typeof e=="string"?e:($T||($T=new _ut),$T.load(e))}function Aut(){$T&&$T.disposeAll()}var Mut=class{constructor(e,t){this.data=e,this.cache=t,this.refCount=0}deref(){this.refCount,this.refCount-=1,this.refCount===0&&(this.cache.remove(this),this.dispose())}dispose(){this.refCount}},Eut=class{constructor(){this.cache=new Map}remove(e){this.cache.delete(e.data)}load(e){let t=this.cache.get(e);return t===void 0&&(t=this.create(e),this.cache.set(e,t)),t.refCount+=1,t}},Swe=class extends Mut{constructor(e,t){super(e,t.imageHolderCache),this.data=e,this.shared=t,this.loaded=!1,this.isVideo=!1,this.isBuffer=!1,this._cache={1e3:{},1001:{},1002:{}},this.isVideo=e.type==="video",this.isBuffer=e.isWebGLRenderTarget===!0,this.loadPromise=this.updateSrc(this.isBuffer?e:e.data)}async updateSrc(e){if(typeof document>"u")return;this.disposeTextures(),this.loaded=!1;let t=()=>{this.loaded=!0;for(let r of Object.values(this._cache))for(let n of Object.values(r))for(let a of Object.values(n))a&&(a.image=this.img,a.needsUpdate=!0);this.shared.requestRender()};if(this.isBuffer)this.img=e,this.loaded=!0;else if(this.isVideo){if(this.img=document.createElement("video"),this.img.preload="auto",this.img.playsInline=!0,this.img.currentTime=.01,typeof e!="string"){var i=new FileReader;i.readAsDataURL(new Blob([e],{type:"video/mp4"}));let r;await new Promise(n=>{i.onloadend=a=>{var s;r=(s=a.target)==null?void 0:s.result,n(null)}}),this.img.src=r}else this.img.src=e;this.img.onloadeddata=()=>{t()}}else this.img=new Image,this.img.src=Sut(e),this.img.onload=t,await new Promise(r=>{this.img.onload=()=>{t(),r(null)}})}getTexture(e,t=1008,i=1006){var n,a;let r=(a=(n=this._cache[e])==null?void 0:n[t])==null?void 0:a[i];if(r)return r;{let s;return this.isBuffer?s=this.img.texture:this.isVideo?s=new ZXe(this.img,void 0,e,e):s=new wa(this.img,void 0,e,e,i,t),this.loaded&&(s.needsUpdate=!0),this._cache[e]===void 0&&(this._cache[e]={}),this._cache[e][t]===void 0&&(this._cache[e][t]={}),this._cache[e][t][i]=s,s}}setNeedsUpdate(e){for(let t of Object.values(this._cache))for(let i of Object.values(t))for(let r of Object.values(i))r&&(r.needsUpdate=e)}disposeTextures(){for(let[e,t]of Object.entries(this._cache))for(let[i,r]of Object.entries(t))for(let[n,a]of Object.entries(r))a==null||a.dispose(),this._cache[e]!==void 0&&this._cache[e][i]!==void 0&&(this._cache[e][i][n]=void 0)}dispose(){super.dispose(),this.disposeTextures()}},zv=class extends Swe{};function Tut(e,t){var i=Out(t);return i.formatToParts?Put(i,e):Dut(i,e)}var Cut={year:0,month:1,day:2,hour:3,minute:4,second:5};function Put(e,t){try{for(var i=e.formatToParts(t),r=[],n=0;n<i.length;n++){var a=Cut[i[n].type];a>=0&&(r[a]=parseInt(i[n].value,10))}return r}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function Dut(e,t){var i=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(i);return[r[3],r[1],r[2],r[4],r[5],r[6]]}var w6={};function Out(e){if(!w6[e]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),i=t==="06/25/2014, 00:00:00"||t==="06/25/2014 00:00:00";w6[e]=i?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return w6[e]}function Awe(e,t,i,r,n,a,s){var o=new Date(0);return o.setUTCFullYear(e,t,i),o.setUTCHours(r,n,a,s),o}var hue=36e5,Rut=6e4,_6={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function Mwe(e,t,i){var r,n;if(!e||(r=_6.timezoneZ.exec(e),r))return 0;var a;if(r=_6.timezoneHH.exec(e),r)return a=parseInt(r[1],10),due(a)?-(a*hue):NaN;if(r=_6.timezoneHHMM.exec(e),r){a=parseInt(r[1],10);var s=parseInt(r[2],10);return due(a,s)?(n=Math.abs(a)*hue+s*Rut,a>0?-n:n):NaN}if(Lut(e)){t=new Date(t||Date.now());var o=i?t:Iut(t),l=H9(o,e),c=i?l:Nut(t,l,e);return-c}return NaN}function Iut(e){return Awe(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function H9(e,t){var i=Tut(e,t),r=Awe(i[0],i[1]-1,i[2],i[3]%24,i[4],i[5],0).getTime(),n=e.getTime(),a=n%1e3;return n-=a>=0?a:1e3+a,r-n}function Nut(e,t,i){var r=e.getTime(),n=r-t,a=H9(new Date(n),i);if(t===a)return t;n-=a-t;var s=H9(new Date(n),i);return a===s?a:Math.max(a,s)}function due(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}var fue={};function Lut(e){if(fue[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),fue[e]=!0,!0}catch{return!1}}var kut=N0(jGe(),1),pue=N0(FGe(),1),zut=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,But=zut,S6=36e5,mue=6e4,Uut=2,Kl={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:But};function jut(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);var i={},r=i.additionalDigits==null?Uut:(0,kut.default)(i.additionalDigits);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var n=Fut(e),a=Vut(n.date,r),s=a.year,o=a.restDateString,l=Hut(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,h;if(n.time&&(u=Gut(n.time),isNaN(u)))return new Date(NaN);if(n.timeZone||i.timeZone){if(h=Mwe(n.timeZone||i.timeZone,new Date(c+u)),isNaN(h))return new Date(NaN)}else h=(0,pue.default)(new Date(c+u)),h=(0,pue.default)(new Date(c+u+h));return new Date(c+u+h)}else return new Date(NaN)}function Fut(e){var t={},i=Kl.dateTimePattern.exec(e),r;if(i?(t.date=i[1],r=i[3]):(i=Kl.datePattern.exec(e),i?(t.date=i[1],r=i[2]):(t.date=null,r=e)),r){var n=Kl.timeZone.exec(r);n?(t.time=r.replace(n[1],""),t.timeZone=n[1].trim()):t.time=r}return t}function Vut(e,t){var i=Kl.YYY[t],r=Kl.YYYYY[t],n;if(n=Kl.YYYY.exec(e)||r.exec(e),n){var a=n[1];return{year:parseInt(a,10),restDateString:e.slice(a.length)}}if(n=Kl.YY.exec(e)||i.exec(e),n){var s=n[1];return{year:parseInt(s,10)*100,restDateString:e.slice(s.length)}}return{year:null}}function Hut(e,t){if(t===null)return null;var i,r,n,a;if(e.length===0)return r=new Date(0),r.setUTCFullYear(t),r;if(i=Kl.MM.exec(e),i)return r=new Date(0),n=parseInt(i[1],10)-1,vue(t,n)?(r.setUTCFullYear(t,n),r):new Date(NaN);if(i=Kl.DDD.exec(e),i){r=new Date(0);var s=parseInt(i[1],10);return Xut(t,s)?(r.setUTCFullYear(t,0,s),r):new Date(NaN)}if(i=Kl.MMDD.exec(e),i){r=new Date(0),n=parseInt(i[1],10)-1;var o=parseInt(i[2],10);return vue(t,n,o)?(r.setUTCFullYear(t,n,o),r):new Date(NaN)}if(i=Kl.Www.exec(e),i)return a=parseInt(i[1],10)-1,yue(t,a)?gue(t,a):new Date(NaN);if(i=Kl.WwwD.exec(e),i){a=parseInt(i[1],10)-1;var l=parseInt(i[2],10)-1;return yue(t,a,l)?gue(t,a,l):new Date(NaN)}return null}function Gut(e){var t,i,r;if(t=Kl.HH.exec(e),t)return i=parseFloat(t[1].replace(",",".")),A6(i)?i%24*S6:NaN;if(t=Kl.HHMM.exec(e),t)return i=parseInt(t[1],10),r=parseFloat(t[2].replace(",",".")),A6(i,r)?i%24*S6+r*mue:NaN;if(t=Kl.HHMMSS.exec(e),t){i=parseInt(t[1],10),r=parseInt(t[2],10);var n=parseFloat(t[3].replace(",","."));return A6(i,r,n)?i%24*S6+r*mue+n*1e3:NaN}return null}function gue(e,t,i){t=t||0,i=i||0;var r=new Date(0);r.setUTCFullYear(e,0,4);var n=r.getUTCDay()||7,a=t*7+i+1-n;return r.setUTCDate(r.getUTCDate()+a),r}var Wut=[31,28,31,30,31,30,31,31,30,31,30,31],qut=[31,29,31,30,31,30,31,31,30,31,30,31];function Ewe(e){return e%400===0||e%4===0&&e%100!==0}function vue(e,t,i){if(t<0||t>11)return!1;if(i!=null){if(i<1)return!1;var r=Ewe(e);if(r&&i>qut[t]||!r&&i>Wut[t])return!1}return!0}function Xut(e,t){if(t<1)return!1;var i=Ewe(e);return!(i&&t>366||!i&&t>365)}function yue(e,t,i){return!(t<0||t>52||i!=null&&(i<0||i>6))}function A6(e,t,i){return!(e!=null&&(e<0||e>=25)||t!=null&&(t<0||t>=60)||i!=null&&(i<0||i>=60))}function Yut(e,t,i){var r=jut(e,i),n=Mwe(t,r,!0),a=new Date(r.getTime()-n),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}function tc(e,t){return t.color(e)}function xue(e=new Date,t){let i=t.format,r=e.getSeconds(),n=e;t&&t.timeZone!==null&&(n=Yut(new Date,t.timeZone));let a=n.getHours(),s=n.getMinutes(),o;t.format12h24h==="12ampm"&&(o=a>=12?"PM":"AM");let l=a;t.format12h24h!=="24"&&(l=a%12,l===0&&(l=12));let c,u;switch(i){case"HH:mm:ss":c=[l,s,r];break;case"HH:mm":c=[l,s];break;case"HH":c=[l],o=void 0;break;case"mm":c=[s],o=void 0;break;case"ss":c=[r],o=void 0;break;case"year":u=n.getFullYear();break;case"month":u=n.getMonth()+1;break;case"dayOfYear":u=Math.floor((n.getTime()-new Date(n.getFullYear(),0,0).getTime())/864e5);break;case"dayOfMonth":u=n.getDate();break;case"secondOfDay":u=a*60*60+s*60+r;break;default:console.error("Unknown time format",i),u=0;break}return c!==void 0?{textValue:c,suffix:o}:u}function $ut(e,t){switch(e.type){case"fresnel":return Zut(e,t);case"gradient":return Jut(e,t);case"depth":return eht(e,t);case"normal":return tht(e,t);case"noise":return iht(e,t);case"rainbow":return rht(e,t);case"toon":return nht(e,t);case"outline":return aht(e,t);case"transmission":return sht(e,t);case"pattern":return oht(e,t);case"color":default:return Qut(e,t)}}function Kut(e){return{type:e.type}}function Rd(e,t){let{alpha:i,mode:r,isMask:n}=e,a=typeof i=="string"?(Number(t.getVariable(i))??100)/100:i;return{...Kut(e),alpha:a,mode:r,isMask:n}}function Qut(e,t){return{...Rd(e,t),color:tc(e.color,t)}}function Zut(e,t){let{bias:i,scale:r,intensity:n,factor:a,color:s}=e;return{...Rd(e,t),color:tc(s,t),bias:i,scale:r,intensity:n,factor:a}}function Jut(e,t){let{gradientType:i,smooth:r,colors:n,steps:a,angle:s,offset:o,morph:l}=e;return{...Rd(e,t),gradientType:i,smooth:r,colors:n.map(c=>new Ii(c[0],c[1],c[2],c[3])),num:n.length,steps:a,offset:new Ce(...o.map(c=>typeof c=="number"?c:0)),morph:new Ce(...l.map(c=>typeof c=="number"?c:0)),angle:s}}function eht(e,t){let{gradientType:i,near:r,far:n,isVector:a,isWorldSpace:s,origin:o,direction:l,colors:c,steps:u,smooth:h}=e;return{...Rd(e,t),gradientType:i,near:r,far:n,isVector:a,isWorldSpace:s,origin:new Y(...o),direction:l?new Y(...l):new Y(1,0,0),colors:c.map(d=>d!==void 0?new Ii(d[0],d[1],d[2],d[3]):new Ii(0,0,0,0)),steps:u.slice(0,c.length),smooth:h}}function tht(e,t){let{cnormal:i}=e;return{...Rd(e,t),cnormal:new Y(i[0],i[1],i[2])}}function iht(e,t){return{...Rd(e,t),scale:e.scale,move:e.move,fA:new Ce(...e.fA.map(i=>typeof i=="number"?i:0)),fB:new Ce(...e.fB.map(i=>typeof i=="number"?i:0)),size:new Y(...e.size),distortion:new Ce(...e.distortion.map(i=>typeof i=="number"?i:0)),colorA:tc(e.colorA,t),colorB:tc(e.colorB,t),colorC:tc(e.colorC,t),colorD:tc(e.colorD,t),noiseType:e.noiseType,voronoiStyle:e.voronoiStyle,highCut:e.highCut,lowCut:e.lowCut,smoothness:e.smoothness,seed:e.seed,quality:e.quality}}function rht(e,t){return{...Rd(e,t),filmThickness:e.filmThickness,movement:e.movement,wavelengths:new Y(...e.wavelengths),noiseStrength:e.noiseStrength,noiseScale:e.noiseScale,offset:new Y(...e.offset)}}function nht(e,t){return{...Rd(e,t),positioning:e.positioning,colors:e.colors.map(i=>new Ii(i[0],i[1],i[2],i[3])),num:e.colors.length,steps:e.steps,source:new Y(...e.source),isWorldSpace:e.isWorldSpace,noiseStrength:e.noiseStrength,noiseScale:e.noiseScale,shadowColor:tc(e.shadowColor,t),offset:new Y(...e.offset)}}function aht(e,t){return{...Rd(e,t),outlineColor:tc(e.outlineColor,t),contourColor:tc(e.contourColor,t),outlineWidth:e.outlineWidth,contourWidth:e.contourWidth,outlineThreshold:e.outlineThreshold,contourThreshold:e.contourThreshold,outlineSmoothing:e.outlineSmoothing,contourFrequency:e.contourFrequency,contourDirection:new Y(...e.contourDirection),positionalLines:e.positionalLines,compensation:e.compensation}}function sht(e,t){return{...Rd(e,t),thickness:e.thickness,ior:e.ior,roughness:e.roughness}}function oht(e,t){return{...Rd(e,t),style:e.style,projection:e.projection,axis:e.axis,blending:e.blending,offset:new Ce(...e.offset.map(i=>typeof i=="number"?i:0)),colorA:tc(e.colorA,t),colorB:tc(e.colorB,t),frequency:new Ce(...e.frequency.map(i=>typeof i=="number"?i:0)),size:e.size,variation:e.variation,smoothness:e.smoothness,zigzag:e.zigzag,rotation:e.rotation,vertical:new Ce(...e.vertical.map(i=>typeof i=="number"?i:0)),horizontal:new Ce(...e.horizontal.map(i=>typeof i=="number"?i:0)),sides:e.sides}}var HL=class extends Ks{},lht={noise:["noiseType"],texture:["projection","axis","side"],video:["projection","axis","side"],displace:["noiseType"],light:["roughnessMap","bumpMap"],depth:["smooth","isWorldSpace","gradientType","isVector"],pattern:["style","projection","axis"]},cht={depth:["colors"]};function uht(e,t,i){var a,s;if(t==="isMask")return!0;let r=lht[e.type],n=cht[e.type];if(n!==void 0){let o=e.color;if(n.includes(t)){let l=(s=(a=o[t])==null?void 0:a.value)==null?void 0:s.length;if(l!==void 0&&l!==i.length)return!0}}return r!==void 0?r.includes(t):!1}function M6(e,t){if(Array.isArray(t)){if(!Array.isArray(e)||e.length!==t.length)return!1;for(let[n,a]of t.entries()){let s=e[n];if(typeof a=="string"||typeof a=="number"&&typeof s=="string")return!0}return!1}let i=typeof e=="string",r=typeof t=="string";return i!==r||i&&r}function o$(e,t,i){let r=i.uniforms[`f${i.id}_texture`];if(!r)return!1;let n=!1,a=e;if("image"in a){let s=a.image,o=t.image(s),l=r;l.image instanceof zv||l.image.deref(),l.image=o}if("video"in a){let s=a.video,o=t.video(s),l=r;l.image instanceof zv||l.image.deref(),l.image=o}if("wrapping"in a){let s=r;s.wrap=a.wrapping}if("minFilter"in a){let s=r;s.minFilter=a.minFilter}if("magFilter"in a){let s=r;s.magFilter=a.magFilter}if("rotation"in a&&i.uniforms[`f${i.id}_rotation`])return i.uniforms[`f${i.id}_rotation`].value=(Pi(a.rotation??0,t)??0)*Wt.DEG2RAD,n;if("repeat"in a||"offset"in a||"rotation"in a){let s="mat",o=i.uniforms[`f${i.id}_${s}`];if(!o)return n;if("repeat"in a){let l=a.repeat;M6(i.data.texture.repeat,l)&&(n=!0),o.repeat=KT(l,t).map((c,u)=>typeof l[u]=="string"?1/c:c)}if("offset"in a){let l=a.offset;M6(i.data.texture.offset,l)&&(n=!0),o.offset=KT(l,t).map((c,u)=>typeof l[u]=="string"?-c:c)}if("rotation"in a){let l=i.data.texture.rotation,c=a.rotation??0;(l===void 0||M6(l,c))&&(n=!0),o.rotation=Pi(c,t)??0}o.updateMatrix()}return n}function hht(e,t,i,r){let n=!1;for(let[a,s]of Object.entries(e)){if(a==="bumpMap"||a==="roughnessMap"){n=!0;continue}if(!a||s===void 0)continue;if(Cwe(a,i,r,t)){a==="visible"&&i.type==="light"&&(n=!0);continue}i.visible=r.visible;let o=i.uniforms[`f${i.id}_${a}`];if(o&&!(o instanceof n$))switch(n=n||uht(i,a,s),o.constructor){case qa:if(typeof s=="string"){let l=t.getColor(s);l&&(o.value=l);break}else{let l=s;o.value instanceof HL?o.value=new Ks(l.r,l.g,l.b,l.a):o.setRGBA(l);break}case mm:if(typeof s=="string"){let l=t.getColor(s);l&&(o.value=l);break}else{let l=s;o.value instanceof HL?o.value=new Ks(l.r,l.g,l.b,l.a):o.value.setRGBA(l.r,l.g,l.b,l.a);break}case Wo:{let l=s;o.value.setX(l[0]),o.value.setY(l[1]);break}case hh:{let l=s;o.value.setX(l[0]),o.value.setY(l[1]),o.value.setZ(l[2]);break}case _m:{o$(s,t,i);break}case sx:{o.value=s.map(l=>new Ii(...l));break}default:{o.value=s;break}}}return n}var ob=(e,t,i)=>Math.max(0,Math.min(1,Number(t.getVariable(typeof e=="number"?e*100:e,i)??100)/100))??1,Pi=(e,t,i)=>typeof e=="number"?e:t.getVariable(e,i),lv=(e,t)=>(e||(e=new Y),e.x=Pi(e.x,t)??0,e.y=Pi(e.y,t)??0,e.z=Pi(e.z,t)??0,e),Zp=(e,t)=>(e||(e=new Ce),e.x=Pi(e.x,t)??0,e.y=Pi(e.y,t)??0,e),KT=(e,t)=>{let i=e.map(r=>Pi(r,t)??0);return[i[0],i[1]]},yD=class{constructor(e,t,i,r,n){this.id=e,this.uuid=t,this.data=i,this.uniforms={};for(let a in r)this.uniforms[`f${this.id}_${a}`]=r[a];for(let a in i)Cwe(a,this,i,n)}get type(){return this.data.type}static create(e,t,i,r){if(i.type==="light")return Cf.createLightLayer(e,t,i,r);if(i.type==="texture"||i.type==="video"){let n=i.type==="texture"?r.uiBuffer(i.texture.image)??r.image(i.texture.image):r.video(i.texture.video),a=new j9(n,i.texture.wrapping,i.texture.minFilter??1008,i.texture.magFilter??1006),s=new dut(n),o=new fut(KT(i.texture.repeat,r),KT(i.texture.offset,r),Pi(i.texture.rotation??0,r)),l=new Zt(i.crop?1:0),c=new Ln(i.projection??0),u=new Ln(["x","y","z"].indexOf(i.axis)??0),h=new Ln(i.side??0),d=new Wo(i.size?new Ce(...KT(i.size,r)):new Ce(100,100)),f=new Zt(i.blending??0),m=new Zt(ob(i.alpha,r)),y=new Ln(i.mode??0),g=new wl(i.isMask??!1),x=new a$(a,s,l,c,u,h,d,f,o,m,y,g),w=new Kn(x.calpha,"f");return new ja(e,t,i,{texture:a,textureSize:s,crop:l,projection:c,axis:u,side:h,size:d,blending:f,mat:o,alpha:m,mode:y,isMask:g},x,y,w,g,r)}else if(i.type==="matcap"){let n=r.image(i.texture.image),a=new j9(n,i.texture.wrapping,i.texture.minFilter??1008,i.texture.magFilter??1006),s=new Zt(ob(i.alpha,r)),o=new Ln(i.mode??0),l=new wl(i.isMask??!1),c=new Zt((Pi(i.texture.rotation??0,r)??0)*Wt.DEG2RAD),u=new cwe(a,s,o,l,c),h=new Kn(u.calpha,"f");return new ja(e,t,i,{texture:a,alpha:s,mode:o,isMask:l,rotation:c},u,o,h,l,r)}else if(i.type==="displace")if(i.displacementType==="noise"){let n=new hh(new Y(...i.offset.map(g=>Pi(g,r)??0))),a=new Zt(Pi(i.scale,r)??10),s=new Zt(Pi(i.intensity,r)??8),o=new Zt(Pi(i.movement,r)??1),l=new Ln(i.noiseType??0),c=new Ln(i.voronoiStyle??0),u=new Zt(Pi(i.smoothness,r)??.5),h=new Zt(Pi(i.seed,r)??0),d=new Zt(Pi(i.highCut,r)??1),f=new Zt(Pi(i.lowCut,r)??0),m=new Ln(Pi(i.quality,r)??1),y=new wwe(s,o,n,c,u,h,d,f,m,a,l);return new Twe(e,t,i,{offset:n,scale:a,intensity:s,movement:o,noiseType:l,voronoiStyle:c,smoothness:u,seed:h,highCut:d,lowCut:f,quality:m},y,r)}else throw new Error;else return pht(e,t,i,r)}updateByOp(e,t,i){let r=e,n=!1;if(r.path[0]===void 0){for(let a of Object.keys(r.props))try{let s=this.data[a],o=t[a];if(Array.isArray(s)&&Array.isArray(o)){for(let[l,c]of o.entries()){let u=s[l];if(typeof c=="string"||typeof c=="number"&&typeof u=="string"){n=!0;break}}if(n)break}else if(typeof o=="string"&&typeof s=="number"||typeof o=="number"&&typeof s=="string"||typeof o=="string"&&typeof s=="string"&&o!==s){n=!0;break}}catch(s){console.error(s)}if(r.type===0)return"type"in r.props||"category"in r.props||"visible"in r.props||"noiseType"in r.props?(i.scene.markNeedsUpdateRendererDirty(),!0):hht(r.props,i.shared,this,t)||n}else if(r.path[0]==="texture")return"texture"in t||"video"in t?o$(r.props,i.shared,this)||n:!0;return n}dispose(){if(dht(this)){let e=this.uniforms[`f${this.id}_texture`];if(!e)return!1;let t=e;t.image instanceof zv||t.image.deref()}}hasValueByKey(e){return this.uniforms[e]!==void 0}hasValue(e){return this.hasValueByKey(`f${this.id}_${e}`)}setValue(e,t){let i=`f${this.id}_${e}`;this.hasValueByKey(i)&&t!==void 0&&(this.uniforms[i].value=t)}getNode(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t]}getValue(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t].value}getName(e){let t=/f\d+_(.*)/.exec(e);if(t&&t.length>1)return t[1];console.log(`Layer.getName: error ${e}`)}getNames(){let e=[];for(let t in this.uniforms){let i=this.getName(t);i&&e.push(i)}return e}},ja=class extends yD{constructor(e,t,i,r,n,a,s,o,l){super(e,t,i,r,l),this.params=r,this.color=n,this.mode=a,this.alpha=s,this.isMask=o}},Twe=class extends yD{constructor(e,t,i,r,n,a){super(e,t,i,r,a),this.position=n}},Cf=class extends yD{constructor(e,t,i,r,n,a){super(e,t,i,n,a),this.node=r}static createLightLayer(e,t,i,r){let n,a=new Zt(ob(i.alpha,r)),s=new Ln(i.mode),o=new Zt(i.bumpMapIntensity),l=new Zt(ob(i.alphaOverride,r)),c;if(!i.visible)n=new s$,c={};else if(i.category==="lambert"){n=new vut;let u=new qa(r.color(i.emissive)??0),h=new wl(i.occlusion??!0);c={emissive:u,occlusion:h},n.emissive=u,n.occlusion=h}else if(i.category==="toon"){n=new but;let u=new Zt(i.shininess??30),h=new qa(r.color(i.specular)??1118481);c={shininess:u,specular:h},n.shininess=u,n.specular=h}else if(i.category==="physical"){n=new xut;let u=new Zt(i.roughness??.3),h=new Zt(i.metalness??0),d=new Zt(i.reflectivity??.5),f=new wl(i.occlusion??!0);c={roughness:u,metalness:h,reflectivity:d,occlusion:f},n.roughness=u,n.metalness=h,n.reflectivity=d,n.occlusion=f}else{n=new yut;let u=new Zt(i.shininess??30),h=new qa(i.specular!==void 0?r.color(i.specular)??1118481:1118481),d=new wl(i.occlusion??!0);c={shininess:u,specular:h,occlusion:d},n.shininess=u,n.specular=h,n.occlusion=d}return n.alpha=new Zt(1),n.shadingAlpha=a,n.shadingBlend=s,n.bumpMapIntensity=o,n.alphaOverride=l,c.alpha=n.shadingAlpha,c.mode=n.shadingBlend,c.bumpMapIntensity=n.bumpMapIntensity,c.alphaOverride=n.alphaOverride,new Cf(e,t,i,n,c,r)}get category(){return this.node.category}};function dht(e){let t=e instanceof yD?e.type:e;return t==="texture"||t==="video"||t==="displace_map"||t==="matcap"}function nh(e){return{alpha:new Zt(e.alpha??1),mode:new Ln(e.mode??0),isMask:new wl(e.isMask??!1)}}function fht(e,t,i,r,n){switch(e.type){case"color":{let a=new qa(r.color??Au),s=nh(r),o=new F9(a,s.alpha),l=new Kn(o.calpha,"f");return new ja(t,i,e,{color:a,...s},o,s.mode,l,s.isMask,n)}case"fresnel":{let a=new qa(r.color??16777215),s=new Zt(Pi(r.bias,n)??.1),o=new Zt(Pi(r.scale,n)??1),l=new Zt(Pi(r.intensity,n)??2),c=new Zt(Pi(r.factor,n)??1),u=nh(r),h=new put(a,s,o,l,c,u.alpha,u.mode,u.isMask),d=new Kn(h.calpha,"f");return new ja(t,i,e,{color:a,bias:s,scale:o,intensity:l,factor:c,...u},h,u.mode,d,u.isMask,n)}case"rainbow":{let a=new Zt(Pi(r.filmThickness,n)??30),s=new Zt(Pi(r.movement,n)??0),o=new hh(lv(r.wavelengths,n)),l=new Zt(Pi(r.noiseStrength,n)??0),c=new Zt(Pi(r.noiseScale,n)??1),u=new hh(lv(r.offset,n)),h=nh(r),d=new mwe(a,s,o,l,c,u,h.alpha,h.isMask),f=new Kn(d.calpha,"f");return new ja(t,i,e,{filmThickness:a,movement:s,wavelengths:o,noiseStrength:l,noiseScale:c,offset:u,...h},d,h.mode,f,h.isMask,n)}case"transmission":{let a=new Zt(Pi(r.thickness??10,n)),s=new Zt(Pi(r.ior??1.5,n)),o=new Zt(Pi(r.roughness??.5,n)),l=gi.transmissionSize,c=gi.transmissionRenderTarget,u=gi.transmissionRenderTargetDepth,h=window.innerWidth,d=window.innerHeight,f=h>=d?new Wo(d/h,1):new Wo(1,h/d),m=nh(r),y=new xwe(a,s,o,l,c,u,f,m.alpha),g=new Kn(y.calpha,"f");return new ja(t,i,e,{thickness:a,ior:s,roughness:o,aspectRatio:f,...m},y,m.mode,g,m.isMask,n)}case"toon":{let a=new Ln(r.positioning??0),s;r.colors?s=new sx(r.colors.length,r.colors):(s=new sx(10,new Ii(0,0,0,1)),s.value[1]=new Ii(1,1,1,1));let o;r.steps?o=new ax(r.steps.length,r.steps):(o=new ax(10,1),o.value[0]=0);let l=new hh(lv(r.source??new Y(0,0,0),n)),c=new wl(r.isWorldSpace??!0),u=new Zt(Pi(r.noiseStrength??0,n)),h=new Zt(Pi(r.noiseScale??1,n)),d=new mm(r.shadowColor),f=new hh(lv(r.offset??new Y(0,0,0),n)),m=nh(r),y=new vwe(a,s,o,l,c,u,h,d,f,m.alpha),g=new Kn(y.calpha,"f");return new ja(t,i,e,{positioning:a,colors:s,steps:o,source:l,isWorldSpace:c,noiseStrength:u,noiseScale:h,shadowColor:d,offset:f,...m},y,m.mode,g,m.isMask,n)}case"outline":{let a=new qa(r.outlineColor??16777215),s=new qa(r.contourColor??16777215),o=new Zt(Pi(r.outlineWidth??.1,n)),l=new Zt(Pi(r.contourWidth??.1,n)),c=new Zt(Pi(r.outlineThreshold??.1,n)),u=new Zt(Pi(r.contourThreshold??.1,n)),h=new Zt(Pi(r.outlineSmoothing??.1,n)),d=new Zt(Pi(r.contourFrequency??.1,n)),f=new hh(lv(r.contourDirection??new Y(0,1,0),n)),m=new wl(r.positionalLines??!1),y=new wl(r.compensation??!0),g=gi.normalRenderTarget,x=gi.normalRenderTargetDepth,w=gi.pixelRatioNode,S=gi.resolution,M=nh(r),E=new dwe(a,s,o,l,c,u,h,d,f,m,y,S,g,x,w,M.alpha),T=new Kn(E.calpha,"f");return new ja(t,i,e,{outlineColor:a,contourColor:s,outlineWidth:o,contourWidth:l,outlineThreshold:c,contourThreshold:u,outlineSmoothing:h,contourFrequency:d,contourDirection:f,positionalLines:m,compensation:y,...M},E,M.mode,T,M.isMask,n)}case"depth":{let a=new Ln(r.gradientType??0),s=new wl(r.smooth??!1),o=new Zt(Pi(r.near,n)??50),l=new Zt(Pi(r.far,n)??200),c=new Zt(r.isVector??1),u=new Zt(r.isWorldSpace??0),h=new hh(lv(r.origin,n)),d=new hh(lv(r.direction,n)),f;r.colors?f=new sx(r.colors.length,r.colors):(f=new sx(2,new Ii(0,0,0,1)),f.value[1]=new Ii(1,1,1,1));let m;r.steps?m=new ax(r.steps.length,r.steps):(m=new ax(2,1),m.value[0]=0);let y=nh(r),g=new awe(a,s,o,l,c,u,h,d,f,m,y.alpha,y.isMask),x=new Kn(g.calpha,"f");return new ja(t,i,e,{gradientType:a,smooth:s,near:o,far:l,isVector:c,isWorldSpace:u,origin:h,direction:d,colors:f,steps:m,...y},g,y.mode,x,y.isMask,n)}case"noise":{let a=new Zt(Pi(r.scale,n)??1),s=new hh(lv(r.size??new Y(100,100,100),n)),o=new Zt(Pi(r.move,n)??1),l=new Wo(Zp(r.fA??new Ce(1.7,9.2),n)),c=new Wo(Zp(r.fB??new Ce(8.3,2.8),n)),u=new Wo(Zp(r.distortion??new Ce(1,1),n)),h=new mm(r.colorA),d=new mm(r.colorB),f=new mm(r.colorC),m=new mm(r.colorD),y=new Ln(r.noiseType??0),g=new Ln(r.voronoiStyle??0),x=new Zt(Pi(r.highCut,n)??1),w=new Zt(Pi(r.lowCut,n)??0),S=new Zt(Pi(r.smoothness,n)??.5),M=new Zt(Pi(r.seed,n)??.5),E=new Ln(r.quality??1),T=nh(r),R=new uwe(a,s,o,l,c,u,h,d,f,m,T.alpha,y,T.isMask,g,x,w,S,M,E),P=new Kn(R.calpha,"f");return new ja(t,i,e,{scale:a,size:s,move:o,fA:l,fB:c,distortion:u,colorA:h,colorB:d,colorC:f,colorD:m,noiseType:y,...T,voronoiStyle:g,highCut:x,lowCut:w,smoothness:S,seed:M,quality:E},R,T.mode,P,T.isMask,n)}case"normal":{let a=new hh(r.cnormal??new Y(1,1,1)),s=nh(r),o=new nwe(a,s.alpha),l=new Kn(o.calpha,"f");return new ja(t,i,e,{cnormal:a,...s},o,s.mode,l,s.isMask,n)}case"gradient":{let a=new Ln(r.gradientType??0),s=new wl(r.smooth??!1),o;r.colors?o=new sx(r.colors.length,r.colors):(o=new sx(10,new Ii(0,0,0,1)),o.value[1]=new Ii(1,1,1,1));let l;r.steps?l=new ax(r.steps.length,r.steps):(l=new ax(10,1),l.value[0]=0);let c=new Wo(Zp(r.offset??new Ce(0,0),n)),u=new Wo(Zp(r.morph??new Ce(0,0),n)),h=new Zt(Pi(r.angle??0,n)),d=nh(r),f=new owe(a,s,o,l,c,u,h,d.alpha,d.isMask),m=new Kn(f.calpha,"f");return new ja(t,i,e,{gradientType:a,smooth:s,colors:o,steps:l,offset:c,morph:u,angle:h,...d},f,d.mode,m,d.isMask,n)}case"pattern":{let a=new Ln(r.style??0),s=new Ln(r.projection??0),o=new Ln(["x","y","z"].indexOf(r.axis)??0),l=new Zt(Pi(r.blending??0,n)),c=new Wo(Zp(r.offset,n)),u=new mm(r.colorA),h=new mm(r.colorB),d=new Wo(Zp(r.frequency??new Ce(10,10),n)),f=new Zt(Pi(r.size??.5,n)),m=new Zt(Pi(r.variation??0,n)),y=new Zt(Pi(r.smoothness??.5,n)),g=new Zt(Pi(r.zigzag??0,n)),x=new Zt(Pi(r.rotation??0,n)),w=new Wo(Zp(r.vertical??new Ce(0,1),n)),S=new Wo(Zp(r.horizontal??new Ce(0,1),n)),M=new Ln(r.sides??6),E=nh(r),T=new fwe(a,s,o,l,c,u,h,d,f,m,y,g,x,w,S,M,E.alpha,E.isMask),R=new Kn(T.calpha,"f");return new ja(t,i,e,{style:a,projection:s,axis:o,blending:l,offset:c,colorA:u,colorB:h,frequency:d,size:f,variation:m,smoothness:y,zigzag:g,rotation:x,vertical:w,horizontal:S,sides:M,...E},T,E.mode,R,E.isMask,n)}default:{let a=new qa(1,0,0,1),s=nh(r),o=new F9(a,s.alpha),l=new Kn(o.calpha,"f");return new ja(t,i,e,{color:a,...s},o,s.mode,l,s.isMask,n)}}}function pht(e,t,i,r){let n=$ut(i,r);return fht(i,e,t,n,r)}function Cwe(e,t,i,r){if(i.type==="displace"&&(e==="intensity"||e==="visible")){let n=t.uniforms[`f${t.id}_intensity`];return n?(n.value=(Pi(i.intensity,r)??1)*(i.visible?1:0),n):void 0}if(i.type!=="displace"&&(e==="alpha"||e==="visible")){let n=t.uniforms[`f${t.id}_alpha`];if(!n)return;if(n.value=ob(i.alpha,r)*(i.visible?1:0),i.type==="outline"&&e==="visible"){let a=t.uniforms[`f${t.id}_compensation`];a&&(a.value=i.compensation&&i.visible)}return n}}function Oc(e,t,i,r,n,a,s=[]){let o=i;for(let l of s)l in o&&(o=o[l]);for(let l of e)l in o&&n.getVariable(o[l],["material",a,"layer",r,...s,String(l)]);for(let l of t)l in o&&o[l].forEach((c,u)=>{n.getVariable(c,["material",a,"layer",r,...s,String(l),u===0?"x":u===1?"y":"z"])})}function y_(e,t){let i=0,r=e.layers.find(n=>n.data.type==="light");if(r){let n=r.data,a=Number(t.getVariable(n.alphaOverride));if((typeof n.alphaOverride=="string"?a/100:n.alphaOverride)<1)return!0}for(let n of e.layers){if(n.data.type!=="displace"&&n.data.isMask)return!0;if(n.data.type!=="displace"&&"alpha"in n.data&&n.data.type!=="light"&&n.data.type!=="fresnel"&&n.data.type!=="texture"&&n.data.type!=="matcap"&&n.data.type!=="rainbow"&&n.data.type!=="outline"&&n.data.type!=="pattern"){let a=n.data.visible?n.data.alpha:0;if(typeof a=="string"&&(a=Math.max(0,Math.min(1,Number(t.getVariable(a)??100)/100))),a===1&&n.data.type==="depth"||n.data.type==="gradient"){for(let s of n.data.colors)if(s[3]<1){a=s[3];break}}else if(a===1&&n.data.type==="noise"){let s=t.color(n.data.colorA).a,o=t.color(n.data.colorB).a,l=t.color(n.data.colorC).a,c=t.color(n.data.colorD).a,u=Math.min(s,Math.min(o,Math.min(l,c)));u<1&&(a=u)}i+=(1-i)*a}}return i<1}var rg=class extends Fr{constructor(){super(void 0),this.flatShading=!1,this.needsJitter=!0,this.shadersPatchedForShapeBlend=!1,this.nodeContextUuid=0,this.fog=!0,this.dithering=!0,this.vertexColors=!0,this.transparent=!0}customProgramCacheKey(){return""}},mht=class extends rg{constructor(e,t,i,r){super(),this.flatShading=e,this.side=t,this.wireframe=i,this.root=r}updateAfterBuild(){let e=this.root;this.lights=e.lights,this.vertexShader=e.vertexShader,this.fragmentShader=e.fragmentShader,Object.assign(this.defines,e.defines),Object.assign(this.uniforms,e.uniforms),this.extensions=e.extensions,this.transparent=e.transparent,this.cacheKey=e.customProgramCacheKey()+"flat"+this.flatShading+this.side}onBeforeCompile(e,t){this.root.onBeforeCompile(e)}get data(){return this.root.data}get category(){return this.root.category}get hasAO(){return this.root.hasAO}getFlavor(e,t,i,r){return this.root.getFlavor(e,t,i,r)}get layers(){return this.root.layers}get fragment(){return this.root.fragment}getLayersOfType(e){return this.root.getLayersOfType(e)}getLayerByUuid(e){return this.root.getLayerByUuid(e)}updateByOp(e,t,i){this.root.updateByOp(e,t,i)}nodeMaterialDispose(){this.root.nodeMaterialDispose()}},l$=class extends rg{constructor(e,t,i=!0){super(),this.data=e,this.allowVariableSaves=i,this.layerIdGen=0,this.flavors=[],this.masks={},this.type="NodeMaterial",this.updaters=[],this.needsJitter=t.shared.needsJitter,qs.startContext(this),this.reset0(e,t),qs.endContext(this)}get nodeMaterial(){return this}getFlavor(e,t,i,r){let n=i?6:(e?3:0)+t;if(n+=(((r==null?void 0:r.resolutionLevel)??0)-(r!=null&&r.useChildrenColors?4:0))*7,n===0)return this;this.flavors===void 0&&(this.flavors=[]),n-=1;let a=this.flavors[n];return a===void 0&&(a=new mht(e,t,i,this),a.needsJitter=this.needsJitter,this.flavors[n]=a,a.flatShading=e,a.side=t,a.updateAfterBuild(),r&&(a.defines.SHAPEBLEND=r.resolutionLevel,a.defines.SHAPEBLEND_C=r.useChildrenColors?1:0)),a}get fragment(){return this.lightLayer.node}get category(){return this.lightLayer.category}get hasAO(){var e;return((e=this.lightLayer.getNode("occlusion"))==null?void 0:e.value)??!1}reset(e,t,i=!1){qs.startContext(this),(this.data!==e||i)&&this.reset0(e,t),qs.endContext(this)}reset0(e,t){this.data=e;let i=e.layers??wo.defaultTwoLayerData("phong").layers;try{this.layers=i.map(r=>yD.create(this.layerIdGen++,r.id,r.data,t.shared))}catch{this.layers=[]}this.layers.reverse(),this.name=e.name??"Untitled Material",this.onUpdate(t.shared),this.transparent=y_(e,t.shared),this.saveVariableLocations(t)}onVariableUpdate(e,t,i){if(e[0]==="alphaOverride")this.transparent=y_(this.data,i.shared),this.lightLayer.setValue("alphaOverride",Math.max(0,Math.min(Number(t)/100,1)));else if(e[0]==="layer"){let r=e[1],n=e[2];if(r&&n){let a=this.layers.find(s=>s.uuid===r);if(a!=null&&a.hasValue(n))if(n==="alpha")this.transparent=y_(this.data,i.shared),a.setValue(n,Math.max(0,Math.min(Number(t)/100,1)));else{let s=a.getValue(n),o=e[3],l=e[4];if(s instanceof wa){let c=s[o],u;typeof c=="number"?u=Number(t):c.isVector2&&(u=c.toArray(),l==="x"?u[0]=Number(t):l==="y"&&(u[1]=Number(t))),o$({[o]:u},i.shared,a);return}(o==="x"||o==="y"||o==="z")&&s.isVector3||(o==="x"||o==="y")&&s.isVector2?s[o]=Number(t):a.setValue(n,t)}}}}saveVariableLocations(e){if(!this.allowVariableSaves)return;let t=this.data.layers.find(i=>i.data.type==="light");t&&e.shared.getVariable(t.data.alphaOverride,["material",this.uuid,"alphaOverride"]),this.data.layers.forEach(i=>{"alpha"in i.data&&typeof i.data.alpha=="string"&&e.shared.getVariable(i.data.alpha,["material",this.uuid,"layer",i.id,"alpha"]),i.data.type==="displace"?i.data.displacementType==="noise"?Oc(["intensity","scale","movement","smoothness","seed","highCut","lowCut"],["offset"],i.data,i.id,e.shared,this.uuid):Oc(["intensity"],[],i.data,i.id,e.shared,this.uuid):i.data.type==="depth"?Oc(["near","far"],["origin","direction"],i.data,i.id,e.shared,this.uuid):i.data.type==="fresnel"?Oc(["bias","scale","intensity","factor"],[],i.data,i.id,e.shared,this.uuid):i.data.type==="rainbow"?Oc(["filmThickness","movement","noiseStrength","noiseScale"],["offset","wavelengths"],i.data,i.id,e.shared,this.uuid):i.data.type==="noise"?Oc(["scale","move","seed","highCut","lowCut","smoothness"],["size","distortion","fA","fB"],i.data,i.id,e.shared,this.uuid):i.data.type==="pattern"?Oc(["blending","size","variation","smoothness","zigzag","rotation"],["offset","frequency","vertical","horizontal"],i.data,i.id,e.shared,this.uuid):i.data.type==="outline"?Oc(["outlineWidth","contourWidth","outlineThreshold","contourThreshold","outlineSmoothing","contourFrequency"],["contourDirection"],i.data,i.id,e.shared,this.uuid):i.data.type==="toon"?Oc(["noiseStrength","noiseScale"],["offset","source"],i.data,i.id,e.shared,this.uuid):i.data.type==="transmission"?Oc(["roughness","thickness","ior"],[],i.data,i.id,e.shared,this.uuid):i.data.type==="texture"||i.data.type==="video"?(Oc([],["size"],i.data,i.id,e.shared,this.uuid),Oc(["rotation"],["repeat","offset"],i.data,i.id,e.shared,this.uuid,["texture"])):i.data.type==="gradient"?Oc(["angle"],["offset","morph"],i.data,i.id,e.shared,this.uuid):i.data.type==="matcap"&&Oc(["rotation"],[],i.data,i.id,e.shared,this.uuid,["texture"])})}getLayersOfType(e){return this.layers.filter(t=>t.type===e)}getLayerByUuid(e){return this.layers.find(t=>t.uuid===e)}onUpdate(e){this.lightLayer=this.layers.find(t=>t instanceof Cf),this.lightLayer===void 0&&(this.lightLayer=new Cf(0,"",{...ss.defaultData("light","phong"),visible:!1},new s$,{},e)),this.dispose();for(let t of this.flavors)t&&t.dispose();this.applyTextureMaps(),this.applyMasks(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),this.build(),this.nodeContextUuid=0}applyTextureMaps(){let e=this.layers.find(n=>n instanceof Cf);if(!e)return;let t=e.data,i=t.bumpMap,r=t.roughnessMap;e.node.bumpMap=void 0,e.node.roughnessMap=void 0;for(let n=0;n<this.layers.length;++n){let a=this.layers[n];a instanceof ja&&a.color instanceof a$&&(a.uuid===i&&(e.node.bumpMap=a.color),a.uuid===r&&(e.node.roughnessMap=a.color))}}updateByOp(e,t,i){if(qs.startContext(this),t!==void 0?this.data=t:t=this.data,this.transparent=y_(t,i.shared),e.path[0]==="layers"){let r=i.shared,n=e.path[1];if(n===void 0)i.scene.markNeedsUpdateRendererDirty(),this.reset0(t,i);else{e.type===0&&e.props.occlusion!==void 0&&i.scene.markNeedsUpdateRendererDirty();let a=this.layers.find(s=>s.uuid===n);if(a){let s=t.layers.data(n),o;e.type===0&&("alpha"in e.props||"alphaOverride"in e.props)&&("alpha"in e.props?o={...e.props,alpha:ob(e.props.alpha,r,["material",this.uuid,"layer",n,"alpha"])}:o={...e.props,alphaOverride:ob(e.props.alphaOverride,r,["material",this.uuid,"alphaOverride"])}),a.updateByOp({...e,...o?{props:o}:{},path:e.path.slice(2)},s,i)&&this.reset0(t,i)}}}else this.reset0(t,i);qs.endContext(this)}applyMasks(){for(let e=0;e<this.layers.length;++e){let t=this.layers[e];t instanceof ja?t.color.mask=void 0:t instanceof Cf&&(t.node.mask=void 0)}for(let e=0;e<this.layers.length;++e){let t=this.layers[e];if(t instanceof ja&&t.isMask.value&&t.data.visible&&e>0){let i=e-1,r=this.layers[i];r instanceof Cf?r.node.mask=new Lc(t.color,t.alpha,Lc.MUL):r instanceof ja&&(r.isMask.value||(r.color.mask=new Lc(t.color,t.alpha,Lc.MUL)))}}}blendColors(){let e=this.layers.findIndex(i=>i instanceof ja),t=this.layers.findIndex(i=>i instanceof Cf);if(e!==-1&&e<t){let i=this.layers[e].color;for(let r=e+1;r<t;++r){let n=this.layers[r];if(n instanceof ja){if(n.isMask.value)continue;i=new uue(i,n.color,n.alpha,n.mode)}}this.fragment.color=i}else this.fragment.color=void 0}blendAfterColors(){let e=new Kn("outgoingLight","f"),t=this.layers.findIndex(i=>i instanceof Cf);if(this.layers.length>t+1){for(let i=t+1;i<this.layers.length;++i){let r=this.layers[i];if(r instanceof ja){if(r.isMask.value)continue;e=new uue(e,r.color,r.alpha,r.mode)}}this.fragment.afterColor=e}else this.fragment.afterColor=void 0}blendPositions(){let e=this.layers.filter(t=>t instanceof Twe);if(e.length>0){let t=e[0].position;for(let i=1;i<e.length;++i)e[i]&&(t=new Lc(t,e[i].position,Lc.ADD),t=new Lc(t,new Zt(.5).setReadonly(!0),Lc.MUL));this.fragment.position=t}else this.fragment.position=void 0}getDefines(){return this.defines}getUniforms(){return this.uniforms}getVertexShader(){return this.vertexShader}getFragmentShader(){return this.fragmentShader}onBeforeCompile(e){this.shapeBlendhack&&this.shapeBlendhack(this),e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.extensionDerivatives=this.extensions.derivatives===!0,e.extensionFragDepth=this.extensions.fragDepth===!0,e.extensionDrawBuffers=this.extensions.drawBuffers===!0,e.extensionShaderTextureLOD=this.extensions.shaderTextureLOD===!0}clampUniformsForPreview(e,t){let i=(r,n,a)=>Math.min(Math.max(r,n),a);for(let r of this.layers)if(r.type==="displace"){let n=i(r.uniforms[`f${r.id}_intensity`].value,e,t);r.uniforms[`f${r.id}_intensity`].value=n}}updateFrame(e){for(let t=0;t<this.updaters.length;++t)e.updateNode(this.updaters[t])}build(){let e=new ewe;e.needsJitter=this.needsJitter,this.lights=this.lightLayer.data.visible,e.build(this.fragment,this.fragment),this.vertexShader=e.getCode("vertex"),this.fragmentShader=e.getCode("fragment"),this.defines=e.defines,this.uniforms=e.uniforms,this.extensions=e.extensions,this.updaters=e.updaters;for(let t of this.flavors)t&&t.updateAfterBuild();return this.shadersPatchedForShapeBlend=!1,this}nodeMaterialDispose(){this.layers.forEach(e=>e.dispose()),super.dispose();for(let e of this.flavors)e&&e.dispose()}assetsLoaded(){for(let e of this.layers)if(e instanceof ja){let t=e.params.texture;if(t instanceof j9&&!t.image.loaded)return!1}return!0}};Object.defineProperties(rg.prototype,{properties:{get:function(){return this.fragment.properties}}});var G9=class extends l${constructor(e,t,i){super(e,t,!1),this.uuid=i,this.allowVariableSaves=!0,this.saveVariableLocations(t)}},bue=new Map;function ght(e){if(typeof e=="string")return e;let t=bue.get(e);return t||(t={url:URL.createObjectURL(new Blob([e]))},bue.set(e,t)),t.url}var Pwe,vht=new Promise(e=>{Pwe=e}),wue=!1,HO;function yht(){if(wue)return;if(HO)return HO;async function e(){await I0(()=>import("./howler-CzrxH3Wg.js").then(t=>t.h),[]),Pwe(window!==void 0?window:global),wue=!0}return HO=e(),HO}var Dwe;vht.then(e=>Dwe=e);function _ue(e,t){e.forEach(i=>{"dragDropActions"in i.data?(t.push(...i.data.dragDropActions.drag),t.push(...i.data.dragDropActions.drop)):"inActions"in i.data?(t.push(...i.data.inActions),t.push(...i.data.outActions)):"gameActions"in i.data?(t.push(...i.data.gameActions.idle),t.push(...i.data.gameActions.move),t.push(...i.data.gameActions.jump),t.push(...i.data.gameActions.run)):"breakpoints"in i.data?i.data.breakpoints.forEach(r=>{t.push(...r.data.actions)}):"actions"in i.data&&(t.push(...i.data.actions),i.data.actions.forEach(r=>{r.data.type==="Conditional"&&r.data.ifActions&&(t.push(...r.data.ifActions),t.push(...r.data.elseActions))}))})}function xht(e){let t=!1,i=[];return e.scene.objects.traverse((r,n)=>{if(n.type==="Page"&&n.uiScene!==void 0&&n.uiScene.objects.traverse((a,s)=>{if(s.events===void 0||Array.isArray(s.events)===!1)return!0;_ue(s.events,i),t=t||i.some(o=>o.data.type==="Audio")}),n.events===void 0||Array.isArray(n.events)===!1)return!0;_ue(n.events,i),t=t||i.some(a=>a.data.type==="Audio")}),t}var AT=class{constructor({src:e,volume:t,delay:i,loop:r}){this._volume=1,this.delay=0,this._loop=1,this.loopsRemaining=0,this._status="stopped",this.onEnd=()=>{this.loopsRemaining===1/0?this.replay():this.loopsRemaining>1?(this.replay(),this.loopsRemaining--):(this._status="stopped",this.loopsRemaining=this._loop)};let n;typeof e=="string"?n={src:e}:n={src:ght(e),format:"wav"},this.sound=new Dwe.Howl(n),this.sound.on("end",this.onEnd),this.src=e,t!==void 0&&(this.volume=t),i!==void 0&&(this.delay=i),r!==void 0&&(this.loop=r)}get status(){return this._status}get volume(){return this._volume}set volume(e){this._volume=e,this.sound.volume(e)}get loop(){return this._loop}set loop(e){this._loop=e,this.loopsRemaining=e}replay(){this.clearDelay(),this.delayTimerId=window.setTimeout(()=>{this.sound.play(),this.clearDelay()},this.delay)}fade(e,t=1e3){e?(this.sound.volume(this._volume),this.clearFade(),this.fadeTimerId=window.setTimeout(()=>{this.sound.fade(this._volume,0,t),this.clearFade()},e)):this.sound.fade(this._volume,0,t)}on(e,t,i){this.sound.on(e,t,i)}off(e,t,i){this.sound.off(e,t,i)}play(){this._status==="playing"||this.sound.playing()||(this._status==="paused"?(this.sound.seek()===0?this.replay():this.sound.play(),this._status="playing"):this._status==="stopped"&&(this.replay(),this._status="playing"))}pause(){this._status==="playing"&&(this.sound.pause(),this.clearFade(),this.clearDelay(),this._status="paused")}stop(){this.sound.stop(),this.loopsRemaining=this._loop,this.clearFade(),this.clearDelay(),this._status="stopped"}clearFade(){this.fadeTimerId&&(clearTimeout(this.fadeTimerId),delete this.fadeTimerId)}clearDelay(){this.delayTimerId&&(clearTimeout(this.delayTimerId),delete this.delayTimerId)}dispose(e=!1){this.off(),this.stop(),this.clearFade(),this.clearDelay()}},bht=class{constructor(){this.type="ShapePath",this.color=new _i,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new eL,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){var i;return(i=this.currentPath)==null||i.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){var n;return(n=this.currentPath)==null||n.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,n,a){var s;return(s=this.currentPath)==null||s.bezierCurveTo(e,t,i,r,n,a),this}splineThru(e){var t;return(t=this.currentPath)==null||t.splineThru(e),this}toShapes(){let e={ORIGIN:0,DESTINATION:1,BETWEEN:2,LEFT:3,RIGHT:4,BEHIND:5,BEYOND:6},t={loc:e.ORIGIN,t:0};function i(f,m,y,g){let x=f.x,w=m.x,S=y.x,M=g.x,E=f.y,T=m.y,R=y.y,P=g.y,I=(M-S)*(E-R)-(P-R)*(x-S),L=(w-x)*(E-R)-(T-E)*(x-S),z=(P-R)*(w-x)-(M-S)*(T-E),U=I/z,j=L/z;if(z===0&&I!==0||U<=0||U>=1||j<0||j>1)return null;if(I===0&&z===0){for(let F=0;F<2;F++)if(r(F===0?y:g,f,m),t.loc===e.ORIGIN){let G=F===0?y:g;return{x:G.x,y:G.y,t:t.t}}else if(t.loc===e.BETWEEN){let G=+(x+t.t*(w-x)).toPrecision(10),H=+(E+t.t*(T-E)).toPrecision(10);return{x:G,y:H,t:t.t}}return null}else{for(let H=0;H<2;H++)if(r(H===0?y:g,f,m),t.loc===e.ORIGIN){let W=H===0?y:g;return{x:W.x,y:W.y,t:t.t}}let F=+(x+U*(w-x)).toPrecision(10),G=+(E+U*(T-E)).toPrecision(10);return{x:F,y:G,t:U}}}function r(f,m,y){let g=y.x-m.x,x=y.y-m.y,w=f.x-m.x,S=f.y-m.y,M=g*S-w*x;if(f.x===m.x&&f.y===m.y){t.loc=e.ORIGIN,t.t=0;return}if(f.x===y.x&&f.y===y.y){t.loc=e.DESTINATION,t.t=1;return}if(M<-Number.EPSILON){t.loc=e.LEFT;return}if(M>Number.EPSILON){t.loc=e.RIGHT;return}if(g*w<0||x*S<0){t.loc=e.BEHIND;return}if(Math.sqrt(g*g+x*x)<Math.sqrt(w*w+S*S)){t.loc=e.BEYOND;return}let E;g!==0?E=w/g:E=S/x,t.loc=e.BETWEEN,t.t=E}function n(f,m){let y=[],g=[];for(let x=1;x<f.length;x++){let w=f[x-1],S=f[x];for(let M=1;M<m.length;M++){let E=m[M-1],T=m[M],R=i(w,S,E,T);R!==null&&y.find(P=>P.t<=R.t+Number.EPSILON&&P.t>=R.t-Number.EPSILON)===void 0&&(y.push(R),g.push(new Ce(R.x,R.y)))}}return g}function a(f,m,y){let g=new Ce;m.getCenter(g);let x=[];return y.forEach(w=>{w.boundingBox.containsPoint(g)&&n(f,w.points).forEach(S=>{x.push({identifier:w.identifier,isCW:w.isCW,point:S})})}),x.sort((w,S)=>w.point.x-S.point.x),x}function s(f,m,y,g,x){(x==null||x==="")&&(x="nonzero");let w=new Ce;f.boundingBox.getCenter(w);let S=[new Ce(y,w.y),new Ce(g,w.y)],M=a(S,f.boundingBox,m);M.sort((L,z)=>L.point.x-z.point.x);let E=[],T=[];M.forEach(L=>{L.identifier===f.identifier?E.push(L):T.push(L)});let R=E[0].point.x,P=[],I=0;for(;I<T.length&&T[I].point.x<R;)P.length>0&&P[P.length-1]===T[I].identifier?P.pop():P.push(T[I].identifier),I++;if(P.push(f.identifier),x==="evenodd"){let L=P.length%2===0,z=P[P.length-2];return{identifier:f.identifier,isHole:L,for:z}}else if(x==="nonzero"){let L=!0,z=null,U=null;for(let j=0;j<P.length;j++){let F=P[j];m[F]&&(L?(U=m[F].isCW,L=!1,z=F):U!==m[F].isCW&&(U=m[F].isCW,L=!0))}return{identifier:f.identifier,isHole:L,for:z}}else console.warn('fill-rule: "'+x+'" is currently not implemented.')}let o=0,l=999999999,c=-999999999,u=[];this.subPaths.forEach(f=>{let m=f.getPoints(),y=-999999999,g=999999999,x=-999999999,w=999999999;for(let S=0;S<m.length;S++){let M=m[S];M.y>y&&(y=M.y),M.y<g&&(g=M.y),M.x>x&&(x=M.x),M.x<w&&(w=M.x)}c<=x&&(c=x+1),l>=w&&(l=w-1),m.length&&u.push({curves:f.curves,points:m,isCW:fxe.isClockWise(m),identifier:o++,boundingBox:new tY(new Ce(w,g),new Ce(x,y))})});let h=u.map(f=>{var m;return s(f,u,l,c,(m=this.userData)==null?void 0:m.style.fillRule)}),d=[];return u.forEach(f=>{let m=h[f.identifier];if(m&&!m.isHole){let y=new tL;y.curves=f.curves,h.filter(g=>(g==null?void 0:g.isHole)&&g.for===f.identifier).forEach(g=>{if(g){let x=u[g.identifier],w=new eL;w.curves=x.curves,y.holes.push(w)}}),d.push(y)}}),d}},Owe=!1,Rwe,Sue=new Promise(e=>{Rwe=e}),Aue=!1,GO;function wht(){if(Owe=!0,Aue)return;if(GO)return GO;async function e(){let t=await I0(()=>import("./opentype-U-0Y99ve.js"),[]);Rwe(t),Aue=!0}return GO=e(),GO}var _ht=class{async load(e,t,i=()=>{}){let{load:r}=await Sue;r(e,(n,a)=>{n||!a?i(n??"Something went wrong"):t(a)})}async parse(e){let{parse:t,Bidi:i}=await Sue;try{let r=t(e),n=new i,a=s=>r.charToGlyphIndex(s.char);return n.registerModifier("glyphIndex",null,a),n.applyFeatures(r,r.defaultRenderOptions.features),{font:r,bidi:n}}catch(r){console.error(r)}}};async function Sht(e){return await(await fetch(e)).arrayBuffer()}var Aht=new _ht;async function Mue(e){let t,i,r=!1;if(e.url?(t=await Sht(e.url),i=e.url,r=e.url.startsWith("/")):e.data&&(t=e.data.buffer.slice(e.data.byteOffset,e.data.byteOffset+e.data.byteLength)),t)if(Owe){let n=await Aht.parse(t);if(n)return{font:n.font,url:i,intercepted:r,arr:t,bidi:n.bidi}}else return{font:void 0,url:i,intercepted:r,arr:t,bidi:null}}function Mht(e,t){return t.state.glyphIndex===e||t.state.fina===e||t.state.medi===e||t.state.init===e}var Eht=class{constructor(e){this._arrayBuffer=new ArrayBuffer(1),this._isLoaded=!1,this._intercepted=!1,this._isUserFont=e.isUserFont??!1,this._loadingPromise=Mue(e).then(t=>{t&&(this._arrayBuffer=t.arr,this._url=t.url,this.font=t.font,this._intercepted=t.intercepted,this._isLoaded=!0,this._bidi=t.bidi)})}update(e){this._isLoaded=!1,this._isUserFont=e.isUserFont??!1,this._loadingPromise=Mue(e).then(t=>{t&&(this._arrayBuffer=t.arr,this._url=t.url,this.font=t.font,this._intercepted=t.intercepted,this._isLoaded=!0,this._bidi=t.bidi)})}get url(){return this._url}get intercepted(){return this._intercepted}get isLoaded(){return this._isLoaded}get loadingPromise(){return this._loadingPromise}reverseLigaturesTable(e,t,i){if(!this._bidi)return[];let r=this._bidi;r.getTextGlyphs(t);let n=r.tokenizer.tokens,a=[],s=0,o=i.length===n.length;for(let l=0;l<i.length;l++){let c=i[l].index,u=String.fromCharCode(i[l].unicode),h=n[s];if(Mht(c,h)||o)a.push({char:u,index:c,replacements:[h.state.glyphIndex],replacementChars:[h.char]}),s++;else{let d=h.char,f="",m=[h.state.glyphIndex],y=[],g=!1;for(;!g;)s++,f=t.charAt(s),d+=f,m.push(e.charToGlyphIndex(f)),y=e.stringToGlyphs(d),y.length===1&&y[0].index===c&&(g=!0),s>t.length&&(g=!0);a.push({char:u,index:c,replacements:m,replacementChars:Array.from(d)}),s++}}return a}generateShapes(e,t,i){var x;if(!this._isLoaded)return;let r=this.font,n=t.fontSize/this.unitsPerEm,a=t.fontSize*t.lineHeight,s=e.map(w=>this.getTextWidth(w,t)),o=typeof t.width=="string"?Number(i.getVariable(t.width)):t.width,l=typeof t.height=="string"?Number(i.getVariable(t.height)):t.height,c=this.getCharWidth(`
|
|
5554
|
+
`)}return t}},wut=class{constructor(e=1e3*10){this.timeout=e,this.cache=new Map,this.head={data:null,time:0,src:null,next:null,prev:null},this.tail={data:null,time:1/0,src:null,next:null,prev:null},this.hasClean=!1,this.cleanupTimer=null,this.head.next=this.tail,this.tail.prev=this.head}log(...e){}remove(e){let t=this.cache.get(e);t&&(this.dispose(e,t.data),this.cache.delete(e),t.prev.next=t.next,t.next.prev=t.prev,t.next=null,t.prev=null,t.data=null)}scheduleCleanup(){this.hasClean||(this.log("scheduled cleanup"),this.hasClean=!0,this.cleanupTimer=setTimeout(()=>{this.hasClean=!1,this.cleanupTimer=null,this.log("cleaning");let e=Date.now(),t=this.head.next;for(;t.time<e-this.timeout;){this.dispose(t.src,t.data),this.cache.delete(t.src);let i=t;t=t.next,t.prev=this.head,this.head.next=t,i.next=null,i.prev=null,i.data=null}this.head.next!==this.tail?this.scheduleCleanup():this.log("no more cleanup")},this.timeout+1e3))}has(e){var t;return(t=this.cache.get(e))==null?void 0:t.data}load(e){let t=Date.now(),i=this.cache.get(e);return i===void 0?(i={data:this.create(e),src:e,time:t,next:null,prev:null},this.cache.set(e,i)):(i.time=t,i.prev.next=i.next,i.next.prev=i.prev),i.prev=this.tail.prev,i.next=this.tail,this.tail.prev.next=i,this.tail.prev=i,this.scheduleCleanup(),i.data}disposeAll(){this.cleanupTimer!==null&&(clearTimeout(this.cleanupTimer),this.cleanupTimer=null),this.hasClean=!1,this.cache.forEach((e,t)=>{this.dispose(t,e.data),e.next=null,e.prev=null,e.data=null}),this.cache.clear(),this.head.next=this.tail,this.tail.prev=this.head}destroy(){this.disposeAll(),this.head=null,this.tail=null}},_ut=class extends wut{create(e){return URL.createObjectURL(new Blob([e]))}dispose(e,t){URL.revokeObjectURL(t)}},$T;function Sut(e){return typeof e=="string"?e:($T||($T=new _ut),$T.load(e))}function Aut(){$T&&$T.disposeAll()}var Mut=class{constructor(e,t){this.data=e,this.cache=t,this.refCount=0}deref(){this.refCount,this.refCount-=1,this.refCount===0&&(this.cache.remove(this),this.dispose())}dispose(){this.refCount}},Eut=class{constructor(){this.cache=new Map}remove(e){this.cache.delete(e.data)}load(e){let t=this.cache.get(e);return t===void 0&&(t=this.create(e),this.cache.set(e,t)),t.refCount+=1,t}},Swe=class extends Mut{constructor(e,t){super(e,t.imageHolderCache),this.data=e,this.shared=t,this.loaded=!1,this.isVideo=!1,this.isBuffer=!1,this._cache={1e3:{},1001:{},1002:{}},this.isVideo=e.type==="video",this.isBuffer=e.isWebGLRenderTarget===!0,this.loadPromise=this.updateSrc(this.isBuffer?e:e.data)}async updateSrc(e){if(typeof document>"u")return;this.disposeTextures(),this.loaded=!1;let t=()=>{this.loaded=!0;for(let r of Object.values(this._cache))for(let n of Object.values(r))for(let a of Object.values(n))a&&(a.image=this.img,a.needsUpdate=!0);this.shared.requestRender()};if(this.isBuffer)this.img=e,this.loaded=!0;else if(this.isVideo){if(this.img=document.createElement("video"),this.img.preload="auto",this.img.playsInline=!0,this.img.currentTime=.01,typeof e!="string"){var i=new FileReader;i.readAsDataURL(new Blob([e],{type:"video/mp4"}));let r;await new Promise(n=>{i.onloadend=a=>{var s;r=(s=a.target)==null?void 0:s.result,n(null)}}),this.img.src=r}else this.img.src=e;this.img.onloadeddata=()=>{t()}}else this.img=new Image,this.img.src=Sut(e),this.img.onload=t,await new Promise(r=>{this.img.onload=()=>{t(),r(null)}})}getTexture(e,t=1008,i=1006){var n,a;let r=(a=(n=this._cache[e])==null?void 0:n[t])==null?void 0:a[i];if(r)return r;{let s;return this.isBuffer?s=this.img.texture:this.isVideo?s=new ZXe(this.img,void 0,e,e):s=new wa(this.img,void 0,e,e,i,t),this.loaded&&(s.needsUpdate=!0),this._cache[e]===void 0&&(this._cache[e]={}),this._cache[e][t]===void 0&&(this._cache[e][t]={}),this._cache[e][t][i]=s,s}}setNeedsUpdate(e){for(let t of Object.values(this._cache))for(let i of Object.values(t))for(let r of Object.values(i))r&&(r.needsUpdate=e)}disposeTextures(){for(let[e,t]of Object.entries(this._cache))for(let[i,r]of Object.entries(t))for(let[n,a]of Object.entries(r))a==null||a.dispose(),this._cache[e]!==void 0&&this._cache[e][i]!==void 0&&(this._cache[e][i][n]=void 0)}dispose(){super.dispose(),this.disposeTextures()}},zv=class extends Swe{};function Tut(e,t){var i=Out(t);return i.formatToParts?Put(i,e):Dut(i,e)}var Cut={year:0,month:1,day:2,hour:3,minute:4,second:5};function Put(e,t){try{for(var i=e.formatToParts(t),r=[],n=0;n<i.length;n++){var a=Cut[i[n].type];a>=0&&(r[a]=parseInt(i[n].value,10))}return r}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function Dut(e,t){var i=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(i);return[r[3],r[1],r[2],r[4],r[5],r[6]]}var w6={};function Out(e){if(!w6[e]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),i=t==="06/25/2014, 00:00:00"||t==="06/25/2014 00:00:00";w6[e]=i?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return w6[e]}function Awe(e,t,i,r,n,a,s){var o=new Date(0);return o.setUTCFullYear(e,t,i),o.setUTCHours(r,n,a,s),o}var hue=36e5,Rut=6e4,_6={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function Mwe(e,t,i){var r,n;if(!e||(r=_6.timezoneZ.exec(e),r))return 0;var a;if(r=_6.timezoneHH.exec(e),r)return a=parseInt(r[1],10),due(a)?-(a*hue):NaN;if(r=_6.timezoneHHMM.exec(e),r){a=parseInt(r[1],10);var s=parseInt(r[2],10);return due(a,s)?(n=Math.abs(a)*hue+s*Rut,a>0?-n:n):NaN}if(Lut(e)){t=new Date(t||Date.now());var o=i?t:Iut(t),l=H9(o,e),c=i?l:Nut(t,l,e);return-c}return NaN}function Iut(e){return Awe(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function H9(e,t){var i=Tut(e,t),r=Awe(i[0],i[1]-1,i[2],i[3]%24,i[4],i[5],0).getTime(),n=e.getTime(),a=n%1e3;return n-=a>=0?a:1e3+a,r-n}function Nut(e,t,i){var r=e.getTime(),n=r-t,a=H9(new Date(n),i);if(t===a)return t;n-=a-t;var s=H9(new Date(n),i);return a===s?a:Math.max(a,s)}function due(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}var fue={};function Lut(e){if(fue[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),fue[e]=!0,!0}catch{return!1}}var kut=N0(jGe(),1),pue=N0(FGe(),1),zut=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,But=zut,S6=36e5,mue=6e4,Uut=2,Kl={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:But};function jut(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);var i={},r=i.additionalDigits==null?Uut:(0,kut.default)(i.additionalDigits);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var n=Fut(e),a=Vut(n.date,r),s=a.year,o=a.restDateString,l=Hut(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,h;if(n.time&&(u=Gut(n.time),isNaN(u)))return new Date(NaN);if(n.timeZone||i.timeZone){if(h=Mwe(n.timeZone||i.timeZone,new Date(c+u)),isNaN(h))return new Date(NaN)}else h=(0,pue.default)(new Date(c+u)),h=(0,pue.default)(new Date(c+u+h));return new Date(c+u+h)}else return new Date(NaN)}function Fut(e){var t={},i=Kl.dateTimePattern.exec(e),r;if(i?(t.date=i[1],r=i[3]):(i=Kl.datePattern.exec(e),i?(t.date=i[1],r=i[2]):(t.date=null,r=e)),r){var n=Kl.timeZone.exec(r);n?(t.time=r.replace(n[1],""),t.timeZone=n[1].trim()):t.time=r}return t}function Vut(e,t){var i=Kl.YYY[t],r=Kl.YYYYY[t],n;if(n=Kl.YYYY.exec(e)||r.exec(e),n){var a=n[1];return{year:parseInt(a,10),restDateString:e.slice(a.length)}}if(n=Kl.YY.exec(e)||i.exec(e),n){var s=n[1];return{year:parseInt(s,10)*100,restDateString:e.slice(s.length)}}return{year:null}}function Hut(e,t){if(t===null)return null;var i,r,n,a;if(e.length===0)return r=new Date(0),r.setUTCFullYear(t),r;if(i=Kl.MM.exec(e),i)return r=new Date(0),n=parseInt(i[1],10)-1,vue(t,n)?(r.setUTCFullYear(t,n),r):new Date(NaN);if(i=Kl.DDD.exec(e),i){r=new Date(0);var s=parseInt(i[1],10);return Xut(t,s)?(r.setUTCFullYear(t,0,s),r):new Date(NaN)}if(i=Kl.MMDD.exec(e),i){r=new Date(0),n=parseInt(i[1],10)-1;var o=parseInt(i[2],10);return vue(t,n,o)?(r.setUTCFullYear(t,n,o),r):new Date(NaN)}if(i=Kl.Www.exec(e),i)return a=parseInt(i[1],10)-1,yue(t,a)?gue(t,a):new Date(NaN);if(i=Kl.WwwD.exec(e),i){a=parseInt(i[1],10)-1;var l=parseInt(i[2],10)-1;return yue(t,a,l)?gue(t,a,l):new Date(NaN)}return null}function Gut(e){var t,i,r;if(t=Kl.HH.exec(e),t)return i=parseFloat(t[1].replace(",",".")),A6(i)?i%24*S6:NaN;if(t=Kl.HHMM.exec(e),t)return i=parseInt(t[1],10),r=parseFloat(t[2].replace(",",".")),A6(i,r)?i%24*S6+r*mue:NaN;if(t=Kl.HHMMSS.exec(e),t){i=parseInt(t[1],10),r=parseInt(t[2],10);var n=parseFloat(t[3].replace(",","."));return A6(i,r,n)?i%24*S6+r*mue+n*1e3:NaN}return null}function gue(e,t,i){t=t||0,i=i||0;var r=new Date(0);r.setUTCFullYear(e,0,4);var n=r.getUTCDay()||7,a=t*7+i+1-n;return r.setUTCDate(r.getUTCDate()+a),r}var Wut=[31,28,31,30,31,30,31,31,30,31,30,31],qut=[31,29,31,30,31,30,31,31,30,31,30,31];function Ewe(e){return e%400===0||e%4===0&&e%100!==0}function vue(e,t,i){if(t<0||t>11)return!1;if(i!=null){if(i<1)return!1;var r=Ewe(e);if(r&&i>qut[t]||!r&&i>Wut[t])return!1}return!0}function Xut(e,t){if(t<1)return!1;var i=Ewe(e);return!(i&&t>366||!i&&t>365)}function yue(e,t,i){return!(t<0||t>52||i!=null&&(i<0||i>6))}function A6(e,t,i){return!(e!=null&&(e<0||e>=25)||t!=null&&(t<0||t>=60)||i!=null&&(i<0||i>=60))}function Yut(e,t,i){var r=jut(e,i),n=Mwe(t,r,!0),a=new Date(r.getTime()-n),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}function tc(e,t){return t.color(e)}function xue(e=new Date,t){let i=t.format,r=e.getSeconds(),n=e;t&&t.timeZone!==null&&(n=Yut(new Date,t.timeZone));let a=n.getHours(),s=n.getMinutes(),o;t.format12h24h==="12ampm"&&(o=a>=12?"PM":"AM");let l=a;t.format12h24h!=="24"&&(l=a%12,l===0&&(l=12));let c,u;switch(i){case"HH:mm:ss":c=[l,s,r];break;case"HH:mm":c=[l,s];break;case"HH":c=[l],o=void 0;break;case"mm":c=[s],o=void 0;break;case"ss":c=[r],o=void 0;break;case"year":u=n.getFullYear();break;case"month":u=n.getMonth()+1;break;case"dayOfYear":u=Math.floor((n.getTime()-new Date(n.getFullYear(),0,0).getTime())/864e5);break;case"dayOfMonth":u=n.getDate();break;case"secondOfDay":u=a*60*60+s*60+r;break;default:console.error("Unknown time format",i),u=0;break}return c!==void 0?{textValue:c,suffix:o}:u}function $ut(e,t){switch(e.type){case"fresnel":return Zut(e,t);case"gradient":return Jut(e,t);case"depth":return eht(e,t);case"normal":return tht(e,t);case"noise":return iht(e,t);case"rainbow":return rht(e,t);case"toon":return nht(e,t);case"outline":return aht(e,t);case"transmission":return sht(e,t);case"pattern":return oht(e,t);case"color":default:return Qut(e,t)}}function Kut(e){return{type:e.type}}function Rd(e,t){let{alpha:i,mode:r,isMask:n}=e,a=typeof i=="string"?(Number(t.getVariable(i))??100)/100:i;return{...Kut(e),alpha:a,mode:r,isMask:n}}function Qut(e,t){return{...Rd(e,t),color:tc(e.color,t)}}function Zut(e,t){let{bias:i,scale:r,intensity:n,factor:a,color:s}=e;return{...Rd(e,t),color:tc(s,t),bias:i,scale:r,intensity:n,factor:a}}function Jut(e,t){let{gradientType:i,smooth:r,colors:n,steps:a,angle:s,offset:o,morph:l}=e;return{...Rd(e,t),gradientType:i,smooth:r,colors:n.map(c=>new Ii(c[0],c[1],c[2],c[3])),num:n.length,steps:a,offset:new Ce(...o.map(c=>typeof c=="number"?c:0)),morph:new Ce(...l.map(c=>typeof c=="number"?c:0)),angle:s}}function eht(e,t){let{gradientType:i,near:r,far:n,isVector:a,isWorldSpace:s,origin:o,direction:l,colors:c,steps:u,smooth:h}=e;return{...Rd(e,t),gradientType:i,near:r,far:n,isVector:a,isWorldSpace:s,origin:new Y(...o),direction:l?new Y(...l):new Y(1,0,0),colors:c.map(d=>d!==void 0?new Ii(d[0],d[1],d[2],d[3]):new Ii(0,0,0,0)),steps:u.slice(0,c.length),smooth:h}}function tht(e,t){let{cnormal:i}=e;return{...Rd(e,t),cnormal:new Y(i[0],i[1],i[2])}}function iht(e,t){return{...Rd(e,t),scale:e.scale,move:e.move,fA:new Ce(...e.fA.map(i=>typeof i=="number"?i:0)),fB:new Ce(...e.fB.map(i=>typeof i=="number"?i:0)),size:new Y(...e.size),distortion:new Ce(...e.distortion.map(i=>typeof i=="number"?i:0)),colorA:tc(e.colorA,t),colorB:tc(e.colorB,t),colorC:tc(e.colorC,t),colorD:tc(e.colorD,t),noiseType:e.noiseType,voronoiStyle:e.voronoiStyle,highCut:e.highCut,lowCut:e.lowCut,smoothness:e.smoothness,seed:e.seed,quality:e.quality}}function rht(e,t){return{...Rd(e,t),filmThickness:e.filmThickness,movement:e.movement,wavelengths:new Y(...e.wavelengths),noiseStrength:e.noiseStrength,noiseScale:e.noiseScale,offset:new Y(...e.offset)}}function nht(e,t){return{...Rd(e,t),positioning:e.positioning,colors:e.colors.map(i=>new Ii(i[0],i[1],i[2],i[3])),num:e.colors.length,steps:e.steps,source:new Y(...e.source),isWorldSpace:e.isWorldSpace,noiseStrength:e.noiseStrength,noiseScale:e.noiseScale,shadowColor:tc(e.shadowColor,t),offset:new Y(...e.offset)}}function aht(e,t){return{...Rd(e,t),outlineColor:tc(e.outlineColor,t),contourColor:tc(e.contourColor,t),outlineWidth:e.outlineWidth,contourWidth:e.contourWidth,outlineThreshold:e.outlineThreshold,contourThreshold:e.contourThreshold,outlineSmoothing:e.outlineSmoothing,contourFrequency:e.contourFrequency,contourDirection:new Y(...e.contourDirection),positionalLines:e.positionalLines,compensation:e.compensation}}function sht(e,t){return{...Rd(e,t),thickness:e.thickness,ior:e.ior,roughness:e.roughness}}function oht(e,t){return{...Rd(e,t),style:e.style,projection:e.projection,axis:e.axis,blending:e.blending,offset:new Ce(...e.offset.map(i=>typeof i=="number"?i:0)),colorA:tc(e.colorA,t),colorB:tc(e.colorB,t),frequency:new Ce(...e.frequency.map(i=>typeof i=="number"?i:0)),size:e.size,variation:e.variation,smoothness:e.smoothness,zigzag:e.zigzag,rotation:e.rotation,vertical:new Ce(...e.vertical.map(i=>typeof i=="number"?i:0)),horizontal:new Ce(...e.horizontal.map(i=>typeof i=="number"?i:0)),sides:e.sides}}var HL=class extends Ks{},lht={noise:["noiseType"],texture:["projection","axis","side"],video:["projection","axis","side"],displace:["noiseType"],light:["roughnessMap","bumpMap"],depth:["smooth","isWorldSpace","gradientType","isVector"],pattern:["style","projection","axis"]},cht={depth:["colors"]};function uht(e,t,i){var a,s;if(t==="isMask")return!0;let r=lht[e.type],n=cht[e.type];if(n!==void 0){let o=e.color;if(n.includes(t)){let l=(s=(a=o[t])==null?void 0:a.value)==null?void 0:s.length;if(l!==void 0&&l!==i.length)return!0}}return r!==void 0?r.includes(t):!1}function M6(e,t){if(Array.isArray(t)){if(!Array.isArray(e)||e.length!==t.length)return!1;for(let[n,a]of t.entries()){let s=e[n];if(typeof a=="string"||typeof a=="number"&&typeof s=="string")return!0}return!1}let i=typeof e=="string",r=typeof t=="string";return i!==r||i&&r}function o$(e,t,i){let r=i.uniforms[`f${i.id}_texture`];if(!r)return!1;let n=!1,a=e;if("image"in a){let s=a.image,o=t.image(s),l=r;l.image instanceof zv||l.image.deref(),l.image=o}if("video"in a){let s=a.video,o=t.video(s),l=r;l.image instanceof zv||l.image.deref(),l.image=o}if("wrapping"in a){let s=r;s.wrap=a.wrapping}if("minFilter"in a){let s=r;s.minFilter=a.minFilter}if("magFilter"in a){let s=r;s.magFilter=a.magFilter}if("rotation"in a&&i.uniforms[`f${i.id}_rotation`])return i.uniforms[`f${i.id}_rotation`].value=(Pi(a.rotation??0,t)??0)*Wt.DEG2RAD,n;if("repeat"in a||"offset"in a||"rotation"in a){let s="mat",o=i.uniforms[`f${i.id}_${s}`];if(!o)return n;if("repeat"in a){let l=a.repeat;M6(i.data.texture.repeat,l)&&(n=!0),o.repeat=KT(l,t).map((c,u)=>typeof l[u]=="string"?1/c:c)}if("offset"in a){let l=a.offset;M6(i.data.texture.offset,l)&&(n=!0),o.offset=KT(l,t).map((c,u)=>typeof l[u]=="string"?-c:c)}if("rotation"in a){let l=i.data.texture.rotation,c=a.rotation??0;(l===void 0||M6(l,c))&&(n=!0),o.rotation=Pi(c,t)??0}o.updateMatrix()}return n}function hht(e,t,i,r){let n=!1;for(let[a,s]of Object.entries(e)){if(a==="bumpMap"||a==="roughnessMap"){n=!0;continue}if(!a||s===void 0)continue;if(Cwe(a,i,r,t)){a==="visible"&&i.type==="light"&&(n=!0);continue}i.visible=r.visible;let o=i.uniforms[`f${i.id}_${a}`];if(o&&!(o instanceof n$))switch(n=n||uht(i,a,s),o.constructor){case qa:if(typeof s=="string"){let l=t.getColor(s);l&&(o.value=l);break}else{let l=s;o.value instanceof HL?o.value=new Ks(l.r,l.g,l.b,l.a):o.setRGBA(l);break}case mm:if(typeof s=="string"){let l=t.getColor(s);l&&(o.value=l);break}else{let l=s;o.value instanceof HL?o.value=new Ks(l.r,l.g,l.b,l.a):o.value.setRGBA(l.r,l.g,l.b,l.a);break}case Wo:{let l=s;o.value.setX(l[0]),o.value.setY(l[1]);break}case hh:{let l=s;o.value.setX(l[0]),o.value.setY(l[1]),o.value.setZ(l[2]);break}case _m:{o$(s,t,i);break}case sx:{o.value=s.map(l=>new Ii(...l));break}default:{o.value=s;break}}}return n}var ob=(e,t,i)=>Math.max(0,Math.min(1,Number(t.getVariable(typeof e=="number"?e*100:e,i)??100)/100))??1,Pi=(e,t,i)=>typeof e=="number"?e:t.getVariable(e,i),lv=(e,t)=>(e||(e=new Y),e.x=Pi(e.x,t)??0,e.y=Pi(e.y,t)??0,e.z=Pi(e.z,t)??0,e),Zp=(e,t)=>(e||(e=new Ce),e.x=Pi(e.x,t)??0,e.y=Pi(e.y,t)??0,e),KT=(e,t)=>{let i=e.map(r=>Pi(r,t)??0);return[i[0],i[1]]},yD=class{constructor(e,t,i,r,n){this.id=e,this.uuid=t,this.data=i,this.uniforms={};for(let a in r)this.uniforms[`f${this.id}_${a}`]=r[a];for(let a in i)Cwe(a,this,i,n)}get type(){return this.data.type}static create(e,t,i,r){if(i.type==="light")return Cf.createLightLayer(e,t,i,r);if(i.type==="texture"||i.type==="video"){let n=i.type==="texture"?r.uiBuffer(i.texture.image)??r.image(i.texture.image):r.video(i.texture.video),a=new j9(n,i.texture.wrapping,i.texture.minFilter??1008,i.texture.magFilter??1006),s=new dut(n),o=new fut(KT(i.texture.repeat,r),KT(i.texture.offset,r),Pi(i.texture.rotation??0,r)),l=new Zt(i.crop?1:0),c=new Ln(i.projection??0),u=new Ln(["x","y","z"].indexOf(i.axis)??0),h=new Ln(i.side??0),d=new Wo(i.size?new Ce(...KT(i.size,r)):new Ce(100,100)),f=new Zt(i.blending??0),m=new Zt(ob(i.alpha,r)),y=new Ln(i.mode??0),g=new wl(i.isMask??!1),x=new a$(a,s,l,c,u,h,d,f,o,m,y,g),w=new Kn(x.calpha,"f");return new ja(e,t,i,{texture:a,textureSize:s,crop:l,projection:c,axis:u,side:h,size:d,blending:f,mat:o,alpha:m,mode:y,isMask:g},x,y,w,g,r)}else if(i.type==="matcap"){let n=r.image(i.texture.image),a=new j9(n,i.texture.wrapping,i.texture.minFilter??1008,i.texture.magFilter??1006),s=new Zt(ob(i.alpha,r)),o=new Ln(i.mode??0),l=new wl(i.isMask??!1),c=new Zt((Pi(i.texture.rotation??0,r)??0)*Wt.DEG2RAD),u=new cwe(a,s,o,l,c),h=new Kn(u.calpha,"f");return new ja(e,t,i,{texture:a,alpha:s,mode:o,isMask:l,rotation:c},u,o,h,l,r)}else if(i.type==="displace")if(i.displacementType==="noise"){let n=new hh(new Y(...i.offset.map(g=>Pi(g,r)??0))),a=new Zt(Pi(i.scale,r)??10),s=new Zt(Pi(i.intensity,r)??8),o=new Zt(Pi(i.movement,r)??1),l=new Ln(i.noiseType??0),c=new Ln(i.voronoiStyle??0),u=new Zt(Pi(i.smoothness,r)??.5),h=new Zt(Pi(i.seed,r)??0),d=new Zt(Pi(i.highCut,r)??1),f=new Zt(Pi(i.lowCut,r)??0),m=new Ln(Pi(i.quality,r)??1),y=new wwe(s,o,n,c,u,h,d,f,m,a,l);return new Twe(e,t,i,{offset:n,scale:a,intensity:s,movement:o,noiseType:l,voronoiStyle:c,smoothness:u,seed:h,highCut:d,lowCut:f,quality:m},y,r)}else throw new Error;else return pht(e,t,i,r)}updateByOp(e,t,i){let r=e,n=!1;if(r.path[0]===void 0){for(let a of Object.keys(r.props))try{let s=this.data[a],o=t[a];if(Array.isArray(s)&&Array.isArray(o)){for(let[l,c]of o.entries()){let u=s[l];if(typeof c=="string"||typeof c=="number"&&typeof u=="string"){n=!0;break}}if(n)break}else if(typeof o=="string"&&typeof s=="number"||typeof o=="number"&&typeof s=="string"||typeof o=="string"&&typeof s=="string"&&o!==s){n=!0;break}}catch(s){console.error(s)}if(r.type===0)return"type"in r.props||"category"in r.props||"visible"in r.props||"noiseType"in r.props?(i.scene.markNeedsUpdateRendererDirty(),!0):hht(r.props,i.shared,this,t)||n}else if(r.path[0]==="texture")return"texture"in t||"video"in t?o$(r.props,i.shared,this)||n:!0;return n}dispose(){if(dht(this)){let e=this.uniforms[`f${this.id}_texture`];if(!e)return!1;let t=e;t.image instanceof zv||t.image.deref()}}hasValueByKey(e){return this.uniforms[e]!==void 0}hasValue(e){return this.hasValueByKey(`f${this.id}_${e}`)}setValue(e,t){let i=`f${this.id}_${e}`;this.hasValueByKey(i)&&t!==void 0&&(this.uniforms[i].value=t)}getNode(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t]}getValue(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t].value}getName(e){let t=/f\d+_(.*)/.exec(e);if(t&&t.length>1)return t[1];console.log(`Layer.getName: error ${e}`)}getNames(){let e=[];for(let t in this.uniforms){let i=this.getName(t);i&&e.push(i)}return e}},ja=class extends yD{constructor(e,t,i,r,n,a,s,o,l){super(e,t,i,r,l),this.params=r,this.color=n,this.mode=a,this.alpha=s,this.isMask=o}},Twe=class extends yD{constructor(e,t,i,r,n,a){super(e,t,i,r,a),this.position=n}},Cf=class extends yD{constructor(e,t,i,r,n,a){super(e,t,i,n,a),this.node=r}static createLightLayer(e,t,i,r){let n,a=new Zt(ob(i.alpha,r)),s=new Ln(i.mode),o=new Zt(i.bumpMapIntensity),l=new Zt(ob(i.alphaOverride,r)),c;if(!i.visible)n=new s$,c={};else if(i.category==="lambert"){n=new vut;let u=new qa(r.color(i.emissive)??0),h=new wl(i.occlusion??!0);c={emissive:u,occlusion:h},n.emissive=u,n.occlusion=h}else if(i.category==="toon"){n=new but;let u=new Zt(i.shininess??30),h=new qa(r.color(i.specular)??1118481);c={shininess:u,specular:h},n.shininess=u,n.specular=h}else if(i.category==="physical"){n=new xut;let u=new Zt(i.roughness??.3),h=new Zt(i.metalness??0),d=new Zt(i.reflectivity??.5),f=new wl(i.occlusion??!0);c={roughness:u,metalness:h,reflectivity:d,occlusion:f},n.roughness=u,n.metalness=h,n.reflectivity=d,n.occlusion=f}else{n=new yut;let u=new Zt(i.shininess??30),h=new qa(i.specular!==void 0?r.color(i.specular)??1118481:1118481),d=new wl(i.occlusion??!0);c={shininess:u,specular:h,occlusion:d},n.shininess=u,n.specular=h,n.occlusion=d}return n.alpha=new Zt(1),n.shadingAlpha=a,n.shadingBlend=s,n.bumpMapIntensity=o,n.alphaOverride=l,c.alpha=n.shadingAlpha,c.mode=n.shadingBlend,c.bumpMapIntensity=n.bumpMapIntensity,c.alphaOverride=n.alphaOverride,new Cf(e,t,i,n,c,r)}get category(){return this.node.category}};function dht(e){let t=e instanceof yD?e.type:e;return t==="texture"||t==="video"||t==="displace_map"||t==="matcap"}function nh(e){return{alpha:new Zt(e.alpha??1),mode:new Ln(e.mode??0),isMask:new wl(e.isMask??!1)}}function fht(e,t,i,r,n){switch(e.type){case"color":{let a=new qa(r.color??Au),s=nh(r),o=new F9(a,s.alpha),l=new Kn(o.calpha,"f");return new ja(t,i,e,{color:a,...s},o,s.mode,l,s.isMask,n)}case"fresnel":{let a=new qa(r.color??16777215),s=new Zt(Pi(r.bias,n)??.1),o=new Zt(Pi(r.scale,n)??1),l=new Zt(Pi(r.intensity,n)??2),c=new Zt(Pi(r.factor,n)??1),u=nh(r),h=new put(a,s,o,l,c,u.alpha,u.mode,u.isMask),d=new Kn(h.calpha,"f");return new ja(t,i,e,{color:a,bias:s,scale:o,intensity:l,factor:c,...u},h,u.mode,d,u.isMask,n)}case"rainbow":{let a=new Zt(Pi(r.filmThickness,n)??30),s=new Zt(Pi(r.movement,n)??0),o=new hh(lv(r.wavelengths,n)),l=new Zt(Pi(r.noiseStrength,n)??0),c=new Zt(Pi(r.noiseScale,n)??1),u=new hh(lv(r.offset,n)),h=nh(r),d=new mwe(a,s,o,l,c,u,h.alpha,h.isMask),f=new Kn(d.calpha,"f");return new ja(t,i,e,{filmThickness:a,movement:s,wavelengths:o,noiseStrength:l,noiseScale:c,offset:u,...h},d,h.mode,f,h.isMask,n)}case"transmission":{let a=new Zt(Pi(r.thickness??10,n)),s=new Zt(Pi(r.ior??1.5,n)),o=new Zt(Pi(r.roughness??.5,n)),l=gi.transmissionSize,c=gi.transmissionRenderTarget,u=gi.transmissionRenderTargetDepth,h=window.innerWidth,d=window.innerHeight,f=h>=d?new Wo(d/h,1):new Wo(1,h/d),m=nh(r),y=new xwe(a,s,o,l,c,u,f,m.alpha),g=new Kn(y.calpha,"f");return new ja(t,i,e,{thickness:a,ior:s,roughness:o,aspectRatio:f,...m},y,m.mode,g,m.isMask,n)}case"toon":{let a=new Ln(r.positioning??0),s;r.colors?s=new sx(r.colors.length,r.colors):(s=new sx(10,new Ii(0,0,0,1)),s.value[1]=new Ii(1,1,1,1));let o;r.steps?o=new ax(r.steps.length,r.steps):(o=new ax(10,1),o.value[0]=0);let l=new hh(lv(r.source??new Y(0,0,0),n)),c=new wl(r.isWorldSpace??!0),u=new Zt(Pi(r.noiseStrength??0,n)),h=new Zt(Pi(r.noiseScale??1,n)),d=new mm(r.shadowColor),f=new hh(lv(r.offset??new Y(0,0,0),n)),m=nh(r),y=new vwe(a,s,o,l,c,u,h,d,f,m.alpha),g=new Kn(y.calpha,"f");return new ja(t,i,e,{positioning:a,colors:s,steps:o,source:l,isWorldSpace:c,noiseStrength:u,noiseScale:h,shadowColor:d,offset:f,...m},y,m.mode,g,m.isMask,n)}case"outline":{let a=new qa(r.outlineColor??16777215),s=new qa(r.contourColor??16777215),o=new Zt(Pi(r.outlineWidth??.1,n)),l=new Zt(Pi(r.contourWidth??.1,n)),c=new Zt(Pi(r.outlineThreshold??.1,n)),u=new Zt(Pi(r.contourThreshold??.1,n)),h=new Zt(Pi(r.outlineSmoothing??.1,n)),d=new Zt(Pi(r.contourFrequency??.1,n)),f=new hh(lv(r.contourDirection??new Y(0,1,0),n)),m=new wl(r.positionalLines??!1),y=new wl(r.compensation??!0),g=gi.normalRenderTarget,x=gi.normalRenderTargetDepth,w=gi.pixelRatioNode,S=gi.resolution,M=nh(r),E=new dwe(a,s,o,l,c,u,h,d,f,m,y,S,g,x,w,M.alpha),T=new Kn(E.calpha,"f");return new ja(t,i,e,{outlineColor:a,contourColor:s,outlineWidth:o,contourWidth:l,outlineThreshold:c,contourThreshold:u,outlineSmoothing:h,contourFrequency:d,contourDirection:f,positionalLines:m,compensation:y,...M},E,M.mode,T,M.isMask,n)}case"depth":{let a=new Ln(r.gradientType??0),s=new wl(r.smooth??!1),o=new Zt(Pi(r.near,n)??50),l=new Zt(Pi(r.far,n)??200),c=new Zt(r.isVector??1),u=new Zt(r.isWorldSpace??0),h=new hh(lv(r.origin,n)),d=new hh(lv(r.direction,n)),f;r.colors?f=new sx(r.colors.length,r.colors):(f=new sx(2,new Ii(0,0,0,1)),f.value[1]=new Ii(1,1,1,1));let m;r.steps?m=new ax(r.steps.length,r.steps):(m=new ax(2,1),m.value[0]=0);let y=nh(r),g=new awe(a,s,o,l,c,u,h,d,f,m,y.alpha,y.isMask),x=new Kn(g.calpha,"f");return new ja(t,i,e,{gradientType:a,smooth:s,near:o,far:l,isVector:c,isWorldSpace:u,origin:h,direction:d,colors:f,steps:m,...y},g,y.mode,x,y.isMask,n)}case"noise":{let a=new Zt(Pi(r.scale,n)??1),s=new hh(lv(r.size??new Y(100,100,100),n)),o=new Zt(Pi(r.move,n)??1),l=new Wo(Zp(r.fA??new Ce(1.7,9.2),n)),c=new Wo(Zp(r.fB??new Ce(8.3,2.8),n)),u=new Wo(Zp(r.distortion??new Ce(1,1),n)),h=new mm(r.colorA),d=new mm(r.colorB),f=new mm(r.colorC),m=new mm(r.colorD),y=new Ln(r.noiseType??0),g=new Ln(r.voronoiStyle??0),x=new Zt(Pi(r.highCut,n)??1),w=new Zt(Pi(r.lowCut,n)??0),S=new Zt(Pi(r.smoothness,n)??.5),M=new Zt(Pi(r.seed,n)??.5),E=new Ln(r.quality??1),T=nh(r),R=new uwe(a,s,o,l,c,u,h,d,f,m,T.alpha,y,T.isMask,g,x,w,S,M,E),P=new Kn(R.calpha,"f");return new ja(t,i,e,{scale:a,size:s,move:o,fA:l,fB:c,distortion:u,colorA:h,colorB:d,colorC:f,colorD:m,noiseType:y,...T,voronoiStyle:g,highCut:x,lowCut:w,smoothness:S,seed:M,quality:E},R,T.mode,P,T.isMask,n)}case"normal":{let a=new hh(r.cnormal??new Y(1,1,1)),s=nh(r),o=new nwe(a,s.alpha),l=new Kn(o.calpha,"f");return new ja(t,i,e,{cnormal:a,...s},o,s.mode,l,s.isMask,n)}case"gradient":{let a=new Ln(r.gradientType??0),s=new wl(r.smooth??!1),o;r.colors?o=new sx(r.colors.length,r.colors):(o=new sx(10,new Ii(0,0,0,1)),o.value[1]=new Ii(1,1,1,1));let l;r.steps?l=new ax(r.steps.length,r.steps):(l=new ax(10,1),l.value[0]=0);let c=new Wo(Zp(r.offset??new Ce(0,0),n)),u=new Wo(Zp(r.morph??new Ce(0,0),n)),h=new Zt(Pi(r.angle??0,n)),d=nh(r),f=new owe(a,s,o,l,c,u,h,d.alpha,d.isMask),m=new Kn(f.calpha,"f");return new ja(t,i,e,{gradientType:a,smooth:s,colors:o,steps:l,offset:c,morph:u,angle:h,...d},f,d.mode,m,d.isMask,n)}case"pattern":{let a=new Ln(r.style??0),s=new Ln(r.projection??0),o=new Ln(["x","y","z"].indexOf(r.axis)??0),l=new Zt(Pi(r.blending??0,n)),c=new Wo(Zp(r.offset,n)),u=new mm(r.colorA),h=new mm(r.colorB),d=new Wo(Zp(r.frequency??new Ce(10,10),n)),f=new Zt(Pi(r.size??.5,n)),m=new Zt(Pi(r.variation??0,n)),y=new Zt(Pi(r.smoothness??.5,n)),g=new Zt(Pi(r.zigzag??0,n)),x=new Zt(Pi(r.rotation??0,n)),w=new Wo(Zp(r.vertical??new Ce(0,1),n)),S=new Wo(Zp(r.horizontal??new Ce(0,1),n)),M=new Ln(r.sides??6),E=nh(r),T=new fwe(a,s,o,l,c,u,h,d,f,m,y,g,x,w,S,M,E.alpha,E.isMask),R=new Kn(T.calpha,"f");return new ja(t,i,e,{style:a,projection:s,axis:o,blending:l,offset:c,colorA:u,colorB:h,frequency:d,size:f,variation:m,smoothness:y,zigzag:g,rotation:x,vertical:w,horizontal:S,sides:M,...E},T,E.mode,R,E.isMask,n)}default:{let a=new qa(1,0,0,1),s=nh(r),o=new F9(a,s.alpha),l=new Kn(o.calpha,"f");return new ja(t,i,e,{color:a,...s},o,s.mode,l,s.isMask,n)}}}function pht(e,t,i,r){let n=$ut(i,r);return fht(i,e,t,n,r)}function Cwe(e,t,i,r){if(i.type==="displace"&&(e==="intensity"||e==="visible")){let n=t.uniforms[`f${t.id}_intensity`];return n?(n.value=(Pi(i.intensity,r)??1)*(i.visible?1:0),n):void 0}if(i.type!=="displace"&&(e==="alpha"||e==="visible")){let n=t.uniforms[`f${t.id}_alpha`];if(!n)return;if(n.value=ob(i.alpha,r)*(i.visible?1:0),i.type==="outline"&&e==="visible"){let a=t.uniforms[`f${t.id}_compensation`];a&&(a.value=i.compensation&&i.visible)}return n}}function Oc(e,t,i,r,n,a,s=[]){let o=i;for(let l of s)l in o&&(o=o[l]);for(let l of e)l in o&&n.getVariable(o[l],["material",a,"layer",r,...s,String(l)]);for(let l of t)l in o&&o[l].forEach((c,u)=>{n.getVariable(c,["material",a,"layer",r,...s,String(l),u===0?"x":u===1?"y":"z"])})}function y_(e,t){let i=0,r=e.layers.find(n=>n.data.type==="light");if(r){let n=r.data,a=Number(t.getVariable(n.alphaOverride));if((typeof n.alphaOverride=="string"?a/100:n.alphaOverride)<1)return!0}for(let n of e.layers){if(n.data.type!=="displace"&&n.data.isMask)return!0;if(n.data.type!=="displace"&&"alpha"in n.data&&n.data.type!=="light"&&n.data.type!=="fresnel"&&n.data.type!=="texture"&&n.data.type!=="matcap"&&n.data.type!=="rainbow"&&n.data.type!=="outline"&&n.data.type!=="pattern"){let a=n.data.visible?n.data.alpha:0;if(typeof a=="string"&&(a=Math.max(0,Math.min(1,Number(t.getVariable(a)??100)/100))),a===1&&n.data.type==="depth"||n.data.type==="gradient"){for(let s of n.data.colors)if(s[3]<1){a=s[3];break}}else if(a===1&&n.data.type==="noise"){let s=t.color(n.data.colorA).a,o=t.color(n.data.colorB).a,l=t.color(n.data.colorC).a,c=t.color(n.data.colorD).a,u=Math.min(s,Math.min(o,Math.min(l,c)));u<1&&(a=u)}i+=(1-i)*a}}return i<1}var rg=class extends Fr{constructor(){super(void 0),this.flatShading=!1,this.needsJitter=!0,this.shadersPatchedForShapeBlend=!1,this.nodeContextUuid=0,this.fog=!0,this.dithering=!0,this.vertexColors=!0,this.transparent=!0}customProgramCacheKey(){return""}},mht=class extends rg{constructor(e,t,i,r){super(),this.flatShading=e,this.side=t,this.wireframe=i,this.root=r}updateAfterBuild(){let e=this.root;this.lights=e.lights,this.vertexShader=e.vertexShader,this.fragmentShader=e.fragmentShader,Object.assign(this.defines,e.defines),Object.assign(this.uniforms,e.uniforms),this.extensions=e.extensions,this.transparent=e.transparent,this.cacheKey=e.customProgramCacheKey()+"flat"+this.flatShading+this.side}onBeforeCompile(e,t){this.root.onBeforeCompile(e)}get data(){return this.root.data}get category(){return this.root.category}get hasAO(){return this.root.hasAO}getFlavor(e,t,i,r){return this.root.getFlavor(e,t,i,r)}get layers(){return this.root.layers}get fragment(){return this.root.fragment}getLayersOfType(e){return this.root.getLayersOfType(e)}getLayerByUuid(e){return this.root.getLayerByUuid(e)}updateByOp(e,t,i){this.root.updateByOp(e,t,i)}nodeMaterialDispose(){this.root.nodeMaterialDispose()}},l$=class extends rg{constructor(e,t,i=!0){super(),this.data=e,this.allowVariableSaves=i,this.layerIdGen=0,this.flavors=[],this.masks={},this.type="NodeMaterial",this.updaters=[],this.needsJitter=t.shared.needsJitter,qs.startContext(this),this.reset0(e,t),qs.endContext(this)}get nodeMaterial(){return this}getFlavor(e,t,i,r){let n=i?6:(e?3:0)+t;if(n+=(((r==null?void 0:r.resolutionLevel)??0)-(r!=null&&r.useChildrenColors?4:0))*7,n===0)return this;this.flavors===void 0&&(this.flavors=[]),n-=1;let a=this.flavors[n];return a===void 0&&(a=new mht(e,t,i,this),a.needsJitter=this.needsJitter,this.flavors[n]=a,a.flatShading=e,a.side=t,a.updateAfterBuild(),r&&(a.defines.SHAPEBLEND=r.resolutionLevel,a.defines.SHAPEBLEND_C=r.useChildrenColors?1:0)),a}get fragment(){return this.lightLayer.node}get category(){return this.lightLayer.category}get hasAO(){var e;return((e=this.lightLayer.getNode("occlusion"))==null?void 0:e.value)??!1}reset(e,t,i=!1){qs.startContext(this),(this.data!==e||i)&&this.reset0(e,t),qs.endContext(this)}reset0(e,t){this.data=e;let i=e.layers??wo.defaultTwoLayerData("phong").layers;try{this.layers=i.map(r=>yD.create(this.layerIdGen++,r.id,r.data,t.shared))}catch{this.layers=[]}this.layers.reverse(),this.name=e.name??"Untitled Material",this.onUpdate(t.shared),this.transparent=y_(e,t.shared),this.saveVariableLocations(t)}onVariableUpdate(e,t,i){if(e[0]==="alphaOverride")this.transparent=y_(this.data,i.shared),this.lightLayer.setValue("alphaOverride",Math.max(0,Math.min(Number(t)/100,1)));else if(e[0]==="layer"){let r=e[1],n=e[2];if(r&&n){let a=this.layers.find(s=>s.uuid===r);if(a!=null&&a.hasValue(n))if(n==="alpha")this.transparent=y_(this.data,i.shared),a.setValue(n,Math.max(0,Math.min(Number(t)/100,1)));else{let s=a.getValue(n),o=e[3],l=e[4];if(s instanceof wa){let c=s[o],u;typeof c=="number"?u=Number(t):c.isVector2&&(u=c.toArray(),l==="x"?u[0]=Number(t):l==="y"&&(u[1]=Number(t))),o$({[o]:u},i.shared,a);return}(o==="x"||o==="y"||o==="z")&&s.isVector3||(o==="x"||o==="y")&&s.isVector2?s[o]=Number(t):a.setValue(n,t)}}}}saveVariableLocations(e){if(!this.allowVariableSaves)return;let t=this.data.layers.find(i=>i.data.type==="light");t&&e.shared.getVariable(t.data.alphaOverride,["material",this.uuid,"alphaOverride"]),this.data.layers.forEach(i=>{"alpha"in i.data&&typeof i.data.alpha=="string"&&e.shared.getVariable(i.data.alpha,["material",this.uuid,"layer",i.id,"alpha"]),i.data.type==="displace"?i.data.displacementType==="noise"?Oc(["intensity","scale","movement","smoothness","seed","highCut","lowCut"],["offset"],i.data,i.id,e.shared,this.uuid):Oc(["intensity"],[],i.data,i.id,e.shared,this.uuid):i.data.type==="depth"?Oc(["near","far"],["origin","direction"],i.data,i.id,e.shared,this.uuid):i.data.type==="fresnel"?Oc(["bias","scale","intensity","factor"],[],i.data,i.id,e.shared,this.uuid):i.data.type==="rainbow"?Oc(["filmThickness","movement","noiseStrength","noiseScale"],["offset","wavelengths"],i.data,i.id,e.shared,this.uuid):i.data.type==="noise"?Oc(["scale","move","seed","highCut","lowCut","smoothness"],["size","distortion","fA","fB"],i.data,i.id,e.shared,this.uuid):i.data.type==="pattern"?Oc(["blending","size","variation","smoothness","zigzag","rotation"],["offset","frequency","vertical","horizontal"],i.data,i.id,e.shared,this.uuid):i.data.type==="outline"?Oc(["outlineWidth","contourWidth","outlineThreshold","contourThreshold","outlineSmoothing","contourFrequency"],["contourDirection"],i.data,i.id,e.shared,this.uuid):i.data.type==="toon"?Oc(["noiseStrength","noiseScale"],["offset","source"],i.data,i.id,e.shared,this.uuid):i.data.type==="transmission"?Oc(["roughness","thickness","ior"],[],i.data,i.id,e.shared,this.uuid):i.data.type==="texture"||i.data.type==="video"?(Oc([],["size"],i.data,i.id,e.shared,this.uuid),Oc(["rotation"],["repeat","offset"],i.data,i.id,e.shared,this.uuid,["texture"])):i.data.type==="gradient"?Oc(["angle"],["offset","morph"],i.data,i.id,e.shared,this.uuid):i.data.type==="matcap"&&Oc(["rotation"],[],i.data,i.id,e.shared,this.uuid,["texture"])})}getLayersOfType(e){return this.layers.filter(t=>t.type===e)}getLayerByUuid(e){return this.layers.find(t=>t.uuid===e)}onUpdate(e){this.lightLayer=this.layers.find(t=>t instanceof Cf),this.lightLayer===void 0&&(this.lightLayer=new Cf(0,"",{...ss.defaultData("light","phong"),visible:!1},new s$,{},e)),this.dispose();for(let t of this.flavors)t&&t.dispose();this.applyTextureMaps(),this.applyMasks(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),this.build(),this.nodeContextUuid=0}applyTextureMaps(){let e=this.layers.find(n=>n instanceof Cf);if(!e)return;let t=e.data,i=t.bumpMap,r=t.roughnessMap;e.node.bumpMap=void 0,e.node.roughnessMap=void 0;for(let n=0;n<this.layers.length;++n){let a=this.layers[n];a instanceof ja&&a.color instanceof a$&&(a.uuid===i&&(e.node.bumpMap=a.color),a.uuid===r&&(e.node.roughnessMap=a.color))}}updateByOp(e,t,i){if(qs.startContext(this),t!==void 0?this.data=t:t=this.data,this.transparent=y_(t,i.shared),e.path[0]==="layers"){let r=i.shared,n=e.path[1];if(n===void 0)i.scene.markNeedsUpdateRendererDirty(),this.reset0(t,i);else{e.type===0&&e.props.occlusion!==void 0&&i.scene.markNeedsUpdateRendererDirty();let a=this.layers.find(s=>s.uuid===n);if(a){let s=t.layers.data(n),o;e.type===0&&("alpha"in e.props||"alphaOverride"in e.props)&&("alpha"in e.props?o={...e.props,alpha:ob(e.props.alpha,r,["material",this.uuid,"layer",n,"alpha"])}:o={...e.props,alphaOverride:ob(e.props.alphaOverride,r,["material",this.uuid,"alphaOverride"])}),a.updateByOp({...e,...o?{props:o}:{},path:e.path.slice(2)},s,i)&&this.reset0(t,i)}}}else this.reset0(t,i);qs.endContext(this)}applyMasks(){for(let e=0;e<this.layers.length;++e){let t=this.layers[e];t instanceof ja?t.color.mask=void 0:t instanceof Cf&&(t.node.mask=void 0)}for(let e=0;e<this.layers.length;++e){let t=this.layers[e];if(t instanceof ja&&t.isMask.value&&t.data.visible&&e>0){let i=e-1,r=this.layers[i];r instanceof Cf?r.node.mask=new Lc(t.color,t.alpha,Lc.MUL):r instanceof ja&&(r.isMask.value||(r.color.mask=new Lc(t.color,t.alpha,Lc.MUL)))}}}blendColors(){let e=this.layers.findIndex(i=>i instanceof ja),t=this.layers.findIndex(i=>i instanceof Cf);if(e!==-1&&e<t){let i=this.layers[e].color;for(let r=e+1;r<t;++r){let n=this.layers[r];if(n instanceof ja){if(n.isMask.value)continue;i=new uue(i,n.color,n.alpha,n.mode)}}this.fragment.color=i}else this.fragment.color=void 0}blendAfterColors(){let e=new Kn("outgoingLight","f"),t=this.layers.findIndex(i=>i instanceof Cf);if(this.layers.length>t+1){for(let i=t+1;i<this.layers.length;++i){let r=this.layers[i];if(r instanceof ja){if(r.isMask.value)continue;e=new uue(e,r.color,r.alpha,r.mode)}}this.fragment.afterColor=e}else this.fragment.afterColor=void 0}blendPositions(){let e=this.layers.filter(t=>t instanceof Twe);if(e.length>0){let t=e[0].position;for(let i=1;i<e.length;++i)e[i]&&(t=new Lc(t,e[i].position,Lc.ADD),t=new Lc(t,new Zt(.5).setReadonly(!0),Lc.MUL));this.fragment.position=t}else this.fragment.position=void 0}getDefines(){return this.defines}getUniforms(){return this.uniforms}getVertexShader(){return this.vertexShader}getFragmentShader(){return this.fragmentShader}onBeforeCompile(e){this.shapeBlendhack&&this.shapeBlendhack(this),e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.extensionDerivatives=this.extensions.derivatives===!0,e.extensionFragDepth=this.extensions.fragDepth===!0,e.extensionDrawBuffers=this.extensions.drawBuffers===!0,e.extensionShaderTextureLOD=this.extensions.shaderTextureLOD===!0}clampUniformsForPreview(e,t){let i=(r,n,a)=>Math.min(Math.max(r,n),a);for(let r of this.layers)if(r.type==="displace"){let n=i(r.uniforms[`f${r.id}_intensity`].value,e,t);r.uniforms[`f${r.id}_intensity`].value=n}}updateFrame(e){for(let t=0;t<this.updaters.length;++t)e.updateNode(this.updaters[t])}build(){let e=new ewe;e.needsJitter=this.needsJitter,this.lights=this.lightLayer.data.visible,e.build(this.fragment,this.fragment),this.vertexShader=e.getCode("vertex"),this.fragmentShader=e.getCode("fragment"),this.defines=e.defines,this.uniforms=e.uniforms,this.extensions=e.extensions,this.updaters=e.updaters;for(let t of this.flavors)t&&t.updateAfterBuild();return this.shadersPatchedForShapeBlend=!1,this}nodeMaterialDispose(){this.layers.forEach(e=>e.dispose()),super.dispose();for(let e of this.flavors)e&&e.dispose()}assetsLoaded(){for(let e of this.layers)if(e instanceof ja){let t=e.params.texture;if(t instanceof j9&&!t.image.loaded)return!1}return!0}};Object.defineProperties(rg.prototype,{properties:{get:function(){return this.fragment.properties}}});var G9=class extends l${constructor(e,t,i){super(e,t,!1),this.uuid=i,this.allowVariableSaves=!0,this.saveVariableLocations(t)}},bue=new Map;function ght(e){if(typeof e=="string")return e;let t=bue.get(e);return t||(t={url:URL.createObjectURL(new Blob([e]))},bue.set(e,t)),t.url}var Pwe,vht=new Promise(e=>{Pwe=e}),wue=!1,HO;function yht(){if(wue)return;if(HO)return HO;async function e(){await I0(()=>import("./howler-BY4p9zcX.js").then(t=>t.h),[]),Pwe(window!==void 0?window:global),wue=!0}return HO=e(),HO}var Dwe;vht.then(e=>Dwe=e);function _ue(e,t){e.forEach(i=>{"dragDropActions"in i.data?(t.push(...i.data.dragDropActions.drag),t.push(...i.data.dragDropActions.drop)):"inActions"in i.data?(t.push(...i.data.inActions),t.push(...i.data.outActions)):"gameActions"in i.data?(t.push(...i.data.gameActions.idle),t.push(...i.data.gameActions.move),t.push(...i.data.gameActions.jump),t.push(...i.data.gameActions.run)):"breakpoints"in i.data?i.data.breakpoints.forEach(r=>{t.push(...r.data.actions)}):"actions"in i.data&&(t.push(...i.data.actions),i.data.actions.forEach(r=>{r.data.type==="Conditional"&&r.data.ifActions&&(t.push(...r.data.ifActions),t.push(...r.data.elseActions))}))})}function xht(e){let t=!1,i=[];return e.scene.objects.traverse((r,n)=>{if(n.type==="Page"&&n.uiScene!==void 0&&n.uiScene.objects.traverse((a,s)=>{if(s.events===void 0||Array.isArray(s.events)===!1)return!0;_ue(s.events,i),t=t||i.some(o=>o.data.type==="Audio")}),n.events===void 0||Array.isArray(n.events)===!1)return!0;_ue(n.events,i),t=t||i.some(a=>a.data.type==="Audio")}),t}var AT=class{constructor({src:e,volume:t,delay:i,loop:r}){this._volume=1,this.delay=0,this._loop=1,this.loopsRemaining=0,this._status="stopped",this.onEnd=()=>{this.loopsRemaining===1/0?this.replay():this.loopsRemaining>1?(this.replay(),this.loopsRemaining--):(this._status="stopped",this.loopsRemaining=this._loop)};let n;typeof e=="string"?n={src:e}:n={src:ght(e),format:"wav"},this.sound=new Dwe.Howl(n),this.sound.on("end",this.onEnd),this.src=e,t!==void 0&&(this.volume=t),i!==void 0&&(this.delay=i),r!==void 0&&(this.loop=r)}get status(){return this._status}get volume(){return this._volume}set volume(e){this._volume=e,this.sound.volume(e)}get loop(){return this._loop}set loop(e){this._loop=e,this.loopsRemaining=e}replay(){this.clearDelay(),this.delayTimerId=window.setTimeout(()=>{this.sound.play(),this.clearDelay()},this.delay)}fade(e,t=1e3){e?(this.sound.volume(this._volume),this.clearFade(),this.fadeTimerId=window.setTimeout(()=>{this.sound.fade(this._volume,0,t),this.clearFade()},e)):this.sound.fade(this._volume,0,t)}on(e,t,i){this.sound.on(e,t,i)}off(e,t,i){this.sound.off(e,t,i)}play(){this._status==="playing"||this.sound.playing()||(this._status==="paused"?(this.sound.seek()===0?this.replay():this.sound.play(),this._status="playing"):this._status==="stopped"&&(this.replay(),this._status="playing"))}pause(){this._status==="playing"&&(this.sound.pause(),this.clearFade(),this.clearDelay(),this._status="paused")}stop(){this.sound.stop(),this.loopsRemaining=this._loop,this.clearFade(),this.clearDelay(),this._status="stopped"}clearFade(){this.fadeTimerId&&(clearTimeout(this.fadeTimerId),delete this.fadeTimerId)}clearDelay(){this.delayTimerId&&(clearTimeout(this.delayTimerId),delete this.delayTimerId)}dispose(e=!1){this.off(),this.stop(),this.clearFade(),this.clearDelay()}},bht=class{constructor(){this.type="ShapePath",this.color=new _i,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new eL,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){var i;return(i=this.currentPath)==null||i.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){var n;return(n=this.currentPath)==null||n.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,n,a){var s;return(s=this.currentPath)==null||s.bezierCurveTo(e,t,i,r,n,a),this}splineThru(e){var t;return(t=this.currentPath)==null||t.splineThru(e),this}toShapes(){let e={ORIGIN:0,DESTINATION:1,BETWEEN:2,LEFT:3,RIGHT:4,BEHIND:5,BEYOND:6},t={loc:e.ORIGIN,t:0};function i(f,m,y,g){let x=f.x,w=m.x,S=y.x,M=g.x,E=f.y,T=m.y,R=y.y,P=g.y,I=(M-S)*(E-R)-(P-R)*(x-S),L=(w-x)*(E-R)-(T-E)*(x-S),z=(P-R)*(w-x)-(M-S)*(T-E),U=I/z,j=L/z;if(z===0&&I!==0||U<=0||U>=1||j<0||j>1)return null;if(I===0&&z===0){for(let F=0;F<2;F++)if(r(F===0?y:g,f,m),t.loc===e.ORIGIN){let G=F===0?y:g;return{x:G.x,y:G.y,t:t.t}}else if(t.loc===e.BETWEEN){let G=+(x+t.t*(w-x)).toPrecision(10),H=+(E+t.t*(T-E)).toPrecision(10);return{x:G,y:H,t:t.t}}return null}else{for(let H=0;H<2;H++)if(r(H===0?y:g,f,m),t.loc===e.ORIGIN){let W=H===0?y:g;return{x:W.x,y:W.y,t:t.t}}let F=+(x+U*(w-x)).toPrecision(10),G=+(E+U*(T-E)).toPrecision(10);return{x:F,y:G,t:U}}}function r(f,m,y){let g=y.x-m.x,x=y.y-m.y,w=f.x-m.x,S=f.y-m.y,M=g*S-w*x;if(f.x===m.x&&f.y===m.y){t.loc=e.ORIGIN,t.t=0;return}if(f.x===y.x&&f.y===y.y){t.loc=e.DESTINATION,t.t=1;return}if(M<-Number.EPSILON){t.loc=e.LEFT;return}if(M>Number.EPSILON){t.loc=e.RIGHT;return}if(g*w<0||x*S<0){t.loc=e.BEHIND;return}if(Math.sqrt(g*g+x*x)<Math.sqrt(w*w+S*S)){t.loc=e.BEYOND;return}let E;g!==0?E=w/g:E=S/x,t.loc=e.BETWEEN,t.t=E}function n(f,m){let y=[],g=[];for(let x=1;x<f.length;x++){let w=f[x-1],S=f[x];for(let M=1;M<m.length;M++){let E=m[M-1],T=m[M],R=i(w,S,E,T);R!==null&&y.find(P=>P.t<=R.t+Number.EPSILON&&P.t>=R.t-Number.EPSILON)===void 0&&(y.push(R),g.push(new Ce(R.x,R.y)))}}return g}function a(f,m,y){let g=new Ce;m.getCenter(g);let x=[];return y.forEach(w=>{w.boundingBox.containsPoint(g)&&n(f,w.points).forEach(S=>{x.push({identifier:w.identifier,isCW:w.isCW,point:S})})}),x.sort((w,S)=>w.point.x-S.point.x),x}function s(f,m,y,g,x){(x==null||x==="")&&(x="nonzero");let w=new Ce;f.boundingBox.getCenter(w);let S=[new Ce(y,w.y),new Ce(g,w.y)],M=a(S,f.boundingBox,m);M.sort((L,z)=>L.point.x-z.point.x);let E=[],T=[];M.forEach(L=>{L.identifier===f.identifier?E.push(L):T.push(L)});let R=E[0].point.x,P=[],I=0;for(;I<T.length&&T[I].point.x<R;)P.length>0&&P[P.length-1]===T[I].identifier?P.pop():P.push(T[I].identifier),I++;if(P.push(f.identifier),x==="evenodd"){let L=P.length%2===0,z=P[P.length-2];return{identifier:f.identifier,isHole:L,for:z}}else if(x==="nonzero"){let L=!0,z=null,U=null;for(let j=0;j<P.length;j++){let F=P[j];m[F]&&(L?(U=m[F].isCW,L=!1,z=F):U!==m[F].isCW&&(U=m[F].isCW,L=!0))}return{identifier:f.identifier,isHole:L,for:z}}else console.warn('fill-rule: "'+x+'" is currently not implemented.')}let o=0,l=999999999,c=-999999999,u=[];this.subPaths.forEach(f=>{let m=f.getPoints(),y=-999999999,g=999999999,x=-999999999,w=999999999;for(let S=0;S<m.length;S++){let M=m[S];M.y>y&&(y=M.y),M.y<g&&(g=M.y),M.x>x&&(x=M.x),M.x<w&&(w=M.x)}c<=x&&(c=x+1),l>=w&&(l=w-1),m.length&&u.push({curves:f.curves,points:m,isCW:fxe.isClockWise(m),identifier:o++,boundingBox:new tY(new Ce(w,g),new Ce(x,y))})});let h=u.map(f=>{var m;return s(f,u,l,c,(m=this.userData)==null?void 0:m.style.fillRule)}),d=[];return u.forEach(f=>{let m=h[f.identifier];if(m&&!m.isHole){let y=new tL;y.curves=f.curves,h.filter(g=>(g==null?void 0:g.isHole)&&g.for===f.identifier).forEach(g=>{if(g){let x=u[g.identifier],w=new eL;w.curves=x.curves,y.holes.push(w)}}),d.push(y)}}),d}},Owe=!1,Rwe,Sue=new Promise(e=>{Rwe=e}),Aue=!1,GO;function wht(){if(Owe=!0,Aue)return;if(GO)return GO;async function e(){let t=await I0(()=>import("./opentype-U-0Y99ve.js"),[]);Rwe(t),Aue=!0}return GO=e(),GO}var _ht=class{async load(e,t,i=()=>{}){let{load:r}=await Sue;r(e,(n,a)=>{n||!a?i(n??"Something went wrong"):t(a)})}async parse(e){let{parse:t,Bidi:i}=await Sue;try{let r=t(e),n=new i,a=s=>r.charToGlyphIndex(s.char);return n.registerModifier("glyphIndex",null,a),n.applyFeatures(r,r.defaultRenderOptions.features),{font:r,bidi:n}}catch(r){console.error(r)}}};async function Sht(e){return await(await fetch(e)).arrayBuffer()}var Aht=new _ht;async function Mue(e){let t,i,r=!1;if(e.url?(t=await Sht(e.url),i=e.url,r=e.url.startsWith("/")):e.data&&(t=e.data.buffer.slice(e.data.byteOffset,e.data.byteOffset+e.data.byteLength)),t)if(Owe){let n=await Aht.parse(t);if(n)return{font:n.font,url:i,intercepted:r,arr:t,bidi:n.bidi}}else return{font:void 0,url:i,intercepted:r,arr:t,bidi:null}}function Mht(e,t){return t.state.glyphIndex===e||t.state.fina===e||t.state.medi===e||t.state.init===e}var Eht=class{constructor(e){this._arrayBuffer=new ArrayBuffer(1),this._isLoaded=!1,this._intercepted=!1,this._isUserFont=e.isUserFont??!1,this._loadingPromise=Mue(e).then(t=>{t&&(this._arrayBuffer=t.arr,this._url=t.url,this.font=t.font,this._intercepted=t.intercepted,this._isLoaded=!0,this._bidi=t.bidi)})}update(e){this._isLoaded=!1,this._isUserFont=e.isUserFont??!1,this._loadingPromise=Mue(e).then(t=>{t&&(this._arrayBuffer=t.arr,this._url=t.url,this.font=t.font,this._intercepted=t.intercepted,this._isLoaded=!0,this._bidi=t.bidi)})}get url(){return this._url}get intercepted(){return this._intercepted}get isLoaded(){return this._isLoaded}get loadingPromise(){return this._loadingPromise}reverseLigaturesTable(e,t,i){if(!this._bidi)return[];let r=this._bidi;r.getTextGlyphs(t);let n=r.tokenizer.tokens,a=[],s=0,o=i.length===n.length;for(let l=0;l<i.length;l++){let c=i[l].index,u=String.fromCharCode(i[l].unicode),h=n[s];if(Mht(c,h)||o)a.push({char:u,index:c,replacements:[h.state.glyphIndex],replacementChars:[h.char]}),s++;else{let d=h.char,f="",m=[h.state.glyphIndex],y=[],g=!1;for(;!g;)s++,f=t.charAt(s),d+=f,m.push(e.charToGlyphIndex(f)),y=e.stringToGlyphs(d),y.length===1&&y[0].index===c&&(g=!0),s>t.length&&(g=!0);a.push({char:u,index:c,replacements:m,replacementChars:Array.from(d)}),s++}}return a}generateShapes(e,t,i){var x;if(!this._isLoaded)return;let r=this.font,n=t.fontSize/this.unitsPerEm,a=t.fontSize*t.lineHeight,s=e.map(w=>this.getTextWidth(w,t)),o=typeof t.width=="string"?Number(i.getVariable(t.width)):t.width,l=typeof t.height=="string"?Number(i.getVariable(t.height)):t.height,c=this.getCharWidth(`
|
|
5555
5555
|
`,t),u=t.horizontalAlign===1?c:0,h=this.getLineInitialOffsetX(s[0],o,t.horizontalAlign,e[0],c),d=this.getLineInitialOffsetY(a,e.length,l,n,t.verticalAlign),f=[],m=e.map(w=>[]),y=e.map(w=>[]);for(let w=0;w<e.length;w++){let S=e[w],M={features:{liga:!0},letterSpacing:t.letterSpacing},E=[];try{E=r.stringToGlyphs(S,M)}catch(L){console.warn(L)}h=this.getLineInitialOffsetX(s[w],o,t.horizontalAlign,S,c);let T=[];try{T=this.reverseLigaturesTable(r,S,E)}catch(L){console.warn(L)}let R=this.computeSpaceWidthForLine(e,w,t,i),P=0,I=E[0];I&&t.horizontalAlign===2&&I.leftSideBearing!==void 0&&(h-=I.leftSideBearing*n),(x=this.font)==null||x.forEachGlyph(S,h,d,t.fontSize,M,(L,z,U,j,F)=>{let G=L.index===0?`
|
|
5556
5556
|
`:L.unicode?String.fromCharCode(L.unicode):void 0,H=T[P],W=0;if(G===`
|
|
5557
5557
|
`)W=u;else if(G===" ")W=R;else{let Q=this.createPath(L,n,z,U,t);Q&&(W=Q.offsetX,f.push(Q.path))}if(H.replacements.length===1)y[w].push([z,U]),m[w].push(W);else{let Q=H.replacements.map(J=>(r.glyphs.get(J).advanceWidth??0)*n),ne=Q.reduce((J,ae)=>J+=ae,0),se=Q.map(J=>J/ne),$=z;for(let J=0;J<se.length;J++){let ae=W*se[J];y[w].push([$,U]),m[w].push(ae),$+=ae}}P++}),d-=a}let g=[];for(let w=0,S=f.length;w<S;w++)g.push(...f[w].toShapes());return{shapes:g,charWidths:m,lineWidths:s,charCoords:y}}get isUserFont(){return this._isUserFont}get arrayBuffer(){return this._arrayBuffer}get ascender(){var e;return((e=this.font)==null?void 0:e.ascender)??0}get descender(){var e;return((e=this.font)==null?void 0:e.descender)??0}get familyName(){var e;return((e=this.font)==null?void 0:e.names.fontFamily)??""}get subfamilyName(){var e;return((e=this.font)==null?void 0:e.names.fontSubfamily)??""}get unitsPerEm(){var e;return((e=this.font)==null?void 0:e.unitsPerEm)??1}getLineInitialOffsetX(e,t,i,r,n){return(i===3||i===2)&&r.indexOf(`
|
|
@@ -12432,7 +12432,7 @@ No matching component was found for:
|
|
|
12432
12432
|
#include <tonemapping_fragment>
|
|
12433
12433
|
#include <${_Tt>=154?"colorspace_fragment":"encodings_fragment"}>
|
|
12434
12434
|
}
|
|
12435
|
-
`})}get time(){return this.uniforms.time.value}set time(t){this.uniforms.time.value=t}get pixelRatio(){return this.uniforms.pixelRatio.value}set pixelRatio(t){this.uniforms.pixelRatio.value=t}}const uMe=e=>e&&e.constructor===Float32Array,ETt=e=>[e.r,e.g,e.b],hMe=e=>e instanceof Dt||e instanceof Me||e instanceof zn,dMe=e=>Array.isArray(e)?e:hMe(e)?e.toArray():[e,e,e];function sT(e,t,i){return ee.useMemo(()=>{if(t!==void 0){if(uMe(t))return t;if(t instanceof Jt){const r=Array.from({length:e*3},()=>ETt(t)).flat();return Float32Array.from(r)}else if(hMe(t)||Array.isArray(t)){const r=Array.from({length:e*3},()=>dMe(t)).flat();return Float32Array.from(r)}return Float32Array.from({length:e},()=>t)}return Float32Array.from({length:e},i)},[t])}const fMe=ee.forwardRef(({noise:e=1,count:t=100,speed:i=1,opacity:r=1,scale:n=1,size:a,color:s,children:o,...l},c)=>{ee.useMemo(()=>rMe({SparklesImplMaterial:MTt}),[]);const u=ee.useRef(null),h=mx(S=>S.viewport.dpr),d=dMe(n),f=ee.useMemo(()=>Float32Array.from(Array.from({length:t},()=>d.map(G$.randFloatSpread)).flat()),[t,...d]),m=sT(t,a,Math.random),y=sT(t,r),g=sT(t,i),x=sT(t*3,e),w=sT(s===void 0?t*3:t,uMe(s)?s:new Jt(s),()=>1);return Jc(S=>{u.current&&u.current.material&&(u.current.material.time=S.clock.elapsedTime)}),ee.useImperativeHandle(c,()=>u.current,[]),ee.createElement("points",SN({key:`particle-${t}-${JSON.stringify(n)}`},l,{ref:u}),ee.createElement("bufferGeometry",null,ee.createElement("bufferAttribute",{attach:"attributes-position",args:[f,3]}),ee.createElement("bufferAttribute",{attach:"attributes-size",args:[m,1]}),ee.createElement("bufferAttribute",{attach:"attributes-opacity",args:[y,1]}),ee.createElement("bufferAttribute",{attach:"attributes-speed",args:[g,1]}),ee.createElement("bufferAttribute",{attach:"attributes-color",args:[w,3]}),ee.createElement("bufferAttribute",{attach:"attributes-noise",args:[x,3]})),o||ee.createElement("sparklesImplMaterial",{transparent:!0,pixelRatio:h,depthWrite:!1}))});function TTt({pixelated:e}){const t=mx(s=>s.gl),i=mx(s=>s.internal.active),r=mx(s=>s.performance.current),n=mx(s=>s.viewport.initialDpr),a=mx(s=>s.setDpr);return ee.useEffect(()=>{const s=t.domElement;return()=>{i&&a(n),e&&s&&(s.style.imageRendering="auto")}},[]),ee.useEffect(()=>{a(r*n),e&&t.domElement&&(t.domElement.style.imageRendering=r===1?"auto":"pixelated")},[r]),null}function CTt({position:e}){const t=ee.useRef(null),i=ee.useRef(null);return Jc(({clock:r})=>{const n=r.getElapsedTime();if(i.current&&(i.current.rotation.y=Math.sin(n*1.2)*.12),t.current){const a=t.current.material;a.emissiveIntensity=.6+Math.sin(n*3)*.3}}),C.jsx("group",{position:e,children:C.jsx(V0,{speed:1.5,rotationIntensity:.1,floatIntensity:.5,children:C.jsxs("group",{ref:i,children:[C.jsxs("mesh",{children:[C.jsx("boxGeometry",{args:[30,20,2]}),C.jsx("meshStandardMaterial",{color:"#111122",metalness:.5,roughness:.3})]}),C.jsxs("mesh",{ref:t,position:[0,0,1.2],children:[C.jsx("boxGeometry",{args:[26,16,.5]}),C.jsx("meshStandardMaterial",{color:"#22d3ee",emissive:"#22d3ee",emissiveIntensity:.6,transparent:!0,opacity:.85})]})]})})})}function PTt({position:e}){const t=ee.useRef(null),i=ee.useRef(null);Jc(({clock:n})=>{const a=n.getElapsedTime();t.current&&(t.current.rotation.y=.3+Math.sin(a*1.5)*.05),i.current&&(i.current.rotation.y=-.3-Math.sin(a*1.5)*.05)});const r=C.jsx("meshStandardMaterial",{color:"#c4b5fd",emissive:"#8b5cf6",emissiveIntensity:.5});return C.jsx("group",{position:e,children:C.jsxs(V0,{speed:1.5,rotationIntensity:.1,floatIntensity:.5,children:[C.jsx("group",{ref:t,position:[-7,0,0],children:C.jsxs("mesh",{children:[C.jsx("boxGeometry",{args:[12,16,1]}),r]})}),C.jsx("group",{ref:i,position:[7,0,0],children:C.jsxs("mesh",{children:[C.jsx("boxGeometry",{args:[12,16,1]}),r]})}),C.jsxs("mesh",{children:[C.jsx("boxGeometry",{args:[2,16,2]}),C.jsx("meshStandardMaterial",{color:"#1e1b2e"})]})]})})}function DTt({position:e}){const t=ee.useRef(null);Jc(({clock:r})=>{const n=r.getElapsedTime();t.current&&(t.current.visible=Math.sin(n*4)>0,t.current.position.x=-8+n*6%16)});const i=C.jsx("meshStandardMaterial",{color:"#22c55e",emissive:"#22c55e",emissiveIntensity:.6});return C.jsx("group",{position:e,children:C.jsxs(V0,{speed:1.5,rotationIntensity:.1,floatIntensity:.5,children:[C.jsxs("mesh",{children:[C.jsx("boxGeometry",{args:[28,18,2]}),C.jsx("meshStandardMaterial",{color:"#0a0a14"})]}),C.jsxs("mesh",{position:[-11,4,1.2],children:[C.jsx("boxGeometry",{args:[2,2,.5]}),i]}),C.jsxs("mesh",{position:[-2,4,1.2],children:[C.jsx("boxGeometry",{args:[14,1.2,.3]}),i]}),C.jsxs("mesh",{position:[-4,0,1.2],children:[C.jsx("boxGeometry",{args:[10,1.2,.3]}),i]}),C.jsxs("mesh",{ref:t,position:[-8,-4,1.2],children:[C.jsx("boxGeometry",{args:[2,3,.5]}),i]})]})})}function OTt({position:e}){const t=ee.useRef(null);Jc(({clock:r})=>{const n=r.getElapsedTime();t.current&&(t.current.rotation.z=Math.sin(n*1.2)*.4)});const i=C.jsx("meshStandardMaterial",{color:"#3b82f6",emissive:"#3b82f6",emissiveIntensity:.5});return C.jsx("group",{position:e,children:C.jsx(V0,{speed:1.5,rotationIntensity:.1,floatIntensity:.5,children:C.jsxs("group",{ref:t,children:[C.jsxs("mesh",{children:[C.jsx("torusGeometry",{args:[9,2.5,16,32]}),i]}),C.jsxs("mesh",{position:[0,0,0],children:[C.jsx("circleGeometry",{args:[6.5,32]}),C.jsx("meshStandardMaterial",{color:"#3b82f6",emissive:"#3b82f6",emissiveIntensity:.2,transparent:!0,opacity:.3})]}),C.jsxs("mesh",{rotation:[0,0,-Math.PI/4],position:[8,-8,0],children:[C.jsx("cylinderGeometry",{args:[2,1.5,14,8]}),i]})]})})})}function RTt({position:e}){const t=ee.useRef(null),i=ee.useRef(null),r=ee.useRef(null);Jc(({clock:a})=>{const s=a.getElapsedTime();[t,i,r].forEach((l,c)=>{if(l.current){const u=s*3-c*.4,h=Math.max(0,Math.sin(u)),d=Math.pow(2,-5*h)*Math.sin(h*Math.PI*2)+h;l.current.position.y=d*5}})});const n=C.jsx("meshStandardMaterial",{color:"#a855f7",emissive:"#a855f7",emissiveIntensity:.6});return C.jsx("group",{position:e,children:C.jsxs(V0,{speed:1.5,rotationIntensity:.1,floatIntensity:.5,children:[C.jsxs("mesh",{position:[0,-2,-1],children:[C.jsx("boxGeometry",{args:[36,14,1]}),C.jsx("meshStandardMaterial",{color:"#1a0a2e",transparent:!0,opacity:.5})]}),C.jsxs("mesh",{ref:t,position:[-10,0,0],children:[C.jsx("sphereGeometry",{args:[3,16,16]}),n]}),C.jsxs("mesh",{ref:i,position:[0,0,0],children:[C.jsx("sphereGeometry",{args:[3,16,16]}),n]}),C.jsxs("mesh",{ref:r,position:[10,0,0],children:[C.jsx("sphereGeometry",{args:[3,16,16]}),n]})]})})}function ITt({position:e}){const t=ee.useRef(null);Jc(({clock:r})=>{t.current&&(t.current.rotation.z=r.getElapsedTime()*.8)});const i=C.jsx("meshStandardMaterial",{color:"#f97316",emissive:"#f97316",emissiveIntensity:.5});return C.jsx("group",{position:e,children:C.jsxs(V0,{speed:1.5,rotationIntensity:.1,floatIntensity:.5,children:[C.jsxs("mesh",{ref:t,children:[C.jsx("torusGeometry",{args:[10,3,6,8]}),i]}),C.jsxs("mesh",{children:[C.jsx("circleGeometry",{args:[5,32]}),i]})]})})}function NTt({position:e}){const t=ee.useRef(null);return Jc(({clock:i})=>{const r=i.getElapsedTime();if(t.current){t.current.rotation.y=r*.6,t.current.rotation.x=Math.sin(r*.8)*.3;const n=t.current.material;n.emissiveIntensity=.5+Math.sin(r*2)*.4}}),C.jsx("group",{position:e,children:C.jsxs(V0,{speed:1.5,rotationIntensity:.1,floatIntensity:.5,children:[C.jsxs("mesh",{ref:t,children:[C.jsx("octahedronGeometry",{args:[12,0]}),C.jsx("meshStandardMaterial",{color:"#fbbf24",emissive:"#fbbf24",emissiveIntensity:.5,metalness:.4,roughness:.2})]}),C.jsx(fMe,{count:30,size:3,speed:.5,color:"#fbbf24",scale:30})]})})}function LTt({position:e}){const t=ee.useRef(null);Jc(({clock:r})=>{const n=r.getElapsedTime();if(t.current){const a=1+Math.sin(n*3)*.1;t.current.scale.set(a,a,a)}});const i=C.jsx("meshStandardMaterial",{color:"#ef4444",emissive:"#ef4444",emissiveIntensity:.6});return C.jsx("group",{position:e,children:C.jsx(V0,{speed:1.5,rotationIntensity:.1,floatIntensity:.5,children:C.jsxs("group",{ref:t,children:[C.jsxs("mesh",{rotation:[0,0,Math.PI/4],children:[C.jsx("boxGeometry",{args:[4,24,3]}),i]}),C.jsxs("mesh",{rotation:[0,0,-Math.PI/4],children:[C.jsx("boxGeometry",{args:[4,24,3]}),i]})]})})})}function npe(e){const t=1-e;return 1-t*t*t}function ape(e){return e*e*e}const kTt=2,sI=.3,Hw=.7;function zTt({position:e,color:t,onComplete:i}){const r=ee.useRef(null),n=ee.useRef(null),a=ee.useRef(null),s=ee.useRef(null),[o,l]=ee.useState(!1),c=t??"#8b5cf6";return Jc(({clock:u})=>{if(o)return;const h=u.getElapsedTime();s.current===null&&(s.current=h);const d=h-s.current,f=Math.min(d/kTt,1);if(f>=1){l(!0),i==null||i();return}const m=r.current;if(!m)return;let y;if(f<sI){const S=f/sI;y=npe(S)}else if(f<Hw)y=1;else{const S=(f-Hw)/(1-Hw);y=1-ape(S)}m.scale.setScalar(Math.max(y,.001));const g=n.current;g&&(g.rotation.y+=.05,g.rotation.x=Math.sin(d*2)*.3);let x;if(f<sI)x=npe(f/sI)*.8;else if(f<Hw)x=.8;else{const S=(f-Hw)/(1-Hw);x=.8*(1-ape(S))}if(g){const S=g.material;S.opacity=x}const w=a.current;w&&(w.intensity=y*2)}),o?null:C.jsxs("group",{ref:r,position:e,children:[C.jsx(ATt,{ref:n,args:[15,25,32],children:C.jsx("meshStandardMaterial",{color:c,emissive:c,emissiveIntensity:1.5,transparent:!0,opacity:.8,side:2,depthWrite:!1})}),C.jsx(fMe,{count:40,size:3,speed:.5,color:c,scale:[50,50,10]}),C.jsx("pointLight",{ref:a,color:c,intensity:2,distance:100,decay:2})]})}const fm=[0,0,0];function BTt({pose:e}){switch(e){case"coding":return C.jsx(CTt,{position:fm});case"reading":return C.jsx(PTt,{position:fm});case"terminal":return C.jsx(DTt,{position:fm});case"searching":return C.jsx(OTt,{position:fm});case"talking":return C.jsx(RTt,{position:fm});case"managing":return C.jsx(ITt,{position:fm});case"celebrating":return C.jsx(NTt,{position:fm});case"idle":return null;default:return C.jsx(LTt,{position:fm})}}function UTt({agentId:e,pose:t,positionsRef:i,zoom:r}){const n=ee.useRef(null);return Jc(()=>{var c;const a=n.current,s=(c=i.current)==null?void 0:c.get(e);if(!a)return;if(!s){a.visible=!1;return}a.visible=!0,a.position.x+=(s.x-a.position.x)*.15,a.position.y+=(s.y-a.position.y)*.15,a.position.z=0;const l=r*1.8-a.scale.x;if(Math.abs(l)>.001){const u=a.scale.x+l*.2;a.scale.set(u,u,u)}}),C.jsx("group",{ref:n,visible:!1,children:C.jsx(BTt,{pose:t})})}function jTt({agentId:e,positionsRef:t,color:i,onComplete:r}){const n=ee.useRef(null);return Jc(()=>{var o;const a=n.current,s=(o=t.current)==null?void 0:o.get(e);!a||!s||(a.position.x=s.x,a.position.y=s.y,a.position.z=0,a.visible=!0)}),C.jsx("group",{ref:n,visible:!1,children:C.jsx(zTt,{position:fm,color:i,onComplete:r})})}function FTt({containerRef:e,agents:t,zoom:i,spawningAgentIds:r}){const{camera:n,size:a}=mx(),s=ee.useRef(new Map),o=ee.useRef(new Map),l=ee.useRef(0);ee.useEffect(()=>{const u=n;u.left=-a.width/2,u.right=a.width/2,u.top=a.height/2,u.bottom=-a.height/2,u.updateProjectionMatrix()},[n,a]),Jc(()=>{const u=e.current;if(!u||!u.isConnected)return;l.current++;const h=l.current;if(h%30===0||o.current.size===0){o.current.clear();const d=u.querySelectorAll("[data-agent-id]");for(const f of d){const m=f.dataset.agentId;m&&o.current.set(m,f)}}if(h%2===0){const d=u.getBoundingClientRect(),f=d.width/2,m=d.height/2;for(const y of t){if(y.pose==="idle")continue;let g=o.current.get(y.agentId);if(!g||!g.isConnected){const T=u.querySelector(`[data-agent-id="${y.agentId}"]`);if(T)g=T,o.current.set(y.agentId,T);else continue}const x=g.getBoundingClientRect(),w=x.left-d.left+x.width/2,S=x.top-d.top,M=w-f,E=m-S+30*i;s.current.set(y.agentId,{x:M,y:E})}}});const c=ee.useMemo(()=>t.filter(u=>u.pose!=="idle"),[t]);return C.jsxs(C.Fragment,{children:[C.jsx("ambientLight",{intensity:.6}),C.jsx("directionalLight",{position:[100,200,300],intensity:.8}),C.jsx(TTt,{pixelated:!0}),c.map(u=>C.jsx(UTt,{agentId:u.agentId,pose:u.pose,positionsRef:s,zoom:i},u.agentId)),c.filter(u=>r.has(u.agentId)).map(u=>C.jsx(jTt,{agentId:u.agentId,positionsRef:s},`spawn-${u.agentId}`))]})}function VTt({containerRef:e,agents:t,zoom:i,spawningAgentIds:r}){return ee.useMemo(()=>t.some(a=>a.pose!=="idle")||r.size>0,[t,r])?C.jsx(bTt,{orthographic:!0,camera:{position:[0,0,500],zoom:1},gl:{alpha:!0,antialias:!1,powerPreference:"high-performance"},style:{pointerEvents:"none",position:"absolute",inset:"0",zIndex:15},frameloop:"always",children:C.jsx(FTt,{containerRef:e,agents:t,zoom:i,spawningAgentIds:r})}):null}const HTt=new Set(["working","moving","talking","error"]),GTt=new Set(["idle","shutdown","completed"]),WTt=new Set(["coding","reading","terminal","talking","searching","managing"]);function qTt(e){return HTt.has(e.animationState)?!0:GTt.has(e.animationState)?!1:WTt.has(e.pose)}function XTt({positions:e,agentMeta:t}){return ee.useMemo(()=>{const i=[],r=[],n=[],a=[];for(const m of e.values())qTt(m)?n.push(m):a.push(m);const s=new Set(n.map(m=>m.agentId)),o=new Map,l=[];for(const m of n){const y=m.parentAgentId;if(!y||!s.has(y))l.push(m);else{const g=o.get(y)??[];g.push(m),o.set(y,g)}}const u=n.length<=1,h=l.length,f=-((h-1)*fH)/2;for(let m=0;m<h;m++){const y=l[m],g=t.get(y.agentId),x=h===1?0:f+m*fH;i.push({agentId:y.agentId,position:[x,0,0],modelType:"main",color:(g==null?void 0:g.color)??"#8b5cf6",name:(g==null?void 0:g.name)??y.agentId,type:(g==null?void 0:g.type)??"general-purpose",pose:y.pose,animationState:y.animationState,activityLabel:y.activityLabel,lastTool:y.lastTool,parentAgentId:y.parentAgentId});const w=o.get(y.agentId)??[],S=fH*.8,M=(w.length-1)*S,E=x-M/2;for(let T=0;T<w.length;T++){const R=w[T],P=t.get(R.agentId),I=w.length===1?x:E+T*S;i.push({agentId:R.agentId,position:[I,0,3],modelType:u?"main":"sub",color:(P==null?void 0:P.color)??"#8b5cf6",name:(P==null?void 0:P.name)??R.agentId,type:(P==null?void 0:P.type)??"general-purpose",pose:R.pose,animationState:R.animationState,activityLabel:R.activityLabel,lastTool:R.lastTool,parentAgentId:R.parentAgentId})}}for(const m of a){const y=t.get(m.agentId);r.push({agentId:m.agentId,position:[0,0,0],modelType:m.parentAgentId?"sub":"main",color:(y==null?void 0:y.color)??"#8b5cf6",name:(y==null?void 0:y.name)??m.agentId,type:(y==null?void 0:y.type)??"general-purpose",pose:m.pose,animationState:m.animationState,activityLabel:m.activityLabel,lastTool:m.lastTool,parentAgentId:m.parentAgentId})}return{active:i,inactive:r}},[e,t])}const spe={zoom:1,panX:0,panY:0};function YTt(e){const[t,i]=ee.useState(spe),[r,n]=ee.useState(!1),a=ee.useRef(t);a.current=t;const s=ee.useRef(!1),o=ee.useRef({x:0,y:0,panX:0,panY:0});ee.useEffect(()=>{const h=e.current;if(!h)return;function d(f){if(Math.abs(f.deltaX)>Math.abs(f.deltaY))return;f.preventDefault();const m=h.getBoundingClientRect(),y=f.clientX-m.left,g=f.clientY-m.top;i(x=>{const w=1-f.deltaY*.001,S=Math.round(Math.min(cyt,Math.max(lyt,x.zoom*w))*100)/100;if(S===x.zoom)return x;const M=S/x.zoom,E=y-M*(y-x.panX),T=g-M*(g-x.panY);return{zoom:S,panX:E,panY:T}})}return h.addEventListener("wheel",d,{passive:!1}),()=>h.removeEventListener("wheel",d)},[e]);const l=ee.useCallback(h=>{const d=h.target.closest("[data-agent-id]");if(h.button===0&&d||h.button!==0&&h.button!==1)return;s.current=!0,n(!0);const f=a.current;o.current={x:h.clientX,y:h.clientY,panX:f.panX,panY:f.panY},h.preventDefault()},[]);ee.useEffect(()=>{function h(f){if(!s.current)return;const m=f.clientX-o.current.x,y=f.clientY-o.current.y;i({zoom:a.current.zoom,panX:o.current.panX+m,panY:o.current.panY+y})}function d(){s.current&&(s.current=!1,n(!1))}return window.addEventListener("mousemove",h),window.addEventListener("mouseup",d),()=>{window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",d)}},[]);const c=ee.useCallback(()=>{i(spe)},[]),u=`translate(${t.panX}px, ${t.panY}px) scale(${t.zoom})`;return{zoom:t.zoom,panX:t.panX,panY:t.panY,isPanning:r,transformStyle:u,handleMouseDown:l,reset:c}}const F7=160,pMe=2,ope=F7*pMe,$Tt={default:{accent:"#8b5cf6",text:"text-violet-400"},warning:{accent:"#f59e0b",text:"text-amber-400"},error:{accent:"#ef4444",text:"text-red-400"},success:{accent:"#22c55e",text:"text-emerald-400"},pulse:{accent:"#10b981",text:"text-emerald-400"}};function KTt({title:e,subtitle:t,variant:i="default",children:r}){const[n,a]=ee.useState(!0),s=ee.useRef(null),o=$Tt[i],l=ee.useCallback(c=>{var h,d;const u=c;try{const f=(h=u._renderer)==null?void 0:h.pipeline;f!=null&&f.logoOverlayPass&&(f.logoOverlayPass.enabled=!1),f==null||f.setWatermark(null)}catch{}try{(d=u.play)==null||d.call(u)}catch{}a(!1)},[]);return ee.useEffect(()=>{if(n)return;const c=s.current;if(!c)return;const u=c.querySelector("canvas");if(!u)return;let h=!1;function d(){h=!0}function f(){h=!1}function m(y){h||u.dispatchEvent(new PointerEvent("pointermove",{clientX:y.clientX,clientY:y.clientY,pointerId:1,pointerType:"mouse",bubbles:!1}))}return u.addEventListener("pointerenter",d),u.addEventListener("pointerleave",f),window.addEventListener("pointermove",m),()=>{u.removeEventListener("pointerenter",d),u.removeEventListener("pointerleave",f),window.removeEventListener("pointermove",m)}},[n]),C.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-5 px-6",children:[C.jsxs("div",{ref:s,className:"relative overflow-hidden shrink-0",style:{width:F7,height:F7},children:[n&&C.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:C.jsx("div",{className:"w-8 h-8 border-2 rounded-full animate-spin",style:{borderColor:`${o.accent}30`,borderTopColor:"transparent"}})}),C.jsx("div",{style:{width:ope,height:ope,transform:`scale(${1/pMe})`,transformOrigin:"top left"},children:C.jsx($_e,{scene:K_e.main,onLoad:l,style:{width:"100%",height:"100%",opacity:n?0:1,transition:"opacity 0.5s ease-in"}})}),!n&&C.jsx("div",{className:"absolute inset-[-6px] rounded-2xl pointer-events-none transition-all duration-700",style:{boxShadow:`0 0 20px ${o.accent}25, 0 0 40px ${o.accent}10`}})]}),C.jsxs("div",{className:"flex flex-col items-center gap-2 max-w-sm text-center",children:[C.jsx("h3",{className:`${o.text} text-sm font-mono font-semibold`,children:e}),t&&C.jsx("p",{className:"text-zinc-500 text-xs font-mono leading-relaxed",children:t}),r]})]})}function pG({n:e,children:t}){return C.jsxs("div",{className:"flex items-start gap-2.5",children:[C.jsx("span",{className:"shrink-0 w-5 h-5 rounded-full flex items-center justify-center text-[10px] font-mono font-bold bg-violet-500/15 text-violet-400",children:e}),C.jsx("span",{className:"text-zinc-400 text-xs font-mono pt-0.5 leading-relaxed",children:t})]})}function MK(){Dye();const e=ee.useRef(null),t=Ni(Z=>Z.session),i=Ni(Z=>Z.agents),r=Ni(Z=>Z.selectedAgentId),n=Ni(Z=>Z.selectAgent),{positions:a,speechBubbles:s,interactionLines:o,showLabels:l,showInteractions:c}=C_(),{zoom:u,transformStyle:h,isPanning:d,handleMouseDown:f,reset:m}=YTt(e),[y,g]=ee.useState(null),[x,w]=ee.useState(new Map),S=ee.useRef({agentId:null,mouseX:0,mouseY:0,agentX:0,agentY:0}),M=ee.useRef(u);M.current=u;const E=ee.useMemo(()=>{const Z=new Map;for(const ce of i)Z.set(ce.id,Ch(ce.id,ce.name||ce.id,ce.type??void 0));return Z},[i]),T=ee.useMemo(()=>{const Z=new Map;for(const ce of i){const me=jHe(ce.name||ce.id);Z.set(ce.id,me.primary)}return Z},[i]),R=ee.useMemo(()=>{const Z=new Map;for(const ce of i)Z.set(ce.id,ce.type);return Z},[i]),P=ee.useMemo(()=>{const Z=new Map;for(const ce of i)Z.set(ce.id,{name:E.get(ce.id)??ce.id,type:R.get(ce.id)??"general-purpose",color:T.get(ce.id)??"#8b5cf6",status:ce.status});return Z},[i,E,R,T]),{active:I,inactive:L}=XTt({positions:a,agentMeta:P}),z=ee.useMemo(()=>{const Z=new Map;for(const ce of s){const me=Z.get(ce.fromAgentId)??[];me.push(ce),Z.set(ce.fromAgentId,me)}return Z},[s]),U=ee.useCallback(Z=>{n(r===Z?null:Z)},[n,r]),j=I.length>0?I:[{agentId:"claude-main",position:[0,0,0],modelType:"main",color:"#8b5cf6",name:"Claude",type:"general-purpose",pose:"idle",animationState:"idle",activityLabel:null,lastTool:null,parentAgentId:null}],F=ee.useMemo(()=>j.map(Z=>Z.agentId).join(","),[j]),[G,H]=ee.useState({w:1200,h:600}),W=ee.useMemo(()=>{const{w:Z,h:ce}=G,me=j.length,he=me*H_+(me-1)*cde,we=(Z-he)/2,Ee=(ce-uyt)/2,Se=new Map;for(let Ne=0;Ne<me;Ne++)Se.set(j[Ne].agentId,{x:Math.max(0,we+Ne*(H_+cde)),y:Math.max(0,Ee)});return Se},[F,G,j]);ee.useEffect(()=>{const Z=e.current;if(!Z)return;const ce=new ResizeObserver(me=>{const{width:he,height:we}=me[0].contentRect;he>0&&we>0&&H({w:he,h:we})});return ce.observe(Z),()=>ce.disconnect()},[]),ee.useEffect(()=>{const Z=new Set(j.map(ce=>ce.agentId));w(ce=>{let me=!1;for(const we of ce.keys())Z.has(we)||(me=!0);if(!me)return ce;const he=new Map;for(const[we,Ee]of ce)Z.has(we)&&he.set(we,Ee);return he})},[F,j]);const Q=ee.useCallback(Z=>x.get(Z)??W.get(Z)??{x:0,y:0},[x,W]),ne=ee.useCallback((Z,ce)=>{if(ce.button!==0)return;ce.stopPropagation();const me=Q(Z);S.current={agentId:Z,mouseX:ce.clientX,mouseY:ce.clientY,agentX:me.x,agentY:me.y},g(Z)},[Q]);ee.useEffect(()=>{function Z(me){const he=S.current;if(!he.agentId)return;const we=M.current,Ee=(me.clientX-he.mouseX)/we,Se=(me.clientY-he.mouseY)/we;w(Ne=>{const Pe=new Map(Ne);return Pe.set(he.agentId,{x:he.agentX+Ee,y:he.agentY+Se}),Pe})}function ce(){S.current.agentId&&(S.current.agentId=null,g(null))}return window.addEventListener("mousemove",Z),window.addEventListener("mouseup",ce),()=>{window.removeEventListener("mousemove",Z),window.removeEventListener("mouseup",ce)}},[]);const se=ee.useMemo(()=>j.map(Z=>({agentId:Z.agentId,pose:Z.pose})),[j]),$=ee.useRef(new Set),[J,ae]=ee.useState(new Set);ee.useEffect(()=>{const Z=new Set(j.map(he=>he.agentId)),ce=$.current,me=new Set;for(const he of Z)ce.has(he)||me.add(he);if($.current=Z,me.size>0){ae(me);const he=setTimeout(()=>ae(new Set),1500);return()=>clearTimeout(he)}},[F,j]);const oe=ee.useCallback(Z=>{Z.target.closest("[data-agent-id]")||m()},[m]),xe=y||d?"grabbing":"default";return t?C.jsxs("div",{className:"flex flex-col h-full overflow-hidden relative",children:[C.jsx($ae,{}),C.jsxs("div",{ref:e,className:"flex-1 relative overflow-hidden",style:{background:"radial-gradient(ellipse at center, #0f0f1a 0%, #0a0a12 70%)",minHeight:0,cursor:xe},onMouseDown:f,onDoubleClick:oe,children:[C.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:["linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px)","linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px)"].join(","),backgroundSize:`${40*u}px ${40*u}px`}}),C.jsx("div",{className:"absolute inset-0",style:{transform:h,transformOrigin:"0 0",willChange:y||d?"transform":"auto"},children:j.map(Z=>{const ce=Q(Z.agentId),me=y===Z.agentId,he=z.get(Z.agentId)??[],we=he.length>0?he[he.length-1]:null;return C.jsxs("div",{"data-agent-id":Z.agentId,className:`absolute flex flex-col items-center${J.has(Z.agentId)?" cam-agent-spawning":""}`,style:{left:`${ce.x}px`,top:`${ce.y}px`,width:`${H_}px`,zIndex:me?50:10,cursor:me?"grabbing":"grab",transition:me?"none":"left 0.3s ease, top 0.3s ease",userSelect:"none"},onMouseDown:Ee=>ne(Z.agentId,Ee),children:[we&&C.jsx("div",{className:"mb-2 max-w-[280px]",children:C.jsx(Z_e,{bubble:we,color:Z.color},we.id)}),C.jsx(fyt,{modelType:Z.modelType,isSelected:r===Z.agentId,isDragging:y===Z.agentId,onClick:()=>U(Z.agentId),color:Z.color,pose:Z.pose,animationState:Z.animationState}),C.jsx(byt,{agentId:Z.agentId,name:Z.name,color:Z.color,activityLabel:Z.activityLabel,speechBubbles:he,showLabels:l,hideBubble:!0})]},Z.agentId)})}),C.jsx(VTt,{containerRef:e,agents:se,zoom:u,spawningAgentIds:J}),C.jsx(Syt,{containerRef:e,interactionLines:o,positions:a,agentColors:T,showInteractions:c}),u!==1&&C.jsxs("div",{className:"absolute bottom-3 right-3 z-30 text-xs font-mono text-zinc-500 bg-black/50 px-2 py-1 rounded select-none pointer-events-none",children:[Math.round(u*100),"%"]})]}),C.jsx(wyt,{agents:L,selectedAgentId:r,onSelectAgent:U})]}):C.jsxs("div",{className:"flex flex-col h-full overflow-hidden relative",children:[C.jsx($ae,{}),C.jsxs("div",{className:"flex-1 relative overflow-hidden flex items-center justify-center",style:{background:"radial-gradient(ellipse at center, #0f0f1a 0%, #0a0a12 70%)"},children:[C.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:["linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px)","linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px)"].join(","),backgroundSize:"40px 40px"}}),C.jsxs(KTt,{title:"Welcome to CAM!",subtitle:"Start a Claude Code session to see your agents here in real-time.",variant:"default",children:[C.jsxs("div",{className:"flex flex-col gap-2 mt-3 text-left",children:[C.jsx(pG,{n:1,children:"Open a terminal in this project"}),C.jsxs(pG,{n:2,children:["Run ",C.jsx("code",{className:"px-1.5 py-0.5 rounded bg-zinc-800 text-violet-300 text-[11px] font-mono",children:"claude"})," to start Claude Code"]}),C.jsx(pG,{n:3,children:"Agents will appear here as they work"})]}),C.jsx("p",{className:"text-zinc-600 text-[10px] font-mono mt-3",children:"Or select a previous session from the picker above"})]})]})]})}const QTt=[{id:"overview",label:"Overview"},{id:"dependencies",label:"Deps"},{id:"activity",label:"Activity"}];function EK(){const{selectedTaskId:e,tasks:t,selectTask:i,sprints:r,activeProject:n}=_n(),a=oz(),[s,o]=ee.useState("overview"),[l,c]=ee.useState([]),[u,h]=ee.useState(!1),d=t.find(S=>S.id===e);if(ee.useEffect(()=>{s==="activity"&&d&&n&&(h(!0),KEe(n.id,d.id).then(S=>c(S.activities??[])).catch(()=>c([])).finally(()=>h(!1)))},[s,d==null?void 0:d.id,n==null?void 0:n.id]),!d)return null;const f=r.find(S=>S.id===d.sprintId),m=G7(d.priority),y=FEe(d.status),g=d.dependsOn.map(S=>t.find(M=>M.id===S)).filter(S=>S!==void 0),x=d.blockedBy.map(S=>t.find(M=>M.id===S)).filter(S=>S!==void 0),w=t.filter(S=>S.dependsOn.includes(d.id)||S.blockedBy.includes(d.id));return C.jsxs("div",{className:"h-full flex flex-col",children:[C.jsxs("div",{className:"p-4 border-b border-cam-border/30 shrink-0",children:[C.jsxs("div",{className:"flex items-start justify-between mb-3",children:[C.jsx("h3",{className:"text-sm font-semibold text-cam-text leading-tight flex-1 pr-2",children:d.title}),C.jsx("button",{onClick:()=>i(null),className:"text-cam-text-muted hover:text-cam-text transition-colors p-1 shrink-0",children:C.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),C.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-3",children:[C.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded border font-medium ${m}`,children:d.priority}),C.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded font-medium ${y}`,children:d.status.replace(/_/g," ")}),d.complexity&&C.jsxs("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-cam-surface-3 text-cam-text-muted border border-cam-border/50",children:["C",d.complexity]})]}),C.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[f&&C.jsxs("div",{className:"bg-cam-surface-2 rounded-md px-2 py-1.5",children:[C.jsx("div",{className:"text-[9px] text-cam-text-muted",children:"Sprint"}),C.jsx("div",{className:"text-[10px] text-cam-text font-medium truncate",children:f.name})]}),d.prdSection&&C.jsxs("div",{className:"bg-cam-surface-2 rounded-md px-2 py-1.5",children:[C.jsx("div",{className:"text-[9px] text-cam-text-muted",children:"Section"}),C.jsx("div",{className:"text-[10px] text-cam-text font-medium truncate",children:d.prdSection})]}),d.assignedAgent&&(()=>{const S=a(d.assignedAgent);return C.jsxs("div",{className:"bg-cam-surface-2 rounded-md px-2 py-1.5",children:[C.jsx("div",{className:"text-[9px] text-cam-text-muted",children:"Agent"}),C.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[C.jsx("div",{className:"w-3 h-3 rounded-full flex items-center justify-center text-[7px] font-bold",style:{backgroundColor:`${f0(d.assignedAgent)}20`,color:f0(d.assignedAgent)},children:S.charAt(0).toUpperCase()}),C.jsx("span",{className:"text-[10px] text-cam-text font-medium",children:S})]})]})})()]})]}),C.jsx("div",{className:"flex border-b border-cam-border/30 shrink-0",children:QTt.map(S=>{const M=S.id==="dependencies"?g.length+x.length+w.length:S.id==="activity"?l.length:0;return C.jsxs("button",{onClick:()=>o(S.id),className:`flex-1 py-2 text-[10px] font-medium transition-colors border-b-2 ${s===S.id?"text-cam-accent border-cam-accent":"text-cam-text-muted border-transparent hover:text-cam-text-secondary"}`,children:[S.label,M>0&&` (${M})`]},S.id)})}),C.jsxs("div",{className:"flex-1 overflow-y-auto modern-scrollbar",children:[s==="overview"&&C.jsx(ZTt,{task:d}),s==="dependencies"&&C.jsx(JTt,{dependsOn:g,blockedBy:x,blocks:w,onSelectTask:i,resolveAgentName:a}),s==="activity"&&C.jsx(tCt,{activities:l,loading:u,resolveAgentName:a})]})]})}function ZTt({task:e}){return C.jsxs("div",{className:"p-3 space-y-4",children:[e.description&&C.jsxs("div",{children:[C.jsx("h4",{className:"text-[10px] uppercase tracking-wider text-cam-text-muted font-medium mb-1",children:"Description"}),C.jsx("p",{className:"text-[11px] text-cam-text-secondary leading-relaxed",children:e.description})]}),e.acceptanceCriteria&&e.acceptanceCriteria.length>0&&C.jsxs("div",{children:[C.jsx("h4",{className:"text-[10px] uppercase tracking-wider text-cam-text-muted font-medium mb-1",children:"Acceptance Criteria"}),C.jsx("ul",{className:"space-y-1",children:e.acceptanceCriteria.map((t,i)=>C.jsxs("li",{className:"flex items-start gap-1.5 text-[11px] text-cam-text-secondary",children:[C.jsx("span",{className:"text-cam-accent mt-0.5 shrink-0",children:e.status==="completed"?"✓":"○"}),C.jsx("span",{children:t})]},i))})]}),e.tags&&e.tags.length>0&&C.jsxs("div",{children:[C.jsx("h4",{className:"text-[10px] uppercase tracking-wider text-cam-text-muted font-medium mb-1",children:"Tags"}),C.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map(t=>C.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-cam-surface-3 text-cam-text-muted border border-cam-border/30",children:t},t))})]}),C.jsxs("div",{children:[C.jsx("h4",{className:"text-[10px] uppercase tracking-wider text-cam-text-muted font-medium mb-1",children:"Timeline"}),C.jsxs("div",{className:"space-y-1 text-[10px]",children:[C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-cam-text-muted",children:"Created"}),C.jsx("span",{className:"text-cam-text-secondary font-mono",children:qc(e.createdAt)})]}),e.startedAt&&C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-cam-text-muted",children:"Started"}),C.jsx("span",{className:"text-cam-text-secondary font-mono",children:qc(e.startedAt)})]}),e.completedAt&&C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-cam-text-muted",children:"Completed"}),C.jsx("span",{className:"text-cam-text-secondary font-mono",children:qc(e.completedAt)})]})]})]})]})}function JTt({dependsOn:e,blockedBy:t,blocks:i,onSelectTask:r,resolveAgentName:n}){return e.length===0&&t.length===0&&i.length===0?C.jsx("p",{className:"text-xs text-cam-text-muted p-4 text-center",children:"No dependencies"}):C.jsxs("div",{className:"p-3 space-y-4",children:[t.length>0&&C.jsx(mG,{title:"Blocked By",tasks:t,color:"text-red-400",onSelect:r,resolveAgentName:n}),e.length>0&&C.jsx(mG,{title:"Depends On",tasks:e,color:"text-yellow-400",onSelect:r,resolveAgentName:n}),i.length>0&&C.jsx(mG,{title:"Blocks",tasks:i,color:"text-blue-400",onSelect:r,resolveAgentName:n})]})}function mG({title:e,tasks:t,color:i,onSelect:r,resolveAgentName:n}){return C.jsxs("div",{children:[C.jsxs("h4",{className:`text-[10px] uppercase tracking-wider font-medium mb-1 ${i}`,children:[e," (",t.length,")"]}),C.jsx("div",{className:"space-y-1",children:t.map(a=>C.jsxs("button",{onClick:()=>r(a.id),className:"w-full text-left px-2 py-1.5 rounded hover:bg-cam-surface-2 transition-colors group",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${eCt(a.status)}`}),C.jsx("span",{className:"text-[11px] text-cam-text-secondary group-hover:text-cam-text truncate",children:a.title})]}),C.jsxs("div",{className:"flex items-center gap-2 ml-3.5 mt-0.5",children:[C.jsx("span",{className:"text-[9px] text-cam-text-muted capitalize",children:a.status.replace(/_/g," ")}),a.assignedAgent&&C.jsxs("span",{className:"text-[9px] text-cam-text-muted",children:["@",n(a.assignedAgent)]})]})]},a.id))})]})}function eCt(e){return{backlog:"bg-gray-500",planned:"bg-blue-500",pending:"bg-yellow-500",in_progress:"bg-emerald-500",in_review:"bg-purple-500",completed:"bg-green-500",blocked:"bg-red-500",deferred:"bg-gray-500"}[e]||"bg-gray-500"}function tCt({activities:e,loading:t,resolveAgentName:i}){return t?C.jsx("div",{className:"flex items-center justify-center p-4",children:C.jsx("span",{className:"text-[10px] text-cam-text-muted animate-pulse",children:"Loading activities..."})}):e.length===0?C.jsx("p",{className:"text-xs text-cam-text-muted p-4 text-center",children:"No activity recorded"}):C.jsx("div",{className:"divide-y divide-cam-border/20",children:e.map(r=>C.jsxs("div",{className:"px-3 py-2",children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("span",{className:"text-[11px] font-medium text-cam-accent",children:iCt(r.activityType)}),C.jsx("span",{className:"text-[9px] text-cam-text-muted font-mono",children:gu(r.timestamp)})]}),C.jsx("div",{className:"flex items-center gap-2 mt-0.5",children:C.jsxs("span",{className:"text-[9px] text-cam-text-muted",children:["@",i(r.agentId)]})}),r.details&&C.jsx("p",{className:"text-[10px] text-cam-text-secondary mt-0.5",children:r.details})]},r.id))})}function iCt(e){return{task_created:"Task Created",task_started:"Task Started",task_completed:"Task Completed",task_blocked:"Task Blocked",task_unblocked:"Task Unblocked",agent_assigned:"Agent Assigned",file_modified:"File Modified",error_occurred:"Error Occurred",manual_update:"Manual Update"}[e]||e.replace(/_/g," ")}const tU=ee.createContext(null);tU.displayName="PanelGroupContext";const Ha={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},TK=10,$x=ee.useLayoutEffect,lpe=PEe.useId,rCt=typeof lpe=="function"?lpe:()=>null;let nCt=0;function CK(e=null){const t=rCt(),i=ee.useRef(e||t||null);return i.current===null&&(i.current=""+nCt++),e??i.current}function mMe({children:e,className:t="",collapsedSize:i,collapsible:r,defaultSize:n,forwardedRef:a,id:s,maxSize:o,minSize:l,onCollapse:c,onExpand:u,onResize:h,order:d,style:f,tagName:m="div",...y}){const g=ee.useContext(tU);if(g===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:w,getPanelSize:S,getPanelStyle:M,groupId:E,isPanelCollapsed:T,reevaluatePanelConstraints:R,registerPanel:P,resizePanel:I,unregisterPanel:L}=g,z=CK(s),U=ee.useRef({callbacks:{onCollapse:c,onExpand:u,onResize:h},constraints:{collapsedSize:i,collapsible:r,defaultSize:n,maxSize:o,minSize:l},id:z,idIsFromProps:s!==void 0,order:d});ee.useRef({didLogMissingDefaultSizeWarning:!1}),$x(()=>{const{callbacks:F,constraints:G}=U.current,H={...G};U.current.id=z,U.current.idIsFromProps=s!==void 0,U.current.order=d,F.onCollapse=c,F.onExpand=u,F.onResize=h,G.collapsedSize=i,G.collapsible=r,G.defaultSize=n,G.maxSize=o,G.minSize=l,(H.collapsedSize!==G.collapsedSize||H.collapsible!==G.collapsible||H.maxSize!==G.maxSize||H.minSize!==G.minSize)&&R(U.current,H)}),$x(()=>{const F=U.current;return P(F),()=>{L(F)}},[d,z,P,L]),ee.useImperativeHandle(a,()=>({collapse:()=>{x(U.current)},expand:F=>{w(U.current,F)},getId(){return z},getSize(){return S(U.current)},isCollapsed(){return T(U.current)},isExpanded(){return!T(U.current)},resize:F=>{I(U.current,F)}}),[x,w,S,T,z,I]);const j=M(U.current,n);return ee.createElement(m,{...y,children:e,className:t,id:z,style:{...j,...f},[Ha.groupId]:E,[Ha.panel]:"",[Ha.panelCollapsible]:r||void 0,[Ha.panelId]:z,[Ha.panelSize]:parseFloat(""+j.flexGrow).toFixed(1)})}const gMe=ee.forwardRef((e,t)=>ee.createElement(mMe,{...e,forwardedRef:t}));mMe.displayName="Panel";gMe.displayName="forwardRef(Panel)";let V7=null,II=-1,jv=null;function aCt(e,t){if(t){const i=(t&wMe)!==0,r=(t&_Me)!==0,n=(t&SMe)!==0,a=(t&AMe)!==0;if(i)return n?"se-resize":a?"ne-resize":"e-resize";if(r)return n?"sw-resize":a?"nw-resize":"w-resize";if(n)return"s-resize";if(a)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function sCt(){jv!==null&&(document.head.removeChild(jv),V7=null,jv=null,II=-1)}function gG(e,t){var i,r;const n=aCt(e,t);if(V7!==n){if(V7=n,jv===null&&(jv=document.createElement("style"),document.head.appendChild(jv)),II>=0){var a;(a=jv.sheet)===null||a===void 0||a.removeRule(II)}II=(i=(r=jv.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${n} !important;}`))!==null&&i!==void 0?i:-1}}function vMe(e){return e.type==="keydown"}function yMe(e){return e.type.startsWith("pointer")}function xMe(e){return e.type.startsWith("mouse")}function iU(e){if(yMe(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(xMe(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function oCt(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function lCt(e,t,i){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function cCt(e,t){if(e===t)throw new Error("Cannot compare node with itself");const i={a:hpe(e),b:hpe(t)};let r;for(;i.a.at(-1)===i.b.at(-1);)e=i.a.pop(),t=i.b.pop(),r=e;br(r,"Stacking order can only be calculated for elements with a common ancestor");const n={a:upe(cpe(i.a)),b:upe(cpe(i.b))};if(n.a===n.b){const a=r.childNodes,s={a:i.a.at(-1),b:i.b.at(-1)};let o=a.length;for(;o--;){const l=a[o];if(l===s.a)return 1;if(l===s.b)return-1}}return Math.sign(n.a-n.b)}const uCt=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function hCt(e){var t;const i=getComputedStyle((t=bMe(e))!==null&&t!==void 0?t:e).display;return i==="flex"||i==="inline-flex"}function dCt(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||hCt(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||uCt.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function cpe(e){let t=e.length;for(;t--;){const i=e[t];if(br(i,"Missing node"),dCt(i))return i}return null}function upe(e){return e&&Number(getComputedStyle(e).zIndex)||0}function hpe(e){const t=[];for(;e;)t.push(e),e=bMe(e);return t}function bMe(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const wMe=1,_Me=2,SMe=4,AMe=8,fCt=oCt()==="coarse";let Ed=[],q_=!1,gx=new Map,rU=new Map;const qP=new Set;function pCt(e,t,i,r,n){var a;const{ownerDocument:s}=t,o={direction:i,element:t,hitAreaMargins:r,setResizeHandlerState:n},l=(a=gx.get(s))!==null&&a!==void 0?a:0;return gx.set(s,l+1),qP.add(o),Qk(),function(){var u;rU.delete(e),qP.delete(o);const h=(u=gx.get(s))!==null&&u!==void 0?u:1;if(gx.set(s,h-1),Qk(),h===1&&gx.delete(s),Ed.includes(o)){const d=Ed.indexOf(o);d>=0&&Ed.splice(d,1),DK(),n("up",!0,null)}}}function mCt(e){const{target:t}=e,{x:i,y:r}=iU(e);q_=!0,PK({target:t,x:i,y:r}),Qk(),Ed.length>0&&(Zk("down",e),e.preventDefault(),MMe(t)||e.stopImmediatePropagation())}function vG(e){const{x:t,y:i}=iU(e);if(q_&&e.buttons===0&&(q_=!1,Zk("up",e)),!q_){const{target:r}=e;PK({target:r,x:t,y:i})}Zk("move",e),DK(),Ed.length>0&&e.preventDefault()}function yG(e){const{target:t}=e,{x:i,y:r}=iU(e);rU.clear(),q_=!1,Ed.length>0&&(e.preventDefault(),MMe(t)||e.stopImmediatePropagation()),Zk("up",e),PK({target:t,x:i,y:r}),DK(),Qk()}function MMe(e){let t=e;for(;t;){if(t.hasAttribute(Ha.resizeHandle))return!0;t=t.parentElement}return!1}function PK({target:e,x:t,y:i}){Ed.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),qP.forEach(n=>{const{element:a,hitAreaMargins:s}=n,o=a.getBoundingClientRect(),{bottom:l,left:c,right:u,top:h}=o,d=fCt?s.coarse:s.fine;if(t>=c-d&&t<=u+d&&i>=h-d&&i<=l+d){if(r!==null&&document.contains(r)&&a!==r&&!a.contains(r)&&!r.contains(a)&&cCt(r,a)>0){let m=r,y=!1;for(;m&&!m.contains(a);){if(lCt(m.getBoundingClientRect(),o)){y=!0;break}m=m.parentElement}if(y)return}Ed.push(n)}})}function xG(e,t){rU.set(e,t)}function DK(){let e=!1,t=!1;Ed.forEach(r=>{const{direction:n}=r;n==="horizontal"?e=!0:t=!0});let i=0;rU.forEach(r=>{i|=r}),e&&t?gG("intersection",i):e?gG("horizontal",i):t?gG("vertical",i):sCt()}let bG=new AbortController;function Qk(){bG.abort(),bG=new AbortController;const e={capture:!0,signal:bG.signal};qP.size&&(q_?(Ed.length>0&&gx.forEach((t,i)=>{const{body:r}=i;t>0&&(r.addEventListener("contextmenu",yG,e),r.addEventListener("pointerleave",vG,e),r.addEventListener("pointermove",vG,e))}),window.addEventListener("pointerup",yG,e),window.addEventListener("pointercancel",yG,e)):gx.forEach((t,i)=>{const{body:r}=i;t>0&&(r.addEventListener("pointerdown",mCt,e),r.addEventListener("pointermove",vG,e))}))}function Zk(e,t){qP.forEach(i=>{const{setResizeHandlerState:r}=i,n=Ed.includes(i);r(e,n,t)})}function gCt(){const[e,t]=ee.useState(0);return ee.useCallback(()=>t(i=>i+1),[])}function br(e,t){if(!e)throw console.error(t),Error(t)}function gb(e,t,i=TK){return e.toFixed(i)===t.toFixed(i)?0:e>t?1:-1}function Mm(e,t,i=TK){return gb(e,t,i)===0}function hu(e,t,i){return gb(e,t,i)===0}function vCt(e,t,i){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const n=e[r],a=t[r];if(!hu(n,a,i))return!1}return!0}function S_({panelConstraints:e,panelIndex:t,size:i}){const r=e[t];br(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:n=0,collapsible:a,maxSize:s=100,minSize:o=0}=r;if(gb(i,o)<0)if(a){const l=(n+o)/2;gb(i,l)<0?i=n:i=o}else i=o;return i=Math.min(s,i),i=parseFloat(i.toFixed(TK)),i}function CT({delta:e,initialLayout:t,panelConstraints:i,pivotIndices:r,prevLayout:n,trigger:a}){if(hu(e,0))return t;const s=[...t],[o,l]=r;br(o!=null,"Invalid first pivot index"),br(l!=null,"Invalid second pivot index");let c=0;if(a==="keyboard"){{const h=e<0?l:o,d=i[h];br(d,`Panel constraints not found for index ${h}`);const{collapsedSize:f=0,collapsible:m,minSize:y=0}=d;if(m){const g=t[h];if(br(g!=null,`Previous layout not found for panel index ${h}`),hu(g,f)){const x=y-g;gb(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const h=e<0?o:l,d=i[h];br(d,`No panel constraints found for index ${h}`);const{collapsedSize:f=0,collapsible:m,minSize:y=0}=d;if(m){const g=t[h];if(br(g!=null,`Previous layout not found for panel index ${h}`),hu(g,y)){const x=g-f;gb(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}}{const h=e<0?1:-1;let d=e<0?l:o,f=0;for(;;){const y=t[d];br(y!=null,`Previous layout not found for panel index ${d}`);const x=S_({panelConstraints:i,panelIndex:d,size:100})-y;if(f+=x,d+=h,d<0||d>=i.length)break}const m=Math.min(Math.abs(e),Math.abs(f));e=e<0?0-m:m}{let d=e<0?o:l;for(;d>=0&&d<i.length;){const f=Math.abs(e)-Math.abs(c),m=t[d];br(m!=null,`Previous layout not found for panel index ${d}`);const y=m-f,g=S_({panelConstraints:i,panelIndex:d,size:y});if(!hu(m,g)&&(c+=m-g,s[d]=g,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?d--:d++}}if(vCt(n,s))return n;{const h=e<0?l:o,d=t[h];br(d!=null,`Previous layout not found for panel index ${h}`);const f=d+c,m=S_({panelConstraints:i,panelIndex:h,size:f});if(s[h]=m,!hu(m,f)){let y=f-m,x=e<0?l:o;for(;x>=0&&x<i.length;){const w=s[x];br(w!=null,`Previous layout not found for panel index ${x}`);const S=w+y,M=S_({panelConstraints:i,panelIndex:x,size:S});if(hu(w,M)||(y-=M-w,s[x]=M),hu(y,0))break;e>0?x--:x++}}}const u=s.reduce((h,d)=>d+h,0);return hu(u,100)?s:n}function yCt({layout:e,panelsArray:t,pivotIndices:i}){let r=0,n=100,a=0,s=0;const o=i[0];br(o!=null,"No pivot index found"),t.forEach((h,d)=>{const{constraints:f}=h,{maxSize:m=100,minSize:y=0}=f;d===o?(r=y,n=m):(a+=y,s+=m)});const l=Math.min(n,100-a),c=Math.max(r,100-s),u=e[o];return{valueMax:l,valueMin:c,valueNow:u}}function XP(e,t=document){return Array.from(t.querySelectorAll(`[${Ha.resizeHandleId}][data-panel-group-id="${e}"]`))}function EMe(e,t,i=document){const n=XP(e,i).findIndex(a=>a.getAttribute(Ha.resizeHandleId)===t);return n??null}function TMe(e,t,i){const r=EMe(e,t,i);return r!=null?[r,r+1]:[-1,-1]}function CMe(e,t=document){var i;if(t instanceof HTMLElement&&(t==null||(i=t.dataset)===null||i===void 0?void 0:i.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function nU(e,t=document){const i=t.querySelector(`[${Ha.resizeHandleId}="${e}"]`);return i||null}function xCt(e,t,i,r=document){var n,a,s,o;const l=nU(t,r),c=XP(e,r),u=l?c.indexOf(l):-1,h=(n=(a=i[u])===null||a===void 0?void 0:a.id)!==null&&n!==void 0?n:null,d=(s=(o=i[u+1])===null||o===void 0?void 0:o.id)!==null&&s!==void 0?s:null;return[h,d]}function bCt({committedValuesRef:e,eagerValuesRef:t,groupId:i,layout:r,panelDataArray:n,panelGroupElement:a,setLayout:s}){ee.useRef({didWarnAboutMissingResizeHandle:!1}),$x(()=>{if(!a)return;const o=XP(i,a);for(let l=0;l<n.length-1;l++){const{valueMax:c,valueMin:u,valueNow:h}=yCt({layout:r,panelsArray:n,pivotIndices:[l,l+1]}),d=o[l];if(d!=null){const f=n[l];br(f,`No panel data found for index "${l}"`),d.setAttribute("aria-controls",f.id),d.setAttribute("aria-valuemax",""+Math.round(c)),d.setAttribute("aria-valuemin",""+Math.round(u)),d.setAttribute("aria-valuenow",h!=null?""+Math.round(h):"")}}return()=>{o.forEach((l,c)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[i,r,n,a]),ee.useEffect(()=>{if(!a)return;const o=t.current;br(o,"Eager values not found");const{panelDataArray:l}=o,c=CMe(i,a);br(c!=null,`No group found for id "${i}"`);const u=XP(i,a);br(u,`No resize handles found for group id "${i}"`);const h=u.map(d=>{const f=d.getAttribute(Ha.resizeHandleId);br(f,"Resize handle element has no handle id attribute");const[m,y]=xCt(i,f,l,a);if(m==null||y==null)return()=>{};const g=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const w=l.findIndex(S=>S.id===m);if(w>=0){const S=l[w];br(S,`No panel data found for index ${w}`);const M=r[w],{collapsedSize:E=0,collapsible:T,minSize:R=0}=S.constraints;if(M!=null&&T){const P=CT({delta:hu(M,E)?R-E:E-M,initialLayout:r,panelConstraints:l.map(I=>I.constraints),pivotIndices:TMe(i,f,a),prevLayout:r,trigger:"keyboard"});r!==P&&s(P)}}break}}};return d.addEventListener("keydown",g),()=>{d.removeEventListener("keydown",g)}});return()=>{h.forEach(d=>d())}},[a,e,t,i,r,n,s])}function dpe(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}function PMe(e,t){const i=e==="horizontal",{x:r,y:n}=iU(t);return i?r:n}function wCt(e,t,i,r,n){const a=i==="horizontal",s=nU(t,n);br(s,`No resize handle element found for id "${t}"`);const o=s.getAttribute(Ha.groupId);br(o,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const c=PMe(i,e),u=CMe(o,n);br(u,`No group element found for id "${o}"`);const h=u.getBoundingClientRect(),d=a?h.width:h.height;return(c-l)/d*100}function _Ct(e,t,i,r,n,a){if(vMe(e)){const s=i==="horizontal";let o=0;e.shiftKey?o=100:n!=null?o=n:o=10;let l=0;switch(e.key){case"ArrowDown":l=s?0:o;break;case"ArrowLeft":l=s?-o:0;break;case"ArrowRight":l=s?o:0;break;case"ArrowUp":l=s?0:-o;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:wCt(e,t,i,r,a)}function SCt({panelDataArray:e}){const t=Array(e.length),i=e.map(a=>a.constraints);let r=0,n=100;for(let a=0;a<e.length;a++){const s=i[a];br(s,`Panel constraints not found for index ${a}`);const{defaultSize:o}=s;o!=null&&(r++,t[a]=o,n-=o)}for(let a=0;a<e.length;a++){const s=i[a];br(s,`Panel constraints not found for index ${a}`);const{defaultSize:o}=s;if(o!=null)continue;const l=e.length-r,c=n/l;r++,t[a]=c,n-=c}return t}function Gw(e,t,i){t.forEach((r,n)=>{const a=e[n];br(a,`Panel data not found for index ${n}`);const{callbacks:s,constraints:o,id:l}=a,{collapsedSize:c=0,collapsible:u}=o,h=i[l];if(h==null||r!==h){i[l]=r;const{onCollapse:d,onExpand:f,onResize:m}=s;m&&m(r,h),u&&(d||f)&&(f&&(h==null||Mm(h,c))&&!Mm(r,c)&&f(),d&&(h==null||!Mm(h,c))&&Mm(r,c)&&d())}})}function oI(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!=t[i])return!1;return!0}function ACt({defaultSize:e,dragState:t,layout:i,panelData:r,panelIndex:n,precision:a=3}){const s=i[n];let o;return s==null?o=e!=null?e.toPrecision(a):"1":r.length===1?o="1":o=s.toPrecision(a),{flexBasis:0,flexGrow:o,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function MCt(e,t=10){let i=null;return(...n)=>{i!==null&&clearTimeout(i),i=setTimeout(()=>{e(...n)},t)}}function fpe(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,i)=>{localStorage.setItem(t,i)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function DMe(e){return`react-resizable-panels:${e}`}function OMe(e){return e.map(t=>{const{constraints:i,id:r,idIsFromProps:n,order:a}=t;return n?r:a?`${a}:${JSON.stringify(i)}`:JSON.stringify(i)}).sort((t,i)=>t.localeCompare(i)).join(",")}function RMe(e,t){try{const i=DMe(e),r=t.getItem(i);if(r){const n=JSON.parse(r);if(typeof n=="object"&&n!=null)return n}}catch{}return null}function ECt(e,t,i){var r,n;const a=(r=RMe(e,i))!==null&&r!==void 0?r:{},s=OMe(t);return(n=a[s])!==null&&n!==void 0?n:null}function TCt(e,t,i,r,n){var a;const s=DMe(e),o=OMe(t),l=(a=RMe(e,n))!==null&&a!==void 0?a:{};l[o]={expandToSizes:Object.fromEntries(i.entries()),layout:r};try{n.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function ppe({layout:e,panelConstraints:t}){const i=[...e],r=i.reduce((a,s)=>a+s,0);if(i.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${i.map(a=>`${a}%`).join(", ")}`);if(!hu(r,100)&&i.length>0)for(let a=0;a<t.length;a++){const s=i[a];br(s!=null,`No layout data found for index ${a}`);const o=100/r*s;i[a]=o}let n=0;for(let a=0;a<t.length;a++){const s=i[a];br(s!=null,`No layout data found for index ${a}`);const o=S_({panelConstraints:t,panelIndex:a,size:s});s!=o&&(n+=s-o,i[a]=o)}if(!hu(n,0))for(let a=0;a<t.length;a++){const s=i[a];br(s!=null,`No layout data found for index ${a}`);const o=s+n,l=S_({panelConstraints:t,panelIndex:a,size:o});if(s!==l&&(n-=l-s,i[a]=l,hu(n,0)))break}return i}const CCt=100,PT={getItem:e=>(fpe(PT),PT.getItem(e)),setItem:(e,t)=>{fpe(PT),PT.setItem(e,t)}},mpe={};function IMe({autoSaveId:e=null,children:t,className:i="",direction:r,forwardedRef:n,id:a=null,onLayout:s=null,keyboardResizeBy:o=null,storage:l=PT,style:c,tagName:u="div",...h}){const d=CK(a),f=ee.useRef(null),[m,y]=ee.useState(null),[g,x]=ee.useState([]),w=gCt(),S=ee.useRef({}),M=ee.useRef(new Map),E=ee.useRef(0),T=ee.useRef({autoSaveId:e,direction:r,dragState:m,id:d,keyboardResizeBy:o,onLayout:s,storage:l}),R=ee.useRef({layout:g,panelDataArray:[],panelDataArrayChanged:!1});ee.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),ee.useImperativeHandle(n,()=>({getId:()=>T.current.id,getLayout:()=>{const{layout:ae}=R.current;return ae},setLayout:ae=>{const{onLayout:oe}=T.current,{layout:xe,panelDataArray:Z}=R.current,ce=ppe({layout:ae,panelConstraints:Z.map(me=>me.constraints)});dpe(xe,ce)||(x(ce),R.current.layout=ce,oe&&oe(ce),Gw(Z,ce,S.current))}}),[]),$x(()=>{T.current.autoSaveId=e,T.current.direction=r,T.current.dragState=m,T.current.id=d,T.current.onLayout=s,T.current.storage=l}),bCt({committedValuesRef:T,eagerValuesRef:R,groupId:d,layout:g,panelDataArray:R.current.panelDataArray,setLayout:x,panelGroupElement:f.current}),ee.useEffect(()=>{const{panelDataArray:ae}=R.current;if(e){if(g.length===0||g.length!==ae.length)return;let oe=mpe[e];oe==null&&(oe=MCt(TCt,CCt),mpe[e]=oe);const xe=[...ae],Z=new Map(M.current);oe(e,xe,Z,g,l)}},[e,g,l]),ee.useEffect(()=>{});const P=ee.useCallback(ae=>{const{onLayout:oe}=T.current,{layout:xe,panelDataArray:Z}=R.current;if(ae.constraints.collapsible){const ce=Z.map(Ee=>Ee.constraints),{collapsedSize:me=0,panelSize:he,pivotIndices:we}=Zy(Z,ae,xe);if(br(he!=null,`Panel size not found for panel "${ae.id}"`),!Mm(he,me)){M.current.set(ae.id,he);const Se=n_(Z,ae)===Z.length-1?he-me:me-he,Ne=CT({delta:Se,initialLayout:xe,panelConstraints:ce,pivotIndices:we,prevLayout:xe,trigger:"imperative-api"});oI(xe,Ne)||(x(Ne),R.current.layout=Ne,oe&&oe(Ne),Gw(Z,Ne,S.current))}}},[]),I=ee.useCallback((ae,oe)=>{const{onLayout:xe}=T.current,{layout:Z,panelDataArray:ce}=R.current;if(ae.constraints.collapsible){const me=ce.map(Pe=>Pe.constraints),{collapsedSize:he=0,panelSize:we=0,minSize:Ee=0,pivotIndices:Se}=Zy(ce,ae,Z),Ne=oe??Ee;if(Mm(we,he)){const Pe=M.current.get(ae.id),Re=Pe!=null&&Pe>=Ne?Pe:Ne,He=n_(ce,ae)===ce.length-1?we-Re:Re-we,de=CT({delta:He,initialLayout:Z,panelConstraints:me,pivotIndices:Se,prevLayout:Z,trigger:"imperative-api"});oI(Z,de)||(x(de),R.current.layout=de,xe&&xe(de),Gw(ce,de,S.current))}}},[]),L=ee.useCallback(ae=>{const{layout:oe,panelDataArray:xe}=R.current,{panelSize:Z}=Zy(xe,ae,oe);return br(Z!=null,`Panel size not found for panel "${ae.id}"`),Z},[]),z=ee.useCallback((ae,oe)=>{const{panelDataArray:xe}=R.current,Z=n_(xe,ae);return ACt({defaultSize:oe,dragState:m,layout:g,panelData:xe,panelIndex:Z})},[m,g]),U=ee.useCallback(ae=>{const{layout:oe,panelDataArray:xe}=R.current,{collapsedSize:Z=0,collapsible:ce,panelSize:me}=Zy(xe,ae,oe);return br(me!=null,`Panel size not found for panel "${ae.id}"`),ce===!0&&Mm(me,Z)},[]),j=ee.useCallback(ae=>{const{layout:oe,panelDataArray:xe}=R.current,{collapsedSize:Z=0,collapsible:ce,panelSize:me}=Zy(xe,ae,oe);return br(me!=null,`Panel size not found for panel "${ae.id}"`),!ce||gb(me,Z)>0},[]),F=ee.useCallback(ae=>{const{panelDataArray:oe}=R.current;oe.push(ae),oe.sort((xe,Z)=>{const ce=xe.order,me=Z.order;return ce==null&&me==null?0:ce==null?-1:me==null?1:ce-me}),R.current.panelDataArrayChanged=!0,w()},[w]);$x(()=>{if(R.current.panelDataArrayChanged){R.current.panelDataArrayChanged=!1;const{autoSaveId:ae,onLayout:oe,storage:xe}=T.current,{layout:Z,panelDataArray:ce}=R.current;let me=null;if(ae){const we=ECt(ae,ce,xe);we&&(M.current=new Map(Object.entries(we.expandToSizes)),me=we.layout)}me==null&&(me=SCt({panelDataArray:ce}));const he=ppe({layout:me,panelConstraints:ce.map(we=>we.constraints)});dpe(Z,he)||(x(he),R.current.layout=he,oe&&oe(he),Gw(ce,he,S.current))}}),$x(()=>{const ae=R.current;return()=>{ae.layout=[]}},[]);const G=ee.useCallback(ae=>{let oe=!1;const xe=f.current;return xe&&window.getComputedStyle(xe,null).getPropertyValue("direction")==="rtl"&&(oe=!0),function(ce){ce.preventDefault();const me=f.current;if(!me)return()=>null;const{direction:he,dragState:we,id:Ee,keyboardResizeBy:Se,onLayout:Ne}=T.current,{layout:Pe,panelDataArray:Re}=R.current,{initialLayout:ze}=we??{},He=TMe(Ee,ae,me);let de=_Ct(ce,ae,he,we,Se,me);const et=he==="horizontal";et&&oe&&(de=-de);const ut=Re.map(q=>q.constraints),vt=CT({delta:de,initialLayout:ze??Pe,panelConstraints:ut,pivotIndices:He,prevLayout:Pe,trigger:vMe(ce)?"keyboard":"mouse-or-touch"}),fe=!oI(Pe,vt);(yMe(ce)||xMe(ce))&&E.current!=de&&(E.current=de,!fe&&de!==0?et?xG(ae,de<0?wMe:_Me):xG(ae,de<0?SMe:AMe):xG(ae,0)),fe&&(x(vt),R.current.layout=vt,Ne&&Ne(vt),Gw(Re,vt,S.current))}},[]),H=ee.useCallback((ae,oe)=>{const{onLayout:xe}=T.current,{layout:Z,panelDataArray:ce}=R.current,me=ce.map(Pe=>Pe.constraints),{panelSize:he,pivotIndices:we}=Zy(ce,ae,Z);br(he!=null,`Panel size not found for panel "${ae.id}"`);const Se=n_(ce,ae)===ce.length-1?he-oe:oe-he,Ne=CT({delta:Se,initialLayout:Z,panelConstraints:me,pivotIndices:we,prevLayout:Z,trigger:"imperative-api"});oI(Z,Ne)||(x(Ne),R.current.layout=Ne,xe&&xe(Ne),Gw(ce,Ne,S.current))},[]),W=ee.useCallback((ae,oe)=>{const{layout:xe,panelDataArray:Z}=R.current,{collapsedSize:ce=0,collapsible:me}=oe,{collapsedSize:he=0,collapsible:we,maxSize:Ee=100,minSize:Se=0}=ae.constraints,{panelSize:Ne}=Zy(Z,ae,xe);Ne!=null&&(me&&we&&Mm(Ne,ce)?Mm(ce,he)||H(ae,he):Ne<Se?H(ae,Se):Ne>Ee&&H(ae,Ee))},[H]),Q=ee.useCallback((ae,oe)=>{const{direction:xe}=T.current,{layout:Z}=R.current;if(!f.current)return;const ce=nU(ae,f.current);br(ce,`Drag handle element not found for id "${ae}"`);const me=PMe(xe,oe);y({dragHandleId:ae,dragHandleRect:ce.getBoundingClientRect(),initialCursorPosition:me,initialLayout:Z})},[]),ne=ee.useCallback(()=>{y(null)},[]),se=ee.useCallback(ae=>{const{panelDataArray:oe}=R.current,xe=n_(oe,ae);xe>=0&&(oe.splice(xe,1),delete S.current[ae.id],R.current.panelDataArrayChanged=!0,w())},[w]),$=ee.useMemo(()=>({collapsePanel:P,direction:r,dragState:m,expandPanel:I,getPanelSize:L,getPanelStyle:z,groupId:d,isPanelCollapsed:U,isPanelExpanded:j,reevaluatePanelConstraints:W,registerPanel:F,registerResizeHandle:G,resizePanel:H,startDragging:Q,stopDragging:ne,unregisterPanel:se,panelGroupElement:f.current}),[P,m,r,I,L,z,d,U,j,W,F,G,H,Q,ne,se]),J={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return ee.createElement(tU.Provider,{value:$},ee.createElement(u,{...h,children:t,className:i,id:a,ref:f,style:{...J,...c},[Ha.group]:"",[Ha.groupDirection]:r,[Ha.groupId]:d}))}const OK=ee.forwardRef((e,t)=>ee.createElement(IMe,{...e,forwardedRef:t}));IMe.displayName="PanelGroup";OK.displayName="forwardRef(PanelGroup)";function n_(e,t){return e.findIndex(i=>i===t||i.id===t.id)}function Zy(e,t,i){const r=n_(e,t),a=r===e.length-1?[r-1,r]:[r,r+1],s=i[r];return{...t.constraints,panelSize:s,pivotIndices:a}}function PCt({disabled:e,handleId:t,resizeHandler:i,panelGroupElement:r}){ee.useEffect(()=>{if(e||i==null||r==null)return;const n=nU(t,r);if(n==null)return;const a=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),i(s);break}case"F6":{s.preventDefault();const o=n.getAttribute(Ha.groupId);br(o,`No group element found for id "${o}"`);const l=XP(o,r),c=EMe(o,t,r);br(c!==null,`No resize element found for id "${t}"`);const u=s.shiftKey?c>0?c-1:l.length-1:c+1<l.length?c+1:0;l[u].focus();break}}};return n.addEventListener("keydown",a),()=>{n.removeEventListener("keydown",a)}},[r,e,t,i])}function NMe({children:e=null,className:t="",disabled:i=!1,hitAreaMargins:r,id:n,onBlur:a,onClick:s,onDragging:o,onFocus:l,onPointerDown:c,onPointerUp:u,style:h={},tabIndex:d=0,tagName:f="div",...m}){var y,g;const x=ee.useRef(null),w=ee.useRef({onClick:s,onDragging:o,onPointerDown:c,onPointerUp:u});ee.useEffect(()=>{w.current.onClick=s,w.current.onDragging=o,w.current.onPointerDown=c,w.current.onPointerUp=u});const S=ee.useContext(tU);if(S===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:M,groupId:E,registerResizeHandle:T,startDragging:R,stopDragging:P,panelGroupElement:I}=S,L=CK(n),[z,U]=ee.useState("inactive"),[j,F]=ee.useState(!1),[G,H]=ee.useState(null),W=ee.useRef({state:z});$x(()=>{W.current.state=z}),ee.useEffect(()=>{if(i)H(null);else{const $=T(L);H(()=>$)}},[i,L,T]);const Q=(y=r==null?void 0:r.coarse)!==null&&y!==void 0?y:15,ne=(g=r==null?void 0:r.fine)!==null&&g!==void 0?g:5;ee.useEffect(()=>{if(i||G==null)return;const $=x.current;br($,"Element ref not attached");let J=!1;return pCt(L,$,M,{coarse:Q,fine:ne},(oe,xe,Z)=>{if(!xe){U("inactive");return}switch(oe){case"down":{U("drag"),J=!1,br(Z,'Expected event to be defined for "down" action'),R(L,Z);const{onDragging:ce,onPointerDown:me}=w.current;ce==null||ce(!0),me==null||me();break}case"move":{const{state:ce}=W.current;J=!0,ce!=="drag"&&U("hover"),br(Z,'Expected event to be defined for "move" action'),G(Z);break}case"up":{U("hover"),P();const{onClick:ce,onDragging:me,onPointerUp:he}=w.current;me==null||me(!1),he==null||he(),J||ce==null||ce();break}}})},[Q,M,i,ne,T,L,G,R,P]),PCt({disabled:i,handleId:L,resizeHandler:G,panelGroupElement:I});const se={touchAction:"none",userSelect:"none"};return ee.createElement(f,{...m,children:e,className:t,id:n,onBlur:()=>{F(!1),a==null||a()},onFocus:()=>{F(!0),l==null||l()},ref:x,role:"separator",style:{...se,...h},tabIndex:d,[Ha.groupDirection]:M,[Ha.groupId]:E,[Ha.resizeHandle]:"",[Ha.resizeHandleActive]:z==="drag"?"pointer":j?"keyboard":void 0,[Ha.resizeHandleEnabled]:!i,[Ha.resizeHandleId]:L,[Ha.resizeHandleState]:z})}NMe.displayName="PanelResizeHandle";function DCt(e,t){switch(e){case"pixel":return t?"group relative flex items-center justify-center cursor-col-resize":"group relative flex items-center justify-center cursor-row-resize";case"terminal":return t?"group relative flex items-center justify-center cursor-col-resize":"group relative flex items-center justify-center cursor-row-resize";case"modern":default:return t?"group relative flex items-center justify-center cursor-col-resize transition-all duration-200":"group relative flex items-center justify-center cursor-row-resize transition-all duration-200"}}function OCt(e,t){switch(e){case"pixel":return t?{width:"8px",background:"var(--pixel-surface, #222244)",borderLeft:"2px solid var(--pixel-border, #444477)",borderRight:"2px solid var(--pixel-border, #444477)"}:{height:"8px",background:"var(--pixel-surface, #222244)",borderTop:"2px solid var(--pixel-border, #444477)",borderBottom:"2px solid var(--pixel-border, #444477)"};case"terminal":return t?{width:"6px",background:"#0a0a0a",borderLeft:"1px solid #1a3a1a",borderRight:"1px solid #1a3a1a"}:{height:"6px",background:"#0a0a0a",borderTop:"1px solid #1a3a1a",borderBottom:"1px solid #1a3a1a"};case"modern":default:return t?{width:"4px",background:"rgba(100,100,100,0.15)",borderRadius:"2px"}:{height:"4px",background:"rgba(100,100,100,0.15)",borderRadius:"2px"}}}function RCt({theme:e,isHorizontal:t}){switch(e){case"pixel":{const i=t?{flexDirection:"column",gap:"3px"}:{flexDirection:"row",gap:"3px"};return C.jsx("div",{className:"flex",style:i,children:[0,1,2].map(r=>C.jsx("div",{style:{width:"2px",height:"2px",background:"var(--pixel-border-light, #5555aa)"},className:"group-hover:!bg-[var(--pixel-gold)]"},r))})}case"terminal":return t?C.jsxs("div",{className:"flex flex-col items-center gap-0 text-[8px] leading-none group-hover:text-[#00ff00]",style:{color:"#1a3a1a",fontFamily:"monospace"},children:[C.jsx("span",{children:"│"}),C.jsx("span",{children:"│"}),C.jsx("span",{children:"│"})]}):C.jsx("div",{className:"flex items-center gap-0 text-[8px] leading-none group-hover:text-[#00ff00]",style:{color:"#1a3a1a",fontFamily:"monospace"},children:C.jsx("span",{children:"═══"})});case"modern":default:{const i=t?{flexDirection:"column",gap:"2px"}:{flexDirection:"row",gap:"2px"};return C.jsx("div",{className:"flex opacity-0 group-hover:opacity-100 transition-opacity duration-200",style:i,children:[0,1,2].map(r=>C.jsx("div",{className:"rounded-full bg-white/20 group-hover:bg-blue-400/50",style:{width:"3px",height:"3px"}},r))})}}}function LMe({id:e,children:t}){return C.jsx(OK,{direction:"horizontal",autoSaveId:e,className:"flex-1 overflow-hidden",children:t})}function ICt({id:e,children:t}){return C.jsx(OK,{direction:"vertical",autoSaveId:e,className:"flex-1 flex flex-col overflow-hidden",children:t})}function Fv({defaultSize:e,minSize:t,maxSize:i,children:r,className:n,collapsible:a,collapsedSize:s,order:o}){return C.jsx(gMe,{defaultSize:e,minSize:t,maxSize:i,collapsible:a,collapsedSize:s,order:o,className:`overflow-hidden${n?` ${n}`:""}`,children:r})}function mC({direction:e="horizontal",disabled:t,className:i}){const r=Di(a=>a.theme);if(t)return null;const n=e==="horizontal";return C.jsx(NMe,{className:`${DCt(r,n)}${i?` ${i}`:""}`,style:OCt(r,n),children:C.jsx(RCt,{theme:r,isHorizontal:n})})}function RK({AgentDetail:e,ActivityFeed:t,FileWatcher:i,tabBarClass:r="flex border-b border-cam-border/50 bg-cam-surface/50",activeTabClass:n="text-cam-accent border-b-2 border-cam-accent",inactiveTabClass:a="text-cam-text-muted hover:text-cam-text",panelClass:s="flex-1 overflow-y-auto"}){const o=Ni(u=>u.selectedAgentId),[l,c]=ee.useState("activity");return o?C.jsx(e,{}):C.jsxs("div",{className:"h-full flex flex-col",children:[C.jsxs("div",{className:r,children:[C.jsx("button",{onClick:()=>c("activity"),className:`px-3 py-1.5 text-[10px] font-medium uppercase tracking-wider transition-colors ${l==="activity"?n:a}`,children:"Activity"}),C.jsx("button",{onClick:()=>c("files"),className:`px-3 py-1.5 text-[10px] font-medium uppercase tracking-wider transition-colors ${l==="files"?n:a}`,children:"Files"})]}),C.jsx("div",{className:s,children:l==="activity"?C.jsx(t,{}):C.jsx(i,{})})]})}const gpe="cam-in-process-dismissed";function NCt(){const e=Ni(r=>r.agents);return!Ni(r=>r.session)||e.length<2?!1:new Set(e.map(r=>r.sessionId)).size===1}function LCt(e){const[t,i]=ee.useState(()=>{if(!e)return!1;try{return localStorage.getItem(gpe)===e}catch{return!1}}),r=ee.useCallback(()=>{if(e)try{localStorage.setItem(gpe,e)}catch{}i(!0)},[e]);return[t,r]}function IK(){const e=NCt(),t=Ni(a=>a.session),[i,r]=LCt(t==null?void 0:t.id),{theme:n}=$P();if(!e||i)return null;switch(n){case"pixel":return C.jsx(zCt,{onDismiss:r});case"terminal":return C.jsx(BCt,{onDismiss:r});default:return C.jsx(kCt,{onDismiss:r})}}function kCt({onDismiss:e}){return C.jsxs("div",{className:"h-8 flex items-center justify-between px-4 bg-amber-500/10 border-b border-amber-500/30 shrink-0",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-pulse"}),C.jsx("span",{className:"text-xs text-amber-300",children:"In-process mode detected — per-agent tracking is limited. Use tmux + Teams for full E2E tracking."})]}),C.jsx("button",{onClick:e,className:"text-amber-400/60 hover:text-amber-300 text-xs px-1",title:"Dismiss",children:"×"})]})}function zCt({onDismiss:e}){return C.jsxs("div",{className:"h-8 flex items-center justify-between px-4 shrink-0",style:{background:"rgba(255, 170, 0, 0.1)",borderBottom:"2px solid var(--pixel-gold, #d4a017)"},children:[C.jsx("div",{className:"flex items-center gap-2",children:C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold, #d4a017)"},children:"! IN-PROCESS MODE - PER-AGENT TRACKING LIMITED. USE TMUX + TEAMS FOR FULL TRACKING."})}),C.jsx("button",{onClick:e,className:"pixel-text-xs px-1",style:{color:"var(--pixel-gold, #d4a017)",opacity:.6},title:"Dismiss",children:"X"})]})}function BCt({onDismiss:e}){return C.jsxs("div",{className:"h-8 flex items-center justify-between px-3 bg-[#1a1a00] border-b border-[#3a3a1a] shrink-0 font-mono text-[11px]",children:[C.jsx("div",{className:"flex items-center gap-2",children:C.jsx("span",{className:"text-[#ffaa00]",children:"[WARN] in-process mode: per-agent tracking limited. use tmux + teams for full e2e tracking."})}),C.jsx("button",{onClick:e,className:"text-[#ffaa00]/60 hover:text-[#ffaa00] px-1",title:"Dismiss",children:"[x]"})]})}function UCt(){const{connectionStatus:e,session:t}=Ni();if(t&&t.status!=="active"){const r=t.status==="error";return C.jsxs("div",{className:"flex items-center gap-1.5",children:[C.jsx("div",{className:`w-2 h-2 rounded-full ${r?"bg-cam-error":"bg-gray-400"}`}),C.jsx("span",{className:`text-xs ${r?"text-cam-error":"text-cam-text-muted"}`,children:r?"Session error":"Session ended"})]})}const i={connected:{dotClass:"bg-cam-success animate-pulse-dot",textClass:"text-cam-success",label:"Connected",sublabel:"capturing events"},reconnecting:{dotClass:"bg-amber-400 animate-pulse",textClass:"text-amber-400",label:"Reconnecting...",sublabel:""},disconnected:{dotClass:"bg-cam-error",textClass:"text-cam-error",label:"Disconnected",sublabel:"waiting for server"}}[e];return C.jsxs("div",{className:"flex items-center gap-1.5",children:[C.jsx("div",{className:`w-2 h-2 rounded-full ${i.dotClass}`}),C.jsx("span",{className:`text-xs ${i.textClass}`,children:i.label}),i.sublabel&&C.jsxs("span",{className:"text-xs text-cam-text-muted",children:["- ",i.sublabel]})]})}function jCt(){const{viewMode:e}=_n();return C.jsxs("div",{className:"h-full w-full flex flex-col modern-gradient-bg overflow-hidden",children:[C.jsxs("header",{className:"h-12 flex items-center justify-between px-4 border-b border-cam-border/50 modern-glass shrink-0 relative z-50",children:[C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx("h1",{className:"text-sm font-semibold text-cam-text tracking-tight",children:"Claude Agent Monitor"}),C.jsx(UCt,{})]}),C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx(RX,{}),C.jsx(RHe,{})]})]}),C.jsx(VEe,{}),C.jsx(IK,{}),C.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[e==="agents"&&C.jsx(FCt,{}),e==="tracker"&&C.jsx(VCt,{})]})]})}function FCt(){const e=Di(t=>t.lockPanels);return C.jsxs(LMe,{id:"modern-agents",children:[C.jsx(Fv,{defaultSize:20,minSize:10,maxSize:25,order:1,children:C.jsx("aside",{className:"h-full overflow-y-auto modern-scrollbar",children:C.jsx(nTe,{})})}),C.jsx(mC,{disabled:e}),C.jsx(Fv,{defaultSize:55,minSize:30,order:2,children:C.jsx("main",{className:"h-full overflow-hidden",children:C.jsx(MK,{})})}),C.jsx(mC,{disabled:e}),C.jsx(Fv,{defaultSize:25,minSize:15,maxSize:40,order:3,children:C.jsx("aside",{className:"h-full modern-scrollbar",children:C.jsx(RK,{AgentDetail:k3e,ActivityFeed:I3e,FileWatcher:B3e})})})]})}function VCt(){const{selectedTaskId:e}=_n(),t=Di(i=>i.lockPanels);return C.jsxs(ICt,{id:"modern-tracker",children:[C.jsx(Fv,{defaultSize:75,minSize:50,order:1,children:C.jsxs(LMe,{id:e?"modern-tracker-top-detail":"modern-tracker-top",children:[C.jsx(Fv,{defaultSize:e?55:70,minSize:30,order:1,children:C.jsx("main",{className:"h-full overflow-hidden",children:C.jsx(F3e,{})})}),e&&C.jsxs(C.Fragment,{children:[C.jsx(mC,{disabled:t}),C.jsx(Fv,{defaultSize:20,minSize:15,maxSize:35,order:2,children:C.jsx("aside",{className:"h-full overflow-y-auto modern-scrollbar",children:C.jsx(EK,{})})})]}),C.jsx(mC,{disabled:t}),C.jsx(Fv,{defaultSize:e?25:30,minSize:15,maxSize:40,order:3,children:C.jsxs("aside",{className:"h-full overflow-y-auto modern-scrollbar flex flex-col",children:[C.jsx(H3e,{}),C.jsx(AHe,{}),C.jsx(OHe,{})]})})]})}),C.jsx(mC,{direction:"vertical",disabled:t}),C.jsx(Fv,{defaultSize:25,minSize:10,maxSize:40,order:2,children:C.jsx("div",{className:"h-full overflow-y-auto modern-scrollbar",children:C.jsx(MHe,{})})})]})}function HCt(){const{session:e,agents:t,events:i}=Ni(),[r,n]=ee.useState("00m 00s");ee.useEffect(()=>{if(!(e!=null&&e.startedAt))return;const u=()=>n(H7(e.startedAt,e.endedAt));if(u(),!e.endedAt){const h=setInterval(u,1e3);return()=>clearInterval(h)}},[e==null?void 0:e.startedAt,e==null?void 0:e.endedAt]);const a=t.filter(u=>u.status==="active").length,s=t.reduce((u,h)=>u+h.errorCount,0),o=t.reduce((u,h)=>u+h.toolCallCount,0),l=i.filter(u=>u.category==="file_change").length,c=[{label:"TIME",value:r,isError:!1},{label:"AGENTS",value:`${a}/${t.length}`,isError:!1},{label:"CALLS",value:Lm(o),isError:!1},{label:"EVENTS",value:Lm((e==null?void 0:e.eventCount)??0),isError:!1},{label:"FILES",value:Lm(l),isError:!1},{label:"ERRORS",value:String(s),isError:s>0}];return C.jsx("div",{className:"shrink-0 border-b border-[#1a3a1a] px-2 py-1 font-mono text-[11px]",children:C.jsxs("div",{className:"flex items-center gap-0",children:[C.jsx("span",{className:"terminal-dim mr-2",children:"["}),c.map((u,h)=>C.jsxs("span",{className:"flex items-center",children:[h>0&&C.jsx("span",{className:"terminal-dim mx-1",children:"|"}),C.jsxs("span",{className:"terminal-muted",children:[u.label,":"]}),C.jsx("span",{className:`ml-1 font-bold ${u.isError?"terminal-error":"text-[#00ff00] terminal-glow"}`,children:u.value})]},u.label)),C.jsx("span",{className:"terminal-dim ml-2",children:"]"})]})})}const GCt={active:"[*]",idle:"[-]",error:"[!]",completed:"[+]",shutdown:"[x]"},WCt={active:"text-[#00ff00]",idle:"text-[#ffaa00]",error:"text-[#ff3333]",completed:"text-[#00ccff]",shutdown:"text-[#006600]"};function qCt(e){return e.status==="active"}function XCt(){const e=$7(),{selectedAgentId:t,selectAgent:i}=Ni(),[r,n]=ee.useState(!1),{activeAgents:a,inactiveAgents:s}=ee.useMemo(()=>{const o=[],l=[];for(const c of e)qCt(c)?o.push(c):l.push(c);return{activeAgents:o,inactiveAgents:l}},[e]);return e.length===0?C.jsxs("div",{className:"p-3 font-mono text-[11px]",children:[C.jsx("div",{className:"terminal-muted mb-2",children:"## AGENTS ##"}),C.jsxs("div",{className:"terminal-dim",children:[C.jsx("p",{children:"> Waiting for agents..."}),C.jsx("p",{className:"mt-1 terminal-cursor",children:"> "})]})]}):C.jsxs("div",{className:"p-2 font-mono text-[11px]",children:[C.jsx("div",{className:"terminal-muted mb-1 px-1",children:"## ACTIVE ("+a.length+") ##"}),C.jsx("div",{className:"border-t border-[#1a3a1a] mb-1"}),a.length>0?C.jsx("div",{className:"space-y-0.5",children:a.map(o=>C.jsx(vpe,{agent:o,isSelected:t===o.id,onSelect:()=>i(t===o.id?null:o.id)},o.id))}):C.jsx("div",{className:"px-1 py-1 terminal-dim",children:"> No active agents"}),s.length>0&&C.jsxs("div",{className:"mt-2",children:[C.jsxs("button",{onClick:()=>n(!r),className:"w-full text-left px-1 py-0.5 hover:bg-[#0a1a0a] transition-colors",children:[C.jsxs("span",{className:"terminal-dim",children:[r?"[-]":"[+]"," "]}),C.jsx("span",{className:"terminal-muted",children:"INACTIVE ("+s.length+")"})]}),r&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"border-t border-[#1a3a1a] mb-1 mt-1"}),C.jsx("div",{className:"space-y-0.5",children:s.map(o=>C.jsx(vpe,{agent:o,isSelected:t===o.id,onSelect:()=>i(t===o.id?null:o.id),compact:!0},o.id))})]})]})]})}function vpe({agent:e,isSelected:t,onSelect:i,compact:r=!1}){const n=Ch(e.id,e.name,e.type??void 0),a=GCt[e.status]||"[ ]",s=WCt[e.status]||"terminal-dim";return r?C.jsx("button",{onClick:i,title:`${e.name} (${e.id})`,className:`
|
|
12435
|
+
`})}get time(){return this.uniforms.time.value}set time(t){this.uniforms.time.value=t}get pixelRatio(){return this.uniforms.pixelRatio.value}set pixelRatio(t){this.uniforms.pixelRatio.value=t}}const uMe=e=>e&&e.constructor===Float32Array,ETt=e=>[e.r,e.g,e.b],hMe=e=>e instanceof Dt||e instanceof Me||e instanceof zn,dMe=e=>Array.isArray(e)?e:hMe(e)?e.toArray():[e,e,e];function sT(e,t,i){return ee.useMemo(()=>{if(t!==void 0){if(uMe(t))return t;if(t instanceof Jt){const r=Array.from({length:e*3},()=>ETt(t)).flat();return Float32Array.from(r)}else if(hMe(t)||Array.isArray(t)){const r=Array.from({length:e*3},()=>dMe(t)).flat();return Float32Array.from(r)}return Float32Array.from({length:e},()=>t)}return Float32Array.from({length:e},i)},[t])}const fMe=ee.forwardRef(({noise:e=1,count:t=100,speed:i=1,opacity:r=1,scale:n=1,size:a,color:s,children:o,...l},c)=>{ee.useMemo(()=>rMe({SparklesImplMaterial:MTt}),[]);const u=ee.useRef(null),h=mx(S=>S.viewport.dpr),d=dMe(n),f=ee.useMemo(()=>Float32Array.from(Array.from({length:t},()=>d.map(G$.randFloatSpread)).flat()),[t,...d]),m=sT(t,a,Math.random),y=sT(t,r),g=sT(t,i),x=sT(t*3,e),w=sT(s===void 0?t*3:t,uMe(s)?s:new Jt(s),()=>1);return Jc(S=>{u.current&&u.current.material&&(u.current.material.time=S.clock.elapsedTime)}),ee.useImperativeHandle(c,()=>u.current,[]),ee.createElement("points",SN({key:`particle-${t}-${JSON.stringify(n)}`},l,{ref:u}),ee.createElement("bufferGeometry",null,ee.createElement("bufferAttribute",{attach:"attributes-position",args:[f,3]}),ee.createElement("bufferAttribute",{attach:"attributes-size",args:[m,1]}),ee.createElement("bufferAttribute",{attach:"attributes-opacity",args:[y,1]}),ee.createElement("bufferAttribute",{attach:"attributes-speed",args:[g,1]}),ee.createElement("bufferAttribute",{attach:"attributes-color",args:[w,3]}),ee.createElement("bufferAttribute",{attach:"attributes-noise",args:[x,3]})),o||ee.createElement("sparklesImplMaterial",{transparent:!0,pixelRatio:h,depthWrite:!1}))});function TTt({pixelated:e}){const t=mx(s=>s.gl),i=mx(s=>s.internal.active),r=mx(s=>s.performance.current),n=mx(s=>s.viewport.initialDpr),a=mx(s=>s.setDpr);return ee.useEffect(()=>{const s=t.domElement;return()=>{i&&a(n),e&&s&&(s.style.imageRendering="auto")}},[]),ee.useEffect(()=>{a(r*n),e&&t.domElement&&(t.domElement.style.imageRendering=r===1?"auto":"pixelated")},[r]),null}function CTt({position:e}){const t=ee.useRef(null),i=ee.useRef(null);return Jc(({clock:r})=>{const n=r.getElapsedTime();if(i.current&&(i.current.rotation.y=Math.sin(n*1.2)*.12),t.current){const a=t.current.material;a.emissiveIntensity=.6+Math.sin(n*3)*.3}}),C.jsx("group",{position:e,children:C.jsx(V0,{speed:1.5,rotationIntensity:.1,floatIntensity:.5,children:C.jsxs("group",{ref:i,children:[C.jsxs("mesh",{children:[C.jsx("boxGeometry",{args:[30,20,2]}),C.jsx("meshStandardMaterial",{color:"#111122",metalness:.5,roughness:.3})]}),C.jsxs("mesh",{ref:t,position:[0,0,1.2],children:[C.jsx("boxGeometry",{args:[26,16,.5]}),C.jsx("meshStandardMaterial",{color:"#22d3ee",emissive:"#22d3ee",emissiveIntensity:.6,transparent:!0,opacity:.85})]})]})})})}function PTt({position:e}){const t=ee.useRef(null),i=ee.useRef(null);Jc(({clock:n})=>{const a=n.getElapsedTime();t.current&&(t.current.rotation.y=.3+Math.sin(a*1.5)*.05),i.current&&(i.current.rotation.y=-.3-Math.sin(a*1.5)*.05)});const r=C.jsx("meshStandardMaterial",{color:"#c4b5fd",emissive:"#8b5cf6",emissiveIntensity:.5});return C.jsx("group",{position:e,children:C.jsxs(V0,{speed:1.5,rotationIntensity:.1,floatIntensity:.5,children:[C.jsx("group",{ref:t,position:[-7,0,0],children:C.jsxs("mesh",{children:[C.jsx("boxGeometry",{args:[12,16,1]}),r]})}),C.jsx("group",{ref:i,position:[7,0,0],children:C.jsxs("mesh",{children:[C.jsx("boxGeometry",{args:[12,16,1]}),r]})}),C.jsxs("mesh",{children:[C.jsx("boxGeometry",{args:[2,16,2]}),C.jsx("meshStandardMaterial",{color:"#1e1b2e"})]})]})})}function DTt({position:e}){const t=ee.useRef(null);Jc(({clock:r})=>{const n=r.getElapsedTime();t.current&&(t.current.visible=Math.sin(n*4)>0,t.current.position.x=-8+n*6%16)});const i=C.jsx("meshStandardMaterial",{color:"#22c55e",emissive:"#22c55e",emissiveIntensity:.6});return C.jsx("group",{position:e,children:C.jsxs(V0,{speed:1.5,rotationIntensity:.1,floatIntensity:.5,children:[C.jsxs("mesh",{children:[C.jsx("boxGeometry",{args:[28,18,2]}),C.jsx("meshStandardMaterial",{color:"#0a0a14"})]}),C.jsxs("mesh",{position:[-11,4,1.2],children:[C.jsx("boxGeometry",{args:[2,2,.5]}),i]}),C.jsxs("mesh",{position:[-2,4,1.2],children:[C.jsx("boxGeometry",{args:[14,1.2,.3]}),i]}),C.jsxs("mesh",{position:[-4,0,1.2],children:[C.jsx("boxGeometry",{args:[10,1.2,.3]}),i]}),C.jsxs("mesh",{ref:t,position:[-8,-4,1.2],children:[C.jsx("boxGeometry",{args:[2,3,.5]}),i]})]})})}function OTt({position:e}){const t=ee.useRef(null);Jc(({clock:r})=>{const n=r.getElapsedTime();t.current&&(t.current.rotation.z=Math.sin(n*1.2)*.4)});const i=C.jsx("meshStandardMaterial",{color:"#3b82f6",emissive:"#3b82f6",emissiveIntensity:.5});return C.jsx("group",{position:e,children:C.jsx(V0,{speed:1.5,rotationIntensity:.1,floatIntensity:.5,children:C.jsxs("group",{ref:t,children:[C.jsxs("mesh",{children:[C.jsx("torusGeometry",{args:[9,2.5,16,32]}),i]}),C.jsxs("mesh",{position:[0,0,0],children:[C.jsx("circleGeometry",{args:[6.5,32]}),C.jsx("meshStandardMaterial",{color:"#3b82f6",emissive:"#3b82f6",emissiveIntensity:.2,transparent:!0,opacity:.3})]}),C.jsxs("mesh",{rotation:[0,0,-Math.PI/4],position:[8,-8,0],children:[C.jsx("cylinderGeometry",{args:[2,1.5,14,8]}),i]})]})})})}function RTt({position:e}){const t=ee.useRef(null),i=ee.useRef(null),r=ee.useRef(null);Jc(({clock:a})=>{const s=a.getElapsedTime();[t,i,r].forEach((l,c)=>{if(l.current){const u=s*3-c*.4,h=Math.max(0,Math.sin(u)),d=Math.pow(2,-5*h)*Math.sin(h*Math.PI*2)+h;l.current.position.y=d*5}})});const n=C.jsx("meshStandardMaterial",{color:"#a855f7",emissive:"#a855f7",emissiveIntensity:.6});return C.jsx("group",{position:e,children:C.jsxs(V0,{speed:1.5,rotationIntensity:.1,floatIntensity:.5,children:[C.jsxs("mesh",{position:[0,-2,-1],children:[C.jsx("boxGeometry",{args:[36,14,1]}),C.jsx("meshStandardMaterial",{color:"#1a0a2e",transparent:!0,opacity:.5})]}),C.jsxs("mesh",{ref:t,position:[-10,0,0],children:[C.jsx("sphereGeometry",{args:[3,16,16]}),n]}),C.jsxs("mesh",{ref:i,position:[0,0,0],children:[C.jsx("sphereGeometry",{args:[3,16,16]}),n]}),C.jsxs("mesh",{ref:r,position:[10,0,0],children:[C.jsx("sphereGeometry",{args:[3,16,16]}),n]})]})})}function ITt({position:e}){const t=ee.useRef(null);Jc(({clock:r})=>{t.current&&(t.current.rotation.z=r.getElapsedTime()*.8)});const i=C.jsx("meshStandardMaterial",{color:"#f97316",emissive:"#f97316",emissiveIntensity:.5});return C.jsx("group",{position:e,children:C.jsxs(V0,{speed:1.5,rotationIntensity:.1,floatIntensity:.5,children:[C.jsxs("mesh",{ref:t,children:[C.jsx("torusGeometry",{args:[10,3,6,8]}),i]}),C.jsxs("mesh",{children:[C.jsx("circleGeometry",{args:[5,32]}),i]})]})})}function NTt({position:e}){const t=ee.useRef(null);return Jc(({clock:i})=>{const r=i.getElapsedTime();if(t.current){t.current.rotation.y=r*.6,t.current.rotation.x=Math.sin(r*.8)*.3;const n=t.current.material;n.emissiveIntensity=.5+Math.sin(r*2)*.4}}),C.jsx("group",{position:e,children:C.jsxs(V0,{speed:1.5,rotationIntensity:.1,floatIntensity:.5,children:[C.jsxs("mesh",{ref:t,children:[C.jsx("octahedronGeometry",{args:[12,0]}),C.jsx("meshStandardMaterial",{color:"#fbbf24",emissive:"#fbbf24",emissiveIntensity:.5,metalness:.4,roughness:.2})]}),C.jsx(fMe,{count:30,size:3,speed:.5,color:"#fbbf24",scale:30})]})})}function LTt({position:e}){const t=ee.useRef(null);Jc(({clock:r})=>{const n=r.getElapsedTime();if(t.current){const a=1+Math.sin(n*3)*.1;t.current.scale.set(a,a,a)}});const i=C.jsx("meshStandardMaterial",{color:"#ef4444",emissive:"#ef4444",emissiveIntensity:.6});return C.jsx("group",{position:e,children:C.jsx(V0,{speed:1.5,rotationIntensity:.1,floatIntensity:.5,children:C.jsxs("group",{ref:t,children:[C.jsxs("mesh",{rotation:[0,0,Math.PI/4],children:[C.jsx("boxGeometry",{args:[4,24,3]}),i]}),C.jsxs("mesh",{rotation:[0,0,-Math.PI/4],children:[C.jsx("boxGeometry",{args:[4,24,3]}),i]})]})})})}function npe(e){const t=1-e;return 1-t*t*t}function ape(e){return e*e*e}const kTt=2,sI=.3,Hw=.7;function zTt({position:e,color:t,onComplete:i}){const r=ee.useRef(null),n=ee.useRef(null),a=ee.useRef(null),s=ee.useRef(null),[o,l]=ee.useState(!1),c=t??"#8b5cf6";return Jc(({clock:u})=>{if(o)return;const h=u.getElapsedTime();s.current===null&&(s.current=h);const d=h-s.current,f=Math.min(d/kTt,1);if(f>=1){l(!0),i==null||i();return}const m=r.current;if(!m)return;let y;if(f<sI){const S=f/sI;y=npe(S)}else if(f<Hw)y=1;else{const S=(f-Hw)/(1-Hw);y=1-ape(S)}m.scale.setScalar(Math.max(y,.001));const g=n.current;g&&(g.rotation.y+=.05,g.rotation.x=Math.sin(d*2)*.3);let x;if(f<sI)x=npe(f/sI)*.8;else if(f<Hw)x=.8;else{const S=(f-Hw)/(1-Hw);x=.8*(1-ape(S))}if(g){const S=g.material;S.opacity=x}const w=a.current;w&&(w.intensity=y*2)}),o?null:C.jsxs("group",{ref:r,position:e,children:[C.jsx(ATt,{ref:n,args:[15,25,32],children:C.jsx("meshStandardMaterial",{color:c,emissive:c,emissiveIntensity:1.5,transparent:!0,opacity:.8,side:2,depthWrite:!1})}),C.jsx(fMe,{count:40,size:3,speed:.5,color:c,scale:[50,50,10]}),C.jsx("pointLight",{ref:a,color:c,intensity:2,distance:100,decay:2})]})}const fm=[0,0,0];function BTt({pose:e}){switch(e){case"coding":return C.jsx(CTt,{position:fm});case"reading":return C.jsx(PTt,{position:fm});case"terminal":return C.jsx(DTt,{position:fm});case"searching":return C.jsx(OTt,{position:fm});case"talking":return C.jsx(RTt,{position:fm});case"managing":return C.jsx(ITt,{position:fm});case"celebrating":return C.jsx(NTt,{position:fm});case"idle":return null;default:return C.jsx(LTt,{position:fm})}}function UTt({agentId:e,pose:t,positionsRef:i,zoom:r}){const n=ee.useRef(null);return Jc(()=>{var c;const a=n.current,s=(c=i.current)==null?void 0:c.get(e);if(!a)return;if(!s){a.visible=!1;return}a.visible=!0,a.position.x+=(s.x-a.position.x)*.15,a.position.y+=(s.y-a.position.y)*.15,a.position.z=0;const l=r*1.8-a.scale.x;if(Math.abs(l)>.001){const u=a.scale.x+l*.2;a.scale.set(u,u,u)}}),C.jsx("group",{ref:n,visible:!1,children:C.jsx(BTt,{pose:t})})}function jTt({agentId:e,positionsRef:t,color:i,onComplete:r}){const n=ee.useRef(null);return Jc(()=>{var o;const a=n.current,s=(o=t.current)==null?void 0:o.get(e);!a||!s||(a.position.x=s.x,a.position.y=s.y,a.position.z=0,a.visible=!0)}),C.jsx("group",{ref:n,visible:!1,children:C.jsx(zTt,{position:fm,color:i,onComplete:r})})}function FTt({containerRef:e,agents:t,zoom:i,spawningAgentIds:r}){const{camera:n,size:a}=mx(),s=ee.useRef(new Map),o=ee.useRef(new Map),l=ee.useRef(0);ee.useEffect(()=>{const u=n;u.left=-a.width/2,u.right=a.width/2,u.top=a.height/2,u.bottom=-a.height/2,u.updateProjectionMatrix()},[n,a]),Jc(()=>{const u=e.current;if(!u||!u.isConnected)return;l.current++;const h=l.current;if(h%30===0||o.current.size===0){o.current.clear();const d=u.querySelectorAll("[data-agent-id]");for(const f of d){const m=f.dataset.agentId;m&&o.current.set(m,f)}}if(h%2===0){const d=u.getBoundingClientRect(),f=d.width/2,m=d.height/2;for(const y of t){if(y.pose==="idle")continue;let g=o.current.get(y.agentId);if(!g||!g.isConnected){const T=u.querySelector(`[data-agent-id="${y.agentId}"]`);if(T)g=T,o.current.set(y.agentId,T);else continue}const x=g.getBoundingClientRect(),w=x.left-d.left+x.width/2,S=x.top-d.top,M=w-f,E=m-S+30*i;s.current.set(y.agentId,{x:M,y:E})}}});const c=ee.useMemo(()=>t.filter(u=>u.pose!=="idle"),[t]);return C.jsxs(C.Fragment,{children:[C.jsx("ambientLight",{intensity:.6}),C.jsx("directionalLight",{position:[100,200,300],intensity:.8}),C.jsx(TTt,{pixelated:!0}),c.map(u=>C.jsx(UTt,{agentId:u.agentId,pose:u.pose,positionsRef:s,zoom:i},u.agentId)),c.filter(u=>r.has(u.agentId)).map(u=>C.jsx(jTt,{agentId:u.agentId,positionsRef:s},`spawn-${u.agentId}`))]})}function VTt({containerRef:e,agents:t,zoom:i,spawningAgentIds:r}){return ee.useMemo(()=>t.some(a=>a.pose!=="idle")||r.size>0,[t,r])?C.jsx(bTt,{orthographic:!0,camera:{position:[0,0,500],zoom:1},gl:{alpha:!0,antialias:!1,powerPreference:"high-performance"},style:{pointerEvents:"none",position:"absolute",inset:"0",zIndex:15},frameloop:"always",children:C.jsx(FTt,{containerRef:e,agents:t,zoom:i,spawningAgentIds:r})}):null}const HTt=new Set(["working","moving","talking","error"]),GTt=new Set(["idle","shutdown","completed"]),WTt=new Set(["coding","reading","terminal","talking","searching","managing"]);function qTt(e){return HTt.has(e.animationState)?!0:GTt.has(e.animationState)?!1:WTt.has(e.pose)}function XTt({positions:e,agentMeta:t}){return ee.useMemo(()=>{const i=[],r=[],n=[],a=[];for(const m of e.values())qTt(m)?n.push(m):a.push(m);const s=new Set(n.map(m=>m.agentId)),o=new Map,l=[];for(const m of n){const y=m.parentAgentId;if(!y||!s.has(y))l.push(m);else{const g=o.get(y)??[];g.push(m),o.set(y,g)}}const u=n.length<=1,h=l.length,f=-((h-1)*fH)/2;for(let m=0;m<h;m++){const y=l[m],g=t.get(y.agentId),x=h===1?0:f+m*fH;i.push({agentId:y.agentId,position:[x,0,0],modelType:"main",color:(g==null?void 0:g.color)??"#8b5cf6",name:(g==null?void 0:g.name)??y.agentId,type:(g==null?void 0:g.type)??"general-purpose",pose:y.pose,animationState:y.animationState,activityLabel:y.activityLabel,lastTool:y.lastTool,parentAgentId:y.parentAgentId});const w=o.get(y.agentId)??[],S=fH*.8,M=(w.length-1)*S,E=x-M/2;for(let T=0;T<w.length;T++){const R=w[T],P=t.get(R.agentId),I=w.length===1?x:E+T*S;i.push({agentId:R.agentId,position:[I,0,3],modelType:u?"main":"sub",color:(P==null?void 0:P.color)??"#8b5cf6",name:(P==null?void 0:P.name)??R.agentId,type:(P==null?void 0:P.type)??"general-purpose",pose:R.pose,animationState:R.animationState,activityLabel:R.activityLabel,lastTool:R.lastTool,parentAgentId:R.parentAgentId})}}for(const m of a){const y=t.get(m.agentId);r.push({agentId:m.agentId,position:[0,0,0],modelType:m.parentAgentId?"sub":"main",color:(y==null?void 0:y.color)??"#8b5cf6",name:(y==null?void 0:y.name)??m.agentId,type:(y==null?void 0:y.type)??"general-purpose",pose:m.pose,animationState:m.animationState,activityLabel:m.activityLabel,lastTool:m.lastTool,parentAgentId:m.parentAgentId})}return{active:i,inactive:r}},[e,t])}const spe={zoom:1,panX:0,panY:0};function YTt(e){const[t,i]=ee.useState(spe),[r,n]=ee.useState(!1),a=ee.useRef(t);a.current=t;const s=ee.useRef(!1),o=ee.useRef({x:0,y:0,panX:0,panY:0});ee.useEffect(()=>{const h=e.current;if(!h)return;function d(f){if(Math.abs(f.deltaX)>Math.abs(f.deltaY))return;f.preventDefault(),f.stopPropagation();const m=h.getBoundingClientRect(),y=f.clientX-m.left,g=f.clientY-m.top;i(x=>{const w=1-f.deltaY*.001,S=Math.round(Math.min(cyt,Math.max(lyt,x.zoom*w))*100)/100;if(S===x.zoom)return x;const M=S/x.zoom,E=y-M*(y-x.panX),T=g-M*(g-x.panY);return{zoom:S,panX:E,panY:T}})}return h.addEventListener("wheel",d,{passive:!1,capture:!0}),()=>h.removeEventListener("wheel",d,{capture:!0})},[e]);const l=ee.useCallback(h=>{const d=h.target.closest("[data-agent-id]");if(h.button===0&&d||h.button!==0&&h.button!==1)return;s.current=!0,n(!0);const f=a.current;o.current={x:h.clientX,y:h.clientY,panX:f.panX,panY:f.panY},h.preventDefault()},[]);ee.useEffect(()=>{function h(f){if(!s.current)return;const m=f.clientX-o.current.x,y=f.clientY-o.current.y;i({zoom:a.current.zoom,panX:o.current.panX+m,panY:o.current.panY+y})}function d(){s.current&&(s.current=!1,n(!1))}return window.addEventListener("mousemove",h),window.addEventListener("mouseup",d),()=>{window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",d)}},[]);const c=ee.useCallback(()=>{i(spe)},[]),u=`translate(${t.panX}px, ${t.panY}px) scale(${t.zoom})`;return{zoom:t.zoom,panX:t.panX,panY:t.panY,isPanning:r,transformStyle:u,handleMouseDown:l,reset:c}}const F7=160,pMe=2,ope=F7*pMe,$Tt={default:{accent:"#8b5cf6",text:"text-violet-400"},warning:{accent:"#f59e0b",text:"text-amber-400"},error:{accent:"#ef4444",text:"text-red-400"},success:{accent:"#22c55e",text:"text-emerald-400"},pulse:{accent:"#10b981",text:"text-emerald-400"}};function KTt({title:e,subtitle:t,variant:i="default",children:r}){const[n,a]=ee.useState(!0),s=ee.useRef(null),o=$Tt[i],l=ee.useCallback(c=>{var h,d;const u=c;try{const f=(h=u._renderer)==null?void 0:h.pipeline;f!=null&&f.logoOverlayPass&&(f.logoOverlayPass.enabled=!1),f==null||f.setWatermark(null)}catch{}try{(d=u.play)==null||d.call(u)}catch{}a(!1)},[]);return ee.useEffect(()=>{if(n)return;const c=s.current;if(!c)return;const u=c.querySelector("canvas");if(!u)return;let h=!1;function d(){h=!0}function f(){h=!1}function m(y){h||u.dispatchEvent(new PointerEvent("pointermove",{clientX:y.clientX,clientY:y.clientY,pointerId:1,pointerType:"mouse",bubbles:!1}))}return u.addEventListener("pointerenter",d),u.addEventListener("pointerleave",f),window.addEventListener("pointermove",m),()=>{u.removeEventListener("pointerenter",d),u.removeEventListener("pointerleave",f),window.removeEventListener("pointermove",m)}},[n]),C.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-5 px-6",children:[C.jsxs("div",{ref:s,className:"relative overflow-hidden shrink-0",style:{width:F7,height:F7},children:[n&&C.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:C.jsx("div",{className:"w-8 h-8 border-2 rounded-full animate-spin",style:{borderColor:`${o.accent}30`,borderTopColor:"transparent"}})}),C.jsx("div",{style:{width:ope,height:ope,transform:`scale(${1/pMe})`,transformOrigin:"top left"},children:C.jsx($_e,{scene:K_e.main,onLoad:l,style:{width:"100%",height:"100%",opacity:n?0:1,transition:"opacity 0.5s ease-in"}})}),!n&&C.jsx("div",{className:"absolute inset-[-6px] rounded-2xl pointer-events-none transition-all duration-700",style:{boxShadow:`0 0 20px ${o.accent}25, 0 0 40px ${o.accent}10`}})]}),C.jsxs("div",{className:"flex flex-col items-center gap-2 max-w-sm text-center",children:[C.jsx("h3",{className:`${o.text} text-sm font-mono font-semibold`,children:e}),t&&C.jsx("p",{className:"text-zinc-500 text-xs font-mono leading-relaxed",children:t}),r]})]})}function pG({n:e,children:t}){return C.jsxs("div",{className:"flex items-start gap-2.5",children:[C.jsx("span",{className:"shrink-0 w-5 h-5 rounded-full flex items-center justify-center text-[10px] font-mono font-bold bg-violet-500/15 text-violet-400",children:e}),C.jsx("span",{className:"text-zinc-400 text-xs font-mono pt-0.5 leading-relaxed",children:t})]})}function MK(){Dye();const e=ee.useRef(null),t=Ni(Z=>Z.session),i=Ni(Z=>Z.agents),r=Ni(Z=>Z.selectedAgentId),n=Ni(Z=>Z.selectAgent),{positions:a,speechBubbles:s,interactionLines:o,showLabels:l,showInteractions:c}=C_(),{zoom:u,transformStyle:h,isPanning:d,handleMouseDown:f,reset:m}=YTt(e),[y,g]=ee.useState(null),[x,w]=ee.useState(new Map),S=ee.useRef({agentId:null,mouseX:0,mouseY:0,agentX:0,agentY:0}),M=ee.useRef(u);M.current=u;const E=ee.useMemo(()=>{const Z=new Map;for(const ce of i)Z.set(ce.id,Ch(ce.id,ce.name||ce.id,ce.type??void 0));return Z},[i]),T=ee.useMemo(()=>{const Z=new Map;for(const ce of i){const me=jHe(ce.name||ce.id);Z.set(ce.id,me.primary)}return Z},[i]),R=ee.useMemo(()=>{const Z=new Map;for(const ce of i)Z.set(ce.id,ce.type);return Z},[i]),P=ee.useMemo(()=>{const Z=new Map;for(const ce of i)Z.set(ce.id,{name:E.get(ce.id)??ce.id,type:R.get(ce.id)??"general-purpose",color:T.get(ce.id)??"#8b5cf6",status:ce.status});return Z},[i,E,R,T]),{active:I,inactive:L}=XTt({positions:a,agentMeta:P}),z=ee.useMemo(()=>{const Z=new Map;for(const ce of s){const me=Z.get(ce.fromAgentId)??[];me.push(ce),Z.set(ce.fromAgentId,me)}return Z},[s]),U=ee.useCallback(Z=>{n(r===Z?null:Z)},[n,r]),j=I.length>0?I:[{agentId:"claude-main",position:[0,0,0],modelType:"main",color:"#8b5cf6",name:"Claude",type:"general-purpose",pose:"idle",animationState:"idle",activityLabel:null,lastTool:null,parentAgentId:null}],F=ee.useMemo(()=>j.map(Z=>Z.agentId).join(","),[j]),[G,H]=ee.useState({w:1200,h:600}),W=ee.useMemo(()=>{const{w:Z,h:ce}=G,me=j.length,he=me*H_+(me-1)*cde,we=(Z-he)/2,Ee=(ce-uyt)/2,Se=new Map;for(let Ne=0;Ne<me;Ne++)Se.set(j[Ne].agentId,{x:Math.max(0,we+Ne*(H_+cde)),y:Math.max(0,Ee)});return Se},[F,G,j]);ee.useEffect(()=>{const Z=e.current;if(!Z)return;const ce=new ResizeObserver(me=>{const{width:he,height:we}=me[0].contentRect;he>0&&we>0&&H({w:he,h:we})});return ce.observe(Z),()=>ce.disconnect()},[]),ee.useEffect(()=>{const Z=new Set(j.map(ce=>ce.agentId));w(ce=>{let me=!1;for(const we of ce.keys())Z.has(we)||(me=!0);if(!me)return ce;const he=new Map;for(const[we,Ee]of ce)Z.has(we)&&he.set(we,Ee);return he})},[F,j]);const Q=ee.useCallback(Z=>x.get(Z)??W.get(Z)??{x:0,y:0},[x,W]),ne=ee.useCallback((Z,ce)=>{if(ce.button!==0)return;ce.stopPropagation();const me=Q(Z);S.current={agentId:Z,mouseX:ce.clientX,mouseY:ce.clientY,agentX:me.x,agentY:me.y},g(Z)},[Q]);ee.useEffect(()=>{function Z(me){const he=S.current;if(!he.agentId)return;const we=M.current,Ee=(me.clientX-he.mouseX)/we,Se=(me.clientY-he.mouseY)/we;w(Ne=>{const Pe=new Map(Ne);return Pe.set(he.agentId,{x:he.agentX+Ee,y:he.agentY+Se}),Pe})}function ce(){S.current.agentId&&(S.current.agentId=null,g(null))}return window.addEventListener("mousemove",Z),window.addEventListener("mouseup",ce),()=>{window.removeEventListener("mousemove",Z),window.removeEventListener("mouseup",ce)}},[]);const se=ee.useMemo(()=>j.map(Z=>({agentId:Z.agentId,pose:Z.pose})),[j]),$=ee.useRef(new Set),[J,ae]=ee.useState(new Set);ee.useEffect(()=>{const Z=new Set(j.map(he=>he.agentId)),ce=$.current,me=new Set;for(const he of Z)ce.has(he)||me.add(he);if($.current=Z,me.size>0){ae(me);const he=setTimeout(()=>ae(new Set),1500);return()=>clearTimeout(he)}},[F,j]);const oe=ee.useCallback(Z=>{Z.target.closest("[data-agent-id]")||m()},[m]),xe=y||d?"grabbing":"default";return t?C.jsxs("div",{className:"flex flex-col h-full overflow-hidden relative",children:[C.jsx($ae,{}),C.jsxs("div",{ref:e,className:"flex-1 relative overflow-hidden",style:{background:"radial-gradient(ellipse at center, #0f0f1a 0%, #0a0a12 70%)",minHeight:0,cursor:xe},onMouseDown:f,onDoubleClick:oe,children:[C.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:["linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px)","linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px)"].join(","),backgroundSize:`${40*u}px ${40*u}px`}}),C.jsx("div",{className:"absolute inset-0",style:{transform:h,transformOrigin:"0 0",willChange:y||d?"transform":"auto"},children:j.map(Z=>{const ce=Q(Z.agentId),me=y===Z.agentId,he=z.get(Z.agentId)??[],we=he.length>0?he[he.length-1]:null;return C.jsxs("div",{"data-agent-id":Z.agentId,className:`absolute flex flex-col items-center${J.has(Z.agentId)?" cam-agent-spawning":""}`,style:{left:`${ce.x}px`,top:`${ce.y}px`,width:`${H_}px`,zIndex:me?50:10,cursor:me?"grabbing":"grab",transition:me?"none":"left 0.3s ease, top 0.3s ease",userSelect:"none"},onMouseDown:Ee=>ne(Z.agentId,Ee),children:[we&&C.jsx("div",{className:"mb-2 max-w-[280px]",children:C.jsx(Z_e,{bubble:we,color:Z.color},we.id)}),C.jsx(fyt,{modelType:Z.modelType,isSelected:r===Z.agentId,isDragging:y===Z.agentId,onClick:()=>U(Z.agentId),color:Z.color,pose:Z.pose,animationState:Z.animationState}),C.jsx(byt,{agentId:Z.agentId,name:Z.name,color:Z.color,activityLabel:Z.activityLabel,speechBubbles:he,showLabels:l,hideBubble:!0})]},Z.agentId)})}),C.jsx(VTt,{containerRef:e,agents:se,zoom:u,spawningAgentIds:J}),C.jsx(Syt,{containerRef:e,interactionLines:o,positions:a,agentColors:T,showInteractions:c}),u!==1&&C.jsxs("div",{className:"absolute bottom-3 right-3 z-30 text-xs font-mono text-zinc-500 bg-black/50 px-2 py-1 rounded select-none pointer-events-none",children:[Math.round(u*100),"%"]})]}),C.jsx(wyt,{agents:L,selectedAgentId:r,onSelectAgent:U})]}):C.jsxs("div",{className:"flex flex-col h-full overflow-hidden relative",children:[C.jsx($ae,{}),C.jsxs("div",{className:"flex-1 relative overflow-hidden flex items-center justify-center",style:{background:"radial-gradient(ellipse at center, #0f0f1a 0%, #0a0a12 70%)"},children:[C.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:["linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px)","linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px)"].join(","),backgroundSize:"40px 40px"}}),C.jsxs(KTt,{title:"Welcome to CAM!",subtitle:"Start a Claude Code session to see your agents here in real-time.",variant:"default",children:[C.jsxs("div",{className:"flex flex-col gap-2 mt-3 text-left",children:[C.jsx(pG,{n:1,children:"Open a terminal in this project"}),C.jsxs(pG,{n:2,children:["Run ",C.jsx("code",{className:"px-1.5 py-0.5 rounded bg-zinc-800 text-violet-300 text-[11px] font-mono",children:"claude"})," to start Claude Code"]}),C.jsx(pG,{n:3,children:"Agents will appear here as they work"})]}),C.jsx("p",{className:"text-zinc-600 text-[10px] font-mono mt-3",children:"Or select a previous session from the picker above"})]})]})]})}const QTt=[{id:"overview",label:"Overview"},{id:"dependencies",label:"Deps"},{id:"activity",label:"Activity"}];function EK(){const{selectedTaskId:e,tasks:t,selectTask:i,sprints:r,activeProject:n}=_n(),a=oz(),[s,o]=ee.useState("overview"),[l,c]=ee.useState([]),[u,h]=ee.useState(!1),d=t.find(S=>S.id===e);if(ee.useEffect(()=>{s==="activity"&&d&&n&&(h(!0),KEe(n.id,d.id).then(S=>c(S.activities??[])).catch(()=>c([])).finally(()=>h(!1)))},[s,d==null?void 0:d.id,n==null?void 0:n.id]),!d)return null;const f=r.find(S=>S.id===d.sprintId),m=G7(d.priority),y=FEe(d.status),g=d.dependsOn.map(S=>t.find(M=>M.id===S)).filter(S=>S!==void 0),x=d.blockedBy.map(S=>t.find(M=>M.id===S)).filter(S=>S!==void 0),w=t.filter(S=>S.dependsOn.includes(d.id)||S.blockedBy.includes(d.id));return C.jsxs("div",{className:"h-full flex flex-col",children:[C.jsxs("div",{className:"p-4 border-b border-cam-border/30 shrink-0",children:[C.jsxs("div",{className:"flex items-start justify-between mb-3",children:[C.jsx("h3",{className:"text-sm font-semibold text-cam-text leading-tight flex-1 pr-2",children:d.title}),C.jsx("button",{onClick:()=>i(null),className:"text-cam-text-muted hover:text-cam-text transition-colors p-1 shrink-0",children:C.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),C.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-3",children:[C.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded border font-medium ${m}`,children:d.priority}),C.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded font-medium ${y}`,children:d.status.replace(/_/g," ")}),d.complexity&&C.jsxs("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-cam-surface-3 text-cam-text-muted border border-cam-border/50",children:["C",d.complexity]})]}),C.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[f&&C.jsxs("div",{className:"bg-cam-surface-2 rounded-md px-2 py-1.5",children:[C.jsx("div",{className:"text-[9px] text-cam-text-muted",children:"Sprint"}),C.jsx("div",{className:"text-[10px] text-cam-text font-medium truncate",children:f.name})]}),d.prdSection&&C.jsxs("div",{className:"bg-cam-surface-2 rounded-md px-2 py-1.5",children:[C.jsx("div",{className:"text-[9px] text-cam-text-muted",children:"Section"}),C.jsx("div",{className:"text-[10px] text-cam-text font-medium truncate",children:d.prdSection})]}),d.assignedAgent&&(()=>{const S=a(d.assignedAgent);return C.jsxs("div",{className:"bg-cam-surface-2 rounded-md px-2 py-1.5",children:[C.jsx("div",{className:"text-[9px] text-cam-text-muted",children:"Agent"}),C.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[C.jsx("div",{className:"w-3 h-3 rounded-full flex items-center justify-center text-[7px] font-bold",style:{backgroundColor:`${f0(d.assignedAgent)}20`,color:f0(d.assignedAgent)},children:S.charAt(0).toUpperCase()}),C.jsx("span",{className:"text-[10px] text-cam-text font-medium",children:S})]})]})})()]})]}),C.jsx("div",{className:"flex border-b border-cam-border/30 shrink-0",children:QTt.map(S=>{const M=S.id==="dependencies"?g.length+x.length+w.length:S.id==="activity"?l.length:0;return C.jsxs("button",{onClick:()=>o(S.id),className:`flex-1 py-2 text-[10px] font-medium transition-colors border-b-2 ${s===S.id?"text-cam-accent border-cam-accent":"text-cam-text-muted border-transparent hover:text-cam-text-secondary"}`,children:[S.label,M>0&&` (${M})`]},S.id)})}),C.jsxs("div",{className:"flex-1 overflow-y-auto modern-scrollbar",children:[s==="overview"&&C.jsx(ZTt,{task:d}),s==="dependencies"&&C.jsx(JTt,{dependsOn:g,blockedBy:x,blocks:w,onSelectTask:i,resolveAgentName:a}),s==="activity"&&C.jsx(tCt,{activities:l,loading:u,resolveAgentName:a})]})]})}function ZTt({task:e}){return C.jsxs("div",{className:"p-3 space-y-4",children:[e.description&&C.jsxs("div",{children:[C.jsx("h4",{className:"text-[10px] uppercase tracking-wider text-cam-text-muted font-medium mb-1",children:"Description"}),C.jsx("p",{className:"text-[11px] text-cam-text-secondary leading-relaxed",children:e.description})]}),e.acceptanceCriteria&&e.acceptanceCriteria.length>0&&C.jsxs("div",{children:[C.jsx("h4",{className:"text-[10px] uppercase tracking-wider text-cam-text-muted font-medium mb-1",children:"Acceptance Criteria"}),C.jsx("ul",{className:"space-y-1",children:e.acceptanceCriteria.map((t,i)=>C.jsxs("li",{className:"flex items-start gap-1.5 text-[11px] text-cam-text-secondary",children:[C.jsx("span",{className:"text-cam-accent mt-0.5 shrink-0",children:e.status==="completed"?"✓":"○"}),C.jsx("span",{children:t})]},i))})]}),e.tags&&e.tags.length>0&&C.jsxs("div",{children:[C.jsx("h4",{className:"text-[10px] uppercase tracking-wider text-cam-text-muted font-medium mb-1",children:"Tags"}),C.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map(t=>C.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-cam-surface-3 text-cam-text-muted border border-cam-border/30",children:t},t))})]}),C.jsxs("div",{children:[C.jsx("h4",{className:"text-[10px] uppercase tracking-wider text-cam-text-muted font-medium mb-1",children:"Timeline"}),C.jsxs("div",{className:"space-y-1 text-[10px]",children:[C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-cam-text-muted",children:"Created"}),C.jsx("span",{className:"text-cam-text-secondary font-mono",children:qc(e.createdAt)})]}),e.startedAt&&C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-cam-text-muted",children:"Started"}),C.jsx("span",{className:"text-cam-text-secondary font-mono",children:qc(e.startedAt)})]}),e.completedAt&&C.jsxs("div",{className:"flex justify-between",children:[C.jsx("span",{className:"text-cam-text-muted",children:"Completed"}),C.jsx("span",{className:"text-cam-text-secondary font-mono",children:qc(e.completedAt)})]})]})]})]})}function JTt({dependsOn:e,blockedBy:t,blocks:i,onSelectTask:r,resolveAgentName:n}){return e.length===0&&t.length===0&&i.length===0?C.jsx("p",{className:"text-xs text-cam-text-muted p-4 text-center",children:"No dependencies"}):C.jsxs("div",{className:"p-3 space-y-4",children:[t.length>0&&C.jsx(mG,{title:"Blocked By",tasks:t,color:"text-red-400",onSelect:r,resolveAgentName:n}),e.length>0&&C.jsx(mG,{title:"Depends On",tasks:e,color:"text-yellow-400",onSelect:r,resolveAgentName:n}),i.length>0&&C.jsx(mG,{title:"Blocks",tasks:i,color:"text-blue-400",onSelect:r,resolveAgentName:n})]})}function mG({title:e,tasks:t,color:i,onSelect:r,resolveAgentName:n}){return C.jsxs("div",{children:[C.jsxs("h4",{className:`text-[10px] uppercase tracking-wider font-medium mb-1 ${i}`,children:[e," (",t.length,")"]}),C.jsx("div",{className:"space-y-1",children:t.map(a=>C.jsxs("button",{onClick:()=>r(a.id),className:"w-full text-left px-2 py-1.5 rounded hover:bg-cam-surface-2 transition-colors group",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${eCt(a.status)}`}),C.jsx("span",{className:"text-[11px] text-cam-text-secondary group-hover:text-cam-text truncate",children:a.title})]}),C.jsxs("div",{className:"flex items-center gap-2 ml-3.5 mt-0.5",children:[C.jsx("span",{className:"text-[9px] text-cam-text-muted capitalize",children:a.status.replace(/_/g," ")}),a.assignedAgent&&C.jsxs("span",{className:"text-[9px] text-cam-text-muted",children:["@",n(a.assignedAgent)]})]})]},a.id))})]})}function eCt(e){return{backlog:"bg-gray-500",planned:"bg-blue-500",pending:"bg-yellow-500",in_progress:"bg-emerald-500",in_review:"bg-purple-500",completed:"bg-green-500",blocked:"bg-red-500",deferred:"bg-gray-500"}[e]||"bg-gray-500"}function tCt({activities:e,loading:t,resolveAgentName:i}){return t?C.jsx("div",{className:"flex items-center justify-center p-4",children:C.jsx("span",{className:"text-[10px] text-cam-text-muted animate-pulse",children:"Loading activities..."})}):e.length===0?C.jsx("p",{className:"text-xs text-cam-text-muted p-4 text-center",children:"No activity recorded"}):C.jsx("div",{className:"divide-y divide-cam-border/20",children:e.map(r=>C.jsxs("div",{className:"px-3 py-2",children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("span",{className:"text-[11px] font-medium text-cam-accent",children:iCt(r.activityType)}),C.jsx("span",{className:"text-[9px] text-cam-text-muted font-mono",children:gu(r.timestamp)})]}),C.jsx("div",{className:"flex items-center gap-2 mt-0.5",children:C.jsxs("span",{className:"text-[9px] text-cam-text-muted",children:["@",i(r.agentId)]})}),r.details&&C.jsx("p",{className:"text-[10px] text-cam-text-secondary mt-0.5",children:r.details})]},r.id))})}function iCt(e){return{task_created:"Task Created",task_started:"Task Started",task_completed:"Task Completed",task_blocked:"Task Blocked",task_unblocked:"Task Unblocked",agent_assigned:"Agent Assigned",file_modified:"File Modified",error_occurred:"Error Occurred",manual_update:"Manual Update"}[e]||e.replace(/_/g," ")}const tU=ee.createContext(null);tU.displayName="PanelGroupContext";const Ha={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},TK=10,$x=ee.useLayoutEffect,lpe=PEe.useId,rCt=typeof lpe=="function"?lpe:()=>null;let nCt=0;function CK(e=null){const t=rCt(),i=ee.useRef(e||t||null);return i.current===null&&(i.current=""+nCt++),e??i.current}function mMe({children:e,className:t="",collapsedSize:i,collapsible:r,defaultSize:n,forwardedRef:a,id:s,maxSize:o,minSize:l,onCollapse:c,onExpand:u,onResize:h,order:d,style:f,tagName:m="div",...y}){const g=ee.useContext(tU);if(g===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:w,getPanelSize:S,getPanelStyle:M,groupId:E,isPanelCollapsed:T,reevaluatePanelConstraints:R,registerPanel:P,resizePanel:I,unregisterPanel:L}=g,z=CK(s),U=ee.useRef({callbacks:{onCollapse:c,onExpand:u,onResize:h},constraints:{collapsedSize:i,collapsible:r,defaultSize:n,maxSize:o,minSize:l},id:z,idIsFromProps:s!==void 0,order:d});ee.useRef({didLogMissingDefaultSizeWarning:!1}),$x(()=>{const{callbacks:F,constraints:G}=U.current,H={...G};U.current.id=z,U.current.idIsFromProps=s!==void 0,U.current.order=d,F.onCollapse=c,F.onExpand=u,F.onResize=h,G.collapsedSize=i,G.collapsible=r,G.defaultSize=n,G.maxSize=o,G.minSize=l,(H.collapsedSize!==G.collapsedSize||H.collapsible!==G.collapsible||H.maxSize!==G.maxSize||H.minSize!==G.minSize)&&R(U.current,H)}),$x(()=>{const F=U.current;return P(F),()=>{L(F)}},[d,z,P,L]),ee.useImperativeHandle(a,()=>({collapse:()=>{x(U.current)},expand:F=>{w(U.current,F)},getId(){return z},getSize(){return S(U.current)},isCollapsed(){return T(U.current)},isExpanded(){return!T(U.current)},resize:F=>{I(U.current,F)}}),[x,w,S,T,z,I]);const j=M(U.current,n);return ee.createElement(m,{...y,children:e,className:t,id:z,style:{...j,...f},[Ha.groupId]:E,[Ha.panel]:"",[Ha.panelCollapsible]:r||void 0,[Ha.panelId]:z,[Ha.panelSize]:parseFloat(""+j.flexGrow).toFixed(1)})}const gMe=ee.forwardRef((e,t)=>ee.createElement(mMe,{...e,forwardedRef:t}));mMe.displayName="Panel";gMe.displayName="forwardRef(Panel)";let V7=null,II=-1,jv=null;function aCt(e,t){if(t){const i=(t&wMe)!==0,r=(t&_Me)!==0,n=(t&SMe)!==0,a=(t&AMe)!==0;if(i)return n?"se-resize":a?"ne-resize":"e-resize";if(r)return n?"sw-resize":a?"nw-resize":"w-resize";if(n)return"s-resize";if(a)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function sCt(){jv!==null&&(document.head.removeChild(jv),V7=null,jv=null,II=-1)}function gG(e,t){var i,r;const n=aCt(e,t);if(V7!==n){if(V7=n,jv===null&&(jv=document.createElement("style"),document.head.appendChild(jv)),II>=0){var a;(a=jv.sheet)===null||a===void 0||a.removeRule(II)}II=(i=(r=jv.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${n} !important;}`))!==null&&i!==void 0?i:-1}}function vMe(e){return e.type==="keydown"}function yMe(e){return e.type.startsWith("pointer")}function xMe(e){return e.type.startsWith("mouse")}function iU(e){if(yMe(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(xMe(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function oCt(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function lCt(e,t,i){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function cCt(e,t){if(e===t)throw new Error("Cannot compare node with itself");const i={a:hpe(e),b:hpe(t)};let r;for(;i.a.at(-1)===i.b.at(-1);)e=i.a.pop(),t=i.b.pop(),r=e;br(r,"Stacking order can only be calculated for elements with a common ancestor");const n={a:upe(cpe(i.a)),b:upe(cpe(i.b))};if(n.a===n.b){const a=r.childNodes,s={a:i.a.at(-1),b:i.b.at(-1)};let o=a.length;for(;o--;){const l=a[o];if(l===s.a)return 1;if(l===s.b)return-1}}return Math.sign(n.a-n.b)}const uCt=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function hCt(e){var t;const i=getComputedStyle((t=bMe(e))!==null&&t!==void 0?t:e).display;return i==="flex"||i==="inline-flex"}function dCt(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||hCt(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||uCt.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function cpe(e){let t=e.length;for(;t--;){const i=e[t];if(br(i,"Missing node"),dCt(i))return i}return null}function upe(e){return e&&Number(getComputedStyle(e).zIndex)||0}function hpe(e){const t=[];for(;e;)t.push(e),e=bMe(e);return t}function bMe(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const wMe=1,_Me=2,SMe=4,AMe=8,fCt=oCt()==="coarse";let Ed=[],q_=!1,gx=new Map,rU=new Map;const qP=new Set;function pCt(e,t,i,r,n){var a;const{ownerDocument:s}=t,o={direction:i,element:t,hitAreaMargins:r,setResizeHandlerState:n},l=(a=gx.get(s))!==null&&a!==void 0?a:0;return gx.set(s,l+1),qP.add(o),Qk(),function(){var u;rU.delete(e),qP.delete(o);const h=(u=gx.get(s))!==null&&u!==void 0?u:1;if(gx.set(s,h-1),Qk(),h===1&&gx.delete(s),Ed.includes(o)){const d=Ed.indexOf(o);d>=0&&Ed.splice(d,1),DK(),n("up",!0,null)}}}function mCt(e){const{target:t}=e,{x:i,y:r}=iU(e);q_=!0,PK({target:t,x:i,y:r}),Qk(),Ed.length>0&&(Zk("down",e),e.preventDefault(),MMe(t)||e.stopImmediatePropagation())}function vG(e){const{x:t,y:i}=iU(e);if(q_&&e.buttons===0&&(q_=!1,Zk("up",e)),!q_){const{target:r}=e;PK({target:r,x:t,y:i})}Zk("move",e),DK(),Ed.length>0&&e.preventDefault()}function yG(e){const{target:t}=e,{x:i,y:r}=iU(e);rU.clear(),q_=!1,Ed.length>0&&(e.preventDefault(),MMe(t)||e.stopImmediatePropagation()),Zk("up",e),PK({target:t,x:i,y:r}),DK(),Qk()}function MMe(e){let t=e;for(;t;){if(t.hasAttribute(Ha.resizeHandle))return!0;t=t.parentElement}return!1}function PK({target:e,x:t,y:i}){Ed.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),qP.forEach(n=>{const{element:a,hitAreaMargins:s}=n,o=a.getBoundingClientRect(),{bottom:l,left:c,right:u,top:h}=o,d=fCt?s.coarse:s.fine;if(t>=c-d&&t<=u+d&&i>=h-d&&i<=l+d){if(r!==null&&document.contains(r)&&a!==r&&!a.contains(r)&&!r.contains(a)&&cCt(r,a)>0){let m=r,y=!1;for(;m&&!m.contains(a);){if(lCt(m.getBoundingClientRect(),o)){y=!0;break}m=m.parentElement}if(y)return}Ed.push(n)}})}function xG(e,t){rU.set(e,t)}function DK(){let e=!1,t=!1;Ed.forEach(r=>{const{direction:n}=r;n==="horizontal"?e=!0:t=!0});let i=0;rU.forEach(r=>{i|=r}),e&&t?gG("intersection",i):e?gG("horizontal",i):t?gG("vertical",i):sCt()}let bG=new AbortController;function Qk(){bG.abort(),bG=new AbortController;const e={capture:!0,signal:bG.signal};qP.size&&(q_?(Ed.length>0&&gx.forEach((t,i)=>{const{body:r}=i;t>0&&(r.addEventListener("contextmenu",yG,e),r.addEventListener("pointerleave",vG,e),r.addEventListener("pointermove",vG,e))}),window.addEventListener("pointerup",yG,e),window.addEventListener("pointercancel",yG,e)):gx.forEach((t,i)=>{const{body:r}=i;t>0&&(r.addEventListener("pointerdown",mCt,e),r.addEventListener("pointermove",vG,e))}))}function Zk(e,t){qP.forEach(i=>{const{setResizeHandlerState:r}=i,n=Ed.includes(i);r(e,n,t)})}function gCt(){const[e,t]=ee.useState(0);return ee.useCallback(()=>t(i=>i+1),[])}function br(e,t){if(!e)throw console.error(t),Error(t)}function gb(e,t,i=TK){return e.toFixed(i)===t.toFixed(i)?0:e>t?1:-1}function Mm(e,t,i=TK){return gb(e,t,i)===0}function hu(e,t,i){return gb(e,t,i)===0}function vCt(e,t,i){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const n=e[r],a=t[r];if(!hu(n,a,i))return!1}return!0}function S_({panelConstraints:e,panelIndex:t,size:i}){const r=e[t];br(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:n=0,collapsible:a,maxSize:s=100,minSize:o=0}=r;if(gb(i,o)<0)if(a){const l=(n+o)/2;gb(i,l)<0?i=n:i=o}else i=o;return i=Math.min(s,i),i=parseFloat(i.toFixed(TK)),i}function CT({delta:e,initialLayout:t,panelConstraints:i,pivotIndices:r,prevLayout:n,trigger:a}){if(hu(e,0))return t;const s=[...t],[o,l]=r;br(o!=null,"Invalid first pivot index"),br(l!=null,"Invalid second pivot index");let c=0;if(a==="keyboard"){{const h=e<0?l:o,d=i[h];br(d,`Panel constraints not found for index ${h}`);const{collapsedSize:f=0,collapsible:m,minSize:y=0}=d;if(m){const g=t[h];if(br(g!=null,`Previous layout not found for panel index ${h}`),hu(g,f)){const x=y-g;gb(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const h=e<0?o:l,d=i[h];br(d,`No panel constraints found for index ${h}`);const{collapsedSize:f=0,collapsible:m,minSize:y=0}=d;if(m){const g=t[h];if(br(g!=null,`Previous layout not found for panel index ${h}`),hu(g,y)){const x=g-f;gb(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}}{const h=e<0?1:-1;let d=e<0?l:o,f=0;for(;;){const y=t[d];br(y!=null,`Previous layout not found for panel index ${d}`);const x=S_({panelConstraints:i,panelIndex:d,size:100})-y;if(f+=x,d+=h,d<0||d>=i.length)break}const m=Math.min(Math.abs(e),Math.abs(f));e=e<0?0-m:m}{let d=e<0?o:l;for(;d>=0&&d<i.length;){const f=Math.abs(e)-Math.abs(c),m=t[d];br(m!=null,`Previous layout not found for panel index ${d}`);const y=m-f,g=S_({panelConstraints:i,panelIndex:d,size:y});if(!hu(m,g)&&(c+=m-g,s[d]=g,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?d--:d++}}if(vCt(n,s))return n;{const h=e<0?l:o,d=t[h];br(d!=null,`Previous layout not found for panel index ${h}`);const f=d+c,m=S_({panelConstraints:i,panelIndex:h,size:f});if(s[h]=m,!hu(m,f)){let y=f-m,x=e<0?l:o;for(;x>=0&&x<i.length;){const w=s[x];br(w!=null,`Previous layout not found for panel index ${x}`);const S=w+y,M=S_({panelConstraints:i,panelIndex:x,size:S});if(hu(w,M)||(y-=M-w,s[x]=M),hu(y,0))break;e>0?x--:x++}}}const u=s.reduce((h,d)=>d+h,0);return hu(u,100)?s:n}function yCt({layout:e,panelsArray:t,pivotIndices:i}){let r=0,n=100,a=0,s=0;const o=i[0];br(o!=null,"No pivot index found"),t.forEach((h,d)=>{const{constraints:f}=h,{maxSize:m=100,minSize:y=0}=f;d===o?(r=y,n=m):(a+=y,s+=m)});const l=Math.min(n,100-a),c=Math.max(r,100-s),u=e[o];return{valueMax:l,valueMin:c,valueNow:u}}function XP(e,t=document){return Array.from(t.querySelectorAll(`[${Ha.resizeHandleId}][data-panel-group-id="${e}"]`))}function EMe(e,t,i=document){const n=XP(e,i).findIndex(a=>a.getAttribute(Ha.resizeHandleId)===t);return n??null}function TMe(e,t,i){const r=EMe(e,t,i);return r!=null?[r,r+1]:[-1,-1]}function CMe(e,t=document){var i;if(t instanceof HTMLElement&&(t==null||(i=t.dataset)===null||i===void 0?void 0:i.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function nU(e,t=document){const i=t.querySelector(`[${Ha.resizeHandleId}="${e}"]`);return i||null}function xCt(e,t,i,r=document){var n,a,s,o;const l=nU(t,r),c=XP(e,r),u=l?c.indexOf(l):-1,h=(n=(a=i[u])===null||a===void 0?void 0:a.id)!==null&&n!==void 0?n:null,d=(s=(o=i[u+1])===null||o===void 0?void 0:o.id)!==null&&s!==void 0?s:null;return[h,d]}function bCt({committedValuesRef:e,eagerValuesRef:t,groupId:i,layout:r,panelDataArray:n,panelGroupElement:a,setLayout:s}){ee.useRef({didWarnAboutMissingResizeHandle:!1}),$x(()=>{if(!a)return;const o=XP(i,a);for(let l=0;l<n.length-1;l++){const{valueMax:c,valueMin:u,valueNow:h}=yCt({layout:r,panelsArray:n,pivotIndices:[l,l+1]}),d=o[l];if(d!=null){const f=n[l];br(f,`No panel data found for index "${l}"`),d.setAttribute("aria-controls",f.id),d.setAttribute("aria-valuemax",""+Math.round(c)),d.setAttribute("aria-valuemin",""+Math.round(u)),d.setAttribute("aria-valuenow",h!=null?""+Math.round(h):"")}}return()=>{o.forEach((l,c)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[i,r,n,a]),ee.useEffect(()=>{if(!a)return;const o=t.current;br(o,"Eager values not found");const{panelDataArray:l}=o,c=CMe(i,a);br(c!=null,`No group found for id "${i}"`);const u=XP(i,a);br(u,`No resize handles found for group id "${i}"`);const h=u.map(d=>{const f=d.getAttribute(Ha.resizeHandleId);br(f,"Resize handle element has no handle id attribute");const[m,y]=xCt(i,f,l,a);if(m==null||y==null)return()=>{};const g=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const w=l.findIndex(S=>S.id===m);if(w>=0){const S=l[w];br(S,`No panel data found for index ${w}`);const M=r[w],{collapsedSize:E=0,collapsible:T,minSize:R=0}=S.constraints;if(M!=null&&T){const P=CT({delta:hu(M,E)?R-E:E-M,initialLayout:r,panelConstraints:l.map(I=>I.constraints),pivotIndices:TMe(i,f,a),prevLayout:r,trigger:"keyboard"});r!==P&&s(P)}}break}}};return d.addEventListener("keydown",g),()=>{d.removeEventListener("keydown",g)}});return()=>{h.forEach(d=>d())}},[a,e,t,i,r,n,s])}function dpe(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}function PMe(e,t){const i=e==="horizontal",{x:r,y:n}=iU(t);return i?r:n}function wCt(e,t,i,r,n){const a=i==="horizontal",s=nU(t,n);br(s,`No resize handle element found for id "${t}"`);const o=s.getAttribute(Ha.groupId);br(o,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const c=PMe(i,e),u=CMe(o,n);br(u,`No group element found for id "${o}"`);const h=u.getBoundingClientRect(),d=a?h.width:h.height;return(c-l)/d*100}function _Ct(e,t,i,r,n,a){if(vMe(e)){const s=i==="horizontal";let o=0;e.shiftKey?o=100:n!=null?o=n:o=10;let l=0;switch(e.key){case"ArrowDown":l=s?0:o;break;case"ArrowLeft":l=s?-o:0;break;case"ArrowRight":l=s?o:0;break;case"ArrowUp":l=s?0:-o;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:wCt(e,t,i,r,a)}function SCt({panelDataArray:e}){const t=Array(e.length),i=e.map(a=>a.constraints);let r=0,n=100;for(let a=0;a<e.length;a++){const s=i[a];br(s,`Panel constraints not found for index ${a}`);const{defaultSize:o}=s;o!=null&&(r++,t[a]=o,n-=o)}for(let a=0;a<e.length;a++){const s=i[a];br(s,`Panel constraints not found for index ${a}`);const{defaultSize:o}=s;if(o!=null)continue;const l=e.length-r,c=n/l;r++,t[a]=c,n-=c}return t}function Gw(e,t,i){t.forEach((r,n)=>{const a=e[n];br(a,`Panel data not found for index ${n}`);const{callbacks:s,constraints:o,id:l}=a,{collapsedSize:c=0,collapsible:u}=o,h=i[l];if(h==null||r!==h){i[l]=r;const{onCollapse:d,onExpand:f,onResize:m}=s;m&&m(r,h),u&&(d||f)&&(f&&(h==null||Mm(h,c))&&!Mm(r,c)&&f(),d&&(h==null||!Mm(h,c))&&Mm(r,c)&&d())}})}function oI(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!=t[i])return!1;return!0}function ACt({defaultSize:e,dragState:t,layout:i,panelData:r,panelIndex:n,precision:a=3}){const s=i[n];let o;return s==null?o=e!=null?e.toPrecision(a):"1":r.length===1?o="1":o=s.toPrecision(a),{flexBasis:0,flexGrow:o,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function MCt(e,t=10){let i=null;return(...n)=>{i!==null&&clearTimeout(i),i=setTimeout(()=>{e(...n)},t)}}function fpe(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,i)=>{localStorage.setItem(t,i)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function DMe(e){return`react-resizable-panels:${e}`}function OMe(e){return e.map(t=>{const{constraints:i,id:r,idIsFromProps:n,order:a}=t;return n?r:a?`${a}:${JSON.stringify(i)}`:JSON.stringify(i)}).sort((t,i)=>t.localeCompare(i)).join(",")}function RMe(e,t){try{const i=DMe(e),r=t.getItem(i);if(r){const n=JSON.parse(r);if(typeof n=="object"&&n!=null)return n}}catch{}return null}function ECt(e,t,i){var r,n;const a=(r=RMe(e,i))!==null&&r!==void 0?r:{},s=OMe(t);return(n=a[s])!==null&&n!==void 0?n:null}function TCt(e,t,i,r,n){var a;const s=DMe(e),o=OMe(t),l=(a=RMe(e,n))!==null&&a!==void 0?a:{};l[o]={expandToSizes:Object.fromEntries(i.entries()),layout:r};try{n.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function ppe({layout:e,panelConstraints:t}){const i=[...e],r=i.reduce((a,s)=>a+s,0);if(i.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${i.map(a=>`${a}%`).join(", ")}`);if(!hu(r,100)&&i.length>0)for(let a=0;a<t.length;a++){const s=i[a];br(s!=null,`No layout data found for index ${a}`);const o=100/r*s;i[a]=o}let n=0;for(let a=0;a<t.length;a++){const s=i[a];br(s!=null,`No layout data found for index ${a}`);const o=S_({panelConstraints:t,panelIndex:a,size:s});s!=o&&(n+=s-o,i[a]=o)}if(!hu(n,0))for(let a=0;a<t.length;a++){const s=i[a];br(s!=null,`No layout data found for index ${a}`);const o=s+n,l=S_({panelConstraints:t,panelIndex:a,size:o});if(s!==l&&(n-=l-s,i[a]=l,hu(n,0)))break}return i}const CCt=100,PT={getItem:e=>(fpe(PT),PT.getItem(e)),setItem:(e,t)=>{fpe(PT),PT.setItem(e,t)}},mpe={};function IMe({autoSaveId:e=null,children:t,className:i="",direction:r,forwardedRef:n,id:a=null,onLayout:s=null,keyboardResizeBy:o=null,storage:l=PT,style:c,tagName:u="div",...h}){const d=CK(a),f=ee.useRef(null),[m,y]=ee.useState(null),[g,x]=ee.useState([]),w=gCt(),S=ee.useRef({}),M=ee.useRef(new Map),E=ee.useRef(0),T=ee.useRef({autoSaveId:e,direction:r,dragState:m,id:d,keyboardResizeBy:o,onLayout:s,storage:l}),R=ee.useRef({layout:g,panelDataArray:[],panelDataArrayChanged:!1});ee.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),ee.useImperativeHandle(n,()=>({getId:()=>T.current.id,getLayout:()=>{const{layout:ae}=R.current;return ae},setLayout:ae=>{const{onLayout:oe}=T.current,{layout:xe,panelDataArray:Z}=R.current,ce=ppe({layout:ae,panelConstraints:Z.map(me=>me.constraints)});dpe(xe,ce)||(x(ce),R.current.layout=ce,oe&&oe(ce),Gw(Z,ce,S.current))}}),[]),$x(()=>{T.current.autoSaveId=e,T.current.direction=r,T.current.dragState=m,T.current.id=d,T.current.onLayout=s,T.current.storage=l}),bCt({committedValuesRef:T,eagerValuesRef:R,groupId:d,layout:g,panelDataArray:R.current.panelDataArray,setLayout:x,panelGroupElement:f.current}),ee.useEffect(()=>{const{panelDataArray:ae}=R.current;if(e){if(g.length===0||g.length!==ae.length)return;let oe=mpe[e];oe==null&&(oe=MCt(TCt,CCt),mpe[e]=oe);const xe=[...ae],Z=new Map(M.current);oe(e,xe,Z,g,l)}},[e,g,l]),ee.useEffect(()=>{});const P=ee.useCallback(ae=>{const{onLayout:oe}=T.current,{layout:xe,panelDataArray:Z}=R.current;if(ae.constraints.collapsible){const ce=Z.map(Ee=>Ee.constraints),{collapsedSize:me=0,panelSize:he,pivotIndices:we}=Zy(Z,ae,xe);if(br(he!=null,`Panel size not found for panel "${ae.id}"`),!Mm(he,me)){M.current.set(ae.id,he);const Se=n_(Z,ae)===Z.length-1?he-me:me-he,Ne=CT({delta:Se,initialLayout:xe,panelConstraints:ce,pivotIndices:we,prevLayout:xe,trigger:"imperative-api"});oI(xe,Ne)||(x(Ne),R.current.layout=Ne,oe&&oe(Ne),Gw(Z,Ne,S.current))}}},[]),I=ee.useCallback((ae,oe)=>{const{onLayout:xe}=T.current,{layout:Z,panelDataArray:ce}=R.current;if(ae.constraints.collapsible){const me=ce.map(Pe=>Pe.constraints),{collapsedSize:he=0,panelSize:we=0,minSize:Ee=0,pivotIndices:Se}=Zy(ce,ae,Z),Ne=oe??Ee;if(Mm(we,he)){const Pe=M.current.get(ae.id),Re=Pe!=null&&Pe>=Ne?Pe:Ne,He=n_(ce,ae)===ce.length-1?we-Re:Re-we,de=CT({delta:He,initialLayout:Z,panelConstraints:me,pivotIndices:Se,prevLayout:Z,trigger:"imperative-api"});oI(Z,de)||(x(de),R.current.layout=de,xe&&xe(de),Gw(ce,de,S.current))}}},[]),L=ee.useCallback(ae=>{const{layout:oe,panelDataArray:xe}=R.current,{panelSize:Z}=Zy(xe,ae,oe);return br(Z!=null,`Panel size not found for panel "${ae.id}"`),Z},[]),z=ee.useCallback((ae,oe)=>{const{panelDataArray:xe}=R.current,Z=n_(xe,ae);return ACt({defaultSize:oe,dragState:m,layout:g,panelData:xe,panelIndex:Z})},[m,g]),U=ee.useCallback(ae=>{const{layout:oe,panelDataArray:xe}=R.current,{collapsedSize:Z=0,collapsible:ce,panelSize:me}=Zy(xe,ae,oe);return br(me!=null,`Panel size not found for panel "${ae.id}"`),ce===!0&&Mm(me,Z)},[]),j=ee.useCallback(ae=>{const{layout:oe,panelDataArray:xe}=R.current,{collapsedSize:Z=0,collapsible:ce,panelSize:me}=Zy(xe,ae,oe);return br(me!=null,`Panel size not found for panel "${ae.id}"`),!ce||gb(me,Z)>0},[]),F=ee.useCallback(ae=>{const{panelDataArray:oe}=R.current;oe.push(ae),oe.sort((xe,Z)=>{const ce=xe.order,me=Z.order;return ce==null&&me==null?0:ce==null?-1:me==null?1:ce-me}),R.current.panelDataArrayChanged=!0,w()},[w]);$x(()=>{if(R.current.panelDataArrayChanged){R.current.panelDataArrayChanged=!1;const{autoSaveId:ae,onLayout:oe,storage:xe}=T.current,{layout:Z,panelDataArray:ce}=R.current;let me=null;if(ae){const we=ECt(ae,ce,xe);we&&(M.current=new Map(Object.entries(we.expandToSizes)),me=we.layout)}me==null&&(me=SCt({panelDataArray:ce}));const he=ppe({layout:me,panelConstraints:ce.map(we=>we.constraints)});dpe(Z,he)||(x(he),R.current.layout=he,oe&&oe(he),Gw(ce,he,S.current))}}),$x(()=>{const ae=R.current;return()=>{ae.layout=[]}},[]);const G=ee.useCallback(ae=>{let oe=!1;const xe=f.current;return xe&&window.getComputedStyle(xe,null).getPropertyValue("direction")==="rtl"&&(oe=!0),function(ce){ce.preventDefault();const me=f.current;if(!me)return()=>null;const{direction:he,dragState:we,id:Ee,keyboardResizeBy:Se,onLayout:Ne}=T.current,{layout:Pe,panelDataArray:Re}=R.current,{initialLayout:ze}=we??{},He=TMe(Ee,ae,me);let de=_Ct(ce,ae,he,we,Se,me);const et=he==="horizontal";et&&oe&&(de=-de);const ut=Re.map(q=>q.constraints),vt=CT({delta:de,initialLayout:ze??Pe,panelConstraints:ut,pivotIndices:He,prevLayout:Pe,trigger:vMe(ce)?"keyboard":"mouse-or-touch"}),fe=!oI(Pe,vt);(yMe(ce)||xMe(ce))&&E.current!=de&&(E.current=de,!fe&&de!==0?et?xG(ae,de<0?wMe:_Me):xG(ae,de<0?SMe:AMe):xG(ae,0)),fe&&(x(vt),R.current.layout=vt,Ne&&Ne(vt),Gw(Re,vt,S.current))}},[]),H=ee.useCallback((ae,oe)=>{const{onLayout:xe}=T.current,{layout:Z,panelDataArray:ce}=R.current,me=ce.map(Pe=>Pe.constraints),{panelSize:he,pivotIndices:we}=Zy(ce,ae,Z);br(he!=null,`Panel size not found for panel "${ae.id}"`);const Se=n_(ce,ae)===ce.length-1?he-oe:oe-he,Ne=CT({delta:Se,initialLayout:Z,panelConstraints:me,pivotIndices:we,prevLayout:Z,trigger:"imperative-api"});oI(Z,Ne)||(x(Ne),R.current.layout=Ne,xe&&xe(Ne),Gw(ce,Ne,S.current))},[]),W=ee.useCallback((ae,oe)=>{const{layout:xe,panelDataArray:Z}=R.current,{collapsedSize:ce=0,collapsible:me}=oe,{collapsedSize:he=0,collapsible:we,maxSize:Ee=100,minSize:Se=0}=ae.constraints,{panelSize:Ne}=Zy(Z,ae,xe);Ne!=null&&(me&&we&&Mm(Ne,ce)?Mm(ce,he)||H(ae,he):Ne<Se?H(ae,Se):Ne>Ee&&H(ae,Ee))},[H]),Q=ee.useCallback((ae,oe)=>{const{direction:xe}=T.current,{layout:Z}=R.current;if(!f.current)return;const ce=nU(ae,f.current);br(ce,`Drag handle element not found for id "${ae}"`);const me=PMe(xe,oe);y({dragHandleId:ae,dragHandleRect:ce.getBoundingClientRect(),initialCursorPosition:me,initialLayout:Z})},[]),ne=ee.useCallback(()=>{y(null)},[]),se=ee.useCallback(ae=>{const{panelDataArray:oe}=R.current,xe=n_(oe,ae);xe>=0&&(oe.splice(xe,1),delete S.current[ae.id],R.current.panelDataArrayChanged=!0,w())},[w]),$=ee.useMemo(()=>({collapsePanel:P,direction:r,dragState:m,expandPanel:I,getPanelSize:L,getPanelStyle:z,groupId:d,isPanelCollapsed:U,isPanelExpanded:j,reevaluatePanelConstraints:W,registerPanel:F,registerResizeHandle:G,resizePanel:H,startDragging:Q,stopDragging:ne,unregisterPanel:se,panelGroupElement:f.current}),[P,m,r,I,L,z,d,U,j,W,F,G,H,Q,ne,se]),J={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return ee.createElement(tU.Provider,{value:$},ee.createElement(u,{...h,children:t,className:i,id:a,ref:f,style:{...J,...c},[Ha.group]:"",[Ha.groupDirection]:r,[Ha.groupId]:d}))}const OK=ee.forwardRef((e,t)=>ee.createElement(IMe,{...e,forwardedRef:t}));IMe.displayName="PanelGroup";OK.displayName="forwardRef(PanelGroup)";function n_(e,t){return e.findIndex(i=>i===t||i.id===t.id)}function Zy(e,t,i){const r=n_(e,t),a=r===e.length-1?[r-1,r]:[r,r+1],s=i[r];return{...t.constraints,panelSize:s,pivotIndices:a}}function PCt({disabled:e,handleId:t,resizeHandler:i,panelGroupElement:r}){ee.useEffect(()=>{if(e||i==null||r==null)return;const n=nU(t,r);if(n==null)return;const a=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),i(s);break}case"F6":{s.preventDefault();const o=n.getAttribute(Ha.groupId);br(o,`No group element found for id "${o}"`);const l=XP(o,r),c=EMe(o,t,r);br(c!==null,`No resize element found for id "${t}"`);const u=s.shiftKey?c>0?c-1:l.length-1:c+1<l.length?c+1:0;l[u].focus();break}}};return n.addEventListener("keydown",a),()=>{n.removeEventListener("keydown",a)}},[r,e,t,i])}function NMe({children:e=null,className:t="",disabled:i=!1,hitAreaMargins:r,id:n,onBlur:a,onClick:s,onDragging:o,onFocus:l,onPointerDown:c,onPointerUp:u,style:h={},tabIndex:d=0,tagName:f="div",...m}){var y,g;const x=ee.useRef(null),w=ee.useRef({onClick:s,onDragging:o,onPointerDown:c,onPointerUp:u});ee.useEffect(()=>{w.current.onClick=s,w.current.onDragging=o,w.current.onPointerDown=c,w.current.onPointerUp=u});const S=ee.useContext(tU);if(S===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:M,groupId:E,registerResizeHandle:T,startDragging:R,stopDragging:P,panelGroupElement:I}=S,L=CK(n),[z,U]=ee.useState("inactive"),[j,F]=ee.useState(!1),[G,H]=ee.useState(null),W=ee.useRef({state:z});$x(()=>{W.current.state=z}),ee.useEffect(()=>{if(i)H(null);else{const $=T(L);H(()=>$)}},[i,L,T]);const Q=(y=r==null?void 0:r.coarse)!==null&&y!==void 0?y:15,ne=(g=r==null?void 0:r.fine)!==null&&g!==void 0?g:5;ee.useEffect(()=>{if(i||G==null)return;const $=x.current;br($,"Element ref not attached");let J=!1;return pCt(L,$,M,{coarse:Q,fine:ne},(oe,xe,Z)=>{if(!xe){U("inactive");return}switch(oe){case"down":{U("drag"),J=!1,br(Z,'Expected event to be defined for "down" action'),R(L,Z);const{onDragging:ce,onPointerDown:me}=w.current;ce==null||ce(!0),me==null||me();break}case"move":{const{state:ce}=W.current;J=!0,ce!=="drag"&&U("hover"),br(Z,'Expected event to be defined for "move" action'),G(Z);break}case"up":{U("hover"),P();const{onClick:ce,onDragging:me,onPointerUp:he}=w.current;me==null||me(!1),he==null||he(),J||ce==null||ce();break}}})},[Q,M,i,ne,T,L,G,R,P]),PCt({disabled:i,handleId:L,resizeHandler:G,panelGroupElement:I});const se={touchAction:"none",userSelect:"none"};return ee.createElement(f,{...m,children:e,className:t,id:n,onBlur:()=>{F(!1),a==null||a()},onFocus:()=>{F(!0),l==null||l()},ref:x,role:"separator",style:{...se,...h},tabIndex:d,[Ha.groupDirection]:M,[Ha.groupId]:E,[Ha.resizeHandle]:"",[Ha.resizeHandleActive]:z==="drag"?"pointer":j?"keyboard":void 0,[Ha.resizeHandleEnabled]:!i,[Ha.resizeHandleId]:L,[Ha.resizeHandleState]:z})}NMe.displayName="PanelResizeHandle";function DCt(e,t){switch(e){case"pixel":return t?"group relative flex items-center justify-center cursor-col-resize":"group relative flex items-center justify-center cursor-row-resize";case"terminal":return t?"group relative flex items-center justify-center cursor-col-resize":"group relative flex items-center justify-center cursor-row-resize";case"modern":default:return t?"group relative flex items-center justify-center cursor-col-resize transition-all duration-200":"group relative flex items-center justify-center cursor-row-resize transition-all duration-200"}}function OCt(e,t){switch(e){case"pixel":return t?{width:"8px",background:"var(--pixel-surface, #222244)",borderLeft:"2px solid var(--pixel-border, #444477)",borderRight:"2px solid var(--pixel-border, #444477)"}:{height:"8px",background:"var(--pixel-surface, #222244)",borderTop:"2px solid var(--pixel-border, #444477)",borderBottom:"2px solid var(--pixel-border, #444477)"};case"terminal":return t?{width:"6px",background:"#0a0a0a",borderLeft:"1px solid #1a3a1a",borderRight:"1px solid #1a3a1a"}:{height:"6px",background:"#0a0a0a",borderTop:"1px solid #1a3a1a",borderBottom:"1px solid #1a3a1a"};case"modern":default:return t?{width:"4px",background:"rgba(100,100,100,0.15)",borderRadius:"2px"}:{height:"4px",background:"rgba(100,100,100,0.15)",borderRadius:"2px"}}}function RCt({theme:e,isHorizontal:t}){switch(e){case"pixel":{const i=t?{flexDirection:"column",gap:"3px"}:{flexDirection:"row",gap:"3px"};return C.jsx("div",{className:"flex",style:i,children:[0,1,2].map(r=>C.jsx("div",{style:{width:"2px",height:"2px",background:"var(--pixel-border-light, #5555aa)"},className:"group-hover:!bg-[var(--pixel-gold)]"},r))})}case"terminal":return t?C.jsxs("div",{className:"flex flex-col items-center gap-0 text-[8px] leading-none group-hover:text-[#00ff00]",style:{color:"#1a3a1a",fontFamily:"monospace"},children:[C.jsx("span",{children:"│"}),C.jsx("span",{children:"│"}),C.jsx("span",{children:"│"})]}):C.jsx("div",{className:"flex items-center gap-0 text-[8px] leading-none group-hover:text-[#00ff00]",style:{color:"#1a3a1a",fontFamily:"monospace"},children:C.jsx("span",{children:"═══"})});case"modern":default:{const i=t?{flexDirection:"column",gap:"2px"}:{flexDirection:"row",gap:"2px"};return C.jsx("div",{className:"flex opacity-0 group-hover:opacity-100 transition-opacity duration-200",style:i,children:[0,1,2].map(r=>C.jsx("div",{className:"rounded-full bg-white/20 group-hover:bg-blue-400/50",style:{width:"3px",height:"3px"}},r))})}}}function LMe({id:e,children:t}){return C.jsx(OK,{direction:"horizontal",autoSaveId:e,className:"flex-1 overflow-hidden",children:t})}function ICt({id:e,children:t}){return C.jsx(OK,{direction:"vertical",autoSaveId:e,className:"flex-1 flex flex-col overflow-hidden",children:t})}function Fv({defaultSize:e,minSize:t,maxSize:i,children:r,className:n,collapsible:a,collapsedSize:s,order:o}){return C.jsx(gMe,{defaultSize:e,minSize:t,maxSize:i,collapsible:a,collapsedSize:s,order:o,className:`overflow-hidden${n?` ${n}`:""}`,children:r})}function mC({direction:e="horizontal",disabled:t,className:i}){const r=Di(a=>a.theme);if(t)return null;const n=e==="horizontal";return C.jsx(NMe,{className:`${DCt(r,n)}${i?` ${i}`:""}`,style:OCt(r,n),children:C.jsx(RCt,{theme:r,isHorizontal:n})})}function RK({AgentDetail:e,ActivityFeed:t,FileWatcher:i,tabBarClass:r="flex border-b border-cam-border/50 bg-cam-surface/50",activeTabClass:n="text-cam-accent border-b-2 border-cam-accent",inactiveTabClass:a="text-cam-text-muted hover:text-cam-text",panelClass:s="flex-1 overflow-y-auto"}){const o=Ni(u=>u.selectedAgentId),[l,c]=ee.useState("activity");return o?C.jsx(e,{}):C.jsxs("div",{className:"h-full flex flex-col",children:[C.jsxs("div",{className:r,children:[C.jsx("button",{onClick:()=>c("activity"),className:`px-3 py-1.5 text-[10px] font-medium uppercase tracking-wider transition-colors ${l==="activity"?n:a}`,children:"Activity"}),C.jsx("button",{onClick:()=>c("files"),className:`px-3 py-1.5 text-[10px] font-medium uppercase tracking-wider transition-colors ${l==="files"?n:a}`,children:"Files"})]}),C.jsx("div",{className:s,children:l==="activity"?C.jsx(t,{}):C.jsx(i,{})})]})}const gpe="cam-in-process-dismissed";function NCt(){const e=Ni(r=>r.agents);return!Ni(r=>r.session)||e.length<2?!1:new Set(e.map(r=>r.sessionId)).size===1}function LCt(e){const[t,i]=ee.useState(()=>{if(!e)return!1;try{return localStorage.getItem(gpe)===e}catch{return!1}}),r=ee.useCallback(()=>{if(e)try{localStorage.setItem(gpe,e)}catch{}i(!0)},[e]);return[t,r]}function IK(){const e=NCt(),t=Ni(a=>a.session),[i,r]=LCt(t==null?void 0:t.id),{theme:n}=$P();if(!e||i)return null;switch(n){case"pixel":return C.jsx(zCt,{onDismiss:r});case"terminal":return C.jsx(BCt,{onDismiss:r});default:return C.jsx(kCt,{onDismiss:r})}}function kCt({onDismiss:e}){return C.jsxs("div",{className:"h-8 flex items-center justify-between px-4 bg-amber-500/10 border-b border-amber-500/30 shrink-0",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-pulse"}),C.jsx("span",{className:"text-xs text-amber-300",children:"In-process mode detected — per-agent tracking is limited. Use tmux + Teams for full E2E tracking."})]}),C.jsx("button",{onClick:e,className:"text-amber-400/60 hover:text-amber-300 text-xs px-1",title:"Dismiss",children:"×"})]})}function zCt({onDismiss:e}){return C.jsxs("div",{className:"h-8 flex items-center justify-between px-4 shrink-0",style:{background:"rgba(255, 170, 0, 0.1)",borderBottom:"2px solid var(--pixel-gold, #d4a017)"},children:[C.jsx("div",{className:"flex items-center gap-2",children:C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold, #d4a017)"},children:"! IN-PROCESS MODE - PER-AGENT TRACKING LIMITED. USE TMUX + TEAMS FOR FULL TRACKING."})}),C.jsx("button",{onClick:e,className:"pixel-text-xs px-1",style:{color:"var(--pixel-gold, #d4a017)",opacity:.6},title:"Dismiss",children:"X"})]})}function BCt({onDismiss:e}){return C.jsxs("div",{className:"h-8 flex items-center justify-between px-3 bg-[#1a1a00] border-b border-[#3a3a1a] shrink-0 font-mono text-[11px]",children:[C.jsx("div",{className:"flex items-center gap-2",children:C.jsx("span",{className:"text-[#ffaa00]",children:"[WARN] in-process mode: per-agent tracking limited. use tmux + teams for full e2e tracking."})}),C.jsx("button",{onClick:e,className:"text-[#ffaa00]/60 hover:text-[#ffaa00] px-1",title:"Dismiss",children:"[x]"})]})}function UCt(){const{connectionStatus:e,session:t}=Ni();if(t&&t.status!=="active"){const r=t.status==="error";return C.jsxs("div",{className:"flex items-center gap-1.5",children:[C.jsx("div",{className:`w-2 h-2 rounded-full ${r?"bg-cam-error":"bg-gray-400"}`}),C.jsx("span",{className:`text-xs ${r?"text-cam-error":"text-cam-text-muted"}`,children:r?"Session error":"Session ended"})]})}const i={connected:{dotClass:"bg-cam-success animate-pulse-dot",textClass:"text-cam-success",label:"Connected",sublabel:"capturing events"},reconnecting:{dotClass:"bg-amber-400 animate-pulse",textClass:"text-amber-400",label:"Reconnecting...",sublabel:""},disconnected:{dotClass:"bg-cam-error",textClass:"text-cam-error",label:"Disconnected",sublabel:"waiting for server"}}[e];return C.jsxs("div",{className:"flex items-center gap-1.5",children:[C.jsx("div",{className:`w-2 h-2 rounded-full ${i.dotClass}`}),C.jsx("span",{className:`text-xs ${i.textClass}`,children:i.label}),i.sublabel&&C.jsxs("span",{className:"text-xs text-cam-text-muted",children:["- ",i.sublabel]})]})}function jCt(){const{viewMode:e}=_n();return C.jsxs("div",{className:"h-full w-full flex flex-col modern-gradient-bg overflow-hidden",children:[C.jsxs("header",{className:"h-12 flex items-center justify-between px-4 border-b border-cam-border/50 modern-glass shrink-0 relative z-50",children:[C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx("h1",{className:"text-sm font-semibold text-cam-text tracking-tight",children:"Claude Agent Monitor"}),C.jsx(UCt,{})]}),C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx(RX,{}),C.jsx(RHe,{})]})]}),C.jsx(VEe,{}),C.jsx(IK,{}),C.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[e==="agents"&&C.jsx(FCt,{}),e==="tracker"&&C.jsx(VCt,{})]})]})}function FCt(){const e=Di(t=>t.lockPanels);return C.jsxs(LMe,{id:"modern-agents",children:[C.jsx(Fv,{defaultSize:20,minSize:10,maxSize:25,order:1,children:C.jsx("aside",{className:"h-full overflow-y-auto modern-scrollbar",children:C.jsx(nTe,{})})}),C.jsx(mC,{disabled:e}),C.jsx(Fv,{defaultSize:55,minSize:30,order:2,children:C.jsx("main",{className:"h-full overflow-hidden",children:C.jsx(MK,{})})}),C.jsx(mC,{disabled:e}),C.jsx(Fv,{defaultSize:25,minSize:15,maxSize:40,order:3,children:C.jsx("aside",{className:"h-full modern-scrollbar",children:C.jsx(RK,{AgentDetail:k3e,ActivityFeed:I3e,FileWatcher:B3e})})})]})}function VCt(){const{selectedTaskId:e}=_n(),t=Di(i=>i.lockPanels);return C.jsxs(ICt,{id:"modern-tracker",children:[C.jsx(Fv,{defaultSize:75,minSize:50,order:1,children:C.jsxs(LMe,{id:e?"modern-tracker-top-detail":"modern-tracker-top",children:[C.jsx(Fv,{defaultSize:e?55:70,minSize:30,order:1,children:C.jsx("main",{className:"h-full overflow-hidden",children:C.jsx(F3e,{})})}),e&&C.jsxs(C.Fragment,{children:[C.jsx(mC,{disabled:t}),C.jsx(Fv,{defaultSize:20,minSize:15,maxSize:35,order:2,children:C.jsx("aside",{className:"h-full overflow-y-auto modern-scrollbar",children:C.jsx(EK,{})})})]}),C.jsx(mC,{disabled:t}),C.jsx(Fv,{defaultSize:e?25:30,minSize:15,maxSize:40,order:3,children:C.jsxs("aside",{className:"h-full overflow-y-auto modern-scrollbar flex flex-col",children:[C.jsx(H3e,{}),C.jsx(AHe,{}),C.jsx(OHe,{})]})})]})}),C.jsx(mC,{direction:"vertical",disabled:t}),C.jsx(Fv,{defaultSize:25,minSize:10,maxSize:40,order:2,children:C.jsx("div",{className:"h-full overflow-y-auto modern-scrollbar",children:C.jsx(MHe,{})})})]})}function HCt(){const{session:e,agents:t,events:i}=Ni(),[r,n]=ee.useState("00m 00s");ee.useEffect(()=>{if(!(e!=null&&e.startedAt))return;const u=()=>n(H7(e.startedAt,e.endedAt));if(u(),!e.endedAt){const h=setInterval(u,1e3);return()=>clearInterval(h)}},[e==null?void 0:e.startedAt,e==null?void 0:e.endedAt]);const a=t.filter(u=>u.status==="active").length,s=t.reduce((u,h)=>u+h.errorCount,0),o=t.reduce((u,h)=>u+h.toolCallCount,0),l=i.filter(u=>u.category==="file_change").length,c=[{label:"TIME",value:r,isError:!1},{label:"AGENTS",value:`${a}/${t.length}`,isError:!1},{label:"CALLS",value:Lm(o),isError:!1},{label:"EVENTS",value:Lm((e==null?void 0:e.eventCount)??0),isError:!1},{label:"FILES",value:Lm(l),isError:!1},{label:"ERRORS",value:String(s),isError:s>0}];return C.jsx("div",{className:"shrink-0 border-b border-[#1a3a1a] px-2 py-1 font-mono text-[11px]",children:C.jsxs("div",{className:"flex items-center gap-0",children:[C.jsx("span",{className:"terminal-dim mr-2",children:"["}),c.map((u,h)=>C.jsxs("span",{className:"flex items-center",children:[h>0&&C.jsx("span",{className:"terminal-dim mx-1",children:"|"}),C.jsxs("span",{className:"terminal-muted",children:[u.label,":"]}),C.jsx("span",{className:`ml-1 font-bold ${u.isError?"terminal-error":"text-[#00ff00] terminal-glow"}`,children:u.value})]},u.label)),C.jsx("span",{className:"terminal-dim ml-2",children:"]"})]})})}const GCt={active:"[*]",idle:"[-]",error:"[!]",completed:"[+]",shutdown:"[x]"},WCt={active:"text-[#00ff00]",idle:"text-[#ffaa00]",error:"text-[#ff3333]",completed:"text-[#00ccff]",shutdown:"text-[#006600]"};function qCt(e){return e.status==="active"}function XCt(){const e=$7(),{selectedAgentId:t,selectAgent:i}=Ni(),[r,n]=ee.useState(!1),{activeAgents:a,inactiveAgents:s}=ee.useMemo(()=>{const o=[],l=[];for(const c of e)qCt(c)?o.push(c):l.push(c);return{activeAgents:o,inactiveAgents:l}},[e]);return e.length===0?C.jsxs("div",{className:"p-3 font-mono text-[11px]",children:[C.jsx("div",{className:"terminal-muted mb-2",children:"## AGENTS ##"}),C.jsxs("div",{className:"terminal-dim",children:[C.jsx("p",{children:"> Waiting for agents..."}),C.jsx("p",{className:"mt-1 terminal-cursor",children:"> "})]})]}):C.jsxs("div",{className:"p-2 font-mono text-[11px]",children:[C.jsx("div",{className:"terminal-muted mb-1 px-1",children:"## ACTIVE ("+a.length+") ##"}),C.jsx("div",{className:"border-t border-[#1a3a1a] mb-1"}),a.length>0?C.jsx("div",{className:"space-y-0.5",children:a.map(o=>C.jsx(vpe,{agent:o,isSelected:t===o.id,onSelect:()=>i(t===o.id?null:o.id)},o.id))}):C.jsx("div",{className:"px-1 py-1 terminal-dim",children:"> No active agents"}),s.length>0&&C.jsxs("div",{className:"mt-2",children:[C.jsxs("button",{onClick:()=>n(!r),className:"w-full text-left px-1 py-0.5 hover:bg-[#0a1a0a] transition-colors",children:[C.jsxs("span",{className:"terminal-dim",children:[r?"[-]":"[+]"," "]}),C.jsx("span",{className:"terminal-muted",children:"INACTIVE ("+s.length+")"})]}),r&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"border-t border-[#1a3a1a] mb-1 mt-1"}),C.jsx("div",{className:"space-y-0.5",children:s.map(o=>C.jsx(vpe,{agent:o,isSelected:t===o.id,onSelect:()=>i(t===o.id?null:o.id),compact:!0},o.id))})]})]})]})}function vpe({agent:e,isSelected:t,onSelect:i,compact:r=!1}){const n=Ch(e.id,e.name,e.type??void 0),a=GCt[e.status]||"[ ]",s=WCt[e.status]||"terminal-dim";return r?C.jsx("button",{onClick:i,title:`${e.name} (${e.id})`,className:`
|
|
12436
12436
|
w-full text-left px-1 py-0.5 font-mono text-[10px] transition-colors
|
|
12437
12437
|
${t?"bg-[#0a1f0a] border-l-2 border-[#00ff00]":"hover:bg-[#0d1a0d] border-l-2 border-transparent"}
|
|
12438
12438
|
`,children:C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("span",{className:`${s} shrink-0`,children:a}),C.jsx("span",{className:"terminal-dim truncate",children:n}),C.jsxs("span",{className:"text-[#006600] shrink-0",children:["[",e.type,"]"]}),C.jsxs("span",{className:"terminal-dim shrink-0",children:["c:",e.toolCallCount]}),C.jsx("span",{className:"terminal-dim shrink-0",children:qc(e.lastActivityAt)})]})}):C.jsxs("button",{onClick:i,title:`${e.name} (${e.id})`,className:`
|
|
@@ -12441,5 +12441,5 @@ No matching component was found for:
|
|
|
12441
12441
|
`,children:[C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("span",{className:`${s} shrink-0 ${e.status==="active"?"terminal-glow":""}`,children:a}),C.jsx("span",{className:`truncate ${t?"text-[#00ff00] terminal-glow":"text-[#00cc00]"}`,children:n}),C.jsxs("span",{className:"text-[#006600] shrink-0",children:["[",e.type,"]"]})]}),C.jsxs("div",{className:"flex items-center gap-2 ml-4 mt-0.5",children:[C.jsxs("span",{className:"terminal-dim",children:["calls:",e.toolCallCount]}),e.errorCount>0&&C.jsxs("span",{className:"terminal-error",children:["err:",e.errorCount]}),C.jsx("span",{className:"terminal-dim ml-auto",children:qc(e.lastActivityAt)})]})]})}const kMe=new Set(["TaskList","TaskGet"]);function YCt(e){const t=[];let i=0;for(;i<e.length;){const r=e[i];if(r.tool&&kMe.has(r.tool)){let n=1;for(;i+n<e.length&&e[i+n].tool===r.tool&&e[i+n].agentId===r.agentId;)n++;t.push({event:r,count:n,groupId:`grp-${r.id}`}),i+=n}else t.push({event:r,count:1,groupId:r.id}),i++}return t}const $Ct={Edit:"EDT",Write:"WRT",Read:"RD ",Bash:"SH ",Grep:"GRP",Glob:"GLB",TaskCreate:"T+ ",TaskUpdate:"T~ ",TaskList:"TL ",SendMessage:"MSG",WebFetch:"GET",WebSearch:"WEB"},KCt={tool_call:"TOOL",file_change:"FILE",command:"CMD ",message:"MSG ",lifecycle:"SYS ",error:"ERR ",compact:"CMP ",notification:"NTF "};function QCt(){const e=Dq(),t=Ni(m=>m.agents),{searchQuery:i,setSearchQuery:r}=az(),n=Di(m=>m.followMode),a=Di(m=>m.hidePolling),s=Di(m=>m.toggleFollowMode),o=Di(m=>m.toggleHidePolling),l=ee.useRef(null),[c,u]=ee.useState(null),h=ee.useMemo(()=>{const m=new Map;for(const y of t)m.set(y.id,Ch(y.id,y.name||y.id,y.type??void 0));return m},[t]);ee.useEffect(()=>{n&&l.current&&(l.current.scrollTop=0)},[e.length,n]);const d=ee.useMemo(()=>{let m=e;if(a&&(m=m.filter(y=>!y.tool||!kMe.has(y.tool))),i){const y=i.toLowerCase();m=m.filter(g=>{var x,w,S,M;return((x=g.tool)==null?void 0:x.toLowerCase().includes(y))||((w=g.filePath)==null?void 0:w.toLowerCase().includes(y))||((S=g.input)==null?void 0:S.toLowerCase().includes(y))||((M=g.output)==null?void 0:M.toLowerCase().includes(y))})}return m},[e,a,i]),f=ee.useMemo(()=>YCt(d),[d]);return C.jsxs("div",{className:"h-full flex flex-col font-mono text-[11px]",children:[C.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-[#1a3a1a] shrink-0",children:[C.jsx("span",{className:"terminal-muted",children:"## tail -f activity.log ("+d.length+" lines) ##"}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsxs("div",{className:"flex items-center",children:[C.jsx("span",{className:"terminal-dim mr-1",children:"grep:"}),C.jsx("input",{type:"text",placeholder:"...",value:i,onChange:m=>r(m.target.value),className:"w-24 bg-[#0d0d0d] border border-[#1a3a1a] px-1.5 py-0.5 text-[11px] text-[#00ff00] font-mono placeholder:text-[#003300] focus:outline-none focus:border-[#00aa00]"})]}),C.jsx("button",{onClick:o,className:`px-2 py-0.5 font-mono text-[10px] border ${a?"bg-[#1f1f0a] text-[#ffaa00] border-[#aa7700]":"bg-[#0d0d0d] text-[#006600] border-[#1a3a1a]"}`,title:"Hide TaskList/TaskGet polling",children:a?"[P]oll:OFF":"[P]oll"}),C.jsx("button",{onClick:s,className:`px-2 py-0.5 font-mono text-[10px] border ${n?"bg-[#0a1f0a] text-[#00ff00] border-[#00aa00] terminal-glow":"bg-[#0d0d0d] text-[#006600] border-[#1a3a1a]"}`,children:n?"[F]ollow:ON":"[F]ollow:OFF"})]})]}),C.jsx("div",{ref:l,className:"flex-1 overflow-y-auto terminal-scrollbar",children:d.length===0?C.jsx("div",{className:"p-4 text-center",children:C.jsxs("div",{className:"terminal-dim",children:[C.jsx("p",{children:"> No activity logged"}),C.jsx("p",{children:"> Waiting for events..."}),C.jsx("p",{className:"mt-2 terminal-cursor",children:"> "})]})}):C.jsx("div",{children:f.map(({event:m,count:y,groupId:g})=>C.jsx(ZCt,{event:m,agentNameMap:h,isExpanded:c===m.id,groupCount:y,onToggle:()=>u(c===m.id?null:m.id)},g))})})]})}function ZCt({event:e,agentNameMap:t,isExpanded:i,groupCount:r,onToggle:n}){const[a,s]=ee.useState(!1),o=$Ct[e.tool||""]||"...",l=KCt[e.category]||"??? ",c=e.category==="error"||!!e.error,u=t.get(e.agentId)??e.agentId.slice(0,8),h=sz(e.tool||e.hookType);return C.jsxs("div",{className:`px-3 py-0.5 hover:bg-[#0a1a0a] cursor-pointer transition-colors border-l-2 ${c?"border-[#ff3333]":i?"border-[#00ff00]":"border-transparent"}`,onClick:n,children:[C.jsxs("div",{className:"flex items-center gap-0 whitespace-nowrap overflow-hidden",children:[C.jsx("span",{className:"terminal-dim shrink-0 w-[60px]",children:gu(e.timestamp)}),C.jsx("span",{className:`shrink-0 w-[36px] ml-1 ${c?"terminal-error":"terminal-muted"}`,children:l}),C.jsx("span",{className:"shrink-0 w-[28px] ml-1 text-[#00ccff]",title:h,children:o}),r&&r>1&&C.jsxs("span",{className:"shrink-0 ml-1 text-[#ffaa00]",children:["x",r]}),C.jsxs("span",{className:"terminal-dim shrink-0 ml-1",title:e.agentId,children:["[",u,"]"]}),e.filePath&&C.jsx("span",{className:"text-[#00aa00] ml-2 truncate",title:e.filePath,children:Ah(e.filePath)}),e.error&&C.jsx("span",{className:"terminal-error ml-2 truncate",title:e.error,children:e.error}),e.duration!==void 0&&C.jsxs("span",{className:"terminal-dim ml-auto shrink-0 pl-2",children:[e.duration,"ms"]})]}),i&&C.jsxs("div",{className:"ml-4 mt-1 mb-1 border-l border-[#1a3a1a] pl-2",onClick:d=>d.stopPropagation(),children:[e.input&&C.jsxs("div",{className:"mb-1",children:[C.jsx("span",{className:"terminal-muted",children:">>> INPUT:"}),a?C.jsx("pre",{className:"text-[10px] text-[#00aa00] whitespace-pre-wrap break-all mt-0.5 max-h-28 overflow-y-auto terminal-scrollbar bg-[#050505] p-1 border border-[#1a3a1a]",children:e.input}):C.jsx("pre",{className:"text-[10px] text-[#00aa00] whitespace-pre-wrap break-all mt-0.5 max-h-28 overflow-y-auto terminal-scrollbar bg-[#050505] p-1 border border-[#1a3a1a]",children:Oq(e.tool,e.input)})]}),e.output&&C.jsxs("div",{className:"mb-1",children:[C.jsx("span",{className:"terminal-muted",children:"<<< OUTPUT:"}),a?C.jsx("pre",{className:"text-[10px] text-[#00aa00] whitespace-pre-wrap break-all mt-0.5 max-h-28 overflow-y-auto terminal-scrollbar bg-[#050505] p-1 border border-[#1a3a1a]",children:e.output}):C.jsx("pre",{className:"text-[10px] text-[#00aa00] whitespace-pre-wrap break-all mt-0.5 max-h-28 overflow-y-auto terminal-scrollbar bg-[#050505] p-1 border border-[#1a3a1a]",children:Rq(e.output)})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[e.duration!==void 0&&C.jsx("span",{className:"terminal-dim text-[10px]",children:"--- duration: "+e.duration+"ms ---"}),(e.input||e.output)&&C.jsx("button",{onClick:d=>{d.stopPropagation(),s(!a)},className:"text-[9px] px-1 py-0.5 border border-[#1a3a1a] hover:border-[#00aa00] text-[#006600] hover:text-[#00ff00] transition-colors",children:a?"[SUMMARY]":"[RAW]"})]})]})]})}const JCt=[{id:"activity",label:"Activity",key:"1"},{id:"files",label:"Files",key:"2"},{id:"errors",label:"Errors",key:"3"},{id:"messages",label:"Messages",key:"4"}],ePt={active:"[ACTIVE]",idle:"[IDLE] ",error:"[ERROR] ",completed:"[DONE] ",shutdown:"[DOWN] "};function tPt(){const{selectedAgentId:e,agents:t,events:i,selectAgent:r}=Ni(),[n,a]=ee.useState("activity"),s=t.find(d=>d.id===e);if(!s)return null;const o=i.filter(d=>d.agentId===s.id),l=o.filter(d=>d.category==="error"||d.error),c=o.filter(d=>d.filePath).reduce((d,f)=>(f.filePath&&!d.includes(f.filePath)&&d.push(f.filePath),d),[]),u=o.filter(d=>d.category==="message"),h=ePt[s.status]||"[???] ";return C.jsxs("div",{className:"h-full flex flex-col font-mono text-[11px]",children:[C.jsxs("div",{className:"p-2 border-b border-[#1a3a1a] shrink-0",children:[C.jsxs("div",{className:"flex items-center justify-between mb-1",children:[C.jsx("span",{className:"text-[#00ff00] terminal-glow font-bold",title:`${s.name} (${s.id})`,children:">> "+Ch(s.id,s.name,s.type??void 0)}),C.jsx("button",{onClick:()=>r(null),className:"text-[#006600] hover:text-[#ff3333] transition-colors",children:"[X]"})]}),C.jsxs("div",{className:"terminal-dim",children:[C.jsx("span",{className:s.status==="active"?"text-[#00ff00]":s.status==="error"?"terminal-error":"terminal-muted",children:h}),C.jsx("span",{className:"ml-2",children:s.type})]}),C.jsxs("div",{className:"mt-2 border border-[#1a3a1a] p-1.5",children:[C.jsx("div",{className:"text-[10px] terminal-dim mb-1",children:"┌── STATS ──────────────┐"}),C.jsxs("div",{className:"grid grid-cols-3 gap-x-2 text-[10px]",children:[C.jsxs("div",{children:[C.jsx("span",{className:"terminal-dim",children:"calls:"}),C.jsx("span",{className:"text-[#00ff00] ml-1",children:s.toolCallCount})]}),C.jsxs("div",{children:[C.jsx("span",{className:"terminal-dim",children:"errs:"}),C.jsx("span",{className:`ml-1 ${s.errorCount>0?"terminal-error":"text-[#00ff00]"}`,children:s.errorCount})]}),C.jsxs("div",{children:[C.jsx("span",{className:"terminal-dim",children:"last:"}),C.jsx("span",{className:"text-[#00aa00] ml-1",children:qc(s.lastActivityAt)})]})]}),C.jsx("div",{className:"text-[10px] terminal-dim mt-1",children:"└──────────────────────┘"})]})]}),C.jsx("div",{className:"flex border-b border-[#1a3a1a] shrink-0",children:JCt.map(d=>{const f=d.id==="activity"?o.length:d.id==="files"?c.length:d.id==="errors"?l.length:u.length;return C.jsxs("button",{onClick:()=>a(d.id),className:`flex-1 py-1.5 text-[10px] font-mono transition-colors border-b ${n===d.id?"text-[#00ff00] border-[#00ff00] bg-[#0a1f0a] terminal-glow":"text-[#006600] border-transparent hover:text-[#00aa00]"}`,children:["[",d.key,"]",d.label,"(",f,")"]},d.id)})}),C.jsxs("div",{className:"flex-1 overflow-y-auto terminal-scrollbar",children:[n==="activity"&&C.jsx("div",{children:o.length===0?C.jsx("p",{className:"terminal-dim p-3 text-center",children:"> No activity recorded"}):o.slice(0,100).map(d=>C.jsx("div",{className:"px-2 py-0.5 hover:bg-[#0a1a0a] transition-colors border-b border-[#0a1a0a]",children:C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"terminal-dim shrink-0 text-[10px]",children:gu(d.timestamp)}),C.jsx("span",{className:`text-[10px] ${d.category==="error"?"terminal-error":"text-[#00ccff]"}`,children:d.tool||d.hookType}),d.filePath&&C.jsx("span",{className:"text-[#00aa00] text-[10px]",title:d.filePath,children:Ah(d.filePath)})]})},d.id))}),n==="files"&&C.jsx("div",{className:"p-2",children:c.length===0?C.jsx("p",{className:"terminal-dim text-center",children:"> No files touched"}):c.map((d,f)=>{const y=f===c.length-1?"└─":"├─";return C.jsxs("div",{className:"flex items-center gap-1 py-0.5 hover:bg-[#0a1a0a]",children:[C.jsx("span",{className:"terminal-dim",children:y}),C.jsx("span",{className:"text-[#00aa00] text-[10px] break-all",title:d,children:Ah(d)})]},d)})}),n==="errors"&&C.jsx("div",{children:l.length===0?C.jsx("p",{className:"terminal-dim p-3 text-center",children:"> No errors - all clear"}):l.map(d=>C.jsxs("div",{className:"px-2 py-1 border-b border-[#1a0a0a]",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"terminal-dim text-[10px]",children:gu(d.timestamp)}),C.jsx("span",{className:"terminal-error text-[10px]",children:d.tool||d.hookType})]}),d.error&&C.jsx("p",{className:"terminal-error text-[10px] ml-2 mt-0.5 break-all",children:"! "+d.error})]},d.id))}),n==="messages"&&C.jsx("div",{children:u.length===0?C.jsx("p",{className:"terminal-dim p-3 text-center",children:"> No messages"}):u.map(d=>C.jsxs("div",{className:"px-2 py-1 border-b border-[#0a1a0a]",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"terminal-dim text-[10px]",children:gu(d.timestamp)}),C.jsx("span",{className:"terminal-info text-[10px]",children:"SendMessage"})]}),d.input&&C.jsx("p",{className:"text-[#00aa00] text-[10px] ml-2 mt-0.5 break-words whitespace-pre-wrap",children:"> "+d.input})]},d.id))})]})]})}const iPt={created:{symbol:"+",color:"text-[#00ff00]"},modified:{symbol:"~",color:"text-[#ffaa00]"},read:{symbol:".",color:"text-[#00ccff]"}};function rPt(){const{session:e}=Ni(),[t,i]=ee.useState([]);ee.useEffect(()=>{if(!(e!=null&&e.id))return;let s=!1;async function o(){try{const{files:c}=await X7(e.id);s||i(c)}catch{}}o();const l=setInterval(o,5e3);return()=>{s=!0,clearInterval(l)}},[e==null?void 0:e.id]);const r=t.filter(s=>s.changeType==="created"),n=t.filter(s=>s.changeType==="modified"),a=t.filter(s=>s.changeType==="read");return C.jsxs("div",{className:"p-2 h-full flex flex-col font-mono text-[11px]",children:[C.jsxs("div",{className:"flex items-center justify-between mb-1 px-1",children:[C.jsx("span",{className:"terminal-muted",children:"## tree --files ##"}),C.jsxs("div",{className:"flex items-center gap-2 text-[10px]",children:[C.jsxs("span",{className:"text-[#00ff00]",children:["+",r.length]}),C.jsxs("span",{className:"text-[#ffaa00]",children:["~",n.length]}),C.jsxs("span",{className:"text-[#00ccff]",children:[".",a.length]})]})]}),C.jsx("div",{className:"border-t border-[#1a3a1a] mb-1"}),t.length===0?C.jsx("div",{className:"flex-1 flex items-center justify-center",children:C.jsxs("div",{className:"terminal-dim text-center",children:[C.jsx("p",{children:"> No files touched"}),C.jsx("p",{className:"terminal-cursor mt-1",children:"> "})]})}):C.jsx("div",{className:"flex-1 overflow-y-auto terminal-scrollbar space-y-0",children:t.map((s,o)=>{const l=o===t.length-1,c=iPt[s.changeType]||{symbol:"?",color:"terminal-dim"},u=l?"└──":"├──";return C.jsxs("div",{className:"flex items-center gap-0 px-1 py-0.5 hover:bg-[#0a1a0a] transition-colors",children:[C.jsx("span",{className:"terminal-dim shrink-0 w-[28px]",children:u}),C.jsx("span",{className:`shrink-0 w-[12px] font-bold ${c.color}`,children:c.symbol}),C.jsx("span",{className:"text-[#00aa00] flex-1 ml-1",title:s.filePath,children:Ah(s.filePath)}),s.touchCount>1&&C.jsxs("span",{className:"terminal-dim shrink-0 ml-1",children:["x",s.touchCount]}),C.jsx("span",{className:"terminal-dim shrink-0 ml-2 text-[10px]",children:qc(s.lastTouchedAt)})]},`${s.filePath}-${s.agentId}`)})})]})}const nPt={backlog:".",planned:"-",in_progress:"*",in_review:"?",completed:"+",blocked:"!"},aPt={backlog:"terminal-dim",planned:"text-[#00ccff]",in_progress:"text-[#00ff00]",in_review:"terminal-muted",completed:"text-[#00ff00]",blocked:"terminal-error"},sPt={critical:"!!!",high:"!! ",medium:"! ",low:". "};function oPt(){const e=T0(),t=r=>r==="pending"?"planned":r==="deferred"?"backlog":r==="in_review"||r==="blocked"?"in_progress":r,i=K_.reduce((r,n)=>(r[n.id]=e.filter(a=>t(a.status)===n.id),r),{});return e.length===0?C.jsx("div",{className:"h-full flex flex-col items-center justify-center font-mono text-[11px]",children:C.jsx("div",{className:"terminal-dim text-center",children:C.jsx("pre",{className:"text-[10px]",children:`┌────────────────────────┐
|
|
12442
12442
|
│ No PRD tasks loaded │
|
|
12443
12443
|
│ Import a PRD first │
|
|
12444
|
-
└────────────────────────┘`})})}):C.jsx("div",{className:"h-full flex gap-1 p-2 overflow-x-auto terminal-scrollbar font-mono text-[11px]",children:K_.map(r=>{const n=i[r.id]||[],a=aPt[r.id]||"terminal-dim",s=nPt[r.id]||" ";return C.jsxs("div",{className:"flex-shrink-0 w-52 flex flex-col border border-[#1a3a1a] bg-[#0a0a0a]",children:[C.jsx("div",{className:"px-2 py-1 border-b border-[#1a3a1a] shrink-0",children:C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("span",{className:`text-[10px] font-bold uppercase ${a}`,children:["[",s,"] ",r.label]}),C.jsxs("span",{className:"terminal-dim text-[10px]",children:["(",n.length,")"]})]})}),C.jsx("div",{className:"flex-1 overflow-y-auto terminal-scrollbar p-1 space-y-1",children:n.map(o=>C.jsx(lPt,{task:o},o.id))})]},r.id)})})}function lPt({task:e}){const{selectTask:t,selectedTaskId:i}=_n(),r=oz(),n=sPt[e.priority]||" ",a=W7(e.prdSection);return C.jsxs("div",{className:`terminal-card p-1.5 text-[10px] cursor-pointer ${i===e.id?"border border-[#00ccff]":""}`,onClick:()=>t(e.id),children:[C.jsxs("div",{className:"flex items-center gap-1 mb-0.5",children:[C.jsx("span",{className:`${e.priority==="critical"||e.priority==="high"?"terminal-error":"terminal-dim"}`,children:n}),e.complexity&&C.jsxs("span",{className:"terminal-dim",children:["C",e.complexity]}),a&&C.jsxs("span",{className:"text-[#00ff00]",children:["[",a,"]"]})]}),C.jsx("div",{className:"text-[#00cc00] leading-tight mb-1 line-clamp-2",children:e.title}),C.jsxs("div",{className:"flex items-center justify-between terminal-dim",children:[e.assignedAgent?C.jsxs("span",{children:["@",r(e.assignedAgent)]}):C.jsx("span",{className:"italic",children:"unassigned"}),e.tags&&e.tags.length>0&&C.jsxs("span",{children:["#",e.tags[0]]})]}),e.blockedBy.length>0&&C.jsx("div",{className:"terminal-error mt-0.5",children:"! blocked by "+e.blockedBy.length+" task"+(e.blockedBy.length>1?"s":"")})]})}function cPt(e,t=20){const i=Math.round(e/100*t),r=t-i;return"["+("█".repeat(i)+"░".repeat(r))+"] "+e+"%"}function uPt(){const{activeSprint:e}=lz(),t=T0(),i=ee.useMemo(()=>{if(!e)return{total:0,completed:0,inProgress:0,blocked:0,pending:0,percent:0};const r=t.filter(u=>u.sprintId===e.id),n=r.length||e.totalTasks||0,a=r.filter(u=>u.status==="completed").length,s=r.filter(u=>u.status==="in_progress").length,o=r.filter(u=>u.status==="blocked").length,l=n-a-s-o,c=n>0?Math.round(a/n*100):0;return{total:n,completed:a,inProgress:s,blocked:o,pending:l,percent:c}},[e,t]);return e?C.jsxs("div",{className:"p-3 border-b border-[#1a3a1a] font-mono text-[11px]",children:[C.jsxs("div",{className:"flex items-center justify-between mb-2",children:[C.jsx("span",{className:"terminal-muted",children:"## SPRINT ##"}),C.jsx("span",{className:"text-[#00ccff] text-[10px]",children:e.name})]}),C.jsx("div",{className:"text-[#00ff00] terminal-glow mb-2",children:cPt(i.percent,24)}),C.jsxs("div",{className:"space-y-0.5 text-[10px]",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"text-[#00ff00] w-[12px]",children:"+"}),C.jsx("span",{className:"terminal-dim flex-1",children:"Completed"}),C.jsx("span",{className:"text-[#00ff00]",children:i.completed})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"text-[#00ccff] w-[12px]",children:"*"}),C.jsx("span",{className:"terminal-dim flex-1",children:"In Progress"}),C.jsx("span",{className:"text-[#00ccff]",children:i.inProgress})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"terminal-muted w-[12px]",children:"-"}),C.jsx("span",{className:"terminal-dim flex-1",children:"Pending"}),C.jsx("span",{className:"terminal-muted",children:i.pending})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"terminal-error w-[12px]",children:"!"}),C.jsx("span",{className:"terminal-dim flex-1",children:"Blocked"}),C.jsx("span",{className:i.blocked>0?"terminal-error":"terminal-dim",children:i.blocked})]}),C.jsxs("div",{className:"border-t border-[#1a3a1a] mt-1 pt-1 flex items-center gap-2",children:[C.jsx("span",{className:"terminal-dim w-[12px]",children:"="}),C.jsx("span",{className:"terminal-dim flex-1",children:"Total"}),C.jsx("span",{className:"text-[#00ff00]",children:i.total})]})]})]}):C.jsx("div",{className:"p-3 font-mono text-[11px]",children:C.jsx("span",{className:"terminal-dim",children:"> No active sprint"})})}function hPt(){const{activeSprint:e,tasks:t}=_n(),[i,r]=ee.useState("burndown"),{chart:n,maxVal:a}=ee.useMemo(()=>{if(!e)return{chart:[],maxVal:0};const c=t.filter(w=>w.sprintId===e.id),u=c.length;if(u===0)return{chart:[],maxVal:0};const h=c.filter(w=>w.completedAt).sort((w,S)=>new Date(w.completedAt).getTime()-new Date(S.completedAt).getTime()),d=e.startedAt?new Date(e.startedAt).getTime():Date.now()-36e5,m=Date.now()-d,y=10,g=[];for(let w=0;w<=y;w++){const S=d+m/y*w,M=h.filter(P=>new Date(P.completedAt).getTime()<=S).length,E=new Date(S).getHours(),T=new Date(S).getMinutes(),R=`${String(E).padStart(2,"0")}:${String(T).padStart(2,"0")}`;i==="burndown"?g.push({label:R,actual:u-M,ideal:Math.max(0,Math.round(u-u/y*w))}):g.push({label:R,actual:M,ideal:Math.round(u/y*w)})}const x=Math.max(u,...g.map(w=>Math.max(w.actual,w.ideal)));return{chart:g,maxVal:x}},[e,t,i]);if(!e||n.length===0)return C.jsxs("div",{className:"p-3 border-b border-[#1a3a1a] font-mono text-[11px]",children:[C.jsx("div",{className:"flex items-center justify-between mb-2",children:C.jsx("span",{className:"terminal-muted",children:"## BURNDOWN ##"})}),C.jsx("div",{className:"terminal-dim text-center py-4",children:"> No data available"})]});const s=8,o=n.length,l=[];for(let c=s;c>=0;c--){const u=c/s*a;let h="";for(let d=0;d<o;d++){const f=n[d],m=f.actual>=u,y=f.ideal>=u;m&&y?h+="#":m?h+="*":y?h+=".":h+=" ",h+=" "}l.push(h)}return C.jsxs("div",{className:"p-3 border-b border-[#1a3a1a] font-mono text-[11px]",children:[C.jsxs("div",{className:"flex items-center justify-between mb-2",children:[C.jsx("span",{className:"terminal-muted",children:"## "+(i==="burndown"?"BURNDOWN":"BURNUP")+" ##"}),C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("button",{onClick:()=>r("burndown"),className:`px-1.5 py-0.5 text-[9px] border ${i==="burndown"?"text-[#00ff00] border-[#00aa00] bg-[#0a1f0a]":"terminal-dim border-[#1a3a1a]"}`,children:"DN"}),C.jsx("button",{onClick:()=>r("burnup"),className:`px-1.5 py-0.5 text-[9px] border ${i==="burnup"?"text-[#00ff00] border-[#00aa00] bg-[#0a1f0a]":"terminal-dim border-[#1a3a1a]"}`,children:"UP"})]})]}),C.jsxs("div",{className:"bg-[#050505] border border-[#1a3a1a] p-2 text-[10px]",children:[C.jsxs("div",{className:"flex",children:[C.jsxs("div",{className:"flex flex-col justify-between text-right pr-1 terminal-dim text-[9px] shrink-0 w-[20px]",children:[C.jsx("span",{children:a}),C.jsx("span",{children:Math.round(a/2)}),C.jsx("span",{children:"0"})]}),C.jsx("div",{className:"flex-1",children:C.jsx("div",{className:"border-l border-b border-[#1a3a1a] pl-1 pb-1",children:l.map((c,u)=>C.jsx("div",{className:"leading-none",children:C.jsx("span",{className:"text-[#00ff00]",children:c.split("").map((h,d)=>h==="*"?C.jsx("span",{className:"text-[#00ff00] terminal-glow",children:h},d):h==="."?C.jsx("span",{className:"terminal-dim",children:h},d):h==="#"?C.jsx("span",{className:"text-[#00ccff]",children:h},d):C.jsx("span",{children:h},d))})},u))})})]}),C.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[9px]",children:[C.jsx("span",{className:"text-[#00ff00]",children:"* actual"}),C.jsx("span",{className:"terminal-dim",children:". ideal"}),C.jsx("span",{className:"text-[#00ccff]",children:"# overlap"})]})]})]})}const ype={backlog:{char:".",color:"terminal-dim"},planned:{char:"-",color:"text-[#00ccff]"},pending:{char:"-",color:"text-[#00ccff]"},in_progress:{char:"*",color:"text-[#00ff00]"},in_review:{char:"?",color:"terminal-muted"},completed:{char:"+",color:"text-[#00ff00]"},blocked:{char:"!",color:"terminal-error"},deferred:{char:".",color:"terminal-dim"}};function xpe(e,t=12){const i=Math.round(e/100*t),r=t-i;return"█".repeat(i)+"░".repeat(r)}function dPt(){const{activeProject:e,tasks:t,sprints:i,selectTask:r}=_n(),[n,a]=ee.useState(null),[s,o]=ee.useState(null),l=ee.useMemo(()=>{if(!e||t.length===0||i.length===0)return[];const c=new Map;for(const d of i)c.set(d.id,d);const u=new Map;for(const d of t){const f=d.sprintId||"unknown";u.has(f)||u.set(f,new Map);const m=u.get(f),y=d.prdSection||"Uncategorized";m.has(y)||m.set(y,{name:y,total:0,completed:0,inProgress:0,blocked:0,percent:0,tasks:[],order:d.prdLineStart??999});const g=m.get(y);g.total++,g.tasks.push(d),d.status==="completed"&&g.completed++,d.status==="in_progress"&&g.inProgress++,d.status==="blocked"&&g.blocked++}const h=[];for(const[d,f]of u){const m=c.get(d);if(!m)continue;const y=Array.from(f.values());for(const w of y)w.percent=w.total>0?Math.round(w.completed/w.total*100):0;y.sort((w,S)=>w.order-S.order);const g=y.reduce((w,S)=>w+S.total,0),x=y.reduce((w,S)=>w+S.completed,0);h.push({sprint:m,sections:y,total:g,completed:x,percent:g>0?Math.round(x/g*100):0})}return h.sort((d,f)=>(d.sprint.order??0)-(f.sprint.order??0)),h},[e,t,i]);return l.length===0?C.jsx("div",{className:"h-full flex items-center justify-center font-mono text-[11px]",children:C.jsxs("div",{className:"terminal-dim text-center",children:[C.jsx("p",{children:"## PRD OVERVIEW ##"}),C.jsx("p",{className:"mt-1",children:"> Import a PRD to see section progress"})]})}):C.jsxs("div",{className:"p-2 font-mono text-[11px]",children:[C.jsxs("div",{className:"flex items-center justify-between mb-2",children:[C.jsx("span",{className:"terminal-muted",children:"## PRD SECTIONS ##"}),C.jsx("span",{className:"text-[#00ccff] text-[10px]",children:e==null?void 0:e.name})]}),C.jsx("div",{className:"border border-[#1a3a1a] bg-[#050505]",children:l.map(c=>{const u=n===c.sprint.id,h=c.percent===100?"text-[#00ff00]":"text-[#ffaa00]";return C.jsxs("div",{children:[C.jsxs("div",{className:"flex items-center gap-0 px-2 py-1.5 hover:bg-[#0a1a0a] transition-colors border-b border-[#1a3a1a] cursor-pointer",onClick:()=>a(u?null:c.sprint.id),children:[C.jsx("span",{className:"w-[24px] terminal-dim text-[10px]",children:u?"[-]":"[+]"}),C.jsx("span",{className:`flex-1 font-bold uppercase text-[11px] ${h}`,children:c.sprint.name}),C.jsxs("span",{className:`w-[110px] text-center text-[10px] ${h}`,children:[xpe(c.percent)," ",c.percent,"%"]}),C.jsxs("span",{className:"w-[50px] text-right text-[10px] text-[#00ff00]",children:[c.completed,"/",c.total]})]}),u&&C.jsxs("div",{className:"bg-[#030303]",children:[C.jsxs("div",{className:"flex items-center gap-0 px-2 py-0.5 border-b border-[#0a1a0a] terminal-dim text-[9px]",children:[C.jsx("span",{className:"w-[36px]"}),C.jsx("span",{className:"flex-1",children:"SECTION"}),C.jsx("span",{className:"w-[110px] text-center",children:"PROGRESS"}),C.jsx("span",{className:"w-[40px] text-right",children:"DONE"}),C.jsx("span",{className:"w-[30px] text-right",children:"ACT"}),C.jsx("span",{className:"w-[30px] text-right",children:"BLK"})]}),c.sections.map(d=>{const f=`${c.sprint.id}:${d.name}`,m=s===f,y=d.percent===100?"text-[#00ff00]":d.blocked>0?"terminal-error":d.inProgress>0?"text-[#00ccff]":"terminal-dim";return C.jsxs("div",{children:[C.jsxs("div",{className:"flex items-center gap-0 px-2 py-0.5 hover:bg-[#0a1a0a] transition-colors border-b border-[#0a1a0a] text-[10px] cursor-pointer",onClick:()=>o(m?null:f),children:[C.jsx("span",{className:"w-[12px]"}),C.jsx("span",{className:"w-[24px] terminal-dim",children:m?"[-]":"[+]"}),C.jsx("span",{className:"flex-1 truncate text-[#00cc00]",children:d.name}),C.jsxs("span",{className:`w-[110px] text-center ${y}`,children:[xpe(d.percent)," ",d.percent,"%"]}),C.jsxs("span",{className:"w-[40px] text-right text-[#00ff00]",children:[d.completed,"/",d.total]}),C.jsx("span",{className:`w-[30px] text-right ${d.inProgress>0?"text-[#00ccff]":"terminal-dim"}`,children:d.inProgress}),C.jsx("span",{className:`w-[30px] text-right ${d.blocked>0?"terminal-error":"terminal-dim"}`,children:d.blocked})]}),m&&C.jsx("div",{className:"bg-[#050505] border-b border-[#0a1a0a]",children:d.tasks.map(g=>{const x=ype[g.status]||ype.backlog;return C.jsxs("div",{onClick:()=>r(g.id),className:"cursor-pointer hover:bg-[#0a1a0a] px-6 py-0.5 text-[10px] flex items-center gap-1",children:[C.jsxs("span",{className:x.color,children:["[",x.char,"]"]}),C.jsx("span",{className:"text-[#00cc00] truncate flex-1",children:g.title}),g.assignedAgent&&C.jsxs("span",{className:"terminal-dim",children:["@",g.assignedAgent]})]},g.id)})})]},f)})]})]},c.sprint.id)})})]})}const zMe={backlog:".",planned:"-",pending:"~",in_progress:"*",in_review:"?",completed:"+",blocked:"!",deferred:"_"},BMe={backlog:"terminal-dim",planned:"text-[#00ccff]",pending:"terminal-muted",in_progress:"text-[#00ff00]",in_review:"terminal-muted",completed:"text-[#00ff00]",blocked:"terminal-error",deferred:"terminal-dim"};function fPt(){const{tasks:e}=_n(),{roots:t,edgeCount:i,nodeCount:r}=ee.useMemo(()=>{const n=new Map,a=new Map,s=new Map;for(const f of e){s.set(f.id,f);const m=new Set([...f.dependsOn,...f.blockedBy]);n.set(f.id,m)}const o=new Set;let l=0;for(const f of e){const m=n.get(f.id)??new Set;if(m.size>0){o.add(f.id);for(const y of m)o.add(y),l++,a.has(y)||a.set(y,new Set),a.get(y).add(f.id)}}if(o.size===0)return{roots:[],edgeCount:0,nodeCount:0};const c=new Set;for(const f of o){const m=n.get(f)??new Set;Array.from(m).some(g=>o.has(g))||c.add(f)}if(c.size===0){const f=Array.from(o).slice(0,3);for(const m of f)c.add(m)}const u=new Set;function h(f,m){if(u.has(f)||m>6)return null;u.add(f);const y=s.get(f);if(!y)return null;const g=a.get(f)??new Set,x=[];for(const w of g)if(o.has(w)){const S=h(w,m+1);S&&x.push(S)}return{task:y,children:x,depth:m}}const d=[];for(const f of c){const m=h(f,0);m&&d.push(m)}return{roots:d,edgeCount:l,nodeCount:o.size}},[e]);return t.length===0?C.jsxs("div",{className:"p-3 border-b border-[#1a3a1a] font-mono text-[11px]",children:[C.jsx("span",{className:"terminal-muted",children:"## DEPENDENCIES ##"}),C.jsx("div",{className:"terminal-dim text-center py-3",children:"> No task dependencies"})]}):C.jsxs("div",{className:"p-3 border-b border-[#1a3a1a] font-mono text-[11px]",children:[C.jsxs("div",{className:"flex items-center justify-between mb-2",children:[C.jsx("span",{className:"terminal-muted",children:"## DEPENDENCIES ##"}),C.jsxs("span",{className:"terminal-dim text-[10px]",children:[r," tasks ","·"," ",i," links"]})]}),C.jsx("div",{className:"bg-[#050505] border border-[#1a3a1a] p-2 overflow-auto terminal-scrollbar max-h-[280px]",children:t.map((n,a)=>C.jsx(UMe,{node:n,prefix:"",isLast:a===t.length-1},n.task.id))}),C.jsx("div",{className:"flex flex-wrap gap-x-3 gap-y-0.5 mt-1.5 text-[9px]",children:Object.entries(zMe).filter(([n])=>e.some(a=>a.status===n)).map(([n,a])=>C.jsxs("span",{className:BMe[n]||"terminal-dim",children:["[",a,"] ",n.replace(/_/g," ")]},n))})]})}function UMe({node:e,prefix:t,isLast:i}){const r=i?"└─":"├─",n=t+(i?" ":"│ "),a=zMe[e.task.status]||"?",s=BMe[e.task.status]||"terminal-dim",o=e.task.title.length>30?e.task.title.slice(0,27)+"...":e.task.title;return C.jsxs("div",{className:"text-[10px]",children:[C.jsxs("div",{className:"flex items-center gap-0 whitespace-nowrap",children:[C.jsxs("span",{className:"terminal-dim",children:[t,r]}),C.jsxs("span",{className:`font-bold ${s}`,children:["[",a,"]"]}),C.jsx("span",{className:"text-[#00cc00] ml-1",children:o}),e.task.assignedAgent&&C.jsxs("span",{className:"terminal-dim ml-1",children:["@",e.task.assignedAgent]})]}),e.children.map((l,c)=>C.jsx(UMe,{node:l,prefix:n,isLast:c===e.children.length-1},l.task.id))]})}function pPt(){const{viewMode:e,setViewMode:t,activeProject:i}=_n();return C.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px]",children:[C.jsx("button",{onClick:()=>t("agents"),className:`px-2 py-0.5 transition-colors ${e==="agents"?"text-[#00ff00] terminal-glow bg-[#0a1f0a]":"terminal-muted hover:text-[#00aa00]"}`,children:"[AGENTS]"}),C.jsx("button",{onClick:()=>t("tracker"),className:`px-2 py-0.5 transition-colors ${e==="tracker"?"text-[#00ff00] terminal-glow bg-[#0a1f0a]":"terminal-muted hover:text-[#00aa00]"}`,children:"[TRACKER]"}),i&&C.jsxs("span",{className:"terminal-muted",children:[i.completedTasks,"/",i.totalTasks]})]})}function mPt(){const{connectionStatus:e}=Ni(),t={connected:{className:"text-[#00ff00] terminal-glow",label:"[CONNECTED]",sublabel:"capturing events",sublabelClass:"text-[#00aa00]",showCursor:!0},reconnecting:{className:"text-[#ffaa00]",label:"[RECONNECTING...]",sublabel:"",sublabelClass:"",showCursor:!1},disconnected:{className:"terminal-error",label:"[DISCONNECTED]",sublabel:"waiting for server",sublabelClass:"terminal-error",showCursor:!1}}[e];return C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("span",{className:t.className,children:t.label}),t.sublabel&&C.jsx("span",{className:t.sublabelClass,children:t.sublabel}),t.showCursor&&C.jsx("span",{className:"terminal-cursor-active"})]})}function gPt(){const{viewMode:e}=_n();return C.jsxs("div",{className:"h-full w-full flex flex-col terminal-bg terminal-boot overflow-hidden",children:[C.jsxs("header",{className:"h-10 flex items-center justify-between px-3 border-b border-[#1a3a1a] bg-[#0d0d0d] shrink-0 font-mono text-[11px] relative z-50",children:[C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx("span",{className:"text-[#00ff00] terminal-glow font-bold",children:"CAM://"}),C.jsx("span",{className:"text-[#00aa00]",children:"Claude Agent Monitor"}),C.jsx("span",{className:"terminal-dim",children:"|"}),C.jsx(mPt,{})]}),C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx(RX,{}),C.jsx(pPt,{})]})]}),C.jsx(HCt,{}),C.jsx(IK,{}),C.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[e==="agents"&&C.jsx(vPt,{}),e==="tracker"&&C.jsx(yPt,{})]})]})}function vPt(){return C.jsxs(C.Fragment,{children:[C.jsx("aside",{className:"w-48 border-r border-[#1a3a1a] overflow-y-auto terminal-scrollbar shrink-0",children:C.jsx(XCt,{})}),C.jsx("main",{className:"flex-1 overflow-hidden",children:C.jsx(MK,{})}),C.jsx("aside",{className:"w-72 border-l border-[#1a3a1a] terminal-scrollbar shrink-0",children:C.jsx(RK,{AgentDetail:tPt,ActivityFeed:QCt,FileWatcher:rPt,tabBarClass:"flex border-b border-[#1a3a1a] bg-[#0d0d0d]",activeTabClass:"text-[#00ff00] terminal-glow border-b-2 border-[#00ff00]",inactiveTabClass:"text-[#00aa00]/60 hover:text-[#00aa00]"})})]})}function yPt(){const{selectedTaskId:e}=_n();return C.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[C.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[C.jsx("main",{className:"flex-1 overflow-hidden",children:C.jsx(oPt,{})}),e&&C.jsx("aside",{className:"w-80 border-l border-[#1a3a1a] overflow-y-auto terminal-scrollbar shrink-0",children:C.jsx(EK,{})}),C.jsxs("aside",{className:"w-80 border-l border-[#1a3a1a] overflow-y-auto terminal-scrollbar shrink-0 flex flex-col",children:[C.jsx(uPt,{}),C.jsx(hPt,{}),C.jsx(fPt,{})]})]}),C.jsx("div",{className:"h-48 border-t border-[#1a3a1a] overflow-y-auto terminal-scrollbar shrink-0",children:C.jsx(dPt,{})})]})}const Ww={TIME:"⌛",PARTY:"⚔",SKILLS:"🎯",EVENTS:"📜",LOOT:"📦",POISON:"☠"};function xPt(){const{session:e,agents:t,events:i}=Ni(),[r,n]=ee.useState("00m 00s");ee.useEffect(()=>{if(!(e!=null&&e.startedAt))return;const u=()=>n(H7(e.startedAt,e.endedAt));if(u(),!e.endedAt){const h=setInterval(u,1e3);return()=>clearInterval(h)}},[e==null?void 0:e.startedAt,e==null?void 0:e.endedAt]);const a=t.filter(u=>u.status==="active").length,s=t.reduce((u,h)=>u+h.errorCount,0),o=t.reduce((u,h)=>u+h.toolCallCount,0),l=i.filter(u=>u.category==="file_change").length,c=[{label:"TIME",value:r,icon:Ww.TIME,color:"var(--pixel-text)"},{label:"PARTY",value:`${a}/${t.length}`,icon:Ww.PARTY,color:a>0?"var(--pixel-green)":"var(--pixel-text)"},{label:"SKILLS",value:Lm(o),icon:Ww.SKILLS,color:"var(--pixel-cyan)"},{label:"EVENTS",value:Lm((e==null?void 0:e.eventCount)??0),icon:Ww.EVENTS,color:"var(--pixel-text)"},{label:"LOOT",value:Lm(l),icon:Ww.LOOT,color:"var(--pixel-orange)"},{label:"POISON",value:String(s),icon:Ww.POISON,color:s>0?"var(--pixel-error)":"var(--pixel-text)"}];return C.jsx("div",{className:"h-11 flex items-center gap-0 px-4 shrink-0",style:{background:"var(--pixel-bg-dark)",borderBottom:"3px solid var(--pixel-border)"},children:c.map((u,h)=>C.jsxs("div",{className:"flex items-center gap-2",style:{borderLeft:h>0?"2px solid var(--pixel-border)":"none",paddingLeft:h>0?"12px":"0",marginLeft:h>0?"12px":"0"},children:[C.jsx("span",{className:"pixel-text-sm",children:u.icon}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:u.label}),C.jsx("span",{className:"pixel-text-sm",style:{color:u.color,fontWeight:"bold"},children:u.value})]},u.label))})}const bPt={"team-lead":"PALADIN","code-writer":"MAGE","code-reviewer":"CLERIC",tester:"RANGER",researcher:"SCHOLAR",designer:"BARD"},wPt={"team-lead":"⚔","code-writer":"🧙","code-reviewer":"🛡",tester:"🎯",researcher:"📚",designer:"🎨"};function _Pt(e){const t=e.name.toLowerCase();for(const[i,r]of Object.entries(bPt))if(t.includes(i))return r;return e.type==="lead"?"PALADIN":"ADVENTURER"}function jMe(e){const t=e.name.toLowerCase();for(const[i,r]of Object.entries(wPt))if(t.includes(i))return r;return"⚔"}function FMe(e){switch(e){case"active":return{text:"FIGHTING",color:"var(--pixel-green)"};case"idle":return{text:"RESTING",color:"var(--pixel-orange)"};case"error":return{text:"POISONED",color:"var(--pixel-error)"};case"completed":return{text:"VICTORY",color:"var(--pixel-cyan)"};case"shutdown":return{text:"FALLEN",color:"var(--pixel-text-dim)"};default:return{text:e.toUpperCase(),color:"var(--pixel-text-muted)"}}}function SPt(e){return e.status==="active"}function APt(){const e=$7(),{selectedAgentId:t,selectAgent:i}=Ni(),[r,n]=ee.useState(!1),{activeAgents:a,inactiveAgents:s}=ee.useMemo(()=>{const o=[],l=[];for(const c of e)SPt(c)?o.push(c):l.push(c);return{activeAgents:o,inactiveAgents:l}},[e]);return e.length===0?C.jsxs("div",{className:"p-4 flex flex-col items-center justify-center h-full text-center",children:[C.jsx("div",{className:"pixel-text-xl mb-3",children:"\\u2694"}),C.jsx("p",{className:"pixel-text-sm",style:{color:"var(--pixel-text-muted)"},children:"WAITING FOR"}),C.jsx("p",{className:"pixel-text-sm mt-1 pixel-blink",style:{color:"var(--pixel-gold)"},children:"PARTY MEMBERS..."})]}):C.jsxs("div",{className:"p-2",children:[C.jsx("div",{className:"px-2 py-2 mb-2",children:C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:["ACTIVE PARTY (",a.length,")"]})}),a.length>0?C.jsx("div",{className:"space-y-2",children:a.map(o=>C.jsx(EPt,{agent:o,isSelected:t===o.id,onSelect:()=>i(t===o.id?null:o.id)},o.id))}):C.jsx("div",{className:"px-2 py-3 text-center",children:C.jsx("p",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:"NO ACTIVE HEROES"})}),s.length>0&&C.jsxs("div",{className:"mt-3",children:[C.jsx("button",{onClick:()=>n(!r),className:"w-full text-left px-2 py-1.5 pixel-card",style:{cursor:"pointer"},children:C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:[r?"▼":"▶"," FALLEN/RESTING"]}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)",background:"var(--pixel-bg-dark)",border:"1px solid var(--pixel-border)",padding:"0 4px"},children:s.length})]})}),r&&C.jsx("div",{className:"space-y-1 mt-1",children:s.map(o=>C.jsx(MPt,{agent:o,isSelected:t===o.id,onSelect:()=>i(t===o.id?null:o.id)},o.id))})]})]})}function MPt({agent:e,isSelected:t,onSelect:i}){const r=Ch(e.id,e.name,e.type??void 0),n=FMe(e.status),a=jMe(e);return C.jsx("button",{onClick:i,title:`${e.name} (${e.id})`,className:`w-full text-left px-2 py-1 ${t?"pixel-border-accent":"pixel-card"}`,style:{cursor:"pointer"},children:C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"pixel-text-xs",children:a}),C.jsx("span",{className:"pixel-text-xs truncate",style:{color:"var(--pixel-text-dim)"},children:r}),C.jsx("span",{className:"pixel-text-xs shrink-0",style:{color:"var(--pixel-gold, #d4a017)"},children:e.type}),C.jsx("span",{className:"pixel-text-xs",style:{color:n.color},children:n.text}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:qc(e.lastActivityAt)})]})})}function EPt({agent:e,isSelected:t,onSelect:i}){const r=f0(e.name),n=FMe(e.status),a=_Pt(e),s=jMe(e),o=100,l=e.errorCount>0?Math.max(10,o-e.errorCount*20):o,c=Math.min(100,e.toolCallCount%100),u=Ch(e.id,e.name,e.type??void 0);return C.jsxs("button",{onClick:i,title:`${e.name} (${e.id})`,className:`w-full text-left p-2 ${t?"pixel-border-accent":"pixel-card"}`,style:{cursor:"pointer"},children:[C.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[C.jsx("span",{className:"pixel-text-base",children:s}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("span",{className:"pixel-text-sm truncate",style:{color:r},children:u}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold, #d4a017)"},children:e.type})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:["LV.",Math.min(99,Math.floor(e.toolCallCount/5)+1)]}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:a})]})]})]}),C.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-hp)",width:"16px"},children:"HP"}),C.jsx("div",{className:"flex-1 pixel-bar-container pixel-bar-hp",children:C.jsx("div",{className:"pixel-bar-fill",style:{width:`${l}%`}})}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)",width:"32px",textAlign:"right"},children:l})]}),C.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-mp)",width:"16px"},children:"MP"}),C.jsx("div",{className:"flex-1 pixel-bar-container pixel-bar-mp",children:C.jsx("div",{className:"pixel-bar-fill",style:{width:`${c}%`}})}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)",width:"32px",textAlign:"right"},children:c})]}),C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("span",{className:`pixel-text-xs ${e.status==="active"?"pixel-pulse":""}`,style:{color:n.color},children:n.text}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:qc(e.lastActivityAt)})]}),e.errorCount>0&&C.jsxs("div",{className:"mt-1 pixel-text-xs pixel-shake",style:{color:"var(--pixel-error)"},children:["\\u2620 ",e.errorCount," CURSE",e.errorCount>1?"S":""]})]})}const VMe=new Set(["TaskList","TaskGet"]);function TPt(e){const t=[];let i=0;for(;i<e.length;){const r=e[i];if(r.tool&&VMe.has(r.tool)){let n=1;for(;i+n<e.length&&e[i+n].tool===r.tool&&e[i+n].agentId===r.agentId;)n++;t.push({event:r,count:n,groupId:`grp-${r.id}`}),i+=n}else t.push({event:r,count:1,groupId:r.id}),i++}return t}const CPt={Edit:"used ENCHANT!",Write:"cast CREATE!",Read:"used SCAN!",Bash:"cast INVOKE!",Grep:"used SEARCH!",Glob:"used DETECT!",TaskCreate:"used QUEST LOG!",TaskUpdate:"used QUEST UPDATE!",TaskList:"checked QUEST BOARD!",SendMessage:"cast TELEPATHY!",WebFetch:"used SCRY!",WebSearch:"cast DIVINATION!",NotebookEdit:"used TOME EDIT!"};function PPt(e){return e.error?{text:"IT MISSED!",color:"var(--pixel-error)"}:e.duration&&e.duration>5e3?{text:"IT WAS SLOW...",color:"var(--pixel-orange)"}:e.category==="error"?{text:"CRITICAL MISS!",color:"var(--pixel-error)"}:e.category==="file_change"?{text:"IT'S SUPER EFFECTIVE!",color:"var(--pixel-green)"}:{text:"HIT!",color:"var(--pixel-cyan)"}}function DPt(e){switch(e){case"tool_call":return"⚔";case"file_change":return"📦";case"command":return"💻";case"message":return"💬";case"lifecycle":return"🔄";case"error":return"☠";case"compact":return"📦";case"notification":return"🔔";default:return"●"}}function OPt(){const e=Dq(),t=Ni(m=>m.agents),{searchQuery:i,setSearchQuery:r}=az(),n=Di(m=>m.followMode),a=Di(m=>m.hidePolling),s=Di(m=>m.toggleFollowMode),o=Di(m=>m.toggleHidePolling),l=ee.useRef(null),[c,u]=ee.useState(null),h=ee.useMemo(()=>{const m=new Map;for(const y of t)m.set(y.id,Ch(y.id,y.name||y.id,y.type??void 0));return m},[t]);ee.useEffect(()=>{n&&l.current&&(l.current.scrollTop=0)},[e.length,n]);const d=ee.useMemo(()=>{let m=e;if(a&&(m=m.filter(y=>!y.tool||!VMe.has(y.tool))),i){const y=i.toLowerCase();m=m.filter(g=>{var x,w,S,M;return((x=g.tool)==null?void 0:x.toLowerCase().includes(y))||((w=g.filePath)==null?void 0:w.toLowerCase().includes(y))||((S=g.input)==null?void 0:S.toLowerCase().includes(y))||((M=g.output)==null?void 0:M.toLowerCase().includes(y))})}return m},[e,a,i]),f=ee.useMemo(()=>TPt(d),[d]);return C.jsxs("div",{className:"h-full flex flex-col",style:{background:"var(--pixel-bg)"},children:[C.jsxs("div",{className:"flex items-center justify-between px-4 py-2 shrink-0",style:{borderBottom:"3px solid var(--pixel-border)",background:"var(--pixel-surface)"},children:[C.jsxs("span",{className:"pixel-text-sm",style:{color:"var(--pixel-gold)"},children:["\\u2694 BATTLE LOG (",d.length,")"]}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("input",{type:"text",placeholder:"SEARCH...",value:i,onChange:m=>r(m.target.value),className:"pixel-text-xs px-2 py-1",style:{width:"100px",background:"var(--pixel-bg-dark)",border:"2px solid var(--pixel-border)",color:"var(--pixel-text)",outline:"none",fontFamily:"'Press Start 2P', monospace"}}),C.jsx("button",{onClick:o,className:`pixel-text-xs px-2 py-1 ${a?"pixel-btn-active":"pixel-btn"}`,title:"Hide TaskList/TaskGet polling",children:a?"POLL:OFF":"POLL"}),C.jsx("button",{onClick:s,className:`pixel-text-xs px-2 py-1 ${n?"pixel-btn-active":"pixel-btn"}`,children:n?"AUTO":"MANUAL"})]})]}),C.jsx("div",{ref:l,className:"flex-1 overflow-y-auto pixel-scrollbar",children:d.length===0?C.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-8",children:[C.jsx("div",{className:"pixel-text-2xl mb-3",children:"\\u2694"}),C.jsx("p",{className:"pixel-text-sm",style:{color:"var(--pixel-text-muted)"},children:"NO ENCOUNTERS YET"}),C.jsx("p",{className:"pixel-text-xs mt-2 pixel-blink",style:{color:"var(--pixel-gold)"},children:"AWAITING BATTLE..."})]}):C.jsx("div",{children:f.map(({event:m,count:y,groupId:g},x)=>C.jsx("div",{className:"pixel-slide-in",style:{animationDelay:`${Math.min(x*.02,.2)}s`},children:C.jsx(RPt,{event:m,agentNameMap:h,isExpanded:c===m.id,groupCount:y,onToggle:()=>u(c===m.id?null:m.id)})},g))})})]})}function RPt({event:e,agentNameMap:t,isExpanded:i,groupCount:r,onToggle:n}){const[a,s]=ee.useState(!1),o=DPt(e.category),l=sz(e.tool||e.hookType),c=CPt[e.tool||""]||`used ${l.toUpperCase()}!`,u=PPt(e);return C.jsx("div",{className:"px-4 py-2 cursor-pointer",onClick:n,style:{borderBottom:"1px solid var(--pixel-border)",background:i?"var(--pixel-surface)":"transparent"},onMouseEnter:h=>{h.currentTarget.style.background="var(--pixel-surface)"},onMouseLeave:h=>{i||(h.currentTarget.style.background="transparent")},children:C.jsxs("div",{className:"flex items-start gap-3",children:[C.jsx("span",{className:"pixel-text-base mt-0.5 w-5 text-center shrink-0",children:o}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-cyan)"},title:e.agentId,children:t.get(e.agentId)??e.agentId.slice(0,8)}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text)"},title:e.tool||e.hookType,children:c}),r&&r>1&&C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)",background:"var(--pixel-bg-dark)",border:"1px solid var(--pixel-border)",padding:"0 3px"},children:["x",r]})]}),C.jsx("span",{className:"pixel-text-xs",style:{color:u.color},children:u.text}),e.filePath&&C.jsx("div",{className:"mt-0.5",children:C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},title:e.filePath,children:["TARGET: ",Ah(e.filePath)]})}),e.error&&C.jsxs("p",{className:"pixel-text-xs mt-0.5 pixel-shake",style:{color:"var(--pixel-error)"},children:["\\u2620 ",e.error]}),i&&C.jsxs("div",{className:"mt-2 space-y-2",onClick:h=>h.stopPropagation(),children:[e.input&&C.jsxs("div",{children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:"INPUT:"}),C.jsx("pre",{className:"mt-1 pixel-text-xs overflow-x-auto max-h-32 pixel-scrollbar whitespace-pre-wrap break-all p-2",style:{color:"var(--pixel-text-muted)",background:"var(--pixel-bg-dark)",border:"2px solid var(--pixel-border)",fontFamily:"'Press Start 2P', monospace"},children:a?e.input:Oq(e.tool,e.input)})]}),e.output&&C.jsxs("div",{children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:"OUTPUT:"}),C.jsx("pre",{className:"mt-1 pixel-text-xs overflow-x-auto max-h-32 pixel-scrollbar whitespace-pre-wrap break-all p-2",style:{color:"var(--pixel-text-muted)",background:"var(--pixel-bg-dark)",border:"2px solid var(--pixel-border)",fontFamily:"'Press Start 2P', monospace"},children:a?e.output:Rq(e.output)})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[e.duration!==void 0&&C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:["CAST TIME: ",e.duration,"ms"]}),(e.input||e.output)&&C.jsx("button",{onClick:h=>{h.stopPropagation(),s(!a)},className:"pixel-text-xs pixel-btn",style:{padding:"0 4px",fontSize:"7px"},children:a?"SUMMARY":"RAW"})]})]})]}),C.jsx("span",{className:"pixel-text-xs shrink-0",style:{color:"var(--pixel-text-dim)"},children:gu(e.timestamp)})]})})}const IPt=[{id:"activity",label:"LOG",icon:"📜"},{id:"files",label:"LOOT",icon:"📦"},{id:"errors",label:"CURSES",icon:"☠"},{id:"messages",label:"CHAT",icon:"💬"}];function NPt(){const{selectedAgentId:e,agents:t,events:i,selectAgent:r}=Ni(),[n,a]=ee.useState("activity"),s=t.find(E=>E.id===e);if(!s)return null;const o=i.filter(E=>E.agentId===s.id),l=o.filter(E=>E.category==="error"||E.error),c=o.filter(E=>E.filePath).reduce((E,T)=>(T.filePath&&!E.includes(T.filePath)&&E.push(T.filePath),E),[]),u=o.filter(E=>E.category==="message"),h=f0(s.name),d=Math.min(99,Math.floor(s.toolCallCount/5)+1),f=s.toolCallCount%50,m=50,y=s.errorCount>0?Math.max(10,100-s.errorCount*20):100,g=Math.min(100,s.toolCallCount%100),x=Math.min(99,Math.floor(s.toolCallCount/3)),w=Math.min(99,50-Math.min(50,s.errorCount*10)),S=Math.min(99,o.length>0?60:10),M=Math.min(99,s.errorCount===0?80:20);return C.jsxs("div",{className:"h-full flex flex-col",style:{background:"var(--pixel-bg)"},children:[C.jsxs("div",{className:"p-3 shrink-0",style:{borderBottom:"3px solid var(--pixel-border)",background:"var(--pixel-surface)"},children:[C.jsxs("div",{className:"flex items-center justify-between mb-2",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("div",{className:"w-10 h-10 flex items-center justify-center pixel-border",style:{background:`${h}20`,color:h},children:C.jsx("span",{className:"pixel-text-lg font-bold",children:s.name.charAt(0).toUpperCase()})}),C.jsxs("div",{children:[C.jsx("h3",{className:"pixel-text-sm",style:{color:"var(--pixel-text)"},title:`${s.name} (${s.id})`,children:Ch(s.id,s.name,s.type??void 0)}),C.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:["LV.",d]}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:s.type.toUpperCase()})]})]})]}),C.jsx("button",{onClick:()=>r(null),className:"pixel-btn px-2 py-1 pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:"X"})]}),C.jsxs("div",{className:"space-y-1 mb-2",children:[C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-hp)",width:"20px"},children:"HP"}),C.jsx("div",{className:"flex-1 pixel-bar-container pixel-bar-hp",children:C.jsx("div",{className:"pixel-bar-fill",style:{width:`${y}%`}})}),C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)",width:"40px",textAlign:"right"},children:[y,"/100"]})]}),C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-mp)",width:"20px"},children:"MP"}),C.jsx("div",{className:"flex-1 pixel-bar-container pixel-bar-mp",children:C.jsx("div",{className:"pixel-bar-fill",style:{width:`${g}%`}})}),C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)",width:"40px",textAlign:"right"},children:[g,"/100"]})]}),C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-xp)",width:"20px"},children:"XP"}),C.jsx("div",{className:"flex-1 pixel-bar-container pixel-bar-xp",children:C.jsx("div",{className:"pixel-bar-fill",style:{width:`${f/m*100}%`}})}),C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)",width:"40px",textAlign:"right"},children:[f,"/",m]})]})]}),C.jsx("div",{className:"grid grid-cols-4 gap-1",children:[{label:"STR",value:x,color:"var(--pixel-hp)"},{label:"DEF",value:w,color:"var(--pixel-blue)"},{label:"SPD",value:S,color:"var(--pixel-green)"},{label:"LCK",value:M,color:"var(--pixel-gold)"}].map(E=>C.jsxs("div",{className:"text-center p-1",style:{background:"var(--pixel-bg-dark)",border:"2px solid var(--pixel-border)"},children:[C.jsx("div",{className:"pixel-text-sm font-bold",style:{color:E.color},children:E.value}),C.jsx("div",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:E.label})]},E.label))})]}),C.jsx("div",{className:"flex shrink-0",style:{borderBottom:"3px solid var(--pixel-border)"},children:IPt.map(E=>{const T=E.id==="activity"?o.length:E.id==="files"?c.length:E.id==="errors"?l.length:u.length;return C.jsxs("button",{onClick:()=>a(E.id),className:"flex-1 py-2 pixel-text-xs text-center",style:{background:n===E.id?"var(--pixel-accent)":"var(--pixel-surface)",color:n===E.id?"#fff":"var(--pixel-text-muted)",borderRight:"2px solid var(--pixel-border)",cursor:"pointer"},children:[E.icon," ",E.label," (",T,")"]},E.id)})}),C.jsxs("div",{className:"flex-1 overflow-y-auto pixel-scrollbar",children:[n==="activity"&&C.jsx("div",{children:o.length===0?C.jsx("p",{className:"pixel-text-xs p-4 text-center",style:{color:"var(--pixel-text-muted)"},children:"NO ADVENTURE LOG YET"}):o.slice(0,100).map(E=>C.jsxs("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--pixel-border)"},children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-cyan)"},children:E.tool||E.hookType}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:gu(E.timestamp)})]}),E.filePath&&C.jsx("span",{className:"pixel-text-xs block mt-0.5",style:{color:"var(--pixel-text-muted)"},title:E.filePath,children:Ah(E.filePath)})]},E.id))}),n==="files"&&C.jsx("div",{className:"p-2 space-y-1",children:c.length===0?C.jsx("p",{className:"pixel-text-xs p-4 text-center",style:{color:"var(--pixel-text-muted)"},children:"NO LOOT FOUND"}):c.map(E=>C.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",style:{border:"1px solid var(--pixel-border)"},children:[C.jsx("span",{className:"pixel-text-xs",children:"\\📦"}),C.jsx("span",{className:"pixel-text-xs break-all",style:{color:"var(--pixel-text)"},title:E,children:Ah(E)})]},E))}),n==="errors"&&C.jsx("div",{children:l.length===0?C.jsx("p",{className:"pixel-text-xs p-4 text-center",style:{color:"var(--pixel-green)"},children:"NO CURSES! ALL CLEAR!"}):l.map(E=>C.jsxs("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--pixel-border)"},children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-error)"},children:["\\u2620 ",E.tool||E.hookType]}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:gu(E.timestamp)})]}),E.error&&C.jsx("p",{className:"pixel-text-xs mt-0.5 break-all",style:{color:"var(--pixel-error)"},children:E.error})]},E.id))}),n==="messages"&&C.jsx("div",{children:u.length===0?C.jsx("p",{className:"pixel-text-xs p-4 text-center",style:{color:"var(--pixel-text-muted)"},children:"NO TELEPATHY LOGS"}):u.map(E=>C.jsxs("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--pixel-border)"},children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-purple)"},children:"\\💬 TELEPATHY"}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:gu(E.timestamp)})]}),E.input&&C.jsx("p",{className:"pixel-text-xs mt-0.5 break-words whitespace-pre-wrap",style:{color:"var(--pixel-text-muted)"},children:E.input})]},E.id))})]})]})}const bpe={created:{icon:"✨",label:"NEW",rarity:"LEGENDARY",color:"var(--pixel-gold)"},modified:{icon:"🔮",label:"MOD",rarity:"RARE",color:"var(--pixel-purple)"},read:{icon:"📜",label:"READ",rarity:"COMMON",color:"var(--pixel-cyan)"}};function LPt(){const{session:e}=Ni(),[t,i]=ee.useState([]);ee.useEffect(()=>{if(!(e!=null&&e.id))return;let s=!1;async function o(){try{const{files:c}=await X7(e.id);s||i(c)}catch{}}o();const l=setInterval(o,5e3);return()=>{s=!0,clearInterval(l)}},[e==null?void 0:e.id]);const r=t.filter(s=>s.changeType==="created"),n=t.filter(s=>s.changeType==="modified"),a=t.filter(s=>s.changeType==="read");return C.jsxs("div",{className:"p-3 h-full flex flex-col",children:[C.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2",style:{borderBottom:"2px solid var(--pixel-border)"},children:[C.jsx("span",{className:"pixel-text-sm",style:{color:"var(--pixel-gold)"},children:"\\📦 INVENTORY"}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:[r.length,"\\u2728"]}),C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-purple)"},children:[n.length,"\\🔮"]}),C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-cyan)"},children:[a.length,"\\📜"]})]})]}),t.length===0?C.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center",children:[C.jsx("div",{className:"pixel-text-xl mb-3",children:"\\📦"}),C.jsx("p",{className:"pixel-text-sm",style:{color:"var(--pixel-text-muted)"},children:"INVENTORY EMPTY"}),C.jsx("p",{className:"pixel-text-xs mt-2",style:{color:"var(--pixel-text-dim)"},children:"NO LOOT COLLECTED YET"})]}):C.jsx("div",{className:"flex-1 overflow-y-auto pixel-scrollbar space-y-1",children:t.map(s=>{const o=bpe[s.changeType]||bpe.read;return C.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 group",style:{border:"2px solid transparent",cursor:"default"},onMouseEnter:l=>{l.currentTarget.style.borderColor="var(--pixel-border)",l.currentTarget.style.background="var(--pixel-surface)"},onMouseLeave:l=>{l.currentTarget.style.borderColor="transparent",l.currentTarget.style.background="transparent"},children:[C.jsx("span",{className:"pixel-text-base shrink-0",children:o.icon}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsx("span",{className:"pixel-text-xs block",style:{color:"var(--pixel-text)"},title:s.filePath,children:Ah(s.filePath)}),C.jsxs("span",{className:"pixel-text-xs",style:{color:o.color},children:["[",o.rarity,"]"]})]}),C.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.touchCount>1&&C.jsxs("span",{className:"pixel-text-xs px-1",style:{color:"var(--pixel-gold)",border:"1px solid var(--pixel-border)",background:"var(--pixel-bg-dark)"},children:["x",s.touchCount]}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:qc(s.lastTouchedAt)})]})]},`${s.filePath}-${s.agentId}`)})})]})}const kPt={backlog:{label:"RUMORS",icon:"💬",color:"var(--pixel-text-dim)"},planned:{label:"ACCEPTED",icon:"📜",color:"var(--pixel-blue)"},in_progress:{label:"ACTIVE",icon:"⚔",color:"var(--pixel-green)"},in_review:{label:"REPORTING",icon:"🔍",color:"var(--pixel-purple)"},completed:{label:"COMPLETE!",icon:"🏆",color:"var(--pixel-gold)"},blocked:{label:"SEALED",icon:"🔒",color:"var(--pixel-error)"}},wpe={critical:{label:"LEGENDARY",stars:"★★★★★",color:"var(--pixel-error)"},high:{label:"EPIC",stars:"★★★★",color:"var(--pixel-orange)"},medium:{label:"RARE",stars:"★★★",color:"var(--pixel-blue)"},low:{label:"COMMON",stars:"★★",color:"var(--pixel-text-dim)"}};function zPt(){const e=T0(),t=r=>r==="pending"?"planned":r==="deferred"?"backlog":r==="in_review"||r==="blocked"?"in_progress":r,i=K_.reduce((r,n)=>(r[n.id]=e.filter(a=>t(a.status)===n.id),r),{});return e.length===0?C.jsxs("div",{className:"h-full flex flex-col items-center justify-center p-8",children:[C.jsx("div",{className:"pixel-text-2xl mb-4",children:"\\📜"}),C.jsx("p",{className:"pixel-text-sm",style:{color:"var(--pixel-text-muted)"},children:"QUEST BOARD EMPTY"}),C.jsx("p",{className:"pixel-text-xs mt-2",style:{color:"var(--pixel-text-dim)"},children:"NO QUESTS AVAILABLE"}),C.jsx("p",{className:"pixel-text-xs mt-1 pixel-blink",style:{color:"var(--pixel-gold)"},children:"CHECK BACK LATER..."})]}):C.jsx("div",{className:"h-full flex gap-2 p-3 overflow-x-auto pixel-scrollbar",children:K_.map(r=>{const n=i[r.id]||[],a=kPt[r.id]||{label:r.label,icon:"■",color:"var(--pixel-text-muted)"};return C.jsxs("div",{className:"flex-shrink-0 w-56 flex flex-col pixel-card",children:[C.jsx("div",{className:"px-3 py-2 shrink-0",style:{borderBottom:"3px solid var(--pixel-border)"},children:C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:a.color},children:[a.icon," ",a.label]}),C.jsx("span",{className:"pixel-text-xs px-1.5 py-0.5",style:{color:"var(--pixel-text)",background:"var(--pixel-bg-dark)",border:"2px solid var(--pixel-border)"},children:n.length})]})}),C.jsx("div",{className:"flex-1 overflow-y-auto pixel-scrollbar p-2 space-y-2",children:n.map(s=>C.jsx(BPt,{task:s},s.id))})]},r.id)})})}function BPt({task:e}){const{selectTask:t,selectedTaskId:i}=_n(),r=oz(),n=wpe[e.priority]||wpe.low,a=e.assignedAgent?f0(e.assignedAgent):null,s=e.assignedAgent?r(e.assignedAgent):null,o=e.status==="completed",l=W7(e.prdSection);return C.jsxs("div",{className:`p-2 cursor-pointer ${o?"pixel-glow-gold":i===e.id?"pixel-glow-green":"pixel-border-light"}`,onClick:()=>t(e.id),style:{background:"var(--pixel-bg-dark)",opacity:o?.85:1},children:[C.jsxs("div",{className:"flex items-center justify-between mb-1",children:[C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:n.color},children:["[",n.label,"]"]}),l&&C.jsx("span",{className:"pixel-text-xs px-1",style:{color:"var(--pixel-gold)",background:"rgba(255, 215, 0, 0.1)",border:"1px solid var(--pixel-gold)"},children:l})]}),e.complexity&&C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:["C",e.complexity]})]}),C.jsx("div",{className:"mb-1",children:C.jsx("span",{className:"pixel-text-xs",style:{color:n.color},children:n.stars})}),C.jsxs("h4",{className:"pixel-text-xs leading-relaxed mb-2",style:{color:o?"var(--pixel-text-dim)":"var(--pixel-text)",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:[o&&"✓ ",e.title]}),C.jsxs("div",{className:"flex items-center justify-between",children:[e.assignedAgent&&a?C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("div",{className:"w-4 h-4 flex items-center justify-center pixel-text-xs",style:{background:`${a}30`,color:a,border:"1px solid var(--pixel-border)"},children:(s??"?").charAt(0).toUpperCase()}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:s})]}):C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:"UNASSIGNED"}),e.tags&&e.tags.length>0&&C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:["#",e.tags[0]]})]}),e.blockedBy.length>0&&C.jsxs("div",{className:"mt-1 pixel-text-xs pixel-shake",style:{color:"var(--pixel-error)"},children:["\\🔒 SEALED BY ",e.blockedBy.length," QUEST",e.blockedBy.length>1?"S":""]})]})}function UPt(){const{activeSprint:e}=lz(),t=T0(),i=ee.useMemo(()=>{if(!e)return{total:0,completed:0,inProgress:0,blocked:0,pending:0,percent:0};const n=t.filter(h=>h.sprintId===e.id),a=n.length||e.totalTasks||0,s=n.filter(h=>h.status==="completed").length,o=n.filter(h=>h.status==="in_progress").length,l=n.filter(h=>h.status==="blocked").length,c=a-s-o-l,u=a>0?Math.round(s/a*100):0;return{total:a,completed:s,inProgress:o,blocked:l,pending:c,percent:u}},[e,t]);if(!e)return C.jsx("div",{className:"p-4 text-center",children:C.jsx("p",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:"NO ACTIVE CHAPTER"})});const r=Math.floor(i.percent/10);return C.jsxs("div",{className:"p-4",style:{borderBottom:"3px solid var(--pixel-border)"},children:[C.jsxs("div",{className:"flex items-center justify-between mb-3",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:"\\📖 CHAPTER PROGRESS"}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:e.name})]}),C.jsxs("div",{className:"mb-3",children:[C.jsxs("div",{className:"flex items-center justify-between mb-1",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-xp)"},children:["XP LV.",r]}),C.jsxs("span",{className:"pixel-text-sm font-bold",style:{color:"var(--pixel-gold)"},children:[i.percent,"%"]})]}),C.jsx("div",{className:"pixel-bar-container pixel-bar-xp",style:{height:"16px"},children:C.jsx("div",{className:"pixel-bar-fill",style:{width:`${i.percent}%`,transition:"width 0.5s steps(8)"}})}),C.jsxs("div",{className:"flex items-center justify-between mt-1",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:[i.completed,"/",i.total," QUESTS"]}),i.percent===100&&C.jsx("span",{className:"pixel-text-xs pixel-bounce",style:{color:"var(--pixel-gold)"},children:"CHAPTER COMPLETE!"})]})]}),C.jsx("div",{className:"space-y-1",children:[{label:"VICTORIES",value:i.completed,icon:"🏆",color:"var(--pixel-green)",barClass:"pixel-bar-green"},{label:"IN BATTLE",value:i.inProgress,icon:"⚔",color:"var(--pixel-cyan)",barClass:"pixel-bar-purple"},{label:"WAITING",value:i.pending,icon:"⌛",color:"var(--pixel-orange)",barClass:"pixel-bar-xp"},{label:"SEALED",value:i.blocked,icon:"🔒",color:"var(--pixel-error)",barClass:"pixel-bar-hp"}].map(n=>C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"pixel-text-xs",style:{width:"14px"},children:n.icon}),C.jsx("span",{className:"pixel-text-xs flex-1",style:{color:n.color},children:n.label}),C.jsx("span",{className:"pixel-text-xs font-bold",style:{color:"var(--pixel-text)"},children:n.value})]},n.label))})]})}function jPt(){const e=T0(),{activeSprint:t}=_n(),i=t?e.filter(c=>c.sprintId===t.id):e,r=i.length,n=i.filter(c=>c.status==="completed").length,a=r-n,s=r>0?Math.round(n/r*100):0,o=20,l=8;return r===0?C.jsxs("div",{className:"pixel-panel p-3",children:[C.jsx("h3",{className:"pixel-title text-xs mb-2",children:"BURNDOWN"}),C.jsx("p",{className:"text-[10px] text-pixel-dim",children:"No quest data..."})]}):C.jsxs("div",{className:"pixel-panel p-3",children:[C.jsxs("h3",{className:"pixel-title text-xs mb-2",children:["BURNDOWN ",C.jsxs("span",{className:"text-pixel-dim",children:["LV.",s]})]}),C.jsxs("div",{className:"font-mono text-[9px] leading-tight text-pixel-green",children:[Array.from({length:l}).map((c,u)=>{const h=(l-u)/l*r,d=Math.round((l-u)/l*r),f=Array.from({length:o}).map((m,y)=>y/o*r<=n&&u>=l-Math.ceil(a/r*l)?"*":d>=h?".":" ").join("");return C.jsxs("div",{children:[String(Math.round(h)).padStart(3," "),"|",f,"|"]},u)}),C.jsx("div",{children:" +"+"-".repeat(o)+"+"})]}),C.jsxs("div",{className:"mt-2 flex gap-3 text-[9px]",children:[C.jsxs("span",{className:"text-pixel-green",children:["Done: ",n]}),C.jsxs("span",{className:"text-pixel-yellow",children:["Left: ",a]}),C.jsxs("span",{className:"text-pixel-dim",children:["Total: ",r]})]})]})}const _pe={backlog:{icon:"○",color:"var(--pixel-text-dim)"},planned:{icon:"○",color:"var(--pixel-blue)"},pending:{icon:"○",color:"var(--pixel-blue)"},in_progress:{icon:"⚔",color:"var(--pixel-green)"},in_review:{icon:"◆",color:"var(--pixel-purple)"},completed:{icon:"✓",color:"var(--pixel-gold)"},blocked:{icon:"✖",color:"var(--pixel-error)"},deferred:{icon:"○",color:"var(--pixel-text-dim)"}};function FPt(){const{activeProject:e,tasks:t,sprints:i,selectTask:r}=_n(),[n,a]=ee.useState(null),[s,o]=ee.useState(null),l=ee.useMemo(()=>{if(!e||t.length===0||i.length===0)return[];const c=new Map;for(const d of i)c.set(d.id,d);const u=new Map;for(const d of t){const f=d.sprintId||"unknown";u.has(f)||u.set(f,new Map);const m=u.get(f),y=d.prdSection||"Uncategorized";m.has(y)||m.set(y,{name:y,total:0,completed:0,inProgress:0,blocked:0,percent:0,tasks:[],order:d.prdLineStart??999});const g=m.get(y);g.total++,g.tasks.push(d),d.status==="completed"&&g.completed++,d.status==="in_progress"&&g.inProgress++,d.status==="blocked"&&g.blocked++}const h=[];for(const[d,f]of u){const m=c.get(d);if(!m)continue;const y=Array.from(f.values());for(const w of y)w.percent=w.total>0?Math.round(w.completed/w.total*100):0;y.sort((w,S)=>w.order-S.order);const g=y.reduce((w,S)=>w+S.total,0),x=y.reduce((w,S)=>w+S.completed,0);h.push({sprint:m,sections:y,total:g,completed:x,percent:g>0?Math.round(x/g*100):0})}return h.sort((d,f)=>(d.sprint.order??0)-(f.sprint.order??0)),h},[e,t,i]);return l.length===0?C.jsx("div",{className:"h-full flex items-center justify-center p-4",children:C.jsxs("div",{className:"text-center",children:[C.jsx("span",{className:"pixel-text-xl",children:"📖"}),C.jsx("p",{className:"pixel-text-xs mt-2",style:{color:"var(--pixel-text-muted)"},children:"QUEST JOURNAL"}),C.jsx("p",{className:"pixel-text-xs mt-1",style:{color:"var(--pixel-text-dim)"},children:"NO ENTRIES YET"})]})}):C.jsxs("div",{className:"p-3",children:[C.jsxs("div",{className:"flex items-center justify-between mb-2",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:["📖"," QUEST JOURNAL"]}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:e==null?void 0:e.name})]}),C.jsx("div",{className:"space-y-1",children:l.map(c=>{const u=n===c.sprint.id,h=c.percent===100;return C.jsxs("div",{children:[C.jsxs("div",{className:`p-2 cursor-pointer ${h?"pixel-border-gold":"pixel-card"}`,style:{background:"var(--pixel-bg-dark)"},onClick:()=>a(u?null:c.sprint.id),children:[C.jsxs("div",{className:"flex items-center justify-between mb-1",children:[C.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:u?"▼":"▶"}),C.jsx("h4",{className:"pixel-text-xs truncate",style:{color:"var(--pixel-gold)",fontWeight:"bold"},children:c.sprint.name})]}),C.jsxs("span",{className:"pixel-text-xs font-bold ml-2 shrink-0",style:{color:h?"var(--pixel-gold)":"var(--pixel-text)"},children:[c.percent,"%"]})]}),C.jsx("div",{className:"pixel-bar-container pixel-bar-xp",style:{height:"8px"},children:C.jsx("div",{className:"pixel-bar-fill",style:{width:`${c.percent}%`,background:h?"var(--pixel-gold)":"var(--pixel-xp)"}})}),C.jsx("div",{className:"flex items-center gap-2 pixel-text-xs mt-1",style:{color:"var(--pixel-text-dim)"},children:C.jsxs("span",{children:[c.completed,"/",c.total]})})]}),u&&C.jsx("div",{className:"ml-2 space-y-0.5",style:{borderLeft:"2px solid var(--pixel-border)"},children:c.sections.map(d=>{const f=`${c.sprint.id}:${d.name}`,m=s===f,y=d.percent===100,g=d.blocked>0,x=d.inProgress>0;let w="var(--pixel-text-dim)";return y?w="var(--pixel-gold)":g?w="var(--pixel-error)":x&&(w="var(--pixel-green)"),C.jsxs("div",{children:[C.jsxs("div",{className:"p-2 cursor-pointer",style:{background:"var(--pixel-bg-dark)"},onClick:()=>o(m?null:f),children:[C.jsxs("div",{className:"flex items-center justify-between mb-1",children:[C.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:m?"▼":"▶"}),C.jsx("h4",{className:"pixel-text-xs truncate",style:{color:"var(--pixel-text)"},children:d.name})]}),C.jsxs("span",{className:"pixel-text-xs font-bold ml-2 shrink-0",style:{color:w},children:[d.percent,"%"]})]}),C.jsx("div",{className:"pixel-bar-container pixel-bar-xp",style:{height:"6px"},children:C.jsx("div",{className:"pixel-bar-fill",style:{width:`${d.percent}%`,background:y?"var(--pixel-gold)":g?"var(--pixel-error)":"var(--pixel-xp)"}})}),C.jsxs("div",{className:"flex items-center gap-2 pixel-text-xs mt-1",style:{color:"var(--pixel-text-dim)"},children:[C.jsxs("span",{children:[d.completed,"/",d.total]}),d.inProgress>0&&C.jsxs("span",{style:{color:"var(--pixel-green)"},children:[d.inProgress,"⚔"]}),d.blocked>0&&C.jsxs("span",{style:{color:"var(--pixel-error)"},children:[d.blocked,"🔒"]})]})]}),m&&C.jsx("div",{className:"ml-2",style:{borderLeft:"2px solid var(--pixel-border)",background:"var(--pixel-bg-dark)"},children:d.tasks.map(S=>{const M=_pe[S.status]||_pe.backlog;return C.jsxs("div",{onClick:()=>r(S.id),className:"cursor-pointer px-3 py-1 flex items-center gap-2 pixel-text-xs",style:{borderBottom:"1px solid var(--pixel-border)"},children:[C.jsx("span",{style:{color:M.color},children:M.icon}),C.jsx("span",{className:"truncate flex-1",style:{color:"var(--pixel-text)"},children:S.title}),S.assignedAgent&&C.jsxs("span",{style:{color:"var(--pixel-text-dim)"},children:["@",S.assignedAgent]})]},S.id)})})]},f)})})]},c.sprint.id)})})]})}const qw=140,Xw=44,VPt=36,HPt=20,Spe=28,Ape=20,GPt={backlog:"#6b7280",planned:"#457b9d",pending:"#f4a261",in_progress:"#2dce89",in_review:"#7c5cff",completed:"#ffd700",blocked:"#e63946",deferred:"#6b7280"},WPt={backlog:"LOCKED",planned:"AVAILABLE",pending:"QUEUED",in_progress:"LEARNING",in_review:"TESTING",completed:"MASTERED",blocked:"SEALED",deferred:"HIDDEN"};function Mpe(e){return GPt[e]??"#6b7280"}function Epe(e){return WPt[e]??e.replace(/_/g," ").toUpperCase()}function qPt(e,t){const i=new Map;function r(a,s){if(i.has(a))return i.get(a);if(s.has(a))return 0;s.add(a);const c=(t.get(a)??[]).reduce((u,h)=>!t.has(h)&&!e.some(d=>d.id===h)?u:Math.max(u,r(h,s)),-1)+1;return i.set(a,c),c}const n=new Set;for(const a of e)r(a.id,n);return i}function XPt(){const{tasks:e}=_n(),t=ee.useRef(null),[i,r]=ee.useState(null),{nodes:n,edges:a,svgWidth:s,svgHeight:o,isEmpty:l}=ee.useMemo(()=>{const d=new Map;for(const R of e){const P=new Set([...R.dependsOn,...R.blockedBy]);d.set(R.id,Array.from(P))}const f=new Set;for(const R of e){const P=d.get(R.id)??[];if(P.length>0){f.add(R.id);for(const I of P)f.add(I)}}const m=e.filter(R=>f.has(R.id));if(m.length===0)return{nodes:[],edges:[],svgWidth:0,svgHeight:0,isEmpty:!0};const y=qPt(m,d),g=new Map;for(const R of m){const P=y.get(R.id)??0;g.has(P)||g.set(P,[]),g.get(P).push(R)}const x=Array.from(g.keys()).sort((R,P)=>R-P),w=[];for(const R of x){const P=g.get(R),I={blocked:0,in_progress:1,in_review:2,pending:3,planned:4,backlog:5,completed:6,deferred:7};P.sort((L,z)=>(I[L.status]??9)-(I[z.status]??9)||L.title.localeCompare(z.title)),P.forEach((L,z)=>{const U=Ape+R*(qw+VPt),j=Spe+z*(Xw+HPt);w.push({id:L.id,title:L.title,status:L.status,col:R,row:z,x:U,y:j})})}const S=[],M=new Set(w.map(R=>R.id));for(const R of m){const P=d.get(R.id)??[];for(const I of P)M.has(I)&&S.push({fromId:I,toId:R.id})}const E=Math.max(...w.map(R=>R.x))+qw+Ape,T=Math.max(...w.map(R=>R.y))+Xw+Spe;return{nodes:w,edges:S,svgWidth:E,svgHeight:T,isEmpty:!1}},[e]);ee.useEffect(()=>{var d;(d=t.current)==null||d.scrollTo({left:0,top:0})},[n]);const c=ee.useMemo(()=>{const d=new Map;for(const f of n)d.set(f.id,f);return d},[n]),u=ee.useCallback(d=>i!==null&&(d.fromId===i||d.toId===i),[i]);if(l)return C.jsxs("div",{className:"p-4",style:{borderBottom:"3px solid var(--pixel-border)"},children:[C.jsx("div",{className:"flex items-center justify-between mb-2",children:C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:"\\🌲 SKILL TREE"})}),C.jsx("div",{className:"h-24 flex items-center justify-center",children:C.jsx("p",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:"NO SKILL DEPENDENCIES"})})]});const h=Array.from(new Set(n.map(d=>d.status)));return C.jsxs("div",{className:"p-4",style:{borderBottom:"3px solid var(--pixel-border)"},children:[C.jsxs("div",{className:"flex items-center justify-between mb-2",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:"\\🌲 SKILL TREE"}),C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:[n.length," SKILLS \\u00B7 ",a.length," LINKS"]})]}),C.jsx("div",{className:"flex flex-wrap gap-x-3 gap-y-1 mb-2",children:h.map(d=>C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("span",{className:"inline-block w-3 h-3",style:{backgroundColor:Mpe(d),border:"1px solid #000"}}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:Epe(d)})]},d))}),C.jsx("div",{ref:t,className:"overflow-auto pixel-scrollbar pixel-card",style:{maxHeight:360,background:"var(--pixel-bg-dark)"},children:C.jsxs("svg",{width:s,height:o,viewBox:`0 0 ${s} ${o}`,className:"select-none",children:[C.jsxs("defs",{children:[C.jsx("marker",{id:"pixel-arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:C.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#444477"})}),C.jsx("marker",{id:"pixel-arrow-hl",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:C.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#ffd700"})})]}),a.map(d=>{const f=c.get(d.fromId),m=c.get(d.toId);if(!f||!m)return null;const y=u(d),g=f.x+qw,x=f.y+Xw/2,w=m.x,S=m.y+Xw/2,M=(g+w)/2,E=`M ${g} ${x} L ${M} ${x} L ${M} ${S} L ${w} ${S}`;return C.jsx("path",{d:E,fill:"none",stroke:y?"#ffd700":"#444477",strokeWidth:y?3:2,markerEnd:y?"url(#pixel-arrow-hl)":"url(#pixel-arrow)",opacity:i===null||y?1:.25},`${d.fromId}-${d.toId}`)}),n.map(d=>{const f=Mpe(d.status),m=i===d.id,y=i!==null&&!m&&!a.some(x=>x.fromId===i&&x.toId===d.id||x.toId===i&&x.fromId===d.id),g=d.status==="completed";return C.jsxs("g",{onMouseEnter:()=>r(d.id),onMouseLeave:()=>r(null),style:{cursor:"default"},opacity:y?.3:1,children:[C.jsx("rect",{x:d.x,y:d.y,width:qw,height:Xw,fill:"#1a1a2e",stroke:m?"#ffd700":f,strokeWidth:3}),C.jsx("rect",{x:d.x+3,y:d.y+3,width:qw-6,height:2,fill:"rgba(255,255,255,0.08)"}),C.jsx("rect",{x:d.x+6,y:d.y+Xw/2-4,width:8,height:8,fill:f}),g&&C.jsx("text",{x:d.x+qw-16,y:d.y+14,fontSize:10,fill:"#ffd700",children:"⭐"}),C.jsx("text",{x:d.x+20,y:d.y+17,fill:"#e8e8ff",fontSize:7,fontFamily:"'Press Start 2P', monospace",children:d.title.length>14?d.title.slice(0,13)+"…":d.title}),C.jsx("text",{x:d.x+20,y:d.y+32,fill:"#6666aa",fontSize:6,fontFamily:"'Press Start 2P', monospace",children:Epe(d.status)})]},d.id)})]})})]})}function YPt(){const{viewMode:e,setViewMode:t,activeProject:i}=_n();return C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("button",{onClick:()=>t("agents"),className:"pixel-text-xs px-2 py-1 transition-colors",style:{color:e==="agents"?"var(--pixel-gold)":"var(--pixel-text-muted)",border:e==="agents"?"2px solid var(--pixel-gold)":"2px solid var(--pixel-border)"},children:"[A] AGENTS"}),C.jsx("button",{onClick:()=>t("tracker"),className:"pixel-text-xs px-2 py-1 transition-colors",style:{color:e==="tracker"?"var(--pixel-gold)":"var(--pixel-text-muted)",border:e==="tracker"?"2px solid var(--pixel-gold)":"2px solid var(--pixel-border)"},children:"[T] TRACKER"})]}),i&&C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:[i.completedTasks,"/",i.totalTasks]})]})}function $Pt(){const{connectionStatus:e}=Ni(),t={connected:{color:"var(--pixel-green)",glow:"0 0 6px var(--pixel-green)",pulse:!0,label:"ONLINE"},reconnecting:{color:"var(--pixel-gold)",glow:"0 0 6px var(--pixel-gold)",pulse:!0,label:"RECONECTANDO..."},disconnected:{color:"var(--pixel-error)",glow:"0 0 6px var(--pixel-error)",pulse:!1,label:"OFFLINE"}}[e];return C.jsxs("div",{className:"flex items-center gap-2 ml-2",children:[C.jsx("div",{className:`w-3 h-3 ${t.pulse?"pixel-pulse":""}`,style:{background:t.color,boxShadow:t.glow}}),C.jsx("span",{className:"pixel-text-xs",style:{color:t.color},children:t.label})]})}function KPt(){const{viewMode:e}=_n();return C.jsxs("div",{className:"pixel-theme h-full w-full flex flex-col overflow-hidden",style:{background:"var(--pixel-bg)"},children:[C.jsxs("header",{className:"h-14 flex items-center justify-between px-4 pixel-hud shrink-0 relative z-50",children:[C.jsxs("div",{className:"flex items-center gap-4",children:[C.jsx("h1",{className:"pixel-text-lg",style:{color:"var(--pixel-gold)"},children:"CAM"}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:"CLAUDE AGENT MONITOR"}),C.jsx($Pt,{})]}),C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx(RX,{}),C.jsx(YPt,{})]})]}),C.jsx(xPt,{}),C.jsx(IK,{}),C.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[e==="agents"&&C.jsx(QPt,{}),e==="tracker"&&C.jsx(ZPt,{})]})]})}function QPt(){return C.jsxs(C.Fragment,{children:[C.jsx("aside",{className:"w-48 overflow-y-auto pixel-scrollbar shrink-0",style:{borderRight:"3px solid var(--pixel-border)"},children:C.jsx(APt,{})}),C.jsx("main",{className:"flex-1 overflow-hidden",children:C.jsx(MK,{})}),C.jsx("aside",{className:"w-72 pixel-scrollbar shrink-0",style:{borderLeft:"3px solid var(--pixel-border)"},children:C.jsx(RK,{AgentDetail:NPt,ActivityFeed:OPt,FileWatcher:LPt,tabBarClass:"flex border-b-[3px] border-[var(--pixel-border)] bg-[var(--pixel-surface)]",activeTabClass:"text-[var(--pixel-gold)]",inactiveTabClass:"text-[var(--pixel-text-muted)] hover:text-[var(--pixel-text)]",panelClass:"flex-1 overflow-y-auto pixel-scrollbar"})})]})}function ZPt(){const{selectedTaskId:e}=_n();return C.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[C.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[C.jsx("main",{className:"flex-1 overflow-hidden",children:C.jsx(zPt,{})}),e&&C.jsx("aside",{className:"w-80 overflow-y-auto pixel-scrollbar shrink-0",style:{borderLeft:"3px solid var(--pixel-border)"},children:C.jsx(EK,{})}),C.jsxs("aside",{className:"w-80 overflow-y-auto pixel-scrollbar shrink-0 flex flex-col",style:{borderLeft:"3px solid var(--pixel-border)"},children:[C.jsx(UPt,{}),C.jsx(jPt,{}),C.jsx(XPt,{})]})]}),C.jsx("div",{className:"h-48 overflow-y-auto pixel-scrollbar shrink-0",style:{borderTop:"3px solid var(--pixel-border)"},children:C.jsx(FPt,{})})]})}function JPt({agentCount:e,hasNewEvents:t}){return e===0?null:C.jsx(p0,{children:C.jsxs(rc.div,{className:"flex items-center gap-1",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},children:[C.jsxs("span",{className:"relative flex h-2 w-2",children:[C.jsx("span",{className:`absolute inline-flex h-full w-full rounded-full bg-cam-success opacity-75 ${t?"animate-ping":"animate-pulse"}`}),C.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-cam-success"})]}),C.jsx(rc.span,{className:"flex items-center justify-center min-w-[16px] h-4 px-1 rounded-full bg-cam-accent/20 text-cam-accent text-[10px] font-bold leading-none",initial:{scale:1.3},animate:{scale:1},transition:{type:"spring",stiffness:400,damping:15},children:e},e)]})})}function eDt({open:e,title:t,message:i,confirmLabel:r="Delete",cancelLabel:n="Cancel",onConfirm:a,onCancel:s}){return ee.useEffect(()=>{if(!e)return;const o=l=>{l.key==="Escape"&&s()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[e,s]),C.jsx(p0,{children:e&&C.jsxs(rc.div,{className:"fixed inset-0 z-50 flex items-center justify-center",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:[C.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:s}),C.jsxs(rc.div,{className:"relative bg-cam-surface border border-cam-border rounded-lg shadow-xl p-6 max-w-sm w-full mx-4",initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},transition:{duration:.15},children:[C.jsx("h3",{className:"text-sm font-semibold text-cam-text mb-2",children:t}),C.jsx("p",{className:"text-xs text-cam-text-muted mb-6",children:i}),C.jsxs("div",{className:"flex justify-end gap-2",children:[C.jsx("button",{onClick:s,className:"px-3 py-1.5 text-xs rounded-md text-cam-text-muted hover:text-cam-text hover:bg-cam-surface-2 transition-colors",children:n}),C.jsx("button",{onClick:a,className:"px-3 py-1.5 text-xs rounded-md bg-red-600 text-white hover:bg-red-700 transition-colors",children:r})]})]})]})})}function tDt(e){let t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((t<<5)-t);return`hsl(${Math.abs(t%360)}, 65%, 55%)`}function iDt(e){return e.totalTasks===0?0:Math.round(e.completedTasks/e.totalTasks*100)}function rDt(e){switch(e){case"pixel":return{background:"var(--pixel-bg-dark, #0f0f1e)",borderRight:"3px solid var(--pixel-border, #444477)",fontFamily:"'Press Start 2P', monospace",imageRendering:"pixelated"};case"terminal":return{background:"#0a0a0a",borderRight:"1px solid #1a3a1a",fontFamily:"'JetBrains Mono', 'Fira Code', monospace"};default:return{}}}function nDt(e){switch(e){case"pixel":case"terminal":return"flex flex-col h-full shrink-0 select-none";case"modern":default:return"flex flex-col h-full bg-cam-surface border-r border-cam-border/50 shrink-0 select-none"}}function aDt(e){switch(e){case"pixel":return{borderBottom:"3px solid var(--pixel-border, #444477)",background:"var(--pixel-surface, #222244)"};case"terminal":return{borderBottom:"1px solid #1a3a1a"};default:return{}}}function sDt(e){switch(e){case"pixel":case"terminal":return"flex items-center justify-between h-12 px-3 shrink-0";case"modern":default:return"flex items-center justify-between h-12 px-3 border-b border-cam-border/50 shrink-0"}}function oDt(e){switch(e){case"pixel":return{fontSize:"7px",lineHeight:"12px",color:"var(--pixel-gold, #ffd700)"};case"terminal":return{fontSize:"11px",color:"#00ff00",textShadow:"0 0 4px rgba(0,255,0,0.4)"};default:return{}}}function lDt(e){switch(e){case"pixel":case"terminal":return"whitespace-nowrap overflow-hidden";case"modern":default:return"text-xs font-semibold text-cam-text tracking-tight whitespace-nowrap overflow-hidden"}}function cDt(e){switch(e){case"pixel":return"PROJECTS";case"terminal":return"[PROJECTS]";default:return"Projects"}}function uDt(e){switch(e){case"pixel":return"p-1.5 pixel-btn";case"terminal":return"p-1.5";case"modern":default:return"p-1.5 rounded-md text-cam-text-muted hover:text-cam-text hover:bg-cam-surface-2 transition-colors"}}function hDt(e){switch(e){case"pixel":return{color:"var(--pixel-text, #e8e8ff)"};case"terminal":return{color:"#00aa00"};default:return{}}}function dDt(e){switch(e){case"pixel":return"flex-1 overflow-y-auto overflow-x-hidden py-1 space-y-0.5 px-1 pixel-scrollbar";case"terminal":return"flex-1 overflow-y-auto overflow-x-hidden py-1 space-y-0 px-1 terminal-scrollbar";case"modern":default:return"flex-1 overflow-y-auto overflow-x-hidden py-2 space-y-0.5 px-2"}}function fDt(e){switch(e){case"pixel":case"terminal":return"shrink-0 p-2";case"modern":default:return"shrink-0 border-t border-cam-border/50 p-2"}}function pDt(e){switch(e){case"pixel":return{borderTop:"3px solid var(--pixel-border, #444477)"};case"terminal":return{borderTop:"1px solid #1a3a1a"};default:return{}}}function mDt(e,t){const i=t?"justify-center p-2":"px-3 py-2";switch(e){case"pixel":return`flex items-center gap-2 w-full pixel-btn ${i}`;case"terminal":return`flex items-center gap-2 w-full ${i}`;case"modern":default:return`flex items-center gap-2 w-full rounded-md text-cam-text-muted hover:text-cam-text hover:bg-cam-surface-2 transition-colors ${i}`}}function gDt(e){switch(e){case"pixel":return{color:"var(--pixel-text-muted, #8888bb)"};case"terminal":return{color:"#00aa00",fontSize:"11px"};default:return{}}}function vDt(e){switch(e){case"terminal":return"> config";default:return"Settings"}}function yDt(e){switch(e){case"pixel":return"whitespace-nowrap overflow-hidden";case"terminal":return"whitespace-nowrap overflow-hidden";case"modern":default:return"text-xs whitespace-nowrap overflow-hidden"}}function xDt(e){switch(e){case"pixel":return{fontSize:"6px",lineHeight:"10px"};case"terminal":return{fontSize:"11px"};default:return{}}}function bDt(e){switch(e){case"pixel":return"text-center px-2 py-4";case"terminal":return"text-center px-2 py-4";case"modern":default:return"text-[10px] text-cam-text-muted text-center px-2 py-4"}}function wDt(e){switch(e){case"pixel":return{fontSize:"6px",lineHeight:"12px",color:"var(--pixel-text-muted, #8888bb)"};case"terminal":return{fontSize:"10px",color:"#00aa00"};default:return{}}}function _Dt({collapsed:e,onToggleCollapse:t,onOpenSettings:i}){const{projects:r,activeProject:n,setActiveProject:a,removeProject:s}=_n(),o=Ni(S=>S.agents),l=Ni(S=>S.events),c=Di(S=>S.theme),[u,h]=ee.useState(null),d=ee.useCallback(async()=>{if(u){try{await YEe(u.id),s(u.id)}catch{}h(null)}},[u,s]),f=ee.useMemo(()=>[...r].sort((S,M)=>S.status==="active"&&M.status!=="active"?-1:S.status!=="active"&&M.status==="active"?1:new Date(M.updatedAt).getTime()-new Date(S.updatedAt).getTime()),[r]),m=Ni(S=>S.projectId);function y(S){a(S)}const g=ee.useMemo(()=>{if(l.length===0)return!1;const S=l[0];return S!=null&&S.timestamp?Date.now()-new Date(S.timestamp).getTime()<5e3:!1},[l]),x=c==="terminal"?C.jsx("span",{style:{fontSize:"11px",color:"#00aa00"},children:e?">":"<"}):c==="pixel"?C.jsx("span",{style:{fontSize:"8px",fontFamily:"'Press Start 2P', monospace"},children:e?"▶":"◀"}):C.jsx("svg",{className:`w-4 h-4 transition-transform duration-200 ${e?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),w=c==="terminal"?C.jsx("span",{style:{fontSize:"11px",color:"#00aa00"},children:"[*]"}):c==="pixel"?C.jsx("span",{style:{fontSize:"8px",fontFamily:"'Press Start 2P', monospace",color:"var(--pixel-text-muted)"},children:"⚙"}):C.jsxs("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 010 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 010-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28z"}),C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]});return C.jsxs(rc.aside,{className:nDt(c),style:rDt(c),animate:{width:e?56:224},transition:{duration:.2,ease:"easeInOut"},children:[C.jsxs("div",{className:sDt(c),style:aDt(c),children:[C.jsx(p0,{mode:"wait",children:!e&&C.jsx(rc.span,{className:lDt(c),style:oDt(c),initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},transition:{duration:.15},children:cDt(c)},"logo-text")}),C.jsx("button",{onClick:t,className:uDt(c),style:hDt(c),title:e?"Expand sidebar":"Collapse sidebar",children:x})]}),C.jsxs("nav",{className:dDt(c),children:[f.length===0&&!e&&C.jsx("p",{className:bDt(c),style:wDt(c),children:c==="terminal"?"> no projects. run: cam init":C.jsxs(C.Fragment,{children:["No registered projects. Use ",C.jsx("code",{className:"text-cam-accent",children:"cam init"})," to get started."]})}),f.map(S=>{const M=(n==null?void 0:n.id)===S.id,E=m===S.id,T=E?o.length:0,R=tDt(S.name),P=iDt(S);return C.jsx(SDt,{project:S,isActive:M,collapsed:e,color:R,completionPct:P,agentCount:T,hasNewEvents:E&&g,onSelect:y,onDelete:h,theme:c},S.id)})]}),C.jsx("div",{className:fDt(c),style:pDt(c),children:C.jsxs("button",{onClick:i,className:mDt(c,e),style:gDt(c),title:"Settings",children:[w,C.jsx(p0,{mode:"wait",children:!e&&C.jsx(rc.span,{className:yDt(c),style:xDt(c),initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},transition:{duration:.15},children:vDt(c)},"settings-label")})]})}),C.jsx(eDt,{open:u!==null,title:"Delete project",message:`Are you sure you want to delete "${(u==null?void 0:u.name)??""}"? All sprints and tasks will be permanently removed. This action cannot be undone.`,onConfirm:d,onCancel:()=>h(null)})]})}function SDt({project:e,isActive:t,collapsed:i,color:r,completionPct:n,agentCount:a,hasNewEvents:s,onSelect:o,onDelete:l,theme:c}){const u=e.name.charAt(0).toUpperCase(),h=e.status==="active";if(i){const d=c==="pixel"?`relative flex items-center justify-center w-full p-2 ${t?"pixel-border-accent":"pixel-btn"}`:c==="terminal"?`relative flex items-center justify-center w-full p-2 ${t?"bg-[#0a1f0a] border border-[#00ff00]":"hover:bg-[#0a1f0a] border border-transparent"}`:`relative flex items-center justify-center w-full rounded-md p-2 transition-colors ${t?"bg-cam-accent/10 ring-1 ring-cam-accent/40":"hover:bg-cam-surface-2"}`,f=c==="pixel"?{backgroundColor:r,imageRendering:"pixelated",borderRadius:0,border:"2px solid var(--pixel-border)"}:c==="terminal"?{backgroundColor:"transparent",color:"#00ff00",border:"1px solid #00aa00",borderRadius:0,fontFamily:"monospace",fontSize:"12px"}:{backgroundColor:r};return C.jsxs(rc.button,{onClick:()=>o(e),className:d,title:`${e.name} (${n}%)`,whileHover:{scale:c==="pixel"?1:1.05},whileTap:{scale:c==="pixel"?1:.95},children:[C.jsx("div",{className:`w-8 h-8 flex items-center justify-center text-xs font-bold text-white shrink-0 ${c==="modern"?"rounded-full":""}`,style:f,children:u}),a>0&&C.jsx("span",{className:"absolute top-1 right-1",children:C.jsx("span",{className:"relative flex h-2 w-2",children:c==="terminal"?C.jsx("span",{className:"relative inline-flex h-2 w-2",style:{background:"#00ff00",borderRadius:0}}):C.jsxs(C.Fragment,{children:[C.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-cam-success opacity-75 animate-ping"}),C.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-cam-success"})]})})})]})}return c==="terminal"?C.jsxs("button",{onClick:()=>o(e),className:`relative w-full text-left px-2 py-1.5 transition-colors ${t?"bg-[#0a1f0a]":"hover:bg-[#0a1f0a]"}`,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",borderLeft:t?"2px solid #00ff00":"2px solid transparent"},children:[C.jsxs("div",{className:"flex items-center gap-1.5",children:[C.jsx("span",{style:{color:t?"#00ff00":"#00aa00"},children:t?">":" "}),C.jsx("span",{style:{color:"#00aa00"},children:"[DIR]"}),C.jsx("span",{className:"truncate",style:{color:t?"#00ff00":"#00aa00",textShadow:t?"0 0 4px rgba(0,255,0,0.4)":"none"},children:e.name}),a>0&&C.jsxs("span",{style:{color:"#00ff00",fontSize:"10px"},children:["[",a,"]"]})]}),C.jsxs("div",{className:"flex items-center gap-1 mt-0.5 ml-4",children:[C.jsxs("span",{style:{color:"#006600",fontSize:"10px"},children:[e.completedTasks,"/",e.totalTasks]}),C.jsxs("span",{style:{color:"#006600",fontSize:"10px"},children:["[","█".repeat(Math.round(n/10)),"░".repeat(10-Math.round(n/10)),"] ",n,"%"]})]}),C.jsx("span",{onClick:d=>{d.stopPropagation(),l(e)},className:"absolute right-1 top-1/2 -translate-y-1/2 opacity-0 hover:opacity-100 transition-opacity",style:{color:"#aa0000",fontSize:"10px",cursor:"pointer"},title:"Delete project",children:"[DEL]"})]}):c==="pixel"?C.jsxs("button",{onClick:()=>o(e),className:`relative w-full text-left p-2 ${t?"pixel-border-accent":"pixel-btn"}`,style:{fontFamily:"'Press Start 2P', monospace"},children:[C.jsxs("div",{className:"flex items-start gap-2",children:[C.jsx("div",{className:"w-6 h-6 flex items-center justify-center shrink-0 mt-0.5",style:{backgroundColor:r,border:"2px solid var(--pixel-border)",imageRendering:"pixelated",fontSize:"7px",color:"#fff",fontWeight:"bold"},children:u}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("span",{style:{width:"4px",height:"4px",display:"inline-block",background:h?"var(--pixel-green)":"var(--pixel-text-muted)"}}),C.jsx("span",{className:"truncate",style:{fontSize:"6px",lineHeight:"10px",color:t?"var(--pixel-gold)":"var(--pixel-text)"},children:e.name.toUpperCase()})]}),C.jsxs("div",{className:"flex items-center justify-between mt-1",children:[C.jsxs("span",{style:{fontSize:"6px",color:"var(--pixel-text-muted)"},children:[e.completedTasks,"/",e.totalTasks]}),C.jsxs("span",{style:{fontSize:"6px",color:"var(--pixel-text-muted)"},children:[n,"%"]})]}),C.jsx("div",{className:"w-full mt-1 pixel-bar-container",style:{height:"6px"},children:C.jsx("div",{className:"pixel-bar-fill",style:{width:`${n}%`,background:t?"var(--pixel-gold)":"var(--pixel-green)",transition:"width 0.3s steps(8)"}})})]}),a>0&&C.jsx("div",{className:"shrink-0 mt-0.5",children:C.jsx("span",{className:"pixel-pulse",style:{display:"inline-block",width:"6px",height:"6px",background:"var(--pixel-green)",boxShadow:"0 0 4px var(--pixel-green)"}})})]}),C.jsx("span",{onClick:d=>{d.stopPropagation(),l(e)},className:"absolute right-1 top-1 opacity-0 hover:opacity-100 transition-opacity",style:{fontSize:"6px",color:"#ff4444",cursor:"pointer",fontFamily:"'Press Start 2P', monospace"},title:"Delete project",children:"X"})]}):C.jsxs(rc.div,{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),o(e))},className:`relative w-full text-left rounded-lg p-2.5 transition-all duration-150 group cursor-pointer ${t?"bg-cam-accent/10 border-l-2 border-cam-accent":"border-l-2 border-transparent hover:bg-cam-surface-2"}`,whileTap:{scale:.98},children:[C.jsxs("div",{className:"flex items-start gap-2.5",children:[C.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-[10px] font-bold text-white shrink-0 mt-0.5",style:{backgroundColor:r},children:u}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsxs("div",{className:"flex items-center gap-1.5",children:[C.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${h?"bg-cam-success":"bg-cam-text-muted"}`}),C.jsx("span",{className:"text-xs font-medium text-cam-text truncate",children:e.name})]}),C.jsxs("div",{className:"flex items-center justify-between mt-1.5",children:[C.jsxs("span",{className:"text-[10px] text-cam-text-muted font-mono",children:[e.completedTasks,"/",e.totalTasks]}),C.jsx("span",{className:"text-[10px] text-cam-text-muted",children:Npe(e.completedTasks,e.totalTasks)})]}),C.jsx("div",{className:"w-full h-1 bg-cam-surface-3 rounded-full overflow-hidden mt-1",children:C.jsx(rc.div,{className:"h-full bg-cam-accent rounded-full",initial:!1,animate:{width:`${n}%`},transition:{duration:.4,ease:"easeOut"}})})]}),a>0&&C.jsx("div",{className:"shrink-0 mt-0.5",children:C.jsx(JPt,{agentCount:a,hasNewEvents:s})})]}),C.jsx("button",{onClick:d=>{d.stopPropagation(),l(e)},className:"absolute top-1.5 right-1.5 p-1 rounded-md text-cam-text-muted hover:text-red-500 hover:bg-red-500/10 opacity-0 group-hover:opacity-100 transition-all",title:"Delete project",children:C.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})}const ADt=[{value:"modern",label:"Modern",description:"Clean and minimalist interface"},{value:"pixel",label:"Pixel",description:"Retro pixel art style"},{value:"terminal",label:"Terminal",description:"Hacker console style"}],Tpe=[{value:"#3b82f6",label:"Blue"},{value:"#ef4444",label:"Red"},{value:"#22c55e",label:"Green"},{value:"#f59e0b",label:"Amber"},{value:"#8b5cf6",label:"Purple"},{value:"#ec4899",label:"Pink"},{value:"#06b6d4",label:"Cyan"},{value:"#f97316",label:"Orange"}],Cpe=/^#[0-9a-fA-F]{6}$/;function MDt(){const e=Di(u=>u.theme),t=Di(u=>u.accentColor),i=Di(u=>u.setTheme),r=Di(u=>u.setAccentColor),[n,a]=ee.useState(Tpe.some(u=>u.value===t)?"":t),[s,o]=ee.useState(!1),l=u=>{if(a(u),o(!1),u==="")return;const h=u.startsWith("#")?u:`#${u}`;Cpe.test(h)?(r(h),o(!1)):h.length>=7&&o(!0)},c=u=>{r(u),a(""),o(!1)};return C.jsxs("div",{className:"space-y-6",children:[C.jsxs("section",{children:[C.jsx("h3",{className:"text-sm font-medium text-cam-text mb-3",children:"Theme"}),C.jsx("div",{className:"grid grid-cols-3 gap-2",children:ADt.map(u=>C.jsxs("button",{onClick:()=>i(u.value),className:`flex flex-col items-center gap-1.5 p-3 rounded-lg border transition-all ${e===u.value?"border-cam-accent bg-cam-accent/10 ring-1 ring-cam-accent/30":"border-cam-border hover:border-cam-border-hover bg-cam-surface-2"}`,children:[C.jsx("div",{className:`w-full h-8 rounded-md ${u.value==="modern"?"bg-gradient-to-br from-cam-surface-3 to-cam-bg":u.value==="pixel"?"bg-[#1a1a2e] border border-[#533483]":"bg-black border border-[#1a3a1a]"}`,children:C.jsx("div",{className:`w-3 h-1.5 mt-1.5 ml-1.5 rounded-sm ${u.value==="modern"?"bg-cam-accent":u.value==="pixel"?"bg-[#e94560]":"bg-[#00ff00]"}`})}),C.jsx("span",{className:`text-xs font-medium ${e===u.value?"text-cam-accent":"text-cam-text-secondary"}`,children:u.label}),C.jsx("span",{className:"text-[10px] text-cam-text-muted leading-tight text-center",children:u.description})]},u.value))})]}),C.jsxs("section",{children:[C.jsx("h3",{className:"text-sm font-medium text-cam-text mb-3",children:"Accent color"}),C.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:Tpe.map(u=>C.jsx("button",{onClick:()=>c(u.value),className:`w-8 h-8 rounded-full border-2 transition-all ${t===u.value?"border-white ring-2 ring-offset-2 ring-offset-cam-surface scale-110":"border-transparent hover:scale-105"}`,style:{backgroundColor:u.value},title:u.label,"aria-label":`Color ${u.label}`},u.value))}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("label",{className:"text-xs text-cam-text-muted shrink-0",children:"Custom color:"}),C.jsx("div",{className:"relative flex-1",children:C.jsx("input",{type:"text",value:n,onChange:u=>l(u.target.value),placeholder:"#RRGGBB",maxLength:7,className:`w-full px-3 py-1.5 text-xs rounded-md border bg-cam-surface-2 text-cam-text placeholder:text-cam-text-muted focus:outline-none focus:ring-1 ${s?"border-cam-error focus:ring-cam-error":"border-cam-border focus:ring-cam-accent"}`})}),n&&!s&&Cpe.test(n)&&C.jsx("div",{className:"w-6 h-6 rounded-md border border-cam-border shrink-0",style:{backgroundColor:n}})]}),s&&C.jsx("p",{className:"text-[10px] text-cam-error mt-1",children:"Invalid format. Use #RRGGBB (e.g. #ff5500)"})]})]})}const EDt=[{value:6e4,label:"1 minute"},{value:18e4,label:"3 minutes"},{value:3e5,label:"5 minutes"},{value:6e5,label:"10 minutes"}];function Ppe({checked:e,onChange:t,label:i}){return C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("span",{className:"text-xs text-cam-text-secondary",children:i}),C.jsx("button",{role:"switch","aria-checked":e,onClick:t,className:`relative w-9 h-5 rounded-full transition-colors shrink-0 ${e?"bg-cam-accent":"bg-cam-surface-3 border border-cam-border"}`,children:C.jsx("div",{className:`absolute top-0.5 w-4 h-4 rounded-full bg-white shadow-sm transition-transform ${e?"translate-x-[18px]":"translate-x-0.5"}`})})]})}function TDt(){const e=Di(l=>l.showLabels),t=Di(l=>l.showInteractions),i=Di(l=>l.displayMode),r=Di(l=>l.activityWindow),n=Di(l=>l.toggleLabels),a=Di(l=>l.toggleInteractions),s=Di(l=>l.setDisplayMode),o=Di(l=>l.setActivityWindow);return C.jsxs("div",{className:"space-y-6",children:[C.jsxs("section",{children:[C.jsx(Ppe,{checked:e,onChange:n,label:"Show activity labels"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1.5 ml-0.5",children:"Displays the tool/action name above each agent on the map."})]}),C.jsxs("section",{children:[C.jsx(Ppe,{checked:t,onChange:a,label:"Show communication lines"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1.5 ml-0.5",children:"Draws lines connecting agents that communicate with each other."})]}),C.jsxs("section",{children:[C.jsx("h3",{className:"text-sm font-medium text-cam-text mb-3",children:"Speech bubbles"}),C.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{value:"technical",label:"Technical",description:"Shows function/tool being executed"},{value:"didactic",label:"Didactic",description:"Shows friendly explanation"}].map(l=>C.jsxs("button",{onClick:()=>s(l.value),className:`flex items-center gap-2.5 p-2.5 rounded-lg border transition-all ${i===l.value?"border-cam-accent bg-cam-accent/10 ring-1 ring-cam-accent/30":"border-cam-border hover:border-cam-border-hover bg-cam-surface-2"}`,children:[C.jsx("div",{className:`w-4 h-4 rounded-full border-2 flex items-center justify-center shrink-0 ${i===l.value?"border-cam-accent":"border-cam-text-muted"}`,children:i===l.value&&C.jsx("div",{className:"w-2 h-2 rounded-full bg-cam-accent"})}),C.jsxs("div",{className:"text-left",children:[C.jsx("span",{className:`text-xs font-medium block ${i===l.value?"text-cam-accent":"text-cam-text-secondary"}`,children:l.label}),C.jsx("span",{className:"text-[10px] text-cam-text-muted leading-tight",children:l.description})]})]},l.value))})]}),C.jsxs("section",{children:[C.jsx("h3",{className:"text-sm font-medium text-cam-text mb-3",children:"Activity window"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mb-2",children:"Maximum time to consider an agent as active."}),C.jsx("select",{value:r,onChange:l=>o(Number(l.target.value)),className:"w-full px-3 py-2 text-xs rounded-md border border-cam-border bg-cam-surface-2 text-cam-text focus:outline-none focus:ring-1 focus:ring-cam-accent appearance-none cursor-pointer",children:EDt.map(l=>C.jsx("option",{value:l.value,children:l.label},l.value))})]})]})}function wG({checked:e,onChange:t,label:i}){return C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("span",{className:"text-xs text-cam-text-secondary",children:i}),C.jsx("button",{role:"switch","aria-checked":e,onClick:t,className:`relative w-9 h-5 rounded-full transition-colors shrink-0 ${e?"bg-cam-accent":"bg-cam-surface-3 border border-cam-border"}`,children:C.jsx("div",{className:`absolute top-0.5 w-4 h-4 rounded-full bg-white shadow-sm transition-transform ${e?"translate-x-[18px]":"translate-x-0.5"}`})})]})}function CDt(){const e=Di(f=>f.followMode),t=Di(f=>f.hidePolling),i=Di(f=>f.pollingTools),r=Di(f=>f.groupRepetitive),n=Di(f=>f.toggleFollowMode),a=Di(f=>f.toggleHidePolling),s=Di(f=>f.toggleGroupRepetitive),o=Di(f=>f.addPollingTool),l=Di(f=>f.removePollingTool),[c,u]=ee.useState(""),h=()=>{const f=c.trim();f!==""&&(o(f),u(""))},d=f=>{f.key==="Enter"&&(f.preventDefault(),h())};return C.jsxs("div",{className:"space-y-6",children:[C.jsxs("section",{children:[C.jsx(wG,{checked:e,onChange:n,label:"Auto-scroll to recent events"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1.5 ml-0.5",children:"Automatically scrolls the feed to show new events."})]}),C.jsxs("section",{children:[C.jsx(wG,{checked:t,onChange:a,label:"Hide repetitive tools"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1.5 ml-0.5",children:"Hides events from tools that do constant polling."})]}),C.jsxs("section",{children:[C.jsx("h3",{className:"text-sm font-medium text-cam-text mb-3",children:"Polling tools"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mb-2",children:'Tools that will be hidden when "Hide repetitive tools" is active.'}),C.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-3 min-h-[28px]",children:[i.map(f=>C.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-[11px] rounded-md bg-cam-surface-3 text-cam-text-secondary border border-cam-border",children:[f,C.jsx("button",{onClick:()=>l(f),className:"text-cam-text-muted hover:text-cam-error transition-colors ml-0.5","aria-label":`Remove ${f}`,children:C.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[C.jsx("line",{x1:"2",y1:"2",x2:"8",y2:"8"}),C.jsx("line",{x1:"8",y1:"2",x2:"2",y2:"8"})]})})]},f)),i.length===0&&C.jsx("span",{className:"text-[10px] text-cam-text-muted italic",children:"No tools configured"})]}),C.jsxs("div",{className:"flex gap-2",children:[C.jsx("input",{type:"text",value:c,onChange:f=>u(f.target.value),onKeyDown:d,placeholder:"Tool name...",className:"flex-1 px-3 py-1.5 text-xs rounded-md border border-cam-border bg-cam-surface-2 text-cam-text placeholder:text-cam-text-muted focus:outline-none focus:ring-1 focus:ring-cam-accent"}),C.jsx("button",{onClick:h,disabled:c.trim()==="",className:"px-3 py-1.5 text-xs font-medium rounded-md bg-cam-accent text-white hover:bg-cam-accent-hover disabled:opacity-40 disabled:cursor-not-allowed transition-colors shrink-0",children:"Add"})]})]}),C.jsxs("section",{children:[C.jsx(wG,{checked:r,onChange:s,label:"Agrupar eventos repetitivos consecutivos"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1.5 ml-0.5",children:"Eventos identicos consecutivos sao agrupados com contador."})]})]})}function PDt({checked:e,onChange:t,label:i}){return C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("span",{className:"text-xs text-cam-text-secondary",children:i}),C.jsx("button",{role:"switch","aria-checked":e,onClick:t,className:`relative w-9 h-5 rounded-full transition-colors shrink-0 ${e?"bg-cam-accent":"bg-cam-surface-3 border border-cam-border"}`,children:C.jsx("div",{className:`absolute top-0.5 w-4 h-4 rounded-full bg-white shadow-sm transition-transform ${e?"translate-x-[18px]":"translate-x-0.5"}`})})]})}function _G({value:e,onChange:t,min:i,max:r,label:n,suffix:a}){const s=c=>{const u=parseInt(c.target.value,10);if(Number.isNaN(u))return;const h=Math.min(r,Math.max(i,u));t(h)},o=()=>{e<r&&t(e+1)},l=()=>{e>i&&t(e-1)};return C.jsxs("div",{children:[C.jsx("label",{className:"text-xs text-cam-text-secondary block mb-1.5",children:n}),C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("button",{onClick:l,disabled:e<=i,className:"w-7 h-7 flex items-center justify-center rounded-md border border-cam-border bg-cam-surface-2 text-cam-text-secondary hover:text-cam-text hover:bg-cam-surface-3 disabled:opacity-30 disabled:cursor-not-allowed transition-colors text-sm font-mono","aria-label":"Decrease",children:"-"}),C.jsx("input",{type:"number",value:e,onChange:s,min:i,max:r,className:"w-20 px-2 py-1 text-xs text-center rounded-md border border-cam-border bg-cam-surface-2 text-cam-text focus:outline-none focus:ring-1 focus:ring-cam-accent [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"}),C.jsx("button",{onClick:o,disabled:e>=r,className:"w-7 h-7 flex items-center justify-center rounded-md border border-cam-border bg-cam-surface-2 text-cam-text-secondary hover:text-cam-text hover:bg-cam-surface-3 disabled:opacity-30 disabled:cursor-not-allowed transition-colors text-sm font-mono","aria-label":"Increase",children:"+"}),a&&C.jsx("span",{className:"text-[10px] text-cam-text-muted ml-1",children:a})]}),C.jsxs("p",{className:"text-[10px] text-cam-text-muted mt-1",children:["Min: ",i," / Max: ",r]})]})}function DDt(){const e=Di(d=>d.maxEvents),t=Di(d=>d.speechBubbleTimeout),i=Di(d=>d.maxCommunicationLines),r=Di(d=>d.lockPanels),n=Di(d=>d.setMaxEvents),a=Di(d=>d.setSpeechBubbleTimeout),s=Di(d=>d.setMaxCommunicationLines),o=Di(d=>d.toggleLockPanels),l=Di(d=>d.resetToDefaults),[c,u]=ee.useState(!1),h=()=>{window.confirm("Are you sure you want to restore all settings to default values?")&&(l(),u(!0),setTimeout(()=>u(!1),2500))};return C.jsxs("div",{className:"space-y-6",children:[C.jsxs("section",{children:[C.jsx(_G,{value:e,onChange:n,min:100,max:1e4,label:"Maximum events in memory",suffix:"events"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1",children:"Maximum number of events kept in the dashboard. Higher values use more memory."})]}),C.jsxs("section",{children:[C.jsx(_G,{value:t,onChange:a,min:1,max:30,label:"Speech bubble timeout",suffix:"seconds"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1",children:"How long each speech bubble remains visible before disappearing."})]}),C.jsxs("section",{children:[C.jsx(_G,{value:i,onChange:s,min:1,max:20,label:"Maximum communication lines"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1",children:"Maximum number of interaction lines visible simultaneously on the Agent Map."})]}),C.jsxs("section",{children:[C.jsx(PDt,{checked:r,onChange:o,label:"Lock panel resizing"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1.5 ml-0.5",children:"Prevents accidental resizing of dashboard panels."})]}),C.jsxs("section",{className:"pt-2 border-t border-cam-border",children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("div",{children:[C.jsx("h3",{className:"text-sm font-medium text-cam-text",children:"Restore Defaults"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-0.5",children:"Resets all settings to their original values."})]}),C.jsx("button",{onClick:h,className:"px-3 py-1.5 text-xs font-medium rounded-md border border-cam-error/50 text-cam-error hover:bg-cam-error/10 transition-colors shrink-0",children:"Restore Defaults"})]}),c&&C.jsx("div",{className:"mt-2 px-3 py-1.5 text-[11px] text-cam-success bg-cam-success/10 border border-cam-success/30 rounded-md",children:"Settings restored successfully!"})]})]})}const ODt=[{id:"appearance",label:"Appearance"},{id:"agent-map",label:"Agent Map"},{id:"activity-feed",label:"Activity Feed"},{id:"advanced",label:"Advanced"}],RDt={hidden:{opacity:0},visible:{opacity:1},exit:{opacity:0}},IDt={hidden:{opacity:0,scale:.95,y:20},visible:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20}};function NDt(e){switch(e){case"pixel":return"relative w-full max-w-lg mx-4 max-h-[85vh] flex flex-col";case"terminal":return"relative w-full max-w-lg mx-4 max-h-[85vh] flex flex-col";case"modern":default:return"relative w-full max-w-lg mx-4 max-h-[85vh] flex flex-col rounded-2xl shadow-2xl"}}function LDt(e){switch(e){case"pixel":return{background:"var(--pixel-bg-dark, #0f0f1e)",border:"4px solid var(--pixel-border, #444477)",boxShadow:"inset -4px -4px 0 rgba(0,0,0,0.4), inset 4px 4px 0 rgba(255,255,255,0.08), 0 0 0 2px #000, 8px 8px 0 rgba(0,0,0,0.5)",fontFamily:"'Press Start 2P', monospace",imageRendering:"pixelated"};case"terminal":return{background:"#0a0a0a",border:"1px solid #00aa00",boxShadow:"0 0 20px rgba(0,255,0,0.05), inset 0 0 60px rgba(0,255,0,0.02)",fontFamily:"'JetBrains Mono', 'Fira Code', monospace"};case"modern":default:return{background:"rgba(15, 15, 15, 0.85)",backdropFilter:"blur(24px)",WebkitBackdropFilter:"blur(24px)",border:"1px solid rgba(255,255,255,0.08)"}}}function kDt(e){switch(e){case"pixel":return"flex items-center justify-between px-4 py-3 shrink-0";case"terminal":return"flex items-center justify-between px-4 py-3 shrink-0";case"modern":default:return"flex items-center justify-between px-5 py-4 border-b border-white/5 shrink-0"}}function zDt(e){switch(e){case"pixel":return{borderBottom:"3px solid var(--pixel-border, #444477)",background:"var(--pixel-surface, #222244)"};case"terminal":return{borderBottom:"1px solid #1a3a1a"};default:return{}}}function BDt(e){switch(e){case"pixel":return C.jsx("span",{style:{fontSize:"8px",lineHeight:"14px",color:"var(--pixel-gold, #ffd700)"},children:"SETTINGS"});case"terminal":return C.jsxs("span",{style:{color:"#00ff00",textShadow:"0 0 4px rgba(0,255,0,0.4)",fontSize:"12px"},children:["> settings",C.jsx("span",{style:{animation:"terminal-cursor-blink 0.6s step-end infinite",color:"#00ff00"},children:"█"})]});case"modern":default:return C.jsx("span",{className:"text-base font-semibold text-cam-text",children:"Settings"})}}function UDt(e){switch(e){case"pixel":return"flex items-center justify-center w-7 h-7 pixel-btn";case"terminal":return"flex items-center justify-center w-7 h-7";case"modern":default:return"flex items-center justify-center w-7 h-7 rounded-md text-cam-text-muted hover:text-cam-text hover:bg-white/5 transition-colors"}}function jDt(e){switch(e){case"pixel":return{color:"var(--pixel-text, #e8e8ff)"};case"terminal":return{color:"#00aa00"};default:return{}}}function FDt(e){switch(e){case"pixel":return"flex gap-0 px-3 pt-2 pb-0 shrink-0 flex-wrap";case"terminal":return"flex gap-0 px-4 pt-2 pb-0 shrink-0";case"modern":default:return"flex gap-1 px-5 pt-3 pb-0 shrink-0"}}function VDt(e){switch(e){case"pixel":return{borderBottom:"3px solid var(--pixel-border, #444477)"};case"terminal":return{borderBottom:"1px solid #1a3a1a"};default:return{}}}function HDt(e,t){switch(e){case"pixel":return t?"pixel-btn-active px-2 py-1.5":"pixel-btn px-2 py-1.5";case"terminal":return`px-3 py-1.5 ${t?"":"hover:bg-[#0a1f0a]"}`;case"modern":default:return`px-3 py-1.5 text-xs font-medium rounded-md transition-colors ${t?"bg-cam-accent text-white":"text-cam-text-muted hover:text-cam-text hover:bg-white/5"}`}}function GDt(e,t){switch(e){case"pixel":return{fontSize:"6px",lineHeight:"10px",fontFamily:"'Press Start 2P', monospace"};case"terminal":return{fontSize:"11px",fontFamily:"'JetBrains Mono', monospace",color:t?"#00ff00":"#00aa00",textShadow:t?"0 0 4px rgba(0,255,0,0.4)":"none",borderBottom:t?"2px solid #00ff00":"2px solid transparent",background:"transparent"};default:return{}}}function WDt(e,t,i){return e==="terminal"?i?`> ${t}`:` ${t}`:e==="pixel"?t.toUpperCase():t}function qDt(e){switch(e){case"pixel":return"flex-1 overflow-y-auto px-4 py-3 pixel-scrollbar";case"terminal":return"flex-1 overflow-y-auto px-4 py-3 terminal-scrollbar";case"modern":default:return"flex-1 overflow-y-auto px-5 py-4 modern-scrollbar"}}function XDt({isOpen:e,onClose:t}){const[i,r]=ee.useState("appearance"),n=Di(c=>c.theme),a=ee.useCallback(c=>{c.key==="Escape"&&t()},[t]);ee.useEffect(()=>{if(e)return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,a]);const s=ee.useCallback(()=>{t()},[t]),o=ee.useCallback(c=>{c.stopPropagation()},[]),l=()=>{switch(i){case"appearance":return C.jsx(MDt,{});case"agent-map":return C.jsx(TDt,{});case"activity-feed":return C.jsx(CDt,{});case"advanced":return C.jsx(DDt,{})}};return C.jsx(p0,{children:e&&C.jsxs(rc.div,{className:"fixed inset-0 z-50 flex items-center justify-center",variants:RDt,initial:"hidden",animate:"visible",exit:"exit",transition:{duration:.2},onClick:s,children:[C.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),n==="terminal"&&C.jsx("div",{className:"absolute inset-0 pointer-events-none z-[51]",style:{background:"repeating-linear-gradient(0deg, rgba(0,0,0,0.15) 0px, rgba(0,0,0,0.15) 1px, transparent 1px, transparent 3px)"}}),C.jsxs(rc.div,{className:NDt(n),style:LDt(n),variants:IDt,initial:"hidden",animate:"visible",exit:"exit",transition:{duration:.25,ease:"easeOut"},onClick:o,children:[C.jsxs("header",{className:kDt(n),style:zDt(n),children:[C.jsx("h2",{children:BDt(n)}),C.jsx("button",{onClick:t,className:UDt(n),style:jDt(n),"aria-label":"Close",children:n==="terminal"?C.jsx("span",{style:{fontSize:"12px"},children:"[X]"}):n==="pixel"?C.jsx("span",{style:{fontSize:"8px",fontFamily:"'Press Start 2P', monospace"},children:"X"}):C.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[C.jsx("line",{x1:"1",y1:"1",x2:"13",y2:"13"}),C.jsx("line",{x1:"13",y1:"1",x2:"1",y2:"13"})]})})]}),C.jsx("nav",{className:FDt(n),style:VDt(n),children:ODt.map(c=>C.jsx("button",{onClick:()=>r(c.id),className:HDt(n,i===c.id),style:GDt(n,i===c.id),children:WDt(n,c.label,i===c.id)},c.id))}),C.jsx("main",{className:qDt(n),children:l()})]})]})})}function YDt(e){ee.useEffect(()=>{function t(i){for(const r of e){const n=r.ctrl?i.ctrlKey||i.metaKey:!0,a=r.alt?i.altKey:!0,s=r.shift?i.shiftKey:!0;if(i.key===r.key&&n&&a&&s){const o=i.target;if(o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable)return;i.preventDefault(),r.handler();return}}}return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e])}function $Dt(){const{theme:e}=$P(),t=Di(u=>u.toggleLockPanels),{settingsOpen:i,sidebarCollapsed:r,closeSettings:n,toggleSettings:a,toggleSidebar:s,openSettings:o}=jEe(),l=ee.useMemo(()=>[{key:",",ctrl:!0,handler:a,description:"Toggle settings modal"},{key:"l",ctrl:!0,handler:t,description:"Toggle panel lock"},{key:"b",ctrl:!0,handler:s,description:"Toggle sidebar"}],[t,a,s]);YDt(l);const c=(()=>{switch(e){case"terminal":return C.jsx(gPt,{});case"pixel":return C.jsx(KPt,{});case"modern":default:return C.jsx(jCt,{})}})();return C.jsxs("div",{className:"flex h-screen w-screen overflow-hidden",children:[C.jsx(_Dt,{collapsed:r,onToggleCollapse:s,onOpenSettings:o}),C.jsx("div",{className:"flex-1 overflow-hidden",children:c}),C.jsx(XDt,{isOpen:i,onClose:n})]})}let KDt=0;const NI=sg(e=>({toasts:[],addToast:t=>{const i=`toast-${++KDt}`,r={...t,id:i,createdAt:Date.now()};e(n=>({toasts:[...n.toasts,r].slice(-5)})),setTimeout(()=>{e(n=>({toasts:n.toasts.filter(a=>a.id!==i)}))},t.duration)},removeToast:t=>e(i=>({toasts:i.toasts.filter(r=>r.id!==t)})),clearAll:()=>e({toasts:[]})}));function Dpe({toast:e,onDismiss:t}){const i={info:"border-blue-500/50 bg-blue-500/10",success:"border-cam-success/50 bg-cam-success/10",warning:"border-amber-500/50 bg-amber-500/10",error:"border-cam-error/50 bg-cam-error/10"},r={info:"text-blue-400",success:"text-cam-success",warning:"text-amber-400",error:"text-cam-error"},n={info:"ℹ",success:"✓",warning:"⚠",error:"✗"};return C.jsxs("div",{className:`flex items-start gap-2 px-3 py-2 rounded-lg border backdrop-blur-sm ${i[e.type]} animate-slide-in-right`,style:{minWidth:"240px",maxWidth:"360px"},children:[C.jsx("span",{className:`text-sm mt-0.5 ${r[e.type]}`,children:n[e.type]}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsx("p",{className:"text-xs font-medium text-cam-text",children:e.title}),e.message&&C.jsx("p",{className:"text-xs text-cam-text-muted mt-0.5",children:e.message})]}),C.jsx("button",{onClick:t,className:"text-cam-text-muted hover:text-cam-text text-xs ml-1 shrink-0",children:"x"})]})}function QDt({toast:e,onDismiss:t}){const i={info:"var(--pixel-blue, #4488ff)",success:"var(--pixel-green)",warning:"var(--pixel-gold)",error:"var(--pixel-error)"},r={info:"◆",success:"★",warning:"!",error:"☠"};return C.jsx("div",{className:"pixel-border animate-slide-in-right",style:{background:"var(--pixel-panel)",borderColor:i[e.type],borderWidth:"2px",borderStyle:"solid",padding:"6px 10px",minWidth:"240px",maxWidth:"360px"},children:C.jsxs("div",{className:"flex items-start gap-2",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:i[e.type]},children:r[e.type]}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsx("p",{className:"pixel-text-xs",style:{color:i[e.type]},children:e.title}),e.message&&C.jsx("p",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:e.message})]}),C.jsx("button",{onClick:t,className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:"x"})]})})}function ZDt({toast:e,onDismiss:t}){const r={info:{text:"[INFO]",color:"#00ff00"},success:{text:"[OK]",color:"#00ff00"},warning:{text:"[WARN]",color:"#ffaa00"},error:{text:"[ERR]",color:"#ff0000"}}[e.type];return C.jsxs("div",{className:"font-mono text-[11px] border border-[#1a3a1a] bg-[#0a0a0a] px-2 py-1 animate-slide-in-right",style:{minWidth:"240px",maxWidth:"360px"},children:[C.jsxs("div",{className:"flex items-start gap-1",children:[C.jsx("span",{style:{color:r.color},children:r.text}),C.jsx("span",{className:"text-[#00ff00] flex-1",children:e.title}),C.jsx("button",{onClick:t,className:"text-[#555] hover:text-[#00ff00]",children:"[x]"})]}),e.message&&C.jsx("div",{className:"text-[#00aa00] ml-7",children:e.message})]})}function JDt(){const{toasts:e,removeToast:t}=NI(),{theme:i}=$P();if(e.length===0)return null;const r={modern:Dpe,pixel:QDt,terminal:ZDt}[i]??Dpe;return C.jsx("div",{className:"fixed top-16 right-4 z-[100] flex flex-col gap-2",children:e.map(n=>C.jsx(r,{toast:n,onDismiss:()=>t(n.id)},n.id))})}function e3t(){return new URLSearchParams(window.location.search).has("session_id")}function t3t(){const{session:e,setSession:t,setProjectId:i}=Ni(),r=ee.useRef(!1),n=ee.useCallback(async()=>{if(!r.current){if(e3t()){r.current=!0;return}try{try{const{registrations:s}=await QEe();if(s.length>0){const o=s.find(u=>u.project_status==="active")||s[0];i(o.project_id);const{sessions:l}=await Y7(o.project_id),c=l.find(u=>u.status==="active");if(c){const{session:u}=await gC(c.id);t(u),r.current=!0;return}}r.current=!0;return}catch{}i(null);const{sessions:a}=await q7({status:"active",limit:1});if(a.length>0){const{session:s}=await gC(a[0].id);t(s),r.current=!0}}catch{}}},[t,i]);return ee.useEffect(()=>{n();const a=setInterval(n,15e3);return()=>clearInterval(a)},[n]),{session:e,refreshSession:n}}class i3t{constructor(t){iE(this,"source",null);iE(this,"options");iE(this,"reconnectTimer",null);iE(this,"shouldReconnect",!0);this.options=t}connect(){this.source&&this.disconnect();const t=new URL(this.options.url,window.location.origin);this.options.projectId?t.searchParams.set("project_id",this.options.projectId):this.options.sessionId&&t.searchParams.set("session_id",this.options.sessionId),this.source=new EventSource(t.toString()),this.source.onopen=()=>{var i,r;(r=(i=this.options).onConnect)==null||r.call(i)},this.source.onerror=i=>{var r,n,a,s;(n=(r=this.options).onError)==null||n.call(r,i),(s=(a=this.options).onDisconnect)==null||s.call(a),this.shouldReconnect&&this.scheduleReconnect()},this.addListener("agent_event",this.options.onEvent),this.addListener("agent_status",this.options.onAgentStatus),this.addListener("session_status",this.options.onSessionStatus),this.addListener("task_status_changed",this.options.onTaskStatusChanged),this.addListener("task_assigned",this.options.onTaskAssigned),this.addListener("sprint_progress",this.options.onSprintProgress),this.addListener("project_progress",this.options.onProjectProgress),this.addListener("task_blocked",this.options.onTaskBlocked),this.addListener("task_unblocked",this.options.onTaskUnblocked),this.addListener("correlation_match",this.options.onCorrelationMatch),this.addListener("agent_created",this.options.onAgentCreated),this.addListener("team_created",this.options.onTeamCreated),this.addListener("heartbeat",this.options.onHeartbeat)}addListener(t,i){!this.source||!i||this.source.addEventListener(t,r=>{try{const n=JSON.parse(r.data);i(n)}catch{}})}scheduleReconnect(){this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=setTimeout(()=>{this.connect()},this.options.reconnectDelay??3e3)}disconnect(){this.shouldReconnect=!1,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.source&&(this.source.close(),this.source=null)}reconnect(){this.shouldReconnect=!0,this.connect()}}function r3t(e){const t=ee.useRef(null),i=Ni(d=>d.projectId),{addEvent:r,addAgent:n,updateAgent:a,setConnected:s,setConnectionStatus:o,setLastHeartbeat:l}=Ni(),{updateTask:c,updateActiveProject:u,updateActiveSprint:h}=_n();return ee.useEffect(()=>{if(!e){o("disconnected");return}const d=new i3t({url:"/api/stream",sessionId:e,projectId:i??void 0,onConnect:()=>{s(!0),o("connected")},onDisconnect:()=>{s(!1),o("reconnecting")},onEvent:f=>{r(f),f.agentId&&n({id:f.agentId,sessionId:f.sessionId,name:f.agentId,type:"agent",status:"active",firstSeenAt:f.timestamp,lastActivityAt:f.timestamp,toolCallCount:0,errorCount:0})},onAgentStatus:f=>{a(f.agent,{status:f.status}),(f.status==="shutdown"||f.status==="completed")&&NI.getState().addToast({type:"info",title:`Agent ${f.agent} finished`,duration:4e3})},onSessionStatus:f=>{const m=Ni.getState().session;f.status==="completed"||f.status==="error"?m&&(m.id===f.session||!f.session)&&(Ni.getState().setSession({...m,status:f.status,endedAt:new Date().toISOString()}),NI.getState().addToast({type:f.status==="completed"?"info":"error",title:f.status==="completed"?"Session ended":"Session ended with error",duration:5e3})):f.status==="active"&&m&&(m.id===f.session||!f.session)&&Ni.getState().setSession({...m,status:"active",endedAt:void 0})},onTaskStatusChanged:f=>{c(f.taskId,{status:f.newStatus})},onTaskAssigned:f=>{c(f.taskId,{assignedAgent:f.agent})},onSprintProgress:f=>{h({completedTasks:f.completedTasks,totalTasks:f.totalTasks})},onProjectProgress:f=>{u({completedTasks:f.completedTasks,totalTasks:f.totalTasks})},onTaskBlocked:f=>{c(f.taskId,{status:"blocked",blockedBy:f.blockedBy})},onTaskUnblocked:f=>{c(f.taskId,{status:"pending",blockedBy:[]})},onCorrelationMatch:()=>{},onAgentCreated:f=>{const m=f.name||f.agent;n({id:f.agent,sessionId:f.sessionId,name:m,type:f.type||"agent",status:f.status||"active",firstSeenAt:f.timestamp,lastActivityAt:f.timestamp,toolCallCount:0,errorCount:0}),NI.getState().addToast({type:"success",title:`Agent ${m} joined`,message:f.type?`Type: ${f.type}`:void 0,duration:4e3})},onTeamCreated:()=>{},onHeartbeat:f=>{l(f.timestamp)}});return d.connect(),t.current=d,()=>{d.disconnect(),t.current=null}},[e,i,r,n,a,s,o,l,c,u,h]),t.current}function n3t(){const{projects:e,activeProject:t,setProjects:i,setActiveProject:r}=_n(),n=ee.useRef(!1);return ee.useEffect(()=>{let a=!1;async function s(){try{const{projects:l}=await XEe();a||(i(l),!n.current&&l.length>0&&(_n.getState().activeProject||r(l[0]),n.current=!0))}catch{}}s();const o=setInterval(s,15e3);return()=>{a=!0,clearInterval(o)}},[i,r]),{projects:e,activeProject:t}}function a3t(){const{projects:e,activeProject:t,setActiveProject:i}=_n(),r=ee.useRef(!1);ee.useEffect(()=>{if(r.current||e.length===0)return;const a=new URLSearchParams(window.location.search).get("project_id");if(a){const s=e.find(o=>o.id===a);s&&i(s)}r.current=!0},[e,i]),ee.useEffect(()=>{if(t){const n=new URLSearchParams(window.location.search);n.get("project_id")!==t.id&&(n.set("project_id",t.id),window.history.replaceState({},"",`?${n.toString()}`))}},[t])}function s3t(){const{session:e,setSession:t}=Ni(),i=ee.useRef(!1);ee.useEffect(()=>{if(i.current)return;i.current=!0;const n=new URLSearchParams(window.location.search).get("session_id");n&&o3t(n)},[]),ee.useEffect(()=>{if(!e)return;const r=e.id.slice(0,8),n=new URLSearchParams(window.location.search);n.get("session_id")!==r&&(n.set("session_id",r),window.history.replaceState({},"",`?${n.toString()}`))},[e==null?void 0:e.id])}async function o3t(e){const{setSession:t}=Ni.getState();if(e.length>8)try{const{session:i}=await gC(e);if(i){t(i);return}}catch{}try{const{sessions:i}=await q7({limit:50}),r=i.find(n=>n.id.startsWith(e));if(r){const{session:n}=await gC(r.id);n&&t(n)}}catch{}}function l3t(){const e=Di(s=>s.theme),t=Di(s=>s.accentColor),i=Di(s=>s.activityWindow),r=Di(s=>s.showLabels),n=Di(s=>s.showInteractions),a=Di(s=>s.displayMode);ee.useEffect(()=>{const s=$P.getState();s.theme!==e&&s.setTheme(e),s.accentColor!==t&&s.setAccentColor(t)},[e,t]),ee.useEffect(()=>{const s=Ni.getState();s.activityWindow!==i&&s.setActivityWindow(i)},[i]),ee.useEffect(()=>{const s=C_.getState();s.showLabels!==r&&s.toggleLabels(),s.showInteractions!==n&&s.toggleInteractions(),s.displayMode!==a&&s.setDisplayMode(a)},[r,n,a])}function c3t(){const{session:e}=t3t();return r3t(e==null?void 0:e.id),n3t(),lz(),T0(),Dye(),a3t(),s3t(),l3t(),C.jsxs(C.Fragment,{children:[C.jsx($Dt,{}),C.jsx(JDt,{})]})}LEe.createRoot(document.getElementById("root")).render(C.jsx(ee.StrictMode,{children:C.jsx(c3t,{})}));export{Vv as c,En as g};
|
|
12445
|
-
//# sourceMappingURL=index-
|
|
12444
|
+
└────────────────────────┘`})})}):C.jsx("div",{className:"h-full flex gap-1 p-2 overflow-x-auto terminal-scrollbar font-mono text-[11px]",children:K_.map(r=>{const n=i[r.id]||[],a=aPt[r.id]||"terminal-dim",s=nPt[r.id]||" ";return C.jsxs("div",{className:"flex-shrink-0 w-52 flex flex-col border border-[#1a3a1a] bg-[#0a0a0a]",children:[C.jsx("div",{className:"px-2 py-1 border-b border-[#1a3a1a] shrink-0",children:C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("span",{className:`text-[10px] font-bold uppercase ${a}`,children:["[",s,"] ",r.label]}),C.jsxs("span",{className:"terminal-dim text-[10px]",children:["(",n.length,")"]})]})}),C.jsx("div",{className:"flex-1 overflow-y-auto terminal-scrollbar p-1 space-y-1",children:n.map(o=>C.jsx(lPt,{task:o},o.id))})]},r.id)})})}function lPt({task:e}){const{selectTask:t,selectedTaskId:i}=_n(),r=oz(),n=sPt[e.priority]||" ",a=W7(e.prdSection);return C.jsxs("div",{className:`terminal-card p-1.5 text-[10px] cursor-pointer ${i===e.id?"border border-[#00ccff]":""}`,onClick:()=>t(e.id),children:[C.jsxs("div",{className:"flex items-center gap-1 mb-0.5",children:[C.jsx("span",{className:`${e.priority==="critical"||e.priority==="high"?"terminal-error":"terminal-dim"}`,children:n}),e.complexity&&C.jsxs("span",{className:"terminal-dim",children:["C",e.complexity]}),a&&C.jsxs("span",{className:"text-[#00ff00]",children:["[",a,"]"]})]}),C.jsx("div",{className:"text-[#00cc00] leading-tight mb-1 line-clamp-2",children:e.title}),C.jsxs("div",{className:"flex items-center justify-between terminal-dim",children:[e.assignedAgent?C.jsxs("span",{children:["@",r(e.assignedAgent)]}):C.jsx("span",{className:"italic",children:"unassigned"}),e.tags&&e.tags.length>0&&C.jsxs("span",{children:["#",e.tags[0]]})]}),e.blockedBy.length>0&&C.jsx("div",{className:"terminal-error mt-0.5",children:"! blocked by "+e.blockedBy.length+" task"+(e.blockedBy.length>1?"s":"")})]})}function cPt(e,t=20){const i=Math.round(e/100*t),r=t-i;return"["+("█".repeat(i)+"░".repeat(r))+"] "+e+"%"}function uPt(){const{activeSprint:e}=lz(),t=T0(),i=ee.useMemo(()=>{if(!e)return{total:0,completed:0,inProgress:0,blocked:0,pending:0,percent:0};const r=t.filter(u=>u.sprintId===e.id),n=r.length||e.totalTasks||0,a=r.filter(u=>u.status==="completed").length,s=r.filter(u=>u.status==="in_progress").length,o=r.filter(u=>u.status==="blocked").length,l=n-a-s-o,c=n>0?Math.round(a/n*100):0;return{total:n,completed:a,inProgress:s,blocked:o,pending:l,percent:c}},[e,t]);return e?C.jsxs("div",{className:"p-3 border-b border-[#1a3a1a] font-mono text-[11px]",children:[C.jsxs("div",{className:"flex items-center justify-between mb-2",children:[C.jsx("span",{className:"terminal-muted",children:"## SPRINT ##"}),C.jsx("span",{className:"text-[#00ccff] text-[10px]",children:e.name})]}),C.jsx("div",{className:"text-[#00ff00] terminal-glow mb-2",children:cPt(i.percent,24)}),C.jsxs("div",{className:"space-y-0.5 text-[10px]",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"text-[#00ff00] w-[12px]",children:"+"}),C.jsx("span",{className:"terminal-dim flex-1",children:"Completed"}),C.jsx("span",{className:"text-[#00ff00]",children:i.completed})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"text-[#00ccff] w-[12px]",children:"*"}),C.jsx("span",{className:"terminal-dim flex-1",children:"In Progress"}),C.jsx("span",{className:"text-[#00ccff]",children:i.inProgress})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"terminal-muted w-[12px]",children:"-"}),C.jsx("span",{className:"terminal-dim flex-1",children:"Pending"}),C.jsx("span",{className:"terminal-muted",children:i.pending})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"terminal-error w-[12px]",children:"!"}),C.jsx("span",{className:"terminal-dim flex-1",children:"Blocked"}),C.jsx("span",{className:i.blocked>0?"terminal-error":"terminal-dim",children:i.blocked})]}),C.jsxs("div",{className:"border-t border-[#1a3a1a] mt-1 pt-1 flex items-center gap-2",children:[C.jsx("span",{className:"terminal-dim w-[12px]",children:"="}),C.jsx("span",{className:"terminal-dim flex-1",children:"Total"}),C.jsx("span",{className:"text-[#00ff00]",children:i.total})]})]})]}):C.jsx("div",{className:"p-3 font-mono text-[11px]",children:C.jsx("span",{className:"terminal-dim",children:"> No active sprint"})})}function hPt(){const{activeSprint:e,tasks:t}=_n(),[i,r]=ee.useState("burndown"),{chart:n,maxVal:a}=ee.useMemo(()=>{if(!e)return{chart:[],maxVal:0};const c=t.filter(w=>w.sprintId===e.id),u=c.length;if(u===0)return{chart:[],maxVal:0};const h=c.filter(w=>w.completedAt).sort((w,S)=>new Date(w.completedAt).getTime()-new Date(S.completedAt).getTime()),d=e.startedAt?new Date(e.startedAt).getTime():Date.now()-36e5,m=Date.now()-d,y=10,g=[];for(let w=0;w<=y;w++){const S=d+m/y*w,M=h.filter(P=>new Date(P.completedAt).getTime()<=S).length,E=new Date(S).getHours(),T=new Date(S).getMinutes(),R=`${String(E).padStart(2,"0")}:${String(T).padStart(2,"0")}`;i==="burndown"?g.push({label:R,actual:u-M,ideal:Math.max(0,Math.round(u-u/y*w))}):g.push({label:R,actual:M,ideal:Math.round(u/y*w)})}const x=Math.max(u,...g.map(w=>Math.max(w.actual,w.ideal)));return{chart:g,maxVal:x}},[e,t,i]);if(!e||n.length===0)return C.jsxs("div",{className:"p-3 border-b border-[#1a3a1a] font-mono text-[11px]",children:[C.jsx("div",{className:"flex items-center justify-between mb-2",children:C.jsx("span",{className:"terminal-muted",children:"## BURNDOWN ##"})}),C.jsx("div",{className:"terminal-dim text-center py-4",children:"> No data available"})]});const s=8,o=n.length,l=[];for(let c=s;c>=0;c--){const u=c/s*a;let h="";for(let d=0;d<o;d++){const f=n[d],m=f.actual>=u,y=f.ideal>=u;m&&y?h+="#":m?h+="*":y?h+=".":h+=" ",h+=" "}l.push(h)}return C.jsxs("div",{className:"p-3 border-b border-[#1a3a1a] font-mono text-[11px]",children:[C.jsxs("div",{className:"flex items-center justify-between mb-2",children:[C.jsx("span",{className:"terminal-muted",children:"## "+(i==="burndown"?"BURNDOWN":"BURNUP")+" ##"}),C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("button",{onClick:()=>r("burndown"),className:`px-1.5 py-0.5 text-[9px] border ${i==="burndown"?"text-[#00ff00] border-[#00aa00] bg-[#0a1f0a]":"terminal-dim border-[#1a3a1a]"}`,children:"DN"}),C.jsx("button",{onClick:()=>r("burnup"),className:`px-1.5 py-0.5 text-[9px] border ${i==="burnup"?"text-[#00ff00] border-[#00aa00] bg-[#0a1f0a]":"terminal-dim border-[#1a3a1a]"}`,children:"UP"})]})]}),C.jsxs("div",{className:"bg-[#050505] border border-[#1a3a1a] p-2 text-[10px]",children:[C.jsxs("div",{className:"flex",children:[C.jsxs("div",{className:"flex flex-col justify-between text-right pr-1 terminal-dim text-[9px] shrink-0 w-[20px]",children:[C.jsx("span",{children:a}),C.jsx("span",{children:Math.round(a/2)}),C.jsx("span",{children:"0"})]}),C.jsx("div",{className:"flex-1",children:C.jsx("div",{className:"border-l border-b border-[#1a3a1a] pl-1 pb-1",children:l.map((c,u)=>C.jsx("div",{className:"leading-none",children:C.jsx("span",{className:"text-[#00ff00]",children:c.split("").map((h,d)=>h==="*"?C.jsx("span",{className:"text-[#00ff00] terminal-glow",children:h},d):h==="."?C.jsx("span",{className:"terminal-dim",children:h},d):h==="#"?C.jsx("span",{className:"text-[#00ccff]",children:h},d):C.jsx("span",{children:h},d))})},u))})})]}),C.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[9px]",children:[C.jsx("span",{className:"text-[#00ff00]",children:"* actual"}),C.jsx("span",{className:"terminal-dim",children:". ideal"}),C.jsx("span",{className:"text-[#00ccff]",children:"# overlap"})]})]})]})}const ype={backlog:{char:".",color:"terminal-dim"},planned:{char:"-",color:"text-[#00ccff]"},pending:{char:"-",color:"text-[#00ccff]"},in_progress:{char:"*",color:"text-[#00ff00]"},in_review:{char:"?",color:"terminal-muted"},completed:{char:"+",color:"text-[#00ff00]"},blocked:{char:"!",color:"terminal-error"},deferred:{char:".",color:"terminal-dim"}};function xpe(e,t=12){const i=Math.round(e/100*t),r=t-i;return"█".repeat(i)+"░".repeat(r)}function dPt(){const{activeProject:e,tasks:t,sprints:i,selectTask:r}=_n(),[n,a]=ee.useState(null),[s,o]=ee.useState(null),l=ee.useMemo(()=>{if(!e||t.length===0||i.length===0)return[];const c=new Map;for(const d of i)c.set(d.id,d);const u=new Map;for(const d of t){const f=d.sprintId||"unknown";u.has(f)||u.set(f,new Map);const m=u.get(f),y=d.prdSection||"Uncategorized";m.has(y)||m.set(y,{name:y,total:0,completed:0,inProgress:0,blocked:0,percent:0,tasks:[],order:d.prdLineStart??999});const g=m.get(y);g.total++,g.tasks.push(d),d.status==="completed"&&g.completed++,d.status==="in_progress"&&g.inProgress++,d.status==="blocked"&&g.blocked++}const h=[];for(const[d,f]of u){const m=c.get(d);if(!m)continue;const y=Array.from(f.values());for(const w of y)w.percent=w.total>0?Math.round(w.completed/w.total*100):0;y.sort((w,S)=>w.order-S.order);const g=y.reduce((w,S)=>w+S.total,0),x=y.reduce((w,S)=>w+S.completed,0);h.push({sprint:m,sections:y,total:g,completed:x,percent:g>0?Math.round(x/g*100):0})}return h.sort((d,f)=>(d.sprint.order??0)-(f.sprint.order??0)),h},[e,t,i]);return l.length===0?C.jsx("div",{className:"h-full flex items-center justify-center font-mono text-[11px]",children:C.jsxs("div",{className:"terminal-dim text-center",children:[C.jsx("p",{children:"## PRD OVERVIEW ##"}),C.jsx("p",{className:"mt-1",children:"> Import a PRD to see section progress"})]})}):C.jsxs("div",{className:"p-2 font-mono text-[11px]",children:[C.jsxs("div",{className:"flex items-center justify-between mb-2",children:[C.jsx("span",{className:"terminal-muted",children:"## PRD SECTIONS ##"}),C.jsx("span",{className:"text-[#00ccff] text-[10px]",children:e==null?void 0:e.name})]}),C.jsx("div",{className:"border border-[#1a3a1a] bg-[#050505]",children:l.map(c=>{const u=n===c.sprint.id,h=c.percent===100?"text-[#00ff00]":"text-[#ffaa00]";return C.jsxs("div",{children:[C.jsxs("div",{className:"flex items-center gap-0 px-2 py-1.5 hover:bg-[#0a1a0a] transition-colors border-b border-[#1a3a1a] cursor-pointer",onClick:()=>a(u?null:c.sprint.id),children:[C.jsx("span",{className:"w-[24px] terminal-dim text-[10px]",children:u?"[-]":"[+]"}),C.jsx("span",{className:`flex-1 font-bold uppercase text-[11px] ${h}`,children:c.sprint.name}),C.jsxs("span",{className:`w-[110px] text-center text-[10px] ${h}`,children:[xpe(c.percent)," ",c.percent,"%"]}),C.jsxs("span",{className:"w-[50px] text-right text-[10px] text-[#00ff00]",children:[c.completed,"/",c.total]})]}),u&&C.jsxs("div",{className:"bg-[#030303]",children:[C.jsxs("div",{className:"flex items-center gap-0 px-2 py-0.5 border-b border-[#0a1a0a] terminal-dim text-[9px]",children:[C.jsx("span",{className:"w-[36px]"}),C.jsx("span",{className:"flex-1",children:"SECTION"}),C.jsx("span",{className:"w-[110px] text-center",children:"PROGRESS"}),C.jsx("span",{className:"w-[40px] text-right",children:"DONE"}),C.jsx("span",{className:"w-[30px] text-right",children:"ACT"}),C.jsx("span",{className:"w-[30px] text-right",children:"BLK"})]}),c.sections.map(d=>{const f=`${c.sprint.id}:${d.name}`,m=s===f,y=d.percent===100?"text-[#00ff00]":d.blocked>0?"terminal-error":d.inProgress>0?"text-[#00ccff]":"terminal-dim";return C.jsxs("div",{children:[C.jsxs("div",{className:"flex items-center gap-0 px-2 py-0.5 hover:bg-[#0a1a0a] transition-colors border-b border-[#0a1a0a] text-[10px] cursor-pointer",onClick:()=>o(m?null:f),children:[C.jsx("span",{className:"w-[12px]"}),C.jsx("span",{className:"w-[24px] terminal-dim",children:m?"[-]":"[+]"}),C.jsx("span",{className:"flex-1 truncate text-[#00cc00]",children:d.name}),C.jsxs("span",{className:`w-[110px] text-center ${y}`,children:[xpe(d.percent)," ",d.percent,"%"]}),C.jsxs("span",{className:"w-[40px] text-right text-[#00ff00]",children:[d.completed,"/",d.total]}),C.jsx("span",{className:`w-[30px] text-right ${d.inProgress>0?"text-[#00ccff]":"terminal-dim"}`,children:d.inProgress}),C.jsx("span",{className:`w-[30px] text-right ${d.blocked>0?"terminal-error":"terminal-dim"}`,children:d.blocked})]}),m&&C.jsx("div",{className:"bg-[#050505] border-b border-[#0a1a0a]",children:d.tasks.map(g=>{const x=ype[g.status]||ype.backlog;return C.jsxs("div",{onClick:()=>r(g.id),className:"cursor-pointer hover:bg-[#0a1a0a] px-6 py-0.5 text-[10px] flex items-center gap-1",children:[C.jsxs("span",{className:x.color,children:["[",x.char,"]"]}),C.jsx("span",{className:"text-[#00cc00] truncate flex-1",children:g.title}),g.assignedAgent&&C.jsxs("span",{className:"terminal-dim",children:["@",g.assignedAgent]})]},g.id)})})]},f)})]})]},c.sprint.id)})})]})}const zMe={backlog:".",planned:"-",pending:"~",in_progress:"*",in_review:"?",completed:"+",blocked:"!",deferred:"_"},BMe={backlog:"terminal-dim",planned:"text-[#00ccff]",pending:"terminal-muted",in_progress:"text-[#00ff00]",in_review:"terminal-muted",completed:"text-[#00ff00]",blocked:"terminal-error",deferred:"terminal-dim"};function fPt(){const{tasks:e}=_n(),{roots:t,edgeCount:i,nodeCount:r}=ee.useMemo(()=>{const n=new Map,a=new Map,s=new Map;for(const f of e){s.set(f.id,f);const m=new Set([...f.dependsOn,...f.blockedBy]);n.set(f.id,m)}const o=new Set;let l=0;for(const f of e){const m=n.get(f.id)??new Set;if(m.size>0){o.add(f.id);for(const y of m)o.add(y),l++,a.has(y)||a.set(y,new Set),a.get(y).add(f.id)}}if(o.size===0)return{roots:[],edgeCount:0,nodeCount:0};const c=new Set;for(const f of o){const m=n.get(f)??new Set;Array.from(m).some(g=>o.has(g))||c.add(f)}if(c.size===0){const f=Array.from(o).slice(0,3);for(const m of f)c.add(m)}const u=new Set;function h(f,m){if(u.has(f)||m>6)return null;u.add(f);const y=s.get(f);if(!y)return null;const g=a.get(f)??new Set,x=[];for(const w of g)if(o.has(w)){const S=h(w,m+1);S&&x.push(S)}return{task:y,children:x,depth:m}}const d=[];for(const f of c){const m=h(f,0);m&&d.push(m)}return{roots:d,edgeCount:l,nodeCount:o.size}},[e]);return t.length===0?C.jsxs("div",{className:"p-3 border-b border-[#1a3a1a] font-mono text-[11px]",children:[C.jsx("span",{className:"terminal-muted",children:"## DEPENDENCIES ##"}),C.jsx("div",{className:"terminal-dim text-center py-3",children:"> No task dependencies"})]}):C.jsxs("div",{className:"p-3 border-b border-[#1a3a1a] font-mono text-[11px]",children:[C.jsxs("div",{className:"flex items-center justify-between mb-2",children:[C.jsx("span",{className:"terminal-muted",children:"## DEPENDENCIES ##"}),C.jsxs("span",{className:"terminal-dim text-[10px]",children:[r," tasks ","·"," ",i," links"]})]}),C.jsx("div",{className:"bg-[#050505] border border-[#1a3a1a] p-2 overflow-auto terminal-scrollbar max-h-[280px]",children:t.map((n,a)=>C.jsx(UMe,{node:n,prefix:"",isLast:a===t.length-1},n.task.id))}),C.jsx("div",{className:"flex flex-wrap gap-x-3 gap-y-0.5 mt-1.5 text-[9px]",children:Object.entries(zMe).filter(([n])=>e.some(a=>a.status===n)).map(([n,a])=>C.jsxs("span",{className:BMe[n]||"terminal-dim",children:["[",a,"] ",n.replace(/_/g," ")]},n))})]})}function UMe({node:e,prefix:t,isLast:i}){const r=i?"└─":"├─",n=t+(i?" ":"│ "),a=zMe[e.task.status]||"?",s=BMe[e.task.status]||"terminal-dim",o=e.task.title.length>30?e.task.title.slice(0,27)+"...":e.task.title;return C.jsxs("div",{className:"text-[10px]",children:[C.jsxs("div",{className:"flex items-center gap-0 whitespace-nowrap",children:[C.jsxs("span",{className:"terminal-dim",children:[t,r]}),C.jsxs("span",{className:`font-bold ${s}`,children:["[",a,"]"]}),C.jsx("span",{className:"text-[#00cc00] ml-1",children:o}),e.task.assignedAgent&&C.jsxs("span",{className:"terminal-dim ml-1",children:["@",e.task.assignedAgent]})]}),e.children.map((l,c)=>C.jsx(UMe,{node:l,prefix:n,isLast:c===e.children.length-1},l.task.id))]})}function pPt(){const{viewMode:e,setViewMode:t,activeProject:i}=_n();return C.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px]",children:[C.jsx("button",{onClick:()=>t("agents"),className:`px-2 py-0.5 transition-colors ${e==="agents"?"text-[#00ff00] terminal-glow bg-[#0a1f0a]":"terminal-muted hover:text-[#00aa00]"}`,children:"[AGENTS]"}),C.jsx("button",{onClick:()=>t("tracker"),className:`px-2 py-0.5 transition-colors ${e==="tracker"?"text-[#00ff00] terminal-glow bg-[#0a1f0a]":"terminal-muted hover:text-[#00aa00]"}`,children:"[TRACKER]"}),i&&C.jsxs("span",{className:"terminal-muted",children:[i.completedTasks,"/",i.totalTasks]})]})}function mPt(){const{connectionStatus:e}=Ni(),t={connected:{className:"text-[#00ff00] terminal-glow",label:"[CONNECTED]",sublabel:"capturing events",sublabelClass:"text-[#00aa00]",showCursor:!0},reconnecting:{className:"text-[#ffaa00]",label:"[RECONNECTING...]",sublabel:"",sublabelClass:"",showCursor:!1},disconnected:{className:"terminal-error",label:"[DISCONNECTED]",sublabel:"waiting for server",sublabelClass:"terminal-error",showCursor:!1}}[e];return C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("span",{className:t.className,children:t.label}),t.sublabel&&C.jsx("span",{className:t.sublabelClass,children:t.sublabel}),t.showCursor&&C.jsx("span",{className:"terminal-cursor-active"})]})}function gPt(){const{viewMode:e}=_n();return C.jsxs("div",{className:"h-full w-full flex flex-col terminal-bg terminal-boot overflow-hidden",children:[C.jsxs("header",{className:"h-10 flex items-center justify-between px-3 border-b border-[#1a3a1a] bg-[#0d0d0d] shrink-0 font-mono text-[11px] relative z-50",children:[C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx("span",{className:"text-[#00ff00] terminal-glow font-bold",children:"CAM://"}),C.jsx("span",{className:"text-[#00aa00]",children:"Claude Agent Monitor"}),C.jsx("span",{className:"terminal-dim",children:"|"}),C.jsx(mPt,{})]}),C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx(RX,{}),C.jsx(pPt,{})]})]}),C.jsx(HCt,{}),C.jsx(IK,{}),C.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[e==="agents"&&C.jsx(vPt,{}),e==="tracker"&&C.jsx(yPt,{})]})]})}function vPt(){return C.jsxs(C.Fragment,{children:[C.jsx("aside",{className:"w-48 border-r border-[#1a3a1a] overflow-y-auto terminal-scrollbar shrink-0",children:C.jsx(XCt,{})}),C.jsx("main",{className:"flex-1 overflow-hidden",children:C.jsx(MK,{})}),C.jsx("aside",{className:"w-72 border-l border-[#1a3a1a] terminal-scrollbar shrink-0",children:C.jsx(RK,{AgentDetail:tPt,ActivityFeed:QCt,FileWatcher:rPt,tabBarClass:"flex border-b border-[#1a3a1a] bg-[#0d0d0d]",activeTabClass:"text-[#00ff00] terminal-glow border-b-2 border-[#00ff00]",inactiveTabClass:"text-[#00aa00]/60 hover:text-[#00aa00]"})})]})}function yPt(){const{selectedTaskId:e}=_n();return C.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[C.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[C.jsx("main",{className:"flex-1 overflow-hidden",children:C.jsx(oPt,{})}),e&&C.jsx("aside",{className:"w-80 border-l border-[#1a3a1a] overflow-y-auto terminal-scrollbar shrink-0",children:C.jsx(EK,{})}),C.jsxs("aside",{className:"w-80 border-l border-[#1a3a1a] overflow-y-auto terminal-scrollbar shrink-0 flex flex-col",children:[C.jsx(uPt,{}),C.jsx(hPt,{}),C.jsx(fPt,{})]})]}),C.jsx("div",{className:"h-48 border-t border-[#1a3a1a] overflow-y-auto terminal-scrollbar shrink-0",children:C.jsx(dPt,{})})]})}const Ww={TIME:"⌛",PARTY:"⚔",SKILLS:"🎯",EVENTS:"📜",LOOT:"📦",POISON:"☠"};function xPt(){const{session:e,agents:t,events:i}=Ni(),[r,n]=ee.useState("00m 00s");ee.useEffect(()=>{if(!(e!=null&&e.startedAt))return;const u=()=>n(H7(e.startedAt,e.endedAt));if(u(),!e.endedAt){const h=setInterval(u,1e3);return()=>clearInterval(h)}},[e==null?void 0:e.startedAt,e==null?void 0:e.endedAt]);const a=t.filter(u=>u.status==="active").length,s=t.reduce((u,h)=>u+h.errorCount,0),o=t.reduce((u,h)=>u+h.toolCallCount,0),l=i.filter(u=>u.category==="file_change").length,c=[{label:"TIME",value:r,icon:Ww.TIME,color:"var(--pixel-text)"},{label:"PARTY",value:`${a}/${t.length}`,icon:Ww.PARTY,color:a>0?"var(--pixel-green)":"var(--pixel-text)"},{label:"SKILLS",value:Lm(o),icon:Ww.SKILLS,color:"var(--pixel-cyan)"},{label:"EVENTS",value:Lm((e==null?void 0:e.eventCount)??0),icon:Ww.EVENTS,color:"var(--pixel-text)"},{label:"LOOT",value:Lm(l),icon:Ww.LOOT,color:"var(--pixel-orange)"},{label:"POISON",value:String(s),icon:Ww.POISON,color:s>0?"var(--pixel-error)":"var(--pixel-text)"}];return C.jsx("div",{className:"h-11 flex items-center gap-0 px-4 shrink-0",style:{background:"var(--pixel-bg-dark)",borderBottom:"3px solid var(--pixel-border)"},children:c.map((u,h)=>C.jsxs("div",{className:"flex items-center gap-2",style:{borderLeft:h>0?"2px solid var(--pixel-border)":"none",paddingLeft:h>0?"12px":"0",marginLeft:h>0?"12px":"0"},children:[C.jsx("span",{className:"pixel-text-sm",children:u.icon}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:u.label}),C.jsx("span",{className:"pixel-text-sm",style:{color:u.color,fontWeight:"bold"},children:u.value})]},u.label))})}const bPt={"team-lead":"PALADIN","code-writer":"MAGE","code-reviewer":"CLERIC",tester:"RANGER",researcher:"SCHOLAR",designer:"BARD"},wPt={"team-lead":"⚔","code-writer":"🧙","code-reviewer":"🛡",tester:"🎯",researcher:"📚",designer:"🎨"};function _Pt(e){const t=e.name.toLowerCase();for(const[i,r]of Object.entries(bPt))if(t.includes(i))return r;return e.type==="lead"?"PALADIN":"ADVENTURER"}function jMe(e){const t=e.name.toLowerCase();for(const[i,r]of Object.entries(wPt))if(t.includes(i))return r;return"⚔"}function FMe(e){switch(e){case"active":return{text:"FIGHTING",color:"var(--pixel-green)"};case"idle":return{text:"RESTING",color:"var(--pixel-orange)"};case"error":return{text:"POISONED",color:"var(--pixel-error)"};case"completed":return{text:"VICTORY",color:"var(--pixel-cyan)"};case"shutdown":return{text:"FALLEN",color:"var(--pixel-text-dim)"};default:return{text:e.toUpperCase(),color:"var(--pixel-text-muted)"}}}function SPt(e){return e.status==="active"}function APt(){const e=$7(),{selectedAgentId:t,selectAgent:i}=Ni(),[r,n]=ee.useState(!1),{activeAgents:a,inactiveAgents:s}=ee.useMemo(()=>{const o=[],l=[];for(const c of e)SPt(c)?o.push(c):l.push(c);return{activeAgents:o,inactiveAgents:l}},[e]);return e.length===0?C.jsxs("div",{className:"p-4 flex flex-col items-center justify-center h-full text-center",children:[C.jsx("div",{className:"pixel-text-xl mb-3",children:"\\u2694"}),C.jsx("p",{className:"pixel-text-sm",style:{color:"var(--pixel-text-muted)"},children:"WAITING FOR"}),C.jsx("p",{className:"pixel-text-sm mt-1 pixel-blink",style:{color:"var(--pixel-gold)"},children:"PARTY MEMBERS..."})]}):C.jsxs("div",{className:"p-2",children:[C.jsx("div",{className:"px-2 py-2 mb-2",children:C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:["ACTIVE PARTY (",a.length,")"]})}),a.length>0?C.jsx("div",{className:"space-y-2",children:a.map(o=>C.jsx(EPt,{agent:o,isSelected:t===o.id,onSelect:()=>i(t===o.id?null:o.id)},o.id))}):C.jsx("div",{className:"px-2 py-3 text-center",children:C.jsx("p",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:"NO ACTIVE HEROES"})}),s.length>0&&C.jsxs("div",{className:"mt-3",children:[C.jsx("button",{onClick:()=>n(!r),className:"w-full text-left px-2 py-1.5 pixel-card",style:{cursor:"pointer"},children:C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:[r?"▼":"▶"," FALLEN/RESTING"]}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)",background:"var(--pixel-bg-dark)",border:"1px solid var(--pixel-border)",padding:"0 4px"},children:s.length})]})}),r&&C.jsx("div",{className:"space-y-1 mt-1",children:s.map(o=>C.jsx(MPt,{agent:o,isSelected:t===o.id,onSelect:()=>i(t===o.id?null:o.id)},o.id))})]})]})}function MPt({agent:e,isSelected:t,onSelect:i}){const r=Ch(e.id,e.name,e.type??void 0),n=FMe(e.status),a=jMe(e);return C.jsx("button",{onClick:i,title:`${e.name} (${e.id})`,className:`w-full text-left px-2 py-1 ${t?"pixel-border-accent":"pixel-card"}`,style:{cursor:"pointer"},children:C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"pixel-text-xs",children:a}),C.jsx("span",{className:"pixel-text-xs truncate",style:{color:"var(--pixel-text-dim)"},children:r}),C.jsx("span",{className:"pixel-text-xs shrink-0",style:{color:"var(--pixel-gold, #d4a017)"},children:e.type}),C.jsx("span",{className:"pixel-text-xs",style:{color:n.color},children:n.text}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:qc(e.lastActivityAt)})]})})}function EPt({agent:e,isSelected:t,onSelect:i}){const r=f0(e.name),n=FMe(e.status),a=_Pt(e),s=jMe(e),o=100,l=e.errorCount>0?Math.max(10,o-e.errorCount*20):o,c=Math.min(100,e.toolCallCount%100),u=Ch(e.id,e.name,e.type??void 0);return C.jsxs("button",{onClick:i,title:`${e.name} (${e.id})`,className:`w-full text-left p-2 ${t?"pixel-border-accent":"pixel-card"}`,style:{cursor:"pointer"},children:[C.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[C.jsx("span",{className:"pixel-text-base",children:s}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("span",{className:"pixel-text-sm truncate",style:{color:r},children:u}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold, #d4a017)"},children:e.type})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:["LV.",Math.min(99,Math.floor(e.toolCallCount/5)+1)]}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:a})]})]})]}),C.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-hp)",width:"16px"},children:"HP"}),C.jsx("div",{className:"flex-1 pixel-bar-container pixel-bar-hp",children:C.jsx("div",{className:"pixel-bar-fill",style:{width:`${l}%`}})}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)",width:"32px",textAlign:"right"},children:l})]}),C.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-mp)",width:"16px"},children:"MP"}),C.jsx("div",{className:"flex-1 pixel-bar-container pixel-bar-mp",children:C.jsx("div",{className:"pixel-bar-fill",style:{width:`${c}%`}})}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)",width:"32px",textAlign:"right"},children:c})]}),C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("span",{className:`pixel-text-xs ${e.status==="active"?"pixel-pulse":""}`,style:{color:n.color},children:n.text}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:qc(e.lastActivityAt)})]}),e.errorCount>0&&C.jsxs("div",{className:"mt-1 pixel-text-xs pixel-shake",style:{color:"var(--pixel-error)"},children:["\\u2620 ",e.errorCount," CURSE",e.errorCount>1?"S":""]})]})}const VMe=new Set(["TaskList","TaskGet"]);function TPt(e){const t=[];let i=0;for(;i<e.length;){const r=e[i];if(r.tool&&VMe.has(r.tool)){let n=1;for(;i+n<e.length&&e[i+n].tool===r.tool&&e[i+n].agentId===r.agentId;)n++;t.push({event:r,count:n,groupId:`grp-${r.id}`}),i+=n}else t.push({event:r,count:1,groupId:r.id}),i++}return t}const CPt={Edit:"used ENCHANT!",Write:"cast CREATE!",Read:"used SCAN!",Bash:"cast INVOKE!",Grep:"used SEARCH!",Glob:"used DETECT!",TaskCreate:"used QUEST LOG!",TaskUpdate:"used QUEST UPDATE!",TaskList:"checked QUEST BOARD!",SendMessage:"cast TELEPATHY!",WebFetch:"used SCRY!",WebSearch:"cast DIVINATION!",NotebookEdit:"used TOME EDIT!"};function PPt(e){return e.error?{text:"IT MISSED!",color:"var(--pixel-error)"}:e.duration&&e.duration>5e3?{text:"IT WAS SLOW...",color:"var(--pixel-orange)"}:e.category==="error"?{text:"CRITICAL MISS!",color:"var(--pixel-error)"}:e.category==="file_change"?{text:"IT'S SUPER EFFECTIVE!",color:"var(--pixel-green)"}:{text:"HIT!",color:"var(--pixel-cyan)"}}function DPt(e){switch(e){case"tool_call":return"⚔";case"file_change":return"📦";case"command":return"💻";case"message":return"💬";case"lifecycle":return"🔄";case"error":return"☠";case"compact":return"📦";case"notification":return"🔔";default:return"●"}}function OPt(){const e=Dq(),t=Ni(m=>m.agents),{searchQuery:i,setSearchQuery:r}=az(),n=Di(m=>m.followMode),a=Di(m=>m.hidePolling),s=Di(m=>m.toggleFollowMode),o=Di(m=>m.toggleHidePolling),l=ee.useRef(null),[c,u]=ee.useState(null),h=ee.useMemo(()=>{const m=new Map;for(const y of t)m.set(y.id,Ch(y.id,y.name||y.id,y.type??void 0));return m},[t]);ee.useEffect(()=>{n&&l.current&&(l.current.scrollTop=0)},[e.length,n]);const d=ee.useMemo(()=>{let m=e;if(a&&(m=m.filter(y=>!y.tool||!VMe.has(y.tool))),i){const y=i.toLowerCase();m=m.filter(g=>{var x,w,S,M;return((x=g.tool)==null?void 0:x.toLowerCase().includes(y))||((w=g.filePath)==null?void 0:w.toLowerCase().includes(y))||((S=g.input)==null?void 0:S.toLowerCase().includes(y))||((M=g.output)==null?void 0:M.toLowerCase().includes(y))})}return m},[e,a,i]),f=ee.useMemo(()=>TPt(d),[d]);return C.jsxs("div",{className:"h-full flex flex-col",style:{background:"var(--pixel-bg)"},children:[C.jsxs("div",{className:"flex items-center justify-between px-4 py-2 shrink-0",style:{borderBottom:"3px solid var(--pixel-border)",background:"var(--pixel-surface)"},children:[C.jsxs("span",{className:"pixel-text-sm",style:{color:"var(--pixel-gold)"},children:["\\u2694 BATTLE LOG (",d.length,")"]}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("input",{type:"text",placeholder:"SEARCH...",value:i,onChange:m=>r(m.target.value),className:"pixel-text-xs px-2 py-1",style:{width:"100px",background:"var(--pixel-bg-dark)",border:"2px solid var(--pixel-border)",color:"var(--pixel-text)",outline:"none",fontFamily:"'Press Start 2P', monospace"}}),C.jsx("button",{onClick:o,className:`pixel-text-xs px-2 py-1 ${a?"pixel-btn-active":"pixel-btn"}`,title:"Hide TaskList/TaskGet polling",children:a?"POLL:OFF":"POLL"}),C.jsx("button",{onClick:s,className:`pixel-text-xs px-2 py-1 ${n?"pixel-btn-active":"pixel-btn"}`,children:n?"AUTO":"MANUAL"})]})]}),C.jsx("div",{ref:l,className:"flex-1 overflow-y-auto pixel-scrollbar",children:d.length===0?C.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-8",children:[C.jsx("div",{className:"pixel-text-2xl mb-3",children:"\\u2694"}),C.jsx("p",{className:"pixel-text-sm",style:{color:"var(--pixel-text-muted)"},children:"NO ENCOUNTERS YET"}),C.jsx("p",{className:"pixel-text-xs mt-2 pixel-blink",style:{color:"var(--pixel-gold)"},children:"AWAITING BATTLE..."})]}):C.jsx("div",{children:f.map(({event:m,count:y,groupId:g},x)=>C.jsx("div",{className:"pixel-slide-in",style:{animationDelay:`${Math.min(x*.02,.2)}s`},children:C.jsx(RPt,{event:m,agentNameMap:h,isExpanded:c===m.id,groupCount:y,onToggle:()=>u(c===m.id?null:m.id)})},g))})})]})}function RPt({event:e,agentNameMap:t,isExpanded:i,groupCount:r,onToggle:n}){const[a,s]=ee.useState(!1),o=DPt(e.category),l=sz(e.tool||e.hookType),c=CPt[e.tool||""]||`used ${l.toUpperCase()}!`,u=PPt(e);return C.jsx("div",{className:"px-4 py-2 cursor-pointer",onClick:n,style:{borderBottom:"1px solid var(--pixel-border)",background:i?"var(--pixel-surface)":"transparent"},onMouseEnter:h=>{h.currentTarget.style.background="var(--pixel-surface)"},onMouseLeave:h=>{i||(h.currentTarget.style.background="transparent")},children:C.jsxs("div",{className:"flex items-start gap-3",children:[C.jsx("span",{className:"pixel-text-base mt-0.5 w-5 text-center shrink-0",children:o}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-cyan)"},title:e.agentId,children:t.get(e.agentId)??e.agentId.slice(0,8)}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text)"},title:e.tool||e.hookType,children:c}),r&&r>1&&C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)",background:"var(--pixel-bg-dark)",border:"1px solid var(--pixel-border)",padding:"0 3px"},children:["x",r]})]}),C.jsx("span",{className:"pixel-text-xs",style:{color:u.color},children:u.text}),e.filePath&&C.jsx("div",{className:"mt-0.5",children:C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},title:e.filePath,children:["TARGET: ",Ah(e.filePath)]})}),e.error&&C.jsxs("p",{className:"pixel-text-xs mt-0.5 pixel-shake",style:{color:"var(--pixel-error)"},children:["\\u2620 ",e.error]}),i&&C.jsxs("div",{className:"mt-2 space-y-2",onClick:h=>h.stopPropagation(),children:[e.input&&C.jsxs("div",{children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:"INPUT:"}),C.jsx("pre",{className:"mt-1 pixel-text-xs overflow-x-auto max-h-32 pixel-scrollbar whitespace-pre-wrap break-all p-2",style:{color:"var(--pixel-text-muted)",background:"var(--pixel-bg-dark)",border:"2px solid var(--pixel-border)",fontFamily:"'Press Start 2P', monospace"},children:a?e.input:Oq(e.tool,e.input)})]}),e.output&&C.jsxs("div",{children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:"OUTPUT:"}),C.jsx("pre",{className:"mt-1 pixel-text-xs overflow-x-auto max-h-32 pixel-scrollbar whitespace-pre-wrap break-all p-2",style:{color:"var(--pixel-text-muted)",background:"var(--pixel-bg-dark)",border:"2px solid var(--pixel-border)",fontFamily:"'Press Start 2P', monospace"},children:a?e.output:Rq(e.output)})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[e.duration!==void 0&&C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:["CAST TIME: ",e.duration,"ms"]}),(e.input||e.output)&&C.jsx("button",{onClick:h=>{h.stopPropagation(),s(!a)},className:"pixel-text-xs pixel-btn",style:{padding:"0 4px",fontSize:"7px"},children:a?"SUMMARY":"RAW"})]})]})]}),C.jsx("span",{className:"pixel-text-xs shrink-0",style:{color:"var(--pixel-text-dim)"},children:gu(e.timestamp)})]})})}const IPt=[{id:"activity",label:"LOG",icon:"📜"},{id:"files",label:"LOOT",icon:"📦"},{id:"errors",label:"CURSES",icon:"☠"},{id:"messages",label:"CHAT",icon:"💬"}];function NPt(){const{selectedAgentId:e,agents:t,events:i,selectAgent:r}=Ni(),[n,a]=ee.useState("activity"),s=t.find(E=>E.id===e);if(!s)return null;const o=i.filter(E=>E.agentId===s.id),l=o.filter(E=>E.category==="error"||E.error),c=o.filter(E=>E.filePath).reduce((E,T)=>(T.filePath&&!E.includes(T.filePath)&&E.push(T.filePath),E),[]),u=o.filter(E=>E.category==="message"),h=f0(s.name),d=Math.min(99,Math.floor(s.toolCallCount/5)+1),f=s.toolCallCount%50,m=50,y=s.errorCount>0?Math.max(10,100-s.errorCount*20):100,g=Math.min(100,s.toolCallCount%100),x=Math.min(99,Math.floor(s.toolCallCount/3)),w=Math.min(99,50-Math.min(50,s.errorCount*10)),S=Math.min(99,o.length>0?60:10),M=Math.min(99,s.errorCount===0?80:20);return C.jsxs("div",{className:"h-full flex flex-col",style:{background:"var(--pixel-bg)"},children:[C.jsxs("div",{className:"p-3 shrink-0",style:{borderBottom:"3px solid var(--pixel-border)",background:"var(--pixel-surface)"},children:[C.jsxs("div",{className:"flex items-center justify-between mb-2",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("div",{className:"w-10 h-10 flex items-center justify-center pixel-border",style:{background:`${h}20`,color:h},children:C.jsx("span",{className:"pixel-text-lg font-bold",children:s.name.charAt(0).toUpperCase()})}),C.jsxs("div",{children:[C.jsx("h3",{className:"pixel-text-sm",style:{color:"var(--pixel-text)"},title:`${s.name} (${s.id})`,children:Ch(s.id,s.name,s.type??void 0)}),C.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:["LV.",d]}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:s.type.toUpperCase()})]})]})]}),C.jsx("button",{onClick:()=>r(null),className:"pixel-btn px-2 py-1 pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:"X"})]}),C.jsxs("div",{className:"space-y-1 mb-2",children:[C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-hp)",width:"20px"},children:"HP"}),C.jsx("div",{className:"flex-1 pixel-bar-container pixel-bar-hp",children:C.jsx("div",{className:"pixel-bar-fill",style:{width:`${y}%`}})}),C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)",width:"40px",textAlign:"right"},children:[y,"/100"]})]}),C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-mp)",width:"20px"},children:"MP"}),C.jsx("div",{className:"flex-1 pixel-bar-container pixel-bar-mp",children:C.jsx("div",{className:"pixel-bar-fill",style:{width:`${g}%`}})}),C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)",width:"40px",textAlign:"right"},children:[g,"/100"]})]}),C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-xp)",width:"20px"},children:"XP"}),C.jsx("div",{className:"flex-1 pixel-bar-container pixel-bar-xp",children:C.jsx("div",{className:"pixel-bar-fill",style:{width:`${f/m*100}%`}})}),C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)",width:"40px",textAlign:"right"},children:[f,"/",m]})]})]}),C.jsx("div",{className:"grid grid-cols-4 gap-1",children:[{label:"STR",value:x,color:"var(--pixel-hp)"},{label:"DEF",value:w,color:"var(--pixel-blue)"},{label:"SPD",value:S,color:"var(--pixel-green)"},{label:"LCK",value:M,color:"var(--pixel-gold)"}].map(E=>C.jsxs("div",{className:"text-center p-1",style:{background:"var(--pixel-bg-dark)",border:"2px solid var(--pixel-border)"},children:[C.jsx("div",{className:"pixel-text-sm font-bold",style:{color:E.color},children:E.value}),C.jsx("div",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:E.label})]},E.label))})]}),C.jsx("div",{className:"flex shrink-0",style:{borderBottom:"3px solid var(--pixel-border)"},children:IPt.map(E=>{const T=E.id==="activity"?o.length:E.id==="files"?c.length:E.id==="errors"?l.length:u.length;return C.jsxs("button",{onClick:()=>a(E.id),className:"flex-1 py-2 pixel-text-xs text-center",style:{background:n===E.id?"var(--pixel-accent)":"var(--pixel-surface)",color:n===E.id?"#fff":"var(--pixel-text-muted)",borderRight:"2px solid var(--pixel-border)",cursor:"pointer"},children:[E.icon," ",E.label," (",T,")"]},E.id)})}),C.jsxs("div",{className:"flex-1 overflow-y-auto pixel-scrollbar",children:[n==="activity"&&C.jsx("div",{children:o.length===0?C.jsx("p",{className:"pixel-text-xs p-4 text-center",style:{color:"var(--pixel-text-muted)"},children:"NO ADVENTURE LOG YET"}):o.slice(0,100).map(E=>C.jsxs("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--pixel-border)"},children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-cyan)"},children:E.tool||E.hookType}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:gu(E.timestamp)})]}),E.filePath&&C.jsx("span",{className:"pixel-text-xs block mt-0.5",style:{color:"var(--pixel-text-muted)"},title:E.filePath,children:Ah(E.filePath)})]},E.id))}),n==="files"&&C.jsx("div",{className:"p-2 space-y-1",children:c.length===0?C.jsx("p",{className:"pixel-text-xs p-4 text-center",style:{color:"var(--pixel-text-muted)"},children:"NO LOOT FOUND"}):c.map(E=>C.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",style:{border:"1px solid var(--pixel-border)"},children:[C.jsx("span",{className:"pixel-text-xs",children:"\\📦"}),C.jsx("span",{className:"pixel-text-xs break-all",style:{color:"var(--pixel-text)"},title:E,children:Ah(E)})]},E))}),n==="errors"&&C.jsx("div",{children:l.length===0?C.jsx("p",{className:"pixel-text-xs p-4 text-center",style:{color:"var(--pixel-green)"},children:"NO CURSES! ALL CLEAR!"}):l.map(E=>C.jsxs("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--pixel-border)"},children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-error)"},children:["\\u2620 ",E.tool||E.hookType]}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:gu(E.timestamp)})]}),E.error&&C.jsx("p",{className:"pixel-text-xs mt-0.5 break-all",style:{color:"var(--pixel-error)"},children:E.error})]},E.id))}),n==="messages"&&C.jsx("div",{children:u.length===0?C.jsx("p",{className:"pixel-text-xs p-4 text-center",style:{color:"var(--pixel-text-muted)"},children:"NO TELEPATHY LOGS"}):u.map(E=>C.jsxs("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--pixel-border)"},children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-purple)"},children:"\\💬 TELEPATHY"}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:gu(E.timestamp)})]}),E.input&&C.jsx("p",{className:"pixel-text-xs mt-0.5 break-words whitespace-pre-wrap",style:{color:"var(--pixel-text-muted)"},children:E.input})]},E.id))})]})]})}const bpe={created:{icon:"✨",label:"NEW",rarity:"LEGENDARY",color:"var(--pixel-gold)"},modified:{icon:"🔮",label:"MOD",rarity:"RARE",color:"var(--pixel-purple)"},read:{icon:"📜",label:"READ",rarity:"COMMON",color:"var(--pixel-cyan)"}};function LPt(){const{session:e}=Ni(),[t,i]=ee.useState([]);ee.useEffect(()=>{if(!(e!=null&&e.id))return;let s=!1;async function o(){try{const{files:c}=await X7(e.id);s||i(c)}catch{}}o();const l=setInterval(o,5e3);return()=>{s=!0,clearInterval(l)}},[e==null?void 0:e.id]);const r=t.filter(s=>s.changeType==="created"),n=t.filter(s=>s.changeType==="modified"),a=t.filter(s=>s.changeType==="read");return C.jsxs("div",{className:"p-3 h-full flex flex-col",children:[C.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2",style:{borderBottom:"2px solid var(--pixel-border)"},children:[C.jsx("span",{className:"pixel-text-sm",style:{color:"var(--pixel-gold)"},children:"\\📦 INVENTORY"}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:[r.length,"\\u2728"]}),C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-purple)"},children:[n.length,"\\🔮"]}),C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-cyan)"},children:[a.length,"\\📜"]})]})]}),t.length===0?C.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center",children:[C.jsx("div",{className:"pixel-text-xl mb-3",children:"\\📦"}),C.jsx("p",{className:"pixel-text-sm",style:{color:"var(--pixel-text-muted)"},children:"INVENTORY EMPTY"}),C.jsx("p",{className:"pixel-text-xs mt-2",style:{color:"var(--pixel-text-dim)"},children:"NO LOOT COLLECTED YET"})]}):C.jsx("div",{className:"flex-1 overflow-y-auto pixel-scrollbar space-y-1",children:t.map(s=>{const o=bpe[s.changeType]||bpe.read;return C.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 group",style:{border:"2px solid transparent",cursor:"default"},onMouseEnter:l=>{l.currentTarget.style.borderColor="var(--pixel-border)",l.currentTarget.style.background="var(--pixel-surface)"},onMouseLeave:l=>{l.currentTarget.style.borderColor="transparent",l.currentTarget.style.background="transparent"},children:[C.jsx("span",{className:"pixel-text-base shrink-0",children:o.icon}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsx("span",{className:"pixel-text-xs block",style:{color:"var(--pixel-text)"},title:s.filePath,children:Ah(s.filePath)}),C.jsxs("span",{className:"pixel-text-xs",style:{color:o.color},children:["[",o.rarity,"]"]})]}),C.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.touchCount>1&&C.jsxs("span",{className:"pixel-text-xs px-1",style:{color:"var(--pixel-gold)",border:"1px solid var(--pixel-border)",background:"var(--pixel-bg-dark)"},children:["x",s.touchCount]}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:qc(s.lastTouchedAt)})]})]},`${s.filePath}-${s.agentId}`)})})]})}const kPt={backlog:{label:"RUMORS",icon:"💬",color:"var(--pixel-text-dim)"},planned:{label:"ACCEPTED",icon:"📜",color:"var(--pixel-blue)"},in_progress:{label:"ACTIVE",icon:"⚔",color:"var(--pixel-green)"},in_review:{label:"REPORTING",icon:"🔍",color:"var(--pixel-purple)"},completed:{label:"COMPLETE!",icon:"🏆",color:"var(--pixel-gold)"},blocked:{label:"SEALED",icon:"🔒",color:"var(--pixel-error)"}},wpe={critical:{label:"LEGENDARY",stars:"★★★★★",color:"var(--pixel-error)"},high:{label:"EPIC",stars:"★★★★",color:"var(--pixel-orange)"},medium:{label:"RARE",stars:"★★★",color:"var(--pixel-blue)"},low:{label:"COMMON",stars:"★★",color:"var(--pixel-text-dim)"}};function zPt(){const e=T0(),t=r=>r==="pending"?"planned":r==="deferred"?"backlog":r==="in_review"||r==="blocked"?"in_progress":r,i=K_.reduce((r,n)=>(r[n.id]=e.filter(a=>t(a.status)===n.id),r),{});return e.length===0?C.jsxs("div",{className:"h-full flex flex-col items-center justify-center p-8",children:[C.jsx("div",{className:"pixel-text-2xl mb-4",children:"\\📜"}),C.jsx("p",{className:"pixel-text-sm",style:{color:"var(--pixel-text-muted)"},children:"QUEST BOARD EMPTY"}),C.jsx("p",{className:"pixel-text-xs mt-2",style:{color:"var(--pixel-text-dim)"},children:"NO QUESTS AVAILABLE"}),C.jsx("p",{className:"pixel-text-xs mt-1 pixel-blink",style:{color:"var(--pixel-gold)"},children:"CHECK BACK LATER..."})]}):C.jsx("div",{className:"h-full flex gap-2 p-3 overflow-x-auto pixel-scrollbar",children:K_.map(r=>{const n=i[r.id]||[],a=kPt[r.id]||{label:r.label,icon:"■",color:"var(--pixel-text-muted)"};return C.jsxs("div",{className:"flex-shrink-0 w-56 flex flex-col pixel-card",children:[C.jsx("div",{className:"px-3 py-2 shrink-0",style:{borderBottom:"3px solid var(--pixel-border)"},children:C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:a.color},children:[a.icon," ",a.label]}),C.jsx("span",{className:"pixel-text-xs px-1.5 py-0.5",style:{color:"var(--pixel-text)",background:"var(--pixel-bg-dark)",border:"2px solid var(--pixel-border)"},children:n.length})]})}),C.jsx("div",{className:"flex-1 overflow-y-auto pixel-scrollbar p-2 space-y-2",children:n.map(s=>C.jsx(BPt,{task:s},s.id))})]},r.id)})})}function BPt({task:e}){const{selectTask:t,selectedTaskId:i}=_n(),r=oz(),n=wpe[e.priority]||wpe.low,a=e.assignedAgent?f0(e.assignedAgent):null,s=e.assignedAgent?r(e.assignedAgent):null,o=e.status==="completed",l=W7(e.prdSection);return C.jsxs("div",{className:`p-2 cursor-pointer ${o?"pixel-glow-gold":i===e.id?"pixel-glow-green":"pixel-border-light"}`,onClick:()=>t(e.id),style:{background:"var(--pixel-bg-dark)",opacity:o?.85:1},children:[C.jsxs("div",{className:"flex items-center justify-between mb-1",children:[C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:n.color},children:["[",n.label,"]"]}),l&&C.jsx("span",{className:"pixel-text-xs px-1",style:{color:"var(--pixel-gold)",background:"rgba(255, 215, 0, 0.1)",border:"1px solid var(--pixel-gold)"},children:l})]}),e.complexity&&C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:["C",e.complexity]})]}),C.jsx("div",{className:"mb-1",children:C.jsx("span",{className:"pixel-text-xs",style:{color:n.color},children:n.stars})}),C.jsxs("h4",{className:"pixel-text-xs leading-relaxed mb-2",style:{color:o?"var(--pixel-text-dim)":"var(--pixel-text)",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:[o&&"✓ ",e.title]}),C.jsxs("div",{className:"flex items-center justify-between",children:[e.assignedAgent&&a?C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("div",{className:"w-4 h-4 flex items-center justify-center pixel-text-xs",style:{background:`${a}30`,color:a,border:"1px solid var(--pixel-border)"},children:(s??"?").charAt(0).toUpperCase()}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:s})]}):C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:"UNASSIGNED"}),e.tags&&e.tags.length>0&&C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:["#",e.tags[0]]})]}),e.blockedBy.length>0&&C.jsxs("div",{className:"mt-1 pixel-text-xs pixel-shake",style:{color:"var(--pixel-error)"},children:["\\🔒 SEALED BY ",e.blockedBy.length," QUEST",e.blockedBy.length>1?"S":""]})]})}function UPt(){const{activeSprint:e}=lz(),t=T0(),i=ee.useMemo(()=>{if(!e)return{total:0,completed:0,inProgress:0,blocked:0,pending:0,percent:0};const n=t.filter(h=>h.sprintId===e.id),a=n.length||e.totalTasks||0,s=n.filter(h=>h.status==="completed").length,o=n.filter(h=>h.status==="in_progress").length,l=n.filter(h=>h.status==="blocked").length,c=a-s-o-l,u=a>0?Math.round(s/a*100):0;return{total:a,completed:s,inProgress:o,blocked:l,pending:c,percent:u}},[e,t]);if(!e)return C.jsx("div",{className:"p-4 text-center",children:C.jsx("p",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:"NO ACTIVE CHAPTER"})});const r=Math.floor(i.percent/10);return C.jsxs("div",{className:"p-4",style:{borderBottom:"3px solid var(--pixel-border)"},children:[C.jsxs("div",{className:"flex items-center justify-between mb-3",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:"\\📖 CHAPTER PROGRESS"}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:e.name})]}),C.jsxs("div",{className:"mb-3",children:[C.jsxs("div",{className:"flex items-center justify-between mb-1",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-xp)"},children:["XP LV.",r]}),C.jsxs("span",{className:"pixel-text-sm font-bold",style:{color:"var(--pixel-gold)"},children:[i.percent,"%"]})]}),C.jsx("div",{className:"pixel-bar-container pixel-bar-xp",style:{height:"16px"},children:C.jsx("div",{className:"pixel-bar-fill",style:{width:`${i.percent}%`,transition:"width 0.5s steps(8)"}})}),C.jsxs("div",{className:"flex items-center justify-between mt-1",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:[i.completed,"/",i.total," QUESTS"]}),i.percent===100&&C.jsx("span",{className:"pixel-text-xs pixel-bounce",style:{color:"var(--pixel-gold)"},children:"CHAPTER COMPLETE!"})]})]}),C.jsx("div",{className:"space-y-1",children:[{label:"VICTORIES",value:i.completed,icon:"🏆",color:"var(--pixel-green)",barClass:"pixel-bar-green"},{label:"IN BATTLE",value:i.inProgress,icon:"⚔",color:"var(--pixel-cyan)",barClass:"pixel-bar-purple"},{label:"WAITING",value:i.pending,icon:"⌛",color:"var(--pixel-orange)",barClass:"pixel-bar-xp"},{label:"SEALED",value:i.blocked,icon:"🔒",color:"var(--pixel-error)",barClass:"pixel-bar-hp"}].map(n=>C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"pixel-text-xs",style:{width:"14px"},children:n.icon}),C.jsx("span",{className:"pixel-text-xs flex-1",style:{color:n.color},children:n.label}),C.jsx("span",{className:"pixel-text-xs font-bold",style:{color:"var(--pixel-text)"},children:n.value})]},n.label))})]})}function jPt(){const e=T0(),{activeSprint:t}=_n(),i=t?e.filter(c=>c.sprintId===t.id):e,r=i.length,n=i.filter(c=>c.status==="completed").length,a=r-n,s=r>0?Math.round(n/r*100):0,o=20,l=8;return r===0?C.jsxs("div",{className:"pixel-panel p-3",children:[C.jsx("h3",{className:"pixel-title text-xs mb-2",children:"BURNDOWN"}),C.jsx("p",{className:"text-[10px] text-pixel-dim",children:"No quest data..."})]}):C.jsxs("div",{className:"pixel-panel p-3",children:[C.jsxs("h3",{className:"pixel-title text-xs mb-2",children:["BURNDOWN ",C.jsxs("span",{className:"text-pixel-dim",children:["LV.",s]})]}),C.jsxs("div",{className:"font-mono text-[9px] leading-tight text-pixel-green",children:[Array.from({length:l}).map((c,u)=>{const h=(l-u)/l*r,d=Math.round((l-u)/l*r),f=Array.from({length:o}).map((m,y)=>y/o*r<=n&&u>=l-Math.ceil(a/r*l)?"*":d>=h?".":" ").join("");return C.jsxs("div",{children:[String(Math.round(h)).padStart(3," "),"|",f,"|"]},u)}),C.jsx("div",{children:" +"+"-".repeat(o)+"+"})]}),C.jsxs("div",{className:"mt-2 flex gap-3 text-[9px]",children:[C.jsxs("span",{className:"text-pixel-green",children:["Done: ",n]}),C.jsxs("span",{className:"text-pixel-yellow",children:["Left: ",a]}),C.jsxs("span",{className:"text-pixel-dim",children:["Total: ",r]})]})]})}const _pe={backlog:{icon:"○",color:"var(--pixel-text-dim)"},planned:{icon:"○",color:"var(--pixel-blue)"},pending:{icon:"○",color:"var(--pixel-blue)"},in_progress:{icon:"⚔",color:"var(--pixel-green)"},in_review:{icon:"◆",color:"var(--pixel-purple)"},completed:{icon:"✓",color:"var(--pixel-gold)"},blocked:{icon:"✖",color:"var(--pixel-error)"},deferred:{icon:"○",color:"var(--pixel-text-dim)"}};function FPt(){const{activeProject:e,tasks:t,sprints:i,selectTask:r}=_n(),[n,a]=ee.useState(null),[s,o]=ee.useState(null),l=ee.useMemo(()=>{if(!e||t.length===0||i.length===0)return[];const c=new Map;for(const d of i)c.set(d.id,d);const u=new Map;for(const d of t){const f=d.sprintId||"unknown";u.has(f)||u.set(f,new Map);const m=u.get(f),y=d.prdSection||"Uncategorized";m.has(y)||m.set(y,{name:y,total:0,completed:0,inProgress:0,blocked:0,percent:0,tasks:[],order:d.prdLineStart??999});const g=m.get(y);g.total++,g.tasks.push(d),d.status==="completed"&&g.completed++,d.status==="in_progress"&&g.inProgress++,d.status==="blocked"&&g.blocked++}const h=[];for(const[d,f]of u){const m=c.get(d);if(!m)continue;const y=Array.from(f.values());for(const w of y)w.percent=w.total>0?Math.round(w.completed/w.total*100):0;y.sort((w,S)=>w.order-S.order);const g=y.reduce((w,S)=>w+S.total,0),x=y.reduce((w,S)=>w+S.completed,0);h.push({sprint:m,sections:y,total:g,completed:x,percent:g>0?Math.round(x/g*100):0})}return h.sort((d,f)=>(d.sprint.order??0)-(f.sprint.order??0)),h},[e,t,i]);return l.length===0?C.jsx("div",{className:"h-full flex items-center justify-center p-4",children:C.jsxs("div",{className:"text-center",children:[C.jsx("span",{className:"pixel-text-xl",children:"📖"}),C.jsx("p",{className:"pixel-text-xs mt-2",style:{color:"var(--pixel-text-muted)"},children:"QUEST JOURNAL"}),C.jsx("p",{className:"pixel-text-xs mt-1",style:{color:"var(--pixel-text-dim)"},children:"NO ENTRIES YET"})]})}):C.jsxs("div",{className:"p-3",children:[C.jsxs("div",{className:"flex items-center justify-between mb-2",children:[C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:["📖"," QUEST JOURNAL"]}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:e==null?void 0:e.name})]}),C.jsx("div",{className:"space-y-1",children:l.map(c=>{const u=n===c.sprint.id,h=c.percent===100;return C.jsxs("div",{children:[C.jsxs("div",{className:`p-2 cursor-pointer ${h?"pixel-border-gold":"pixel-card"}`,style:{background:"var(--pixel-bg-dark)"},onClick:()=>a(u?null:c.sprint.id),children:[C.jsxs("div",{className:"flex items-center justify-between mb-1",children:[C.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:u?"▼":"▶"}),C.jsx("h4",{className:"pixel-text-xs truncate",style:{color:"var(--pixel-gold)",fontWeight:"bold"},children:c.sprint.name})]}),C.jsxs("span",{className:"pixel-text-xs font-bold ml-2 shrink-0",style:{color:h?"var(--pixel-gold)":"var(--pixel-text)"},children:[c.percent,"%"]})]}),C.jsx("div",{className:"pixel-bar-container pixel-bar-xp",style:{height:"8px"},children:C.jsx("div",{className:"pixel-bar-fill",style:{width:`${c.percent}%`,background:h?"var(--pixel-gold)":"var(--pixel-xp)"}})}),C.jsx("div",{className:"flex items-center gap-2 pixel-text-xs mt-1",style:{color:"var(--pixel-text-dim)"},children:C.jsxs("span",{children:[c.completed,"/",c.total]})})]}),u&&C.jsx("div",{className:"ml-2 space-y-0.5",style:{borderLeft:"2px solid var(--pixel-border)"},children:c.sections.map(d=>{const f=`${c.sprint.id}:${d.name}`,m=s===f,y=d.percent===100,g=d.blocked>0,x=d.inProgress>0;let w="var(--pixel-text-dim)";return y?w="var(--pixel-gold)":g?w="var(--pixel-error)":x&&(w="var(--pixel-green)"),C.jsxs("div",{children:[C.jsxs("div",{className:"p-2 cursor-pointer",style:{background:"var(--pixel-bg-dark)"},onClick:()=>o(m?null:f),children:[C.jsxs("div",{className:"flex items-center justify-between mb-1",children:[C.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:m?"▼":"▶"}),C.jsx("h4",{className:"pixel-text-xs truncate",style:{color:"var(--pixel-text)"},children:d.name})]}),C.jsxs("span",{className:"pixel-text-xs font-bold ml-2 shrink-0",style:{color:w},children:[d.percent,"%"]})]}),C.jsx("div",{className:"pixel-bar-container pixel-bar-xp",style:{height:"6px"},children:C.jsx("div",{className:"pixel-bar-fill",style:{width:`${d.percent}%`,background:y?"var(--pixel-gold)":g?"var(--pixel-error)":"var(--pixel-xp)"}})}),C.jsxs("div",{className:"flex items-center gap-2 pixel-text-xs mt-1",style:{color:"var(--pixel-text-dim)"},children:[C.jsxs("span",{children:[d.completed,"/",d.total]}),d.inProgress>0&&C.jsxs("span",{style:{color:"var(--pixel-green)"},children:[d.inProgress,"⚔"]}),d.blocked>0&&C.jsxs("span",{style:{color:"var(--pixel-error)"},children:[d.blocked,"🔒"]})]})]}),m&&C.jsx("div",{className:"ml-2",style:{borderLeft:"2px solid var(--pixel-border)",background:"var(--pixel-bg-dark)"},children:d.tasks.map(S=>{const M=_pe[S.status]||_pe.backlog;return C.jsxs("div",{onClick:()=>r(S.id),className:"cursor-pointer px-3 py-1 flex items-center gap-2 pixel-text-xs",style:{borderBottom:"1px solid var(--pixel-border)"},children:[C.jsx("span",{style:{color:M.color},children:M.icon}),C.jsx("span",{className:"truncate flex-1",style:{color:"var(--pixel-text)"},children:S.title}),S.assignedAgent&&C.jsxs("span",{style:{color:"var(--pixel-text-dim)"},children:["@",S.assignedAgent]})]},S.id)})})]},f)})})]},c.sprint.id)})})]})}const qw=140,Xw=44,VPt=36,HPt=20,Spe=28,Ape=20,GPt={backlog:"#6b7280",planned:"#457b9d",pending:"#f4a261",in_progress:"#2dce89",in_review:"#7c5cff",completed:"#ffd700",blocked:"#e63946",deferred:"#6b7280"},WPt={backlog:"LOCKED",planned:"AVAILABLE",pending:"QUEUED",in_progress:"LEARNING",in_review:"TESTING",completed:"MASTERED",blocked:"SEALED",deferred:"HIDDEN"};function Mpe(e){return GPt[e]??"#6b7280"}function Epe(e){return WPt[e]??e.replace(/_/g," ").toUpperCase()}function qPt(e,t){const i=new Map;function r(a,s){if(i.has(a))return i.get(a);if(s.has(a))return 0;s.add(a);const c=(t.get(a)??[]).reduce((u,h)=>!t.has(h)&&!e.some(d=>d.id===h)?u:Math.max(u,r(h,s)),-1)+1;return i.set(a,c),c}const n=new Set;for(const a of e)r(a.id,n);return i}function XPt(){const{tasks:e}=_n(),t=ee.useRef(null),[i,r]=ee.useState(null),{nodes:n,edges:a,svgWidth:s,svgHeight:o,isEmpty:l}=ee.useMemo(()=>{const d=new Map;for(const R of e){const P=new Set([...R.dependsOn,...R.blockedBy]);d.set(R.id,Array.from(P))}const f=new Set;for(const R of e){const P=d.get(R.id)??[];if(P.length>0){f.add(R.id);for(const I of P)f.add(I)}}const m=e.filter(R=>f.has(R.id));if(m.length===0)return{nodes:[],edges:[],svgWidth:0,svgHeight:0,isEmpty:!0};const y=qPt(m,d),g=new Map;for(const R of m){const P=y.get(R.id)??0;g.has(P)||g.set(P,[]),g.get(P).push(R)}const x=Array.from(g.keys()).sort((R,P)=>R-P),w=[];for(const R of x){const P=g.get(R),I={blocked:0,in_progress:1,in_review:2,pending:3,planned:4,backlog:5,completed:6,deferred:7};P.sort((L,z)=>(I[L.status]??9)-(I[z.status]??9)||L.title.localeCompare(z.title)),P.forEach((L,z)=>{const U=Ape+R*(qw+VPt),j=Spe+z*(Xw+HPt);w.push({id:L.id,title:L.title,status:L.status,col:R,row:z,x:U,y:j})})}const S=[],M=new Set(w.map(R=>R.id));for(const R of m){const P=d.get(R.id)??[];for(const I of P)M.has(I)&&S.push({fromId:I,toId:R.id})}const E=Math.max(...w.map(R=>R.x))+qw+Ape,T=Math.max(...w.map(R=>R.y))+Xw+Spe;return{nodes:w,edges:S,svgWidth:E,svgHeight:T,isEmpty:!1}},[e]);ee.useEffect(()=>{var d;(d=t.current)==null||d.scrollTo({left:0,top:0})},[n]);const c=ee.useMemo(()=>{const d=new Map;for(const f of n)d.set(f.id,f);return d},[n]),u=ee.useCallback(d=>i!==null&&(d.fromId===i||d.toId===i),[i]);if(l)return C.jsxs("div",{className:"p-4",style:{borderBottom:"3px solid var(--pixel-border)"},children:[C.jsx("div",{className:"flex items-center justify-between mb-2",children:C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:"\\🌲 SKILL TREE"})}),C.jsx("div",{className:"h-24 flex items-center justify-center",children:C.jsx("p",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:"NO SKILL DEPENDENCIES"})})]});const h=Array.from(new Set(n.map(d=>d.status)));return C.jsxs("div",{className:"p-4",style:{borderBottom:"3px solid var(--pixel-border)"},children:[C.jsxs("div",{className:"flex items-center justify-between mb-2",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:"\\🌲 SKILL TREE"}),C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:[n.length," SKILLS \\u00B7 ",a.length," LINKS"]})]}),C.jsx("div",{className:"flex flex-wrap gap-x-3 gap-y-1 mb-2",children:h.map(d=>C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("span",{className:"inline-block w-3 h-3",style:{backgroundColor:Mpe(d),border:"1px solid #000"}}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:Epe(d)})]},d))}),C.jsx("div",{ref:t,className:"overflow-auto pixel-scrollbar pixel-card",style:{maxHeight:360,background:"var(--pixel-bg-dark)"},children:C.jsxs("svg",{width:s,height:o,viewBox:`0 0 ${s} ${o}`,className:"select-none",children:[C.jsxs("defs",{children:[C.jsx("marker",{id:"pixel-arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:C.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#444477"})}),C.jsx("marker",{id:"pixel-arrow-hl",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:C.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#ffd700"})})]}),a.map(d=>{const f=c.get(d.fromId),m=c.get(d.toId);if(!f||!m)return null;const y=u(d),g=f.x+qw,x=f.y+Xw/2,w=m.x,S=m.y+Xw/2,M=(g+w)/2,E=`M ${g} ${x} L ${M} ${x} L ${M} ${S} L ${w} ${S}`;return C.jsx("path",{d:E,fill:"none",stroke:y?"#ffd700":"#444477",strokeWidth:y?3:2,markerEnd:y?"url(#pixel-arrow-hl)":"url(#pixel-arrow)",opacity:i===null||y?1:.25},`${d.fromId}-${d.toId}`)}),n.map(d=>{const f=Mpe(d.status),m=i===d.id,y=i!==null&&!m&&!a.some(x=>x.fromId===i&&x.toId===d.id||x.toId===i&&x.fromId===d.id),g=d.status==="completed";return C.jsxs("g",{onMouseEnter:()=>r(d.id),onMouseLeave:()=>r(null),style:{cursor:"default"},opacity:y?.3:1,children:[C.jsx("rect",{x:d.x,y:d.y,width:qw,height:Xw,fill:"#1a1a2e",stroke:m?"#ffd700":f,strokeWidth:3}),C.jsx("rect",{x:d.x+3,y:d.y+3,width:qw-6,height:2,fill:"rgba(255,255,255,0.08)"}),C.jsx("rect",{x:d.x+6,y:d.y+Xw/2-4,width:8,height:8,fill:f}),g&&C.jsx("text",{x:d.x+qw-16,y:d.y+14,fontSize:10,fill:"#ffd700",children:"⭐"}),C.jsx("text",{x:d.x+20,y:d.y+17,fill:"#e8e8ff",fontSize:7,fontFamily:"'Press Start 2P', monospace",children:d.title.length>14?d.title.slice(0,13)+"…":d.title}),C.jsx("text",{x:d.x+20,y:d.y+32,fill:"#6666aa",fontSize:6,fontFamily:"'Press Start 2P', monospace",children:Epe(d.status)})]},d.id)})]})})]})}function YPt(){const{viewMode:e,setViewMode:t,activeProject:i}=_n();return C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("button",{onClick:()=>t("agents"),className:"pixel-text-xs px-2 py-1 transition-colors",style:{color:e==="agents"?"var(--pixel-gold)":"var(--pixel-text-muted)",border:e==="agents"?"2px solid var(--pixel-gold)":"2px solid var(--pixel-border)"},children:"[A] AGENTS"}),C.jsx("button",{onClick:()=>t("tracker"),className:"pixel-text-xs px-2 py-1 transition-colors",style:{color:e==="tracker"?"var(--pixel-gold)":"var(--pixel-text-muted)",border:e==="tracker"?"2px solid var(--pixel-gold)":"2px solid var(--pixel-border)"},children:"[T] TRACKER"})]}),i&&C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:[i.completedTasks,"/",i.totalTasks]})]})}function $Pt(){const{connectionStatus:e}=Ni(),t={connected:{color:"var(--pixel-green)",glow:"0 0 6px var(--pixel-green)",pulse:!0,label:"ONLINE"},reconnecting:{color:"var(--pixel-gold)",glow:"0 0 6px var(--pixel-gold)",pulse:!0,label:"RECONECTANDO..."},disconnected:{color:"var(--pixel-error)",glow:"0 0 6px var(--pixel-error)",pulse:!1,label:"OFFLINE"}}[e];return C.jsxs("div",{className:"flex items-center gap-2 ml-2",children:[C.jsx("div",{className:`w-3 h-3 ${t.pulse?"pixel-pulse":""}`,style:{background:t.color,boxShadow:t.glow}}),C.jsx("span",{className:"pixel-text-xs",style:{color:t.color},children:t.label})]})}function KPt(){const{viewMode:e}=_n();return C.jsxs("div",{className:"pixel-theme h-full w-full flex flex-col overflow-hidden",style:{background:"var(--pixel-bg)"},children:[C.jsxs("header",{className:"h-14 flex items-center justify-between px-4 pixel-hud shrink-0 relative z-50",children:[C.jsxs("div",{className:"flex items-center gap-4",children:[C.jsx("h1",{className:"pixel-text-lg",style:{color:"var(--pixel-gold)"},children:"CAM"}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:"CLAUDE AGENT MONITOR"}),C.jsx($Pt,{})]}),C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx(RX,{}),C.jsx(YPt,{})]})]}),C.jsx(xPt,{}),C.jsx(IK,{}),C.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[e==="agents"&&C.jsx(QPt,{}),e==="tracker"&&C.jsx(ZPt,{})]})]})}function QPt(){return C.jsxs(C.Fragment,{children:[C.jsx("aside",{className:"w-48 overflow-y-auto pixel-scrollbar shrink-0",style:{borderRight:"3px solid var(--pixel-border)"},children:C.jsx(APt,{})}),C.jsx("main",{className:"flex-1 overflow-hidden",children:C.jsx(MK,{})}),C.jsx("aside",{className:"w-72 pixel-scrollbar shrink-0",style:{borderLeft:"3px solid var(--pixel-border)"},children:C.jsx(RK,{AgentDetail:NPt,ActivityFeed:OPt,FileWatcher:LPt,tabBarClass:"flex border-b-[3px] border-[var(--pixel-border)] bg-[var(--pixel-surface)]",activeTabClass:"text-[var(--pixel-gold)]",inactiveTabClass:"text-[var(--pixel-text-muted)] hover:text-[var(--pixel-text)]",panelClass:"flex-1 overflow-y-auto pixel-scrollbar"})})]})}function ZPt(){const{selectedTaskId:e}=_n();return C.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[C.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[C.jsx("main",{className:"flex-1 overflow-hidden",children:C.jsx(zPt,{})}),e&&C.jsx("aside",{className:"w-80 overflow-y-auto pixel-scrollbar shrink-0",style:{borderLeft:"3px solid var(--pixel-border)"},children:C.jsx(EK,{})}),C.jsxs("aside",{className:"w-80 overflow-y-auto pixel-scrollbar shrink-0 flex flex-col",style:{borderLeft:"3px solid var(--pixel-border)"},children:[C.jsx(UPt,{}),C.jsx(jPt,{}),C.jsx(XPt,{})]})]}),C.jsx("div",{className:"h-48 overflow-y-auto pixel-scrollbar shrink-0",style:{borderTop:"3px solid var(--pixel-border)"},children:C.jsx(FPt,{})})]})}function JPt({agentCount:e,hasNewEvents:t}){return e===0?null:C.jsx(p0,{children:C.jsxs(rc.div,{className:"flex items-center gap-1",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},children:[C.jsxs("span",{className:"relative flex h-2 w-2",children:[C.jsx("span",{className:`absolute inline-flex h-full w-full rounded-full bg-cam-success opacity-75 ${t?"animate-ping":"animate-pulse"}`}),C.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-cam-success"})]}),C.jsx(rc.span,{className:"flex items-center justify-center min-w-[16px] h-4 px-1 rounded-full bg-cam-accent/20 text-cam-accent text-[10px] font-bold leading-none",initial:{scale:1.3},animate:{scale:1},transition:{type:"spring",stiffness:400,damping:15},children:e},e)]})})}function eDt({open:e,title:t,message:i,confirmLabel:r="Delete",cancelLabel:n="Cancel",onConfirm:a,onCancel:s}){return ee.useEffect(()=>{if(!e)return;const o=l=>{l.key==="Escape"&&s()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[e,s]),C.jsx(p0,{children:e&&C.jsxs(rc.div,{className:"fixed inset-0 z-50 flex items-center justify-center",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:[C.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:s}),C.jsxs(rc.div,{className:"relative bg-cam-surface border border-cam-border rounded-lg shadow-xl p-6 max-w-sm w-full mx-4",initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},transition:{duration:.15},children:[C.jsx("h3",{className:"text-sm font-semibold text-cam-text mb-2",children:t}),C.jsx("p",{className:"text-xs text-cam-text-muted mb-6",children:i}),C.jsxs("div",{className:"flex justify-end gap-2",children:[C.jsx("button",{onClick:s,className:"px-3 py-1.5 text-xs rounded-md text-cam-text-muted hover:text-cam-text hover:bg-cam-surface-2 transition-colors",children:n}),C.jsx("button",{onClick:a,className:"px-3 py-1.5 text-xs rounded-md bg-red-600 text-white hover:bg-red-700 transition-colors",children:r})]})]})]})})}function tDt(e){let t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((t<<5)-t);return`hsl(${Math.abs(t%360)}, 65%, 55%)`}function iDt(e){return e.totalTasks===0?0:Math.round(e.completedTasks/e.totalTasks*100)}function rDt(e){switch(e){case"pixel":return{background:"var(--pixel-bg-dark, #0f0f1e)",borderRight:"3px solid var(--pixel-border, #444477)",fontFamily:"'Press Start 2P', monospace",imageRendering:"pixelated"};case"terminal":return{background:"#0a0a0a",borderRight:"1px solid #1a3a1a",fontFamily:"'JetBrains Mono', 'Fira Code', monospace"};default:return{}}}function nDt(e){switch(e){case"pixel":case"terminal":return"flex flex-col h-full shrink-0 select-none";case"modern":default:return"flex flex-col h-full bg-cam-surface border-r border-cam-border/50 shrink-0 select-none"}}function aDt(e){switch(e){case"pixel":return{borderBottom:"3px solid var(--pixel-border, #444477)",background:"var(--pixel-surface, #222244)"};case"terminal":return{borderBottom:"1px solid #1a3a1a"};default:return{}}}function sDt(e){switch(e){case"pixel":case"terminal":return"flex items-center justify-between h-12 px-3 shrink-0";case"modern":default:return"flex items-center justify-between h-12 px-3 border-b border-cam-border/50 shrink-0"}}function oDt(e){switch(e){case"pixel":return{fontSize:"7px",lineHeight:"12px",color:"var(--pixel-gold, #ffd700)"};case"terminal":return{fontSize:"11px",color:"#00ff00",textShadow:"0 0 4px rgba(0,255,0,0.4)"};default:return{}}}function lDt(e){switch(e){case"pixel":case"terminal":return"whitespace-nowrap overflow-hidden";case"modern":default:return"text-xs font-semibold text-cam-text tracking-tight whitespace-nowrap overflow-hidden"}}function cDt(e){switch(e){case"pixel":return"PROJECTS";case"terminal":return"[PROJECTS]";default:return"Projects"}}function uDt(e){switch(e){case"pixel":return"p-1.5 pixel-btn";case"terminal":return"p-1.5";case"modern":default:return"p-1.5 rounded-md text-cam-text-muted hover:text-cam-text hover:bg-cam-surface-2 transition-colors"}}function hDt(e){switch(e){case"pixel":return{color:"var(--pixel-text, #e8e8ff)"};case"terminal":return{color:"#00aa00"};default:return{}}}function dDt(e){switch(e){case"pixel":return"flex-1 overflow-y-auto overflow-x-hidden py-1 space-y-0.5 px-1 pixel-scrollbar";case"terminal":return"flex-1 overflow-y-auto overflow-x-hidden py-1 space-y-0 px-1 terminal-scrollbar";case"modern":default:return"flex-1 overflow-y-auto overflow-x-hidden py-2 space-y-0.5 px-2"}}function fDt(e){switch(e){case"pixel":case"terminal":return"shrink-0 p-2";case"modern":default:return"shrink-0 border-t border-cam-border/50 p-2"}}function pDt(e){switch(e){case"pixel":return{borderTop:"3px solid var(--pixel-border, #444477)"};case"terminal":return{borderTop:"1px solid #1a3a1a"};default:return{}}}function mDt(e,t){const i=t?"justify-center p-2":"px-3 py-2";switch(e){case"pixel":return`flex items-center gap-2 w-full pixel-btn ${i}`;case"terminal":return`flex items-center gap-2 w-full ${i}`;case"modern":default:return`flex items-center gap-2 w-full rounded-md text-cam-text-muted hover:text-cam-text hover:bg-cam-surface-2 transition-colors ${i}`}}function gDt(e){switch(e){case"pixel":return{color:"var(--pixel-text-muted, #8888bb)"};case"terminal":return{color:"#00aa00",fontSize:"11px"};default:return{}}}function vDt(e){switch(e){case"terminal":return"> config";default:return"Settings"}}function yDt(e){switch(e){case"pixel":return"whitespace-nowrap overflow-hidden";case"terminal":return"whitespace-nowrap overflow-hidden";case"modern":default:return"text-xs whitespace-nowrap overflow-hidden"}}function xDt(e){switch(e){case"pixel":return{fontSize:"6px",lineHeight:"10px"};case"terminal":return{fontSize:"11px"};default:return{}}}function bDt(e){switch(e){case"pixel":return"text-center px-2 py-4";case"terminal":return"text-center px-2 py-4";case"modern":default:return"text-[10px] text-cam-text-muted text-center px-2 py-4"}}function wDt(e){switch(e){case"pixel":return{fontSize:"6px",lineHeight:"12px",color:"var(--pixel-text-muted, #8888bb)"};case"terminal":return{fontSize:"10px",color:"#00aa00"};default:return{}}}function _Dt({collapsed:e,onToggleCollapse:t,onOpenSettings:i}){const{projects:r,activeProject:n,setActiveProject:a,removeProject:s}=_n(),o=Ni(S=>S.agents),l=Ni(S=>S.events),c=Di(S=>S.theme),[u,h]=ee.useState(null),d=ee.useCallback(async()=>{if(u){try{await YEe(u.id),s(u.id)}catch{}h(null)}},[u,s]),f=ee.useMemo(()=>[...r].sort((S,M)=>S.status==="active"&&M.status!=="active"?-1:S.status!=="active"&&M.status==="active"?1:new Date(M.updatedAt).getTime()-new Date(S.updatedAt).getTime()),[r]),m=Ni(S=>S.projectId);function y(S){a(S)}const g=ee.useMemo(()=>{if(l.length===0)return!1;const S=l[0];return S!=null&&S.timestamp?Date.now()-new Date(S.timestamp).getTime()<5e3:!1},[l]),x=c==="terminal"?C.jsx("span",{style:{fontSize:"11px",color:"#00aa00"},children:e?">":"<"}):c==="pixel"?C.jsx("span",{style:{fontSize:"8px",fontFamily:"'Press Start 2P', monospace"},children:e?"▶":"◀"}):C.jsx("svg",{className:`w-4 h-4 transition-transform duration-200 ${e?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),w=c==="terminal"?C.jsx("span",{style:{fontSize:"11px",color:"#00aa00"},children:"[*]"}):c==="pixel"?C.jsx("span",{style:{fontSize:"8px",fontFamily:"'Press Start 2P', monospace",color:"var(--pixel-text-muted)"},children:"⚙"}):C.jsxs("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 010 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 010-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28z"}),C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]});return C.jsxs(rc.aside,{className:nDt(c),style:rDt(c),animate:{width:e?56:224},transition:{duration:.2,ease:"easeInOut"},children:[C.jsxs("div",{className:sDt(c),style:aDt(c),children:[C.jsx(p0,{mode:"wait",children:!e&&C.jsx(rc.span,{className:lDt(c),style:oDt(c),initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},transition:{duration:.15},children:cDt(c)},"logo-text")}),C.jsx("button",{onClick:t,className:uDt(c),style:hDt(c),title:e?"Expand sidebar":"Collapse sidebar",children:x})]}),C.jsxs("nav",{className:dDt(c),children:[f.length===0&&!e&&C.jsx("p",{className:bDt(c),style:wDt(c),children:c==="terminal"?"> no projects. run: cam init":C.jsxs(C.Fragment,{children:["No registered projects. Use ",C.jsx("code",{className:"text-cam-accent",children:"cam init"})," to get started."]})}),f.map(S=>{const M=(n==null?void 0:n.id)===S.id,E=m===S.id,T=E?o.length:0,R=tDt(S.name),P=iDt(S);return C.jsx(SDt,{project:S,isActive:M,collapsed:e,color:R,completionPct:P,agentCount:T,hasNewEvents:E&&g,onSelect:y,onDelete:h,theme:c},S.id)})]}),C.jsx("div",{className:fDt(c),style:pDt(c),children:C.jsxs("button",{onClick:i,className:mDt(c,e),style:gDt(c),title:"Settings",children:[w,C.jsx(p0,{mode:"wait",children:!e&&C.jsx(rc.span,{className:yDt(c),style:xDt(c),initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},transition:{duration:.15},children:vDt(c)},"settings-label")})]})}),C.jsx(eDt,{open:u!==null,title:"Delete project",message:`Are you sure you want to delete "${(u==null?void 0:u.name)??""}"? All sprints and tasks will be permanently removed. This action cannot be undone.`,onConfirm:d,onCancel:()=>h(null)})]})}function SDt({project:e,isActive:t,collapsed:i,color:r,completionPct:n,agentCount:a,hasNewEvents:s,onSelect:o,onDelete:l,theme:c}){const u=e.name.charAt(0).toUpperCase(),h=e.status==="active";if(i){const d=c==="pixel"?`relative flex items-center justify-center w-full p-2 ${t?"pixel-border-accent":"pixel-btn"}`:c==="terminal"?`relative flex items-center justify-center w-full p-2 ${t?"bg-[#0a1f0a] border border-[#00ff00]":"hover:bg-[#0a1f0a] border border-transparent"}`:`relative flex items-center justify-center w-full rounded-md p-2 transition-colors ${t?"bg-cam-accent/10 ring-1 ring-cam-accent/40":"hover:bg-cam-surface-2"}`,f=c==="pixel"?{backgroundColor:r,imageRendering:"pixelated",borderRadius:0,border:"2px solid var(--pixel-border)"}:c==="terminal"?{backgroundColor:"transparent",color:"#00ff00",border:"1px solid #00aa00",borderRadius:0,fontFamily:"monospace",fontSize:"12px"}:{backgroundColor:r};return C.jsxs(rc.button,{onClick:()=>o(e),className:d,title:`${e.name} (${n}%)`,whileHover:{scale:c==="pixel"?1:1.05},whileTap:{scale:c==="pixel"?1:.95},children:[C.jsx("div",{className:`w-8 h-8 flex items-center justify-center text-xs font-bold text-white shrink-0 ${c==="modern"?"rounded-full":""}`,style:f,children:u}),a>0&&C.jsx("span",{className:"absolute top-1 right-1",children:C.jsx("span",{className:"relative flex h-2 w-2",children:c==="terminal"?C.jsx("span",{className:"relative inline-flex h-2 w-2",style:{background:"#00ff00",borderRadius:0}}):C.jsxs(C.Fragment,{children:[C.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-cam-success opacity-75 animate-ping"}),C.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-cam-success"})]})})})]})}return c==="terminal"?C.jsxs("button",{onClick:()=>o(e),className:`relative w-full text-left px-2 py-1.5 transition-colors ${t?"bg-[#0a1f0a]":"hover:bg-[#0a1f0a]"}`,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",borderLeft:t?"2px solid #00ff00":"2px solid transparent"},children:[C.jsxs("div",{className:"flex items-center gap-1.5",children:[C.jsx("span",{style:{color:t?"#00ff00":"#00aa00"},children:t?">":" "}),C.jsx("span",{style:{color:"#00aa00"},children:"[DIR]"}),C.jsx("span",{className:"truncate",style:{color:t?"#00ff00":"#00aa00",textShadow:t?"0 0 4px rgba(0,255,0,0.4)":"none"},children:e.name}),a>0&&C.jsxs("span",{style:{color:"#00ff00",fontSize:"10px"},children:["[",a,"]"]})]}),C.jsxs("div",{className:"flex items-center gap-1 mt-0.5 ml-4",children:[C.jsxs("span",{style:{color:"#006600",fontSize:"10px"},children:[e.completedTasks,"/",e.totalTasks]}),C.jsxs("span",{style:{color:"#006600",fontSize:"10px"},children:["[","█".repeat(Math.round(n/10)),"░".repeat(10-Math.round(n/10)),"] ",n,"%"]})]}),C.jsx("span",{onClick:d=>{d.stopPropagation(),l(e)},className:"absolute right-1 top-1/2 -translate-y-1/2 opacity-0 hover:opacity-100 transition-opacity",style:{color:"#aa0000",fontSize:"10px",cursor:"pointer"},title:"Delete project",children:"[DEL]"})]}):c==="pixel"?C.jsxs("button",{onClick:()=>o(e),className:`relative w-full text-left p-2 ${t?"pixel-border-accent":"pixel-btn"}`,style:{fontFamily:"'Press Start 2P', monospace"},children:[C.jsxs("div",{className:"flex items-start gap-2",children:[C.jsx("div",{className:"w-6 h-6 flex items-center justify-center shrink-0 mt-0.5",style:{backgroundColor:r,border:"2px solid var(--pixel-border)",imageRendering:"pixelated",fontSize:"7px",color:"#fff",fontWeight:"bold"},children:u}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("span",{style:{width:"4px",height:"4px",display:"inline-block",background:h?"var(--pixel-green)":"var(--pixel-text-muted)"}}),C.jsx("span",{className:"truncate",style:{fontSize:"6px",lineHeight:"10px",color:t?"var(--pixel-gold)":"var(--pixel-text)"},children:e.name.toUpperCase()})]}),C.jsxs("div",{className:"flex items-center justify-between mt-1",children:[C.jsxs("span",{style:{fontSize:"6px",color:"var(--pixel-text-muted)"},children:[e.completedTasks,"/",e.totalTasks]}),C.jsxs("span",{style:{fontSize:"6px",color:"var(--pixel-text-muted)"},children:[n,"%"]})]}),C.jsx("div",{className:"w-full mt-1 pixel-bar-container",style:{height:"6px"},children:C.jsx("div",{className:"pixel-bar-fill",style:{width:`${n}%`,background:t?"var(--pixel-gold)":"var(--pixel-green)",transition:"width 0.3s steps(8)"}})})]}),a>0&&C.jsx("div",{className:"shrink-0 mt-0.5",children:C.jsx("span",{className:"pixel-pulse",style:{display:"inline-block",width:"6px",height:"6px",background:"var(--pixel-green)",boxShadow:"0 0 4px var(--pixel-green)"}})})]}),C.jsx("span",{onClick:d=>{d.stopPropagation(),l(e)},className:"absolute right-1 top-1 opacity-0 hover:opacity-100 transition-opacity",style:{fontSize:"6px",color:"#ff4444",cursor:"pointer",fontFamily:"'Press Start 2P', monospace"},title:"Delete project",children:"X"})]}):C.jsxs(rc.div,{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),o(e))},className:`relative w-full text-left rounded-lg p-2.5 transition-all duration-150 group cursor-pointer ${t?"bg-cam-accent/10 border-l-2 border-cam-accent":"border-l-2 border-transparent hover:bg-cam-surface-2"}`,whileTap:{scale:.98},children:[C.jsxs("div",{className:"flex items-start gap-2.5",children:[C.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-[10px] font-bold text-white shrink-0 mt-0.5",style:{backgroundColor:r},children:u}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsxs("div",{className:"flex items-center gap-1.5",children:[C.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${h?"bg-cam-success":"bg-cam-text-muted"}`}),C.jsx("span",{className:"text-xs font-medium text-cam-text truncate",children:e.name})]}),C.jsxs("div",{className:"flex items-center justify-between mt-1.5",children:[C.jsxs("span",{className:"text-[10px] text-cam-text-muted font-mono",children:[e.completedTasks,"/",e.totalTasks]}),C.jsx("span",{className:"text-[10px] text-cam-text-muted",children:Npe(e.completedTasks,e.totalTasks)})]}),C.jsx("div",{className:"w-full h-1 bg-cam-surface-3 rounded-full overflow-hidden mt-1",children:C.jsx(rc.div,{className:"h-full bg-cam-accent rounded-full",initial:!1,animate:{width:`${n}%`},transition:{duration:.4,ease:"easeOut"}})})]}),a>0&&C.jsx("div",{className:"shrink-0 mt-0.5",children:C.jsx(JPt,{agentCount:a,hasNewEvents:s})})]}),C.jsx("button",{onClick:d=>{d.stopPropagation(),l(e)},className:"absolute top-1.5 right-1.5 p-1 rounded-md text-cam-text-muted hover:text-red-500 hover:bg-red-500/10 opacity-0 group-hover:opacity-100 transition-all",title:"Delete project",children:C.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})}const ADt=[{value:"modern",label:"Modern",description:"Clean and minimalist interface"},{value:"pixel",label:"Pixel",description:"Retro pixel art style"},{value:"terminal",label:"Terminal",description:"Hacker console style"}],Tpe=[{value:"#3b82f6",label:"Blue"},{value:"#ef4444",label:"Red"},{value:"#22c55e",label:"Green"},{value:"#f59e0b",label:"Amber"},{value:"#8b5cf6",label:"Purple"},{value:"#ec4899",label:"Pink"},{value:"#06b6d4",label:"Cyan"},{value:"#f97316",label:"Orange"}],Cpe=/^#[0-9a-fA-F]{6}$/;function MDt(){const e=Di(u=>u.theme),t=Di(u=>u.accentColor),i=Di(u=>u.setTheme),r=Di(u=>u.setAccentColor),[n,a]=ee.useState(Tpe.some(u=>u.value===t)?"":t),[s,o]=ee.useState(!1),l=u=>{if(a(u),o(!1),u==="")return;const h=u.startsWith("#")?u:`#${u}`;Cpe.test(h)?(r(h),o(!1)):h.length>=7&&o(!0)},c=u=>{r(u),a(""),o(!1)};return C.jsxs("div",{className:"space-y-6",children:[C.jsxs("section",{children:[C.jsx("h3",{className:"text-sm font-medium text-cam-text mb-3",children:"Theme"}),C.jsx("div",{className:"grid grid-cols-3 gap-2",children:ADt.map(u=>C.jsxs("button",{onClick:()=>i(u.value),className:`flex flex-col items-center gap-1.5 p-3 rounded-lg border transition-all ${e===u.value?"border-cam-accent bg-cam-accent/10 ring-1 ring-cam-accent/30":"border-cam-border hover:border-cam-border-hover bg-cam-surface-2"}`,children:[C.jsx("div",{className:`w-full h-8 rounded-md ${u.value==="modern"?"bg-gradient-to-br from-cam-surface-3 to-cam-bg":u.value==="pixel"?"bg-[#1a1a2e] border border-[#533483]":"bg-black border border-[#1a3a1a]"}`,children:C.jsx("div",{className:`w-3 h-1.5 mt-1.5 ml-1.5 rounded-sm ${u.value==="modern"?"bg-cam-accent":u.value==="pixel"?"bg-[#e94560]":"bg-[#00ff00]"}`})}),C.jsx("span",{className:`text-xs font-medium ${e===u.value?"text-cam-accent":"text-cam-text-secondary"}`,children:u.label}),C.jsx("span",{className:"text-[10px] text-cam-text-muted leading-tight text-center",children:u.description})]},u.value))})]}),C.jsxs("section",{children:[C.jsx("h3",{className:"text-sm font-medium text-cam-text mb-3",children:"Accent color"}),C.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:Tpe.map(u=>C.jsx("button",{onClick:()=>c(u.value),className:`w-8 h-8 rounded-full border-2 transition-all ${t===u.value?"border-white ring-2 ring-offset-2 ring-offset-cam-surface scale-110":"border-transparent hover:scale-105"}`,style:{backgroundColor:u.value},title:u.label,"aria-label":`Color ${u.label}`},u.value))}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("label",{className:"text-xs text-cam-text-muted shrink-0",children:"Custom color:"}),C.jsx("div",{className:"relative flex-1",children:C.jsx("input",{type:"text",value:n,onChange:u=>l(u.target.value),placeholder:"#RRGGBB",maxLength:7,className:`w-full px-3 py-1.5 text-xs rounded-md border bg-cam-surface-2 text-cam-text placeholder:text-cam-text-muted focus:outline-none focus:ring-1 ${s?"border-cam-error focus:ring-cam-error":"border-cam-border focus:ring-cam-accent"}`})}),n&&!s&&Cpe.test(n)&&C.jsx("div",{className:"w-6 h-6 rounded-md border border-cam-border shrink-0",style:{backgroundColor:n}})]}),s&&C.jsx("p",{className:"text-[10px] text-cam-error mt-1",children:"Invalid format. Use #RRGGBB (e.g. #ff5500)"})]})]})}const EDt=[{value:6e4,label:"1 minute"},{value:18e4,label:"3 minutes"},{value:3e5,label:"5 minutes"},{value:6e5,label:"10 minutes"}];function Ppe({checked:e,onChange:t,label:i}){return C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("span",{className:"text-xs text-cam-text-secondary",children:i}),C.jsx("button",{role:"switch","aria-checked":e,onClick:t,className:`relative w-9 h-5 rounded-full transition-colors shrink-0 ${e?"bg-cam-accent":"bg-cam-surface-3 border border-cam-border"}`,children:C.jsx("div",{className:`absolute top-0.5 w-4 h-4 rounded-full bg-white shadow-sm transition-transform ${e?"translate-x-[18px]":"translate-x-0.5"}`})})]})}function TDt(){const e=Di(l=>l.showLabels),t=Di(l=>l.showInteractions),i=Di(l=>l.displayMode),r=Di(l=>l.activityWindow),n=Di(l=>l.toggleLabels),a=Di(l=>l.toggleInteractions),s=Di(l=>l.setDisplayMode),o=Di(l=>l.setActivityWindow);return C.jsxs("div",{className:"space-y-6",children:[C.jsxs("section",{children:[C.jsx(Ppe,{checked:e,onChange:n,label:"Show activity labels"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1.5 ml-0.5",children:"Displays the tool/action name above each agent on the map."})]}),C.jsxs("section",{children:[C.jsx(Ppe,{checked:t,onChange:a,label:"Show communication lines"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1.5 ml-0.5",children:"Draws lines connecting agents that communicate with each other."})]}),C.jsxs("section",{children:[C.jsx("h3",{className:"text-sm font-medium text-cam-text mb-3",children:"Speech bubbles"}),C.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{value:"technical",label:"Technical",description:"Shows function/tool being executed"},{value:"didactic",label:"Didactic",description:"Shows friendly explanation"}].map(l=>C.jsxs("button",{onClick:()=>s(l.value),className:`flex items-center gap-2.5 p-2.5 rounded-lg border transition-all ${i===l.value?"border-cam-accent bg-cam-accent/10 ring-1 ring-cam-accent/30":"border-cam-border hover:border-cam-border-hover bg-cam-surface-2"}`,children:[C.jsx("div",{className:`w-4 h-4 rounded-full border-2 flex items-center justify-center shrink-0 ${i===l.value?"border-cam-accent":"border-cam-text-muted"}`,children:i===l.value&&C.jsx("div",{className:"w-2 h-2 rounded-full bg-cam-accent"})}),C.jsxs("div",{className:"text-left",children:[C.jsx("span",{className:`text-xs font-medium block ${i===l.value?"text-cam-accent":"text-cam-text-secondary"}`,children:l.label}),C.jsx("span",{className:"text-[10px] text-cam-text-muted leading-tight",children:l.description})]})]},l.value))})]}),C.jsxs("section",{children:[C.jsx("h3",{className:"text-sm font-medium text-cam-text mb-3",children:"Activity window"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mb-2",children:"Maximum time to consider an agent as active."}),C.jsx("select",{value:r,onChange:l=>o(Number(l.target.value)),className:"w-full px-3 py-2 text-xs rounded-md border border-cam-border bg-cam-surface-2 text-cam-text focus:outline-none focus:ring-1 focus:ring-cam-accent appearance-none cursor-pointer",children:EDt.map(l=>C.jsx("option",{value:l.value,children:l.label},l.value))})]})]})}function wG({checked:e,onChange:t,label:i}){return C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("span",{className:"text-xs text-cam-text-secondary",children:i}),C.jsx("button",{role:"switch","aria-checked":e,onClick:t,className:`relative w-9 h-5 rounded-full transition-colors shrink-0 ${e?"bg-cam-accent":"bg-cam-surface-3 border border-cam-border"}`,children:C.jsx("div",{className:`absolute top-0.5 w-4 h-4 rounded-full bg-white shadow-sm transition-transform ${e?"translate-x-[18px]":"translate-x-0.5"}`})})]})}function CDt(){const e=Di(f=>f.followMode),t=Di(f=>f.hidePolling),i=Di(f=>f.pollingTools),r=Di(f=>f.groupRepetitive),n=Di(f=>f.toggleFollowMode),a=Di(f=>f.toggleHidePolling),s=Di(f=>f.toggleGroupRepetitive),o=Di(f=>f.addPollingTool),l=Di(f=>f.removePollingTool),[c,u]=ee.useState(""),h=()=>{const f=c.trim();f!==""&&(o(f),u(""))},d=f=>{f.key==="Enter"&&(f.preventDefault(),h())};return C.jsxs("div",{className:"space-y-6",children:[C.jsxs("section",{children:[C.jsx(wG,{checked:e,onChange:n,label:"Auto-scroll to recent events"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1.5 ml-0.5",children:"Automatically scrolls the feed to show new events."})]}),C.jsxs("section",{children:[C.jsx(wG,{checked:t,onChange:a,label:"Hide repetitive tools"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1.5 ml-0.5",children:"Hides events from tools that do constant polling."})]}),C.jsxs("section",{children:[C.jsx("h3",{className:"text-sm font-medium text-cam-text mb-3",children:"Polling tools"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mb-2",children:'Tools that will be hidden when "Hide repetitive tools" is active.'}),C.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-3 min-h-[28px]",children:[i.map(f=>C.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-[11px] rounded-md bg-cam-surface-3 text-cam-text-secondary border border-cam-border",children:[f,C.jsx("button",{onClick:()=>l(f),className:"text-cam-text-muted hover:text-cam-error transition-colors ml-0.5","aria-label":`Remove ${f}`,children:C.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[C.jsx("line",{x1:"2",y1:"2",x2:"8",y2:"8"}),C.jsx("line",{x1:"8",y1:"2",x2:"2",y2:"8"})]})})]},f)),i.length===0&&C.jsx("span",{className:"text-[10px] text-cam-text-muted italic",children:"No tools configured"})]}),C.jsxs("div",{className:"flex gap-2",children:[C.jsx("input",{type:"text",value:c,onChange:f=>u(f.target.value),onKeyDown:d,placeholder:"Tool name...",className:"flex-1 px-3 py-1.5 text-xs rounded-md border border-cam-border bg-cam-surface-2 text-cam-text placeholder:text-cam-text-muted focus:outline-none focus:ring-1 focus:ring-cam-accent"}),C.jsx("button",{onClick:h,disabled:c.trim()==="",className:"px-3 py-1.5 text-xs font-medium rounded-md bg-cam-accent text-white hover:bg-cam-accent-hover disabled:opacity-40 disabled:cursor-not-allowed transition-colors shrink-0",children:"Add"})]})]}),C.jsxs("section",{children:[C.jsx(wG,{checked:r,onChange:s,label:"Agrupar eventos repetitivos consecutivos"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1.5 ml-0.5",children:"Eventos identicos consecutivos sao agrupados com contador."})]})]})}function PDt({checked:e,onChange:t,label:i}){return C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("span",{className:"text-xs text-cam-text-secondary",children:i}),C.jsx("button",{role:"switch","aria-checked":e,onClick:t,className:`relative w-9 h-5 rounded-full transition-colors shrink-0 ${e?"bg-cam-accent":"bg-cam-surface-3 border border-cam-border"}`,children:C.jsx("div",{className:`absolute top-0.5 w-4 h-4 rounded-full bg-white shadow-sm transition-transform ${e?"translate-x-[18px]":"translate-x-0.5"}`})})]})}function _G({value:e,onChange:t,min:i,max:r,label:n,suffix:a}){const s=c=>{const u=parseInt(c.target.value,10);if(Number.isNaN(u))return;const h=Math.min(r,Math.max(i,u));t(h)},o=()=>{e<r&&t(e+1)},l=()=>{e>i&&t(e-1)};return C.jsxs("div",{children:[C.jsx("label",{className:"text-xs text-cam-text-secondary block mb-1.5",children:n}),C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("button",{onClick:l,disabled:e<=i,className:"w-7 h-7 flex items-center justify-center rounded-md border border-cam-border bg-cam-surface-2 text-cam-text-secondary hover:text-cam-text hover:bg-cam-surface-3 disabled:opacity-30 disabled:cursor-not-allowed transition-colors text-sm font-mono","aria-label":"Decrease",children:"-"}),C.jsx("input",{type:"number",value:e,onChange:s,min:i,max:r,className:"w-20 px-2 py-1 text-xs text-center rounded-md border border-cam-border bg-cam-surface-2 text-cam-text focus:outline-none focus:ring-1 focus:ring-cam-accent [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"}),C.jsx("button",{onClick:o,disabled:e>=r,className:"w-7 h-7 flex items-center justify-center rounded-md border border-cam-border bg-cam-surface-2 text-cam-text-secondary hover:text-cam-text hover:bg-cam-surface-3 disabled:opacity-30 disabled:cursor-not-allowed transition-colors text-sm font-mono","aria-label":"Increase",children:"+"}),a&&C.jsx("span",{className:"text-[10px] text-cam-text-muted ml-1",children:a})]}),C.jsxs("p",{className:"text-[10px] text-cam-text-muted mt-1",children:["Min: ",i," / Max: ",r]})]})}function DDt(){const e=Di(d=>d.maxEvents),t=Di(d=>d.speechBubbleTimeout),i=Di(d=>d.maxCommunicationLines),r=Di(d=>d.lockPanels),n=Di(d=>d.setMaxEvents),a=Di(d=>d.setSpeechBubbleTimeout),s=Di(d=>d.setMaxCommunicationLines),o=Di(d=>d.toggleLockPanels),l=Di(d=>d.resetToDefaults),[c,u]=ee.useState(!1),h=()=>{window.confirm("Are you sure you want to restore all settings to default values?")&&(l(),u(!0),setTimeout(()=>u(!1),2500))};return C.jsxs("div",{className:"space-y-6",children:[C.jsxs("section",{children:[C.jsx(_G,{value:e,onChange:n,min:100,max:1e4,label:"Maximum events in memory",suffix:"events"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1",children:"Maximum number of events kept in the dashboard. Higher values use more memory."})]}),C.jsxs("section",{children:[C.jsx(_G,{value:t,onChange:a,min:1,max:30,label:"Speech bubble timeout",suffix:"seconds"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1",children:"How long each speech bubble remains visible before disappearing."})]}),C.jsxs("section",{children:[C.jsx(_G,{value:i,onChange:s,min:1,max:20,label:"Maximum communication lines"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1",children:"Maximum number of interaction lines visible simultaneously on the Agent Map."})]}),C.jsxs("section",{children:[C.jsx(PDt,{checked:r,onChange:o,label:"Lock panel resizing"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-1.5 ml-0.5",children:"Prevents accidental resizing of dashboard panels."})]}),C.jsxs("section",{className:"pt-2 border-t border-cam-border",children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("div",{children:[C.jsx("h3",{className:"text-sm font-medium text-cam-text",children:"Restore Defaults"}),C.jsx("p",{className:"text-[10px] text-cam-text-muted mt-0.5",children:"Resets all settings to their original values."})]}),C.jsx("button",{onClick:h,className:"px-3 py-1.5 text-xs font-medium rounded-md border border-cam-error/50 text-cam-error hover:bg-cam-error/10 transition-colors shrink-0",children:"Restore Defaults"})]}),c&&C.jsx("div",{className:"mt-2 px-3 py-1.5 text-[11px] text-cam-success bg-cam-success/10 border border-cam-success/30 rounded-md",children:"Settings restored successfully!"})]})]})}const ODt=[{id:"appearance",label:"Appearance"},{id:"agent-map",label:"Agent Map"},{id:"activity-feed",label:"Activity Feed"},{id:"advanced",label:"Advanced"}],RDt={hidden:{opacity:0},visible:{opacity:1},exit:{opacity:0}},IDt={hidden:{opacity:0,scale:.95,y:20},visible:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20}};function NDt(e){switch(e){case"pixel":return"relative w-full max-w-lg mx-4 max-h-[85vh] flex flex-col";case"terminal":return"relative w-full max-w-lg mx-4 max-h-[85vh] flex flex-col";case"modern":default:return"relative w-full max-w-lg mx-4 max-h-[85vh] flex flex-col rounded-2xl shadow-2xl"}}function LDt(e){switch(e){case"pixel":return{background:"var(--pixel-bg-dark, #0f0f1e)",border:"4px solid var(--pixel-border, #444477)",boxShadow:"inset -4px -4px 0 rgba(0,0,0,0.4), inset 4px 4px 0 rgba(255,255,255,0.08), 0 0 0 2px #000, 8px 8px 0 rgba(0,0,0,0.5)",fontFamily:"'Press Start 2P', monospace",imageRendering:"pixelated"};case"terminal":return{background:"#0a0a0a",border:"1px solid #00aa00",boxShadow:"0 0 20px rgba(0,255,0,0.05), inset 0 0 60px rgba(0,255,0,0.02)",fontFamily:"'JetBrains Mono', 'Fira Code', monospace"};case"modern":default:return{background:"rgba(15, 15, 15, 0.85)",backdropFilter:"blur(24px)",WebkitBackdropFilter:"blur(24px)",border:"1px solid rgba(255,255,255,0.08)"}}}function kDt(e){switch(e){case"pixel":return"flex items-center justify-between px-4 py-3 shrink-0";case"terminal":return"flex items-center justify-between px-4 py-3 shrink-0";case"modern":default:return"flex items-center justify-between px-5 py-4 border-b border-white/5 shrink-0"}}function zDt(e){switch(e){case"pixel":return{borderBottom:"3px solid var(--pixel-border, #444477)",background:"var(--pixel-surface, #222244)"};case"terminal":return{borderBottom:"1px solid #1a3a1a"};default:return{}}}function BDt(e){switch(e){case"pixel":return C.jsx("span",{style:{fontSize:"8px",lineHeight:"14px",color:"var(--pixel-gold, #ffd700)"},children:"SETTINGS"});case"terminal":return C.jsxs("span",{style:{color:"#00ff00",textShadow:"0 0 4px rgba(0,255,0,0.4)",fontSize:"12px"},children:["> settings",C.jsx("span",{style:{animation:"terminal-cursor-blink 0.6s step-end infinite",color:"#00ff00"},children:"█"})]});case"modern":default:return C.jsx("span",{className:"text-base font-semibold text-cam-text",children:"Settings"})}}function UDt(e){switch(e){case"pixel":return"flex items-center justify-center w-7 h-7 pixel-btn";case"terminal":return"flex items-center justify-center w-7 h-7";case"modern":default:return"flex items-center justify-center w-7 h-7 rounded-md text-cam-text-muted hover:text-cam-text hover:bg-white/5 transition-colors"}}function jDt(e){switch(e){case"pixel":return{color:"var(--pixel-text, #e8e8ff)"};case"terminal":return{color:"#00aa00"};default:return{}}}function FDt(e){switch(e){case"pixel":return"flex gap-0 px-3 pt-2 pb-0 shrink-0 flex-wrap";case"terminal":return"flex gap-0 px-4 pt-2 pb-0 shrink-0";case"modern":default:return"flex gap-1 px-5 pt-3 pb-0 shrink-0"}}function VDt(e){switch(e){case"pixel":return{borderBottom:"3px solid var(--pixel-border, #444477)"};case"terminal":return{borderBottom:"1px solid #1a3a1a"};default:return{}}}function HDt(e,t){switch(e){case"pixel":return t?"pixel-btn-active px-2 py-1.5":"pixel-btn px-2 py-1.5";case"terminal":return`px-3 py-1.5 ${t?"":"hover:bg-[#0a1f0a]"}`;case"modern":default:return`px-3 py-1.5 text-xs font-medium rounded-md transition-colors ${t?"bg-cam-accent text-white":"text-cam-text-muted hover:text-cam-text hover:bg-white/5"}`}}function GDt(e,t){switch(e){case"pixel":return{fontSize:"6px",lineHeight:"10px",fontFamily:"'Press Start 2P', monospace"};case"terminal":return{fontSize:"11px",fontFamily:"'JetBrains Mono', monospace",color:t?"#00ff00":"#00aa00",textShadow:t?"0 0 4px rgba(0,255,0,0.4)":"none",borderBottom:t?"2px solid #00ff00":"2px solid transparent",background:"transparent"};default:return{}}}function WDt(e,t,i){return e==="terminal"?i?`> ${t}`:` ${t}`:e==="pixel"?t.toUpperCase():t}function qDt(e){switch(e){case"pixel":return"flex-1 overflow-y-auto px-4 py-3 pixel-scrollbar";case"terminal":return"flex-1 overflow-y-auto px-4 py-3 terminal-scrollbar";case"modern":default:return"flex-1 overflow-y-auto px-5 py-4 modern-scrollbar"}}function XDt({isOpen:e,onClose:t}){const[i,r]=ee.useState("appearance"),n=Di(c=>c.theme),a=ee.useCallback(c=>{c.key==="Escape"&&t()},[t]);ee.useEffect(()=>{if(e)return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,a]);const s=ee.useCallback(()=>{t()},[t]),o=ee.useCallback(c=>{c.stopPropagation()},[]),l=()=>{switch(i){case"appearance":return C.jsx(MDt,{});case"agent-map":return C.jsx(TDt,{});case"activity-feed":return C.jsx(CDt,{});case"advanced":return C.jsx(DDt,{})}};return C.jsx(p0,{children:e&&C.jsxs(rc.div,{className:"fixed inset-0 z-50 flex items-center justify-center",variants:RDt,initial:"hidden",animate:"visible",exit:"exit",transition:{duration:.2},onClick:s,children:[C.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),n==="terminal"&&C.jsx("div",{className:"absolute inset-0 pointer-events-none z-[51]",style:{background:"repeating-linear-gradient(0deg, rgba(0,0,0,0.15) 0px, rgba(0,0,0,0.15) 1px, transparent 1px, transparent 3px)"}}),C.jsxs(rc.div,{className:NDt(n),style:LDt(n),variants:IDt,initial:"hidden",animate:"visible",exit:"exit",transition:{duration:.25,ease:"easeOut"},onClick:o,children:[C.jsxs("header",{className:kDt(n),style:zDt(n),children:[C.jsx("h2",{children:BDt(n)}),C.jsx("button",{onClick:t,className:UDt(n),style:jDt(n),"aria-label":"Close",children:n==="terminal"?C.jsx("span",{style:{fontSize:"12px"},children:"[X]"}):n==="pixel"?C.jsx("span",{style:{fontSize:"8px",fontFamily:"'Press Start 2P', monospace"},children:"X"}):C.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[C.jsx("line",{x1:"1",y1:"1",x2:"13",y2:"13"}),C.jsx("line",{x1:"13",y1:"1",x2:"1",y2:"13"})]})})]}),C.jsx("nav",{className:FDt(n),style:VDt(n),children:ODt.map(c=>C.jsx("button",{onClick:()=>r(c.id),className:HDt(n,i===c.id),style:GDt(n,i===c.id),children:WDt(n,c.label,i===c.id)},c.id))}),C.jsx("main",{className:qDt(n),children:l()})]})]})})}function YDt(e){ee.useEffect(()=>{function t(i){for(const r of e){const n=r.ctrl?i.ctrlKey||i.metaKey:!0,a=r.alt?i.altKey:!0,s=r.shift?i.shiftKey:!0;if(i.key===r.key&&n&&a&&s){const o=i.target;if(o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable)return;i.preventDefault(),r.handler();return}}}return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e])}function $Dt(){const{theme:e}=$P(),t=Di(u=>u.toggleLockPanels),{settingsOpen:i,sidebarCollapsed:r,closeSettings:n,toggleSettings:a,toggleSidebar:s,openSettings:o}=jEe(),l=ee.useMemo(()=>[{key:",",ctrl:!0,handler:a,description:"Toggle settings modal"},{key:"l",ctrl:!0,handler:t,description:"Toggle panel lock"},{key:"b",ctrl:!0,handler:s,description:"Toggle sidebar"}],[t,a,s]);YDt(l);const c=(()=>{switch(e){case"terminal":return C.jsx(gPt,{});case"pixel":return C.jsx(KPt,{});case"modern":default:return C.jsx(jCt,{})}})();return C.jsxs("div",{className:"flex h-screen w-screen overflow-hidden",children:[C.jsx(_Dt,{collapsed:r,onToggleCollapse:s,onOpenSettings:o}),C.jsx("div",{className:"flex-1 overflow-hidden",children:c}),C.jsx(XDt,{isOpen:i,onClose:n})]})}let KDt=0;const NI=sg(e=>({toasts:[],addToast:t=>{const i=`toast-${++KDt}`,r={...t,id:i,createdAt:Date.now()};e(n=>({toasts:[...n.toasts,r].slice(-5)})),setTimeout(()=>{e(n=>({toasts:n.toasts.filter(a=>a.id!==i)}))},t.duration)},removeToast:t=>e(i=>({toasts:i.toasts.filter(r=>r.id!==t)})),clearAll:()=>e({toasts:[]})}));function Dpe({toast:e,onDismiss:t}){const i={info:"border-blue-500/50 bg-blue-500/10",success:"border-cam-success/50 bg-cam-success/10",warning:"border-amber-500/50 bg-amber-500/10",error:"border-cam-error/50 bg-cam-error/10"},r={info:"text-blue-400",success:"text-cam-success",warning:"text-amber-400",error:"text-cam-error"},n={info:"ℹ",success:"✓",warning:"⚠",error:"✗"};return C.jsxs("div",{className:`flex items-start gap-2 px-3 py-2 rounded-lg border backdrop-blur-sm ${i[e.type]} animate-slide-in-right`,style:{minWidth:"240px",maxWidth:"360px"},children:[C.jsx("span",{className:`text-sm mt-0.5 ${r[e.type]}`,children:n[e.type]}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsx("p",{className:"text-xs font-medium text-cam-text",children:e.title}),e.message&&C.jsx("p",{className:"text-xs text-cam-text-muted mt-0.5",children:e.message})]}),C.jsx("button",{onClick:t,className:"text-cam-text-muted hover:text-cam-text text-xs ml-1 shrink-0",children:"x"})]})}function QDt({toast:e,onDismiss:t}){const i={info:"var(--pixel-blue, #4488ff)",success:"var(--pixel-green)",warning:"var(--pixel-gold)",error:"var(--pixel-error)"},r={info:"◆",success:"★",warning:"!",error:"☠"};return C.jsx("div",{className:"pixel-border animate-slide-in-right",style:{background:"var(--pixel-panel)",borderColor:i[e.type],borderWidth:"2px",borderStyle:"solid",padding:"6px 10px",minWidth:"240px",maxWidth:"360px"},children:C.jsxs("div",{className:"flex items-start gap-2",children:[C.jsx("span",{className:"pixel-text-xs",style:{color:i[e.type]},children:r[e.type]}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsx("p",{className:"pixel-text-xs",style:{color:i[e.type]},children:e.title}),e.message&&C.jsx("p",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:e.message})]}),C.jsx("button",{onClick:t,className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)"},children:"x"})]})})}function ZDt({toast:e,onDismiss:t}){const r={info:{text:"[INFO]",color:"#00ff00"},success:{text:"[OK]",color:"#00ff00"},warning:{text:"[WARN]",color:"#ffaa00"},error:{text:"[ERR]",color:"#ff0000"}}[e.type];return C.jsxs("div",{className:"font-mono text-[11px] border border-[#1a3a1a] bg-[#0a0a0a] px-2 py-1 animate-slide-in-right",style:{minWidth:"240px",maxWidth:"360px"},children:[C.jsxs("div",{className:"flex items-start gap-1",children:[C.jsx("span",{style:{color:r.color},children:r.text}),C.jsx("span",{className:"text-[#00ff00] flex-1",children:e.title}),C.jsx("button",{onClick:t,className:"text-[#555] hover:text-[#00ff00]",children:"[x]"})]}),e.message&&C.jsx("div",{className:"text-[#00aa00] ml-7",children:e.message})]})}function JDt(){const{toasts:e,removeToast:t}=NI(),{theme:i}=$P();if(e.length===0)return null;const r={modern:Dpe,pixel:QDt,terminal:ZDt}[i]??Dpe;return C.jsx("div",{className:"fixed top-16 right-4 z-[100] flex flex-col gap-2",children:e.map(n=>C.jsx(r,{toast:n,onDismiss:()=>t(n.id)},n.id))})}function e3t(){return new URLSearchParams(window.location.search).has("session_id")}function t3t(){const{session:e,setSession:t,setProjectId:i}=Ni(),r=ee.useRef(!1),n=ee.useCallback(async()=>{if(!r.current){if(e3t()){r.current=!0;return}try{try{const{registrations:s}=await QEe();if(s.length>0){const o=s.find(c=>c.project_status==="active")||s[0];i(o.project_id);const{sessions:l}=await Y7(o.project_id);if(l.length>0){const u=l.find(d=>d.status==="active")||l[0],{session:h}=await gC(u.id);t(h),r.current=!0;return}return}}catch{}i(null);const{sessions:a}=await q7({limit:1});if(a.length>0){const{session:s}=await gC(a[0].id);t(s),r.current=!0}}catch{}}},[t,i]);return ee.useEffect(()=>{n();const a=setInterval(n,15e3);return()=>clearInterval(a)},[n]),{session:e,refreshSession:n}}class i3t{constructor(t){iE(this,"source",null);iE(this,"options");iE(this,"reconnectTimer",null);iE(this,"shouldReconnect",!0);this.options=t}connect(){this.source&&this.disconnect();const t=new URL(this.options.url,window.location.origin);this.options.projectId?t.searchParams.set("project_id",this.options.projectId):this.options.sessionId&&t.searchParams.set("session_id",this.options.sessionId),this.source=new EventSource(t.toString()),this.source.onopen=()=>{var i,r;(r=(i=this.options).onConnect)==null||r.call(i)},this.source.onerror=i=>{var r,n,a,s;(n=(r=this.options).onError)==null||n.call(r,i),(s=(a=this.options).onDisconnect)==null||s.call(a),this.shouldReconnect&&this.scheduleReconnect()},this.addListener("agent_event",this.options.onEvent),this.addListener("agent_status",this.options.onAgentStatus),this.addListener("session_status",this.options.onSessionStatus),this.addListener("task_status_changed",this.options.onTaskStatusChanged),this.addListener("task_assigned",this.options.onTaskAssigned),this.addListener("sprint_progress",this.options.onSprintProgress),this.addListener("project_progress",this.options.onProjectProgress),this.addListener("task_blocked",this.options.onTaskBlocked),this.addListener("task_unblocked",this.options.onTaskUnblocked),this.addListener("correlation_match",this.options.onCorrelationMatch),this.addListener("agent_created",this.options.onAgentCreated),this.addListener("team_created",this.options.onTeamCreated),this.addListener("heartbeat",this.options.onHeartbeat)}addListener(t,i){!this.source||!i||this.source.addEventListener(t,r=>{try{const n=JSON.parse(r.data);i(n)}catch{}})}scheduleReconnect(){this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=setTimeout(()=>{this.connect()},this.options.reconnectDelay??3e3)}disconnect(){this.shouldReconnect=!1,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.source&&(this.source.close(),this.source=null)}reconnect(){this.shouldReconnect=!0,this.connect()}}function r3t(e){const t=ee.useRef(null),i=Ni(d=>d.projectId),{addEvent:r,addAgent:n,updateAgent:a,setConnected:s,setConnectionStatus:o,setLastHeartbeat:l}=Ni(),{updateTask:c,updateActiveProject:u,updateActiveSprint:h}=_n();return ee.useEffect(()=>{if(!e){o("disconnected");return}const d=new i3t({url:"/api/stream",sessionId:e,projectId:i??void 0,onConnect:()=>{s(!0),o("connected")},onDisconnect:()=>{s(!1),o("reconnecting")},onEvent:f=>{f.sessionId&&f.sessionId!==e||(r(f),f.agentId&&n({id:f.agentId,sessionId:f.sessionId,name:f.agentId,type:"agent",status:"active",firstSeenAt:f.timestamp,lastActivityAt:f.timestamp,toolCallCount:0,errorCount:0}))},onAgentStatus:f=>{a(f.agent,{status:f.status}),(f.status==="shutdown"||f.status==="completed")&&NI.getState().addToast({type:"info",title:`Agent ${f.agent} finished`,duration:4e3})},onSessionStatus:f=>{const m=Ni.getState().session;f.status==="completed"||f.status==="error"?m&&(m.id===f.session||!f.session)&&(Ni.getState().setSession({...m,status:f.status,endedAt:new Date().toISOString()}),NI.getState().addToast({type:f.status==="completed"?"info":"error",title:f.status==="completed"?"Session ended":"Session ended with error",duration:5e3})):f.status==="active"&&m&&(m.id===f.session||!f.session)&&Ni.getState().setSession({...m,status:"active",endedAt:void 0})},onTaskStatusChanged:f=>{c(f.taskId,{status:f.newStatus})},onTaskAssigned:f=>{c(f.taskId,{assignedAgent:f.agent})},onSprintProgress:f=>{h({completedTasks:f.completedTasks,totalTasks:f.totalTasks})},onProjectProgress:f=>{u({completedTasks:f.completedTasks,totalTasks:f.totalTasks})},onTaskBlocked:f=>{c(f.taskId,{status:"blocked",blockedBy:f.blockedBy})},onTaskUnblocked:f=>{c(f.taskId,{status:"pending",blockedBy:[]})},onCorrelationMatch:()=>{},onAgentCreated:f=>{const m=f.name||f.agent;n({id:f.agent,sessionId:f.sessionId,name:m,type:f.type||"agent",status:f.status||"active",firstSeenAt:f.timestamp,lastActivityAt:f.timestamp,toolCallCount:0,errorCount:0}),NI.getState().addToast({type:"success",title:`Agent ${m} joined`,message:f.type?`Type: ${f.type}`:void 0,duration:4e3})},onTeamCreated:()=>{},onHeartbeat:f=>{l(f.timestamp)}});return d.connect(),t.current=d,()=>{d.disconnect(),t.current=null}},[e,i,r,n,a,s,o,l,c,u,h]),t.current}function n3t(){const{projects:e,activeProject:t,setProjects:i,setActiveProject:r}=_n(),n=ee.useRef(!1);return ee.useEffect(()=>{let a=!1;async function s(){try{const{projects:l}=await XEe();a||(i(l),!n.current&&l.length>0&&(_n.getState().activeProject||r(l[0]),n.current=!0))}catch{}}s();const o=setInterval(s,15e3);return()=>{a=!0,clearInterval(o)}},[i,r]),{projects:e,activeProject:t}}function a3t(){const{projects:e,activeProject:t,setActiveProject:i}=_n(),r=ee.useRef(!1);ee.useEffect(()=>{if(r.current||e.length===0)return;const a=new URLSearchParams(window.location.search).get("project_id");if(a){const s=e.find(o=>o.id===a);s&&i(s)}r.current=!0},[e,i]),ee.useEffect(()=>{if(t){const n=new URLSearchParams(window.location.search);n.get("project_id")!==t.id&&(n.set("project_id",t.id),window.history.replaceState({},"",`?${n.toString()}`))}},[t])}function s3t(){const{session:e,setSession:t}=Ni(),i=ee.useRef(!1);ee.useEffect(()=>{if(i.current)return;i.current=!0;const n=new URLSearchParams(window.location.search).get("session_id");n&&o3t(n)},[]),ee.useEffect(()=>{if(!e)return;const r=e.id.slice(0,8),n=new URLSearchParams(window.location.search);n.get("session_id")!==r&&(n.set("session_id",r),window.history.replaceState({},"",`?${n.toString()}`))},[e==null?void 0:e.id])}async function o3t(e){const{setSession:t}=Ni.getState();if(e.length>8)try{const{session:i}=await gC(e);if(i){t(i);return}}catch{}try{const{sessions:i}=await q7({limit:50}),r=i.find(n=>n.id.startsWith(e));if(r){const{session:n}=await gC(r.id);n&&t(n)}}catch{}}function l3t(){const e=Di(s=>s.theme),t=Di(s=>s.accentColor),i=Di(s=>s.activityWindow),r=Di(s=>s.showLabels),n=Di(s=>s.showInteractions),a=Di(s=>s.displayMode);ee.useEffect(()=>{const s=$P.getState();s.theme!==e&&s.setTheme(e),s.accentColor!==t&&s.setAccentColor(t)},[e,t]),ee.useEffect(()=>{const s=Ni.getState();s.activityWindow!==i&&s.setActivityWindow(i)},[i]),ee.useEffect(()=>{const s=C_.getState();s.showLabels!==r&&s.toggleLabels(),s.showInteractions!==n&&s.toggleInteractions(),s.displayMode!==a&&s.setDisplayMode(a)},[r,n,a])}function c3t(){const{session:e}=t3t();return r3t(e==null?void 0:e.id),n3t(),lz(),T0(),Dye(),a3t(),s3t(),l3t(),C.jsxs(C.Fragment,{children:[C.jsx($Dt,{}),C.jsx(JDt,{})]})}LEe.createRoot(document.getElementById("root")).render(C.jsx(ee.StrictMode,{children:C.jsx(c3t,{})}));export{Vv as c,En as g};
|
|
12445
|
+
//# sourceMappingURL=index-CPeO9TMq.js.map
|