@newrelic/preflight 1.4.33 → 1.4.35

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.
@@ -6,7 +6,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
6
6
  `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{xe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?be(n):``}function Ce(e,t){switch(e.tag){case 26:case 27:case 5:return be(e.type);case 16:return be(`Lazy`);case 13:return e.child!==t&&t!==null?be(`Suspense Fallback`):be(`Suspense`);case 19:return be(`SuspenseList`);case 0:case 15:return Se(e.type,!1);case 11:return Se(e.type.render,!1);case 1:return Se(e.type,!0);case 31:return be(`Activity`);default:return``}}function we(e){try{var t=``,n=null;do t+=Ce(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
7
  Error generating stack: `+e.message+`
8
8
  `+e.stack}}var Te=Object.prototype.hasOwnProperty,Ee=t.unstable_scheduleCallback,De=t.unstable_cancelCallback,Oe=t.unstable_shouldYield,ke=t.unstable_requestPaint,Ae=t.unstable_now,je=t.unstable_getCurrentPriorityLevel,Me=t.unstable_ImmediatePriority,Ne=t.unstable_UserBlockingPriority,Pe=t.unstable_NormalPriority,Fe=t.unstable_LowPriority,Ie=t.unstable_IdlePriority,Le=t.log,Re=t.unstable_setDisableYieldValue,ze=null,Be=null;function Ve(e){if(typeof Le==`function`&&Re(e),Be&&typeof Be.setStrictMode==`function`)try{Be.setStrictMode(ze,e)}catch{}}var He=Math.clz32?Math.clz32:Ge,Ue=Math.log,We=Math.LN2;function Ge(e){return e>>>=0,e===0?32:31-(Ue(e)/We|0)|0}var Ke=256,qe=262144,Je=4194304;function P(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function F(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=P(n))):i=P(o):i=P(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=P(n))):i=P(o)):i=P(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ye(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ze(){var e=Je;return Je<<=1,!(Je&62914560)&&(Je=4194304),e}function Qe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $e(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function et(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-He(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&tt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function tt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-He(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function nt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-He(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function rt(e,t){var n=t&-t;return n=n&42?1:it(n),(n&(e.suspendedLanes|t))===0?n:0}function it(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function at(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ot(){var e=N.p;return e===0?(e=window.event,e===void 0?32:hp(e.type)):e}function st(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var ct=Math.random().toString(36).slice(2),lt=`__reactFiber$`+ct,ut=`__reactProps$`+ct,I=`__reactContainer$`+ct,dt=`__reactEvents$`+ct,ft=`__reactListeners$`+ct,pt=`__reactHandles$`+ct,mt=`__reactResources$`+ct,ht=`__reactMarker$`+ct;function gt(e){delete e[lt],delete e[ut],delete e[dt],delete e[ft],delete e[pt]}function _t(e){var t=e[lt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[I]||n[lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pf(e);e!==null;){if(n=e[lt])return n;e=pf(e)}return t}e=n,n=e.parentNode}return null}function vt(e){if(e=e[lt]||e[I]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function yt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function bt(e){var t=e[mt];return t||=e[mt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function xt(e){e[ht]=!0}var St=new Set,Ct={};function wt(e,t){Tt(e,t),Tt(e+`Capture`,t)}function Tt(e,t){for(Ct[e]=t,e=0;e<t.length;e++)St.add(t[e])}var Et=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]*$`),Dt={},Ot={};function kt(e){return Te.call(Ot,e)?!0:Te.call(Dt,e)?!1:Et.test(e)?Ot[e]=!0:(Dt[e]=!0,!1)}function At(e,t,n){if(kt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function jt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Mt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Nt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Pt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ft(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function It(e){if(!e._valueTracker){var t=Pt(e)?`checked`:`value`;e._valueTracker=Ft(e,t,``+e[t])}}function Lt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Pt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Rt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var zt=/[\n"\\]/g;function Bt(e){return e.replace(zt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Vt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Nt(t)):e.value!==``+Nt(t)&&(e.value=``+Nt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ut(e,o,Nt(n)):Ut(e,o,Nt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Nt(s):e.removeAttribute(`name`)}function Ht(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){It(e);return}n=n==null?``:``+Nt(n),t=t==null?n:``+Nt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),It(e)}function Ut(e,t,n){t===`number`&&Rt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Wt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Nt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Gt(e,t,n){if(t!=null&&(t=``+Nt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Nt(n)}function Kt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(re(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Nt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),It(e)}function qt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jt=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 Yt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Jt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Xt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Yt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Yt(e,o,t[o])}function Zt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Qt=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`]]),$t=/^[\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 en(e){return $t.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function tn(){}var nn=null;function rn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var an=null,on=null;function sn(e){var t=vt(e);if(t&&(e=t.stateNode)){var n=e[ut]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Vt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Bt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ut]||null;if(!a)throw Error(i(90));Vt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Lt(r)}break a;case`textarea`:Gt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Wt(e,!!n.multiple,t,!1)}}}var cn=!1;function ln(e,t,n){if(cn)return e(t,n);cn=!0;try{return e(t)}finally{if(cn=!1,(an!==null||on!==null)&&(xu(),an&&(t=an,e=on,on=an=null,sn(t),e)))for(t=0;t<e.length;t++)sn(e[t])}}function un(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ut]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var dn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),fn=!1;if(dn)try{var pn={};Object.defineProperty(pn,"passive",{get:function(){fn=!0}}),window.addEventListener(`test`,pn,pn),window.removeEventListener(`test`,pn,pn)}catch{fn=!1}var mn=null,hn=null,gn=null;function _n(){if(gn)return gn;var e,t=hn,n=t.length,r,i=`value`in mn?mn.value:mn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return gn=i.slice(e,1<r?1-r:void 0)}function vn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function yn(){return!0}function bn(){return!1}function xn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?yn:bn,this.isPropagationStopped=bn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=yn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=yn)},persist:function(){},isPersistent:yn}),t}var Sn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cn=xn(Sn),wn=m({},Sn,{view:0,detail:0}),Tn=xn(wn),En,Dn,On,kn=m({},wn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==On&&(On&&e.type===`mousemove`?(En=e.screenX-On.screenX,Dn=e.screenY-On.screenY):Dn=En=0,On=e),En)},movementY:function(e){return`movementY`in e?e.movementY:Dn}}),An=xn(kn),jn=xn(m({},kn,{dataTransfer:0})),Mn=xn(m({},wn,{relatedTarget:0})),Nn=xn(m({},Sn,{animationName:0,elapsedTime:0,pseudoElement:0})),Pn=xn(m({},Sn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Fn=xn(m({},Sn,{data:0})),In={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Ln={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`},Rn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function zn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Rn[e])?!!t[e]:!1}function Bn(){return zn}var Vn=xn(m({},wn,{key:function(e){if(e.key){var t=In[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=vn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Ln[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bn,charCode:function(e){return e.type===`keypress`?vn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?vn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Hn=xn(m({},kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Un=xn(m({},wn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bn})),Wn=xn(m({},Sn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Gn=xn(m({},kn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Kn=xn(m({},Sn,{newState:0,oldState:0})),qn=[9,13,27,32],Jn=dn&&`CompositionEvent`in window,Yn=null;dn&&`documentMode`in document&&(Yn=document.documentMode);var Xn=dn&&`TextEvent`in window&&!Yn,Zn=dn&&(!Jn||Yn&&8<Yn&&11>=Yn),Qn=` `,$n=!1;function er(e,t){switch(e){case`keyup`:return qn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function tr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var nr=!1;function rr(e,t){switch(e){case`compositionend`:return tr(t);case`keypress`:return t.which===32?($n=!0,Qn):null;case`textInput`:return e=t.data,e===Qn&&$n?null:e;default:return null}}function ir(e,t){if(nr)return e===`compositionend`||!Jn&&er(e,t)?(e=_n(),gn=hn=mn=null,nr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Zn&&t.locale!==`ko`?null:t.data;default:return null}}var ar={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 or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ar[e.type]:t===`textarea`}function sr(e,t,n,r){an?on?on.push(r):on=[r]:an=r,t=Od(t,`onChange`),0<t.length&&(n=new Cn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var cr=null,lr=null;function ur(e){xd(e,0)}function dr(e){if(Lt(yt(e)))return e}function fr(e,t){if(e===`change`)return t}var pr=!1;if(dn){var mr;if(dn){var hr=`oninput`in document;if(!hr){var gr=document.createElement(`div`);gr.setAttribute(`oninput`,`return;`),hr=typeof gr.oninput==`function`}mr=hr}else mr=!1;pr=mr&&(!document.documentMode||9<document.documentMode)}function _r(){cr&&(cr.detachEvent(`onpropertychange`,vr),lr=cr=null)}function vr(e){if(e.propertyName===`value`&&dr(lr)){var t=[];sr(t,lr,e,rn(e)),ln(ur,t)}}function yr(e,t,n){e===`focusin`?(_r(),cr=t,lr=n,cr.attachEvent(`onpropertychange`,vr)):e===`focusout`&&_r()}function br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return dr(lr)}function xr(e,t){if(e===`click`)return dr(t)}function L(e,t){if(e===`input`||e===`change`)return dr(t)}function Sr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Cr=typeof Object.is==`function`?Object.is:Sr;function wr(e,t){if(Cr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Te.call(t,i)||!Cr(e[i],t[i]))return!1}return!0}function Tr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Er(e,t){var n=Tr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Tr(n)}}function R(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?R(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rt(e.document)}return t}function Or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var kr=dn&&`documentMode`in document&&11>=document.documentMode,Ar=null,jr=null,Mr=null,Nr=!1;function Pr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Nr||Ar==null||Ar!==Rt(r)||(r=Ar,`selectionStart`in r&&Or(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Mr&&wr(Mr,r)||(Mr=r,r=Od(jr,`onSelect`),0<r.length&&(t=new Cn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ar)))}function Fr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ir={animationend:Fr(`Animation`,`AnimationEnd`),animationiteration:Fr(`Animation`,`AnimationIteration`),animationstart:Fr(`Animation`,`AnimationStart`),transitionrun:Fr(`Transition`,`TransitionRun`),transitionstart:Fr(`Transition`,`TransitionStart`),transitioncancel:Fr(`Transition`,`TransitionCancel`),transitionend:Fr(`Transition`,`TransitionEnd`)},Lr={},Rr={};dn&&(Rr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ir.animationend.animation,delete Ir.animationiteration.animation,delete Ir.animationstart.animation),`TransitionEvent`in window||delete Ir.transitionend.transition);function z(e){if(Lr[e])return Lr[e];if(!Ir[e])return e;var t=Ir[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Rr)return Lr[e]=t[n];return e}var zr=z(`animationend`),Br=z(`animationiteration`),Vr=z(`animationstart`),Hr=z(`transitionrun`),Ur=z(`transitionstart`),Wr=z(`transitioncancel`),Gr=z(`transitionend`),Kr=new Map,qr=`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(` `);qr.push(`scrollEnd`);function Jr(e,t){Kr.set(e,t),wt(t,[e])}var Yr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Xr=[],Zr=0,Qr=0;function $r(){for(var e=Zr,t=Qr=Zr=0;t<e;){var n=Xr[t];Xr[t++]=null;var r=Xr[t];Xr[t++]=null;var i=Xr[t];Xr[t++]=null;var a=Xr[t];if(Xr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ri(n,i,a)}}function ei(e,t,n,r){Xr[Zr++]=e,Xr[Zr++]=t,Xr[Zr++]=n,Xr[Zr++]=r,Qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ti(e,t,n,r){return ei(e,t,n,r),ii(e)}function ni(e,t){return ei(e,null,null,t),ii(e)}function ri(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-He(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ii(e){if(50<fu)throw fu=0,pu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ai={};function oi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function si(e,t,n,r){return new oi(e,t,n,r)}function ci(e){return e=e.prototype,!(!e||!e.isReactComponent)}function li(e,t){var n=e.alternate;return n===null?(n=si(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ui(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function di(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ci(e)&&(s=1);else if(typeof e==`string`)s=Wf(e,n,ue.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=si(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return fi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=si(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=si(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=si(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=si(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function fi(e,t,n,r){return e=si(7,e,r,t),e.lanes=n,e}function pi(e,t,n){return e=si(6,e,null,t),e.lanes=n,e}function mi(e){var t=si(18,null,null,0);return t.stateNode=e,t}function hi(e,t,n){return t=si(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gi=new WeakMap;function _i(e,t){if(typeof e==`object`&&e){var n=gi.get(e);return n===void 0?(t={value:e,source:t,stack:we(t)},gi.set(e,t),t):n}return{value:e,source:t,stack:we(t)}}var vi=[],yi=0,bi=null,xi=0,Si=[],B=0,Ci=null,wi=1,Ti=``;function Ei(e,t){vi[yi++]=xi,vi[yi++]=bi,bi=e,xi=t}function Di(e,t,n){Si[B++]=wi,Si[B++]=Ti,Si[B++]=Ci,Ci=e;var r=wi;e=Ti;var i=32-He(r)-1;r&=~(1<<i),n+=1;var a=32-He(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,wi=1<<32-He(t)+i|n<<i|r,Ti=a+e}else wi=1<<a|n<<i|r,Ti=e}function Oi(e){e.return!==null&&(Ei(e,1),Di(e,1,0))}function ki(e){for(;e===bi;)bi=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null;for(;e===Ci;)Ci=Si[--B],Si[B]=null,Ti=Si[--B],Si[B]=null,wi=Si[--B],Si[B]=null}function Ai(e,t){Si[B++]=wi,Si[B++]=Ti,Si[B++]=Ci,wi=t.id,Ti=t.overflow,Ci=e}var ji=null,Mi=null,V=!1,Ni=null,Pi=!1,Fi=Error(i(519));function Ii(e){throw Hi(_i(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Fi}function Li(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[lt]=e,t[ut]=r,n){case`dialog`:X(`cancel`,t),X(`close`,t);break;case`iframe`:case`object`:case`embed`:X(`load`,t);break;case`video`:case`audio`:for(n=0;n<yd.length;n++)X(yd[n],t);break;case`source`:X(`error`,t);break;case`img`:case`image`:case`link`:X(`error`,t),X(`load`,t);break;case`details`:X(`toggle`,t);break;case`input`:X(`invalid`,t),Ht(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:X(`invalid`,t);break;case`textarea`:X(`invalid`,t),Kt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Pd(t.textContent,n)?(r.popover!=null&&(X(`beforetoggle`,t),X(`toggle`,t)),r.onScroll!=null&&X(`scroll`,t),r.onScrollEnd!=null&&X(`scrollend`,t),r.onClick!=null&&(t.onclick=tn),t=!0):t=!1,t||Ii(e,!0)}function Ri(e){for(ji=e.return;ji;)switch(ji.tag){case 5:case 31:case 13:Pi=!1;return;case 27:case 3:Pi=!0;return;default:ji=ji.return}}function zi(e){if(e!==ji)return!1;if(!V)return Ri(e),V=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Gd(e.type,e.memoizedProps)),n=!n),n&&Mi&&Ii(e),Ri(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Mi=ff(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Mi=ff(e)}else t===27?(t=Mi,$d(e.type)?(e=df,df=null,Mi=e):Mi=t):Mi=ji?uf(e.stateNode.nextSibling):null;return!0}function Bi(){Mi=ji=null,V=!1}function Vi(){var e=Ni;return e!==null&&($l===null?$l=e:$l.push.apply($l,e),Ni=null),e}function Hi(e){Ni===null?Ni=[e]:Ni.push(e)}var Ui=se(null),Wi=null,Gi=null;function Ki(e,t,n){le(Ui,t._currentValue),t._currentValue=n}function qi(e){e._currentValue=Ui.current,ce(Ui)}function Ji(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Yi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ji(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ji(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Xi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Cr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===pe.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[$f]:e.push($f))}a=a.return}e!==null&&Yi(t,e,n,r),t.flags|=262144}function Zi(e){for(e=e.firstContext;e!==null;){if(!Cr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Qi(e){Wi=e,Gi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $i(e){return ta(Wi,e)}function ea(e,t){return Wi===null&&Qi(e),ta(e,t)}function ta(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Gi===null){if(e===null)throw Error(i(308));Gi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Gi=Gi.next=t;return n}var na=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ra=t.unstable_scheduleCallback,ia=t.unstable_NormalPriority,aa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oa(){return{controller:new na,data:new Map,refCount:0}}function sa(e){e.refCount--,e.refCount===0&&ra(ia,function(){e.controller.abort()})}var ca=null,la=0,ua=0,da=null;function fa(e,t){if(ca===null){var n=ca=[];la=0,ua=pd(),da={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return la++,t.then(pa,pa),t}function pa(){if(--la===0&&ca!==null){da!==null&&(da.status=`fulfilled`);var e=ca;ca=null,ua=0,da=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ma(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ha=M.S;M.S=function(e,t){nu=Ae(),typeof t==`object`&&t&&typeof t.then==`function`&&fa(e,t),ha!==null&&ha(e,t)};var ga=se(null);function _a(){var e=ga.current;return e===null?Bl.pooledCache:e}function va(e,t){t===null?le(ga,ga.current):le(ga,t.pool)}function ya(){var e=_a();return e===null?null:{parent:aa._currentValue,pool:e}}var ba=Error(i(460)),xa=Error(i(474)),Sa=Error(i(542)),Ca={then:function(){}};function wa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ta(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(tn,tn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e;default:if(typeof t.status==`string`)t.then(tn,tn);else{if(e=Bl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e}throw Da=t,ba}}function Ea(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Da=e,ba):e}}var Da=null;function Oa(){if(Da===null)throw Error(i(459));var e=Da;return Da=null,e}function ka(e){if(e===ba||e===Sa)throw Error(i(483))}var Aa=null,ja=0;function Ma(e){var t=ja;return ja+=1,Aa===null&&(Aa=[]),Ta(Aa,e,t)}function Na(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Pa(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Fa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=li(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=pi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Ea(i)===t.type)?(t=a(t,n.props),Na(t,n),t.return=e,t):(t=di(n.type,n.key,n.props,null,e.mode,r),Na(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=hi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=fi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=di(t.type,t.key,t.props,null,e.mode,n),Na(n,t),n.return=e,n;case v:return t=hi(t,e.mode,n),t.return=e,t;case O:return t=Ea(t),f(e,t,n)}if(re(t)||te(t))return t=fi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ma(t),n);if(t.$$typeof===C)return f(e,ea(e,t),n);Pa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Ea(n),p(e,t,n,r)}if(re(n)||te(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ma(n),r);if(n.$$typeof===C)return p(e,t,ea(e,n),r);Pa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Ea(r),m(e,t,n,r,i)}if(re(r)||te(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ma(r),i);if(r.$$typeof===C)return m(e,t,n,ea(t,r),i);Pa(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),V&&Ei(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return V&&Ei(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),V&&Ei(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),V&&Ei(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return V&&Ei(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),V&&Ei(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Ea(l)===r.type){n(e,r.sibling),c=a(r,o.props),Na(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=fi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=di(o.type,o.key,o.props,null,e.mode,c),Na(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=hi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Ea(o),b(e,r,o,c)}if(re(o))return h(e,r,o,c);if(te(o)){if(l=te(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ma(o),c);if(o.$$typeof===C)return b(e,r,ea(e,o),c);Pa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ja=0;var i=b(e,t,n,r);return Aa=null,i}catch(t){if(t===ba||t===Sa)throw t;var a=si(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ia=Fa(!0),La=Fa(!1),Ra=!1;function za(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ba(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ha(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,zl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ii(e),ri(e,null,n),t}return ei(e,r,t,n),ii(e)}function Ua(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nt(e,n)}}function Wa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ga=!1;function Ka(){if(Ga){var e=da;if(e!==null)throw e}}function qa(e,t,n,r){Ga=!1;var i=e.updateQueue;Ra=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(q&f)===f:(r&f)===f){f!==0&&f===ua&&(Ga=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ra=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ql|=o,e.lanes=o,e.memoizedState=d}}function Ja(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ya(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ja(n[e],t)}var Xa=se(null),Za=se(0);function Qa(e,t){e=Gl,le(Za,e),le(Xa,t),Gl=e|t.baseLanes}function $a(){le(Za,Gl),le(Xa,Xa.current)}function eo(){Gl=Za.current,ce(Xa),ce(Za)}var to=se(null),no=null;function ro(e){var t=e.alternate;le(co,co.current&1),le(to,e),no===null&&(t===null||Xa.current!==null||t.memoizedState!==null)&&(no=e)}function io(e){le(co,co.current),le(to,e),no===null&&(no=e)}function ao(e){e.tag===22?(le(co,co.current),le(to,e),no===null&&(no=e)):oo(e)}function oo(){le(co,co.current),le(to,to.current)}function so(e){ce(to),no===e&&(no=null),ce(co)}var co=se(0);function lo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||sf(n)||cf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var uo=0,H=null,fo=null,po=null,mo=!1,ho=!1,go=!1,_o=0,vo=0,yo=null,bo=0;function xo(){throw Error(i(321))}function So(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Cr(e[n],t[n]))return!1;return!0}function Co(e,t,n,r,i,a){return uo=a,H=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?zs:Bs,go=!1,a=n(r,i),go=!1,ho&&(a=To(t,n,r,i)),wo(e),a}function wo(e){M.H=Rs;var t=fo!==null&&fo.next!==null;if(uo=0,po=fo=H=null,mo=!1,vo=0,yo=null,t)throw Error(i(300));e===null||rc||(e=e.dependencies,e!==null&&Zi(e)&&(rc=!0))}function To(e,t,n,r){H=e;var a=0;do{if(ho&&(yo=null),vo=0,ho=!1,25<=a)throw Error(i(301));if(a+=1,po=fo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=Vs,o=t(n,r)}while(ho);return o}function Eo(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?No(t):t,e=e.useState()[0],(fo===null?null:fo.memoizedState)!==e&&(H.flags|=1024),t}function Do(){var e=_o!==0;return _o=0,e}function Oo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ko(e){if(mo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}mo=!1}uo=0,po=fo=H=null,ho=!1,vo=_o=0,yo=null}function Ao(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return po===null?H.memoizedState=po=e:po=po.next=e,po}function jo(){if(fo===null){var e=H.alternate;e=e===null?null:e.memoizedState}else e=fo.next;var t=po===null?H.memoizedState:po.next;if(t!==null)po=t,fo=e;else{if(e===null)throw H.alternate===null?Error(i(467)):Error(i(310));fo=e,e={memoizedState:fo.memoizedState,baseState:fo.baseState,baseQueue:fo.baseQueue,queue:fo.queue,next:null},po===null?H.memoizedState=po=e:po=po.next=e}return po}function Mo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function No(e){var t=vo;return vo+=1,yo===null&&(yo=[]),e=Ta(yo,e,t),t=H,(po===null?t.memoizedState:po.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?zs:Bs),e}function Po(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return No(e);if(e.$$typeof===C)return $i(e)}throw Error(i(438,String(e)))}function Fo(e){var t=null,n=H.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=H.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Mo(),H.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ee;return t.index++,n}function Io(e,t){return typeof t==`function`?t(e):t}function Lo(e){return Ro(jo(),fo,e)}function Ro(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(uo&f)===f:(q&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ua&&(d=!0);else if((uo&p)===p){u=u.next,p===ua&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,H.lanes|=p,ql|=p;f=u.action,go&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,H.lanes|=f,ql|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Cr(o,e.memoizedState)&&(rc=!0,d&&(n=da,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function U(e){var t=jo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Cr(o,t.memoizedState)||(rc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function zo(e,t,n){var r=H,a=jo(),o=V;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Cr((fo||a).memoizedState,n);if(s&&(a.memoizedState=n,rc=!0),a=a.queue,us(Ho.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||po!==null&&po.memoizedState.tag&1){if(r.flags|=2048,as(9,{destroy:void 0},Vo.bind(null,r,a,n,t),null),Bl===null)throw Error(i(349));o||uo&127||Bo(r,t,n)}return n}function Bo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=H.updateQueue,t===null?(t=Mo(),H.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Vo(e,t,n,r){t.value=n,t.getSnapshot=r,Uo(t)&&Wo(e)}function Ho(e,t,n){return n(function(){Uo(t)&&Wo(e)})}function Uo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Cr(e,n)}catch{return!0}}function Wo(e){var t=ni(e,2);t!==null&&gu(t,e,2)}function Go(e){var t=Ao();if(typeof e==`function`){var n=e;if(e=n(),go){Ve(!0);try{n()}finally{Ve(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:e},t}function Ko(e,t,n,r){return e.baseState=n,Ro(e,fo,typeof r==`function`?r:Io)}function qo(e,t,n,r,a){if(Fs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Jo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Jo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),Yo(e,t,s)}catch(n){Zo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),Yo(e,t,a)}catch(n){Zo(e,t,n)}}function Yo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Xo(e,t,n)},function(n){return Zo(e,t,n)}):Xo(e,t,n)}function Xo(e,t,n){t.status=`fulfilled`,t.value=n,Qo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Jo(e,n)))}function Zo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Qo(t),t=t.next;while(t!==r)}e.action=null}function Qo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function $o(e,t){return t}function es(e,t){if(V){var n=Bl.formState;if(n!==null){a:{var r=H;if(V){if(Mi){b:{for(var i=Mi,a=Pi;i.nodeType!==8;){if(!a){i=null;break b}if(i=uf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Mi=uf(i.nextSibling),r=i.data===`F!`;break a}}Ii(r)}r=!1}r&&(t=n[0])}}return n=Ao(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$o,lastRenderedState:t},n.queue=r,n=Ms.bind(null,H,r),r.dispatch=n,r=Go(!1),a=Ps.bind(null,H,!1,r.queue),r=Ao(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=qo.bind(null,H,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ts(e){return ns(jo(),fo,e)}function ns(e,t,n){if(t=Ro(e,t,$o)[0],e=Lo(Io)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=No(t)}catch(e){throw e===ba?Sa:e}else r=t;t=jo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(H.flags|=2048,as(9,{destroy:void 0},rs.bind(null,i,n),null)),[r,a,e]}function rs(e,t){e.action=t}function is(e){var t=jo(),n=fo;if(n!==null)return ns(t,n,e);jo(),t=t.memoizedState,n=jo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function as(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=H.updateQueue,t===null&&(t=Mo(),H.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function os(){return jo().memoizedState}function ss(e,t,n,r){var i=Ao();H.flags|=e,i.memoizedState=as(1|t,{destroy:void 0},n,r===void 0?null:r)}function cs(e,t,n,r){var i=jo();r=r===void 0?null:r;var a=i.memoizedState.inst;fo!==null&&r!==null&&So(r,fo.memoizedState.deps)?i.memoizedState=as(t,a,n,r):(H.flags|=e,i.memoizedState=as(1|t,a,n,r))}function ls(e,t){ss(8390656,8,e,t)}function us(e,t){cs(2048,8,e,t)}function ds(e){H.flags|=4;var t=H.updateQueue;if(t===null)t=Mo(),H.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function fs(e){var t=jo().memoizedState;return ds({ref:t,nextImpl:e}),function(){if(zl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ps(e,t){return cs(4,2,e,t)}function ms(e,t){return cs(4,4,e,t)}function hs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function gs(e,t,n){n=n==null?null:n.concat([e]),cs(4,4,hs.bind(null,t,e),n)}function _s(){}function vs(e,t){var n=jo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&So(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ys(e,t){var n=jo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&So(t,r[1]))return r[0];if(r=e(),go){Ve(!0);try{e()}finally{Ve(!1)}}return n.memoizedState=[r,t],r}function bs(e,t,n){return n===void 0||uo&1073741824&&!(q&261930)?e.memoizedState=t:(e.memoizedState=n,e=hu(),H.lanes|=e,ql|=e,n)}function xs(e,t,n,r){return Cr(n,t)?n:Xa.current===null?!(uo&42)||uo&1073741824&&!(q&261930)?(rc=!0,e.memoizedState=n):(e=hu(),H.lanes|=e,ql|=e,t):(e=bs(e,n,r),Cr(e,t)||(rc=!0),e)}function Ss(e,t,n,r,i){var a=N.p;N.p=a!==0&&8>a?a:8;var o=M.T,s={};M.T=s,Ps(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ns(e,t,ma(c,r),mu(e)):Ns(e,t,r,mu(e))}catch(n){Ns(e,t,{then:function(){},status:`rejected`,reason:n},mu())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function Cs(){}function ws(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ts(e).queue;Ss(e,a,t,ie,n===null?Cs:function(){return Es(e),n(r)})}function Ts(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:ie},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Es(e){var t=Ts(e);t.next===null&&(t=e.alternate.memoizedState),Ns(e,t.next.queue,{},mu())}function Ds(){return $i($f)}function Os(){return jo().memoizedState}function ks(){return jo().memoizedState}function As(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=mu();e=Va(n);var r=Ha(t,e,n);r!==null&&(gu(r,t,n),Ua(r,t,n)),t={cache:oa()},e.payload=t;return}t=t.return}}function js(e,t,n){var r=mu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Fs(e)?Is(t,n):(n=ti(e,t,n,r),n!==null&&(gu(n,e,r),Ls(n,t,r)))}function Ms(e,t,n){Ns(e,t,n,mu())}function Ns(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fs(e))Is(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Cr(s,o))return ei(e,t,i,0),Bl===null&&$r(),!1}catch{}if(n=ti(e,t,i,r),n!==null)return gu(n,e,r),Ls(n,t,r),!0}return!1}function Ps(e,t,n,r){if(r={lane:2,revertLane:pd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Fs(e)){if(t)throw Error(i(479))}else t=ti(e,n,r,2),t!==null&&gu(t,e,2)}function Fs(e){var t=e.alternate;return e===H||t!==null&&t===H}function Is(e,t){ho=mo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ls(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nt(e,n)}}var Rs={readContext:$i,use:Po,useCallback:xo,useContext:xo,useEffect:xo,useImperativeHandle:xo,useLayoutEffect:xo,useInsertionEffect:xo,useMemo:xo,useReducer:xo,useRef:xo,useState:xo,useDebugValue:xo,useDeferredValue:xo,useTransition:xo,useSyncExternalStore:xo,useId:xo,useHostTransitionStatus:xo,useFormState:xo,useActionState:xo,useOptimistic:xo,useMemoCache:xo,useCacheRefresh:xo};Rs.useEffectEvent=xo;var zs={readContext:$i,use:Po,useCallback:function(e,t){return Ao().memoizedState=[e,t===void 0?null:t],e},useContext:$i,useEffect:ls,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ss(4194308,4,hs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ss(4194308,4,e,t)},useInsertionEffect:function(e,t){ss(4,2,e,t)},useMemo:function(e,t){var n=Ao();t=t===void 0?null:t;var r=e();if(go){Ve(!0);try{e()}finally{Ve(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Ao();if(n!==void 0){var i=n(t);if(go){Ve(!0);try{n(t)}finally{Ve(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=js.bind(null,H,e),[r.memoizedState,e]},useRef:function(e){var t=Ao();return e={current:e},t.memoizedState=e},useState:function(e){e=Go(e);var t=e.queue,n=Ms.bind(null,H,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:_s,useDeferredValue:function(e,t){return bs(Ao(),e,t)},useTransition:function(){var e=Go(!1);return e=Ss.bind(null,H,e.queue,!0,!1),Ao().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=H,a=Ao();if(V){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Bl===null)throw Error(i(349));q&127||Bo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ls(Ho.bind(null,r,o,e),[e]),r.flags|=2048,as(9,{destroy:void 0},Vo.bind(null,r,o,n,t),null),n},useId:function(){var e=Ao(),t=Bl.identifierPrefix;if(V){var n=Ti,r=wi;n=(r&~(1<<32-He(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=_o++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=bo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ds,useFormState:es,useActionState:es,useOptimistic:function(e){var t=Ao();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ps.bind(null,H,!0,n),n.dispatch=t,[e,t]},useMemoCache:Fo,useCacheRefresh:function(){return Ao().memoizedState=As.bind(null,H)},useEffectEvent:function(e){var t=Ao(),n={impl:e};return t.memoizedState=n,function(){if(zl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Bs={readContext:$i,use:Po,useCallback:vs,useContext:$i,useEffect:us,useImperativeHandle:gs,useInsertionEffect:ps,useLayoutEffect:ms,useMemo:ys,useReducer:Lo,useRef:os,useState:function(){return Lo(Io)},useDebugValue:_s,useDeferredValue:function(e,t){return xs(jo(),fo.memoizedState,e,t)},useTransition:function(){var e=Lo(Io)[0],t=jo().memoizedState;return[typeof e==`boolean`?e:No(e),t]},useSyncExternalStore:zo,useId:Os,useHostTransitionStatus:Ds,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){return Ko(jo(),fo,e,t)},useMemoCache:Fo,useCacheRefresh:ks};Bs.useEffectEvent=fs;var Vs={readContext:$i,use:Po,useCallback:vs,useContext:$i,useEffect:us,useImperativeHandle:gs,useInsertionEffect:ps,useLayoutEffect:ms,useMemo:ys,useReducer:U,useRef:os,useState:function(){return U(Io)},useDebugValue:_s,useDeferredValue:function(e,t){var n=jo();return fo===null?bs(n,e,t):xs(n,fo.memoizedState,e,t)},useTransition:function(){var e=U(Io)[0],t=jo().memoizedState;return[typeof e==`boolean`?e:No(e),t]},useSyncExternalStore:zo,useId:Os,useHostTransitionStatus:Ds,useFormState:is,useActionState:is,useOptimistic:function(e,t){var n=jo();return fo===null?(n.baseState=e,[e,n.queue.dispatch]):Ko(n,fo,e,t)},useMemoCache:Fo,useCacheRefresh:ks};Vs.useEffectEvent=fs;function Hs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Us={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=mu(),i=Va(r);i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(gu(t,e,r),Ua(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=mu(),i=Va(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(gu(t,e,r),Ua(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=mu(),r=Va(n);r.tag=2,t!=null&&(r.callback=t),t=Ha(e,r,n),t!==null&&(gu(t,e,n),Ua(t,e,n))}};function Ws(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!wr(n,r)||!wr(i,a):!0}function Gs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Us.enqueueReplaceState(t,t.state,null)}function Ks(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function qs(e){Yr(e)}function Js(e){console.error(e)}function Ys(e){Yr(e)}function Xs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Zs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Qs(e,t,n){return n=Va(n),n.tag=3,n.payload={element:null},n.callback=function(){Xs(e,t)},n}function $s(e){return e=Va(e),e.tag=3,e}function ec(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Zs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Zs(t,n,r),typeof i!=`function`&&(au===null?au=new Set([this]):au.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function tc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Xi(t,n,a,!0),n=to.current,n!==null){switch(n.tag){case 31:case 13:return no===null?Ou():n.alternate===null&&Kl===0&&(Kl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),qu(e,r,a)),!1;case 22:return n.flags|=65536,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),qu(e,r,a)),!1}throw Error(i(435,n.tag))}return qu(e,r,a),Ou(),!1}if(V)return t=to.current,t===null?(r!==Fi&&(t=Error(i(423),{cause:r}),Hi(_i(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=_i(r,n),a=Qs(e.stateNode,r,a),Wa(e,a),Kl!==4&&(Kl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Fi&&(e=Error(i(422),{cause:r}),Hi(_i(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=_i(o,n),Ql===null?Ql=[o]:Ql.push(o),Kl!==4&&(Kl=2),t===null)return!0;r=_i(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Qs(n.stateNode,r,e),Wa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(au===null||!au.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=$s(a),ec(a,e,n,r),Wa(n,a),!1}n=n.return}while(n!==null);return!1}var nc=Error(i(461)),rc=!1;function ic(e,t,n,r){t.child=e===null?La(t,null,n,r):Ia(t,e.child,n,r)}function ac(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Qi(t),r=Co(e,t,n,o,a,i),s=Do(),e!==null&&!rc?(Oo(e,t,i),Oc(e,t,i)):(V&&s&&Oi(t),t.flags|=1,ic(e,t,r,i),t.child)}function oc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ci(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,sc(e,t,a,r,i)):(e=di(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!kc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?wr:n,n(o,r)&&e.ref===t.ref)return Oc(e,t,i)}return t.flags|=1,e=li(a,r),e.ref=t.ref,e.return=t,t.child=e}function sc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(wr(a,r)&&e.ref===t.ref)if(rc=!1,t.pendingProps=r=a,kc(e,i))e.flags&131072&&(rc=!0);else return t.lanes=e.lanes,Oc(e,t,i)}return hc(e,t,n,r,i)}function cc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return uc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&va(t,a===null?null:a.cachePool),a===null?$a():Qa(t,a),ao(t);else return r=t.lanes=536870912,uc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&va(t,null),$a(),oo(t)):(va(t,a.cachePool),Qa(t,a),oo(t),t.memoizedState=null);return ic(e,t,i,n),t.child}function lc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function uc(e,t,n,r,i){var a=_a();return a=a===null?null:{parent:aa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&va(t,null),$a(),ao(t),e!==null&&Xi(e,t,r,!0),t.childLanes=i,null}function dc(e,t){return t=Cc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function fc(e,t,n){return Ia(t,e.child,null,n),e=dc(t,t.pendingProps),e.flags|=2,so(t),t.memoizedState=null,e}function pc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(V){if(r.mode===`hidden`)return e=dc(t,r),t.lanes=536870912,lc(null,e);if(io(t),(e=Mi)?(e=of(e,Pi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ci===null?null:{id:wi,overflow:Ti},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,ji=t,Mi=null)):e=null,e===null)throw Ii(t);return t.lanes=536870912,null}return dc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(io(t),a)if(t.flags&256)t.flags&=-257,t=fc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(rc||Xi(e,t,n,!1),a=(n&e.childLanes)!==0,rc||a){if(r=Bl,r!==null&&(s=rt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ni(e,s),gu(r,e,s),nc;Ou(),t=fc(e,t,n)}else e=o.treeContext,Mi=uf(s.nextSibling),ji=t,V=!0,Ni=null,Pi=!1,e!==null&&Ai(t,e),t=dc(t,r),t.flags|=4096;return t}return e=li(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function mc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function hc(e,t,n,r,i){return Qi(t),n=Co(e,t,n,r,void 0,i),r=Do(),e!==null&&!rc?(Oo(e,t,i),Oc(e,t,i)):(V&&r&&Oi(t),t.flags|=1,ic(e,t,n,i),t.child)}function gc(e,t,n,r,i,a){return Qi(t),t.updateQueue=null,n=To(t,r,n,i),wo(e),r=Do(),e!==null&&!rc?(Oo(e,t,a),Oc(e,t,a)):(V&&r&&Oi(t),t.flags|=1,ic(e,t,n,a),t.child)}function _c(e,t,n,r,i){if(Qi(t),t.stateNode===null){var a=ai,o=n.contextType;typeof o==`object`&&o&&(a=$i(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Us,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},za(t),o=n.contextType,a.context=typeof o==`object`&&o?$i(o):ai,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Hs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Us.enqueueReplaceState(a,a.state,null),qa(t,r,a,i),Ka(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ks(n,s);a.props=c;var l=a.context,u=n.contextType;o=ai,typeof u==`object`&&u&&(o=$i(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Gs(t,a,r,o),Ra=!1;var f=t.memoizedState;a.state=f,qa(t,r,a,i),Ka(),l=t.memoizedState,s||f!==l||Ra?(typeof d==`function`&&(Hs(t,n,d,r),l=t.memoizedState),(c=Ra||Ws(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ba(e,t),o=t.memoizedProps,u=Ks(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ai,typeof l==`object`&&l&&(c=$i(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Gs(t,a,r,c),Ra=!1,f=t.memoizedState,a.state=f,qa(t,r,a,i),Ka();var p=t.memoizedState;o!==d||f!==p||Ra||e!==null&&e.dependencies!==null&&Zi(e.dependencies)?(typeof s==`function`&&(Hs(t,n,s,r),p=t.memoizedState),(u=Ra||Ws(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Zi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,mc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ia(t,e.child,null,i),t.child=Ia(t,null,n,i)):ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Oc(e,t,i),e}function vc(e,t,n,r){return Bi(),t.flags|=256,ic(e,t,n,r),t.child}var yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bc(e){return{baseLanes:e,cachePool:ya()}}function xc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Xl),e}function Sc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(co.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(V){if(a?ro(t):oo(t),(e=Mi)?(e=of(e,Pi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ci===null?null:{id:wi,overflow:Ti},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,ji=t,Mi=null)):e=null,e===null)throw Ii(t);return cf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(oo(t),a=t.mode,c=Cc({mode:`hidden`,children:c},a),r=fi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=bc(n),r.childLanes=xc(e,s,n),t.memoizedState=yc,lc(null,r)):(ro(t),W(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(ro(t),t.flags&=-257,t=wc(e,t,n)):t.memoizedState===null?(oo(t),c=r.fallback,a=t.mode,r=Cc({mode:`visible`,children:r.children},a),c=fi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ia(t,e.child,null,n),r=t.child,r.memoizedState=bc(n),r.childLanes=xc(e,s,n),t.memoizedState=yc,t=lc(null,r)):(oo(t),t.child=e.child,t.flags|=128,t=null);else if(ro(t),cf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Hi({value:r,source:null,stack:null}),t=wc(e,t,n)}else if(rc||Xi(e,t,n,!1),s=(n&e.childLanes)!==0,rc||s){if(s=Bl,s!==null&&(r=rt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ni(e,r),gu(s,e,r),nc;sf(c)||Ou(),t=wc(e,t,n)}else sf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Mi=uf(c.nextSibling),ji=t,V=!0,Ni=null,Pi=!1,e!==null&&Ai(t,e),t=W(t,r.children),t.flags|=4096);return t}return a?(oo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=li(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=fi(c,a,n,null),c.flags|=2):c=li(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,lc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=bc(n):(a=c.cachePool,a===null?a=ya():(l=aa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=xc(e,s,n),t.memoizedState=yc,lc(e.child,r)):(ro(t),n=e.child,e=n.sibling,n=li(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function W(e,t){return t=Cc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Cc(e,t){return e=si(22,e,null,t),e.lanes=0,e}function wc(e,t,n){return Ia(t,e.child,null,n),e=W(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Tc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ji(e.return,t,n)}function Ec(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Dc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=co.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,le(co,o),ic(e,t,r,n),r=V?xi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Tc(e,n,t);else if(e.tag===19)Tc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&lo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ec(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&lo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ec(t,!0,n,null,a,r);break;case`together`:Ec(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Oc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ql|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Xi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function kc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Zi(e))):!0}function Ac(e,t,n){switch(t.tag){case 3:me(t,t.stateNode.containerInfo),Ki(t,aa,e.memoizedState.cache),Bi();break;case 27:case 5:ge(t);break;case 4:me(t,t.stateNode.containerInfo);break;case 10:Ki(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,io(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ro(t),e=Oc(e,t,n),e===null?null:e.sibling):Sc(e,t,n):(ro(t),t.flags|=128,null);ro(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Xi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Dc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),le(co,co.current),r)break;return null;case 22:return t.lanes=0,cc(e,t,n,t.pendingProps);case 24:Ki(t,aa,e.memoizedState.cache)}return Oc(e,t,n)}function jc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)rc=!0;else{if(!kc(e,n)&&!(t.flags&128))return rc=!1,Ac(e,t,n);rc=!!(e.flags&131072)}else rc=!1,V&&t.flags&1048576&&Di(t,xi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ea(t.elementType),t.type=e,typeof e==`function`)ci(e)?(r=Ks(e,r),t.tag=1,t=_c(null,t,e,r,n)):(t.tag=0,t=hc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=ac(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=oc(null,t,e,r,n);break a}}throw t=ne(e)||e,Error(i(306,t,``))}}return t;case 0:return hc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ks(r,t.pendingProps),_c(e,t,r,a,n);case 3:a:{if(me(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ba(e,t),qa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ki(t,aa,r),r!==o.cache&&Yi(t,[aa],n,!0),Ka(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=vc(e,t,r,n);break a}else if(r!==a){a=_i(Error(i(424)),t),Hi(a),t=vc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Mi=uf(e.firstChild),ji=t,V=!0,Ni=null,Pi=!0,n=La(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Bi(),r===a){t=Oc(e,t,n);break a}ic(e,t,r,n)}t=t.child}return t;case 26:return mc(e,t),e===null?(n=jf(t.type,null,t.pendingProps,null))?t.memoizedState=n:V||(n=t.type,e=t.pendingProps,r=Hd(fe.current).createElement(n),r[lt]=t,r[ut]=e,Id(r,n,e),xt(r),t.stateNode=r):t.memoizedState=jf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ge(t),e===null&&V&&(r=t.stateNode=mf(t.type,t.pendingProps,fe.current),ji=t,Pi=!0,a=Mi,$d(t.type)?(df=a,Mi=uf(r.firstChild)):Mi=a),ic(e,t,t.pendingProps.children,n),mc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&V&&((a=r=Mi)&&(r=rf(r,t.type,t.pendingProps,Pi),r===null?a=!1:(t.stateNode=r,ji=t,Mi=uf(r.firstChild),Pi=!1,a=!0)),a||Ii(t)),ge(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Gd(a,o)?r=null:s!==null&&Gd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Co(e,t,Eo,null,null,n),$f._currentValue=a),mc(e,t),ic(e,t,r,n),t.child;case 6:return e===null&&V&&((e=n=Mi)&&(n=af(n,t.pendingProps,Pi),n===null?e=!1:(t.stateNode=n,ji=t,Mi=null,e=!0)),e||Ii(t)),null;case 13:return Sc(e,t,n);case 4:return me(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ia(t,null,r,n):ic(e,t,r,n),t.child;case 11:return ac(e,t,t.type,t.pendingProps,n);case 7:return ic(e,t,t.pendingProps,n),t.child;case 8:return ic(e,t,t.pendingProps.children,n),t.child;case 12:return ic(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ki(t,t.type,r.value),ic(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Qi(t),a=$i(a),r=r(a),t.flags|=1,ic(e,t,r,n),t.child;case 14:return oc(e,t,t.type,t.pendingProps,n);case 15:return sc(e,t,t.type,t.pendingProps,n);case 19:return Dc(e,t,n);case 31:return pc(e,t,n);case 22:return cc(e,t,n,t.pendingProps);case 24:return Qi(t),r=$i(aa),e===null?(a=_a(),a===null&&(a=Bl,o=oa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},za(t),Ki(t,aa,a)):((e.lanes&n)!==0&&(Ba(e,t),qa(t,null,null,n),Ka()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ki(t,aa,r),r!==a.cache&&Yi(t,[aa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ki(t,aa,r))),ic(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Mc(e){e.flags|=4}function Nc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Tu())e.flags|=8192;else throw Da=Ca,xa}else e.flags&=-16777217}function Pc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Gf(t))if(Tu())e.flags|=8192;else throw Da=Ca,xa}function Fc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ze(),e.lanes|=t,Zl|=t)}function Ic(e,t){if(!V)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function G(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Lc(e,t,n){var r=t.pendingProps;switch(ki(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return G(t),null;case 1:return G(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),qi(aa),he(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(zi(t)?Mc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vi())),G(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Mc(t),o===null?(G(t),Nc(t,a,null,r,n)):(G(t),Pc(t,o))):o?o===e.memoizedState?(G(t),t.flags&=-16777217):(Mc(t),G(t),Pc(t,o)):(e=e.memoizedProps,e!==r&&Mc(t),G(t),Nc(t,a,e,r,n)),null;case 27:if(_e(t),n=fe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return G(t),null}e=ue.current,zi(t)?Li(t,e):(e=mf(a,r,n),t.stateNode=e,Mc(t))}return G(t),null;case 5:if(_e(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return G(t),null}if(o=ue.current,zi(t))Li(t,o);else{var s=Hd(fe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[lt]=t,o[ut]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Id(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Mc(t)}}return G(t),Nc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=fe.current,zi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ji,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[lt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Pd(e.nodeValue,n)),e||Ii(t,!0)}else e=Hd(e).createTextNode(r),e[lt]=t,t.stateNode=e}return G(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=zi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[lt]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;G(t),e=!1}else n=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(so(t),t):(so(t),null);if(t.flags&128)throw Error(i(558))}return G(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=zi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[lt]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;G(t),a=!1}else a=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(so(t),t):(so(t),null)}return so(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Fc(t,t.updateQueue),G(t),null);case 4:return he(),e===null&&wd(t.stateNode.containerInfo),G(t),null;case 10:return qi(t.type),G(t),null;case 19:if(ce(co),r=t.memoizedState,r===null)return G(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Ic(r,!1);else{if(Kl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=lo(e),o!==null){for(t.flags|=128,Ic(r,!1),e=o.updateQueue,t.updateQueue=e,Fc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ui(n,e),n=n.sibling;return le(co,co.current&1|2),V&&Ei(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ae()>ru&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304)}else{if(!a)if(e=lo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Fc(t,e),Ic(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!V)return G(t),null}else 2*Ae()-r.renderingStartTime>ru&&n!==536870912&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(G(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ae(),e.sibling=null,n=co.current,le(co,a?n&1|2:n&1),V&&Ei(t,r.treeForkCount),e);case 22:case 23:return so(t),eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(G(t),t.subtreeFlags&6&&(t.flags|=8192)):G(t),n=t.updateQueue,n!==null&&Fc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ce(ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),qi(aa),G(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Rc(e,t){switch(ki(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qi(aa),he(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(so(t),t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(so(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ce(co),null;case 4:return he(),null;case 10:return qi(t.type),null;case 22:case 23:return so(t),eo(),e!==null&&ce(ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qi(aa),null;case 25:return null;default:return null}}function zc(e,t){switch(ki(t),t.tag){case 3:qi(aa),he();break;case 26:case 27:case 5:_e(t);break;case 4:he();break;case 31:t.memoizedState!==null&&so(t);break;case 13:so(t);break;case 19:ce(co);break;case 10:qi(t.type);break;case 22:case 23:so(t),eo(),e!==null&&ce(ga);break;case 24:qi(aa)}}function Bc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ku(t,t.return,e)}}function Vc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Ku(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ku(t,t.return,e)}}function Hc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ya(t,n)}catch(t){Ku(e,e.return,t)}}}function Uc(e,t,n){n.props=Ks(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ku(e,t,n)}}function Wc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ku(e,t,n)}}function Gc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Ku(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Ku(e,t,n)}else n.current=null}function Kc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ku(e,e.return,t)}}function qc(e,t,n){try{var r=e.stateNode;Ld(r,e.type,n,t),r[ut]=t}catch(t){Ku(e,e.return,t)}}function Jc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&$d(e.type)||e.tag===4}function Yc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&$d(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=tn));else if(r!==4&&(r===27&&$d(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&$d(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Id(t,r,n),t[lt]=e,t[ut]=n}catch(t){Ku(e,e.return,t)}}var $c=!1,el=!1,tl=!1,nl=typeof WeakSet==`function`?WeakSet:Set,rl=null;function il(e,t){if(e=e.containerInfo,Bd=cp,e=Dr(e),Or(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Vd={focusedElem:e,selectionRange:n},cp=!1,rl=t;rl!==null;)if(t=rl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,rl=e;else for(;rl!==null;){switch(t=rl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ks(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ku(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)nf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:nf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,rl=e;break}rl=t.return}}function al(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:bl(e,n),r&4&&Bc(5,n);break;case 1:if(bl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ku(n,n.return,e)}else{var i=Ks(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ku(n,n.return,e)}}r&64&&Hc(n),r&512&&Wc(n,n.return);break;case 3:if(bl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ya(e,t)}catch(e){Ku(n,n.return,e)}}break;case 27:t===null&&r&4&&Qc(n);case 26:case 5:bl(e,n),t===null&&r&4&&Kc(n),r&512&&Wc(n,n.return);break;case 12:bl(e,n);break;case 31:bl(e,n),r&4&&dl(e,n);break;case 13:bl(e,n),r&4&&fl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Xu.bind(null,n),lf(e,n))));break;case 22:if(r=n.memoizedState!==null||$c,!r){t=t!==null&&t.memoizedState!==null||el,i=$c;var a=el;$c=r,(el=t)&&!a?Sl(e,n,(n.subtreeFlags&8772)!=0):bl(e,n),$c=i,el=a}break;case 30:break;default:bl(e,n)}}function ol(e){var t=e.alternate;t!==null&&(e.alternate=null,ol(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&gt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var sl=null,cl=!1;function ll(e,t,n){for(n=n.child;n!==null;)ul(e,t,n),n=n.sibling}function ul(e,t,n){if(Be&&typeof Be.onCommitFiberUnmount==`function`)try{Be.onCommitFiberUnmount(ze,n)}catch{}switch(n.tag){case 26:el||Gc(n,t),ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:el||Gc(n,t);var r=sl,i=cl;$d(n.type)&&(sl=n.stateNode,cl=!1),ll(e,t,n),hf(n.stateNode),sl=r,cl=i;break;case 5:el||Gc(n,t);case 6:if(r=sl,i=cl,sl=null,ll(e,t,n),sl=r,cl=i,sl!==null)if(cl)try{(sl.nodeType===9?sl.body:sl.nodeName===`HTML`?sl.ownerDocument.body:sl).removeChild(n.stateNode)}catch(e){Ku(n,t,e)}else try{sl.removeChild(n.stateNode)}catch(e){Ku(n,t,e)}break;case 18:sl!==null&&(cl?(e=sl,ef(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Pp(e)):ef(sl,n.stateNode));break;case 4:r=sl,i=cl,sl=n.stateNode.containerInfo,cl=!0,ll(e,t,n),sl=r,cl=i;break;case 0:case 11:case 14:case 15:Vc(2,n,t),el||Vc(4,n,t),ll(e,t,n);break;case 1:el||(Gc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Uc(n,t,r)),ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:el=(r=el)||n.memoizedState!==null,ll(e,t,n),el=r;break;default:ll(e,t,n)}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Pp(e)}catch(e){Ku(t,t.return,e)}}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Pp(e)}catch(e){Ku(t,t.return,e)}}function pl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nl),t;default:throw Error(i(435,e.tag))}}function ml(e,t){var n=pl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Zu.bind(null,e,t);t.then(r,r)}})}function hl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if($d(c.type)){sl=c.stateNode,cl=!1;break a}break;case 5:sl=c.stateNode,cl=!1;break a;case 3:case 4:sl=c.stateNode.containerInfo,cl=!0;break a}c=c.return}if(sl===null)throw Error(i(160));ul(o,s,a),sl=null,cl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_l(t,e),t=t.sibling}var gl=null;function _l(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hl(t,e),vl(e),r&4&&(Vc(3,e,e.return),Bc(3,e),Vc(5,e,e.return));break;case 1:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&64&&$c&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=gl;if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ht]||o[lt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Id(o,r,n),o[lt]=e,xt(o),r=o;break a;case`link`:var s=Hf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Id(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Hf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Id(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[lt]=e,xt(o),r=o}e.stateNode=r}else Uf(a,e.type,e.stateNode);else e.stateNode=Lf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&qc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Uf(a,e.type,e.stateNode):Lf(a,r,e.memoizedProps))}break;case 27:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),n!==null&&r&4&&qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),e.flags&32){a=e.stateNode;try{qt(a,``)}catch(t){Ku(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,qc(e,a,n===null?a:n.memoizedProps)),r&1024&&(tl=!0);break;case 6:if(hl(t,e),vl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ku(e,e.return,t)}}break;case 3:if(Vf=null,a=gl,gl=vf(t.containerInfo),hl(t,e),gl=a,vl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Pp(t.containerInfo)}catch(t){Ku(e,e.return,t)}tl&&(tl=!1,yl(e));break;case 4:r=gl,gl=vf(e.stateNode.containerInfo),hl(t,e),vl(e),gl=r;break;case 12:hl(t,e),vl(e);break;case 31:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 13:hl(t,e),vl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(tu=Ae()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=$c,d=el;if($c=u||a,el=d||l,hl(t,e),el=d,$c=u,vl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||$c||el||xl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Ku(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ku(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?tf(m,!0):tf(l.stateNode,!1)}catch(e){Ku(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ml(e,n))));break;case 19:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 30:break;case 21:break;default:hl(t,e),vl(e)}}function vl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Jc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Zc(e,Yc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(qt(o,``),n.flags&=-33),Zc(e,Yc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Xc(e,Yc(e),s);break;default:throw Error(i(161))}}catch(t){Ku(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)al(e,t.alternate,t),t=t.sibling}function xl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vc(4,t,t.return),xl(t);break;case 1:Gc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Uc(t,t.return,n),xl(t);break;case 27:hf(t.stateNode);case 26:case 5:Gc(t,t.return),xl(t);break;case 22:t.memoizedState===null&&xl(t);break;case 30:xl(t);break;default:xl(t)}e=e.sibling}}function Sl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Sl(i,a,n),Bc(4,a);break;case 1:if(Sl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ku(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ja(c[i],s)}catch(e){Ku(r,r.return,e)}}n&&o&64&&Hc(a),Wc(a,a.return);break;case 27:Qc(a);case 26:case 5:Sl(i,a,n),n&&r===null&&o&4&&Kc(a),Wc(a,a.return);break;case 12:Sl(i,a,n);break;case 31:Sl(i,a,n),n&&o&4&&dl(i,a);break;case 13:Sl(i,a,n),n&&o&4&&fl(i,a);break;case 22:a.memoizedState===null&&Sl(i,a,n),Wc(a,a.return);break;case 30:break;default:Sl(i,a,n)}t=t.sibling}}function Cl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&sa(n))}function wl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e))}function Tl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)El(e,t,n,r),t=t.sibling}function El(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Tl(e,t,n,r),i&2048&&Bc(9,t);break;case 1:Tl(e,t,n,r);break;case 3:Tl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e)));break;case 12:if(i&2048){Tl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ku(t,t.return,e)}}else Tl(e,t,n,r);break;case 31:Tl(e,t,n,r);break;case 13:Tl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Tl(e,t,n,r):(a._visibility|=2,Dl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Tl(e,t,n,r):Ol(e,t),i&2048&&Cl(o,t);break;case 24:Tl(e,t,n,r),i&2048&&wl(t.alternate,t);break;default:Tl(e,t,n,r)}}function Dl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Dl(a,o,s,c,i),Bc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Dl(a,o,s,c,i)):u._visibility&2?Dl(a,o,s,c,i):Ol(a,o),i&&l&2048&&Cl(o.alternate,o);break;case 24:Dl(a,o,s,c,i),i&&l&2048&&wl(o.alternate,o);break;default:Dl(a,o,s,c,i)}t=t.sibling}}function Ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ol(n,r),i&2048&&Cl(r.alternate,r);break;case 24:Ol(n,r),i&2048&&wl(r.alternate,r);break;default:Ol(n,r)}t=t.sibling}}var kl=8192;function Al(e,t,n){if(e.subtreeFlags&kl)for(e=e.child;e!==null;)jl(e,t,n),e=e.sibling}function jl(e,t,n){switch(e.tag){case 26:Al(e,t,n),e.flags&kl&&e.memoizedState!==null&&Kf(n,gl,e.memoizedState,e.memoizedProps);break;case 5:Al(e,t,n);break;case 3:case 4:var r=gl;gl=vf(e.stateNode.containerInfo),Al(e,t,n),gl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=kl,kl=16777216,Al(e,t,n),kl=r):Al(e,t,n));break;default:Al(e,t,n)}}function Ml(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Pl(e),e=e.sibling}function Pl(e){switch(e.tag){case 0:case 11:case 15:Nl(e),e.flags&2048&&Vc(9,e,e.return);break;case 3:Nl(e);break;case 12:Nl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):Nl(e);break;default:Nl(e)}}function Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vc(8,t,t.return),Fl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function Il(e,t){for(;rl!==null;){var n=rl;switch(n.tag){case 0:case 11:case 15:Vc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:sa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,rl=r;else a:for(n=e;rl!==null;){r=rl;var i=r.sibling,a=r.return;if(ol(r),r===n){rl=null;break a}if(i!==null){i.return=a,rl=i;break a}rl=a}}}var Ll={getCacheForType:function(e){var t=$i(aa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return $i(aa).controller.signal}},Rl=typeof WeakMap==`function`?WeakMap:Map,zl=0,Bl=null,K=null,q=0,J=0,Vl=null,Hl=!1,Ul=!1,Wl=!1,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=null,$l=null,eu=!1,tu=0,nu=0,ru=1/0,iu=null,au=null,ou=0,su=null,cu=null,lu=0,Y=0,uu=null,du=null,fu=0,pu=null;function mu(){return zl&2&&q!==0?q&-q:M.T===null?ot():pd()}function hu(){if(Xl===0)if(!(q&536870912)||V){var e=qe;qe<<=1,!(qe&3932160)&&(qe=262144),Xl=e}else Xl=536870912;return e=to.current,e!==null&&(e.flags|=32),Xl}function gu(e,t,n){(e===Bl&&(J===2||J===9)||e.cancelPendingCommit!==null)&&(Cu(e,0),bu(e,q,Xl,!1)),$e(e,n),(!(zl&2)||e!==Bl)&&(e===Bl&&(!(zl&2)&&(Jl|=n),Kl===4&&bu(e,q,Xl,!1)),ad(e))}function _u(e,t,n){if(zl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ye(e,t),a=r?ju(e,t):ku(e,t,!0),o=r;do{if(a===0){Ul&&!r&&bu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!yu(n)){a=ku(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Ql;var l=c.current.memoizedState.isDehydrated;if(l&&(Cu(c,s).flags|=256),s=ku(c,s,!1),s!==2){if(Wl&&!l){c.errorRecoveryDisabledLanes|=o,Jl|=o,a=4;break a}o=$l,$l=a,o!==null&&($l===null?$l=o:$l.push.apply($l,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Cu(e,0),bu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:bu(r,t,Xl,!Hl);break a;case 2:$l=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=tu+300-Ae(),10<a)){if(bu(r,t,Xl,!Hl),F(r,0,!0)!==0)break a;lu=t,r.timeoutHandle=Jd(vu.bind(null,r,n,$l,iu,eu,t,Xl,Jl,Zl,Hl,o,`Throttled`,-0,0),a);break a}vu(r,n,$l,iu,eu,t,Xl,Jl,Zl,Hl,o,null,-0,0)}}break}while(1);ad(e)}function vu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tn},jl(t,a,d);var m=(a&62914560)===a?tu-Ae():(a&4194048)===a?nu-Ae():0;if(m=Jf(d,m),m!==null){lu=a,e.cancelPendingCommit=m(Ru.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),bu(e,a,o,!l);return}}Ru(e,t,a,n,r,i,o,s,c)}function yu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Cr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function bu(e,t,n,r){t&=~Yl,t&=~Jl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-He(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&tt(e,n,t)}function xu(){return zl&6?!0:(od(0,!1),!1)}function Su(){if(K!==null){if(J===0)var e=K.return;else e=K,Gi=Wi=null,ko(e),Aa=null,ja=0,e=K;for(;e!==null;)zc(e.alternate,e),e=e.return;K=null}}function Cu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Yd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),lu=0,Su(),Bl=e,K=n=li(e.current,null),q=t,J=0,Vl=null,Hl=!1,Ul=Ye(e,t),Wl=!1,Zl=Xl=Yl=Jl=ql=Kl=0,$l=Ql=null,eu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-He(r),a=1<<i;t|=e[i],r&=~a}return Gl=t,$r(),n}function wu(e,t){H=null,M.H=Rs,t===ba||t===Sa?(t=Oa(),J=3):t===xa?(t=Oa(),J=4):J=t===nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Vl=t,K===null&&(Kl=1,Xs(e,_i(t,e.current)))}function Tu(){var e=to.current;return e===null?!0:(q&4194048)===q?no===null:(q&62914560)===q||q&536870912?e===no:!1}function Eu(){var e=M.H;return M.H=Rs,e===null?Rs:e}function Du(){var e=M.A;return M.A=Ll,e}function Ou(){Kl=4,Hl||(q&4194048)!==q&&to.current!==null||(Ul=!0),!(ql&134217727)&&!(Jl&134217727)||Bl===null||bu(Bl,q,Xl,!1)}function ku(e,t,n){var r=zl;zl|=2;var i=Eu(),a=Du();(Bl!==e||q!==t)&&(iu=null,Cu(e,t)),t=!1;var o=Kl;a:do try{if(J!==0&&K!==null){var s=K,c=Vl;switch(J){case 8:Su(),o=6;break a;case 3:case 2:case 9:case 6:to.current===null&&(t=!0);var l=J;if(J=0,Vl=null,Fu(e,s,c,l),n&&Ul){o=0;break a}break;default:l=J,J=0,Vl=null,Fu(e,s,c,l)}}Au(),o=Kl;break}catch(t){wu(e,t)}while(1);return t&&e.shellSuspendCounter++,Gi=Wi=null,zl=r,M.H=i,M.A=a,K===null&&(Bl=null,q=0,$r()),o}function Au(){for(;K!==null;)Nu(K)}function ju(e,t){var n=zl;zl|=2;var r=Eu(),a=Du();Bl!==e||q!==t?(iu=null,ru=Ae()+500,Cu(e,t)):Ul=Ye(e,t);a:do try{if(J!==0&&K!==null){t=K;var o=Vl;b:switch(J){case 1:J=0,Vl=null,Fu(e,t,o,1);break;case 2:case 9:if(wa(o)){J=0,Vl=null,Pu(t);break}t=function(){J!==2&&J!==9||Bl!==e||(J=7),ad(e)},o.then(t,t);break a;case 3:J=7;break a;case 4:J=5;break a;case 7:wa(o)?(J=0,Vl=null,Pu(t)):(J=0,Vl=null,Fu(e,t,o,7));break;case 5:var s=null;switch(K.tag){case 26:s=K.memoizedState;case 5:case 27:var c=K;if(s?Gf(s):c.stateNode.complete){J=0,Vl=null;var l=c.sibling;if(l!==null)K=l;else{var u=c.return;u===null?K=null:(K=u,Iu(u))}break b}}J=0,Vl=null,Fu(e,t,o,5);break;case 6:J=0,Vl=null,Fu(e,t,o,6);break;case 8:Su(),Kl=6;break a;default:throw Error(i(462))}}Mu();break}catch(t){wu(e,t)}while(1);return Gi=Wi=null,M.H=r,M.A=a,zl=n,K===null?(Bl=null,q=0,$r(),Kl):0}function Mu(){for(;K!==null&&!Oe();)Nu(K)}function Nu(e){var t=jc(e.alternate,e,Gl);e.memoizedProps=e.pendingProps,t===null?Iu(e):K=t}function Pu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=gc(n,t,t.pendingProps,t.type,void 0,q);break;case 11:t=gc(n,t,t.pendingProps,t.type.render,t.ref,q);break;case 5:ko(t);default:zc(n,t),t=K=ui(t,Gl),t=jc(n,t,Gl)}e.memoizedProps=e.pendingProps,t===null?Iu(e):K=t}function Fu(e,t,n,r){Gi=Wi=null,ko(t),Aa=null,ja=0;var i=t.return;try{if(tc(e,i,t,n,q)){Kl=1,Xs(e,_i(n,e.current)),K=null;return}}catch(t){if(i!==null)throw K=i,t;Kl=1,Xs(e,_i(n,e.current)),K=null;return}t.flags&32768?(V||r===1?e=!0:Ul||q&536870912?e=!1:(Hl=e=!0,(r===2||r===9||r===3||r===6)&&(r=to.current,r!==null&&r.tag===13&&(r.flags|=16384))),Lu(t,e)):Iu(t)}function Iu(e){var t=e;do{if(t.flags&32768){Lu(t,Hl);return}e=t.return;var n=Lc(t.alternate,t,Gl);if(n!==null){K=n;return}if(t=t.sibling,t!==null){K=t;return}K=t=e}while(t!==null);Kl===0&&(Kl=5)}function Lu(e,t){do{var n=Rc(e.alternate,e);if(n!==null){n.flags&=32767,K=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){K=e;return}K=e=n}while(e!==null);Kl=6,K=null}function Ru(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Uu();while(ou!==0);if(zl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Qr,et(e,n,o,s,c,l),e===Bl&&(K=Bl=null,q=0),cu=t,su=e,lu=n,Y=o,uu=a,du=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Qu(Pe,function(){return Wu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=M.T,M.T=null,a=N.p,N.p=2,s=zl,zl|=4;try{il(e,t,n)}finally{zl=s,N.p=a,M.T=r}}ou=1,zu(),Bu(),Vu()}}function zu(){if(ou===1){ou=0;var e=su,t=cu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=zl;zl|=4;try{_l(t,e);var a=Vd,o=Dr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&R(s.ownerDocument.documentElement,s)){if(c!==null&&Or(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Er(s,h),v=Er(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}cp=!!Bd,Vd=Bd=null}finally{zl=i,N.p=r,M.T=n}}e.current=t,ou=2}}function Bu(){if(ou===2){ou=0;var e=su,t=cu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=zl;zl|=4;try{al(e,t.alternate,t)}finally{zl=i,N.p=r,M.T=n}}ou=3}}function Vu(){if(ou===4||ou===3){ou=0,ke();var e=su,t=cu,n=lu,r=du;t.subtreeFlags&10256||t.flags&10256?ou=5:(ou=0,cu=su=null,Hu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(au=null),at(n),t=t.stateNode,Be&&typeof Be.onCommitFiberRoot==`function`)try{Be.onCommitFiberRoot(ze,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=M.T,i=N.p,N.p=2,M.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{M.T=t,N.p=i}}lu&3&&Uu(),ad(e),i=e.pendingLanes,n&261930&&i&42?e===pu?fu++:(fu=0,pu=e):fu=0,od(0,!1)}}function Hu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,sa(t)))}function Uu(){return zu(),Bu(),Vu(),Wu()}function Wu(){if(ou!==5)return!1;var e=su,t=Y;Y=0;var n=at(lu),r=M.T,a=N.p;try{N.p=32>n?32:n,M.T=null,n=uu,uu=null;var o=su,s=lu;if(ou=0,cu=su=null,lu=0,zl&6)throw Error(i(331));var c=zl;if(zl|=4,Pl(o.current),El(o,o.current,s,n),zl=c,od(0,!1),Be&&typeof Be.onPostCommitFiberRoot==`function`)try{Be.onPostCommitFiberRoot(ze,o)}catch{}return!0}finally{N.p=a,M.T=r,Hu(e,t)}}function Gu(e,t,n){t=_i(n,t),t=Qs(e.stateNode,t,2),e=Ha(e,t,2),e!==null&&($e(e,2),ad(e))}function Ku(e,t,n){if(e.tag===3)Gu(e,e,n);else for(;t!==null;){if(t.tag===3){Gu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(au===null||!au.has(r))){e=_i(n,e),n=$s(2),r=Ha(t,n,2),r!==null&&(ec(n,r,t,e),$e(r,2),ad(r));break}}t=t.return}}function qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Wl=!0,i.add(n),e=Ju.bind(null,e,t,n),t.then(e,e))}function Ju(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Bl===e&&(q&n)===n&&(Kl===4||Kl===3&&(q&62914560)===q&&300>Ae()-tu?!(zl&2)&&Cu(e,0):Yl|=n,Zl===q&&(Zl=0)),ad(e)}function Yu(e,t){t===0&&(t=Ze()),e=ni(e,t),e!==null&&($e(e,t),ad(e))}function Xu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yu(e,n)}function Zu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Yu(e,n)}function Qu(e,t){return Ee(e,t)}var $u=null,ed=null,td=!1,nd=!1,rd=!1,id=0;function ad(e){e!==ed&&e.next===null&&(ed===null?$u=ed=e:ed=ed.next=e),nd=!0,td||(td=!0,fd())}function od(e,t){if(!rd&&nd){rd=!0;do for(var n=!1,r=$u;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-He(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,dd(r,a))}else a=q,a=F(r,r===Bl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ye(r,a)||(n=!0,dd(r,a));r=r.next}while(n);rd=!1}}function sd(){cd()}function cd(){nd=td=!1;var e=0;id!==0&&qd()&&(e=id);for(var t=Ae(),n=null,r=$u;r!==null;){var i=r.next,a=ld(r,t);a===0?(r.next=null,n===null?$u=i:n.next=i,i===null&&(ed=n)):(n=r,(e!==0||a&3)&&(nd=!0)),r=i}ou!==0&&ou!==5||od(e,!1),id!==0&&(id=0)}function ld(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-He(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Xe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Bl,n=q,n=F(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(J===2||J===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&De(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ye(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&De(r),at(n)){case 2:case 8:n=Ne;break;case 32:n=Pe;break;case 268435456:n=Ie;break;default:n=Pe}return r=ud.bind(null,e),n=Ee(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&De(r),e.callbackPriority=2,e.callbackNode=null,2}function ud(e,t){if(ou!==0&&ou!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Uu()&&e.callbackNode!==n)return null;var r=q;return r=F(e,e===Bl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(_u(e,r,t),ld(e,Ae()),e.callbackNode!=null&&e.callbackNode===n?ud.bind(null,e):null)}function dd(e,t){if(Uu())return null;_u(e,t,!0)}function fd(){Zd(function(){zl&6?Ee(Me,sd):cd()})}function pd(){if(id===0){var e=ua;e===0&&(e=Ke,Ke<<=1,!(Ke&261888)&&(Ke=256)),id=e}return id}function md(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:en(``+e)}function hd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function gd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=md((i[ut]||null).action),o=r.submitter;o&&(t=(t=o[ut]||null)?md(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Cn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(id!==0){var e=o?hd(i,o):new FormData(i);ws(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?hd(i,o):new FormData(i),ws(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var _d=0;_d<qr.length;_d++){var vd=qr[_d];Jr(vd.toLowerCase(),`on`+(vd[0].toUpperCase()+vd.slice(1)))}Jr(zr,`onAnimationEnd`),Jr(Br,`onAnimationIteration`),Jr(Vr,`onAnimationStart`),Jr(`dblclick`,`onDoubleClick`),Jr(`focusin`,`onFocus`),Jr(`focusout`,`onBlur`),Jr(Hr,`onTransitionRun`),Jr(Ur,`onTransitionStart`),Jr(Wr,`onTransitionCancel`),Jr(Gr,`onTransitionEnd`),Tt(`onMouseEnter`,[`mouseout`,`mouseover`]),Tt(`onMouseLeave`,[`mouseout`,`mouseover`]),Tt(`onPointerEnter`,[`pointerout`,`pointerover`]),Tt(`onPointerLeave`,[`pointerout`,`pointerover`]),wt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),wt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),wt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),wt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var yd=`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(` `),bd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(yd));function xd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}}}}function X(e,t){var n=t[dt];n===void 0&&(n=t[dt]=new Set);var r=e+`__bubble`;n.has(r)||(Td(t,e,2,!1),n.add(r))}function Sd(e,t,n){var r=0;t&&(r|=4),Td(n,e,r,t)}var Cd=`_reactListening`+Math.random().toString(36).slice(2);function wd(e){if(!e[Cd]){e[Cd]=!0,St.forEach(function(t){t!==`selectionchange`&&(bd.has(t)||Sd(t,!1,e),Sd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Cd]||(t[Cd]=!0,Sd(`selectionchange`,!1,t))}}function Td(e,t,n,r){switch(hp(t)){case 2:var i=lp;break;case 8:i=up;break;default:i=dp}n=i.bind(null,t,n,e),i=void 0,!fn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Ed(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=_t(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}ln(function(){var r=a,i=rn(n),s=[];a:{var c=Kr.get(e);if(c!==void 0){var l=Cn,u=e;switch(e){case`keypress`:if(vn(n)===0)break a;case`keydown`:case`keyup`:l=Vn;break;case`focusin`:u=`focus`,l=Mn;break;case`focusout`:u=`blur`,l=Mn;break;case`beforeblur`:case`afterblur`:l=Mn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=An;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Un;break;case zr:case Br:case Vr:l=Nn;break;case Gr:l=Wn;break;case`scroll`:case`scrollend`:l=Tn;break;case`wheel`:l=Gn;break;case`copy`:case`cut`:case`paste`:l=Pn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Hn;break;case`toggle`:case`beforetoggle`:l=Kn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=un(m,p),g!=null&&d.push(Dd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==nn&&(u=n.relatedTarget||n.fromElement)&&(_t(u)||u[I]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?_t(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=An,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Hn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:yt(l),h=u==null?c:yt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,_t(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=kd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Ad(s,c,l,d,!1),u!==null&&f!==null&&Ad(s,f,u,d,!0)}}a:{if(c=r?yt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=fr;else if(or(c))if(pr)v=L;else{v=br;var y=yr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Zt(r.elementType)&&(v=fr):v=xr;if(v&&=v(e,r)){sr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ut(c,`number`,c.value)}switch(y=r?yt(r):window,e){case`focusin`:(or(y)||y.contentEditable===`true`)&&(Ar=y,jr=r,Mr=null);break;case`focusout`:Mr=jr=Ar=null;break;case`mousedown`:Nr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Nr=!1,Pr(s,n,i);break;case`selectionchange`:if(kr)break;case`keydown`:case`keyup`:Pr(s,n,i)}var b;if(Jn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else nr?er(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Zn&&n.locale!==`ko`&&(nr||x!==`onCompositionStart`?x===`onCompositionEnd`&&nr&&(b=_n()):(mn=i,hn=`value`in mn?mn.value:mn.textContent,nr=!0)),y=Od(r,x),0<y.length&&(x=new Fn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=tr(n),b!==null&&(x.data=b)))),(b=Xn?rr(e,n):ir(e,n))&&(x=Od(r,`onBeforeInput`),0<x.length&&(y=new Fn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),gd(s,e,r,n,i)}xd(s,t)})}function Dd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Od(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=un(e,n),i!=null&&r.unshift(Dd(e,i,a)),i=un(e,t),i!=null&&r.push(Dd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function kd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ad(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=un(n,a),l!=null&&o.unshift(Dd(n,l,c))):i||(l=un(n,a),l!=null&&o.push(Dd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var jd=/\r\n?/g,Md=/\u0000|\uFFFD/g;function Nd(e){return(typeof e==`string`?e:``+e).replace(jd,`
9
- `).replace(Md,``)}function Pd(e,t){return t=Nd(t),Nd(e)===t}function Z(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&qt(e,``+r);break;case`className`:jt(e,`class`,r);break;case`tabIndex`:jt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:jt(e,n,r);break;case`style`:Xt(e,r,o);break;case`data`:if(t!==`object`){jt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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 o==`function`&&(n===`formAction`?(t!==`input`&&Z(e,t,`name`,a.name,a,null),Z(e,t,`formEncType`,a.formEncType,a,null),Z(e,t,`formMethod`,a.formMethod,a,null),Z(e,t,`formTarget`,a.formTarget,a,null)):(Z(e,t,`encType`,a.encType,a,null),Z(e,t,`method`,a.method,a,null),Z(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`onScroll`:r!=null&&X(`scroll`,e);break;case`onScrollEnd`:r!=null&&X(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=en(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:X(`beforetoggle`,e),X(`toggle`,e),At(e,`popover`,r);break;case`xlinkActuate`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:At(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Qt.get(n)||n,At(e,n,r))}}function Fd(e,t,n,r,a,o){switch(n){case`style`:Xt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&qt(e,``+r);break;case`onScroll`:r!=null&&X(`scroll`,e);break;case`onScrollEnd`:r!=null&&X(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ct.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ut]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):At(e,n,r)}}}function Id(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:X(`error`,e),X(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Z(e,t,o,s,n,null)}}a&&Z(e,t,`srcSet`,n.srcSet,n,null),r&&Z(e,t,`src`,n.src,n,null);return;case`input`:X(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Z(e,t,r,d,n,null)}}Ht(e,o,c,l,u,s,a,!1);return;case`select`:for(a in X(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Z(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Wt(e,!!r,n,!0):Wt(e,!!r,t,!1);return;case`textarea`:for(s in X(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Z(e,t,s,c,n,null)}Kt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Z(e,t,l,r,n,null)}return;case`dialog`:X(`beforetoggle`,e),X(`toggle`,e),X(`cancel`,e),X(`close`,e);break;case`iframe`:case`object`:X(`load`,e);break;case`video`:case`audio`:for(r=0;r<yd.length;r++)X(yd[r],e);break;case`image`:X(`error`,e),X(`load`,e);break;case`details`:X(`toggle`,e);break;case`embed`:case`source`:case`link`:X(`error`,e),X(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Z(e,t,u,r,n,null)}return;default:if(Zt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Fd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Z(e,t,c,r,n,null))}function Ld(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Z(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Z(e,t,p,m,r,f)}}Vt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Z(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Z(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Wt(e,!!n,n?[]:``,!1):Wt(e,!!n,t,!0)):Wt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Z(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Z(e,t,s,a,r,o)}Gt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Z(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Z(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Z(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Z(e,t,u,p,r,m)}return;default:if(Zt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Fd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Fd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Z(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Z(e,t,f,p,r,m)}function Rd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function zd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Rd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Rd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Bd=null,Vd=null;function Hd(e){return e.nodeType===9?e:e.ownerDocument}function Ud(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Wd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Gd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Kd=null;function qd(){var e=window.event;return e&&e.type===`popstate`?e===Kd?!1:(Kd=e,!0):(Kd=null,!1)}var Jd=typeof setTimeout==`function`?setTimeout:void 0,Yd=typeof clearTimeout==`function`?clearTimeout:void 0,Xd=typeof Promise==`function`?Promise:void 0,Zd=typeof queueMicrotask==`function`?queueMicrotask:Xd===void 0?Jd:function(e){return Xd.resolve(null).then(e).catch(Qd)};function Qd(e){setTimeout(function(){throw e})}function $d(e){return e===`head`}function ef(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Pp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)hf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,hf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ht]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&hf(e.ownerDocument.body);n=i}while(n);Pp(t)}function tf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function nf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nf(n),gt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[ht])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=uf(e.nextSibling),e===null)break}return null}function af(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=uf(e.nextSibling),e===null))return null;return e}function of(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=uf(e.nextSibling),e===null))return null;return e}function sf(e){return e.data===`$?`||e.data===`$~`}function cf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function uf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var df=null;function ff(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return uf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function mf(e,t,n){switch(t=Hd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function hf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);gt(e)}var gf=new Map,_f=new Set;function vf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var yf=N.d;N.d={f:bf,r:xf,D:wf,C:Tf,L:Ef,m:Df,X:kf,S:Of,M:Af};function bf(){var e=yf.f(),t=xu();return e||t}function xf(e){var t=vt(e);t!==null&&t.tag===5&&t.type===`form`?Es(t):yf.r(e)}var Sf=typeof document>`u`?null:document;function Cf(e,t,n){var r=Sf;if(r&&typeof t==`string`&&t){var i=Bt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),_f.has(i)||(_f.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Id(t,`link`,e),xt(t),r.head.appendChild(t)))}}function wf(e){yf.D(e),Cf(`dns-prefetch`,e,null)}function Tf(e,t){yf.C(e,t),Cf(`preconnect`,e,t)}function Ef(e,t,n){yf.L(e,t,n);var r=Sf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Bt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Bt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Bt(n.imageSizes)+`"]`)):i+=`[href="`+Bt(e)+`"]`;var a=i;switch(t){case`style`:a=Mf(e);break;case`script`:a=Ff(e)}gf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),gf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Q(a))||t===`script`&&r.querySelector(If(a))||(t=r.createElement(`link`),Id(t,`link`,e),xt(t),r.head.appendChild(t)))}}function Df(e,t){yf.m(e,t);var n=Sf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Bt(r)+`"][href="`+Bt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Ff(e)}if(!gf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),gf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(If(a)))return}r=n.createElement(`link`),Id(r,`link`,e),xt(r),n.head.appendChild(r)}}}function Of(e,t,n){yf.S(e,t,n);var r=Sf;if(r&&e){var i=bt(r).hoistableStyles,a=Mf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Q(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=gf.get(a))&&zf(e,n);var c=o=r.createElement(`link`);xt(c),Id(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Rf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function kf(e,t){yf.X(e,t);var n=Sf;if(n&&e){var r=bt(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=m({src:e,async:!0},t),(t=gf.get(i))&&Bf(e,t),a=n.createElement(`script`),xt(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t){yf.M(e,t);var n=Sf;if(n&&e){var r=bt(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=gf.get(i))&&Bf(e,t),a=n.createElement(`script`),xt(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t,n,r){var a=(a=fe.current)?vf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Mf(n.href),n=bt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Mf(n.href);var o=bt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Q(e)))&&!o._p&&(s.instance=o,s.state.loading=5),gf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},gf.set(e,n),o||Pf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Ff(n),n=bt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Mf(e){return`href="`+Bt(e)+`"`}function Q(e){return`link[rel="stylesheet"][`+e+`]`}function Nf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Pf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Id(t,`link`,n),xt(t),e.head.appendChild(t))}function Ff(e){return`[src="`+Bt(e)+`"]`}function If(e){return`script[async]`+e}function Lf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Bt(n.href)+`"]`);if(r)return t.instance=r,xt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),xt(r),Id(r,`style`,a),Rf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Mf(n.href);var o=e.querySelector(Q(a));if(o)return t.state.loading|=4,t.instance=o,xt(o),o;r=Nf(n),(a=gf.get(a))&&zf(r,a),o=(e.ownerDocument||e).createElement(`link`),xt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Id(o,`link`,r),t.state.loading|=4,Rf(o,n.precedence,e),t.instance=o;case`script`:return o=Ff(n.src),(a=e.querySelector(If(o)))?(t.instance=a,xt(a),a):(r=n,(a=gf.get(o))&&(r=m({},n),Bf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),xt(a),Id(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Rf(r,n.precedence,e));return t.instance}function Rf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Vf=null;function Hf(e,t,n){if(Vf===null){var r=new Map,i=Vf=new Map;i.set(n,r)}else i=Vf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ht]||a[lt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Uf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Wf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Gf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Kf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Mf(r.href),a=t.querySelector(Q(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Yf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,xt(a);return}a=t.ownerDocument||t,r=Nf(r),(i=gf.get(i))&&zf(r,i),a=a.createElement(`link`),xt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Id(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Yf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var qf=0;function Jf(e,t){return e.stylesheets&&e.count===0&&Zf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Zf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&qf===0&&(qf=62500*zd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Zf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Yf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xf=null;function Zf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xf=new Map,t.forEach(Qf,e),Xf=null,Yf.call(e))}function Qf(e,t){if(!(t.state.loading&4)){var n=Xf.get(e);if(n)var r=n.get(null);else{n=new Map,Xf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Yf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var $f={$$typeof:C,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function ep(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Qe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qe(0),this.hiddenUpdates=Qe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function tp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ep(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=si(3,null,null,t),e.current=a,a.stateNode=e,t=oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},za(a),e}function np(e){return e?(e=ai,e):ai}function rp(e,t,n,r,i,a){i=np(i),r.context===null?r.context=i:r.pendingContext=i,r=Va(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ha(e,r,t),n!==null&&(gu(n,e,t),Ua(n,e,t))}function ip(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ap(e,t){ip(e,t),(e=e.alternate)&&ip(e,t)}function op(e){if(e.tag===13||e.tag===31){var t=ni(e,67108864);t!==null&&gu(t,e,67108864),ap(e,67108864)}}function sp(e){if(e.tag===13||e.tag===31){var t=mu();t=it(t);var n=ni(e,t);n!==null&&gu(n,e,t),ap(e,t)}}var cp=!0;function lp(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,dp(e,t,n,r)}finally{N.p=a,M.T=i}}function up(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,dp(e,t,n,r)}finally{N.p=a,M.T=i}}function dp(e,t,n,r){if(cp){var i=fp(r);if(i===null)Ed(e,t,r,pp,n),wp(e,r);else if(Ep(i,e,t,n,r))r.stopPropagation();else if(wp(e,r),t&4&&-1<Cp.indexOf(e)){for(;i!==null;){var a=vt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=P(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-He(o);s.entanglements[1]|=c,o&=~c}ad(a),!(zl&6)&&(ru=Ae()+500,od(0,!1))}}break;case 31:case 13:s=ni(a,2),s!==null&&gu(s,a,2),xu(),ap(a,2)}if(a=fp(r),a===null&&Ed(e,t,r,pp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ed(e,t,r,null,n)}}function fp(e){return e=rn(e),mp(e)}var pp=null;function mp(e){if(pp=null,e=_t(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return pp=e,null}function hp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(je()){case Me:return 2;case Ne:return 8;case Pe:case Fe:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var gp=!1,_p=null,vp=null,yp=null,bp=new Map,xp=new Map,Sp=[],Cp=`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 wp(e,t){switch(e){case`focusin`:case`focusout`:_p=null;break;case`dragenter`:case`dragleave`:vp=null;break;case`mouseover`:case`mouseout`:yp=null;break;case`pointerover`:case`pointerout`:bp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:xp.delete(t.pointerId)}}function Tp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=vt(t),t!==null&&op(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ep(e,t,n,r,i){switch(t){case`focusin`:return _p=Tp(_p,e,t,n,r,i),!0;case`dragenter`:return vp=Tp(vp,e,t,n,r,i),!0;case`mouseover`:return yp=Tp(yp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return bp.set(a,Tp(bp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,xp.set(a,Tp(xp.get(a)||null,e,t,n,r,i)),!0}return!1}function Dp(e){var t=_t(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,st(e.priority,function(){sp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,st(e.priority,function(){sp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Op(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=fp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);nn=r,n.target.dispatchEvent(r),nn=null}else return t=vt(n),t!==null&&op(t),e.blockedOn=n,!1;t.shift()}return!0}function kp(e,t,n){Op(e)&&n.delete(t)}function Ap(){gp=!1,_p!==null&&Op(_p)&&(_p=null),vp!==null&&Op(vp)&&(vp=null),yp!==null&&Op(yp)&&(yp=null),bp.forEach(kp),xp.forEach(kp)}function jp(e,n){e.blockedOn===n&&(e.blockedOn=null,gp||(gp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ap)))}var Mp=null;function Np(e){Mp!==e&&(Mp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Mp===e&&(Mp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(mp(r||n)===null)continue;break}var a=vt(n);a!==null&&(e.splice(t,3),t-=3,ws(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Pp(e){function t(t){return jp(t,e)}_p!==null&&jp(_p,e),vp!==null&&jp(vp,e),yp!==null&&jp(yp,e),bp.forEach(t),xp.forEach(t);for(var n=0;n<Sp.length;n++){var r=Sp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Sp.length&&(n=Sp[0],n.blockedOn===null);)Dp(n),n.blockedOn===null&&Sp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ut]||null;if(typeof a==`function`)o||Np(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ut]||null)s=o.formAction;else if(mp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Np(n)}}}function Fp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Ip(e){this._internalRoot=e}Lp.prototype.render=Ip.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;rp(n,mu(),e,t,null,null)},Lp.prototype.unmount=Ip.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;rp(e.current,2,null,e,null,null),xu(),t[I]=null}};function Lp(e){this._internalRoot=e}Lp.prototype.unstable_scheduleHydration=function(e){if(e){var t=ot();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Sp.length&&t!==0&&t<Sp[n].priority;n++);Sp.splice(n,0,e),n===0&&Dp(e)}};var Rp=n.version;if(Rp!==`19.2.7`)throw Error(i(527,Rp,`19.2.7`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var zp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Bp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bp.isDisabled&&Bp.supportsFiber)try{ze=Bp.inject(zp),Be=Bp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=qs,s=Js,c=Ys;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=tp(e,1,!1,null,null,n,r,null,o,s,c,Fp),e[I]=t.current,wd(e),new Ip(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},y=new class{#e=v;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function b(e){setTimeout(e,0)}var x=typeof window>`u`||`Deno`in globalThis;function S(){}function C(e,t){return typeof e==`function`?e(t):e}function w(e){return typeof e==`number`&&e>=0&&e!==1/0}function T(e,t){return Math.max(e+(t||0)-Date.now(),0)}function E(e,t){return typeof e==`function`?e(t):e}function D(e,t){return typeof e==`function`?e(t):e}function O(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ee(o,t.options))return!1}else if(!te(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function k(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(A(t.options.mutationKey)!==A(a))return!1}else if(!te(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ee(e,t){return(t?.queryKeyHashFn||A)(e)}function A(e){return JSON.stringify(e,(e,t)=>N(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function te(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>te(e[n],t[n])):!1}var j=Object.prototype.hasOwnProperty;function ne(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=M(e)&&M(t);if(!r&&!(N(e)&&N(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:j.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ne(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function re(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function M(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function N(e){if(!ie(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ie(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ie(e){return Object.prototype.toString.call(e)===`[object Object]`}function ae(e){return new Promise(t=>{y.setTimeout(t,e)})}function oe(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ne(e,t)}function se(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ce(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var le=Symbol();function ue(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===le?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function de(e,t){return typeof e==`function`?e(...t):!!e}function fe(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var pe=(()=>{let e=()=>x;return{isServer(){return e()},setIsServer(t){e=t}}})(),me=b;function he(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=me,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var ge=he(),_e=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),w(this.gcTime)&&(this.#e=y.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(pe.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(y.clearTimeout(this.#e),this.#e=void 0)}},ve=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ye=new class extends ve{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},be=new class extends ve{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function xe(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}function Se(e){return Math.min(1e3*2**e,3e4)}function Ce(e){return(e??`online`)===`online`?be.isOnline():!0}var we=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Te(e){let t=!1,n=0,r,i=xe(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new we(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>ye.isFocused()&&(e.networkMode===`always`||be.isOnline())&&e.canRun(),u=()=>Ce(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(pe.isServer()?0:3),o=e.retryDelay??Se,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),ae(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Ee=class extends _e{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||De(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Te({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),ge.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function De(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Oe=class extends ve{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),re(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&A(t.mutationKey)!==A(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??De();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){ge.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function ke(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{fe(e,()=>t.signal,()=>n=!0)},u=ue(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?ce:se;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?je:Ae,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Ae(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Ae(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function je(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Me=class extends _e{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Fe(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Fe(this.options);e.data!==void 0&&(this.setState(Pe(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=oe(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(S).catch(S):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>D(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===le||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>E(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!T(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ue(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?ke(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Te({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof we&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof we){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ne(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Pe(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),ge.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Ne(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ce(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Pe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Fe(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ie=class extends ve{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??ee(r,t),a=this.get(i);return a||(a=new Me({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ge.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>O(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>O(e,t)):t}notify(e){ge.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ge.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ge.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Le=class extends ve{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Ee({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Re(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Re(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Re(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Re(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ge.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>k(t,e))}findAll(e={}){return this.getAll().filter(t=>k(e,t))}notify(e){ge.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ge.batch(()=>Promise.all(e.map(e=>e.continue().catch(S))))}};function Re(e){return e.options.scope?.id}var ze=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ie,this.#t=e.mutationCache||new Le,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ye.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=be.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(E(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=C(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ge.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ge.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ge.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=ge.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(S).catch(S)}invalidateQueries(e,t={}){return ge.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ge.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(S)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(S)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(E(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(S).catch(S)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(S).catch(S)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return be.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(A(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{te(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(A(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{te(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ee(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===le&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Be=class extends ve{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=xe(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),He(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ue(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ue(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof D(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!re(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&We(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||D(this.options.enabled,this.#t)!==D(t.enabled,this.#t)||E(this.options.staleTime,this.#t)!==E(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||D(this.options.enabled,this.#t)!==D(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Ke(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(S)),t}#g(){this.#b();let e=E(this.options.staleTime,this.#t);if(pe.isServer()||this.#r.isStale||!w(e))return;let t=T(this.#r.dataUpdatedAt,e)+1;this.#d=y.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(pe.isServer()||D(this.options.enabled,this.#t)===!1||!w(this.#p)||this.#p===0)&&(this.#f=y.setInterval(()=>{(this.options.refetchIntervalInBackground||ye.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(y.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(y.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&He(e,t),o=i&&We(e,n,t,r);(a||o)&&(l={...l,...Ne(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=oe(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=oe(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Ge(e,t),refetch:this.refetch,promise:this.#o,isEnabled:D(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=xe())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!re(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){ge.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Ve(e,t){return D(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&D(t.retryOnMount,e)===!1)}function He(e,t){return Ve(e,t)||e.state.data!==void 0&&Ue(e,t,t.refetchOnMount)}function Ue(e,t,n){if(D(t.enabled,e)!==!1&&E(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Ge(e,t)}return!1}function We(e,t,n,r){return(e!==t||D(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Ge(e,n)}function Ge(e,t){return D(t.enabled,e)!==!1&&e.isStaleByTime(E(t.staleTime,e))}function Ke(e,t){return!re(e.getCurrentResult(),t)}var qe=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Je=o(((e,t)=>{t.exports=qe()})),P=l(d(),1),F=Je(),Ye=P.createContext(void 0),Xe=e=>{let t=P.useContext(Ye);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Ze=({client:e,children:t})=>(P.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,F.jsx)(Ye.Provider,{value:e,children:t}));function Qe(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $e=P.createContext(Qe()),et=()=>P.useContext($e),tt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?de(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},nt=e=>{P.useEffect(()=>{e.clearReset()},[e])},rt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||de(n,[e.error,r])),it=P.createContext(!1),at=()=>P.useContext(it);it.Provider;var ot=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},st=(e,t)=>e.isLoading&&e.isFetching&&!t,ct=(e,t)=>e?.suspense&&t.isPending,lt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ut(e,t,n){let r=at(),i=et(),a=Xe(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,ot(o),tt(o,i,s),nt(i);let l=!a.getQueryCache().get(o.queryHash),[u]=P.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(P.useSyncExternalStore(P.useCallback(e=>{let t=f?u.subscribe(ge.batchCalls(e)):S;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),P.useEffect(()=>{u.setOptions(o)},[o,u]),ct(o,d))throw lt(o,u,i);if(rt({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!pe.isServer()&&st(d,r)&&(l?lt(o,u,i):s?.promise)?.catch(S).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function I(e,t){return ut(e,Be,t)}function dt(e,t){let n=Xe(t),[r]=P.useState(()=>new Oe(n,e));P.useEffect(()=>{r.setOptions(e)},[r,e]);let i=P.useSyncExternalStore(P.useCallback(e=>r.subscribe(ge.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=P.useCallback((e,t)=>{r.mutate(e,t).catch(S)},[r]);if(i.error&&de(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var ft=_();function pt(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var mt=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),ht=o(((e,t)=>{t.exports=mt()})),gt=ht(),_t=P.useInsertionEffect,vt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect,yt=_t||vt,bt=e=>{let t=P.useRef([e,(...e)=>t[0](...e)]).current;return yt(()=>{t[0]=e}),t[1]},xt=`popstate`,St=`pushState`,Ct=`replaceState`,wt=[xt,St,Ct,`hashchange`],Tt=e=>{for(let t of wt)addEventListener(t,e);return()=>{for(let t of wt)removeEventListener(t,e)}},Et=(e,t)=>(0,gt.useSyncExternalStore)(Tt,e,t),Dt=()=>location.search,Ot=({ssrSearch:e}={})=>Et(Dt,e==null?Dt:()=>e),kt=()=>location.pathname,At=({ssrPath:e}={})=>Et(kt,e==null?kt:()=>e),jt=(e,{replace:t=!1,state:n=null}={})=>history[t?Ct:St](n,``,e),Mt=(e={})=>[At(e),jt],Nt=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[Nt]===void 0){for(let e of[St,Ct]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,Nt,{value:!0})}var Pt=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?`~`+t:t.slice(e.length)||`/`,Ft=(e=``)=>e===`/`?``:e,It=(e,t)=>e[0]===`~`?e.slice(1):Ft(t)+e,Lt=(e=``,t)=>Pt(Rt(Ft(e)),Rt(t)),Rt=e=>{try{return decodeURI(e)}catch{return e}},zt={hook:Mt,searchHook:Ot,parser:pt,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,n)=>e(t,n)},Bt=(0,P.createContext)(zt),Vt=()=>(0,P.useContext)(Bt),Ht={},Ut=(0,P.createContext)(Ht),Wt=()=>(0,P.useContext)(Ut),Gt=e=>{let[t,n]=e.hook(e);return[Lt(e.base,t),bt((t,r)=>e.aroundNav(n,It(t,e.base),r))]},Kt=()=>Gt(Vt()),qt=(e,t,n,r)=>{let{pattern:i,keys:a}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||`*`,r),o=i.exec(n)||[],[s,...c]=o;return s===void 0?[!1,null]:[!0,(()=>{let e=a===!1?o.groups:Object.fromEntries(a.map((e,t)=>[e,c[t]])),t={...c};return e&&Object.assign(t,e),t})(),...r?[s]:[]]},Jt=({children:e,...t})=>{let n=Vt(),r=t.hook?zt:n,i=r,[a,o=t.ssrSearch??``]=t.ssrPath?.split(`?`)??[];a&&(t.ssrSearch=o,t.ssrPath=a),t.hrefs=t.hrefs??t.hook?.hrefs,t.searchHook=t.searchHook??t.hook?.searchHook;let s=(0,P.useRef)({}),c=s.current,l=c;for(let e in r){let n=e===`base`?r[e]+(t[e]??``):t[e]??r[e];c===l&&n!==l[e]&&(s.current=l={...l}),l[e]=n,(n!==r[e]||n!==i[e])&&(i=l)}return(0,P.createElement)(Bt.Provider,{value:i,children:e})},Yt=({children:e,component:t},n)=>t?(0,P.createElement)(t,{params:n}):typeof e==`function`?e(n):e,Xt=e=>{let t=(0,P.useRef)(Ht),n=t.current;return t.current=Object.keys(e).length!==Object.keys(n).length||Object.entries(e).some(([e,t])=>t!==n[e])?e:n},Zt=({path:e,nest:t,match:n,...r})=>{let i=Vt(),[a]=Gt(i),[o,s,c]=n??qt(i.parser,e,a,t),l=Xt({...Wt(),...s});if(!o)return null;let u=c?(0,P.createElement)(Jt,{base:c},Yt(r,l)):Yt(r,l);return(0,P.createElement)(Ut.Provider,{value:l,children:u})},Qt=(0,P.forwardRef)((e,t)=>{let n=Vt(),[r,i]=Gt(n),{to:a=``,href:o=a,onClick:s,asChild:c,children:l,className:u,replace:d,state:f,transition:p,...m}=e,h=bt(t=>{t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0||(s?.(t),t.defaultPrevented||(t.preventDefault(),i(o,e)))}),g=n.hrefs(o[0]===`~`?o.slice(1):n.base+o,n);return c&&(0,P.isValidElement)(l)?(0,P.cloneElement)(l,{onClick:h,href:g}):(0,P.createElement)(`a`,{...m,onClick:h,href:g,className:u?.call?u(r===o):u,children:l,ref:t})}),$t=e=>Array.isArray(e)?e.flatMap(e=>$t(e&&e.type===P.Fragment?e.props.children:e)):[e],en=({children:e,location:t})=>{let n=Vt(),[r]=Gt(n);for(let i of $t(e)){let e=0;if((0,P.isValidElement)(i)&&(e=qt(n.parser,i.props.path,t||r,i.props.nest))[0])return(0,P.cloneElement)(i,{match:e})}return null},tn=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),nn=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),rn=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),an=e=>{let t=rn(e);return t.charAt(0).toUpperCase()+t.slice(1)},on={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},sn=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},cn=(0,P.createContext)({}),ln=()=>(0,P.useContext)(cn),un=(0,P.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=ln()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,P.createElement)(`svg`,{ref:c,...on,width:t??l??on.width,height:t??l??on.height,stroke:e??f,strokeWidth:m,className:tn(`lucide`,p,i),...!a&&!sn(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,P.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),dn=(e,t)=>{let n=(0,P.forwardRef)(({className:n,...r},i)=>(0,P.createElement)(un,{ref:i,iconNode:t,className:tn(`lucide-${nn(an(e))}`,`lucide-${e}`,n),...r}));return n.displayName=an(e),n},fn=dn(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),pn=dn(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),mn=dn(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),hn=dn(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),gn=dn(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),_n=dn(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),vn=dn(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),yn=dn(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),bn=dn(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),xn=dn(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Sn=dn(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Cn=dn(`trending-up`,[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]),wn=dn(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Tn=e=>Symbol.iterator in e,En=e=>`entries`in e,Dn=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},On=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function kn(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:Tn(e)&&Tn(t)?En(e)&&En(t)?Dn(e,t):On(e,t):Dn({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function An(e){let t=P.useRef(void 0);return n=>{let r=e(n);return kn(t.current,r)?t.current:t.current=r}}var jn=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Mn=(e=>e?jn(e):jn),Nn=e=>e;function Pn(e,t=Nn){let n=P.useSyncExternalStore(e.subscribe,P.useCallback(()=>t(e.getState()),[e,t]),P.useCallback(()=>t(e.getInitialState()),[e,t]));return P.useDebugValue(n),n}var Fn=e=>{let t=Mn(e),n=e=>Pn(t,e);return Object.assign(n,t),n},In=(e=>e?Fn(e):Fn),Ln=20,Rn=10,zn=In(e=>({connected:!1,recentToolCalls:[],cost:null,antiPatterns:[],contextBySession:new Map,firingAlerts:new Map,dismissedAlerts:new Set,activeSessionId:null,setConnected:t=>e({connected:t}),setActiveSession:t=>e(e=>{if(e.activeSessionId===t)return{};let n=e=>t===null?e===void 0:e===t;return{activeSessionId:t,recentToolCalls:e.recentToolCalls.filter(e=>n(e.sessionId)),antiPatterns:e.antiPatterns.filter(e=>n(e.sessionId)),cost:e.cost&&n(e.cost.sessionId)?e.cost:null}}),pushToolCall:t=>e(e=>{if(e.recentToolCalls.some(e=>e.id===t.id))return{};let n=[...e.recentToolCalls,t];return{recentToolCalls:n.length>Ln?n.slice(n.length-Ln):n}}),setCost:t=>e({cost:t}),setContext:t=>e(e=>{let n=new Map(e.contextBySession);return n.set(t.sessionId,t),{contextBySession:n}}),pushAntiPattern:t=>e(e=>{let n=[...e.antiPatterns,t];return{antiPatterns:n.length>Rn?n.slice(n.length-Rn):n}}),addOrUpdateAlert:t=>e(e=>{let n=new Map(e.firingAlerts);if(t.state===`firing`)n.set(t.id,t);else if(n.delete(t.id),e.dismissedAlerts.has(t.id)){let r=new Set(e.dismissedAlerts);return r.delete(t.id),{firingAlerts:n,dismissedAlerts:r}}return{firingAlerts:n}}),clearAlert:t=>e(e=>{if(!e.firingAlerts.has(t))return e;let n=new Map(e.firingAlerts);return n.delete(t),{firingAlerts:n}}),dismissAlert:t=>e(e=>{if(e.dismissedAlerts.has(t))return e;let n=new Set(e.dismissedAlerts);return n.add(t),{dismissedAlerts:n}})})),Bn={info:0,warning:1,critical:2};function Vn(e){let t=[];for(let n of e.firingAlerts.values())e.dismissedAlerts.has(n.id)||t.push(n);return t.sort((e,t)=>{let n=Bn[t.severity]-Bn[e.severity];return n===0?e.firedAt-t.firedAt:n}),t}function Hn(e){let t=null;for(let n of e.firingAlerts.values())e.dismissedAlerts.has(n.id)||(t===null||Bn[n.severity]>Bn[t])&&(t=n.severity);return t}function Un(){let e=zn(An(Vn)),t=zn(Hn),n=zn(e=>e.dismissAlert);return{alerts:e,maxSeverity:t,count:e.length,dismiss:n}}var Wn=class extends Error{constructor(e){super(`Not found: ${e}`),this.name=`NotFoundError`}};async function Gn(e){let t=await fetch(e);if(t.status===404)throw new Wn(e);if(!t.ok)throw Error(`${t.status} ${t.statusText} for ${e}`);return await t.json()}var Kn=()=>Gn(`/api/health`),qn=()=>Gn(`/api/session/current`),Jn=(e=50)=>Gn(`/api/sessions?limit=${e}`),Yn=()=>Gn(`/api/sessions/today/aggregate`),Xn=()=>Gn(`/api/sessions/live`),Zn=e=>Gn(`/api/sessions/${encodeURIComponent(e)}`),Qn=()=>Gn(`/api/cost`),$n=()=>Gn(`/api/anti-patterns`),er=()=>Gn(`/api/audit`),tr=()=>Gn(`/api/weekly`),nr=()=>Gn(`/api/budget`),rr=()=>Gn(`/api/latency`),ir=(e=30)=>Gn(`/api/cost-per-outcome?days=${e}`),ar=()=>Gn(`/api/personal-coach`),or=()=>Gn(`/api/alerts/recent`),sr=e=>Gn(`/api/sessions/${encodeURIComponent(e)}/replay`),cr=()=>Gn(`/api/quality-proxy`),lr=()=>Gn(`/api/tool-selection-score`),ur=()=>Gn(`/api/git-efficiency`),dr=()=>Gn(`/api/git-efficiency/repos`),fr=()=>Gn(`/api/concurrency`),pr=(e=30)=>Gn(`/api/concurrency?view=history&days=${e}`),mr=(e,t)=>Gn(`/api/activity-heatmap?view=${encodeURIComponent(e)}${t?`&weeks=${t}`:``}`),hr=e=>Gn(e?`/api/context?sessionId=${encodeURIComponent(e)}`:`/api/context`),gr=()=>Gn(`/api/model-usage`),_r=()=>Gn(`/api/cache-health`),vr=()=>Gn(`/api/settings`),yr=()=>Gn(`/api/diagnostics`),br=e=>fetch(`/api/settings`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}).then(async e=>{if(!e.ok)throw Error(`${e.status} ${e.statusText}`);return await e.json()}),xr=()=>fetch(`/api/digest/send`,{method:`POST`}).then(async e=>{if(!e.ok)throw Error(`${e.status} ${e.statusText}`);return await e.json()}),L={sessionCurrent:[`session`,`current`],sessionToday:[`session`,`today`],sessionsList:e=>[`sessions`,`list`,e],sessionDetail:e=>[`session`,e],cost:[`cost`],antiPatterns:[`anti-patterns`],audit:[`audit`],weekly:[`weekly`],budget:[`budget`],latency:[`latency`],costPerOutcome:e=>[`cost-per-outcome`,e],personalCoach:[`personal-coach`],alertsRecent:[`alerts`,`recent`],sessionReplay:e=>[`session`,e,`replay`],qualityProxy:[`quality-proxy`],toolSelectionScore:[`tool-selection-score`],gitEfficiency:[`git-efficiency`],gitEfficiencyRepos:[`git-efficiency-repos`],concurrency:[`concurrency`],concurrencyHistory:e=>[`concurrency`,`history`,e],activityHeatmap:e=>[`activity-heatmap`,e],context:[`context`],modelUsage:[`model-usage`],cacheHealth:[`cache-health`],settings:[`settings`],sessionsLive:[`sessions`,`live`],sessionsTodayAggregate:[`sessions`,`today`,`aggregate`],diagnostics:[`diagnostics`]},Sr={installed:null,latest:null,updateAvailable:!1};function Cr(){let[e,t]=(0,P.useState)(Sr);return(0,P.useEffect)(()=>{let e=!0;return Kn().then(n=>{e&&t({installed:n.version,latest:n.latestVersion,updateAvailable:n.updateAvailable})}).catch(()=>{}),()=>{e=!1}},[]),e}var wr={none:``,sm:`p-3`,md:`p-4`,lg:`p-5`},Tr={default:`glass-card`,elevated:`glass-card bg-surface-5`,static:`glass-card glass-card-static`,danger:`glass-card glass-card-static border border-accent-red/60`,warning:`glass-card glass-card-static border border-accent-amber/40`},Er={none:``,green:`glow-green`,purple:`glow-purple`};function R({children:e,padding:t=`md`,tone:n=`default`,glow:r=`none`,className:i=``}){return(0,F.jsx)(`div`,{className:[Tr[n],wr[t],Er[r],i].filter(Boolean).join(` `),children:e})}var Dr={primary:`bg-accent-green/10 border border-accent-green/40 text-accent-green hover:bg-accent-green/20`,secondary:`bg-surface-5 border border-border-medium text-ink-subtle hover:border-border-strong hover:text-ink-base`,ghost:`bg-transparent border border-transparent text-ink-muted hover:text-ink-base hover:bg-surface-5`,danger:`bg-surface-5 border border-border-subtle text-ink-muted hover:border-accent-red hover:text-accent-red`},Or={sm:`px-2 py-1 text-xs`,md:`px-3 py-1.5 text-xs`};function kr({children:e,variant:t=`secondary`,size:n=`md`,disabled:r=!1,loading:i=!1,type:a=`button`,className:o=``,...s}){let c=r||i,l=[`inline-flex items-center justify-center gap-1.5 rounded-md transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 focus-visible:ring-offset-1 focus-visible:ring-offset-bg-deep`,Dr[t],Or[n],c?`opacity-50 cursor-not-allowed`:``,o].filter(Boolean).join(` `);return(0,F.jsx)(`button`,{type:a,disabled:c,"aria-busy":i||void 0,className:l,...s,children:e})}var Ar={neutral:`bg-surface-5 text-ink-subtle`,info:`bg-accent-blue/15 text-accent-blue`,success:`bg-accent-green/15 text-accent-green`,warning:`bg-accent-amber/20 text-accent-amber`,danger:`bg-accent-red/20 text-accent-red`},jr={neutral:`border border-border-medium`,info:`border border-accent-blue/30`,success:`border border-accent-green/30`,warning:`border border-accent-amber/30`,danger:`border border-accent-red/30`},Mr={sm:`px-1.5 py-0.5 text-[10px]`,md:`px-2 py-0.5 text-[11px]`};function Nr({children:e,tone:t=`neutral`,size:n=`md`,uppercase:r=!1,bordered:i=!1,className:a=``,...o}){return(0,F.jsx)(`span`,{className:[`inline-flex items-center gap-1 rounded-full`,Ar[t],Mr[n],i?jr[t]:``,r?`uppercase tracking-wider font-semibold`:``,a].filter(Boolean).join(` `),...o,children:e})}var Pr={sm:`text-[9px]`,md:`text-[10px]`};function Fr({label:e=`LIVE`,pulse:t=!0,size:n=`md`,className:r=``}){return(0,F.jsxs)(`span`,{className:[`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full`,`bg-accent-cyan/15 text-accent-cyan uppercase tracking-wider font-semibold`,Pr[n],r].filter(Boolean).join(` `),children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`w-1.5 h-1.5 rounded-full bg-accent-cyan ${t?`animate-pulse`:``}`}),e]})}var Ir={sm:`px-2 py-0.5 text-[10px] rounded-md`,md:`px-3 py-1 text-xs rounded-md`},Lr={green:`bg-accent-green/20 text-accent-green font-medium`,cyan:`bg-accent-cyan/20 text-accent-cyan font-medium`};function Rr({value:e,onChange:t,options:n,size:r=`md`,tone:i=`green`,ariaLabel:a,className:o=``}){return(0,F.jsx)(`div`,{role:`tablist`,"aria-label":a,className:[`inline-flex items-center gap-1`,o].filter(Boolean).join(` `),children:n.map(n=>{let a=n.value===e;return(0,F.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":a,onClick:()=>t(n.value),className:[`transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 focus-visible:ring-offset-1 focus-visible:ring-offset-bg-deep`,Ir[r],a?Lr[i]:`text-ink-muted hover:text-ink-base`].join(` `),children:n.label},n.value)})})}function z({children:e,as:t=`div`,className:n=``}){let r=[`text-[10px] text-ink-muted uppercase tracking-wider font-medium`,n].filter(Boolean).join(` `);return t===`h2`?(0,F.jsx)(`h2`,{className:r,children:e}):t===`h3`?(0,F.jsx)(`h3`,{className:r,children:e}):(0,F.jsx)(`div`,{className:r,children:e})}function zr({title:e,subtitle:t,action:n,className:r=``}){return(0,F.jsxs)(`div`,{className:[`flex items-start justify-between gap-3 mb-3`,r].filter(Boolean).join(` `),children:[(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`text-sm font-medium text-ink-base`,children:e}),t!=null&&(0,F.jsx)(`div`,{className:`text-xs text-ink-muted`,children:t})]}),n!=null&&(0,F.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:n})]})}var Br=[{path:`/`,label:`Today`,Icon:fn},{path:`/sessions`,label:`Sessions`,Icon:gn}],Vr=[{path:`/history`,label:`History`,Icon:Cn},{path:`/git`,label:`Git`,Icon:vn},{path:`/audit`,label:`Audit`,Icon:xn}],Hr=[{path:`/settings`,label:`Settings`,Icon:bn},{path:`/alerts`,label:`Alerts`,Icon:pn}],Ur={info:`neutral`,warning:`warning`,critical:`danger`};function Wr({currentPath:e,onNavigate:t,connected:n,theme:r,onToggleTheme:i}){let{count:a,maxSeverity:o}=Un(),s=Cr();function c({path:n,label:r,Icon:i}){let s=e===n,c=n===`/`&&a>0,l=o??`info`;return(0,F.jsxs)(`button`,{type:`button`,"aria-current":s?`page`:void 0,onClick:()=>t(n),className:`flex items-center gap-2.5 px-3 py-2 rounded-lg text-xs text-left transition-colors duration-150 `+(s?`border-l-[3px] border-l-accent-green bg-accent-green/8 text-ink-base font-medium pl-2.5`:`border-l-[3px] border-l-transparent text-ink-subtle hover:text-ink-base hover:bg-surface-3`),children:[(0,F.jsx)(i,{size:14,"aria-hidden":`true`,focusable:`false`}),(0,F.jsx)(`span`,{children:r}),c&&(0,F.jsx)(Nr,{tone:Ur[l],size:`sm`,className:`ml-auto font-semibold tabular-nums`,"data-testid":`alert-badge`,"data-severity":l,"aria-label":`${a>99?`99+`:a} firing ${a===1?`alert`:`alerts`}`,children:a>99?`99+`:a})]},n)}return(0,F.jsxs)(`aside`,{className:`w-52 bg-bg-deep border-r border-border-subtle p-4 flex flex-col`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,F.jsxs)(`svg`,{width:`22`,height:`22`,viewBox:`0 0 128 128`,"aria-hidden":`true`,children:[(0,F.jsx)(`rect`,{width:`128`,height:`128`,rx:`24`,fill:`url(#preflightGrad)`}),(0,F.jsx)(`path`,{d:`M21.1599 74.0495L29.1148 66.0946L45.3429 68.9583L56.7981 57.5032L21.1599 42.2297L30.7058 32.6838L73.9808 40.3205L87.9815 26.3198C89.7316 24.5697 91.8529 23.6947 94.3454 23.6947C96.838 23.6947 98.9593 24.5697 100.709 26.3198C102.459 28.0699 103.335 30.1912 103.335 32.6838C103.335 35.1763 102.459 37.2976 100.709 39.0477L86.7087 53.0484L94.3454 96.3234L84.7995 105.869L69.526 70.2311L58.0709 81.6863L60.9346 97.9144L52.9797 105.869L41.8428 85.1864L21.1599 74.0495Z`,fill:`#080F11`}),(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`preflightGrad`,x1:`64`,y1:`0`,x2:`64`,y2:`128`,gradientUnits:`userSpaceOnUse`,children:[(0,F.jsx)(`stop`,{offset:`0.12`,stopColor:`#D2FA37`}),(0,F.jsx)(`stop`,{offset:`0.88`,stopColor:`#1CE783`})]})})]}),(0,F.jsx)(`span`,{className:`font-semibold text-sm tracking-tight brand-text`,children:`Preflight`}),(0,F.jsx)(`span`,{className:`text-ink-muted text-[10px] leading-none select-none`,children:`|`}),(0,F.jsx)(`span`,{className:`text-ink-muted text-[9px] leading-none`,children:`by`}),(0,F.jsxs)(`svg`,{width:`46`,height:`9`,viewBox:`0 0 819.12 159.36`,"aria-label":`New Relic`,fill:`currentColor`,className:`text-ink-subtle flex-shrink-0`,children:[(0,F.jsx)(`polygon`,{points:`68.85 .18 8.05 35.28 34.54 50.57 68.85 30.76 111.21 55.22 111.21 104.14 76.9 123.95 76.9 154.53 137.7 119.43 137.7 39.93 68.85 .18`}),(0,F.jsx)(`polygon`,{points:`42.36 94.97 42.36 143.89 68.85 159.18 68.85 79.68 0 39.93 0 70.51 42.36 94.97`}),(0,F.jsx)(`path`,{d:`M232.21,39.81c-14.82,0-21.84,9.36-21.84,9.36h-.78l-1.56-7.8h-17.94v79.57h19.5v-46.03c0-10.14,7.02-17.16,17.16-17.16s17.16,7.02,17.16,17.16v46.03h19.5v-47.59c0-20.28-13.26-33.55-31.21-33.55Z`}),(0,F.jsx)(`polygon`,{points:`442.54 93.64 441.42 93.64 428.15 41.38 408.31 41.38 395.05 93.64 393.93 93.64 380.67 41.38 360.39 41.38 380.67 120.95 404.41 120.95 417.67 69.46 418.79 69.46 432.06 120.95 455.8 120.95 476.08 41.38 455.8 41.38 442.54 93.64`}),(0,F.jsx)(`path`,{d:`M535.8,48.4h-.78l-1.56-7.02h-16.38v79.57h19.5v-46.02c0-10.14,4.68-14.82,14.82-14.82h10.04v-18.72h-11.6c-9.36,0-14.04,7.02-14.04,7.02Z`}),(0,F.jsx)(`path`,{d:`M604.56,39.82c-23.4,0-40.56,17.16-40.56,41.34s16.19,41.34,40.56,41.34c19.73,0,31.61-11.61,36.56-20.15l-17.9-6.38c-1.78,3.24-8.91,9.47-18.66,9.47-11.37,0-19.5-7.12-21.06-18.04h59.29s.78-3.12.78-7.8c0-22.62-17.16-39.78-39-39.78ZM583.5,74.14c2.34-10.14,9.36-17.94,21.06-17.94,10.92,0,17.94,7.8,19.5,17.94h-40.56Z`}),(0,F.jsx)(`path`,{d:`M316.44,39.82c-23.4,0-40.56,17.16-40.56,41.34s16.19,41.34,40.56,41.34c19.73,0,31.61-11.61,36.56-20.15l-17.9-6.38c-1.78,3.24-8.91,9.47-18.66,9.47-11.37,0-19.5-7.12-21.06-18.04h59.29s.78-3.12.78-7.8c0-22.62-17.16-39.78-39-39.78ZM295.38,74.14c2.34-10.14,9.36-17.94,21.06-17.94,10.92,0,17.94,7.8,19.5,17.94h-40.56Z`}),(0,F.jsx)(`rect`,{x:`692.24`,y:`9.96`,width:`19.5`,height:`19.5`}),(0,F.jsx)(`path`,{d:`M765.56,104.56c-11.7,0-21.06-9.36-21.06-23.4s9.36-23.4,21.06-23.4,16.38,7.8,17.94,12.48l17.66-6.28c-4.27-11.11-14.77-24.14-35.6-24.14-23.4,0-40.56,17.16-40.56,41.34s17.16,41.34,40.56,41.34c21,0,31.5-13.25,35.71-24.88l-17.77-6.32c-1.56,5.46-6.24,13.26-17.94,13.26Z`}),(0,F.jsx)(`polygon`,{points:`645.72 27.3 656.79 27.3 656.79 120.95 676.3 120.95 676.3 9.96 645.72 9.96 645.72 27.3`}),(0,F.jsx)(`rect`,{x:`692.24`,y:`41.38`,width:`19.5`,height:`79.57`}),(0,F.jsx)(`path`,{d:`M811.7,105.65c-4.28,0-7.42,3.24-7.42,7.52s3.13,7.52,7.42,7.52,7.42-3.24,7.42-7.52-3.13-7.52-7.42-7.52ZM811.7,119.54c-3.66,0-6.27-2.72-6.27-6.37s2.61-6.37,6.27-6.37,6.27,2.72,6.27,6.37-2.61,6.37-6.27,6.37Z`}),(0,F.jsx)(`path`,{d:`M814.94,111.81c0-1.46-1.15-2.61-2.82-2.61h-3.34v7.83h1.15v-2.72h1.04l2.72,2.72h1.46l-2.72-2.72c1.46-.1,2.51-1.15,2.51-2.51ZM809.93,113.17v-2.82h2.19c1.04,0,1.67.63,1.67,1.46s-.52,1.36-1.67,1.36h-2.19Z`})]})]}),(0,F.jsx)(`div`,{className:`text-ink-muted text-[10px] tracking-wide mb-6`,children:`local · single-user`}),(0,F.jsx)(`div`,{className:`text-[10px] font-medium text-ink-muted uppercase tracking-wider mb-2 px-2`,children:`Observe`}),(0,F.jsx)(`nav`,{"aria-label":`Observe`,className:`flex flex-col gap-0.5 mb-4`,children:Br.map(e=>c(e))}),(0,F.jsx)(`div`,{className:`text-[10px] font-medium text-ink-muted uppercase tracking-wider mb-2 px-2`,children:`Analyze`}),(0,F.jsx)(`nav`,{"aria-label":`Analyze`,className:`flex flex-col gap-0.5 mb-4`,children:Vr.map(e=>c(e))}),(0,F.jsx)(`div`,{className:`text-[10px] font-medium text-ink-muted uppercase tracking-wider mb-2 px-2`,children:`Configure`}),(0,F.jsx)(`nav`,{"aria-label":`Configure`,className:`flex flex-col gap-0.5`,children:Hr.map(e=>c(e))}),(0,F.jsxs)(`div`,{className:`mt-auto`,children:[(0,F.jsxs)(`a`,{href:`https://newrelic.com/platform/ai-observability`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 px-2.5 py-2 rounded-md text-ink-subtle border border-accent-green/20 bg-accent-green/5 hover:bg-accent-green/10 hover:border-accent-green/50 hover:text-ink-base hover:shadow-[0_0_8px_rgba(28,231,131,0.35),0_0_20px_rgba(28,231,131,0.15)] transition-all duration-300 group/cta mb-2`,children:[(0,F.jsxs)(`svg`,{width:`11`,height:`13`,viewBox:`0 0 138 160`,fill:`currentColor`,"aria-hidden":`true`,className:`flex-shrink-0 text-accent-green opacity-75 group-hover/cta:opacity-100 transition-opacity`,children:[(0,F.jsx)(`polygon`,{points:`68.85 .18 8.05 35.28 34.54 50.57 68.85 30.76 111.21 55.22 111.21 104.14 76.9 123.95 76.9 154.53 137.7 119.43 137.7 39.93 68.85 .18`}),(0,F.jsx)(`polygon`,{points:`42.36 94.97 42.36 143.89 68.85 159.18 68.85 79.68 0 39.93 0 70.51 42.36 94.97`})]}),(0,F.jsx)(`span`,{className:`text-xs flex-1 leading-tight`,children:`Try AI Observability`}),(0,F.jsxs)(`svg`,{width:`8`,height:`8`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:`flex-shrink-0 opacity-50 group-hover/cta:opacity-80 transition-opacity`,children:[(0,F.jsx)(`polyline`,{points:`15 3 21 3 21 9`}),(0,F.jsx)(`line`,{x1:`10`,y1:`14`,x2:`21`,y2:`3`})]})]}),(0,F.jsx)(`div`,{className:`pt-3 border-t border-border-subtle`,children:(0,F.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1.5 rounded-md bg-surface-3 transition-colors duration-150`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`w-2 h-2 rounded-full ${n?`bg-accent-green animate-pulse`:`bg-accent-amber`}`}),(0,F.jsx)(`span`,{className:`text-[10px] text-ink-subtle tracking-wide`,children:n?`live`:`reconnecting`})]}),(0,F.jsx)(kr,{variant:`ghost`,size:`sm`,onClick:i,"aria-label":r===`dark`?`Switch to light mode`:`Switch to dark mode`,className:`px-1 py-1`,children:r===`dark`?(0,F.jsx)(Sn,{size:12}):(0,F.jsx)(yn,{size:12})})]})}),s.installed!==null&&(0,F.jsxs)(`div`,{className:`mt-2 px-2 flex items-center gap-1.5`,children:[(0,F.jsxs)(`span`,{className:`text-[10px] text-ink-muted`,children:[`v`,s.installed]}),(0,F.jsx)(`span`,{className:`text-[10px] text-ink-muted`,"aria-hidden":`true`,children:`·`}),(0,F.jsxs)(`a`,{href:`https://github.com/newrelic-experimental/preflight`,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`View Preflight on GitHub`,className:`text-[10px] text-ink-subtle hover:text-ink-base transition-colors duration-150 flex items-center gap-0.5`,children:[`GitHub`,(0,F.jsx)(_n,{size:8,"aria-hidden":`true`})]})]}),s.updateAvailable&&s.latest!==null&&(0,F.jsx)(`div`,{className:`mt-0.5 px-2`,children:(0,F.jsxs)(`span`,{className:`text-[10px] text-accent-amber`,children:[`v`,s.latest,` available`]})})]})]})}function Gr(e,t=.8,n=.5){return e===null?`text-ink-muted`:e>=t?`text-accent-green`:e>=n?`text-accent-amber`:`text-accent-red`}function Kr(e){return e>=.8?`text-accent-cyan`:e>=.5?`text-accent-amber`:`text-accent-red`}function qr(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function Jr(e){return new Date(e).toLocaleString(void 0,{hour:`numeric`,minute:`2-digit`})}function Yr(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}function Xr(e){let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60){let e=t%60;return e>0?`${n}m ${e}s`:`${n}m`}let r=Math.floor(n/60);if(r<24){let e=n%60;return e>0?`${r}h ${e}m`:`${r}h`}let i=Math.floor(r/24),a=r%24;return a>0?`${i}d ${a}h`:`${i}d`}function Zr(e){return Number.isFinite(e)?Math.abs(e)>=100?e.toFixed(0):Math.abs(e)>=10?e.toFixed(1):Number.isInteger(e)?String(e):e.toFixed(2):`—`}function Qr(e){let t=e.split(`__`);return t.length>=3&&t[0]===`mcp`?t.slice(2).join(`__`):e}var $r={info:`bg-surface-3 border-surface-8`,warning:`bg-accent-amber/5 border-accent-amber/40`,critical:`bg-accent-red/5 border-accent-red/50`},ei={info:`text-ink-muted`,warning:`text-accent-amber`,critical:`text-accent-red`},ti={info:`INFO`,warning:`WARN`,critical:`CRIT`};function ni(e){return e===`critical`?`alert`:`status`}function ri({alert:e,onDismiss:t}){let n=n=>{n.key===`Escape`&&(n.preventDefault(),t(e.id))},r=`alert-title-${String(e.id).replace(/[^a-zA-Z0-9-_]/g,`_`)}`;return(0,F.jsxs)(`div`,{role:ni(e.severity),"aria-labelledby":r,tabIndex:0,"data-alert-id":e.id,"data-severity":e.severity,onKeyDown:n,className:`flex items-center gap-3 px-3 py-2 border-b text-xs focus:outline-none focus:ring-2 focus:ring-accent-cyan/40 ${$r[e.severity]}`,children:[(0,F.jsxs)(`span`,{"aria-hidden":`true`,className:`shrink-0 font-semibold tracking-wider ${ei[e.severity]}`,children:[`● `,ti[e.severity]]}),(0,F.jsx)(`span`,{id:r,className:`font-medium text-ink-base shrink-0`,children:e.title}),(0,F.jsx)(`span`,{className:`text-ink-muted truncate`,children:e.description}),(0,F.jsxs)(`span`,{className:`ml-auto shrink-0 text-ink-subtle tabular-nums whitespace-nowrap`,children:[Zr(e.value),` / `,Zr(e.threshold)]}),(0,F.jsx)(`button`,{type:`button`,"aria-label":`Dismiss alert`,onClick:()=>t(e.id),className:`shrink-0 ml-1 p-1 rounded-md text-ink-subtle hover:text-ink-base hover:bg-surface-5 transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-accent-cyan/50`,children:(0,F.jsx)(wn,{size:14,"aria-hidden":`true`,focusable:`false`})})]})}var ii=5,ai={info:`text-ink-muted`,warning:`text-accent-amber`,critical:`text-accent-red`},oi={info:`border-bg-line`,warning:`border-accent-amber/50`,critical:`border-accent-red/60`};function si(){let{alerts:e,maxSeverity:t,count:n,dismiss:r}=Un(),[i,a]=(0,P.useState)(!1);if((0,P.useEffect)(()=>{n<ii&&a(!1)},[n]),n===0)return null;let o=n>=ii&&!i,s=t??`info`;return o?(0,F.jsx)(`div`,{className:`bg-bg-panel border-b`,"data-collapsed-stack":`true`,children:(0,F.jsxs)(`button`,{type:`button`,onClick:()=>a(!0),"aria-expanded":`false`,"aria-label":`${n} alerts firing — expand`,className:`w-full flex items-center gap-2 px-3 py-2 text-xs text-left border-b ${oi[s]} transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-accent-cyan/50`,children:[(0,F.jsx)(hn,{size:14,"aria-hidden":`true`,focusable:`false`}),(0,F.jsxs)(`span`,{className:`font-semibold ${ai[s]}`,children:[`● `,n,` alerts firing`]}),(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`— click to expand`})]})}):(0,F.jsxs)(`div`,{"data-stack":`true`,children:[n>=ii&&(0,F.jsxs)(`button`,{type:`button`,onClick:()=>a(!1),"aria-expanded":`true`,"aria-label":`${n} alerts firing — collapse`,className:`w-full flex items-center gap-2 px-3 py-2 text-xs text-left bg-bg-panel border-b ${oi[s]} transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-accent-cyan/50`,children:[(0,F.jsx)(mn,{size:14,"aria-hidden":`true`,focusable:`false`}),(0,F.jsxs)(`span`,{className:`font-semibold ${ai[s]}`,children:[`● `,n,` alerts firing`]}),(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`— click to collapse`})]}),e.map(e=>(0,F.jsx)(ri,{alert:e,onDismiss:r},e.id))]})}var ci=class extends P.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`ErrorBoundary caught a render error`,{error:e,info:t})}componentDidUpdate(e){this.state.error&&e.resetKey!==this.props.resetKey&&this.setState({error:null})}handleReload=()=>{window.location.reload()};handleDismiss=()=>{this.setState({error:null})};render(){let{error:e}=this.state;return e?(0,F.jsx)(`div`,{role:`alert`,className:`flex justify-center p-8`,children:(0,F.jsx)(`div`,{className:`max-w-2xl w-full`,children:(0,F.jsxs)(R,{padding:`lg`,tone:`danger`,className:`space-y-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-accent-red font-semibold uppercase text-xs tracking-wider mb-1`,children:`Render error`}),(0,F.jsx)(`div`,{className:`text-ink-base text-base font-mono break-all`,children:e.message})]}),(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[(0,F.jsx)(kr,{variant:`secondary`,size:`md`,onClick:this.handleReload,children:`Reload page`}),(0,F.jsx)(kr,{variant:`ghost`,size:`md`,onClick:this.handleDismiss,children:`Dismiss`})]}),e.stack&&(0,F.jsxs)(`details`,{className:`text-xs text-ink-muted`,children:[(0,F.jsx)(`summary`,{className:`cursor-pointer select-none`,children:`Stack trace`}),(0,F.jsx)(`pre`,{className:`mt-2 p-2 bg-bg-line/30 rounded overflow-x-auto whitespace-pre-wrap break-all`,children:e.stack})]})]})})}):this.props.children}},li=[{keys:[`?`],description:`Show this help`},{keys:[`t`],description:`Toggle light/dark mode`},{keys:[`g`,`h`],description:`Go to Today`},{keys:[`g`,`s`],description:`Go to Sessions`},{keys:[`g`,`i`],description:`Go to History`},{keys:[`g`,`a`],description:`Go to Audit`},{keys:[`g`,`v`],description:`Go to Git Efficiency`},{keys:[`g`,`e`],description:`Go to Settings`},{keys:[`g`,`l`],description:`Go to Alerts`},{keys:[`Esc`],description:`Close overlay`}];function ui({open:e,onClose:t}){return(0,P.useEffect)(()=>{if(!e)return;function n(e){e.key===`Escape`&&(e.preventDefault(),t())}return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e,t]),e?(0,F.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:t,children:(0,F.jsxs)(`div`,{className:`glass-card animate-overlay-enter max-w-sm w-full mx-4 p-5`,onClick:e=>e.stopPropagation(),children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,F.jsx)(`h2`,{className:`text-sm font-semibold text-ink-base`,children:`Keyboard Shortcuts`}),(0,F.jsx)(kr,{variant:`ghost`,size:`sm`,onClick:t,"aria-label":`Close keyboard shortcuts`,className:`px-1 py-1`,children:(0,F.jsx)(wn,{size:16})})]}),(0,F.jsx)(`div`,{className:`space-y-2`,children:li.map(e=>(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,F.jsx)(`span`,{className:`text-ink-subtle`,children:e.description}),(0,F.jsx)(`span`,{className:`flex gap-1`,children:e.keys.map(e=>(0,F.jsx)(`kbd`,{className:`inline-block px-1.5 py-0.5 text-[11px] font-mono bg-bg-elevated rounded-md border border-border-subtle text-ink-base`,children:e},e))})]},e.description))})]})}):null}var di=75e3,fi=1e4;function pi(e){let t=zn.getState();fetch(`/api/session/current`,{signal:e}).then(e=>e.ok?e.json():null).then(e=>{if(e?.toolCallTimeline)for(let n of e.toolCallTimeline)t.pushToolCall({id:`${n.timestamp}-${n.toolName}`,tool:n.toolName,durationMs:n.durationMs??0,costUsd:0,ts:n.timestamp,sessionId:e.sessionId})}).catch(()=>{}),fetch(`/api/anti-patterns`,{signal:e}).then(e=>e.ok?e.json():null).then(e=>{if(Array.isArray(e))for(let n of e)n&&typeof n==`object`&&`type`in n&&t.pushAntiPattern(n)}).catch(()=>{})}function mi(e=`/sse`){(0,P.useEffect)(()=>{let t=new AbortController;pi(t.signal);let n=Date.now(),r=null,i=()=>{r||t.signal.aborted||(r=new EventSource(e),r.onopen=()=>{n=Date.now(),zn.getState().setConnected(!0)},r.onerror=()=>zn.getState().setConnected(!1),r.addEventListener(`tool-call`,a),r.addEventListener(`cost-update`,o),r.addEventListener(`anti-pattern`,s),r.addEventListener(`alert`,c),r.addEventListener(`context-update`,l),r.addEventListener(`heartbeat`,u))},a=e=>{try{zn.getState().pushToolCall(JSON.parse(e.data))}catch{}},o=e=>{try{zn.getState().setCost(JSON.parse(e.data))}catch{}},s=e=>{try{zn.getState().pushAntiPattern(JSON.parse(e.data))}catch{}},c=e=>{try{zn.getState().addOrUpdateAlert(JSON.parse(e.data))}catch{}},l=e=>{try{zn.getState().setContext(JSON.parse(e.data))}catch{}},u=()=>{n=Date.now();let e=zn.getState();e.connected||e.setConnected(!0)};typeof document<`u`&&document.readyState===`complete`?i():typeof window<`u`?window.addEventListener(`load`,i,{once:!0}):i();let d=setInterval(()=>{if(Date.now()-n>di){let e=zn.getState();e.connected&&e.setConnected(!1)}},fi);return()=>{t.abort(),clearInterval(d),typeof window<`u`&&window.removeEventListener(`load`,i),r&&(r.removeEventListener(`tool-call`,a),r.removeEventListener(`cost-update`,o),r.removeEventListener(`anti-pattern`,s),r.removeEventListener(`alert`,c),r.removeEventListener(`context-update`,l),r.removeEventListener(`heartbeat`,u),r.close())}},[e])}function hi({navigate:e,onToggleHelp:t,onToggleTheme:n}){let r=(0,P.useRef)(null),i=(0,P.useRef)(null);(0,P.useEffect)(()=>{function a(a){let o=a.target?.tagName;if(o===`INPUT`||o===`TEXTAREA`||o===`SELECT`||a.target?.isContentEditable||a.metaKey||a.ctrlKey||a.altKey)return;let s=a.key;if(r.current===`g`){if(s===`g`){i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=null},500);return}r.current=null,i.current&&=(clearTimeout(i.current),null);let t={h:`/`,s:`/sessions`,i:`/history`,a:`/audit`,v:`/git`,e:`/settings`,l:`/alerts`};t[s]&&(a.preventDefault(),e(t[s]));return}if(s===`g`){r.current=`g`,i.current=setTimeout(()=>{r.current=null},500);return}s===`?`&&(a.preventDefault(),t()),s===`t`&&n&&(a.preventDefault(),n())}return document.addEventListener(`keydown`,a),()=>{document.removeEventListener(`keydown`,a),i.current&&clearTimeout(i.current)}},[e,t,n])}var gi=`preflight-theme`;function _i(){try{let e=localStorage.getItem(gi);if(e===`light`||e===`dark`)return e}catch{}try{if(window.matchMedia(`(prefers-color-scheme: light)`).matches)return`light`}catch{}return`dark`}function vi(e){document.documentElement.classList.toggle(`light`,e===`light`)}function yi(){let[e,t]=(0,P.useState)(_i),n=(0,P.useRef)(!1);return(0,P.useLayoutEffect)(()=>{vi(e)},[e]),(0,P.useEffect)(()=>{if(!n.current){n.current=!0;return}try{localStorage.setItem(gi,e)}catch{}},[e]),{theme:e,toggleTheme:(0,P.useCallback)(()=>{t(e=>e===`dark`?`light`:`dark`)},[])}}function bi(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function xi(e,t={}){let{duration:n=800,decimals:r=0,enabled:i=!0}=t,a=i&&bi(),[o,s]=(0,P.useState)(()=>a?0:e),c=(0,P.useRef)(0);return(0,P.useEffect)(()=>{if(!a){s(e);return}let t=performance.now();function r(i){let a=i-t,o=Math.min(a/n,1);s((1-(1-o)**3)*e),o<1&&(c.current=requestAnimationFrame(r))}return c.current=requestAnimationFrame(r),()=>{c.current&&cancelAnimationFrame(c.current)}},[e,n,a]),o.toFixed(r)}var Si={neutral:`text-ink-base`,good:`text-accent-green`,warn:`text-accent-amber`,bad:`text-accent-red`,accent:`text-accent-green`};function B({label:e,value:t,sub:n,tone:r=`neutral`,hero:i=!1,animate:a=!1,numericValue:o,prefix:s=``,suffix:c=``,decimals:l=0}){let u=xi(o??0,{decimals:l,enabled:a&&o!==void 0}),d=a&&o!==void 0?`${s}${u}${c}`:t,f=i?`text-3xl font-bold mt-1 tabular-nums gradient-text`:`text-3xl font-bold mt-1 tabular-nums ${Si[r]}`;return(0,F.jsxs)(`div`,{className:`px-1`,children:[(0,F.jsx)(`div`,{className:`text-[10px] text-ink-muted uppercase tracking-wider font-medium`,children:e}),(0,F.jsx)(`div`,{className:f,children:d}),n&&(0,F.jsx)(`div`,{className:`text-[10px] text-ink-muted mt-0.5`,children:n})]})}function Ci({children:e,index:t=0,className:n=``}){let r=`${t*120}ms`;return(0,F.jsx)(`div`,{className:`animate-card-enter ${n}`,style:{animationDelay:r},children:e})}var wi=6,Ti=5,Ei=[.01,.02,.05,.1,.25,.5,1,2,5,10,25,50,100,250,500,1e3];function Di(e){if(e<=0)return .01;for(let t of Ei)if(t>=e)return t;return Ei[Ei.length-1]}function Oi(e){return e===0?`12am`:e<12?`${e}am`:e===12?`12pm`:`${e-12}pm`}function ki(e){let t=e.reduce((e,t)=>e+t.cost,0),n=e.reduce((e,t)=>Math.max(e,t.cost),0),r=e.find(e=>e.cost===n);return`Hourly spend today: $${t.toFixed(2)} total, peak $${n.toFixed(2)} at ${Oi(r.hour)}`}function Ai({hours:e,formatValue:t,ariaLabel:n}){let[r,i]=(0,P.useState)(null),a=e.reduce((e,t)=>Math.max(e,t.cost),0);if(a===0)return null;let o=Di(a/Ti),s=e.map(e=>Math.max(0,Math.round(e.cost/o))),c=s.reduce((e,t)=>Math.max(e,t),0);if(c===0)return null;let l=c*7,u=t??(e=>`$${e.toFixed(2)}`),d=n??ki(e),f=r===null?null:e[r],p=f?`${Oi(f.hour)}: ${u(f.cost)} (start hour)`:``,m=r===null?0:(r+.5)/e.length*100;return(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(`div`,{role:`img`,"aria-label":d,className:`flex w-full`,style:{height:l},onMouseLeave:()=>i(null),children:e.map((e,t)=>{let n=s[t],r=e.cost>0&&e.cost===a,o=[];for(let e=0;e<n;e++)o.push((0,F.jsx)(`span`,{className:`absolute rounded-sm heatmap-cell`,style:{bottom:e*7,left:`50%`,marginLeft:-6/2,width:wi,height:wi,backgroundColor:r?`var(--color-chart-block-peak)`:`var(--color-chart-block)`,animationDelay:`${t*12+e*6}ms`}},e));return(0,F.jsx)(`div`,{className:`relative flex-1 h-full`,onMouseEnter:()=>i(t),children:o},t)})}),f&&(0,F.jsx)(`div`,{className:`absolute -top-7 px-1.5 py-0.5 bg-bg-elevated border border-border-subtle text-[10px] text-ink-base rounded-md shadow-md pointer-events-none whitespace-nowrap tabular-nums`,style:{left:`${m}%`,transform:`translateX(-50%)`},role:`tooltip`,children:p})]})}function ji(){return(0,F.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,F.jsx)(`circle`,{cx:`24`,cy:`24`,r:`20`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,F.jsx)(`circle`,{cx:`24`,cy:`24`,r:`13`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,F.jsx)(`circle`,{cx:`24`,cy:`24`,r:`6`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,F.jsx)(`line`,{x1:`24`,y1:`24`,x2:`24`,y2:`4`,stroke:`var(--color-accent-green)`,strokeWidth:`1.5`,strokeLinecap:`round`,className:`animate-radar-sweep`}),(0,F.jsx)(`circle`,{cx:`24`,cy:`24`,r:`2`,fill:`var(--color-accent-green)`})]})}function Mi(){return(0,F.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,F.jsx)(`path`,{d:`M16 14 L6 24 L16 34`,stroke:`var(--color-ink-muted)`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,F.jsx)(`path`,{d:`M32 14 L42 24 L32 34`,stroke:`var(--color-ink-muted)`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,F.jsx)(`line`,{x1:`24`,y1:`18`,x2:`24`,y2:`30`,stroke:`var(--color-accent-green)`,strokeWidth:`2`,strokeLinecap:`round`,opacity:`0.8`})]})}function V(){return(0,F.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,F.jsx)(`line`,{x1:`4`,y1:`24`,x2:`44`,y2:`24`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.4`}),(0,F.jsx)(`circle`,{cx:`12`,cy:`24`,r:`3`,stroke:`var(--color-ink-muted)`,strokeWidth:`1.5`}),(0,F.jsx)(`circle`,{cx:`24`,cy:`24`,r:`3`,stroke:`var(--color-accent-green)`,strokeWidth:`1.5`}),(0,F.jsx)(`circle`,{cx:`36`,cy:`24`,r:`3`,stroke:`var(--color-ink-muted)`,strokeWidth:`1.5`}),(0,F.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12`,y2:`20`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,strokeLinecap:`round`,opacity:`0.5`}),(0,F.jsx)(`line`,{x1:`24`,y1:`16`,x2:`24`,y2:`20`,stroke:`var(--color-accent-green)`,strokeWidth:`1`,strokeLinecap:`round`,opacity:`0.7`}),(0,F.jsx)(`line`,{x1:`36`,y1:`16`,x2:`36`,y2:`20`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,strokeLinecap:`round`,opacity:`0.5`})]})}function Ni(){return(0,F.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,F.jsx)(`circle`,{cx:`24`,cy:`24`,r:`18`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,F.jsx)(`path`,{d:`M16 24 L22 30 L34 18`,stroke:`var(--color-accent-green)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function Pi(){return(0,F.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,F.jsx)(`circle`,{cx:`24`,cy:`24`,r:`18`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,F.jsx)(`path`,{d:`M24 14 L24 24 L31 28`,stroke:`var(--color-ink-subtle)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}var Fi={radar:ji,code:Mi,timeline:V,checkmark:Ni,clock:Pi};function Ii(){return(0,F.jsx)(`div`,{className:`flex items-center justify-center`,style:{width:48,height:48},"aria-hidden":`true`,children:(0,F.jsx)(`span`,{className:`rounded-full animate-pulse`,style:{width:10,height:10,backgroundColor:`var(--color-accent-green)`,boxShadow:`0 0 0 4px color-mix(in srgb, var(--color-accent-green) 15%, transparent)`}})})}function Li({icon:e,title:t,subtitle:n,variant:r=`empty`}){let i=e===void 0?void 0:Fi[e];return(0,F.jsxs)(`div`,{className:`py-8 flex flex-col items-center justify-center gap-3`,children:[r===`loading`?(0,F.jsx)(Ii,{}):i&&(0,F.jsx)(i,{}),(0,F.jsx)(`span`,{className:`text-sm font-medium text-ink-subtle`,children:t}),n&&(0,F.jsx)(`span`,{className:`text-xs text-ink-muted text-center max-w-[240px]`,children:n})]})}function Ri(e){return e===`Read`?`bg-accent-blue`:e===`Edit`||e===`Write`?`bg-accent-green`:e===`Bash`?`bg-accent-purple`:e===`Agent`?`bg-accent-teal`:`bg-ink-subtle`}var zi={thrashing:`Edit/Test Thrashing`,stuck_loop:`Stuck Loop`,blind_editing:`Blind Editing`,re_reading:`Repeated Reads`};function Bi(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}function Vi({entries:e,segments:t}){let[n,r]=(0,P.useState)(null);if(e.length===0)return(0,F.jsx)(`div`,{className:`text-ink-muted text-xs`,children:`No tool calls recorded.`});let i=e.map((e,t)=>({entry:e,originalIdx:t})).sort((e,t)=>e.entry.timestamp-t.entry.timestamp),a=i[0].entry.timestamp,o=i.reduce((e,{entry:t})=>Math.max(e,t.timestamp+(t.durationMs??50)),0),s=Math.max(o-a,1),c=[1e4,3e4,6e4,12e4,3e5,6e5,9e5,18e5].find(e=>s/e<=8)??Math.ceil(s/8),l=[];for(let e=c;e<s;e+=c)l.push(e);let u=Array(i.length).fill(null),d=new Map;for(let e=0;e<i.length;e++)d.set(i[e].originalIdx,e);for(let n of t){let t=Math.max(0,n.startIndex),r=Math.min(n.endIndex,e.length-1);for(let e=t;e<=r;e++){let t=d.get(e);t!==void 0&&(u[t]===null||n.severity===`critical`&&u[t].severity!==`critical`)&&(u[t]=n)}}let f=Math.min(30,800/Math.max(e.length,1));return(0,F.jsxs)(`div`,{className:`p-2 overflow-x-hidden`,children:[(0,F.jsxs)(`div`,{className:`flex`,children:[(0,F.jsx)(`div`,{className:`w-20 shrink-0`}),(0,F.jsx)(`div`,{className:`relative flex-1 h-5 border-b border-bg-line overflow-x-auto`,children:l.map(e=>(0,F.jsx)(`span`,{className:`absolute top-0 text-[9px] text-ink-muted tabular-nums -translate-x-1/2`,style:{left:`${e/s*100}%`},children:Bi(e)},e))})]}),(0,F.jsx)(`div`,{className:`mt-1`,children:i.map(({entry:e,originalIdx:t},o)=>{let c=e.timestamp-a,l=e.durationMs??50,d=c/s*100,p=l/s*100,m=u[o];return(0,F.jsxs)(`div`,{className:`flex items-center h-7 ${m?m.severity===`critical`?`border-l-2 border-l-accent-red`:`border-l-2 border-l-accent-amber`:`border-l-2 border-l-transparent`}`,children:[(0,F.jsx)(`div`,{className:`w-20 shrink-0 truncate text-[11px] text-ink-subtle pr-2 text-right`,title:e.toolName,children:Qr(e.toolName)}),(0,F.jsxs)(`div`,{className:`relative flex-1 h-full flex items-center`,children:[(0,F.jsx)(`div`,{className:`gantt-bar absolute h-5 rounded-sm opacity-80 ${Ri(Qr(e.toolName))} ${e.success?``:`ring-1 ring-accent-red/60`}`,style:{left:`${d}%`,width:`${p}%`,minWidth:`4px`,animationDelay:`${Math.round(o*f)}ms`},onMouseEnter:()=>r(o),onMouseLeave:()=>r(null)}),n===o&&(0,F.jsxs)(`div`,{className:`absolute z-50 px-2 py-1.5 rounded-lg bg-bg-elevated border border-bg-line text-[11px] text-ink-base shadow-lg whitespace-nowrap pointer-events-none ${o>=3&&o>i.length-4?`bottom-full mb-1`:`top-full mt-1`}`,style:d>=50?{right:`${Math.max(0,100-d-p)}%`}:{left:`${d}%`},children:[(0,F.jsx)(`div`,{className:`font-medium`,children:e.toolName}),(e.filePath??e.command)&&(0,F.jsx)(`div`,{className:`text-ink-subtle truncate max-w-[200px]`,children:e.filePath??e.command}),(0,F.jsxs)(`div`,{className:`text-ink-muted`,children:[e.durationMs==null?`unknown`:`${e.durationMs}ms`,` ·`,` `,e.success?`success`:`failed`]}),m&&(0,F.jsx)(`div`,{className:`mt-0.5 font-medium ${m.severity===`critical`?`text-accent-red`:`text-accent-amber`}`,children:zi[m.type]??m.type})]})]})]},`${t}-${e.timestamp}`)})})]})}var Hi=`var(--color-chart-block)`,Ui=`var(--color-chart-block-peak)`,Wi=10,Gi=13;function Ki({data:e,maxCount:t,ariaLabel:n}){let r=(0,P.useRef)(null),[i,a]=(0,P.useState)(null);if(e.length===0||e.every(e=>e.count===0))return null;let o=Math.max(t??0,...e.map(e=>e.count),1),s=o*12;return(0,F.jsxs)(`div`,{ref:r,className:`relative`,children:[(0,F.jsx)(`svg`,{width:`100%`,height:s,role:`img`,"aria-label":n,viewBox:`0 0 ${e.length*Gi} ${s}`,preserveAspectRatio:`xMidYMax meet`,onMouseLeave:()=>a(null),children:e.map((e,t)=>{let n=[];for(let r=0;r<e.count;r++){let i=e.count===o;n.push((0,F.jsx)(`rect`,{x:t*Gi,y:s-(r+1)*12,width:Wi,height:Wi,rx:1,fill:i?Ui:Hi,className:`heatmap-cell`,style:{animationDelay:`${t*20+r*10}ms`}},`${t}-${r}`))}return(0,F.jsxs)(`g`,{onMouseEnter:t=>{let n=r.current;if(!n)return;let i=n.getBoundingClientRect(),o=t.currentTarget,s=o.querySelectorAll(`rect.heatmap-cell`),c=(s[s.length-1]??o).getBoundingClientRect();a({x:c.left-i.left+c.width/2,y:c.top-i.top,text:e.tooltip})},children:[(0,F.jsx)(`rect`,{x:t*Gi,y:0,width:Gi,height:s,fill:`transparent`}),n]},t)})}),i&&(0,F.jsx)(`div`,{className:`absolute px-1.5 py-0.5 bg-bg-elevated border border-border-subtle text-[10px] text-ink-base rounded-md shadow-md pointer-events-none whitespace-nowrap tabular-nums`,style:{left:i.x,top:i.y,transform:`translate(-50%, calc(-100% - 4px))`},children:i.text})]})}var qi=`nr-observe-peak-concurrent`;function Ji({current:e,peak:t,allTimePeak:n,buckets:r}){let[i,a]=(0,P.useState)(!1),o=(0,P.useRef)(null),s=r.some(e=>e.count>0);(0,P.useEffect)(()=>{let e=n??t;if(e<=0)return;let r=parseInt(localStorage.getItem(qi)??`0`,10);if(o.current===null&&(o.current=r),e>o.current){localStorage.setItem(qi,String(e)),o.current=e,a(!0);let t=setTimeout(()=>a(!1),3e3);return()=>clearTimeout(t)}},[t,n]);let c=r.map(e=>{let t=new Date(e.timestamp).toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`});return{count:e.count,tooltip:`${t} — ${e.count} concurrent`}});return(0,F.jsxs)(R,{padding:`sm`,className:`relative overflow-hidden${i?` new-peak-glow`:``}`,children:[i&&(0,F.jsx)(Yi,{}),(0,F.jsx)(z,{className:`mb-1.5`,children:`Concurrent Sessions`}),(0,F.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,F.jsx)(`span`,{className:`text-lg font-semibold text-accent-teal tabular-nums`,children:e}),(0,F.jsxs)(`span`,{className:`text-xs text-ink-muted tabular-nums`,children:[`today peak `,t,n&&n>t?` · all-time ${n}`:``]}),i&&(0,F.jsx)(`span`,{className:`text-[10px] text-accent-green font-semibold animate-bounce`,children:`NEW RECORD!`})]}),s&&(0,F.jsx)(`div`,{className:`mt-2`,children:(0,F.jsx)(Ki,{data:c,ariaLabel:`Concurrency over time, peak ${t}`})})]})}function Yi(){return(0,F.jsx)(F.Fragment,{children:Array.from({length:12},(e,t)=>{let n=t/12*360,r=40+Math.random()*30;return(0,F.jsx)(`span`,{className:`absolute w-1.5 h-1.5 rounded-full`,style:{left:`50%`,top:`50%`,backgroundColor:t%3==0?`#1CE783`:t%3==1?`#00D4AA`:`#9945FF`,animation:`particle-burst 1s ease-out forwards`,animationDelay:`${t*40}ms`,transform:`translate(-50%, -50%) rotate(${n}deg) translateY(-${r}px)`,opacity:0}},t)})})}var Xi=5,Zi=[`var(--color-heatmap-0)`,`var(--color-heatmap-1)`,`var(--color-heatmap-2)`,`var(--color-heatmap-3)`,`var(--color-heatmap-4)`];function Qi(e,t){if(e===0)return Zi[0];let n=e/t;return Zi[Math.min(Math.ceil(n*(Xi-1)),Xi-1)]}function $i(e,t,n){let r=e+n*t;return new Date(r).toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})}function ea({variant:e,buckets:t,maxCount:n,bucketSizeMs:r,startTimestamp:i,width:a,height:o,ariaLabel:s,days:c}){return e===`grid`&&c?(0,F.jsx)(ra,{days:c,maxCount:n,width:a,height:o,ariaLabel:s}):(0,F.jsx)(ta,{buckets:t,maxCount:n,bucketSizeMs:r,startTimestamp:i,width:a,height:o,ariaLabel:s})}function ta({buckets:e,maxCount:t,bucketSizeMs:n=9e5,startTimestamp:r=0,width:i,height:a=24,ariaLabel:o}){let[s,c]=(0,P.useState)(null),l=Math.max(4,Math.min(12,i?(i-e.length*1)/e.length:8)),u=i??e.length*(l+1);return(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(`svg`,{width:u,height:a,role:`img`,"aria-label":o??`Activity heatmap: ${e.length} time buckets`,className:`w-full`,style:{maxWidth:u},viewBox:`0 0 ${u} ${a}`,preserveAspectRatio:`none`,onMouseLeave:()=>c(null),children:e.map((e,i)=>(0,F.jsx)(`rect`,{x:i*(l+1),y:0,width:l,height:a,rx:2,fill:Qi(e,t),className:`heatmap-cell`,style:{animationDelay:`${Math.min(i*8,400)}ms`},onMouseEnter:t=>{let a=$i(r,n,i);c({x:t.currentTarget.x.baseVal.value,text:`${a}: ${e} calls`})}},i))}),s&&(0,F.jsx)(`div`,{className:`absolute -top-7 px-1.5 py-0.5 bg-bg-elevated border border-border-subtle text-[10px] text-ink-base rounded-md shadow-md pointer-events-none whitespace-nowrap tabular-nums`,style:{left:s.x},children:s.text})]})}var na=[`Mon`,``,`Wed`,``,`Fri`,``,`Sun`];function ra({days:e,maxCount:t,ariaLabel:n}){let[r,i]=(0,P.useState)(null),a=(0,P.useMemo)(()=>{if(e.length===0)return{weeks:0,cells:[]};let t=(new Date(e[0].date).getUTCDay()+6)%7,n=[];for(let r=0;r<e.length;r++){let i=r+t,a=i%7,o=Math.floor(i/7);n.push({...e[r],row:a,col:o})}return{weeks:n.length>0?n[n.length-1].col+1:0,cells:n}},[e]),o=28+a.weeks*12,s=(0,P.useMemo)(()=>{let e=[],t=``;for(let n of a.cells){if(n.row!==0)continue;let r=new Date(n.date).toLocaleString(void 0,{month:`short`,timeZone:`UTC`});r!==t&&(e.push({text:r,col:n.col}),t=r)}return e},[a.cells]);return(0,F.jsxs)(`div`,{className:`relative flex justify-center`,children:[(0,F.jsxs)(`svg`,{width:`100%`,height:98,role:`img`,"aria-label":n??`Activity grid: ${e.length} days`,viewBox:`0 0 ${o} 98`,preserveAspectRatio:`xMidYMid meet`,onMouseLeave:()=>i(null),children:[na.map((e,t)=>e?(0,F.jsx)(`text`,{x:0,y:14+t*12+10-2,className:`fill-ink-muted`,fontSize:10,children:e},t):null),s.map(({text:e,col:t})=>(0,F.jsx)(`text`,{x:28+t*12,y:10,className:`fill-ink-muted`,fontSize:10,children:e},`${e}-${t}`)),a.cells.map((e,n)=>(0,F.jsx)(`rect`,{x:28+e.col*12,y:14+e.row*12,width:10,height:10,rx:2,fill:Qi(e.count,t),className:`heatmap-cell`,style:{animationDelay:`${Math.min(n*3,300)}ms`},onMouseEnter:t=>{let n=t.currentTarget;i({x:n.x.baseVal.value,y:n.y.baseVal.value-16,text:`${e.date}: ${e.count} calls`})}},n))]}),r&&(0,F.jsx)(`div`,{className:`absolute px-1.5 py-0.5 bg-bg-elevated border border-border-subtle text-[10px] text-ink-base rounded-md shadow-md pointer-events-none whitespace-nowrap tabular-nums`,style:{left:r.x,top:r.y},children:r.text}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1 mt-1.5 text-[10px] text-ink-muted`,children:[(0,F.jsx)(`span`,{children:`Less`}),Zi.map((e,t)=>(0,F.jsx)(`span`,{className:`inline-block w-2.5 h-2.5 rounded-sm`,style:{backgroundColor:e}},t)),(0,F.jsx)(`span`,{children:`More`})]})]})}function ia({theme:e=`observatory`}){return(0,F.jsxs)(`div`,{className:`geo-banner`,"aria-hidden":`true`,children:[e===`observatory`&&(0,F.jsx)(aa,{}),e===`sessions`&&(0,F.jsx)(oa,{}),e===`history`&&(0,F.jsx)(sa,{}),e===`audit`&&(0,F.jsx)(ca,{}),e===`git`&&(0,F.jsx)(la,{})]})}function aa(){return(0,F.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`obsSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:`#1a3a5c`}),(0,F.jsx)(`stop`,{offset:`40%`,stopColor:`#2d5a7b`}),(0,F.jsx)(`stop`,{offset:`70%`,stopColor:`#e8834a`}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:`#f4a261`})]})}),(0,F.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#obsSky)`}),(0,F.jsx)(`polygon`,{points:`0,80 0,45 80,38 160,48 240,30 340,42 420,25 500,38 580,32 660,40 740,28 800,35 800,80`,fill:`#1a3a5c`,opacity:`0.7`}),(0,F.jsx)(`polygon`,{points:`0,80 0,55 60,48 140,58 220,42 300,52 380,40 460,50 520,38 600,48 680,42 760,52 800,48 800,80`,fill:`#234e6f`}),(0,F.jsx)(`polygon`,{points:`0,80 0,62 100,58 200,65 300,55 400,60 500,54 600,62 700,56 800,60 800,80`,fill:`#2a6b4a`,opacity:`0.8`}),(0,F.jsx)(`circle`,{cx:`680`,cy:`28`,r:`14`,fill:`#f4a261`,opacity:`0.6`}),(0,F.jsx)(`circle`,{cx:`680`,cy:`28`,r:`8`,fill:`#ffd166`,opacity:`0.5`}),(0,F.jsx)(`ellipse`,{cx:`150`,cy:`56`,rx:`18`,ry:`10`,fill:`#1a3a5c`}),(0,F.jsx)(`line`,{x1:`150`,y1:`46`,x2:`172`,y2:`34`,stroke:`#5ce0d8`,strokeWidth:`1.5`,opacity:`0.8`})]})}function oa(){return(0,F.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`seaSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:`#4aa8c7`}),(0,F.jsx)(`stop`,{offset:`60%`,stopColor:`#3a8fb7`}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:`#2d7a9e`})]})}),(0,F.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#seaSky)`}),(0,F.jsx)(`polygon`,{points:`600,48 640,35 680,48`,fill:`#2d7a4a`,opacity:`0.4`}),(0,F.jsx)(`polygon`,{points:`700,50 730,40 760,50`,fill:`#3d9b5b`,opacity:`0.3`}),(0,F.jsx)(`polygon`,{points:`0,80 0,15 40,12 80,20 120,18 160,25 180,30 180,80`,fill:`#c05a3c`}),(0,F.jsx)(`polygon`,{points:`0,80 0,25 30,22 60,28 100,25 140,30 160,35 160,80`,fill:`#e8834a`,opacity:`0.6`}),(0,F.jsx)(`polygon`,{points:`20,20 35,8 50,20`,fill:`#3d9b5b`}),(0,F.jsx)(`polygon`,{points:`60,22 72,12 84,24`,fill:`#4aad6b`}),(0,F.jsx)(`polygon`,{points:`100,20 115,10 130,22`,fill:`#3d9b5b`}),(0,F.jsx)(`polygon`,{points:`140,28 150,18 160,28`,fill:`#4aad6b`,opacity:`0.8`}),(0,F.jsx)(`rect`,{x:`120`,y:`30`,width:`8`,height:`50`,fill:`#87ceeb`,opacity:`0.5`}),(0,F.jsx)(`rect`,{x:`122`,y:`30`,width:`4`,height:`50`,fill:`#fff`,opacity:`0.3`}),(0,F.jsx)(`polygon`,{points:`620,80 620,30 660,25 700,32 740,28 780,35 800,30 800,80`,fill:`#c05a3c`,opacity:`0.8`}),(0,F.jsx)(`polygon`,{points:`650,30 665,18 680,30`,fill:`#3d9b5b`}),(0,F.jsx)(`polygon`,{points:`720,32 732,22 744,32`,fill:`#4aad6b`}),(0,F.jsx)(`polygon`,{points:`180,80 180,55 250,52 350,56 450,52 550,55 620,52 620,80`,fill:`#2d7a9e`,opacity:`0.6`}),(0,F.jsx)(`line`,{x1:`200`,y1:`60`,x2:`280`,y2:`58`,stroke:`#5ce0d8`,strokeWidth:`0.8`,opacity:`0.3`}),(0,F.jsx)(`line`,{x1:`350`,y1:`56`,x2:`450`,y2:`55`,stroke:`#5ce0d8`,strokeWidth:`0.8`,opacity:`0.25`}),(0,F.jsx)(`line`,{x1:`480`,y1:`58`,x2:`580`,y2:`56`,stroke:`#87ceeb`,strokeWidth:`0.8`,opacity:`0.3`})]})}function sa(){return(0,F.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`histSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:`#3a7ca5`}),(0,F.jsx)(`stop`,{offset:`60%`,stopColor:`#5bb8d4`}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:`#8ed4c0`})]})}),(0,F.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#histSky)`}),(0,F.jsx)(`polygon`,{points:`100,50 140,20 180,50`,fill:`#e8834a`,opacity:`0.7`}),(0,F.jsx)(`polygon`,{points:`160,50 210,15 260,50`,fill:`#d4694a`,opacity:`0.6`}),(0,F.jsx)(`polygon`,{points:`550,50 600,18 650,50`,fill:`#e8834a`,opacity:`0.6`}),(0,F.jsx)(`polygon`,{points:`620,50 660,22 700,50`,fill:`#c05a3c`,opacity:`0.5`}),(0,F.jsx)(`polygon`,{points:`350,50 370,12 390,50`,fill:`#5ce0d8`,opacity:`0.4`}),(0,F.jsx)(`polygon`,{points:`380,50 395,20 410,50`,fill:`#87ceeb`,opacity:`0.3`}),(0,F.jsx)(`polygon`,{points:`700,50 715,25 730,50`,fill:`#5ce0d8`,opacity:`0.35`}),(0,F.jsx)(`polygon`,{points:`300,80 380,50 420,50 500,80`,fill:`#2a5a6b`,opacity:`0.6`}),(0,F.jsx)(`line`,{x1:`390`,y1:`52`,x2:`350`,y2:`78`,stroke:`#f4a261`,strokeWidth:`1`,opacity:`0.4`}),(0,F.jsx)(`line`,{x1:`410`,y1:`52`,x2:`450`,y2:`78`,stroke:`#f4a261`,strokeWidth:`1`,opacity:`0.4`}),(0,F.jsx)(`polygon`,{points:`0,80 0,55 80,52 160,58 240,50 320,55 500,52 580,56 660,50 740,55 800,52 800,80`,fill:`#2d8a4a`,opacity:`0.5`}),(0,F.jsx)(`polygon`,{points:`0,80 0,65 60,62 140,68 220,60 400,65 500,62 600,66 700,60 800,65 800,80`,fill:`#1e6b3a`,opacity:`0.6`}),(0,F.jsx)(`polygon`,{points:`30,65 42,42 54,65`,fill:`#3d9b5b`,opacity:`0.8`}),(0,F.jsx)(`polygon`,{points:`50,65 60,48 70,65`,fill:`#2d8a4a`,opacity:`0.7`}),(0,F.jsx)(`polygon`,{points:`720,65 732,45 744,65`,fill:`#3d9b5b`,opacity:`0.7`}),(0,F.jsx)(`polygon`,{points:`760,65 770,50 780,65`,fill:`#2d8a4a`,opacity:`0.8`})]})}function ca(){return(0,F.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`auditSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:`#1a5c3a`}),(0,F.jsx)(`stop`,{offset:`50%`,stopColor:`#2d7a4a`}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:`#3d9b5b`})]})}),(0,F.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#auditSky)`}),(0,F.jsx)(`polygon`,{points:`200,0 210,80 220,0`,fill:`#ffd166`,opacity:`0.08`}),(0,F.jsx)(`polygon`,{points:`500,0 510,80 520,0`,fill:`#ffd166`,opacity:`0.06`}),(0,F.jsx)(`polygon`,{points:`650,0 660,80 670,0`,fill:`#fff`,opacity:`0.05`}),(0,F.jsx)(`rect`,{x:`80`,y:`20`,width:`6`,height:`60`,fill:`#1a4a2e`}),(0,F.jsx)(`rect`,{x:`180`,y:`10`,width:`7`,height:`70`,fill:`#1a4a2e`}),(0,F.jsx)(`rect`,{x:`320`,y:`15`,width:`6`,height:`65`,fill:`#1a4a2e`}),(0,F.jsx)(`rect`,{x:`500`,y:`8`,width:`7`,height:`72`,fill:`#1a4a2e`}),(0,F.jsx)(`rect`,{x:`620`,y:`18`,width:`6`,height:`62`,fill:`#1a4a2e`}),(0,F.jsx)(`rect`,{x:`740`,y:`12`,width:`7`,height:`68`,fill:`#1a4a2e`}),(0,F.jsx)(`polygon`,{points:`55,25 83,5 111,25`,fill:`#4aad6b`}),(0,F.jsx)(`polygon`,{points:`60,35 83,15 106,35`,fill:`#3d9b5b`}),(0,F.jsx)(`polygon`,{points:`155,15 183,0 211,18`,fill:`#5bc47a`}),(0,F.jsx)(`polygon`,{points:`160,28 183,8 206,28`,fill:`#4aad6b`}),(0,F.jsx)(`polygon`,{points:`295,20 323,2 351,22`,fill:`#5bc47a`}),(0,F.jsx)(`polygon`,{points:`300,32 323,12 346,32`,fill:`#3d9b5b`}),(0,F.jsx)(`polygon`,{points:`475,12 503,0 531,15`,fill:`#4aad6b`}),(0,F.jsx)(`polygon`,{points:`480,25 503,5 526,25`,fill:`#3d9b5b`}),(0,F.jsx)(`polygon`,{points:`595,22 623,5 651,22`,fill:`#5bc47a`}),(0,F.jsx)(`polygon`,{points:`600,34 623,14 646,34`,fill:`#4aad6b`}),(0,F.jsx)(`polygon`,{points:`715,16 743,0 771,18`,fill:`#5bc47a`}),(0,F.jsx)(`polygon`,{points:`720,30 743,10 766,30`,fill:`#3d9b5b`}),(0,F.jsx)(`polygon`,{points:`0,80 0,68 100,65 200,70 300,64 400,68 500,63 600,67 700,64 800,68 800,80`,fill:`#1e6b3a`}),(0,F.jsx)(`polygon`,{points:`250,80 258,65 266,80`,fill:`#e8834a`,opacity:`0.6`}),(0,F.jsx)(`polygon`,{points:`450,80 456,68 462,80`,fill:`#f4a261`,opacity:`0.5`}),(0,F.jsx)(`polygon`,{points:`650,80 656,66 662,80`,fill:`#e8834a`,opacity:`0.55`})]})}function la(){return(0,F.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`gitSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:`#2d5a7b`}),(0,F.jsx)(`stop`,{offset:`60%`,stopColor:`#3a8fb7`}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:`#5bb8d4`})]})}),(0,F.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#gitSky)`}),(0,F.jsx)(`polygon`,{points:`0,80 0,20 60,25 120,18 180,28 220,22 260,30 260,80`,fill:`#2d7a4a`,opacity:`0.7`}),(0,F.jsx)(`polygon`,{points:`540,80 540,22 600,28 660,20 720,25 780,18 800,22 800,80`,fill:`#2d7a4a`,opacity:`0.7`}),(0,F.jsx)(`path`,{d:`M 260,50 Q 320,48 400,45 Q 480,42 540,50`,fill:`none`,stroke:`#5ce0d8`,strokeWidth:`4`,opacity:`0.5`}),(0,F.jsx)(`path`,{d:`M 350,45 Q 370,35 400,28`,fill:`none`,stroke:`#87ceeb`,strokeWidth:`2`,opacity:`0.4`}),(0,F.jsx)(`path`,{d:`M 420,44 Q 440,52 470,60`,fill:`none`,stroke:`#87ceeb`,strokeWidth:`2`,opacity:`0.4`}),(0,F.jsx)(`path`,{d:`M 400,28 Q 430,25 460,30`,fill:`none`,stroke:`#5ce0d8`,strokeWidth:`1.5`,opacity:`0.35`}),(0,F.jsx)(`circle`,{cx:`400`,cy:`45`,r:`3`,fill:`#5ce0d8`,opacity:`0.6`}),(0,F.jsx)(`circle`,{cx:`350`,cy:`45`,r:`2`,fill:`#1ce783`,opacity:`0.5`}),(0,F.jsx)(`circle`,{cx:`460`,cy:`44`,r:`2`,fill:`#1ce783`,opacity:`0.5`}),(0,F.jsx)(`polygon`,{points:`300,65 310,55 320,65`,fill:`#3a6b4a`,opacity:`0.6`}),(0,F.jsx)(`polygon`,{points:`480,62 492,52 504,62`,fill:`#3a6b4a`,opacity:`0.6`}),(0,F.jsx)(`polygon`,{points:`240,35 250,18 260,35`,fill:`#4aad6b`}),(0,F.jsx)(`polygon`,{points:`540,35 550,20 560,35`,fill:`#4aad6b`}),(0,F.jsx)(`polygon`,{points:`270,50 278,38 286,50`,fill:`#3d9b5b`,opacity:`0.8`}),(0,F.jsx)(`polygon`,{points:`520,48 528,36 536,48`,fill:`#3d9b5b`,opacity:`0.8`})]})}var ua=[`system`,`tools`,`user`,`assistant`],da={system:`bg-accent-indigo`,tools:`bg-accent-amber`,user:`bg-accent-blue`,assistant:`bg-accent-green`},fa={system:`shadow-[0_0_8px_rgba(99,102,241,0.4)]`,tools:`shadow-[0_0_8px_rgba(255,178,36,0.4)]`,user:`shadow-[0_0_8px_rgba(0,149,255,0.4)]`,assistant:`shadow-[0_0_8px_rgba(28,231,131,0.4)]`},pa={system:`bg-accent-indigo`,tools:`bg-accent-amber`,user:`bg-accent-blue`,assistant:`bg-accent-green`},ma={system:`System`,tools:`Tools`,user:`User`,assistant:`Assistant`};function ha(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function ga(e,t=``){return{sessionId:t,turnNumber:e.turnCount,totalTokens:e.growth.currentTokens,fillPercent:e.fillPercent,contextWindow:e.contextWindow,breakdown:e.currentBreakdown,growth:{startTokens:e.growth.startTokens,currentTokens:e.growth.currentTokens,delta:e.growth.deltaTokens},topTools:e.toolContributions.map(e=>({tool:e.tool,estimatedTokens:e.estimatedTokens}))}}function _a({data:e,sessionId:t}){let n=zn(e=>e.contextBySession),r=t?n.get(t)??null:null,[i,a]=(0,P.useState)(null),[o,s]=(0,P.useState)(!1),c=(0,P.useRef)(0),l=(0,P.useRef)(0),{data:u}=I({queryKey:t?[`context`,t]:L.context,queryFn:()=>hr(t??void 0),refetchInterval:1e4,enabled:!e}),d=e??u,f=t??``,p=e?ga(e,f):r??(d?ga(d,f):null),m=p?.growth.currentTokens??0,h=Math.min(p?.fillPercent??0,100),g=l.current>0&&h>c.current;if((0,P.useEffect)(()=>{if(l.current>0&&m<l.current*.7){s(!0);let e=setTimeout(()=>s(!1),1e3);return l.current=m,c.current=h,()=>clearTimeout(e)}l.current=m,c.current=h},[h,m]),!p||p.totalTokens===0)return null;let{breakdown:_,growth:v,fillPercent:y,totalTokens:b}=p,x=y>=100,S=p.contextWindow;return(0,F.jsxs)(`div`,{className:`group`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-1.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(z,{children:`Context`}),x&&(0,F.jsx)(Nr,{tone:`danger`,size:`sm`,uppercase:!0,className:`animate-pulse motion-reduce:animate-none`,children:`at capacity`})]}),(0,F.jsxs)(`div`,{className:`text-[11px] text-ink-subtle tabular-nums`,children:[ha(v.currentTokens),S&&S>0&&(0,F.jsx)(`span`,{className:`text-ink-muted`,children:` / ${ha(S)}`}),v.delta>0&&(0,F.jsxs)(`span`,{className:`text-accent-amber ml-1`,children:[`+`,ha(v.delta)]}),v.delta<0&&(0,F.jsx)(`span`,{className:`text-accent-cyan ml-1`,children:`compacted`})]})]}),(0,F.jsxs)(`div`,{className:`relative`,children:[o&&(0,F.jsx)(`div`,{className:`absolute inset-0 rounded-full bg-accent-cyan/20 animate-compact-flash pointer-events-none`}),(0,F.jsx)(`div`,{className:`w-full h-3 bg-surface-3 rounded-full overflow-hidden flex transition-colors duration-150 ${g?`shadow-[0_0_12px_rgba(255,178,36,0.3)]`:``} ${o?`animate-compact`:``}`,children:ua.map(e=>{let t=_[e];if(t<=0)return null;let n=Math.round(t/b*100),r=i===e;return(0,F.jsx)(`div`,{className:`${da[e]} transition-all duration-500 ease-out cursor-default relative ${r?`brightness-125 ${fa[e]}`:``}`,style:{width:`${t/b*h}%`},title:`${ma[e]}: ${ha(t)} (${n}%)`,onMouseEnter:()=>a(e),onMouseLeave:()=>a(null)},e)})})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3 mt-1.5 text-[10px] text-ink-muted`,children:[ua.map(e=>{let t=_[e],n=i===e;return(0,F.jsxs)(`span`,{className:`flex items-center gap-1 transition-colors duration-200 cursor-default ${n?`text-ink-base`:``}`,onMouseEnter:()=>a(e),onMouseLeave:()=>a(null),children:[(0,F.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full ${pa[e]} ${n?`scale-150`:``} transition-transform duration-200`}),ma[e],n&&t>0&&(0,F.jsx)(`span`,{className:`text-ink-subtle ml-0.5`,children:ha(t)})]},e)}),(0,F.jsxs)(`span`,{className:`ml-auto tabular-nums ${x?`text-accent-red`:h>=75?`text-accent-amber`:``}`,children:[h.toFixed(0),`%`]})]})]})}function va(e){let t=e==null?new Date:new Date(e);return t.setHours(0,0,0,0),t.getTime()}function ya(e,t){let n=new Date(e),r=t==null?new Date:new Date(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}var ba={weekday:`short`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`},xa=3e4,Sa={info:`text-ink-muted`,warning:`text-accent-amber`,critical:`text-accent-red`},Ca=1e4;function wa(){let e=zn(e=>e.cost),t=zn(e=>e.antiPatterns),{data:n,isPending:r}=I({queryKey:L.cost,queryFn:()=>Qn()}),{data:i}=I({queryKey:L.sessionCurrent,queryFn:()=>qn(),refetchInterval:1e4}),{data:a,isPending:o}=I({queryKey:L.sessionsTodayAggregate,queryFn:()=>Yn(),refetchInterval:1e4}),{data:s,isPending:c}=I({queryKey:L.sessionsList(200),queryFn:()=>Jn(200),refetchInterval:1e4}),{data:l,isPending:u}=I({queryKey:L.antiPatterns,queryFn:()=>$n()}),{data:d}=I({queryKey:L.concurrency,queryFn:()=>fr(),refetchInterval:1e4}),{data:f}=I({queryKey:L.activityHeatmap(`today`),queryFn:()=>mr(`today`),refetchInterval:3e4}),{data:p}=I({queryKey:L.sessionsLive,queryFn:()=>Xn(),refetchInterval:1e4}),m=(0,P.useMemo)(()=>za(s??[]),[s]),h=(0,P.useMemo)(()=>Ba(s??[]),[s]),g=(0,P.useMemo)(()=>Va(s??[]),[s]),_=(0,P.useMemo)(()=>Ha(s??[]),[s]),v=Math.max(a?.toolCallCount??0,h),y=(r||c||o)&&!e&&m===0&&a===void 0,b=Math.max(e?.todayTotalUsd??0,a?.totalCostUsd??0,m),x=Math.max(l?.length??0,t.length),S=Math.max(a?.antiPatternCount??0,g+x),[C,w]=(0,P.useState)(()=>new Date().toLocaleString(void 0,ba));(0,P.useEffect)(()=>{let e=setInterval(()=>w(new Date().toLocaleString(void 0,ba)),6e4);return()=>clearInterval(e)},[]);let T=i?.efficiencyScore??null,E=T!==null&&Number.isFinite(T)?`${Math.round(T*100)}%`:`—`,D=T===null?`needs more data`:Math.round(T*100)>=80?`strong session`:Math.round(T*100)>=50?`mixed signals`:`needs attention`;return(0,F.jsxs)(`section`,{children:[(0,F.jsx)(ia,{}),(0,F.jsxs)(`header`,{className:`flex items-baseline justify-between mb-4`,children:[(0,F.jsx)(`h1`,{className:`text-xl font-semibold gradient-text`,children:`Today`}),(0,F.jsx)(`span`,{className:`text-xs text-ink-muted`,children:C})]}),!y&&!o&&!c&&!u&&v===0&&b===0&&S===0?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ci,{index:0,className:`glass-card p-8 mb-4`,children:(0,F.jsx)(Li,{icon:`code`,title:`No activity yet today`,subtitle:`Metrics will appear here once you start a coding session with Claude.`})}),(0,F.jsx)(Ci,{index:1,children:(0,F.jsx)(Fa,{})})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ci,{index:0,className:`mb-4`,children:(0,F.jsx)(R,{padding:`lg`,tone:`elevated`,glow:`green`,children:(0,F.jsxs)(`div`,{className:`grid grid-cols-4 gap-4`,children:[(0,F.jsx)(B,{label:`efficiency`,hero:!0,value:E,sub:D,...T===null?{}:{animate:!0,numericValue:Math.round(T*100),suffix:`%`}}),(0,F.jsx)(B,{label:`spend today`,tone:`accent`,value:y?`…`:`$${b.toFixed(2)}`,...y?{}:{animate:!0,numericValue:b,prefix:`$`,decimals:2}}),(0,F.jsx)(B,{label:`tool calls`,value:String(v),animate:!0,numericValue:v}),(0,F.jsx)(B,{label:`flags`,tone:S>0?`warn`:`neutral`,value:String(S),animate:!0,numericValue:S})]})})}),(0,F.jsxs)(Ci,{index:1,className:`grid grid-cols-2 gap-3 mb-3`,children:[(0,F.jsx)(Ua,{todayTotal:b,forecastEod:y?null:e?.forecastEodUsd??(n?.forecast?.forecastEndOfDayUsd==null?null:b+n.forecast.forecastEndOfDayUsd-(n.sessionTodayUsd??0)),hourlySpend:_}),d&&d.buckets&&(0,F.jsx)(Ji,{current:d.current,peak:d.peak,allTimePeak:d.allTimePeak,bucketSizeMs:d.bucketSizeMs,startTimestamp:d.startTimestamp,buckets:d.buckets})]}),S>0&&(t.length>0||l&&l.length>0)&&(0,F.jsx)(Ci,{index:2,className:`mb-3`,children:(0,F.jsx)(R,{padding:`sm`,tone:`warning`,className:`text-xs`,children:t.length>0?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Nr,{tone:`warning`,size:`sm`,className:`mr-2`,children:t[0].type}),(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`— `}),(0,F.jsxs)(`span`,{children:[t[0].count,`× on `]}),(0,F.jsx)(`code`,{className:`bg-surface-5 px-1 rounded`,children:t[0].target}),t[0].sessionId&&(0,F.jsxs)(Nr,{tone:`neutral`,size:`sm`,className:`ml-2`,children:[`Session: `,Pa(t[0].sessionId,p??[])]})]}):l&&l.length>0?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Nr,{tone:`warning`,size:`sm`,className:`mr-2`,children:l[0].type}),(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`— `}),(0,F.jsxs)(`span`,{children:[l[0].count??l[0].iterations??l[0].readCount??l[0].repeatCount??l[0].editCount??l[0].agentCount??`?`,`× on`,` `]}),(0,F.jsx)(`code`,{className:`bg-surface-5 px-1 rounded`,children:l[0].file??l[0].command??`unknown`})]}):null})}),(0,F.jsxs)(Ci,{index:3,className:`grid grid-cols-3 gap-3 mb-3`,children:[(0,F.jsx)(Ta,{}),(0,F.jsx)(Ea,{}),(0,F.jsx)(Da,{}),(0,F.jsx)(Oa,{}),(0,F.jsx)(Aa,{})]}),(0,F.jsx)(Ci,{index:4,children:(0,F.jsx)(Na,{sessions:s??[],liveSessions:p??[]})}),f&&f.buckets?.length>0&&(0,F.jsx)(Ci,{index:5,className:`mb-3`,children:(0,F.jsxs)(R,{padding:`sm`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Activity Today`}),(0,F.jsx)(ea,{variant:`strip`,buckets:f.buckets,maxCount:f.maxCount,bucketSizeMs:f.bucketSizeMs,startTimestamp:f.startTimestamp,ariaLabel:`Today's activity density in 15-minute blocks`})]})}),(0,F.jsx)(Ci,{index:6,children:(0,F.jsx)(Fa,{})})]})]})}function Ta(){let{data:e}=I({queryKey:L.qualityProxy,queryFn:()=>cr(),refetchInterval:Ca});return(0,F.jsxs)(R,{padding:`sm`,className:`h-full`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Quality`}),!e||e.totalSignals===0?(0,F.jsx)(Li,{icon:`checkmark`,title:`Waiting for edits and test runs`,subtitle:`Quality metrics appear after editing files and running tests.`}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`Diff Apply `}),(0,F.jsx)(`span`,{className:Gr(e.diffApplyRate),children:e.diffApplyRate===null?`—`:`${(e.diffApplyRate*100).toFixed(0)}%`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`Test Pass `}),(0,F.jsx)(`span`,{className:Gr(e.testPassRate),children:e.testPassRate===null?`—`:`${(e.testPassRate*100).toFixed(0)}%`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`Backtracks `}),(0,F.jsx)(`span`,{className:e.backtrackCount>0?`text-accent-amber`:``,children:e.backtrackCount})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`Self-corrections `}),(0,F.jsx)(`span`,{className:`text-ink-subtle`,children:e.selfCorrectionCount})]})]}),e.degradationDetected&&(0,F.jsx)(`div`,{className:`text-accent-amber text-xs mt-2`,children:`⚠ Quality degrading`})]})]})}function Ea(){let{data:e}=I({queryKey:L.toolSelectionScore,queryFn:()=>lr(),refetchInterval:Ca});return(0,F.jsxs)(R,{padding:`sm`,className:`h-full`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Tool Selection`}),!e||Array.isArray(e)||e.totalCalls===0?(0,F.jsx)(Li,{icon:`radar`,title:`Waiting for tool calls`,subtitle:`Start a Claude Code session to begin scoring. Resets when the process restarts.`}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,F.jsx)(`span`,{className:`text-2xl font-semibold tabular-nums ${Kr(e.score)}`,children:e.score.toFixed(2)}),(0,F.jsx)(`span`,{className:`text-[10px] text-ink-muted`,children:`/ 1.0`})]}),(0,F.jsxs)(`div`,{className:`text-[10px] text-ink-muted mt-1`,children:[e.penalizedCalls,` of `,e.totalCalls,` calls penalized`]}),(e.redundantReadCount>0||e.repeatedFailureCount>0||e.unusedOutputCount>0)&&(0,F.jsxs)(`div`,{className:`text-[10px] text-ink-subtle mt-1 space-x-2`,children:[e.redundantReadCount>0&&(0,F.jsxs)(`span`,{children:[`re-reads: `,e.redundantReadCount]}),e.repeatedFailureCount>0&&(0,F.jsxs)(`span`,{children:[`repeat fails: `,e.repeatedFailureCount]}),e.unusedOutputCount>0&&(0,F.jsxs)(`span`,{children:[`unused output: `,e.unusedOutputCount]})]}),(0,F.jsx)(`div`,{className:`text-[10px] text-ink-subtle/60 mt-2`,children:`Penalizes: reading the same file 3+ times without editing, repeated tool failures, fetching large outputs never referenced.`})]})]})}function Da(){let{data:e}=I({queryKey:L.latency,queryFn:()=>rr(),refetchInterval:Ca}),t=e?.byTool?Object.entries(e.byTool).filter(e=>e[1]!==null&&e[1].count>0).sort((e,t)=>t[1].p95-e[1].p95).slice(0,4):[];return(0,F.jsxs)(R,{padding:`sm`,className:`h-full`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Latency (ms)`}),!e||!e.overall?(0,F.jsx)(Li,{icon:`clock`,title:`Waiting for tool calls`,subtitle:`Latency percentiles appear after tool calls complete.`}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`flex gap-4 text-xs mb-2`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`p50 `}),(0,F.jsx)(`span`,{className:`text-ink-base tabular-nums`,children:e.overall.p50})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`p95 `}),(0,F.jsx)(`span`,{className:`text-ink-base tabular-nums`,children:e.overall.p95})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`p99 `}),(0,F.jsx)(`span`,{className:`text-ink-base tabular-nums`,children:e.overall.p99})]})]}),t.length>0&&(0,F.jsx)(`div`,{className:`space-y-1`,children:t.map(([e,t])=>(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,F.jsx)(`span`,{className:`text-ink-muted truncate w-28 shrink-0`,children:Qr(e)}),(0,F.jsxs)(`span`,{className:`tabular-nums text-ink-subtle`,children:[t.p95,`ms p95`]})]},e))})]})]})}function Oa(){let{data:e}=I({queryKey:L.modelUsage,queryFn:()=>gr(),refetchInterval:Ca}),t=e?.byModel?Object.entries(e.byModel).filter(([,e])=>e.requestCount>0).sort((e,t)=>t[1].totalCostUsd-e[1].totalCostUsd).slice(0,4):[];return(0,F.jsxs)(R,{padding:`sm`,className:`h-full`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Model Usage`}),!e||t.length===0?(0,F.jsx)(Li,{icon:`radar`,title:`No model data yet`,subtitle:`Start a Claude Code session to see model cost breakdown. Resets when the process restarts.`}):(0,F.jsxs)(`div`,{className:`space-y-1.5`,children:[t.map(([e,t])=>(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-xs gap-2`,children:[(0,F.jsx)(`span`,{className:`text-ink-muted truncate`,children:e}),(0,F.jsxs)(`div`,{className:`flex gap-3 shrink-0 tabular-nums`,children:[(0,F.jsxs)(`span`,{className:`text-ink-subtle`,children:[t.requestCount,`req`]}),(0,F.jsxs)(`span`,{className:`text-ink-base`,children:[`$`,t.totalCostUsd.toFixed(4)]})]})]},e)),e?.mostEfficientModel&&(0,F.jsxs)(`div`,{className:`text-[10px] text-accent-green mt-1`,children:[`Most efficient: `,e.mostEfficientModel]})]})]})}function ka(e,t){let n=t===null?null:`${t}%`;return e===`excellent`?n?`Cache hit rate is ${n}. Cache is well-structured.`:`Cache is well-structured. No changes needed.`:e===`can_improve`?n?`Cache hit rate is ${n}. Placing stable content before variable content in prompts could improve this.`:`Place stable content before variable content in prompts to improve.`:n?`Cache hit rate is ${n}. Restructuring your system prompt so stable context appears at the top could bring this above 60%.`:`Restructure your system prompt so stable context appears at the top.`}function Aa(){let{data:e}=I({queryKey:L.cacheHealth,queryFn:()=>_r(),refetchInterval:Ca}),t=!e||e.status===`no_cache_activity`||e.cache_hit_rate_pct==null;return(0,F.jsxs)(R,{padding:`sm`,className:`h-full`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Cache Health`}),t?(0,F.jsx)(Li,{icon:`radar`,title:`No cache data yet`,subtitle:`Appears once token usage with cache reads is reported.`}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`flex items-baseline gap-2 mb-1`,children:[(0,F.jsxs)(`span`,{className:`text-2xl font-semibold tabular-nums ${e.status===`excellent`?`text-accent-green`:e.status===`needs_attention`?`text-accent-amber`:`text-ink-base`}`,children:[e.cache_hit_rate_pct,`%`]}),(0,F.jsx)(Nr,{tone:e.status===`needs_attention`?`warning`:`neutral`,size:`sm`,children:e.status===`excellent`?`excellent`:e.status.replace(`_`,` `)})]}),e.total_savings_usd>0&&(0,F.jsxs)(`div`,{className:`text-xs text-accent-green mb-1`,children:[`$`,e.total_savings_usd.toFixed(4),` saved`]}),e.week_over_week_delta_pts!==null&&e.week_over_week_delta_pts!==0&&(0,F.jsxs)(`div`,{className:`text-[10px] font-medium mb-1 ${e.week_over_week_delta_pts>0?`text-accent-green`:`text-accent-amber`}`,children:[e.week_over_week_delta_pts>0?`↑`:`↓`,Math.abs(e.week_over_week_delta_pts),`pts vs last week`]}),(0,F.jsx)(`div`,{className:`text-[10px] text-ink-subtle/70 leading-snug`,children:ka(e.status,e.cache_hit_rate_pct)})]})]})}var ja={Read:`📄`,Edit:`✏️`,Write:`📝`,Bash:`⚡`,Agent:`🤖`,AskUserQuestion:`💬`,TaskCreate:`📋`,TaskUpdate:`✅`},Ma=3e3;function Na({sessions:e,liveSessions:t}){let[n,r]=(0,P.useState)(null),[i,a]=(0,P.useState)(`list`),[,o]=Kt(),s=zn(e=>e.setActiveSession),{data:c}=I({queryKey:L.sessionCurrent,queryFn:()=>qn()}),l=(0,P.useMemo)(()=>{let e=new Set;for(let n of t)e.add(n.sessionId);if(e.size===0)if(c?.liveSessions?.length)for(let t of c.liveSessions)e.add(t);else c?.sessionId&&e.add(c.sessionId);return e},[t,c]),u=(t.length>0?t[0].sessionId:null)??(l.size>0?[...l][0]:null),d=n??u,f=d!==null&&l.has(d),p=n!==null&&!l.has(n);(0,P.useEffect)(()=>{s(d)},[d,s]);let{data:m}=I({queryKey:d?L.sessionReplay(d):[`replay`,`none`],queryFn:()=>sr(d),enabled:d!==null,retry:!1,refetchInterval:f?Ma:!1}),h=(0,P.useRef)(null);(0,P.useEffect)(()=>{f&&h.current&&(h.current.scrollTop=h.current.scrollHeight)},[m?.timeline.length,f]);let g=(0,P.useMemo)(()=>{let n=Date.now()-360*60*1e3,r=new Map;for(let e of t)r.set(e.sessionId,e);let i=new Map;for(let t of e){if(!t.sessionId)continue;let e=t.startTime!=null&&La(t.startTime),a=r.has(t.sessionId),o=t.startTime!=null&&t.durationMs!=null?t.startTime+t.durationMs:null,s=o!=null&&o>=n&&La(o);(e||a||s)&&i.set(t.sessionId,t)}for(let e of t)e.sessionId&&(i.has(e.sessionId)||i.set(e.sessionId,{sessionId:e.sessionId,sessionName:e.sessionName,startTime:e.startTime,toolCallCount:0,estimatedCostUsd:null}));let a=e=>{let t=r.get(e.sessionId);return t?t.lastActivity:e.startTime!=null&&e.durationMs!=null?e.startTime+e.durationMs:e.startTime??0};return[...i.values()].sort((e,t)=>a(t)-a(e)).slice(0,10)},[e,t]),_=m?.timeline??[],v=_.length>0?_[0].timestamp:0;return(0,F.jsxs)(`div`,{className:`glass-card mb-3 grid grid-cols-[220px_1fr] overflow-hidden`,style:{height:`320px`},children:[(0,F.jsxs)(`div`,{className:`border-r border-border-subtle overflow-auto`,children:[(0,F.jsx)(z,{className:`p-2 border-b border-border-subtle`,children:`Session Live Tail`}),g.map(e=>{let t=l.has(e.sessionId);return(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r(e.sessionId),className:`block w-full text-left p-2 border-b border-border-subtle text-xs transition-colors duration-150 hover:bg-surface-5 `+(d===e.sessionId?`bg-surface-5`:``),children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`font-mono text-ink-base`,children:e.sessionName||e.sessionId.slice(0,8)}),t?(0,F.jsx)(Fr,{label:`live`,size:`sm`}):(0,F.jsx)(`span`,{className:`text-[10px] text-ink-muted`,title:e.startTime?`Started ${Jr(e.startTime)}`:void 0,children:e.startTime?Jr(e.startTime+(e.durationMs??0)):``})]}),(0,F.jsxs)(`div`,{className:`flex gap-2 mt-0.5 text-[10px] text-ink-subtle`,children:[(0,F.jsxs)(`span`,{children:[e.toolCallCount??0,` calls`]}),e.estimatedCostUsd!=null&&e.estimatedCostUsd>0?(0,F.jsxs)(`span`,{children:[`$`,e.estimatedCostUsd.toFixed(2)]}):(0,F.jsx)(`span`,{children:`—`})]})]},e.sessionId)}),l.size===0&&g.length===0&&(0,F.jsx)(Li,{icon:`code`,title:`No sessions today`,subtitle:`Start coding with Claude to see sessions here.`})]}),(0,F.jsxs)(`div`,{className:`flex flex-col overflow-hidden`,children:[d&&(0,F.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1 border-b border-border-subtle shrink-0`,children:[(0,F.jsx)(Rr,{value:i,onChange:a,size:`sm`,tone:`green`,ariaLabel:`Timeline view mode`,options:[{value:`gantt`,label:`Gantt`},{value:`list`,label:`List`}]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p&&(0,F.jsx)(`span`,{"data-testid":`session-ended-badge`,children:(0,F.jsx)(Nr,{tone:`neutral`,size:`sm`,uppercase:!0,children:`Session ended`})}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>o(`/sessions?id=${d}`),className:`text-[10px] text-accent-cyan hover:underline transition-colors duration-150`,children:`full session →`})]})]}),(0,F.jsxs)(`div`,{ref:h,className:`overflow-auto flex-1 p-2`,children:[!d&&(0,F.jsx)(`div`,{className:`text-ink-muted text-xs p-2`,children:`Select a session to view its timeline.`}),d&&_.length===0&&(0,F.jsx)(Li,{icon:`timeline`,title:f?`Waiting for tool calls`:`No tool calls`,subtitle:f?`Tool calls will appear here in real time.`:`This session has no recorded tool calls.`}),_.length>0&&i===`gantt`&&(0,F.jsx)(Vi,{entries:_,segments:m?.segments??[]}),_.length>0&&i===`list`&&(0,F.jsx)(`div`,{className:`flex flex-col`,children:_.map((e,t)=>(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 px-1 py-0.5 text-xs border-b border-border-subtle/50 last:border-b-0`,children:[(0,F.jsxs)(`span`,{className:`w-10 text-ink-muted tabular-nums text-[11px] shrink-0`,children:[`+`,Yr(e.timestamp-v)]}),(0,F.jsx)(`span`,{className:`w-4 text-center text-[11px]`,"aria-hidden":`true`,children:ja[e.toolName]??`·`}),(0,F.jsx)(`span`,{className:`w-28 truncate font-medium text-ink-base text-[11px]`,title:e.toolName,children:Qr(e.toolName)}),(0,F.jsx)(`span`,{className:`flex-1 truncate font-mono text-ink-subtle text-[10px]`,title:e.filePath??e.command??``,children:e.filePath??e.command??``}),(0,F.jsx)(`span`,{className:`w-12 text-right tabular-nums text-ink-muted text-[10px]`,children:e.durationMs==null?``:`${e.durationMs}ms`}),(0,F.jsx)(`span`,{className:`w-3 text-center text-[10px] ${e.success?`text-accent-green`:`text-accent-red`}`,children:e.success?`✓`:`✗`})]},`${t}-${e.timestamp}`))})]}),f&&d&&(0,F.jsx)(`div`,{className:`border-t border-bg-line px-3 py-2 shrink-0`,children:(0,F.jsx)(_a,{sessionId:d})})]})]})}function Pa(e,t){let n=t.find(t=>t.sessionId===e);return n?.sessionName?n.sessionName:e.slice(0,8)}function Fa(){let{data:e,isLoading:t,error:n}=I({queryKey:L.alertsRecent,queryFn:async()=>{try{return await or()}catch(e){if(e instanceof Wn)return null;throw e}},refetchInterval:xa,retry:!1});if(e===null)return null;let r=[...e??[]].sort((e,t)=>t.firedAt-e.firedAt);return(0,F.jsxs)(R,{padding:`sm`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Recent Alerts`}),t&&(0,F.jsx)(Li,{variant:`loading`,title:`Loading...`}),n&&(0,F.jsx)(`div`,{className:`text-accent-red text-xs`,children:`Error loading recent alerts.`}),!t&&!n&&r.length===0&&(0,F.jsx)(`div`,{className:`text-ink-muted text-xs`,children:`No alerts in recent history.`}),!t&&!n&&r.length>0&&(0,F.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,F.jsx)(`thead`,{className:`text-ink-muted`,children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{className:`text-left pb-1`,children:`when`}),(0,F.jsx)(`th`,{className:`text-left pb-1`,children:`sev`}),(0,F.jsx)(`th`,{className:`text-left pb-1`,children:`rule`}),(0,F.jsx)(`th`,{className:`text-right pb-1`,children:`value / threshold`}),(0,F.jsx)(`th`,{className:`text-left pb-1 pl-2`,children:`state`})]})}),(0,F.jsx)(`tbody`,{children:r.slice(0,50).map(e=>(0,F.jsxs)(`tr`,{className:`border-t border-border-subtle`,children:[(0,F.jsx)(`td`,{className:`py-1 text-ink-subtle tabular-nums whitespace-nowrap`,children:Ia(e.firedAt)}),(0,F.jsxs)(`td`,{className:`py-1`,children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,className:Sa[e.severity],children:`●`}),` `,(0,F.jsx)(`span`,{className:`text-ink-subtle uppercase tracking-wider text-[10px]`,children:e.severity})]}),(0,F.jsx)(`td`,{className:`py-1`,children:e.title}),(0,F.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[Zr(e.value),` / `,Zr(e.threshold)]}),(0,F.jsx)(`td`,{className:`py-1 pl-2 `+(e.state===`firing`?`text-accent-amber`:`text-ink-muted`),children:e.state})]},`${e.id}-${e.firedAt}-${e.state}`))})]})]})}function Ia(e){let t=Math.max(0,Date.now()-e),n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}var La=e=>ya(e);function Ra(e){let t=e.estimatedCostUsd;if(t==null||t<=0||e.startTime==null)return 0;let n=va(),r=n+864e5,i=e.startTime,a=typeof e.endTime==`number`?e.endTime:typeof e.durationMs==`number`?e.startTime+e.durationMs:Date.now();return a<n||i>=r?0:i>=n&&a<r?t:t*((Math.min(a,r)-Math.max(i,n))/Math.max(1,a-i))}function za(e){let t=0;for(let n of e)t+=Ra(n);return t}function Ba(e){let t=0;for(let n of e)(n.startTime&&La(n.startTime)||Ra(n)>0)&&(t+=n.toolCallCount??0);return t}function Va(e){let t=0;for(let n of e)(n.startTime&&La(n.startTime)||Ra(n)>0)&&(t+=n.antiPatterns?.length??0);return t}function Ha(e){let t=Array(24).fill(0);for(let n of e){if(!n.startTime||!La(n.startTime)||n.estimatedCostUsd==null)continue;let e=new Date(n.startTime).getHours();t[e]+=n.estimatedCostUsd}return t.map((e,t)=>({hour:t,cost:e}))}function Ua({todayTotal:e,forecastEod:t,hourlySpend:n}){let r=t!==null&&Number.isFinite(t),i=r?Math.max(t,e):0,a=r?i-e:0,o=r&&e>0?a/e*100:0,s=n.some(e=>e.cost>0);return(0,F.jsxs)(R,{padding:`sm`,className:`mb-3 h-full`,children:[(0,F.jsx)(z,{className:`mb-1.5`,children:`Forecast · End of Day`}),r?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,F.jsxs)(`span`,{className:`text-lg font-semibold text-accent-cyan tabular-nums`,children:[`$`,i.toFixed(2)]}),(0,F.jsx)(`span`,{className:`text-xs text-ink-muted tabular-nums`,children:a>0?(0,F.jsxs)(F.Fragment,{children:[`+$`,a.toFixed(2),e>0&&` (+${o.toFixed(0)}%)`,` from now`]}):(0,F.jsx)(F.Fragment,{children:`on pace`})})]}),s&&(0,F.jsx)(`div`,{className:`mt-2`,children:(0,F.jsx)(Ai,{hours:n})})]}):(0,F.jsx)(`div`,{className:`text-ink-muted text-xs`,children:`Insufficient data — forecast appears once burn rate stabilizes.`})]})}function Wa(e,t){let{startMs:n,endMs:r,bucketSizeMs:i}=t,a=Math.max(1,Math.ceil((r-n)/i)),o=Array(a).fill(0);for(let t of e){let e=Math.floor((t.timestamp-n)/i);e>=0&&e<a&&o[e]++}return o}function Ga(e){return e<6e5?3e4:e<36e5?6e4:e<144e5?3e5:9e5}var Ka=50,qa={thrashing:`Edit/Test Thrashing`,stuck_loop:`Stuck Loop`,blind_editing:`Blind Editing`,re_reading:`Repeated Reads`},Ja={Read:`📄`,Edit:`✏️`,Write:`📝`,Bash:`⚡`,Agent:`🤖`,AskUserQuestion:`💬`,TaskCreate:`📋`,TaskUpdate:`✅`},Ya=3e3;function Xa(e){return typeof e.startTime==`number`?e.startTime:new Date(e.startTime??0).getTime()}function Za(e){return Xa(e)+(e.durationMs??0)}function Qa(e,t){let n=[...e];switch(t){case`date`:n.sort((e,t)=>Xa(t)-Xa(e));break;case`lastActive`:n.sort((e,t)=>Za(t)-Za(e));break;case`cost`:n.sort((e,t)=>(t.estimatedCostUsd??0)-(e.estimatedCostUsd??0));break;case`calls`:n.sort((e,t)=>(t.toolCallCount??0)-(e.toolCallCount??0));break}return n}function $a(){let[e,t]=(0,P.useState)(new URLSearchParams(window.location.search).get(`id`)),[n,r]=(0,P.useState)(`date`),i=I({queryKey:L.sessionsList(Ka),queryFn:()=>Jn(Ka),refetchInterval:1e4}),a=I({queryKey:L.sessionCurrent,queryFn:()=>qn(),refetchInterval:1e4}),o=(0,P.useMemo)(()=>{let e=new Set;if(a.data?.liveSessions?.length)for(let t of a.data.liveSessions)e.add(t);else a.data?.sessionId&&e.add(a.data.sessionId);return e},[a.data]),s=I({queryKey:e?L.sessionDetail(e):[`session`,`none`],queryFn:()=>Zn(e),enabled:e!==null,refetchInterval:a.isLoading||e&&o.has(e)?1e4:!1}),c=(0,P.useMemo)(()=>Qa(i.data??[],n),[i.data,n]);(0,P.useEffect)(()=>{if(e)return;let n=o.size>0?[...o][0]:null;n?t(n):c.length>0&&t(c[0].sessionId)},[o,c,e]);let l=e=>{t(e)};return(0,F.jsxs)(`section`,{className:`flex flex-col h-full`,children:[(0,F.jsx)(`div`,{className:`h-8 overflow-hidden rounded-lg mb-2 shrink-0`,children:(0,F.jsx)(ia,{theme:`sessions`})}),(0,F.jsx)(`h1`,{className:`text-lg font-semibold gradient-text mb-2 shrink-0`,children:`Sessions`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-[260px_1fr] gap-3 flex-1 min-h-0`,children:[(0,F.jsxs)(R,{padding:`none`,tone:`static`,className:`overflow-hidden flex flex-col`,children:[(0,F.jsx)(`header`,{className:`p-2 border-b border-border-subtle`,children:(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsx)(z,{as:`h2`,children:`List`}),(0,F.jsxs)(`select`,{value:n,onChange:e=>r(e.target.value),className:`text-[10px] bg-surface-5 border border-border-medium rounded-md px-1.5 py-0.5 text-ink-subtle`,children:[(0,F.jsx)(`option`,{value:`date`,children:`Newest`}),(0,F.jsx)(`option`,{value:`lastActive`,children:`Last active`}),(0,F.jsx)(`option`,{value:`cost`,children:`Cost`}),(0,F.jsx)(`option`,{value:`calls`,children:`Calls`})]})]})}),(0,F.jsxs)(`div`,{className:`overflow-auto`,children:[i.isLoading&&(0,F.jsx)(Li,{variant:`loading`,icon:`timeline`,title:`Loading sessions`}),!i.isLoading&&c.length===0&&o.size===0&&(0,F.jsx)(Li,{icon:`code`,title:`No sessions yet`,subtitle:`Start coding with Claude to see your sessions here.`}),c.map(t=>{let r=o.has(t.sessionId);return(0,F.jsxs)(`button`,{type:`button`,onClick:()=>l(t.sessionId),className:`block w-full text-left p-2 border-b border-border-subtle text-xs transition-colors duration-150 hover:bg-surface-5 `+(e===t.sessionId?`bg-surface-5`:``),children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,F.jsx)(`span`,{className:`font-mono text-ink-base truncate`,children:t.sessionName||t.sessionId.slice(0,8)}),r&&(0,F.jsx)(Fr,{size:`sm`,label:`live`,className:`shrink-0`})]}),(0,F.jsxs)(`div`,{className:`flex justify-between mt-1 text-ink-subtle text-[11px] tabular-nums`,children:[(0,F.jsxs)(`span`,{children:[t.toolCallCount??0,` calls`]}),(0,F.jsx)(`span`,{className:`text-ink-muted`,title:n===`lastActive`&&t.startTime?`Started ${qr(t.startTime)}`:void 0,children:t.startTime?qr(n===`lastActive`?Za(t):t.startTime):`—`}),(0,F.jsx)(`span`,{children:t.estimatedCostUsd==null?`—`:`$${t.estimatedCostUsd.toFixed(2)}`})]})]},t.sessionId)}),c.length>=Ka&&(0,F.jsxs)(`div`,{className:`p-2 text-[10px] text-ink-muted text-center border-t border-border-subtle`,children:[`Showing `,Ka,` most recent sessions.`]})]})]}),(0,F.jsxs)(`div`,{className:`glass-card glass-card-static p-4 overflow-auto`,children:[!e&&(0,F.jsx)(Li,{icon:`timeline`,title:`Loading sessions`,subtitle:`Selecting the most recent session…`}),e&&s.isLoading&&(0,F.jsx)(Li,{variant:`loading`,icon:`timeline`,title:`Loading detail`}),e&&s.data&&(0,F.jsx)(to,{data:s.data,isLive:!!e&&o.has(e)})]})]})]})}function eo(e){return e===`Read`?`bg-accent-blue/80`:e===`Edit`||e===`Write`?`bg-accent-green/80`:e===`Bash`?`bg-accent-purple/80`:e===`Agent`?`bg-accent-teal/80`:`bg-ink-subtle/80`}function to({data:e,isLive:t}){let n=e.toolBreakdown??{},r=Object.entries(n).sort((e,t)=>t[1]-e[1]),i=e.toolCallCount??0,a=e.durationMs==null?null:Xr(e.durationMs),o=e.timeline??[],s=o.length>0?o[0].timestamp:0;return o.length===0&&r.length===0?(0,F.jsx)(Li,{icon:`timeline`,title:`No tool calls`,subtitle:`This session has no recorded tool calls.`}):(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`flex items-baseline justify-between mb-3`,children:(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`h2`,{className:`text-xs tracking-wider text-ink-muted flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`font-mono text-ink-base ${e.sessionName?`font-medium`:`uppercase`}`,children:e.sessionName||e.sessionId.slice(0,8)}),(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,F.jsxs)(`span`,{className:`uppercase`,children:[i,` calls`]}),a&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,F.jsx)(`span`,{className:`tabular-nums`,children:a})]}),t&&(0,F.jsx)(Fr,{size:`sm`,label:`live`})]}),s>0&&(0,F.jsx)(`div`,{className:`text-[11px] text-ink-subtle mt-0.5`,children:new Date(s).toLocaleString(void 0,{weekday:`short`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})})]})}),(0,F.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 mb-4 text-xs`,children:[e.model&&(0,F.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-2.5`,children:[(0,F.jsx)(z,{children:`Model`}),(0,F.jsx)(`div`,{className:`font-mono`,children:e.model})]}),e.estimatedCostUsd!=null&&(0,F.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-2.5`,children:[(0,F.jsx)(z,{children:`Cost`}),(0,F.jsxs)(`div`,{className:`tabular-nums`,children:[`$`,e.estimatedCostUsd.toFixed(4)]})]}),e.outcome&&(0,F.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-2.5`,children:[(0,F.jsx)(z,{children:`Status`}),(0,F.jsx)(`div`,{className:`capitalize`,children:e.outcome})]})]}),(e.antiPatterns?.length??0)>0&&(0,F.jsxs)(`div`,{className:`mb-4`,children:[(0,F.jsx)(z,{className:`mb-1`,children:`Anti-Patterns`}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.antiPatterns.map(({type:e,count:t})=>(0,F.jsxs)(Nr,{tone:`warning`,size:`sm`,bordered:!0,children:[qa[e]??e,(0,F.jsxs)(`span`,{className:`opacity-70`,children:[`× `,t]})]},e))})]}),(e.qualityProxy||e.toolSelectionScore)&&(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 mb-4`,children:[e.qualityProxy&&(0,F.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-3`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Session Quality`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`Diff Apply `}),(0,F.jsx)(`span`,{className:Gr(e.qualityProxy.diffApplyRate),children:e.qualityProxy.diffApplyRate===null?`—`:`${(e.qualityProxy.diffApplyRate*100).toFixed(0)}%`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`Test Pass `}),(0,F.jsx)(`span`,{className:Gr(e.qualityProxy.testPassRate),children:e.qualityProxy.testPassRate===null?`—`:`${(e.qualityProxy.testPassRate*100).toFixed(0)}%`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`Backtracks `}),(0,F.jsx)(`span`,{className:e.qualityProxy.backtrackCount>0?`text-accent-amber`:``,children:e.qualityProxy.backtrackCount})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`Self-corrections `}),(0,F.jsx)(`span`,{className:`text-ink-subtle`,children:e.qualityProxy.selfCorrectionCount})]})]})]}),e.toolSelectionScore&&(0,F.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-3`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Tool Selection`}),(0,F.jsx)(`div`,{className:`text-2xl font-semibold tabular-nums ${Kr(e.toolSelectionScore.score)}`,children:e.toolSelectionScore.score.toFixed(2)}),(0,F.jsxs)(`div`,{className:`text-[10px] text-ink-muted mt-1`,children:[`re-reads: `,e.toolSelectionScore.redundantReadCount,` · repeat fails:`,` `,e.toolSelectionScore.repeatedFailureCount,` · unused:`,` `,e.toolSelectionScore.unusedOutputCount]})]})]}),t&&(0,F.jsx)(`div`,{className:`mb-4`,children:(0,F.jsx)(_a,{sessionId:e.sessionId})}),r.length>0&&(0,F.jsx)(no,{breakdownEntries:r,totalCalls:i,isLive:t,sessionId:e.sessionId}),(e.filesRead?.length??0)>0&&(0,F.jsxs)(`div`,{className:`mb-4`,children:[(0,F.jsx)(z,{className:`mb-1`,children:`Files Read`}),(0,F.jsx)(`ul`,{className:`text-[11px] text-ink-subtle space-y-0.5`,children:e.filesRead.map(e=>(0,F.jsx)(`li`,{className:`font-mono truncate`,children:e.split(`/`).slice(-2).join(`/`)},e))})]}),(e.filesModified?.length??0)>0&&(0,F.jsxs)(`div`,{className:`mb-4`,children:[(0,F.jsx)(z,{className:`mb-1`,children:`Files Modified`}),(0,F.jsx)(`ul`,{className:`text-[11px] text-ink-subtle space-y-0.5`,children:e.filesModified.map(e=>(0,F.jsx)(`li`,{className:`font-mono truncate`,children:e.split(`/`).slice(-2).join(`/`)},e))})]}),(0,F.jsx)(io,{timeline:o}),(0,F.jsx)(oo,{sessionId:e.sessionId,isLive:t})]})}function no({breakdownEntries:e,totalCalls:t,isLive:n,sessionId:r}){let[i,a]=(0,P.useState)(`calls`),o=`/api/context?sessionId=${encodeURIComponent(r)}`,{data:s}=I({queryKey:[`context`,r],queryFn:()=>fetch(o).then(e=>e.ok?e.json():null),refetchInterval:1e4,enabled:n&&i===`context`}),c=s?.toolContributions??[],l=c.length>0?c[0].estimatedTokens:0;return(0,F.jsxs)(`div`,{className:`mb-4`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,F.jsx)(z,{children:`Tools`}),n&&(0,F.jsx)(Rr,{value:i,onChange:a,options:[{value:`calls`,label:`Calls`},{value:`context`,label:`Context`}],size:`sm`,tone:`cyan`,ariaLabel:`Tools view`})]}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[i===`calls`&&e.map(([e,n])=>{let r=t>0?n/t*100:0;return(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,F.jsx)(`span`,{className:`w-28 text-ink-subtle truncate`,title:e,children:Qr(e)}),(0,F.jsx)(`div`,{className:`flex-1 h-3 bg-surface-3 relative rounded`,children:(0,F.jsx)(`div`,{className:`h-3 rounded ${eo(e)}`,style:{width:`${r}%`}})}),(0,F.jsx)(`span`,{className:`w-10 text-right text-ink-muted tabular-nums`,children:n})]},e)}),i===`context`&&c.map(e=>{let t=l>0?e.estimatedTokens/l*100:0;return(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,F.jsx)(`span`,{className:`w-28 text-ink-subtle truncate`,title:e.tool,children:Qr(e.tool)}),(0,F.jsx)(`div`,{className:`flex-1 h-3 bg-surface-3 relative rounded`,children:(0,F.jsx)(`div`,{className:`h-3 rounded bg-accent-amber/80`,style:{width:`${t}%`}})}),(0,F.jsxs)(`span`,{className:`w-16 text-right text-ink-muted tabular-nums text-[10px]`,children:[`~`,ro(e.estimatedTokens)]})]},e.tool)}),i===`context`&&c.length===0&&(0,F.jsx)(`div`,{className:`text-[11px] text-ink-muted`,children:`No context data available yet`})]})]})}function ro(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function io({timeline:e}){let t=(0,P.useMemo)(()=>{if(e.length<2)return null;let t=e[0].timestamp,n=e[e.length-1].timestamp,r=n-t;if(r<1e3)return null;let i=Ga(r),a=Wa(e,{startMs:t,endMs:n+i,bucketSizeMs:i});return{buckets:a,maxCount:Math.max(...a,1),bucketSizeMs:i,startMs:t}},[e]);return t?(0,F.jsxs)(`div`,{className:`mb-4`,children:[(0,F.jsx)(z,{className:`mb-1`,children:`Activity Density`}),(0,F.jsx)(ea,{variant:`strip`,buckets:t.buckets,maxCount:t.maxCount,bucketSizeMs:t.bucketSizeMs,startTimestamp:t.startMs,ariaLabel:`Session activity density`})]}):null}var ao=(0,P.forwardRef)(function({children:e,isLive:t,timelineLength:n},r){let i=(0,P.useRef)(null),[a,o]=(0,P.useState)(!1),s=(0,P.useCallback)(()=>{let e=i.current;if(!e)return;let t=e.scrollHeight>e.clientHeight+40,n=e.scrollHeight-e.scrollTop-e.clientHeight<40;o(t&&!n)},[]);(0,P.useEffect)(()=>{let e=i.current;if(e)return s(),e.addEventListener(`scroll`,s,{passive:!0}),()=>e.removeEventListener(`scroll`,s)},[s]),(0,P.useEffect)(()=>{t&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[t,n]);let c=(0,P.useCallback)(()=>{i.current?.scrollTo({top:i.current.scrollHeight,behavior:`smooth`})},[]);return(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(`div`,{ref:(0,P.useCallback)(e=>{i.current=e,typeof r==`function`?r(e):r&&(r.current=e)},[r]),className:`overflow-auto max-h-[60vh]`,children:e}),a&&(0,F.jsx)(kr,{variant:`ghost`,size:`sm`,onClick:c,className:`absolute bottom-2 right-3 backdrop-blur-sm shadow-lg`,children:`↓ Jump to bottom`})]})});function oo({sessionId:e,isLive:t}){let n=(0,P.useRef)(null),[r,i]=(0,P.useState)(`gantt`);(0,P.useEffect)(()=>{i(`gantt`)},[e]);let{data:a,isLoading:o,error:s}=I({queryKey:L.sessionReplay(e),queryFn:()=>sr(e),retry:!1,refetchInterval:t?Ya:!1});if((0,P.useEffect)(()=>{t&&n.current&&(n.current.scrollTop=n.current.scrollHeight)},[a?.timeline.length,t]),o)return(0,F.jsx)(`div`,{className:`mt-3`,children:(0,F.jsx)(Li,{variant:`loading`,icon:`timeline`,title:`Loading replay`})});if(s)return(0,F.jsx)(`div`,{className:`mt-3`,children:(0,F.jsx)(Li,{icon:`timeline`,title:`Replay not available for this session`,subtitle:`This session may predate the replay feature or have no recorded tool calls.`})});if(!a||a.timeline.length===0)return(0,F.jsx)(F.Fragment,{});let c=a.segments,l=a.timeline[0].timestamp,u=co(a.timeline.length,c);return(0,F.jsxs)(`div`,{className:`mt-4`,children:[c.length>0&&(0,F.jsxs)(`div`,{className:`bg-accent-amber/5 border border-accent-amber/30 rounded-xl p-2.5 mb-3`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] font-semibold text-accent-amber mb-1.5`,children:[c.length,` anti-pattern`,c.length>1?`s`:``,` detected`]}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:so(c).map(({type:e,count:t,worstSeverity:n})=>(0,F.jsxs)(Nr,{tone:n===`critical`?`danger`:`warning`,size:`sm`,bordered:!0,children:[qa[e]??e,(0,F.jsxs)(`span`,{className:`opacity-70`,children:[`× `,t]})]},e))})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,F.jsx)(Rr,{value:r,onChange:i,options:[{value:`gantt`,label:`Gantt`},{value:`list`,label:`List`}],size:`sm`,tone:`green`,ariaLabel:`Replay view mode`}),(0,F.jsxs)(z,{children:[`Replay · `,a.timeline.length,` calls`,t&&(0,F.jsx)(`span`,{className:`text-accent-cyan ml-1`,children:`· Auto-Updating`})]})]}),(0,F.jsx)(ao,{ref:n,isLive:t,timelineLength:a.timeline.length,children:r===`gantt`?(0,F.jsx)(Vi,{entries:a.timeline,segments:c}):(0,F.jsx)(`div`,{className:`flex flex-col`,children:a.timeline.map((e,t)=>{let n=u[t],r=n?n.severity===`critical`?`border-l-accent-red`:`border-l-accent-amber`:`border-l-transparent`,i=n?n.severity===`critical`?`bg-accent-red/5`:`bg-accent-amber/5`:``,a=e.timestamp-l;return(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-0.5 border-l-2 ${r} ${i} text-[11px]`,children:[(0,F.jsxs)(`span`,{className:`w-10 text-ink-muted tabular-nums shrink-0`,children:[`+`,Yr(a)]}),(0,F.jsx)(`span`,{className:`w-4 text-center shrink-0`,"aria-hidden":`true`,children:Ja[e.toolName]??`·`}),(0,F.jsx)(`span`,{className:`w-28 truncate font-medium text-ink-base shrink-0`,title:e.toolName,children:Qr(e.toolName)}),(0,F.jsx)(`span`,{className:`flex-1 truncate font-mono text-ink-subtle min-w-0`,title:e.filePath??e.command??``,children:e.filePath??e.command??``}),(0,F.jsx)(`span`,{className:`w-14 text-right tabular-nums text-ink-muted shrink-0`,children:e.durationMs==null?`—`:`${e.durationMs}ms`}),(0,F.jsx)(`span`,{className:`w-3 text-center shrink-0 ${e.success?`text-accent-green`:`text-accent-red`}`,children:e.success?`✓`:`✗`}),n&&t===n.startIndex&&(0,F.jsx)(Nr,{tone:n.severity===`critical`?`danger`:`warning`,size:`sm`,className:`ml-0.5 font-medium shrink-0`,children:qa[n.type]??n.type})]},`${t}-${e.timestamp}`)})})})]})}function so(e){let t=new Map;for(let n of e){let e=t.get(n.type);e?(e.count++,e.totalIterations+=n.iterations,n.severity===`critical`&&(e.worstSeverity=`critical`)):t.set(n.type,{count:1,totalIterations:n.iterations,worstSeverity:n.severity})}return Array.from(t.entries()).map(([e,t])=>({type:e,...t}))}function co(e,t){let n=Array(e).fill(null);for(let r of t){let t=Math.max(0,r.startIndex),i=Math.min(r.endIndex,e-1);for(let e=t;e<=i;e++)(n[e]===null||r.severity===`critical`&&n[e].severity!==`critical`)&&(n[e]=r)}return n}var lo=o((e=>{function t(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Array.isArray(o)&&t<r?i(o,t+1):n.push(o)}};return i(e,0),n}e.flatten=t})),uo=o((e=>{function t(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}e.isEqualsSameValueZero=t})),H=o((()=>{uo()})),fo=o((e=>{function t(e){return Number.isSafeInteger(e)&&e>=0}e.isLength=t})),po=o((e=>{var t=fo();function n(e){return e!=null&&typeof e!=`function`&&t.isLength(e.length)}e.isArrayLike=n})),mo=o((e=>{function t(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}e.isObject=t})),ho=o((e=>{var t=/^(?:0|[1-9]\d*)$/;function n(e,n=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<n;case`symbol`:return!1;case`string`:return t.test(e)}}e.isIndex=n})),go=o((e=>{var t=uo();H();var n=po(),r=mo(),i=ho();function a(e,a,o){return r.isObject(o)&&(typeof a==`number`&&n.isArrayLike(o)&&i.isIndex(a)&&a<o.length||typeof a==`string`&&a in o)?t.isEqualsSameValueZero(o[a],e):!1}e.isIterateeCall=a})),_o=o((e=>{function t(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}e.toKey=t})),vo=o((e=>{function t(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(t).join(`,`);let n=String(e);return n===`0`&&Object.is(Number(e),-0)?`-0`:n}e.toString=t})),yo=o((e=>{var t=_o(),n=vo();function r(e){if(Array.isArray(e))return e.map(t.toKey);if(typeof e==`symbol`)return[e];e=n.toString(e);let r=[],i=e.length;if(i===0)return r;let a=0,o=``,s=``,c=!1;for(e.charCodeAt(0)===46&&(r.push(``),a++);a<i;){let t=e[a];s?t===`\\`&&a+1<i?(a++,o+=e[a]):t===s?s=``:o+=t:c?t===`"`||t===`'`?s=t:t===`]`?(c=!1,r.push(o),o=``):o+=t:t===`[`?(c=!0,o&&=(r.push(o),``)):t===`.`?o&&=(r.push(o),``):o+=t,a++}return o&&r.push(o),r}e.toPath=r})),bo=o((e=>{function t(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}e.compareValues=(e,n,r)=>{if(e!==n){let i=t(e),a=t(n);if(i===a&&i===0){if(e<n)return r===`desc`?1:-1;if(e>n)return r===`desc`?-1:1}return r===`desc`?a-i:i-a}return 0}})),xo=o((e=>{function t(e){return typeof e==`symbol`||e instanceof Symbol}e.isSymbol=t})),So=o((e=>{var t=xo(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(e,i){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||t.isSymbol(e)?!0:typeof e==`string`&&(r.test(e)||!n.test(e))||i!=null&&Object.hasOwn(i,e)}e.isKey=i})),Co=o((e=>{var t=yo(),n=bo(),r=So();function i(e,i,a,o){if(e==null)return[];a=o?void 0:a,Array.isArray(e)||(e=Object.values(e)),Array.isArray(i)||(i=i==null?[null]:[i]),i.length===0&&(i=[null]),Array.isArray(a)||(a=a==null?[]:[a]),a=a.map(e=>String(e));let s=(e,t)=>{let n=e;for(let e=0;e<t.length&&n!=null;++e)n=n[t[e]];return n},c=(e,t)=>t==null||e==null?t:typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:s(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?s(t,e):typeof t==`object`?t[e]:t,l=i.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||r.isKey(e)?e:{key:e,path:t.toPath(e)}));return e.map(e=>({original:e,criteria:l.map(t=>c(t,e))})).slice().sort((e,t)=>{for(let r=0;r<l.length;r++){let i=n.compareValues(e.criteria[r],t.criteria[r],a[r]);if(i!==0)return i}return 0}).map(e=>e.original)}e.orderBy=i})),wo=o((e=>{var t=lo(),n=go(),r=Co();function i(e,...i){let a=i.length;return a>1&&n.isIterateeCall(e,i[0],i[1])?i=[]:a>2&&n.isIterateeCall(i[0],i[1],i[2])&&(i=[i[0]]),r.orderBy(e,t.flatten(i),[`asc`])}e.sortBy=i})),To=o(((e,t)=>{t.exports=wo().sortBy}));function Eo(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Eo(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Do(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Eo(e))&&(r&&(r+=` `),r+=t);return r}var Oo=o((e=>{function t(e){return e===`__proto__`}e.isUnsafeProperty=t})),ko=o((e=>{function t(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}e.isDeepKey=t})),Ao=o((e=>{var t=Oo(),n=ko(),r=_o(),i=yo();function a(e,s,c){if(e==null)return c;switch(typeof s){case`string`:{if(t.isUnsafeProperty(s))return c;let r=e[s];return r===void 0?n.isDeepKey(s)?a(e,i.toPath(s),c):c:r}case`number`:case`symbol`:{typeof s==`number`&&(s=r.toKey(s));let t=e[s];return t===void 0?c:t}default:{if(Array.isArray(s))return o(e,s,c);if(s=Object.is(s?.valueOf(),-0)?`-0`:String(s),t.isUnsafeProperty(s))return c;let n=e[s];return n===void 0?c:n}}}function o(e,n,r){if(n.length===0)return r;let i=e;for(let e=0;e<n.length;e++){if(i==null||t.isUnsafeProperty(n[e]))return r;i=i[n[e]]}return i===void 0?r:i}e.get=a})),jo=o(((e,t)=>{t.exports=Ao().get})),Mo=4;function No(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:Mo),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function Po(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+No(i)+n},``)}var Fo=l(jo()),Io=e=>e===0?0:e>0?1:-1,Lo=e=>typeof e==`number`&&e!=+e,Ro=e=>typeof e==`string`&&e.length>1&&e.indexOf(`%`)===e.length-1,U=e=>(typeof e==`number`||e instanceof Number)&&!Lo(e),zo=e=>U(e)||typeof e==`string`,Bo=0,Vo=e=>{var t=++Bo;return`${e||``}${t}`},Ho=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!U(e)&&typeof e!=`string`)return n;var i;if(Ro(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return Lo(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},Uo=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Wo(e,t,n){return U(e)&&U(t)?No(e+n*(t-e)):t}function Go(e,t,n){if(!(!e||!e.length))return e.find(e=>e&&(typeof t==`function`?t(e):(0,Fo.default)(e,t))===n)}var Ko=e=>e==null,qo=e=>Ko(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function Jo(e){return e!=null}function Yo(){}var Xo=l(To());function Zo(){return Zo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zo.apply(null,arguments)}function Qo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $o(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Qo(Object(n),!0).forEach(function(t){es(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function es(e,t,n){return(t=ts(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ts(e){var t=ns(e,`string`);return typeof t==`symbol`?t:t+``}function ns(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function rs(e,t){return cs(e)||ss(e,t)||as(e,t)||is()}function is(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
9
+ `).replace(Md,``)}function Pd(e,t){return t=Nd(t),Nd(e)===t}function Z(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&qt(e,``+r);break;case`className`:jt(e,`class`,r);break;case`tabIndex`:jt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:jt(e,n,r);break;case`style`:Xt(e,r,o);break;case`data`:if(t!==`object`){jt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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 o==`function`&&(n===`formAction`?(t!==`input`&&Z(e,t,`name`,a.name,a,null),Z(e,t,`formEncType`,a.formEncType,a,null),Z(e,t,`formMethod`,a.formMethod,a,null),Z(e,t,`formTarget`,a.formTarget,a,null)):(Z(e,t,`encType`,a.encType,a,null),Z(e,t,`method`,a.method,a,null),Z(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`onScroll`:r!=null&&X(`scroll`,e);break;case`onScrollEnd`:r!=null&&X(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=en(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:X(`beforetoggle`,e),X(`toggle`,e),At(e,`popover`,r);break;case`xlinkActuate`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:At(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Qt.get(n)||n,At(e,n,r))}}function Fd(e,t,n,r,a,o){switch(n){case`style`:Xt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&qt(e,``+r);break;case`onScroll`:r!=null&&X(`scroll`,e);break;case`onScrollEnd`:r!=null&&X(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ct.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ut]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):At(e,n,r)}}}function Id(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:X(`error`,e),X(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Z(e,t,o,s,n,null)}}a&&Z(e,t,`srcSet`,n.srcSet,n,null),r&&Z(e,t,`src`,n.src,n,null);return;case`input`:X(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Z(e,t,r,d,n,null)}}Ht(e,o,c,l,u,s,a,!1);return;case`select`:for(a in X(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Z(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Wt(e,!!r,n,!0):Wt(e,!!r,t,!1);return;case`textarea`:for(s in X(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Z(e,t,s,c,n,null)}Kt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Z(e,t,l,r,n,null)}return;case`dialog`:X(`beforetoggle`,e),X(`toggle`,e),X(`cancel`,e),X(`close`,e);break;case`iframe`:case`object`:X(`load`,e);break;case`video`:case`audio`:for(r=0;r<yd.length;r++)X(yd[r],e);break;case`image`:X(`error`,e),X(`load`,e);break;case`details`:X(`toggle`,e);break;case`embed`:case`source`:case`link`:X(`error`,e),X(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Z(e,t,u,r,n,null)}return;default:if(Zt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Fd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Z(e,t,c,r,n,null))}function Ld(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Z(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Z(e,t,p,m,r,f)}}Vt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Z(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Z(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Wt(e,!!n,n?[]:``,!1):Wt(e,!!n,t,!0)):Wt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Z(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Z(e,t,s,a,r,o)}Gt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Z(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Z(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Z(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Z(e,t,u,p,r,m)}return;default:if(Zt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Fd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Fd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Z(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Z(e,t,f,p,r,m)}function Rd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function zd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Rd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Rd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Bd=null,Vd=null;function Hd(e){return e.nodeType===9?e:e.ownerDocument}function Ud(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Wd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Gd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Kd=null;function qd(){var e=window.event;return e&&e.type===`popstate`?e===Kd?!1:(Kd=e,!0):(Kd=null,!1)}var Jd=typeof setTimeout==`function`?setTimeout:void 0,Yd=typeof clearTimeout==`function`?clearTimeout:void 0,Xd=typeof Promise==`function`?Promise:void 0,Zd=typeof queueMicrotask==`function`?queueMicrotask:Xd===void 0?Jd:function(e){return Xd.resolve(null).then(e).catch(Qd)};function Qd(e){setTimeout(function(){throw e})}function $d(e){return e===`head`}function ef(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Pp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)hf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,hf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ht]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&hf(e.ownerDocument.body);n=i}while(n);Pp(t)}function tf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function nf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nf(n),gt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[ht])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=uf(e.nextSibling),e===null)break}return null}function af(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=uf(e.nextSibling),e===null))return null;return e}function of(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=uf(e.nextSibling),e===null))return null;return e}function sf(e){return e.data===`$?`||e.data===`$~`}function cf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function uf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var df=null;function ff(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return uf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function mf(e,t,n){switch(t=Hd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function hf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);gt(e)}var gf=new Map,_f=new Set;function vf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var yf=N.d;N.d={f:bf,r:xf,D:wf,C:Tf,L:Ef,m:Df,X:kf,S:Of,M:Af};function bf(){var e=yf.f(),t=xu();return e||t}function xf(e){var t=vt(e);t!==null&&t.tag===5&&t.type===`form`?Es(t):yf.r(e)}var Sf=typeof document>`u`?null:document;function Cf(e,t,n){var r=Sf;if(r&&typeof t==`string`&&t){var i=Bt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),_f.has(i)||(_f.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Id(t,`link`,e),xt(t),r.head.appendChild(t)))}}function wf(e){yf.D(e),Cf(`dns-prefetch`,e,null)}function Tf(e,t){yf.C(e,t),Cf(`preconnect`,e,t)}function Ef(e,t,n){yf.L(e,t,n);var r=Sf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Bt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Bt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Bt(n.imageSizes)+`"]`)):i+=`[href="`+Bt(e)+`"]`;var a=i;switch(t){case`style`:a=Mf(e);break;case`script`:a=Ff(e)}gf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),gf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Q(a))||t===`script`&&r.querySelector(If(a))||(t=r.createElement(`link`),Id(t,`link`,e),xt(t),r.head.appendChild(t)))}}function Df(e,t){yf.m(e,t);var n=Sf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Bt(r)+`"][href="`+Bt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Ff(e)}if(!gf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),gf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(If(a)))return}r=n.createElement(`link`),Id(r,`link`,e),xt(r),n.head.appendChild(r)}}}function Of(e,t,n){yf.S(e,t,n);var r=Sf;if(r&&e){var i=bt(r).hoistableStyles,a=Mf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Q(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=gf.get(a))&&zf(e,n);var c=o=r.createElement(`link`);xt(c),Id(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Rf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function kf(e,t){yf.X(e,t);var n=Sf;if(n&&e){var r=bt(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=m({src:e,async:!0},t),(t=gf.get(i))&&Bf(e,t),a=n.createElement(`script`),xt(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t){yf.M(e,t);var n=Sf;if(n&&e){var r=bt(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=gf.get(i))&&Bf(e,t),a=n.createElement(`script`),xt(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t,n,r){var a=(a=fe.current)?vf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Mf(n.href),n=bt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Mf(n.href);var o=bt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Q(e)))&&!o._p&&(s.instance=o,s.state.loading=5),gf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},gf.set(e,n),o||Pf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Ff(n),n=bt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Mf(e){return`href="`+Bt(e)+`"`}function Q(e){return`link[rel="stylesheet"][`+e+`]`}function Nf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Pf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Id(t,`link`,n),xt(t),e.head.appendChild(t))}function Ff(e){return`[src="`+Bt(e)+`"]`}function If(e){return`script[async]`+e}function Lf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Bt(n.href)+`"]`);if(r)return t.instance=r,xt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),xt(r),Id(r,`style`,a),Rf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Mf(n.href);var o=e.querySelector(Q(a));if(o)return t.state.loading|=4,t.instance=o,xt(o),o;r=Nf(n),(a=gf.get(a))&&zf(r,a),o=(e.ownerDocument||e).createElement(`link`),xt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Id(o,`link`,r),t.state.loading|=4,Rf(o,n.precedence,e),t.instance=o;case`script`:return o=Ff(n.src),(a=e.querySelector(If(o)))?(t.instance=a,xt(a),a):(r=n,(a=gf.get(o))&&(r=m({},n),Bf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),xt(a),Id(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Rf(r,n.precedence,e));return t.instance}function Rf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Vf=null;function Hf(e,t,n){if(Vf===null){var r=new Map,i=Vf=new Map;i.set(n,r)}else i=Vf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ht]||a[lt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Uf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Wf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Gf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Kf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Mf(r.href),a=t.querySelector(Q(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Yf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,xt(a);return}a=t.ownerDocument||t,r=Nf(r),(i=gf.get(i))&&zf(r,i),a=a.createElement(`link`),xt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Id(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Yf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var qf=0;function Jf(e,t){return e.stylesheets&&e.count===0&&Zf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Zf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&qf===0&&(qf=62500*zd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Zf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Yf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xf=null;function Zf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xf=new Map,t.forEach(Qf,e),Xf=null,Yf.call(e))}function Qf(e,t){if(!(t.state.loading&4)){var n=Xf.get(e);if(n)var r=n.get(null);else{n=new Map,Xf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Yf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var $f={$$typeof:C,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function ep(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Qe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qe(0),this.hiddenUpdates=Qe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function tp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ep(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=si(3,null,null,t),e.current=a,a.stateNode=e,t=oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},za(a),e}function np(e){return e?(e=ai,e):ai}function rp(e,t,n,r,i,a){i=np(i),r.context===null?r.context=i:r.pendingContext=i,r=Va(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ha(e,r,t),n!==null&&(gu(n,e,t),Ua(n,e,t))}function ip(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ap(e,t){ip(e,t),(e=e.alternate)&&ip(e,t)}function op(e){if(e.tag===13||e.tag===31){var t=ni(e,67108864);t!==null&&gu(t,e,67108864),ap(e,67108864)}}function sp(e){if(e.tag===13||e.tag===31){var t=mu();t=it(t);var n=ni(e,t);n!==null&&gu(n,e,t),ap(e,t)}}var cp=!0;function lp(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,dp(e,t,n,r)}finally{N.p=a,M.T=i}}function up(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,dp(e,t,n,r)}finally{N.p=a,M.T=i}}function dp(e,t,n,r){if(cp){var i=fp(r);if(i===null)Ed(e,t,r,pp,n),wp(e,r);else if(Ep(i,e,t,n,r))r.stopPropagation();else if(wp(e,r),t&4&&-1<Cp.indexOf(e)){for(;i!==null;){var a=vt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=P(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-He(o);s.entanglements[1]|=c,o&=~c}ad(a),!(zl&6)&&(ru=Ae()+500,od(0,!1))}}break;case 31:case 13:s=ni(a,2),s!==null&&gu(s,a,2),xu(),ap(a,2)}if(a=fp(r),a===null&&Ed(e,t,r,pp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ed(e,t,r,null,n)}}function fp(e){return e=rn(e),mp(e)}var pp=null;function mp(e){if(pp=null,e=_t(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return pp=e,null}function hp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(je()){case Me:return 2;case Ne:return 8;case Pe:case Fe:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var gp=!1,_p=null,vp=null,yp=null,bp=new Map,xp=new Map,Sp=[],Cp=`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 wp(e,t){switch(e){case`focusin`:case`focusout`:_p=null;break;case`dragenter`:case`dragleave`:vp=null;break;case`mouseover`:case`mouseout`:yp=null;break;case`pointerover`:case`pointerout`:bp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:xp.delete(t.pointerId)}}function Tp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=vt(t),t!==null&&op(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ep(e,t,n,r,i){switch(t){case`focusin`:return _p=Tp(_p,e,t,n,r,i),!0;case`dragenter`:return vp=Tp(vp,e,t,n,r,i),!0;case`mouseover`:return yp=Tp(yp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return bp.set(a,Tp(bp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,xp.set(a,Tp(xp.get(a)||null,e,t,n,r,i)),!0}return!1}function Dp(e){var t=_t(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,st(e.priority,function(){sp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,st(e.priority,function(){sp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Op(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=fp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);nn=r,n.target.dispatchEvent(r),nn=null}else return t=vt(n),t!==null&&op(t),e.blockedOn=n,!1;t.shift()}return!0}function kp(e,t,n){Op(e)&&n.delete(t)}function Ap(){gp=!1,_p!==null&&Op(_p)&&(_p=null),vp!==null&&Op(vp)&&(vp=null),yp!==null&&Op(yp)&&(yp=null),bp.forEach(kp),xp.forEach(kp)}function jp(e,n){e.blockedOn===n&&(e.blockedOn=null,gp||(gp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ap)))}var Mp=null;function Np(e){Mp!==e&&(Mp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Mp===e&&(Mp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(mp(r||n)===null)continue;break}var a=vt(n);a!==null&&(e.splice(t,3),t-=3,ws(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Pp(e){function t(t){return jp(t,e)}_p!==null&&jp(_p,e),vp!==null&&jp(vp,e),yp!==null&&jp(yp,e),bp.forEach(t),xp.forEach(t);for(var n=0;n<Sp.length;n++){var r=Sp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Sp.length&&(n=Sp[0],n.blockedOn===null);)Dp(n),n.blockedOn===null&&Sp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ut]||null;if(typeof a==`function`)o||Np(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ut]||null)s=o.formAction;else if(mp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Np(n)}}}function Fp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Ip(e){this._internalRoot=e}Lp.prototype.render=Ip.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;rp(n,mu(),e,t,null,null)},Lp.prototype.unmount=Ip.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;rp(e.current,2,null,e,null,null),xu(),t[I]=null}};function Lp(e){this._internalRoot=e}Lp.prototype.unstable_scheduleHydration=function(e){if(e){var t=ot();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Sp.length&&t!==0&&t<Sp[n].priority;n++);Sp.splice(n,0,e),n===0&&Dp(e)}};var Rp=n.version;if(Rp!==`19.2.7`)throw Error(i(527,Rp,`19.2.7`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var zp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Bp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bp.isDisabled&&Bp.supportsFiber)try{ze=Bp.inject(zp),Be=Bp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=qs,s=Js,c=Ys;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=tp(e,1,!1,null,null,n,r,null,o,s,c,Fp),e[I]=t.current,wd(e),new Ip(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},y=new class{#e=v;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function b(e){setTimeout(e,0)}var x=typeof window>`u`||`Deno`in globalThis;function S(){}function C(e,t){return typeof e==`function`?e(t):e}function w(e){return typeof e==`number`&&e>=0&&e!==1/0}function T(e,t){return Math.max(e+(t||0)-Date.now(),0)}function E(e,t){return typeof e==`function`?e(t):e}function D(e,t){return typeof e==`function`?e(t):e}function O(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ee(o,t.options))return!1}else if(!te(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function k(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(A(t.options.mutationKey)!==A(a))return!1}else if(!te(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ee(e,t){return(t?.queryKeyHashFn||A)(e)}function A(e){return JSON.stringify(e,(e,t)=>N(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function te(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>te(e[n],t[n])):!1}var j=Object.prototype.hasOwnProperty;function ne(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=M(e)&&M(t);if(!r&&!(N(e)&&N(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:j.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ne(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function re(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function M(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function N(e){if(!ie(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ie(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ie(e){return Object.prototype.toString.call(e)===`[object Object]`}function ae(e){return new Promise(t=>{y.setTimeout(t,e)})}function oe(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ne(e,t)}function se(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ce(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var le=Symbol();function ue(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===le?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function de(e,t){return typeof e==`function`?e(...t):!!e}function fe(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var pe=(()=>{let e=()=>x;return{isServer(){return e()},setIsServer(t){e=t}}})(),me=b;function he(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=me,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var ge=he(),_e=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),w(this.gcTime)&&(this.#e=y.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(pe.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(y.clearTimeout(this.#e),this.#e=void 0)}},ve=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ye=new class extends ve{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},be=new class extends ve{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function xe(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}function Se(e){return Math.min(1e3*2**e,3e4)}function Ce(e){return(e??`online`)===`online`?be.isOnline():!0}var we=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Te(e){let t=!1,n=0,r,i=xe(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new we(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>ye.isFocused()&&(e.networkMode===`always`||be.isOnline())&&e.canRun(),u=()=>Ce(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(pe.isServer()?0:3),o=e.retryDelay??Se,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),ae(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Ee=class extends _e{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||De(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Te({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),ge.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function De(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Oe=class extends ve{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),re(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&A(t.mutationKey)!==A(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??De();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){ge.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function ke(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{fe(e,()=>t.signal,()=>n=!0)},u=ue(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?ce:se;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?je:Ae,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Ae(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Ae(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function je(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Me=class extends _e{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Fe(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Fe(this.options);e.data!==void 0&&(this.setState(Pe(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=oe(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(S).catch(S):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>D(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===le||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>E(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!T(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ue(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?ke(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Te({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof we&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof we){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ne(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Pe(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),ge.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Ne(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ce(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Pe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Fe(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ie=class extends ve{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??ee(r,t),a=this.get(i);return a||(a=new Me({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ge.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>O(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>O(e,t)):t}notify(e){ge.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ge.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ge.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Le=class extends ve{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Ee({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Re(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Re(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Re(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Re(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ge.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>k(t,e))}findAll(e={}){return this.getAll().filter(t=>k(e,t))}notify(e){ge.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ge.batch(()=>Promise.all(e.map(e=>e.continue().catch(S))))}};function Re(e){return e.options.scope?.id}var ze=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ie,this.#t=e.mutationCache||new Le,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ye.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=be.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(E(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=C(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ge.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ge.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ge.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=ge.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(S).catch(S)}invalidateQueries(e,t={}){return ge.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ge.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(S)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(S)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(E(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(S).catch(S)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(S).catch(S)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return be.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(A(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{te(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(A(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{te(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ee(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===le&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Be=class extends ve{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=xe(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),He(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ue(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ue(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof D(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!re(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&We(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||D(this.options.enabled,this.#t)!==D(t.enabled,this.#t)||E(this.options.staleTime,this.#t)!==E(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||D(this.options.enabled,this.#t)!==D(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Ke(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(S)),t}#g(){this.#b();let e=E(this.options.staleTime,this.#t);if(pe.isServer()||this.#r.isStale||!w(e))return;let t=T(this.#r.dataUpdatedAt,e)+1;this.#d=y.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(pe.isServer()||D(this.options.enabled,this.#t)===!1||!w(this.#p)||this.#p===0)&&(this.#f=y.setInterval(()=>{(this.options.refetchIntervalInBackground||ye.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(y.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(y.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&He(e,t),o=i&&We(e,n,t,r);(a||o)&&(l={...l,...Ne(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=oe(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=oe(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Ge(e,t),refetch:this.refetch,promise:this.#o,isEnabled:D(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=xe())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!re(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){ge.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Ve(e,t){return D(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&D(t.retryOnMount,e)===!1)}function He(e,t){return Ve(e,t)||e.state.data!==void 0&&Ue(e,t,t.refetchOnMount)}function Ue(e,t,n){if(D(t.enabled,e)!==!1&&E(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Ge(e,t)}return!1}function We(e,t,n,r){return(e!==t||D(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Ge(e,n)}function Ge(e,t){return D(t.enabled,e)!==!1&&e.isStaleByTime(E(t.staleTime,e))}function Ke(e,t){return!re(e.getCurrentResult(),t)}var qe=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Je=o(((e,t)=>{t.exports=qe()})),P=l(d(),1),F=Je(),Ye=P.createContext(void 0),Xe=e=>{let t=P.useContext(Ye);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Ze=({client:e,children:t})=>(P.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,F.jsx)(Ye.Provider,{value:e,children:t}));function Qe(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $e=P.createContext(Qe()),et=()=>P.useContext($e),tt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?de(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},nt=e=>{P.useEffect(()=>{e.clearReset()},[e])},rt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||de(n,[e.error,r])),it=P.createContext(!1),at=()=>P.useContext(it);it.Provider;var ot=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},st=(e,t)=>e.isLoading&&e.isFetching&&!t,ct=(e,t)=>e?.suspense&&t.isPending,lt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ut(e,t,n){let r=at(),i=et(),a=Xe(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,ot(o),tt(o,i,s),nt(i);let l=!a.getQueryCache().get(o.queryHash),[u]=P.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(P.useSyncExternalStore(P.useCallback(e=>{let t=f?u.subscribe(ge.batchCalls(e)):S;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),P.useEffect(()=>{u.setOptions(o)},[o,u]),ct(o,d))throw lt(o,u,i);if(rt({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!pe.isServer()&&st(d,r)&&(l?lt(o,u,i):s?.promise)?.catch(S).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function I(e,t){return ut(e,Be,t)}function dt(e,t){let n=Xe(t),[r]=P.useState(()=>new Oe(n,e));P.useEffect(()=>{r.setOptions(e)},[r,e]);let i=P.useSyncExternalStore(P.useCallback(e=>r.subscribe(ge.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=P.useCallback((e,t)=>{r.mutate(e,t).catch(S)},[r]);if(i.error&&de(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var ft=_();function pt(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var mt=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),ht=o(((e,t)=>{t.exports=mt()})),gt=ht(),_t=P.useInsertionEffect,vt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect,yt=_t||vt,bt=e=>{let t=P.useRef([e,(...e)=>t[0](...e)]).current;return yt(()=>{t[0]=e}),t[1]},xt=`popstate`,St=`pushState`,Ct=`replaceState`,wt=[xt,St,Ct,`hashchange`],Tt=e=>{for(let t of wt)addEventListener(t,e);return()=>{for(let t of wt)removeEventListener(t,e)}},Et=(e,t)=>(0,gt.useSyncExternalStore)(Tt,e,t),Dt=()=>location.search,Ot=({ssrSearch:e}={})=>Et(Dt,e==null?Dt:()=>e),kt=()=>location.pathname,At=({ssrPath:e}={})=>Et(kt,e==null?kt:()=>e),jt=(e,{replace:t=!1,state:n=null}={})=>history[t?Ct:St](n,``,e),Mt=(e={})=>[At(e),jt],Nt=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[Nt]===void 0){for(let e of[St,Ct]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,Nt,{value:!0})}var Pt=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?`~`+t:t.slice(e.length)||`/`,Ft=(e=``)=>e===`/`?``:e,It=(e,t)=>e[0]===`~`?e.slice(1):Ft(t)+e,Lt=(e=``,t)=>Pt(Rt(Ft(e)),Rt(t)),Rt=e=>{try{return decodeURI(e)}catch{return e}},zt={hook:Mt,searchHook:Ot,parser:pt,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,n)=>e(t,n)},Bt=(0,P.createContext)(zt),Vt=()=>(0,P.useContext)(Bt),Ht={},Ut=(0,P.createContext)(Ht),Wt=()=>(0,P.useContext)(Ut),Gt=e=>{let[t,n]=e.hook(e);return[Lt(e.base,t),bt((t,r)=>e.aroundNav(n,It(t,e.base),r))]},Kt=()=>Gt(Vt()),qt=(e,t,n,r)=>{let{pattern:i,keys:a}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||`*`,r),o=i.exec(n)||[],[s,...c]=o;return s===void 0?[!1,null]:[!0,(()=>{let e=a===!1?o.groups:Object.fromEntries(a.map((e,t)=>[e,c[t]])),t={...c};return e&&Object.assign(t,e),t})(),...r?[s]:[]]},Jt=({children:e,...t})=>{let n=Vt(),r=t.hook?zt:n,i=r,[a,o=t.ssrSearch??``]=t.ssrPath?.split(`?`)??[];a&&(t.ssrSearch=o,t.ssrPath=a),t.hrefs=t.hrefs??t.hook?.hrefs,t.searchHook=t.searchHook??t.hook?.searchHook;let s=(0,P.useRef)({}),c=s.current,l=c;for(let e in r){let n=e===`base`?r[e]+(t[e]??``):t[e]??r[e];c===l&&n!==l[e]&&(s.current=l={...l}),l[e]=n,(n!==r[e]||n!==i[e])&&(i=l)}return(0,P.createElement)(Bt.Provider,{value:i,children:e})},Yt=({children:e,component:t},n)=>t?(0,P.createElement)(t,{params:n}):typeof e==`function`?e(n):e,Xt=e=>{let t=(0,P.useRef)(Ht),n=t.current;return t.current=Object.keys(e).length!==Object.keys(n).length||Object.entries(e).some(([e,t])=>t!==n[e])?e:n},Zt=({path:e,nest:t,match:n,...r})=>{let i=Vt(),[a]=Gt(i),[o,s,c]=n??qt(i.parser,e,a,t),l=Xt({...Wt(),...s});if(!o)return null;let u=c?(0,P.createElement)(Jt,{base:c},Yt(r,l)):Yt(r,l);return(0,P.createElement)(Ut.Provider,{value:l,children:u})},Qt=(0,P.forwardRef)((e,t)=>{let n=Vt(),[r,i]=Gt(n),{to:a=``,href:o=a,onClick:s,asChild:c,children:l,className:u,replace:d,state:f,transition:p,...m}=e,h=bt(t=>{t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0||(s?.(t),t.defaultPrevented||(t.preventDefault(),i(o,e)))}),g=n.hrefs(o[0]===`~`?o.slice(1):n.base+o,n);return c&&(0,P.isValidElement)(l)?(0,P.cloneElement)(l,{onClick:h,href:g}):(0,P.createElement)(`a`,{...m,onClick:h,href:g,className:u?.call?u(r===o):u,children:l,ref:t})}),$t=e=>Array.isArray(e)?e.flatMap(e=>$t(e&&e.type===P.Fragment?e.props.children:e)):[e],en=({children:e,location:t})=>{let n=Vt(),[r]=Gt(n);for(let i of $t(e)){let e=0;if((0,P.isValidElement)(i)&&(e=qt(n.parser,i.props.path,t||r,i.props.nest))[0])return(0,P.cloneElement)(i,{match:e})}return null},tn=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),nn=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),rn=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),an=e=>{let t=rn(e);return t.charAt(0).toUpperCase()+t.slice(1)},on={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},sn=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},cn=(0,P.createContext)({}),ln=()=>(0,P.useContext)(cn),un=(0,P.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=ln()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,P.createElement)(`svg`,{ref:c,...on,width:t??l??on.width,height:t??l??on.height,stroke:e??f,strokeWidth:m,className:tn(`lucide`,p,i),...!a&&!sn(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,P.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),dn=(e,t)=>{let n=(0,P.forwardRef)(({className:n,...r},i)=>(0,P.createElement)(un,{ref:i,iconNode:t,className:tn(`lucide-${nn(an(e))}`,`lucide-${e}`,n),...r}));return n.displayName=an(e),n},fn=dn(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),pn=dn(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),mn=dn(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),hn=dn(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),gn=dn(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),_n=dn(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),vn=dn(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),yn=dn(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),bn=dn(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),xn=dn(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Sn=dn(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Cn=dn(`trending-up`,[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]),wn=dn(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Tn=e=>Symbol.iterator in e,En=e=>`entries`in e,Dn=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},On=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function kn(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:Tn(e)&&Tn(t)?En(e)&&En(t)?Dn(e,t):On(e,t):Dn({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function An(e){let t=P.useRef(void 0);return n=>{let r=e(n);return kn(t.current,r)?t.current:t.current=r}}var jn=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Mn=(e=>e?jn(e):jn),Nn=e=>e;function Pn(e,t=Nn){let n=P.useSyncExternalStore(e.subscribe,P.useCallback(()=>t(e.getState()),[e,t]),P.useCallback(()=>t(e.getInitialState()),[e,t]));return P.useDebugValue(n),n}var Fn=e=>{let t=Mn(e),n=e=>Pn(t,e);return Object.assign(n,t),n},In=(e=>e?Fn(e):Fn),Ln=20,Rn=10,zn=In(e=>({connected:!1,recentToolCalls:[],cost:null,antiPatterns:[],contextBySession:new Map,firingAlerts:new Map,dismissedAlerts:new Set,activeSessionId:null,setConnected:t=>e({connected:t}),setActiveSession:t=>e(e=>{if(e.activeSessionId===t)return{};let n=e=>t===null?e===void 0:e===t;return{activeSessionId:t,recentToolCalls:e.recentToolCalls.filter(e=>n(e.sessionId)),antiPatterns:e.antiPatterns.filter(e=>n(e.sessionId)),cost:e.cost&&n(e.cost.sessionId)?e.cost:null}}),pushToolCall:t=>e(e=>{if(e.recentToolCalls.some(e=>e.id===t.id))return{};let n=[...e.recentToolCalls,t];return{recentToolCalls:n.length>Ln?n.slice(n.length-Ln):n}}),setCost:t=>e({cost:t}),setContext:t=>e(e=>{let n=new Map(e.contextBySession);return n.set(t.sessionId,t),{contextBySession:n}}),pushAntiPattern:t=>e(e=>{let n=[...e.antiPatterns,t];return{antiPatterns:n.length>Rn?n.slice(n.length-Rn):n}}),addOrUpdateAlert:t=>e(e=>{let n=new Map(e.firingAlerts);if(t.state===`firing`)n.set(t.id,t);else if(n.delete(t.id),e.dismissedAlerts.has(t.id)){let r=new Set(e.dismissedAlerts);return r.delete(t.id),{firingAlerts:n,dismissedAlerts:r}}return{firingAlerts:n}}),clearAlert:t=>e(e=>{if(!e.firingAlerts.has(t))return e;let n=new Map(e.firingAlerts);return n.delete(t),{firingAlerts:n}}),dismissAlert:t=>e(e=>{if(e.dismissedAlerts.has(t))return e;let n=new Set(e.dismissedAlerts);return n.add(t),{dismissedAlerts:n}})})),Bn={info:0,warning:1,critical:2};function Vn(e){let t=[];for(let n of e.firingAlerts.values())e.dismissedAlerts.has(n.id)||t.push(n);return t.sort((e,t)=>{let n=Bn[t.severity]-Bn[e.severity];return n===0?e.firedAt-t.firedAt:n}),t}function Hn(e){let t=null;for(let n of e.firingAlerts.values())e.dismissedAlerts.has(n.id)||(t===null||Bn[n.severity]>Bn[t])&&(t=n.severity);return t}function Un(){let e=zn(An(Vn)),t=zn(Hn),n=zn(e=>e.dismissAlert);return{alerts:e,maxSeverity:t,count:e.length,dismiss:n}}var Wn=class extends Error{constructor(e){super(`Not found: ${e}`),this.name=`NotFoundError`}};async function Gn(e){let t=await fetch(e);if(t.status===404)throw new Wn(e);if(!t.ok)throw Error(`${t.status} ${t.statusText} for ${e}`);return await t.json()}var Kn=()=>Gn(`/api/health`),qn=()=>Gn(`/api/session/current`),Jn=(e=50)=>Gn(`/api/sessions?limit=${e}`),Yn=()=>Gn(`/api/sessions/today/aggregate`),Xn=()=>Gn(`/api/sessions/live`),Zn=e=>Gn(`/api/sessions/${encodeURIComponent(e)}`),Qn=()=>Gn(`/api/cost`),$n=()=>Gn(`/api/anti-patterns`),er=()=>Gn(`/api/audit`),tr=()=>Gn(`/api/weekly`),nr=()=>Gn(`/api/budget`),rr=()=>Gn(`/api/latency`),ir=(e=30)=>Gn(`/api/cost-per-outcome?days=${e}`),ar=()=>Gn(`/api/personal-coach`),or=()=>Gn(`/api/alerts/recent`),sr=e=>Gn(`/api/sessions/${encodeURIComponent(e)}/replay`),cr=()=>Gn(`/api/quality-proxy`),lr=()=>Gn(`/api/tool-selection-score`),ur=()=>Gn(`/api/git-efficiency`),dr=()=>Gn(`/api/git-efficiency/repos`),fr=()=>Gn(`/api/concurrency`),pr=(e=30)=>Gn(`/api/concurrency?view=history&days=${e}`);function mr(e,t){return Gn(`/api/activity-heatmap?view=${encodeURIComponent(e)}${t?`&weeks=${t}`:``}`)}var hr=e=>Gn(e?`/api/context?sessionId=${encodeURIComponent(e)}`:`/api/context`),gr=()=>Gn(`/api/model-usage`),_r=()=>Gn(`/api/cache-health`),vr=()=>Gn(`/api/settings`),yr=()=>Gn(`/api/diagnostics`),br=e=>fetch(`/api/settings`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}).then(async e=>{if(!e.ok)throw Error(`${e.status} ${e.statusText}`);return await e.json()}),xr=()=>fetch(`/api/digest/send`,{method:`POST`}).then(async e=>{if(!e.ok)throw Error(`${e.status} ${e.statusText}`);return await e.json()}),L={sessionCurrent:[`session`,`current`],sessionToday:[`session`,`today`],sessionsList:e=>[`sessions`,`list`,e],sessionDetail:e=>[`session`,e],cost:[`cost`],antiPatterns:[`anti-patterns`],audit:[`audit`],weekly:[`weekly`],budget:[`budget`],latency:[`latency`],costPerOutcome:e=>[`cost-per-outcome`,e],personalCoach:[`personal-coach`],alertsRecent:[`alerts`,`recent`],sessionReplay:e=>[`session`,e,`replay`],qualityProxy:[`quality-proxy`],toolSelectionScore:[`tool-selection-score`],gitEfficiency:[`git-efficiency`],gitEfficiencyRepos:[`git-efficiency-repos`],concurrency:[`concurrency`],concurrencyHistory:e=>[`concurrency`,`history`,e],activityHeatmap:e=>[`activity-heatmap`,e],context:[`context`],modelUsage:[`model-usage`],cacheHealth:[`cache-health`],settings:[`settings`],sessionsLive:[`sessions`,`live`],sessionsTodayAggregate:[`sessions`,`today`,`aggregate`],diagnostics:[`diagnostics`]},Sr={installed:null,latest:null,updateAvailable:!1};function Cr(){let[e,t]=(0,P.useState)(Sr);return(0,P.useEffect)(()=>{let e=!0;return Kn().then(n=>{e&&t({installed:n.version,latest:n.latestVersion,updateAvailable:n.updateAvailable})}).catch(()=>{}),()=>{e=!1}},[]),e}var wr={none:``,sm:`p-3`,md:`p-4`,lg:`p-5`},Tr={default:`glass-card`,elevated:`glass-card bg-surface-5`,static:`glass-card glass-card-static`,danger:`glass-card glass-card-static border border-accent-red/60`,warning:`glass-card glass-card-static border border-accent-amber/40`},Er={none:``,green:`glow-green`,purple:`glow-purple`};function R({children:e,padding:t=`md`,tone:n=`default`,glow:r=`none`,className:i=``}){return(0,F.jsx)(`div`,{className:[Tr[n],wr[t],Er[r],i].filter(Boolean).join(` `),children:e})}var Dr={primary:`bg-accent-green/10 border border-accent-green/40 text-accent-green hover:bg-accent-green/20`,secondary:`bg-surface-5 border border-border-medium text-ink-subtle hover:border-border-strong hover:text-ink-base`,ghost:`bg-transparent border border-transparent text-ink-muted hover:text-ink-base hover:bg-surface-5`,danger:`bg-surface-5 border border-border-subtle text-ink-muted hover:border-accent-red hover:text-accent-red`},Or={sm:`px-2 py-1 text-xs`,md:`px-3 py-1.5 text-xs`};function kr({children:e,variant:t=`secondary`,size:n=`md`,disabled:r=!1,loading:i=!1,type:a=`button`,className:o=``,...s}){let c=r||i,l=[`inline-flex items-center justify-center gap-1.5 rounded-md transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 focus-visible:ring-offset-1 focus-visible:ring-offset-bg-deep`,Dr[t],Or[n],c?`opacity-50 cursor-not-allowed`:``,o].filter(Boolean).join(` `);return(0,F.jsx)(`button`,{type:a,disabled:c,"aria-busy":i||void 0,className:l,...s,children:e})}var Ar={neutral:`bg-surface-5 text-ink-subtle`,info:`bg-accent-blue/15 text-accent-blue`,success:`bg-accent-green/15 text-accent-green`,warning:`bg-accent-amber/20 text-accent-amber`,danger:`bg-accent-red/20 text-accent-red`},jr={neutral:`border border-border-medium`,info:`border border-accent-blue/30`,success:`border border-accent-green/30`,warning:`border border-accent-amber/30`,danger:`border border-accent-red/30`},Mr={sm:`px-1.5 py-0.5 text-[10px]`,md:`px-2 py-0.5 text-[11px]`};function Nr({children:e,tone:t=`neutral`,size:n=`md`,uppercase:r=!1,bordered:i=!1,className:a=``,...o}){return(0,F.jsx)(`span`,{className:[`inline-flex items-center gap-1 rounded-full`,Ar[t],Mr[n],i?jr[t]:``,r?`uppercase tracking-wider font-semibold`:``,a].filter(Boolean).join(` `),...o,children:e})}var Pr={sm:`text-[9px]`,md:`text-[10px]`};function Fr({label:e=`LIVE`,pulse:t=!0,size:n=`md`,className:r=``}){return(0,F.jsxs)(`span`,{className:[`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full`,`bg-accent-cyan/15 text-accent-cyan uppercase tracking-wider font-semibold`,Pr[n],r].filter(Boolean).join(` `),children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`w-1.5 h-1.5 rounded-full bg-accent-cyan ${t?`animate-pulse`:``}`}),e]})}var Ir={sm:`px-2 py-0.5 text-[10px] rounded-md`,md:`px-3 py-1 text-xs rounded-md`},Lr={green:`bg-accent-green/20 text-accent-green font-medium`,cyan:`bg-accent-cyan/20 text-accent-cyan font-medium`};function Rr({value:e,onChange:t,options:n,size:r=`md`,tone:i=`green`,ariaLabel:a,className:o=``}){return(0,F.jsx)(`div`,{role:`tablist`,"aria-label":a,className:[`inline-flex items-center gap-1`,o].filter(Boolean).join(` `),children:n.map(n=>{let a=n.value===e;return(0,F.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":a,onClick:()=>t(n.value),className:[`transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-cyan/40 focus-visible:ring-offset-1 focus-visible:ring-offset-bg-deep`,Ir[r],a?Lr[i]:`text-ink-muted hover:text-ink-base`].join(` `),children:n.label},n.value)})})}function z({children:e,as:t=`div`,className:n=``}){let r=[`text-[10px] text-ink-muted uppercase tracking-wider font-medium`,n].filter(Boolean).join(` `);return t===`h2`?(0,F.jsx)(`h2`,{className:r,children:e}):t===`h3`?(0,F.jsx)(`h3`,{className:r,children:e}):(0,F.jsx)(`div`,{className:r,children:e})}function zr({title:e,subtitle:t,action:n,className:r=``}){return(0,F.jsxs)(`div`,{className:[`flex items-start justify-between gap-3 mb-3`,r].filter(Boolean).join(` `),children:[(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`text-sm font-medium text-ink-base`,children:e}),t!=null&&(0,F.jsx)(`div`,{className:`text-xs text-ink-muted`,children:t})]}),n!=null&&(0,F.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:n})]})}var Br=[{path:`/`,label:`Today`,Icon:fn},{path:`/sessions`,label:`Sessions`,Icon:gn}],Vr=[{path:`/history`,label:`History`,Icon:Cn},{path:`/git`,label:`Git`,Icon:vn},{path:`/audit`,label:`Audit`,Icon:xn}],Hr=[{path:`/settings`,label:`Settings`,Icon:bn},{path:`/alerts`,label:`Alerts`,Icon:pn}],Ur={info:`neutral`,warning:`warning`,critical:`danger`};function Wr({currentPath:e,onNavigate:t,connected:n,theme:r,onToggleTheme:i}){let{count:a,maxSeverity:o}=Un(),s=Cr();function c({path:n,label:r,Icon:i}){let s=e===n,c=n===`/`&&a>0,l=o??`info`;return(0,F.jsxs)(`button`,{type:`button`,"aria-current":s?`page`:void 0,onClick:()=>t(n),className:`flex items-center gap-2.5 px-3 py-2 rounded-lg text-xs text-left transition-colors duration-150 `+(s?`border-l-[3px] border-l-accent-green bg-accent-green/8 text-ink-base font-medium pl-2.5`:`border-l-[3px] border-l-transparent text-ink-subtle hover:text-ink-base hover:bg-surface-3`),children:[(0,F.jsx)(i,{size:14,"aria-hidden":`true`,focusable:`false`}),(0,F.jsx)(`span`,{children:r}),c&&(0,F.jsx)(Nr,{tone:Ur[l],size:`sm`,className:`ml-auto font-semibold tabular-nums`,"data-testid":`alert-badge`,"data-severity":l,"aria-label":`${a>99?`99+`:a} firing ${a===1?`alert`:`alerts`}`,children:a>99?`99+`:a})]},n)}return(0,F.jsxs)(`aside`,{className:`w-52 bg-bg-deep border-r border-border-subtle p-4 flex flex-col`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,F.jsxs)(`svg`,{width:`22`,height:`22`,viewBox:`0 0 128 128`,"aria-hidden":`true`,children:[(0,F.jsx)(`rect`,{width:`128`,height:`128`,rx:`24`,fill:`url(#preflightGrad)`}),(0,F.jsx)(`path`,{d:`M21.1599 74.0495L29.1148 66.0946L45.3429 68.9583L56.7981 57.5032L21.1599 42.2297L30.7058 32.6838L73.9808 40.3205L87.9815 26.3198C89.7316 24.5697 91.8529 23.6947 94.3454 23.6947C96.838 23.6947 98.9593 24.5697 100.709 26.3198C102.459 28.0699 103.335 30.1912 103.335 32.6838C103.335 35.1763 102.459 37.2976 100.709 39.0477L86.7087 53.0484L94.3454 96.3234L84.7995 105.869L69.526 70.2311L58.0709 81.6863L60.9346 97.9144L52.9797 105.869L41.8428 85.1864L21.1599 74.0495Z`,fill:`#080F11`}),(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`preflightGrad`,x1:`64`,y1:`0`,x2:`64`,y2:`128`,gradientUnits:`userSpaceOnUse`,children:[(0,F.jsx)(`stop`,{offset:`0.12`,stopColor:`#D2FA37`}),(0,F.jsx)(`stop`,{offset:`0.88`,stopColor:`#1CE783`})]})})]}),(0,F.jsx)(`span`,{className:`font-semibold text-sm tracking-tight brand-text`,children:`Preflight`}),(0,F.jsx)(`span`,{className:`text-ink-muted text-[10px] leading-none select-none`,children:`|`}),(0,F.jsx)(`span`,{className:`text-ink-muted text-[9px] leading-none`,children:`by`}),(0,F.jsxs)(`svg`,{width:`46`,height:`9`,viewBox:`0 0 819.12 159.36`,"aria-label":`New Relic`,fill:`currentColor`,className:`text-ink-subtle flex-shrink-0`,children:[(0,F.jsx)(`polygon`,{points:`68.85 .18 8.05 35.28 34.54 50.57 68.85 30.76 111.21 55.22 111.21 104.14 76.9 123.95 76.9 154.53 137.7 119.43 137.7 39.93 68.85 .18`}),(0,F.jsx)(`polygon`,{points:`42.36 94.97 42.36 143.89 68.85 159.18 68.85 79.68 0 39.93 0 70.51 42.36 94.97`}),(0,F.jsx)(`path`,{d:`M232.21,39.81c-14.82,0-21.84,9.36-21.84,9.36h-.78l-1.56-7.8h-17.94v79.57h19.5v-46.03c0-10.14,7.02-17.16,17.16-17.16s17.16,7.02,17.16,17.16v46.03h19.5v-47.59c0-20.28-13.26-33.55-31.21-33.55Z`}),(0,F.jsx)(`polygon`,{points:`442.54 93.64 441.42 93.64 428.15 41.38 408.31 41.38 395.05 93.64 393.93 93.64 380.67 41.38 360.39 41.38 380.67 120.95 404.41 120.95 417.67 69.46 418.79 69.46 432.06 120.95 455.8 120.95 476.08 41.38 455.8 41.38 442.54 93.64`}),(0,F.jsx)(`path`,{d:`M535.8,48.4h-.78l-1.56-7.02h-16.38v79.57h19.5v-46.02c0-10.14,4.68-14.82,14.82-14.82h10.04v-18.72h-11.6c-9.36,0-14.04,7.02-14.04,7.02Z`}),(0,F.jsx)(`path`,{d:`M604.56,39.82c-23.4,0-40.56,17.16-40.56,41.34s16.19,41.34,40.56,41.34c19.73,0,31.61-11.61,36.56-20.15l-17.9-6.38c-1.78,3.24-8.91,9.47-18.66,9.47-11.37,0-19.5-7.12-21.06-18.04h59.29s.78-3.12.78-7.8c0-22.62-17.16-39.78-39-39.78ZM583.5,74.14c2.34-10.14,9.36-17.94,21.06-17.94,10.92,0,17.94,7.8,19.5,17.94h-40.56Z`}),(0,F.jsx)(`path`,{d:`M316.44,39.82c-23.4,0-40.56,17.16-40.56,41.34s16.19,41.34,40.56,41.34c19.73,0,31.61-11.61,36.56-20.15l-17.9-6.38c-1.78,3.24-8.91,9.47-18.66,9.47-11.37,0-19.5-7.12-21.06-18.04h59.29s.78-3.12.78-7.8c0-22.62-17.16-39.78-39-39.78ZM295.38,74.14c2.34-10.14,9.36-17.94,21.06-17.94,10.92,0,17.94,7.8,19.5,17.94h-40.56Z`}),(0,F.jsx)(`rect`,{x:`692.24`,y:`9.96`,width:`19.5`,height:`19.5`}),(0,F.jsx)(`path`,{d:`M765.56,104.56c-11.7,0-21.06-9.36-21.06-23.4s9.36-23.4,21.06-23.4,16.38,7.8,17.94,12.48l17.66-6.28c-4.27-11.11-14.77-24.14-35.6-24.14-23.4,0-40.56,17.16-40.56,41.34s17.16,41.34,40.56,41.34c21,0,31.5-13.25,35.71-24.88l-17.77-6.32c-1.56,5.46-6.24,13.26-17.94,13.26Z`}),(0,F.jsx)(`polygon`,{points:`645.72 27.3 656.79 27.3 656.79 120.95 676.3 120.95 676.3 9.96 645.72 9.96 645.72 27.3`}),(0,F.jsx)(`rect`,{x:`692.24`,y:`41.38`,width:`19.5`,height:`79.57`}),(0,F.jsx)(`path`,{d:`M811.7,105.65c-4.28,0-7.42,3.24-7.42,7.52s3.13,7.52,7.42,7.52,7.42-3.24,7.42-7.52-3.13-7.52-7.42-7.52ZM811.7,119.54c-3.66,0-6.27-2.72-6.27-6.37s2.61-6.37,6.27-6.37,6.27,2.72,6.27,6.37-2.61,6.37-6.27,6.37Z`}),(0,F.jsx)(`path`,{d:`M814.94,111.81c0-1.46-1.15-2.61-2.82-2.61h-3.34v7.83h1.15v-2.72h1.04l2.72,2.72h1.46l-2.72-2.72c1.46-.1,2.51-1.15,2.51-2.51ZM809.93,113.17v-2.82h2.19c1.04,0,1.67.63,1.67,1.46s-.52,1.36-1.67,1.36h-2.19Z`})]})]}),(0,F.jsx)(`div`,{className:`text-ink-muted text-[10px] tracking-wide mb-6`,children:`local · single-user`}),(0,F.jsx)(`div`,{className:`text-[10px] font-medium text-ink-muted uppercase tracking-wider mb-2 px-2`,children:`Observe`}),(0,F.jsx)(`nav`,{"aria-label":`Observe`,className:`flex flex-col gap-0.5 mb-4`,children:Br.map(e=>c(e))}),(0,F.jsx)(`div`,{className:`text-[10px] font-medium text-ink-muted uppercase tracking-wider mb-2 px-2`,children:`Analyze`}),(0,F.jsx)(`nav`,{"aria-label":`Analyze`,className:`flex flex-col gap-0.5 mb-4`,children:Vr.map(e=>c(e))}),(0,F.jsx)(`div`,{className:`text-[10px] font-medium text-ink-muted uppercase tracking-wider mb-2 px-2`,children:`Configure`}),(0,F.jsx)(`nav`,{"aria-label":`Configure`,className:`flex flex-col gap-0.5`,children:Hr.map(e=>c(e))}),(0,F.jsxs)(`div`,{className:`mt-auto`,children:[(0,F.jsxs)(`a`,{href:`https://newrelic.com/platform/ai-observability`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 px-2.5 py-2 rounded-md text-ink-subtle border border-accent-green/20 bg-accent-green/5 hover:bg-accent-green/10 hover:border-accent-green/50 hover:text-ink-base hover:shadow-[0_0_8px_rgba(28,231,131,0.35),0_0_20px_rgba(28,231,131,0.15)] transition-all duration-300 group/cta mb-2`,children:[(0,F.jsxs)(`svg`,{width:`11`,height:`13`,viewBox:`0 0 138 160`,fill:`currentColor`,"aria-hidden":`true`,className:`flex-shrink-0 text-accent-green opacity-75 group-hover/cta:opacity-100 transition-opacity`,children:[(0,F.jsx)(`polygon`,{points:`68.85 .18 8.05 35.28 34.54 50.57 68.85 30.76 111.21 55.22 111.21 104.14 76.9 123.95 76.9 154.53 137.7 119.43 137.7 39.93 68.85 .18`}),(0,F.jsx)(`polygon`,{points:`42.36 94.97 42.36 143.89 68.85 159.18 68.85 79.68 0 39.93 0 70.51 42.36 94.97`})]}),(0,F.jsx)(`span`,{className:`text-xs flex-1 leading-tight`,children:`Try AI Observability`}),(0,F.jsxs)(`svg`,{width:`8`,height:`8`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:`flex-shrink-0 opacity-50 group-hover/cta:opacity-80 transition-opacity`,children:[(0,F.jsx)(`polyline`,{points:`15 3 21 3 21 9`}),(0,F.jsx)(`line`,{x1:`10`,y1:`14`,x2:`21`,y2:`3`})]})]}),(0,F.jsx)(`div`,{className:`pt-3 border-t border-border-subtle`,children:(0,F.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1.5 rounded-md bg-surface-3 transition-colors duration-150`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`w-2 h-2 rounded-full ${n?`bg-accent-green animate-pulse`:`bg-accent-amber`}`}),(0,F.jsx)(`span`,{className:`text-[10px] text-ink-subtle tracking-wide`,children:n?`live`:`reconnecting`})]}),(0,F.jsx)(kr,{variant:`ghost`,size:`sm`,onClick:i,"aria-label":r===`dark`?`Switch to light mode`:`Switch to dark mode`,className:`px-1 py-1`,children:r===`dark`?(0,F.jsx)(Sn,{size:12}):(0,F.jsx)(yn,{size:12})})]})}),s.installed!==null&&(0,F.jsxs)(`div`,{className:`mt-2 px-2 flex items-center gap-1.5`,children:[(0,F.jsxs)(`span`,{className:`text-[10px] text-ink-muted`,children:[`v`,s.installed]}),(0,F.jsx)(`span`,{className:`text-[10px] text-ink-muted`,"aria-hidden":`true`,children:`·`}),(0,F.jsxs)(`a`,{href:`https://github.com/newrelic-experimental/preflight`,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`View Preflight on GitHub`,className:`text-[10px] text-ink-subtle hover:text-ink-base transition-colors duration-150 flex items-center gap-0.5`,children:[`GitHub`,(0,F.jsx)(_n,{size:8,"aria-hidden":`true`})]})]}),s.updateAvailable&&s.latest!==null&&(0,F.jsx)(`div`,{className:`mt-0.5 px-2`,children:(0,F.jsxs)(`span`,{className:`text-[10px] text-accent-amber`,children:[`v`,s.latest,` available`]})})]})]})}function Gr(e,t=.8,n=.5){return e===null?`text-ink-muted`:e>=t?`text-accent-green`:e>=n?`text-accent-amber`:`text-accent-red`}function Kr(e){return e>=.8?`text-accent-cyan`:e>=.5?`text-accent-amber`:`text-accent-red`}function qr(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function Jr(e){return new Date(e).toLocaleString(void 0,{hour:`numeric`,minute:`2-digit`})}function Yr(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}function Xr(e){let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60){let e=t%60;return e>0?`${n}m ${e}s`:`${n}m`}let r=Math.floor(n/60);if(r<24){let e=n%60;return e>0?`${r}h ${e}m`:`${r}h`}let i=Math.floor(r/24),a=r%24;return a>0?`${i}d ${a}h`:`${i}d`}function Zr(e){return Number.isFinite(e)?Math.abs(e)>=100?e.toFixed(0):Math.abs(e)>=10?e.toFixed(1):Number.isInteger(e)?String(e):e.toFixed(2):`—`}function Qr(e){let t=e.split(`__`);return t.length>=3&&t[0]===`mcp`?t.slice(2).join(`__`):e}var $r={info:`bg-surface-3 border-surface-8`,warning:`bg-accent-amber/5 border-accent-amber/40`,critical:`bg-accent-red/5 border-accent-red/50`},ei={info:`text-ink-muted`,warning:`text-accent-amber`,critical:`text-accent-red`},ti={info:`INFO`,warning:`WARN`,critical:`CRIT`};function ni(e){return e===`critical`?`alert`:`status`}function ri({alert:e,onDismiss:t}){let n=n=>{n.key===`Escape`&&(n.preventDefault(),t(e.id))},r=`alert-title-${String(e.id).replace(/[^a-zA-Z0-9-_]/g,`_`)}`;return(0,F.jsxs)(`div`,{role:ni(e.severity),"aria-labelledby":r,tabIndex:0,"data-alert-id":e.id,"data-severity":e.severity,onKeyDown:n,className:`flex items-center gap-3 px-3 py-2 border-b text-xs focus:outline-none focus:ring-2 focus:ring-accent-cyan/40 ${$r[e.severity]}`,children:[(0,F.jsxs)(`span`,{"aria-hidden":`true`,className:`shrink-0 font-semibold tracking-wider ${ei[e.severity]}`,children:[`● `,ti[e.severity]]}),(0,F.jsx)(`span`,{id:r,className:`font-medium text-ink-base shrink-0`,children:e.title}),(0,F.jsx)(`span`,{className:`text-ink-muted truncate`,children:e.description}),(0,F.jsxs)(`span`,{className:`ml-auto shrink-0 text-ink-subtle tabular-nums whitespace-nowrap`,children:[Zr(e.value),` / `,Zr(e.threshold)]}),(0,F.jsx)(`button`,{type:`button`,"aria-label":`Dismiss alert`,onClick:()=>t(e.id),className:`shrink-0 ml-1 p-1 rounded-md text-ink-subtle hover:text-ink-base hover:bg-surface-5 transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-accent-cyan/50`,children:(0,F.jsx)(wn,{size:14,"aria-hidden":`true`,focusable:`false`})})]})}var ii=5,ai={info:`text-ink-muted`,warning:`text-accent-amber`,critical:`text-accent-red`},oi={info:`border-bg-line`,warning:`border-accent-amber/50`,critical:`border-accent-red/60`};function si(){let{alerts:e,maxSeverity:t,count:n,dismiss:r}=Un(),[i,a]=(0,P.useState)(!1);if((0,P.useEffect)(()=>{n<ii&&a(!1)},[n]),n===0)return null;let o=n>=ii&&!i,s=t??`info`;return o?(0,F.jsx)(`div`,{className:`bg-bg-panel border-b`,"data-collapsed-stack":`true`,children:(0,F.jsxs)(`button`,{type:`button`,onClick:()=>a(!0),"aria-expanded":`false`,"aria-label":`${n} alerts firing — expand`,className:`w-full flex items-center gap-2 px-3 py-2 text-xs text-left border-b ${oi[s]} transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-accent-cyan/50`,children:[(0,F.jsx)(hn,{size:14,"aria-hidden":`true`,focusable:`false`}),(0,F.jsxs)(`span`,{className:`font-semibold ${ai[s]}`,children:[`● `,n,` alerts firing`]}),(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`— click to expand`})]})}):(0,F.jsxs)(`div`,{"data-stack":`true`,children:[n>=ii&&(0,F.jsxs)(`button`,{type:`button`,onClick:()=>a(!1),"aria-expanded":`true`,"aria-label":`${n} alerts firing — collapse`,className:`w-full flex items-center gap-2 px-3 py-2 text-xs text-left bg-bg-panel border-b ${oi[s]} transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-accent-cyan/50`,children:[(0,F.jsx)(mn,{size:14,"aria-hidden":`true`,focusable:`false`}),(0,F.jsxs)(`span`,{className:`font-semibold ${ai[s]}`,children:[`● `,n,` alerts firing`]}),(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`— click to collapse`})]}),e.map(e=>(0,F.jsx)(ri,{alert:e,onDismiss:r},e.id))]})}var ci=class extends P.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`ErrorBoundary caught a render error`,{error:e,info:t})}componentDidUpdate(e){this.state.error&&e.resetKey!==this.props.resetKey&&this.setState({error:null})}handleReload=()=>{window.location.reload()};handleDismiss=()=>{this.setState({error:null})};render(){let{error:e}=this.state;return e?(0,F.jsx)(`div`,{role:`alert`,className:`flex justify-center p-8`,children:(0,F.jsx)(`div`,{className:`max-w-2xl w-full`,children:(0,F.jsxs)(R,{padding:`lg`,tone:`danger`,className:`space-y-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-accent-red font-semibold uppercase text-xs tracking-wider mb-1`,children:`Render error`}),(0,F.jsx)(`div`,{className:`text-ink-base text-base font-mono break-all`,children:e.message})]}),(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[(0,F.jsx)(kr,{variant:`secondary`,size:`md`,onClick:this.handleReload,children:`Reload page`}),(0,F.jsx)(kr,{variant:`ghost`,size:`md`,onClick:this.handleDismiss,children:`Dismiss`})]}),e.stack&&(0,F.jsxs)(`details`,{className:`text-xs text-ink-muted`,children:[(0,F.jsx)(`summary`,{className:`cursor-pointer select-none`,children:`Stack trace`}),(0,F.jsx)(`pre`,{className:`mt-2 p-2 bg-bg-line/30 rounded overflow-x-auto whitespace-pre-wrap break-all`,children:e.stack})]})]})})}):this.props.children}},li=[{keys:[`?`],description:`Show this help`},{keys:[`t`],description:`Toggle light/dark mode`},{keys:[`g`,`h`],description:`Go to Today`},{keys:[`g`,`s`],description:`Go to Sessions`},{keys:[`g`,`i`],description:`Go to History`},{keys:[`g`,`a`],description:`Go to Audit`},{keys:[`g`,`v`],description:`Go to Git Efficiency`},{keys:[`g`,`e`],description:`Go to Settings`},{keys:[`g`,`l`],description:`Go to Alerts`},{keys:[`Esc`],description:`Close overlay`}];function ui({open:e,onClose:t}){return(0,P.useEffect)(()=>{if(!e)return;function n(e){e.key===`Escape`&&(e.preventDefault(),t())}return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e,t]),e?(0,F.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:t,children:(0,F.jsxs)(`div`,{className:`glass-card animate-overlay-enter max-w-sm w-full mx-4 p-5`,onClick:e=>e.stopPropagation(),children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,F.jsx)(`h2`,{className:`text-sm font-semibold text-ink-base`,children:`Keyboard Shortcuts`}),(0,F.jsx)(kr,{variant:`ghost`,size:`sm`,onClick:t,"aria-label":`Close keyboard shortcuts`,className:`px-1 py-1`,children:(0,F.jsx)(wn,{size:16})})]}),(0,F.jsx)(`div`,{className:`space-y-2`,children:li.map(e=>(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,F.jsx)(`span`,{className:`text-ink-subtle`,children:e.description}),(0,F.jsx)(`span`,{className:`flex gap-1`,children:e.keys.map(e=>(0,F.jsx)(`kbd`,{className:`inline-block px-1.5 py-0.5 text-[11px] font-mono bg-bg-elevated rounded-md border border-border-subtle text-ink-base`,children:e},e))})]},e.description))})]})}):null}var di=75e3,fi=1e4;function pi(e){let t=zn.getState();fetch(`/api/session/current`,{signal:e}).then(e=>e.ok?e.json():null).then(e=>{if(e?.toolCallTimeline)for(let n of e.toolCallTimeline)t.pushToolCall({id:`${n.timestamp}-${n.toolName}`,tool:n.toolName,durationMs:n.durationMs??0,costUsd:0,ts:n.timestamp,sessionId:e.sessionId})}).catch(()=>{}),fetch(`/api/anti-patterns`,{signal:e}).then(e=>e.ok?e.json():null).then(e=>{if(Array.isArray(e))for(let n of e)n&&typeof n==`object`&&`type`in n&&t.pushAntiPattern(n)}).catch(()=>{})}function mi(e=`/sse`){(0,P.useEffect)(()=>{let t=new AbortController;pi(t.signal);let n=Date.now(),r=null,i=()=>{r||t.signal.aborted||(r=new EventSource(e),r.onopen=()=>{n=Date.now(),zn.getState().setConnected(!0)},r.onerror=()=>zn.getState().setConnected(!1),r.addEventListener(`tool-call`,a),r.addEventListener(`cost-update`,o),r.addEventListener(`anti-pattern`,s),r.addEventListener(`alert`,c),r.addEventListener(`context-update`,l),r.addEventListener(`heartbeat`,u))},a=e=>{try{zn.getState().pushToolCall(JSON.parse(e.data))}catch{}},o=e=>{try{zn.getState().setCost(JSON.parse(e.data))}catch{}},s=e=>{try{zn.getState().pushAntiPattern(JSON.parse(e.data))}catch{}},c=e=>{try{zn.getState().addOrUpdateAlert(JSON.parse(e.data))}catch{}},l=e=>{try{zn.getState().setContext(JSON.parse(e.data))}catch{}},u=()=>{n=Date.now();let e=zn.getState();e.connected||e.setConnected(!0)};typeof document<`u`&&document.readyState===`complete`?i():typeof window<`u`?window.addEventListener(`load`,i,{once:!0}):i();let d=setInterval(()=>{if(Date.now()-n>di){let e=zn.getState();e.connected&&e.setConnected(!1)}},fi);return()=>{t.abort(),clearInterval(d),typeof window<`u`&&window.removeEventListener(`load`,i),r&&(r.removeEventListener(`tool-call`,a),r.removeEventListener(`cost-update`,o),r.removeEventListener(`anti-pattern`,s),r.removeEventListener(`alert`,c),r.removeEventListener(`context-update`,l),r.removeEventListener(`heartbeat`,u),r.close())}},[e])}function hi({navigate:e,onToggleHelp:t,onToggleTheme:n}){let r=(0,P.useRef)(null),i=(0,P.useRef)(null);(0,P.useEffect)(()=>{function a(a){let o=a.target?.tagName;if(o===`INPUT`||o===`TEXTAREA`||o===`SELECT`||a.target?.isContentEditable||a.metaKey||a.ctrlKey||a.altKey)return;let s=a.key;if(r.current===`g`){if(s===`g`){i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=null},500);return}r.current=null,i.current&&=(clearTimeout(i.current),null);let t={h:`/`,s:`/sessions`,i:`/history`,a:`/audit`,v:`/git`,e:`/settings`,l:`/alerts`};t[s]&&(a.preventDefault(),e(t[s]));return}if(s===`g`){r.current=`g`,i.current=setTimeout(()=>{r.current=null},500);return}s===`?`&&(a.preventDefault(),t()),s===`t`&&n&&(a.preventDefault(),n())}return document.addEventListener(`keydown`,a),()=>{document.removeEventListener(`keydown`,a),i.current&&clearTimeout(i.current)}},[e,t,n])}var gi=`preflight-theme`;function _i(){try{let e=localStorage.getItem(gi);if(e===`light`||e===`dark`)return e}catch{}try{if(window.matchMedia(`(prefers-color-scheme: light)`).matches)return`light`}catch{}return`dark`}function vi(e){document.documentElement.classList.toggle(`light`,e===`light`)}function yi(){let[e,t]=(0,P.useState)(_i),n=(0,P.useRef)(!1);return(0,P.useLayoutEffect)(()=>{vi(e)},[e]),(0,P.useEffect)(()=>{if(!n.current){n.current=!0;return}try{localStorage.setItem(gi,e)}catch{}},[e]),{theme:e,toggleTheme:(0,P.useCallback)(()=>{t(e=>e===`dark`?`light`:`dark`)},[])}}function bi(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function xi(e,t={}){let{duration:n=800,decimals:r=0,enabled:i=!0}=t,a=i&&bi(),[o,s]=(0,P.useState)(()=>a?0:e),c=(0,P.useRef)(0);return(0,P.useEffect)(()=>{if(!a){s(e);return}let t=performance.now();function r(i){let a=i-t,o=Math.min(a/n,1);s((1-(1-o)**3)*e),o<1&&(c.current=requestAnimationFrame(r))}return c.current=requestAnimationFrame(r),()=>{c.current&&cancelAnimationFrame(c.current)}},[e,n,a]),o.toFixed(r)}var Si={neutral:`text-ink-base`,good:`text-accent-green`,warn:`text-accent-amber`,bad:`text-accent-red`,accent:`text-accent-green`};function B({label:e,value:t,sub:n,tone:r=`neutral`,hero:i=!1,animate:a=!1,numericValue:o,prefix:s=``,suffix:c=``,decimals:l=0}){let u=xi(o??0,{decimals:l,enabled:a&&o!==void 0}),d=a&&o!==void 0?`${s}${u}${c}`:t,f=i?`text-3xl font-bold mt-1 tabular-nums gradient-text`:`text-3xl font-bold mt-1 tabular-nums ${Si[r]}`;return(0,F.jsxs)(`div`,{className:`px-1`,children:[(0,F.jsx)(`div`,{className:`text-[10px] text-ink-muted uppercase tracking-wider font-medium`,children:e}),(0,F.jsx)(`div`,{className:f,children:d}),n&&(0,F.jsx)(`div`,{className:`text-[10px] text-ink-muted mt-0.5`,children:n})]})}function Ci({children:e,index:t=0,className:n=``}){let r=`${t*120}ms`;return(0,F.jsx)(`div`,{className:`animate-card-enter ${n}`,style:{animationDelay:r},children:e})}var wi=6,Ti=5,Ei=[.01,.02,.05,.1,.25,.5,1,2,5,10,25,50,100,250,500,1e3];function Di(e){if(e<=0)return .01;for(let t of Ei)if(t>=e)return t;return Ei[Ei.length-1]}function Oi(e){return e===0?`12am`:e<12?`${e}am`:e===12?`12pm`:`${e-12}pm`}function ki(e){let t=e.reduce((e,t)=>e+t.cost,0),n=e.reduce((e,t)=>Math.max(e,t.cost),0),r=e.find(e=>e.cost===n);return`Hourly spend today: $${t.toFixed(2)} total, peak $${n.toFixed(2)} at ${Oi(r.hour)}`}function Ai({hours:e,formatValue:t,ariaLabel:n}){let[r,i]=(0,P.useState)(null),a=e.reduce((e,t)=>Math.max(e,t.cost),0);if(a===0)return null;let o=Di(a/Ti),s=e.map(e=>Math.max(0,Math.round(e.cost/o))),c=s.reduce((e,t)=>Math.max(e,t),0);if(c===0)return null;let l=c*7,u=t??(e=>`$${e.toFixed(2)}`),d=n??ki(e),f=r===null?null:e[r],p=f?`${Oi(f.hour)}: ${u(f.cost)} (start hour)`:``,m=r===null?0:(r+.5)/e.length*100;return(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(`div`,{role:`img`,"aria-label":d,className:`flex w-full`,style:{height:l},onMouseLeave:()=>i(null),children:e.map((e,t)=>{let n=s[t],r=e.cost>0&&e.cost===a,o=[];for(let e=0;e<n;e++)o.push((0,F.jsx)(`span`,{className:`absolute rounded-sm heatmap-cell`,style:{bottom:e*7,left:`50%`,marginLeft:-6/2,width:wi,height:wi,backgroundColor:r?`var(--color-chart-block-peak)`:`var(--color-chart-block)`,animationDelay:`${t*12+e*6}ms`}},e));return(0,F.jsx)(`div`,{className:`relative flex-1 h-full`,onMouseEnter:()=>i(t),children:o},t)})}),f&&(0,F.jsx)(`div`,{className:`absolute -top-7 px-1.5 py-0.5 bg-bg-elevated border border-border-subtle text-[10px] text-ink-base rounded-md shadow-md pointer-events-none whitespace-nowrap tabular-nums`,style:{left:`${m}%`,transform:`translateX(-50%)`},role:`tooltip`,children:p})]})}function ji(){return(0,F.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,F.jsx)(`circle`,{cx:`24`,cy:`24`,r:`20`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,F.jsx)(`circle`,{cx:`24`,cy:`24`,r:`13`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,F.jsx)(`circle`,{cx:`24`,cy:`24`,r:`6`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,F.jsx)(`line`,{x1:`24`,y1:`24`,x2:`24`,y2:`4`,stroke:`var(--color-accent-green)`,strokeWidth:`1.5`,strokeLinecap:`round`,className:`animate-radar-sweep`}),(0,F.jsx)(`circle`,{cx:`24`,cy:`24`,r:`2`,fill:`var(--color-accent-green)`})]})}function Mi(){return(0,F.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,F.jsx)(`path`,{d:`M16 14 L6 24 L16 34`,stroke:`var(--color-ink-muted)`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,F.jsx)(`path`,{d:`M32 14 L42 24 L32 34`,stroke:`var(--color-ink-muted)`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,F.jsx)(`line`,{x1:`24`,y1:`18`,x2:`24`,y2:`30`,stroke:`var(--color-accent-green)`,strokeWidth:`2`,strokeLinecap:`round`,opacity:`0.8`})]})}function V(){return(0,F.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,F.jsx)(`line`,{x1:`4`,y1:`24`,x2:`44`,y2:`24`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.4`}),(0,F.jsx)(`circle`,{cx:`12`,cy:`24`,r:`3`,stroke:`var(--color-ink-muted)`,strokeWidth:`1.5`}),(0,F.jsx)(`circle`,{cx:`24`,cy:`24`,r:`3`,stroke:`var(--color-accent-green)`,strokeWidth:`1.5`}),(0,F.jsx)(`circle`,{cx:`36`,cy:`24`,r:`3`,stroke:`var(--color-ink-muted)`,strokeWidth:`1.5`}),(0,F.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12`,y2:`20`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,strokeLinecap:`round`,opacity:`0.5`}),(0,F.jsx)(`line`,{x1:`24`,y1:`16`,x2:`24`,y2:`20`,stroke:`var(--color-accent-green)`,strokeWidth:`1`,strokeLinecap:`round`,opacity:`0.7`}),(0,F.jsx)(`line`,{x1:`36`,y1:`16`,x2:`36`,y2:`20`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,strokeLinecap:`round`,opacity:`0.5`})]})}function Ni(){return(0,F.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,F.jsx)(`circle`,{cx:`24`,cy:`24`,r:`18`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,F.jsx)(`path`,{d:`M16 24 L22 30 L34 18`,stroke:`var(--color-accent-green)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function Pi(){return(0,F.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,"aria-hidden":`true`,children:[(0,F.jsx)(`circle`,{cx:`24`,cy:`24`,r:`18`,stroke:`var(--color-ink-muted)`,strokeWidth:`1`,opacity:`0.3`}),(0,F.jsx)(`path`,{d:`M24 14 L24 24 L31 28`,stroke:`var(--color-ink-subtle)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}var Fi={radar:ji,code:Mi,timeline:V,checkmark:Ni,clock:Pi};function Ii(){return(0,F.jsx)(`div`,{className:`flex items-center justify-center`,style:{width:48,height:48},"aria-hidden":`true`,children:(0,F.jsx)(`span`,{className:`rounded-full animate-pulse`,style:{width:10,height:10,backgroundColor:`var(--color-accent-green)`,boxShadow:`0 0 0 4px color-mix(in srgb, var(--color-accent-green) 15%, transparent)`}})})}function Li({icon:e,title:t,subtitle:n,variant:r=`empty`}){let i=e===void 0?void 0:Fi[e];return(0,F.jsxs)(`div`,{className:`py-8 flex flex-col items-center justify-center gap-3`,children:[r===`loading`?(0,F.jsx)(Ii,{}):i&&(0,F.jsx)(i,{}),(0,F.jsx)(`span`,{className:`text-sm font-medium text-ink-subtle`,children:t}),n&&(0,F.jsx)(`span`,{className:`text-xs text-ink-muted text-center max-w-[240px]`,children:n})]})}function Ri(e){return e===`Read`?`bg-accent-blue`:e===`Edit`||e===`Write`?`bg-accent-green`:e===`Bash`?`bg-accent-purple`:e===`Agent`?`bg-accent-teal`:`bg-ink-subtle`}var zi={thrashing:`Edit/Test Thrashing`,stuck_loop:`Stuck Loop`,blind_editing:`Blind Editing`,re_reading:`Repeated Reads`};function Bi(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}function Vi({entries:e,segments:t}){let[n,r]=(0,P.useState)(null);if(e.length===0)return(0,F.jsx)(`div`,{className:`text-ink-muted text-xs`,children:`No tool calls recorded.`});let i=e.map((e,t)=>({entry:e,originalIdx:t})).sort((e,t)=>e.entry.timestamp-t.entry.timestamp),a=i[0].entry.timestamp,o=i.reduce((e,{entry:t})=>Math.max(e,t.timestamp+(t.durationMs??50)),0),s=Math.max(o-a,1),c=[1e4,3e4,6e4,12e4,3e5,6e5,9e5,18e5].find(e=>s/e<=8)??Math.ceil(s/8),l=[];for(let e=c;e<s;e+=c)l.push(e);let u=Array(i.length).fill(null),d=new Map;for(let e=0;e<i.length;e++)d.set(i[e].originalIdx,e);for(let n of t){let t=Math.max(0,n.startIndex),r=Math.min(n.endIndex,e.length-1);for(let e=t;e<=r;e++){let t=d.get(e);t!==void 0&&(u[t]===null||n.severity===`critical`&&u[t].severity!==`critical`)&&(u[t]=n)}}let f=Math.min(30,800/Math.max(e.length,1));return(0,F.jsxs)(`div`,{className:`p-2 overflow-x-hidden`,children:[(0,F.jsxs)(`div`,{className:`flex`,children:[(0,F.jsx)(`div`,{className:`w-20 shrink-0`}),(0,F.jsx)(`div`,{className:`relative flex-1 h-5 border-b border-bg-line overflow-x-auto`,children:l.map(e=>(0,F.jsx)(`span`,{className:`absolute top-0 text-[9px] text-ink-muted tabular-nums -translate-x-1/2`,style:{left:`${e/s*100}%`},children:Bi(e)},e))})]}),(0,F.jsx)(`div`,{className:`mt-1`,children:i.map(({entry:e,originalIdx:t},o)=>{let c=e.timestamp-a,l=e.durationMs??50,d=c/s*100,p=l/s*100,m=u[o];return(0,F.jsxs)(`div`,{className:`flex items-center h-7 ${m?m.severity===`critical`?`border-l-2 border-l-accent-red`:`border-l-2 border-l-accent-amber`:`border-l-2 border-l-transparent`}`,children:[(0,F.jsx)(`div`,{className:`w-20 shrink-0 truncate text-[11px] text-ink-subtle pr-2 text-right`,title:e.toolName,children:Qr(e.toolName)}),(0,F.jsxs)(`div`,{className:`relative flex-1 h-full flex items-center`,children:[(0,F.jsx)(`div`,{className:`gantt-bar absolute h-5 rounded-sm opacity-80 ${Ri(Qr(e.toolName))} ${e.success?``:`ring-1 ring-accent-red/60`}`,style:{left:`${d}%`,width:`${p}%`,minWidth:`4px`,animationDelay:`${Math.round(o*f)}ms`},onMouseEnter:()=>r(o),onMouseLeave:()=>r(null)}),n===o&&(0,F.jsxs)(`div`,{className:`absolute z-50 px-2 py-1.5 rounded-lg bg-bg-elevated border border-bg-line text-[11px] text-ink-base shadow-lg whitespace-nowrap pointer-events-none ${o>=3&&o>i.length-4?`bottom-full mb-1`:`top-full mt-1`}`,style:d>=50?{right:`${Math.max(0,100-d-p)}%`}:{left:`${d}%`},children:[(0,F.jsx)(`div`,{className:`font-medium`,children:e.toolName}),(e.filePath??e.command)&&(0,F.jsx)(`div`,{className:`text-ink-subtle truncate max-w-[200px]`,children:e.filePath??e.command}),(0,F.jsxs)(`div`,{className:`text-ink-muted`,children:[e.durationMs==null?`unknown`:`${e.durationMs}ms`,` ·`,` `,e.success?`success`:`failed`]}),m&&(0,F.jsx)(`div`,{className:`mt-0.5 font-medium ${m.severity===`critical`?`text-accent-red`:`text-accent-amber`}`,children:zi[m.type]??m.type})]})]})]},`${t}-${e.timestamp}`)})})]})}var Hi=`var(--color-chart-block)`,Ui=`var(--color-chart-block-peak)`,Wi=10,Gi=13;function Ki({data:e,maxCount:t,ariaLabel:n}){let r=(0,P.useRef)(null),[i,a]=(0,P.useState)(null);if(e.length===0||e.every(e=>e.count===0))return null;let o=Math.max(t??0,...e.map(e=>e.count),1),s=o*12;return(0,F.jsxs)(`div`,{ref:r,className:`relative`,children:[(0,F.jsx)(`svg`,{width:`100%`,height:s,role:`img`,"aria-label":n,viewBox:`0 0 ${e.length*Gi} ${s}`,preserveAspectRatio:`xMidYMax meet`,onMouseLeave:()=>a(null),children:e.map((e,t)=>{let n=[];for(let r=0;r<e.count;r++){let i=e.count===o;n.push((0,F.jsx)(`rect`,{x:t*Gi,y:s-(r+1)*12,width:Wi,height:Wi,rx:1,fill:i?Ui:Hi,className:`heatmap-cell`,style:{animationDelay:`${t*20+r*10}ms`}},`${t}-${r}`))}return(0,F.jsxs)(`g`,{onMouseEnter:t=>{let n=r.current;if(!n)return;let i=n.getBoundingClientRect(),o=t.currentTarget,s=o.querySelectorAll(`rect.heatmap-cell`),c=(s[s.length-1]??o).getBoundingClientRect();a({x:c.left-i.left+c.width/2,y:c.top-i.top,text:e.tooltip})},children:[(0,F.jsx)(`rect`,{x:t*Gi,y:0,width:Gi,height:s,fill:`transparent`}),n]},t)})}),i&&(0,F.jsx)(`div`,{className:`absolute px-1.5 py-0.5 bg-bg-elevated border border-border-subtle text-[10px] text-ink-base rounded-md shadow-md pointer-events-none whitespace-nowrap tabular-nums`,style:{left:i.x,top:i.y,transform:`translate(-50%, calc(-100% - 4px))`},children:i.text})]})}var qi=`nr-observe-peak-concurrent`;function Ji({current:e,peak:t,allTimePeak:n,buckets:r}){let[i,a]=(0,P.useState)(!1),o=(0,P.useRef)(null),s=r.some(e=>e.count>0);(0,P.useEffect)(()=>{let e=n??t;if(e<=0)return;let r=parseInt(localStorage.getItem(qi)??`0`,10);if(o.current===null&&(o.current=r),e>o.current){localStorage.setItem(qi,String(e)),o.current=e,a(!0);let t=setTimeout(()=>a(!1),3e3);return()=>clearTimeout(t)}},[t,n]);let c=r.map(e=>{let t=new Date(e.timestamp).toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`});return{count:e.count,tooltip:`${t} — ${e.count} concurrent`}});return(0,F.jsxs)(R,{padding:`sm`,className:`relative overflow-hidden${i?` new-peak-glow`:``}`,children:[i&&(0,F.jsx)(Yi,{}),(0,F.jsx)(z,{className:`mb-1.5`,children:`Concurrent Sessions`}),(0,F.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,F.jsx)(`span`,{className:`text-lg font-semibold text-accent-teal tabular-nums`,children:e}),(0,F.jsxs)(`span`,{className:`text-xs text-ink-muted tabular-nums`,children:[`today peak `,t,n&&n>t?` · all-time ${n}`:``]}),i&&(0,F.jsx)(`span`,{className:`text-[10px] text-accent-green font-semibold animate-bounce`,children:`NEW RECORD!`})]}),s&&(0,F.jsx)(`div`,{className:`mt-2`,children:(0,F.jsx)(Ki,{data:c,ariaLabel:`Concurrency over time, peak ${t}`})})]})}function Yi(){return(0,F.jsx)(F.Fragment,{children:Array.from({length:12},(e,t)=>{let n=t/12*360,r=40+Math.random()*30;return(0,F.jsx)(`span`,{className:`absolute w-1.5 h-1.5 rounded-full`,style:{left:`50%`,top:`50%`,backgroundColor:t%3==0?`#1CE783`:t%3==1?`#00D4AA`:`#9945FF`,animation:`particle-burst 1s ease-out forwards`,animationDelay:`${t*40}ms`,transform:`translate(-50%, -50%) rotate(${n}deg) translateY(-${r}px)`,opacity:0}},t)})})}var Xi=5,Zi=[`var(--color-heatmap-0)`,`var(--color-heatmap-1)`,`var(--color-heatmap-2)`,`var(--color-heatmap-3)`,`var(--color-heatmap-4)`];function Qi(e,t){if(e===0)return Zi[0];let n=e/t;return Zi[Math.min(Math.ceil(n*(Xi-1)),Xi-1)]}function $i(e,t,n){let r=e+n*t;return new Date(r).toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})}function ea({variant:e,buckets:t,maxCount:n,bucketSizeMs:r,startTimestamp:i,width:a,height:o,ariaLabel:s,days:c}){return e===`grid`&&c?(0,F.jsx)(ra,{days:c,maxCount:n,width:a,height:o,ariaLabel:s}):(0,F.jsx)(ta,{buckets:t,maxCount:n,bucketSizeMs:r,startTimestamp:i,width:a,height:o,ariaLabel:s})}function ta({buckets:e,maxCount:t,bucketSizeMs:n=9e5,startTimestamp:r=0,width:i,height:a=24,ariaLabel:o}){let[s,c]=(0,P.useState)(null),l=Math.max(4,Math.min(12,i?(i-e.length*1)/e.length:8)),u=i??e.length*(l+1);return(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(`svg`,{width:u,height:a,role:`img`,"aria-label":o??`Activity heatmap: ${e.length} time buckets`,className:`w-full`,style:{maxWidth:u},viewBox:`0 0 ${u} ${a}`,preserveAspectRatio:`none`,onMouseLeave:()=>c(null),children:e.map((e,i)=>(0,F.jsx)(`rect`,{x:i*(l+1),y:0,width:l,height:a,rx:2,fill:Qi(e,t),className:`heatmap-cell`,style:{animationDelay:`${Math.min(i*8,400)}ms`},onMouseEnter:t=>{let a=$i(r,n,i);c({x:t.currentTarget.x.baseVal.value,text:`${a}: ${e} calls`})}},i))}),s&&(0,F.jsx)(`div`,{className:`absolute -top-7 px-1.5 py-0.5 bg-bg-elevated border border-border-subtle text-[10px] text-ink-base rounded-md shadow-md pointer-events-none whitespace-nowrap tabular-nums`,style:{left:s.x},children:s.text})]})}var na=[`Mon`,``,`Wed`,``,`Fri`,``,`Sun`];function ra({days:e,maxCount:t,ariaLabel:n}){let[r,i]=(0,P.useState)(null),a=(0,P.useMemo)(()=>{if(e.length===0)return{weeks:0,cells:[]};let t=(new Date(e[0].date).getUTCDay()+6)%7,n=[];for(let r=0;r<e.length;r++){let i=r+t,a=i%7,o=Math.floor(i/7);n.push({...e[r],row:a,col:o})}return{weeks:n.length>0?n[n.length-1].col+1:0,cells:n}},[e]),o=28+a.weeks*12,s=(0,P.useMemo)(()=>{let e=[],t=``;for(let n of a.cells){if(n.row!==0)continue;let r=new Date(n.date).toLocaleString(void 0,{month:`short`,timeZone:`UTC`});r!==t&&(e.push({text:r,col:n.col}),t=r)}return e},[a.cells]);return(0,F.jsxs)(`div`,{className:`relative flex justify-center`,children:[(0,F.jsxs)(`svg`,{width:`100%`,height:98,role:`img`,"aria-label":n??`Activity grid: ${e.length} days`,viewBox:`0 0 ${o} 98`,preserveAspectRatio:`xMidYMid meet`,onMouseLeave:()=>i(null),children:[na.map((e,t)=>e?(0,F.jsx)(`text`,{x:0,y:14+t*12+10-2,className:`fill-ink-muted`,fontSize:10,children:e},t):null),s.map(({text:e,col:t})=>(0,F.jsx)(`text`,{x:28+t*12,y:10,className:`fill-ink-muted`,fontSize:10,children:e},`${e}-${t}`)),a.cells.map((e,n)=>(0,F.jsx)(`rect`,{x:28+e.col*12,y:14+e.row*12,width:10,height:10,rx:2,fill:Qi(e.count,t),className:`heatmap-cell`,style:{animationDelay:`${Math.min(n*3,300)}ms`},onMouseEnter:t=>{let n=t.currentTarget;i({x:n.x.baseVal.value,y:n.y.baseVal.value-16,text:`${e.date}: ${e.count} calls`})}},n))]}),r&&(0,F.jsx)(`div`,{className:`absolute px-1.5 py-0.5 bg-bg-elevated border border-border-subtle text-[10px] text-ink-base rounded-md shadow-md pointer-events-none whitespace-nowrap tabular-nums`,style:{left:r.x,top:r.y},children:r.text}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1 mt-1.5 text-[10px] text-ink-muted`,children:[(0,F.jsx)(`span`,{children:`Less`}),Zi.map((e,t)=>(0,F.jsx)(`span`,{className:`inline-block w-2.5 h-2.5 rounded-sm`,style:{backgroundColor:e}},t)),(0,F.jsx)(`span`,{children:`More`})]})]})}function ia({theme:e=`observatory`}){return(0,F.jsxs)(`div`,{className:`geo-banner`,"aria-hidden":`true`,children:[e===`observatory`&&(0,F.jsx)(aa,{}),e===`sessions`&&(0,F.jsx)(oa,{}),e===`history`&&(0,F.jsx)(sa,{}),e===`audit`&&(0,F.jsx)(ca,{}),e===`git`&&(0,F.jsx)(la,{})]})}function aa(){return(0,F.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`obsSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:`#1a3a5c`}),(0,F.jsx)(`stop`,{offset:`40%`,stopColor:`#2d5a7b`}),(0,F.jsx)(`stop`,{offset:`70%`,stopColor:`#e8834a`}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:`#f4a261`})]})}),(0,F.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#obsSky)`}),(0,F.jsx)(`polygon`,{points:`0,80 0,45 80,38 160,48 240,30 340,42 420,25 500,38 580,32 660,40 740,28 800,35 800,80`,fill:`#1a3a5c`,opacity:`0.7`}),(0,F.jsx)(`polygon`,{points:`0,80 0,55 60,48 140,58 220,42 300,52 380,40 460,50 520,38 600,48 680,42 760,52 800,48 800,80`,fill:`#234e6f`}),(0,F.jsx)(`polygon`,{points:`0,80 0,62 100,58 200,65 300,55 400,60 500,54 600,62 700,56 800,60 800,80`,fill:`#2a6b4a`,opacity:`0.8`}),(0,F.jsx)(`circle`,{cx:`680`,cy:`28`,r:`14`,fill:`#f4a261`,opacity:`0.6`}),(0,F.jsx)(`circle`,{cx:`680`,cy:`28`,r:`8`,fill:`#ffd166`,opacity:`0.5`}),(0,F.jsx)(`ellipse`,{cx:`150`,cy:`56`,rx:`18`,ry:`10`,fill:`#1a3a5c`}),(0,F.jsx)(`line`,{x1:`150`,y1:`46`,x2:`172`,y2:`34`,stroke:`#5ce0d8`,strokeWidth:`1.5`,opacity:`0.8`})]})}function oa(){return(0,F.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`seaSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:`#4aa8c7`}),(0,F.jsx)(`stop`,{offset:`60%`,stopColor:`#3a8fb7`}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:`#2d7a9e`})]})}),(0,F.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#seaSky)`}),(0,F.jsx)(`polygon`,{points:`600,48 640,35 680,48`,fill:`#2d7a4a`,opacity:`0.4`}),(0,F.jsx)(`polygon`,{points:`700,50 730,40 760,50`,fill:`#3d9b5b`,opacity:`0.3`}),(0,F.jsx)(`polygon`,{points:`0,80 0,15 40,12 80,20 120,18 160,25 180,30 180,80`,fill:`#c05a3c`}),(0,F.jsx)(`polygon`,{points:`0,80 0,25 30,22 60,28 100,25 140,30 160,35 160,80`,fill:`#e8834a`,opacity:`0.6`}),(0,F.jsx)(`polygon`,{points:`20,20 35,8 50,20`,fill:`#3d9b5b`}),(0,F.jsx)(`polygon`,{points:`60,22 72,12 84,24`,fill:`#4aad6b`}),(0,F.jsx)(`polygon`,{points:`100,20 115,10 130,22`,fill:`#3d9b5b`}),(0,F.jsx)(`polygon`,{points:`140,28 150,18 160,28`,fill:`#4aad6b`,opacity:`0.8`}),(0,F.jsx)(`rect`,{x:`120`,y:`30`,width:`8`,height:`50`,fill:`#87ceeb`,opacity:`0.5`}),(0,F.jsx)(`rect`,{x:`122`,y:`30`,width:`4`,height:`50`,fill:`#fff`,opacity:`0.3`}),(0,F.jsx)(`polygon`,{points:`620,80 620,30 660,25 700,32 740,28 780,35 800,30 800,80`,fill:`#c05a3c`,opacity:`0.8`}),(0,F.jsx)(`polygon`,{points:`650,30 665,18 680,30`,fill:`#3d9b5b`}),(0,F.jsx)(`polygon`,{points:`720,32 732,22 744,32`,fill:`#4aad6b`}),(0,F.jsx)(`polygon`,{points:`180,80 180,55 250,52 350,56 450,52 550,55 620,52 620,80`,fill:`#2d7a9e`,opacity:`0.6`}),(0,F.jsx)(`line`,{x1:`200`,y1:`60`,x2:`280`,y2:`58`,stroke:`#5ce0d8`,strokeWidth:`0.8`,opacity:`0.3`}),(0,F.jsx)(`line`,{x1:`350`,y1:`56`,x2:`450`,y2:`55`,stroke:`#5ce0d8`,strokeWidth:`0.8`,opacity:`0.25`}),(0,F.jsx)(`line`,{x1:`480`,y1:`58`,x2:`580`,y2:`56`,stroke:`#87ceeb`,strokeWidth:`0.8`,opacity:`0.3`})]})}function sa(){return(0,F.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`histSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:`#3a7ca5`}),(0,F.jsx)(`stop`,{offset:`60%`,stopColor:`#5bb8d4`}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:`#8ed4c0`})]})}),(0,F.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#histSky)`}),(0,F.jsx)(`polygon`,{points:`100,50 140,20 180,50`,fill:`#e8834a`,opacity:`0.7`}),(0,F.jsx)(`polygon`,{points:`160,50 210,15 260,50`,fill:`#d4694a`,opacity:`0.6`}),(0,F.jsx)(`polygon`,{points:`550,50 600,18 650,50`,fill:`#e8834a`,opacity:`0.6`}),(0,F.jsx)(`polygon`,{points:`620,50 660,22 700,50`,fill:`#c05a3c`,opacity:`0.5`}),(0,F.jsx)(`polygon`,{points:`350,50 370,12 390,50`,fill:`#5ce0d8`,opacity:`0.4`}),(0,F.jsx)(`polygon`,{points:`380,50 395,20 410,50`,fill:`#87ceeb`,opacity:`0.3`}),(0,F.jsx)(`polygon`,{points:`700,50 715,25 730,50`,fill:`#5ce0d8`,opacity:`0.35`}),(0,F.jsx)(`polygon`,{points:`300,80 380,50 420,50 500,80`,fill:`#2a5a6b`,opacity:`0.6`}),(0,F.jsx)(`line`,{x1:`390`,y1:`52`,x2:`350`,y2:`78`,stroke:`#f4a261`,strokeWidth:`1`,opacity:`0.4`}),(0,F.jsx)(`line`,{x1:`410`,y1:`52`,x2:`450`,y2:`78`,stroke:`#f4a261`,strokeWidth:`1`,opacity:`0.4`}),(0,F.jsx)(`polygon`,{points:`0,80 0,55 80,52 160,58 240,50 320,55 500,52 580,56 660,50 740,55 800,52 800,80`,fill:`#2d8a4a`,opacity:`0.5`}),(0,F.jsx)(`polygon`,{points:`0,80 0,65 60,62 140,68 220,60 400,65 500,62 600,66 700,60 800,65 800,80`,fill:`#1e6b3a`,opacity:`0.6`}),(0,F.jsx)(`polygon`,{points:`30,65 42,42 54,65`,fill:`#3d9b5b`,opacity:`0.8`}),(0,F.jsx)(`polygon`,{points:`50,65 60,48 70,65`,fill:`#2d8a4a`,opacity:`0.7`}),(0,F.jsx)(`polygon`,{points:`720,65 732,45 744,65`,fill:`#3d9b5b`,opacity:`0.7`}),(0,F.jsx)(`polygon`,{points:`760,65 770,50 780,65`,fill:`#2d8a4a`,opacity:`0.8`})]})}function ca(){return(0,F.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`auditSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:`#1a5c3a`}),(0,F.jsx)(`stop`,{offset:`50%`,stopColor:`#2d7a4a`}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:`#3d9b5b`})]})}),(0,F.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#auditSky)`}),(0,F.jsx)(`polygon`,{points:`200,0 210,80 220,0`,fill:`#ffd166`,opacity:`0.08`}),(0,F.jsx)(`polygon`,{points:`500,0 510,80 520,0`,fill:`#ffd166`,opacity:`0.06`}),(0,F.jsx)(`polygon`,{points:`650,0 660,80 670,0`,fill:`#fff`,opacity:`0.05`}),(0,F.jsx)(`rect`,{x:`80`,y:`20`,width:`6`,height:`60`,fill:`#1a4a2e`}),(0,F.jsx)(`rect`,{x:`180`,y:`10`,width:`7`,height:`70`,fill:`#1a4a2e`}),(0,F.jsx)(`rect`,{x:`320`,y:`15`,width:`6`,height:`65`,fill:`#1a4a2e`}),(0,F.jsx)(`rect`,{x:`500`,y:`8`,width:`7`,height:`72`,fill:`#1a4a2e`}),(0,F.jsx)(`rect`,{x:`620`,y:`18`,width:`6`,height:`62`,fill:`#1a4a2e`}),(0,F.jsx)(`rect`,{x:`740`,y:`12`,width:`7`,height:`68`,fill:`#1a4a2e`}),(0,F.jsx)(`polygon`,{points:`55,25 83,5 111,25`,fill:`#4aad6b`}),(0,F.jsx)(`polygon`,{points:`60,35 83,15 106,35`,fill:`#3d9b5b`}),(0,F.jsx)(`polygon`,{points:`155,15 183,0 211,18`,fill:`#5bc47a`}),(0,F.jsx)(`polygon`,{points:`160,28 183,8 206,28`,fill:`#4aad6b`}),(0,F.jsx)(`polygon`,{points:`295,20 323,2 351,22`,fill:`#5bc47a`}),(0,F.jsx)(`polygon`,{points:`300,32 323,12 346,32`,fill:`#3d9b5b`}),(0,F.jsx)(`polygon`,{points:`475,12 503,0 531,15`,fill:`#4aad6b`}),(0,F.jsx)(`polygon`,{points:`480,25 503,5 526,25`,fill:`#3d9b5b`}),(0,F.jsx)(`polygon`,{points:`595,22 623,5 651,22`,fill:`#5bc47a`}),(0,F.jsx)(`polygon`,{points:`600,34 623,14 646,34`,fill:`#4aad6b`}),(0,F.jsx)(`polygon`,{points:`715,16 743,0 771,18`,fill:`#5bc47a`}),(0,F.jsx)(`polygon`,{points:`720,30 743,10 766,30`,fill:`#3d9b5b`}),(0,F.jsx)(`polygon`,{points:`0,80 0,68 100,65 200,70 300,64 400,68 500,63 600,67 700,64 800,68 800,80`,fill:`#1e6b3a`}),(0,F.jsx)(`polygon`,{points:`250,80 258,65 266,80`,fill:`#e8834a`,opacity:`0.6`}),(0,F.jsx)(`polygon`,{points:`450,80 456,68 462,80`,fill:`#f4a261`,opacity:`0.5`}),(0,F.jsx)(`polygon`,{points:`650,80 656,66 662,80`,fill:`#e8834a`,opacity:`0.55`})]})}function la(){return(0,F.jsxs)(`svg`,{viewBox:`0 0 800 80`,preserveAspectRatio:`xMidYMid slice`,className:`w-full h-full`,children:[(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`gitSky`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:`#2d5a7b`}),(0,F.jsx)(`stop`,{offset:`60%`,stopColor:`#3a8fb7`}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:`#5bb8d4`})]})}),(0,F.jsx)(`rect`,{width:`800`,height:`80`,fill:`url(#gitSky)`}),(0,F.jsx)(`polygon`,{points:`0,80 0,20 60,25 120,18 180,28 220,22 260,30 260,80`,fill:`#2d7a4a`,opacity:`0.7`}),(0,F.jsx)(`polygon`,{points:`540,80 540,22 600,28 660,20 720,25 780,18 800,22 800,80`,fill:`#2d7a4a`,opacity:`0.7`}),(0,F.jsx)(`path`,{d:`M 260,50 Q 320,48 400,45 Q 480,42 540,50`,fill:`none`,stroke:`#5ce0d8`,strokeWidth:`4`,opacity:`0.5`}),(0,F.jsx)(`path`,{d:`M 350,45 Q 370,35 400,28`,fill:`none`,stroke:`#87ceeb`,strokeWidth:`2`,opacity:`0.4`}),(0,F.jsx)(`path`,{d:`M 420,44 Q 440,52 470,60`,fill:`none`,stroke:`#87ceeb`,strokeWidth:`2`,opacity:`0.4`}),(0,F.jsx)(`path`,{d:`M 400,28 Q 430,25 460,30`,fill:`none`,stroke:`#5ce0d8`,strokeWidth:`1.5`,opacity:`0.35`}),(0,F.jsx)(`circle`,{cx:`400`,cy:`45`,r:`3`,fill:`#5ce0d8`,opacity:`0.6`}),(0,F.jsx)(`circle`,{cx:`350`,cy:`45`,r:`2`,fill:`#1ce783`,opacity:`0.5`}),(0,F.jsx)(`circle`,{cx:`460`,cy:`44`,r:`2`,fill:`#1ce783`,opacity:`0.5`}),(0,F.jsx)(`polygon`,{points:`300,65 310,55 320,65`,fill:`#3a6b4a`,opacity:`0.6`}),(0,F.jsx)(`polygon`,{points:`480,62 492,52 504,62`,fill:`#3a6b4a`,opacity:`0.6`}),(0,F.jsx)(`polygon`,{points:`240,35 250,18 260,35`,fill:`#4aad6b`}),(0,F.jsx)(`polygon`,{points:`540,35 550,20 560,35`,fill:`#4aad6b`}),(0,F.jsx)(`polygon`,{points:`270,50 278,38 286,50`,fill:`#3d9b5b`,opacity:`0.8`}),(0,F.jsx)(`polygon`,{points:`520,48 528,36 536,48`,fill:`#3d9b5b`,opacity:`0.8`})]})}var ua=[`system`,`tools`,`user`,`assistant`],da={system:`bg-accent-indigo`,tools:`bg-accent-amber`,user:`bg-accent-blue`,assistant:`bg-accent-green`},fa={system:`shadow-[0_0_8px_rgba(99,102,241,0.4)]`,tools:`shadow-[0_0_8px_rgba(255,178,36,0.4)]`,user:`shadow-[0_0_8px_rgba(0,149,255,0.4)]`,assistant:`shadow-[0_0_8px_rgba(28,231,131,0.4)]`},pa={system:`bg-accent-indigo`,tools:`bg-accent-amber`,user:`bg-accent-blue`,assistant:`bg-accent-green`},ma={system:`System`,tools:`Tools`,user:`User`,assistant:`Assistant`};function ha(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function ga(e,t=``){return{sessionId:t,turnNumber:e.turnCount,totalTokens:e.growth.currentTokens,fillPercent:e.fillPercent,contextWindow:e.contextWindow,breakdown:e.currentBreakdown,growth:{startTokens:e.growth.startTokens,currentTokens:e.growth.currentTokens,delta:e.growth.deltaTokens},topTools:e.toolContributions.map(e=>({tool:e.tool,estimatedTokens:e.estimatedTokens}))}}function _a({data:e,sessionId:t}){let n=zn(e=>e.contextBySession),r=t?n.get(t)??null:null,[i,a]=(0,P.useState)(null),[o,s]=(0,P.useState)(!1),c=(0,P.useRef)(0),l=(0,P.useRef)(0),{data:u}=I({queryKey:t?[`context`,t]:L.context,queryFn:()=>hr(t??void 0),refetchInterval:1e4,enabled:!e}),d=e??u,f=t??``,p=e?ga(e,f):r??(d?ga(d,f):null),m=p?.growth.currentTokens??0,h=Math.min(p?.fillPercent??0,100),g=l.current>0&&h>c.current;if((0,P.useEffect)(()=>{if(l.current>0&&m<l.current*.7){s(!0);let e=setTimeout(()=>s(!1),1e3);return l.current=m,c.current=h,()=>clearTimeout(e)}l.current=m,c.current=h},[h,m]),!p||p.totalTokens===0)return null;let{breakdown:_,growth:v,fillPercent:y,totalTokens:b}=p,x=y>=100,S=p.contextWindow;return(0,F.jsxs)(`div`,{className:`group`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-1.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(z,{children:`Context`}),x&&(0,F.jsx)(Nr,{tone:`danger`,size:`sm`,uppercase:!0,className:`animate-pulse motion-reduce:animate-none`,children:`at capacity`})]}),(0,F.jsxs)(`div`,{className:`text-[11px] text-ink-subtle tabular-nums`,children:[ha(v.currentTokens),S&&S>0&&(0,F.jsx)(`span`,{className:`text-ink-muted`,children:` / ${ha(S)}`}),v.delta>0&&(0,F.jsxs)(`span`,{className:`text-accent-amber ml-1`,children:[`+`,ha(v.delta)]}),v.delta<0&&(0,F.jsx)(`span`,{className:`text-accent-cyan ml-1`,children:`compacted`})]})]}),(0,F.jsxs)(`div`,{className:`relative`,children:[o&&(0,F.jsx)(`div`,{className:`absolute inset-0 rounded-full bg-accent-cyan/20 animate-compact-flash pointer-events-none`}),(0,F.jsx)(`div`,{className:`w-full h-3 bg-surface-3 rounded-full overflow-hidden flex transition-colors duration-150 ${g?`shadow-[0_0_12px_rgba(255,178,36,0.3)]`:``} ${o?`animate-compact`:``}`,children:ua.map(e=>{let t=_[e];if(t<=0)return null;let n=Math.round(t/b*100),r=i===e;return(0,F.jsx)(`div`,{className:`${da[e]} transition-all duration-500 ease-out cursor-default relative ${r?`brightness-125 ${fa[e]}`:``}`,style:{width:`${t/b*h}%`},title:`${ma[e]}: ${ha(t)} (${n}%)`,onMouseEnter:()=>a(e),onMouseLeave:()=>a(null)},e)})})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3 mt-1.5 text-[10px] text-ink-muted`,children:[ua.map(e=>{let t=_[e],n=i===e;return(0,F.jsxs)(`span`,{className:`flex items-center gap-1 transition-colors duration-200 cursor-default ${n?`text-ink-base`:``}`,onMouseEnter:()=>a(e),onMouseLeave:()=>a(null),children:[(0,F.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full ${pa[e]} ${n?`scale-150`:``} transition-transform duration-200`}),ma[e],n&&t>0&&(0,F.jsx)(`span`,{className:`text-ink-subtle ml-0.5`,children:ha(t)})]},e)}),(0,F.jsxs)(`span`,{className:`ml-auto tabular-nums ${x?`text-accent-red`:h>=75?`text-accent-amber`:``}`,children:[h.toFixed(0),`%`]})]})]})}function va(e){let t=e==null?new Date:new Date(e);return t.setHours(0,0,0,0),t.getTime()}function ya(e,t){let n=new Date(e),r=t==null?new Date:new Date(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}var ba={weekday:`short`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`},xa=3e4,Sa={info:`text-ink-muted`,warning:`text-accent-amber`,critical:`text-accent-red`},Ca=1e4;function wa(){let e=zn(e=>e.cost),t=zn(e=>e.antiPatterns),{data:n,isPending:r}=I({queryKey:L.cost,queryFn:Qn}),{data:i}=I({queryKey:L.sessionCurrent,queryFn:qn,refetchInterval:1e4}),{data:a,isPending:o}=I({queryKey:L.sessionsTodayAggregate,queryFn:Yn,refetchInterval:1e4}),{data:s,isPending:c}=I({queryKey:L.sessionsList(200),queryFn:()=>Jn(200),refetchInterval:1e4}),{data:l,isPending:u}=I({queryKey:L.antiPatterns,queryFn:$n}),{data:d}=I({queryKey:L.concurrency,queryFn:fr,refetchInterval:1e4}),{data:f}=I({queryKey:L.activityHeatmap(`today`),queryFn:()=>mr(`today`),refetchInterval:3e4}),{data:p}=I({queryKey:L.sessionsLive,queryFn:Xn,refetchInterval:1e4}),m=(0,P.useMemo)(()=>za(s??[]),[s]),h=(0,P.useMemo)(()=>Ba(s??[]),[s]),g=(0,P.useMemo)(()=>Va(s??[]),[s]),_=(0,P.useMemo)(()=>Ha(s??[]),[s]),v=Math.max(a?.toolCallCount??0,h),y=(r||c||o)&&!e&&m===0&&a===void 0,b=Math.max(e?.todayTotalUsd??0,a?.totalCostUsd??0,m),x=Math.max(l?.length??0,t.length),S=Math.max(a?.antiPatternCount??0,g+x),[C,w]=(0,P.useState)(()=>new Date().toLocaleString(void 0,ba));(0,P.useEffect)(()=>{let e=setInterval(()=>w(new Date().toLocaleString(void 0,ba)),6e4);return()=>clearInterval(e)},[]);let T=i?.efficiencyScore??null,E=T!==null&&Number.isFinite(T)?`${Math.round(T*100)}%`:`—`,D=T===null?`needs more data`:Math.round(T*100)>=80?`strong session`:Math.round(T*100)>=50?`mixed signals`:`needs attention`;return(0,F.jsxs)(`section`,{children:[(0,F.jsx)(ia,{}),(0,F.jsxs)(`header`,{className:`flex items-baseline justify-between mb-4`,children:[(0,F.jsx)(`h1`,{className:`text-xl font-semibold gradient-text`,children:`Today`}),(0,F.jsx)(`span`,{className:`text-xs text-ink-muted`,children:C})]}),!y&&!o&&!c&&!u&&v===0&&b===0&&S===0?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ci,{index:0,className:`glass-card p-8 mb-4`,children:(0,F.jsx)(Li,{icon:`code`,title:`No activity yet today`,subtitle:`Metrics will appear here once you start a coding session with Claude.`})}),(0,F.jsx)(Ci,{index:1,children:(0,F.jsx)(Fa,{})})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ci,{index:0,className:`mb-4`,children:(0,F.jsx)(R,{padding:`lg`,tone:`elevated`,glow:`green`,children:(0,F.jsxs)(`div`,{className:`grid grid-cols-4 gap-4`,children:[(0,F.jsx)(B,{label:`efficiency`,hero:!0,value:E,sub:D,...T===null?{}:{animate:!0,numericValue:Math.round(T*100),suffix:`%`}}),(0,F.jsx)(B,{label:`spend today`,tone:`accent`,value:y?`…`:`$${b.toFixed(2)}`,...y?{}:{animate:!0,numericValue:b,prefix:`$`,decimals:2}}),(0,F.jsx)(B,{label:`tool calls`,value:String(v),animate:!0,numericValue:v}),(0,F.jsx)(B,{label:`flags`,tone:S>0?`warn`:`neutral`,value:String(S),animate:!0,numericValue:S})]})})}),(0,F.jsxs)(Ci,{index:1,className:`grid grid-cols-2 gap-3 mb-3`,children:[(0,F.jsx)(Ua,{todayTotal:b,forecastEod:y?null:e?.forecastEodUsd??(n?.forecast?.forecastEndOfDayUsd==null?null:b+n.forecast.forecastEndOfDayUsd-(n.sessionTodayUsd??0)),hourlySpend:_}),d&&d.buckets&&(0,F.jsx)(Ji,{current:d.current,peak:d.peak,allTimePeak:d.allTimePeak,bucketSizeMs:d.bucketSizeMs,startTimestamp:d.startTimestamp,buckets:d.buckets})]}),S>0&&(t.length>0||l&&l.length>0)&&(0,F.jsx)(Ci,{index:2,className:`mb-3`,children:(0,F.jsx)(R,{padding:`sm`,tone:`warning`,className:`text-xs`,children:t.length>0?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Nr,{tone:`warning`,size:`sm`,className:`mr-2`,children:t[0].type}),(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`— `}),(0,F.jsxs)(`span`,{children:[t[0].count,`× on `]}),(0,F.jsx)(`code`,{className:`bg-surface-5 px-1 rounded`,children:t[0].target}),t[0].sessionId&&(0,F.jsxs)(Nr,{tone:`neutral`,size:`sm`,className:`ml-2`,children:[`Session: `,Pa(t[0].sessionId,p??[])]})]}):l&&l.length>0?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Nr,{tone:`warning`,size:`sm`,className:`mr-2`,children:l[0].type}),(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`— `}),(0,F.jsxs)(`span`,{children:[l[0].count??l[0].iterations??l[0].readCount??l[0].repeatCount??l[0].editCount??l[0].agentCount??`?`,`× on`,` `]}),(0,F.jsx)(`code`,{className:`bg-surface-5 px-1 rounded`,children:l[0].file??l[0].command??`unknown`})]}):null})}),(0,F.jsxs)(Ci,{index:3,className:`grid grid-cols-3 gap-3 mb-3`,children:[(0,F.jsx)(Ta,{}),(0,F.jsx)(Ea,{}),(0,F.jsx)(Da,{}),(0,F.jsx)(Oa,{}),(0,F.jsx)(Aa,{})]}),(0,F.jsx)(Ci,{index:4,children:(0,F.jsx)(Na,{sessions:s??[],liveSessions:p??[]})}),f&&f.buckets?.length>0&&(0,F.jsx)(Ci,{index:5,className:`mb-3`,children:(0,F.jsxs)(R,{padding:`sm`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Activity Today`}),(0,F.jsx)(ea,{variant:`strip`,buckets:f.buckets,maxCount:f.maxCount,bucketSizeMs:f.bucketSizeMs,startTimestamp:f.startTimestamp,ariaLabel:`Today's activity density in 15-minute blocks`})]})}),(0,F.jsx)(Ci,{index:6,children:(0,F.jsx)(Fa,{})})]})]})}function Ta(){let{data:e}=I({queryKey:L.qualityProxy,queryFn:cr,refetchInterval:Ca});return(0,F.jsxs)(R,{padding:`sm`,className:`h-full`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Quality`}),!e||e.totalSignals===0?(0,F.jsx)(Li,{icon:`checkmark`,title:`Waiting for edits and test runs`,subtitle:`Quality metrics appear after editing files and running tests.`}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`Diff Apply `}),(0,F.jsx)(`span`,{className:Gr(e.diffApplyRate),children:e.diffApplyRate===null?`—`:`${(e.diffApplyRate*100).toFixed(0)}%`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`Test Pass `}),(0,F.jsx)(`span`,{className:Gr(e.testPassRate),children:e.testPassRate===null?`—`:`${(e.testPassRate*100).toFixed(0)}%`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`Backtracks `}),(0,F.jsx)(`span`,{className:e.backtrackCount>0?`text-accent-amber`:``,children:e.backtrackCount})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`Self-corrections `}),(0,F.jsx)(`span`,{className:`text-ink-subtle`,children:e.selfCorrectionCount})]})]}),e.degradationDetected&&(0,F.jsx)(`div`,{className:`text-accent-amber text-xs mt-2`,children:`⚠ Quality degrading`})]})]})}function Ea(){let{data:e}=I({queryKey:L.toolSelectionScore,queryFn:lr,refetchInterval:Ca});return(0,F.jsxs)(R,{padding:`sm`,className:`h-full`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Tool Selection`}),!e||Array.isArray(e)||e.totalCalls===0?(0,F.jsx)(Li,{icon:`radar`,title:`Waiting for tool calls`,subtitle:`Start a Claude Code session to begin scoring. Resets when the process restarts.`}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,F.jsx)(`span`,{className:`text-2xl font-semibold tabular-nums ${Kr(e.score)}`,children:e.score.toFixed(2)}),(0,F.jsx)(`span`,{className:`text-[10px] text-ink-muted`,children:`/ 1.0`})]}),(0,F.jsxs)(`div`,{className:`text-[10px] text-ink-muted mt-1`,children:[e.penalizedCalls,` of `,e.totalCalls,` calls penalized`]}),(e.redundantReadCount>0||e.repeatedFailureCount>0||e.unusedOutputCount>0)&&(0,F.jsxs)(`div`,{className:`text-[10px] text-ink-subtle mt-1 space-x-2`,children:[e.redundantReadCount>0&&(0,F.jsxs)(`span`,{children:[`re-reads: `,e.redundantReadCount]}),e.repeatedFailureCount>0&&(0,F.jsxs)(`span`,{children:[`repeat fails: `,e.repeatedFailureCount]}),e.unusedOutputCount>0&&(0,F.jsxs)(`span`,{children:[`unused output: `,e.unusedOutputCount]})]}),(0,F.jsx)(`div`,{className:`text-[10px] text-ink-subtle/60 mt-2`,children:`Penalizes: reading the same file 3+ times without editing, repeated tool failures, fetching large outputs never referenced.`})]})]})}function Da(){let{data:e}=I({queryKey:L.latency,queryFn:rr,refetchInterval:Ca}),t=e?.byTool?Object.entries(e.byTool).filter(e=>e[1]!==null&&e[1].count>0).sort((e,t)=>t[1].p95-e[1].p95).slice(0,4):[];return(0,F.jsxs)(R,{padding:`sm`,className:`h-full`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Latency (ms)`}),!e||!e.overall?(0,F.jsx)(Li,{icon:`clock`,title:`Waiting for tool calls`,subtitle:`Latency percentiles appear after tool calls complete.`}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`flex gap-4 text-xs mb-2`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`p50 `}),(0,F.jsx)(`span`,{className:`text-ink-base tabular-nums`,children:e.overall.p50})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`p95 `}),(0,F.jsx)(`span`,{className:`text-ink-base tabular-nums`,children:e.overall.p95})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`p99 `}),(0,F.jsx)(`span`,{className:`text-ink-base tabular-nums`,children:e.overall.p99})]})]}),t.length>0&&(0,F.jsx)(`div`,{className:`space-y-1`,children:t.map(([e,t])=>(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,F.jsx)(`span`,{className:`text-ink-muted truncate w-28 shrink-0`,children:Qr(e)}),(0,F.jsxs)(`span`,{className:`tabular-nums text-ink-subtle`,children:[t.p95,`ms p95`]})]},e))})]})]})}function Oa(){let{data:e}=I({queryKey:L.modelUsage,queryFn:gr,refetchInterval:Ca}),t=e?.byModel?Object.entries(e.byModel).filter(([,e])=>e.requestCount>0).sort((e,t)=>t[1].totalCostUsd-e[1].totalCostUsd).slice(0,4):[];return(0,F.jsxs)(R,{padding:`sm`,className:`h-full`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Model Usage`}),!e||t.length===0?(0,F.jsx)(Li,{icon:`radar`,title:`No model data yet`,subtitle:`Start a Claude Code session to see model cost breakdown. Resets when the process restarts.`}):(0,F.jsxs)(`div`,{className:`space-y-1.5`,children:[t.map(([e,t])=>(0,F.jsxs)(`div`,{className:`flex items-center justify-between text-xs gap-2`,children:[(0,F.jsx)(`span`,{className:`text-ink-muted truncate`,children:e}),(0,F.jsxs)(`div`,{className:`flex gap-3 shrink-0 tabular-nums`,children:[(0,F.jsxs)(`span`,{className:`text-ink-subtle`,children:[t.requestCount,`req`]}),(0,F.jsxs)(`span`,{className:`text-ink-base`,children:[`$`,t.totalCostUsd.toFixed(4)]})]})]},e)),e?.mostEfficientModel&&(0,F.jsxs)(`div`,{className:`text-[10px] text-accent-green mt-1`,children:[`Most efficient: `,e.mostEfficientModel]})]})]})}function ka(e,t){let n=t===null?null:`${t}%`;return e===`excellent`?n?`Cache hit rate is ${n}. Cache is well-structured.`:`Cache is well-structured. No changes needed.`:e===`can_improve`?n?`Cache hit rate is ${n}. Placing stable content before variable content in prompts could improve this.`:`Place stable content before variable content in prompts to improve.`:n?`Cache hit rate is ${n}. Restructuring your system prompt so stable context appears at the top could bring this above 60%.`:`Restructure your system prompt so stable context appears at the top.`}function Aa(){let{data:e}=I({queryKey:L.cacheHealth,queryFn:_r,refetchInterval:Ca}),t=!e||e.status===`no_cache_activity`||e.cache_hit_rate_pct==null;return(0,F.jsxs)(R,{padding:`sm`,className:`h-full`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Cache Health`}),t?(0,F.jsx)(Li,{icon:`radar`,title:`No cache data yet`,subtitle:`Appears once token usage with cache reads is reported.`}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`flex items-baseline gap-2 mb-1`,children:[(0,F.jsxs)(`span`,{className:`text-2xl font-semibold tabular-nums ${e.status===`excellent`?`text-accent-green`:e.status===`needs_attention`?`text-accent-amber`:`text-ink-base`}`,children:[e.cache_hit_rate_pct,`%`]}),(0,F.jsx)(Nr,{tone:e.status===`needs_attention`?`warning`:`neutral`,size:`sm`,children:e.status===`excellent`?`excellent`:e.status.replace(`_`,` `)})]}),e.total_savings_usd>0&&(0,F.jsxs)(`div`,{className:`text-xs text-accent-green mb-1`,children:[`$`,e.total_savings_usd.toFixed(4),` saved`]}),e.week_over_week_delta_pts!==null&&e.week_over_week_delta_pts!==0&&(0,F.jsxs)(`div`,{className:`text-[10px] font-medium mb-1 ${e.week_over_week_delta_pts>0?`text-accent-green`:`text-accent-amber`}`,children:[e.week_over_week_delta_pts>0?`↑`:`↓`,Math.abs(e.week_over_week_delta_pts),`pts vs last week`]}),(0,F.jsx)(`div`,{className:`text-[10px] text-ink-subtle/70 leading-snug`,children:ka(e.status,e.cache_hit_rate_pct)})]})]})}var ja={Read:`📄`,Edit:`✏️`,Write:`📝`,Bash:`⚡`,Agent:`🤖`,AskUserQuestion:`💬`,TaskCreate:`📋`,TaskUpdate:`✅`},Ma=3e3;function Na({sessions:e,liveSessions:t}){let[n,r]=(0,P.useState)(null),[i,a]=(0,P.useState)(`list`),[,o]=Kt(),s=zn(e=>e.setActiveSession),{data:c}=I({queryKey:L.sessionCurrent,queryFn:qn}),l=(0,P.useMemo)(()=>{let e=new Set;for(let n of t)e.add(n.sessionId);if(e.size===0)if(c?.liveSessions?.length)for(let t of c.liveSessions)e.add(t);else c?.sessionId&&e.add(c.sessionId);return e},[t,c]),u=(t.length>0?t[0].sessionId:null)??(l.size>0?[...l][0]:null),d=n??u,f=d!==null&&l.has(d),p=n!==null&&!l.has(n);(0,P.useEffect)(()=>{s(d)},[d,s]);let{data:m}=I({queryKey:d?L.sessionReplay(d):[`replay`,`none`],queryFn:()=>sr(d),enabled:d!==null,retry:!1,refetchInterval:f?Ma:!1}),h=(0,P.useRef)(null);(0,P.useEffect)(()=>{f&&h.current&&(h.current.scrollTop=h.current.scrollHeight)},[m?.timeline.length,f]);let g=(0,P.useMemo)(()=>{let n=Date.now()-360*60*1e3,r=new Map;for(let e of t)r.set(e.sessionId,e);let i=new Map;for(let t of e){if(!t.sessionId)continue;let e=t.startTime!=null&&La(t.startTime),a=r.has(t.sessionId),o=t.startTime!=null&&t.durationMs!=null?t.startTime+t.durationMs:null,s=o!=null&&o>=n&&La(o);(e||a||s)&&i.set(t.sessionId,t)}for(let e of t)e.sessionId&&(i.has(e.sessionId)||i.set(e.sessionId,{sessionId:e.sessionId,sessionName:e.sessionName,startTime:e.startTime,toolCallCount:0,estimatedCostUsd:null}));let a=e=>{let t=r.get(e.sessionId);return t?t.lastActivity:e.startTime!=null&&e.durationMs!=null?e.startTime+e.durationMs:e.startTime??0};return[...i.values()].sort((e,t)=>a(t)-a(e)).slice(0,10)},[e,t]),_=m?.timeline??[],v=_.length>0?_[0].timestamp:0;return(0,F.jsxs)(`div`,{className:`glass-card mb-3 grid grid-cols-[220px_1fr] overflow-hidden`,style:{height:`320px`},children:[(0,F.jsxs)(`div`,{className:`border-r border-border-subtle overflow-auto`,children:[(0,F.jsx)(z,{className:`p-2 border-b border-border-subtle`,children:`Session Live Tail`}),g.map(e=>{let t=l.has(e.sessionId);return(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r(e.sessionId),className:`block w-full text-left p-2 border-b border-border-subtle text-xs transition-colors duration-150 hover:bg-surface-5 `+(d===e.sessionId?`bg-surface-5`:``),children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`font-mono text-ink-base`,children:e.sessionName||e.sessionId.slice(0,8)}),t?(0,F.jsx)(Fr,{label:`live`,size:`sm`}):(0,F.jsx)(`span`,{className:`text-[10px] text-ink-muted`,title:e.startTime?`Started ${Jr(e.startTime)}`:void 0,children:e.startTime?Jr(e.startTime+(e.durationMs??0)):``})]}),(0,F.jsxs)(`div`,{className:`flex gap-2 mt-0.5 text-[10px] text-ink-subtle`,children:[(0,F.jsxs)(`span`,{children:[e.toolCallCount??0,` calls`]}),e.estimatedCostUsd!=null&&e.estimatedCostUsd>0?(0,F.jsxs)(`span`,{children:[`$`,e.estimatedCostUsd.toFixed(2)]}):(0,F.jsx)(`span`,{children:`—`})]})]},e.sessionId)}),l.size===0&&g.length===0&&(0,F.jsx)(Li,{icon:`code`,title:`No sessions today`,subtitle:`Start coding with Claude to see sessions here.`})]}),(0,F.jsxs)(`div`,{className:`flex flex-col overflow-hidden`,children:[d&&(0,F.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1 border-b border-border-subtle shrink-0`,children:[(0,F.jsx)(Rr,{value:i,onChange:a,size:`sm`,tone:`green`,ariaLabel:`Timeline view mode`,options:[{value:`gantt`,label:`Gantt`},{value:`list`,label:`List`}]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p&&(0,F.jsx)(`span`,{"data-testid":`session-ended-badge`,children:(0,F.jsx)(Nr,{tone:`neutral`,size:`sm`,uppercase:!0,children:`Session ended`})}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>o(`/sessions?id=${d}`),className:`text-[10px] text-accent-cyan hover:underline transition-colors duration-150`,children:`full session →`})]})]}),(0,F.jsxs)(`div`,{ref:h,className:`overflow-auto flex-1 p-2`,children:[!d&&(0,F.jsx)(`div`,{className:`text-ink-muted text-xs p-2`,children:`Select a session to view its timeline.`}),d&&_.length===0&&(0,F.jsx)(Li,{icon:`timeline`,title:f?`Waiting for tool calls`:`No tool calls`,subtitle:f?`Tool calls will appear here in real time.`:`This session has no recorded tool calls.`}),_.length>0&&i===`gantt`&&(0,F.jsx)(Vi,{entries:_,segments:m?.segments??[]}),_.length>0&&i===`list`&&(0,F.jsx)(`div`,{className:`flex flex-col`,children:_.map((e,t)=>(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 px-1 py-0.5 text-xs border-b border-border-subtle/50 last:border-b-0`,children:[(0,F.jsxs)(`span`,{className:`w-10 text-ink-muted tabular-nums text-[11px] shrink-0`,children:[`+`,Yr(e.timestamp-v)]}),(0,F.jsx)(`span`,{className:`w-4 text-center text-[11px]`,"aria-hidden":`true`,children:ja[e.toolName]??`·`}),(0,F.jsx)(`span`,{className:`w-28 truncate font-medium text-ink-base text-[11px]`,title:e.toolName,children:Qr(e.toolName)}),(0,F.jsx)(`span`,{className:`flex-1 truncate font-mono text-ink-subtle text-[10px]`,title:e.filePath??e.command??``,children:e.filePath??e.command??``}),(0,F.jsx)(`span`,{className:`w-12 text-right tabular-nums text-ink-muted text-[10px]`,children:e.durationMs==null?``:`${e.durationMs}ms`}),(0,F.jsx)(`span`,{className:`w-3 text-center text-[10px] ${e.success?`text-accent-green`:`text-accent-red`}`,children:e.success?`✓`:`✗`})]},`${t}-${e.timestamp}`))})]}),f&&d&&(0,F.jsx)(`div`,{className:`border-t border-bg-line px-3 py-2 shrink-0`,children:(0,F.jsx)(_a,{sessionId:d})})]})]})}function Pa(e,t){let n=t.find(t=>t.sessionId===e);return n?.sessionName?n.sessionName:e.slice(0,8)}function Fa(){let{data:e,isLoading:t,error:n}=I({queryKey:L.alertsRecent,queryFn:async()=>{try{return await or()}catch(e){if(e instanceof Wn)return null;throw e}},refetchInterval:xa,retry:!1});if(e===null)return null;let r=[...e??[]].sort((e,t)=>t.firedAt-e.firedAt);return(0,F.jsxs)(R,{padding:`sm`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Recent Alerts`}),t&&(0,F.jsx)(Li,{variant:`loading`,title:`Loading...`}),n&&(0,F.jsx)(`div`,{className:`text-accent-red text-xs`,children:`Error loading recent alerts.`}),!t&&!n&&r.length===0&&(0,F.jsx)(`div`,{className:`text-ink-muted text-xs`,children:`No alerts in recent history.`}),!t&&!n&&r.length>0&&(0,F.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,F.jsx)(`thead`,{className:`text-ink-muted`,children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{className:`text-left pb-1`,children:`when`}),(0,F.jsx)(`th`,{className:`text-left pb-1`,children:`sev`}),(0,F.jsx)(`th`,{className:`text-left pb-1`,children:`rule`}),(0,F.jsx)(`th`,{className:`text-right pb-1`,children:`value / threshold`}),(0,F.jsx)(`th`,{className:`text-left pb-1 pl-2`,children:`state`})]})}),(0,F.jsx)(`tbody`,{children:r.slice(0,50).map(e=>(0,F.jsxs)(`tr`,{className:`border-t border-border-subtle`,children:[(0,F.jsx)(`td`,{className:`py-1 text-ink-subtle tabular-nums whitespace-nowrap`,children:Ia(e.firedAt)}),(0,F.jsxs)(`td`,{className:`py-1`,children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,className:Sa[e.severity],children:`●`}),` `,(0,F.jsx)(`span`,{className:`text-ink-subtle uppercase tracking-wider text-[10px]`,children:e.severity})]}),(0,F.jsx)(`td`,{className:`py-1`,children:e.title}),(0,F.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[Zr(e.value),` / `,Zr(e.threshold)]}),(0,F.jsx)(`td`,{className:`py-1 pl-2 `+(e.state===`firing`?`text-accent-amber`:`text-ink-muted`),children:e.state})]},`${e.id}-${e.firedAt}-${e.state}`))})]})]})}function Ia(e){let t=Math.max(0,Date.now()-e),n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}var La=e=>ya(e);function Ra(e){let t=e.estimatedCostUsd;if(t==null||t<=0||e.startTime==null)return 0;let n=va(),r=n+864e5,i=e.startTime,a=typeof e.endTime==`number`?e.endTime:typeof e.durationMs==`number`?e.startTime+e.durationMs:Date.now();return a<n||i>=r?0:i>=n&&a<r?t:t*((Math.min(a,r)-Math.max(i,n))/Math.max(1,a-i))}function za(e){let t=0;for(let n of e)t+=Ra(n);return t}function Ba(e){let t=0;for(let n of e)(n.startTime&&La(n.startTime)||Ra(n)>0)&&(t+=n.toolCallCount??0);return t}function Va(e){let t=0;for(let n of e)(n.startTime&&La(n.startTime)||Ra(n)>0)&&(t+=n.antiPatterns?.length??0);return t}function Ha(e){let t=Array(24).fill(0);for(let n of e){if(!n.startTime||!La(n.startTime)||n.estimatedCostUsd==null)continue;let e=new Date(n.startTime).getHours();t[e]+=n.estimatedCostUsd}return t.map((e,t)=>({hour:t,cost:e}))}function Ua({todayTotal:e,forecastEod:t,hourlySpend:n}){let r=t!==null&&Number.isFinite(t),i=r?Math.max(t,e):0,a=r?i-e:0,o=r&&e>0?a/e*100:0,s=n.some(e=>e.cost>0);return(0,F.jsxs)(R,{padding:`sm`,className:`mb-3 h-full`,children:[(0,F.jsx)(z,{className:`mb-1.5`,children:`Forecast · End of Day`}),r?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,F.jsxs)(`span`,{className:`text-lg font-semibold text-accent-cyan tabular-nums`,children:[`$`,i.toFixed(2)]}),(0,F.jsx)(`span`,{className:`text-xs text-ink-muted tabular-nums`,children:a>0?(0,F.jsxs)(F.Fragment,{children:[`+$`,a.toFixed(2),e>0&&` (+${o.toFixed(0)}%)`,` from now`]}):(0,F.jsx)(F.Fragment,{children:`on pace`})})]}),s&&(0,F.jsx)(`div`,{className:`mt-2`,children:(0,F.jsx)(Ai,{hours:n})})]}):(0,F.jsx)(`div`,{className:`text-ink-muted text-xs`,children:`Insufficient data — forecast appears once burn rate stabilizes.`})]})}function Wa(e,t){let{startMs:n,endMs:r,bucketSizeMs:i}=t,a=Math.max(1,Math.ceil((r-n)/i)),o=Array(a).fill(0);for(let t of e){let e=Math.floor((t.timestamp-n)/i);e>=0&&e<a&&o[e]++}return o}function Ga(e){return e<6e5?3e4:e<36e5?6e4:e<144e5?3e5:9e5}var Ka=50,qa={thrashing:`Edit/Test Thrashing`,stuck_loop:`Stuck Loop`,blind_editing:`Blind Editing`,re_reading:`Repeated Reads`},Ja={Read:`📄`,Edit:`✏️`,Write:`📝`,Bash:`⚡`,Agent:`🤖`,AskUserQuestion:`💬`,TaskCreate:`📋`,TaskUpdate:`✅`},Ya=3e3;function Xa(e){return typeof e.startTime==`number`?e.startTime:new Date(e.startTime??0).getTime()}function Za(e){return Xa(e)+(e.durationMs??0)}function Qa(e,t){let n=[...e];switch(t){case`date`:n.sort((e,t)=>Xa(t)-Xa(e));break;case`lastActive`:n.sort((e,t)=>Za(t)-Za(e));break;case`cost`:n.sort((e,t)=>(t.estimatedCostUsd??0)-(e.estimatedCostUsd??0));break;case`calls`:n.sort((e,t)=>(t.toolCallCount??0)-(e.toolCallCount??0));break}return n}function $a(){let[e,t]=(0,P.useState)(new URLSearchParams(window.location.search).get(`id`)),[n,r]=(0,P.useState)(`date`),i=I({queryKey:L.sessionsList(Ka),queryFn:()=>Jn(Ka),refetchInterval:1e4}),a=I({queryKey:L.sessionCurrent,queryFn:qn,refetchInterval:1e4}),o=(0,P.useMemo)(()=>{let e=new Set;if(a.data?.liveSessions?.length)for(let t of a.data.liveSessions)e.add(t);else a.data?.sessionId&&e.add(a.data.sessionId);return e},[a.data]),s=I({queryKey:e?L.sessionDetail(e):[`session`,`none`],queryFn:()=>Zn(e),enabled:e!==null,refetchInterval:a.isLoading||e&&o.has(e)?1e4:!1}),c=(0,P.useMemo)(()=>Qa(i.data??[],n),[i.data,n]);(0,P.useEffect)(()=>{if(e)return;let n=o.size>0?[...o][0]:null;n?t(n):c.length>0&&t(c[0].sessionId)},[o,c,e]);let l=e=>{t(e)};return(0,F.jsxs)(`section`,{className:`flex flex-col h-full`,children:[(0,F.jsx)(`div`,{className:`h-8 overflow-hidden rounded-lg mb-2 shrink-0`,children:(0,F.jsx)(ia,{theme:`sessions`})}),(0,F.jsx)(`h1`,{className:`text-lg font-semibold gradient-text mb-2 shrink-0`,children:`Sessions`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-[260px_1fr] gap-3 flex-1 min-h-0`,children:[(0,F.jsxs)(R,{padding:`none`,tone:`static`,className:`overflow-hidden flex flex-col`,children:[(0,F.jsx)(`header`,{className:`p-2 border-b border-border-subtle`,children:(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsx)(z,{as:`h2`,children:`List`}),(0,F.jsxs)(`select`,{value:n,onChange:e=>r(e.target.value),className:`text-[10px] bg-surface-5 border border-border-medium rounded-md px-1.5 py-0.5 text-ink-subtle`,children:[(0,F.jsx)(`option`,{value:`date`,children:`Newest`}),(0,F.jsx)(`option`,{value:`lastActive`,children:`Last active`}),(0,F.jsx)(`option`,{value:`cost`,children:`Cost`}),(0,F.jsx)(`option`,{value:`calls`,children:`Calls`})]})]})}),(0,F.jsxs)(`div`,{className:`overflow-auto`,children:[i.isLoading&&(0,F.jsx)(Li,{variant:`loading`,icon:`timeline`,title:`Loading sessions`}),!i.isLoading&&c.length===0&&o.size===0&&(0,F.jsx)(Li,{icon:`code`,title:`No sessions yet`,subtitle:`Start coding with Claude to see your sessions here.`}),c.map(t=>{let r=o.has(t.sessionId);return(0,F.jsxs)(`button`,{type:`button`,onClick:()=>l(t.sessionId),className:`block w-full text-left p-2 border-b border-border-subtle text-xs transition-colors duration-150 hover:bg-surface-5 `+(e===t.sessionId?`bg-surface-5`:``),children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,F.jsx)(`span`,{className:`font-mono text-ink-base truncate`,children:t.sessionName||t.sessionId.slice(0,8)}),r&&(0,F.jsx)(Fr,{size:`sm`,label:`live`,className:`shrink-0`})]}),(0,F.jsxs)(`div`,{className:`flex justify-between mt-1 text-ink-subtle text-[11px] tabular-nums`,children:[(0,F.jsxs)(`span`,{children:[t.toolCallCount??0,` calls`]}),(0,F.jsx)(`span`,{className:`text-ink-muted`,title:n===`lastActive`&&t.startTime?`Started ${qr(t.startTime)}`:void 0,children:t.startTime?qr(n===`lastActive`?Za(t):t.startTime):`—`}),(0,F.jsx)(`span`,{children:t.estimatedCostUsd==null?`—`:`$${t.estimatedCostUsd.toFixed(2)}`})]})]},t.sessionId)}),c.length>=Ka&&(0,F.jsxs)(`div`,{className:`p-2 text-[10px] text-ink-muted text-center border-t border-border-subtle`,children:[`Showing `,Ka,` most recent sessions.`]})]})]}),(0,F.jsxs)(`div`,{className:`glass-card glass-card-static p-4 overflow-auto`,children:[!e&&(0,F.jsx)(Li,{icon:`timeline`,title:`Loading sessions`,subtitle:`Selecting the most recent session…`}),e&&s.isLoading&&(0,F.jsx)(Li,{variant:`loading`,icon:`timeline`,title:`Loading detail`}),e&&s.data&&(0,F.jsx)(to,{data:s.data,isLive:!!e&&o.has(e)})]})]})]})}function eo(e){return e===`Read`?`bg-accent-blue/80`:e===`Edit`||e===`Write`?`bg-accent-green/80`:e===`Bash`?`bg-accent-purple/80`:e===`Agent`?`bg-accent-teal/80`:`bg-ink-subtle/80`}function to({data:e,isLive:t}){let n=e.toolBreakdown??{},r=Object.entries(n).sort((e,t)=>t[1]-e[1]),i=e.toolCallCount??0,a=e.durationMs==null?null:Xr(e.durationMs),o=e.timeline??[],s=o.length>0?o[0].timestamp:0;return o.length===0&&r.length===0?(0,F.jsx)(Li,{icon:`timeline`,title:`No tool calls`,subtitle:`This session has no recorded tool calls.`}):(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`flex items-baseline justify-between mb-3`,children:(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`h2`,{className:`text-xs tracking-wider text-ink-muted flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`font-mono text-ink-base ${e.sessionName?`font-medium`:`uppercase`}`,children:e.sessionName||e.sessionId.slice(0,8)}),(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,F.jsxs)(`span`,{className:`uppercase`,children:[i,` calls`]}),a&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,F.jsx)(`span`,{className:`tabular-nums`,children:a})]}),t&&(0,F.jsx)(Fr,{size:`sm`,label:`live`})]}),s>0&&(0,F.jsx)(`div`,{className:`text-[11px] text-ink-subtle mt-0.5`,children:new Date(s).toLocaleString(void 0,{weekday:`short`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})})]})}),(0,F.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 mb-4 text-xs`,children:[e.model&&(0,F.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-2.5`,children:[(0,F.jsx)(z,{children:`Model`}),(0,F.jsx)(`div`,{className:`font-mono`,children:e.model})]}),e.estimatedCostUsd!=null&&(0,F.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-2.5`,children:[(0,F.jsx)(z,{children:`Cost`}),(0,F.jsxs)(`div`,{className:`tabular-nums`,children:[`$`,e.estimatedCostUsd.toFixed(4)]})]}),e.outcome&&(0,F.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-2.5`,children:[(0,F.jsx)(z,{children:`Status`}),(0,F.jsx)(`div`,{className:`capitalize`,children:e.outcome})]})]}),(e.antiPatterns?.length??0)>0&&(0,F.jsxs)(`div`,{className:`mb-4`,children:[(0,F.jsx)(z,{className:`mb-1`,children:`Anti-Patterns`}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.antiPatterns.map(({type:e,count:t})=>(0,F.jsxs)(Nr,{tone:`warning`,size:`sm`,bordered:!0,children:[qa[e]??e,(0,F.jsxs)(`span`,{className:`opacity-70`,children:[`× `,t]})]},e))})]}),(e.qualityProxy||e.toolSelectionScore)&&(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 mb-4`,children:[e.qualityProxy&&(0,F.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-3`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Session Quality`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`Diff Apply `}),(0,F.jsx)(`span`,{className:Gr(e.qualityProxy.diffApplyRate),children:e.qualityProxy.diffApplyRate===null?`—`:`${(e.qualityProxy.diffApplyRate*100).toFixed(0)}%`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`Test Pass `}),(0,F.jsx)(`span`,{className:Gr(e.qualityProxy.testPassRate),children:e.qualityProxy.testPassRate===null?`—`:`${(e.qualityProxy.testPassRate*100).toFixed(0)}%`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`Backtracks `}),(0,F.jsx)(`span`,{className:e.qualityProxy.backtrackCount>0?`text-accent-amber`:``,children:e.qualityProxy.backtrackCount})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`Self-corrections `}),(0,F.jsx)(`span`,{className:`text-ink-subtle`,children:e.qualityProxy.selfCorrectionCount})]})]})]}),e.toolSelectionScore&&(0,F.jsxs)(`div`,{className:`bg-surface-3 rounded-lg p-3`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Tool Selection`}),(0,F.jsx)(`div`,{className:`text-2xl font-semibold tabular-nums ${Kr(e.toolSelectionScore.score)}`,children:e.toolSelectionScore.score.toFixed(2)}),(0,F.jsxs)(`div`,{className:`text-[10px] text-ink-muted mt-1`,children:[`re-reads: `,e.toolSelectionScore.redundantReadCount,` · repeat fails:`,` `,e.toolSelectionScore.repeatedFailureCount,` · unused:`,` `,e.toolSelectionScore.unusedOutputCount]})]})]}),t&&(0,F.jsx)(`div`,{className:`mb-4`,children:(0,F.jsx)(_a,{sessionId:e.sessionId})}),r.length>0&&(0,F.jsx)(no,{breakdownEntries:r,totalCalls:i,isLive:t,sessionId:e.sessionId}),(e.filesRead?.length??0)>0&&(0,F.jsxs)(`div`,{className:`mb-4`,children:[(0,F.jsx)(z,{className:`mb-1`,children:`Files Read`}),(0,F.jsx)(`ul`,{className:`text-[11px] text-ink-subtle space-y-0.5`,children:e.filesRead.map(e=>(0,F.jsx)(`li`,{className:`font-mono truncate`,children:e.split(`/`).slice(-2).join(`/`)},e))})]}),(e.filesModified?.length??0)>0&&(0,F.jsxs)(`div`,{className:`mb-4`,children:[(0,F.jsx)(z,{className:`mb-1`,children:`Files Modified`}),(0,F.jsx)(`ul`,{className:`text-[11px] text-ink-subtle space-y-0.5`,children:e.filesModified.map(e=>(0,F.jsx)(`li`,{className:`font-mono truncate`,children:e.split(`/`).slice(-2).join(`/`)},e))})]}),(0,F.jsx)(io,{timeline:o}),(0,F.jsx)(oo,{sessionId:e.sessionId,isLive:t})]})}function no({breakdownEntries:e,totalCalls:t,isLive:n,sessionId:r}){let[i,a]=(0,P.useState)(`calls`),o=`/api/context?sessionId=${encodeURIComponent(r)}`,{data:s}=I({queryKey:[`context`,r],queryFn:()=>fetch(o).then(e=>e.ok?e.json():null),refetchInterval:1e4,enabled:n&&i===`context`}),c=s?.toolContributions??[],l=c.length>0?c[0].estimatedTokens:0;return(0,F.jsxs)(`div`,{className:`mb-4`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,F.jsx)(z,{children:`Tools`}),n&&(0,F.jsx)(Rr,{value:i,onChange:a,options:[{value:`calls`,label:`Calls`},{value:`context`,label:`Context`}],size:`sm`,tone:`cyan`,ariaLabel:`Tools view`})]}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[i===`calls`&&e.map(([e,n])=>{let r=t>0?n/t*100:0;return(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,F.jsx)(`span`,{className:`w-28 text-ink-subtle truncate`,title:e,children:Qr(e)}),(0,F.jsx)(`div`,{className:`flex-1 h-3 bg-surface-3 relative rounded`,children:(0,F.jsx)(`div`,{className:`h-3 rounded ${eo(e)}`,style:{width:`${r}%`}})}),(0,F.jsx)(`span`,{className:`w-10 text-right text-ink-muted tabular-nums`,children:n})]},e)}),i===`context`&&c.map(e=>{let t=l>0?e.estimatedTokens/l*100:0;return(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,F.jsx)(`span`,{className:`w-28 text-ink-subtle truncate`,title:e.tool,children:Qr(e.tool)}),(0,F.jsx)(`div`,{className:`flex-1 h-3 bg-surface-3 relative rounded`,children:(0,F.jsx)(`div`,{className:`h-3 rounded bg-accent-amber/80`,style:{width:`${t}%`}})}),(0,F.jsxs)(`span`,{className:`w-16 text-right text-ink-muted tabular-nums text-[10px]`,children:[`~`,ro(e.estimatedTokens)]})]},e.tool)}),i===`context`&&c.length===0&&(0,F.jsx)(`div`,{className:`text-[11px] text-ink-muted`,children:`No context data available yet`})]})]})}function ro(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function io({timeline:e}){let t=(0,P.useMemo)(()=>{if(e.length<2)return null;let t=e[0].timestamp,n=e[e.length-1].timestamp,r=n-t;if(r<1e3)return null;let i=Ga(r),a=Wa(e,{startMs:t,endMs:n+i,bucketSizeMs:i});return{buckets:a,maxCount:Math.max(...a,1),bucketSizeMs:i,startMs:t}},[e]);return t?(0,F.jsxs)(`div`,{className:`mb-4`,children:[(0,F.jsx)(z,{className:`mb-1`,children:`Activity Density`}),(0,F.jsx)(ea,{variant:`strip`,buckets:t.buckets,maxCount:t.maxCount,bucketSizeMs:t.bucketSizeMs,startTimestamp:t.startMs,ariaLabel:`Session activity density`})]}):null}var ao=(0,P.forwardRef)(function({children:e,isLive:t,timelineLength:n},r){let i=(0,P.useRef)(null),[a,o]=(0,P.useState)(!1),s=(0,P.useCallback)(()=>{let e=i.current;if(!e)return;let t=e.scrollHeight>e.clientHeight+40,n=e.scrollHeight-e.scrollTop-e.clientHeight<40;o(t&&!n)},[]);(0,P.useEffect)(()=>{let e=i.current;if(e)return s(),e.addEventListener(`scroll`,s,{passive:!0}),()=>e.removeEventListener(`scroll`,s)},[s]),(0,P.useEffect)(()=>{t&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[t,n]);let c=(0,P.useCallback)(()=>{i.current?.scrollTo({top:i.current.scrollHeight,behavior:`smooth`})},[]);return(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(`div`,{ref:(0,P.useCallback)(e=>{i.current=e,typeof r==`function`?r(e):r&&(r.current=e)},[r]),className:`overflow-auto max-h-[60vh]`,children:e}),a&&(0,F.jsx)(kr,{variant:`ghost`,size:`sm`,onClick:c,className:`absolute bottom-2 right-3 backdrop-blur-sm shadow-lg`,children:`↓ Jump to bottom`})]})});function oo({sessionId:e,isLive:t}){let n=(0,P.useRef)(null),[r,i]=(0,P.useState)(`gantt`);(0,P.useEffect)(()=>{i(`gantt`)},[e]);let{data:a,isLoading:o,error:s}=I({queryKey:L.sessionReplay(e),queryFn:()=>sr(e),retry:!1,refetchInterval:t?Ya:!1});if((0,P.useEffect)(()=>{t&&n.current&&(n.current.scrollTop=n.current.scrollHeight)},[a?.timeline.length,t]),o)return(0,F.jsx)(`div`,{className:`mt-3`,children:(0,F.jsx)(Li,{variant:`loading`,icon:`timeline`,title:`Loading replay`})});if(s)return(0,F.jsx)(`div`,{className:`mt-3`,children:(0,F.jsx)(Li,{icon:`timeline`,title:`Replay not available for this session`,subtitle:`This session may predate the replay feature or have no recorded tool calls.`})});if(!a||a.timeline.length===0)return(0,F.jsx)(F.Fragment,{});let c=a.segments,l=a.timeline[0].timestamp,u=co(a.timeline.length,c);return(0,F.jsxs)(`div`,{className:`mt-4`,children:[c.length>0&&(0,F.jsxs)(`div`,{className:`bg-accent-amber/5 border border-accent-amber/30 rounded-xl p-2.5 mb-3`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] font-semibold text-accent-amber mb-1.5`,children:[c.length,` anti-pattern`,c.length>1?`s`:``,` detected`]}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:so(c).map(({type:e,count:t,worstSeverity:n})=>(0,F.jsxs)(Nr,{tone:n===`critical`?`danger`:`warning`,size:`sm`,bordered:!0,children:[qa[e]??e,(0,F.jsxs)(`span`,{className:`opacity-70`,children:[`× `,t]})]},e))})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,F.jsx)(Rr,{value:r,onChange:i,options:[{value:`gantt`,label:`Gantt`},{value:`list`,label:`List`}],size:`sm`,tone:`green`,ariaLabel:`Replay view mode`}),(0,F.jsxs)(z,{children:[`Replay · `,a.timeline.length,` calls`,t&&(0,F.jsx)(`span`,{className:`text-accent-cyan ml-1`,children:`· Auto-Updating`})]})]}),(0,F.jsx)(ao,{ref:n,isLive:t,timelineLength:a.timeline.length,children:r===`gantt`?(0,F.jsx)(Vi,{entries:a.timeline,segments:c}):(0,F.jsx)(`div`,{className:`flex flex-col`,children:a.timeline.map((e,t)=>{let n=u[t],r=n?n.severity===`critical`?`border-l-accent-red`:`border-l-accent-amber`:`border-l-transparent`,i=n?n.severity===`critical`?`bg-accent-red/5`:`bg-accent-amber/5`:``,a=e.timestamp-l;return(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-0.5 border-l-2 ${r} ${i} text-[11px]`,children:[(0,F.jsxs)(`span`,{className:`w-10 text-ink-muted tabular-nums shrink-0`,children:[`+`,Yr(a)]}),(0,F.jsx)(`span`,{className:`w-4 text-center shrink-0`,"aria-hidden":`true`,children:Ja[e.toolName]??`·`}),(0,F.jsx)(`span`,{className:`w-28 truncate font-medium text-ink-base shrink-0`,title:e.toolName,children:Qr(e.toolName)}),(0,F.jsx)(`span`,{className:`flex-1 truncate font-mono text-ink-subtle min-w-0`,title:e.filePath??e.command??``,children:e.filePath??e.command??``}),(0,F.jsx)(`span`,{className:`w-14 text-right tabular-nums text-ink-muted shrink-0`,children:e.durationMs==null?`—`:`${e.durationMs}ms`}),(0,F.jsx)(`span`,{className:`w-3 text-center shrink-0 ${e.success?`text-accent-green`:`text-accent-red`}`,children:e.success?`✓`:`✗`}),n&&t===n.startIndex&&(0,F.jsx)(Nr,{tone:n.severity===`critical`?`danger`:`warning`,size:`sm`,className:`ml-0.5 font-medium shrink-0`,children:qa[n.type]??n.type})]},`${t}-${e.timestamp}`)})})})]})}function so(e){let t=new Map;for(let n of e){let e=t.get(n.type);e?(e.count++,e.totalIterations+=n.iterations,n.severity===`critical`&&(e.worstSeverity=`critical`)):t.set(n.type,{count:1,totalIterations:n.iterations,worstSeverity:n.severity})}return Array.from(t.entries()).map(([e,t])=>({type:e,...t}))}function co(e,t){let n=Array(e).fill(null);for(let r of t){let t=Math.max(0,r.startIndex),i=Math.min(r.endIndex,e-1);for(let e=t;e<=i;e++)(n[e]===null||r.severity===`critical`&&n[e].severity!==`critical`)&&(n[e]=r)}return n}var lo=o((e=>{function t(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Array.isArray(o)&&t<r?i(o,t+1):n.push(o)}};return i(e,0),n}e.flatten=t})),uo=o((e=>{function t(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}e.isEqualsSameValueZero=t})),H=o((()=>{uo()})),fo=o((e=>{function t(e){return Number.isSafeInteger(e)&&e>=0}e.isLength=t})),po=o((e=>{var t=fo();function n(e){return e!=null&&typeof e!=`function`&&t.isLength(e.length)}e.isArrayLike=n})),mo=o((e=>{function t(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}e.isObject=t})),ho=o((e=>{var t=/^(?:0|[1-9]\d*)$/;function n(e,n=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<n;case`symbol`:return!1;case`string`:return t.test(e)}}e.isIndex=n})),go=o((e=>{var t=uo();H();var n=po(),r=mo(),i=ho();function a(e,a,o){return r.isObject(o)&&(typeof a==`number`&&n.isArrayLike(o)&&i.isIndex(a)&&a<o.length||typeof a==`string`&&a in o)?t.isEqualsSameValueZero(o[a],e):!1}e.isIterateeCall=a})),_o=o((e=>{function t(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}e.toKey=t})),vo=o((e=>{function t(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(t).join(`,`);let n=String(e);return n===`0`&&Object.is(Number(e),-0)?`-0`:n}e.toString=t})),yo=o((e=>{var t=_o(),n=vo();function r(e){if(Array.isArray(e))return e.map(t.toKey);if(typeof e==`symbol`)return[e];e=n.toString(e);let r=[],i=e.length;if(i===0)return r;let a=0,o=``,s=``,c=!1;for(e.charCodeAt(0)===46&&(r.push(``),a++);a<i;){let t=e[a];s?t===`\\`&&a+1<i?(a++,o+=e[a]):t===s?s=``:o+=t:c?t===`"`||t===`'`?s=t:t===`]`?(c=!1,r.push(o),o=``):o+=t:t===`[`?(c=!0,o&&=(r.push(o),``)):t===`.`?o&&=(r.push(o),``):o+=t,a++}return o&&r.push(o),r}e.toPath=r})),bo=o((e=>{function t(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}e.compareValues=(e,n,r)=>{if(e!==n){let i=t(e),a=t(n);if(i===a&&i===0){if(e<n)return r===`desc`?1:-1;if(e>n)return r===`desc`?-1:1}return r===`desc`?a-i:i-a}return 0}})),xo=o((e=>{function t(e){return typeof e==`symbol`||e instanceof Symbol}e.isSymbol=t})),So=o((e=>{var t=xo(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(e,i){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||t.isSymbol(e)?!0:typeof e==`string`&&(r.test(e)||!n.test(e))||i!=null&&Object.hasOwn(i,e)}e.isKey=i})),Co=o((e=>{var t=yo(),n=bo(),r=So();function i(e,i,a,o){if(e==null)return[];a=o?void 0:a,Array.isArray(e)||(e=Object.values(e)),Array.isArray(i)||(i=i==null?[null]:[i]),i.length===0&&(i=[null]),Array.isArray(a)||(a=a==null?[]:[a]),a=a.map(e=>String(e));let s=(e,t)=>{let n=e;for(let e=0;e<t.length&&n!=null;++e)n=n[t[e]];return n},c=(e,t)=>t==null||e==null?t:typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:s(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?s(t,e):typeof t==`object`?t[e]:t,l=i.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||r.isKey(e)?e:{key:e,path:t.toPath(e)}));return e.map(e=>({original:e,criteria:l.map(t=>c(t,e))})).slice().sort((e,t)=>{for(let r=0;r<l.length;r++){let i=n.compareValues(e.criteria[r],t.criteria[r],a[r]);if(i!==0)return i}return 0}).map(e=>e.original)}e.orderBy=i})),wo=o((e=>{var t=lo(),n=go(),r=Co();function i(e,...i){let a=i.length;return a>1&&n.isIterateeCall(e,i[0],i[1])?i=[]:a>2&&n.isIterateeCall(i[0],i[1],i[2])&&(i=[i[0]]),r.orderBy(e,t.flatten(i),[`asc`])}e.sortBy=i})),To=o(((e,t)=>{t.exports=wo().sortBy}));function Eo(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Eo(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Do(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Eo(e))&&(r&&(r+=` `),r+=t);return r}var Oo=o((e=>{function t(e){return e===`__proto__`}e.isUnsafeProperty=t})),ko=o((e=>{function t(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}e.isDeepKey=t})),Ao=o((e=>{var t=Oo(),n=ko(),r=_o(),i=yo();function a(e,s,c){if(e==null)return c;switch(typeof s){case`string`:{if(t.isUnsafeProperty(s))return c;let r=e[s];return r===void 0?n.isDeepKey(s)?a(e,i.toPath(s),c):c:r}case`number`:case`symbol`:{typeof s==`number`&&(s=r.toKey(s));let t=e[s];return t===void 0?c:t}default:{if(Array.isArray(s))return o(e,s,c);if(s=Object.is(s?.valueOf(),-0)?`-0`:String(s),t.isUnsafeProperty(s))return c;let n=e[s];return n===void 0?c:n}}}function o(e,n,r){if(n.length===0)return r;let i=e;for(let e=0;e<n.length;e++){if(i==null||t.isUnsafeProperty(n[e]))return r;i=i[n[e]]}return i===void 0?r:i}e.get=a})),jo=o(((e,t)=>{t.exports=Ao().get})),Mo=4;function No(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:Mo),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function Po(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+No(i)+n},``)}var Fo=l(jo()),Io=e=>e===0?0:e>0?1:-1,Lo=e=>typeof e==`number`&&e!=+e,Ro=e=>typeof e==`string`&&e.length>1&&e.indexOf(`%`)===e.length-1,U=e=>(typeof e==`number`||e instanceof Number)&&!Lo(e),zo=e=>U(e)||typeof e==`string`,Bo=0,Vo=e=>{var t=++Bo;return`${e||``}${t}`},Ho=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!U(e)&&typeof e!=`string`)return n;var i;if(Ro(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return Lo(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},Uo=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Wo(e,t,n){return U(e)&&U(t)?No(e+n*(t-e)):t}function Go(e,t,n){if(!(!e||!e.length))return e.find(e=>e&&(typeof t==`function`?t(e):(0,Fo.default)(e,t))===n)}var Ko=e=>e==null,qo=e=>Ko(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function Jo(e){return e!=null}function Yo(){}var Xo=l(To());function Zo(){return Zo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zo.apply(null,arguments)}function Qo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $o(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Qo(Object(n),!0).forEach(function(t){es(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function es(e,t,n){return(t=ts(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ts(e){var t=ns(e,`string`);return typeof t==`symbol`?t:t+``}function ns(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function rs(e,t){return cs(e)||ss(e,t)||as(e,t)||is()}function is(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
10
10
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function as(e,t){if(e){if(typeof e==`string`)return os(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?os(e,t):void 0}}function os(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ss(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function cs(e){if(Array.isArray(e))return e}function ls(e){return Array.isArray(e)&&zo(e[0])&&zo(e[1])?e.join(` ~ `):e}var us={separator:` : `,contentStyle:{margin:0,padding:10,backgroundColor:`#fff`,border:`1px solid #ccc`,whiteSpace:`nowrap`},itemStyle:{display:`block`,paddingTop:4,paddingBottom:4,color:`#000`},labelStyle:{},accessibilityLayer:!1};function ds(e,t){return t==null?e:(0,Xo.default)(e,t)}var fs=e=>{var t=e.separator,n=t===void 0?us.separator:t,r=e.contentStyle,i=e.itemStyle,a=e.labelStyle,o=a===void 0?us.labelStyle:a,s=e.payload,c=e.formatter,l=e.itemSorter,u=e.wrapperClassName,d=e.labelClassName,f=e.label,p=e.labelFormatter,m=e.accessibilityLayer,h=m===void 0?us.accessibilityLayer:m,g=()=>{if(s&&s.length){var e={padding:0,margin:0},t=ds(s,l).map((e,t)=>{if(!e||e.type===`none`)return null;var r=e.formatter||c||ls,a=e.value,o=e.name,l=a,u=o;if(r){var d=r(a,o,e,t,s);if(Array.isArray(d)){var f=rs(d,2);l=f[0],u=f[1]}else if(d!=null)l=d;else return null}var p=$o($o({},us.itemStyle),{},{color:e.color||us.itemStyle.color},i);return P.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${t}`,style:p},zo(u)?P.createElement(`span`,{className:`recharts-tooltip-item-name`},u):null,zo(u)?P.createElement(`span`,{className:`recharts-tooltip-item-separator`},n):null,P.createElement(`span`,{className:`recharts-tooltip-item-value`},l),P.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return P.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},t)}return null},_=$o($o({},us.contentStyle),r),v=$o({margin:0},o),y=!Ko(f),b=y?f:``,x=Do(`recharts-default-tooltip`,u),S=Do(`recharts-tooltip-label`,d);y&&p&&s!=null&&(b=p(f,s));var C=h?{role:`status`,"aria-live":`assertive`}:{};return P.createElement(`div`,Zo({className:x,style:_},C),P.createElement(`p`,{className:S,style:v},P.isValidElement(b)?b:`${b}`),g())},ps=`recharts-tooltip-wrapper`,ms={visibility:`hidden`};function hs(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Do(ps,{[`${ps}-right`]:U(n)&&t&&U(t.x)&&n>=t.x,[`${ps}-left`]:U(n)&&t&&U(t.x)&&n<t.x,[`${ps}-bottom`]:U(r)&&t&&U(t.y)&&r>=t.y,[`${ps}-top`]:U(r)&&t&&U(t.y)&&r<t.y})}function gs(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offset,a=e.position,o=e.reverseDirection,s=e.tooltipDimension,c=e.viewBox,l=e.viewBoxDimension;if(a&&U(a[r]))return a[r];var u=n[r]-s-(i>0?i:0),d=n[r]+i;if(t[r])return o[r]?u:d;var f=c[r];return f==null?0:o[r]?Math.max(u<f?d:u,f):l==null?0:d+s>f+l?Math.max(u,f):Math.max(d,f)}function _s(e){var t=e.translateX,n=e.translateY;return{transform:e.useTranslate3d?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function vs(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTop,i=e.offsetLeft,a=e.position,o=e.reverseDirection,s=e.tooltipBox,c=e.useTranslate3d,l=e.viewBox,u,d,f;return s.height>0&&s.width>0&&n?(d=gs({allowEscapeViewBox:t,coordinate:n,key:`x`,offset:i,position:a,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=gs({allowEscapeViewBox:t,coordinate:n,key:`y`,offset:r,position:a,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),u=_s({translateX:d,translateY:f,useTranslate3d:c})):u=ms,{cssProperties:u,cssClasses:hs({translateX:d,translateY:f,coordinate:n})}}var ys={devToolsEnabled:!0,isSsr:!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout)};function bs(e,t){return Ts(e)||ws(e,t)||Ss(e,t)||xs()}function xs(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
11
11
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ss(e,t){if(e){if(typeof e==`string`)return Cs(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cs(e,t):void 0}}function Cs(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ws(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Ts(e){if(Array.isArray(e))return e}function Es(){var e=bs((0,P.useState)(()=>ys.isSsr||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches),2),t=e[0],n=e[1];return(0,P.useEffect)(()=>{if(window.matchMedia){var e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>{n(e.matches)};return e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}}},[]),t}function Ds(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Os(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ds(Object(n),!0).forEach(function(t){ks(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ds(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ks(e,t,n){return(t=As(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function As(e){var t=js(e,`string`);return typeof t==`symbol`?t:t+``}function js(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ms(e,t){return Ls(e)||Is(e,t)||Ps(e,t)||Ns()}function Ns(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
12
12
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ps(e,t){if(e){if(typeof e==`string`)return Fs(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fs(e,t):void 0}}function Fs(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Is(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Ls(e){if(Array.isArray(e))return e}function Rs(e){if(!(e.prefersReducedMotion&&e.isAnimationActive===`auto`)&&e.isAnimationActive&&e.active){var t=typeof e.animationEasing==`string`?e.animationEasing:`ease`;return`transform ${e.animationDuration}ms ${t}`}}function zs(e){var t=Es(),n=Ms(P.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),2),r=n[0],i=n[1];P.useEffect(()=>{var t=t=>{t.key===`Escape`&&i({dismissed:!0,dismissedAtCoordinate:{x:e.coordinate?.x??0,y:e.coordinate?.y??0}})};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t)}},[e.coordinate?.x,e.coordinate?.y]),r.dismissed&&((e.coordinate?.x??0)!==r.dismissedAtCoordinate.x||(e.coordinate?.y??0)!==r.dismissedAtCoordinate.y)&&i(Os(Os({},r),{},{dismissed:!1}));var a=vs({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset==`number`?e.offset:e.offset.x,offsetTop:typeof e.offset==`number`?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),o=a.cssClasses,s=a.cssProperties,c=Os(Os({},e.hasPortalFromProps?{}:Os(Os({transition:Rs({prefersReducedMotion:t,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},s),{},{pointerEvents:`none`,position:`absolute`,top:0,left:0})),{},{visibility:!r.dismissed&&e.active&&e.hasPayload?`visible`:`hidden`},e.wrapperStyle);return P.createElement(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,tabIndex:-1,className:o,style:c,ref:e.innerRef},e.children)}var Bs=P.memo(zs),Vs=o((e=>{function t(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}e.uniqBy=t})),Hs=o((e=>{function t(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}e.ary=t})),Us=o((e=>{function t(e){return e}e.identity=t})),Ws=o((e=>{var t=Ao();function n(e){return function(n){return t.get(n,e)}}e.property=n})),Gs=o((e=>{function t(e){return e==null||typeof e!=`object`&&typeof e!=`function`}e.isPrimitive=t})),Ks=o((e=>{function t(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}e.isTypedArray=t})),qs=o((e=>{function t(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}e.getSymbols=t})),Js=o((e=>{function t(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}e.getTag=t})),Ys=o((e=>{e.argumentsTag=`[object Arguments]`,e.arrayBufferTag=`[object ArrayBuffer]`,e.arrayTag=`[object Array]`,e.bigInt64ArrayTag=`[object BigInt64Array]`,e.bigUint64ArrayTag=`[object BigUint64Array]`,e.booleanTag=`[object Boolean]`,e.dataViewTag=`[object DataView]`,e.dateTag=`[object Date]`,e.errorTag=`[object Error]`,e.float32ArrayTag=`[object Float32Array]`,e.float64ArrayTag=`[object Float64Array]`,e.functionTag=`[object Function]`,e.int16ArrayTag=`[object Int16Array]`,e.int32ArrayTag=`[object Int32Array]`,e.int8ArrayTag=`[object Int8Array]`,e.mapTag=`[object Map]`,e.numberTag=`[object Number]`,e.objectTag=`[object Object]`,e.regexpTag=`[object RegExp]`,e.setTag=`[object Set]`,e.stringTag=`[object String]`,e.symbolTag=`[object Symbol]`,e.uint16ArrayTag=`[object Uint16Array]`,e.uint32ArrayTag=`[object Uint32Array]`,e.uint8ArrayTag=`[object Uint8Array]`,e.uint8ClampedArrayTag=`[object Uint8ClampedArray]`})),Xs=o((e=>{e.globalThis_=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})()||Function(`return this`)()})),Zs=o((e=>{var t=Xs();function n(e){return t.globalThis_.Buffer!==void 0&&t.globalThis_.Buffer.isBuffer(e)}e.isBuffer=n})),Qs=o((e=>{var t=Gs(),n=Ks(),r=qs(),i=Js(),a=Ys(),o=Zs();function s(e,t){return c(e,void 0,e,new Map,t)}function c(e,r,i,a=new Map,s=void 0){let d=s?.(e,r,i,a);if(d!==void 0)return d;if(t.isPrimitive(e))return e;if(a.has(e))return a.get(e);if(Array.isArray(e)){let t=Array(e.length);a.set(e,t);for(let n=0;n<e.length;n++)t[n]=c(e[n],n,i,a,s);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;a.set(e,t);for(let[n,r]of e)t.set(n,c(r,n,i,a,s));return t}if(e instanceof Set){let t=new Set;a.set(e,t);for(let n of e)t.add(c(n,void 0,i,a,s));return t}if(o.isBuffer(e))return e.subarray();if(n.isTypedArray(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);a.set(e,t);for(let n=0;n<e.length;n++)t[n]=c(e[n],n,i,a,s);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return a.set(e,t),l(t,e,i,a,s),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return a.set(e,t),l(t,e,i,a,s),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return a.set(e,t),l(t,e,i,a,s),t}if(e instanceof Error){let t=structuredClone(e);return a.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,l(t,e,i,a,s),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return a.set(e,t),l(t,e,i,a,s),t}if(e instanceof Number){let t=new Number(e.valueOf());return a.set(e,t),l(t,e,i,a,s),t}if(e instanceof String){let t=new String(e.valueOf());return a.set(e,t),l(t,e,i,a,s),t}if(typeof e==`object`&&u(e)){let t=Object.create(Object.getPrototypeOf(e));return a.set(e,t),l(t,e,i,a,s),t}return e}function l(e,t,n=e,i,a){let o=[...Object.keys(t),...r.getSymbols(t)];for(let r=0;r<o.length;r++){let s=o[r],l=Object.getOwnPropertyDescriptor(e,s);(l==null||l.writable)&&(e[s]=c(t[s],s,n,i,a))}}function u(e){switch(i.getTag(e)){case a.argumentsTag:case a.arrayTag:case a.arrayBufferTag:case a.dataViewTag:case a.booleanTag:case a.dateTag:case a.float32ArrayTag:case a.float64ArrayTag:case a.int8ArrayTag:case a.int16ArrayTag:case a.int32ArrayTag:case a.mapTag:case a.numberTag:case a.objectTag:case a.regexpTag:case a.setTag:case a.stringTag:case a.symbolTag:case a.uint8ArrayTag:case a.uint8ClampedArrayTag:case a.uint16ArrayTag:case a.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=s,e.cloneDeepWithImpl=c,e.copyProperties=l})),$s=o((e=>{var t=Qs();function n(e){return t.cloneDeepWithImpl(e,void 0,e,new Map,void 0)}e.cloneDeep=n})),ec=o((e=>{var t=Gs(),n=uo();H();var r=mo();function i(e,t,n){return typeof n==`function`?a(e,t,function e(t,r,i,o,s,c){let l=n(t,r,i,o,s,c);return l===void 0?a(t,r,e,c):!!l},new Map):i(e,t,()=>void 0)}function a(e,t,i,s){if(t===e)return!0;switch(typeof t){case`object`:return o(e,t,i,s);case`function`:return Object.keys(t).length>0?a(e,{...t},i,s):n.isEqualsSameValueZero(e,t);default:return r.isObject(e)?typeof t==`string`?t===``:!0:n.isEqualsSameValueZero(e,t)}}function o(e,n,r,i){if(n==null)return!0;if(Array.isArray(n))return c(e,n,r,i);if(n instanceof Map)return s(e,n,r,i);if(n instanceof Set)return l(e,n,r,i);let a=Object.keys(n);if(e==null||t.isPrimitive(e))return a.length===0;if(a.length===0)return!0;if(i?.has(n))return i.get(n)===e;i?.set(n,e);try{for(let o=0;o<a.length;o++){let s=a[o];if(!t.isPrimitive(e)&&!(s in e)||n[s]===void 0&&e[s]!==void 0||n[s]===null&&e[s]!==null||!r(e[s],n[s],s,e,n,i))return!1}return!0}finally{i?.delete(n)}}function s(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function c(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let o=t[a],s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;let l=e[c],u=!1;if(n(l,o,a,e,t,r)&&(u=!0),u){i.add(c),s=!0;break}}if(!s)return!1}return!0}function l(e,t,n,r){return t.size===0?!0:e instanceof Set?c([...e],[...t],n,r):!1}e.isMatchWith=i})),tc=o((e=>{var t=ec();function n(e,n){return t.isMatchWith(e,n,()=>void 0)}e.isMatch=n})),nc=o((e=>{var t=$s(),n=tc();function r(e){return e=t.cloneDeep(e),t=>n.isMatch(t,e)}e.matches=r})),rc=o((e=>{var t=Js(),n=Ys(),r=Qs();function i(e,i){return r.cloneDeepWith(e,(a,o,s,c)=>{let l=i?.(a,o,s,c);if(l!==void 0)return l;if(typeof e==`object`){if(t.getTag(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return c.set(e,t),r.copyProperties(t,e,s,c),t}switch(Object.prototype.toString.call(e)){case n.numberTag:case n.stringTag:case n.booleanTag:{let t=new e.constructor(e?.valueOf());return r.copyProperties(t,e),t}case n.argumentsTag:{let t={};return r.copyProperties(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}e.cloneDeepWith=i})),ic=o((e=>{var t=rc();function n(e){return t.cloneDeepWith(e)}e.cloneDeep=n})),ac=o((e=>{var t=Js();function n(e){return typeof e==`object`&&!!e&&t.getTag(e)===`[object Arguments]`}e.isArguments=n})),oc=o((e=>{var t=ko(),n=yo(),r=ho(),i=ac();function a(e,a){let o;if(o=Array.isArray(a)?a:typeof a==`string`&&t.isDeepKey(a)&&e?.[a]==null?n.toPath(a):[a],o.length===0)return!1;let s=e;for(let e=0;e<o.length;e++){let t=o[e];if((s==null||!Object.hasOwn(s,t))&&!((Array.isArray(s)||i.isArguments(s))&&r.isIndex(t)&&t<s.length))return!1;s=s[t]}return!0}e.has=a})),sc=o((e=>{var t=_o(),n=Ao(),r=tc(),i=ic(),a=oc();function o(e,o){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=t.toKey(e);break}return o=i.cloneDeep(o),function(t){let i=n.get(t,e);return i===void 0?a.has(t,e):o===void 0?i===void 0:r.isMatch(i,o)}}e.matchesProperty=o})),cc=o((e=>{var t=Us(),n=Ws(),r=nc(),i=sc();function a(e){if(e==null)return t.identity;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?i.matchesProperty(e[0],e[1]):r.matches(e);case`string`:case`symbol`:case`number`:return n.property(e)}}e.iteratee=a})),lc=o((e=>{function t(e){return typeof e==`object`&&!!e}e.isObjectLike=t})),uc=o((e=>{var t=po(),n=lc();function r(e){return n.isObjectLike(e)&&t.isArrayLike(e)}e.isArrayLikeObject=r})),dc=o((e=>{var t=Vs(),n=Hs(),r=Us(),i=cc(),a=uc();function o(e,o=r.identity){return a.isArrayLikeObject(e)?t.uniqBy(Array.from(e),n.ary(i.iteratee(o),1)):[]}e.uniqBy=o})),fc=l(o(((e,t)=>{t.exports=dc().uniqBy}))());function pc(e,t,n){return t===!0?(0,fc.default)(e,n):typeof t==`function`?(0,fc.default)(e,t):e}var mc=o((e=>{var t=d(),n=ht();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),hc=o(((e,t)=>{t.exports=mc()})),gc=(0,P.createContext)(null),_c=hc(),vc=e=>e,yc=()=>{var e=(0,P.useContext)(gc);return e?e.store.dispatch:vc},bc=()=>{},xc=()=>bc,Sc=(e,t)=>e===t;function W(e){var t=(0,P.useContext)(gc),n=(0,P.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:bc,[t,e]);return(0,_c.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:xc,t?t.store.getState:bc,t?t.store.getState:bc,n,Sc)}function Cc(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var wc=typeof Symbol==`function`&&Symbol.observable||`@@observable`,Tc=()=>Math.random().toString(36).substring(7).split(``).join(`.`),Ec={INIT:`@@redux/INIT${Tc()}`,REPLACE:`@@redux/REPLACE${Tc()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Tc()}`};function Dc(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Oc(e,t,n){if(typeof e!=`function`)throw Error(Cc(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(Cc(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(Cc(1));return n(Oc)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(Cc(3));return i}function d(e){if(typeof e!=`function`)throw Error(Cc(4));if(c)throw Error(Cc(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(Cc(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!Dc(e))throw Error(Cc(7));if(e.type===void 0)throw Error(Cc(8));if(typeof e.type!=`string`)throw Error(Cc(17));if(c)throw Error(Cc(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(Cc(10));r=e,f({type:Ec.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(Cc(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[wc](){return this}}}return f({type:Ec.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[wc]:m}}function kc(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:Ec.INIT})===void 0)throw Error(Cc(12));if(n(void 0,{type:Ec.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(Cc(13))})}function Ac(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let i=t[r];typeof e[i]==`function`&&(n[i]=e[i])}let r=Object.keys(n),i;try{kc(n)}catch(e){i=e}return function(e={},t){if(i)throw i;let a=!1,o={};for(let i=0;i<r.length;i++){let s=r[i],c=n[s],l=e[s],u=c(l,t);if(u===void 0)throw t&&t.type,Error(Cc(14));o[s]=u,a||=u!==l}return a||=r.length!==Object.keys(e).length,a?o:e}}function jc(...e){return e.length===0?e=>e:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function Mc(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(Cc(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=jc(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}function Nc(e){return Dc(e)&&`type`in e&&typeof e.type==`string`}var Pc=Symbol.for(`immer-nothing`),Fc=Symbol.for(`immer-draftable`),Ic=Symbol.for(`immer-state`);function G(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Lc=Object,Rc=Lc.getPrototypeOf,zc=`constructor`,Bc=`prototype`,Vc=`configurable`,Hc=`enumerable`,Uc=`writable`,Wc=`value`,Gc=e=>!!e&&!!e[Ic];function Kc(e){return e?Yc(e)||nl(e)||!!e[Fc]||!!e[zc]?.[Fc]||rl(e)||il(e):!1}var qc=Lc[Bc][zc].toString(),Jc=new WeakMap;function Yc(e){if(!e||!al(e))return!1;let t=Rc(e);if(t===null||t===Lc[Bc])return!0;let n=Lc.hasOwnProperty.call(t,zc)&&t[zc];if(n===Object)return!0;if(!ol(n))return!1;let r=Jc.get(n);return r===void 0&&(r=Function.toString.call(n),Jc.set(n,r)),r===qc}function Xc(e,t,n=!0){Zc(e)===0?(n?Reflect.ownKeys(e):Lc.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Zc(e){let t=e[Ic];return t?t.type_:nl(e)?1:rl(e)?2:il(e)?3:0}var Qc=(e,t,n=Zc(e))=>n===2?e.has(t):Lc[Bc].hasOwnProperty.call(e,t),$c=(e,t,n=Zc(e))=>n===2?e.get(t):e[t],el=(e,t,n,r=Zc(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function tl(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var nl=Array.isArray,rl=e=>e instanceof Map,il=e=>e instanceof Set,al=e=>typeof e==`object`,ol=e=>typeof e==`function`,sl=e=>typeof e==`boolean`;function cl(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var ll=e=>e.copy_||e.base_,ul=e=>e.modified_?e.copy_:e.base_;function dl(e,t){if(rl(e))return new Map(e);if(il(e))return new Set(e);if(nl(e))return Array[Bc].slice.call(e);let n=Yc(e);if(t===!0||t===`class_only`&&!n){let t=Lc.getOwnPropertyDescriptors(e);delete t[Ic];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[Uc]===!1&&(a[Uc]=!0,a[Vc]=!0),(a.get||a.set)&&(t[i]={[Vc]:!0,[Uc]:!0,[Hc]:a[Hc],[Wc]:e[i]})}return Lc.create(Rc(e),t)}else{let t=Rc(e);if(t!==null&&n)return{...e};let r=Lc.create(t);return Lc.assign(r,e)}}function fl(e,t=!1){return hl(e)||Gc(e)||!Kc(e)?e:(Zc(e)>1&&Lc.defineProperties(e,{set:ml,add:ml,clear:ml,delete:ml}),Lc.freeze(e),t&&Xc(e,(e,t)=>{fl(t,!0)},!1),e)}function pl(){G(2)}var ml={[Wc]:pl};function hl(e){return e===null||!al(e)?!0:Lc.isFrozen(e)}var gl=`MapSet`,_l=`Patches`,vl=`ArrayMethods`,yl={};function bl(e){let t=yl[e];return t||G(0,e),t}var xl=e=>!!yl[e],Sl,Cl=()=>Sl,wl=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:xl(gl)?bl(gl):void 0,arrayMethodsPlugin_:xl(vl)?bl(vl):void 0});function Tl(e,t){t&&(e.patchPlugin_=bl(_l),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function El(e){Dl(e),e.drafts_.forEach(kl),e.drafts_=null}function Dl(e){e===Sl&&(Sl=e.parent_)}var Ol=e=>Sl=wl(Sl,e);function kl(e){let t=e[Ic];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Al(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[Ic].modified_&&(El(t),G(4)),Kc(e)&&(e=jl(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[Ic].base_,e,t)}else e=jl(t,n);return Ml(t,e,!0),El(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===Pc?void 0:e}function jl(e,t){if(hl(t))return t;let n=t[Ic];if(!n)return Bl(t,e.handledSet_,e);if(!Pl(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);Rl(n,e)}return n.copy_}function Ml(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&fl(t,n)}function Nl(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Pl=(e,t)=>e.scope_===t,Fl=[];function Il(e,t,n,r){let i=ll(e),a=e.type_;if(r!==void 0&&$c(i,r,a)===t){el(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;Xc(i,(e,n)=>{if(Gc(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??Fl;for(let e of o)el(i,e,n,a)}function Ll(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!Pl(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=ul(i);Il(e,i.draft_??i,a,n),Rl(i,r)})}function Rl(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}Nl(e)}}function zl(e,t,n){let{scope_:r}=e;if(Gc(n)){let i=n[Ic];Pl(i,r)&&i.callbacks_.push(function(){Gl(e),Il(e,n,ul(i),t)})}else Kc(n)&&e.callbacks_.push(function(){let i=ll(e);e.type_===3?i.has(n)&&Bl(n,r.handledSet_,r):$c(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Bl($c(e.copy_,t,e.type_),r.handledSet_,r)})}function Bl(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Gc(e)||t.has(e)||!Kc(e)||hl(e)?e:(t.add(e),Xc(e,(r,i)=>{if(Gc(i)){let t=i[Ic];Pl(t,n)&&(el(e,r,ul(t),e.type_),Nl(t))}else Kc(i)&&Bl(i,t,n)}),e)}function K(e,t){let n=nl(e),r={type_:+!!n,scope_:t?t.scope_:Cl(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=q;n&&(i=[r],a=J);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var q={get(e,t){if(t===Ic)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=ll(e);if(!Qc(i,t,e.type_))return Hl(e,i,t);let a=i[t];if(e.finalized_||!Kc(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&cl(t))return a;if(a===Vl(e.base_,t)){Gl(e);let n=e.type_===1?+t:t,r=ql(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in ll(e)},ownKeys(e){return Reflect.ownKeys(ll(e))},set(e,t,n){let r=Ul(ll(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=Vl(ll(e),t),i=r?.[Ic];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(tl(n,r)&&(n!==void 0||Qc(e.base_,t,e.type_)))return!0;Gl(e),Wl(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),zl(e,t,n),!0)},deleteProperty(e,t){return Gl(e),Vl(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Wl(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=ll(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Uc]:!0,[Vc]:e.type_!==1||t!==`length`,[Hc]:r[Hc],[Wc]:n[t]}},defineProperty(){G(11)},getPrototypeOf(e){return Rc(e.base_)},setPrototypeOf(){G(12)}},J={};for(let e in q){let t=q[e];J[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}J.deleteProperty=function(e,t){return J.set.call(this,e,t,void 0)},J.set=function(e,t,n){return q.set.call(this,e[0],t,n,e[0])};function Vl(e,t){let n=e[Ic];return(n?ll(n):e)[t]}function Hl(e,t,n){let r=Ul(t,n);return r?Wc in r?r[Wc]:r.get?.call(e.draft_):void 0}function Ul(e,t){if(!(t in e))return;let n=Rc(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Rc(n)}}function Wl(e){e.modified_||(e.modified_=!0,e.parent_&&Wl(e.parent_))}function Gl(e){e.copy_||=(e.assigned_=new Map,dl(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Kl=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(ol(e)&&!ol(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}ol(t)||G(6),n!==void 0&&!ol(n)&&G(7);let r;if(Kc(e)){let i=Ol(this),a=ql(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?El(i):Dl(i)}return Tl(i,n),Al(r,i)}else if(!e||!al(e)){if(r=t(e),r===void 0&&(r=e),r===Pc&&(r=void 0),this.autoFreeze_&&fl(r,!0),n){let t=[],i=[];bl(_l).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}else G(1,e)},this.produceWithPatches=(e,t)=>{if(ol(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},sl(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),sl(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),sl(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Kc(e)||G(8),Gc(e)&&(e=Jl(e));let t=Ol(this),n=ql(t,e,void 0);return n[Ic].isManual_=!0,Dl(t),n}finishDraft(e,t){let n=e&&e[Ic];(!n||!n.isManual_)&&G(9);let{scope_:r}=n;return Tl(r,t),Al(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=bl(_l).applyPatches_;return Gc(e)?r(e,t):this.produce(e,e=>r(e,t))}};function ql(e,t,n,r){let[i,a]=rl(t)?bl(gl).proxyMap_(t,n):il(t)?bl(gl).proxySet_(t,n):K(t,n);return(n?.scope_??Cl()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?Ll(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function Jl(e){return Gc(e)||G(10,e),Yl(e)}function Yl(e){if(!Kc(e)||hl(e))return e;let t=e[Ic],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=dl(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=dl(e,!0);return Xc(n,(e,t)=>{el(n,e,Yl(t))},r),t&&(t.finalized_=!1),n}var Xl=new Kl().produce;function Zl(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function Ql(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var $l=e=>Array.isArray(e)?e:[e];function eu(e){let t=Array.isArray(e[0])?e[0]:e;return Ql(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function tu(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var nu=class{constructor(e){this.value=e}deref(){return this.value}},ru=typeof WeakRef>`u`?nu:WeakRef,iu=0,au=1;function ou(){return{s:iu,v:void 0,o:null,p:null}}function su(e){return e instanceof ru?e.deref():e}function cu(e,t={}){let n=ou(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=ou(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=ou(),e.set(n,t)):t=r}}let s=t,c;if(t.s===au)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=su(i);e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new ru(c):c}return s.s=au,s.v=c,c}return o.clearCache=()=>{n=ou(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function lu(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),Zl(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=cu,argsMemoizeOptions:u=[]}={...n,...a},d=$l(c),f=$l(u),p=eu(e),m=s(function(){return t++,o.apply(null,arguments)},...d),h=l(function(){r++;let e=tu(p,arguments);return i=m.apply(null,e),i},...f);return Object.assign(h,{resultFunc:o,memoizedResultFunc:m,dependencies:p,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var Y=lu(cu);function uu(e){return({dispatch:t,getState:n})=>r=>i=>typeof i==`function`?i(t,n,e):r(i)}var du=uu(),fu=uu,pu=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]==`object`?jc:jc.apply(null,arguments)};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function mu(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw Error(Sd(0));return{type:e,payload:r.payload,...`meta`in r&&{meta:r.meta},...`error`in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>Nc(t)&&t.type===e,n}var hu=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function gu(e){return Kc(e)?Xl(e,()=>{}):e}function _u(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function vu(e){return typeof e==`boolean`}var yu=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},a=new hu;return t&&(vu(t)?a.push(du):a.push(fu(t.extraArgument))),a},bu=`RTK_autoBatch`,xu=()=>e=>({payload:e,meta:{[bu]:!0}}),Su=e=>t=>{setTimeout(t,e)},Cu=(e,t)=>n=>{let r=!1,i=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(o),n())},a=e(i),o=setTimeout(i,t)},wu=(e={type:`raf`})=>t=>(...n)=>{let r=t(...n),i=!0,a=!1,o=!1,s=new Set,c=e.type===`tick`?queueMicrotask:e.type===`raf`?typeof window<`u`&&window.requestAnimationFrame?Cu(window.requestAnimationFrame,100):Su(10):e.type===`callback`?e.queueNotification:Su(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){let t=r.subscribe(()=>i&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[bu],a=!i,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{i=!0}}})},Tu=e=>function(t){let{autoBatch:n=!0}=t??{},r=new hu(e);return n&&r.push(wu(typeof n==`object`?n:void 0)),r};function Eu(e){let t=yu(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof n==`function`)c=n;else if(Dc(n))c=Ac(n);else throw Error(Sd(1));let l;l=typeof r==`function`?r(t):t();let u=jc;i&&(u=pu({trace:!1,...typeof i==`object`&&i}));let d=Tu(Mc(...l)),f=typeof s==`function`?s(d):d(),p=u(...f);return Oc(c,o,p)}function Du(e){let t={},n=[],r,i={addCase(e,n){let r=typeof e==`string`?e:e.type;if(!r)throw Error(Sd(28));if(r in t)throw Error(Sd(29));return t[r]=n,i},addAsyncThunk(e,r){return r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return r=e,i}};return e(i),[t,n,r]}function Ou(e){return typeof e==`function`}function ku(e,t){let[n,r,i]=Du(t),a;if(Ou(e))a=()=>gu(e());else{let t=gu(e);a=()=>t}function o(e=a(),t){let o=[n[t.type],...r.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return o.filter(e=>!!e).length===0&&(o=[i]),o.reduce((e,n)=>{if(n)if(Gc(e)){let r=n(e,t);return r===void 0?e:r}else if(Kc(e))return Xl(e,e=>n(e,t));else{let r=n(e,t);if(r===void 0){if(e===null)return e;throw Error(`A case reducer on a non-draftable value must not return undefined`)}return r}return e},e)}return o.getInitialState=a,o}var Au=`ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW`,ju=(e=21)=>{let t=``,n=e;for(;n--;)t+=Au[Math.random()*64|0];return t},Mu=Symbol.for(`rtk-slice-createasyncthunk`);function Nu(e,t){return`${e}/${t}`}function Pu({creators:e}={}){let t=e?.asyncThunk?.[Mu];return function(e){let{name:n,reducerPath:r=n}=e;if(!n)throw Error(Sd(11));let i=(typeof e.reducers==`function`?e.reducers(Lu()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let n=typeof e==`string`?e:e.type;if(!n)throw Error(Sd(12));if(n in o.sliceCaseReducersByType)throw Error(Sd(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return o.actionCreators[e]=t,s},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,s}};a.forEach(r=>{let a=i[r],o={reducerName:r,type:Nu(n,r),createNotation:typeof e.reducers==`function`};zu(a)?Vu(o,a,s,t):Ru(o,a,s)});function c(){let[t={},n=[],r=void 0]=typeof e.extraReducers==`function`?Du(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return ku(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}let l=e=>e,u=new Map,d=new WeakMap,f;function p(e,t){return f||=c(),f(e,t)}function m(){return f||=c(),f.getInitialState()}function h(t,n=!1){function r(e){let i=e[t];return i===void 0&&n&&(i=_u(d,r,m)),i}function i(t=l){return _u(_u(u,n,()=>new WeakMap),t,()=>{let r={};for(let[i,a]of Object.entries(e.selectors??{}))r[i]=Fu(a,t,()=>_u(d,t,m),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}let g={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:m,...h(r),injectInto(e,{reducerPath:t,...n}={}){let i=t??r;return e.inject({reducerPath:i,reducer:p},n),{...g,...h(i,!0)}}};return g}}function Fu(e,t,n,r){function i(i,...a){let o=t(i);return o===void 0&&r&&(o=n()),e(o,...a)}return i.unwrapped=e,i}var Iu=Pu();function Lu(){function e(e,t){return{_reducerDefinitionType:`asyncThunk`,payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:`reducer`})},preparedReducer(e,t){return{_reducerDefinitionType:`reducerWithPrepare`,prepare:e,reducer:t}},asyncThunk:e}}function Ru({type:e,reducerName:t,createNotation:n},r,i){let a,o;if(`reducer`in r){if(n&&!Bu(r))throw Error(Sd(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?mu(e,o):mu(e))}function zu(e){return e._reducerDefinitionType===`asyncThunk`}function Bu(e){return e._reducerDefinitionType===`reducerWithPrepare`}function Vu({type:e,reducerName:t},n,r,i){if(!i)throw Error(Sd(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=i(e,a,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||Hu,pending:s||Hu,rejected:c||Hu,settled:l||Hu})}function Hu(){}var Uu=`task`,Wu=`listener`,Gu=`completed`,Ku=`cancelled`,qu=`task-${Ku}`,Ju=`task-${Gu}`,Yu=`${Wu}-${Ku}`,Xu=`${Wu}-${Gu}`,Zu=class{constructor(e){this.code=e,this.message=`${Uu} ${Ku} (reason: ${e})`}code;name=`TaskAbortError`;message},Qu=(e,t)=>{if(typeof e!=`function`)throw TypeError(Sd(32))},$u=()=>{},ed=(e,t=$u)=>(e.catch(t),e),td=(e,t)=>(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)),nd=e=>{if(e.aborted)throw new Zu(e.reason)};function rd(e,t){let n=$u;return new Promise((r,i)=>{let a=()=>i(new Zu(e.reason));if(e.aborted){a();return}n=td(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=$u})}var id=async(e,t)=>{try{return await Promise.resolve(),{status:`ok`,value:await e()}}catch(e){return{status:e instanceof Zu?`cancelled`:`rejected`,error:e}}finally{t?.()}},ad=e=>t=>ed(rd(e,t).then(t=>(nd(e),t))),od=e=>{let t=ad(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:sd}=Object,cd={},ld=`listenerMiddleware`,ud=(e,t)=>{let n=t=>td(e,()=>t.abort(e.reason));return(r,i)=>{Qu(r,`taskExecutor`);let a=new AbortController;n(a);let o=id(async()=>{nd(e),nd(a.signal);let t=await r({pause:ad(a.signal),delay:od(a.signal),signal:a.signal});return nd(a.signal),t},()=>a.abort(Ju));return i?.autoJoin&&t.push(o.catch($u)),{result:ad(e)(o),cancel(){a.abort(qu)}}}},dd=(e,t)=>{let n=async(n,r)=>{nd(t);let i=()=>{},a=[new Promise((t,r)=>{let a=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});i=()=>{a(),r()}})];r!=null&&a.push(new Promise(e=>setTimeout(e,r,null)));try{let e=await rd(t,Promise.race(a));return nd(t),e}finally{i()}};return((e,t)=>ed(n(e,t)))},fd=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=mu(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw Error(Sd(21));return Qu(a,`options.listener`),{predicate:i,type:t,effect:a}},pd=sd(e=>{let{type:t,predicate:n,effect:r}=fd(e);return{id:ju(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw Error(Sd(22))}}},{withTypes:()=>pd}),md=(e,t)=>{let{type:n,effect:r,predicate:i}=fd(t);return Array.from(e.values()).find(e=>(typeof n==`string`?e.type===n:e.predicate===i)&&e.effect===r)},hd=e=>{e.pending.forEach(e=>{e.abort(Yu)})},gd=(e,t)=>()=>{for(let e of t.keys())hd(e);e.clear()},_d=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout(()=>{throw e},0)}},vd=sd(mu(`${ld}/add`),{withTypes:()=>vd}),yd=mu(`${ld}/removeAll`),bd=sd(mu(`${ld}/remove`),{withTypes:()=>bd}),xd=(...e)=>{console.error(`${ld}/error`,...e)},X=(e={})=>{let t=new Map,n=new Map,r=e=>{let t=n.get(e)??0;n.set(e,t+1)},i=e=>{let t=n.get(e)??1;t===1?n.delete(e):n.set(e,t-1)},{extra:a,onError:o=xd}=e;Qu(o,`onError`);let s=e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),t?.cancelActive&&hd(e)}),c=(e=>s(md(t,e)??pd(e)));sd(c,{withTypes:()=>c});let l=e=>{let n=md(t,e);return n&&(n.unsubscribe(),e.cancelActive&&hd(n)),!!n};sd(l,{withTypes:()=>l});let u=async(e,n,s,l)=>{let u=new AbortController,d=dd(c,u.signal),f=[];try{e.pending.add(u),r(e),await Promise.resolve(e.effect(n,sd({},s,{getOriginalState:l,condition:(e,t)=>d(e,t).then(Boolean),take:d,delay:od(u.signal),pause:ad(u.signal),extra:a,signal:u.signal,fork:ud(u.signal,f),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,n)=>{e!==u&&(e.abort(Yu),n.delete(e))})},cancel:()=>{u.abort(Yu),e.pending.delete(u)},throwIfCancelled:()=>{nd(u.signal)}})))}catch(e){e instanceof Zu||_d(o,e,{raisedBy:`effect`})}finally{await Promise.all(f),u.abort(Xu),i(e),e.pending.delete(u)}},d=gd(t,n);return{middleware:e=>n=>r=>{if(!Nc(r))return n(r);if(vd.match(r))return c(r.payload);if(yd.match(r)){d();return}if(bd.match(r))return l(r.payload);let i=e.getState(),a=()=>{if(i===cd)throw Error(Sd(23));return i},s;try{if(s=n(r),t.size>0){let n=e.getState(),s=Array.from(t.values());for(let t of s){let s=!1;try{s=t.predicate(r,n,i)}catch(e){s=!1,_d(o,e,{raisedBy:`predicate`})}s&&u(t,r,e,a)}}}finally{i=cd}return s},startListening:c,stopListening:l,clearListeners:d}};function Sd(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Cd=Iu({name:`chartLayout`,initialState:{layoutType:`horizontal`,width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){e.margin.top=t.payload.top??0,e.margin.right=t.payload.right??0,e.margin.bottom=t.payload.bottom??0,e.margin.left=t.payload.left??0},setScale(e,t){e.scale=t.payload}}}),wd=Cd.actions,Td=wd.setMargin,Ed=wd.setLayout,Dd=wd.setChartSize,Od=wd.setScale,kd=Cd.reducer,Ad=e=>e.legend.settings,jd=e=>e.legend.size;Y([e=>e.legend.payload,Ad],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?(0,Xo.default)(r,n):r});function Md(e){return function(){return e}}var Nd=Math.PI,Pd=2*Nd,Z=1e-6,Fd=Pd-Z;function Id(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Ld(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return Id;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var Rd=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?Id:Ld(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>Z)if(!(Math.abs(u*s-c*l)>Z)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((Nd-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>Z&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Z||Math.abs(this._y1-l)>Z)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%Pd+Pd),d>Fd?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>Z&&this._append`A${n},${n},0,${+(d>=Nd)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function zd(){return new Rd}zd.prototype=Rd.prototype;function Bd(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Rd(t)}Array.prototype.slice;function Vd(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Hd(e){this._context=e}Hd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Ud(e){return new Hd(e)}function Wd(e){return e[0]}function Gd(e){return e[1]}function Kd(e,t){var n=Md(!0),r=null,i=Ud,a=null,o=Bd(s);e=typeof e==`function`?e:e===void 0?Wd:Md(e),t=typeof t==`function`?t:t===void 0?Gd:Md(t);function s(s){var c,l=(s=Vd(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:Md(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:Md(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:Md(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function qd(e,t,n){var r=null,i=Md(!0),a=null,o=Ud,s=null,c=Bd(l);e=typeof e==`function`?e:e===void 0?Wd:Md(+e),t=typeof t==`function`?t:Md(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?Gd:Md(+n);function l(l){var u,d,f,p=(l=Vd(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h)if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return Kd().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:Md(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:Md(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:Md(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:Md(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:Md(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:Md(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:Md(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var Jd=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function Yd(e){return new Jd(e,!0)}function Xd(e){return new Jd(e,!1)}function Zd(){}function Qd(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function $d(e){this._context=e}$d.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Qd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Qd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ef(e){return new $d(e)}function tf(e){this._context=e}tf.prototype={areaStart:Zd,areaEnd:Zd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Qd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function nf(e){return new tf(e)}function rf(e){this._context=e}rf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Qd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function af(e){return new rf(e)}function of(e){this._context=e}of.prototype={areaStart:Zd,areaEnd:Zd,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function sf(e){return new of(e)}function cf(e){return e<0?-1:1}function lf(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(cf(a)+cf(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function uf(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function df(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function ff(e){this._context=e}ff.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:df(this,this._t0,uf(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,df(this,uf(this,n=lf(this,e,t)),n);break;default:df(this,this._t0,n=lf(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function pf(e){this._context=new mf(e)}(pf.prototype=Object.create(ff.prototype)).point=function(e,t){ff.prototype.point.call(this,t,e)};function mf(e){this._context=e}mf.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function hf(e){return new ff(e)}function gf(e){return new pf(e)}function _f(e){this._context=e}_f.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=vf(e),i=vf(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function vf(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function yf(e){return new _f(e)}function bf(e,t){this._context=e,this._t=t}bf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}};function xf(e){return new bf(e,.5)}function Sf(e){return new bf(e,0)}function Cf(e){return new bf(e,1)}function wf(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Tf(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function Ef(e,t){return e[t]}function Df(e){let t=[];return t.key=e,t}function Of(){var e=Md([]),t=Tf,n=wf,r=Ef;function i(i){var a=Array.from(e.apply(this,arguments),Df),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=Vd(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:Md(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:Md(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?Tf:typeof e==`function`?e:Md(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??wf,i):n},i}function kf(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}wf(e,t)}}function Af(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}wf(e,t)}}function jf(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,wf(e,t)}}function Mf(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Q(e){return Number.isFinite(e)}function Nf(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}function Pf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ff(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Pf(Object(n),!0).forEach(function(t){If(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pf(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function If(e,t,n){return(t=Lf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lf(e){var t=Rf(e,`string`);return typeof t==`symbol`?t:t+``}function Rf(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function zf(e,t,n){return Ko(e)||Ko(t)?n:zo(t)?(0,Fo.default)(e,t,n):typeof t==`function`?t(e):n}var Bf=(e,t,n)=>{if(t&&n){var r=n.width,i=n.height,a=t.align,o=t.verticalAlign,s=t.layout;if((s===`vertical`||s===`horizontal`&&o===`middle`)&&a!==`center`&&U(e[a]))return Ff(Ff({},e),{},{[a]:e[a]+(r||0)});if((s===`horizontal`||s===`vertical`&&a===`center`)&&o!==`middle`&&U(e[o]))return Ff(Ff({},e),{},{[o]:e[o]+(i||0)})}return e},Vf=(e,t)=>e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`,Hf=(e,t,n,r)=>{if(r)return e.map(e=>e.coordinate);var i,a,o=e.map(e=>(e.coordinate===t&&(i=!0),e.coordinate===n&&(a=!0),e.coordinate));return i||o.push(t),a||o.push(n),o},Uf=(e,t,n)=>{if(!e)return null;var r=e.duplicateDomain,i=e.type,a=e.range,o=e.scale,s=e.realScaleType,c=e.isCategorical,l=e.categoricalDomain,u=e.tickCount,d=e.ticks,f=e.niceTicks,p=e.axisType;if(!o)return null;var m=s===`scaleBand`&&o.bandwidth?o.bandwidth()/2:2,h=(t||n)&&i===`category`&&o.bandwidth?o.bandwidth()/m:0;return h=p===`angleAxis`&&a&&a.length>=2?Io(a[0]-a[1])*2*h:h,t&&(d||f)?(d||f||[]).map((e,t)=>{var n=r?r.indexOf(e):e,i=o.map(n);return Q(i)?{coordinate:i+h,value:e,offset:h,index:t}:null}).filter(Jo):c&&l?l.map((e,t)=>{var n=o.map(e);return Q(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(Jo):o.ticks&&!n&&u!=null?o.ticks(u).map((e,t)=>{var n=o.map(e);return Q(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(Jo):o.domain().map((e,t)=>{var n=o.map(e);return Q(n)?{coordinate:n+h,value:r?r[e]:e,index:t,offset:h}:null}).filter(Jo)},Wf=(e,t)=>{if(!t||t.length!==2||!U(t[0])||!U(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!U(e[0])||e[0]<n)&&(i[0]=n),(!U(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},Gf={sign:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0,o=0;o<t;++o){var s=e[o]?.[r];if(s!=null){var c=s[1],l=s[0],u=Lo(c)?l:c;u>=0?(s[0]=i,i+=u,s[1]=i):(s[0]=a,a+=u,s[1]=a)}}}},expand:kf,none:wf,silhouette:Af,wiggle:jf,positive:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0;a<t;++a){var o=e[a]?.[r];if(o!=null){var s=Lo(o[1])?o[0]:o[1];s>=0?(o[0]=i,i+=s,o[1]=i):(o[0]=0,o[1]=0)}}}}},Kf=(e,t,n)=>{var r=Gf[n]??wf,i=Of().keys(t).value((e,t)=>Number(zf(e,t,0))).order(Tf).offset(r)(e);return i.forEach((n,r)=>{n.forEach((n,i)=>{var a=zf(e[i],t[r],0);Array.isArray(a)&&a.length===2&&U(a[0])&&U(a[1])&&(n[0]=a[0],n[1]=a[1])})}),i};function qf(e){return e==null?void 0:String(e)}function Jf(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type===`category`){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ko(i[t.dataKey])){var s=Go(n,`value`,i[t.dataKey]);if(s)return s.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=zf(i,Ko(o)?t.dataKey:o),l=t.scale.map(c);return U(l)?l:null}var Yf=e=>{var t=e.axis,n=e.ticks,r=e.offset,i=e.bandSize,a=e.entry,o=e.index;if(t.type===`category`)return n[o]?n[o].coordinate+r:null;var s=zf(a,t.dataKey,t.scale.domain()[o]);if(Ko(s))return null;var c=t.scale.map(s);return U(c)?c-i/2+r:null},Xf=e=>{var t=e.numericAxis,n=t.scale.domain();if(t.type===`number`){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},Zf=e=>{var t=e.flat(2).filter(U);return[Math.min(...t),Math.max(...t)]},Qf=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],$f=(e,t,n)=>{if(!(e==null||Object.keys(e).length===0))return Qf(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var o=a.stackedData.reduce((e,r)=>{var i=Zf(Mf(r,t,n));return!Q(i[0])||!Q(i[1])?e:[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(o[0],r[0]),Math.max(o[1],r[1])]},[1/0,-1/0]))},ep=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,tp=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,np=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=(0,Xo.default)(t,e=>e.coordinate),a=1/0,o=1,s=i.length;o<s;o++){var c=i[o],l=i[o-1];a=Math.min((c?.coordinate||0)-(l?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function rp(e){var t=e.tooltipEntrySettings,n=e.dataKey,r=e.payload,i=e.value,a=e.name;return Ff(Ff({},t),{},{dataKey:n,payload:r,value:i,name:a})}function ip(e,t){if(e!=null)return String(e);if(typeof t==`string`)return t}var ap=(e,t)=>{if(t===`horizontal`)return e.relativeX;if(t===`vertical`)return e.relativeY},op=(e,t)=>t===`centric`?e.angle:e.radius,sp=e=>e.layout.width,cp=e=>e.layout.height,lp=e=>e.layout.scale,up=e=>e.layout.margin,dp=Y(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),fp=Y(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),pp=`data-recharts-item-index`;function mp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function hp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?mp(Object(n),!0).forEach(function(t){gp(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mp(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gp(e,t,n){return(t=_p(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _p(e){var t=vp(e,`string`);return typeof t==`symbol`?t:t+``}function vp(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var yp=e=>e.brush.height;function bp(e){return fp(e).reduce((e,t)=>t.orientation===`left`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function xp(e){return fp(e).reduce((e,t)=>t.orientation===`right`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function Sp(e){return dp(e).reduce((e,t)=>t.orientation===`top`&&!t.mirror&&!t.hide?e+t.height:e,0)}function Cp(e){return dp(e).reduce((e,t)=>t.orientation===`bottom`&&!t.mirror&&!t.hide?e+t.height:e,0)}var wp=Y([sp,cp,up,yp,bp,xp,Sp,Cp,Ad,jd],(e,t,n,r,i,a,o,s,c,l)=>{var u={left:(n.left||0)+i,right:(n.right||0)+a},d=hp(hp({},{top:(n.top||0)+o,bottom:(n.bottom||0)+s}),u),f=d.bottom;d.bottom+=r,d=Bf(d,c,l);var p=e-d.left-d.right,m=t-d.top-d.bottom;return hp(hp({brushBottom:f},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),Tp=Y(wp,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Ep=Y(sp,cp,(e,t)=>({x:0,y:0,width:e,height:t})),Dp=(0,P.createContext)(null),Op=()=>(0,P.useContext)(Dp)!=null,kp=e=>e.brush,Ap=Y([kp,wp,up],(e,t,n)=>({height:e.height,x:U(e.x)?e.x:t.left,y:U(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:U(e.width)?e.width:t.width})),jp=o((e=>{function t(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}e.debounce=t})),Mp=o((e=>{var t=jp();function n(e,n=0,r={}){typeof r!=`object`&&(r={});let{leading:i=!1,trailing:a=!0,maxWait:o}=r,s=[,,];i&&(s[0]=`leading`),a&&(s[1]=`trailing`);let c,l=null,u=t.debounce(function(...t){c=e.apply(this,t),l=null},n,{edges:s}),d=function(...t){return o!=null&&(l===null&&(l=Date.now()),Date.now()-l>=o)?(c=e.apply(this,t),l=Date.now(),u.cancel(),u.schedule(),c):(u.apply(this,t),c)};return d.cancel=u.cancel,d.flush=()=>(u.flush(),c),d}e.debounce=n})),Np=o((e=>{var t=Mp();function n(e,n=0,r={}){let{leading:i=!0,trailing:a=!0}=r;return t.debounce(e,n,{leading:i,maxWait:n,trailing:a})}e.throttle=n})),Pp=o(((e,t)=>{t.exports=Np().throttle})),Fp=function(e,t){var n=[...arguments].slice(2);if(typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e))if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,()=>n[r++]))}},Ip={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},Lp=(e,t,n)=>{var r=n.width,i=r===void 0?Ip.width:r,a=n.height,o=a===void 0?Ip.height:a,s=n.aspect,c=n.maxHeight,l=Ro(i)?e:Number(i),u=Ro(o)?t:Number(o);return s&&s>0&&(l?u=l/s:u&&(l=u*s),c&&u!=null&&u>c&&(u=c)),{calculatedWidth:l,calculatedHeight:u}},Rp={width:0,height:0,overflow:`visible`},zp={width:0,overflowX:`visible`},Bp={height:0,overflowY:`visible`},Vp={},Hp=e=>{var t=e.width,n=e.height,r=Ro(t),i=Ro(n);return r&&i?Rp:r?zp:i?Bp:Vp};function Up(e){var t=e.width,n=e.height,r=e.aspect,i=t,a=n;return i===void 0&&a===void 0?(i=Ip.width,a=Ip.height):i===void 0?i=r&&r>0?void 0:Ip.width:a===void 0&&(a=r&&r>0?void 0:Ip.height),{width:i,height:a}}var Wp=l(Pp()),Gp=[`aspect`,`initialDimension`,`width`,`height`,`minWidth`,`minHeight`,`maxHeight`,`children`,`debounce`,`id`,`className`,`onResize`,`style`];function Kp(){return Kp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kp.apply(null,arguments)}function qp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Jp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?qp(Object(n),!0).forEach(function(t){Yp(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qp(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Yp(e,t,n){return(t=Xp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xp(e){var t=Zp(e,`string`);return typeof t==`symbol`?t:t+``}function Zp(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Qp(e,t){return rm(e)||nm(e,t)||em(e,t)||$p()}function $p(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
@@ -60,5 +60,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
60
60
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uz(e,t){if(e){if(typeof e==`string`)return dz(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dz(e,t):void 0}}function dz(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function fz(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function pz(e){if(Array.isArray(e))return e}function mz(){return mz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mz.apply(null,arguments)}function hz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?hz(Object(n),!0).forEach(function(t){_z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _z(e,t,n){return(t=vz(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vz(e){var t=yz(e,`string`);return typeof t==`symbol`?t:t+``}function yz(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function bz(e,t){if(e==null)return{};var n,r,i=xz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xz(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Sz=e=>{var t=e.dataKey,n=e.name,r=e.fill,i=e.legendType;return[{inactive:e.hide,dataKey:t,type:i,color:r,value:ip(n,t),payload:e}]},Cz=P.memo(e=>{var t=e.dataKey,n=e.stroke,r=e.strokeWidth,i=e.fill,a=e.name,o=e.hide,s=e.unit,c=e.tooltipType,l=e.id,u={dataDefinedOnItem:void 0,getPosition:Yo,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:ip(a,t),hide:o,type:c,color:i,unit:s,graphicalItemId:l}};return P.createElement(LF,{tooltipEntrySettings:u})});function wz(e){var t=W(fk),n=e.data,r=e.dataKey,i=e.background,a=e.allOtherBarProps,o=a.onMouseEnter,s=a.onMouseLeave,c=a.onClick,l=bz(a,iz),u=uR(o,r,a.id),d=dR(s),f=fR(c,r,a.id);if(!i||n==null)return null;var p=Gm(i);return P.createElement(_A,{zIndex:JR(i,cv.barBackground)},n.map((e,n)=>{e.value;var a=e.background;e.tooltipPosition;var o=bz(e,az);if(!a)return null;var s=u(e,e.originalDataIndex),c=d(e,e.originalDataIndex),m=f(e,e.originalDataIndex),h=gz(gz(gz(gz(gz({option:i,isActive:String(e.originalDataIndex)===t},o),{},{fill:`#eee`},a),p),Bm(l,e,n)),{},{onMouseEnter:s,onMouseLeave:c,onClick:m,dataKey:r,index:n,className:`recharts-bar-background-rectangle`});return P.createElement(cR,mz({key:`background-bar-${n}`},h))}))}function Tz(e){var t=e.showLabels,n=e.children,r=e.rects?.map(e=>{var t={x:e.x,y:e.y,width:e.width,lowerWidth:e.width,upperWidth:e.width,height:e.height};return gz(gz({},t),{},{value:e.value,payload:e.payload,parentViewBox:e.parentViewBox,viewBox:t,fill:e.fill})});return P.createElement(RP,{value:t?r:void 0},n)}function Ez(e){var t=e.shape,n=e.activeBar,r=e.baseProps,i=e.entry,a=e.index,o=e.dataKey,s=W(fk),c=W(mk),l=n&&String(i.originalDataIndex)===s&&(c==null||o===c),u=cz((0,P.useState)(!1),2),d=u[0],f=u[1],p=cz((0,P.useState)(!1),2),m=p[0],h=p[1];(0,P.useEffect)(()=>{var e;return l?(f(!0),e=requestAnimationFrame(()=>{h(!0)})):h(!1),()=>{cancelAnimationFrame(e)}},[l]);var g=(0,P.useCallback)(()=>{l||f(!1)},[l]),_=l&&m,v=l||d,y=l?n===!0?t:n:t,b=P.createElement(cR,mz({},r,{name:String(r.name)},i,{isActive:_,option:y,index:a,dataKey:o,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance,onTransitionEnd:g}));return v?P.createElement(_A,{zIndex:cv.activeBar},P.createElement(rz,{index:i.originalDataIndex},b)):b}function Dz(e){var t=e.shape,n=e.baseProps,r=e.entry,i=e.index,a=e.dataKey;return P.createElement(cR,mz({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance}))}function Oz(e){var t=e.data,n=e.props,r=e.animationElapsedTime,i=e.isAnimating,a=e.isEntrance,o=Wm(n)??{},s=o.id,c=bz(o,oz),l=n.shape,u=n.dataKey,d=n.activeBar,f=n.onMouseEnter,p=n.onClick,m=n.onMouseLeave,h=bz(n,sz),g=uR(f,u,s),_=dR(m),v=fR(p,u,s);return t?P.createElement(P.Fragment,null,t.map((e,t)=>P.createElement(rz,mz({index:e.originalDataIndex,key:`rectangle-${e?.x}-${e?.y}-${e?.value}-${t}`,className:`recharts-bar-rectangle`},Bm(h,e,t),{onMouseEnter:g(e,e.originalDataIndex),onMouseLeave:_(e,e.originalDataIndex),onClick:v(e,e.originalDataIndex)}),d?P.createElement(Ez,{shape:l,activeBar:d,baseProps:c,entry:e,index:t,dataKey:u,animationElapsedTime:r,isAnimating:i,isEntrance:a}):P.createElement(Dz,{shape:l,baseProps:c,entry:e,index:t,dataKey:u,animationElapsedTime:r,isAnimating:i,isEntrance:a})))):null}var kz=(e,t,n)=>e==null?[]:t===1?e.flatMap(e=>e.status===`removed`?[]:[e.next]):e.flatMap(e=>{if(e.status===`removed`)return n===`horizontal`?[gz(gz({},e.prev),{},{height:Wo(e.prev.height,0,t),y:Wo(e.prev.y,e.prev.y+e.prev.height,t)})]:[gz(gz({},e.prev),{},{width:Wo(e.prev.width,0,t)})];if(e.status===`matched`)return[gz(gz({},e.next),{},{x:Wo(e.prev.x,e.next.x,t),y:Wo(e.prev.y,e.next.y,t),width:Wo(e.prev.width,e.next.width,t),height:Wo(e.prev.height,e.next.height,t)})];var r=e.next;return n===`horizontal`?[gz(gz({},r),{},{height:Wo(0,r.height,t),y:Wo(r.stackedBarStart,r.y,t)})]:[gz(gz({},r),{},{width:Wo(0,r.width,t),x:Wo(r.stackedBarStart,r.x,t)})]});function Az(e){var t=e.props,n=e.previousRectanglesRef,r=t.data,i=t.isAnimationActive,a=t.animationBegin,o=t.animationDuration,s=t.animationEasing,c=t.animationInterpolateFn,l=t.layout,u=TI(t.onAnimationStart,t.onAnimationEnd),d=u.isAnimating,f=u.handleAnimationStart,p=u.handleAnimationEnd;return P.createElement(Tz,{showLabels:!d,rects:r},P.createElement(EI,{animationInput:r,animationIdPrefix:`recharts-bar-`,items:r,previousItemsRef:n,isAnimationActive:i,animationBegin:a,animationDuration:o,animationEasing:s,onAnimationStart:f,onAnimationEnd:p,animationInterpolateFn:c,animationMatchBy:t.animationMatchBy,layout:l},(e,n,r)=>P.createElement(tM,null,P.createElement(Oz,{props:t,data:e,animationElapsedTime:n,isAnimating:d||n<1,isEntrance:r}))),P.createElement(UP,{label:t.label}),t.children)}function jz(e){var t=(0,P.useRef)(null);return P.createElement(Az,{previousRectanglesRef:t,props:e})}var Mz=0,Nz=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:zf(e,t)}},Pz=class extends P.PureComponent{render(){var e=this.props,t=e.hide,n=e.data,r=e.dataKey,i=e.className,a=e.xAxisId,o=e.yAxisId,s=e.needClip,c=e.background,l=e.id;if(t||n==null)return null;var u=Do(`recharts-bar`,i),d=l;return P.createElement(tM,{className:u,id:l},s&&P.createElement(`defs`,null,P.createElement(zF,{clipPathId:d,xAxisId:a,yAxisId:o})),P.createElement(tM,{className:`recharts-bar-rectangles`,clipPath:s?`url(#clipPath-${d})`:void 0},P.createElement(wz,{data:n,dataKey:r,background:c,allOtherBarProps:this.props}),P.createElement(jz,this.props)))}},Fz={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:`ease`,animationInterpolateFn:kz,animationMatchBy:dI,background:!1,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`rect`,minPointSize:Mz,shape:sR,xAxisId:0,yAxisId:0,zIndex:cv.bar};function Iz(e){var t=e.xAxisId,n=e.yAxisId,r=e.hide,i=e.legendType,a=e.minPointSize,o=e.activeBar,s=e.animationBegin,c=e.animationDuration,l=e.animationEasing,u=e.isAnimationActive,d=RF(t,n).needClip,f=ym(),p=Op(),m=QP(e.children,_j),h=W(t=>qR(t,e.id,p,m));if(f!==`vertical`&&f!==`horizontal`)return null;var g,_=h?.[0];return g=_==null||_.height==null||_.width==null?0:f===`vertical`?_.height/2:_.width/2,P.createElement(bR,{xAxisId:t,yAxisId:n,data:h,dataPointFormatter:Nz,errorBarOffset:g},P.createElement(Pz,mz({},e,{layout:f,needClip:d,data:h,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:s,animationDuration:c,animationEasing:l,isAnimationActive:u})))}function Lz(e){var t=e.layout,n=e.barSettings,r=n.dataKey,i=n.minPointSize,a=n.hasCustomShape,o=e.pos,s=e.bandSize,c=e.xAxis,l=e.yAxis,u=e.xAxisTicks,d=e.yAxisTicks,f=e.stackedData,p=e.displayedData,m=e.offset,h=e.cells,g=e.parentViewBox,_=e.dataStartIndex,v=t===`horizontal`?l:c,y=f?v.scale.domain():null,b=Xf({numericAxis:v}),x=v.scale.map(b);return p.map((e,n)=>{var p,v,S,C,w,T;if(f){var E=f[n+_];if(E==null)return null;p=Wf(E,y)}else p=zf(e,r),Array.isArray(p)||(p=[b,p]);var D=lR(i,Mz)(p[1],n);if(t===`horizontal`){var O=l.scale.map(p[0]),k=l.scale.map(p[1]);if(O==null||k==null)return null;v=Yf({axis:c,ticks:u,bandSize:s,offset:o.offset,entry:e,index:n}),S=k??O??void 0,C=o.size;var ee=O-k;if(w=Lo(ee)?0:ee,T={x:v,y:m.top,width:C,height:m.height},Math.abs(D)>0&&Math.abs(w)<Math.abs(D)){var A=Io(w||D)*(Math.abs(D)-Math.abs(w));S-=A,w+=A}}else{var te=c.scale.map(p[0]),j=c.scale.map(p[1]);if(te==null||j==null)return null;if(v=te,S=Yf({axis:l,ticks:d,bandSize:s,offset:o.offset,entry:e,index:n}),C=j-te,w=o.size,T={x:m.left,y:S,width:m.width,height:w},Math.abs(D)>0&&Math.abs(C)<Math.abs(D)){var ne=Io(C||D)*(Math.abs(D)-Math.abs(C));C+=ne}}return v==null||S==null||C==null||w==null||!a&&(C===0||w===0)?null:gz(gz({},e),{},{stackedBarStart:x,x:v,y:S,width:C,height:w,value:f?p:p[1],payload:e,background:T,tooltipPosition:{x:v+C/2,y:S+w/2},parentViewBox:g,originalDataIndex:n},h&&h[n]&&h[n].props)}).filter(Boolean)}function Rz(e){var t=Eh(e,Fz),n=ez(t.stackId),r=Op();return P.createElement(II,{id:t.id,type:`bar`},e=>P.createElement(P.Fragment,null,P.createElement(rI,{legendPayload:Sz(t)}),P.createElement(Cz,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),P.createElement(UI,{type:`bar`,id:e,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null&&t.shape!==sR}),P.createElement(_A,{zIndex:t.zIndex},P.createElement(Iz,mz({},t,{id:e})))))}var zz=P.memo(Rz,bL);zz.displayName=`Bar`;var Bz=[`domain`,`range`],Vz=[`domain`,`range`];function Hz(e,t){if(e==null)return{};var n,r,i=Uz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Uz(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Wz(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function Gz(e,t){if(e===t)return!0;var n=e.domain,r=e.range,i=Hz(e,Bz),a=t.domain,o=t.range,s=Hz(t,Vz);return!Wz(n,a)||!Wz(r,o)?!1:bL(i,s)}var Kz=[`type`],qz=[`dangerouslySetInnerHTML`,`ticks`,`scale`],Jz=[`id`,`scale`];function Yz(){return Yz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yz.apply(null,arguments)}function Xz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Zz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Xz(Object(n),!0).forEach(function(t){Qz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Qz(e,t,n){return(t=$z(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $z(e){var t=eB(e,`string`);return typeof t==`symbol`?t:t+``}function eB(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function tB(e,t){if(e==null)return{};var n,r,i=nB(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function nB(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function rB(e){var t=yc(),n=(0,P.useRef)(null),r=bm(),i=e.type,a=tB(e,Kz),o=fv(r,`xAxis`,i),s=(0,P.useMemo)(()=>{if(o!=null)return Zz(Zz({},a),{},{type:o})},[a,o]);return(0,P.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(yF(s)):n.current!==s&&t(bF({prev:n.current,next:s})),n.current=s)},[s,t]),(0,P.useLayoutEffect)(()=>()=>{n.current&&=(t(xF(n.current)),null)},[t]),null}var iB=e=>{var t=e.xAxisId,n=e.className,r=W(Ep),i=Op(),a=`xAxis`,o=W(e=>GE(e,a,t,i)),s=W(e=>NE(e,t)),c=W(e=>RE(e,t)),l=W(e=>Ww(e,t));if(s==null||c==null||l==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var u=tB(e,qz);l.id,l.scale;var d=tB(l,Jz);return P.createElement(cP,Yz({},u,d,{x:c.x,y:c.y,width:s.width,height:s.height,className:Do(`recharts-${a} ${a}`,n),viewBox:r,ticks:o,axisType:a,axisId:t}))},aB={allowDataOverflow:Uw.allowDataOverflow,allowDecimals:Uw.allowDecimals,allowDuplicatedCategory:Uw.allowDuplicatedCategory,angle:Uw.angle,axisLine:$N.axisLine,height:Uw.height,hide:!1,includeHidden:Uw.includeHidden,interval:Uw.interval,label:!1,minTickGap:Uw.minTickGap,mirror:Uw.mirror,orientation:Uw.orientation,padding:Uw.padding,reversed:Uw.reversed,scale:Uw.scale,tick:Uw.tick,tickCount:Uw.tickCount,tickLine:$N.tickLine,tickSize:$N.tickSize,type:Uw.type,niceTicks:Uw.niceTicks,xAxisId:0},oB=P.memo(e=>{var t=Eh(e,aB);return P.createElement(P.Fragment,null,P.createElement(rB,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),P.createElement(iB,t))},Gz);oB.displayName=`XAxis`;var sB=[`type`],cB=[`dangerouslySetInnerHTML`,`ticks`,`scale`],lB=[`id`,`scale`];function uB(){return uB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uB.apply(null,arguments)}function dB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dB(Object(n),!0).forEach(function(t){pB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pB(e,t,n){return(t=mB(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mB(e){var t=hB(e,`string`);return typeof t==`symbol`?t:t+``}function hB(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function gB(e,t){if(e==null)return{};var n,r,i=_B(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function _B(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function vB(e){var t=yc(),n=(0,P.useRef)(null),r=bm(),i=e.type,a=gB(e,sB),o=fv(r,`yAxis`,i),s=(0,P.useMemo)(()=>{if(o!=null)return fB(fB({},a),{},{type:o})},[o,a]);return(0,P.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(SF(s)):n.current!==s&&t(CF({prev:n.current,next:s})),n.current=s)},[s,t]),(0,P.useLayoutEffect)(()=>()=>{n.current&&=(t(wF(n.current)),null)},[t]),null}function yB(e){var t=e.yAxisId,n=e.className,r=e.width,i=e.label,a=(0,P.useRef)(null),o=(0,P.useRef)(null),s=W(Ep),c=Op(),l=yc(),u=`yAxis`,d=W(e=>BE(e,t)),f=W(e=>zE(e,t)),p=W(e=>GE(e,u,t,c)),m=W(e=>qw(e,t));if((0,P.useLayoutEffect)(()=>{if(!(r!==`auto`||!d||xN(i)||(0,P.isValidElement)(i)||m==null)){var e=a.current;if(e){var n=e.getCalculatedWidth();Math.round(d.width)!==Math.round(n)&&l(TF({id:t,width:n}))}}},[p,d,l,i,t,r,m]),d==null||f==null||m==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var h=gB(e,cB);m.id,m.scale;var g=gB(m,lB);return P.createElement(cP,uB({},h,g,{ref:a,labelRef:o,x:f.x,y:f.y,tickTextProps:r===`auto`?{width:void 0}:{width:r},width:d.width,height:d.height,className:Do(`recharts-${u} ${u}`,n),viewBox:s,ticks:p,axisType:u,axisId:t}))}var bB={allowDataOverflow:Kw.allowDataOverflow,allowDecimals:Kw.allowDecimals,allowDuplicatedCategory:Kw.allowDuplicatedCategory,angle:Kw.angle,axisLine:$N.axisLine,hide:!1,includeHidden:Kw.includeHidden,interval:Kw.interval,label:!1,minTickGap:Kw.minTickGap,mirror:Kw.mirror,orientation:Kw.orientation,padding:Kw.padding,reversed:Kw.reversed,scale:Kw.scale,tick:Kw.tick,tickCount:Kw.tickCount,tickLine:$N.tickLine,tickSize:$N.tickSize,type:Kw.type,niceTicks:Kw.niceTicks,width:Kw.width,yAxisId:0},xB=P.memo(e=>{var t=Eh(e,bB);return P.createElement(P.Fragment,null,P.createElement(vB,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),P.createElement(yB,t))},Gz);xB.displayName=`YAxis`;var SB=Y([(e,t)=>t,vm,Ov,Lv,ak,sk,Bk,wp],Qk);function CB(e){return`getBBox`in e.currentTarget&&typeof e.currentTarget.getBBox==`function`}function wB(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(CB(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(e,i)=>({relativeX:Math.round((e-t.left)/n),relativeY:Math.round((i-t.top)/r)});return`touches`in e?Array.from(e.touches).map(e=>o(e.clientX,e.clientY)):o(e.clientX,e.clientY)}var TB=mu(`mouseClick`),EB=X();EB.startListening({actionCreator:TB,effect:(e,t)=>{var n=e.payload,r=SB(t.getState(),wB(n));r?.activeIndex!=null&&t.dispatch(uO({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var DB=mu(`mouseMove`),OB=X(),kB=null,AB=null,jB=null;OB.startListening({actionCreator:DB,effect:(e,t)=>{var n=e.payload,r=t.getState().eventSettings,i=r.throttleDelay,a=r.throttledEvents,o=a===`all`||a?.includes(`mousemove`);kB!==null&&(cancelAnimationFrame(kB),kB=null),AB!==null&&(typeof i!=`number`||!o)&&(clearTimeout(AB),AB=null),jB=wB(n);var s=()=>{var e=t.getState(),n=QE(e,e.tooltip.settings.shared);if(!jB){kB=null,AB=null;return}if(n===`axis`){var r=SB(e,jB);r?.activeIndex==null?t.dispatch(sO()):t.dispatch(lO({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}kB=null,AB=null};if(!o){s();return}i===`raf`?kB=requestAnimationFrame(s):typeof i==`number`&&AB===null&&(AB=setTimeout(s,i))}});function MB(e,t){return t instanceof HTMLElement?`HTMLElement <${t.tagName} class="${t.className}">`:t===window?`global.window`:e===`children`&&typeof t==`object`&&t?`<<CHILDREN>>`:t}var NB=Iu({name:`referenceElements`,initialState:{dots:[],areas:[],lines:[]},reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Jl(e).dots.findIndex(e=>e===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=Jl(e).areas.findIndex(e=>e===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(ZD(t.payload))},removeLine:(e,t)=>{var n=Jl(e).lines.findIndex(e=>e===t.payload);n!==-1&&e.lines.splice(n,1)}}}),PB=NB.actions;PB.addDot,PB.removeDot,PB.addArea,PB.removeArea,PB.addLine,PB.removeLine;var FB=NB.reducer,IB={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},LB=Iu({name:`brush`,initialState:IB,reducers:{setBrushSettings(e,t){return t.payload==null?IB:t.payload}}});LB.actions.setBrushSettings;var RB=LB.reducer,zB={accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:`none`,syncId:void 0,syncMethod:`index`,baseValue:void 0,reverseStackOrder:!1},BB=Iu({name:`rootProps`,initialState:zB,reducers:{updateOptions:(e,t)=>{e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=t.payload.barGap??zB.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),VB=BB.reducer,HB=BB.actions.updateOptions,UB=Iu({name:`polarAxis`,initialState:{radiusAxis:{},angleAxis:{}},reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=ZD(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=ZD(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),WB=UB.actions;WB.addRadiusAxis,WB.removeRadiusAxis,WB.addAngleAxis,WB.removeAngleAxis;var GB=UB.reducer,KB=Iu({name:`polarOptions`,initialState:null,reducers:{updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)}});KB.actions.updatePolarOptions;var qB=KB.reducer,JB=mu(`keyDown`),YB=mu(`focus`),XB=mu(`blur`),ZB=X(),QB=null,$B=null,eV=null;ZB.startListening({actionCreator:JB,effect:(e,t)=>{eV=e.payload,QB!==null&&(cancelAnimationFrame(QB),QB=null);var n=t.getState().eventSettings,r=n.throttleDelay,i=n.throttledEvents,a=i===`all`||i.includes(`keydown`);$B!==null&&(typeof r!=`number`||!a)&&(clearTimeout($B),$B=null);var o=()=>{try{var e=t.getState();if(e.rootProps.accessibilityLayer===!1)return;var n=e.tooltip.keyboardInteraction,r=eV;if(r!==`ArrowRight`&&r!==`ArrowLeft`&&r!==`Enter`)return;var i=TO(n,qO(e),TT(e),nk(e)),a=i==null?-1:Number(i),o=!Number.isFinite(a)||a<0,s=sk(e),c=qO(e),l=QE(e,e.tooltip.settings.shared);if(r===`Enter`){if(o)return;var u=Gk(e,l,`hover`,String(n.index));t.dispatch(fO({active:!n.active,activeIndex:n.index,activeCoordinate:u}));return}var d=JE(e)===`left-to-right`?1:-1,f=r===`ArrowRight`?1:-1,p;if(o){var m=TT(e),h=nk(e),g=f*d,_=e=>({active:!1,index:String(e),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(p=-1,g>0){for(var v=0;v<c.length;v++)if(TO(_(v),c,m,h)!=null){p=v;break}}else for(var y=c.length-1;y>=0;y--)if(TO(_(y),c,m,h)!=null){p=y;break}if(p<0)return}else{p=a+f*d;var b=s?.length||c.length;if(b===0||p>=b||p<0)return}var x=Gk(e,l,`hover`,String(p));t.dispatch(fO({active:!0,activeIndex:p.toString(),activeCoordinate:x}))}finally{QB=null,$B=null}};if(!a){o();return}r===`raf`?QB=requestAnimationFrame(o):typeof r==`number`&&$B===null&&(o(),eV=null,$B=setTimeout(()=>{eV?o():($B=null,QB=null)},r))}}),ZB.startListening({actionCreator:YB,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var r=n.tooltip.keyboardInteraction;if(!r.active&&r.index==null){var i=`0`,a=Gk(n,QE(n,n.tooltip.settings.shared),`hover`,String(i));t.dispatch(fO({active:!0,activeIndex:i,activeCoordinate:a}))}}}}),ZB.startListening({actionCreator:XB,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var r=n.tooltip.keyboardInteraction;r.active&&t.dispatch(fO({active:!1,activeIndex:r.index,activeCoordinate:r.coordinate}))}}});function tV(e){e.persist();var t=e.currentTarget;return new Proxy(e,{get:(e,n)=>{if(n===`currentTarget`)return t;var r=Reflect.get(e,n);return typeof r==`function`?r.bind(e):r}})}var nV=mu(`externalEvent`),rV=X(),iV=new Map,aV=new Map,oV=new Map;rV.startListening({actionCreator:nV,effect:(e,t)=>{var n=e.payload,r=n.handler,i=n.reactEvent;if(r!=null){var a=i.type,o=tV(i);oV.set(a,{handler:r,reactEvent:o});var s=iV.get(a);s!==void 0&&(cancelAnimationFrame(s),iV.delete(a));var c=t.getState().eventSettings,l=c.throttleDelay,u=c.throttledEvents,d=u===`all`||u?.includes(a),f=aV.get(a);f!==void 0&&(typeof l!=`number`||!d)&&(clearTimeout(f),aV.delete(a));var p=()=>{var e=oV.get(a);try{if(!e)return;var n=e.handler,r=e.reactEvent,i=t.getState(),o={activeCoordinate:_k(i),activeDataKey:mk(i),activeIndex:fk(i),activeLabel:pk(i),activeTooltipIndex:fk(i),isTooltipActive:vk(i)};n&&n(o,r)}finally{iV.delete(a),aV.delete(a),oV.delete(a)}};if(!d){p();return}if(l===`raf`){var m=requestAnimationFrame(p);iV.set(a,m)}else if(typeof l==`number`){if(!aV.has(a)){p();var h=setTimeout(p,l);aV.set(a,h)}}else p()}}});var sV=Y([Y([kO],e=>e.tooltipItemPayloads),(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(e=>e.settings.graphicalItemId===n);if(r!=null){var i=r.getPosition;if(i!=null)return i(t)}}}),cV=mu(`touchMove`),lV=X(),uV=null,dV=null,fV=null,pV=null;lV.startListening({actionCreator:cV,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){pV=tV(n);var r=t.getState().eventSettings,i=r.throttleDelay,a=r.throttledEvents,o=a===`all`||a.includes(`touchmove`);uV!==null&&(cancelAnimationFrame(uV),uV=null),dV!==null&&(typeof i!=`number`||!o)&&(clearTimeout(dV),dV=null),fV=Array.from(n.touches).map(e=>wB({clientX:e.clientX,clientY:e.clientY,currentTarget:n.currentTarget}));var s=()=>{if(pV!=null){var e=t.getState(),n=QE(e,e.tooltip.settings.shared);if(n===`axis`){var r=fV?.[0];if(r==null){uV=null,dV=null;return}var i=SB(e,r);i?.activeIndex!=null&&t.dispatch(lO({activeIndex:i.activeIndex,activeDataKey:void 0,activeCoordinate:i.activeCoordinate}))}else if(n===`item`){var a=pV.touches[0];if(document.elementFromPoint==null||a==null)return;var o=document.elementFromPoint(a.clientX,a.clientY);if(!o||!o.getAttribute)return;var s=o.getAttribute(pp),c=o.getAttribute(`data-recharts-item-id`)??void 0,l=UO(e).find(e=>e.id===c);if(s==null||l==null||c==null)return;var u=l.dataKey,d=sV(e,s,c);t.dispatch(aO({activeDataKey:u,activeIndex:s,activeCoordinate:d,activeGraphicalItemId:c}))}uV=null,dV=null}};if(!o){s();return}i===`raf`?uV=requestAnimationFrame(s):typeof i==`number`&&dV===null&&(s(),pV=null,dV=setTimeout(()=>{pV?s():(dV=null,uV=null)},i))}}});var mV={throttleDelay:`raf`,throttledEvents:[`mousemove`,`touchmove`,`pointermove`,`scroll`,`wheel`]},hV=Iu({name:`eventSettings`,initialState:mV,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=ZD(t.payload.throttledEvents))}}}),gV=hV.actions.setEventSettings,_V=hV.reducer,vV=Ac({brush:RB,cartesianAxis:EF,chartData:HA,errorBars:hR,eventSettings:_V,graphicalItems:HI,layout:kd,legend:nI,options:FA,polarAxis:GB,polarOptions:qB,referenceElements:FB,renderedTicks:LN,rootProps:VB,tooltip:pO,zIndex:hA}),yV=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`Chart`;return Eu({reducer:vV,preloadedState:e,middleware:e=>e({serializableCheck:!1,immutableCheck:![`commonjs`,`es6`,`production`].includes(`es6`)}).concat([EB.middleware,OB.middleware,ZB.middleware,rV.middleware,lV.middleware]),enhancers:e=>{var t=e;return typeof e==`function`&&(t=e()),t.concat(wu({type:`raf`}))},devTools:ys.devToolsEnabled&&{serialize:{replacer:MB},name:`recharts-${t}`}})};function bV(e){var t=e.preloadedState,n=e.children,r=e.reduxStoreName,i=Op(),a=(0,P.useRef)(null);if(i)return n;a.current??=yV(t,r);var o=gc;return P.createElement(_L,{context:o,store:a.current},n)}var xV=e=>{var t=e.chartData,n=yc(),r=Op();return(0,P.useEffect)(()=>r?()=>{}:(n(BA(t)),()=>{n(BA(void 0))}),[t,n,r]),null};function SV(e){var t=e.layout,n=e.margin,r=yc(),i=Op();return(0,P.useEffect)(()=>{i||(r(Ed(t)),r(Td(n)))},[r,i,t,n]),null}var CV=(0,P.memo)(SV,bL);function wV(e){var t=yc();return(0,P.useEffect)(()=>{t(HB(e))},[t,e]),null}var TV=(0,P.memo)(e=>{var t=yc();return(0,P.useEffect)(()=>{t(gV(e))},[t,e]),null},bL),EV=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function DV(){return DV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},DV.apply(null,arguments)}function OV(e,t){if(e==null)return{};var n,r,i=kV(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kV(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var AV=(0,P.forwardRef)((e,t)=>{var n=e.children,r=e.width,i=e.height,a=e.viewBox,o=e.className,s=e.style,c=e.title,l=e.desc,u=OV(e,EV),d=a||{width:r,height:i,x:0,y:0},f=Do(`recharts-surface`,o);return P.createElement(`svg`,DV({},sh(u),{className:f,width:r,height:i,style:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:t}),P.createElement(`title`,null,c),P.createElement(`desc`,null,l),n)});function jV(e){var t=e.zIndex,n=e.isPanorama,r=(0,P.useRef)(null),i=yc();return(0,P.useLayoutEffect)(()=>(r.current&&i(pA({zIndex:t,element:r.current,isPanorama:n})),()=>{i(mA({zIndex:t,isPanorama:n}))}),[i,t,n]),P.createElement(`g`,{tabIndex:-1,ref:r,className:`recharts-zIndex-layer_${t}`})}function MV(e){var t=e.children,n=e.isPanorama,r=W(eA);if(!r||r.length===0)return t;var i=r.filter(e=>e<0),a=r.filter(e=>e>0);return P.createElement(P.Fragment,null,i.map(e=>P.createElement(jV,{key:e,zIndex:e,isPanorama:n})),t,a.map(e=>P.createElement(jV,{key:e,zIndex:e,isPanorama:n})))}var NV=[`children`];function PV(e,t){if(e==null)return{};var n,r,i=FV(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function FV(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function IV(){return IV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},IV.apply(null,arguments)}var LV={width:`100%`,height:`100%`,display:`block`},RV=(0,P.forwardRef)((e,t)=>{var n=gm(),r=_m(),i=wm();if(!Nf(n)||!Nf(r))return null;var a=e.children,o=e.otherAttributes,s=e.title,c=e.desc,l,u;return o!=null&&(l=typeof o.tabIndex==`number`?o.tabIndex:i?0:void 0,u=typeof o.role==`string`?o.role:i?`application`:void 0),P.createElement(AV,IV({},o,{title:s,desc:c,role:u,tabIndex:l,width:n,height:r,style:LV,ref:t}),a)}),zV=e=>{var t=e.children,n=W(Ap);if(!n)return null;var r=n.width,i=n.height,a=n.y,o=n.x;return P.createElement(AV,{width:r,height:i,x:o,y:a},t)},BV=(0,P.forwardRef)((e,t)=>{var n=e.children,r=PV(e,NV);return Op()?P.createElement(zV,null,P.createElement(MV,{isPanorama:!0},n)):P.createElement(RV,IV({ref:t},r),P.createElement(MV,{isPanorama:!1},n))});function VV(e,t){return KV(e)||GV(e,t)||UV(e,t)||HV()}function HV(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
61
61
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UV(e,t){if(e){if(typeof e==`string`)return WV(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?WV(e,t):void 0}}function WV(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function GV(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function KV(e){if(Array.isArray(e))return e}function qV(){var e=yc(),t=VV((0,P.useState)(null),2),n=t[0],r=t[1],i=W(lp);return(0,P.useEffect)(()=>{if(n!=null){var t=n.getBoundingClientRect().width/n.offsetWidth;Q(t)&&t!==i&&e(Od(t))}},[n,e,i]),r}var JV=(0,P.createContext)(null);function YV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function XV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?YV(Object(n),!0).forEach(function(t){ZV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ZV(e,t,n){return(t=QV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QV(e){var t=$V(e,`string`);return typeof t==`symbol`?t:t+``}function $V(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function eH(){return eH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eH.apply(null,arguments)}function tH(e,t){return oH(e)||aH(e,t)||rH(e,t)||nH()}function nH(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
62
62
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rH(e,t){if(e){if(typeof e==`string`)return iH(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?iH(e,t):void 0}}function iH(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function aH(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function oH(e){if(Array.isArray(e))return e}var sH=()=>($A(),null);function cH(e){if(typeof e==`number`)return e;if(typeof e==`string`){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var lH=(0,P.forwardRef)((e,t)=>{var n=(0,P.useRef)(null),r=tH((0,P.useState)({containerWidth:cH(e.style?.width),containerHeight:cH(e.style?.height)}),2),i=r[0],a=r[1],o=(0,P.useCallback)((e,t)=>{a(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),s=(0,P.useCallback)(e=>{if(typeof t==`function`&&t(e),n.current!=null&&(n.current.disconnect(),n.current=null),e!=null&&typeof ResizeObserver<`u`){var r=e.getBoundingClientRect(),i=r.width,a=r.height;o(i,a);var s=new ResizeObserver(e=>{var t=e[0];if(t!=null){var n=t.contentRect,r=n.width,i=n.height;o(r,i)}});s.observe(e),n.current=s}},[t,o]);return(0,P.useEffect)(()=>()=>{n.current?.disconnect()},[o]),P.createElement(P.Fragment,null,P.createElement(Cm,{width:i.containerWidth,height:i.containerHeight}),P.createElement(`div`,eH({ref:s},e)))}),uH=(0,P.forwardRef)((e,t)=>{var n=e.width,r=e.height,i=tH((0,P.useState)({containerWidth:cH(n),containerHeight:cH(r)}),2),a=i[0],o=i[1],s=(0,P.useCallback)((e,t)=>{o(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),c=(0,P.useCallback)(e=>{if(typeof t==`function`&&t(e),e!=null){var n=e.getBoundingClientRect(),r=n.width,i=n.height;s(r,i)}},[t,s]);return P.createElement(P.Fragment,null,P.createElement(Cm,{width:a.containerWidth,height:a.containerHeight}),P.createElement(`div`,eH({ref:c},e)))}),dH=(0,P.forwardRef)((e,t)=>{var n=e.width,r=e.height;return P.createElement(P.Fragment,null,P.createElement(Cm,{width:n,height:r}),P.createElement(`div`,eH({ref:t},e)))}),fH=(0,P.forwardRef)((e,t)=>{var n=e.width,r=e.height;return typeof n==`string`||typeof r==`string`?P.createElement(uH,eH({},e,{ref:t})):typeof n==`number`&&typeof r==`number`?P.createElement(dH,eH({},e,{width:n,height:r,ref:t})):P.createElement(P.Fragment,null,P.createElement(Cm,{width:n,height:r}),P.createElement(`div`,eH({ref:t},e)))});function pH(e){return e?lH:fH}var mH=(0,P.forwardRef)((e,t)=>{var n=e.children,r=e.className,i=e.height,a=e.onClick,o=e.onContextMenu,s=e.onDoubleClick,c=e.onMouseDown,l=e.onMouseEnter,u=e.onMouseLeave,d=e.onMouseMove,f=e.onMouseUp,p=e.onTouchEnd,m=e.onTouchMove,h=e.onTouchStart,g=e.style,_=e.width,v=e.responsive,y=e.dispatchTouchEvents,b=y===void 0?!0:y,x=(0,P.useRef)(null),S=yc(),C=tH((0,P.useState)(null),2),w=C[0],T=C[1],E=tH((0,P.useState)(null),2),D=E[0],O=E[1],k=qV(),ee=lm(),A=ee?.width>0?ee.width:_,te=ee?.height>0?ee.height:i,j=(0,P.useCallback)(e=>{k(e),typeof t==`function`&&t(e),T(e),O(e),e!=null&&(x.current=e)},[k,t,T,O]),ne=(0,P.useCallback)(e=>{S(TB(e)),S(nV({handler:a,reactEvent:e}))},[S,a]),re=(0,P.useCallback)(e=>{S(DB(e)),S(nV({handler:l,reactEvent:e}))},[S,l]),M=(0,P.useCallback)(e=>{S(sO()),S(nV({handler:u,reactEvent:e}))},[S,u]),N=(0,P.useCallback)(e=>{S(DB(e)),S(nV({handler:d,reactEvent:e}))},[S,d]),ie=(0,P.useCallback)(()=>{S(YB())},[S]),ae=(0,P.useCallback)(()=>{S(XB())},[S]),oe=(0,P.useCallback)(e=>{S(JB(e.key))},[S]),se=(0,P.useCallback)(e=>{S(nV({handler:o,reactEvent:e}))},[S,o]),ce=(0,P.useCallback)(e=>{S(nV({handler:s,reactEvent:e}))},[S,s]),le=(0,P.useCallback)(e=>{S(nV({handler:c,reactEvent:e}))},[S,c]),ue=(0,P.useCallback)(e=>{S(nV({handler:f,reactEvent:e}))},[S,f]),de=(0,P.useCallback)(e=>{S(nV({handler:h,reactEvent:e}))},[S,h]),fe=(0,P.useCallback)(e=>{b&&S(cV(e)),S(nV({handler:m,reactEvent:e}))},[S,b,m]),pe=(0,P.useCallback)(e=>{S(nV({handler:p,reactEvent:e}))},[S,p]),me=pH(v);return P.createElement(DA.Provider,{value:w},P.createElement(JV.Provider,{value:D},P.createElement(me,{width:A??g?.width,height:te??g?.height,className:Do(`recharts-wrapper`,r),style:XV({position:`relative`,cursor:`default`,width:A,height:te},g),onClick:ne,onContextMenu:se,onDoubleClick:ce,onFocus:ie,onBlur:ae,onKeyDown:oe,onMouseDown:le,onMouseEnter:re,onMouseLeave:M,onMouseMove:N,onMouseUp:ue,onTouchEnd:pe,onTouchMove:fe,onTouchStart:de,ref:j},P.createElement(sH,null),n)))});function hH(e,t){return bH(e)||yH(e,t)||_H(e,t)||gH()}function gH(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
63
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _H(e,t){if(e){if(typeof e==`string`)return vH(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vH(e,t):void 0}}function vH(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yH(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function bH(e){if(Array.isArray(e))return e}var xH=(0,P.createContext)(void 0),SH=e=>{var t=e.children,n=hH((0,P.useState)(`${Vo(`recharts`)}-clip`),1)[0],r=OF();if(r==null)return null;var i=r.x,a=r.y,o=r.width,s=r.height;return P.createElement(xH.Provider,{value:n},P.createElement(`defs`,null,P.createElement(`clipPath`,{id:n},P.createElement(`rect`,{x:i,y:a,height:s,width:o}))),t)},CH=[`width`,`height`,`responsive`,`children`,`className`,`style`,`compact`,`title`,`desc`];function wH(e,t){if(e==null)return{};var n,r,i=TH(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function TH(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var EH=(0,P.forwardRef)((e,t)=>{var n=e.width,r=e.height,i=e.responsive,a=e.children,o=e.className,s=e.style,c=e.compact,l=e.title,u=e.desc,d=Wm(wH(e,CH));return c?P.createElement(P.Fragment,null,P.createElement(Cm,{width:n,height:r}),P.createElement(BV,{otherAttributes:d,title:l,desc:u},a)):P.createElement(mH,{className:o,style:s,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},P.createElement(BV,{otherAttributes:d,title:l,desc:u,ref:t},P.createElement(SH,null,a)))});function DH(){return DH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},DH.apply(null,arguments)}function OH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kH(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?OH(Object(n),!0).forEach(function(t){AH(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OH(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function AH(e,t,n){return(t=jH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jH(e){var t=MH(e,`string`);return typeof t==`symbol`?t:t+``}function MH(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var NH=kH({accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,layout:`horizontal`,margin:{top:5,right:5,bottom:5,left:5},responsive:!1,reverseStackOrder:!1,stackOffset:`none`,syncMethod:`index`},mV),PH=(0,P.forwardRef)(function(e,t){var n=Eh(e.categoricalChartProps,NH),r=e.chartName,i=e.defaultTooltipEventType,a=e.validateTooltipEventTypes,o=e.tooltipPayloadSearcher,s=e.categoricalChartProps,c={chartName:r,defaultTooltipEventType:i,validateTooltipEventTypes:a,tooltipPayloadSearcher:o,eventEmitter:void 0};return P.createElement(bV,{preloadedState:{options:c},reduxStoreName:s.id??r},P.createElement(xV,{chartData:s.data}),P.createElement(CV,{layout:n.layout,margin:n.margin}),P.createElement(TV,{throttleDelay:n.throttleDelay,throttledEvents:n.throttledEvents}),P.createElement(wV,{baseValue:n.baseValue,accessibilityLayer:n.accessibilityLayer,barCategoryGap:n.barCategoryGap,maxBarSize:n.maxBarSize,stackOffset:n.stackOffset,barGap:n.barGap,barSize:n.barSize,syncId:n.syncId,syncMethod:n.syncMethod,className:n.className,reverseStackOrder:n.reverseStackOrder}),P.createElement(EH,DH({},n,{ref:t})))}),FH=[`axis`,`item`],IH=(0,P.forwardRef)((e,t)=>P.createElement(PH,{chartName:`BarChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:FH,tooltipPayloadSearcher:NA,categoricalChartProps:e,ref:t})),LH=[`axis`],RH=(0,P.forwardRef)((e,t)=>P.createElement(PH,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:LH,tooltipPayloadSearcher:NA,categoricalChartProps:e,ref:t})),zH={fill:`var(--color-ink-muted)`,fontSize:10},BH=`var(--color-border-subtle)`,VH={background:`var(--color-bg-elevated)`,border:`1px solid var(--color-border-medium)`,borderRadius:8,fontSize:12,color:`var(--color-ink-base)`},HH=`var(--color-accent-green)`,UH=`var(--color-accent-amber)`,WH=`var(--color-accent-green)`,GH=`var(--color-accent-purple)`,KH=`var(--color-accent-blue)`,qH=`var(--color-accent-teal)`;function JH(e){return e===`Read`?KH:e===`Edit`||e===`Write`?WH:e===`Bash`?GH:e===`Agent`?qH:`var(--color-ink-muted)`}function YH(e){let t=e.toLowerCase();return t===`bug fix`||t===`fix`?`#FF6B6B`:t===`feature`?WH:t===`refactor`?KH:t===`configuration`||t===`config`?UH:t===`test`?qH:t===`docs`?`#C4B5FD`:GH}function XH(e){return typeof e==`string`&&e.length>=10?e.slice(5,10):e}function ZH(){let e=I({queryKey:L.weekly,queryFn:()=>tr()}),t=I({queryKey:L.sessionsList(200),queryFn:()=>Jn(200)}),n=I({queryKey:L.costPerOutcome(30),queryFn:()=>ir(30)}),r=I({queryKey:L.personalCoach,queryFn:()=>ar()}),i=I({queryKey:L.activityHeatmap(`history`),queryFn:()=>mr(`history`,12)}),a=I({queryKey:L.concurrencyHistory(30),queryFn:()=>pr(30)}),o=[...e.data??[]].reverse(),s=o.map(e=>{let t=e.weekStart??e.week??``,n=e.efficiencyScore??e.avgEfficiencyScore??null;return{week:t||`?`,efficiency:n===null?null:Math.round(n*100)}}),c=nU(eU(t.data??[],30),30),l=tU(n.data),u=rU(o),d=aU(t.data??[]),f=oU(t.data??[]),p=a.data?.dailyPeaks??[],m=p.some(e=>e.peak>0);return(0,F.jsxs)(`section`,{children:[(0,F.jsx)(ia,{theme:`history`}),(0,F.jsx)(`h1`,{className:`text-xl font-semibold gradient-text mb-4`,children:`History`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,F.jsx)(QH,{title:`Weekly Efficiency · Last 12`,children:(0,F.jsx)(`div`,{className:`h-44 min-w-0`,children:(0,F.jsx)(dm,{width:`100%`,height:`100%`,minWidth:1,minHeight:1,children:(0,F.jsxs)(RH,{data:s,children:[(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`effGradient`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:HH,stopOpacity:.3}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:HH,stopOpacity:0})]})}),(0,F.jsx)(AP,{stroke:BH,strokeDasharray:`3 3`}),(0,F.jsx)(oB,{dataKey:`week`,tick:zH,stroke:BH,tickFormatter:XH}),(0,F.jsx)(xB,{tick:zH,stroke:BH,domain:[0,100],unit:`%`}),(0,F.jsx)(gj,{contentStyle:VH}),(0,F.jsx)(tR,{type:`monotone`,dataKey:`efficiency`,stroke:HH,strokeWidth:2,fill:`url(#effGradient)`,dot:{r:2,fill:HH}})]})})})}),(0,F.jsx)(QH,{title:`Daily Spend · Last 30 Days (most recent 200)`,children:(0,F.jsx)(`div`,{className:`h-44 min-w-0`,children:(0,F.jsx)(dm,{width:`100%`,height:`100%`,minWidth:1,minHeight:1,children:(0,F.jsxs)(IH,{data:c,children:[(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`costGradient`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:HH,stopOpacity:.9}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:HH,stopOpacity:.4})]})}),(0,F.jsx)(AP,{stroke:BH,strokeDasharray:`3 3`}),(0,F.jsx)(oB,{dataKey:`day`,tick:zH,stroke:BH,tickFormatter:XH,interval:`preserveStartEnd`,minTickGap:20}),(0,F.jsx)(xB,{tick:zH,stroke:BH,unit:`$`}),(0,F.jsx)(gj,{contentStyle:VH,labelFormatter:XH,cursor:!1}),(0,F.jsx)(zz,{dataKey:`cost`,fill:`url(#costGradient)`,radius:[3,3,0,0]})]})})})}),(0,F.jsx)(QH,{title:`Cost Per Outcome · Last 30 Days`,children:l.length===0?(0,F.jsx)(Li,{icon:`radar`,title:`No outcomes yet`,subtitle:`Finish a few sessions and check back.`}):(0,F.jsx)(`div`,{className:`min-w-0`,style:{height:`${Math.max(176,l.length*32+40)}px`},children:(0,F.jsx)(dm,{width:`100%`,height:`100%`,minWidth:1,minHeight:1,children:(0,F.jsxs)(IH,{data:l,layout:`vertical`,children:[(0,F.jsx)(AP,{stroke:BH,strokeDasharray:`3 3`}),(0,F.jsx)(oB,{type:`number`,tick:zH,stroke:BH,unit:`$`}),(0,F.jsx)(xB,{type:`category`,dataKey:`outcome`,tick:zH,stroke:BH,width:110}),(0,F.jsx)(gj,{contentStyle:VH}),(0,F.jsx)(zz,{dataKey:`totalCost`,radius:[0,3,3,0],children:l.map(e=>(0,F.jsx)(_j,{fill:YH(e.outcome),fillOpacity:.8},e.outcome))})]})})})}),(0,F.jsx)(QH,{title:`Anti-Pattern Frequency · Weekly`,children:u.length===0?(0,F.jsx)(Li,{icon:`checkmark`,title:`No anti-patterns detected`,subtitle:`No anti-patterns detected in the loaded weeks.`}):(0,F.jsx)(`div`,{className:`h-44 min-w-0`,children:(0,F.jsx)(dm,{width:`100%`,height:`100%`,minWidth:1,minHeight:1,children:(0,F.jsxs)(IH,{data:u,children:[(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`antiPatternGradient`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:UH,stopOpacity:.9}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:UH,stopOpacity:.4})]})}),(0,F.jsx)(AP,{stroke:BH,strokeDasharray:`3 3`}),(0,F.jsx)(oB,{dataKey:`week`,tick:zH,stroke:BH,tickFormatter:XH}),(0,F.jsx)(xB,{tick:zH,stroke:BH}),(0,F.jsx)(gj,{contentStyle:VH}),(0,F.jsx)(zz,{dataKey:`count`,fill:`url(#antiPatternGradient)`,radius:[3,3,0,0]})]})})})}),(0,F.jsx)(QH,{title:`Model Performance`,children:d.length===0?(0,F.jsx)(Li,{icon:`radar`,title:`No model data yet`,subtitle:`Complete a few sessions to see model performance.`}):(0,F.jsxs)(`div`,{className:`h-44 overflow-y-auto text-xs`,children:[(0,F.jsxs)(`table`,{className:`w-full`,children:[(0,F.jsx)(`thead`,{className:`text-ink-muted sticky top-0 bg-bg-panel`,children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{className:`text-left pb-1`,children:`Model`}),(0,F.jsx)(`th`,{className:`text-right pb-1`,children:`Sessions`}),(0,F.jsx)(`th`,{className:`text-right pb-1`,children:`Eff.`}),(0,F.jsx)(`th`,{className:`text-right pb-1`,children:`Success`}),(0,F.jsx)(`th`,{className:`text-right pb-1`,children:`Avg $`})]})}),(0,F.jsx)(`tbody`,{children:d.map(e=>(0,F.jsxs)(`tr`,{className:`border-t border-bg-line`,children:[(0,F.jsx)(`td`,{className:`py-1 font-medium`,children:e.model}),(0,F.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:e.sessions}),(0,F.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:e.avgEfficiency===null?`—`:`${Math.min(100,Math.round(e.avgEfficiency*100))}%`}),(0,F.jsx)(`td`,{className:`py-1 text-right tabular-nums ${e.flagged?`text-accent-amber`:``}`,children:e.avgSuccessRate===null?`—`:`${Math.min(100,Math.round(e.avgSuccessRate*100))}%`}),(0,F.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:e.avgCost===null?`—`:`$${e.avgCost.toFixed(2)}`})]},e.model))})]}),d.some(e=>e.flagged)&&(0,F.jsx)(`div`,{className:`text-accent-amber text-[10px] mt-1`,children:`⚠ Highlighted models had sessions with elevated error rates`})]})}),(0,F.jsx)(QH,{title:`Top Tools · Most Recent 200 Sessions`,children:f.length===0?(0,F.jsx)(Li,{icon:`code`,title:`No tool data yet`,subtitle:`Tool usage data will appear after coding sessions.`}):(0,F.jsx)(`div`,{className:`min-w-0`,style:{height:`${Math.max(176,f.length*28+40)}px`},children:(0,F.jsx)(dm,{width:`100%`,height:`100%`,minWidth:1,minHeight:1,children:(0,F.jsxs)(IH,{data:f,layout:`vertical`,children:[(0,F.jsx)(AP,{stroke:BH,strokeDasharray:`3 3`}),(0,F.jsx)(oB,{type:`number`,tick:zH,stroke:BH}),(0,F.jsx)(xB,{type:`category`,dataKey:`tool`,tick:zH,tickFormatter:Qr,stroke:BH,width:120}),(0,F.jsx)(gj,{contentStyle:VH,labelFormatter:Qr}),(0,F.jsx)(zz,{dataKey:`count`,radius:[0,3,3,0],children:f.map(e=>(0,F.jsx)(_j,{fill:JH(Qr(e.tool)),fillOpacity:.8},e.tool))})]})})})})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 mt-3`,children:[i.data&&i.data.days.length>0&&(0,F.jsx)(QH,{title:`Activity · Last 12 Weeks`,children:(0,F.jsx)(ea,{variant:`grid`,buckets:[],maxCount:i.data.maxCount,days:i.data.days,ariaLabel:`Daily activity heatmap for the last 12 weeks`})}),(0,F.jsxs)(R,{padding:`md`,className:`flex flex-col`,children:[(0,F.jsxs)(z,{className:`mb-3`,children:[`Peak Concurrent Sessions · Last 30 Days`,m&&`: ${Math.max(...p.map(e=>e.peak))}`]}),m?(0,F.jsx)(`div`,{className:`flex-1 flex items-end justify-center`,children:(0,F.jsx)(sU,{data:p})}):(0,F.jsx)(Li,{icon:`code`,title:`No concurrent sessions yet`,subtitle:`Run two or more Claude Code sessions at the same time to populate this chart.`})]})]}),(0,F.jsx)(`div`,{className:`mt-3`,children:(0,F.jsx)($H,{data:r.data})})]})}function QH({title:e,children:t}){return(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(z,{children:e}),(0,F.jsx)(`div`,{className:`mt-3`,children:t})]})}function $H({data:e}){return e?e.status===`insufficient_data`?(0,F.jsx)(QH,{title:`Personal Coach`,children:(0,F.jsx)(`div`,{className:`text-ink-muted text-xs`,children:e.message})}):(0,F.jsx)(QH,{title:`Personal coach`,children:(0,F.jsxs)(`div`,{className:`text-xs space-y-2`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-accent-cyan font-semibold`,children:`Top recommendation: `}),e.topRecommendation]}),e.highlights.length>0&&(0,F.jsx)(`ul`,{className:`list-disc list-inside text-accent-green`,children:e.highlights.map(e=>(0,F.jsx)(`li`,{children:e},`hl-${e}`))}),e.regressions.length>0&&(0,F.jsx)(`ul`,{className:`list-disc list-inside text-accent-amber`,children:e.regressions.map(e=>(0,F.jsx)(`li`,{children:e},`rg-${e}`))}),e.streaks.length>0&&(0,F.jsx)(`ul`,{className:`list-disc list-inside text-ink-muted`,children:e.streaks.map(e=>(0,F.jsx)(`li`,{children:e},`st-${e}`))})]})}):(0,F.jsx)(QH,{title:`Personal Coach`,children:(0,F.jsx)(Li,{variant:`loading`,title:`Loading coaching insights…`})})}function eU(e,t){let n=new Map;for(let t of e){if(t.estimatedCostUsd==null||t.startTime==null)continue;let e=new Date(t.startTime),r=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`;n.set(r,(n.get(r)??0)+t.estimatedCostUsd)}return Array.from(n.entries()).sort((e,t)=>e[0].localeCompare(t[0])).slice(-t).map(([e,t])=>({day:e,cost:Number(t.toFixed(2))}))}function tU(e){return e?Object.entries(e.outcomeDistribution).map(([e,t])=>({outcome:e.replace(/_/g,` `),totalCost:Number(t.totalCost.toFixed(2)),count:t.count})).filter(e=>e.totalCost>0).sort((e,t)=>t.totalCost-e.totalCost):[]}function nU(e,t,n=new Date){let r=new Map(e.map(e=>[e.day,e.cost])),i=[];for(let e=t-1;e>=0;e--){let t=new Date(n);t.setDate(t.getDate()-e);let a=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`;i.push({day:a,cost:r.get(a)??0})}return i}function rU(e){let t=[];for(let n of e){let e=n.antiPatternCounts??{},r=Object.values(e).reduce((e,t)=>e+t,0);r>0&&t.push({week:(n.weekStart??n.week??``)||`?`,count:r})}return t}var iU=.85;function aU(e){let t=new Map;for(let n of e){let e=n.model??`unknown`,r=t.get(e);r||(r={sessions:0,effSum:0,effCount:0,successSum:0,successCount:0,costSum:0,costCount:0,lowSuccessSessions:0},t.set(e,r)),r.sessions++,n.efficiencyScore!=null&&(r.effSum+=n.efficiencyScore,r.effCount++),n.toolSuccessRate!=null&&(r.successSum+=n.toolSuccessRate,r.successCount++,n.toolSuccessRate<iU&&r.lowSuccessSessions++),n.estimatedCostUsd!=null&&(r.costSum+=n.estimatedCostUsd,r.costCount++)}let n=[];for(let[e,r]of t)n.push({model:e,sessions:r.sessions,avgEfficiency:r.effCount>0?r.effSum/r.effCount:null,avgSuccessRate:r.successCount>0?r.successSum/r.successCount:null,avgCost:r.costCount>0?r.costSum/r.costCount:null,flagged:r.lowSuccessSessions>0});return n.sort((e,t)=>t.sessions-e.sessions)}function oU(e){let t=new Map;for(let n of e)if(n.toolBreakdown)for(let[e,r]of Object.entries(n.toolBreakdown))t.set(e,(t.get(e)??0)+r);return Array.from(t.entries()).map(([e,t])=>({tool:e,count:t})).sort((e,t)=>t.count-e.count).slice(0,8)}function sU({data:e}){return(0,F.jsx)(Ki,{data:e.map(e=>({count:e.peak,tooltip:`${e.date.slice(5)}: ${e.peak}`})),ariaLabel:`Peak concurrent sessions over ${e.length} days`})}var cU=[{key:`all`,label:`All`},{key:`sensitive_file`,label:`Sensitive files`},{key:`destructive_command`,label:`Destructive`},{key:`external_network`,label:`External network`}],lU={critical:`danger`,high:`warning`,medium:`info`};function uU(e){let t=e.map(e=>JSON.stringify(e)).join(`
64
- `),n=new Blob([t],{type:`application/x-ndjson`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`audit-${new Date().toISOString().slice(0,10)}.jsonl`,i.rel=`noopener`,document.body.appendChild(i);try{i.click()}finally{document.body.removeChild(i),URL.revokeObjectURL(r)}}function dU(){let[e,t]=(0,P.useState)(`all`),{data:n,isLoading:r,error:i}=I({queryKey:L.audit,queryFn:()=>er()}),a=n??[],o=e===`all`?a:a.filter(t=>t.classification===e),s=o.slice(0,200);return(0,F.jsxs)(`section`,{children:[(0,F.jsx)(ia,{theme:`audit`}),(0,F.jsxs)(`header`,{className:`flex items-baseline justify-between mb-4`,children:[(0,F.jsx)(`h1`,{className:`text-xl font-semibold gradient-text`,children:`Audit`}),(0,F.jsx)(kr,{variant:`secondary`,size:`md`,onClick:()=>uU(s),children:`Export JSONL`})]}),(0,F.jsx)(`div`,{className:`flex gap-2 mb-3 flex-wrap`,children:cU.map(({key:n,label:r})=>(0,F.jsx)(kr,{variant:e===n?`primary`:`secondary`,size:`sm`,onClick:()=>t(n),children:r},n))}),r&&(0,F.jsx)(Li,{icon:`clock`,variant:`loading`,title:`Loading...`}),i&&(0,F.jsx)(`div`,{className:`text-accent-red text-xs`,children:`Error loading audit log.`}),!r&&!i&&o.length>200&&(0,F.jsxs)(`div`,{className:`text-[11px] text-ink-muted mb-2`,children:[`Showing first `,200,` of `,o.length,` entries.`]}),!r&&!i&&(0,F.jsx)(R,{padding:`sm`,tone:`static`,className:`overflow-hidden`,children:(0,F.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,F.jsx)(`thead`,{className:`text-ink-muted bg-surface-3`,children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{className:`text-left p-2`,children:`When`}),(0,F.jsx)(`th`,{className:`text-left p-2`,children:`Tool`}),(0,F.jsx)(`th`,{className:`text-left p-2`,children:`Target`}),(0,F.jsx)(`th`,{className:`text-left p-2`,children:`Classification`}),(0,F.jsx)(`th`,{className:`text-left p-2`,children:`Session`})]})}),(0,F.jsxs)(`tbody`,{children:[o.length===0&&(0,F.jsx)(`tr`,{children:(0,F.jsx)(`td`,{colSpan:5,className:`p-3 text-ink-muted text-center`,children:`No matching entries.`})}),s.map(e=>(0,F.jsxs)(`tr`,{className:`border-t border-border-subtle`,children:[(0,F.jsx)(`td`,{className:`p-2 tabular-nums`,children:new Date(e.ts).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}),(0,F.jsx)(`td`,{className:`p-2`,children:e.tool}),(0,F.jsx)(`td`,{className:`p-2 font-mono text-[11px]`,children:e.target}),(0,F.jsx)(`td`,{className:`p-2`,children:(0,F.jsx)(Nr,{tone:e.severity?lU[e.severity]??`neutral`:`neutral`,size:`sm`,children:e.classification})}),(0,F.jsx)(`td`,{className:`p-2 text-ink-subtle`,children:e.sessionId??`—`})]},`${e.ts}-${e.tool}-${e.target}`))]})]})})]})}var fU={info:`border-l-accent-blue bg-accent-blue/5`,warning:`border-l-accent-amber bg-accent-amber/5`,critical:`border-l-accent-red bg-accent-red/5`},pU={info:`info`,warning:`warning`,critical:`danger`},mU={resolved:`text-accent-green`,aborted:`text-accent-red`,pending:`text-accent-amber`},hU={merge_conflict:`bg-accent-red/20 text-accent-red`,rebase_conflict:`bg-accent-red/20 text-accent-red`,merge_abort:`bg-accent-amber/20 text-accent-amber`,rebase_abort:`bg-accent-amber/20 text-accent-amber`,force_push:`bg-accent-red/20 text-accent-red`,reset_hard:`bg-accent-amber/20 text-accent-amber`,commit:`bg-accent-green/20 text-accent-green`,push:`bg-accent-blue/20 text-accent-blue`,pull:`bg-accent-blue/20 text-accent-blue`};function gU(e){return e===null?`—`:e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function _U(e){return e.replace(/_/g,` `)}function vU({score:e}){if(e===null)return(0,F.jsx)(`div`,{className:`flex items-center justify-center w-20 h-20 rounded-full border-4 border-border-medium`,children:(0,F.jsx)(`span`,{className:`text-ink-muted text-xs`,children:`N/A`})});let t=Math.max(0,Math.min(100,e)),[n,r]=t>=80?[`text-accent-green`,`border-accent-green`]:t>=60?[`text-accent-amber`,`border-accent-amber`]:[`text-accent-red`,`border-accent-red`],i=2*Math.PI*34,a=i-t/100*i;return(0,F.jsxs)(`div`,{className:`relative w-20 h-20`,children:[(0,F.jsxs)(`svg`,{className:`w-20 h-20 -rotate-90`,viewBox:`0 0 80 80`,children:[(0,F.jsx)(`circle`,{cx:`40`,cy:`40`,r:`34`,fill:`none`,stroke:`rgba(255,255,255,0.08)`,strokeWidth:`6`}),(0,F.jsx)(`circle`,{cx:`40`,cy:`40`,r:`34`,fill:`none`,className:r,stroke:`currentColor`,strokeWidth:`6`,strokeLinecap:`round`,strokeDasharray:i,strokeDashoffset:a,style:{transition:`stroke-dashoffset 0.8s ease-out`}})]}),(0,F.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center text-lg font-bold ${n}`,children:e})]})}function yU(){let{data:e,isLoading:t,error:n}=I({queryKey:L.gitEfficiency,queryFn:()=>ur(),refetchInterval:5e3}),{data:r}=I({queryKey:L.gitEfficiencyRepos,queryFn:()=>dr(),refetchInterval:3e4});return t?(0,F.jsx)(Li,{icon:`clock`,variant:`loading`,title:`Loading...`}):n?(0,F.jsx)(`div`,{className:`text-accent-red text-xs`,children:`Error loading git efficiency data.`}):!e||e.totalGitCommands===0?(0,F.jsxs)(F.Fragment,{children:[r&&r.repos.length>0&&(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mb-4`,children:[(0,F.jsx)(z,{as:`div`,className:`mr-1`,children:`Repos Today:`}),r.repos.map(e=>{let t=e.split(`/`).pop()||e;return(0,F.jsx)(Nr,{tone:e===r.currentRepo?`success`:`neutral`,size:`sm`,bordered:!0,className:`font-mono`,children:t},e)})]}),(0,F.jsx)(Li,{icon:`code`,title:`No Git activity yet`,subtitle:`Git efficiency metrics will appear here as git commands are executed during the session.`})]}):(0,F.jsxs)(`section`,{children:[(0,F.jsx)(ia,{theme:`git`}),(0,F.jsxs)(`header`,{className:`flex items-baseline justify-between mb-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h1`,{className:`text-xl font-semibold gradient-text`,children:`Git Efficiency`}),e.repoContext.repoName&&(0,F.jsxs)(`div`,{className:`flex items-center gap-2 mt-1 text-[11px] text-ink-muted`,children:[(0,F.jsx)(`span`,{className:`font-mono`,children:e.repoContext.repoName}),e.repoContext.branch&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`/`}),(0,F.jsx)(`span`,{className:`font-mono text-ink-subtle`,children:e.repoContext.branch})]})]}),(0,F.jsx)(`div`,{className:`mt-1 text-[11px] text-ink-muted`,children:`Today's activity across all sessions`}),r&&r.repos.length>0&&(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mt-2`,children:[(0,F.jsx)(`span`,{className:`text-[10px] text-ink-muted uppercase tracking-wider mr-1`,children:`Repos today:`}),r.repos.map(e=>{let t=e.split(`/`).pop()||e;return(0,F.jsx)(Nr,{tone:e===r.currentRepo?`success`:`neutral`,size:`sm`,bordered:!0,className:`font-mono`,children:t},e)})]})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,F.jsxs)(`div`,{className:`text-center`,children:[(0,F.jsx)(z,{as:`div`,className:`mb-1`,children:`Prevention`}),(0,F.jsx)(vU,{score:e.preventionScore})]}),(0,F.jsxs)(`div`,{className:`text-center`,children:[(0,F.jsx)(z,{as:`div`,className:`mb-1`,children:`Efficiency`}),(0,F.jsx)(vU,{score:e.efficiencyScore})]})]})]}),(0,F.jsx)(Ci,{index:0,className:`mb-3`,children:(0,F.jsx)(R,{padding:`lg`,tone:`elevated`,glow:`green`,children:(0,F.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-4`,children:[(0,F.jsx)(B,{label:`commits today`,hero:!0,value:String(e.commitCount),animate:!0,numericValue:e.commitCount}),(0,F.jsx)(B,{label:`PRs opened`,tone:e.prMetrics.created>0?`good`:`neutral`,value:String(e.prMetrics.created),sub:e.prMetrics.merged>0?`${e.prMetrics.merged} merged`:void 0,animate:!0,numericValue:e.prMetrics.created}),(0,F.jsx)(B,{label:`conflicts`,tone:e.mergeConflicts+e.rebaseConflicts>0?`bad`:`good`,value:String(e.mergeConflicts+e.rebaseConflicts),sub:e.mergeConflicts+e.rebaseConflicts===0?`clean session`:`${e.abortedOperations} aborted`,animate:!0,numericValue:e.mergeConflicts+e.rebaseConflicts}),(0,F.jsx)(B,{label:`behind main`,tone:(e.riskIndicators.commitsBehindMain??0)>20?`bad`:(e.riskIndicators.commitsBehindMain??0)>5?`warn`:`good`,value:e.riskIndicators.commitsBehindMain===null?`—`:String(e.riskIndicators.commitsBehindMain),sub:e.riskIndicators.commitsBehindMain===0?`up to date`:e.riskIndicators.commitsBehindMain!==null&&e.riskIndicators.commitsBehindMain>10?`rebase soon`:void 0,animate:!0,numericValue:e.riskIndicators.commitsBehindMain??0})]})})}),e.bestPractices.length>0&&(0,F.jsx)(Ci,{index:1,className:`mb-3`,children:(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Best Practices`,action:(0,F.jsx)(`span`,{className:`text-[11px] text-ink-muted`,children:(()=>{let t=e.bestPractices.filter(e=>e.status!==`unknown`).length;return t===0?`No data yet`:`${e.bestPractices.filter(e=>e.status===`pass`).length}/${t} passing`})()})}),(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 mb-2`,children:[e.bestPractices.filter(e=>e.status===`pass`).map(e=>(0,F.jsxs)(Nr,{tone:`success`,size:`sm`,bordered:!0,children:[(0,F.jsx)(`span`,{children:`✓`}),` `,e.label]},e.id)),e.bestPractices.filter(e=>e.status===`unknown`).map(e=>(0,F.jsxs)(Nr,{tone:`neutral`,size:`sm`,bordered:!0,children:[(0,F.jsx)(`span`,{children:`●`}),` `,e.label]},e.id))]}),e.bestPractices.filter(e=>e.status===`fail`||e.status===`warn`).map(e=>(0,F.jsxs)(`div`,{className:`flex items-start gap-2 px-2.5 py-2 rounded-lg mt-1.5 ${e.status===`fail`?`bg-accent-red/5 border border-accent-red/20`:`bg-accent-amber/5 border border-accent-amber/20`}`,children:[(0,F.jsx)(`span`,{className:`shrink-0 mt-0.5 text-xs`,children:e.status===`fail`?(0,F.jsx)(`span`,{className:`text-accent-red`,children:`✗`}):(0,F.jsx)(`span`,{className:`text-accent-amber`,children:`⚠`})}),(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`text-xs font-medium text-ink-base`,children:e.label}),(0,F.jsx)(`div`,{className:`text-[11px] text-ink-muted mt-0.5 leading-relaxed`,children:e.detail})]})]},e.id))]})}),(e.mergeConflicts>0||e.rebaseConflicts>0)&&(0,F.jsx)(Ci,{index:2,className:`mb-3`,children:(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Conflict Resolution`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3`,children:[(0,F.jsx)(B,{label:`Resolution rate`,value:e.conflictResolutionRate===null?`—`:`${Math.round(e.conflictResolutionRate*100)}%`}),(0,F.jsx)(B,{label:`Avg resolution time`,value:gU(e.avgConflictResolutionMs)}),(0,F.jsx)(B,{label:`Aborted ops`,value:String(e.abortedOperations)}),(0,F.jsx)(B,{label:`Stale branch pulls`,value:String(e.staleBranchPulls)})]}),e.conflictHistory.length>0&&(0,F.jsxs)(`div`,{className:`mt-3`,children:[(0,F.jsx)(z,{as:`h3`,className:`mb-2`,children:`Conflict History`}),(0,F.jsx)(`div`,{className:`space-y-1`,children:e.conflictHistory.map(e=>(0,F.jsxs)(`div`,{className:`flex items-center gap-3 text-xs py-1 border-t border-border-subtle`,children:[(0,F.jsx)(`span`,{className:`tabular-nums text-ink-subtle w-28 shrink-0`,children:new Date(e.timestamp).toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`,second:`2-digit`})}),(0,F.jsx)(`span`,{className:`font-medium ${mU[e.resolution]}`,children:e.resolution}),(0,F.jsx)(`span`,{className:`text-ink-muted`,children:gU(e.resolutionTimeMs)}),(0,F.jsx)(`span`,{className:`text-ink-subtle font-mono text-[11px] truncate`,children:e.command})]},`${e.timestamp}-${e.command}`))})]})]})}),e.suggestions.length>0&&(0,F.jsx)(Ci,{index:3,className:`mb-3`,children:(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Suggestions`}),(0,F.jsx)(`div`,{className:`space-y-2`,children:e.suggestions.map((e,t)=>(0,F.jsx)(`div`,{className:`border-l-[3px] rounded-r-lg px-3 py-2 ${fU[e.severity]}`,children:(0,F.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,F.jsx)(Nr,{tone:pU[e.severity],size:`sm`,className:`font-semibold`,children:e.severity}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`text-xs text-ink-base`,children:e.message}),(0,F.jsx)(`p`,{className:`text-[11px] text-ink-muted mt-0.5`,children:e.evidence})]})]})},`${e.category}-${e.severity}-${t}`))})]})}),e.commitCount>=2&&(0,F.jsx)(Ci,{index:4,className:`mb-3`,children:(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Velocity & Workflow`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3`,children:[(0,F.jsx)(B,{label:`Avg time between commits`,value:gU(e.velocityMetrics.avgTimeBetweenCommitsMs)}),(0,F.jsx)(B,{label:`Longest gap`,value:gU(e.velocityMetrics.longestGapMs)}),(0,F.jsx)(B,{label:`Commit bursts`,value:String(e.velocityMetrics.commitBurstCount)}),(0,F.jsx)(B,{label:`Worktree ops`,value:String(e.velocityMetrics.worktreeCount)})]}),e.velocityMetrics.buildBeforePush!==null&&(0,F.jsxs)(`div`,{className:`mt-3 text-xs`,children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`Verified before push: `}),e.velocityMetrics.buildBeforePush?(0,F.jsx)(`span`,{className:`text-accent-green`,children:`yes (build/test ran first)`}):(0,F.jsx)(`span`,{className:`text-accent-amber`,children:`no build/test detected before push`})]})]})}),(e.prMetrics.created>0||e.prMetrics.merged>0||e.prMetrics.checksViewed>0)&&(0,F.jsx)(Ci,{index:5,className:`mb-3`,children:(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Pull Requests`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3`,children:[(0,F.jsx)(B,{label:`PRs created`,value:String(e.prMetrics.created),tone:e.prMetrics.created>0?`good`:`neutral`}),(0,F.jsx)(B,{label:`PRs merged`,value:String(e.prMetrics.merged),tone:e.prMetrics.merged>0?`good`:`neutral`}),(0,F.jsx)(B,{label:`CI checks viewed`,value:String(e.prMetrics.checksViewed)}),(0,F.jsx)(B,{label:`Time to PR`,value:gU(e.prMetrics.avgTimeToCreateMs)})]}),e.prMetrics.prActivity.length>0&&(0,F.jsxs)(`div`,{className:`mt-3`,children:[(0,F.jsx)(z,{as:`h3`,className:`mb-2`,children:`Activity`}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.prMetrics.prActivity.map(e=>(0,F.jsxs)(Nr,{tone:e.action===`create`?`success`:e.action===`merge`?`info`:`neutral`,size:`sm`,children:[e.action,e.prNumber?` #${e.prNumber}`:``]},`${e.timestamp}-${e.action}`))})]})]})}),e.conflictResolutionStrategy.totalResolutions>0&&(0,F.jsx)(Ci,{index:6,className:`mb-3`,children:(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Conflict Resolution Strategy`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3`,children:[(0,F.jsx)(B,{label:`Accept ours`,value:String(e.conflictResolutionStrategy.oursCount)}),(0,F.jsx)(B,{label:`Accept theirs`,value:String(e.conflictResolutionStrategy.theirsCount)}),(0,F.jsx)(B,{label:`Manual merge`,value:String(e.conflictResolutionStrategy.manualMergeCount)}),(0,F.jsx)(B,{label:`Cherry-picks`,value:String(e.conflictResolutionStrategy.cherryPickCount)})]})]})}),(e.resetHards>0||e.discardedChanges>0||e.forcePushes>0)&&(0,F.jsx)(Ci,{index:7,className:`mb-3`,children:(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Destructive Operations`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,F.jsx)(B,{label:`Hard resets`,value:String(e.resetHards)}),(0,F.jsx)(B,{label:`Discarded changes`,value:String(e.discardedChanges)}),(0,F.jsx)(B,{label:`Force pushes`,value:String(e.forcePushes)})]})]})}),(0,F.jsx)(Ci,{index:8,children:(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Recent Git Activity`}),(0,F.jsx)(`div`,{className:`max-h-64 overflow-auto`,children:(0,F.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,F.jsx)(`thead`,{className:`text-ink-muted bg-surface-3 sticky top-0`,children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{className:`text-left p-2`,children:`Time`}),(0,F.jsx)(`th`,{className:`text-left p-2`,children:`Type`}),(0,F.jsx)(`th`,{className:`text-left p-2`,children:`Duration`}),(0,F.jsx)(`th`,{className:`text-left p-2`,children:`Status`})]})}),(0,F.jsx)(`tbody`,{children:[...e.gitCommandTimeline].reverse().slice(0,30).map(e=>(0,F.jsxs)(`tr`,{className:`border-t border-border-subtle`,children:[(0,F.jsx)(`td`,{className:`p-2 tabular-nums text-ink-subtle`,children:new Date(e.timestamp).toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`,second:`2-digit`})}),(0,F.jsx)(`td`,{className:`p-2`,children:(0,F.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${hU[e.type]??`bg-surface-8 text-ink-subtle`}`,children:_U(e.type)})}),(0,F.jsx)(`td`,{className:`p-2 tabular-nums text-ink-subtle`,children:gU(e.durationMs)}),(0,F.jsx)(`td`,{className:`p-2`,children:e.success?(0,F.jsx)(`span`,{className:`text-accent-green`,children:`ok`}):(0,F.jsx)(`span`,{className:`text-accent-red`,children:`fail`})})]},`${e.type}-${e.timestamp}`))})]})})]})})]})}function bU({label:e,value:t}){return(0,F.jsxs)(`div`,{className:`flex items-center gap-3 py-1.5`,children:[(0,F.jsx)(`span`,{className:`text-xs text-ink-muted w-36 shrink-0`,children:e}),(0,F.jsx)(`span`,{className:`text-xs font-mono text-ink-subtle bg-surface-3 px-2 py-0.5 rounded-md`,children:t??`—`})]})}function xU({label:e,value:t,onChange:n,placeholder:r,min:i}){return(0,F.jsxs)(`div`,{className:`flex items-center gap-3 py-1.5`,children:[(0,F.jsx)(`label`,{className:`text-xs text-ink-muted w-36 shrink-0`,children:e}),(0,F.jsx)(`input`,{type:`number`,min:i,step:`any`,value:t??``,placeholder:r??`unlimited`,onChange:e=>{let t=e.target.value;n(t===``?null:Number(t))},className:`text-xs bg-surface-3 border border-border-subtle rounded-md px-2 py-1 w-32 focus:outline-none focus:border-accent-green text-ink-base placeholder:text-ink-muted`})]})}var SU={ok:`●`,warn:`▲`,fail:`✗`,skip:`–`},CU={ok:`text-accent-green`,warn:`text-accent-amber`,fail:`text-accent-red`,skip:`text-ink-muted`};function wU(){let{data:e,isLoading:t,isError:n,refetch:r}=I({queryKey:L.diagnostics,queryFn:()=>yr(),refetchInterval:6e4,staleTime:55e3}),i=e??[],a=i.some(e=>e.status===`fail`||e.status===`warn`);return(0,F.jsxs)(R,{padding:`md`,className:`mb-4`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,F.jsx)(zr,{title:`System Health`}),(0,F.jsx)(`button`,{onClick:()=>void r(),className:`text-[10px] text-ink-muted hover:text-ink-base transition-colors`,children:`Re-check`})]}),t&&(0,F.jsx)(Li,{icon:`clock`,variant:`loading`,title:`Checking system…`}),n&&(0,F.jsx)(`div`,{className:`text-xs text-accent-red`,children:`Failed to load diagnostics.`}),!t&&!n&&!a&&(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-accent-green`,children:[(0,F.jsx)(`span`,{children:`●`}),(0,F.jsx)(`span`,{children:`System healthy`})]}),!t&&!n&&a&&(0,F.jsx)(`div`,{className:`space-y-1.5`,children:i.map(e=>(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`flex items-baseline gap-2 text-xs`,children:[(0,F.jsx)(`span`,{className:`shrink-0 ${CU[e.status]??`text-ink-muted`}`,children:SU[e.status]??`?`}),(0,F.jsx)(`span`,{className:`text-ink-muted w-36 shrink-0`,children:e.check}),(0,F.jsx)(`span`,{className:`text-ink-subtle`,children:e.detail})]}),e.fix&&(e.status===`fail`||e.status===`warn`)&&(0,F.jsxs)(`div`,{className:`ml-[1.25rem] mt-0.5 flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`text-[10px] font-mono text-ink-subtle bg-surface-3 px-1.5 py-0.5 rounded`,children:e.fix}),(0,F.jsx)(`button`,{className:`text-[10px] text-ink-muted hover:text-ink-base transition-colors`,onClick:()=>void navigator.clipboard.writeText(e.fix??``),children:`copy`})]})]},e.check))})]})}function TU(){let e=Xe(),{data:t,isLoading:n,error:r}=I({queryKey:L.settings,queryFn:()=>vr()}),[i,a]=(0,P.useState)(null),[o,s]=(0,P.useState)(void 0),[c,l]=(0,P.useState)(void 0),[u,d]=(0,P.useState)(void 0),[f,p]=(0,P.useState)(void 0),[m,h]=(0,P.useState)(void 0),[g,_]=(0,P.useState)(null),[v,y]=(0,P.useState)(null),b=dt({mutationFn:e=>br(e),onSuccess:()=>{e.invalidateQueries({queryKey:L.settings}),y(null)},onError:e=>{y(String(e))}});if(n)return(0,F.jsx)(Li,{icon:`clock`,variant:`loading`,title:`Loading...`});if(r||!t)return(0,F.jsx)(`div`,{className:`text-accent-red text-xs`,children:`Failed to load settings.`});let x=i??t.developer,S=o===void 0?t.teamId:o,C=c===void 0?t.sessionBudgetUsd:c,w=u===void 0?t.dailyBudgetUsd:u,T=f===void 0?t.weeklyBudgetUsd:f,E=m===void 0?t.retainSessionsDays:m;function D(){let e={};i!==null&&(e.developer=i),o!==void 0&&(e.teamId=o),b.mutate(e,{onSuccess:()=>{_(`identity`),setTimeout(()=>_(null),3e3)}})}function O(){let e={};c!==void 0&&(e.sessionBudgetUsd=c),u!==void 0&&(e.dailyBudgetUsd=u),f!==void 0&&(e.weeklyBudgetUsd=f),m!==void 0&&(e.retainSessionsDays=m),b.mutate(e,{onSuccess:()=>{_(`budgets`),setTimeout(()=>_(null),3e3)}})}let k=e=>g===e?(0,F.jsx)(`div`,{className:`mt-2 text-xs text-accent-amber`,children:`Saved. Restart the server for changes to take effect.`}):null;return(0,F.jsxs)(`section`,{children:[(0,F.jsx)(wU,{}),(0,F.jsxs)(`header`,{className:`mb-6`,children:[(0,F.jsx)(`h1`,{className:`text-xl font-semibold gradient-text`,children:`Settings`}),(0,F.jsx)(`p`,{className:`text-xs text-ink-muted mt-1`,children:`Changes are written to config.json on disk. Most require a server restart.`})]}),v&&(0,F.jsx)(`div`,{className:`mb-4 text-xs text-accent-red bg-accent-red/10 border border-accent-red/30 rounded-md px-3 py-2`,children:v}),(0,F.jsxs)(R,{padding:`md`,className:`mb-4`,children:[(0,F.jsx)(zr,{title:`Identity & Account`}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3 py-1.5`,children:[(0,F.jsx)(`label`,{className:`text-xs text-ink-muted w-36 shrink-0`,children:`Developer name`}),(0,F.jsx)(`input`,{type:`text`,value:x,maxLength:128,onChange:e=>a(e.target.value),className:`text-xs bg-surface-3 border border-border-subtle rounded-md px-2 py-1 w-48 focus:outline-none focus:border-accent-green text-ink-base`})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3 py-1.5`,children:[(0,F.jsx)(`label`,{className:`text-xs text-ink-muted w-36 shrink-0`,children:`Team ID`}),(0,F.jsx)(`input`,{type:`text`,value:S??``,placeholder:`optional`,onChange:e=>s(e.target.value===``?null:e.target.value),className:`text-xs bg-surface-3 border border-border-subtle rounded-md px-2 py-1 w-48 focus:outline-none focus:border-accent-green text-ink-base placeholder:text-ink-muted`})]}),(0,F.jsx)(bU,{label:`Account ID`,value:t.accountId}),(0,F.jsx)(bU,{label:`App name`,value:t.appName}),(0,F.jsx)(bU,{label:`Mode`,value:t.mode}),(0,F.jsx)(bU,{label:`Storage path`,value:t.storagePath}),(0,F.jsx)(bU,{label:`High security`,value:t.highSecurity?`enabled`:`disabled`}),(0,F.jsx)(bU,{label:`License key`,value:t.licenseKey}),(0,F.jsx)(`div`,{className:`mt-3 flex items-center gap-3`,children:(0,F.jsx)(kr,{variant:`primary`,size:`md`,onClick:D,disabled:b.isPending,loading:b.isPending,children:b.isPending?`Saving…`:`Save identity`})}),k(`identity`)]}),(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Cost & Retention`,subtitle:`Budget caps trigger warnings at 50%, 80%, and 100%. Leave blank for no limit.`}),(0,F.jsx)(xU,{label:`Session budget (USD)`,value:C,onChange:l,min:.01}),(0,F.jsx)(xU,{label:`Daily budget (USD)`,value:w,onChange:d,min:.01}),(0,F.jsx)(xU,{label:`Weekly budget (USD)`,value:T,onChange:p,min:.01}),(0,F.jsx)(xU,{label:`Retain sessions (days)`,value:E,onChange:h,placeholder:`forever`,min:1}),(0,F.jsx)(`div`,{className:`mt-3 flex items-center gap-3`,children:(0,F.jsx)(kr,{variant:`primary`,size:`md`,onClick:O,disabled:b.isPending,loading:b.isPending,children:b.isPending?`Saving…`:`Save budgets`})}),k(`budgets`)]})]})}function EU({pct:e,exceeded:t}){let n=e??0;return(0,F.jsx)(`div`,{className:`w-24 h-1.5 bg-surface-5 rounded-full overflow-hidden`,children:(0,F.jsx)(`div`,{className:`h-full rounded-full ${t?`bg-accent-red`:n>=80?`bg-accent-amber`:`bg-accent-green`}`,style:{width:`${Math.min(n,100)}%`}})})}function DU({label:e,p:t}){return(0,F.jsxs)(`div`,{className:`flex items-center gap-3 py-1.5`,children:[(0,F.jsx)(`span`,{className:`text-xs text-ink-muted w-20 shrink-0 capitalize`,children:e}),(0,F.jsx)(EU,{pct:t.pctUsed,exceeded:t.exceeded}),(0,F.jsxs)(`span`,{className:`text-xs tabular-nums text-ink-base`,children:[`$`,t.spentUsd.toFixed(4),t.budgetUsd===null?``:` / $${t.budgetUsd.toFixed(2)}`,t.pctUsed===null?``:` (${t.pctUsed.toFixed(0)}%)`]}),t.exceeded&&(0,F.jsx)(Nr,{tone:`danger`,size:`sm`,children:`exceeded`})]})}function OU(){let e=Xe(),t=I({queryKey:L.budget,queryFn:()=>nr(),refetchInterval:1e4}),n=I({queryKey:L.settings,queryFn:()=>vr()}),r=t.data,i=n.data,[a,o]=(0,P.useState)({}),[s,c]=(0,P.useState)(!1),[l,u]=(0,P.useState)(void 0),[d,f]=(0,P.useState)(null),[p,m]=(0,P.useState)(null),h=dt({mutationFn:e=>br(e),onSuccess:()=>void e.invalidateQueries({queryKey:L.settings})}),g=dt({mutationFn:()=>xr(),onSuccess:e=>{let t=e.content?.[0]?.text??``;try{let e=JSON.parse(t);m(e.ok?`Digest sent.`:e.error??`Failed to send.`)}catch{m(`Done.`)}setTimeout(()=>m(null),4e3)},onError:e=>{m(`Error: ${String(e)}`)}});function _(){Object.keys(a).length!==0&&h.mutate({alerts:{personal:a}},{onSuccess:()=>{c(!0),setTimeout(()=>c(!1),3e3)}})}function v(){let e={};l!==void 0&&(e.digestWebhookUrl=l),d!==null&&(e.digestSchedule=d??i?.digestSchedule),h.mutate(e)}function y(e){return a[e]??i?.alerts.personal[e]??0}function b(e,t,n={}){return(0,F.jsxs)(`div`,{className:`flex items-center gap-3 py-1.5`,children:[(0,F.jsx)(`label`,{className:`text-xs text-ink-muted w-44 shrink-0`,children:e}),(0,F.jsx)(`input`,{type:`number`,value:y(t),min:n.min,max:n.max,step:n.step??`any`,onChange:e=>o(n=>({...n,[t]:Number(e.target.value)})),className:`text-xs bg-surface-3 border border-border-subtle rounded-md px-2 py-1 w-24 focus:outline-none focus:border-accent-green text-ink-base`})]})}return(0,F.jsxs)(`section`,{children:[(0,F.jsx)(`header`,{className:`mb-6`,children:(0,F.jsx)(`h1`,{className:`text-xl font-semibold gradient-text`,children:`Alerts`})}),(0,F.jsxs)(R,{padding:`md`,className:`mb-4`,children:[(0,F.jsx)(zr,{title:`Budget Status`}),t.isLoading&&(0,F.jsx)(Li,{icon:`clock`,variant:`loading`,title:`Loading...`}),r&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(DU,{label:`session`,p:r.session}),(0,F.jsx)(DU,{label:`daily`,p:r.daily}),(0,F.jsx)(DU,{label:`weekly`,p:r.weekly}),r.alerts.length>0&&(0,F.jsxs)(`div`,{className:`mt-3 border-t border-border-subtle pt-3`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Recent Warnings`}),(0,F.jsx)(`div`,{className:`flex flex-col gap-1`,children:r.alerts.slice(-5).reverse().map((e,t)=>(0,F.jsxs)(`div`,{className:`text-xs text-ink-subtle flex gap-2`,children:[(0,F.jsxs)(`span`,{className:`text-accent-amber tabular-nums`,children:[e.thresholdPct,`%`]}),(0,F.jsx)(`span`,{className:`capitalize`,children:e.period}),(0,F.jsxs)(`span`,{className:`text-ink-muted tabular-nums`,children:[`$`,e.spentUsd.toFixed(4),` / $`,e.budgetUsd.toFixed(2)]}),(0,F.jsx)(`span`,{className:`text-ink-muted ml-auto tabular-nums`,children:new Date(e.timestamp).toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})})]},t))})]}),r.alerts.length===0&&r.session.budgetUsd===null&&r.daily.budgetUsd===null&&r.weekly.budgetUsd===null&&(0,F.jsxs)(`p`,{className:`text-xs text-ink-muted mt-2`,children:[`No budget caps configured.`,` `,(0,F.jsx)(Qt,{href:`/settings`,className:`text-accent-cyan hover:underline transition-colors duration-150`,children:`Set limits in Settings`}),` `,`to enable warnings.`]})]})]}),(0,F.jsxs)(R,{padding:`md`,className:`mb-4`,children:[(0,F.jsx)(zr,{title:`Alert Thresholds`,subtitle:"Thresholds used by the `deploy-alerts` CLI (`npm run deploy:alerts`) when templating cloud alert conditions. Have no effect on this dashboard or any running session."}),n.isLoading&&(0,F.jsx)(Li,{icon:`clock`,variant:`loading`,title:`Loading...`}),i&&(0,F.jsxs)(F.Fragment,{children:[b(`Daily cost ($)`,`dailyCostUsd`,{min:0,step:.1}),b(`Session cost ($)`,`sessionCostUsd`,{min:0,step:.1}),b(`Min efficiency score (0–1)`,`efficiencyScoreMin`,{min:0,max:1,step:.05}),b(`Max anti-patterns`,`antiPatternCountMax`,{min:0,step:1}),b(`Max stuck loops`,`stuckLoopCountMax`,{min:0,step:1}),(0,F.jsxs)(`div`,{className:`mt-3 flex items-center gap-3`,children:[(0,F.jsx)(kr,{variant:`primary`,size:`md`,onClick:_,disabled:h.isPending||Object.keys(a).length===0,loading:h.isPending,children:h.isPending?`Saving…`:`Save thresholds`}),s&&(0,F.jsx)(`span`,{className:`text-xs text-accent-amber`,children:"Saved. Run `npm run deploy:alerts` to apply these to your cloud alert conditions."})]})]})]}),(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Slack Digest`,subtitle:`Weekly digest sent to a Slack incoming webhook. URL changes take effect immediately.`}),i&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`flex items-center gap-2 mb-3`,children:(0,F.jsx)(Nr,{tone:i.digestWebhookUrl?`success`:`neutral`,size:`sm`,children:i.digestWebhookUrl?`Configured`:`Not configured`})}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3 py-1.5`,children:[(0,F.jsx)(`label`,{className:`text-xs text-ink-muted w-28 shrink-0`,children:`Webhook URL`}),(0,F.jsx)(`input`,{type:`url`,value:l===void 0?i.digestWebhookUrl??``:l??``,placeholder:`https://hooks.slack.com/...`,onChange:e=>u(e.target.value===``?null:e.target.value),className:`text-xs bg-surface-3 border border-border-subtle rounded-md px-2 py-1 w-72 focus:outline-none focus:border-accent-green text-ink-base placeholder:text-ink-muted`})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3 py-1.5`,children:[(0,F.jsxs)(`label`,{className:`text-xs text-ink-muted w-28 shrink-0`,children:[`Schedule`,(0,F.jsx)(`span`,{className:`block text-[10px] text-ink-muted font-normal`,children:`(cron, restart req.)`})]}),(0,F.jsx)(`input`,{type:`text`,value:d??i.digestSchedule,onChange:e=>f(e.target.value),className:`text-xs bg-surface-3 border border-border-subtle rounded-md px-2 py-1 w-36 focus:outline-none focus:border-accent-green text-ink-base font-mono`}),(0,F.jsx)(`span`,{className:`text-[10px] text-ink-muted`,children:`default: Mon 9am`})]}),(0,F.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 flex-wrap`,children:[(0,F.jsx)(kr,{variant:`primary`,size:`md`,onClick:v,disabled:h.isPending,loading:h.isPending,children:h.isPending?`Saving…`:`Save`}),i.digestWebhookUrl&&(0,F.jsx)(kr,{variant:`danger`,size:`md`,onClick:()=>h.mutate({digestWebhookUrl:null},{onSuccess:()=>u(void 0)}),disabled:h.isPending,children:`Unsubscribe`}),(0,F.jsx)(kr,{variant:`secondary`,size:`md`,onClick:()=>g.mutate(),disabled:g.isPending||!i.digestWebhookUrl,loading:g.isPending,children:g.isPending?`Sending…`:`Send test now`}),p&&(0,F.jsx)(`span`,{className:`text-xs text-ink-subtle`,children:p})]})]})]})]})}function kU(){mi();let e=zn(e=>e.connected),[t,n]=Kt(),[r,i]=(0,P.useState)(!1),{theme:a,toggleTheme:o}=yi(),s=(0,P.useCallback)(()=>i(e=>!e),[]),c=(0,P.useCallback)(()=>i(!1),[]);return hi({navigate:n,onToggleHelp:s,onToggleTheme:o}),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`flex flex-col h-full mesh-bg`,children:[(0,F.jsx)(si,{}),(0,F.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,F.jsx)(Wr,{currentPath:t,onNavigate:n,connected:e,theme:a,onToggleTheme:o}),(0,F.jsx)(`main`,{className:`flex-1 overflow-auto p-6`,children:(0,F.jsx)(ci,{resetKey:t,children:(0,F.jsxs)(en,{children:[(0,F.jsx)(Zt,{path:`/sessions`,component:$a}),(0,F.jsx)(Zt,{path:`/history`,component:ZH}),(0,F.jsx)(Zt,{path:`/audit`,component:dU}),(0,F.jsx)(Zt,{path:`/git`,component:yU}),(0,F.jsx)(Zt,{path:`/settings`,component:TU}),(0,F.jsx)(Zt,{path:`/alerts`,component:OU}),(0,F.jsx)(Zt,{path:`/`,component:wa}),(0,F.jsx)(Zt,{children:(0,F.jsx)(`div`,{className:`text-ink-muted`,children:`Not found`})})]})})})]})]}),(0,F.jsx)(ui,{open:r,onClose:c})]})}var AU=new ze({defaultOptions:{queries:{staleTime:5e3,retry:0,refetchOnWindowFocus:!1}}}),jU=document.getElementById(`root`);if(!jU)throw Error(`Mount node #root not found`);(0,ft.createRoot)(jU).render((0,F.jsx)(P.StrictMode,{children:(0,F.jsx)(Ze,{client:AU,children:(0,F.jsx)(kU,{})})}));
63
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _H(e,t){if(e){if(typeof e==`string`)return vH(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vH(e,t):void 0}}function vH(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yH(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function bH(e){if(Array.isArray(e))return e}var xH=(0,P.createContext)(void 0),SH=e=>{var t=e.children,n=hH((0,P.useState)(`${Vo(`recharts`)}-clip`),1)[0],r=OF();if(r==null)return null;var i=r.x,a=r.y,o=r.width,s=r.height;return P.createElement(xH.Provider,{value:n},P.createElement(`defs`,null,P.createElement(`clipPath`,{id:n},P.createElement(`rect`,{x:i,y:a,height:s,width:o}))),t)},CH=[`width`,`height`,`responsive`,`children`,`className`,`style`,`compact`,`title`,`desc`];function wH(e,t){if(e==null)return{};var n,r,i=TH(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function TH(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var EH=(0,P.forwardRef)((e,t)=>{var n=e.width,r=e.height,i=e.responsive,a=e.children,o=e.className,s=e.style,c=e.compact,l=e.title,u=e.desc,d=Wm(wH(e,CH));return c?P.createElement(P.Fragment,null,P.createElement(Cm,{width:n,height:r}),P.createElement(BV,{otherAttributes:d,title:l,desc:u},a)):P.createElement(mH,{className:o,style:s,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},P.createElement(BV,{otherAttributes:d,title:l,desc:u,ref:t},P.createElement(SH,null,a)))});function DH(){return DH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},DH.apply(null,arguments)}function OH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kH(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?OH(Object(n),!0).forEach(function(t){AH(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OH(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function AH(e,t,n){return(t=jH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jH(e){var t=MH(e,`string`);return typeof t==`symbol`?t:t+``}function MH(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var NH=kH({accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,layout:`horizontal`,margin:{top:5,right:5,bottom:5,left:5},responsive:!1,reverseStackOrder:!1,stackOffset:`none`,syncMethod:`index`},mV),PH=(0,P.forwardRef)(function(e,t){var n=Eh(e.categoricalChartProps,NH),r=e.chartName,i=e.defaultTooltipEventType,a=e.validateTooltipEventTypes,o=e.tooltipPayloadSearcher,s=e.categoricalChartProps,c={chartName:r,defaultTooltipEventType:i,validateTooltipEventTypes:a,tooltipPayloadSearcher:o,eventEmitter:void 0};return P.createElement(bV,{preloadedState:{options:c},reduxStoreName:s.id??r},P.createElement(xV,{chartData:s.data}),P.createElement(CV,{layout:n.layout,margin:n.margin}),P.createElement(TV,{throttleDelay:n.throttleDelay,throttledEvents:n.throttledEvents}),P.createElement(wV,{baseValue:n.baseValue,accessibilityLayer:n.accessibilityLayer,barCategoryGap:n.barCategoryGap,maxBarSize:n.maxBarSize,stackOffset:n.stackOffset,barGap:n.barGap,barSize:n.barSize,syncId:n.syncId,syncMethod:n.syncMethod,className:n.className,reverseStackOrder:n.reverseStackOrder}),P.createElement(EH,DH({},n,{ref:t})))}),FH=[`axis`,`item`],IH=(0,P.forwardRef)((e,t)=>P.createElement(PH,{chartName:`BarChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:FH,tooltipPayloadSearcher:NA,categoricalChartProps:e,ref:t})),LH=[`axis`],RH=(0,P.forwardRef)((e,t)=>P.createElement(PH,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:LH,tooltipPayloadSearcher:NA,categoricalChartProps:e,ref:t})),zH={fill:`var(--color-ink-muted)`,fontSize:10},BH=`var(--color-border-subtle)`,VH={background:`var(--color-bg-elevated)`,border:`1px solid var(--color-border-medium)`,borderRadius:8,fontSize:12,color:`var(--color-ink-base)`},HH=`var(--color-accent-green)`,UH=`var(--color-accent-amber)`,WH=`var(--color-accent-green)`,GH=`var(--color-accent-purple)`,KH=`var(--color-accent-blue)`,qH=`var(--color-accent-teal)`;function JH(e){return e===`Read`?KH:e===`Edit`||e===`Write`?WH:e===`Bash`?GH:e===`Agent`?qH:`var(--color-ink-muted)`}function YH(e){let t=e.toLowerCase();return t===`bug fix`||t===`fix`?`#FF6B6B`:t===`feature`?WH:t===`refactor`?KH:t===`configuration`||t===`config`?UH:t===`test`?qH:t===`docs`?`#C4B5FD`:GH}function XH(e){return typeof e==`string`&&e.length>=10?e.slice(5,10):e}function ZH(){let e=I({queryKey:L.weekly,queryFn:tr}),t=I({queryKey:L.sessionsList(200),queryFn:()=>Jn(200)}),n=I({queryKey:L.costPerOutcome(30),queryFn:()=>ir(30)}),r=I({queryKey:L.personalCoach,queryFn:ar}),i=I({queryKey:L.activityHeatmap(`history`),queryFn:()=>mr(`history`,12)}),a=I({queryKey:L.concurrencyHistory(30),queryFn:()=>pr(30)}),o=[...e.data??[]].reverse(),s=o.map(e=>{let t=e.avgEfficiencyScore;return{week:e.week||`?`,efficiency:t===null?null:Math.round(t*100)}}),c=nU(eU(t.data??[],30),30),l=tU(n.data),u=rU(o),d=aU(t.data??[]),f=oU(t.data??[]),p=a.data?.dailyPeaks??[],m=p.some(e=>e.peak>0);return(0,F.jsxs)(`section`,{children:[(0,F.jsx)(ia,{theme:`history`}),(0,F.jsx)(`h1`,{className:`text-xl font-semibold gradient-text mb-4`,children:`History`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,F.jsx)(QH,{title:`Weekly Efficiency · Last 12`,children:(0,F.jsx)(`div`,{className:`h-44 min-w-0`,children:(0,F.jsx)(dm,{width:`100%`,height:`100%`,minWidth:1,minHeight:1,children:(0,F.jsxs)(RH,{data:s,children:[(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`effGradient`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:HH,stopOpacity:.3}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:HH,stopOpacity:0})]})}),(0,F.jsx)(AP,{stroke:BH,strokeDasharray:`3 3`}),(0,F.jsx)(oB,{dataKey:`week`,tick:zH,stroke:BH,tickFormatter:XH}),(0,F.jsx)(xB,{tick:zH,stroke:BH,domain:[0,100],unit:`%`}),(0,F.jsx)(gj,{contentStyle:VH}),(0,F.jsx)(tR,{type:`monotone`,dataKey:`efficiency`,stroke:HH,strokeWidth:2,fill:`url(#effGradient)`,dot:{r:2,fill:HH}})]})})})}),(0,F.jsx)(QH,{title:`Daily Spend · Last 30 Days (most recent 200)`,children:(0,F.jsx)(`div`,{className:`h-44 min-w-0`,children:(0,F.jsx)(dm,{width:`100%`,height:`100%`,minWidth:1,minHeight:1,children:(0,F.jsxs)(IH,{data:c,children:[(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`costGradient`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:HH,stopOpacity:.9}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:HH,stopOpacity:.4})]})}),(0,F.jsx)(AP,{stroke:BH,strokeDasharray:`3 3`}),(0,F.jsx)(oB,{dataKey:`day`,tick:zH,stroke:BH,tickFormatter:XH,interval:`preserveStartEnd`,minTickGap:20}),(0,F.jsx)(xB,{tick:zH,stroke:BH,unit:`$`}),(0,F.jsx)(gj,{contentStyle:VH,labelFormatter:XH,cursor:!1}),(0,F.jsx)(zz,{dataKey:`cost`,fill:`url(#costGradient)`,radius:[3,3,0,0]})]})})})}),(0,F.jsx)(QH,{title:`Cost Per Outcome · Last 30 Days`,children:l.length===0?(0,F.jsx)(Li,{icon:`radar`,title:`No outcomes yet`,subtitle:`Finish a few sessions and check back.`}):(0,F.jsx)(`div`,{className:`min-w-0`,style:{height:`${Math.max(176,l.length*32+40)}px`},children:(0,F.jsx)(dm,{width:`100%`,height:`100%`,minWidth:1,minHeight:1,children:(0,F.jsxs)(IH,{data:l,layout:`vertical`,children:[(0,F.jsx)(AP,{stroke:BH,strokeDasharray:`3 3`}),(0,F.jsx)(oB,{type:`number`,tick:zH,stroke:BH,unit:`$`}),(0,F.jsx)(xB,{type:`category`,dataKey:`outcome`,tick:zH,stroke:BH,width:110}),(0,F.jsx)(gj,{contentStyle:VH}),(0,F.jsx)(zz,{dataKey:`totalCost`,radius:[0,3,3,0],children:l.map(e=>(0,F.jsx)(_j,{fill:YH(e.outcome),fillOpacity:.8},e.outcome))})]})})})}),(0,F.jsx)(QH,{title:`Anti-Pattern Frequency · Weekly`,children:u.length===0?(0,F.jsx)(Li,{icon:`checkmark`,title:`No anti-patterns detected`,subtitle:`No anti-patterns detected in the loaded weeks.`}):(0,F.jsx)(`div`,{className:`h-44 min-w-0`,children:(0,F.jsx)(dm,{width:`100%`,height:`100%`,minWidth:1,minHeight:1,children:(0,F.jsxs)(IH,{data:u,children:[(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`antiPatternGradient`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:UH,stopOpacity:.9}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:UH,stopOpacity:.4})]})}),(0,F.jsx)(AP,{stroke:BH,strokeDasharray:`3 3`}),(0,F.jsx)(oB,{dataKey:`week`,tick:zH,stroke:BH,tickFormatter:XH}),(0,F.jsx)(xB,{tick:zH,stroke:BH}),(0,F.jsx)(gj,{contentStyle:VH}),(0,F.jsx)(zz,{dataKey:`count`,fill:`url(#antiPatternGradient)`,radius:[3,3,0,0]})]})})})}),(0,F.jsx)(QH,{title:`Model Performance`,children:d.length===0?(0,F.jsx)(Li,{icon:`radar`,title:`No model data yet`,subtitle:`Complete a few sessions to see model performance.`}):(0,F.jsxs)(`div`,{className:`h-44 overflow-y-auto text-xs`,children:[(0,F.jsxs)(`table`,{className:`w-full`,children:[(0,F.jsx)(`thead`,{className:`text-ink-muted sticky top-0 bg-bg-panel`,children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{className:`text-left pb-1`,children:`Model`}),(0,F.jsx)(`th`,{className:`text-right pb-1`,children:`Sessions`}),(0,F.jsx)(`th`,{className:`text-right pb-1`,children:`Eff.`}),(0,F.jsx)(`th`,{className:`text-right pb-1`,children:`Success`}),(0,F.jsx)(`th`,{className:`text-right pb-1`,children:`Avg $`})]})}),(0,F.jsx)(`tbody`,{children:d.map(e=>(0,F.jsxs)(`tr`,{className:`border-t border-bg-line`,children:[(0,F.jsx)(`td`,{className:`py-1 font-medium`,children:e.model}),(0,F.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:e.sessions}),(0,F.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:e.avgEfficiency===null?`—`:`${Math.min(100,Math.round(e.avgEfficiency*100))}%`}),(0,F.jsx)(`td`,{className:`py-1 text-right tabular-nums ${e.flagged?`text-accent-amber`:``}`,children:e.avgSuccessRate===null?`—`:`${Math.min(100,Math.round(e.avgSuccessRate*100))}%`}),(0,F.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:e.avgCost===null?`—`:`$${e.avgCost.toFixed(2)}`})]},e.model))})]}),d.some(e=>e.flagged)&&(0,F.jsx)(`div`,{className:`text-accent-amber text-[10px] mt-1`,children:`⚠ Highlighted models had sessions with elevated error rates`})]})}),(0,F.jsx)(QH,{title:`Top Tools · Most Recent 200 Sessions`,children:f.length===0?(0,F.jsx)(Li,{icon:`code`,title:`No tool data yet`,subtitle:`Tool usage data will appear after coding sessions.`}):(0,F.jsx)(`div`,{className:`min-w-0`,style:{height:`${Math.max(176,f.length*28+40)}px`},children:(0,F.jsx)(dm,{width:`100%`,height:`100%`,minWidth:1,minHeight:1,children:(0,F.jsxs)(IH,{data:f,layout:`vertical`,children:[(0,F.jsx)(AP,{stroke:BH,strokeDasharray:`3 3`}),(0,F.jsx)(oB,{type:`number`,tick:zH,stroke:BH}),(0,F.jsx)(xB,{type:`category`,dataKey:`tool`,tick:zH,tickFormatter:Qr,stroke:BH,width:120}),(0,F.jsx)(gj,{contentStyle:VH,labelFormatter:Qr}),(0,F.jsx)(zz,{dataKey:`count`,radius:[0,3,3,0],children:f.map(e=>(0,F.jsx)(_j,{fill:JH(Qr(e.tool)),fillOpacity:.8},e.tool))})]})})})})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 mt-3`,children:[i.data&&i.data.days.length>0&&(0,F.jsx)(QH,{title:`Activity · Last 12 Weeks`,children:(0,F.jsx)(ea,{variant:`grid`,buckets:[],maxCount:i.data.maxCount,days:i.data.days,ariaLabel:`Daily activity heatmap for the last 12 weeks`})}),(0,F.jsxs)(R,{padding:`md`,className:`flex flex-col`,children:[(0,F.jsxs)(z,{className:`mb-3`,children:[`Peak Concurrent Sessions · Last 30 Days`,m&&`: ${Math.max(...p.map(e=>e.peak))}`]}),m?(0,F.jsx)(`div`,{className:`flex-1 flex items-end justify-center`,children:(0,F.jsx)(sU,{data:p})}):(0,F.jsx)(Li,{icon:`code`,title:`No concurrent sessions yet`,subtitle:`Run two or more Claude Code sessions at the same time to populate this chart.`})]})]}),(0,F.jsx)(`div`,{className:`mt-3`,children:(0,F.jsx)($H,{data:r.data})})]})}function QH({title:e,children:t}){return(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(z,{children:e}),(0,F.jsx)(`div`,{className:`mt-3`,children:t})]})}function $H({data:e}){return e?e.status===`insufficient_data`?(0,F.jsx)(QH,{title:`Personal Coach`,children:(0,F.jsx)(`div`,{className:`text-ink-muted text-xs`,children:e.message})}):(0,F.jsx)(QH,{title:`Personal coach`,children:(0,F.jsxs)(`div`,{className:`text-xs space-y-2`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-accent-cyan font-semibold`,children:`Top recommendation: `}),e.topRecommendation]}),e.highlights.length>0&&(0,F.jsx)(`ul`,{className:`list-disc list-inside text-accent-green`,children:e.highlights.map(e=>(0,F.jsx)(`li`,{children:e},`hl-${e}`))}),e.regressions.length>0&&(0,F.jsx)(`ul`,{className:`list-disc list-inside text-accent-amber`,children:e.regressions.map(e=>(0,F.jsx)(`li`,{children:e},`rg-${e}`))}),e.streaks.length>0&&(0,F.jsx)(`ul`,{className:`list-disc list-inside text-ink-muted`,children:e.streaks.map(e=>(0,F.jsx)(`li`,{children:e},`st-${e}`))})]})}):(0,F.jsx)(QH,{title:`Personal Coach`,children:(0,F.jsx)(Li,{variant:`loading`,title:`Loading coaching insights…`})})}function eU(e,t){let n=new Map;for(let t of e){if(t.estimatedCostUsd==null||t.startTime==null)continue;let e=new Date(t.startTime),r=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`;n.set(r,(n.get(r)??0)+t.estimatedCostUsd)}return Array.from(n.entries()).sort((e,t)=>e[0].localeCompare(t[0])).slice(-t).map(([e,t])=>({day:e,cost:Number(t.toFixed(2))}))}function tU(e){return e?Object.entries(e.outcomeDistribution).map(([e,t])=>({outcome:e.replace(/_/g,` `),totalCost:Number(t.totalCost.toFixed(2)),count:t.count})).filter(e=>e.totalCost>0).sort((e,t)=>t.totalCost-e.totalCost):[]}function nU(e,t,n=new Date){let r=new Map(e.map(e=>[e.day,e.cost])),i=[];for(let e=t-1;e>=0;e--){let t=new Date(n);t.setDate(t.getDate()-e);let a=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`;i.push({day:a,cost:r.get(a)??0})}return i}function rU(e){let t=[];for(let n of e){let e=n.antiPatternCounts??{},r=Object.values(e).reduce((e,t)=>e+t,0);r>0&&t.push({week:n.week||`?`,count:r})}return t}var iU=.85;function aU(e){let t=new Map;for(let n of e){let e=n.model??`unknown`,r=t.get(e);r||(r={sessions:0,effSum:0,effCount:0,successSum:0,successCount:0,costSum:0,costCount:0,lowSuccessSessions:0},t.set(e,r)),r.sessions++,n.efficiencyScore!=null&&(r.effSum+=n.efficiencyScore,r.effCount++),n.toolSuccessRate!=null&&(r.successSum+=n.toolSuccessRate,r.successCount++,n.toolSuccessRate<iU&&r.lowSuccessSessions++),n.estimatedCostUsd!=null&&(r.costSum+=n.estimatedCostUsd,r.costCount++)}let n=[];for(let[e,r]of t)n.push({model:e,sessions:r.sessions,avgEfficiency:r.effCount>0?r.effSum/r.effCount:null,avgSuccessRate:r.successCount>0?r.successSum/r.successCount:null,avgCost:r.costCount>0?r.costSum/r.costCount:null,flagged:r.lowSuccessSessions>0});return n.sort((e,t)=>t.sessions-e.sessions)}function oU(e){let t=new Map;for(let n of e)if(n.toolBreakdown)for(let[e,r]of Object.entries(n.toolBreakdown))t.set(e,(t.get(e)??0)+r);return Array.from(t.entries()).map(([e,t])=>({tool:e,count:t})).sort((e,t)=>t.count-e.count).slice(0,8)}function sU({data:e}){return(0,F.jsx)(Ki,{data:e.map(e=>({count:e.peak,tooltip:`${e.date.slice(5)}: ${e.peak}`})),ariaLabel:`Peak concurrent sessions over ${e.length} days`})}var cU=[{key:`all`,label:`All`},{key:`sensitive_file`,label:`Sensitive files`},{key:`destructive_command`,label:`Destructive`},{key:`external_network`,label:`External network`}],lU={critical:`danger`,high:`warning`,medium:`info`};function uU(e){let t=e.map(e=>JSON.stringify(e)).join(`
64
+ `),n=new Blob([t],{type:`application/x-ndjson`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`audit-${new Date().toISOString().slice(0,10)}.jsonl`,i.rel=`noopener`,document.body.appendChild(i);try{i.click()}finally{document.body.removeChild(i),URL.revokeObjectURL(r)}}function dU(){let[e,t]=(0,P.useState)(`all`),{data:n,isLoading:r,error:i}=I({queryKey:L.audit,queryFn:()=>er()}),a=n??[],o=e===`all`?a:a.filter(t=>t.classification===e),s=o.slice(0,200);return(0,F.jsxs)(`section`,{children:[(0,F.jsx)(ia,{theme:`audit`}),(0,F.jsxs)(`header`,{className:`flex items-baseline justify-between mb-4`,children:[(0,F.jsx)(`h1`,{className:`text-xl font-semibold gradient-text`,children:`Audit`}),(0,F.jsx)(kr,{variant:`secondary`,size:`md`,onClick:()=>uU(s),children:`Export JSONL`})]}),(0,F.jsx)(`div`,{className:`flex gap-2 mb-3 flex-wrap`,children:cU.map(({key:n,label:r})=>(0,F.jsx)(kr,{variant:e===n?`primary`:`secondary`,size:`sm`,onClick:()=>t(n),children:r},n))}),r&&(0,F.jsx)(Li,{icon:`clock`,variant:`loading`,title:`Loading...`}),i&&(0,F.jsx)(`div`,{className:`text-accent-red text-xs`,children:`Error loading audit log.`}),!r&&!i&&o.length>200&&(0,F.jsxs)(`div`,{className:`text-[11px] text-ink-muted mb-2`,children:[`Showing first `,200,` of `,o.length,` entries.`]}),!r&&!i&&(0,F.jsx)(R,{padding:`sm`,tone:`static`,className:`overflow-hidden`,children:(0,F.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,F.jsx)(`thead`,{className:`text-ink-muted bg-surface-3`,children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{className:`text-left p-2`,children:`When`}),(0,F.jsx)(`th`,{className:`text-left p-2`,children:`Tool`}),(0,F.jsx)(`th`,{className:`text-left p-2`,children:`Target`}),(0,F.jsx)(`th`,{className:`text-left p-2`,children:`Classification`}),(0,F.jsx)(`th`,{className:`text-left p-2`,children:`Session`})]})}),(0,F.jsxs)(`tbody`,{children:[o.length===0&&(0,F.jsx)(`tr`,{children:(0,F.jsx)(`td`,{colSpan:5,className:`p-3 text-ink-muted text-center`,children:`No matching entries.`})}),s.map(e=>(0,F.jsxs)(`tr`,{className:`border-t border-border-subtle`,children:[(0,F.jsx)(`td`,{className:`p-2 tabular-nums`,children:new Date(e.ts).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}),(0,F.jsx)(`td`,{className:`p-2`,children:e.tool}),(0,F.jsx)(`td`,{className:`p-2 font-mono text-[11px]`,children:e.target}),(0,F.jsx)(`td`,{className:`p-2`,children:(0,F.jsx)(Nr,{tone:e.severity?lU[e.severity]??`neutral`:`neutral`,size:`sm`,children:e.classification})}),(0,F.jsx)(`td`,{className:`p-2 text-ink-subtle`,children:e.sessionId??`—`})]},`${e.ts}-${e.tool}-${e.target}`))]})]})})]})}var fU={info:`border-l-accent-blue bg-accent-blue/5`,warning:`border-l-accent-amber bg-accent-amber/5`,critical:`border-l-accent-red bg-accent-red/5`},pU={info:`info`,warning:`warning`,critical:`danger`},mU={resolved:`text-accent-green`,aborted:`text-accent-red`,pending:`text-accent-amber`},hU={merge_conflict:`bg-accent-red/20 text-accent-red`,rebase_conflict:`bg-accent-red/20 text-accent-red`,merge_abort:`bg-accent-amber/20 text-accent-amber`,rebase_abort:`bg-accent-amber/20 text-accent-amber`,force_push:`bg-accent-red/20 text-accent-red`,reset_hard:`bg-accent-amber/20 text-accent-amber`,commit:`bg-accent-green/20 text-accent-green`,push:`bg-accent-blue/20 text-accent-blue`,pull:`bg-accent-blue/20 text-accent-blue`};function gU(e){return e===null?`—`:e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function _U(e){return e.replace(/_/g,` `)}function vU({score:e}){if(e===null)return(0,F.jsx)(`div`,{className:`flex items-center justify-center w-20 h-20 rounded-full border-4 border-border-medium`,children:(0,F.jsx)(`span`,{className:`text-ink-muted text-xs`,children:`N/A`})});let t=Math.max(0,Math.min(100,e)),[n,r]=t>=80?[`text-accent-green`,`border-accent-green`]:t>=60?[`text-accent-amber`,`border-accent-amber`]:[`text-accent-red`,`border-accent-red`],i=2*Math.PI*34,a=i-t/100*i;return(0,F.jsxs)(`div`,{className:`relative w-20 h-20`,children:[(0,F.jsxs)(`svg`,{className:`w-20 h-20 -rotate-90`,viewBox:`0 0 80 80`,children:[(0,F.jsx)(`circle`,{cx:`40`,cy:`40`,r:`34`,fill:`none`,stroke:`rgba(255,255,255,0.08)`,strokeWidth:`6`}),(0,F.jsx)(`circle`,{cx:`40`,cy:`40`,r:`34`,fill:`none`,className:r,stroke:`currentColor`,strokeWidth:`6`,strokeLinecap:`round`,strokeDasharray:i,strokeDashoffset:a,style:{transition:`stroke-dashoffset 0.8s ease-out`}})]}),(0,F.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center text-lg font-bold ${n}`,children:e})]})}function yU(){let{data:e,isLoading:t,error:n}=I({queryKey:L.gitEfficiency,queryFn:ur,refetchInterval:5e3}),{data:r}=I({queryKey:L.gitEfficiencyRepos,queryFn:dr,refetchInterval:3e4});return t?(0,F.jsx)(Li,{icon:`clock`,variant:`loading`,title:`Loading...`}):n?(0,F.jsx)(`div`,{className:`text-accent-red text-xs`,children:`Error loading git efficiency data.`}):!e||e.totalGitCommands===0?(0,F.jsxs)(F.Fragment,{children:[r&&r.repos.length>0&&(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mb-4`,children:[(0,F.jsx)(z,{as:`div`,className:`mr-1`,children:`Repos Today:`}),r.repos.map(e=>{let t=e.split(`/`).pop()||e;return(0,F.jsx)(Nr,{tone:e===r.currentRepo?`success`:`neutral`,size:`sm`,bordered:!0,className:`font-mono`,children:t},e)})]}),(0,F.jsx)(Li,{icon:`code`,title:`No Git activity yet`,subtitle:`Git efficiency metrics will appear here as git commands are executed during the session.`})]}):(0,F.jsxs)(`section`,{children:[(0,F.jsx)(ia,{theme:`git`}),(0,F.jsxs)(`header`,{className:`flex items-baseline justify-between mb-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h1`,{className:`text-xl font-semibold gradient-text`,children:`Git Efficiency`}),e.repoContext.repoName&&(0,F.jsxs)(`div`,{className:`flex items-center gap-2 mt-1 text-[11px] text-ink-muted`,children:[(0,F.jsx)(`span`,{className:`font-mono`,children:e.repoContext.repoName}),e.repoContext.branch&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`/`}),(0,F.jsx)(`span`,{className:`font-mono text-ink-subtle`,children:e.repoContext.branch})]})]}),(0,F.jsx)(`div`,{className:`mt-1 text-[11px] text-ink-muted`,children:`Today's activity across all sessions`}),r&&r.repos.length>0&&(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mt-2`,children:[(0,F.jsx)(`span`,{className:`text-[10px] text-ink-muted uppercase tracking-wider mr-1`,children:`Repos today:`}),r.repos.map(e=>{let t=e.split(`/`).pop()||e;return(0,F.jsx)(Nr,{tone:e===r.currentRepo?`success`:`neutral`,size:`sm`,bordered:!0,className:`font-mono`,children:t},e)})]})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,F.jsxs)(`div`,{className:`text-center`,children:[(0,F.jsx)(z,{as:`div`,className:`mb-1`,children:`Prevention`}),(0,F.jsx)(vU,{score:e.preventionScore})]}),(0,F.jsxs)(`div`,{className:`text-center`,children:[(0,F.jsx)(z,{as:`div`,className:`mb-1`,children:`Efficiency`}),(0,F.jsx)(vU,{score:e.efficiencyScore})]})]})]}),(0,F.jsx)(Ci,{index:0,className:`mb-3`,children:(0,F.jsx)(R,{padding:`lg`,tone:`elevated`,glow:`green`,children:(0,F.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-4`,children:[(0,F.jsx)(B,{label:`commits today`,hero:!0,value:String(e.commitCount),animate:!0,numericValue:e.commitCount}),(0,F.jsx)(B,{label:`PRs opened`,tone:e.prMetrics.created>0?`good`:`neutral`,value:String(e.prMetrics.created),sub:e.prMetrics.merged>0?`${e.prMetrics.merged} merged`:void 0,animate:!0,numericValue:e.prMetrics.created}),(0,F.jsx)(B,{label:`conflicts`,tone:e.mergeConflicts+e.rebaseConflicts>0?`bad`:`good`,value:String(e.mergeConflicts+e.rebaseConflicts),sub:e.mergeConflicts+e.rebaseConflicts===0?`clean session`:`${e.abortedOperations} aborted`,animate:!0,numericValue:e.mergeConflicts+e.rebaseConflicts}),(0,F.jsx)(B,{label:`behind main`,tone:(e.riskIndicators.commitsBehindMain??0)>20?`bad`:(e.riskIndicators.commitsBehindMain??0)>5?`warn`:`good`,value:e.riskIndicators.commitsBehindMain===null?`—`:String(e.riskIndicators.commitsBehindMain),sub:e.riskIndicators.commitsBehindMain===0?`up to date`:e.riskIndicators.commitsBehindMain!==null&&e.riskIndicators.commitsBehindMain>10?`rebase soon`:void 0,animate:!0,numericValue:e.riskIndicators.commitsBehindMain??0})]})})}),e.bestPractices.length>0&&(0,F.jsx)(Ci,{index:1,className:`mb-3`,children:(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Best Practices`,action:(0,F.jsx)(`span`,{className:`text-[11px] text-ink-muted`,children:(()=>{let t=e.bestPractices.filter(e=>e.status!==`unknown`).length;return t===0?`No data yet`:`${e.bestPractices.filter(e=>e.status===`pass`).length}/${t} passing`})()})}),(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 mb-2`,children:[e.bestPractices.filter(e=>e.status===`pass`).map(e=>(0,F.jsxs)(Nr,{tone:`success`,size:`sm`,bordered:!0,children:[(0,F.jsx)(`span`,{children:`✓`}),` `,e.label]},e.id)),e.bestPractices.filter(e=>e.status===`unknown`).map(e=>(0,F.jsxs)(Nr,{tone:`neutral`,size:`sm`,bordered:!0,children:[(0,F.jsx)(`span`,{children:`●`}),` `,e.label]},e.id))]}),e.bestPractices.filter(e=>e.status===`fail`||e.status===`warn`).map(e=>(0,F.jsxs)(`div`,{className:`flex items-start gap-2 px-2.5 py-2 rounded-lg mt-1.5 ${e.status===`fail`?`bg-accent-red/5 border border-accent-red/20`:`bg-accent-amber/5 border border-accent-amber/20`}`,children:[(0,F.jsx)(`span`,{className:`shrink-0 mt-0.5 text-xs`,children:e.status===`fail`?(0,F.jsx)(`span`,{className:`text-accent-red`,children:`✗`}):(0,F.jsx)(`span`,{className:`text-accent-amber`,children:`⚠`})}),(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`text-xs font-medium text-ink-base`,children:e.label}),(0,F.jsx)(`div`,{className:`text-[11px] text-ink-muted mt-0.5 leading-relaxed`,children:e.detail})]})]},e.id))]})}),(e.mergeConflicts>0||e.rebaseConflicts>0)&&(0,F.jsx)(Ci,{index:2,className:`mb-3`,children:(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Conflict Resolution`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3`,children:[(0,F.jsx)(B,{label:`Resolution rate`,value:e.conflictResolutionRate===null?`—`:`${Math.round(e.conflictResolutionRate*100)}%`}),(0,F.jsx)(B,{label:`Avg resolution time`,value:gU(e.avgConflictResolutionMs)}),(0,F.jsx)(B,{label:`Aborted ops`,value:String(e.abortedOperations)}),(0,F.jsx)(B,{label:`Stale branch pulls`,value:String(e.staleBranchPulls)})]}),e.conflictHistory.length>0&&(0,F.jsxs)(`div`,{className:`mt-3`,children:[(0,F.jsx)(z,{as:`h3`,className:`mb-2`,children:`Conflict History`}),(0,F.jsx)(`div`,{className:`space-y-1`,children:e.conflictHistory.map(e=>(0,F.jsxs)(`div`,{className:`flex items-center gap-3 text-xs py-1 border-t border-border-subtle`,children:[(0,F.jsx)(`span`,{className:`tabular-nums text-ink-subtle w-28 shrink-0`,children:new Date(e.timestamp).toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`,second:`2-digit`})}),(0,F.jsx)(`span`,{className:`font-medium ${mU[e.resolution]}`,children:e.resolution}),(0,F.jsx)(`span`,{className:`text-ink-muted`,children:gU(e.resolutionTimeMs)}),(0,F.jsx)(`span`,{className:`text-ink-subtle font-mono text-[11px] truncate`,children:e.command})]},`${e.timestamp}-${e.command}`))})]})]})}),e.suggestions.length>0&&(0,F.jsx)(Ci,{index:3,className:`mb-3`,children:(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Suggestions`}),(0,F.jsx)(`div`,{className:`space-y-2`,children:e.suggestions.map((e,t)=>(0,F.jsx)(`div`,{className:`border-l-[3px] rounded-r-lg px-3 py-2 ${fU[e.severity]}`,children:(0,F.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,F.jsx)(Nr,{tone:pU[e.severity],size:`sm`,className:`font-semibold`,children:e.severity}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`text-xs text-ink-base`,children:e.message}),(0,F.jsx)(`p`,{className:`text-[11px] text-ink-muted mt-0.5`,children:e.evidence})]})]})},`${e.category}-${e.severity}-${t}`))})]})}),e.commitCount>=2&&(0,F.jsx)(Ci,{index:4,className:`mb-3`,children:(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Velocity & Workflow`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3`,children:[(0,F.jsx)(B,{label:`Avg time between commits`,value:gU(e.velocityMetrics.avgTimeBetweenCommitsMs)}),(0,F.jsx)(B,{label:`Longest gap`,value:gU(e.velocityMetrics.longestGapMs)}),(0,F.jsx)(B,{label:`Commit bursts`,value:String(e.velocityMetrics.commitBurstCount)}),(0,F.jsx)(B,{label:`Worktree ops`,value:String(e.velocityMetrics.worktreeCount)})]}),e.velocityMetrics.buildBeforePush!==null&&(0,F.jsxs)(`div`,{className:`mt-3 text-xs`,children:[(0,F.jsx)(`span`,{className:`text-ink-muted`,children:`Verified before push: `}),e.velocityMetrics.buildBeforePush?(0,F.jsx)(`span`,{className:`text-accent-green`,children:`yes (build/test ran first)`}):(0,F.jsx)(`span`,{className:`text-accent-amber`,children:`no build/test detected before push`})]})]})}),(e.prMetrics.created>0||e.prMetrics.merged>0||e.prMetrics.checksViewed>0)&&(0,F.jsx)(Ci,{index:5,className:`mb-3`,children:(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Pull Requests`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3`,children:[(0,F.jsx)(B,{label:`PRs created`,value:String(e.prMetrics.created),tone:e.prMetrics.created>0?`good`:`neutral`}),(0,F.jsx)(B,{label:`PRs merged`,value:String(e.prMetrics.merged),tone:e.prMetrics.merged>0?`good`:`neutral`}),(0,F.jsx)(B,{label:`CI checks viewed`,value:String(e.prMetrics.checksViewed)}),(0,F.jsx)(B,{label:`Time to PR`,value:gU(e.prMetrics.avgTimeToCreateMs)})]}),e.prMetrics.prActivity.length>0&&(0,F.jsxs)(`div`,{className:`mt-3`,children:[(0,F.jsx)(z,{as:`h3`,className:`mb-2`,children:`Activity`}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.prMetrics.prActivity.map(e=>(0,F.jsxs)(Nr,{tone:e.action===`create`?`success`:e.action===`merge`?`info`:`neutral`,size:`sm`,children:[e.action,e.prNumber?` #${e.prNumber}`:``]},`${e.timestamp}-${e.action}`))})]})]})}),e.conflictResolutionStrategy.totalResolutions>0&&(0,F.jsx)(Ci,{index:6,className:`mb-3`,children:(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Conflict Resolution Strategy`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3`,children:[(0,F.jsx)(B,{label:`Accept ours`,value:String(e.conflictResolutionStrategy.oursCount)}),(0,F.jsx)(B,{label:`Accept theirs`,value:String(e.conflictResolutionStrategy.theirsCount)}),(0,F.jsx)(B,{label:`Manual merge`,value:String(e.conflictResolutionStrategy.manualMergeCount)}),(0,F.jsx)(B,{label:`Cherry-picks`,value:String(e.conflictResolutionStrategy.cherryPickCount)})]})]})}),(e.resetHards>0||e.discardedChanges>0||e.forcePushes>0)&&(0,F.jsx)(Ci,{index:7,className:`mb-3`,children:(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Destructive Operations`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,F.jsx)(B,{label:`Hard resets`,value:String(e.resetHards)}),(0,F.jsx)(B,{label:`Discarded changes`,value:String(e.discardedChanges)}),(0,F.jsx)(B,{label:`Force pushes`,value:String(e.forcePushes)})]})]})}),(0,F.jsx)(Ci,{index:8,children:(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Recent Git Activity`}),(0,F.jsx)(`div`,{className:`max-h-64 overflow-auto`,children:(0,F.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,F.jsx)(`thead`,{className:`text-ink-muted bg-surface-3 sticky top-0`,children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{className:`text-left p-2`,children:`Time`}),(0,F.jsx)(`th`,{className:`text-left p-2`,children:`Type`}),(0,F.jsx)(`th`,{className:`text-left p-2`,children:`Duration`}),(0,F.jsx)(`th`,{className:`text-left p-2`,children:`Status`})]})}),(0,F.jsx)(`tbody`,{children:[...e.gitCommandTimeline].reverse().slice(0,30).map(e=>(0,F.jsxs)(`tr`,{className:`border-t border-border-subtle`,children:[(0,F.jsx)(`td`,{className:`p-2 tabular-nums text-ink-subtle`,children:new Date(e.timestamp).toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`,second:`2-digit`})}),(0,F.jsx)(`td`,{className:`p-2`,children:(0,F.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${hU[e.type]??`bg-surface-8 text-ink-subtle`}`,children:_U(e.type)})}),(0,F.jsx)(`td`,{className:`p-2 tabular-nums text-ink-subtle`,children:gU(e.durationMs)}),(0,F.jsx)(`td`,{className:`p-2`,children:e.success?(0,F.jsx)(`span`,{className:`text-accent-green`,children:`ok`}):(0,F.jsx)(`span`,{className:`text-accent-red`,children:`fail`})})]},`${e.type}-${e.timestamp}`))})]})})]})})]})}function bU({label:e,value:t}){return(0,F.jsxs)(`div`,{className:`flex items-center gap-3 py-1.5`,children:[(0,F.jsx)(`span`,{className:`text-xs text-ink-muted w-36 shrink-0`,children:e}),(0,F.jsx)(`span`,{className:`text-xs font-mono text-ink-subtle bg-surface-3 px-2 py-0.5 rounded-md`,children:t??`—`})]})}function xU({label:e,value:t,onChange:n,placeholder:r,min:i}){return(0,F.jsxs)(`div`,{className:`flex items-center gap-3 py-1.5`,children:[(0,F.jsx)(`label`,{className:`text-xs text-ink-muted w-36 shrink-0`,children:e}),(0,F.jsx)(`input`,{type:`number`,min:i,step:`any`,value:t??``,placeholder:r??`unlimited`,onChange:e=>{let t=e.target.value;n(t===``?null:Number(t))},className:`text-xs bg-surface-3 border border-border-subtle rounded-md px-2 py-1 w-32 focus:outline-none focus:border-accent-green text-ink-base placeholder:text-ink-muted`})]})}var SU={ok:`●`,warn:`▲`,fail:`✗`,skip:`–`},CU={ok:`text-accent-green`,warn:`text-accent-amber`,fail:`text-accent-red`,skip:`text-ink-muted`};function wU(){let{data:e,isLoading:t,isError:n,refetch:r}=I({queryKey:L.diagnostics,queryFn:()=>yr(),refetchInterval:6e4,staleTime:55e3}),i=e??[],a=i.some(e=>e.status===`fail`||e.status===`warn`);return(0,F.jsxs)(R,{padding:`md`,className:`mb-4`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,F.jsx)(zr,{title:`System Health`}),(0,F.jsx)(`button`,{onClick:()=>void r(),className:`text-[10px] text-ink-muted hover:text-ink-base transition-colors`,children:`Re-check`})]}),t&&(0,F.jsx)(Li,{icon:`clock`,variant:`loading`,title:`Checking system…`}),n&&(0,F.jsx)(`div`,{className:`text-xs text-accent-red`,children:`Failed to load diagnostics.`}),!t&&!n&&!a&&(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-accent-green`,children:[(0,F.jsx)(`span`,{children:`●`}),(0,F.jsx)(`span`,{children:`System healthy`})]}),!t&&!n&&a&&(0,F.jsx)(`div`,{className:`space-y-1.5`,children:i.map(e=>(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`flex items-baseline gap-2 text-xs`,children:[(0,F.jsx)(`span`,{className:`shrink-0 ${CU[e.status]??`text-ink-muted`}`,children:SU[e.status]??`?`}),(0,F.jsx)(`span`,{className:`text-ink-muted w-36 shrink-0`,children:e.check}),(0,F.jsx)(`span`,{className:`text-ink-subtle`,children:e.detail})]}),e.fix&&(e.status===`fail`||e.status===`warn`)&&(0,F.jsxs)(`div`,{className:`ml-[1.25rem] mt-0.5 flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`text-[10px] font-mono text-ink-subtle bg-surface-3 px-1.5 py-0.5 rounded`,children:e.fix}),(0,F.jsx)(`button`,{className:`text-[10px] text-ink-muted hover:text-ink-base transition-colors`,onClick:()=>void navigator.clipboard.writeText(e.fix??``),children:`copy`})]})]},e.check))})]})}function TU(){let e=Xe(),{data:t,isLoading:n,error:r}=I({queryKey:L.settings,queryFn:()=>vr()}),[i,a]=(0,P.useState)(null),[o,s]=(0,P.useState)(void 0),[c,l]=(0,P.useState)(void 0),[u,d]=(0,P.useState)(void 0),[f,p]=(0,P.useState)(void 0),[m,h]=(0,P.useState)(void 0),[g,_]=(0,P.useState)(null),[v,y]=(0,P.useState)(null),b=dt({mutationFn:e=>br(e),onSuccess:()=>{e.invalidateQueries({queryKey:L.settings}),y(null)},onError:e=>{y(String(e))}});if(n)return(0,F.jsx)(Li,{icon:`clock`,variant:`loading`,title:`Loading...`});if(r||!t)return(0,F.jsx)(`div`,{className:`text-accent-red text-xs`,children:`Failed to load settings.`});let x=i??t.developer,S=o===void 0?t.teamId:o,C=c===void 0?t.sessionBudgetUsd:c,w=u===void 0?t.dailyBudgetUsd:u,T=f===void 0?t.weeklyBudgetUsd:f,E=m===void 0?t.retainSessionsDays:m;function D(){let e={};i!==null&&(e.developer=i),o!==void 0&&(e.teamId=o),b.mutate(e,{onSuccess:()=>{_(`identity`),setTimeout(()=>_(null),3e3)}})}function O(){let e={};c!==void 0&&(e.sessionBudgetUsd=c),u!==void 0&&(e.dailyBudgetUsd=u),f!==void 0&&(e.weeklyBudgetUsd=f),m!==void 0&&(e.retainSessionsDays=m),b.mutate(e,{onSuccess:()=>{_(`budgets`),setTimeout(()=>_(null),3e3)}})}let k=e=>g===e?(0,F.jsx)(`div`,{className:`mt-2 text-xs text-accent-amber`,children:`Saved. Restart the server for changes to take effect.`}):null;return(0,F.jsxs)(`section`,{children:[(0,F.jsx)(wU,{}),(0,F.jsxs)(`header`,{className:`mb-6`,children:[(0,F.jsx)(`h1`,{className:`text-xl font-semibold gradient-text`,children:`Settings`}),(0,F.jsx)(`p`,{className:`text-xs text-ink-muted mt-1`,children:`Changes are written to config.json on disk. Most require a server restart.`})]}),v&&(0,F.jsx)(`div`,{className:`mb-4 text-xs text-accent-red bg-accent-red/10 border border-accent-red/30 rounded-md px-3 py-2`,children:v}),(0,F.jsxs)(R,{padding:`md`,className:`mb-4`,children:[(0,F.jsx)(zr,{title:`Identity & Account`}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3 py-1.5`,children:[(0,F.jsx)(`label`,{className:`text-xs text-ink-muted w-36 shrink-0`,children:`Developer name`}),(0,F.jsx)(`input`,{type:`text`,value:x,maxLength:128,onChange:e=>a(e.target.value),className:`text-xs bg-surface-3 border border-border-subtle rounded-md px-2 py-1 w-48 focus:outline-none focus:border-accent-green text-ink-base`})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3 py-1.5`,children:[(0,F.jsx)(`label`,{className:`text-xs text-ink-muted w-36 shrink-0`,children:`Team ID`}),(0,F.jsx)(`input`,{type:`text`,value:S??``,placeholder:`optional`,onChange:e=>s(e.target.value===``?null:e.target.value),className:`text-xs bg-surface-3 border border-border-subtle rounded-md px-2 py-1 w-48 focus:outline-none focus:border-accent-green text-ink-base placeholder:text-ink-muted`})]}),(0,F.jsx)(bU,{label:`Account ID`,value:t.accountId}),(0,F.jsx)(bU,{label:`App name`,value:t.appName}),(0,F.jsx)(bU,{label:`Mode`,value:t.mode}),(0,F.jsx)(bU,{label:`Storage path`,value:t.storagePath}),(0,F.jsx)(bU,{label:`High security`,value:t.highSecurity?`enabled`:`disabled`}),(0,F.jsx)(bU,{label:`License key`,value:t.licenseKey}),(0,F.jsx)(`div`,{className:`mt-3 flex items-center gap-3`,children:(0,F.jsx)(kr,{variant:`primary`,size:`md`,onClick:D,disabled:b.isPending,loading:b.isPending,children:b.isPending?`Saving…`:`Save identity`})}),k(`identity`)]}),(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Cost & Retention`,subtitle:`Budget caps trigger warnings at 50%, 80%, and 100%. Leave blank for no limit.`}),(0,F.jsx)(xU,{label:`Session budget (USD)`,value:C,onChange:l,min:.01}),(0,F.jsx)(xU,{label:`Daily budget (USD)`,value:w,onChange:d,min:.01}),(0,F.jsx)(xU,{label:`Weekly budget (USD)`,value:T,onChange:p,min:.01}),(0,F.jsx)(xU,{label:`Retain sessions (days)`,value:E,onChange:h,placeholder:`forever`,min:1}),(0,F.jsx)(`div`,{className:`mt-3 flex items-center gap-3`,children:(0,F.jsx)(kr,{variant:`primary`,size:`md`,onClick:O,disabled:b.isPending,loading:b.isPending,children:b.isPending?`Saving…`:`Save budgets`})}),k(`budgets`)]})]})}function EU({pct:e,exceeded:t}){let n=e??0;return(0,F.jsx)(`div`,{className:`w-24 h-1.5 bg-surface-5 rounded-full overflow-hidden`,children:(0,F.jsx)(`div`,{className:`h-full rounded-full ${t?`bg-accent-red`:n>=80?`bg-accent-amber`:`bg-accent-green`}`,style:{width:`${Math.min(n,100)}%`}})})}function DU({label:e,p:t}){return(0,F.jsxs)(`div`,{className:`flex items-center gap-3 py-1.5`,children:[(0,F.jsx)(`span`,{className:`text-xs text-ink-muted w-20 shrink-0 capitalize`,children:e}),(0,F.jsx)(EU,{pct:t.pctUsed,exceeded:t.exceeded}),(0,F.jsxs)(`span`,{className:`text-xs tabular-nums text-ink-base`,children:[`$`,t.spentUsd.toFixed(4),t.budgetUsd===null?``:` / $${t.budgetUsd.toFixed(2)}`,t.pctUsed===null?``:` (${t.pctUsed.toFixed(0)}%)`]}),t.exceeded&&(0,F.jsx)(Nr,{tone:`danger`,size:`sm`,children:`exceeded`})]})}function OU(){let e=Xe(),t=I({queryKey:L.budget,queryFn:()=>nr(),refetchInterval:1e4}),n=I({queryKey:L.settings,queryFn:()=>vr()}),r=t.data,i=n.data,[a,o]=(0,P.useState)({}),[s,c]=(0,P.useState)(!1),[l,u]=(0,P.useState)(void 0),[d,f]=(0,P.useState)(null),[p,m]=(0,P.useState)(null),h=dt({mutationFn:e=>br(e),onSuccess:()=>void e.invalidateQueries({queryKey:L.settings})}),g=dt({mutationFn:()=>xr(),onSuccess:e=>{let t=e.content?.[0]?.text??``;try{let e=JSON.parse(t);m(e.ok?`Digest sent.`:e.error??`Failed to send.`)}catch{m(`Done.`)}setTimeout(()=>m(null),4e3)},onError:e=>{m(`Error: ${String(e)}`)}});function _(){Object.keys(a).length!==0&&h.mutate({alerts:{personal:a}},{onSuccess:()=>{c(!0),setTimeout(()=>c(!1),3e3)}})}function v(){let e={};l!==void 0&&(e.digestWebhookUrl=l),d!==null&&(e.digestSchedule=d??i?.digestSchedule),h.mutate(e)}function y(e){return a[e]??i?.alerts.personal[e]??0}function b(e,t,n={}){return(0,F.jsxs)(`div`,{className:`flex items-center gap-3 py-1.5`,children:[(0,F.jsx)(`label`,{className:`text-xs text-ink-muted w-44 shrink-0`,children:e}),(0,F.jsx)(`input`,{type:`number`,value:y(t),min:n.min,max:n.max,step:n.step??`any`,onChange:e=>o(n=>({...n,[t]:Number(e.target.value)})),className:`text-xs bg-surface-3 border border-border-subtle rounded-md px-2 py-1 w-24 focus:outline-none focus:border-accent-green text-ink-base`})]})}return(0,F.jsxs)(`section`,{children:[(0,F.jsx)(`header`,{className:`mb-6`,children:(0,F.jsx)(`h1`,{className:`text-xl font-semibold gradient-text`,children:`Alerts`})}),(0,F.jsxs)(R,{padding:`md`,className:`mb-4`,children:[(0,F.jsx)(zr,{title:`Budget Status`}),t.isLoading&&(0,F.jsx)(Li,{icon:`clock`,variant:`loading`,title:`Loading...`}),r&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(DU,{label:`session`,p:r.session}),(0,F.jsx)(DU,{label:`daily`,p:r.daily}),(0,F.jsx)(DU,{label:`weekly`,p:r.weekly}),r.alerts.length>0&&(0,F.jsxs)(`div`,{className:`mt-3 border-t border-border-subtle pt-3`,children:[(0,F.jsx)(z,{className:`mb-2`,children:`Recent Warnings`}),(0,F.jsx)(`div`,{className:`flex flex-col gap-1`,children:r.alerts.slice(-5).reverse().map((e,t)=>(0,F.jsxs)(`div`,{className:`text-xs text-ink-subtle flex gap-2`,children:[(0,F.jsxs)(`span`,{className:`text-accent-amber tabular-nums`,children:[e.thresholdPct,`%`]}),(0,F.jsx)(`span`,{className:`capitalize`,children:e.period}),(0,F.jsxs)(`span`,{className:`text-ink-muted tabular-nums`,children:[`$`,e.spentUsd.toFixed(4),` / $`,e.budgetUsd.toFixed(2)]}),(0,F.jsx)(`span`,{className:`text-ink-muted ml-auto tabular-nums`,children:new Date(e.timestamp).toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})})]},t))})]}),r.alerts.length===0&&r.session.budgetUsd===null&&r.daily.budgetUsd===null&&r.weekly.budgetUsd===null&&(0,F.jsxs)(`p`,{className:`text-xs text-ink-muted mt-2`,children:[`No budget caps configured.`,` `,(0,F.jsx)(Qt,{href:`/settings`,className:`text-accent-cyan hover:underline transition-colors duration-150`,children:`Set limits in Settings`}),` `,`to enable warnings.`]})]})]}),(0,F.jsxs)(R,{padding:`md`,className:`mb-4`,children:[(0,F.jsx)(zr,{title:`Alert Thresholds`,subtitle:"Thresholds used by the `deploy-alerts` CLI (`npm run deploy:alerts`) when templating cloud alert conditions. Have no effect on this dashboard or any running session."}),n.isLoading&&(0,F.jsx)(Li,{icon:`clock`,variant:`loading`,title:`Loading...`}),i&&(0,F.jsxs)(F.Fragment,{children:[b(`Daily cost ($)`,`dailyCostUsd`,{min:0,step:.1}),b(`Session cost ($)`,`sessionCostUsd`,{min:0,step:.1}),b(`Min efficiency score (0–1)`,`efficiencyScoreMin`,{min:0,max:1,step:.05}),b(`Max anti-patterns`,`antiPatternCountMax`,{min:0,step:1}),b(`Max stuck loops`,`stuckLoopCountMax`,{min:0,step:1}),(0,F.jsxs)(`div`,{className:`mt-3 flex items-center gap-3`,children:[(0,F.jsx)(kr,{variant:`primary`,size:`md`,onClick:_,disabled:h.isPending||Object.keys(a).length===0,loading:h.isPending,children:h.isPending?`Saving…`:`Save thresholds`}),s&&(0,F.jsx)(`span`,{className:`text-xs text-accent-amber`,children:"Saved. Run `npm run deploy:alerts` to apply these to your cloud alert conditions."})]})]})]}),(0,F.jsxs)(R,{padding:`md`,children:[(0,F.jsx)(zr,{title:`Slack Digest`,subtitle:`Weekly digest sent to a Slack incoming webhook. URL changes take effect immediately.`}),i&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`flex items-center gap-2 mb-3`,children:(0,F.jsx)(Nr,{tone:i.digestWebhookUrl?`success`:`neutral`,size:`sm`,children:i.digestWebhookUrl?`Configured`:`Not configured`})}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3 py-1.5`,children:[(0,F.jsx)(`label`,{className:`text-xs text-ink-muted w-28 shrink-0`,children:`Webhook URL`}),(0,F.jsx)(`input`,{type:`url`,value:l===void 0?i.digestWebhookUrl??``:l??``,placeholder:`https://hooks.slack.com/...`,onChange:e=>u(e.target.value===``?null:e.target.value),className:`text-xs bg-surface-3 border border-border-subtle rounded-md px-2 py-1 w-72 focus:outline-none focus:border-accent-green text-ink-base placeholder:text-ink-muted`})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3 py-1.5`,children:[(0,F.jsxs)(`label`,{className:`text-xs text-ink-muted w-28 shrink-0`,children:[`Schedule`,(0,F.jsx)(`span`,{className:`block text-[10px] text-ink-muted font-normal`,children:`(cron, restart req.)`})]}),(0,F.jsx)(`input`,{type:`text`,value:d??i.digestSchedule,onChange:e=>f(e.target.value),className:`text-xs bg-surface-3 border border-border-subtle rounded-md px-2 py-1 w-36 focus:outline-none focus:border-accent-green text-ink-base font-mono`}),(0,F.jsx)(`span`,{className:`text-[10px] text-ink-muted`,children:`default: Mon 9am`})]}),(0,F.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 flex-wrap`,children:[(0,F.jsx)(kr,{variant:`primary`,size:`md`,onClick:v,disabled:h.isPending,loading:h.isPending,children:h.isPending?`Saving…`:`Save`}),i.digestWebhookUrl&&(0,F.jsx)(kr,{variant:`danger`,size:`md`,onClick:()=>h.mutate({digestWebhookUrl:null},{onSuccess:()=>u(void 0)}),disabled:h.isPending,children:`Unsubscribe`}),(0,F.jsx)(kr,{variant:`secondary`,size:`md`,onClick:()=>g.mutate(),disabled:g.isPending||!i.digestWebhookUrl,loading:g.isPending,children:g.isPending?`Sending…`:`Send test now`}),p&&(0,F.jsx)(`span`,{className:`text-xs text-ink-subtle`,children:p})]})]})]})]})}function kU(){mi();let e=zn(e=>e.connected),[t,n]=Kt(),[r,i]=(0,P.useState)(!1),{theme:a,toggleTheme:o}=yi(),s=(0,P.useCallback)(()=>i(e=>!e),[]),c=(0,P.useCallback)(()=>i(!1),[]);return hi({navigate:n,onToggleHelp:s,onToggleTheme:o}),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`flex flex-col h-full mesh-bg`,children:[(0,F.jsx)(si,{}),(0,F.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,F.jsx)(Wr,{currentPath:t,onNavigate:n,connected:e,theme:a,onToggleTheme:o}),(0,F.jsx)(`main`,{className:`flex-1 overflow-auto p-6`,children:(0,F.jsx)(ci,{resetKey:t,children:(0,F.jsxs)(en,{children:[(0,F.jsx)(Zt,{path:`/sessions`,component:$a}),(0,F.jsx)(Zt,{path:`/history`,component:ZH}),(0,F.jsx)(Zt,{path:`/audit`,component:dU}),(0,F.jsx)(Zt,{path:`/git`,component:yU}),(0,F.jsx)(Zt,{path:`/settings`,component:TU}),(0,F.jsx)(Zt,{path:`/alerts`,component:OU}),(0,F.jsx)(Zt,{path:`/`,component:wa}),(0,F.jsx)(Zt,{children:(0,F.jsx)(`div`,{className:`text-ink-muted`,children:`Not found`})})]})})})]})]}),(0,F.jsx)(ui,{open:r,onClose:c})]})}var AU=new ze({defaultOptions:{queries:{staleTime:5e3,retry:0,refetchOnWindowFocus:!1}}}),jU=document.getElementById(`root`);if(!jU)throw Error(`Mount node #root not found`);(0,ft.createRoot)(jU).render((0,F.jsx)(P.StrictMode,{children:(0,F.jsx)(Ze,{client:AU,children:(0,F.jsx)(kU,{})})}));