@claudecam/dashboard 0.1.1 → 0.1.2

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.
@@ -46,7 +46,7 @@ var yEe=Object.defineProperty;var xEe=(e,t,i)=>t in e?yEe(e,t,{enumerable:!0,con
46
46
  `+Ie[D].replace(" at new "," at ");return f.displayName&&St.includes("<anonymous>")&&(St=St.replace("<anonymous>",f.displayName)),St}while(1<=D&&0<=k);break}}}finally{Re=!1,Error.prepareStackTrace=A}return(A=f?f.displayName||f.name:"")?Pe(A):""}function He(f,v){switch(f.tag){case 26:case 27:case 5:return Pe(f.type);case 16:return Pe("Lazy");case 13:return f.child!==v&&v!==null?Pe("Suspense Fallback"):Pe("Suspense");case 19:return Pe("SuspenseList");case 0:case 15:return Be(f.type,!1);case 11:return Be(f.type.render,!1);case 1:return Be(f.type,!0);case 31:return Pe("Activity");default:return""}}function he(f){try{var v="",A=null;do v+=He(f,A),A=f,f=f.return;while(f);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,pe=e.unstable_shouldYield,q=e.unstable_requestPaint,K=e.unstable_now,be=e.unstable_getCurrentPriorityLevel,ie=e.unstable_ImmediatePriority,ze=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(f){if(typeof _t=="function"&&bt(f),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(Qe,f)}catch{}}var xt=Math.clz32?Math.clz32:ue,Rt=Math.log,ai=Math.LN2;function ue(f){return f>>>=0,f===0?32:31-(Rt(f)/ai|0)|0}var ke=256,je=262144,ct=4194304;function at(f){var v=f&42;if(v!==0)return v;switch(f&-f){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 f&261888;case 262144:case 524288:case 1048576:case 2097152:return f&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return f&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return f}}function $e(f,v,A){var D=f.pendingLanes;if(D===0)return 0;var k=0,U=f.suspendedLanes,ee=f.pingedLanes;f=f.warmLanes;var xe=D&134217727;return xe!==0?(D=xe&~U,D!==0?k=at(D):(ee&=xe,ee!==0?k=at(ee):A||(A=xe&~f,A!==0&&(k=at(A))))):(xe=D&~U,xe!==0?k=at(xe):ee!==0?k=at(ee):A||(A=D&~f,A!==0&&(k=at(A)))),k===0?0:v!==0&&v!==k&&(v&U)===0&&(U=k&-k,A=v&-v,U>=A||U===32&&(A&4194048)!==0)?v:k}function Lt(f,v){return(f.pendingLanes&~(f.suspendedLanes&~f.pingedLanes)&v)===0}function ri(f,v){switch(f){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 f=ct;return ct<<=1,(ct&62914560)===0&&(ct=4194304),f}function di(f){for(var v=[],A=0;31>A;A++)v.push(f);return v}function pn(f,v){f.pendingLanes|=v,v!==268435456&&(f.suspendedLanes=0,f.pingedLanes=0,f.warmLanes=0)}function sn(f,v,A,D,k,U){var ee=f.pendingLanes;f.pendingLanes=A,f.suspendedLanes=0,f.pingedLanes=0,f.warmLanes=0,f.expiredLanes&=A,f.entangledLanes&=A,f.errorRecoveryDisabledLanes&=A,f.shellSuspendCounter=0;var xe=f.entanglements,Ie=f.expirationTimes,it=f.hiddenUpdates;for(A=ee&~A;0<A;){var St=31-xt(A),Ct=1<<St;xe[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(f,D,0),U!==0&&k===0&&f.tag!==0&&(f.suspendedLanes|=U&~(ee&~v))}function no(f,v,A){f.pendingLanes|=v,f.suspendedLanes&=~v;var D=31-xt(v);f.entangledLanes|=v,f.entanglements[D]=f.entanglements[D]|1073741824|A&261930}function Dl(f,v){var A=f.entangledLanes|=v;for(f=f.entanglements;A;){var D=31-xt(A),k=1<<D;k&v|f[D]&v&&(f[D]|=v),A&=~k}}function Ih(f,v){var A=v&-v;return A=(A&42)!==0?1:To(A),(A&(f.suspendedLanes|v))!==0?0:A}function To(f){switch(f){case 2:f=1;break;case 8:f=4;break;case 32:f=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:f=128;break;case 268435456:f=134217728;break;default:f=0}return f}function we(f){return f&=-f,2<f?8<f?(f&134217727)!==0?32:268435456:8:2}function Ke(){var f=G.p;return f!==0?f:(f=window.event,f===void 0?32:cQ(f.type))}function ft(f,v){var A=G.p;try{return G.p=f,v()}finally{G.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,Ai="__reactMarker$"+We;function wi(f){delete f[lt],delete f[Vt],delete f[li],delete f[ii],delete f[or]}function on(f){var v=f[lt];if(v)return v;for(var A=f.parentNode;A;){if(v=A[fi]||A[lt]){if(A=v.alternate,v.child!==null||A!==null&&A.child!==null)for(f=XK(f);f!==null;){if(A=f[lt])return A;f=XK(f)}return v}f=A,A=f.parentNode}return null}function ha(f){if(f=f[lt]||f[fi]){var v=f.tag;if(v===5||v===6||v===13||v===31||v===26||v===27||v===3)return f}return null}function hs(f){var v=f.tag;if(v===5||v===26||v===27||v===6)return f.stateNode;throw Error(r(33))}function me(f){var v=f[ji];return v||(v=f[ji]={hoistableStyles:new Map,hoistableScripts:new Map}),v}function De(f){f[Ai]=!0}var Ze=new Set,Ve={};function Ye(f,v){Nt(f,v),Nt(f+"Capture",v)}function Nt(f,v){for(Ve[f]=v,f=0;f<v.length;f++)Ze.add(v[f])}var zt=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(f){return et.call(re,f)?!0:et.call(kt,f)?!1:zt.test(f)?re[f]=!0:(kt[f]=!0,!1)}function Ae(f,v,A){if(le(v))if(A===null)f.removeAttribute(v);else{switch(typeof A){case"undefined":case"function":case"symbol":f.removeAttribute(v);return;case"boolean":var D=v.toLowerCase().slice(0,5);if(D!=="data-"&&D!=="aria-"){f.removeAttribute(v);return}}f.setAttribute(v,""+A)}}function ye(f,v,A){if(A===null)f.removeAttribute(v);else{switch(typeof A){case"undefined":case"function":case"symbol":case"boolean":f.removeAttribute(v);return}f.setAttribute(v,""+A)}}function Ee(f,v,A,D){if(D===null)f.removeAttribute(A);else{switch(typeof D){case"undefined":case"function":case"symbol":case"boolean":f.removeAttribute(A);return}f.setAttributeNS(v,A,""+D)}}function pt(f){switch(typeof f){case"bigint":case"boolean":case"number":case"string":case"undefined":return f;case"object":return f;default:return""}}function Er(f){var v=f.type;return(f=f.nodeName)&&f.toLowerCase()==="input"&&(v==="checkbox"||v==="radio")}function Jr(f,v,A){var D=Object.getOwnPropertyDescriptor(f.constructor.prototype,v);if(!f.hasOwnProperty(v)&&typeof D<"u"&&typeof D.get=="function"&&typeof D.set=="function"){var k=D.get,U=D.set;return Object.defineProperty(f,v,{configurable:!0,get:function(){return k.call(this)},set:function(ee){A=""+ee,U.call(this,ee)}}),Object.defineProperty(f,v,{enumerable:D.enumerable}),{getValue:function(){return A},setValue:function(ee){A=""+ee},stopTracking:function(){f._valueTracker=null,delete f[v]}}}}function pr(f){if(!f._valueTracker){var v=Er(f)?"checked":"value";f._valueTracker=Jr(f,v,""+f[v])}}function _r(f){if(!f)return!1;var v=f._valueTracker;if(!v)return!0;var A=v.getValue(),D="";return f&&(D=Er(f)?f.checked?"true":"false":f.value),f=D,f!==A?(v.setValue(f),!0):!1}function Ut(f){if(f=f||(typeof document<"u"?document:void 0),typeof f>"u")return null;try{return f.activeElement||f.body}catch{return f.body}}var da=/[\n"\\]/g;function zi(f){return f.replace(da,function(v){return"\\"+v.charCodeAt(0).toString(16)+" "})}function ds(f,v,A,D,k,U,ee,xe){f.name="",ee!=null&&typeof ee!="function"&&typeof ee!="symbol"&&typeof ee!="boolean"?f.type=ee:f.removeAttribute("type"),v!=null?ee==="number"?(v===0&&f.value===""||f.value!=v)&&(f.value=""+pt(v)):f.value!==""+pt(v)&&(f.value=""+pt(v)):ee!=="submit"&&ee!=="reset"||f.removeAttribute("value"),v!=null?$a(f,ee,pt(v)):A!=null?$a(f,ee,pt(A)):D!=null&&f.removeAttribute("value"),k==null&&U!=null&&(f.defaultChecked=!!U),k!=null&&(f.checked=k&&typeof k!="function"&&typeof k!="symbol"),xe!=null&&typeof xe!="function"&&typeof xe!="symbol"&&typeof xe!="boolean"?f.name=""+pt(xe):f.removeAttribute("name")}function Co(f,v,A,D,k,U,ee,xe){if(U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"&&(f.type=U),v!=null||A!=null){if(!(U!=="submit"&&U!=="reset"||v!=null)){pr(f);return}A=A!=null?""+pt(A):"",v=v!=null?""+pt(v):A,xe||v===f.value||(f.value=v),f.defaultValue=v}D=D??k,D=typeof D!="function"&&typeof D!="symbol"&&!!D,f.checked=xe?f.checked:!!D,f.defaultChecked=!!D,ee!=null&&typeof ee!="function"&&typeof ee!="symbol"&&typeof ee!="boolean"&&(f.name=ee),pr(f)}function $a(f,v,A){v==="number"&&Ut(f.ownerDocument)===f||f.defaultValue===""+A||(f.defaultValue=""+A)}function ao(f,v,A,D){if(f=f.options,v){v={};for(var k=0;k<A.length;k++)v["$"+A[k]]=!0;for(A=0;A<f.length;A++)k=v.hasOwnProperty("$"+f[A].value),f[A].selected!==k&&(f[A].selected=k),k&&D&&(f[A].defaultSelected=!0)}else{for(A=""+pt(A),v=null,k=0;k<f.length;k++){if(f[k].value===A){f[k].selected=!0,D&&(f[k].defaultSelected=!0);return}v!==null||f[k].disabled||(v=f[k])}v!==null&&(v.selected=!0)}}function qr(f,v,A){if(v!=null&&(v=""+pt(v),v!==f.value&&(f.value=v),A==null)){f.defaultValue!==v&&(f.defaultValue=v);return}f.defaultValue=A!=null?""+pt(A):""}function fa(f,v,A,D){if(v==null){if(D!=null){if(A!=null)throw Error(r(92));if(W(D)){if(1<D.length)throw Error(r(93));D=D[0]}A=D}A==null&&(A=""),v=A}A=pt(v),f.defaultValue=A,D=f.textContent,D===A&&D!==""&&D!==null&&(f.value=D),pr(f)}function so(f,v){if(v){var A=f.firstChild;if(A&&A===f.lastChild&&A.nodeType===3){A.nodeValue=v;return}}f.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(f,v,A){var D=v.indexOf("--")===0;A==null||typeof A=="boolean"||A===""?D?f.setProperty(v,""):v==="float"?f.cssFloat="":f[v]="":D?f.setProperty(v,A):typeof A!="number"||A===0||_a.has(v)?v==="float"?f.cssFloat=A:f[v]=(""+A).trim():f[v]=A+"px"}function Tu(f,v,A){if(v!=null&&typeof v!="object")throw Error(r(62));if(f=f.style,A!=null){for(var D in A)!A.hasOwnProperty(D)||v!=null&&v.hasOwnProperty(D)||(D.indexOf("--")===0?f.setProperty(D,""):D==="float"?f.cssFloat="":f[D]="");for(var k in v)D=v[k],v.hasOwnProperty(k)&&A[k]!==D&&dc(f,k,D)}else for(var U in v)v.hasOwnProperty(U)&&dc(f,U,v[U])}function mp(f){if(f.indexOf("-")===-1)return!1;switch(f){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"]]),IA=/^[\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(f){return IA.test(""+f)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":f}function Nh(){}var Rb=null;function Ib(f){return f=f.target||f.srcElement||window,f.correspondingUseElement&&(f=f.correspondingUseElement),f.nodeType===3?f.parentNode:f}var gp=null,Nd=null;function NA(f){var v=ha(f);if(v&&(f=v.stateNode)){var A=f[Vt]||null;e:switch(f=v.stateNode,v.type){case"input":if(ds(f,A.value,A.defaultValue,A.defaultValue,A.checked,A.defaultChecked,A.type,A.name),v=A.name,A.type==="radio"&&v!=null){for(A=f;A.parentNode;)A=A.parentNode;for(A=A.querySelectorAll('input[name="'+zi(""+v)+'"][type="radio"]'),v=0;v<A.length;v++){var D=A[v];if(D!==f&&D.form===f.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===f.form&&_r(D)}break e;case"textarea":qr(f,A.value,A.defaultValue);break e;case"select":v=A.value,v!=null&&ao(f,!!A.multiple,v,!1)}}}var Nb=!1;function LA(f,v,A){if(Nb)return f(v,A);Nb=!0;try{var D=f(v);return D}finally{if(Nb=!1,(gp!==null||Nd!==null)&&(nu(),gp&&(v=gp,f=Nd,Nd=gp=null,NA(v),f)))for(v=0;v<f.length;v++)NA(f[v])}}function dg(f,v){var A=f.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)||(f=f.type,D=!(f==="button"||f==="input"||f==="select"||f==="textarea")),f=!D;break e;default:f=!1}if(f)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"),kA=!1;if(Cu)try{var fg={};Object.defineProperty(fg,"passive",{get:function(){kA=!0}}),window.addEventListener("test",fg,fg),window.removeEventListener("test",fg,fg)}catch{kA=!1}var Ol=null,Lb=null,vp=null;function G0(){if(vp)return vp;var f,v=Lb,A=v.length,D,k="value"in Ol?Ol.value:Ol.textContent,U=k.length;for(f=0;f<A&&v[f]===k[f];f++);var ee=A-f;for(D=1;D<=ee&&v[A-D]===k[U-D];D++);return vp=k.slice(f,1<D?1-D:void 0)}function W0(f){var v=f.keyCode;return"charCode"in f?(f=f.charCode,f===0&&v===13&&(f=13)):f=v,f===10&&(f=13),32<=f||f===13?f:0}function pg(){return!0}function kD(){return!1}function Po(f){function v(A,D,k,U,ee){this._reactName=A,this._targetInst=k,this.type=D,this.nativeEvent=U,this.target=ee,this.currentTarget=null;for(var xe in f)f.hasOwnProperty(xe)&&(A=f[xe],this[xe]=A?A(U):U[xe]);return this.isDefaultPrevented=(U.defaultPrevented!=null?U.defaultPrevented:U.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(f){return f.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},q0=Po(Ld),mg=h({},Ld,{view:0,detail:0}),BD=Po(mg),X0,kb,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:jb,button:0,buttons:0,relatedTarget:function(f){return f.relatedTarget===void 0?f.fromElement===f.srcElement?f.toElement:f.fromElement:f.relatedTarget},movementX:function(f){return"movementX"in f?f.movementX:(f!==gg&&(gg&&f.type==="mousemove"?(X0=f.screenX-gg.screenX,kb=f.screenY-gg.screenY):kb=X0=0,gg=f),X0)},movementY:function(f){return"movementY"in f?f.movementY:kb}}),BA=Po(vg),zD=h({},vg,{dataTransfer:0}),UD=Po(zD),zA=h({},mg,{relatedTarget:0}),Bb=Po(zA),jD=h({},Ld,{animationName:0,elapsedTime:0,pseudoElement:0}),sU=Po(jD),oU=h({},Ld,{clipboardData:function(f){return"clipboardData"in f?f.clipboardData:window.clipboardData}}),FD=Po(oU),Y0=h({},Ld,{data:0}),zb=Po(Y0),Ub={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 UA(f){var v=this.nativeEvent;return v.getModifierState?v.getModifierState(f):(f=HD[f])?!!v[f]:!1}function jb(){return UA}var GD=h({},mg,{key:function(f){if(f.key){var v=Ub[f.key]||f.key;if(v!=="Unidentified")return v}return f.type==="keypress"?(f=W0(f),f===13?"Enter":String.fromCharCode(f)):f.type==="keydown"||f.type==="keyup"?VD[f.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jb,charCode:function(f){return f.type==="keypress"?W0(f):0},keyCode:function(f){return f.type==="keydown"||f.type==="keyup"?f.keyCode:0},which:function(f){return f.type==="keypress"?W0(f):f.type==="keydown"||f.type==="keyup"?f.keyCode:0}}),yp=Po(GD),Fb=h({},vg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jA=Po(Fb),FA=h({},mg,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jb}),WD=Po(FA),qD=h({},Ld,{propertyName:0,elapsedTime:0,pseudoElement:0}),lU=Po(qD),Ls=h({},vg,{deltaX:function(f){return"deltaX"in f?f.deltaX:"wheelDeltaX"in f?-f.wheelDeltaX:0},deltaY:function(f){return"deltaY"in f?f.deltaY:"wheelDeltaY"in f?-f.wheelDeltaY:"wheelDelta"in f?-f.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 Vb=Cu&&"TextEvent"in window&&!yg,VA=Cu&&(!xp||yg&&8<yg&&11>=yg),QD=" ",$0=!1;function Hb(f,v){switch(f){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 HA(f){return f=f.detail,typeof f=="object"&&"data"in f?f.data:null}var bp=!1;function ZD(f,v){switch(f){case"compositionend":return HA(v);case"keypress":return v.which!==32?null:($0=!0,QD);case"textInput":return f=v.data,f===QD&&$0?null:f;default:return null}}function GA(f,v){if(bp)return f==="compositionend"||!xp&&Hb(f,v)?(f=G0(),vp=Lb=Ol=null,bp=!1,f):null;switch(f){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 VA&&v.locale!=="ko"?null:v.data;default:return null}}var WA={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 qA(f){var v=f&&f.nodeName&&f.nodeName.toLowerCase();return v==="input"?!!WA[f.type]:v==="textarea"}function Gb(f,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),f.push({event:A,listeners:v}))}var kd=null,wp=null;function JD(f){IK(f,0)}function xg(f){var v=hs(f);if(_r(v))return f}function XA(f,v){if(f==="change")return v}var Pu=!1;if(Cu){var K0;if(Cu){var YA="oninput"in document;if(!YA){var $A=document.createElement("div");$A.setAttribute("oninput","return;"),YA=typeof $A.oninput=="function"}K0=YA}else K0=!1;Pu=K0&&(!document.documentMode||9<document.documentMode)}function fc(){kd&&(kd.detachEvent("onpropertychange",Q0),wp=kd=null)}function Q0(f){if(f.propertyName==="value"&&xg(wp)){var v=[];Gb(v,wp,f,Ib(f)),LA(JD,v)}}function e3(f,v,A){f==="focusin"?(fc(),kd=v,wp=A,kd.attachEvent("onpropertychange",Q0)):f==="focusout"&&fc()}function KA(f){if(f==="selectionchange"||f==="keyup"||f==="keydown")return xg(wp)}function t3(f,v){if(f==="click")return xg(v)}function i3(f,v){if(f==="input"||f==="change")return xg(v)}function QA(f,v){return f===v&&(f!==0||1/f===1/v)||f!==f&&v!==v}var Do=typeof Object.is=="function"?Object.is:QA;function bg(f,v){if(Do(f,v))return!0;if(typeof f!="object"||f===null||typeof v!="object"||v===null)return!1;var A=Object.keys(f),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(f[k],v[k]))return!1}return!0}function Z0(f){for(;f&&f.firstChild;)f=f.firstChild;return f}function wg(f,v){var A=Z0(f);f=0;for(var D;A;){if(A.nodeType===3){if(D=f+A.textContent.length,f<=v&&D>=v)return{node:A,offset:v-f};f=D}e:{for(;A;){if(A.nextSibling){A=A.nextSibling;break e}A=A.parentNode}A=void 0}A=Z0(A)}}function Cn(f,v){return f&&v?f===v?!0:f&&f.nodeType===3?!1:v&&v.nodeType===3?Cn(f,v.parentNode):"contains"in f?f.contains(v):f.compareDocumentPosition?!!(f.compareDocumentPosition(v)&16):!1:!1}function r3(f){f=f!=null&&f.ownerDocument!=null&&f.ownerDocument.defaultView!=null?f.ownerDocument.defaultView:window;for(var v=Ut(f.document);v instanceof f.HTMLIFrameElement;){try{var A=typeof v.contentWindow.location.href=="string"}catch{A=!1}if(A)f=v.contentWindow;else break;v=Ut(f.document)}return v}function ZA(f){var v=f&&f.nodeName&&f.nodeName.toLowerCase();return v&&(v==="input"&&(f.type==="text"||f.type==="search"||f.type==="tel"||f.type==="url"||f.type==="password")||v==="textarea"||f.contentEditable==="true")}var n3=Cu&&"documentMode"in document&&11>=document.documentMode,Du=null,Ou=null,_g=null,Wb=!1;function Sg(f,v,A){var D=A.window===A?A.document:A.nodeType===9?A:A.ownerDocument;Wb||Du==null||Du!==Ut(D)||(D=Du,"selectionStart"in D&&ZA(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),f.push({event:v,listeners:D}),v.target=Du)))}function oo(f,v){var A={};return A[f.toLowerCase()]=v.toLowerCase(),A["Webkit"+f]="webkit"+v,A["Moz"+f]="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={},JA={};Cu&&(JA=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(f){if(J0[f])return J0[f];if(!_p[f])return f;var v=_p[f],A;for(A in v)if(v.hasOwnProperty(A)&&A in JA)return J0[f]=v[A];return f}var qb=Lh("animationend"),ey=Lh("animationiteration"),eM=Lh("animationstart"),a3=Lh("transitionrun"),cU=Lh("transitionstart"),s3=Lh("transitioncancel"),tM=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(f,v){pc.set(f,v),Ye(v,[f])}var iy=typeof reportError=="function"?reportError:function(f){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var v=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof f=="object"&&f!==null&&typeof f.message=="string"?String(f.message):String(f),error:f});if(!window.dispatchEvent(v))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",f);return}console.error(f)},gc=[],kh=0,fs=0;function ry(){for(var f=kh,v=fs=kh=0;v<f;){var A=gc[v];gc[v++]=null;var D=gc[v];gc[v++]=null;var k=gc[v];gc[v++]=null;var U=gc[v];if(gc[v++]=null,D!==null&&k!==null){var ee=D.pending;ee===null?k.next=k:(k.next=ee.next,ee.next=k),D.pending=k}U!==0&&Bd(A,k,U)}}function ps(f,v,A,D){gc[kh++]=f,gc[kh++]=v,gc[kh++]=A,gc[kh++]=D,fs|=D,f.lanes|=D,f=f.alternate,f!==null&&(f.lanes|=D)}function Xb(f,v,A,D){return ps(f,v,A,D),vc(f)}function Oo(f,v){return ps(f,null,null,v),vc(f)}function Bd(f,v,A){f.lanes|=A;var D=f.alternate;D!==null&&(D.lanes|=A);for(var k=!1,U=f.return;U!==null;)U.childLanes|=A,D=U.alternate,D!==null&&(D.childLanes|=A),U.tag===22&&(f=U.stateNode,f===null||f._visibility&1||(k=!0)),f=U,U=U.return;return f.tag===3?(U=f.stateNode,k&&v!==null&&(k=31-xt(A),f=U.hiddenUpdates,D=f[k],D===null?f[k]=[v]:D.push(v),v.lane=A|536870912),U):null}function vc(f){if(50<rf)throw rf=0,Fp=null,Error(r(185));for(var v=f.return;v!==null;)f=v,v=f.return;return f.tag===3?f.stateNode:null}var zd={};function iM(f,v,A,D){this.tag=f,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(f,v,A,D){return new iM(f,v,A,D)}function Yb(f){return f=f.prototype,!(!f||!f.isReactComponent)}function tl(f,v){var A=f.alternate;return A===null?(A=Zn(f.tag,v,f.key,f.mode),A.elementType=f.elementType,A.type=f.type,A.stateNode=f.stateNode,A.alternate=f,f.alternate=A):(A.pendingProps=v,A.type=f.type,A.flags=0,A.subtreeFlags=0,A.deletions=null),A.flags=f.flags&65011712,A.childLanes=f.childLanes,A.lanes=f.lanes,A.child=f.child,A.memoizedProps=f.memoizedProps,A.memoizedState=f.memoizedState,A.updateQueue=f.updateQueue,v=f.dependencies,A.dependencies=v===null?null:{lanes:v.lanes,firstContext:v.firstContext},A.sibling=f.sibling,A.index=f.index,A.ref=f.ref,A.refCleanup=f.refCleanup,A}function Ag(f,v){f.flags&=65011714;var A=f.alternate;return A===null?(f.childLanes=0,f.lanes=v,f.child=null,f.subtreeFlags=0,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=A.childLanes,f.lanes=A.lanes,f.child=A.child,f.subtreeFlags=0,f.deletions=null,f.memoizedProps=A.memoizedProps,f.memoizedState=A.memoizedState,f.updateQueue=A.updateQueue,f.type=A.type,v=A.dependencies,f.dependencies=v===null?null:{lanes:v.lanes,firstContext:v.firstContext}),f}function Ru(f,v,A,D,k,U){var ee=0;if(D=f,typeof f=="function")Yb(f)&&(ee=1);else if(typeof f=="string")ee=sEe(f,A,oe.current)?26:f==="html"||f==="head"||f==="body"?27:5;else e:switch(f){case I:return f=Zn(31,A,v,k),f.elementType=I,f.lanes=U,f;case y:return Ud(A.children,k,U,v);case g:ee=8,k|=24;break;case x:return f=Zn(12,A,v,k|2),f.elementType=x,f.lanes=U,f;case E:return f=Zn(13,A,v,k),f.elementType=E,f.lanes=U,f;case T:return f=Zn(19,A,v,k),f.elementType=T,f.lanes=U,f;default:if(typeof f=="object"&&f!==null)switch(f.$$typeof){case S:ee=10;break e;case w:ee=9;break e;case M:ee=11;break e;case R:ee=14;break e;case P:ee=16,D=null;break e}ee=29,A=Error(r(130,f===null?"null":typeof f,"")),D=null}return v=Zn(ee,A,v,k),v.elementType=f,v.type=D,v.lanes=U,v}function Ud(f,v,A,D){return f=Zn(7,f,D,v),f.lanes=A,f}function $b(f,v,A){return f=Zn(6,f,null,v),f.lanes=A,f}function Mg(f){var v=Zn(18,null,null,0);return v.stateNode=f,v}function Kb(f,v,A){return v=Zn(4,f.children!==null?f.children:[],f.key,v),v.lanes=A,v.stateNode={containerInfo:f.containerInfo,pendingChildren:null,implementation:f.implementation},v}var ny=new WeakMap;function Rl(f,v){if(typeof f=="object"&&f!==null){var A=ny.get(f);return A!==void 0?A:(v={value:f,source:v,stack:he(v)},ny.set(f,v),v)}return{value:f,source:v,stack:he(v)}}var jd=[],Fd=0,Eg=null,Tg=0,il=[],Gn=0,Bh=null,Jn=1,eu="";function Iu(f,v){jd[Fd++]=Tg,jd[Fd++]=Eg,Eg=f,Tg=v}function o3(f,v,A){il[Gn++]=Jn,il[Gn++]=eu,il[Gn++]=Bh,Bh=f;var D=Jn;f=eu;var k=32-xt(D)-1;D&=~(1<<k),A+=1;var U=32-xt(v)+k;if(30<U){var ee=k-k%5;U=(D&(1<<ee)-1).toString(32),D>>=ee,k-=ee,Jn=1<<32-xt(v)+k|A<<k|D,eu=U+f}else Jn=1<<U|A<<k|D,eu=f}function Nu(f){f.return!==null&&(Iu(f,1),o3(f,1,0))}function Qb(f){for(;f===Eg;)Eg=jd[--Fd],jd[Fd]=null,Tg=jd[--Fd],jd[Fd]=null;for(;f===Bh;)Bh=il[--Gn],il[Gn]=null,eu=il[--Gn],il[Gn]=null,Jn=il[--Gn],il[Gn]=null}function Zb(f,v){il[Gn++]=Jn,il[Gn++]=eu,il[Gn++]=Bh,Jn=v.id,eu=v.overflow,Bh=f}var pa=null,Pn=null,Tr=!1,zh=null,Il=!1,Cg=Error(r(519));function Lu(f){var v=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ku(Rl(v,f)),Cg}function l3(f){var v=f.stateNode,A=f.type,D=f.memoizedProps;switch(v[lt]=f,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(f,!0)}function c3(f){for(pa=f.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(f){if(f!==pa)return!1;if(!Tr)return c3(f),Tr=!0,!1;var v=f.tag,A;if((A=v!==3&&v!==27)&&((A=v===5)&&(A=f.type,A=!(A!=="form"&&A!=="button")||MU(f.type,f.memoizedProps)),A=!A),A&&Pn&&Lu(f),c3(f),v===13){if(f=f.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(317));Pn=qK(f)}else if(v===31){if(f=f.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(317));Pn=qK(f)}else v===27?(v=Pn,$g(f.type)?(f=DU,DU=null,Pn=f):Pn=v):Pn=pa?Ku(f.stateNode.nextSibling):null;return!0}function Vd(){Pn=pa=null,Tr=!1}function Jb(){var f=zh;return f!==null&&(ga===null?ga=f:ga.push.apply(ga,f),zh=null),f}function ku(f){zh===null?zh=[f]:zh.push(f)}var Dg=$(null),Hd=null,Bu=null;function Uh(f,v,A){ae(Dg,v._currentValue),v._currentValue=A}function zu(f){f._currentValue=Dg.current,Z(Dg)}function e1(f,v,A){for(;f!==null;){var D=f.alternate;if((f.childLanes&v)!==v?(f.childLanes|=v,D!==null&&(D.childLanes|=v)):D!==null&&(D.childLanes&v)!==v&&(D.childLanes|=v),f===A)break;f=f.return}}function t1(f,v,A,D){var k=f.child;for(k!==null&&(k.return=f);k!==null;){var U=k.dependencies;if(U!==null){var ee=k.child;U=U.firstContext;e:for(;U!==null;){var xe=U;U=k;for(var Ie=0;Ie<v.length;Ie++)if(xe.context===v[Ie]){U.lanes|=A,xe=U.alternate,xe!==null&&(xe.lanes|=A),e1(U.return,A,f),D||(ee=null);break e}U=xe.next}}else if(k.tag===18){if(ee=k.return,ee===null)throw Error(r(341));ee.lanes|=A,U=ee.alternate,U!==null&&(U.lanes|=A),e1(ee,A,f),ee=null}else ee=k.child;if(ee!==null)ee.return=k;else for(ee=k;ee!==null;){if(ee===f){ee=null;break}if(k=ee.sibling,k!==null){k.return=ee.return,ee=k;break}ee=ee.return}k=ee}}function Uu(f,v,A,D){f=null;for(var k=v,U=!1;k!==null;){if(!U){if((k.flags&524288)!==0)U=!0;else if((k.flags&262144)!==0)break}if(k.tag===10){var ee=k.alternate;if(ee===null)throw Error(r(387));if(ee=ee.memoizedProps,ee!==null){var xe=k.type;Do(k.pendingProps.value,ee.value)||(f!==null?f.push(xe):f=[xe])}}else if(k===fe.current){if(ee=k.alternate,ee===null)throw Error(r(387));ee.memoizedState.memoizedState!==k.memoizedState.memoizedState&&(f!==null?f.push(JM):f=[JM])}k=k.return}f!==null&&t1(v,f,A,D),v.flags|=262144}function ay(f){for(f=f.firstContext;f!==null;){if(!Do(f.context._currentValue,f.memoizedValue))return!0;f=f.next}return!1}function Gd(f){Hd=f,Bu=null,f=f.dependencies,f!==null&&(f.firstContext=null)}function Fi(f){return u3(Hd,f)}function Og(f,v){return Hd===null&&Gd(f),u3(f,v)}function u3(f,v){var A=v._currentValue;if(v={context:v,memoizedValue:A,next:null},Bu===null){if(f===null)throw Error(r(308));Bu=v,f.dependencies={lanes:0,firstContext:v},f.flags|=524288}else Bu=Bu.next=v;return A}var h3=typeof AbortController<"u"?AbortController:function(){var f=[],v=this.signal={aborted:!1,addEventListener:function(A,D){f.push(D)}};this.abort=function(){v.aborted=!0,f.forEach(function(A){return A()})}},uU=e.unstable_scheduleCallback,hU=e.unstable_NormalPriority,Na={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function rM(){return{controller:new h3,data:new Map,refCount:0}}function Sp(f){f.refCount--,f.refCount===0&&uU(hU,function(){f.controller.abort()})}var Nl=null,i1=0,jh=0,yc=null;function nM(f,v){if(Nl===null){var A=Nl=[];i1=0,jh=ht(),yc={status:"pending",value:void 0,then:function(D){A.push(D)}}}return i1++,v.then(aM,aM),v}function aM(){if(--i1===0&&Nl!==null){yc!==null&&(yc.status="fulfilled");var f=Nl;Nl=null,jh=0,yc=null;for(var v=0;v<f.length;v++)(0,f[v])()}}function sM(f,v){var A=[],D={status:"pending",value:null,reason:null,then:function(k){A.push(k)}};return f.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(f,v){XM=K(),typeof v=="object"&&v!==null&&typeof v.then=="function"&&nM(f,v),d3!==null&&d3(f,v)};var Wd=$(null);function r1(){var f=Wd.current;return f!==null?f:qi.pooledCache}function sy(f,v){v===null?ae(Wd,Wd.current):ae(Wd,v.pool)}function oM(){var f=r1();return f===null?null:{parent:Na._currentValue,pool:f}}var Ap=Error(r(460)),oy=Error(r(474)),ur=Error(r(542)),n1={then:function(){}};function rl(f){return f=f.status,f==="fulfilled"||f==="rejected"}function a1(f,v,A){switch(A=f[A],A===void 0?f.push(v):A!==v&&(v.then(Nh,Nh),v=A),v.status){case"fulfilled":return v.value;case"rejected":throw f=v.reason,Tp(f),f;default:if(typeof v.status=="string")v.then(Nh,Nh);else{if(f=qi,f!==null&&100<f.shellSuspendCounter)throw Error(r(482));f=v,f.status="pending",f.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 f=v.reason,Tp(f),f}throw ju=v,Ap}}function Mp(f){try{var v=f._init;return v(f._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 f=ju;return ju=null,f}function Tp(f){if(f===Ap||f===ur)throw Error(r(483))}var Cp=null,Pp=0;function ly(f){var v=Pp;return Pp+=1,Cp===null&&(Cp=[]),a1(Cp,f,v)}function xc(f,v){v=v.props.ref,f.ref=v!==void 0?v:null}function Rg(f,v){throw v.$$typeof===d?Error(r(525)):(f=Object.prototype.toString.call(v),Error(r(31,f==="[object Object]"?"object with keys {"+Object.keys(v).join(", ")+"}":f)))}function s1(f){function v(qe,Fe){if(f){var tt=qe.deletions;tt===null?(qe.deletions=[Fe],qe.flags|=16):tt.push(Fe)}}function A(qe,Fe){if(!f)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 U(qe,Fe,tt){return qe.index=tt,f?(tt=qe.alternate,tt!==null?(tt=tt.index,tt<Fe?(qe.flags|=67108866,Fe):tt):(qe.flags|=67108866,Fe)):(qe.flags|=1048576,Fe)}function ee(qe){return f&&qe.alternate===null&&(qe.flags|=67108866),qe}function xe(qe,Fe,tt,Et){return Fe===null||Fe.tag!==6?(Fe=$b(tt,qe.mode,Et),Fe.return=qe,Fe):(Fe=k(Fe,tt),Fe.return=qe,Fe)}function Ie(qe,Fe,tt,Et){var Ei=tt.type;return Ei===y?St(qe,Fe,tt.props.children,Et,tt.key):Fe!==null&&(Fe.elementType===Ei||typeof Ei=="object"&&Ei!==null&&Ei.$$typeof===P&&Mp(Ei)===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=Kb(tt,qe.mode,Et),Fe.return=qe,Fe):(Fe=k(Fe,tt.children||[]),Fe.return=qe,Fe)}function St(qe,Fe,tt,Et,Ei){return Fe===null||Fe.tag!==7?(Fe=Ud(tt,qe.mode,Et,Ei),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=$b(""+Fe,qe.mode,tt),Fe.return=qe,Fe;if(typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case p:return tt=Ru(Fe.type,Fe.key,Fe.props,null,qe.mode,tt),xc(tt,Fe),tt.return=qe,tt;case m:return Fe=Kb(Fe,qe.mode,tt),Fe.return=qe,Fe;case P:return Fe=Mp(Fe),Ct(qe,Fe,tt)}if(W(Fe)||z(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 Ei=Fe!==null?Fe.key:null;if(typeof tt=="string"&&tt!==""||typeof tt=="number"||typeof tt=="bigint")return Ei!==null?null:xe(qe,Fe,""+tt,Et);if(typeof tt=="object"&&tt!==null){switch(tt.$$typeof){case p:return tt.key===Ei?Ie(qe,Fe,tt,Et):null;case m:return tt.key===Ei?it(qe,Fe,tt,Et):null;case P:return tt=Mp(tt),ot(qe,Fe,tt,Et)}if(W(tt)||z(tt))return Ei!==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,Ei){if(typeof Et=="string"&&Et!==""||typeof Et=="number"||typeof Et=="bigint")return qe=qe.get(tt)||null,xe(Fe,qe,""+Et,Ei);if(typeof Et=="object"&&Et!==null){switch(Et.$$typeof){case p:return qe=qe.get(Et.key===null?tt:Et.key)||null,Ie(Fe,qe,Et,Ei);case m:return qe=qe.get(Et.key===null?tt:Et.key)||null,it(Fe,qe,Et,Ei);case P:return Et=Mp(Et),gt(qe,Fe,tt,Et,Ei)}if(W(Et)||z(Et))return qe=qe.get(tt)||null,St(Fe,qe,Et,Ei,null);if(typeof Et.then=="function")return gt(qe,Fe,tt,ly(Et),Ei);if(Et.$$typeof===S)return gt(qe,Fe,tt,Og(Fe,Et),Ei);Rg(Fe,Et)}return null}function ci(qe,Fe,tt,Et){for(var Ei=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}f&&mi&&tn.alternate===null&&v(qe,mi),Fe=U(tn,Fe,mr),en===null?Ei=tn:en.sibling=tn,en=tn,mi=kr}if(mr===tt.length)return A(qe,mi),Tr&&Iu(qe,mr),Ei;if(mi===null){for(;mr<tt.length;mr++)mi=Ct(qe,tt[mr],Et),mi!==null&&(Fe=U(mi,Fe,mr),en===null?Ei=mi:en.sibling=mi,en=mi);return Tr&&Iu(qe,mr),Ei}for(mi=D(mi);mr<tt.length;mr++)kr=gt(mi,qe,mr,tt[mr],Et),kr!==null&&(f&&kr.alternate!==null&&mi.delete(kr.key===null?mr:kr.key),Fe=U(kr,Fe,mr),en===null?Ei=kr:en.sibling=kr,en=kr);return f&&mi.forEach(function(ev){return v(qe,ev)}),Tr&&Iu(qe,mr),Ei}function Ui(qe,Fe,tt,Et){if(tt==null)throw Error(r(151));for(var Ei=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}f&&mi&&ev.alternate===null&&v(qe,mi),Fe=U(ev,Fe,mr),en===null?Ei=ev:en.sibling=ev,en=ev,mi=kr}if(tn.done)return A(qe,mi),Tr&&Iu(qe,mr),Ei;if(mi===null){for(;!tn.done;mr++,tn=tt.next())tn=Ct(qe,tn.value,Et),tn!==null&&(Fe=U(tn,Fe,mr),en===null?Ei=tn:en.sibling=tn,en=tn);return Tr&&Iu(qe,mr),Ei}for(mi=D(mi);!tn.done;mr++,tn=tt.next())tn=gt(mi,qe,mr,tn.value,Et),tn!==null&&(f&&tn.alternate!==null&&mi.delete(tn.key===null?mr:tn.key),Fe=U(tn,Fe,mr),en===null?Ei=tn:en.sibling=tn,en=tn);return f&&mi.forEach(function(vEe){return v(qe,vEe)}),Tr&&Iu(qe,mr),Ei}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 p:e:{for(var Ei=tt.key;Fe!==null;){if(Fe.key===Ei){if(Ei=tt.type,Ei===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===Ei||typeof Ei=="object"&&Ei!==null&&Ei.$$typeof===P&&Mp(Ei)===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 ee(qe);case m:e:{for(Ei=tt.key;Fe!==null;){if(Fe.key===Ei)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=Kb(tt,qe.mode,Et),Et.return=qe,qe=Et}return ee(qe);case P:return tt=Mp(tt),Rn(qe,Fe,tt,Et)}if(W(tt))return ci(qe,Fe,tt,Et);if(z(tt)){if(Ei=z(tt),typeof Ei!="function")throw Error(r(150));return tt=Ei.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=$b(tt,qe.mode,Et),Et.return=qe,qe=Et),ee(qe)):A(qe,Fe)}return function(qe,Fe,tt,Et){try{Pp=0;var Ei=Rn(qe,Fe,tt,Et);return Cp=null,Ei}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=s1(!0),o1=s1(!1),Ro=!1;function cy(f){f.updateQueue={baseState:f.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lM(f,v){f=f.updateQueue,v.updateQueue===f&&(v.updateQueue={baseState:f.baseState,firstBaseUpdate:f.firstBaseUpdate,lastBaseUpdate:f.lastBaseUpdate,shared:f.shared,callbacks:null})}function Vh(f){return{lane:f,tag:0,payload:null,callback:null,next:null}}function qd(f,v,A){var D=f.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(f),Bd(f,null,A),v}return ps(f,D,v,A),vc(f)}function Xd(f,v,A){if(v=v.updateQueue,v!==null&&(v=v.shared,(A&4194048)!==0)){var D=v.lanes;D&=f.pendingLanes,A|=D,v.lanes=A,Dl(f,A)}}function Mi(f,v){var A=f.updateQueue,D=f.alternate;if(D!==null&&(D=D.updateQueue,A===D)){var k=null,U=null;if(A=A.firstBaseUpdate,A!==null){do{var ee={lane:A.lane,tag:A.tag,payload:A.payload,callback:null,next:null};U===null?k=U=ee:U=U.next=ee,A=A.next}while(A!==null);U===null?k=U=v:U=U.next=v}else k=U=v;A={baseState:D.baseState,firstBaseUpdate:k,lastBaseUpdate:U,shared:D.shared,callbacks:D.callbacks},f.updateQueue=A;return}f=A.lastBaseUpdate,f===null?A.firstBaseUpdate=v:f.next=v,A.lastBaseUpdate=v}var cM=!1;function uy(){if(cM){var f=yc;if(f!==null)throw f}}function Ig(f,v,A,D){cM=!1;var k=f.updateQueue;Ro=!1;var U=k.firstBaseUpdate,ee=k.lastBaseUpdate,xe=k.shared.pending;if(xe!==null){k.shared.pending=null;var Ie=xe,it=Ie.next;Ie.next=null,ee===null?U=it:ee.next=it,ee=Ie;var St=f.alternate;St!==null&&(St=St.updateQueue,xe=St.lastBaseUpdate,xe!==ee&&(xe===null?St.firstBaseUpdate=it:xe.next=it,St.lastBaseUpdate=Ie))}if(U!==null){var Ct=k.baseState;ee=0,St=it=Ie=null,xe=U;do{var ot=xe.lane&-536870913,gt=ot!==xe.lane;if(gt?(lr&ot)===ot:(D&ot)===ot){ot!==0&&ot===jh&&(cM=!0),St!==null&&(St=St.next={lane:0,tag:xe.tag,payload:xe.payload,callback:null,next:null});e:{var ci=f,Ui=xe;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=xe.callback,ot!==null&&(f.flags|=64,gt&&(f.flags|=8192),gt=k.callbacks,gt===null?k.callbacks=[ot]:gt.push(ot))}else gt={lane:ot,tag:xe.tag,payload:xe.payload,callback:xe.callback,next:null},St===null?(it=St=gt,Ie=Ct):St=St.next=gt,ee|=ot;if(xe=xe.next,xe===null){if(xe=k.shared.pending,xe===null)break;gt=xe,xe=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,U===null&&(k.shared.lanes=0),Xu|=ee,f.lanes=ee,f.memoizedState=Ct}}function Ng(f,v){if(typeof f!="function")throw Error(r(191,f));f.call(v)}function f3(f,v){var A=f.callbacks;if(A!==null)for(f.callbacks=null,f=0;f<A.length;f++)Ng(A[f],v)}var Lg=$(null),l1=$(0);function p3(f,v){f=zl,ae(l1,f),ae(Lg,v),zl=f|v.baseLanes}function uM(){ae(l1,zl),ae(Lg,Lg.current)}function hy(){zl=l1.current,Z(Lg),Z(l1)}var nl=$(null),Io=null;function Hh(f){var v=f.alternate;ae(Cr,Cr.current&1),ae(nl,f),Io===null&&(v===null||Lg.current!==null||v.memoizedState!==null)&&(Io=f)}function hM(f){ae(Cr,Cr.current),ae(nl,f),Io===null&&(Io=f)}function m3(f){f.tag===22?(ae(Cr,Cr.current),ae(nl,f),Io===null&&(Io=f)):al()}function al(){ae(Cr,Cr.current),ae(nl,nl.current)}function Sa(f){Z(nl),Io===f&&(Io=null),Z(Cr)}var Cr=$(0);function Ll(f){for(var v=f;v!==null;){if(v.tag===13){var A=v.memoizedState;if(A!==null&&(A=A.dehydrated,A===null||CU(A)||PU(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===f)break;for(;v.sibling===null;){if(v.return===null||v.return===f)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,c1=0,dy=0,Bg=null,dM=0;function ea(){throw Error(r(321))}function fM(f,v){if(v===null)return!1;for(var A=0;A<v.length&&A<f.length;A++)if(!Do(f[A],v[A]))return!1;return!0}function u1(f,v,A,D,k,U){return Wn=U,tr=v,v.memoizedState=null,v.updateQueue=null,v.lanes=0,H.H=f===null||f.memoizedState===null?X3:IM,Dp=!1,U=A(D,k),Dp=!1,kg&&(U=Op(v,A,D,k)),g3(f),U}function g3(f){H.H=zg;var v=mn!==null&&mn.next!==null;if(Wn=0,Sr=mn=tr=null,bc=!1,dy=0,Bg=null,v)throw Error(r(300));f===null||La||(f=f.dependencies,f!==null&&ay(f)&&(La=!0))}function Op(f,v,A,D){tr=f;var k=0;do{if(kg&&(Bg=null),dy=0,kg=!1,25<=k)throw Error(r(301));if(k+=1,Sr=mn=null,f.updateQueue!=null){var U=f.updateQueue;U.lastEffect=null,U.events=null,U.stores=null,U.memoCache!=null&&(U.memoCache.index=0)}H.H=wc,U=v(A,D)}while(kg);return U}function Rp(){var f=H.H,v=f.useState()[0];return v=typeof v.then=="function"?fy(v):v,f=f.useState()[0],(mn!==null?mn.memoizedState:null)!==f&&(tr.flags|=1024),v}function pM(){var f=c1!==0;return c1=0,f}function mM(f,v,A){v.updateQueue=f.updateQueue,v.flags&=-2053,f.lanes&=~A}function gM(f){if(bc){for(f=f.memoizedState;f!==null;){var v=f.queue;v!==null&&(v.pending=null),f=f.next}bc=!1}Wn=0,Sr=mn=tr=null,kg=!1,dy=c1=0,Bg=null}function Ka(){var f={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Sr===null?tr.memoizedState=Sr=f:Sr=Sr.next=f,Sr}function Aa(){if(mn===null){var f=tr.alternate;f=f!==null?f.memoizedState:null}else f=mn.next;var v=Sr===null?tr.memoizedState:Sr.next;if(v!==null)Sr=v,mn=f;else{if(f===null)throw tr.alternate===null?Error(r(467)):Error(r(310));mn=f,f={memoizedState:mn.memoizedState,baseState:mn.baseState,baseQueue:mn.baseQueue,queue:mn.queue,next:null},Sr===null?tr.memoizedState=Sr=f:Sr=Sr.next=f}return Sr}function h1(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fy(f){var v=dy;return dy+=1,Bg===null&&(Bg=[]),f=a1(Bg,f,v),v=tr,(Sr===null?v.memoizedState:Sr.next)===null&&(v=v.alternate,H.H=v===null||v.memoizedState===null?X3:IM),f}function Yd(f){if(f!==null&&typeof f=="object"){if(typeof f.then=="function")return fy(f);if(f.$$typeof===S)return Fi(f)}throw Error(r(438,String(f)))}function vM(f){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=h1(),tr.updateQueue=A),A.memoCache=v,A=v.data[v.index],A===void 0)for(A=v.data[v.index]=Array(f),D=0;D<f;D++)A[D]=L;return v.index++,A}function Gh(f,v){return typeof v=="function"?v(f):v}function d1(f){var v=Aa();return yM(v,mn,f)}function yM(f,v,A){var D=f.queue;if(D===null)throw Error(r(311));D.lastRenderedReducer=A;var k=f.baseQueue,U=D.pending;if(U!==null){if(k!==null){var ee=k.next;k.next=U.next,U.next=ee}v.baseQueue=k=U,D.pending=null}if(U=f.baseState,k===null)f.memoizedState=U;else{v=k.next;var xe=ee=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?(xe=Ie=Ct,ee=U):Ie=Ie.next=Ct,tr.lanes|=ot,Xu|=ot;Ct=it.action,Dp&&A(U,Ct),U=it.hasEagerState?it.eagerState:A(U,Ct)}else ot={lane:Ct,revertLane:it.revertLane,gesture:it.gesture,action:it.action,hasEagerState:it.hasEagerState,eagerState:it.eagerState,next:null},Ie===null?(xe=Ie=ot,ee=U):Ie=Ie.next=ot,tr.lanes|=Ct,Xu|=Ct;it=it.next}while(it!==null&&it!==v);if(Ie===null?ee=U:Ie.next=xe,!Do(U,f.memoizedState)&&(La=!0,St&&(A=yc,A!==null)))throw A;f.memoizedState=U,f.baseState=ee,f.baseQueue=Ie,D.lastRenderedState=U}return k===null&&(D.lanes=0),[f.memoizedState,D.dispatch]}function xM(f){var v=Aa(),A=v.queue;if(A===null)throw Error(r(311));A.lastRenderedReducer=f;var D=A.dispatch,k=A.pending,U=v.memoizedState;if(k!==null){A.pending=null;var ee=k=k.next;do U=f(U,ee.action),ee=ee.next;while(ee!==k);Do(U,v.memoizedState)||(La=!0),v.memoizedState=U,v.baseQueue===null&&(v.baseState=U),A.lastRenderedState=U}return[U,D]}function v3(f,v,A){var D=tr,k=Aa(),U=Tr;if(U){if(A===void 0)throw Error(r(407));A=A()}else A=v();var ee=!Do((mn||k).memoizedState,A);if(ee&&(k.memoizedState=A,La=!0),k=k.queue,TM(b3.bind(null,D,k,f),[f]),k.getSnapshot!==v||ee||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));U||(Wn&127)!==0||y3(D,v,A)}return A}function y3(f,v,A){f.flags|=16384,f={getSnapshot:v,value:A},v=tr.updateQueue,v===null?(v=h1(),tr.updateQueue=v,v.stores=[f]):(A=v.stores,A===null?v.stores=[f]:A.push(f))}function x3(f,v,A,D){v.value=A,v.getSnapshot=D,w3(v)&&_3(f)}function b3(f,v,A){return A(function(){w3(v)&&_3(f)})}function w3(f){var v=f.getSnapshot;f=f.value;try{var A=v();return!Do(f,A)}catch{return!0}}function _3(f){var v=Oo(f,2);v!==null&&dr(v,f,2)}function bM(f){var v=Ka();if(typeof f=="function"){var A=f;if(f=A(),Dp){wt(!0);try{A()}finally{wt(!1)}}}return v.memoizedState=v.baseState=f,v.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gh,lastRenderedState:f},v}function wM(f,v,A,D){return f.baseState=A,yM(f,mn,typeof D=="function"?D:Gh)}function dU(f,v,A,D,k){if(g1(f))throw Error(r(485));if(f=v.action,f!==null){var U={payload:k,action:f,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(ee){U.listeners.push(ee)}};H.T!==null?A(!0):U.isTransition=!1,D(U),A=v.pending,A===null?(U.next=v.pending=U,S3(v,U)):(U.next=A.next,v.pending=A.next=U)}}function S3(f,v){var A=v.action,D=v.payload,k=f.state;if(v.isTransition){var U=H.T,ee={};H.T=ee;try{var xe=A(k,D),Ie=H.S;Ie!==null&&Ie(ee,xe),A3(f,v,xe)}catch(it){_M(f,v,it)}finally{U!==null&&ee.types!==null&&(U.types=ee.types),H.T=U}}else try{U=A(k,D),A3(f,v,U)}catch(it){_M(f,v,it)}}function A3(f,v,A){A!==null&&typeof A=="object"&&typeof A.then=="function"?A.then(function(D){M3(f,v,D)},function(D){return _M(f,v,D)}):M3(f,v,A)}function M3(f,v,A){v.status="fulfilled",v.value=A,E3(v),f.state=A,v=f.pending,v!==null&&(A=v.next,A===v?f.pending=null:(A=A.next,v.next=A,S3(f,A)))}function _M(f,v,A){var D=f.pending;if(f.pending=null,D!==null){D=D.next;do v.status="rejected",v.reason=A,E3(v),v=v.next;while(v!==D)}f.action=null}function E3(f){f=f.listeners;for(var v=0;v<f.length;v++)(0,f[v])()}function SM(f,v){return v}function AM(f,v){if(Tr){var A=qi.formState;if(A!==null){e:{var D=tr;if(Tr){if(Pn){t:{for(var k=Pn,U=Il;k.nodeType!==8;){if(!U){k=null;break t}if(k=Ku(k.nextSibling),k===null){k=null;break t}}U=k.data,k=U==="F!"||U==="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:SM,lastRenderedState:v},A.queue=D,A=G3.bind(null,tr,D),D.dispatch=A,D=bM(!1),U=RM.bind(null,tr,!1,D.queue),D=Ka(),k={state:v,dispatch:null,action:f,pending:null},D.queue=k,A=dU.bind(null,tr,k,U,A),k.dispatch=A,D.memoizedState=f,[v,A,!1]}function T3(f){var v=Aa();return MM(v,mn,f)}function MM(f,v,A){if(v=yM(f,v,SM)[0],f=d1(Gh)[0],typeof v=="object"&&v!==null&&typeof v.then=="function")try{var D=fy(v)}catch(ee){throw ee===Ap?ur:ee}else D=v;v=Aa();var k=v.queue,U=k.dispatch;return A!==v.memoizedState&&(tr.flags|=2048,$d(9,{destroy:void 0},C3.bind(null,k,A),null)),[D,U,f]}function C3(f,v){f.action=v}function EM(f){var v=Aa(),A=mn;if(A!==null)return MM(v,A,f);Aa(),v=v.memoizedState,A=Aa();var D=A.queue.dispatch;return A.memoizedState=f,[v,D,!1]}function $d(f,v,A,D){return f={tag:f,create:A,deps:D,inst:v,next:null},v=tr.updateQueue,v===null&&(v=h1(),tr.updateQueue=v),A=v.lastEffect,A===null?v.lastEffect=f.next=f:(D=A.next,A.next=f,f.next=D,v.lastEffect=f),f}function f1(){return Aa().memoizedState}function p1(f,v,A,D){var k=Ka();tr.flags|=f,k.memoizedState=$d(1|v,{destroy:void 0},A,D===void 0?null:D)}function m1(f,v,A,D){var k=Aa();D=D===void 0?null:D;var U=k.memoizedState.inst;mn!==null&&D!==null&&fM(D,mn.memoizedState.deps)?k.memoizedState=$d(v,U,A,D):(tr.flags|=f,k.memoizedState=$d(1|v,U,A,D))}function P3(f,v){p1(8390656,8,f,v)}function TM(f,v){m1(2048,8,f,v)}function D3(f){tr.flags|=4;var v=tr.updateQueue;if(v===null)v=h1(),tr.updateQueue=v,v.events=[f];else{var A=v.events;A===null?v.events=[f]:A.push(f)}}function O3(f){var v=Aa().memoizedState;return D3({ref:v,nextImpl:f}),function(){if((vi&2)!==0)throw Error(r(440));return v.impl.apply(void 0,arguments)}}function R3(f,v){return m1(4,2,f,v)}function I3(f,v){return m1(4,4,f,v)}function N3(f,v){if(typeof v=="function"){f=f();var A=v(f);return function(){typeof A=="function"?A():v(null)}}if(v!=null)return f=f(),v.current=f,function(){v.current=null}}function L3(f,v,A){A=A!=null?A.concat([f]):null,m1(4,4,N3.bind(null,v,f),A)}function CM(){}function k3(f,v){var A=Aa();v=v===void 0?null:v;var D=A.memoizedState;return v!==null&&fM(v,D[1])?D[0]:(A.memoizedState=[f,v],f)}function B3(f,v){var A=Aa();v=v===void 0?null:v;var D=A.memoizedState;if(v!==null&&fM(v,D[1]))return D[0];if(D=f(),Dp){wt(!0);try{f()}finally{wt(!1)}}return A.memoizedState=[D,v],D}function PM(f,v,A){return A===void 0||(Wn&1073741824)!==0&&(lr&261930)===0?f.memoizedState=v:(f.memoizedState=A,f=yr(),tr.lanes|=f,Xu|=f,A)}function z3(f,v,A,D){return Do(A,v)?A:Lg.current!==null?(f=PM(f,A,D),Do(f,v)||(La=!0),f):(Wn&42)===0||(Wn&1073741824)!==0&&(lr&261930)===0?(La=!0,f.memoizedState=A):(f=yr(),tr.lanes|=f,Xu|=f,v)}function U3(f,v,A,D,k){var U=G.p;G.p=U!==0&&8>U?U:8;var ee=H.T,xe={};H.T=xe,RM(f,!1,v,A);try{var Ie=k(),it=H.S;if(it!==null&&it(xe,Ie),Ie!==null&&typeof Ie=="object"&&typeof Ie.then=="function"){var St=sM(Ie,D);py(f,v,St,jl(f))}else py(f,v,D,jl(f))}catch(Ct){py(f,v,{then:function(){},status:"rejected",reason:Ct},jl())}finally{G.p=U,ee!==null&&xe.types!==null&&(ee.types=xe.types),H.T=ee}}function fU(){}function DM(f,v,A,D){if(f.tag!==5)throw Error(r(476));var k=j3(f).queue;U3(f,k,v,Q,A===null?fU:function(){return F3(f),A(D)})}function j3(f){var v=f.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},f.memoizedState=v,f=f.alternate,f!==null&&(f.memoizedState=v),v}function F3(f){var v=j3(f);v.next===null&&(v=f.alternate.memoizedState),py(f,v.next.queue,{},jl())}function OM(){return Fi(JM)}function V3(){return Aa().memoizedState}function H3(){return Aa().memoizedState}function pU(f){for(var v=f.return;v!==null;){switch(v.tag){case 24:case 3:var A=jl();f=Vh(A);var D=qd(v,f,A);D!==null&&(dr(D,v,A),Xd(D,v,A)),v={cache:rM()},f.payload=v;return}v=v.return}}function mU(f,v,A){var D=jl();A={lane:D,revertLane:0,gesture:null,action:A,hasEagerState:!1,eagerState:null,next:null},g1(f)?W3(v,A):(A=Xb(f,v,A,D),A!==null&&(dr(A,f,D),q3(A,v,D)))}function G3(f,v,A){var D=jl();py(f,v,A,D)}function py(f,v,A,D){var k={lane:D,revertLane:0,gesture:null,action:A,hasEagerState:!1,eagerState:null,next:null};if(g1(f))W3(v,k);else{var U=f.alternate;if(f.lanes===0&&(U===null||U.lanes===0)&&(U=v.lastRenderedReducer,U!==null))try{var ee=v.lastRenderedState,xe=U(ee,A);if(k.hasEagerState=!0,k.eagerState=xe,Do(xe,ee))return ps(f,v,k,0),qi===null&&ry(),!1}catch{}finally{}if(A=Xb(f,v,k,D),A!==null)return dr(A,f,D),q3(A,v,D),!0}return!1}function RM(f,v,A,D){if(D={lane:2,revertLane:ht(),gesture:null,action:D,hasEagerState:!1,eagerState:null,next:null},g1(f)){if(v)throw Error(r(479))}else v=Xb(f,A,D,2),v!==null&&dr(v,f,2)}function g1(f){var v=f.alternate;return f===tr||v!==null&&v===tr}function W3(f,v){kg=bc=!0;var A=f.pending;A===null?v.next=v:(v.next=A.next,A.next=v),f.pending=v}function q3(f,v,A){if((A&4194048)!==0){var D=v.lanes;D&=f.pendingLanes,A|=D,v.lanes=A,Dl(f,A)}}var zg={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};zg.useEffectEvent=ea;var X3={readContext:Fi,use:Yd,useCallback:function(f,v){return Ka().memoizedState=[f,v===void 0?null:v],f},useContext:Fi,useEffect:P3,useImperativeHandle:function(f,v,A){A=A!=null?A.concat([f]):null,p1(4194308,4,N3.bind(null,v,f),A)},useLayoutEffect:function(f,v){return p1(4194308,4,f,v)},useInsertionEffect:function(f,v){p1(4,2,f,v)},useMemo:function(f,v){var A=Ka();v=v===void 0?null:v;var D=f();if(Dp){wt(!0);try{f()}finally{wt(!1)}}return A.memoizedState=[D,v],D},useReducer:function(f,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,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:f,lastRenderedState:k},D.queue=f,f=f.dispatch=mU.bind(null,tr,f),[D.memoizedState,f]},useRef:function(f){var v=Ka();return f={current:f},v.memoizedState=f},useState:function(f){f=bM(f);var v=f.queue,A=G3.bind(null,tr,v);return v.dispatch=A,[f.memoizedState,A]},useDebugValue:CM,useDeferredValue:function(f,v){var A=Ka();return PM(A,f,v)},useTransition:function(){var f=bM(!1);return f=U3.bind(null,tr,f.queue,!0,!1),Ka().memoizedState=f,[!1,f]},useSyncExternalStore:function(f,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 U={value:A,getSnapshot:v};return k.queue=U,P3(b3.bind(null,D,U,f),[f]),D.flags|=2048,$d(9,{destroy:void 0},x3.bind(null,D,U,A,v),null),A},useId:function(){var f=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=c1++,0<A&&(v+="H"+A.toString(32)),v+="_"}else A=dM++,v="_"+v+"r_"+A.toString(32)+"_";return f.memoizedState=v},useHostTransitionStatus:OM,useFormState:AM,useActionState:AM,useOptimistic:function(f){var v=Ka();v.memoizedState=v.baseState=f;var A={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return v.queue=A,v=RM.bind(null,tr,!0,A),A.dispatch=v,[f,v]},useMemoCache:vM,useCacheRefresh:function(){return Ka().memoizedState=pU.bind(null,tr)},useEffectEvent:function(f){var v=Ka(),A={impl:f};return v.memoizedState=A,function(){if((vi&2)!==0)throw Error(r(440));return A.impl.apply(void 0,arguments)}}},IM={readContext:Fi,use:Yd,useCallback:k3,useContext:Fi,useEffect:TM,useImperativeHandle:L3,useInsertionEffect:R3,useLayoutEffect:I3,useMemo:B3,useReducer:d1,useRef:f1,useState:function(){return d1(Gh)},useDebugValue:CM,useDeferredValue:function(f,v){var A=Aa();return z3(A,mn.memoizedState,f,v)},useTransition:function(){var f=d1(Gh)[0],v=Aa().memoizedState;return[typeof f=="boolean"?f:fy(f),v]},useSyncExternalStore:v3,useId:V3,useHostTransitionStatus:OM,useFormState:T3,useActionState:T3,useOptimistic:function(f,v){var A=Aa();return wM(A,mn,f,v)},useMemoCache:vM,useCacheRefresh:H3};IM.useEffectEvent=O3;var wc={readContext:Fi,use:Yd,useCallback:k3,useContext:Fi,useEffect:TM,useImperativeHandle:L3,useInsertionEffect:R3,useLayoutEffect:I3,useMemo:B3,useReducer:xM,useRef:f1,useState:function(){return xM(Gh)},useDebugValue:CM,useDeferredValue:function(f,v){var A=Aa();return mn===null?PM(A,f,v):z3(A,mn.memoizedState,f,v)},useTransition:function(){var f=xM(Gh)[0],v=Aa().memoizedState;return[typeof f=="boolean"?f:fy(f),v]},useSyncExternalStore:v3,useId:V3,useHostTransitionStatus:OM,useFormState:EM,useActionState:EM,useOptimistic:function(f,v){var A=Aa();return mn!==null?wM(A,mn,f,v):(A.baseState=f,[f,A.queue.dispatch])},useMemoCache:vM,useCacheRefresh:H3};wc.useEffectEvent=O3;function v1(f,v,A,D){v=f.memoizedState,A=A(D,v),A=A==null?v:h({},v,A),f.memoizedState=A,f.lanes===0&&(f.updateQueue.baseState=A)}var my={enqueueSetState:function(f,v,A){f=f._reactInternals;var D=jl(),k=Vh(D);k.payload=v,A!=null&&(k.callback=A),v=qd(f,k,D),v!==null&&(dr(v,f,D),Xd(v,f,D))},enqueueReplaceState:function(f,v,A){f=f._reactInternals;var D=jl(),k=Vh(D);k.tag=1,k.payload=v,A!=null&&(k.callback=A),v=qd(f,k,D),v!==null&&(dr(v,f,D),Xd(v,f,D))},enqueueForceUpdate:function(f,v){f=f._reactInternals;var A=jl(),D=Vh(A);D.tag=2,v!=null&&(D.callback=v),v=qd(f,D,A),v!==null&&(dr(v,f,A),Xd(v,f,A))}};function NM(f,v,A,D,k,U,ee){return f=f.stateNode,typeof f.shouldComponentUpdate=="function"?f.shouldComponentUpdate(D,U,ee):v.prototype&&v.prototype.isPureReactComponent?!bg(A,D)||!bg(k,U):!0}function LM(f,v,A,D){f=v.state,typeof v.componentWillReceiveProps=="function"&&v.componentWillReceiveProps(A,D),typeof v.UNSAFE_componentWillReceiveProps=="function"&&v.UNSAFE_componentWillReceiveProps(A,D),v.state!==f&&my.enqueueReplaceState(v,v.state,null)}function Kd(f,v){var A=v;if("ref"in v){A={};for(var D in v)D!=="ref"&&(A[D]=v[D])}if(f=f.defaultProps){A===v&&(A=h({},A));for(var k in f)A[k]===void 0&&(A[k]=f[k])}return A}function Y3(f){iy(f)}function kM(f){console.error(f)}function BM(f){iy(f)}function y1(f,v){try{var A=f.onUncaughtError;A(v.value,{componentStack:v.stack})}catch(D){setTimeout(function(){throw D})}}function $3(f,v,A){try{var D=f.onCaughtError;D(A.value,{componentStack:A.stack,errorBoundary:v.tag===1?v.stateNode:null})}catch(k){setTimeout(function(){throw k})}}function zM(f,v,A){return A=Vh(A),A.tag=3,A.payload={element:null},A.callback=function(){y1(f,v)},A}function UM(f){return f=Vh(f),f.tag=3,f}function K3(f,v,A,D){var k=A.type.getDerivedStateFromError;if(typeof k=="function"){var U=D.value;f.payload=function(){return k(U)},f.callback=function(){$3(v,A,D)}}var ee=A.stateNode;ee!==null&&typeof ee.componentDidCatch=="function"&&(f.callback=function(){$3(v,A,D),typeof k!="function"&&(Ta===null?Ta=new Set([this]):Ta.add(this));var xe=D.stack;this.componentDidCatch(D.value,{componentStack:xe!==null?xe:""})})}function Qa(f,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===n1?A.flags|=16384:(v=A.updateQueue,v===null?A.updateQueue=new Set([D]):v.add(D),Ty(f,D,k)),!1;case 22:return A.flags|=65536,D===n1?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(f,D,k)),!1}throw Error(r(435,A.tag))}return Ty(f,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&&(f=Error(r(422),{cause:D}),ku(Rl(f,A)))):(D!==Cg&&(v=Error(r(423),{cause:D}),ku(Rl(v,A))),f=f.current.alternate,f.flags|=65536,k&=-k,f.lanes|=k,D=Rl(D,A),k=zM(f.stateNode,D,k),Mi(f,k),ta!==4&&(ta=2)),!1;var U=Error(r(520),{cause:D});if(U=Rl(U,A),jp===null?jp=[U]:jp.push(U),ta!==4&&(ta=2),v===null)return!0;D=Rl(D,A),A=v;do{switch(A.tag){case 3:return A.flags|=65536,f=k&-k,A.lanes|=f,f=zM(A.stateNode,D,f),Mi(A,f),!1;case 1:if(v=A.type,U=A.stateNode,(A.flags&128)===0&&(typeof v.getDerivedStateFromError=="function"||U!==null&&typeof U.componentDidCatch=="function"&&(Ta===null||!Ta.has(U))))return A.flags|=65536,k&=-k,A.lanes|=k,k=UM(k),K3(k,f,A,D),Mi(A,k),!1}A=A.return}while(A!==null);return!1}var x1=Error(r(461)),La=!1;function ms(f,v,A,D){v.child=f===null?o1(v,null,A,D):Fh(v,f.child,A,D)}function jM(f,v,A,D,k){A=A.render;var U=v.ref;if("ref"in D){var ee={};for(var xe in D)xe!=="ref"&&(ee[xe]=D[xe])}else ee=D;return Gd(v),D=u1(f,v,A,ee,U,k),xe=pM(),f!==null&&!La?(mM(f,v,k),Ma(f,v,k)):(Tr&&xe&&Nu(v),v.flags|=1,ms(f,v,D,k),v.child)}function Ip(f,v,A,D,k){if(f===null){var U=A.type;return typeof U=="function"&&!Yb(U)&&U.defaultProps===void 0&&A.compare===null?(v.tag=15,v.type=U,b1(f,v,U,D,k)):(f=Ru(A.type,null,D,v,v.mode,k),f.ref=v.ref,f.return=v,v.child=f)}if(U=f.child,!E1(f,k)){var ee=U.memoizedProps;if(A=A.compare,A=A!==null?A:bg,A(ee,D)&&f.ref===v.ref)return Ma(f,v,k)}return v.flags|=1,f=tl(U,D),f.ref=v.ref,f.return=v,v.child=f}function b1(f,v,A,D,k){if(f!==null){var U=f.memoizedProps;if(bg(U,D)&&f.ref===v.ref)if(La=!1,v.pendingProps=D=U,E1(f,k))(f.flags&131072)!==0&&(La=!0);else return v.lanes=f.lanes,Ma(f,v,k)}return Ug(f,v,A,D,k)}function Np(f,v,A,D){var k=D.children,U=f!==null?f.memoizedState:null;if(f===null&&v.stateNode===null&&(v.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),D.mode==="hidden"){if((v.flags&128)!==0){if(U=U!==null?U.baseLanes|A:A,f!==null){for(D=v.child=f.child,k=0;D!==null;)k=k|D.lanes|D.childLanes,D=D.sibling;D=k&~U}else D=0,v.child=null;return sl(f,v,U,A,D)}if((A&536870912)!==0)v.memoizedState={baseLanes:0,cachePool:null},f!==null&&sy(v,U!==null?U.cachePool:null),U!==null?p3(v,U):uM(),m3(v);else return D=v.lanes=536870912,sl(f,v,U!==null?U.baseLanes|A:A,A,D)}else U!==null?(sy(v,U.cachePool),p3(v,U),al(),v.memoizedState=null):(f!==null&&sy(v,null),uM(),al());return ms(f,v,k,A),v.child}function Fu(f,v){return f!==null&&f.tag===22||v.stateNode!==null||(v.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),v.sibling}function sl(f,v,A,D,k){var U=r1();return U=U===null?null:{parent:Na._currentValue,pool:U},v.memoizedState={baseLanes:A,cachePool:U},f!==null&&sy(v,null),uM(),m3(v),f!==null&&Uu(f,v,D,!0),v.childLanes=k,null}function w1(f,v){return v=M1({mode:v.mode,children:v.children},f.mode),v.ref=f.ref,f.child=v,v.return=f,v}function Q3(f,v,A){return Fh(v,f.child,null,A),f=w1(v,v.pendingProps),f.flags|=2,Sa(v),v.memoizedState=null,f}function _1(f,v,A){var D=v.pendingProps,k=(v.flags&128)!==0;if(v.flags&=-129,f===null){if(Tr){if(D.mode==="hidden")return f=w1(v,D),v.lanes=536870912,Fu(null,f);if(hM(v),(f=Pn)?(f=WK(f,Il),f=f!==null&&f.data==="&"?f:null,f!==null&&(v.memoizedState={dehydrated:f,treeContext:Bh!==null?{id:Jn,overflow:eu}:null,retryLane:536870912,hydrationErrors:null},A=Mg(f),A.return=v,v.child=A,pa=v,Pn=null)):f=null,f===null)throw Lu(v);return v.lanes=536870912,null}return w1(v,D)}var U=f.memoizedState;if(U!==null){var ee=U.dehydrated;if(hM(v),k)if(v.flags&256)v.flags&=-257,v=Q3(f,v,A);else if(v.memoizedState!==null)v.child=f.child,v.flags|=128,v=null;else throw Error(r(558));else if(La||Uu(f,v,A,!1),k=(A&f.childLanes)!==0,La||k){if(D=qi,D!==null&&(ee=Ih(D,A),ee!==0&&ee!==U.retryLane))throw U.retryLane=ee,Oo(f,ee),dr(D,f,ee),x1;Wg(),v=Q3(f,v,A)}else f=U.treeContext,Pn=Ku(ee.nextSibling),pa=v,Tr=!0,zh=null,Il=!1,f!==null&&Zb(v,f),v=w1(v,D),v.flags|=4096;return v}return f=tl(f.child,{mode:D.mode,children:D.children}),f.ref=v.ref,v.child=f,f.return=v,f}function Lp(f,v){var A=v.ref;if(A===null)f!==null&&f.ref!==null&&(v.flags|=4194816);else{if(typeof A!="function"&&typeof A!="object")throw Error(r(284));(f===null||f.ref!==A)&&(v.flags|=4194816)}}function Ug(f,v,A,D,k){return Gd(v),A=u1(f,v,A,D,void 0,k),D=pM(),f!==null&&!La?(mM(f,v,k),Ma(f,v,k)):(Tr&&D&&Nu(v),v.flags|=1,ms(f,v,A,k),v.child)}function gy(f,v,A,D,k,U){return Gd(v),v.updateQueue=null,A=Op(v,D,A,k),g3(f),D=pM(),f!==null&&!La?(mM(f,v,U),Ma(f,v,U)):(Tr&&D&&Nu(v),v.flags|=1,ms(f,v,A,U),v.child)}function S1(f,v,A,D,k){if(Gd(v),v.stateNode===null){var U=zd,ee=A.contextType;typeof ee=="object"&&ee!==null&&(U=Fi(ee)),U=new A(D,U),v.memoizedState=U.state!==null&&U.state!==void 0?U.state:null,U.updater=my,v.stateNode=U,U._reactInternals=v,U=v.stateNode,U.props=D,U.state=v.memoizedState,U.refs={},cy(v),ee=A.contextType,U.context=typeof ee=="object"&&ee!==null?Fi(ee):zd,U.state=v.memoizedState,ee=A.getDerivedStateFromProps,typeof ee=="function"&&(v1(v,A,ee,D),U.state=v.memoizedState),typeof A.getDerivedStateFromProps=="function"||typeof U.getSnapshotBeforeUpdate=="function"||typeof U.UNSAFE_componentWillMount!="function"&&typeof U.componentWillMount!="function"||(ee=U.state,typeof U.componentWillMount=="function"&&U.componentWillMount(),typeof U.UNSAFE_componentWillMount=="function"&&U.UNSAFE_componentWillMount(),ee!==U.state&&my.enqueueReplaceState(U,U.state,null),Ig(v,D,U,k),uy(),U.state=v.memoizedState),typeof U.componentDidMount=="function"&&(v.flags|=4194308),D=!0}else if(f===null){U=v.stateNode;var xe=v.memoizedProps,Ie=Kd(A,xe);U.props=Ie;var it=U.context,St=A.contextType;ee=zd,typeof St=="object"&&St!==null&&(ee=Fi(St));var Ct=A.getDerivedStateFromProps;St=typeof Ct=="function"||typeof U.getSnapshotBeforeUpdate=="function",xe=v.pendingProps!==xe,St||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(xe||it!==ee)&&LM(v,U,D,ee),Ro=!1;var ot=v.memoizedState;U.state=ot,Ig(v,D,U,k),uy(),it=v.memoizedState,xe||ot!==it||Ro?(typeof Ct=="function"&&(v1(v,A,Ct,D),it=v.memoizedState),(Ie=Ro||NM(v,A,Ie,D,ot,it,ee))?(St||typeof U.UNSAFE_componentWillMount!="function"&&typeof U.componentWillMount!="function"||(typeof U.componentWillMount=="function"&&U.componentWillMount(),typeof U.UNSAFE_componentWillMount=="function"&&U.UNSAFE_componentWillMount()),typeof U.componentDidMount=="function"&&(v.flags|=4194308)):(typeof U.componentDidMount=="function"&&(v.flags|=4194308),v.memoizedProps=D,v.memoizedState=it),U.props=D,U.state=it,U.context=ee,D=Ie):(typeof U.componentDidMount=="function"&&(v.flags|=4194308),D=!1)}else{U=v.stateNode,lM(f,v),ee=v.memoizedProps,St=Kd(A,ee),U.props=St,Ct=v.pendingProps,ot=U.context,it=A.contextType,Ie=zd,typeof it=="object"&&it!==null&&(Ie=Fi(it)),xe=A.getDerivedStateFromProps,(it=typeof xe=="function"||typeof U.getSnapshotBeforeUpdate=="function")||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(ee!==Ct||ot!==Ie)&&LM(v,U,D,Ie),Ro=!1,ot=v.memoizedState,U.state=ot,Ig(v,D,U,k),uy();var gt=v.memoizedState;ee!==Ct||ot!==gt||Ro||f!==null&&f.dependencies!==null&&ay(f.dependencies)?(typeof xe=="function"&&(v1(v,A,xe,D),gt=v.memoizedState),(St=Ro||NM(v,A,St,D,ot,gt,Ie)||f!==null&&f.dependencies!==null&&ay(f.dependencies))?(it||typeof U.UNSAFE_componentWillUpdate!="function"&&typeof U.componentWillUpdate!="function"||(typeof U.componentWillUpdate=="function"&&U.componentWillUpdate(D,gt,Ie),typeof U.UNSAFE_componentWillUpdate=="function"&&U.UNSAFE_componentWillUpdate(D,gt,Ie)),typeof U.componentDidUpdate=="function"&&(v.flags|=4),typeof U.getSnapshotBeforeUpdate=="function"&&(v.flags|=1024)):(typeof U.componentDidUpdate!="function"||ee===f.memoizedProps&&ot===f.memoizedState||(v.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||ee===f.memoizedProps&&ot===f.memoizedState||(v.flags|=1024),v.memoizedProps=D,v.memoizedState=gt),U.props=D,U.state=gt,U.context=Ie,D=St):(typeof U.componentDidUpdate!="function"||ee===f.memoizedProps&&ot===f.memoizedState||(v.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||ee===f.memoizedProps&&ot===f.memoizedState||(v.flags|=1024),D=!1)}return U=D,Lp(f,v),D=(v.flags&128)!==0,U||D?(U=v.stateNode,A=D&&typeof A.getDerivedStateFromError!="function"?null:U.render(),v.flags|=1,f!==null&&D?(v.child=Fh(v,f.child,null,k),v.child=Fh(v,null,A,k)):ms(f,v,A,k),v.memoizedState=U.state,f=v.child):f=Ma(f,v,k),f}function Z3(f,v,A,D){return Vd(),v.flags|=256,ms(f,v,A,D),v.child}var FM={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lo(f){return{baseLanes:f,cachePool:oM()}}function A1(f,v,A){return f=f!==null?f.childLanes&~A:0,v&&(f|=ko),f}function J3(f,v,A){var D=v.pendingProps,k=!1,U=(v.flags&128)!==0,ee;if((ee=U)||(ee=f!==null&&f.memoizedState===null?!1:(Cr.current&2)!==0),ee&&(k=!0,v.flags&=-129),ee=(v.flags&32)!==0,v.flags&=-33,f===null){if(Tr){if(k?Hh(v):al(),(f=Pn)?(f=WK(f,Il),f=f!==null&&f.data!=="&"?f:null,f!==null&&(v.memoizedState={dehydrated:f,treeContext:Bh!==null?{id:Jn,overflow:eu}:null,retryLane:536870912,hydrationErrors:null},A=Mg(f),A.return=v,v.child=A,pa=v,Pn=null)):f=null,f===null)throw Lu(v);return PU(f)?v.lanes=32:v.lanes=536870912,null}var xe=D.children;return D=D.fallback,k?(al(),k=v.mode,xe=M1({mode:"hidden",children:xe},k),D=Ud(D,k,A,null),xe.return=v,D.return=v,xe.sibling=D,v.child=xe,D=v.child,D.memoizedState=lo(A),D.childLanes=A1(f,ee,A),v.memoizedState=FM,Fu(null,D)):(Hh(v),vy(v,xe))}var Ie=f.memoizedState;if(Ie!==null&&(xe=Ie.dehydrated,xe!==null)){if(U)v.flags&256?(Hh(v),v.flags&=-257,v=VM(f,v,A)):v.memoizedState!==null?(al(),v.child=f.child,v.flags|=128,v=null):(al(),xe=D.fallback,k=v.mode,D=M1({mode:"visible",children:D.children},k),xe=Ud(xe,k,A,null),xe.flags|=2,D.return=v,xe.return=v,D.sibling=xe,v.child=D,Fh(v,f.child,null,A),D=v.child,D.memoizedState=lo(A),D.childLanes=A1(f,ee,A),v.memoizedState=FM,v=Fu(null,D));else if(Hh(v),PU(xe)){if(ee=xe.nextSibling&&xe.nextSibling.dataset,ee)var it=ee.dgst;ee=it,D=Error(r(419)),D.stack="",D.digest=ee,ku({value:D,source:null,stack:null}),v=VM(f,v,A)}else if(La||Uu(f,v,A,!1),ee=(A&f.childLanes)!==0,La||ee){if(ee=qi,ee!==null&&(D=Ih(ee,A),D!==0&&D!==Ie.retryLane))throw Ie.retryLane=D,Oo(f,D),dr(ee,f,D),x1;CU(xe)||Wg(),v=VM(f,v,A)}else CU(xe)?(v.flags|=192,v.child=f.child,v=null):(f=Ie.treeContext,Pn=Ku(xe.nextSibling),pa=v,Tr=!0,zh=null,Il=!1,f!==null&&Zb(v,f),v=vy(v,D.children),v.flags|=4096);return v}return k?(al(),xe=D.fallback,k=v.mode,Ie=f.child,it=Ie.sibling,D=tl(Ie,{mode:"hidden",children:D.children}),D.subtreeFlags=Ie.subtreeFlags&65011712,it!==null?xe=tl(it,xe):(xe=Ud(xe,k,A,null),xe.flags|=2),xe.return=v,D.return=v,D.sibling=xe,v.child=D,Fu(null,D),D=v.child,xe=f.child.memoizedState,xe===null?xe=lo(A):(k=xe.cachePool,k!==null?(Ie=Na._currentValue,k=k.parent!==Ie?{parent:Ie,pool:Ie}:k):k=oM(),xe={baseLanes:xe.baseLanes|A,cachePool:k}),D.memoizedState=xe,D.childLanes=A1(f,ee,A),v.memoizedState=FM,Fu(f.child,D)):(Hh(v),A=f.child,f=A.sibling,A=tl(A,{mode:"visible",children:D.children}),A.return=v,A.sibling=null,f!==null&&(ee=v.deletions,ee===null?(v.deletions=[f],v.flags|=16):ee.push(f)),v.child=A,v.memoizedState=null,A)}function vy(f,v){return v=M1({mode:"visible",children:v},f.mode),v.return=f,f.child=v}function M1(f,v){return f=Zn(22,f,null,v),f.lanes=0,f}function VM(f,v,A){return Fh(v,f.child,null,A),f=vy(v,v.pendingProps.children),f.flags|=2,v.memoizedState=null,f}function e2(f,v,A){f.lanes|=v;var D=f.alternate;D!==null&&(D.lanes|=v),e1(f.return,v,A)}function kp(f,v,A,D,k,U){var ee=f.memoizedState;ee===null?f.memoizedState={isBackwards:v,rendering:null,renderingStartTime:0,last:D,tail:A,tailMode:k,treeForkCount:U}:(ee.isBackwards=v,ee.rendering=null,ee.renderingStartTime=0,ee.last=D,ee.tail=A,ee.tailMode=k,ee.treeForkCount=U)}function ol(f,v,A){var D=v.pendingProps,k=D.revealOrder,U=D.tail;D=D.children;var ee=Cr.current,xe=(ee&2)!==0;if(xe?(ee=ee&1|2,v.flags|=128):ee&=1,ae(Cr,ee),ms(f,v,D,A),D=Tr?Tg:0,!xe&&f!==null&&(f.flags&128)!==0)e:for(f=v.child;f!==null;){if(f.tag===13)f.memoizedState!==null&&e2(f,A,v);else if(f.tag===19)e2(f,A,v);else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===v)break e;for(;f.sibling===null;){if(f.return===null||f.return===v)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}switch(k){case"forwards":for(A=v.child,k=null;A!==null;)f=A.alternate,f!==null&&Ll(f)===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,U,D);break;case"backwards":case"unstable_legacy-backwards":for(A=null,k=v.child,v.child=null;k!==null;){if(f=k.alternate,f!==null&&Ll(f)===null){v.child=k;break}f=k.sibling,k.sibling=A,A=k,k=f}kp(v,!0,A,null,U,D);break;case"together":kp(v,!1,null,null,void 0,D);break;default:v.memoizedState=null}return v.child}function Ma(f,v,A){if(f!==null&&(v.dependencies=f.dependencies),Xu|=v.lanes,(A&v.childLanes)===0)if(f!==null){if(Uu(f,v,A,!1),(A&v.childLanes)===0)return null}else return null;if(f!==null&&v.child!==f.child)throw Error(r(153));if(v.child!==null){for(f=v.child,A=tl(f,f.pendingProps),v.child=A,A.return=v;f.sibling!==null;)f=f.sibling,A=A.sibling=tl(f,f.pendingProps),A.return=v;A.sibling=null}return v.child}function E1(f,v){return(f.lanes&v)!==0?!0:(f=f.dependencies,!!(f!==null&&ay(f)))}function gU(f,v,A){switch(v.tag){case 3:ve(v,v.stateNode.containerInfo),Uh(v,Na,f.memoizedState.cache),Vd();break;case 27:case 5:_e(v);break;case 4:ve(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,hM(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(f,v,A):(Hh(v),f=Ma(f,v,A),f!==null?f.sibling:null);Hh(v);break;case 19:var k=(f.flags&128)!==0;if(D=(A&v.childLanes)!==0,D||(Uu(f,v,A,!1),D=(A&v.childLanes)!==0),k){if(D)return ol(f,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(f,v,A,v.pendingProps);case 24:Uh(v,Na,f.memoizedState.cache)}return Ma(f,v,A)}function T1(f,v,A){if(f!==null)if(f.memoizedProps!==v.pendingProps)La=!0;else{if(!E1(f,A)&&(v.flags&128)===0)return La=!1,gU(f,v,A);La=(f.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(f=Mp(v.elementType),v.type=f,typeof f=="function")Yb(f)?(D=Kd(f,D),v.tag=1,v=S1(null,v,f,D,A)):(v.tag=0,v=Ug(null,v,f,D,A));else{if(f!=null){var k=f.$$typeof;if(k===M){v.tag=11,v=jM(null,v,f,D,A);break e}else if(k===R){v.tag=14,v=Ip(null,v,f,D,A);break e}}throw v=V(f)||f,Error(r(306,v,""))}}return v;case 0:return Ug(f,v,v.type,v.pendingProps,A);case 1:return D=v.type,k=Kd(D,v.pendingProps),S1(f,v,D,k,A);case 3:e:{if(ve(v,v.stateNode.containerInfo),f===null)throw Error(r(387));D=v.pendingProps;var U=v.memoizedState;k=U.element,lM(f,v),Ig(v,D,null,A);var ee=v.memoizedState;if(D=ee.cache,Uh(v,Na,D),D!==U.cache&&t1(v,[Na],A,!0),uy(),D=ee.element,U.isDehydrated)if(U={element:D,isDehydrated:!1,cache:ee.cache},v.updateQueue.baseState=U,v.memoizedState=U,v.flags&256){v=Z3(f,v,D,A);break e}else if(D!==k){k=Rl(Error(r(424)),v),ku(k),v=Z3(f,v,D,A);break e}else{switch(f=v.stateNode.containerInfo,f.nodeType){case 9:f=f.body;break;default:f=f.nodeName==="HTML"?f.ownerDocument.body:f}for(Pn=Ku(f.firstChild),pa=v,Tr=!0,zh=null,Il=!0,A=o1(v,null,D,A),v.child=A;A;)A.flags=A.flags&-3|4096,A=A.sibling}else{if(Vd(),D===k){v=Ma(f,v,A);break e}ms(f,v,D,A)}v=v.child}return v;case 26:return Lp(f,v),f===null?(A=QK(v.type,null,v.pendingProps,null))?v.memoizedState=A:Tr||(A=v.type,f=v.pendingProps,D=n2(J.current).createElement(A),D[lt]=v,D[Vt]=f,zo(D,A,f),De(D),v.stateNode=D):v.memoizedState=QK(v.type,f.memoizedProps,v.pendingProps,f.memoizedState),null;case 27:return _e(v),f===null&&Tr&&(D=v.stateNode=YK(v.type,v.pendingProps,J.current),pa=v,Il=!0,k=Pn,$g(v.type)?(DU=k,Pn=Ku(D.firstChild)):Pn=k),ms(f,v,v.pendingProps.children,A),Lp(f,v),f===null&&(v.flags|=4194304),v.child;case 5:return f===null&&Tr&&((k=D=Pn)&&(D=XMe(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)),_e(v),k=v.type,U=v.pendingProps,ee=f!==null?f.memoizedProps:null,D=U.children,MU(k,U)?D=null:ee!==null&&MU(k,ee)&&(v.flags|=32),v.memoizedState!==null&&(k=u1(f,v,Rp,null,null,A),JM._currentValue=k),Lp(f,v),ms(f,v,D,A),v.child;case 6:return f===null&&Tr&&((f=A=Pn)&&(A=YMe(A,v.pendingProps,Il),A!==null?(v.stateNode=A,pa=v,Pn=null,f=!0):f=!1),f||Lu(v)),null;case 13:return J3(f,v,A);case 4:return ve(v,v.stateNode.containerInfo),D=v.pendingProps,f===null?v.child=Fh(v,null,D,A):ms(f,v,D,A),v.child;case 11:return jM(f,v,v.type,v.pendingProps,A);case 7:return ms(f,v,v.pendingProps,A),v.child;case 8:return ms(f,v,v.pendingProps.children,A),v.child;case 12:return ms(f,v,v.pendingProps.children,A),v.child;case 10:return D=v.pendingProps,Uh(v,v.type,D.value),ms(f,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(f,v,D,A),v.child;case 14:return Ip(f,v,v.type,v.pendingProps,A);case 15:return b1(f,v,v.type,v.pendingProps,A);case 19:return ol(f,v,A);case 31:return _1(f,v,A);case 22:return Np(f,v,A,v.pendingProps);case 24:return Gd(v),D=Fi(Na),f===null?(k=r1(),k===null&&(k=qi,U=rM(),k.pooledCache=U,U.refCount++,U!==null&&(k.pooledCacheLanes|=A),k=U),v.memoizedState={parent:D,cache:k},cy(v),Uh(v,Na,k)):((f.lanes&A)!==0&&(lM(f,v),Ig(v,null,null,A),uy()),k=f.memoizedState,U=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=U.cache,Uh(v,Na,D),D!==k.cache&&t1(v,[Na],A,!0))),ms(f,v,v.pendingProps.children,A),v.child;case 29:throw v.pendingProps}throw Error(r(156,v.tag))}function Vu(f){f.flags|=4}function yy(f,v,A,D,k){if((v=(f.mode&32)!==0)&&(v=!1),v){if(f.flags|=16777216,(k&335544128)===k)if(f.stateNode.complete)f.flags|=8192;else if(ra())f.flags|=8192;else throw ju=n1,oy}else f.flags&=-16777217}function HM(f,v){if(v.type!=="stylesheet"||(v.state.loading&4)!==0)f.flags&=-16777217;else if(f.flags|=16777216,!iQ(v))if(ra())f.flags|=8192;else throw ju=n1,oy}function Wh(f,v){v!==null&&(f.flags|=4),f.flags&16384&&(v=f.tag!==22?Wi():536870912,f.lanes|=v,Un|=v)}function Hu(f,v){if(!Tr)switch(f.tailMode){case"hidden":v=f.tail;for(var A=null;v!==null;)v.alternate!==null&&(A=v),v=v.sibling;A===null?f.tail=null:A.sibling=null;break;case"collapsed":A=f.tail;for(var D=null;A!==null;)A.alternate!==null&&(D=A),A=A.sibling;D===null?v||f.tail===null?f.tail=null:f.tail.sibling=null:D.sibling=null}}function gn(f){var v=f.alternate!==null&&f.alternate.child===f.child,A=0,D=0;if(v)for(var k=f.child;k!==null;)A|=k.lanes|k.childLanes,D|=k.subtreeFlags&65011712,D|=k.flags&65011712,k.return=f,k=k.sibling;else for(k=f.child;k!==null;)A|=k.lanes|k.childLanes,D|=k.subtreeFlags,D|=k.flags,k.return=f,k=k.sibling;return f.subtreeFlags|=D,f.childLanes=A,v}function xy(f,v,A){var D=v.pendingProps;switch(Qb(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,f!==null&&(D=f.memoizedState.cache),v.memoizedState.cache!==D&&(v.flags|=2048),zu(Na),de(),A.pendingContext&&(A.context=A.pendingContext,A.pendingContext=null),(f===null||f.child===null)&&(Pg(v)?Vu(v):f===null||f.memoizedState.isDehydrated&&(v.flags&256)===0||(v.flags|=1024,Jb())),gn(v),null;case 26:var k=v.type,U=v.memoizedState;return f===null?(Vu(v),U!==null?(gn(v),HM(v,U)):(gn(v),yy(v,k,null,D,A))):U?U!==f.memoizedState?(Vu(v),gn(v),HM(v,U)):(gn(v),v.flags&=-16777217):(f=f.memoizedProps,f!==D&&Vu(v),gn(v),yy(v,k,f,D,A)),null;case 27:if(Te(v),A=J.current,k=v.type,f!==null&&v.stateNode!=null)f.memoizedProps!==D&&Vu(v);else{if(!D){if(v.stateNode===null)throw Error(r(166));return gn(v),null}f=oe.current,Pg(v)?l3(v):(f=YK(k,D,A),v.stateNode=f,Vu(v))}return gn(v),null;case 5:if(Te(v),k=v.type,f!==null&&v.stateNode!=null)f.memoizedProps!==D&&Vu(v);else{if(!D){if(v.stateNode===null)throw Error(r(166));return gn(v),null}if(U=oe.current,Pg(v))l3(v);else{var ee=n2(J.current);switch(U){case 1:U=ee.createElementNS("http://www.w3.org/2000/svg",k);break;case 2:U=ee.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;default:switch(k){case"svg":U=ee.createElementNS("http://www.w3.org/2000/svg",k);break;case"math":U=ee.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;case"script":U=ee.createElement("div"),U.innerHTML="<script><\/script>",U=U.removeChild(U.firstChild);break;case"select":U=typeof D.is=="string"?ee.createElement("select",{is:D.is}):ee.createElement("select"),D.multiple?U.multiple=!0:D.size&&(U.size=D.size);break;default:U=typeof D.is=="string"?ee.createElement(k,{is:D.is}):ee.createElement(k)}}U[lt]=v,U[Vt]=D;e:for(ee=v.child;ee!==null;){if(ee.tag===5||ee.tag===6)U.appendChild(ee.stateNode);else if(ee.tag!==4&&ee.tag!==27&&ee.child!==null){ee.child.return=ee,ee=ee.child;continue}if(ee===v)break e;for(;ee.sibling===null;){if(ee.return===null||ee.return===v)break e;ee=ee.return}ee.sibling.return=ee.return,ee=ee.sibling}v.stateNode=U;e:switch(zo(U,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,f===null?null:f.memoizedProps,v.pendingProps,A),null;case 6:if(f&&v.stateNode!=null)f.memoizedProps!==D&&Vu(v);else{if(typeof D!="string"&&v.stateNode===null)throw Error(r(166));if(f=J.current,Pg(v)){if(f=v.stateNode,A=v.memoizedProps,D=null,k=pa,k!==null)switch(k.tag){case 27:case 5:D=k.memoizedProps}f[lt]=v,f=!!(f.nodeValue===A||D!==null&&D.suppressHydrationWarning===!0||BK(f.nodeValue,A)),f||Lu(v,!0)}else f=n2(f).createTextNode(D),f[lt]=v,v.stateNode=f}return gn(v),null;case 31:if(A=v.memoizedState,f===null||f.memoizedState!==null){if(D=Pg(v),A!==null){if(f===null){if(!D)throw Error(r(318));if(f=v.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(557));f[lt]=v}else Vd(),(v.flags&128)===0&&(v.memoizedState=null),v.flags|=4;gn(v),f=!1}else A=Jb(),f!==null&&f.memoizedState!==null&&(f.memoizedState.hydrationErrors=A),f=!0;if(!f)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,f===null||f.memoizedState!==null&&f.memoizedState.dehydrated!==null){if(k=Pg(v),D!==null&&D.dehydrated!==null){if(f===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=Jb(),f!==null&&f.memoizedState!==null&&(f.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,f=f!==null&&f.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),U=null,D.memoizedState!==null&&D.memoizedState.cachePool!==null&&(U=D.memoizedState.cachePool.pool),U!==k&&(D.flags|=2048)),A!==f&&A&&(v.child.flags|=8192),Wh(v,v.updateQueue),gn(v),null);case 4:return de(),f===null&&bU(v.stateNode.containerInfo),gn(v),null;case 10:return zu(v.type),gn(v),null;case 19:if(Z(Cr),D=v.memoizedState,D===null)return gn(v),null;if(k=(v.flags&128)!==0,U=D.rendering,U===null)if(k)Hu(D,!1);else{if(ta!==0||f!==null&&(f.flags&128)!==0)for(f=v.child;f!==null;){if(U=Ll(f),U!==null){for(v.flags|=128,Hu(D,!1),f=U.updateQueue,v.updateQueue=f,Wh(v,f),v.subtreeFlags=0,f=A,A=v.child;A!==null;)Ag(A,f),A=A.sibling;return ae(Cr,Cr.current&1|2),Tr&&Iu(v,D.treeForkCount),v.child}f=f.sibling}D.tail!==null&&K()>Ea&&(v.flags|=128,k=!0,Hu(D,!1),v.lanes=4194304)}else{if(!k)if(f=Ll(U),f!==null){if(v.flags|=128,k=!0,f=f.updateQueue,v.updateQueue=f,Wh(v,f),Hu(D,!0),D.tail===null&&D.tailMode==="hidden"&&!U.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?(U.sibling=v.child,v.child=U):(f=D.last,f!==null?f.sibling=U:v.child=U,D.last=U)}return D.tail!==null?(f=D.tail,D.rendering=f,D.tail=f.sibling,D.renderingStartTime=K(),f.sibling=null,A=Cr.current,ae(Cr,k?A&1|2:A&1),Tr&&Iu(v,D.treeForkCount),f):(gn(v),null);case 22:case 23:return Sa(v),hy(),D=v.memoizedState!==null,f!==null?f.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,f!==null&&f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(A=f.memoizedState.cachePool.pool),D=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(D=v.memoizedState.cachePool.pool),D!==A&&(v.flags|=2048),f!==null&&Z(Wd),null;case 24:return A=null,f!==null&&(A=f.memoizedState.cache),v.memoizedState.cache!==A&&(v.flags|=2048),zu(Na),gn(v),null;case 25:return null;case 30:return null}throw Error(r(156,v.tag))}function _c(f,v){switch(Qb(v),v.tag){case 1:return f=v.flags,f&65536?(v.flags=f&-65537|128,v):null;case 3:return zu(Na),de(),f=v.flags,(f&65536)!==0&&(f&128)===0?(v.flags=f&-65537|128,v):null;case 26:case 27:case 5:return Te(v),null;case 31:if(v.memoizedState!==null){if(Sa(v),v.alternate===null)throw Error(r(340));Vd()}return f=v.flags,f&65536?(v.flags=f&-65537|128,v):null;case 13:if(Sa(v),f=v.memoizedState,f!==null&&f.dehydrated!==null){if(v.alternate===null)throw Error(r(340));Vd()}return f=v.flags,f&65536?(v.flags=f&-65537|128,v):null;case 19:return Z(Cr),null;case 4:return de(),null;case 10:return zu(v.type),null;case 22:case 23:return Sa(v),hy(),f!==null&&Z(Wd),f=v.flags,f&65536?(v.flags=f&-65537|128,v):null;case 24:return zu(Na),null;case 25:return null;default:return null}}function kl(f,v){switch(Qb(v),v.tag){case 3:zu(Na),de();break;case 26:case 27:case 5:Te(v);break;case 4:de();break;case 31:v.memoizedState!==null&&Sa(v);break;case 13:Sa(v);break;case 19:Z(Cr);break;case 10:zu(v.type);break;case 22:case 23:Sa(v),hy(),f!==null&&Z(Wd);break;case 24:zu(Na)}}function Sc(f,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&f)===f){D=void 0;var U=A.create,ee=A.inst;D=U(),ee.destroy=D}A=A.next}while(A!==k)}}catch(xe){Vr(v,v.return,xe)}}function ks(f,v,A){try{var D=v.updateQueue,k=D!==null?D.lastEffect:null;if(k!==null){var U=k.next;D=U;do{if((D.tag&f)===f){var ee=D.inst,xe=ee.destroy;if(xe!==void 0){ee.destroy=void 0,k=v;var Ie=A,it=xe;try{it()}catch(St){Vr(k,Ie,St)}}}D=D.next}while(D!==U)}}catch(St){Vr(v,v.return,St)}}function tu(f){var v=f.updateQueue;if(v!==null){var A=f.stateNode;try{f3(v,A)}catch(D){Vr(f,f.return,D)}}}function gs(f,v,A){A.props=Kd(f.type,f.memoizedProps),A.state=f.memoizedState;try{A.componentWillUnmount()}catch(D){Vr(f,v,D)}}function qh(f,v){try{var A=f.ref;if(A!==null){switch(f.tag){case 26:case 27:case 5:var D=f.stateNode;break;case 30:D=f.stateNode;break;default:D=f.stateNode}typeof A=="function"?f.refCleanup=A(D):A.current=D}}catch(k){Vr(f,v,k)}}function Bs(f,v){var A=f.ref,D=f.refCleanup;if(A!==null)if(typeof D=="function")try{D()}catch(k){Vr(f,v,k)}finally{f.refCleanup=null,f=f.alternate,f!=null&&(f.refCleanup=null)}else if(typeof A=="function")try{A(null)}catch(k){Vr(f,v,k)}else A.current=null}function by(f){var v=f.type,A=f.memoizedProps,D=f.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(f,f.return,k)}}function Za(f,v,A){try{var D=f.stateNode;FMe(D,f.type,A,v),D[Vt]=v}catch(k){Vr(f,f.return,k)}}function qn(f){return f.tag===5||f.tag===3||f.tag===26||f.tag===27&&$g(f.type)||f.tag===4}function Ar(f){e:for(;;){for(;f.sibling===null;){if(f.return===null||qn(f.return))return null;f=f.return}for(f.sibling.return=f.return,f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.tag===27&&$g(f.type)||f.flags&2||f.child===null||f.tag===4)continue e;f.child.return=f,f=f.child}if(!(f.flags&2))return f.stateNode}}function Gu(f,v,A){var D=f.tag;if(D===5||D===6)f=f.stateNode,v?(A.nodeType===9?A.body:A.nodeName==="HTML"?A.ownerDocument.body:A).insertBefore(f,v):(v=A.nodeType===9?A.body:A.nodeName==="HTML"?A.ownerDocument.body:A,v.appendChild(f),A=A._reactRootContainer,A!=null||v.onclick!==null||(v.onclick=Nh));else if(D!==4&&(D===27&&$g(f.type)&&(A=f.stateNode,v=null),f=f.child,f!==null))for(Gu(f,v,A),f=f.sibling;f!==null;)Gu(f,v,A),f=f.sibling}function No(f,v,A){var D=f.tag;if(D===5||D===6)f=f.stateNode,v?A.insertBefore(f,v):A.appendChild(f);else if(D!==4&&(D===27&&$g(f.type)&&(A=f.stateNode),f=f.child,f!==null))for(No(f,v,A),f=f.sibling;f!==null;)No(f,v,A),f=f.sibling}function C1(f){var v=f.stateNode,A=f.memoizedProps;try{for(var D=f.type,k=v.attributes;k.length;)v.removeAttributeNode(k[0]);zo(v,D,A),v[lt]=f,v[Vt]=A}catch(U){Vr(f,f.return,U)}}var Ac=!1,Dn=!1,iu=!1,t2=typeof WeakSet=="function"?WeakSet:Set,vs=null;function vU(f,v){if(f=f.containerInfo,SU=h2,f=r3(f),ZA(f)){if("selectionStart"in f)var A={start:f.selectionStart,end:f.selectionEnd};else e:{A=(A=f.ownerDocument)&&A.defaultView||window;var D=A.getSelection&&A.getSelection();if(D&&D.rangeCount!==0){A=D.anchorNode;var k=D.anchorOffset,U=D.focusNode;D=D.focusOffset;try{A.nodeType,U.nodeType}catch{A=null;break e}var ee=0,xe=-1,Ie=-1,it=0,St=0,Ct=f,ot=null;t:for(;;){for(var gt;Ct!==A||k!==0&&Ct.nodeType!==3||(xe=ee+k),Ct!==U||D!==0&&Ct.nodeType!==3||(Ie=ee+D),Ct.nodeType===3&&(ee+=Ct.nodeValue.length),(gt=Ct.firstChild)!==null;)ot=Ct,Ct=gt;for(;;){if(Ct===f)break t;if(ot===A&&++it===k&&(xe=ee),ot===U&&++St===D&&(Ie=ee),(gt=Ct.nextSibling)!==null)break;Ct=ot,ot=Ct.parentNode}Ct=gt}A=xe===-1||Ie===-1?null:{start:xe,end:Ie}}else A=null}A=A||{start:0,end:0}}else A=null;for(AU={focusedElem:f,selectionRange:A},h2=!1,vs=v;vs!==null;)if(v=vs,f=v.child,(v.subtreeFlags&1028)!==0&&f!==null)f.return=v,vs=f;else for(;vs!==null;){switch(v=vs,U=v.alternate,f=v.flags,v.tag){case 0:if((f&4)!==0&&(f=v.updateQueue,f=f!==null?f.events:null,f!==null))for(A=0;A<f.length;A++)k=f[A],k.ref.impl=k.nextImpl;break;case 11:case 15:break;case 1:if((f&1024)!==0&&U!==null){f=void 0,A=v,k=U.memoizedProps,U=U.memoizedState,D=A.stateNode;try{var ci=Kd(A.type,k);f=D.getSnapshotBeforeUpdate(ci,U),D.__reactInternalSnapshotBeforeUpdate=f}catch(Ui){Vr(A,A.return,Ui)}}break;case 3:if((f&1024)!==0){if(f=v.stateNode.containerInfo,A=f.nodeType,A===9)TU(f);else if(A===1)switch(f.nodeName){case"HEAD":case"HTML":case"BODY":TU(f);break;default:f.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((f&1024)!==0)throw Error(r(163))}if(f=v.sibling,f!==null){f.return=v.return,vs=f;break}vs=v.return}}function Xn(f,v,A){var D=A.flags;switch(A.tag){case 0:case 11:case 15:Tc(f,A),D&4&&Sc(5,A);break;case 1:if(Tc(f,A),D&4)if(f=A.stateNode,v===null)try{f.componentDidMount()}catch(ee){Vr(A,A.return,ee)}else{var k=Kd(A.type,v.memoizedProps);v=v.memoizedState;try{f.componentDidUpdate(k,v,f.__reactInternalSnapshotBeforeUpdate)}catch(ee){Vr(A,A.return,ee)}}D&64&&tu(A),D&512&&qh(A,A.return);break;case 3:if(Tc(f,A),D&64&&(f=A.updateQueue,f!==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(f,v)}catch(ee){Vr(A,A.return,ee)}}break;case 27:v===null&&D&4&&C1(A);case 26:case 5:Tc(f,A),v===null&&D&4&&by(A),D&512&&qh(A,A.return);break;case 12:Tc(f,A);break;case 31:Tc(f,A),D&4&&Qd(f,A);break;case 13:Tc(f,A),D&4&&jg(f,A),D&64&&(f=A.memoizedState,f!==null&&(f=f.dehydrated,f!==null&&(A=O.bind(null,A),$Me(f,A))));break;case 22:if(D=A.memoizedState!==null||Ac,!D){v=v!==null&&v.memoizedState!==null||Dn,k=Ac;var U=Dn;Ac=D,(Dn=v)&&!U?Lo(f,A,(A.subtreeFlags&8772)!==0):Tc(f,A),Ac=k,Dn=U}break;case 30:break;default:Tc(f,A)}}function wy(f){var v=f.alternate;v!==null&&(f.alternate=null,wy(v)),f.child=null,f.deletions=null,f.sibling=null,f.tag===5&&(v=f.stateNode,v!==null&&wi(v)),f.stateNode=null,f.return=null,f.dependencies=null,f.memoizedProps=null,f.memoizedState=null,f.pendingProps=null,f.stateNode=null,f.updateQueue=null}var ln=null,co=!1;function Mc(f,v,A){for(A=A.child;A!==null;)P1(f,v,A),A=A.sibling}function P1(f,v,A){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(Qe,A)}catch{}switch(A.tag){case 26:Dn||Bs(A,v),Mc(f,v,A),A.memoizedState?A.memoizedState.count--:A.stateNode&&(A=A.stateNode,A.parentNode.removeChild(A));break;case 27:Dn||Bs(A,v);var D=ln,k=co;$g(A.type)&&(ln=A.stateNode,co=!1),Mc(f,v,A),KM(A.stateNode),ln=D,co=k;break;case 5:Dn||Bs(A,v);case 6:if(D=ln,k=co,ln=null,Mc(f,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(U){Vr(A,v,U)}else try{ln.removeChild(A.stateNode)}catch(U){Vr(A,v,U)}break;case 18:ln!==null&&(co?(f=ln,HK(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,A.stateNode),B1(f)):HK(ln,A.stateNode));break;case 4:D=ln,k=co,ln=A.stateNode.containerInfo,co=!0,Mc(f,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(f,v,A);break;case 1:Dn||(Bs(A,v),D=A.stateNode,typeof D.componentWillUnmount=="function"&&gs(A,v,D)),Mc(f,v,A);break;case 21:Mc(f,v,A);break;case 22:Dn=(D=Dn)||A.memoizedState!==null,Mc(f,v,A),Dn=D;break;default:Mc(f,v,A)}}function Qd(f,v){if(v.memoizedState===null&&(f=v.alternate,f!==null&&(f=f.memoizedState,f!==null))){f=f.dehydrated;try{B1(f)}catch(A){Vr(v,v.return,A)}}}function jg(f,v){if(v.memoizedState===null&&(f=v.alternate,f!==null&&(f=f.memoizedState,f!==null&&(f=f.dehydrated,f!==null))))try{B1(f)}catch(A){Vr(v,v.return,A)}}function GM(f){switch(f.tag){case 31:case 13:case 19:var v=f.stateNode;return v===null&&(v=f.stateNode=new t2),v;case 22:return f=f.stateNode,v=f._retryCache,v===null&&(v=f._retryCache=new t2),v;default:throw Error(r(435,f.tag))}}function Xh(f,v){var A=GM(f);v.forEach(function(D){if(!A.has(D)){A.add(D);var k=N.bind(null,f,D);D.then(k,k)}})}function Ja(f,v){var A=v.deletions;if(A!==null)for(var D=0;D<A.length;D++){var k=A[D],U=f,ee=v,xe=ee;e:for(;xe!==null;){switch(xe.tag){case 27:if($g(xe.type)){ln=xe.stateNode,co=!1;break e}break;case 5:ln=xe.stateNode,co=!1;break e;case 3:case 4:ln=xe.stateNode.containerInfo,co=!0;break e}xe=xe.return}if(ln===null)throw Error(r(160));P1(U,ee,k),ln=null,co=!1,U=k.alternate,U!==null&&(U.return=null),k.return=null}if(v.subtreeFlags&13886)for(v=v.child;v!==null;)Zd(v,f),v=v.sibling}var Ec=null;function Zd(f,v){var A=f.alternate,D=f.flags;switch(f.tag){case 0:case 11:case 14:case 15:Ja(v,f),es(f),D&4&&(ks(3,f,f.return),Sc(3,f),ks(5,f,f.return));break;case 1:Ja(v,f),es(f),D&512&&(Dn||A===null||Bs(A,A.return)),D&64&&Ac&&(f=f.updateQueue,f!==null&&(D=f.callbacks,D!==null&&(A=f.shared.hiddenCallbacks,f.shared.hiddenCallbacks=A===null?D:A.concat(D))));break;case 26:var k=Ec;if(Ja(v,f),es(f),D&512&&(Dn||A===null||Bs(A,A.return)),D&4){var U=A!==null?A.memoizedState:null;if(D=f.memoizedState,A===null)if(D===null)if(f.stateNode===null){e:{D=f.type,A=f.memoizedProps,k=k.ownerDocument||k;t:switch(D){case"title":U=k.getElementsByTagName("title")[0],(!U||U[Ai]||U[lt]||U.namespaceURI==="http://www.w3.org/2000/svg"||U.hasAttribute("itemprop"))&&(U=k.createElement(D),k.head.insertBefore(U,k.querySelector("head > title"))),zo(U,D,A),U[lt]=f,De(U),D=U;break e;case"link":var ee=eQ("link","href",k).get(D+(A.href||""));if(ee){for(var xe=0;xe<ee.length;xe++)if(U=ee[xe],U.getAttribute("href")===(A.href==null||A.href===""?null:A.href)&&U.getAttribute("rel")===(A.rel==null?null:A.rel)&&U.getAttribute("title")===(A.title==null?null:A.title)&&U.getAttribute("crossorigin")===(A.crossOrigin==null?null:A.crossOrigin)){ee.splice(xe,1);break t}}U=k.createElement(D),zo(U,D,A),k.head.appendChild(U);break;case"meta":if(ee=eQ("meta","content",k).get(D+(A.content||""))){for(xe=0;xe<ee.length;xe++)if(U=ee[xe],U.getAttribute("content")===(A.content==null?null:""+A.content)&&U.getAttribute("name")===(A.name==null?null:A.name)&&U.getAttribute("property")===(A.property==null?null:A.property)&&U.getAttribute("http-equiv")===(A.httpEquiv==null?null:A.httpEquiv)&&U.getAttribute("charset")===(A.charSet==null?null:A.charSet)){ee.splice(xe,1);break t}}U=k.createElement(D),zo(U,D,A),k.head.appendChild(U);break;default:throw Error(r(468,D))}U[lt]=f,De(U),D=U}f.stateNode=D}else tQ(k,f.type,f.stateNode);else f.stateNode=JK(k,D,f.memoizedProps);else U!==D?(U===null?A.stateNode!==null&&(A=A.stateNode,A.parentNode.removeChild(A)):U.count--,D===null?tQ(k,f.type,f.stateNode):JK(k,D,f.memoizedProps)):D===null&&f.stateNode!==null&&Za(f,f.memoizedProps,A.memoizedProps)}break;case 27:Ja(v,f),es(f),D&512&&(Dn||A===null||Bs(A,A.return)),A!==null&&D&4&&Za(f,f.memoizedProps,A.memoizedProps);break;case 5:if(Ja(v,f),es(f),D&512&&(Dn||A===null||Bs(A,A.return)),f.flags&32){k=f.stateNode;try{so(k,"")}catch(ci){Vr(f,f.return,ci)}}D&4&&f.stateNode!=null&&(k=f.memoizedProps,Za(f,k,A!==null?A.memoizedProps:k)),D&1024&&(iu=!0);break;case 6:if(Ja(v,f),es(f),D&4){if(f.stateNode===null)throw Error(r(162));D=f.memoizedProps,A=f.stateNode;try{A.nodeValue=D}catch(ci){Vr(f,f.return,ci)}}break;case 3:if(o2=null,k=Ec,Ec=a2(v.containerInfo),Ja(v,f),Ec=k,es(f),D&4&&A!==null&&A.memoizedState.isDehydrated)try{B1(v.containerInfo)}catch(ci){Vr(f,f.return,ci)}iu&&(iu=!1,D1(f));break;case 4:D=Ec,Ec=a2(f.stateNode.containerInfo),Ja(v,f),es(f),Ec=D;break;case 12:Ja(v,f),es(f);break;case 31:Ja(v,f),es(f),D&4&&(D=f.updateQueue,D!==null&&(f.updateQueue=null,Xh(f,D)));break;case 13:Ja(v,f),es(f),f.child.flags&8192&&f.memoizedState!==null!=(A!==null&&A.memoizedState!==null)&&(Fg=K()),D&4&&(D=f.updateQueue,D!==null&&(f.updateQueue=null,Xh(f,D)));break;case 22:k=f.memoizedState!==null;var Ie=A!==null&&A.memoizedState!==null,it=Ac,St=Dn;if(Ac=it||k,Dn=St||Ie,Ja(v,f),Dn=St,Ac=it,es(f),D&8192)e:for(v=f.stateNode,v._visibility=k?v._visibility&-2:v._visibility|1,k&&(A===null||Ie||Ac||Dn||Wu(f)),A=null,v=f;;){if(v.tag===5||v.tag===26){if(A===null){Ie=A=v;try{if(U=Ie.stateNode,k)ee=U.style,typeof ee.setProperty=="function"?ee.setProperty("display","none","important"):ee.display="none";else{xe=Ie.stateNode;var Ct=Ie.memoizedProps.style,ot=Ct!=null&&Ct.hasOwnProperty("display")?Ct.display:null;xe.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?GK(gt,!0):GK(Ie.stateNode,!1)}catch(ci){Vr(Ie,Ie.return,ci)}}}else if((v.tag!==22&&v.tag!==23||v.memoizedState===null||v===f)&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===f)break e;for(;v.sibling===null;){if(v.return===null||v.return===f)break e;A===v&&(A=null),v=v.return}A===v&&(A=null),v.sibling.return=v.return,v=v.sibling}D&4&&(D=f.updateQueue,D!==null&&(A=D.retryQueue,A!==null&&(D.retryQueue=null,Xh(f,A))));break;case 19:Ja(v,f),es(f),D&4&&(D=f.updateQueue,D!==null&&(f.updateQueue=null,Xh(f,D)));break;case 30:break;case 21:break;default:Ja(v,f),es(f)}}function es(f){var v=f.flags;if(v&2){try{for(var A,D=f.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,U=Ar(f);No(f,U,k);break;case 5:var ee=A.stateNode;A.flags&32&&(so(ee,""),A.flags&=-33);var xe=Ar(f);No(f,xe,ee);break;case 3:case 4:var Ie=A.stateNode.containerInfo,it=Ar(f);Gu(f,it,Ie);break;default:throw Error(r(161))}}catch(St){Vr(f,f.return,St)}f.flags&=-3}v&4096&&(f.flags&=-4097)}function D1(f){if(f.subtreeFlags&1024)for(f=f.child;f!==null;){var v=f;D1(v),v.tag===5&&v.flags&1024&&v.stateNode.reset(),f=f.sibling}}function Tc(f,v){if(v.subtreeFlags&8772)for(v=v.child;v!==null;)Xn(f,v.alternate,v),v=v.sibling}function Wu(f){for(f=f.child;f!==null;){var v=f;switch(v.tag){case 0:case 11:case 14:case 15:ks(4,v,v.return),Wu(v);break;case 1:Bs(v,v.return);var A=v.stateNode;typeof A.componentWillUnmount=="function"&&gs(v,v.return,A),Wu(v);break;case 27:KM(v.stateNode);case 26:case 5:Bs(v,v.return),Wu(v);break;case 22:v.memoizedState===null&&Wu(v);break;case 30:Wu(v);break;default:Wu(v)}f=f.sibling}}function Lo(f,v,A){for(A=A&&(v.subtreeFlags&8772)!==0,v=v.child;v!==null;){var D=v.alternate,k=f,U=v,ee=U.flags;switch(U.tag){case 0:case 11:case 15:Lo(k,U,A),Sc(4,U);break;case 1:if(Lo(k,U,A),D=U,k=D.stateNode,typeof k.componentDidMount=="function")try{k.componentDidMount()}catch(it){Vr(D,D.return,it)}if(D=U,k=D.updateQueue,k!==null){var xe=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],xe)}catch(it){Vr(D,D.return,it)}}A&&ee&64&&tu(U),qh(U,U.return);break;case 27:C1(U);case 26:case 5:Lo(k,U,A),A&&D===null&&ee&4&&by(U),qh(U,U.return);break;case 12:Lo(k,U,A);break;case 31:Lo(k,U,A),A&&ee&4&&Qd(k,U);break;case 13:Lo(k,U,A),A&&ee&4&&jg(k,U);break;case 22:U.memoizedState===null&&Lo(k,U,A),qh(U,U.return);break;case 30:break;default:Lo(k,U,A)}v=v.sibling}}function Jd(f,v){var A=null;f!==null&&f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(A=f.memoizedState.cachePool.pool),f=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(f=v.memoizedState.cachePool.pool),f!==A&&(f!=null&&f.refCount++,A!=null&&Sp(A))}function Bp(f,v){f=null,v.alternate!==null&&(f=v.alternate.memoizedState.cache),v=v.memoizedState.cache,v!==f&&(v.refCount++,f!=null&&Sp(f))}function zs(f,v,A,D){if(v.subtreeFlags&10256)for(v=v.child;v!==null;)WM(f,v,A,D),v=v.sibling}function WM(f,v,A,D){var k=v.flags;switch(v.tag){case 0:case 11:case 15:zs(f,v,A,D),k&2048&&Sc(9,v);break;case 1:zs(f,v,A,D);break;case 3:zs(f,v,A,D),k&2048&&(f=null,v.alternate!==null&&(f=v.alternate.memoizedState.cache),v=v.memoizedState.cache,v!==f&&(v.refCount++,f!=null&&Sp(f)));break;case 12:if(k&2048){zs(f,v,A,D),f=v.stateNode;try{var U=v.memoizedProps,ee=U.id,xe=U.onPostCommit;typeof xe=="function"&&xe(ee,v.alternate===null?"mount":"update",f.passiveEffectDuration,-0)}catch(Ie){Vr(v,v.return,Ie)}}else zs(f,v,A,D);break;case 31:zs(f,v,A,D);break;case 13:zs(f,v,A,D);break;case 23:break;case 22:U=v.stateNode,ee=v.alternate,v.memoizedState!==null?U._visibility&2?zs(f,v,A,D):qu(f,v):U._visibility&2?zs(f,v,A,D):(U._visibility|=2,Us(f,v,A,D,(v.subtreeFlags&10256)!==0||!1)),k&2048&&Jd(ee,v);break;case 24:zs(f,v,A,D),k&2048&&Bp(v.alternate,v);break;default:zs(f,v,A,D)}}function Us(f,v,A,D,k){for(k=k&&((v.subtreeFlags&10256)!==0||!1),v=v.child;v!==null;){var U=f,ee=v,xe=A,Ie=D,it=ee.flags;switch(ee.tag){case 0:case 11:case 15:Us(U,ee,xe,Ie,k),Sc(8,ee);break;case 23:break;case 22:var St=ee.stateNode;ee.memoizedState!==null?St._visibility&2?Us(U,ee,xe,Ie,k):qu(U,ee):(St._visibility|=2,Us(U,ee,xe,Ie,k)),k&&it&2048&&Jd(ee.alternate,ee);break;case 24:Us(U,ee,xe,Ie,k),k&&it&2048&&Bp(ee.alternate,ee);break;default:Us(U,ee,xe,Ie,k)}v=v.sibling}}function qu(f,v){if(v.subtreeFlags&10256)for(v=v.child;v!==null;){var A=f,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&&Bp(D.alternate,D);break;default:qu(A,D)}v=v.sibling}}var zp=8192;function Bl(f,v,A){if(f.subtreeFlags&zp)for(f=f.child;f!==null;)O1(f,v,A),f=f.sibling}function O1(f,v,A){switch(f.tag){case 26:Bl(f,v,A),f.flags&zp&&f.memoizedState!==null&&oEe(A,Ec,f.memoizedState,f.memoizedProps);break;case 5:Bl(f,v,A);break;case 3:case 4:var D=Ec;Ec=a2(f.stateNode.containerInfo),Bl(f,v,A),Ec=D;break;case 22:f.memoizedState===null&&(D=f.alternate,D!==null&&D.memoizedState!==null?(D=zp,zp=16777216,Bl(f,v,A),zp=D):Bl(f,v,A));break;default:Bl(f,v,A)}}function Up(f){var v=f.alternate;if(v!==null&&(f=v.child,f!==null)){v.child=null;do v=f.sibling,f.sibling=null,f=v;while(f!==null)}}function ef(f){var v=f.deletions;if((f.flags&16)!==0){if(v!==null)for(var A=0;A<v.length;A++){var D=v[A];vs=D,ma(D,f)}Up(f)}if(f.subtreeFlags&10256)for(f=f.child;f!==null;)ll(f),f=f.sibling}function ll(f){switch(f.tag){case 0:case 11:case 15:ef(f),f.flags&2048&&ks(9,f,f.return);break;case 3:ef(f);break;case 12:ef(f);break;case 22:var v=f.stateNode;f.memoizedState!==null&&v._visibility&2&&(f.return===null||f.return.tag!==13)?(v._visibility&=-3,cl(f)):ef(f);break;default:ef(f)}}function cl(f){var v=f.deletions;if((f.flags&16)!==0){if(v!==null)for(var A=0;A<v.length;A++){var D=v[A];vs=D,ma(D,f)}Up(f)}for(f=f.child;f!==null;){switch(v=f,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)}f=f.sibling}}function ma(f,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=f;vs!==null;){D=vs;var k=D.sibling,U=D.return;if(wy(D),D===A){vs=null;break e}if(k!==null){k.return=U,vs=k;break e}vs=U}}}var Yh={getCacheForType:function(f){var v=Fi(Na),A=v.data.get(f);return A===void 0&&(A=f(),v.data.set(f,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,qM=!1,zl=0,ta=0,Xu=0,tf=0,_y=0,ko=0,Un=0,jp=null,ga=null,va=!1,Fg=0,XM=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 f=je;je<<=1,(je&3932160)===0&&(je=262144),ko=f}else ko=536870912;return f=nl.current,f!==null&&(f.flags|=32),ko}function dr(f,v,A){(f===qi&&(Or===2||Or===9)||f.cancelPendingCommit!==null)&&(af(f,0),ka(f,lr,ko,!1)),pn(f,A),((vi&2)===0||f!==qi)&&(f===qi&&((vi&2)===0&&(tf|=A),ta===4&&ka(f,lr,ko,!1)),It(f))}function xr(f,v,A){if((vi&6)!==0)throw Error(r(327));var D=!A&&(v&127)===0&&(v&f.expiredLanes)===0||Lt(f,v),k=D?Ay(f,v):Bo(f,v,!0),U=D;do{if(k===0){ru&&!D&&ka(f,v,0,!1);break}else{if(A=f.current.alternate,U&&!un(A)){k=Bo(f,v,!1),U=!1;continue}if(k===2){if(U=v,f.errorRecoveryDisabledLanes&U)var ee=0;else ee=f.pendingLanes&-536870913,ee=ee!==0?ee:ee&536870912?536870912:0;if(ee!==0){v=ee;e:{var xe=f;k=jp;var Ie=xe.current.memoizedState.isDehydrated;if(Ie&&(af(xe,ee).flags|=256),ee=Bo(xe,ee,!1),ee!==2){if(qM&&!Ie){xe.errorRecoveryDisabledLanes|=U,tf|=U,k=4;break e}U=ga,ga=k,U!==null&&(ga===null?ga=U:ga.push.apply(ga,U))}k=ee}if(U=!1,k!==2)continue}}if(k===1){af(f,0),ka(f,v,0,!0);break}e:{switch(D=f,U=k,U){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=FK(Mr.bind(null,D,A,ga,ia,va,v,ko,tf,Un,Cc,U,"Throttled",-0,0),k);break e}Mr(D,A,ga,ia,va,v,ko,tf,Un,Cc,U,null,-0,0)}}break}while(!0);It(f)}function Mr(f,v,A,D,k,U,ee,xe,Ie,it,St,Ct,ot,gt){if(f.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},O1(v,U,Ct);var ci=(U&62914560)===U?Fg-K():(U&4194048)===U?XM-K():0;if(ci=lEe(Ct,ci),ci!==null){Pc=U,f.cancelPendingCommit=ci(Kh.bind(null,f,v,U,A,D,k,ee,xe,Ie,St,Ct,null,ot,gt)),ka(f,U,ee,!it);return}}Kh(f,v,U,A,D,k,ee,xe,Ie)}function un(f){for(var v=f;;){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],U=k.getSnapshot;k=k.value;try{if(!Do(U(),k))return!1}catch{return!1}}if(A=v.child,v.subtreeFlags&16384&&A!==null)A.return=v,v=A;else{if(v===f)break;for(;v.sibling===null;){if(v.return===null||v.return===f)return!0;v=v.return}v.sibling.return=v.return,v=v.sibling}}return!0}function ka(f,v,A,D){v&=~_y,v&=~tf,f.suspendedLanes|=v,f.pingedLanes&=~v,D&&(f.warmLanes|=v),D=f.expirationTimes;for(var k=v;0<k;){var U=31-xt(k),ee=1<<U;D[U]=-1,k&=~ee}A!==0&&no(f,A,v)}function nu(){return(vi&6)===0?(Qt(0),!1):!0}function nf(){if(hr!==null){if(Or===0)var f=hr.return;else f=hr,Bu=Hd=null,gM(f),Cp=null,Pp=0,f=hr;for(;f!==null;)kl(f.alternate,f),f=f.return;hr=null}}function af(f,v){var A=f.timeoutHandle;A!==-1&&(f.timeoutHandle=-1,GMe(A)),A=f.cancelPendingCommit,A!==null&&(f.cancelPendingCommit=null,A()),Pc=0,nf(),qi=f,hr=A=tl(f.current,null),lr=v,Or=0,uo=null,Cc=!1,ru=Lt(f,v),qM=!1,Un=ko=_y=tf=Xu=ta=0,ga=jp=null,va=!1,(v&8)!==0&&(v|=v&32);var D=f.entangledLanes;if(D!==0)for(f=f.entanglements,D&=v;0<D;){var k=31-xt(D),U=1<<k;v|=f[k],D&=~U}return zl=v,ry(),A}function Yu(f,v){tr=null,H.H=zg,v===Ap||v===ur?(v=Ep(),Or=3):v===oy?(v=Ep(),Or=4):Or=v===x1?8:v!==null&&typeof v=="object"&&typeof v.then=="function"?6:1,uo=v,hr===null&&(ta=1,y1(f,Rl(v,f.current)))}function ra(){var f=nl.current;return f===null?!0:(lr&4194048)===lr?Io===null:(lr&62914560)===lr||(lr&536870912)!==0?f===Io:!1}function $h(){var f=H.H;return H.H=zg,f===null?zg:f}function sf(){var f=H.A;return H.A=Yh,f}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 Bo(f,v,A){var D=vi;vi|=2;var k=$h(),U=sf();(qi!==f||lr!==v)&&(ia=null,af(f,v)),v=!1;var ee=ta;e:do try{if(Or!==0&&hr!==null){var xe=hr,Ie=uo;switch(Or){case 8:nf(),ee=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(f,xe,Ie,it),A&&ru){ee=0;break e}break;default:it=Or,Or=0,uo=null,Vp(f,xe,Ie,it)}}qg(),ee=ta;break}catch(St){Yu(f,St)}while(!0);return v&&f.shellSuspendCounter++,Bu=Hd=null,vi=D,H.H=k,H.A=U,hr===null&&(qi=null,lr=0,ry()),ee}function qg(){for(;hr!==null;)R1(hr)}function Ay(f,v){var A=vi;vi|=2;var D=$h(),k=sf();qi!==f||lr!==v?(ia=null,Ea=K()+500,af(f,v)):ru=Lt(f,v);e:do try{if(Or!==0&&hr!==null){v=hr;var U=uo;t:switch(Or){case 1:Or=0,uo=null,Vp(f,v,U,1);break;case 2:case 9:if(rl(U)){Or=0,uo=null,My(v);break}v=function(){Or!==2&&Or!==9||qi!==f||(Or=7),It(f)},U.then(v,v);break e;case 3:Or=7;break e;case 4:Or=5;break e;case 7:rl(U)?(Or=0,uo=null,My(v)):(Or=0,uo=null,Vp(f,v,U,7));break;case 5:var ee=null;switch(hr.tag){case 26:ee=hr.memoizedState;case 5:case 27:var xe=hr;if(ee?iQ(ee):xe.stateNode.complete){Or=0,uo=null;var Ie=xe.sibling;if(Ie!==null)hr=Ie;else{var it=xe.return;it!==null?(hr=it,of(it)):hr=null}break t}}Or=0,uo=null,Vp(f,v,U,5);break;case 6:Or=0,uo=null,Vp(f,v,U,6);break;case 8:nf(),ta=6;break e;default:throw Error(r(462))}}ul();break}catch(St){Yu(f,St)}while(!0);return Bu=Hd=null,H.H=D,H.A=k,vi=A,hr!==null?0:(qi=null,lr=0,ry(),ta)}function ul(){for(;hr!==null&&!pe();)R1(hr)}function R1(f){var v=T1(f.alternate,f,zl);f.memoizedProps=f.pendingProps,v===null?of(f):hr=v}function My(f){var v=f,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:gM(v);default:kl(A,v),v=hr=Ag(v,zl),v=T1(A,v,zl)}f.memoizedProps=f.pendingProps,v===null?of(f):hr=v}function Vp(f,v,A,D){Bu=Hd=null,gM(v),Cp=null,Pp=0;var k=v.return;try{if(Qa(f,k,v,A,lr)){ta=1,y1(f,Rl(A,f.current)),hr=null;return}}catch(U){if(k!==null)throw hr=k,U;ta=1,y1(f,Rl(A,f.current)),hr=null;return}v.flags&32768?(Tr||D===1?f=!0:ru||(lr&536870912)!==0?f=!1:(Cc=f=!0,(D===2||D===9||D===3||D===6)&&(D=nl.current,D!==null&&D.tag===13&&(D.flags|=16384))),Ey(v,f)):of(v)}function of(f){var v=f;do{if((v.flags&32768)!==0){Ey(v,Cc);return}f=v.return;var A=xy(v.alternate,v,zl);if(A!==null){hr=A;return}if(v=v.sibling,v!==null){hr=v;return}hr=v=f}while(v!==null);ta===0&&(ta=5)}function Ey(f,v){do{var A=_c(f.alternate,f);if(A!==null){A.flags&=32767,hr=A;return}if(A=f.return,A!==null&&(A.flags|=32768,A.subtreeFlags=0,A.deletions=null),!v&&(f=f.sibling,f!==null)){hr=f;return}hr=f=A}while(f!==null);ta=6,hr=null}function Kh(f,v,A,D,k,U,ee,xe,Ie){f.cancelPendingCommit=null;do Xg();while(cn!==0);if((vi&6)!==0)throw Error(r(327));if(v!==null){if(v===f.current)throw Error(r(177));if(U=v.lanes|v.childLanes,U|=fs,sn(f,A,U,ee,xe,Ie),f===qi&&(hr=qi=null,lr=0),Vg=v,Ul=f,Pc=A,Hg=U,Gg=k,Sy=D,(v.subtreeFlags&10256)!==0||(v.flags&10256)!==0?(f.callbackNode=null,f.callbackPriority=0,F(Ue,function(){return I1(),null})):(f.callbackNode=null,f.callbackPriority=0),D=(v.flags&13878)!==0,(v.subtreeFlags&13878)!==0||D){D=H.T,H.T=null,k=G.p,G.p=2,ee=vi,vi|=4;try{vU(f,v,A)}finally{vi=ee,G.p=k,H.T=D}}cn=1,Ba(),Qh(),Hp()}}function Ba(){if(cn===1){cn=0;var f=Ul,v=Vg,A=(v.flags&13878)!==0;if((v.subtreeFlags&13878)!==0||A){A=H.T,H.T=null;var D=G.p;G.p=2;var k=vi;vi|=4;try{Zd(v,f);var U=AU,ee=r3(f.containerInfo),xe=U.focusedElem,Ie=U.selectionRange;if(ee!==xe&&xe&&xe.ownerDocument&&Cn(xe.ownerDocument.documentElement,xe)){if(Ie!==null&&ZA(xe)){var it=Ie.start,St=Ie.end;if(St===void 0&&(St=it),"selectionStart"in xe)xe.selectionStart=it,xe.selectionEnd=Math.min(St,xe.value.length);else{var Ct=xe.ownerDocument||document,ot=Ct&&Ct.defaultView||window;if(ot.getSelection){var gt=ot.getSelection(),ci=xe.textContent.length,Ui=Math.min(Ie.start,ci),Rn=Ie.end===void 0?Ui:Math.min(Ie.end,ci);!gt.extend&&Ui>Rn&&(ee=Rn,Rn=Ui,Ui=ee);var qe=wg(xe,Ui),Fe=wg(xe,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=xe;gt=gt.parentNode;)gt.nodeType===1&&Ct.push({element:gt,left:gt.scrollLeft,top:gt.scrollTop});for(typeof xe.focus=="function"&&xe.focus(),xe=0;xe<Ct.length;xe++){var Et=Ct[xe];Et.element.scrollLeft=Et.left,Et.element.scrollTop=Et.top}}h2=!!SU,AU=SU=null}finally{vi=k,G.p=D,H.T=A}}f.current=v,cn=2}}function Qh(){if(cn===2){cn=0;var f=Ul,v=Vg,A=(v.flags&8772)!==0;if((v.subtreeFlags&8772)!==0||A){A=H.T,H.T=null;var D=G.p;G.p=2;var k=vi;vi|=4;try{Xn(f,v.alternate,v)}finally{vi=k,G.p=D,H.T=A}}cn=3}}function Hp(){if(cn===4||cn===3){cn=0,q();var f=Ul,v=Vg,A=Pc,D=Sy;(v.subtreeFlags&10256)!==0||(v.flags&10256)!==0?cn=5:(cn=0,Vg=Ul=null,$u(f,f.pendingLanes));var k=f.pendingLanes;if(k===0&&(Ta=null),we(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=G.p,G.p=2,H.T=null;try{for(var U=f.onRecoverableError,ee=0;ee<D.length;ee++){var xe=D[ee];U(xe.value,{componentStack:xe.stack})}}finally{H.T=v,G.p=k}}(Pc&3)!==0&&Xg(),It(f),k=f.pendingLanes,(A&261930)!==0&&(k&42)!==0?f===Fp?rf++:(rf=0,Fp=f):rf=0,Qt(0)}}function $u(f,v){(f.pooledCacheLanes&=v)===0&&(v=f.pooledCache,v!=null&&(f.pooledCache=null,Sp(v)))}function Xg(){return Ba(),Qh(),Hp(),I1()}function I1(){if(cn!==5)return!1;var f=Ul,v=Hg;Hg=0;var A=we(Pc),D=H.T,k=G.p;try{G.p=32>A?32:A,H.T=null,A=Gg,Gg=null;var U=Ul,ee=Pc;if(cn=0,Vg=Ul=null,Pc=0,(vi&6)!==0)throw Error(r(331));var xe=vi;if(vi|=4,ll(U.current),WM(U,U.current,ee,A),vi=xe,Qt(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(Qe,U)}catch{}return!0}finally{G.p=k,H.T=D,$u(f,v)}}function YM(f,v,A){v=Rl(A,v),v=zM(f.stateNode,v,2),f=qd(f,v,2),f!==null&&(pn(f,2),It(f))}function Vr(f,v,A){if(f.tag===3)YM(f,f,A);else for(;v!==null;){if(v.tag===3){YM(v,f,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))){f=Rl(A,f),A=UM(2),D=qd(v,A,2),D!==null&&(K3(A,D,v,f),pn(D,2),It(D));break}}v=v.return}}function Ty(f,v,A){var D=f.pingCache;if(D===null){D=f.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)||(qM=!0,k.add(A),f=b.bind(null,f,v,A),v.then(f,f))}function b(f,v,A){var D=f.pingCache;D!==null&&D.delete(v),f.pingedLanes|=f.suspendedLanes&A,f.warmLanes&=~A,qi===f&&(lr&A)===A&&(ta===4||ta===3&&(lr&62914560)===lr&&300>K()-Fg?(vi&2)===0&&af(f,0):_y|=A,Un===lr&&(Un=0)),It(f)}function _(f,v){v===0&&(v=Wi()),f=Oo(f,v),f!==null&&(pn(f,v),It(f))}function O(f){var v=f.memoizedState,A=0;v!==null&&(A=v.retryLane),_(f,A)}function N(f,v){var A=0;switch(f.tag){case 31:case 13:var D=f.stateNode,k=f.memoizedState;k!==null&&(A=k.retryLane);break;case 19:D=f.stateNode;break;case 22:D=f.stateNode._retryCache;break;default:throw Error(r(314))}D!==null&&D.delete(v),_(f,A)}function F(f,v){return ut(f,v)}var X=null,ge=null,Ne=!1,mt=!1,Ot=!1,Ht=0;function It(f){f!==ge&&f.next===null&&(ge===null?X=ge=f:ge=ge.next=f),mt=!0,Ne||(Ne=!0,Xe())}function Qt(f,v){if(!Ot&&mt){Ot=!0;do for(var A=!1,D=X;D!==null;){if(f!==0){var k=D.pendingLanes;if(k===0)var U=0;else{var ee=D.suspendedLanes,xe=D.pingedLanes;U=(1<<31-xt(42|f)+1)-1,U&=k&~(ee&~xe),U=U&201326741?U&201326741|1:U?U|2:0}U!==0&&(A=!0,st(D,U))}else U=lr,U=$e(D,D===qi?U:0,D.cancelPendingCommit!==null||D.timeoutHandle!==-1),(U&3)===0||Lt(D,U)||(A=!0,st(D,U));D=D.next}while(A);Ot=!1}}function Qi(){Ca()}function Ca(){mt=Ne=!1;var f=0;Ht!==0&&HMe()&&(f=Ht);for(var v=K(),A=null,D=X;D!==null;){var k=D.next,U=Yg(D,v);U===0?(D.next=null,A===null?X=k:A.next=k,k===null&&(ge=A)):(A=D,(f!==0||(U&3)!==0)&&(mt=!0)),D=k}cn!==0&&cn!==5||Qt(f),Ht!==0&&(Ht=0)}function Yg(f,v){for(var A=f.suspendedLanes,D=f.pingedLanes,k=f.expirationTimes,U=f.pendingLanes&-62914561;0<U;){var ee=31-xt(U),xe=1<<ee,Ie=k[ee];Ie===-1?((xe&A)===0||(xe&D)!==0)&&(k[ee]=ri(xe,v)):Ie<=v&&(f.expiredLanes|=xe),U&=~xe}if(v=qi,A=lr,A=$e(f,f===v?A:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),D=f.callbackNode,A===0||f===v&&(Or===2||Or===9)||f.cancelPendingCommit!==null)return D!==null&&D!==null&&vt(D),f.callbackNode=null,f.callbackPriority=0;if((A&3)===0||Lt(f,A)){if(v=A&-A,v===f.callbackPriority)return v;switch(D!==null&&vt(D),we(A)){case 2:case 8:A=ze;break;case 32:A=Ue;break;case 268435456:A=Oe;break;default:A=Ue}return D=lf.bind(null,f),A=ut(A,D),f.callbackPriority=v,f.callbackNode=A,v}return D!==null&&D!==null&&vt(D),f.callbackPriority=2,f.callbackNode=null,2}function lf(f,v){if(cn!==0&&cn!==5)return f.callbackNode=null,f.callbackPriority=0,null;var A=f.callbackNode;if(Xg()&&f.callbackNode!==A)return null;var D=lr;return D=$e(f,f===qi?D:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),D===0?null:(xr(f,D,v),Yg(f,K()),f.callbackNode!=null&&f.callbackNode===A?lf.bind(null,f):null)}function st(f,v){if(Xg())return null;xr(f,v,!0)}function Xe(){WMe(function(){(vi&6)!==0?ut(ie,Qi):Ca()})}function ht(){if(Ht===0){var f=jh;f===0&&(f=ke,ke<<=1,(ke&261888)===0&&(ke=256)),Ht=f}return Ht}function Bt(f){return f==null||typeof f=="symbol"||typeof f=="boolean"?null:typeof f=="function"?f:H0(""+f)}function Ci(f,v){var A=v.ownerDocument.createElement("input");return A.name=v.name,A.value=v.value,f.id&&A.setAttribute("form",f.id),v.parentNode.insertBefore(A,v),f=new FormData(f),A.parentNode.removeChild(A),f}function na(f,v,A,D,k){if(v==="submit"&&A&&A.stateNode===k){var U=Bt((k[Vt]||null).action),ee=D.submitter;ee&&(v=(v=ee[Vt]||null)?Bt(v.formAction):ee.getAttribute("formAction"),v!==null&&(U=v,ee=null));var xe=new q0("action","action",null,D,k);f.push({event:xe,listeners:[{instance:null,listener:function(){if(D.defaultPrevented){if(Ht!==0){var Ie=ee?Ci(k,ee):new FormData(k);DM(A,{pending:!0,data:Ie,method:k.method,action:U},null,Ie)}}else typeof U=="function"&&(xe.preventDefault(),Ie=ee?Ci(k,ee):new FormData(k),DM(A,{pending:!0,data:Ie,method:k.method,action:U},U,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(qb,"onAnimationEnd"),mc(ey,"onAnimationIteration"),mc(eM,"onAnimationStart"),mc("dblclick","onDoubleClick"),mc("focusin","onFocus"),mc("focusout","onBlur"),mc(a3,"onTransitionRun"),mc(cU,"onTransitionStart"),mc(s3,"onTransitionCancel"),mc(tM,"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(" "),yU=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Dc));function IK(f,v){v=(v&4)!==0;for(var A=0;A<f.length;A++){var D=f[A],k=D.event;D=D.listeners;e:{var U=void 0;if(v)for(var ee=D.length-1;0<=ee;ee--){var xe=D[ee],Ie=xe.instance,it=xe.currentTarget;if(xe=xe.listener,Ie!==U&&k.isPropagationStopped())break e;U=xe,k.currentTarget=it;try{U(k)}catch(St){iy(St)}k.currentTarget=null,U=Ie}else for(ee=0;ee<D.length;ee++){if(xe=D[ee],Ie=xe.instance,it=xe.currentTarget,xe=xe.listener,Ie!==U&&k.isPropagationStopped())break e;U=xe,k.currentTarget=it;try{U(k)}catch(St){iy(St)}k.currentTarget=null,U=Ie}}}}function Rr(f,v){var A=v[li];A===void 0&&(A=v[li]=new Set);var D=f+"__bubble";A.has(D)||(NK(v,f,2,!1),A.add(D))}function xU(f,v,A){var D=0;v&&(D|=4),NK(A,f,D,v)}var i2="_reactListening"+Math.random().toString(36).slice(2);function bU(f){if(!f[i2]){f[i2]=!0,Ze.forEach(function(A){A!=="selectionchange"&&(yU.has(A)||xU(A,!1,f),xU(A,!0,f))});var v=f.nodeType===9?f:f.ownerDocument;v===null||v[i2]||(v[i2]=!0,xU("selectionchange",!1,v))}}function NK(f,v,A,D){switch(cQ(v)){case 2:var k=hEe;break;case 8:k=dEe;break;default:k=LU}A=k.bind(null,v,A,f),k=void 0,!kA||v!=="touchstart"&&v!=="touchmove"&&v!=="wheel"||(k=!0),D?k!==void 0?f.addEventListener(v,A,{capture:!0,passive:k}):f.addEventListener(v,A,!0):k!==void 0?f.addEventListener(v,A,{passive:k}):f.addEventListener(v,A,!1)}function wU(f,v,A,D,k){var U=D;if((v&1)===0&&(v&2)===0&&D!==null)e:for(;;){if(D===null)return;var ee=D.tag;if(ee===3||ee===4){var xe=D.stateNode.containerInfo;if(xe===k)break;if(ee===4)for(ee=D.return;ee!==null;){var Ie=ee.tag;if((Ie===3||Ie===4)&&ee.stateNode.containerInfo===k)return;ee=ee.return}for(;xe!==null;){if(ee=on(xe),ee===null)return;if(Ie=ee.tag,Ie===5||Ie===6||Ie===26||Ie===27){D=U=ee;continue e}xe=xe.parentNode}}D=D.return}LA(function(){var it=U,St=Ib(A),Ct=[];e:{var ot=pc.get(f);if(ot!==void 0){var gt=q0,ci=f;switch(f){case"keypress":if(W0(A)===0)break e;case"keydown":case"keyup":gt=yp;break;case"focusin":ci="focus",gt=Bb;break;case"focusout":ci="blur",gt=Bb;break;case"beforeblur":case"afterblur":gt=Bb;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=BA;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 qb:case ey:case eM:gt=sU;break;case tM:gt=lU;break;case"scroll":case"scrollend":gt=BD;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=jA;break;case"toggle":case"beforetoggle":gt=$D}var Ui=(v&4)!==0,Rn=!Ui&&(f==="scroll"||f==="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($M(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=f==="mouseover"||f==="pointerover",gt=f==="mouseout"||f==="pointerout",ot&&A!==Rb&&(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=BA,Et="onMouseLeave",qe="onMouseEnter",Fe="mouse",(f==="pointerout"||f==="pointerover")&&(Ui=jA,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=zMe,qe=gt,Fe=ci,tt=0,Et=qe;Et;Et=Ui(Et))tt++;Et=0;for(var Ei=Fe;Ei;Ei=Ui(Ei))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&&LK(Ct,ot,gt,Ui,!1),ci!==null&&Rn!==null&&LK(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=XA;else if(qA(ot))if(Pu)en=i3;else{en=KA;var mi=e3}else gt=ot.nodeName,!gt||gt.toLowerCase()!=="input"||ot.type!=="checkbox"&&ot.type!=="radio"?it&&mp(it.elementType)&&(en=XA):en=t3;if(en&&(en=en(f,it))){Gb(Ct,en,A,St);break e}mi&&mi(f,ot,it),f==="focusout"&&it&&ot.type==="number"&&it.memoizedProps.value!=null&&$a(ot,"number",ot.value)}switch(mi=it?hs(it):window,f){case"focusin":(qA(mi)||mi.contentEditable==="true")&&(Du=mi,Ou=it,_g=null);break;case"focusout":_g=Ou=Du=null;break;case"mousedown":Wb=!0;break;case"contextmenu":case"mouseup":case"dragend":Wb=!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(f){case"compositionstart":var kr="onCompositionStart";break e;case"compositionend":kr="onCompositionEnd";break e;case"compositionupdate":kr="onCompositionUpdate";break e}kr=void 0}else bp?Hb(f,A)&&(kr="onCompositionEnd"):f==="keydown"&&A.keyCode===229&&(kr="onCompositionStart");kr&&(VA&&A.locale!=="ko"&&(bp||kr!=="onCompositionStart"?kr==="onCompositionEnd"&&bp&&(mr=G0()):(Ol=St,Lb="value"in Ol?Ol.value:Ol.textContent,bp=!0)),mi=r2(it,kr),0<mi.length&&(kr=new zb(kr,f,null,A,St),Ct.push({event:kr,listeners:mi}),mr?kr.data=mr:(mr=HA(A),mr!==null&&(kr.data=mr)))),(mr=Vb?ZD(f,A):GA(f,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,f,it,A,St)}IK(Ct,v)})}function $M(f,v,A){return{instance:f,listener:v,currentTarget:A}}function r2(f,v){for(var A=v+"Capture",D=[];f!==null;){var k=f,U=k.stateNode;if(k=k.tag,k!==5&&k!==26&&k!==27||U===null||(k=dg(f,A),k!=null&&D.unshift($M(f,k,U)),k=dg(f,v),k!=null&&D.push($M(f,k,U))),f.tag===3)return D;f=f.return}return[]}function zMe(f){if(f===null)return null;do f=f.return;while(f&&f.tag!==5&&f.tag!==27);return f||null}function LK(f,v,A,D,k){for(var U=v._reactName,ee=[];A!==null&&A!==D;){var xe=A,Ie=xe.alternate,it=xe.stateNode;if(xe=xe.tag,Ie!==null&&Ie===D)break;xe!==5&&xe!==26&&xe!==27||it===null||(Ie=it,k?(it=dg(A,U),it!=null&&ee.unshift($M(A,it,Ie))):k||(it=dg(A,U),it!=null&&ee.push($M(A,it,Ie)))),A=A.return}ee.length!==0&&f.push({event:v,listeners:ee})}var UMe=/\r\n?/g,jMe=/\u0000|\uFFFD/g;function kK(f){return(typeof f=="string"?f:""+f).replace(UMe,`
49
- `).replace(jMe,"")}function BK(f,v){return v=kK(v),kK(f)===v}function On(f,v,A,D,k,U){switch(A){case"children":typeof D=="string"?v==="body"||v==="textarea"&&D===""||so(f,D):(typeof D=="number"||typeof D=="bigint")&&v!=="body"&&so(f,""+D);break;case"className":ye(f,"class",D);break;case"tabIndex":ye(f,"tabindex",D);break;case"dir":case"role":case"viewBox":case"width":case"height":ye(f,A,D);break;case"style":Tu(f,D,U);break;case"data":if(v!=="object"){ye(f,"data",D);break}case"src":case"href":if(D===""&&(v!=="a"||A!=="href")){f.removeAttribute(A);break}if(D==null||typeof D=="function"||typeof D=="symbol"||typeof D=="boolean"){f.removeAttribute(A);break}D=H0(""+D),f.setAttribute(A,D);break;case"action":case"formAction":if(typeof D=="function"){f.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 U=="function"&&(A==="formAction"?(v!=="input"&&On(f,v,"name",k.name,k,null),On(f,v,"formEncType",k.formEncType,k,null),On(f,v,"formMethod",k.formMethod,k,null),On(f,v,"formTarget",k.formTarget,k,null)):(On(f,v,"encType",k.encType,k,null),On(f,v,"method",k.method,k,null),On(f,v,"target",k.target,k,null)));if(D==null||typeof D=="symbol"||typeof D=="boolean"){f.removeAttribute(A);break}D=H0(""+D),f.setAttribute(A,D);break;case"onClick":D!=null&&(f.onclick=Nh);break;case"onScroll":D!=null&&Rr("scroll",f);break;case"onScrollEnd":D!=null&&Rr("scrollend",f);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));f.innerHTML=A}}break;case"multiple":f.multiple=D&&typeof D!="function"&&typeof D!="symbol";break;case"muted":f.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"){f.removeAttribute("xlink:href");break}A=H0(""+D),f.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"?f.setAttribute(A,""+D):f.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"?f.setAttribute(A,""):f.removeAttribute(A);break;case"capture":case"download":D===!0?f.setAttribute(A,""):D!==!1&&D!=null&&typeof D!="function"&&typeof D!="symbol"?f.setAttribute(A,D):f.removeAttribute(A);break;case"cols":case"rows":case"size":case"span":D!=null&&typeof D!="function"&&typeof D!="symbol"&&!isNaN(D)&&1<=D?f.setAttribute(A,D):f.removeAttribute(A);break;case"rowSpan":case"start":D==null||typeof D=="function"||typeof D=="symbol"||isNaN(D)?f.removeAttribute(A):f.setAttribute(A,D);break;case"popover":Rr("beforetoggle",f),Rr("toggle",f),Ae(f,"popover",D);break;case"xlinkActuate":Ee(f,"http://www.w3.org/1999/xlink","xlink:actuate",D);break;case"xlinkArcrole":Ee(f,"http://www.w3.org/1999/xlink","xlink:arcrole",D);break;case"xlinkRole":Ee(f,"http://www.w3.org/1999/xlink","xlink:role",D);break;case"xlinkShow":Ee(f,"http://www.w3.org/1999/xlink","xlink:show",D);break;case"xlinkTitle":Ee(f,"http://www.w3.org/1999/xlink","xlink:title",D);break;case"xlinkType":Ee(f,"http://www.w3.org/1999/xlink","xlink:type",D);break;case"xmlBase":Ee(f,"http://www.w3.org/XML/1998/namespace","xml:base",D);break;case"xmlLang":Ee(f,"http://www.w3.org/XML/1998/namespace","xml:lang",D);break;case"xmlSpace":Ee(f,"http://www.w3.org/XML/1998/namespace","xml:space",D);break;case"is":Ae(f,"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(f,A,D))}}function _U(f,v,A,D,k,U){switch(A){case"style":Tu(f,D,U);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));f.innerHTML=A}}break;case"children":typeof D=="string"?so(f,D):(typeof D=="number"||typeof D=="bigint")&&so(f,""+D);break;case"onScroll":D!=null&&Rr("scroll",f);break;case"onScrollEnd":D!=null&&Rr("scrollend",f);break;case"onClick":D!=null&&(f.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),U=f[Vt]||null,U=U!=null?U[A]:null,typeof U=="function"&&f.removeEventListener(v,U,k),typeof D=="function")){typeof U!="function"&&U!==null&&(A in f?f[A]=null:f.hasAttribute(A)&&f.removeAttribute(A)),f.addEventListener(v,D,k);break e}A in f?f[A]=D:D===!0?f.setAttribute(A,""):Ae(f,A,D)}}}function zo(f,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",f),Rr("load",f);var D=!1,k=!1,U;for(U in A)if(A.hasOwnProperty(U)){var ee=A[U];if(ee!=null)switch(U){case"src":D=!0;break;case"srcSet":k=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,v));default:On(f,v,U,ee,A,null)}}k&&On(f,v,"srcSet",A.srcSet,A,null),D&&On(f,v,"src",A.src,A,null);return;case"input":Rr("invalid",f);var xe=U=ee=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":ee=St;break;case"checked":Ie=St;break;case"defaultChecked":it=St;break;case"value":U=St;break;case"defaultValue":xe=St;break;case"children":case"dangerouslySetInnerHTML":if(St!=null)throw Error(r(137,v));break;default:On(f,v,D,St,A,null)}}Co(f,U,xe,Ie,it,ee,k,!1);return;case"select":Rr("invalid",f),D=ee=U=null;for(k in A)if(A.hasOwnProperty(k)&&(xe=A[k],xe!=null))switch(k){case"value":U=xe;break;case"defaultValue":ee=xe;break;case"multiple":D=xe;default:On(f,v,k,xe,A,null)}v=U,A=ee,f.multiple=!!D,v!=null?ao(f,!!D,v,!1):A!=null&&ao(f,!!D,A,!0);return;case"textarea":Rr("invalid",f),U=k=D=null;for(ee in A)if(A.hasOwnProperty(ee)&&(xe=A[ee],xe!=null))switch(ee){case"value":D=xe;break;case"defaultValue":k=xe;break;case"children":U=xe;break;case"dangerouslySetInnerHTML":if(xe!=null)throw Error(r(91));break;default:On(f,v,ee,xe,A,null)}fa(f,D,k,U);return;case"option":for(Ie in A)if(A.hasOwnProperty(Ie)&&(D=A[Ie],D!=null))switch(Ie){case"selected":f.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:On(f,v,Ie,D,A,null)}return;case"dialog":Rr("beforetoggle",f),Rr("toggle",f),Rr("cancel",f),Rr("close",f);break;case"iframe":case"object":Rr("load",f);break;case"video":case"audio":for(D=0;D<Dc.length;D++)Rr(Dc[D],f);break;case"image":Rr("error",f),Rr("load",f);break;case"details":Rr("toggle",f);break;case"embed":case"source":case"link":Rr("error",f),Rr("load",f);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(f,v,it,D,A,null)}return;default:if(mp(v)){for(St in A)A.hasOwnProperty(St)&&(D=A[St],D!==void 0&&_U(f,v,St,D,A,void 0));return}}for(xe in A)A.hasOwnProperty(xe)&&(D=A[xe],D!=null&&On(f,v,xe,D,A,null))}function FMe(f,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,U=null,ee=null,xe=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(f,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":U=gt;break;case"name":k=gt;break;case"checked":it=gt;break;case"defaultChecked":St=gt;break;case"value":ee=gt;break;case"defaultValue":xe=gt;break;case"children":case"dangerouslySetInnerHTML":if(gt!=null)throw Error(r(137,v));break;default:gt!==Ct&&On(f,v,ot,gt,D,Ct)}}ds(f,ee,xe,Ie,it,St,U,k);return;case"select":gt=ee=xe=ot=null;for(U in A)if(Ie=A[U],A.hasOwnProperty(U)&&Ie!=null)switch(U){case"value":break;case"multiple":gt=Ie;default:D.hasOwnProperty(U)||On(f,v,U,null,D,Ie)}for(k in D)if(U=D[k],Ie=A[k],D.hasOwnProperty(k)&&(U!=null||Ie!=null))switch(k){case"value":ot=U;break;case"defaultValue":xe=U;break;case"multiple":ee=U;default:U!==Ie&&On(f,v,k,U,D,Ie)}v=xe,A=ee,D=gt,ot!=null?ao(f,!!A,ot,!1):!!D!=!!A&&(v!=null?ao(f,!!A,v,!0):ao(f,!!A,A?[]:"",!1));return;case"textarea":gt=ot=null;for(xe in A)if(k=A[xe],A.hasOwnProperty(xe)&&k!=null&&!D.hasOwnProperty(xe))switch(xe){case"value":break;case"children":break;default:On(f,v,xe,null,D,k)}for(ee in D)if(k=D[ee],U=A[ee],D.hasOwnProperty(ee)&&(k!=null||U!=null))switch(ee){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!==U&&On(f,v,ee,k,D,U)}qr(f,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":f.selected=!1;break;default:On(f,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":f.selected=ot&&typeof ot!="function"&&typeof ot!="symbol";break;default:On(f,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(f,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(f,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)&&_U(f,v,Rn,void 0,D,ot);for(St in D)ot=D[St],gt=A[St],!D.hasOwnProperty(St)||ot===gt||ot===void 0&&gt===void 0||_U(f,v,St,ot,D,gt);return}}for(var qe in A)ot=A[qe],A.hasOwnProperty(qe)&&ot!=null&&!D.hasOwnProperty(qe)&&On(f,v,qe,null,D,ot);for(Ct in D)ot=D[Ct],gt=A[Ct],!D.hasOwnProperty(Ct)||ot===gt||ot==null&&gt==null||On(f,v,Ct,ot,D,gt)}function zK(f){switch(f){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function VMe(){if(typeof performance.getEntriesByType=="function"){for(var f=0,v=0,A=performance.getEntriesByType("resource"),D=0;D<A.length;D++){var k=A[D],U=k.transferSize,ee=k.initiatorType,xe=k.duration;if(U&&xe&&zK(ee)){for(ee=0,xe=k.responseEnd,D+=1;D<A.length;D++){var Ie=A[D],it=Ie.startTime;if(it>xe)break;var St=Ie.transferSize,Ct=Ie.initiatorType;St&&zK(Ct)&&(Ie=Ie.responseEnd,ee+=St*(Ie<xe?1:(xe-it)/(Ie-it)))}if(--D,v+=8*(U+ee)/(k.duration/1e3),f++,10<f)break}}if(0<f)return v/f/1e6}return navigator.connection&&(f=navigator.connection.downlink,typeof f=="number")?f:5}var SU=null,AU=null;function n2(f){return f.nodeType===9?f:f.ownerDocument}function UK(f){switch(f){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function jK(f,v){if(f===0)switch(v){case"svg":return 1;case"math":return 2;default:return 0}return f===1&&v==="foreignObject"?0:f}function MU(f,v){return f==="textarea"||f==="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 EU=null;function HMe(){var f=window.event;return f&&f.type==="popstate"?f===EU?!1:(EU=f,!0):(EU=null,!1)}var FK=typeof setTimeout=="function"?setTimeout:void 0,GMe=typeof clearTimeout=="function"?clearTimeout:void 0,VK=typeof Promise=="function"?Promise:void 0,WMe=typeof queueMicrotask=="function"?queueMicrotask:typeof VK<"u"?function(f){return VK.resolve(null).then(f).catch(qMe)}:FK;function qMe(f){setTimeout(function(){throw f})}function $g(f){return f==="head"}function HK(f,v){var A=v,D=0;do{var k=A.nextSibling;if(f.removeChild(A),k&&k.nodeType===8)if(A=k.data,A==="/$"||A==="/&"){if(D===0){f.removeChild(k),B1(v);return}D--}else if(A==="$"||A==="$?"||A==="$~"||A==="$!"||A==="&")D++;else if(A==="html")KM(f.ownerDocument.documentElement);else if(A==="head"){A=f.ownerDocument.head,KM(A);for(var U=A.firstChild;U;){var ee=U.nextSibling,xe=U.nodeName;U[Ai]||xe==="SCRIPT"||xe==="STYLE"||xe==="LINK"&&U.rel.toLowerCase()==="stylesheet"||A.removeChild(U),U=ee}}else A==="body"&&KM(f.ownerDocument.body);A=k}while(A);B1(v)}function GK(f,v){var A=f;f=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(f===0)break;f--}else A!=="$"&&A!=="$?"&&A!=="$~"&&A!=="$!"||f++;A=D}while(A)}function TU(f){var v=f.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":TU(A),wi(A);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(A.rel.toLowerCase()==="stylesheet")continue}f.removeChild(A)}}function XMe(f,v,A,D){for(;f.nodeType===1;){var k=A;if(f.nodeName.toLowerCase()!==v.toLowerCase()){if(!D&&(f.nodeName!=="INPUT"||f.type!=="hidden"))break}else if(D){if(!f[Ai])switch(v){case"meta":if(!f.hasAttribute("itemprop"))break;return f;case"link":if(U=f.getAttribute("rel"),U==="stylesheet"&&f.hasAttribute("data-precedence"))break;if(U!==k.rel||f.getAttribute("href")!==(k.href==null||k.href===""?null:k.href)||f.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin)||f.getAttribute("title")!==(k.title==null?null:k.title))break;return f;case"style":if(f.hasAttribute("data-precedence"))break;return f;case"script":if(U=f.getAttribute("src"),(U!==(k.src==null?null:k.src)||f.getAttribute("type")!==(k.type==null?null:k.type)||f.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin))&&U&&f.hasAttribute("async")&&!f.hasAttribute("itemprop"))break;return f;default:return f}}else if(v==="input"&&f.type==="hidden"){var U=k.name==null?null:""+k.name;if(k.type==="hidden"&&f.getAttribute("name")===U)return f}else return f;if(f=Ku(f.nextSibling),f===null)break}return null}function YMe(f,v,A){if(v==="")return null;for(;f.nodeType!==3;)if((f.nodeType!==1||f.nodeName!=="INPUT"||f.type!=="hidden")&&!A||(f=Ku(f.nextSibling),f===null))return null;return f}function WK(f,v){for(;f.nodeType!==8;)if((f.nodeType!==1||f.nodeName!=="INPUT"||f.type!=="hidden")&&!v||(f=Ku(f.nextSibling),f===null))return null;return f}function CU(f){return f.data==="$?"||f.data==="$~"}function PU(f){return f.data==="$!"||f.data==="$?"&&f.ownerDocument.readyState!=="loading"}function $Me(f,v){var A=f.ownerDocument;if(f.data==="$~")f._reactRetry=v;else if(f.data!=="$?"||A.readyState!=="loading")v();else{var D=function(){v(),A.removeEventListener("DOMContentLoaded",D)};A.addEventListener("DOMContentLoaded",D),f._reactRetry=D}}function Ku(f){for(;f!=null;f=f.nextSibling){var v=f.nodeType;if(v===1||v===3)break;if(v===8){if(v=f.data,v==="$"||v==="$!"||v==="$?"||v==="$~"||v==="&"||v==="F!"||v==="F")break;if(v==="/$"||v==="/&")return null}}return f}var DU=null;function qK(f){f=f.nextSibling;for(var v=0;f;){if(f.nodeType===8){var A=f.data;if(A==="/$"||A==="/&"){if(v===0)return Ku(f.nextSibling);v--}else A!=="$"&&A!=="$!"&&A!=="$?"&&A!=="$~"&&A!=="&"||v++}f=f.nextSibling}return null}function XK(f){f=f.previousSibling;for(var v=0;f;){if(f.nodeType===8){var A=f.data;if(A==="$"||A==="$!"||A==="$?"||A==="$~"||A==="&"){if(v===0)return f;v--}else A!=="/$"&&A!=="/&"||v++}f=f.previousSibling}return null}function YK(f,v,A){switch(v=n2(A),f){case"html":if(f=v.documentElement,!f)throw Error(r(452));return f;case"head":if(f=v.head,!f)throw Error(r(453));return f;case"body":if(f=v.body,!f)throw Error(r(454));return f;default:throw Error(r(451))}}function KM(f){for(var v=f.attributes;v.length;)f.removeAttributeNode(v[0]);wi(f)}var Qu=new Map,$K=new Set;function a2(f){return typeof f.getRootNode=="function"?f.getRootNode():f.nodeType===9?f:f.ownerDocument}var Gp=G.d;G.d={f:KMe,r:QMe,D:ZMe,C:JMe,L:eEe,m:tEe,X:rEe,S:iEe,M:nEe};function KMe(){var f=Gp.f(),v=nu();return f||v}function QMe(f){var v=ha(f);v!==null&&v.tag===5&&v.type==="form"?F3(v):Gp.r(f)}var N1=typeof document>"u"?null:document;function KK(f,v,A){var D=N1;if(D&&typeof v=="string"&&v){var k=zi(v);k='link[rel="'+f+'"][href="'+k+'"]',typeof A=="string"&&(k+='[crossorigin="'+A+'"]'),$K.has(k)||($K.add(k),f={rel:f,crossOrigin:A,href:v},D.querySelector(k)===null&&(v=D.createElement("link"),zo(v,"link",f),De(v),D.head.appendChild(v)))}}function ZMe(f){Gp.D(f),KK("dns-prefetch",f,null)}function JMe(f,v){Gp.C(f,v),KK("preconnect",f,v)}function eEe(f,v,A){Gp.L(f,v,A);var D=N1;if(D&&f&&v){var k='link[rel="preload"][as="'+zi(v)+'"]';v==="image"&&A&&A.imageSrcSet?(k+='[imagesrcset="'+zi(A.imageSrcSet)+'"]',typeof A.imageSizes=="string"&&(k+='[imagesizes="'+zi(A.imageSizes)+'"]')):k+='[href="'+zi(f)+'"]';var U=k;switch(v){case"style":U=L1(f);break;case"script":U=k1(f)}Qu.has(U)||(f=h({rel:"preload",href:v==="image"&&A&&A.imageSrcSet?void 0:f,as:v},A),Qu.set(U,f),D.querySelector(k)!==null||v==="style"&&D.querySelector(QM(U))||v==="script"&&D.querySelector(ZM(U))||(v=D.createElement("link"),zo(v,"link",f),De(v),D.head.appendChild(v)))}}function tEe(f,v){Gp.m(f,v);var A=N1;if(A&&f){var D=v&&typeof v.as=="string"?v.as:"script",k='link[rel="modulepreload"][as="'+zi(D)+'"][href="'+zi(f)+'"]',U=k;switch(D){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":U=k1(f)}if(!Qu.has(U)&&(f=h({rel:"modulepreload",href:f},v),Qu.set(U,f),A.querySelector(k)===null)){switch(D){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(A.querySelector(ZM(U)))return}D=A.createElement("link"),zo(D,"link",f),De(D),A.head.appendChild(D)}}}function iEe(f,v,A){Gp.S(f,v,A);var D=N1;if(D&&f){var k=me(D).hoistableStyles,U=L1(f);v=v||"default";var ee=k.get(U);if(!ee){var xe={loading:0,preload:null};if(ee=D.querySelector(QM(U)))xe.loading=5;else{f=h({rel:"stylesheet",href:f,"data-precedence":v},A),(A=Qu.get(U))&&OU(f,A);var Ie=ee=D.createElement("link");De(Ie),zo(Ie,"link",f),Ie._p=new Promise(function(it,St){Ie.onload=it,Ie.onerror=St}),Ie.addEventListener("load",function(){xe.loading|=1}),Ie.addEventListener("error",function(){xe.loading|=2}),xe.loading|=4,s2(ee,v,D)}ee={type:"stylesheet",instance:ee,count:1,state:xe},k.set(U,ee)}}}function rEe(f,v){Gp.X(f,v);var A=N1;if(A&&f){var D=me(A).hoistableScripts,k=k1(f),U=D.get(k);U||(U=A.querySelector(ZM(k)),U||(f=h({src:f,async:!0},v),(v=Qu.get(k))&&RU(f,v),U=A.createElement("script"),De(U),zo(U,"link",f),A.head.appendChild(U)),U={type:"script",instance:U,count:1,state:null},D.set(k,U))}}function nEe(f,v){Gp.M(f,v);var A=N1;if(A&&f){var D=me(A).hoistableScripts,k=k1(f),U=D.get(k);U||(U=A.querySelector(ZM(k)),U||(f=h({src:f,async:!0,type:"module"},v),(v=Qu.get(k))&&RU(f,v),U=A.createElement("script"),De(U),zo(U,"link",f),A.head.appendChild(U)),U={type:"script",instance:U,count:1,state:null},D.set(k,U))}}function QK(f,v,A,D){var k=(k=J.current)?a2(k):null;if(!k)throw Error(r(446));switch(f){case"meta":case"title":return null;case"style":return typeof A.precedence=="string"&&typeof A.href=="string"?(v=L1(A.href),A=me(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"){f=L1(A.href);var U=me(k).hoistableStyles,ee=U.get(f);if(ee||(k=k.ownerDocument||k,ee={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},U.set(f,ee),(U=k.querySelector(QM(f)))&&!U._p&&(ee.instance=U,ee.state.loading=5),Qu.has(f)||(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(f,A),U||aEe(k,f,A,ee.state))),v&&D===null)throw Error(r(528,""));return ee}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=k1(A),A=me(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,f))}}function L1(f){return'href="'+zi(f)+'"'}function QM(f){return'link[rel="stylesheet"]['+f+"]"}function ZK(f){return h({},f,{"data-precedence":f.precedence,precedence:null})}function aEe(f,v,A,D){f.querySelector('link[rel="preload"][as="style"]['+v+"]")?D.loading=1:(v=f.createElement("link"),D.preload=v,v.addEventListener("load",function(){return D.loading|=1}),v.addEventListener("error",function(){return D.loading|=2}),zo(v,"link",A),De(v),f.head.appendChild(v))}function k1(f){return'[src="'+zi(f)+'"]'}function ZM(f){return"script[async]"+f}function JK(f,v,A){if(v.count++,v.instance===null)switch(v.type){case"style":var D=f.querySelector('style[data-href~="'+zi(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=(f.ownerDocument||f).createElement("style"),De(D),zo(D,"style",k),s2(D,A.precedence,f),v.instance=D;case"stylesheet":k=L1(A.href);var U=f.querySelector(QM(k));if(U)return v.state.loading|=4,v.instance=U,De(U),U;D=ZK(A),(k=Qu.get(k))&&OU(D,k),U=(f.ownerDocument||f).createElement("link"),De(U);var ee=U;return ee._p=new Promise(function(xe,Ie){ee.onload=xe,ee.onerror=Ie}),zo(U,"link",D),v.state.loading|=4,s2(U,A.precedence,f),v.instance=U;case"script":return U=k1(A.src),(k=f.querySelector(ZM(U)))?(v.instance=k,De(k),k):(D=A,(k=Qu.get(U))&&(D=h({},A),RU(D,k)),f=f.ownerDocument||f,k=f.createElement("script"),De(k),zo(k,"link",D),f.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,f));return v.instance}function s2(f,v,A){for(var D=A.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),k=D.length?D[D.length-1]:null,U=k,ee=0;ee<D.length;ee++){var xe=D[ee];if(xe.dataset.precedence===v)U=xe;else if(U!==k)break}U?U.parentNode.insertBefore(f,U.nextSibling):(v=A.nodeType===9?A.head:A,v.insertBefore(f,v.firstChild))}function OU(f,v){f.crossOrigin==null&&(f.crossOrigin=v.crossOrigin),f.referrerPolicy==null&&(f.referrerPolicy=v.referrerPolicy),f.title==null&&(f.title=v.title)}function RU(f,v){f.crossOrigin==null&&(f.crossOrigin=v.crossOrigin),f.referrerPolicy==null&&(f.referrerPolicy=v.referrerPolicy),f.integrity==null&&(f.integrity=v.integrity)}var o2=null;function eQ(f,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(f))return D;for(D.set(f,null),A=A.getElementsByTagName(f),k=0;k<A.length;k++){var U=A[k];if(!(U[Ai]||U[lt]||f==="link"&&U.getAttribute("rel")==="stylesheet")&&U.namespaceURI!=="http://www.w3.org/2000/svg"){var ee=U.getAttribute(v)||"";ee=f+ee;var xe=D.get(ee);xe?xe.push(U):D.set(ee,[U])}}return D}function tQ(f,v,A){f=f.ownerDocument||f,f.head.insertBefore(A,v==="title"?f.querySelector("head > title"):null)}function sEe(f,v,A){if(A===1||v.itemProp!=null)return!1;switch(f){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 f=v.disabled,typeof v.precedence=="string"&&f==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 iQ(f){return!(f.type==="stylesheet"&&(f.state.loading&3)===0)}function oEe(f,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=L1(D.href),U=v.querySelector(QM(k));if(U){v=U._p,v!==null&&typeof v=="object"&&typeof v.then=="function"&&(f.count++,f=l2.bind(f),v.then(f,f)),A.state.loading|=4,A.instance=U,De(U);return}U=v.ownerDocument||v,D=ZK(D),(k=Qu.get(k))&&OU(D,k),U=U.createElement("link"),De(U);var ee=U;ee._p=new Promise(function(xe,Ie){ee.onload=xe,ee.onerror=Ie}),zo(U,"link",D),A.instance=U}f.stylesheets===null&&(f.stylesheets=new Map),f.stylesheets.set(A,v),(v=A.state.preload)&&(A.state.loading&3)===0&&(f.count++,A=l2.bind(f),v.addEventListener("load",A),v.addEventListener("error",A))}}var IU=0;function lEe(f,v){return f.stylesheets&&f.count===0&&u2(f,f.stylesheets),0<f.count||0<f.imgCount?function(A){var D=setTimeout(function(){if(f.stylesheets&&u2(f,f.stylesheets),f.unsuspend){var U=f.unsuspend;f.unsuspend=null,U()}},6e4+v);0<f.imgBytes&&IU===0&&(IU=62500*VMe());var k=setTimeout(function(){if(f.waitingForImages=!1,f.count===0&&(f.stylesheets&&u2(f,f.stylesheets),f.unsuspend)){var U=f.unsuspend;f.unsuspend=null,U()}},(f.imgBytes>IU?50:800)+v);return f.unsuspend=A,function(){f.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 f=this.unsuspend;this.unsuspend=null,f()}}}var c2=null;function u2(f,v){f.stylesheets=null,f.unsuspend!==null&&(f.count++,c2=new Map,v.forEach(cEe,f),c2=null,l2.call(f))}function cEe(f,v){if(!(v.state.loading&4)){var A=c2.get(f);if(A)var D=A.get(null);else{A=new Map,c2.set(f,A);for(var k=f.querySelectorAll("link[data-precedence],style[data-precedence]"),U=0;U<k.length;U++){var ee=k[U];(ee.nodeName==="LINK"||ee.getAttribute("media")!=="not all")&&(A.set(ee.dataset.precedence,ee),D=ee)}D&&A.set(null,D)}k=v.instance,ee=k.getAttribute("data-precedence"),U=A.get(ee)||D,U===D&&A.set(null,k),A.set(ee,k),this.count++,D=l2.bind(this),k.addEventListener("load",D),k.addEventListener("error",D),U?U.parentNode.insertBefore(k,U.nextSibling):(f=f.nodeType===9?f.head:f,f.insertBefore(k,f.firstChild)),v.state.loading|=4}}var JM={$$typeof:S,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function uEe(f,v,A,D,k,U,ee,xe,Ie){this.tag=1,this.containerInfo=f,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=U,this.onRecoverableError=ee,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Ie,this.incompleteTransitions=new Map}function rQ(f,v,A,D,k,U,ee,xe,Ie,it,St,Ct){return f=new uEe(f,v,A,ee,Ie,it,St,Ct,xe),v=1,U===!0&&(v|=24),U=Zn(3,null,null,v),f.current=U,U.stateNode=f,v=rM(),v.refCount++,f.pooledCache=v,v.refCount++,U.memoizedState={element:D,isDehydrated:A,cache:v},cy(U),f}function nQ(f){return f?(f=zd,f):zd}function aQ(f,v,A,D,k,U){k=nQ(k),D.context===null?D.context=k:D.pendingContext=k,D=Vh(v),D.payload={element:A},U=U===void 0?null:U,U!==null&&(D.callback=U),A=qd(f,D,v),A!==null&&(dr(A,f,v),Xd(A,f,v))}function sQ(f,v){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var A=f.retryLane;f.retryLane=A!==0&&A<v?A:v}}function NU(f,v){sQ(f,v),(f=f.alternate)&&sQ(f,v)}function oQ(f){if(f.tag===13||f.tag===31){var v=Oo(f,67108864);v!==null&&dr(v,f,67108864),NU(f,67108864)}}function lQ(f){if(f.tag===13||f.tag===31){var v=jl();v=To(v);var A=Oo(f,v);A!==null&&dr(A,f,v),NU(f,v)}}var h2=!0;function hEe(f,v,A,D){var k=H.T;H.T=null;var U=G.p;try{G.p=2,LU(f,v,A,D)}finally{G.p=U,H.T=k}}function dEe(f,v,A,D){var k=H.T;H.T=null;var U=G.p;try{G.p=8,LU(f,v,A,D)}finally{G.p=U,H.T=k}}function LU(f,v,A,D){if(h2){var k=kU(D);if(k===null)wU(f,v,D,d2,A),uQ(f,D);else if(pEe(k,f,v,A,D))D.stopPropagation();else if(uQ(f,D),v&4&&-1<fEe.indexOf(f)){for(;k!==null;){var U=ha(k);if(U!==null)switch(U.tag){case 3:if(U=U.stateNode,U.current.memoizedState.isDehydrated){var ee=at(U.pendingLanes);if(ee!==0){var xe=U;for(xe.pendingLanes|=2,xe.entangledLanes|=2;ee;){var Ie=1<<31-xt(ee);xe.entanglements[1]|=Ie,ee&=~Ie}It(U),(vi&6)===0&&(Ea=K()+500,Qt(0))}}break;case 31:case 13:xe=Oo(U,2),xe!==null&&dr(xe,U,2),nu(),NU(U,2)}if(U=kU(D),U===null&&wU(f,v,D,d2,A),U===k)break;k=U}k!==null&&D.stopPropagation()}else wU(f,v,D,null,A)}}function kU(f){return f=Ib(f),BU(f)}var d2=null;function BU(f){if(d2=null,f=on(f),f!==null){var v=a(f);if(v===null)f=null;else{var A=v.tag;if(A===13){if(f=s(v),f!==null)return f;f=null}else if(A===31){if(f=o(v),f!==null)return f;f=null}else if(A===3){if(v.stateNode.current.memoizedState.isDehydrated)return v.tag===3?v.stateNode.containerInfo:null;f=null}else v!==f&&(f=null)}}return d2=f,null}function cQ(f){switch(f){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 ze: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,eE=new Map,tE=new Map,Jg=[],fEe="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 uQ(f,v){switch(f){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":eE.delete(v.pointerId);break;case"gotpointercapture":case"lostpointercapture":tE.delete(v.pointerId)}}function iE(f,v,A,D,k,U){return f===null||f.nativeEvent!==U?(f={blockedOn:v,domEventName:A,eventSystemFlags:D,nativeEvent:U,targetContainers:[k]},v!==null&&(v=ha(v),v!==null&&oQ(v)),f):(f.eventSystemFlags|=D,v=f.targetContainers,k!==null&&v.indexOf(k)===-1&&v.push(k),f)}function pEe(f,v,A,D,k){switch(v){case"focusin":return Kg=iE(Kg,f,v,A,D,k),!0;case"dragenter":return Qg=iE(Qg,f,v,A,D,k),!0;case"mouseover":return Zg=iE(Zg,f,v,A,D,k),!0;case"pointerover":var U=k.pointerId;return eE.set(U,iE(eE.get(U)||null,f,v,A,D,k)),!0;case"gotpointercapture":return U=k.pointerId,tE.set(U,iE(tE.get(U)||null,f,v,A,D,k)),!0}return!1}function hQ(f){var v=on(f.target);if(v!==null){var A=a(v);if(A!==null){if(v=A.tag,v===13){if(v=s(A),v!==null){f.blockedOn=v,ft(f.priority,function(){lQ(A)});return}}else if(v===31){if(v=o(A),v!==null){f.blockedOn=v,ft(f.priority,function(){lQ(A)});return}}else if(v===3&&A.stateNode.current.memoizedState.isDehydrated){f.blockedOn=A.tag===3?A.stateNode.containerInfo:null;return}}}f.blockedOn=null}function f2(f){if(f.blockedOn!==null)return!1;for(var v=f.targetContainers;0<v.length;){var A=kU(f.nativeEvent);if(A===null){A=f.nativeEvent;var D=new A.constructor(A.type,A);Rb=D,A.target.dispatchEvent(D),Rb=null}else return v=ha(A),v!==null&&oQ(v),f.blockedOn=A,!1;v.shift()}return!0}function dQ(f,v,A){f2(f)&&A.delete(v)}function mEe(){zU=!1,Kg!==null&&f2(Kg)&&(Kg=null),Qg!==null&&f2(Qg)&&(Qg=null),Zg!==null&&f2(Zg)&&(Zg=null),eE.forEach(dQ),tE.forEach(dQ)}function p2(f,v){f.blockedOn===v&&(f.blockedOn=null,zU||(zU=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,mEe)))}var m2=null;function fQ(f){m2!==f&&(m2=f,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){m2===f&&(m2=null);for(var v=0;v<f.length;v+=3){var A=f[v],D=f[v+1],k=f[v+2];if(typeof D!="function"){if(BU(D||A)===null)continue;break}var U=ha(A);U!==null&&(f.splice(v,3),v-=3,DM(U,{pending:!0,data:k,method:A.method,action:D},D,k))}}))}function B1(f){function v(Ie){return p2(Ie,f)}Kg!==null&&p2(Kg,f),Qg!==null&&p2(Qg,f),Zg!==null&&p2(Zg,f),eE.forEach(v),tE.forEach(v);for(var A=0;A<Jg.length;A++){var D=Jg[A];D.blockedOn===f&&(D.blockedOn=null)}for(;0<Jg.length&&(A=Jg[0],A.blockedOn===null);)hQ(A),A.blockedOn===null&&Jg.shift();if(A=(f.ownerDocument||f).$$reactFormReplay,A!=null)for(D=0;D<A.length;D+=3){var k=A[D],U=A[D+1],ee=k[Vt]||null;if(typeof U=="function")ee||fQ(A);else if(ee){var xe=null;if(U&&U.hasAttribute("formAction")){if(k=U,ee=U[Vt]||null)xe=ee.formAction;else if(BU(k)!==null)continue}else xe=ee.action;typeof xe=="function"?A[D+1]=xe:(A.splice(D,3),D-=3),fQ(A)}}}function pQ(){function f(U){U.canIntercept&&U.info==="react-transition"&&U.intercept({handler:function(){return new Promise(function(ee){return k=ee})},focusReset:"manual",scroll:"manual"})}function v(){k!==null&&(k(),k=null),D||setTimeout(A,20)}function A(){if(!D&&!navigation.transition){var U=navigation.currentEntry;U&&U.url!=null&&navigation.navigate(U.url,{state:U.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var D=!1,k=null;return navigation.addEventListener("navigate",f),navigation.addEventListener("navigatesuccess",v),navigation.addEventListener("navigateerror",v),setTimeout(A,100),function(){D=!0,navigation.removeEventListener("navigate",f),navigation.removeEventListener("navigatesuccess",v),navigation.removeEventListener("navigateerror",v),k!==null&&(k(),k=null)}}}function UU(f){this._internalRoot=f}g2.prototype.render=UU.prototype.render=function(f){var v=this._internalRoot;if(v===null)throw Error(r(409));var A=v.current,D=jl();aQ(A,D,f,v,null,null)},g2.prototype.unmount=UU.prototype.unmount=function(){var f=this._internalRoot;if(f!==null){this._internalRoot=null;var v=f.containerInfo;aQ(f.current,2,null,f,null,null),nu(),v[fi]=null}};function g2(f){this._internalRoot=f}g2.prototype.unstable_scheduleHydration=function(f){if(f){var v=Ke();f={blockedOn:null,target:f,priority:v};for(var A=0;A<Jg.length&&v!==0&&v<Jg[A].priority;A++);Jg.splice(A,0,f),A===0&&hQ(f)}};var mQ=t.version;if(mQ!=="19.2.4")throw Error(r(527,mQ,"19.2.4"));G.findDOMNode=function(f){var v=f._reactInternals;if(v===void 0)throw typeof f.render=="function"?Error(r(188)):(f=Object.keys(f).join(","),Error(r(268,f)));return f=c(v),f=f!==null?u(f):null,f=f===null?null:f.stateNode,f};var gEe={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(gEe),rt=v2}catch{}}return aE.createRoot=function(f,v){if(!n(f))throw Error(r(299));var A=!1,D="",k=Y3,U=kM,ee=BM;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&&(U=v.onCaughtError),v.onRecoverableError!==void 0&&(ee=v.onRecoverableError)),v=rQ(f,1,!1,null,null,A,D,null,k,U,ee,pQ),f[fi]=v.current,bU(f),new UU(v)},aE.hydrateRoot=function(f,v,A){if(!n(f))throw Error(r(299));var D=!1,k="",U=Y3,ee=kM,xe=BM,Ie=null;return A!=null&&(A.unstable_strictMode===!0&&(D=!0),A.identifierPrefix!==void 0&&(k=A.identifierPrefix),A.onUncaughtError!==void 0&&(U=A.onUncaughtError),A.onCaughtError!==void 0&&(ee=A.onCaughtError),A.onRecoverableError!==void 0&&(xe=A.onRecoverableError),A.formState!==void 0&&(Ie=A.formState)),v=rQ(f,1,!0,v,A??null,D,k,Ie,U,ee,xe,pQ),v.context=nQ(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),f[fi]=v.current,bU(f),new g2(v)},aE.version="19.2.4",aE}var MQ;function PEe(){if(MQ)return VU.exports;MQ=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),VU.exports=CEe(),VU.exports}var DEe=PEe();const EQ=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(p=>p(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},Ppe=(e=>e?EQ(e):EQ),OEe=e=>e;function REe(e,t=OEe){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 TQ=e=>{const t=Ppe(e),i=r=>REe(t,r);return Object.assign(i,t),i},sg=(e=>e?TQ(e):TQ);function IEe(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 AG=e=>t=>{try{const i=e(t);return i instanceof Promise?i:{then(r){return AG(r)(i)},catch(r){return this}}}catch(i){return{then(r){return this},catch(r){return AG(r)(i)}}}},NEe=(e,t)=>(i,r,n)=>{let a={storage:IEe(()=>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 p=e((...g)=>(i(...g),h()),r,n);n.getInitialState=()=>p;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:p)});const S=((x=a.onRehydrateStorage)==null?void 0:x.call(a,(g=r())!=null?g:p))||void 0;return AG(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:p),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||p},Dpe=NEe,vb=sg()(Dpe(e=>({theme:"modern",accentColor:"#3b82f6",setTheme:t=>e({theme:t}),setAccentColor:t=>e({accentColor:t})}),{name:"cam-theme"})),bi=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})})),LEe=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})})),CQ={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},Oi=sg()(Dpe(e=>({...CQ,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({...CQ})}),{name:"cam-settings"})),_n=sg(e=>({projects:[],projectsLoaded:!1,activeProject:null,activeSprint:null,sprints:[],tasks:[],viewMode:"agents",selectedTaskId:null,setProjects:t=>e({projects:t}),setProjectsLoaded:t=>e({projectsLoaded: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})}));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 Ope(e,t){return t===0?"0%":`${Math.round(e/t*100)}%`}function MG(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 Rpe(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 kEe(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 BEe(){const{session:e,agents:t,events:i}=bi(),[r,n]=te.useState("00m 00s");te.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 zEe="/api";async function $c(e,t){const i=await fetch(`${zEe}${e}`,{headers:{"Content-Type":"application/json"},...t});if(!i.ok)throw new Error(`API Error: ${i.status} ${i.statusText}`);return i.json()}async function LI(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 vC(e){return $c(`/sessions/${e}`)}async function UEe(e,t){return $c(`/sessions/${e}/name`,{method:"PATCH",body:JSON.stringify({name:t})})}async function jEe(e){return $c(`/sessions/${e}/close`,{method:"PATCH"})}async function Ipe(e){return $c(`/sessions/${e}/agents`)}async function FEe(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 q7(e){return $c(`/sessions/${e}/files`)}async function VEe(){return $c("/projects")}async function HEe(e){return $c(`/projects/${e}`,{method:"DELETE"})}async function GEe(e){return $c(`/projects/${e}/sprints`)}async function PQ(e,t){const r=new URLSearchParams().toString();return $c(`/projects/${e}/tasks${r?`?${r}`:""}`)}async function WEe(e,t){return $c(`/projects/${e}/tasks/${t}/activity`)}async function qEe(){return $c("/registry")}async function Npe(e){const t=new URLSearchParams;return t.set("project_id",e),$c(`/sessions?${t.toString()}`)}async function XEe(e){try{const{sessions:t}=await Npe(e),i=t.map(async n=>{try{const{agents:a}=await Ipe(n.id);return a}catch{return[]}});return{agents:(await Promise.all(i)).flat()}}catch{return{agents:[]}}}function X7(){const{session:e,projectId:t,agents:i,setAgents:r}=bi();return te.useEffect(()=>{if(!(e!=null&&e.id)&&!t)return;const n=async()=>{try{if(t){const{agents:s}=await XEe(t);if(s.length>0||!(e!=null&&e.id)){r(s);return}}if(e!=null&&e.id){const{agents:s}=await Ipe(e.id);r(s)}}catch{}};n();const a=setInterval(n,15e3);return()=>clearInterval(a)},[e==null?void 0:e.id,t,r]),i}const YEe=new Set(["main","team-lead","team_lead","teamlead","lead","orchestrator","coordinator"]),Lpe=/^(opus|sonnet|haiku|claude)\s/i;function $Ee(e){return Lpe.test(e)}const KEe=new Set(["general-purpose","general_purpose","default","agent","unknown",""]);function Ch(e,t,i){const r=t.toLowerCase().trim();return YEe.has(r)?"main":Lpe.test(t)||QEe(t)?t:i&&!KEe.has(i.toLowerCase().trim())?i:"Subagent"}function QEe(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 ZEe(e){return e.status==="active"}function JEe(){const e=X7(),{selectedAgentId:t,selectAgent:i}=bi(),[r,n]=te.useState(!1),{activeAgents:a,inactiveAgents:s}=te.useMemo(()=>{const o=[],l=[];for(const u of e)ZEe(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(DQ,{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(DQ,{agent:o,isSelected:t===o.id,onSelect:()=>i(t===o.id?null:o.id),compact:!0},o.id))})]})]})}function DQ({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(jMe,"")}function BK(f,v){return v=kK(v),kK(f)===v}function On(f,v,A,D,k,U){switch(A){case"children":typeof D=="string"?v==="body"||v==="textarea"&&D===""||so(f,D):(typeof D=="number"||typeof D=="bigint")&&v!=="body"&&so(f,""+D);break;case"className":ye(f,"class",D);break;case"tabIndex":ye(f,"tabindex",D);break;case"dir":case"role":case"viewBox":case"width":case"height":ye(f,A,D);break;case"style":Tu(f,D,U);break;case"data":if(v!=="object"){ye(f,"data",D);break}case"src":case"href":if(D===""&&(v!=="a"||A!=="href")){f.removeAttribute(A);break}if(D==null||typeof D=="function"||typeof D=="symbol"||typeof D=="boolean"){f.removeAttribute(A);break}D=H0(""+D),f.setAttribute(A,D);break;case"action":case"formAction":if(typeof D=="function"){f.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 U=="function"&&(A==="formAction"?(v!=="input"&&On(f,v,"name",k.name,k,null),On(f,v,"formEncType",k.formEncType,k,null),On(f,v,"formMethod",k.formMethod,k,null),On(f,v,"formTarget",k.formTarget,k,null)):(On(f,v,"encType",k.encType,k,null),On(f,v,"method",k.method,k,null),On(f,v,"target",k.target,k,null)));if(D==null||typeof D=="symbol"||typeof D=="boolean"){f.removeAttribute(A);break}D=H0(""+D),f.setAttribute(A,D);break;case"onClick":D!=null&&(f.onclick=Nh);break;case"onScroll":D!=null&&Rr("scroll",f);break;case"onScrollEnd":D!=null&&Rr("scrollend",f);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));f.innerHTML=A}}break;case"multiple":f.multiple=D&&typeof D!="function"&&typeof D!="symbol";break;case"muted":f.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"){f.removeAttribute("xlink:href");break}A=H0(""+D),f.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"?f.setAttribute(A,""+D):f.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"?f.setAttribute(A,""):f.removeAttribute(A);break;case"capture":case"download":D===!0?f.setAttribute(A,""):D!==!1&&D!=null&&typeof D!="function"&&typeof D!="symbol"?f.setAttribute(A,D):f.removeAttribute(A);break;case"cols":case"rows":case"size":case"span":D!=null&&typeof D!="function"&&typeof D!="symbol"&&!isNaN(D)&&1<=D?f.setAttribute(A,D):f.removeAttribute(A);break;case"rowSpan":case"start":D==null||typeof D=="function"||typeof D=="symbol"||isNaN(D)?f.removeAttribute(A):f.setAttribute(A,D);break;case"popover":Rr("beforetoggle",f),Rr("toggle",f),Ae(f,"popover",D);break;case"xlinkActuate":Ee(f,"http://www.w3.org/1999/xlink","xlink:actuate",D);break;case"xlinkArcrole":Ee(f,"http://www.w3.org/1999/xlink","xlink:arcrole",D);break;case"xlinkRole":Ee(f,"http://www.w3.org/1999/xlink","xlink:role",D);break;case"xlinkShow":Ee(f,"http://www.w3.org/1999/xlink","xlink:show",D);break;case"xlinkTitle":Ee(f,"http://www.w3.org/1999/xlink","xlink:title",D);break;case"xlinkType":Ee(f,"http://www.w3.org/1999/xlink","xlink:type",D);break;case"xmlBase":Ee(f,"http://www.w3.org/XML/1998/namespace","xml:base",D);break;case"xmlLang":Ee(f,"http://www.w3.org/XML/1998/namespace","xml:lang",D);break;case"xmlSpace":Ee(f,"http://www.w3.org/XML/1998/namespace","xml:space",D);break;case"is":Ae(f,"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(f,A,D))}}function _U(f,v,A,D,k,U){switch(A){case"style":Tu(f,D,U);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));f.innerHTML=A}}break;case"children":typeof D=="string"?so(f,D):(typeof D=="number"||typeof D=="bigint")&&so(f,""+D);break;case"onScroll":D!=null&&Rr("scroll",f);break;case"onScrollEnd":D!=null&&Rr("scrollend",f);break;case"onClick":D!=null&&(f.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),U=f[Vt]||null,U=U!=null?U[A]:null,typeof U=="function"&&f.removeEventListener(v,U,k),typeof D=="function")){typeof U!="function"&&U!==null&&(A in f?f[A]=null:f.hasAttribute(A)&&f.removeAttribute(A)),f.addEventListener(v,D,k);break e}A in f?f[A]=D:D===!0?f.setAttribute(A,""):Ae(f,A,D)}}}function zo(f,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",f),Rr("load",f);var D=!1,k=!1,U;for(U in A)if(A.hasOwnProperty(U)){var ee=A[U];if(ee!=null)switch(U){case"src":D=!0;break;case"srcSet":k=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,v));default:On(f,v,U,ee,A,null)}}k&&On(f,v,"srcSet",A.srcSet,A,null),D&&On(f,v,"src",A.src,A,null);return;case"input":Rr("invalid",f);var xe=U=ee=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":ee=St;break;case"checked":Ie=St;break;case"defaultChecked":it=St;break;case"value":U=St;break;case"defaultValue":xe=St;break;case"children":case"dangerouslySetInnerHTML":if(St!=null)throw Error(r(137,v));break;default:On(f,v,D,St,A,null)}}Co(f,U,xe,Ie,it,ee,k,!1);return;case"select":Rr("invalid",f),D=ee=U=null;for(k in A)if(A.hasOwnProperty(k)&&(xe=A[k],xe!=null))switch(k){case"value":U=xe;break;case"defaultValue":ee=xe;break;case"multiple":D=xe;default:On(f,v,k,xe,A,null)}v=U,A=ee,f.multiple=!!D,v!=null?ao(f,!!D,v,!1):A!=null&&ao(f,!!D,A,!0);return;case"textarea":Rr("invalid",f),U=k=D=null;for(ee in A)if(A.hasOwnProperty(ee)&&(xe=A[ee],xe!=null))switch(ee){case"value":D=xe;break;case"defaultValue":k=xe;break;case"children":U=xe;break;case"dangerouslySetInnerHTML":if(xe!=null)throw Error(r(91));break;default:On(f,v,ee,xe,A,null)}fa(f,D,k,U);return;case"option":for(Ie in A)if(A.hasOwnProperty(Ie)&&(D=A[Ie],D!=null))switch(Ie){case"selected":f.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:On(f,v,Ie,D,A,null)}return;case"dialog":Rr("beforetoggle",f),Rr("toggle",f),Rr("cancel",f),Rr("close",f);break;case"iframe":case"object":Rr("load",f);break;case"video":case"audio":for(D=0;D<Dc.length;D++)Rr(Dc[D],f);break;case"image":Rr("error",f),Rr("load",f);break;case"details":Rr("toggle",f);break;case"embed":case"source":case"link":Rr("error",f),Rr("load",f);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(f,v,it,D,A,null)}return;default:if(mp(v)){for(St in A)A.hasOwnProperty(St)&&(D=A[St],D!==void 0&&_U(f,v,St,D,A,void 0));return}}for(xe in A)A.hasOwnProperty(xe)&&(D=A[xe],D!=null&&On(f,v,xe,D,A,null))}function FMe(f,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,U=null,ee=null,xe=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(f,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":U=gt;break;case"name":k=gt;break;case"checked":it=gt;break;case"defaultChecked":St=gt;break;case"value":ee=gt;break;case"defaultValue":xe=gt;break;case"children":case"dangerouslySetInnerHTML":if(gt!=null)throw Error(r(137,v));break;default:gt!==Ct&&On(f,v,ot,gt,D,Ct)}}ds(f,ee,xe,Ie,it,St,U,k);return;case"select":gt=ee=xe=ot=null;for(U in A)if(Ie=A[U],A.hasOwnProperty(U)&&Ie!=null)switch(U){case"value":break;case"multiple":gt=Ie;default:D.hasOwnProperty(U)||On(f,v,U,null,D,Ie)}for(k in D)if(U=D[k],Ie=A[k],D.hasOwnProperty(k)&&(U!=null||Ie!=null))switch(k){case"value":ot=U;break;case"defaultValue":xe=U;break;case"multiple":ee=U;default:U!==Ie&&On(f,v,k,U,D,Ie)}v=xe,A=ee,D=gt,ot!=null?ao(f,!!A,ot,!1):!!D!=!!A&&(v!=null?ao(f,!!A,v,!0):ao(f,!!A,A?[]:"",!1));return;case"textarea":gt=ot=null;for(xe in A)if(k=A[xe],A.hasOwnProperty(xe)&&k!=null&&!D.hasOwnProperty(xe))switch(xe){case"value":break;case"children":break;default:On(f,v,xe,null,D,k)}for(ee in D)if(k=D[ee],U=A[ee],D.hasOwnProperty(ee)&&(k!=null||U!=null))switch(ee){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!==U&&On(f,v,ee,k,D,U)}qr(f,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":f.selected=!1;break;default:On(f,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":f.selected=ot&&typeof ot!="function"&&typeof ot!="symbol";break;default:On(f,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(f,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(f,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)&&_U(f,v,Rn,void 0,D,ot);for(St in D)ot=D[St],gt=A[St],!D.hasOwnProperty(St)||ot===gt||ot===void 0&&gt===void 0||_U(f,v,St,ot,D,gt);return}}for(var qe in A)ot=A[qe],A.hasOwnProperty(qe)&&ot!=null&&!D.hasOwnProperty(qe)&&On(f,v,qe,null,D,ot);for(Ct in D)ot=D[Ct],gt=A[Ct],!D.hasOwnProperty(Ct)||ot===gt||ot==null&&gt==null||On(f,v,Ct,ot,D,gt)}function zK(f){switch(f){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function VMe(){if(typeof performance.getEntriesByType=="function"){for(var f=0,v=0,A=performance.getEntriesByType("resource"),D=0;D<A.length;D++){var k=A[D],U=k.transferSize,ee=k.initiatorType,xe=k.duration;if(U&&xe&&zK(ee)){for(ee=0,xe=k.responseEnd,D+=1;D<A.length;D++){var Ie=A[D],it=Ie.startTime;if(it>xe)break;var St=Ie.transferSize,Ct=Ie.initiatorType;St&&zK(Ct)&&(Ie=Ie.responseEnd,ee+=St*(Ie<xe?1:(xe-it)/(Ie-it)))}if(--D,v+=8*(U+ee)/(k.duration/1e3),f++,10<f)break}}if(0<f)return v/f/1e6}return navigator.connection&&(f=navigator.connection.downlink,typeof f=="number")?f:5}var SU=null,AU=null;function n2(f){return f.nodeType===9?f:f.ownerDocument}function UK(f){switch(f){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function jK(f,v){if(f===0)switch(v){case"svg":return 1;case"math":return 2;default:return 0}return f===1&&v==="foreignObject"?0:f}function MU(f,v){return f==="textarea"||f==="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 EU=null;function HMe(){var f=window.event;return f&&f.type==="popstate"?f===EU?!1:(EU=f,!0):(EU=null,!1)}var FK=typeof setTimeout=="function"?setTimeout:void 0,GMe=typeof clearTimeout=="function"?clearTimeout:void 0,VK=typeof Promise=="function"?Promise:void 0,WMe=typeof queueMicrotask=="function"?queueMicrotask:typeof VK<"u"?function(f){return VK.resolve(null).then(f).catch(qMe)}:FK;function qMe(f){setTimeout(function(){throw f})}function $g(f){return f==="head"}function HK(f,v){var A=v,D=0;do{var k=A.nextSibling;if(f.removeChild(A),k&&k.nodeType===8)if(A=k.data,A==="/$"||A==="/&"){if(D===0){f.removeChild(k),B1(v);return}D--}else if(A==="$"||A==="$?"||A==="$~"||A==="$!"||A==="&")D++;else if(A==="html")KM(f.ownerDocument.documentElement);else if(A==="head"){A=f.ownerDocument.head,KM(A);for(var U=A.firstChild;U;){var ee=U.nextSibling,xe=U.nodeName;U[Ai]||xe==="SCRIPT"||xe==="STYLE"||xe==="LINK"&&U.rel.toLowerCase()==="stylesheet"||A.removeChild(U),U=ee}}else A==="body"&&KM(f.ownerDocument.body);A=k}while(A);B1(v)}function GK(f,v){var A=f;f=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(f===0)break;f--}else A!=="$"&&A!=="$?"&&A!=="$~"&&A!=="$!"||f++;A=D}while(A)}function TU(f){var v=f.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":TU(A),wi(A);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(A.rel.toLowerCase()==="stylesheet")continue}f.removeChild(A)}}function XMe(f,v,A,D){for(;f.nodeType===1;){var k=A;if(f.nodeName.toLowerCase()!==v.toLowerCase()){if(!D&&(f.nodeName!=="INPUT"||f.type!=="hidden"))break}else if(D){if(!f[Ai])switch(v){case"meta":if(!f.hasAttribute("itemprop"))break;return f;case"link":if(U=f.getAttribute("rel"),U==="stylesheet"&&f.hasAttribute("data-precedence"))break;if(U!==k.rel||f.getAttribute("href")!==(k.href==null||k.href===""?null:k.href)||f.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin)||f.getAttribute("title")!==(k.title==null?null:k.title))break;return f;case"style":if(f.hasAttribute("data-precedence"))break;return f;case"script":if(U=f.getAttribute("src"),(U!==(k.src==null?null:k.src)||f.getAttribute("type")!==(k.type==null?null:k.type)||f.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin))&&U&&f.hasAttribute("async")&&!f.hasAttribute("itemprop"))break;return f;default:return f}}else if(v==="input"&&f.type==="hidden"){var U=k.name==null?null:""+k.name;if(k.type==="hidden"&&f.getAttribute("name")===U)return f}else return f;if(f=Ku(f.nextSibling),f===null)break}return null}function YMe(f,v,A){if(v==="")return null;for(;f.nodeType!==3;)if((f.nodeType!==1||f.nodeName!=="INPUT"||f.type!=="hidden")&&!A||(f=Ku(f.nextSibling),f===null))return null;return f}function WK(f,v){for(;f.nodeType!==8;)if((f.nodeType!==1||f.nodeName!=="INPUT"||f.type!=="hidden")&&!v||(f=Ku(f.nextSibling),f===null))return null;return f}function CU(f){return f.data==="$?"||f.data==="$~"}function PU(f){return f.data==="$!"||f.data==="$?"&&f.ownerDocument.readyState!=="loading"}function $Me(f,v){var A=f.ownerDocument;if(f.data==="$~")f._reactRetry=v;else if(f.data!=="$?"||A.readyState!=="loading")v();else{var D=function(){v(),A.removeEventListener("DOMContentLoaded",D)};A.addEventListener("DOMContentLoaded",D),f._reactRetry=D}}function Ku(f){for(;f!=null;f=f.nextSibling){var v=f.nodeType;if(v===1||v===3)break;if(v===8){if(v=f.data,v==="$"||v==="$!"||v==="$?"||v==="$~"||v==="&"||v==="F!"||v==="F")break;if(v==="/$"||v==="/&")return null}}return f}var DU=null;function qK(f){f=f.nextSibling;for(var v=0;f;){if(f.nodeType===8){var A=f.data;if(A==="/$"||A==="/&"){if(v===0)return Ku(f.nextSibling);v--}else A!=="$"&&A!=="$!"&&A!=="$?"&&A!=="$~"&&A!=="&"||v++}f=f.nextSibling}return null}function XK(f){f=f.previousSibling;for(var v=0;f;){if(f.nodeType===8){var A=f.data;if(A==="$"||A==="$!"||A==="$?"||A==="$~"||A==="&"){if(v===0)return f;v--}else A!=="/$"&&A!=="/&"||v++}f=f.previousSibling}return null}function YK(f,v,A){switch(v=n2(A),f){case"html":if(f=v.documentElement,!f)throw Error(r(452));return f;case"head":if(f=v.head,!f)throw Error(r(453));return f;case"body":if(f=v.body,!f)throw Error(r(454));return f;default:throw Error(r(451))}}function KM(f){for(var v=f.attributes;v.length;)f.removeAttributeNode(v[0]);wi(f)}var Qu=new Map,$K=new Set;function a2(f){return typeof f.getRootNode=="function"?f.getRootNode():f.nodeType===9?f:f.ownerDocument}var Gp=G.d;G.d={f:KMe,r:QMe,D:ZMe,C:JMe,L:eEe,m:tEe,X:rEe,S:iEe,M:nEe};function KMe(){var f=Gp.f(),v=nu();return f||v}function QMe(f){var v=ha(f);v!==null&&v.tag===5&&v.type==="form"?F3(v):Gp.r(f)}var N1=typeof document>"u"?null:document;function KK(f,v,A){var D=N1;if(D&&typeof v=="string"&&v){var k=zi(v);k='link[rel="'+f+'"][href="'+k+'"]',typeof A=="string"&&(k+='[crossorigin="'+A+'"]'),$K.has(k)||($K.add(k),f={rel:f,crossOrigin:A,href:v},D.querySelector(k)===null&&(v=D.createElement("link"),zo(v,"link",f),De(v),D.head.appendChild(v)))}}function ZMe(f){Gp.D(f),KK("dns-prefetch",f,null)}function JMe(f,v){Gp.C(f,v),KK("preconnect",f,v)}function eEe(f,v,A){Gp.L(f,v,A);var D=N1;if(D&&f&&v){var k='link[rel="preload"][as="'+zi(v)+'"]';v==="image"&&A&&A.imageSrcSet?(k+='[imagesrcset="'+zi(A.imageSrcSet)+'"]',typeof A.imageSizes=="string"&&(k+='[imagesizes="'+zi(A.imageSizes)+'"]')):k+='[href="'+zi(f)+'"]';var U=k;switch(v){case"style":U=L1(f);break;case"script":U=k1(f)}Qu.has(U)||(f=h({rel:"preload",href:v==="image"&&A&&A.imageSrcSet?void 0:f,as:v},A),Qu.set(U,f),D.querySelector(k)!==null||v==="style"&&D.querySelector(QM(U))||v==="script"&&D.querySelector(ZM(U))||(v=D.createElement("link"),zo(v,"link",f),De(v),D.head.appendChild(v)))}}function tEe(f,v){Gp.m(f,v);var A=N1;if(A&&f){var D=v&&typeof v.as=="string"?v.as:"script",k='link[rel="modulepreload"][as="'+zi(D)+'"][href="'+zi(f)+'"]',U=k;switch(D){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":U=k1(f)}if(!Qu.has(U)&&(f=h({rel:"modulepreload",href:f},v),Qu.set(U,f),A.querySelector(k)===null)){switch(D){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(A.querySelector(ZM(U)))return}D=A.createElement("link"),zo(D,"link",f),De(D),A.head.appendChild(D)}}}function iEe(f,v,A){Gp.S(f,v,A);var D=N1;if(D&&f){var k=me(D).hoistableStyles,U=L1(f);v=v||"default";var ee=k.get(U);if(!ee){var xe={loading:0,preload:null};if(ee=D.querySelector(QM(U)))xe.loading=5;else{f=h({rel:"stylesheet",href:f,"data-precedence":v},A),(A=Qu.get(U))&&OU(f,A);var Ie=ee=D.createElement("link");De(Ie),zo(Ie,"link",f),Ie._p=new Promise(function(it,St){Ie.onload=it,Ie.onerror=St}),Ie.addEventListener("load",function(){xe.loading|=1}),Ie.addEventListener("error",function(){xe.loading|=2}),xe.loading|=4,s2(ee,v,D)}ee={type:"stylesheet",instance:ee,count:1,state:xe},k.set(U,ee)}}}function rEe(f,v){Gp.X(f,v);var A=N1;if(A&&f){var D=me(A).hoistableScripts,k=k1(f),U=D.get(k);U||(U=A.querySelector(ZM(k)),U||(f=h({src:f,async:!0},v),(v=Qu.get(k))&&RU(f,v),U=A.createElement("script"),De(U),zo(U,"link",f),A.head.appendChild(U)),U={type:"script",instance:U,count:1,state:null},D.set(k,U))}}function nEe(f,v){Gp.M(f,v);var A=N1;if(A&&f){var D=me(A).hoistableScripts,k=k1(f),U=D.get(k);U||(U=A.querySelector(ZM(k)),U||(f=h({src:f,async:!0,type:"module"},v),(v=Qu.get(k))&&RU(f,v),U=A.createElement("script"),De(U),zo(U,"link",f),A.head.appendChild(U)),U={type:"script",instance:U,count:1,state:null},D.set(k,U))}}function QK(f,v,A,D){var k=(k=J.current)?a2(k):null;if(!k)throw Error(r(446));switch(f){case"meta":case"title":return null;case"style":return typeof A.precedence=="string"&&typeof A.href=="string"?(v=L1(A.href),A=me(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"){f=L1(A.href);var U=me(k).hoistableStyles,ee=U.get(f);if(ee||(k=k.ownerDocument||k,ee={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},U.set(f,ee),(U=k.querySelector(QM(f)))&&!U._p&&(ee.instance=U,ee.state.loading=5),Qu.has(f)||(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(f,A),U||aEe(k,f,A,ee.state))),v&&D===null)throw Error(r(528,""));return ee}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=k1(A),A=me(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,f))}}function L1(f){return'href="'+zi(f)+'"'}function QM(f){return'link[rel="stylesheet"]['+f+"]"}function ZK(f){return h({},f,{"data-precedence":f.precedence,precedence:null})}function aEe(f,v,A,D){f.querySelector('link[rel="preload"][as="style"]['+v+"]")?D.loading=1:(v=f.createElement("link"),D.preload=v,v.addEventListener("load",function(){return D.loading|=1}),v.addEventListener("error",function(){return D.loading|=2}),zo(v,"link",A),De(v),f.head.appendChild(v))}function k1(f){return'[src="'+zi(f)+'"]'}function ZM(f){return"script[async]"+f}function JK(f,v,A){if(v.count++,v.instance===null)switch(v.type){case"style":var D=f.querySelector('style[data-href~="'+zi(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=(f.ownerDocument||f).createElement("style"),De(D),zo(D,"style",k),s2(D,A.precedence,f),v.instance=D;case"stylesheet":k=L1(A.href);var U=f.querySelector(QM(k));if(U)return v.state.loading|=4,v.instance=U,De(U),U;D=ZK(A),(k=Qu.get(k))&&OU(D,k),U=(f.ownerDocument||f).createElement("link"),De(U);var ee=U;return ee._p=new Promise(function(xe,Ie){ee.onload=xe,ee.onerror=Ie}),zo(U,"link",D),v.state.loading|=4,s2(U,A.precedence,f),v.instance=U;case"script":return U=k1(A.src),(k=f.querySelector(ZM(U)))?(v.instance=k,De(k),k):(D=A,(k=Qu.get(U))&&(D=h({},A),RU(D,k)),f=f.ownerDocument||f,k=f.createElement("script"),De(k),zo(k,"link",D),f.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,f));return v.instance}function s2(f,v,A){for(var D=A.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),k=D.length?D[D.length-1]:null,U=k,ee=0;ee<D.length;ee++){var xe=D[ee];if(xe.dataset.precedence===v)U=xe;else if(U!==k)break}U?U.parentNode.insertBefore(f,U.nextSibling):(v=A.nodeType===9?A.head:A,v.insertBefore(f,v.firstChild))}function OU(f,v){f.crossOrigin==null&&(f.crossOrigin=v.crossOrigin),f.referrerPolicy==null&&(f.referrerPolicy=v.referrerPolicy),f.title==null&&(f.title=v.title)}function RU(f,v){f.crossOrigin==null&&(f.crossOrigin=v.crossOrigin),f.referrerPolicy==null&&(f.referrerPolicy=v.referrerPolicy),f.integrity==null&&(f.integrity=v.integrity)}var o2=null;function eQ(f,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(f))return D;for(D.set(f,null),A=A.getElementsByTagName(f),k=0;k<A.length;k++){var U=A[k];if(!(U[Ai]||U[lt]||f==="link"&&U.getAttribute("rel")==="stylesheet")&&U.namespaceURI!=="http://www.w3.org/2000/svg"){var ee=U.getAttribute(v)||"";ee=f+ee;var xe=D.get(ee);xe?xe.push(U):D.set(ee,[U])}}return D}function tQ(f,v,A){f=f.ownerDocument||f,f.head.insertBefore(A,v==="title"?f.querySelector("head > title"):null)}function sEe(f,v,A){if(A===1||v.itemProp!=null)return!1;switch(f){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 f=v.disabled,typeof v.precedence=="string"&&f==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 iQ(f){return!(f.type==="stylesheet"&&(f.state.loading&3)===0)}function oEe(f,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=L1(D.href),U=v.querySelector(QM(k));if(U){v=U._p,v!==null&&typeof v=="object"&&typeof v.then=="function"&&(f.count++,f=l2.bind(f),v.then(f,f)),A.state.loading|=4,A.instance=U,De(U);return}U=v.ownerDocument||v,D=ZK(D),(k=Qu.get(k))&&OU(D,k),U=U.createElement("link"),De(U);var ee=U;ee._p=new Promise(function(xe,Ie){ee.onload=xe,ee.onerror=Ie}),zo(U,"link",D),A.instance=U}f.stylesheets===null&&(f.stylesheets=new Map),f.stylesheets.set(A,v),(v=A.state.preload)&&(A.state.loading&3)===0&&(f.count++,A=l2.bind(f),v.addEventListener("load",A),v.addEventListener("error",A))}}var IU=0;function lEe(f,v){return f.stylesheets&&f.count===0&&u2(f,f.stylesheets),0<f.count||0<f.imgCount?function(A){var D=setTimeout(function(){if(f.stylesheets&&u2(f,f.stylesheets),f.unsuspend){var U=f.unsuspend;f.unsuspend=null,U()}},6e4+v);0<f.imgBytes&&IU===0&&(IU=62500*VMe());var k=setTimeout(function(){if(f.waitingForImages=!1,f.count===0&&(f.stylesheets&&u2(f,f.stylesheets),f.unsuspend)){var U=f.unsuspend;f.unsuspend=null,U()}},(f.imgBytes>IU?50:800)+v);return f.unsuspend=A,function(){f.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 f=this.unsuspend;this.unsuspend=null,f()}}}var c2=null;function u2(f,v){f.stylesheets=null,f.unsuspend!==null&&(f.count++,c2=new Map,v.forEach(cEe,f),c2=null,l2.call(f))}function cEe(f,v){if(!(v.state.loading&4)){var A=c2.get(f);if(A)var D=A.get(null);else{A=new Map,c2.set(f,A);for(var k=f.querySelectorAll("link[data-precedence],style[data-precedence]"),U=0;U<k.length;U++){var ee=k[U];(ee.nodeName==="LINK"||ee.getAttribute("media")!=="not all")&&(A.set(ee.dataset.precedence,ee),D=ee)}D&&A.set(null,D)}k=v.instance,ee=k.getAttribute("data-precedence"),U=A.get(ee)||D,U===D&&A.set(null,k),A.set(ee,k),this.count++,D=l2.bind(this),k.addEventListener("load",D),k.addEventListener("error",D),U?U.parentNode.insertBefore(k,U.nextSibling):(f=f.nodeType===9?f.head:f,f.insertBefore(k,f.firstChild)),v.state.loading|=4}}var JM={$$typeof:S,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function uEe(f,v,A,D,k,U,ee,xe,Ie){this.tag=1,this.containerInfo=f,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=U,this.onRecoverableError=ee,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Ie,this.incompleteTransitions=new Map}function rQ(f,v,A,D,k,U,ee,xe,Ie,it,St,Ct){return f=new uEe(f,v,A,ee,Ie,it,St,Ct,xe),v=1,U===!0&&(v|=24),U=Zn(3,null,null,v),f.current=U,U.stateNode=f,v=rM(),v.refCount++,f.pooledCache=v,v.refCount++,U.memoizedState={element:D,isDehydrated:A,cache:v},cy(U),f}function nQ(f){return f?(f=zd,f):zd}function aQ(f,v,A,D,k,U){k=nQ(k),D.context===null?D.context=k:D.pendingContext=k,D=Vh(v),D.payload={element:A},U=U===void 0?null:U,U!==null&&(D.callback=U),A=qd(f,D,v),A!==null&&(dr(A,f,v),Xd(A,f,v))}function sQ(f,v){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var A=f.retryLane;f.retryLane=A!==0&&A<v?A:v}}function NU(f,v){sQ(f,v),(f=f.alternate)&&sQ(f,v)}function oQ(f){if(f.tag===13||f.tag===31){var v=Oo(f,67108864);v!==null&&dr(v,f,67108864),NU(f,67108864)}}function lQ(f){if(f.tag===13||f.tag===31){var v=jl();v=To(v);var A=Oo(f,v);A!==null&&dr(A,f,v),NU(f,v)}}var h2=!0;function hEe(f,v,A,D){var k=H.T;H.T=null;var U=G.p;try{G.p=2,LU(f,v,A,D)}finally{G.p=U,H.T=k}}function dEe(f,v,A,D){var k=H.T;H.T=null;var U=G.p;try{G.p=8,LU(f,v,A,D)}finally{G.p=U,H.T=k}}function LU(f,v,A,D){if(h2){var k=kU(D);if(k===null)wU(f,v,D,d2,A),uQ(f,D);else if(pEe(k,f,v,A,D))D.stopPropagation();else if(uQ(f,D),v&4&&-1<fEe.indexOf(f)){for(;k!==null;){var U=ha(k);if(U!==null)switch(U.tag){case 3:if(U=U.stateNode,U.current.memoizedState.isDehydrated){var ee=at(U.pendingLanes);if(ee!==0){var xe=U;for(xe.pendingLanes|=2,xe.entangledLanes|=2;ee;){var Ie=1<<31-xt(ee);xe.entanglements[1]|=Ie,ee&=~Ie}It(U),(vi&6)===0&&(Ea=K()+500,Qt(0))}}break;case 31:case 13:xe=Oo(U,2),xe!==null&&dr(xe,U,2),nu(),NU(U,2)}if(U=kU(D),U===null&&wU(f,v,D,d2,A),U===k)break;k=U}k!==null&&D.stopPropagation()}else wU(f,v,D,null,A)}}function kU(f){return f=Ib(f),BU(f)}var d2=null;function BU(f){if(d2=null,f=on(f),f!==null){var v=a(f);if(v===null)f=null;else{var A=v.tag;if(A===13){if(f=s(v),f!==null)return f;f=null}else if(A===31){if(f=o(v),f!==null)return f;f=null}else if(A===3){if(v.stateNode.current.memoizedState.isDehydrated)return v.tag===3?v.stateNode.containerInfo:null;f=null}else v!==f&&(f=null)}}return d2=f,null}function cQ(f){switch(f){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 ze: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,eE=new Map,tE=new Map,Jg=[],fEe="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 uQ(f,v){switch(f){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":eE.delete(v.pointerId);break;case"gotpointercapture":case"lostpointercapture":tE.delete(v.pointerId)}}function iE(f,v,A,D,k,U){return f===null||f.nativeEvent!==U?(f={blockedOn:v,domEventName:A,eventSystemFlags:D,nativeEvent:U,targetContainers:[k]},v!==null&&(v=ha(v),v!==null&&oQ(v)),f):(f.eventSystemFlags|=D,v=f.targetContainers,k!==null&&v.indexOf(k)===-1&&v.push(k),f)}function pEe(f,v,A,D,k){switch(v){case"focusin":return Kg=iE(Kg,f,v,A,D,k),!0;case"dragenter":return Qg=iE(Qg,f,v,A,D,k),!0;case"mouseover":return Zg=iE(Zg,f,v,A,D,k),!0;case"pointerover":var U=k.pointerId;return eE.set(U,iE(eE.get(U)||null,f,v,A,D,k)),!0;case"gotpointercapture":return U=k.pointerId,tE.set(U,iE(tE.get(U)||null,f,v,A,D,k)),!0}return!1}function hQ(f){var v=on(f.target);if(v!==null){var A=a(v);if(A!==null){if(v=A.tag,v===13){if(v=s(A),v!==null){f.blockedOn=v,ft(f.priority,function(){lQ(A)});return}}else if(v===31){if(v=o(A),v!==null){f.blockedOn=v,ft(f.priority,function(){lQ(A)});return}}else if(v===3&&A.stateNode.current.memoizedState.isDehydrated){f.blockedOn=A.tag===3?A.stateNode.containerInfo:null;return}}}f.blockedOn=null}function f2(f){if(f.blockedOn!==null)return!1;for(var v=f.targetContainers;0<v.length;){var A=kU(f.nativeEvent);if(A===null){A=f.nativeEvent;var D=new A.constructor(A.type,A);Rb=D,A.target.dispatchEvent(D),Rb=null}else return v=ha(A),v!==null&&oQ(v),f.blockedOn=A,!1;v.shift()}return!0}function dQ(f,v,A){f2(f)&&A.delete(v)}function mEe(){zU=!1,Kg!==null&&f2(Kg)&&(Kg=null),Qg!==null&&f2(Qg)&&(Qg=null),Zg!==null&&f2(Zg)&&(Zg=null),eE.forEach(dQ),tE.forEach(dQ)}function p2(f,v){f.blockedOn===v&&(f.blockedOn=null,zU||(zU=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,mEe)))}var m2=null;function fQ(f){m2!==f&&(m2=f,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){m2===f&&(m2=null);for(var v=0;v<f.length;v+=3){var A=f[v],D=f[v+1],k=f[v+2];if(typeof D!="function"){if(BU(D||A)===null)continue;break}var U=ha(A);U!==null&&(f.splice(v,3),v-=3,DM(U,{pending:!0,data:k,method:A.method,action:D},D,k))}}))}function B1(f){function v(Ie){return p2(Ie,f)}Kg!==null&&p2(Kg,f),Qg!==null&&p2(Qg,f),Zg!==null&&p2(Zg,f),eE.forEach(v),tE.forEach(v);for(var A=0;A<Jg.length;A++){var D=Jg[A];D.blockedOn===f&&(D.blockedOn=null)}for(;0<Jg.length&&(A=Jg[0],A.blockedOn===null);)hQ(A),A.blockedOn===null&&Jg.shift();if(A=(f.ownerDocument||f).$$reactFormReplay,A!=null)for(D=0;D<A.length;D+=3){var k=A[D],U=A[D+1],ee=k[Vt]||null;if(typeof U=="function")ee||fQ(A);else if(ee){var xe=null;if(U&&U.hasAttribute("formAction")){if(k=U,ee=U[Vt]||null)xe=ee.formAction;else if(BU(k)!==null)continue}else xe=ee.action;typeof xe=="function"?A[D+1]=xe:(A.splice(D,3),D-=3),fQ(A)}}}function pQ(){function f(U){U.canIntercept&&U.info==="react-transition"&&U.intercept({handler:function(){return new Promise(function(ee){return k=ee})},focusReset:"manual",scroll:"manual"})}function v(){k!==null&&(k(),k=null),D||setTimeout(A,20)}function A(){if(!D&&!navigation.transition){var U=navigation.currentEntry;U&&U.url!=null&&navigation.navigate(U.url,{state:U.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var D=!1,k=null;return navigation.addEventListener("navigate",f),navigation.addEventListener("navigatesuccess",v),navigation.addEventListener("navigateerror",v),setTimeout(A,100),function(){D=!0,navigation.removeEventListener("navigate",f),navigation.removeEventListener("navigatesuccess",v),navigation.removeEventListener("navigateerror",v),k!==null&&(k(),k=null)}}}function UU(f){this._internalRoot=f}g2.prototype.render=UU.prototype.render=function(f){var v=this._internalRoot;if(v===null)throw Error(r(409));var A=v.current,D=jl();aQ(A,D,f,v,null,null)},g2.prototype.unmount=UU.prototype.unmount=function(){var f=this._internalRoot;if(f!==null){this._internalRoot=null;var v=f.containerInfo;aQ(f.current,2,null,f,null,null),nu(),v[fi]=null}};function g2(f){this._internalRoot=f}g2.prototype.unstable_scheduleHydration=function(f){if(f){var v=Ke();f={blockedOn:null,target:f,priority:v};for(var A=0;A<Jg.length&&v!==0&&v<Jg[A].priority;A++);Jg.splice(A,0,f),A===0&&hQ(f)}};var mQ=t.version;if(mQ!=="19.2.4")throw Error(r(527,mQ,"19.2.4"));G.findDOMNode=function(f){var v=f._reactInternals;if(v===void 0)throw typeof f.render=="function"?Error(r(188)):(f=Object.keys(f).join(","),Error(r(268,f)));return f=c(v),f=f!==null?u(f):null,f=f===null?null:f.stateNode,f};var gEe={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(gEe),rt=v2}catch{}}return aE.createRoot=function(f,v){if(!n(f))throw Error(r(299));var A=!1,D="",k=Y3,U=kM,ee=BM;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&&(U=v.onCaughtError),v.onRecoverableError!==void 0&&(ee=v.onRecoverableError)),v=rQ(f,1,!1,null,null,A,D,null,k,U,ee,pQ),f[fi]=v.current,bU(f),new UU(v)},aE.hydrateRoot=function(f,v,A){if(!n(f))throw Error(r(299));var D=!1,k="",U=Y3,ee=kM,xe=BM,Ie=null;return A!=null&&(A.unstable_strictMode===!0&&(D=!0),A.identifierPrefix!==void 0&&(k=A.identifierPrefix),A.onUncaughtError!==void 0&&(U=A.onUncaughtError),A.onCaughtError!==void 0&&(ee=A.onCaughtError),A.onRecoverableError!==void 0&&(xe=A.onRecoverableError),A.formState!==void 0&&(Ie=A.formState)),v=rQ(f,1,!0,v,A??null,D,k,Ie,U,ee,xe,pQ),v.context=nQ(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),f[fi]=v.current,bU(f),new g2(v)},aE.version="19.2.4",aE}var MQ;function PEe(){if(MQ)return VU.exports;MQ=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),VU.exports=CEe(),VU.exports}var DEe=PEe();const EQ=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(p=>p(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},Ppe=(e=>e?EQ(e):EQ),OEe=e=>e;function REe(e,t=OEe){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 TQ=e=>{const t=Ppe(e),i=r=>REe(t,r);return Object.assign(i,t),i},sg=(e=>e?TQ(e):TQ);function IEe(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 AG=e=>t=>{try{const i=e(t);return i instanceof Promise?i:{then(r){return AG(r)(i)},catch(r){return this}}}catch(i){return{then(r){return this},catch(r){return AG(r)(i)}}}},NEe=(e,t)=>(i,r,n)=>{let a={storage:IEe(()=>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 p=e((...g)=>(i(...g),h()),r,n);n.getInitialState=()=>p;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:p)});const S=((x=a.onRehydrateStorage)==null?void 0:x.call(a,(g=r())!=null?g:p))||void 0;return AG(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:p),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||p},Dpe=NEe,vb=sg()(Dpe(e=>({theme:"modern",accentColor:"#3b82f6",setTheme:t=>e({theme:t}),setAccentColor:t=>e({accentColor:t})}),{name:"cam-theme"})),bi=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})})),LEe=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})})),CQ={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},Oi=sg()(Dpe(e=>({...CQ,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({...CQ})}),{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})}));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 Ope(e,t){return t===0?"0%":`${Math.round(e/t*100)}%`}function MG(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 Rpe(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 kEe(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 BEe(){const{session:e,agents:t,events:i}=bi(),[r,n]=te.useState("00m 00s");te.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 zEe="/api";async function $c(e,t){const i=await fetch(`${zEe}${e}`,{headers:{"Content-Type":"application/json"},...t});if(!i.ok)throw new Error(`API Error: ${i.status} ${i.statusText}`);return i.json()}async function LI(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 vC(e){return $c(`/sessions/${e}`)}async function UEe(e,t){return $c(`/sessions/${e}/name`,{method:"PATCH",body:JSON.stringify({name:t})})}async function jEe(e){return $c(`/sessions/${e}/close`,{method:"PATCH"})}async function Ipe(e){return $c(`/sessions/${e}/agents`)}async function FEe(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 q7(e){return $c(`/sessions/${e}/files`)}async function VEe(){return $c("/projects")}async function HEe(e){return $c(`/projects/${e}`,{method:"DELETE"})}async function GEe(e){return $c(`/projects/${e}/sprints`)}async function PQ(e,t){const r=new URLSearchParams().toString();return $c(`/projects/${e}/tasks${r?`?${r}`:""}`)}async function WEe(e,t){return $c(`/projects/${e}/tasks/${t}/activity`)}async function qEe(){return $c("/registry")}async function Npe(e){const t=new URLSearchParams;return t.set("project_id",e),$c(`/sessions?${t.toString()}`)}async function XEe(e){try{const{sessions:t}=await Npe(e),i=t.map(async n=>{try{const{agents:a}=await Ipe(n.id);return a}catch{return[]}});return{agents:(await Promise.all(i)).flat()}}catch{return{agents:[]}}}function X7(){const{session:e,projectId:t,agents:i,setAgents:r}=bi();return te.useEffect(()=>{if(!(e!=null&&e.id)&&!t)return;const n=async()=>{try{if(t){const{agents:s}=await XEe(t);if(s.length>0||!(e!=null&&e.id)){r(s);return}}if(e!=null&&e.id){const{agents:s}=await Ipe(e.id);r(s)}}catch{}};n();const a=setInterval(n,15e3);return()=>clearInterval(a)},[e==null?void 0:e.id,t,r]),i}const YEe=new Set(["main","team-lead","team_lead","teamlead","lead","orchestrator","coordinator"]),Lpe=/^(opus|sonnet|haiku|claude)\s/i;function $Ee(e){return Lpe.test(e)}const KEe=new Set(["general-purpose","general_purpose","default","agent","unknown",""]);function Ch(e,t,i){const r=t.toLowerCase().trim();return YEe.has(r)?"main":Lpe.test(t)||QEe(t)?t:i&&!KEe.has(i.toLowerCase().trim())?i:"Subagent"}function QEe(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 ZEe(e){return e.status==="active"}function JEe(){const e=X7(),{selectedAgentId:t,selectAgent:i}=bi(),[r,n]=te.useState(!1),{activeAgents:a,inactiveAgents:s}=te.useMemo(()=>{const o=[],l=[];for(const u of e)ZEe(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(DQ,{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(DQ,{agent:o,isSelected:t===o.id,onSelect:()=>i(t===o.id?null:o.id),compact:!0},o.id))})]})]})}function DQ({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 ${MG(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}},vut=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}},yut=class extends vut{create(e){return URL.createObjectURL(new Blob([e]))}dispose(e,t){URL.revokeObjectURL(t)}},KT;function xut(e){return typeof e=="string"?e:(KT||(KT=new yut),KT.load(e))}function but(){KT&&KT.disposeAll()}var wut=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}},_ut=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}},wwe=class extends wut{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=xut(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 YXe(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()}},Bv=class extends wwe{};function Sut(e,t){var i=Tut(t);return i.formatToParts?Mut(i,e):Eut(i,e)}var Aut={year:0,month:1,day:2,hour:3,minute:4,second:5};function Mut(e,t){try{for(var i=e.formatToParts(t),r=[],n=0;n<i.length;n++){var a=Aut[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 Eut(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 _6={};function Tut(e){if(!_6[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";_6[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 _6[e]}function _we(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 cue=36e5,Cut=6e4,S6={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function Swe(e,t,i){var r,n;if(!e||(r=S6.timezoneZ.exec(e),r))return 0;var a;if(r=S6.timezoneHH.exec(e),r)return a=parseInt(r[1],10),uue(a)?-(a*cue):NaN;if(r=S6.timezoneHHMM.exec(e),r){a=parseInt(r[1],10);var s=parseInt(r[2],10);return uue(a,s)?(n=Math.abs(a)*cue+s*Cut,a>0?-n:n):NaN}if(Out(e)){t=new Date(t||Date.now());var o=i?t:Put(t),l=G9(o,e),c=i?l:Dut(t,l,e);return-c}return NaN}function Put(e){return _we(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function G9(e,t){var i=Sut(e,t),r=_we(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 Dut(e,t,i){var r=e.getTime(),n=r-t,a=G9(new Date(n),i);if(t===a)return t;n-=a-t;var s=G9(new Date(n),i);return a===s?a:Math.max(a,s)}function uue(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}var hue={};function Out(e){if(hue[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),hue[e]=!0,!0}catch{return!1}}var Rut=N0(kGe(),1),due=N0(BGe(),1),Iut=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Nut=Iut,A6=36e5,fue=6e4,Lut=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:Nut};function kut(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?Lut:(0,Rut.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=But(e),a=zut(n.date,r),s=a.year,o=a.restDateString,l=Uut(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,h;if(n.time&&(u=jut(n.time),isNaN(u)))return new Date(NaN);if(n.timeZone||i.timeZone){if(h=Swe(n.timeZone||i.timeZone,new Date(c+u)),isNaN(h))return new Date(NaN)}else h=(0,due.default)(new Date(c+u)),h=(0,due.default)(new Date(c+u+h));return new Date(c+u+h)}else return new Date(NaN)}function But(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 zut(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 Uut(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,mue(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 Hut(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 mue(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,gue(t,a)?pue(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 gue(t,a,l)?pue(t,a,l):new Date(NaN)}return null}function jut(e){var t,i,r;if(t=Kl.HH.exec(e),t)return i=parseFloat(t[1].replace(",",".")),M6(i)?i%24*A6:NaN;if(t=Kl.HHMM.exec(e),t)return i=parseInt(t[1],10),r=parseFloat(t[2].replace(",",".")),M6(i,r)?i%24*A6+r*fue: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 M6(i,r,n)?i%24*A6+r*fue+n*1e3:NaN}return null}function pue(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 Fut=[31,28,31,30,31,30,31,31,30,31,30,31],Vut=[31,29,31,30,31,30,31,31,30,31,30,31];function Awe(e){return e%400===0||e%4===0&&e%100!==0}function mue(e,t,i){if(t<0||t>11)return!1;if(i!=null){if(i<1)return!1;var r=Awe(e);if(r&&i>Vut[t]||!r&&i>Fut[t])return!1}return!0}function Hut(e,t){if(t<1)return!1;var i=Awe(e);return!(i&&t>366||!i&&t>365)}function gue(e,t,i){return!(t<0||t>52||i!=null&&(i<0||i>6))}function M6(e,t,i){return!(e!=null&&(e<0||e>=25)||t!=null&&(t<0||t>=60)||i!=null&&(i<0||i>=60))}function Gut(e,t,i){var r=kut(e,i),n=Swe(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 vue(e=new Date,t){let i=t.format,r=e.getSeconds(),n=e;t&&t.timeZone!==null&&(n=Gut(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 Wut(e,t){switch(e.type){case"fresnel":return Yut(e,t);case"gradient":return $ut(e,t);case"depth":return Kut(e,t);case"normal":return Qut(e,t);case"noise":return Zut(e,t);case"rainbow":return Jut(e,t);case"toon":return eht(e,t);case"outline":return tht(e,t);case"transmission":return iht(e,t);case"pattern":return rht(e,t);case"color":default:return Xut(e,t)}}function qut(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{...qut(e),alpha:a,mode:r,isMask:n}}function Xut(e,t){return{...Rd(e,t),color:tc(e.color,t)}}function Yut(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 $ut(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 Ni(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 Kut(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 Ni(d[0],d[1],d[2],d[3]):new Ni(0,0,0,0)),steps:u.slice(0,c.length),smooth:h}}function Qut(e,t){let{cnormal:i}=e;return{...Rd(e,t),cnormal:new Y(i[0],i[1],i[2])}}function Zut(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 Jut(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 eht(e,t){return{...Rd(e,t),positioning:e.positioning,colors:e.colors.map(i=>new Ni(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 tht(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 iht(e,t){return{...Rd(e,t),thickness:e.thickness,ior:e.ior,roughness:e.roughness}}function rht(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 GL=class extends Ks{},nht={noise:["noiseType"],texture:["projection","axis","side"],video:["projection","axis","side"],displace:["noiseType"],light:["roughnessMap","bumpMap"],depth:["smooth","isWorldSpace","gradientType","isVector"],pattern:["style","projection","axis"]},aht={depth:["colors"]};function sht(e,t,i){var a,s;if(t==="isMask")return!0;let r=nht[e.type],n=aht[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 E6(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 a$(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 Bv||l.image.deref(),l.image=o}if("video"in a){let s=a.video,o=t.video(s),l=r;l.image instanceof Bv||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=(Di(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;E6(i.data.texture.repeat,l)&&(n=!0),o.repeat=QT(l,t).map((c,u)=>typeof l[u]=="string"?1/c:c)}if("offset"in a){let l=a.offset;E6(i.data.texture.offset,l)&&(n=!0),o.offset=QT(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||E6(l,c))&&(n=!0),o.rotation=Di(c,t)??0}o.updateMatrix()}return n}function oht(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(Ewe(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 i$))switch(n=n||sht(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 GL?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 GL?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:{a$(s,t,i);break}case sx:{o.value=s.map(l=>new Ni(...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,Di=(e,t,i)=>typeof e=="number"?e:t.getVariable(e,i),lv=(e,t)=>(e||(e=new Y),e.x=Di(e.x,t)??0,e.y=Di(e.y,t)??0,e.z=Di(e.z,t)??0,e),Zp=(e,t)=>(e||(e=new Ce),e.x=Di(e.x,t)??0,e.y=Di(e.y,t)??0,e),QT=(e,t)=>{let i=e.map(r=>Di(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)Ewe(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 F9(n,i.texture.wrapping,i.texture.minFilter??1008,i.texture.magFilter??1006),s=new lut(n),o=new cut(QT(i.texture.repeat,r),QT(i.texture.offset,r),Di(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(...QT(i.size,r)):new Ce(100,100)),p=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 r$(a,s,l,c,u,h,d,p,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:p,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 F9(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((Di(i.texture.rotation??0,r)??0)*Wt.DEG2RAD),u=new owe(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=>Di(g,r)??0))),a=new Zt(Di(i.scale,r)??10),s=new Zt(Di(i.intensity,r)??8),o=new Zt(Di(i.movement,r)??1),l=new Ln(i.noiseType??0),c=new Ln(i.voronoiStyle??0),u=new Zt(Di(i.smoothness,r)??.5),h=new Zt(Di(i.seed,r)??0),d=new Zt(Di(i.highCut,r)??1),p=new Zt(Di(i.lowCut,r)??0),m=new Ln(Di(i.quality,r)??1),y=new xwe(s,o,n,c,u,h,d,p,m,a,l);return new Mwe(e,t,i,{offset:n,scale:a,intensity:s,movement:o,noiseType:l,voronoiStyle:c,smoothness:u,seed:h,highCut:d,lowCut:p,quality:m},y,r)}else throw new Error;else return uht(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):oht(r.props,i.shared,this,t)||n}else if(r.path[0]==="texture")return"texture"in t||"video"in t?a$(r.props,i.shared,this)||n:!0;return n}dispose(){if(lht(this)){let e=this.uniforms[`f${this.id}_texture`];if(!e)return!1;let t=e;t.image instanceof Bv||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}},Mwe=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 n$,c={};else if(i.category==="lambert"){n=new fut;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 gut;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 mut;let u=new Zt(i.roughness??.3),h=new Zt(i.metalness??0),d=new Zt(i.reflectivity??.5),p=new wl(i.occlusion??!0);c={roughness:u,metalness:h,reflectivity:d,occlusion:p},n.roughness=u,n.metalness=h,n.reflectivity=d,n.occlusion=p}else{n=new put;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 lht(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 cht(e,t,i,r,n){switch(e.type){case"color":{let a=new qa(r.color??Au),s=nh(r),o=new V9(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(Di(r.bias,n)??.1),o=new Zt(Di(r.scale,n)??1),l=new Zt(Di(r.intensity,n)??2),c=new Zt(Di(r.factor,n)??1),u=nh(r),h=new uut(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(Di(r.filmThickness,n)??30),s=new Zt(Di(r.movement,n)??0),o=new hh(lv(r.wavelengths,n)),l=new Zt(Di(r.noiseStrength,n)??0),c=new Zt(Di(r.noiseScale,n)??1),u=new hh(lv(r.offset,n)),h=nh(r),d=new fwe(a,s,o,l,c,u,h.alpha,h.isMask),p=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,p,h.isMask,n)}case"transmission":{let a=new Zt(Di(r.thickness??10,n)),s=new Zt(Di(r.ior??1.5,n)),o=new Zt(Di(r.roughness??.5,n)),l=gi.transmissionSize,c=gi.transmissionRenderTarget,u=gi.transmissionRenderTargetDepth,h=window.innerWidth,d=window.innerHeight,p=h>=d?new Wo(d/h,1):new Wo(1,h/d),m=nh(r),y=new vwe(a,s,o,l,c,u,p,m.alpha),g=new Kn(y.calpha,"f");return new ja(t,i,e,{thickness:a,ior:s,roughness:o,aspectRatio:p,...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 Ni(0,0,0,1)),s.value[1]=new Ni(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(Di(r.noiseStrength??0,n)),h=new Zt(Di(r.noiseScale??1,n)),d=new mm(r.shadowColor),p=new hh(lv(r.offset??new Y(0,0,0),n)),m=nh(r),y=new mwe(a,s,o,l,c,u,h,d,p,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:p,...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(Di(r.outlineWidth??.1,n)),l=new Zt(Di(r.contourWidth??.1,n)),c=new Zt(Di(r.outlineThreshold??.1,n)),u=new Zt(Di(r.contourThreshold??.1,n)),h=new Zt(Di(r.outlineSmoothing??.1,n)),d=new Zt(Di(r.contourFrequency??.1,n)),p=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 uwe(a,s,o,l,c,u,h,d,p,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:p,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(Di(r.near,n)??50),l=new Zt(Di(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)),p;r.colors?p=new sx(r.colors.length,r.colors):(p=new sx(2,new Ni(0,0,0,1)),p.value[1]=new Ni(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 rwe(a,s,o,l,c,u,h,d,p,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:p,steps:m,...y},g,y.mode,x,y.isMask,n)}case"noise":{let a=new Zt(Di(r.scale,n)??1),s=new hh(lv(r.size??new Y(100,100,100),n)),o=new Zt(Di(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),p=new mm(r.colorC),m=new mm(r.colorD),y=new Ln(r.noiseType??0),g=new Ln(r.voronoiStyle??0),x=new Zt(Di(r.highCut,n)??1),w=new Zt(Di(r.lowCut,n)??0),S=new Zt(Di(r.smoothness,n)??.5),M=new Zt(Di(r.seed,n)??.5),E=new Ln(r.quality??1),T=nh(r),R=new lwe(a,s,o,l,c,u,h,d,p,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:p,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 iwe(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 Ni(0,0,0,1)),o.value[1]=new Ni(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(Di(r.angle??0,n)),d=nh(r),p=new awe(a,s,o,l,c,u,h,d.alpha,d.isMask),m=new Kn(p.calpha,"f");return new ja(t,i,e,{gradientType:a,smooth:s,colors:o,steps:l,offset:c,morph:u,angle:h,...d},p,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(Di(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)),p=new Zt(Di(r.size??.5,n)),m=new Zt(Di(r.variation??0,n)),y=new Zt(Di(r.smoothness??.5,n)),g=new Zt(Di(r.zigzag??0,n)),x=new Zt(Di(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 hwe(a,s,o,l,c,u,h,d,p,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:p,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 V9(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 uht(e,t,i,r){let n=Wut(i,r);return cht(i,e,t,n,r)}function Ewe(e,t,i,r){if(i.type==="displace"&&(e==="intensity"||e==="visible")){let n=t.uniforms[`f${t.id}_intensity`];return n?(n.value=(Di(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 x_(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""}},hht=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()}},s$=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 hht(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=x_(e,t.shared),this.saveVariableLocations(t)}onVariableUpdate(e,t,i){if(e[0]==="alphaOverride")this.transparent=x_(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=x_(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))),a$({[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 n$,{},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 r$&&(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=x_(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 lue(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 lue(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 Mwe);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 Z1e;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 F9&&!t.image.loaded)return!1}return!0}};Object.defineProperties(rg.prototype,{properties:{get:function(){return this.fragment.properties}}});var W9=class extends s${constructor(e,t,i){super(e,t,!1),this.uuid=i,this.allowVariableSaves=!0,this.saveVariableLocations(t)}},yue=new Map;function dht(e){if(typeof e=="string")return e;let t=yue.get(e);return t||(t={url:URL.createObjectURL(new Blob([e]))},yue.set(e,t)),t.url}var Twe,fht=new Promise(e=>{Twe=e}),xue=!1,HO;function pht(){if(xue)return;if(HO)return HO;async function e(){await I0(()=>import("./howler-4ZFIxiBI.js").then(t=>t.h),[]),Twe(window!==void 0?window:global),xue=!0}return HO=e(),HO}var Cwe;fht.then(e=>Cwe=e);function bue(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 mht(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;bue(s.events,i),t=t||i.some(o=>o.data.type==="Audio")}),n.events===void 0||Array.isArray(n.events)===!1)return!0;bue(n.events,i),t=t||i.some(a=>a.data.type==="Audio")}),t}var MT=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:dht(e),format:"wav"},this.sound=new Cwe.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()}},ght=class{constructor(){this.type="ShapePath",this.color=new Si,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new tL,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(p,m,y,g){let x=p.x,w=m.x,S=y.x,M=g.x,E=p.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),B=(P-R)*(w-x)-(M-S)*(T-E),z=I/B,j=L/B;if(B===0&&I!==0||z<=0||z>=1||j<0||j>1)return null;if(I===0&&B===0){for(let V=0;V<2;V++)if(r(V===0?y:g,p,m),t.loc===e.ORIGIN){let W=V===0?y:g;return{x:W.x,y:W.y,t:t.t}}else if(t.loc===e.BETWEEN){let W=+(x+t.t*(w-x)).toPrecision(10),H=+(E+t.t*(T-E)).toPrecision(10);return{x:W,y:H,t:t.t}}return null}else{for(let H=0;H<2;H++)if(r(H===0?y:g,p,m),t.loc===e.ORIGIN){let G=H===0?y:g;return{x:G.x,y:G.y,t:t.t}}let V=+(x+z*(w-x)).toPrecision(10),W=+(E+z*(T-E)).toPrecision(10);return{x:V,y:W,t:z}}}function r(p,m,y){let g=y.x-m.x,x=y.y-m.y,w=p.x-m.x,S=p.y-m.y,M=g*S-w*x;if(p.x===m.x&&p.y===m.y){t.loc=e.ORIGIN,t.t=0;return}if(p.x===y.x&&p.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(p,m){let y=[],g=[];for(let x=1;x<p.length;x++){let w=p[x-1],S=p[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(p,m,y){let g=new Ce;m.getCenter(g);let x=[];return y.forEach(w=>{w.boundingBox.containsPoint(g)&&n(p,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(p,m,y,g,x){(x==null||x==="")&&(x="nonzero");let w=new Ce;p.boundingBox.getCenter(w);let S=[new Ce(y,w.y),new Ce(g,w.y)],M=a(S,p.boundingBox,m);M.sort((L,B)=>L.point.x-B.point.x);let E=[],T=[];M.forEach(L=>{L.identifier===p.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(p.identifier),x==="evenodd"){let L=P.length%2===0,B=P[P.length-2];return{identifier:p.identifier,isHole:L,for:B}}else if(x==="nonzero"){let L=!0,B=null,z=null;for(let j=0;j<P.length;j++){let V=P[j];m[V]&&(L?(z=m[V].isCW,L=!1,B=V):z!==m[V].isCW&&(z=m[V].isCW,L=!0))}return{identifier:p.identifier,isHole:L,for:B}}else console.warn('fill-rule: "'+x+'" is currently not implemented.')}let o=0,l=999999999,c=-999999999,u=[];this.subPaths.forEach(p=>{let m=p.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:p.curves,points:m,isCW:hxe.isClockWise(m),identifier:o++,boundingBox:new JX(new Ce(w,g),new Ce(x,y))})});let h=u.map(p=>{var m;return s(p,u,l,c,(m=this.userData)==null?void 0:m.style.fillRule)}),d=[];return u.forEach(p=>{let m=h[p.identifier];if(m&&!m.isHole){let y=new iL;y.curves=p.curves,h.filter(g=>(g==null?void 0:g.isHole)&&g.for===p.identifier).forEach(g=>{if(g){let x=u[g.identifier],w=new tL;w.curves=x.curves,y.holes.push(w)}}),d.push(y)}}),d}},Pwe=!1,Dwe,wue=new Promise(e=>{Dwe=e}),_ue=!1,GO;function vht(){if(Pwe=!0,_ue)return;if(GO)return GO;async function e(){let t=await I0(()=>import("./opentype-U-0Y99ve.js"),[]);Dwe(t),_ue=!0}return GO=e(),GO}var yht=class{async load(e,t,i=()=>{}){let{load:r}=await wue;r(e,(n,a)=>{n||!a?i(n??"Something went wrong"):t(a)})}async parse(e){let{parse:t,Bidi:i}=await wue;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 xht(e){return await(await fetch(e)).arrayBuffer()}var bht=new yht;async function Sue(e){let t,i,r=!1;if(e.url?(t=await xht(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(Pwe){let n=await bht.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 wht(e,t){return t.state.glyphIndex===e||t.state.fina===e||t.state.medi===e||t.state.init===e}var _ht=class{constructor(e){this._arrayBuffer=new ArrayBuffer(1),this._isLoaded=!1,this._intercepted=!1,this._isUserFont=e.isUserFont??!1,this._loadingPromise=Sue(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=Sue(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(wht(c,h)||o)a.push({char:u,index:c,replacements:[h.state.glyphIndex],replacementChars:[h.char]}),s++;else{let d=h.char,p="",m=[h.state.glyphIndex],y=[],g=!1;for(;!g;)s++,p=t.charAt(s),d+=p,m.push(e.charToGlyphIndex(p)),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}},vut=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}},yut=class extends vut{create(e){return URL.createObjectURL(new Blob([e]))}dispose(e,t){URL.revokeObjectURL(t)}},KT;function xut(e){return typeof e=="string"?e:(KT||(KT=new yut),KT.load(e))}function but(){KT&&KT.disposeAll()}var wut=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}},_ut=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}},wwe=class extends wut{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=xut(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 YXe(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()}},Bv=class extends wwe{};function Sut(e,t){var i=Tut(t);return i.formatToParts?Mut(i,e):Eut(i,e)}var Aut={year:0,month:1,day:2,hour:3,minute:4,second:5};function Mut(e,t){try{for(var i=e.formatToParts(t),r=[],n=0;n<i.length;n++){var a=Aut[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 Eut(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 _6={};function Tut(e){if(!_6[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";_6[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 _6[e]}function _we(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 cue=36e5,Cut=6e4,S6={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function Swe(e,t,i){var r,n;if(!e||(r=S6.timezoneZ.exec(e),r))return 0;var a;if(r=S6.timezoneHH.exec(e),r)return a=parseInt(r[1],10),uue(a)?-(a*cue):NaN;if(r=S6.timezoneHHMM.exec(e),r){a=parseInt(r[1],10);var s=parseInt(r[2],10);return uue(a,s)?(n=Math.abs(a)*cue+s*Cut,a>0?-n:n):NaN}if(Out(e)){t=new Date(t||Date.now());var o=i?t:Put(t),l=G9(o,e),c=i?l:Dut(t,l,e);return-c}return NaN}function Put(e){return _we(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function G9(e,t){var i=Sut(e,t),r=_we(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 Dut(e,t,i){var r=e.getTime(),n=r-t,a=G9(new Date(n),i);if(t===a)return t;n-=a-t;var s=G9(new Date(n),i);return a===s?a:Math.max(a,s)}function uue(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}var hue={};function Out(e){if(hue[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),hue[e]=!0,!0}catch{return!1}}var Rut=N0(kGe(),1),due=N0(BGe(),1),Iut=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Nut=Iut,A6=36e5,fue=6e4,Lut=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:Nut};function kut(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?Lut:(0,Rut.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=But(e),a=zut(n.date,r),s=a.year,o=a.restDateString,l=Uut(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,h;if(n.time&&(u=jut(n.time),isNaN(u)))return new Date(NaN);if(n.timeZone||i.timeZone){if(h=Swe(n.timeZone||i.timeZone,new Date(c+u)),isNaN(h))return new Date(NaN)}else h=(0,due.default)(new Date(c+u)),h=(0,due.default)(new Date(c+u+h));return new Date(c+u+h)}else return new Date(NaN)}function But(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 zut(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 Uut(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,mue(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 Hut(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 mue(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,gue(t,a)?pue(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 gue(t,a,l)?pue(t,a,l):new Date(NaN)}return null}function jut(e){var t,i,r;if(t=Kl.HH.exec(e),t)return i=parseFloat(t[1].replace(",",".")),M6(i)?i%24*A6:NaN;if(t=Kl.HHMM.exec(e),t)return i=parseInt(t[1],10),r=parseFloat(t[2].replace(",",".")),M6(i,r)?i%24*A6+r*fue: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 M6(i,r,n)?i%24*A6+r*fue+n*1e3:NaN}return null}function pue(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 Fut=[31,28,31,30,31,30,31,31,30,31,30,31],Vut=[31,29,31,30,31,30,31,31,30,31,30,31];function Awe(e){return e%400===0||e%4===0&&e%100!==0}function mue(e,t,i){if(t<0||t>11)return!1;if(i!=null){if(i<1)return!1;var r=Awe(e);if(r&&i>Vut[t]||!r&&i>Fut[t])return!1}return!0}function Hut(e,t){if(t<1)return!1;var i=Awe(e);return!(i&&t>366||!i&&t>365)}function gue(e,t,i){return!(t<0||t>52||i!=null&&(i<0||i>6))}function M6(e,t,i){return!(e!=null&&(e<0||e>=25)||t!=null&&(t<0||t>=60)||i!=null&&(i<0||i>=60))}function Gut(e,t,i){var r=kut(e,i),n=Swe(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 vue(e=new Date,t){let i=t.format,r=e.getSeconds(),n=e;t&&t.timeZone!==null&&(n=Gut(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 Wut(e,t){switch(e.type){case"fresnel":return Yut(e,t);case"gradient":return $ut(e,t);case"depth":return Kut(e,t);case"normal":return Qut(e,t);case"noise":return Zut(e,t);case"rainbow":return Jut(e,t);case"toon":return eht(e,t);case"outline":return tht(e,t);case"transmission":return iht(e,t);case"pattern":return rht(e,t);case"color":default:return Xut(e,t)}}function qut(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{...qut(e),alpha:a,mode:r,isMask:n}}function Xut(e,t){return{...Rd(e,t),color:tc(e.color,t)}}function Yut(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 $ut(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 Ni(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 Kut(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 Ni(d[0],d[1],d[2],d[3]):new Ni(0,0,0,0)),steps:u.slice(0,c.length),smooth:h}}function Qut(e,t){let{cnormal:i}=e;return{...Rd(e,t),cnormal:new Y(i[0],i[1],i[2])}}function Zut(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 Jut(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 eht(e,t){return{...Rd(e,t),positioning:e.positioning,colors:e.colors.map(i=>new Ni(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 tht(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 iht(e,t){return{...Rd(e,t),thickness:e.thickness,ior:e.ior,roughness:e.roughness}}function rht(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 GL=class extends Ks{},nht={noise:["noiseType"],texture:["projection","axis","side"],video:["projection","axis","side"],displace:["noiseType"],light:["roughnessMap","bumpMap"],depth:["smooth","isWorldSpace","gradientType","isVector"],pattern:["style","projection","axis"]},aht={depth:["colors"]};function sht(e,t,i){var a,s;if(t==="isMask")return!0;let r=nht[e.type],n=aht[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 E6(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 a$(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 Bv||l.image.deref(),l.image=o}if("video"in a){let s=a.video,o=t.video(s),l=r;l.image instanceof Bv||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=(Di(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;E6(i.data.texture.repeat,l)&&(n=!0),o.repeat=QT(l,t).map((c,u)=>typeof l[u]=="string"?1/c:c)}if("offset"in a){let l=a.offset;E6(i.data.texture.offset,l)&&(n=!0),o.offset=QT(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||E6(l,c))&&(n=!0),o.rotation=Di(c,t)??0}o.updateMatrix()}return n}function oht(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(Ewe(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 i$))switch(n=n||sht(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 GL?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 GL?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:{a$(s,t,i);break}case sx:{o.value=s.map(l=>new Ni(...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,Di=(e,t,i)=>typeof e=="number"?e:t.getVariable(e,i),lv=(e,t)=>(e||(e=new Y),e.x=Di(e.x,t)??0,e.y=Di(e.y,t)??0,e.z=Di(e.z,t)??0,e),Zp=(e,t)=>(e||(e=new Ce),e.x=Di(e.x,t)??0,e.y=Di(e.y,t)??0,e),QT=(e,t)=>{let i=e.map(r=>Di(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)Ewe(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 F9(n,i.texture.wrapping,i.texture.minFilter??1008,i.texture.magFilter??1006),s=new lut(n),o=new cut(QT(i.texture.repeat,r),QT(i.texture.offset,r),Di(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(...QT(i.size,r)):new Ce(100,100)),p=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 r$(a,s,l,c,u,h,d,p,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:p,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 F9(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((Di(i.texture.rotation??0,r)??0)*Wt.DEG2RAD),u=new owe(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=>Di(g,r)??0))),a=new Zt(Di(i.scale,r)??10),s=new Zt(Di(i.intensity,r)??8),o=new Zt(Di(i.movement,r)??1),l=new Ln(i.noiseType??0),c=new Ln(i.voronoiStyle??0),u=new Zt(Di(i.smoothness,r)??.5),h=new Zt(Di(i.seed,r)??0),d=new Zt(Di(i.highCut,r)??1),p=new Zt(Di(i.lowCut,r)??0),m=new Ln(Di(i.quality,r)??1),y=new xwe(s,o,n,c,u,h,d,p,m,a,l);return new Mwe(e,t,i,{offset:n,scale:a,intensity:s,movement:o,noiseType:l,voronoiStyle:c,smoothness:u,seed:h,highCut:d,lowCut:p,quality:m},y,r)}else throw new Error;else return uht(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):oht(r.props,i.shared,this,t)||n}else if(r.path[0]==="texture")return"texture"in t||"video"in t?a$(r.props,i.shared,this)||n:!0;return n}dispose(){if(lht(this)){let e=this.uniforms[`f${this.id}_texture`];if(!e)return!1;let t=e;t.image instanceof Bv||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}},Mwe=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 n$,c={};else if(i.category==="lambert"){n=new fut;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 gut;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 mut;let u=new Zt(i.roughness??.3),h=new Zt(i.metalness??0),d=new Zt(i.reflectivity??.5),p=new wl(i.occlusion??!0);c={roughness:u,metalness:h,reflectivity:d,occlusion:p},n.roughness=u,n.metalness=h,n.reflectivity=d,n.occlusion=p}else{n=new put;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 lht(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 cht(e,t,i,r,n){switch(e.type){case"color":{let a=new qa(r.color??Au),s=nh(r),o=new V9(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(Di(r.bias,n)??.1),o=new Zt(Di(r.scale,n)??1),l=new Zt(Di(r.intensity,n)??2),c=new Zt(Di(r.factor,n)??1),u=nh(r),h=new uut(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(Di(r.filmThickness,n)??30),s=new Zt(Di(r.movement,n)??0),o=new hh(lv(r.wavelengths,n)),l=new Zt(Di(r.noiseStrength,n)??0),c=new Zt(Di(r.noiseScale,n)??1),u=new hh(lv(r.offset,n)),h=nh(r),d=new fwe(a,s,o,l,c,u,h.alpha,h.isMask),p=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,p,h.isMask,n)}case"transmission":{let a=new Zt(Di(r.thickness??10,n)),s=new Zt(Di(r.ior??1.5,n)),o=new Zt(Di(r.roughness??.5,n)),l=gi.transmissionSize,c=gi.transmissionRenderTarget,u=gi.transmissionRenderTargetDepth,h=window.innerWidth,d=window.innerHeight,p=h>=d?new Wo(d/h,1):new Wo(1,h/d),m=nh(r),y=new vwe(a,s,o,l,c,u,p,m.alpha),g=new Kn(y.calpha,"f");return new ja(t,i,e,{thickness:a,ior:s,roughness:o,aspectRatio:p,...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 Ni(0,0,0,1)),s.value[1]=new Ni(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(Di(r.noiseStrength??0,n)),h=new Zt(Di(r.noiseScale??1,n)),d=new mm(r.shadowColor),p=new hh(lv(r.offset??new Y(0,0,0),n)),m=nh(r),y=new mwe(a,s,o,l,c,u,h,d,p,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:p,...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(Di(r.outlineWidth??.1,n)),l=new Zt(Di(r.contourWidth??.1,n)),c=new Zt(Di(r.outlineThreshold??.1,n)),u=new Zt(Di(r.contourThreshold??.1,n)),h=new Zt(Di(r.outlineSmoothing??.1,n)),d=new Zt(Di(r.contourFrequency??.1,n)),p=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 uwe(a,s,o,l,c,u,h,d,p,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:p,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(Di(r.near,n)??50),l=new Zt(Di(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)),p;r.colors?p=new sx(r.colors.length,r.colors):(p=new sx(2,new Ni(0,0,0,1)),p.value[1]=new Ni(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 rwe(a,s,o,l,c,u,h,d,p,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:p,steps:m,...y},g,y.mode,x,y.isMask,n)}case"noise":{let a=new Zt(Di(r.scale,n)??1),s=new hh(lv(r.size??new Y(100,100,100),n)),o=new Zt(Di(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),p=new mm(r.colorC),m=new mm(r.colorD),y=new Ln(r.noiseType??0),g=new Ln(r.voronoiStyle??0),x=new Zt(Di(r.highCut,n)??1),w=new Zt(Di(r.lowCut,n)??0),S=new Zt(Di(r.smoothness,n)??.5),M=new Zt(Di(r.seed,n)??.5),E=new Ln(r.quality??1),T=nh(r),R=new lwe(a,s,o,l,c,u,h,d,p,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:p,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 iwe(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 Ni(0,0,0,1)),o.value[1]=new Ni(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(Di(r.angle??0,n)),d=nh(r),p=new awe(a,s,o,l,c,u,h,d.alpha,d.isMask),m=new Kn(p.calpha,"f");return new ja(t,i,e,{gradientType:a,smooth:s,colors:o,steps:l,offset:c,morph:u,angle:h,...d},p,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(Di(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)),p=new Zt(Di(r.size??.5,n)),m=new Zt(Di(r.variation??0,n)),y=new Zt(Di(r.smoothness??.5,n)),g=new Zt(Di(r.zigzag??0,n)),x=new Zt(Di(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 hwe(a,s,o,l,c,u,h,d,p,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:p,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 V9(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 uht(e,t,i,r){let n=Wut(i,r);return cht(i,e,t,n,r)}function Ewe(e,t,i,r){if(i.type==="displace"&&(e==="intensity"||e==="visible")){let n=t.uniforms[`f${t.id}_intensity`];return n?(n.value=(Di(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 x_(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""}},hht=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()}},s$=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 hht(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=x_(e,t.shared),this.saveVariableLocations(t)}onVariableUpdate(e,t,i){if(e[0]==="alphaOverride")this.transparent=x_(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=x_(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))),a$({[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 n$,{},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 r$&&(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=x_(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 lue(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 lue(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 Mwe);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 Z1e;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 F9&&!t.image.loaded)return!1}return!0}};Object.defineProperties(rg.prototype,{properties:{get:function(){return this.fragment.properties}}});var W9=class extends s${constructor(e,t,i){super(e,t,!1),this.uuid=i,this.allowVariableSaves=!0,this.saveVariableLocations(t)}},yue=new Map;function dht(e){if(typeof e=="string")return e;let t=yue.get(e);return t||(t={url:URL.createObjectURL(new Blob([e]))},yue.set(e,t)),t.url}var Twe,fht=new Promise(e=>{Twe=e}),xue=!1,HO;function pht(){if(xue)return;if(HO)return HO;async function e(){await I0(()=>import("./howler-v1Wn81iL.js").then(t=>t.h),[]),Twe(window!==void 0?window:global),xue=!0}return HO=e(),HO}var Cwe;fht.then(e=>Cwe=e);function bue(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 mht(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;bue(s.events,i),t=t||i.some(o=>o.data.type==="Audio")}),n.events===void 0||Array.isArray(n.events)===!1)return!0;bue(n.events,i),t=t||i.some(a=>a.data.type==="Audio")}),t}var MT=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:dht(e),format:"wav"},this.sound=new Cwe.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()}},ght=class{constructor(){this.type="ShapePath",this.color=new Si,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new tL,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(p,m,y,g){let x=p.x,w=m.x,S=y.x,M=g.x,E=p.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),B=(P-R)*(w-x)-(M-S)*(T-E),z=I/B,j=L/B;if(B===0&&I!==0||z<=0||z>=1||j<0||j>1)return null;if(I===0&&B===0){for(let V=0;V<2;V++)if(r(V===0?y:g,p,m),t.loc===e.ORIGIN){let W=V===0?y:g;return{x:W.x,y:W.y,t:t.t}}else if(t.loc===e.BETWEEN){let W=+(x+t.t*(w-x)).toPrecision(10),H=+(E+t.t*(T-E)).toPrecision(10);return{x:W,y:H,t:t.t}}return null}else{for(let H=0;H<2;H++)if(r(H===0?y:g,p,m),t.loc===e.ORIGIN){let G=H===0?y:g;return{x:G.x,y:G.y,t:t.t}}let V=+(x+z*(w-x)).toPrecision(10),W=+(E+z*(T-E)).toPrecision(10);return{x:V,y:W,t:z}}}function r(p,m,y){let g=y.x-m.x,x=y.y-m.y,w=p.x-m.x,S=p.y-m.y,M=g*S-w*x;if(p.x===m.x&&p.y===m.y){t.loc=e.ORIGIN,t.t=0;return}if(p.x===y.x&&p.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(p,m){let y=[],g=[];for(let x=1;x<p.length;x++){let w=p[x-1],S=p[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(p,m,y){let g=new Ce;m.getCenter(g);let x=[];return y.forEach(w=>{w.boundingBox.containsPoint(g)&&n(p,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(p,m,y,g,x){(x==null||x==="")&&(x="nonzero");let w=new Ce;p.boundingBox.getCenter(w);let S=[new Ce(y,w.y),new Ce(g,w.y)],M=a(S,p.boundingBox,m);M.sort((L,B)=>L.point.x-B.point.x);let E=[],T=[];M.forEach(L=>{L.identifier===p.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(p.identifier),x==="evenodd"){let L=P.length%2===0,B=P[P.length-2];return{identifier:p.identifier,isHole:L,for:B}}else if(x==="nonzero"){let L=!0,B=null,z=null;for(let j=0;j<P.length;j++){let V=P[j];m[V]&&(L?(z=m[V].isCW,L=!1,B=V):z!==m[V].isCW&&(z=m[V].isCW,L=!0))}return{identifier:p.identifier,isHole:L,for:B}}else console.warn('fill-rule: "'+x+'" is currently not implemented.')}let o=0,l=999999999,c=-999999999,u=[];this.subPaths.forEach(p=>{let m=p.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:p.curves,points:m,isCW:hxe.isClockWise(m),identifier:o++,boundingBox:new JX(new Ce(w,g),new Ce(x,y))})});let h=u.map(p=>{var m;return s(p,u,l,c,(m=this.userData)==null?void 0:m.style.fillRule)}),d=[];return u.forEach(p=>{let m=h[p.identifier];if(m&&!m.isHole){let y=new iL;y.curves=p.curves,h.filter(g=>(g==null?void 0:g.isHole)&&g.for===p.identifier).forEach(g=>{if(g){let x=u[g.identifier],w=new tL;w.curves=x.curves,y.holes.push(w)}}),d.push(y)}}),d}},Pwe=!1,Dwe,wue=new Promise(e=>{Dwe=e}),_ue=!1,GO;function vht(){if(Pwe=!0,_ue)return;if(GO)return GO;async function e(){let t=await I0(()=>import("./opentype-U-0Y99ve.js"),[]);Dwe(t),_ue=!0}return GO=e(),GO}var yht=class{async load(e,t,i=()=>{}){let{load:r}=await wue;r(e,(n,a)=>{n||!a?i(n??"Something went wrong"):t(a)})}async parse(e){let{parse:t,Bidi:i}=await wue;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 xht(e){return await(await fetch(e)).arrayBuffer()}var bht=new yht;async function Sue(e){let t,i,r=!1;if(e.url?(t=await xht(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(Pwe){let n=await bht.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 wht(e,t){return t.state.glyphIndex===e||t.state.fina===e||t.state.medi===e||t.state.init===e}var _ht=class{constructor(e){this._arrayBuffer=new ArrayBuffer(1),this._isLoaded=!1,this._intercepted=!1,this._isUserFont=e.isUserFont??!1,this._loadingPromise=Sue(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=Sue(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(wht(c,h)||o)a.push({char:u,index:c,replacements:[h.state.glyphIndex],replacementChars:[h.char]}),s++;else{let d=h.char,p="",m=[h.state.glyphIndex],y=[],g=!1;for(;!g;)s++,p=t.charAt(s),d+=p,m.push(e.charToGlyphIndex(p)),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),p=[],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,B,z,j,V)=>{let W=L.index===0?`
5556
5556
  `:L.unicode?String.fromCharCode(L.unicode):void 0,H=T[P],G=0;if(W===`
5557
5557
  `)G=u;else if(W===" ")G=R;else{let Q=this.createPath(L,n,B,z,t);Q&&(G=Q.offsetX,p.push(Q.path))}if(H.replacements.length===1)y[w].push([B,z]),m[w].push(G);else{let Q=H.replacements.map(Z=>(r.glyphs.get(Z).advanceWidth??0)*n),ne=Q.reduce((Z,ae)=>Z+=ae,0),se=Q.map(Z=>Z/ne),$=B;for(let Z=0;Z<se.length;Z++){let ae=G*se[Z];y[w].push([$,z]),m[w].push(ae),$+=ae}}P++}),d-=a}let g=[];for(let w=0,S=p.length;w<S;w++)g.push(...p[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(`
@@ -12444,5 +12444,5 @@ No matching component was found for:
12444
12444
  └────────────────────────┘`})})}):C.jsx("div",{className:"h-full flex gap-1 p-2 overflow-x-auto terminal-scrollbar font-mono text-[11px]",children:Q_.map(r=>{const n=i[r.id]||[],a=tPt[r.id]||"terminal-dim",s=ePt[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(nPt,{task:o},o.id))})]},r.id)})})}function nPt({task:e}){const{selectTask:t,selectedTaskId:i}=_n(),r=lB(),n=iPt[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 aPt(e,t=20){const i=Math.round(e/100*t),r=t-i;return"["+("█".repeat(i)+"░".repeat(r))+"] "+e+"%"}function sPt(){const{activeSprint:e}=cB(),t=T0(),i=te.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:aPt(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 oPt(){const{activeSprint:e,tasks:t}=_n(),[i,r]=te.useState("burndown"),{chart:n,maxVal:a}=te.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 p=n[d],m=p.actual>=u,y=p.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 mpe={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 gpe(e,t=12){const i=Math.round(e/100*t),r=t-i;return"█".repeat(i)+"░".repeat(r)}function lPt(){const{activeProject:e,tasks:t,sprints:i,selectTask:r}=_n(),[n,a]=te.useState(null),[s,o]=te.useState(null),l=te.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 p=d.sprintId||"unknown";u.has(p)||u.set(p,new Map);const m=u.get(p),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,p]of u){const m=c.get(d);if(!m)continue;const y=Array.from(p.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,p)=>(d.sprint.order??0)-(p.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:[gpe(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 p=`${c.sprint.id}:${d.name}`,m=s===p,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:p),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:[gpe(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=mpe[g.status]||mpe.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)})})]},p)})]})]},c.sprint.id)})})]})}const RMe={backlog:".",planned:"-",pending:"~",in_progress:"*",in_review:"?",completed:"+",blocked:"!",deferred:"_"},IMe={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 cPt(){const{tasks:e}=_n(),{roots:t,edgeCount:i,nodeCount:r}=te.useMemo(()=>{const n=new Map,a=new Map,s=new Map;for(const p of e){s.set(p.id,p);const m=new Set([...p.dependsOn,...p.blockedBy]);n.set(p.id,m)}const o=new Set;let l=0;for(const p of e){const m=n.get(p.id)??new Set;if(m.size>0){o.add(p.id);for(const y of m)o.add(y),l++,a.has(y)||a.set(y,new Set),a.get(y).add(p.id)}}if(o.size===0)return{roots:[],edgeCount:0,nodeCount:0};const c=new Set;for(const p of o){const m=n.get(p)??new Set;Array.from(m).some(g=>o.has(g))||c.add(p)}if(c.size===0){const p=Array.from(o).slice(0,3);for(const m of p)c.add(m)}const u=new Set;function h(p,m){if(u.has(p)||m>6)return null;u.add(p);const y=s.get(p);if(!y)return null;const g=a.get(p)??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 p of c){const m=h(p,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(NMe,{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(RMe).filter(([n])=>e.some(a=>a.status===n)).map(([n,a])=>C.jsxs("span",{className:IMe[n]||"terminal-dim",children:["[",a,"] ",n.replace(/_/g," ")]},n))})]})}function NMe({node:e,prefix:t,isLast:i}){const r=i?"└─":"├─",n=t+(i?" ":"│ "),a=RMe[e.task.status]||"?",s=IMe[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(NMe,{node:l,prefix:n,isLast:c===e.children.length-1},l.task.id))]})}function uPt(){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 hPt(){const{connectionStatus:e}=bi(),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 dPt(){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(hPt,{})]}),C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx(DX,{}),C.jsx(uPt,{})]})]}),C.jsx(UCt,{}),C.jsx(OK,{}),C.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[e==="agents"&&C.jsx(fPt,{}),e==="tracker"&&C.jsx(pPt,{})]})]})}function fPt(){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(HCt,{})}),C.jsx("main",{className:"flex-1 overflow-hidden",children:C.jsx(SK,{})}),C.jsx("aside",{className:"w-72 border-l border-[#1a3a1a] terminal-scrollbar shrink-0",children:C.jsx(DK,{AgentDetail:QCt,ActivityFeed:XCt,FileWatcher:JCt,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 pPt(){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(rPt,{})}),e&&C.jsx("aside",{className:"w-80 border-l border-[#1a3a1a] overflow-y-auto terminal-scrollbar shrink-0",children:C.jsx(AK,{})}),C.jsxs("aside",{className:"w-80 border-l border-[#1a3a1a] overflow-y-auto terminal-scrollbar shrink-0 flex flex-col",children:[C.jsx(sPt,{}),C.jsx(oPt,{}),C.jsx(cPt,{})]})]}),C.jsx("div",{className:"h-48 border-t border-[#1a3a1a] overflow-y-auto terminal-scrollbar shrink-0",children:C.jsx(lPt,{})})]})}const qw={TIME:"⌛",PARTY:"⚔",SKILLS:"🎯",EVENTS:"📜",LOOT:"📦",POISON:"☠"};function mPt(){const{session:e,agents:t,events:i}=bi(),[r,n]=te.useState("00m 00s");te.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:qw.TIME,color:"var(--pixel-text)"},{label:"PARTY",value:`${a}/${t.length}`,icon:qw.PARTY,color:a>0?"var(--pixel-green)":"var(--pixel-text)"},{label:"SKILLS",value:Lm(o),icon:qw.SKILLS,color:"var(--pixel-cyan)"},{label:"EVENTS",value:Lm((e==null?void 0:e.eventCount)??0),icon:qw.EVENTS,color:"var(--pixel-text)"},{label:"LOOT",value:Lm(l),icon:qw.LOOT,color:"var(--pixel-orange)"},{label:"POISON",value:String(s),icon:qw.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 gPt={"team-lead":"PALADIN","code-writer":"MAGE","code-reviewer":"CLERIC",tester:"RANGER",researcher:"SCHOLAR",designer:"BARD"},vPt={"team-lead":"⚔","code-writer":"🧙","code-reviewer":"🛡",tester:"🎯",researcher:"📚",designer:"🎨"};function yPt(e){const t=e.name.toLowerCase();for(const[i,r]of Object.entries(gPt))if(t.includes(i))return r;return e.type==="lead"?"PALADIN":"ADVENTURER"}function LMe(e){const t=e.name.toLowerCase();for(const[i,r]of Object.entries(vPt))if(t.includes(i))return r;return"⚔"}function kMe(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 xPt(e){return e.status==="active"}function bPt(){const e=X7(),{selectedAgentId:t,selectAgent:i}=bi(),[r,n]=te.useState(!1),{activeAgents:a,inactiveAgents:s}=te.useMemo(()=>{const o=[],l=[];for(const c of e)xPt(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(_Pt,{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(wPt,{agent:o,isSelected:t===o.id,onSelect:()=>i(t===o.id?null:o.id)},o.id))})]})]})}function wPt({agent:e,isSelected:t,onSelect:i}){const r=Ch(e.id,e.name,e.type??void 0),n=kMe(e.status),a=LMe(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 _Pt({agent:e,isSelected:t,onSelect:i}){const r=f0(e.name),n=kMe(e.status),a=yPt(e),s=LMe(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 BMe=new Set(["TaskList","TaskGet"]);function SPt(e){const t=[];let i=0;for(;i<e.length;){const r=e[i];if(r.tool&&BMe.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 APt={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 MPt(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 EPt(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 TPt(){const e=Cq(),t=bi(m=>m.agents),{searchQuery:i,setSearchQuery:r}=sB(),n=Oi(m=>m.followMode),a=Oi(m=>m.hidePolling),s=Oi(m=>m.toggleFollowMode),o=Oi(m=>m.toggleHidePolling),l=te.useRef(null),[c,u]=te.useState(null),h=te.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]);te.useEffect(()=>{n&&l.current&&(l.current.scrollTop=0)},[e.length,n]);const d=te.useMemo(()=>{let m=e;if(a&&(m=m.filter(y=>!y.tool||!BMe.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]),p=te.useMemo(()=>SPt(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:p.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(CPt,{event:m,agentNameMap:h,isExpanded:c===m.id,groupCount:y,onToggle:()=>u(c===m.id?null:m.id)})},g))})})]})}function CPt({event:e,agentNameMap:t,isExpanded:i,groupCount:r,onToggle:n}){const[a,s]=te.useState(!1),o=EPt(e.category),l=oB(e.tool||e.hookType),c=APt[e.tool||""]||`used ${l.toUpperCase()}!`,u=MPt(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:Pq(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:Dq(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 PPt=[{id:"activity",label:"LOG",icon:"📜"},{id:"files",label:"LOOT",icon:"📦"},{id:"errors",label:"CURSES",icon:"☠"},{id:"messages",label:"CHAT",icon:"💬"}];function DPt(){const{selectedAgentId:e,agents:t,events:i,selectAgent:r}=bi(),[n,a]=te.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),p=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:`${p/m*100}%`}})}),C.jsxs("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-muted)",width:"40px",textAlign:"right"},children:[p,"/",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:PPt.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 vpe={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 OPt(){const{session:e}=bi(),[t,i]=te.useState([]);te.useEffect(()=>{if(!(e!=null&&e.id))return;let s=!1;async function o(){try{const{files:c}=await q7(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=vpe[s.changeType]||vpe.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 RPt={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)"}},ype={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 IPt(){const e=T0(),t=r=>r==="pending"?"planned":r==="deferred"?"backlog":r==="in_review"||r==="blocked"?"in_progress":r,i=Q_.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:Q_.map(r=>{const n=i[r.id]||[],a=RPt[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(NPt,{task:s},s.id))})]},r.id)})})}function NPt({task:e}){const{selectTask:t,selectedTaskId:i}=_n(),r=lB(),n=ype[e.priority]||ype.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 LPt(){const{activeSprint:e}=cB(),t=T0(),i=te.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 kPt(){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),p=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," "),"|",p,"|"]},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 xpe={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 BPt(){const{activeProject:e,tasks:t,sprints:i,selectTask:r}=_n(),[n,a]=te.useState(null),[s,o]=te.useState(null),l=te.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 p=d.sprintId||"unknown";u.has(p)||u.set(p,new Map);const m=u.get(p),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,p]of u){const m=c.get(d);if(!m)continue;const y=Array.from(p.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,p)=>(d.sprint.order??0)-(p.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 p=`${c.sprint.id}:${d.name}`,m=s===p,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:p),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=xpe[S.status]||xpe.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)})})]},p)})})]},c.sprint.id)})})]})}const Xw=140,Yw=44,zPt=36,UPt=20,bpe=28,wpe=20,jPt={backlog:"#6b7280",planned:"#457b9d",pending:"#f4a261",in_progress:"#2dce89",in_review:"#7c5cff",completed:"#ffd700",blocked:"#e63946",deferred:"#6b7280"},FPt={backlog:"LOCKED",planned:"AVAILABLE",pending:"QUEUED",in_progress:"LEARNING",in_review:"TESTING",completed:"MASTERED",blocked:"SEALED",deferred:"HIDDEN"};function _pe(e){return jPt[e]??"#6b7280"}function Spe(e){return FPt[e]??e.replace(/_/g," ").toUpperCase()}function VPt(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 HPt(){const{tasks:e}=_n(),t=te.useRef(null),[i,r]=te.useState(null),{nodes:n,edges:a,svgWidth:s,svgHeight:o,isEmpty:l}=te.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 p=new Set;for(const R of e){const P=d.get(R.id)??[];if(P.length>0){p.add(R.id);for(const I of P)p.add(I)}}const m=e.filter(R=>p.has(R.id));if(m.length===0)return{nodes:[],edges:[],svgWidth:0,svgHeight:0,isEmpty:!0};const y=VPt(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,B)=>(I[L.status]??9)-(I[B.status]??9)||L.title.localeCompare(B.title)),P.forEach((L,B)=>{const z=wpe+R*(Xw+zPt),j=bpe+B*(Yw+UPt);w.push({id:L.id,title:L.title,status:L.status,col:R,row:B,x:z,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))+Xw+wpe,T=Math.max(...w.map(R=>R.y))+Yw+bpe;return{nodes:w,edges:S,svgWidth:E,svgHeight:T,isEmpty:!1}},[e]);te.useEffect(()=>{var d;(d=t.current)==null||d.scrollTo({left:0,top:0})},[n]);const c=te.useMemo(()=>{const d=new Map;for(const p of n)d.set(p.id,p);return d},[n]),u=te.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:_pe(d),border:"1px solid #000"}}),C.jsx("span",{className:"pixel-text-xs",style:{color:"var(--pixel-text-dim)"},children:Spe(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 p=c.get(d.fromId),m=c.get(d.toId);if(!p||!m)return null;const y=u(d),g=p.x+Xw,x=p.y+Yw/2,w=m.x,S=m.y+Yw/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 p=_pe(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:Xw,height:Yw,fill:"#1a1a2e",stroke:m?"#ffd700":p,strokeWidth:3}),C.jsx("rect",{x:d.x+3,y:d.y+3,width:Xw-6,height:2,fill:"rgba(255,255,255,0.08)"}),C.jsx("rect",{x:d.x+6,y:d.y+Yw/2-4,width:8,height:8,fill:p}),g&&C.jsx("text",{x:d.x+Xw-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:Spe(d.status)})]},d.id)})]})})]})}function GPt(){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 WPt(){const{connectionStatus:e}=bi(),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 qPt(){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(WPt,{})]}),C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx(DX,{}),C.jsx(GPt,{})]})]}),C.jsx(mPt,{}),C.jsx(OK,{}),C.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[e==="agents"&&C.jsx(XPt,{}),e==="tracker"&&C.jsx(YPt,{})]})]})}function XPt(){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(bPt,{})}),C.jsx("main",{className:"flex-1 overflow-hidden",children:C.jsx(SK,{})}),C.jsx("aside",{className:"w-72 pixel-scrollbar shrink-0",style:{borderLeft:"3px solid var(--pixel-border)"},children:C.jsx(DK,{AgentDetail:DPt,ActivityFeed:TPt,FileWatcher:OPt,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 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(IPt,{})}),e&&C.jsx("aside",{className:"w-80 overflow-y-auto pixel-scrollbar shrink-0",style:{borderLeft:"3px solid var(--pixel-border)"},children:C.jsx(AK,{})}),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(LPt,{}),C.jsx(kPt,{}),C.jsx(HPt,{})]})]}),C.jsx("div",{className:"h-48 overflow-y-auto pixel-scrollbar shrink-0",style:{borderTop:"3px solid var(--pixel-border)"},children:C.jsx(BPt,{})})]})}const $Pt=[{id:"modern",label:"Modern",icon:"M"},{id:"pixel",label:"Pixel",icon:"P"},{id:"terminal",label:"Terminal",icon:"T"}];function RK(){const{theme:e,setTheme:t}=vb();return C.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-cam-surface-2 p-1 border border-cam-border",children:$Pt.map(i=>C.jsx("button",{onClick:()=>t(i.id),className:`
12445
12445
  px-3 py-1.5 rounded-md text-xs font-medium transition-all duration-200
12446
12446
  ${e===i.id?"bg-cam-accent text-white shadow-sm":"text-cam-text-muted hover:text-cam-text-secondary hover:bg-cam-surface-3"}
12447
- `,title:i.label,children:i.label},i.id))})}function KPt(){const{connectionStatus:e}=bi();return C.jsxs("div",{className:"h-screen w-screen flex flex-col modern-gradient-bg",children:[C.jsxs("header",{className:"h-12 flex items-center justify-between px-4 border-b border-cam-border/50 modern-glass shrink-0",children:[C.jsx("h1",{className:"text-sm font-semibold text-cam-text tracking-tight",children:"Claude Agent Monitor"}),C.jsx(RK,{})]}),C.jsx("div",{className:"flex-1 flex items-center justify-center",children:C.jsxs("div",{className:"text-center max-w-md mx-auto px-6",children:[C.jsx("div",{className:"w-16 h-16 rounded-2xl bg-cam-surface-2 border border-cam-border flex items-center justify-center mx-auto mb-6",children:C.jsx("span",{className:"text-3xl",children:e==="connected"?"📡":"🔌"})}),C.jsx("h2",{className:"text-xl font-semibold text-cam-text mb-2",children:"Waiting for connection..."}),C.jsx("p",{className:"text-sm text-cam-text-muted mb-8",children:e==="connected"?"Server connected. Start Claude Code in another terminal to see activity.":"No active session detected. Follow the steps below to get started."}),C.jsxs("div",{className:"text-left space-y-4",children:[C.jsx(wG,{number:1,title:"Configure hooks in your project",children:C.jsx("code",{className:"text-xs bg-cam-surface-2 px-2 py-1 rounded text-cam-accent font-mono",children:"cam init"})}),C.jsx(wG,{number:2,title:"Start Claude Code in another terminal",children:C.jsx("code",{className:"text-xs bg-cam-surface-2 px-2 py-1 rounded text-cam-accent font-mono",children:'claude "your task here"'})}),C.jsx(wG,{number:3,title:"Watch agents working",children:C.jsx("span",{className:"text-xs text-cam-text-muted",children:"Events will appear automatically on the dashboard."})})]}),e==="reconnecting"&&C.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2",children:[C.jsx("div",{className:"w-2 h-2 rounded-full bg-amber-400 animate-pulse"}),C.jsx("span",{className:"text-xs text-amber-400",children:"Reconnecting to server..."})]})]})})]})}function wG({number:e,title:t,children:i}){return C.jsxs("div",{className:"flex items-start gap-3",children:[C.jsx("div",{className:"w-6 h-6 rounded-full bg-cam-accent/20 border border-cam-accent/40 flex items-center justify-center shrink-0 mt-0.5",children:C.jsx("span",{className:"text-xs font-bold text-cam-accent",children:e})}),C.jsxs("div",{children:[C.jsx("p",{className:"text-sm text-cam-text font-medium",children:t}),C.jsx("div",{className:"mt-1",children:i})]})]})}function QPt(){const{connectionStatus:e}=bi();return C.jsxs("div",{className:"pixel-theme h-screen w-screen flex flex-col",style:{background:"var(--pixel-bg)"},children:[C.jsxs("header",{className:"h-14 flex items-center justify-between px-4 pixel-hud shrink-0",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(RK,{})]}),C.jsx("div",{className:"flex-1 flex items-center justify-center",children:C.jsxs("div",{className:"text-center max-w-md mx-auto px-6",children:[C.jsx("div",{className:"pixel-text-lg mb-2",style:{color:"var(--pixel-gold)",fontSize:"24px"},children:"> WAITING FOR CONNECTION..."}),C.jsx("p",{className:"pixel-text-xs mb-8",style:{color:"var(--pixel-text-muted)"},children:e==="connected"?"SERVER ONLINE. START CLAUDE CODE IN ANOTHER TERMINAL.":"NO ACTIVE SESSION. FOLLOW THE STEPS BELOW."}),C.jsxs("div",{className:"text-left space-y-3 mx-auto",style:{border:"2px solid var(--pixel-border)",background:"var(--pixel-panel)",padding:"12px 16px",maxWidth:"380px"},children:[C.jsx("div",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:"== QUEST LOG =="}),C.jsx("div",{className:"pixel-text-xs",style:{color:"var(--pixel-green)"},children:"[1] Run: cam init"}),C.jsx("div",{className:"pixel-text-xs",style:{color:"var(--pixel-green)"},children:'[2] Run: claude "your task"'}),C.jsx("div",{className:"pixel-text-xs",style:{color:"var(--pixel-green)"},children:"[3] Watch agents on dashboard"})]}),e==="reconnecting"&&C.jsx("div",{className:"mt-4",children:C.jsx("span",{className:"pixel-text-xs pixel-pulse",style:{color:"var(--pixel-gold)"},children:"RECONNECTING..."})})]})})]})}function ZPt(){const{connectionStatus:e}=bi();return C.jsxs("div",{className:"h-screen w-screen flex flex-col terminal-bg terminal-boot",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]",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(RK,{})]}),C.jsx("div",{className:"flex-1 flex items-center justify-center font-mono",children:C.jsxs("div",{className:"max-w-lg mx-auto px-6 text-[12px]",children:[C.jsx("div",{className:"text-[#00ff00] terminal-glow mb-4 text-[14px]",children:"$ cam status"}),C.jsx("div",{className:"text-[#00aa00] mb-1",children:e==="connected"?"[OK] Server connected on port 7890":"[..] Waiting for server connection..."}),C.jsx("div",{className:"text-[#ffaa00] mb-6",children:"[!!] No active session detected"}),C.jsxs("div",{className:"border border-[#1a3a1a] p-3 mb-4",children:[C.jsx("div",{className:"text-[#00ff00] mb-2",children:"# Getting started:"}),C.jsxs("div",{className:"text-[#00aa00] space-y-1",children:[C.jsxs("div",{children:[C.jsx("span",{className:"text-[#555]",children:"1."})," ",C.jsx("span",{className:"text-[#00ff00]",children:"$ cam init"}),C.jsxs("span",{className:"text-[#555]",children:[" ","#"," configure hooks"]})]}),C.jsxs("div",{children:[C.jsx("span",{className:"text-[#555]",children:"2."})," ",C.jsx("span",{className:"text-[#00ff00]",children:'$ claude "your task"'}),C.jsxs("span",{className:"text-[#555]",children:[" ","#"," in another terminal"]})]}),C.jsxs("div",{children:[C.jsx("span",{className:"text-[#555]",children:"3."})," ",C.jsx("span",{className:"text-[#00aa00]",children:"Events appear automatically"})]})]})]}),e==="reconnecting"&&C.jsx("div",{className:"text-[#ffaa00] animate-pulse",children:"[..] Trying to reconnect to server..."}),C.jsx("div",{className:"text-[#00ff00] terminal-glow",children:C.jsx("span",{className:"terminal-cursor-active"})})]})})]})}function JPt(){const{theme:e}=vb();switch(e){case"terminal":return C.jsx(ZPt,{});case"pixel":return C.jsx(QPt,{});case"modern":default:return C.jsx(KPt,{})}}function eDt({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 tDt({open:e,title:t,message:i,confirmLabel:r="Delete",cancelLabel:n="Cancel",onConfirm:a,onCancel:s}){return te.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 iDt(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 rDt(e){return e.totalTasks===0?0:Math.round(e.completedTasks/e.totalTasks*100)}function nDt(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 aDt(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 sDt(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 oDt(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 lDt(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 cDt(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 uDt(e){switch(e){case"pixel":return"PROJECTS";case"terminal":return"[PROJECTS]";default:return"Projects"}}function hDt(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 dDt(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-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 pDt(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 mDt(e){switch(e){case"pixel":return{borderTop:"3px solid var(--pixel-border, #444477)"};case"terminal":return{borderTop:"1px solid #1a3a1a"};default:return{}}}function gDt(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 vDt(e){switch(e){case"pixel":return{color:"var(--pixel-text-muted, #8888bb)"};case"terminal":return{color:"#00aa00",fontSize:"11px"};default:return{}}}function yDt(e){switch(e){case"terminal":return"> config";default:return"Settings"}}function xDt(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 bDt(e){switch(e){case"pixel":return{fontSize:"6px",lineHeight:"10px"};case"terminal":return{fontSize:"11px"};default:return{}}}function wDt(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 _Dt(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 SDt({collapsed:e,onToggleCollapse:t,onOpenSettings:i}){const{projects:r,activeProject:n,setActiveProject:a,removeProject:s}=_n(),o=bi(S=>S.agents),l=bi(S=>S.events),c=Oi(S=>S.theme),[u,h]=te.useState(null),d=te.useCallback(async()=>{if(u){try{await HEe(u.id),s(u.id)}catch{}h(null)}},[u,s]),p=te.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=bi(S=>S.projectId);function y(S){a(S)}const g=te.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:aDt(c),style:nDt(c),animate:{width:e?56:224},transition:{duration:.2,ease:"easeInOut"},children:[C.jsxs("div",{className:oDt(c),style:sDt(c),children:[C.jsx(p0,{mode:"wait",children:!e&&C.jsx(rc.span,{className:cDt(c),style:lDt(c),initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},transition:{duration:.15},children:uDt(c)},"logo-text")}),C.jsx("button",{onClick:t,className:hDt(c),style:dDt(c),title:e?"Expand sidebar":"Collapse sidebar",children:x})]}),C.jsxs("nav",{className:fDt(c),children:[p.length===0&&!e&&C.jsx("p",{className:wDt(c),style:_Dt(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."]})}),p.map(S=>{const M=(n==null?void 0:n.id)===S.id,E=m===S.id,T=E?o.length:0,R=iDt(S.name),P=rDt(S);return C.jsx(ADt,{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:pDt(c),style:mDt(c),children:C.jsxs("button",{onClick:i,className:gDt(c,e),style:vDt(c),title:"Settings",children:[w,C.jsx(p0,{mode:"wait",children:!e&&C.jsx(rc.span,{className:xDt(c),style:bDt(c),initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},transition:{duration:.15},children:yDt(c)},"settings-label")})]})}),C.jsx(tDt,{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 ADt({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"}`,p=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:p,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:Ope(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(eDt,{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 MDt=[{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"}],Ape=[{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"}],Mpe=/^#[0-9a-fA-F]{6}$/;function EDt(){const e=Oi(u=>u.theme),t=Oi(u=>u.accentColor),i=Oi(u=>u.setTheme),r=Oi(u=>u.setAccentColor),[n,a]=te.useState(Ape.some(u=>u.value===t)?"":t),[s,o]=te.useState(!1),l=u=>{if(a(u),o(!1),u==="")return;const h=u.startsWith("#")?u:`#${u}`;Mpe.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:MDt.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:Ape.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&&Mpe.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 TDt=[{value:6e4,label:"1 minute"},{value:18e4,label:"3 minutes"},{value:3e5,label:"5 minutes"},{value:6e5,label:"10 minutes"}];function Epe({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=Oi(l=>l.showLabels),t=Oi(l=>l.showInteractions),i=Oi(l=>l.displayMode),r=Oi(l=>l.activityWindow),n=Oi(l=>l.toggleLabels),a=Oi(l=>l.toggleInteractions),s=Oi(l=>l.setDisplayMode),o=Oi(l=>l.setActivityWindow);return C.jsxs("div",{className:"space-y-6",children:[C.jsxs("section",{children:[C.jsx(Epe,{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(Epe,{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:TDt.map(l=>C.jsx("option",{value:l.value,children:l.label},l.value))})]})]})}function _G({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 PDt(){const e=Oi(p=>p.followMode),t=Oi(p=>p.hidePolling),i=Oi(p=>p.pollingTools),r=Oi(p=>p.groupRepetitive),n=Oi(p=>p.toggleFollowMode),a=Oi(p=>p.toggleHidePolling),s=Oi(p=>p.toggleGroupRepetitive),o=Oi(p=>p.addPollingTool),l=Oi(p=>p.removePollingTool),[c,u]=te.useState(""),h=()=>{const p=c.trim();p!==""&&(o(p),u(""))},d=p=>{p.key==="Enter"&&(p.preventDefault(),h())};return C.jsxs("div",{className:"space-y-6",children:[C.jsxs("section",{children:[C.jsx(_G,{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(_G,{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(p=>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:[p,C.jsx("button",{onClick:()=>l(p),className:"text-cam-text-muted hover:text-cam-error transition-colors ml-0.5","aria-label":`Remove ${p}`,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"})]})})]},p)),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:p=>u(p.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(_G,{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 DDt({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 SG({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 ODt(){const e=Oi(d=>d.maxEvents),t=Oi(d=>d.speechBubbleTimeout),i=Oi(d=>d.maxCommunicationLines),r=Oi(d=>d.lockPanels),n=Oi(d=>d.setMaxEvents),a=Oi(d=>d.setSpeechBubbleTimeout),s=Oi(d=>d.setMaxCommunicationLines),o=Oi(d=>d.toggleLockPanels),l=Oi(d=>d.resetToDefaults),[c,u]=te.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(SG,{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(SG,{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(SG,{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(DDt,{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 RDt=[{id:"appearance",label:"Appearance"},{id:"agent-map",label:"Agent Map"},{id:"activity-feed",label:"Activity Feed"},{id:"advanced",label:"Advanced"}],IDt={hidden:{opacity:0},visible:{opacity:1},exit:{opacity:0}},NDt={hidden:{opacity:0,scale:.95,y:20},visible:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20}};function LDt(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 kDt(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 BDt(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 UDt(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 jDt(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 FDt(e){switch(e){case"pixel":return{color:"var(--pixel-text, #e8e8ff)"};case"terminal":return{color:"#00aa00"};default:return{}}}function VDt(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 HDt(e){switch(e){case"pixel":return{borderBottom:"3px solid var(--pixel-border, #444477)"};case"terminal":return{borderBottom:"1px solid #1a3a1a"};default:return{}}}function GDt(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 WDt(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 qDt(e,t,i){return e==="terminal"?i?`> ${t}`:` ${t}`:e==="pixel"?t.toUpperCase():t}function XDt(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 YDt({isOpen:e,onClose:t}){const[i,r]=te.useState("appearance"),n=Oi(c=>c.theme),a=te.useCallback(c=>{c.key==="Escape"&&t()},[t]);te.useEffect(()=>{if(e)return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,a]);const s=te.useCallback(()=>{t()},[t]),o=te.useCallback(c=>{c.stopPropagation()},[]),l=()=>{switch(i){case"appearance":return C.jsx(EDt,{});case"agent-map":return C.jsx(CDt,{});case"activity-feed":return C.jsx(PDt,{});case"advanced":return C.jsx(ODt,{})}};return C.jsx(p0,{children:e&&C.jsxs(rc.div,{className:"fixed inset-0 z-50 flex items-center justify-center",variants:IDt,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:LDt(n),style:kDt(n),variants:NDt,initial:"hidden",animate:"visible",exit:"exit",transition:{duration:.25,ease:"easeOut"},onClick:o,children:[C.jsxs("header",{className:BDt(n),style:zDt(n),children:[C.jsx("h2",{children:UDt(n)}),C.jsx("button",{onClick:t,className:jDt(n),style:FDt(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:VDt(n),style:HDt(n),children:RDt.map(c=>C.jsx("button",{onClick:()=>r(c.id),className:GDt(n,i===c.id),style:WDt(n,i===c.id),children:qDt(n,c.label,i===c.id)},c.id))}),C.jsx("main",{className:XDt(n),children:l()})]})]})})}function $Dt(e){te.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 KDt(){const{theme:e}=vb(),t=bi(d=>d.session),i=bi(d=>d.events),r=Oi(d=>d.toggleLockPanels),{settingsOpen:n,sidebarCollapsed:a,closeSettings:s,toggleSettings:o,toggleSidebar:l,openSettings:c}=LEe(),u=te.useMemo(()=>[{key:",",ctrl:!0,handler:o,description:"Toggle settings modal"},{key:"l",ctrl:!0,handler:r,description:"Toggle panel lock"},{key:"b",ctrl:!0,handler:l,description:"Toggle sidebar"}],[r,o,l]);if($Dt(u),!t&&i.length===0)return C.jsx(JPt,{});const h=(()=>{switch(e){case"terminal":return C.jsx(dPt,{});case"pixel":return C.jsx(qPt,{});case"modern":default:return C.jsx(kCt,{})}})();return C.jsxs("div",{className:"flex h-screen w-screen overflow-hidden",children:[C.jsx(SDt,{collapsed:a,onToggleCollapse:l,onOpenSettings:c}),C.jsx("div",{className:"flex-1 overflow-hidden",children:h}),C.jsx(YDt,{isOpen:n,onClose:s})]})}let QDt=0;const NI=sg(e=>({toasts:[],addToast:t=>{const i=`toast-${++QDt}`,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 Tpe({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 ZDt({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 JDt({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 e3t(){const{toasts:e,removeToast:t}=NI(),{theme:i}=vb();if(e.length===0)return null;const r={modern:Tpe,pixel:ZDt,terminal:JDt}[i]??Tpe;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 t3t(){return new URLSearchParams(window.location.search).has("session_id")}function i3t(){const{session:e,setSession:t,setProjectId:i}=bi(),r=te.useRef(!1),n=te.useCallback(async()=>{if(!r.current){if(t3t()){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 LI({status:"active",limit:10}),c=l.find(u=>u.status==="active");if(c){const{session:u}=await vC(c.id);t(u),r.current=!0;return}}r.current=!0;return}catch{}i(null);const{sessions:a}=await LI({status:"active",limit:1});if(a.length>0){const{session:s}=await vC(a[0].id);t(s),r.current=!0}}catch{}}},[t,i]);return te.useEffect(()=>{n();const a=setInterval(n,15e3);return()=>clearInterval(a)},[n]),{session:e,refreshSession:n}}class r3t{constructor(t){rE(this,"source",null);rE(this,"options");rE(this,"reconnectTimer",null);rE(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 n3t(e){const t=te.useRef(null),i=bi(d=>d.projectId),{addEvent:r,addAgent:n,updateAgent:a,setConnected:s,setConnectionStatus:o,setLastHeartbeat:l}=bi(),{updateTask:c,updateActiveProject:u,updateActiveSprint:h}=_n();return te.useEffect(()=>{if(!e){o("disconnected");return}const d=new r3t({url:"/api/stream",sessionId:e,projectId:i??void 0,onConnect:()=>{s(!0),o("connected")},onDisconnect:()=>{s(!1),o("reconnecting")},onEvent:p=>{r(p),p.agentId&&n({id:p.agentId,sessionId:p.sessionId,name:p.agentId,type:"agent",status:"active",firstSeenAt:p.timestamp,lastActivityAt:p.timestamp,toolCallCount:0,errorCount:0})},onAgentStatus:p=>{a(p.agent,{status:p.status}),(p.status==="shutdown"||p.status==="completed")&&NI.getState().addToast({type:"info",title:`Agent ${p.agent} finished`,duration:4e3})},onSessionStatus:p=>{const m=bi.getState().session;p.status==="completed"||p.status==="error"?m&&(m.id===p.session||!p.session)&&(bi.getState().setSession({...m,status:p.status,endedAt:new Date().toISOString()}),NI.getState().addToast({type:p.status==="completed"?"info":"error",title:p.status==="completed"?"Session ended":"Session ended with error",duration:5e3})):p.status==="active"&&m&&(m.id===p.session||!p.session)&&bi.getState().setSession({...m,status:"active",endedAt:void 0})},onTaskStatusChanged:p=>{c(p.taskId,{status:p.newStatus})},onTaskAssigned:p=>{c(p.taskId,{assignedAgent:p.agent})},onSprintProgress:p=>{h({completedTasks:p.completedTasks,totalTasks:p.totalTasks})},onProjectProgress:p=>{u({completedTasks:p.completedTasks,totalTasks:p.totalTasks})},onTaskBlocked:p=>{c(p.taskId,{status:"blocked",blockedBy:p.blockedBy})},onTaskUnblocked:p=>{c(p.taskId,{status:"pending",blockedBy:[]})},onCorrelationMatch:()=>{},onAgentCreated:p=>{const m=p.name||p.agent;n({id:p.agent,sessionId:p.sessionId,name:m,type:p.type||"agent",status:p.status||"active",firstSeenAt:p.timestamp,lastActivityAt:p.timestamp,toolCallCount:0,errorCount:0}),NI.getState().addToast({type:"success",title:`Agent ${m} joined`,message:p.type?`Type: ${p.type}`:void 0,duration:4e3})},onTeamCreated:()=>{},onHeartbeat:p=>{l(p.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 a3t(){const{projects:e,activeProject:t,setProjects:i,setActiveProject:r,setProjectsLoaded:n}=_n(),a=te.useRef(!1);return te.useEffect(()=>{let s=!1;async function o(){try{const{projects:c}=await VEe();s||(i(c),n(!0),!a.current&&c.length>0&&(_n.getState().activeProject||r(c[0]),a.current=!0))}catch{}}o();const l=setInterval(o,15e3);return()=>{s=!0,clearInterval(l)}},[i,r]),{projects:e,activeProject:t}}function s3t(){const{projects:e,activeProject:t,setActiveProject:i}=_n(),r=te.useRef(!1);te.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]),te.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 o3t(){const{session:e,setSession:t}=bi(),i=te.useRef(!1);te.useEffect(()=>{if(i.current)return;i.current=!0;const n=new URLSearchParams(window.location.search).get("session_id");n&&l3t(n)},[]),te.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 l3t(e){const{setSession:t}=bi.getState();if(e.length>8)try{const{session:i}=await vC(e);if(i){t(i);return}}catch{}try{const{sessions:i}=await LI({limit:50}),r=i.find(n=>n.id.startsWith(e));if(r){const{session:n}=await vC(r.id);n&&t(n)}}catch{}}function c3t(){const e=Oi(s=>s.theme),t=Oi(s=>s.accentColor),i=Oi(s=>s.activityWindow),r=Oi(s=>s.showLabels),n=Oi(s=>s.showInteractions),a=Oi(s=>s.displayMode);te.useEffect(()=>{const s=vb.getState();s.theme!==e&&s.setTheme(e),s.accentColor!==t&&s.setAccentColor(t)},[e,t]),te.useEffect(()=>{const s=bi.getState();s.activityWindow!==i&&s.setActivityWindow(i)},[i]),te.useEffect(()=>{const s=P_.getState();s.showLabels!==r&&s.toggleLabels(),s.showInteractions!==n&&s.toggleInteractions(),s.displayMode!==a&&s.setDisplayMode(a)},[r,n,a])}function u3t(){const{session:e}=i3t();return n3t(e==null?void 0:e.id),a3t(),cB(),T0(),Cye(),s3t(),o3t(),c3t(),C.jsxs(C.Fragment,{children:[C.jsx(KDt,{}),C.jsx(e3t,{})]})}DEe.createRoot(document.getElementById("root")).render(C.jsx(te.StrictMode,{children:C.jsx(u3t,{})}));export{Vv as c,En as g};
12448
- //# sourceMappingURL=index-CFGuf1_-.js.map
12447
+ `,title:i.label,children:i.label},i.id))})}function KPt(){const{connectionStatus:e}=bi();return C.jsxs("div",{className:"h-screen w-screen flex flex-col modern-gradient-bg",children:[C.jsxs("header",{className:"h-12 flex items-center justify-between px-4 border-b border-cam-border/50 modern-glass shrink-0",children:[C.jsx("h1",{className:"text-sm font-semibold text-cam-text tracking-tight",children:"Claude Agent Monitor"}),C.jsx(RK,{})]}),C.jsx("div",{className:"flex-1 flex items-center justify-center",children:C.jsxs("div",{className:"text-center max-w-md mx-auto px-6",children:[C.jsx("div",{className:"w-16 h-16 rounded-2xl bg-cam-surface-2 border border-cam-border flex items-center justify-center mx-auto mb-6",children:C.jsx("span",{className:"text-3xl",children:e==="connected"?"📡":"🔌"})}),C.jsx("h2",{className:"text-xl font-semibold text-cam-text mb-2",children:"Waiting for connection..."}),C.jsx("p",{className:"text-sm text-cam-text-muted mb-8",children:e==="connected"?"Server connected. Start Claude Code in another terminal to see activity.":"No active session detected. Follow the steps below to get started."}),C.jsxs("div",{className:"text-left space-y-4",children:[C.jsx(wG,{number:1,title:"Configure hooks in your project",children:C.jsx("code",{className:"text-xs bg-cam-surface-2 px-2 py-1 rounded text-cam-accent font-mono",children:"cam init"})}),C.jsx(wG,{number:2,title:"Start Claude Code in another terminal",children:C.jsx("code",{className:"text-xs bg-cam-surface-2 px-2 py-1 rounded text-cam-accent font-mono",children:'claude "your task here"'})}),C.jsx(wG,{number:3,title:"Watch agents working",children:C.jsx("span",{className:"text-xs text-cam-text-muted",children:"Events will appear automatically on the dashboard."})})]}),e==="reconnecting"&&C.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2",children:[C.jsx("div",{className:"w-2 h-2 rounded-full bg-amber-400 animate-pulse"}),C.jsx("span",{className:"text-xs text-amber-400",children:"Reconnecting to server..."})]})]})})]})}function wG({number:e,title:t,children:i}){return C.jsxs("div",{className:"flex items-start gap-3",children:[C.jsx("div",{className:"w-6 h-6 rounded-full bg-cam-accent/20 border border-cam-accent/40 flex items-center justify-center shrink-0 mt-0.5",children:C.jsx("span",{className:"text-xs font-bold text-cam-accent",children:e})}),C.jsxs("div",{children:[C.jsx("p",{className:"text-sm text-cam-text font-medium",children:t}),C.jsx("div",{className:"mt-1",children:i})]})]})}function QPt(){const{connectionStatus:e}=bi();return C.jsxs("div",{className:"pixel-theme h-screen w-screen flex flex-col",style:{background:"var(--pixel-bg)"},children:[C.jsxs("header",{className:"h-14 flex items-center justify-between px-4 pixel-hud shrink-0",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(RK,{})]}),C.jsx("div",{className:"flex-1 flex items-center justify-center",children:C.jsxs("div",{className:"text-center max-w-md mx-auto px-6",children:[C.jsx("div",{className:"pixel-text-lg mb-2",style:{color:"var(--pixel-gold)",fontSize:"24px"},children:"> WAITING FOR CONNECTION..."}),C.jsx("p",{className:"pixel-text-xs mb-8",style:{color:"var(--pixel-text-muted)"},children:e==="connected"?"SERVER ONLINE. START CLAUDE CODE IN ANOTHER TERMINAL.":"NO ACTIVE SESSION. FOLLOW THE STEPS BELOW."}),C.jsxs("div",{className:"text-left space-y-3 mx-auto",style:{border:"2px solid var(--pixel-border)",background:"var(--pixel-panel)",padding:"12px 16px",maxWidth:"380px"},children:[C.jsx("div",{className:"pixel-text-xs",style:{color:"var(--pixel-gold)"},children:"== QUEST LOG =="}),C.jsx("div",{className:"pixel-text-xs",style:{color:"var(--pixel-green)"},children:"[1] Run: cam init"}),C.jsx("div",{className:"pixel-text-xs",style:{color:"var(--pixel-green)"},children:'[2] Run: claude "your task"'}),C.jsx("div",{className:"pixel-text-xs",style:{color:"var(--pixel-green)"},children:"[3] Watch agents on dashboard"})]}),e==="reconnecting"&&C.jsx("div",{className:"mt-4",children:C.jsx("span",{className:"pixel-text-xs pixel-pulse",style:{color:"var(--pixel-gold)"},children:"RECONNECTING..."})})]})})]})}function ZPt(){const{connectionStatus:e}=bi();return C.jsxs("div",{className:"h-screen w-screen flex flex-col terminal-bg terminal-boot",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]",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(RK,{})]}),C.jsx("div",{className:"flex-1 flex items-center justify-center font-mono",children:C.jsxs("div",{className:"max-w-lg mx-auto px-6 text-[12px]",children:[C.jsx("div",{className:"text-[#00ff00] terminal-glow mb-4 text-[14px]",children:"$ cam status"}),C.jsx("div",{className:"text-[#00aa00] mb-1",children:e==="connected"?"[OK] Server connected on port 7890":"[..] Waiting for server connection..."}),C.jsx("div",{className:"text-[#ffaa00] mb-6",children:"[!!] No active session detected"}),C.jsxs("div",{className:"border border-[#1a3a1a] p-3 mb-4",children:[C.jsx("div",{className:"text-[#00ff00] mb-2",children:"# Getting started:"}),C.jsxs("div",{className:"text-[#00aa00] space-y-1",children:[C.jsxs("div",{children:[C.jsx("span",{className:"text-[#555]",children:"1."})," ",C.jsx("span",{className:"text-[#00ff00]",children:"$ cam init"}),C.jsxs("span",{className:"text-[#555]",children:[" ","#"," configure hooks"]})]}),C.jsxs("div",{children:[C.jsx("span",{className:"text-[#555]",children:"2."})," ",C.jsx("span",{className:"text-[#00ff00]",children:'$ claude "your task"'}),C.jsxs("span",{className:"text-[#555]",children:[" ","#"," in another terminal"]})]}),C.jsxs("div",{children:[C.jsx("span",{className:"text-[#555]",children:"3."})," ",C.jsx("span",{className:"text-[#00aa00]",children:"Events appear automatically"})]})]})]}),e==="reconnecting"&&C.jsx("div",{className:"text-[#ffaa00] animate-pulse",children:"[..] Trying to reconnect to server..."}),C.jsx("div",{className:"text-[#00ff00] terminal-glow",children:C.jsx("span",{className:"terminal-cursor-active"})})]})})]})}function JPt(){const{theme:e}=vb();switch(e){case"terminal":return C.jsx(ZPt,{});case"pixel":return C.jsx(QPt,{});case"modern":default:return C.jsx(KPt,{})}}function eDt({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 tDt({open:e,title:t,message:i,confirmLabel:r="Delete",cancelLabel:n="Cancel",onConfirm:a,onCancel:s}){return te.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 iDt(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 rDt(e){return e.totalTasks===0?0:Math.round(e.completedTasks/e.totalTasks*100)}function nDt(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 aDt(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 sDt(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 oDt(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 lDt(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 cDt(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 uDt(e){switch(e){case"pixel":return"PROJECTS";case"terminal":return"[PROJECTS]";default:return"Projects"}}function hDt(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 dDt(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-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 pDt(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 mDt(e){switch(e){case"pixel":return{borderTop:"3px solid var(--pixel-border, #444477)"};case"terminal":return{borderTop:"1px solid #1a3a1a"};default:return{}}}function gDt(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 vDt(e){switch(e){case"pixel":return{color:"var(--pixel-text-muted, #8888bb)"};case"terminal":return{color:"#00aa00",fontSize:"11px"};default:return{}}}function yDt(e){switch(e){case"terminal":return"> config";default:return"Settings"}}function xDt(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 bDt(e){switch(e){case"pixel":return{fontSize:"6px",lineHeight:"10px"};case"terminal":return{fontSize:"11px"};default:return{}}}function wDt(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 _Dt(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 SDt({collapsed:e,onToggleCollapse:t,onOpenSettings:i}){const{projects:r,activeProject:n,setActiveProject:a,removeProject:s}=_n(),o=bi(S=>S.agents),l=bi(S=>S.events),c=Oi(S=>S.theme),[u,h]=te.useState(null),d=te.useCallback(async()=>{if(u){try{await HEe(u.id),s(u.id)}catch{}h(null)}},[u,s]),p=te.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=bi(S=>S.projectId);function y(S){a(S)}const g=te.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:aDt(c),style:nDt(c),animate:{width:e?56:224},transition:{duration:.2,ease:"easeInOut"},children:[C.jsxs("div",{className:oDt(c),style:sDt(c),children:[C.jsx(p0,{mode:"wait",children:!e&&C.jsx(rc.span,{className:cDt(c),style:lDt(c),initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},transition:{duration:.15},children:uDt(c)},"logo-text")}),C.jsx("button",{onClick:t,className:hDt(c),style:dDt(c),title:e?"Expand sidebar":"Collapse sidebar",children:x})]}),C.jsxs("nav",{className:fDt(c),children:[p.length===0&&!e&&C.jsx("p",{className:wDt(c),style:_Dt(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."]})}),p.map(S=>{const M=(n==null?void 0:n.id)===S.id,E=m===S.id,T=E?o.length:0,R=iDt(S.name),P=rDt(S);return C.jsx(ADt,{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:pDt(c),style:mDt(c),children:C.jsxs("button",{onClick:i,className:gDt(c,e),style:vDt(c),title:"Settings",children:[w,C.jsx(p0,{mode:"wait",children:!e&&C.jsx(rc.span,{className:xDt(c),style:bDt(c),initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},transition:{duration:.15},children:yDt(c)},"settings-label")})]})}),C.jsx(tDt,{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 ADt({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"}`,p=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:p,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:Ope(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(eDt,{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 MDt=[{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"}],Ape=[{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"}],Mpe=/^#[0-9a-fA-F]{6}$/;function EDt(){const e=Oi(u=>u.theme),t=Oi(u=>u.accentColor),i=Oi(u=>u.setTheme),r=Oi(u=>u.setAccentColor),[n,a]=te.useState(Ape.some(u=>u.value===t)?"":t),[s,o]=te.useState(!1),l=u=>{if(a(u),o(!1),u==="")return;const h=u.startsWith("#")?u:`#${u}`;Mpe.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:MDt.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:Ape.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&&Mpe.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 TDt=[{value:6e4,label:"1 minute"},{value:18e4,label:"3 minutes"},{value:3e5,label:"5 minutes"},{value:6e5,label:"10 minutes"}];function Epe({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=Oi(l=>l.showLabels),t=Oi(l=>l.showInteractions),i=Oi(l=>l.displayMode),r=Oi(l=>l.activityWindow),n=Oi(l=>l.toggleLabels),a=Oi(l=>l.toggleInteractions),s=Oi(l=>l.setDisplayMode),o=Oi(l=>l.setActivityWindow);return C.jsxs("div",{className:"space-y-6",children:[C.jsxs("section",{children:[C.jsx(Epe,{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(Epe,{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:TDt.map(l=>C.jsx("option",{value:l.value,children:l.label},l.value))})]})]})}function _G({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 PDt(){const e=Oi(p=>p.followMode),t=Oi(p=>p.hidePolling),i=Oi(p=>p.pollingTools),r=Oi(p=>p.groupRepetitive),n=Oi(p=>p.toggleFollowMode),a=Oi(p=>p.toggleHidePolling),s=Oi(p=>p.toggleGroupRepetitive),o=Oi(p=>p.addPollingTool),l=Oi(p=>p.removePollingTool),[c,u]=te.useState(""),h=()=>{const p=c.trim();p!==""&&(o(p),u(""))},d=p=>{p.key==="Enter"&&(p.preventDefault(),h())};return C.jsxs("div",{className:"space-y-6",children:[C.jsxs("section",{children:[C.jsx(_G,{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(_G,{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(p=>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:[p,C.jsx("button",{onClick:()=>l(p),className:"text-cam-text-muted hover:text-cam-error transition-colors ml-0.5","aria-label":`Remove ${p}`,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"})]})})]},p)),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:p=>u(p.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(_G,{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 DDt({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 SG({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 ODt(){const e=Oi(d=>d.maxEvents),t=Oi(d=>d.speechBubbleTimeout),i=Oi(d=>d.maxCommunicationLines),r=Oi(d=>d.lockPanels),n=Oi(d=>d.setMaxEvents),a=Oi(d=>d.setSpeechBubbleTimeout),s=Oi(d=>d.setMaxCommunicationLines),o=Oi(d=>d.toggleLockPanels),l=Oi(d=>d.resetToDefaults),[c,u]=te.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(SG,{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(SG,{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(SG,{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(DDt,{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 RDt=[{id:"appearance",label:"Appearance"},{id:"agent-map",label:"Agent Map"},{id:"activity-feed",label:"Activity Feed"},{id:"advanced",label:"Advanced"}],IDt={hidden:{opacity:0},visible:{opacity:1},exit:{opacity:0}},NDt={hidden:{opacity:0,scale:.95,y:20},visible:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20}};function LDt(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 kDt(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 BDt(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 UDt(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 jDt(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 FDt(e){switch(e){case"pixel":return{color:"var(--pixel-text, #e8e8ff)"};case"terminal":return{color:"#00aa00"};default:return{}}}function VDt(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 HDt(e){switch(e){case"pixel":return{borderBottom:"3px solid var(--pixel-border, #444477)"};case"terminal":return{borderBottom:"1px solid #1a3a1a"};default:return{}}}function GDt(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 WDt(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 qDt(e,t,i){return e==="terminal"?i?`> ${t}`:` ${t}`:e==="pixel"?t.toUpperCase():t}function XDt(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 YDt({isOpen:e,onClose:t}){const[i,r]=te.useState("appearance"),n=Oi(c=>c.theme),a=te.useCallback(c=>{c.key==="Escape"&&t()},[t]);te.useEffect(()=>{if(e)return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,a]);const s=te.useCallback(()=>{t()},[t]),o=te.useCallback(c=>{c.stopPropagation()},[]),l=()=>{switch(i){case"appearance":return C.jsx(EDt,{});case"agent-map":return C.jsx(CDt,{});case"activity-feed":return C.jsx(PDt,{});case"advanced":return C.jsx(ODt,{})}};return C.jsx(p0,{children:e&&C.jsxs(rc.div,{className:"fixed inset-0 z-50 flex items-center justify-center",variants:IDt,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:LDt(n),style:kDt(n),variants:NDt,initial:"hidden",animate:"visible",exit:"exit",transition:{duration:.25,ease:"easeOut"},onClick:o,children:[C.jsxs("header",{className:BDt(n),style:zDt(n),children:[C.jsx("h2",{children:UDt(n)}),C.jsx("button",{onClick:t,className:jDt(n),style:FDt(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:VDt(n),style:HDt(n),children:RDt.map(c=>C.jsx("button",{onClick:()=>r(c.id),className:GDt(n,i===c.id),style:WDt(n,i===c.id),children:qDt(n,c.label,i===c.id)},c.id))}),C.jsx("main",{className:XDt(n),children:l()})]})]})})}function $Dt(e){te.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 KDt(){const{theme:e}=vb(),t=bi(d=>d.session),i=bi(d=>d.events),r=Oi(d=>d.toggleLockPanels),{settingsOpen:n,sidebarCollapsed:a,closeSettings:s,toggleSettings:o,toggleSidebar:l,openSettings:c}=LEe(),u=te.useMemo(()=>[{key:",",ctrl:!0,handler:o,description:"Toggle settings modal"},{key:"l",ctrl:!0,handler:r,description:"Toggle panel lock"},{key:"b",ctrl:!0,handler:l,description:"Toggle sidebar"}],[r,o,l]);if($Dt(u),!t&&i.length===0)return C.jsx(JPt,{});const h=(()=>{switch(e){case"terminal":return C.jsx(dPt,{});case"pixel":return C.jsx(qPt,{});case"modern":default:return C.jsx(kCt,{})}})();return C.jsxs("div",{className:"flex h-screen w-screen overflow-hidden",children:[C.jsx(SDt,{collapsed:a,onToggleCollapse:l,onOpenSettings:c}),C.jsx("div",{className:"flex-1 overflow-hidden",children:h}),C.jsx(YDt,{isOpen:n,onClose:s})]})}let QDt=0;const NI=sg(e=>({toasts:[],addToast:t=>{const i=`toast-${++QDt}`,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 Tpe({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 ZDt({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 JDt({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 e3t(){const{toasts:e,removeToast:t}=NI(),{theme:i}=vb();if(e.length===0)return null;const r={modern:Tpe,pixel:ZDt,terminal:JDt}[i]??Tpe;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 t3t(){return new URLSearchParams(window.location.search).has("session_id")}function i3t(){const{session:e,setSession:t,setProjectId:i}=bi(),r=te.useRef(!1),n=te.useCallback(async()=>{if(!r.current){if(t3t()){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 LI({status:"active",limit:10}),c=l.find(u=>u.status==="active");if(c){const{session:u}=await vC(c.id);t(u),r.current=!0;return}}r.current=!0;return}catch{}i(null);const{sessions:a}=await LI({status:"active",limit:1});if(a.length>0){const{session:s}=await vC(a[0].id);t(s),r.current=!0}}catch{}}},[t,i]);return te.useEffect(()=>{n();const a=setInterval(n,15e3);return()=>clearInterval(a)},[n]),{session:e,refreshSession:n}}class r3t{constructor(t){rE(this,"source",null);rE(this,"options");rE(this,"reconnectTimer",null);rE(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 n3t(e){const t=te.useRef(null),i=bi(d=>d.projectId),{addEvent:r,addAgent:n,updateAgent:a,setConnected:s,setConnectionStatus:o,setLastHeartbeat:l}=bi(),{updateTask:c,updateActiveProject:u,updateActiveSprint:h}=_n();return te.useEffect(()=>{if(!e){o("disconnected");return}const d=new r3t({url:"/api/stream",sessionId:e,projectId:i??void 0,onConnect:()=>{s(!0),o("connected")},onDisconnect:()=>{s(!1),o("reconnecting")},onEvent:p=>{r(p),p.agentId&&n({id:p.agentId,sessionId:p.sessionId,name:p.agentId,type:"agent",status:"active",firstSeenAt:p.timestamp,lastActivityAt:p.timestamp,toolCallCount:0,errorCount:0})},onAgentStatus:p=>{a(p.agent,{status:p.status}),(p.status==="shutdown"||p.status==="completed")&&NI.getState().addToast({type:"info",title:`Agent ${p.agent} finished`,duration:4e3})},onSessionStatus:p=>{const m=bi.getState().session;p.status==="completed"||p.status==="error"?m&&(m.id===p.session||!p.session)&&(bi.getState().setSession({...m,status:p.status,endedAt:new Date().toISOString()}),NI.getState().addToast({type:p.status==="completed"?"info":"error",title:p.status==="completed"?"Session ended":"Session ended with error",duration:5e3})):p.status==="active"&&m&&(m.id===p.session||!p.session)&&bi.getState().setSession({...m,status:"active",endedAt:void 0})},onTaskStatusChanged:p=>{c(p.taskId,{status:p.newStatus})},onTaskAssigned:p=>{c(p.taskId,{assignedAgent:p.agent})},onSprintProgress:p=>{h({completedTasks:p.completedTasks,totalTasks:p.totalTasks})},onProjectProgress:p=>{u({completedTasks:p.completedTasks,totalTasks:p.totalTasks})},onTaskBlocked:p=>{c(p.taskId,{status:"blocked",blockedBy:p.blockedBy})},onTaskUnblocked:p=>{c(p.taskId,{status:"pending",blockedBy:[]})},onCorrelationMatch:()=>{},onAgentCreated:p=>{const m=p.name||p.agent;n({id:p.agent,sessionId:p.sessionId,name:m,type:p.type||"agent",status:p.status||"active",firstSeenAt:p.timestamp,lastActivityAt:p.timestamp,toolCallCount:0,errorCount:0}),NI.getState().addToast({type:"success",title:`Agent ${m} joined`,message:p.type?`Type: ${p.type}`:void 0,duration:4e3})},onTeamCreated:()=>{},onHeartbeat:p=>{l(p.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 a3t(){const{projects:e,activeProject:t,setProjects:i,setActiveProject:r}=_n(),n=te.useRef(!1);return te.useEffect(()=>{let a=!1;async function s(){try{const{projects:l}=await VEe();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 s3t(){const{projects:e,activeProject:t,setActiveProject:i}=_n(),r=te.useRef(!1);te.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]),te.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 o3t(){const{session:e,setSession:t}=bi(),i=te.useRef(!1);te.useEffect(()=>{if(i.current)return;i.current=!0;const n=new URLSearchParams(window.location.search).get("session_id");n&&l3t(n)},[]),te.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 l3t(e){const{setSession:t}=bi.getState();if(e.length>8)try{const{session:i}=await vC(e);if(i){t(i);return}}catch{}try{const{sessions:i}=await LI({limit:50}),r=i.find(n=>n.id.startsWith(e));if(r){const{session:n}=await vC(r.id);n&&t(n)}}catch{}}function c3t(){const e=Oi(s=>s.theme),t=Oi(s=>s.accentColor),i=Oi(s=>s.activityWindow),r=Oi(s=>s.showLabels),n=Oi(s=>s.showInteractions),a=Oi(s=>s.displayMode);te.useEffect(()=>{const s=vb.getState();s.theme!==e&&s.setTheme(e),s.accentColor!==t&&s.setAccentColor(t)},[e,t]),te.useEffect(()=>{const s=bi.getState();s.activityWindow!==i&&s.setActivityWindow(i)},[i]),te.useEffect(()=>{const s=P_.getState();s.showLabels!==r&&s.toggleLabels(),s.showInteractions!==n&&s.toggleInteractions(),s.displayMode!==a&&s.setDisplayMode(a)},[r,n,a])}function u3t(){const{session:e}=i3t();return n3t(e==null?void 0:e.id),a3t(),cB(),T0(),Cye(),s3t(),o3t(),c3t(),C.jsxs(C.Fragment,{children:[C.jsx(KDt,{}),C.jsx(e3t,{})]})}DEe.createRoot(document.getElementById("root")).render(C.jsx(te.StrictMode,{children:C.jsx(u3t,{})}));export{Vv as c,En as g};
12448
+ //# sourceMappingURL=index-9h5avhWJ.js.map